summaryrefslogtreecommitdiffstats
path: root/dom/canvas/test/webgl-conf/checkout/deqp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /dom/canvas/test/webgl-conf/checkout/deqp
parentInitial commit. (diff)
downloadfirefox-esr-upstream.tar.xz
firefox-esr-upstream.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/canvas/test/webgl-conf/checkout/deqp')
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/00_test_list.txt7
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/LICENSE202
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/README.md21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/build.py264
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/compiler_additional_extern.js94
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/00_test_list.txt31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conditionals.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conditionals.test333
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constant_expressions.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constant_expressions.test288
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constants.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constants.test662
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions.template36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions.test5930
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_matrix_combine.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_matrix_combine.test553
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_matrix_to_matrix.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_matrix_to_matrix.test206
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_scalar_to_matrix.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_scalar_to_matrix.test206
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_scalar_to_scalar.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_scalar_to_scalar.test206
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_scalar_to_vector.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_scalar_to_vector.test602
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_combine.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_combine.test1844
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_illegal.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_illegal.test548
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_to_scalar.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_to_scalar.test602
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_to_vector.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_to_vector.test1196
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/declarations.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/declarations.test140
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/fragdata.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/fragdata.test76
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/functions.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/functions.test3475
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/invalid_texture_functions.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/invalid_texture_functions.test90
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/keywords.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/keywords.test1613
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/linkage.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/linkage.test1715
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/preprocessor.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/preprocessor.test4287
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/qualification_order.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/qualification_order.test785
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/reserved_operators.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/reserved_operators.test250
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/scoping.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/scoping.test823
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/shader-lib-test.html462
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/split-conversions.js33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/split-swizzles.js47
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles.template36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles.test6811
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_bvec2.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_bvec2.test469
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_bvec3.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_bvec3.test865
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_bvec4.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_bvec4.test1063
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_ivec2.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_ivec2.test469
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_ivec3.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_ivec3.test865
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_ivec4.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_ivec4.test1063
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_vec2.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_vec2.test469
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_vec3.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_vec3.test865
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_vec4.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_vec4.test1063
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/template.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/00_test_list.txt33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/arrays.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/arrays.test1962
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conditionals.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conditionals.test381
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constant_expressions.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constant_expressions.test483
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constants.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constants.test1153
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions.template25
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions.test14246
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_matrix_combine.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_matrix_combine.test1887
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_matrix_to_matrix.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_matrix_to_matrix.test1952
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_scalar_to_matrix.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_scalar_to_matrix.test872
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_scalar_to_scalar.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_scalar_to_scalar.test392
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_scalar_to_vector.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_scalar_to_vector.test1160
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_combine.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_combine.test3480
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_illegal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_illegal.test1064
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_to_scalar.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_to_scalar.test1160
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_to_vector.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_to_vector.test2312
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/declarations.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/declarations.test591
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/fragdata.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/fragdata.test76
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/functions.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/functions.test4345
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/invalid_texture_functions.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/invalid_texture_functions.test1143
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/keywords.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/keywords.test3219
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/linkage.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/linkage.test3833
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/negative.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/negative.test100
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/preprocessor.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/preprocessor.test5256
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/qualification_order.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/qualification_order.test2714
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/scoping.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/scoping.test901
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/split-conversions.js33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/split-swizzles.js47
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/switch.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/switch.test633
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles.template36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles.test7459
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_bvec2.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_bvec2.test511
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_bvec3.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_bvec3.test943
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_bvec4.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_bvec4.test1159
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_ivec2.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_ivec2.test511
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_ivec3.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_ivec3.test943
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_ivec4.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_ivec4.test1159
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_vec2.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_vec2.test511
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_vec3.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_vec3.test943
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_vec4.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_vec4.test1159
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/template.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/deqp-deps.js141
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuBilinearImageCompare.js272
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuCompressedTexture.js967
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuFloat.js862
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuFloatFormat.js349
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuFuzzyImageCompare.js338
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuImageCompare.js757
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuInterval.js609
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuLogImage.js163
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuMatrix.js354
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuMatrixUtil.js70
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuPixelFormat.js79
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuRGBA.js279
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuSkipList.js245
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuStringTemplate.js42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuSurface.js184
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTestCase.js491
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexCompareVerifier.js1356
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexLookupVerifier.js2225
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexVerifierUtil.js265
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexture.js3636
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTextureUtil.js725
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deMath.js1143
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deRandom.js260
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deString.js111
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deUtil.js90
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluDrawUtil.js510
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluObjectWrapper.js117
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluPixelTransfer.js55
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluShaderProgram.js488
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluShaderUtil.js795
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluStrUtil.js166
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluTexture.js380
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluTextureUtil.js1025
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluVarType.js814
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluVarTypeUtil.js693
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/00_test_list.txt1
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/referencecontext.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrGLContext.js231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrReferenceContext.js4986
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrReferenceContextTest.js834
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrReferenceUtils.js317
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrShaderProgram.js336
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrDefs.js72
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrFragmentOperations.js583
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrGenericVector.js54
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrMultisamplePixelBufferAccess.js190
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrRenderState.js323
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrRenderer.js1274
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrShaders.js123
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrShadingContext.js113
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrUtil.js115
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrVertexAttrib.js641
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrVertexPacket.js101
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/00_test_list.txt80
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/attriblocation.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/booleanstatequery.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/buffercopy.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/bufferobjectquery.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/00_test_list.txt55
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/abs.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/acos.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/acosh.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/add.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/asin.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/asinh.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/atan.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/atan2.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/atanh.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/builtinprecision_test_generator.py143
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/ceil.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/clamp.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/cos.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/cosh.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/cross.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/degrees.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/determinant.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/distance.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/div.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/dot.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/exp.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/exp2.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/faceforward.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/floor.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/fract.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/inverse.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/inversesqrt.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/length.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/log.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/log2.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/matrixcompmult.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/max.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/min.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/mix.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/mod.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/modf.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/mul.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/normalize.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/outerproduct.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/pow.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/radians.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/reflect.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/refract.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/round.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/roundeven.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sign.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sin.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sinh.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/smoothstep.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sqrt.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/step.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sub.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/tan.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/tanh.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/transpose.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/trunc.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/clipping.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/defaultvertexattribute.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/00_test_list.txt7
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_arrays.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_arrays_instanced.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_elements.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_elements_instanced.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_range_elements.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_test_generator.py89
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/instancing.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/random.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fApiCase.js161
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fAttribLocationTests.js267
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBooleanStateQuery.js372
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBufferCopyTests.js355
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBufferObjectQueryTests.js177
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBuiltinPrecisionTests.js87
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fClippingTests.js406
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fDefaultVertexAttributeTests.js546
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fDrawTests.js1155
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboColorbufferTests.js1049
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboCompletenessTests.js567
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboDepthbufferTests.js385
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboInvalidateTests.js1471
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboMultisampleTests.js377
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboRenderTest.js2389
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboStateQueryTests.js796
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboStencilbufferTests.js325
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboTestCase.js483
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboTestUtil.js1324
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFloatStateQueryTests.js431
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFragDepthTests.js593
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFragmentOutputTests.js1398
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFramebufferBlitTests.js1261
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fIndexedStateQueryTests.js409
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fInstancedRenderingTests.js711
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fIntegerStateQueryTests.js2049
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fInternalFormatQueryTests.js173
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fLifetimeTests.js471
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fMultisampleTests.js1744
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeBufferApiTests.js1104
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeFragmentApiTests.js339
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeShaderApiTests.js1195
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeStateApiTests.js927
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeTextureApiTests.js3002
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeVertexArrayApiTests.js906
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fOcclusionQueryTests.js511
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fPixelBufferObjectTest.js585
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fPrimitiveRestartTests.js709
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fRasterizerDiscardTests.js485
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fRboStateQueryTests.js308
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fReadPixelTests.js517
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fSamplerObjectTests.js313
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fSamplerStateQueryTests.js205
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderApiTests.js650
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderBuiltinVarTests.js1109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderCommonFunctionTests.js1973
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderDerivateTests.js1696
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderIndexingTests.js1278
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderLoopTests.js1251
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderMatrixTest.js1852
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderOperatorTests.js3252
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderPackingFunctionTests.js791
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderPrecisionTests.js947
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderStateQueryTests.js2205
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderStructTests.js1957
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderSwitchTests.js492
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderTextureFunctionTests.js2709
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fStringQueryTests.js111
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fSyncTests.js330
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureFilteringTests.js2282
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureFormatTests.js1185
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureShadowTests.js898
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureSpecificationTests.js7456
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureStateQuery.js376
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureWrapTests.js434
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTransformFeedbackTests.js1914
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fUniformApiTests.js3203
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fUniformBlockTests.js748
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fVertexArrayObjectTests.js875
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fVertexArrayTests.js1103
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/00_test_list.txt26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/blend.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/clear.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/fbocolorbuffer_test_generator.py116
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_00.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_01.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_02.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_03.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_04.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_05.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_00.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_01.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_02.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_03.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_04.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_05.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_00.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_01.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_02.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_03.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_04.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_05.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_00.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_01.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_02.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_03.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_04.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_05.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocompleteness.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbodepthbuffer.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/00_test_list.txt7
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/default.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/fboinvalidate_test_generator.py114
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/format_00.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/format_01.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/format_02.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/sub.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/target.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/whole.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbomultisample.2_samples.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbomultisample.4_samples.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbomultisample.8_samples.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/00_test_list.txt18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/fborender_test_generator.py117
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_04.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_05.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_06.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_depth_stencil.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_clear.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_depth_stencil.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/stencil_clear.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbostatequery.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbostencilbuffer.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/floatstatequery.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragdepth.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/00_test_list.txt11
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.fixed.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.float.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.int.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.uint.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.fixed.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.float.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.int.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.uint.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/fragmentoutput_test_generator.py93
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/random_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/random_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/random_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/00_test_list.txt50
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_04.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_05.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_06.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_07.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_08.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_09.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_10.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_11.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_12.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_13.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_14.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_15.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_16.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_17.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_18.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_19.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_20.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_21.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_22.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_23.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_24.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_25.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_26.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_27.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_28.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_29.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_30.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_31.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_32.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_33.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_34.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_04.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_05.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_06.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/depth_stencil.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/frambufferblit_test_generator.py111
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_04.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_05.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_06.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/indexedstatequery.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/instancedrendering.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/integerstatequery.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/internalformatquery.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/lifetime.html34
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/multisample/00_test_list.txt6
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/multisample/default_fbo.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/multisample/fbo_4_samples.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/multisample/fbo_8_samples.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/multisample/fbo_max_samples.html31
-rwxr-xr-xdom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/multisample/multisample_test_generator.py98
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativebufferapi.html30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativefragmentapi.html23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativeshaderapi.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativestateapi.html23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativetextureapi.html30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativevertexarrayapi.html30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/occlusionquery_conservative.html26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/occlusionquery_strict.html26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/pixelbufferobject.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/00_test_list.txt8
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/04.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/05.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/06.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/07.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/primitiverestart_test_generator.py84
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/rasterizerdiscard.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/rbostatequery.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/readpixel.html26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/samplerobject.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/samplerstatequery.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderapi.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderbuiltinvar.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadercommonfunction.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderderivate_dfdx.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderderivate_dfdy.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderderivate_fwidth.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/00_test_list.txt9
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/mat_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/mat_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/mat_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/shaderindexing_test_generator.py97
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/tmp.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/uniform.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/varying.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/vec2.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/vec3.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/vec4.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderloop_do_while.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderloop_for.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderloop_while.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/00_test_list.txt33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_assign.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_const.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_dynamic.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_uniform.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/determinant.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_assign.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_const.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_dynamic.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_uniform.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/inverse.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/matrixcompmult.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_assign.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_const_highp.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_const_lowp.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_const_mediump.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_dynamic_highp.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_dynamic_lowp.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_dynamic_mediump.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_uniform_highp.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_uniform_lowp.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_uniform_mediump.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/negation.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/outerproduct.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/post_decrement.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/post_increment.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/pre_decrement.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/pre_increment.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/shadermatrix_test_generator.py121
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_assign.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_const.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_dynamic.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_uniform.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/transpose.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/unary_addition.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/00_test_list.txt37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_00.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_01.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_02.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_03.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_00.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_01.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_02.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_03.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_04.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_05.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_06.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_07.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_08.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_09.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_10.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_11.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_12.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_13.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_14.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_15.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/bool_compare.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions_00.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions_01.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions_02.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions_03.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions_04.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions_05.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions_06.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/exponential.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/float_compare.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/geometric.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/int_compare.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/selection.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/sequence.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/shaderoperator_test_generator.py127
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/unary_operator_00.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/unary_operator_01.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/unary_operator_02.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderpackingfunction.html26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderprecision_float.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderprecision_int.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderprecision_uint.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderstatequery.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderstruct.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderswitch.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/00_test_list.txt15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/shadertexturefunction_test_generator.py103
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texelfetch.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texelfetchoffset.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texture.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturegrad.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturegradoffset.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturelod.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturelodoffset.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureoffset.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureproj.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojgrad.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojgradoffset.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojlod.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojlodoffset.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojoffset.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturesize.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/stringquery.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/sync.html32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/00_test_list.txt116
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_04.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_05.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_04.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_05.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_06.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_07.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_08.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_09.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_04.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_04.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_05.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_04.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_05.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_06.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_07.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_08.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_09.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_04.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_05.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_04.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_05.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_06.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_07.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_08.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_09.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_10.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_11.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_12.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_13.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_14.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_15.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_16.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_17.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_18.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_19.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_20.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_21.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_22.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_23.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_24.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_25.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_26.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_27.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_28.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_29.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_30.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_31.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_32.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_33.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_34.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_35.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_04.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_05.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_06.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_07.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_08.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_09.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_04.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_04.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_05.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_04.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_05.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_06.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_07.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_08.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_09.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_no_edges_visible.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_04.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/texturefiltering_test_generator.py138
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/00_test_list.txt38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/compressed_2d.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/compressed_cube.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_depth_stencil.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/textureformat_test_generator.py126
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/unsized_2d.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/unsized_2d_array.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/unsized_3d.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/00_test_list.txt144
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_always.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_greater.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_greater_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_less.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_less_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_always.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_greater.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_greater_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_less.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_less_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_never.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_not_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_always.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_greater.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_greater_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_less.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_less_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_never.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_not_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_never.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_not_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_always.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_greater.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_greater_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_less.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_less_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_always.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_greater.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_greater_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_less.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_less_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_never.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_not_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_always.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_greater.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_greater_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_less.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_less_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_never.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_not_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_never.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_not_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_always.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_greater.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_greater_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_less.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_less_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_always.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_greater.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_greater_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_less.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_less_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_never.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_not_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_always.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_greater.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_greater_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_less.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_less_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_never.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_not_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_never.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_not_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_always.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_greater.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_greater_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_less.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_less_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_always.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_greater.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_greater_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_less.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_less_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_never.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_not_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_always.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_greater.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_greater_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_less.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_less_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_never.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_not_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_never.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_not_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_always.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_greater.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_greater_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_less.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_less_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_always.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_greater.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_greater_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_less.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_less_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_never.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_not_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_always.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_greater.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_greater_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_less.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_less_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_never.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_not_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_never.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_not_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_always.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_greater.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_greater_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_less.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_less_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_always.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_greater.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_greater_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_less.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_less_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_never.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_not_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_always.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_greater.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_greater_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_less.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_less_or_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_never.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_not_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_never.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_not_equal.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/textureshadow_test_generator.py116
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/00_test_list.txt90
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_copyteximage2d.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_copytexsubimage2d.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_2d_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_2d_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_04.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_2d_array_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_2d_array_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_2d_array_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_04.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_2d_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_2d_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_2d_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_04.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_04.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/random_teximage2d_2d.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/random_teximage2d_cube.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_align.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_depth.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_depth_pbo.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_2d_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_2d_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_04.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_params.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_unpack_params.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_depth.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_depth_pbo.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_2d_array_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_2d_array_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_3d_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_3d_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_params.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_unpack_params.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_2d_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_2d_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_2d_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_04.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_depth_stencil.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_size.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_2d_array_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_2d_array_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_2d_array_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_depth_stencil.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_size.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_align.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_depth.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_empty_tex.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_2d_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_2d_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_02.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_03.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_04.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_params.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_unpack_params.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_depth.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_2d_array_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_2d_array_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_3d_00.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_3d_01.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_params.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_unpack_params.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texturespecification_test_generator.py178
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturestatequery.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/00_test_list.txt22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_r11_npot.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_r11_pot.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_rg11_npot.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_rg11_pot.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_r11_npot.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_r11_pot.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_rg11_npot.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_rg11_pot.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_rgba8_npot.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_rgba8_pot.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_srgb8_alpha8_npot.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_srgb8_alpha8_pot.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_npot.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_pot.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_punchthrough_alpha1_npot.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_punchthrough_alpha1_pot.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_npot.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_pot.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_punchthrough_alpha1_npot.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_punchthrough_alpha1_pot.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/rgba8_npot.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/rgba8_pot.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/texturewrap_test_generator.py110
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/00_test_list.txt29
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_interleaved_lines.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_interleaved_points.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_interleaved_triangles.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_separate_lines.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_separate_points.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_separate_triangles.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_interleaved_lines.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_interleaved_points.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_interleaved_triangles.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_separate_lines.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_separate_points.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_separate_triangles.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_interleaved_lines.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_interleaved_points.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_interleaved_triangles.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_separate_lines.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_separate_points.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_separate_triangles.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/interpolation_centroid.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/interpolation_flat.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/interpolation_smooth.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/point_size.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/position.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_interleaved_lines.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_interleaved_points.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_interleaved_triangles.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_separate_lines.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_separate_points.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_separate_triangles.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/transformfeedback_test_generator.py118
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/00_test_list.txt4
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/info_query.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/random.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/uniformapi_test_generator.py92
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/value_assigned.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/value_initial.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/00_test_list.txt10
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/instance_array_basic_type.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/multi_basic_types.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/multi_nested_struct.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/random.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_basic_array.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_basic_type.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_nested_struct.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_nested_struct_array.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_struct.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_struct_array.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/uniformbuffers_test_generator.py98
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrayobject.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/00_test_list.txt27
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.count.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.output.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.storage.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.stride.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.first.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.normalize.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.offset.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.byte.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.float.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.half.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.int.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.int_2_10_10_10.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.short.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_byte.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_int.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_int_2_10_10_10.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_short.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.stride.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.dynamic_copy.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.dynamic_draw.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.dynamic_read.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.static_copy.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.static_draw.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.static_read.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.stream_copy.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.stream_draw.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.stream_read.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/vertexarrays_test_generator.py110
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/genHTMLfromTest.py43
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsAttributeLocationTests.js1477
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsBufferTestUtil.js1068
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsBuiltinPrecisionTests.js5415
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsBuiltinPrecisionTestsUnitTests.js2819
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsDrawTests.js3452
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsFboCompletenessTests.js961
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsFboUtil.js1413
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsLifetimeTests.js1118
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsRandomUniformBlockCase.js282
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsSamplerObjectTest.js1148
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderExecUtil.js731
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderLibrary.js1114
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderLibraryCase.js1132
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderRenderCase.js1200
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsStateQuery.js367
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsTextureTestUtil.js2642
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsUniformBlockCase.js2451
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsVertexArrayTests.js2534
-rwxr-xr-xdom/canvas/test/webgl-conf/checkout/deqp/run-closure.sh26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/chrome.js156
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/deprecated.js46
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es3.js2236
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es5.js269
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es6.js856
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es6_collections.js253
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/fileapi.js961
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/flash.js210
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_css.js126
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_dom.js1120
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_event.js62
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_xml.js73
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/google.js30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/html5.js3231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_css.js267
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_dom.js1395
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_event.js309
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_vml.js77
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/intl.js163
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/iphone.js362
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/mediasource.js142
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/page_visibility.js32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/v8.js125
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_anim_timing.js191
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_css.js2505
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_css3d.js199
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_device_sensor_event.js101
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_dom1.js874
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_dom2.js2619
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_dom3.js854
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_elementtraversal.js56
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_encoding.js54
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_event.js372
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_event3.js63
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_geolocation.js101
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_indexeddb.js914
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_navigation_timing.js161
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_range.js248
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_rtc.js1002
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_selectors.js94
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_xml.js417
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_css.js456
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_dom.js281
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_event.js48
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_notifications.js201
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webstorage.js148
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/window.js191
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/test-webgl2.js4
-rwxr-xr-xdom/canvas/test/webgl-conf/checkout/deqp/test-webgl2.sh60
-rw-r--r--dom/canvas/test/webgl-conf/checkout/deqp/webgl2.js5520
1206 files changed, 312574 insertions, 0 deletions
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/00_test_list.txt
new file mode 100644
index 0000000000..32ec5067a6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/00_test_list.txt
@@ -0,0 +1,7 @@
+// files that end in .txt list other tests
+// other lines are assumed to be .html files
+
+--min-version 1.0.4 --max-version 1.9.9 data/gles2/shaders/00_test_list.txt
+--min-version 2.0.0 data/gles3/shaders/00_test_list.txt
+--min-version 2.0.0 framework/opengl/simplereference/00_test_list.txt
+--min-version 2.0.0 functional/gles3/00_test_list.txt
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/LICENSE b/dom/canvas/test/webgl-conf/checkout/deqp/LICENSE
new file mode 100644
index 0000000000..0a93ef7186
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/README.md b/dom/canvas/test/webgl-conf/checkout/deqp/README.md
new file mode 100644
index 0000000000..bdaf88f050
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/README.md
@@ -0,0 +1,21 @@
+DEQP tests for WebGL
+===========================================
+
+1. Running
+Tests can be run as part of the WebGL Conformance suite or individually
+by navigating to one of pages in functional/gles3 or in data/gles(2|3)/shaders/
+
+2. Filtering
+One can limit the tests to run with a 'filter' query. For example:
+
+functional/gles3/textureformat.html?filter=2d
+
+will executed only the tests with '2d' in the test name.
+Filter query accepts a regular expression.
+
+3. Compiling.
+The tests have been annotated for closure and can be compiled with run-closure script.
+
+4. Implementation notes.
+Tests use a minimal subset of google closure library for dependency management.
+The closure compiler is used solely for error checking. The compiler output is discarded.
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/build.py b/dom/canvas/test/webgl-conf/checkout/deqp/build.py
new file mode 100644
index 0000000000..7f452c634a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/build.py
@@ -0,0 +1,264 @@
+#!/usr/bin/env python2
+
+# Copyright (c) 2019 The Khronos Group Inc.
+# Use of this source code is governed by an MIT-style license that can be
+# found in the LICENSE.txt file.
+
+# Author: Mobica LTD
+
+import sys
+import re
+import os
+import subprocess
+import threading
+from sys import stdout, stderr, argv
+
+# Running this script
+# 1. To rebuild all dependencies:
+# $ build.py deps
+# 2. To build all targets without rebuilding dependencies
+# $ build.py build
+# 3. To build a single target without rebuilding dependencies
+# $ build.py build <target>
+# See the table below for available targets
+# 4. To rebuild all dependencies and targets
+# $ build.py
+# 5. To build dependencies for a single target
+# $ build.py deps <target>
+# 6. To build dependencies for and compile a single target
+# $ build.py <target>
+
+# List of targets (short target name, closure namespace)
+targets = {
+ 'textureformat': 'functional.gles3.es3fTextureFormatTests',
+ 'fboCompletenessTests': 'functional.gles3.es3fFboCompletenessTests',
+ 'fbomultisampletests': 'functional.gles3.es3fFboMultisampleTests',
+ 'fbostencilbuffertests': 'functional.gles3.es3fFboStencilbufferTests',
+ 'fragmentoutput': 'functional.gles3.es3fFragmentOutputTests',
+ 'framebufferblittests': 'functional.gles3.es3fFramebufferBlitTests',
+ 'instancedrenderingtests': 'functional.gles3.es3fInstancedRenderingTests',
+ 'pixelBufferObjectTest': 'functional.gles3.es3fPixelBufferObjectTest',
+ 'primitiverestarttests': 'functional.gles3.es3fPrimitiveRestartTests',
+ 'samplerobjecttests': 'functional.gles3.es3fSamplerObjectTests',
+ 'transformFeedbackTests': 'functional.gles3.es3fTransformFeedbackTests',
+ 'uniformapi': 'functional.gles3.es3fUniformApiTests',
+ 'uniformbuffers': 'functional.gles3.es3fUniformBlockTests',
+ 'vertexarrays': 'functional.gles3.es3fVertexArrayTests',
+ 'shaderlibrary': 'modules.shared.glsShaderLibrary',
+ 'negativebuffer': 'functional.gles3.es3fNegativeBufferApiTests',
+ 'sglrReferenceContextTest': 'framework.opengl.simplereference.sglrReferenceContextTest',
+ 'lifetime': 'functional.gles3.es3fLifetimeTests',
+ 'draw': 'functional.gles3.es3fDrawTests',
+ 'attriblocation': 'functional.gles3.es3fAttribLocationTests',
+ 'textureShadowTests': 'functional.gles3.es3fTextureShadowTests',
+ 'texturewrap': 'functional.gles3.es3fTextureWrapTests',
+ 'negativetextureapi': 'functional.gles3.es3fNegativeTextureApiTests',
+ 'multisample': 'functional.gles3.es3fMultisampleTests',
+ 'negativefragmentapi': 'functional.gles3.es3fNegativeFragmentApiTests',
+ 'negativevertexarrayapi': 'functional.gles3.es3fNegativeVertexArrayApiTests',
+ 'negativestateapi' : 'functional.gles3.es3fNegativeStateApiTests',
+ 'negativeshaderapi' : 'functional.gles3.es3fNegativeShaderApiTests',
+ 'rasterizerdiscard' : 'functional.gles3.es3fRasterizerDiscardTests',
+ 'buffercopy' : 'functional.gles3.es3fBufferCopyTests',
+ 'shaderindexing' : 'functional.gles3.es3fShaderIndexingTests',
+ 'shaderloop' : 'functional.gles3.es3fShaderLoopTests',
+ 'shaderstruct' : 'functional.gles3.es3fShaderStructTests',
+ 'shaderswitch' : 'functional.gles3.es3fShaderSwitchTests',
+ 'fborender' : 'functional.gles3.es3fFboRenderTest',
+ 'shaderderivate' : 'functional.gles3.es3fShaderDerivateTests',
+ 'builtinprecision' : 'functional.gles3.es3fBuiltinPrecisionTests',
+ 'shaderbuiltinvar' : 'functional.gles3.es3fShaderBuiltinVarTests',
+ 'texturefiltering' : 'functional.gles3.es3fTextureFilteringTests',
+ 'fbocolor' : 'functional.gles3.es3fFboColorbufferTests',
+ 'fragdepth' : 'functional.gles3.es3fFragDepthTests',
+ 'shaderop' : 'functional.gles3.es3fShaderOperatorTests',
+ 'vao' : 'functional.gles3.es3fVertexArrayObjectTests',
+ 'clip' : 'functional.gles3.es3fClippingTests',
+ 'inv' : 'functional.gles3.es3fFboInvalidateTests',
+ 'defvertattr' : 'functional.gles3.es3fDefaultVertexAttributeTests',
+ 'occlusion' : 'functional.gles3.es3fOcclusionQueryTests',
+ 'shaderapi' : 'functional.gles3.es3fShaderApiTests',
+ 'shaderpackingfunction' : 'functional.gles3.es3fShaderPackingFunctionTests',
+ 'shadercommonfunction' : 'functional.gles3.es3fShaderCommonFunctionTests',
+ 'shadermatrix' : 'functional.gles3.es3fShaderMatrixTest',
+ 'shaderprecision' : 'functional.gles3.es3fShaderPrecisionTests',
+ 'bstate': 'functional.gles3.es3fBooleanStateQuery',
+ 'shaderstate': 'functional.gles3.es3fShaderStateQueryTests',
+ 'fbostate' : 'functional.gles3.es3fFboStateQueryTests',
+ 'rbostate' : 'functional.gles3.es3fRboStateQueryTests',
+ 'bufferstate' : 'functional.gles3.es3fBufferObjectQueryTests',
+ 'samplerstate' : 'functional.gles3.es3fSamplerStateQueryTests',
+ 'texstate' : 'functional.gles3.es3fTextureStateQuery',
+ 'internalformatstate' : 'functional.gles3.es3fInternalFormatQueryTests',
+ 'texturespecification' : 'functional.gles3.es3fTextureSpecificationTests',
+ 'shadertexturefunction' : 'functional.gles3.es3fShaderTextureFunctionTests',
+ 'sync' : 'functional.gles3.es3fSyncTests',
+ 'readpixel' : 'functional.gles3.es3fReadPixelTests',
+ 'stringquery' : 'functional.gles3.es3fStringQueryTests',
+ 'indexedstate' : 'functional.gles3.es3fIndexedStateQueryTests',
+ 'integerstate' : 'functional.gles3.es3fIntegerStateQueryTests',
+ 'floatstate' : 'functional.gles3.es3fFloatStateQueryTests'
+}
+
+total_errors = 0
+total_warnings = 0
+
+results = dict()
+
+def dep_filename(target):
+ return target + '.dep'
+
+def compiled_filename(target):
+ return target + '.compiled'
+
+def write_to_file(outfile, cmdLine, redirect_stderr):
+ stderr = None
+ if redirect_stderr:
+ stderr = subprocess.STDOUT
+
+ with open(outfile, "w") as out_file:
+ proc = subprocess.Popen(cmdLine, shell=True, stdout=subprocess.PIPE, stderr=stderr)
+ while proc.poll() is None:
+ line = proc.stdout.readline()
+ out_file.write(line)
+
+ out_file.flush()
+ proc.wait()
+
+def read_file(file_path):
+ #File exist
+ if not file_exists(file_path):
+ sys.exit(2)
+
+ fo = open(file_path)
+ lines = fo.read()
+ fo.close()
+ return lines
+
+def file_exists(file_path):
+ if not os.path.exists:
+ print "The file " + file_name + " doesn't exists"
+ return False
+ return True
+
+def build_deps(target, namespace):
+ cmdLine = 'python ../closure-library/closure/bin/build/closurebuilder.py --root=../closure-library --root=. --namespace=' + namespace
+ print cmdLine
+ write_to_file(dep_filename(target), cmdLine, False)
+
+def build_all_deps():
+ for target in targets.keys():
+ build_deps(target, targets[target])
+
+def buildDepsFile():
+ # the parameter "--root_with_prefix" is the relative path from the file goog/base.js to the root of the .js files we
+ # are working on.
+ cmdBuildDeps = 'python ../closure-library/closure/bin/build/depswriter.py --root_with_prefix=". ../../../deqp" > deqp-deps.js'
+
+ # Calls the python program that generates the google closure dependencies
+ # write_to_file('deqp-deps.js', cmdBuildDeps, False)
+ proc = subprocess.Popen(cmdBuildDeps, shell=True, stdout=subprocess.PIPE, stderr=None)
+ proc.wait()
+
+def build_target(target, namespace):
+ global total_errors
+ global total_warnings
+ deps = read_file(dep_filename(target))
+ cmdLine = 'java -jar compiler.jar --compilation_level ADVANCED_OPTIMIZATIONS --warning_level VERBOSE --jscomp_warning undefinedVars --externs compiler_additional_extern.js'
+ for dep in deps.split('\n'):
+ dep = dep.strip()
+ if len(dep) > 0:
+ cmdLine += ' --js ' + dep
+ cmdLine += ' --closure_entry_point=' + namespace
+ print cmdLine
+ filename = compiled_filename(target)
+ write_to_file(filename, cmdLine, True)
+ compiled = read_file(filename)
+ result = re.search(r'(\d*)\s*error\(s\),\s*(\d*)\s*warning\(s\)', compiled)
+ errors = 0
+ warnings = 0
+ if result:
+ print target + ': ' + result.group(0)
+ errors = int(result.group(1))
+ warnings = int(result.group(2))
+ total_errors += errors
+ total_warnings += warnings
+ results[target] = [errors, warnings]
+
+def build_all_targets():
+ for target in targets.keys():
+ build_target(target, targets[target])
+
+def format_target(target):
+ deps = read_file(dep_filename(target))
+ fixjsstyle = 'fixjsstyle.py'
+ reformat = 'reformatting_tool.py'
+ for dep in deps.split('\n'):
+ dep = dep.strip()
+ if len(dep) > 0 and not re.search('closure-library.*base\.js', dep):
+ print fixjsstyle + ' ' + dep
+ subprocess.call(['python', fixjsstyle, dep])
+ print reformat + ' -f ' + dep
+ subprocess.call(['python', reformat, '-f', dep])
+
+def format_all_targets():
+ for target in targets.keys():
+ format_target(target)
+
+def pass_or_fail():
+ if total_errors + total_warnings == 0:
+ print "Passed"
+ elif len(results) > 1: #display the summary only when building more than one target
+ passed = [k for k, v in results.iteritems() if v[0] + v[1] == 0]
+ failed = dict((k, v) for k, v in results.iteritems() if v[0] + v[1] != 0)
+ print "\nBuild Summary:"
+ # Print first the tests that passed
+ for target in passed:
+ print "{0:>30}\tPassed".format(target+":")
+
+ # Print tests that failed. Fixed-width to improve readability
+ for target in failed:
+ errors = failed[target][0]
+ warnings = failed[target][1]
+ print "{0:>30}\tErrors: {1:4}\tWarnings: {2:4}".format(target+":", errors, warnings)
+ print "Compilation failed: {} error(s), {} warning(s).".format(total_errors, total_warnings)
+
+def main(argv):
+ if len(argv) == 0:
+ build_all_deps()
+ build_all_targets()
+ buildDepsFile()
+ pass_or_fail()
+ elif (argv[0] == 'deps'):
+ if len(argv) == 2:
+ target = argv[1]
+ build_deps(target, targets[target])
+ else:
+ build_all_deps()
+ elif (argv[0] == 'format'):
+ if len(argv) == 2:
+ target = argv[1]
+ format_target(target)
+ else:
+ format_all_targets()
+ elif (argv[0] == 'build'):
+ if len(argv) == 2:
+ target = argv[1]
+ build_target(target, targets[target])
+ else:
+ build_all_targets()
+ pass_or_fail()
+ elif (argv[0] == 'depfile'):
+ buildDepsFile()
+ elif (argv[0] == 'list'):
+ print "List of available targets:"
+ for target in targets.keys():
+ print "\t{}".format(target)
+ else:
+ target = argv[0]
+ build_deps(target, targets[target])
+ build_target(target, targets[target])
+ pass_or_fail()
+
+if __name__ == '__main__':
+ main(sys.argv[1:])
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/compiler_additional_extern.js b/dom/canvas/test/webgl-conf/checkout/deqp/compiler_additional_extern.js
new file mode 100644
index 0000000000..9f76119229
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/compiler_additional_extern.js
@@ -0,0 +1,94 @@
+/*
+Copyright (c) 2019 The Khronos Group Inc.
+Use of this source code is governed by an MIT-style license that can be
+found in the LICENSE.txt file.
+*/
+
+/* Author: Mobica LTD */
+
+/**
+ * @typedef {function(*): boolean}
+ */
+ArrayBuffer.isView;
+
+/**
+ * @param {?string} msg
+ */
+function description(msg){};
+
+function finishTest(){};
+
+/** @type {string} */ var _currentTestName;
+/**
+ * @param {?string} name
+ */
+function setCurrentTestName(name){};
+
+/**
+ * @param {string} msg
+ */
+function bufferedLogToConsole(msg){};
+
+/**
+ * @constructor
+ * @param {string} message The error message.
+ */
+var TestFailedException = function (message) {};
+
+/**
+ * Shows a message in case expression test fails.
+ * @param {boolean} exp
+ * @param {string} message
+ */
+function checkMessage(exp, message) {};
+
+/**
+ * @param {boolean} assertion
+ * @param {?string} msg
+ * @param {boolean} verbose
+ * @param {boolean} exthrow
+ */
+function assertMsgOptions(assertion, msg, verbose, exthrow) {};
+
+/**
+ * @param {Object|string} msg
+ */
+function debug(msg){};
+
+/**
+ * @param {string} msg
+ * @param {boolean} exthrow
+ */
+function testFailedOptions(msg, exthrow){};
+
+/**
+ * @param {string} msg
+ * @param {boolean} exthrow
+ */
+function testPassedOptions(msg, exthrow){};
+
+/**
+ * @param {string=} msg
+ */
+function testFailed(msg){};
+
+/**
+ * @param {string=} msg
+ */
+function testPassed(msg){};
+
+/**
+ * Defines the exception type for a GL error.
+ * @constructor
+ * @param {string} message The error message.
+ * @param {number} error GL error code
+ */
+WebGLTestUtils.GLErrorException = function(message, error){ /** @type {string} */ this.message; };
+
+/** @type {WebGL2RenderingContext} */ var gl;
+/** @type {HTMLElement} */ var canvas;
+/** @type {Object} */ var wtu;
+
+/** @type {{create3DContext: function(string):WebGL2RenderingContext,
+ loadTextFileAsync: function(string, function(boolean, string)),
+ glEnumToString: function(WebGL2RenderingContext, number):string }} */ var WebGLTestUtils;
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/00_test_list.txt
new file mode 100644
index 0000000000..3a9b9cf966
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/00_test_list.txt
@@ -0,0 +1,31 @@
+conditionals.html
+constants.html
+constant_expressions.html
+--min-version 1.0.4 conversions_matrix_combine.html
+--min-version 1.0.4 conversions_matrix_to_matrix.html
+--min-version 1.0.4 conversions_scalar_to_matrix.html
+--min-version 1.0.4 conversions_scalar_to_scalar.html
+--min-version 1.0.4 conversions_scalar_to_vector.html
+--min-version 1.0.4 conversions_vector_combine.html
+--min-version 1.0.4 conversions_vector_illegal.html
+--min-version 1.0.4 conversions_vector_to_scalar.html
+--min-version 1.0.4 conversions_vector_to_vector.html
+declarations.html
+fragdata.html
+functions.html
+invalid_texture_functions.html
+keywords.html
+linkage.html
+preprocessor.html
+qualification_order.html
+reserved_operators.html
+scoping.html
+--min-version 1.0.4 swizzles_bvec2.html
+--min-version 1.0.4 swizzles_bvec3.html
+--min-version 1.0.4 swizzles_bvec4.html
+--min-version 1.0.4 swizzles_ivec2.html
+--min-version 1.0.4 swizzles_ivec3.html
+--min-version 1.0.4 swizzles_ivec4.html
+--min-version 1.0.4 swizzles_vec2.html
+--min-version 1.0.4 swizzles_vec3.html
+--min-version 1.0.4 swizzles_vec4.html \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conditionals.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conditionals.html
new file mode 100644
index 0000000000..c80304c551
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conditionals.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'conditionals';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conditionals.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conditionals.test
new file mode 100644
index 0000000000..7b5f591149
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conditionals.test
@@ -0,0 +1,333 @@
+group if "If Statements"
+
+ case single_statement
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 ];
+ output float out0 = [ 0.0 | 1.0 | 1.0 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 0.0;
+ if (in0 >= 1.0)
+ out0 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case compound_statement
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 ];
+ output float out0 = [ 0.0 | 1.0 | 1.0 ];
+ output float out1 = [ 1.0 | 0.0 | 0.0 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 0.0;
+ out1 = 1.0;
+ if (in0 >= 1.0)
+ {
+ out0 = 1.0;
+ out1 = 0.0;
+ }
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case sequence_statements
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 ];
+ output float out0 = [ 0.0 | 1.0 | 1.0 ];
+ output float out1 = [ 1.0 | 0.0 | 0.0 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 0.0;
+ out1 = 1.0;
+ if (in0 >= 1.0)
+ out0 = 1.0, out1 = 0.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case sequence_condition
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 ];
+ output float out0 = [ 0.0 | 1.0 | 1.0 ];
+ output float out1 = [ 1.0 | 0.0 | 0.0 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 0.0;
+ out1 = 1.0;
+ if (false, in0 >= 1.0)
+ out0 = 1.0, out1 = 0.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case complex_condition
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 ];
+ output float out0 = [ 0.0 | 1.0 | 1.0 ];
+ output float out1 = [ 1.0 | 0.0 | 0.0 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 0.0;
+ out1 = 1.0;
+ if (false || (in0 >= 1.0) && (in0 - 2.0*in0 < 0.0))
+ out0 = 1.0, out1 = 0.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case if_else
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 ];
+ output float out0 = [ 0.0 | 1.0 | 1.0 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ if (in0 >= 1.0)
+ out0 = 1.0;
+ else
+ out0 = 0.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case if_elseif
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 ];
+ output float out0 = [ 0.0 | 1.0 | 2.0 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 0.0;
+ if (in0 >= 2.0)
+ out0 = 2.0;
+ else if (in0 >= 1.0)
+ out0 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case if_elseif_else
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 ];
+ output float out0 = [ 0.0 | 1.0 | 2.0 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ if (in0 >= 2.0)
+ out0 = 2.0;
+ else if (in0 >= 1.0)
+ out0 = 1.0;
+ else
+ out0 = 0.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mixed_if_elseif_else
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 ];
+ output float out0 = [ 0.0 | 1.0 | 2.0 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ if (in0 >= 2.0)
+ {
+ out0 = 2.0;
+ }
+ else if (in0 >= 1.0)
+ out0 = 2.0, out0 = 1.0;
+ else
+ out0 = 0.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # if
+
+group invalid_if "Invalid If Conditionals"
+
+ case missing_parenthesis
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ if true
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case unclosed_parenthesis
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ if (true
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case int_condition
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ if (5)
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case int_zero_condition
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ if (0)
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case int_one_condition
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ if (1)
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case int_uniform_condition
+ expect compile_fail
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ uniform int u0;
+ void main()
+ {
+ if (u0)
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case float_condition
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ if (5.0)
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case float_zero_condition
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ if (0.0)
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case float_one_condition
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ if (1.0)
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case sampler_condition
+ expect compile_fail
+ both ""
+ precision mediump float;
+ uniform sampler2D s0;
+ void main()
+ {
+ if (s0)
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+end # invalid_if
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constant_expressions.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constant_expressions.html
new file mode 100644
index 0000000000..db92c09fbf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constant_expressions.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'constant_expressions';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constant_expressions.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constant_expressions.test
new file mode 100644
index 0000000000..355a4432a3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constant_expressions.test
@@ -0,0 +1,288 @@
+group trivial "Trivial expressions"
+
+ case float
+ values { output float out0 = 5.0; }
+ both ""
+
+ precision highp float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const float a = 5.0;
+ out0 = a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int
+ values { output int out0 = 5; }
+ both ""
+ precision highp float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const int a = 5;
+ out0 = a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool
+ values { output bool out0 = true; }
+ both ""
+ precision highp float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const bool a = true;
+ out0 = a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case cast
+ values { output float out0 = 1.0; }
+ both ""
+ precision highp float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const float a = float(int(bool(true)));
+ out0 = a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # trivial
+
+group operators "Operators"
+
+ case math_float
+ values { output float out0 = 2.19; }
+ both ""
+ precision highp float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const float a = 6.0/3.5 + 1.8*2.6 - 4.2;
+ out0 = a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case math_vec
+ values { output float out0 = 15.0; }
+ both ""
+ precision highp float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const vec3 a = (vec4(1.0, 2.0, 3.0, 4.0).zyx * vec3(1.0, 1.5, 3.0).xyz).xzy + (vec2(5.0)/vec2(2.5)).xxy;
+ out0 = a.x + a.y + a.z;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case math_int
+ values { output int out0 = 7; }
+ both ""
+ precision highp int;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const int a = 5-1 + 2*3 - 9/3;
+ out0 = a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case math_ivec
+ values { output int out0 = 21; }
+ both ""
+ precision highp int;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const ivec3 a = ivec2(5-1, 4).xxy + ivec4(1*3, 9/3, 1+2, 8/4).xyz;
+ out0 = a.x + a.y + a.z;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case math_mat
+ values { output float out0 = 8.0; }
+ both ""
+ precision highp float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const mat3 a = mat3(3.0) * mat3(4.0);
+ const mat4 b = mat4(a[1][1])*2.0;
+ const mat2 c = mat2(b[0][0]) / 3.0;
+ out0 = c[0][0]+c[1][0];
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case logical
+ values { output bool out0 = true; }
+ both ""
+ precision highp int;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const bool a = (!false || false) && (true ^^ false);
+ out0 = a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case compare
+ values { output bool out0 = true; }
+ both ""
+ precision highp int;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const bool a = (false == false) && (true != false) && (1 < 2) && (3 <= 3) && ((1 > 1) != (1 >= 1));
+ out0 = a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case selection
+ values { output float out0 = 5.3; }
+ both ""
+ precision highp float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const float a = false ? 0.0 : (true ? 5.3 : 1.0);
+ out0 = a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # operators
+
+group complex_types "Arrays, structs & nested calls"
+
+ case struct
+ values { output float out0 = 260.922; }
+ both ""
+ precision highp float;
+ ${DECLARATIONS}
+
+ struct S
+ {
+ vec4 a;
+ int b;
+ };
+
+ void main()
+ {
+ const S s = S(vec4(1.5), 123);
+ out0 = length(s.a.xy)*float(s.b);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case nested_struct
+ values { output float out0 = 965.9; }
+ both ""
+ precision highp float;
+ ${DECLARATIONS}
+
+ struct S
+ {
+ vec4 v;
+ int i;
+ };
+
+ struct T
+ {
+ S s;
+ bool b;
+ int i;
+ };
+
+ struct U
+ {
+ S s;
+ T t;
+ };
+
+ void main()
+ {
+ const S s = S(vec4(1.5), 123);
+ const T t = T(s, false, 3);
+ const U u = U(s, t);
+ const U v = U(S(vec4(1.3), 4), T(S(vec4(2.0), 5), true, 6));
+ out0 = float(u.s.i*v.t.i + v.t.s.i)*v.s.v.x; // float(123*6 + 5)*1.3
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case array
+ values
+ {
+ input float in0 = [ 0.0 | 1.0];
+ output float out0 = [0.0 | 1.0];
+ }
+ both ""
+ precision highp float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ float a[int(max(-1.0, 2.0))];
+ a[0] = -1.0;
+ a[1] = in0;
+ out0 = a[int(min(1.0, 2.0))];
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case nested_builtin_funcs
+ values { output float out0 = 3.05; }
+ both ""
+ precision highp float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const float a = sqrt( atan(sin(1.5)/cos(1.5)) /*1.5*/ * log2(exp2(log(exp(6.2) + 0.1)) + 0.1) /*~6.2*/);
+ out0 = a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # complex_types
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constants.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constants.html
new file mode 100644
index 0000000000..d0c7c8662c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constants.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'constants';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constants.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constants.test
new file mode 100644
index 0000000000..c3887e7081
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/constants.test
@@ -0,0 +1,662 @@
+case float_input
+ values
+ {
+ input float in0 = [ 1.123 | 0.75 | -512.0 | -72.13 | 199.91 ];
+ output float out0 = [ 1.123 | 0.75 | -512.0 | -72.13 | 199.91 ];
+ }
+ values
+ {
+ input float in0 = [ -1.123 | -0.75 | 512.0 | -72.13 | -199.91 ];
+ output float out0 = [ -1.123 | -0.75 | 512.0 | -72.13 | -199.91 ];
+ }
+
+ both ""
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = in0;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case float_uniform
+ values
+ {
+ uniform float uni0 = [ 1.123 | 0.75 | -512.0 | -72.13 | 199.91 ];
+ output float out0 = [ 1.123 | 0.75 | -512.0 | -72.13 | 199.91 ];
+ }
+
+ both ""
+ precision highp float;
+ ${DECLARATIONS}
+ uniform float uni0;
+ void main()
+ {
+ out0 = uni0;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case float_0
+ values { output float out0 = 1.123; }
+ both ""
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = +1.123;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case float_1
+ values { output float out0 = -1.123; }
+ both ""
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = -1.123;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case float_2
+ values { output float out0 = 123.0; }
+ both ""
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 123.;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case float_3
+ values { output float out0 = 0.123; }
+ both ""
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = .123;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case float_4
+ values { output float out0 = 123.0; }
+ both ""
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 1.23e+2;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case float_5
+ values { output float out0 = -123.0; }
+ both ""
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = -1.23E+2;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case float_6
+ values { output float out0 = -123.0; }
+ both ""
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = -1.23e2;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case float_7
+ values { output float out0 = 0.123; }
+ both ""
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 1.23e-1;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case float_8
+ values { output float out0 = 1000.0; }
+ both ""
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 1e3;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case int_0
+ values { output int out0 = 123; }
+ both ""
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 123;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case int_1
+ values { output int out0 = -321; }
+ both ""
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = -321;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case int_2
+ values { output int out0 = 123; }
+ both ""
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 0x7B;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case int_3
+ values { output int out0 = 123; }
+ both ""
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 0X7b;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case int_4
+ values { output int out0 = 123; }
+ both ""
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 0173;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case bool_0
+ values { output bool out0 = true; }
+ both ""
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = true;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case bool_1
+ values { output bool out0 = false; }
+ both ""
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = false;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_global
+ values { output float out0 = 1000.0; }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ const float theConstant = 1000.0;
+ void main()
+ {
+ out0 = theConstant;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_main
+ values { output float out0 = -1000.0; }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ const float theConstant = -1000.0;
+ out0 = theConstant;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_function
+ values { output float out0 = -0.012; }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ float func()
+ {
+ const float theConstant = -0.012;
+ return theConstant;
+ }
+ void main()
+ {
+ out0 = func();
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_scope
+ values { output float out0 = 1.0; }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ {
+ const float theConstant = 1.0;
+ out0 = theConstant;
+ }
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_scope_shawdowing_1
+ values { output float out0 = 1.0; }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ const float theConstant = 100.0;
+ {
+ const float theConstant = 1.0;
+ out0 = theConstant;
+ }
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_scope_shawdowing_2
+ values { output float out0 = 1.0; }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ const float theConstant = 100.0;
+ void main()
+ {
+ {
+ const float theConstant = 1.0;
+ out0 = theConstant;
+ }
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_scope_shawdowing_3
+ values { output float out0 = 1.0; }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ const float theConstant = 100.0;
+ void main()
+ {
+ const float theConstant = -100.0;
+ {
+ const float theConstant = 1.0;
+ out0 = theConstant;
+ }
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_scope_shawdowing_4
+ values { output float out0 = 2.0; }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ const float theConstant = 100.0;
+ float func()
+ {
+ const float theConstant = 2.0;
+ return theConstant;
+ }
+ void main()
+ {
+ const float theConstant = -100.0;
+ {
+ const float theConstant = 1.0;
+ out0 = func();
+ }
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_operations_with_const
+ values { output float out0 = 21.0; }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ const float theGlobalConstant = 10.0;
+ float func()
+ {
+ const float theConstant = 2.0;
+ return theConstant;
+ }
+ void main()
+ {
+ const float theConstant = -100.0;
+ {
+ const float theConstant = 1.0;
+ out0 = func() * theGlobalConstant + theConstant;
+ }
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_assignment_1
+ values { output float out0 = 10.0; }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ const float theConstant1 = 10.0;
+ const float theConstant2 = theConstant1;
+ out0 = theConstant2;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_assignment_2
+ values { output float out0 = 10.0; }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ const float theConstant1 = 10.0;
+ {
+ const float theConstant2 = theConstant1;
+ out0 = theConstant2;
+ }
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_assignment_3
+ values { output float out0 = 10.0; }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ const float theConstant1 = 10.0;
+ void main()
+ {
+ const float theConstant2 = theConstant1;
+ out0 = theConstant2;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_assignment_4
+ values { output float out0 = 10.0; }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ const float theConstant1 = 10.0;
+ float func()
+ {
+ const float theConstant2 = theConstant1;
+ return theConstant2;
+ }
+ void main()
+ {
+ out0 = func();
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_assign_uniform
+ expect compile_fail
+ values { output float out0 = 10.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform float theUniform;
+ void main()
+ {
+ const float theConstant = theUniform;
+ out0 = theConstant;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_assign_varying
+ expect compile_fail
+ values { output float out0 = 10.0; }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ varying float theVarying;
+ void main()
+ {
+ theVarying = 1.0;
+ gl_Position = vec(1.0);
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ varying float theVarying;
+ void main()
+ {
+ const float theConstant = theVarying;
+ out0 = theConstant;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case const_float_function_gotcha
+ desc "Function constant parameters are not really constants, so using them as constant expressions should fail."
+ expect compile_fail
+ values { output float out0 = 20.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ float func(const float gotcha)
+ {
+ const float theConstant2 = gotcha;
+ return theConstant2*2.0;
+ }
+ void main()
+ {
+ const float theConstant = 10.0;
+ out0 = func(theConstant);
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_from_int
+ values { output float out0 = 10.0; }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ const float theConstant = float(10);
+ void main()
+ {
+ out0 = theConstant;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_from_vec2
+ values { output float out0 = 10.0; }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ const float theConstant = vec2(1.0, 10.0).y;
+ void main()
+ {
+ out0 = theConstant;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_from_vec3
+ values { output float out0 = 10.0; }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ const float theConstant = vec3(1.0, 10.0, 20.0).y;
+ void main()
+ {
+ out0 = theConstant;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_from_vec4
+ values { output float out0 = 10.0; }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ const float theConstant = vec4(1.0, 10.0, 20.0, -10.0).y;
+ void main()
+ {
+ out0 = theConstant;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_assign_variable_1
+ expect compile_fail
+ values { output float out0 = 20.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ float theVariable = 20.0;
+ const float theConstant = theVariable;
+ out0 = theConstant;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_assign_variable_2
+ expect compile_fail
+ values { output float out0 = 50.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ float theVariable = 20.0;
+ theVariable += 30.0;
+ const float theConstant = theVariable;
+ out0 = theConstant;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_assign_user_func
+ expect compile_fail
+ values { output float out0 = 50.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ float func()
+ {
+ return 50.0;
+ }
+ void main()
+ {
+ const float theConstant = func();
+ out0 = theConstant;
+ ${OUTPUT}
+ }
+ ""
+end
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions.template b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions.template
new file mode 100644
index 0000000000..40aa8c8628
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions.template
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'conversions';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions.test
new file mode 100644
index 0000000000..51dd9c2374
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions.test
@@ -0,0 +1,5930 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+
+group scalar_to_scalar "Scalar to Scalar Conversions"
+
+ case float_to_float
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output float out0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_int
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output int out0 = [ 0 | 1 | 2 | 3 | 0 | -8 | -20 | 36 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_bool
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output bool out0 = [ false | true | true | true | true | true | true | true ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_float
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output float out0 = [ 0.0 | 1.0 | 2.0 | 5.0 | 8.0 | 11.0 | -12.0 | -66.0 | -192.0 | 255.0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_int
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output int out0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_bool
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output bool out0 = [ false | true | true | true | true | true | true | true | true | true ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_float
+ values
+ {
+ input bool in0 = [ true | false ];
+ output float out0 = [ 1.0 | 0.0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_int
+ values
+ {
+ input bool in0 = [ true | false ];
+ output int out0 = [ 1 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_bool
+ values
+ {
+ input bool in0 = [ true | false ];
+ output bool out0 = [ true | false ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # scalar_to_scalar
+group scalar_to_vector "Scalar to Vector Conversions"
+
+ case float_to_vec2
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(2.0, 2.0) | vec2(3.5, 3.5) | vec2(-0.5, -0.5) | vec2(-8.25, -8.25) | vec2(-20.125, -20.125) | vec2(36.8125, 36.8125) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_vec3
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(2.0, 2.0, 2.0) | vec3(3.5, 3.5, 3.5) | vec3(-0.5, -0.5, -0.5) | vec3(-8.25, -8.25, -8.25) | vec3(-20.125, -20.125, -20.125) | vec3(36.8125, 36.8125, 36.8125) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_vec4
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(2.0, 2.0, 2.0, 2.0) | vec4(3.5, 3.5, 3.5, 3.5) | vec4(-0.5, -0.5, -0.5, -0.5) | vec4(-8.25, -8.25, -8.25, -8.25) | vec4(-20.125, -20.125, -20.125, -20.125) | vec4(36.8125, 36.8125, 36.8125, 36.8125) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_ivec2
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(2, 2) | ivec2(3, 3) | ivec2(0, 0) | ivec2(-8, -8) | ivec2(-20, -20) | ivec2(36, 36) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_ivec3
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(2, 2, 2) | ivec3(3, 3, 3) | ivec3(0, 0, 0) | ivec3(-8, -8, -8) | ivec3(-20, -20, -20) | ivec3(36, 36, 36) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_ivec4
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(2, 2, 2, 2) | ivec4(3, 3, 3, 3) | ivec4(0, 0, 0, 0) | ivec4(-8, -8, -8, -8) | ivec4(-20, -20, -20, -20) | ivec4(36, 36, 36, 36) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_bvec2
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_bvec3
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_bvec4
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_vec2
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(2.0, 2.0) | vec2(5.0, 5.0) | vec2(8.0, 8.0) | vec2(11.0, 11.0) | vec2(-12.0, -12.0) | vec2(-66.0, -66.0) | vec2(-192.0, -192.0) | vec2(255.0, 255.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_vec3
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(2.0, 2.0, 2.0) | vec3(5.0, 5.0, 5.0) | vec3(8.0, 8.0, 8.0) | vec3(11.0, 11.0, 11.0) | vec3(-12.0, -12.0, -12.0) | vec3(-66.0, -66.0, -66.0) | vec3(-192.0, -192.0, -192.0) | vec3(255.0, 255.0, 255.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_vec4
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(2.0, 2.0, 2.0, 2.0) | vec4(5.0, 5.0, 5.0, 5.0) | vec4(8.0, 8.0, 8.0, 8.0) | vec4(11.0, 11.0, 11.0, 11.0) | vec4(-12.0, -12.0, -12.0, -12.0) | vec4(-66.0, -66.0, -66.0, -66.0) | vec4(-192.0, -192.0, -192.0, -192.0) | vec4(255.0, 255.0, 255.0, 255.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_ivec2
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(2, 2) | ivec2(5, 5) | ivec2(8, 8) | ivec2(11, 11) | ivec2(-12, -12) | ivec2(-66, -66) | ivec2(-192, -192) | ivec2(255, 255) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_ivec3
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(2, 2, 2) | ivec3(5, 5, 5) | ivec3(8, 8, 8) | ivec3(11, 11, 11) | ivec3(-12, -12, -12) | ivec3(-66, -66, -66) | ivec3(-192, -192, -192) | ivec3(255, 255, 255) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_ivec4
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(2, 2, 2, 2) | ivec4(5, 5, 5, 5) | ivec4(8, 8, 8, 8) | ivec4(11, 11, 11, 11) | ivec4(-12, -12, -12, -12) | ivec4(-66, -66, -66, -66) | ivec4(-192, -192, -192, -192) | ivec4(255, 255, 255, 255) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_bvec2
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_bvec3
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_bvec4
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_vec2
+ values
+ {
+ input bool in0 = [ true | false ];
+ output vec2 out0 = [ vec2(1.0, 1.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_vec3
+ values
+ {
+ input bool in0 = [ true | false ];
+ output vec3 out0 = [ vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_vec4
+ values
+ {
+ input bool in0 = [ true | false ];
+ output vec4 out0 = [ vec4(1.0, 1.0, 1.0, 1.0) | vec4(0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_ivec2
+ values
+ {
+ input bool in0 = [ true | false ];
+ output ivec2 out0 = [ ivec2(1, 1) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_ivec3
+ values
+ {
+ input bool in0 = [ true | false ];
+ output ivec3 out0 = [ ivec3(1, 1, 1) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_ivec4
+ values
+ {
+ input bool in0 = [ true | false ];
+ output ivec4 out0 = [ ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_bvec2
+ values
+ {
+ input bool in0 = [ true | false ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_bvec3
+ values
+ {
+ input bool in0 = [ true | false ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_bvec4
+ values
+ {
+ input bool in0 = [ true | false ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # scalar_to_vector
+group vector_to_scalar "Vector to Scalar Conversions"
+
+ case vec2_to_float
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_int
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_bool
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output bool out0 = [ false | true | true | true | true ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_float
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_int
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_bool
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output bool out0 = [ false | true | true | true | true ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_float
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_int
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_bool
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output bool out0 = [ false | true | true | true | true ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_float
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output float out0 = [ 0.0 | 1.0 | 0.0 | -32.0 | 0.0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_int
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_bool
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output bool out0 = [ false | true | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_float
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output float out0 = [ 0.0 | 1.0 | 0.0 | -32.0 | 0.0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_int
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_bool
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output bool out0 = [ false | true | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_float
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output float out0 = [ 0.0 | 1.0 | 0.0 | -32.0 | 0.0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_int
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_bool
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output bool out0 = [ false | true | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_float
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output float out0 = [ 1.0 | 0.0 | 0.0 | 1.0 | 0.0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_int
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output int out0 = [ 1 | 0 | 0 | 1 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_bool
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_float
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output float out0 = [ 1.0 | 0.0 | 0.0 | 1.0 | 0.0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_int
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output int out0 = [ 1 | 0 | 0 | 1 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_bool
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_float
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output float out0 = [ 1.0 | 0.0 | 0.0 | 1.0 | 0.0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_int
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output int out0 = [ 1 | 0 | 0 | 1 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_bool
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # vector_to_scalar
+group vector_illegal "Illegal Vector Conversions"
+
+ case vec2_to_vec3
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec2 in0 = vec2(0.0, 0.5);
+ vec3 out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_ivec3
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec2 in0 = vec2(0.0, 0.5);
+ ivec3 out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_bvec3
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec2 in0 = vec2(0.0, 0.5);
+ bvec3 out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_vec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec2 in0 = vec2(0.0, 0.5);
+ vec4 out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_ivec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec2 in0 = vec2(0.0, 0.5);
+ ivec4 out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_bvec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec2 in0 = vec2(0.0, 0.5);
+ bvec4 out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_vec3
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec2 in0 = ivec2(0, 0);
+ vec3 out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_ivec3
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec2 in0 = ivec2(0, 0);
+ ivec3 out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_bvec3
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec2 in0 = ivec2(0, 0);
+ bvec3 out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_vec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec2 in0 = ivec2(0, 0);
+ vec4 out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_ivec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec2 in0 = ivec2(0, 0);
+ ivec4 out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_bvec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec2 in0 = ivec2(0, 0);
+ bvec4 out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_vec3
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec2 in0 = bvec2(true, false);
+ vec3 out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_ivec3
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec2 in0 = bvec2(true, false);
+ ivec3 out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_bvec3
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec2 in0 = bvec2(true, false);
+ bvec3 out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_vec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec2 in0 = bvec2(true, false);
+ vec4 out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_ivec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec2 in0 = bvec2(true, false);
+ ivec4 out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_bvec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec2 in0 = bvec2(true, false);
+ bvec4 out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_vec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec3 in0 = vec3(0.0, 0.5, 0.75);
+ vec4 out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_ivec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec3 in0 = vec3(0.0, 0.5, 0.75);
+ ivec4 out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_bvec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec3 in0 = vec3(0.0, 0.5, 0.75);
+ bvec4 out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_vec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec3 in0 = ivec3(0, 0, 0);
+ vec4 out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_ivec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec3 in0 = ivec3(0, 0, 0);
+ ivec4 out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_bvec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec3 in0 = ivec3(0, 0, 0);
+ bvec4 out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_vec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec3 in0 = bvec3(true, false, false);
+ vec4 out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_ivec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec3 in0 = bvec3(true, false, false);
+ ivec4 out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_bvec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec3 in0 = bvec3(true, false, false);
+ bvec4 out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # vector_illegal
+group vector_to_vector "Vector to Vector Conversions"
+
+ case vec4_to_vec4
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_vec3
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_vec2
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_ivec4
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_ivec3
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_ivec2
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_bvec4
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output bvec4 out0 = [ bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_bvec3
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output bvec3 out0 = [ bvec3(false, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_bvec2
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output bvec2 out0 = [ bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_vec4
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(0.0, -2.0, -4.0, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_vec3
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, -2.0, -4.0) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_vec2
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, -2.0) | vec2(-32.0, 64.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_ivec4
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_ivec3
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_ivec2
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_bvec4
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_bvec3
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_bvec2
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_vec4
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output vec4 out0 = [ vec4(1.0, 0.0, 0.0, 1.0) | vec4(0.0, 0.0, 0.0, 1.0) | vec4(0.0, 1.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_vec3
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output vec3 out0 = [ vec3(1.0, 0.0, 0.0) | vec3(0.0, 0.0, 0.0) | vec3(0.0, 1.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_vec2
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output vec2 out0 = [ vec2(1.0, 0.0) | vec2(0.0, 0.0) | vec2(0.0, 1.0) | vec2(1.0, 1.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_ivec4
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output ivec4 out0 = [ ivec4(1, 0, 0, 1) | ivec4(0, 0, 0, 1) | ivec4(0, 1, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_ivec3
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output ivec3 out0 = [ ivec3(1, 0, 0) | ivec3(0, 0, 0) | ivec3(0, 1, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_ivec2
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output ivec2 out0 = [ ivec2(1, 0) | ivec2(0, 0) | ivec2(0, 1) | ivec2(1, 1) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_bvec4
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_bvec3
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_bvec2
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_vec3
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_vec2
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_ivec3
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_ivec2
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_bvec3
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output bvec3 out0 = [ bvec3(false, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_bvec2
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output bvec2 out0 = [ bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_vec3
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, -2.0, -4.0) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_vec2
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, -2.0) | vec2(-32.0, 64.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_ivec3
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_ivec2
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_bvec3
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_bvec2
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_vec3
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output vec3 out0 = [ vec3(1.0, 0.0, 0.0) | vec3(0.0, 0.0, 0.0) | vec3(0.0, 1.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_vec2
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output vec2 out0 = [ vec2(1.0, 0.0) | vec2(0.0, 0.0) | vec2(0.0, 1.0) | vec2(1.0, 1.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_ivec3
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output ivec3 out0 = [ ivec3(1, 0, 0) | ivec3(0, 0, 0) | ivec3(0, 1, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_ivec2
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output ivec2 out0 = [ ivec2(1, 0) | ivec2(0, 0) | ivec2(0, 1) | ivec2(1, 1) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_bvec3
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_bvec2
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_vec2
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_ivec2
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_bvec2
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output bvec2 out0 = [ bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_vec2
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, -2.0) | vec2(-32.0, 64.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_ivec2
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_bvec2
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_vec2
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output vec2 out0 = [ vec2(1.0, 0.0) | vec2(0.0, 0.0) | vec2(0.0, 1.0) | vec2(1.0, 1.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_ivec2
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output ivec2 out0 = [ ivec2(1, 0) | ivec2(0, 0) | ivec2(0, 1) | ivec2(1, 1) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_bvec2
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # vector_to_vector
+group scalar_to_matrix "Scalar to Matrix Conversions"
+
+ case float_to_mat4
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output mat4 out0 = [ mat4(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.0, 0.0, 0.0, 0.0) | mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0) | mat4(3.5, 0.0, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 0.0, 3.5) | mat4(-0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0, -0.5) | mat4(-8.25, 0.0, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, 0.0, -8.25) | mat4(-20.125, 0.0, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, 0.0, -20.125) | mat4(36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_mat3
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output mat3 out0 = [ mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0) | mat3(3.5, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 3.5) | mat3(-0.5, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, -0.5) | mat3(-8.25, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, -8.25) | mat3(-20.125, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, -20.125) | mat3(36.8125, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 36.8125) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_mat2
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output mat2 out0 = [ mat2(0.0, 0.0, 0.0, 0.0) | mat2(1.0, 0.0, 0.0, 1.0) | mat2(2.0, 0.0, 0.0, 2.0) | mat2(3.5, 0.0, 0.0, 3.5) | mat2(-0.5, 0.0, 0.0, -0.5) | mat2(-8.25, 0.0, 0.0, -8.25) | mat2(-20.125, 0.0, 0.0, -20.125) | mat2(36.8125, 0.0, 0.0, 36.8125) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_mat4
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output mat4 out0 = [ mat4(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.0, 0.0, 0.0, 0.0) | mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0) | mat4(5.0, 0.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 5.0) | mat4(8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 8.0) | mat4(11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0, 11.0) | mat4(-12.0, 0.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, 0.0, -12.0) | mat4(-66.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, 0.0, -66.0) | mat4(-192.0, 0.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, 0.0, -192.0) | mat4(255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0, 255.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_mat3
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output mat3 out0 = [ mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0) | mat3(5.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 5.0) | mat3(8.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 8.0) | mat3(11.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 11.0) | mat3(-12.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, -12.0) | mat3(-66.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, -66.0) | mat3(-192.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, -192.0) | mat3(255.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 255.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_mat2
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output mat2 out0 = [ mat2(0.0, 0.0, 0.0, 0.0) | mat2(1.0, 0.0, 0.0, 1.0) | mat2(2.0, 0.0, 0.0, 2.0) | mat2(5.0, 0.0, 0.0, 5.0) | mat2(8.0, 0.0, 0.0, 8.0) | mat2(11.0, 0.0, 0.0, 11.0) | mat2(-12.0, 0.0, 0.0, -12.0) | mat2(-66.0, 0.0, 0.0, -66.0) | mat2(-192.0, 0.0, 0.0, -192.0) | mat2(255.0, 0.0, 0.0, 255.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_mat4
+ values
+ {
+ input bool in0 = [ true | false ];
+ output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(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.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_mat3
+ values
+ {
+ input bool in0 = [ true | false ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_mat2
+ values
+ {
+ input bool in0 = [ true | false ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # scalar_to_matrix
+group matrix_to_matrix "Matrix to Matrix Conversions"
+
+ case mat4_to_mat4
+ values
+ {
+ input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ];
+ output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4_to_mat3
+ values
+ {
+ input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4_to_mat2
+ values
+ {
+ input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3_to_mat4
+ values
+ {
+ input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.03125, 0.0625, -0.75, 0.015625, 0.03125) ];
+ output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, 0.0, 12.5, 0.03125, 0.0625, 0.0, -0.75, 0.015625, 0.03125, 0.0, 0.0, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3_to_mat3
+ values
+ {
+ input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.03125, 0.0625, -0.75, 0.015625, 0.03125) ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.03125, 0.0625, -0.75, 0.015625, 0.03125) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3_to_mat2
+ values
+ {
+ input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.03125, 0.0625, -0.75, 0.015625, 0.03125) ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.03125) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2_to_mat4
+ values
+ {
+ input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ];
+ output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(8.0, -24.0, 0.0, 0.0, 16.0, -16.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(0.125, 0.03125, 0.0, 0.0, 0.0625, 0.015625, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(-18.725, -0.0125, 0.0, 0.0, -0.5, 19.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2_to_mat3
+ values
+ {
+ input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 1.0) | mat3(8.0, -24.0, 0.0, 16.0, -16.0, 0.0, 0.0, 0.0, 1.0) | mat3(0.125, 0.03125, 0.0, 0.0625, 0.015625, 0.0, 0.0, 0.0, 1.0) | mat3(-18.725, -0.0125, 0.0, -0.5, 19.975, 0.0, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2_to_mat2
+ values
+ {
+ input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # matrix_to_matrix
+group vector_combine "Vector Combine Constructors"
+
+ case vec2_vec2_to_vec4
+ values
+ {
+ input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) ];
+ input vec2 in1 = [ vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) ];
+ output vec4 out0 = [ vec4(-0.5, -2.25, -32.0, 64.0) | vec4(-32.0, 64.0, 1.0, 1.25) | vec4(1.0, 1.25, 0.0, 0.5) | vec4(0.0, 0.5, -0.5, -2.25) | vec4(-0.75, -0.0322580645161, -0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_vec2_to_ivec4
+ values
+ {
+ input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) ];
+ input vec2 in1 = [ vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) ];
+ output ivec4 out0 = [ ivec4(0, -2, -32, 64) | ivec4(-32, 64, 1, 1) | ivec4(1, 1, 0, 0) | ivec4(0, 0, 0, -2) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_vec2_to_bvec4
+ values
+ {
+ input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) ];
+ input vec2 in1 = [ vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, false, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_bvec2_to_vec4
+ values
+ {
+ input bvec2 in0 = [ bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ];
+ input bvec2 in1 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 1.0, 0.0) | vec4(1.0, 0.0, 0.0, 0.0) | vec4(0.0, 1.0, 0.0, 1.0) | vec4(0.0, 0.0, 1.0, 1.0) | vec4(1.0, 1.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_bvec2_to_ivec4
+ values
+ {
+ input bvec2 in0 = [ bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ];
+ input bvec2 in1 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output ivec4 out0 = [ ivec4(0, 0, 1, 0) | ivec4(1, 0, 0, 0) | ivec4(0, 1, 0, 1) | ivec4(0, 0, 1, 1) | ivec4(1, 1, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_bvec2_to_bvec4
+ values
+ {
+ input bvec2 in0 = [ bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ];
+ input bvec2 in1 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(true, false, false, false) | bvec4(false, true, false, true) | bvec4(false, false, true, true) | bvec4(true, true, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_float_to_vec4
+ values
+ {
+ input float in0 = [ 1.0 | 0.0 | -0.5 | -8.25 | 3.5 | -20.125 | 36.8125 | 2.0 ];
+ input float in1 = [ 0.0 | 36.8125 | -8.25 | 2.0 | 3.5 | 1.0 | -20.125 | -0.5 ];
+ input float in2 = [ 3.5 | 36.8125 | -8.25 | 1.0 | 2.0 | 0.0 | -20.125 | -0.5 ];
+ input float in3 = [ 3.5 | 36.8125 | 1.0 | -8.25 | 2.0 | 0.0 | -0.5 | -20.125 ];
+ output vec4 out0 = [ vec4(1.0, 0.0, 3.5, 3.5) | vec4(0.0, 36.8125, 36.8125, 36.8125) | vec4(-0.5, -8.25, -8.25, 1.0) | vec4(-8.25, 2.0, 1.0, -8.25) | vec4(3.5, 3.5, 2.0, 2.0) | vec4(-20.125, 1.0, 0.0, 0.0) | vec4(36.8125, -20.125, -20.125, -0.5) | vec4(2.0, -0.5, -0.5, -20.125) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_float_to_ivec4
+ values
+ {
+ input float in0 = [ 1.0 | 0.0 | -0.5 | -8.25 | 3.5 | -20.125 | 36.8125 | 2.0 ];
+ input float in1 = [ 0.0 | 36.8125 | -8.25 | 2.0 | 3.5 | 1.0 | -20.125 | -0.5 ];
+ input float in2 = [ 3.5 | 36.8125 | -8.25 | 1.0 | 2.0 | 0.0 | -20.125 | -0.5 ];
+ input float in3 = [ 3.5 | 36.8125 | 1.0 | -8.25 | 2.0 | 0.0 | -0.5 | -20.125 ];
+ output ivec4 out0 = [ ivec4(1, 0, 3, 3) | ivec4(0, 36, 36, 36) | ivec4(0, -8, -8, 1) | ivec4(-8, 2, 1, -8) | ivec4(3, 3, 2, 2) | ivec4(-20, 1, 0, 0) | ivec4(36, -20, -20, 0) | ivec4(2, 0, 0, -20) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_float_to_bvec4
+ values
+ {
+ input float in0 = [ 1.0 | 0.0 | -0.5 | -8.25 | 3.5 | -20.125 | 36.8125 | 2.0 ];
+ input float in1 = [ 0.0 | 36.8125 | -8.25 | 2.0 | 3.5 | 1.0 | -20.125 | -0.5 ];
+ input float in2 = [ 3.5 | 36.8125 | -8.25 | 1.0 | 2.0 | 0.0 | -20.125 | -0.5 ];
+ input float in3 = [ 3.5 | 36.8125 | 1.0 | -8.25 | 2.0 | 0.0 | -0.5 | -20.125 ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_int_to_vec4
+ values
+ {
+ input int in0 = [ -12 | -66 | 2 | 5 | 8 | -192 | 255 | 1 | 0 | 11 ];
+ input int in1 = [ 2 | 5 | -66 | 11 | -192 | 8 | -12 | 1 | 255 | 0 ];
+ input int in2 = [ 11 | 255 | 5 | 8 | 2 | -192 | -12 | -66 | 1 | 0 ];
+ input int in3 = [ -192 | -66 | 8 | -12 | 1 | 2 | 0 | 255 | 5 | 11 ];
+ output vec4 out0 = [ vec4(-12.0, 2.0, 11.0, -192.0) | vec4(-66.0, 5.0, 255.0, -66.0) | vec4(2.0, -66.0, 5.0, 8.0) | vec4(5.0, 11.0, 8.0, -12.0) | vec4(8.0, -192.0, 2.0, 1.0) | vec4(-192.0, 8.0, -192.0, 2.0) | vec4(255.0, -12.0, -12.0, 0.0) | vec4(1.0, 1.0, -66.0, 255.0) | vec4(0.0, 255.0, 1.0, 5.0) | vec4(11.0, 0.0, 0.0, 11.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_int_to_ivec4
+ values
+ {
+ input int in0 = [ -12 | -66 | 2 | 5 | 8 | -192 | 255 | 1 | 0 | 11 ];
+ input int in1 = [ 2 | 5 | -66 | 11 | -192 | 8 | -12 | 1 | 255 | 0 ];
+ input int in2 = [ 11 | 255 | 5 | 8 | 2 | -192 | -12 | -66 | 1 | 0 ];
+ input int in3 = [ -192 | -66 | 8 | -12 | 1 | 2 | 0 | 255 | 5 | 11 ];
+ output ivec4 out0 = [ ivec4(-12, 2, 11, -192) | ivec4(-66, 5, 255, -66) | ivec4(2, -66, 5, 8) | ivec4(5, 11, 8, -12) | ivec4(8, -192, 2, 1) | ivec4(-192, 8, -192, 2) | ivec4(255, -12, -12, 0) | ivec4(1, 1, -66, 255) | ivec4(0, 255, 1, 5) | ivec4(11, 0, 0, 11) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_int_to_bvec4
+ values
+ {
+ input int in0 = [ -12 | -66 | 2 | 5 | 8 | -192 | 255 | 1 | 0 | 11 ];
+ input int in1 = [ 2 | 5 | -66 | 11 | -192 | 8 | -12 | 1 | 255 | 0 ];
+ input int in2 = [ 11 | 255 | 5 | 8 | 2 | -192 | -12 | -66 | 1 | 0 ];
+ input int in3 = [ -192 | -66 | 8 | -12 | 1 | 2 | 0 | 255 | 5 | 11 ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, false) | bvec4(true, true, true, true) | bvec4(false, true, true, true) | bvec4(true, false, false, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_bool_to_vec4
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ false | true ];
+ input bool in2 = [ true | false ];
+ input bool in3 = [ false | true ];
+ output vec4 out0 = [ vec4(1.0, 0.0, 1.0, 0.0) | vec4(0.0, 1.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_bool_to_ivec4
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ false | true ];
+ input bool in2 = [ true | false ];
+ input bool in3 = [ false | true ];
+ output ivec4 out0 = [ ivec4(1, 0, 1, 0) | ivec4(0, 1, 0, 1) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_bool_to_bvec4
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ false | true ];
+ input bool in2 = [ true | false ];
+ input bool in3 = [ false | true ];
+ output bvec4 out0 = [ bvec4(true, false, true, false) | bvec4(false, true, false, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_bool_to_vec4
+ values
+ {
+ input bool in0 = [ true | true | true | false | false | false | true | false | true | false ];
+ input float in1 = [ 1.0 | 2.0 | 1.0 | 0.0 | 36.8125 | -8.25 | -0.5 | 3.5 | -20.125 | 0.0 ];
+ input int in2 = [ -192 | -12 | 2 | -66 | 255 | 8 | 0 | 5 | 11 | 1 ];
+ input bool in3 = [ true | true | false | false | true | false | false | false | true | true ];
+ output vec4 out0 = [ vec4(1.0, 1.0, -192.0, 1.0) | vec4(1.0, 2.0, -12.0, 1.0) | vec4(1.0, 1.0, 2.0, 0.0) | vec4(0.0, 0.0, -66.0, 0.0) | vec4(0.0, 36.8125, 255.0, 1.0) | vec4(0.0, -8.25, 8.0, 0.0) | vec4(1.0, -0.5, 0.0, 0.0) | vec4(0.0, 3.5, 5.0, 0.0) | vec4(1.0, -20.125, 11.0, 1.0) | vec4(0.0, 0.0, 1.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_bool_to_ivec4
+ values
+ {
+ input bool in0 = [ true | true | true | false | false | false | true | false | true | false ];
+ input float in1 = [ 1.0 | 2.0 | 1.0 | 0.0 | 36.8125 | -8.25 | -0.5 | 3.5 | -20.125 | 0.0 ];
+ input int in2 = [ -192 | -12 | 2 | -66 | 255 | 8 | 0 | 5 | 11 | 1 ];
+ input bool in3 = [ true | true | false | false | true | false | false | false | true | true ];
+ output ivec4 out0 = [ ivec4(1, 1, -192, 1) | ivec4(1, 2, -12, 1) | ivec4(1, 1, 2, 0) | ivec4(0, 0, -66, 0) | ivec4(0, 36, 255, 1) | ivec4(0, -8, 8, 0) | ivec4(1, 0, 0, 0) | ivec4(0, 3, 5, 0) | ivec4(1, -20, 11, 1) | ivec4(0, 0, 1, 1) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_bool_to_bvec4
+ values
+ {
+ input bool in0 = [ true | true | true | false | false | false | true | false | true | false ];
+ input float in1 = [ 1.0 | 2.0 | 1.0 | 0.0 | 36.8125 | -8.25 | -0.5 | 3.5 | -20.125 | 0.0 ];
+ input int in2 = [ -192 | -12 | 2 | -66 | 255 | 8 | 0 | 5 | 11 | 1 ];
+ input bool in3 = [ true | true | false | false | true | false | false | false | true | true ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, false) | bvec4(false, false, true, false) | bvec4(false, true, true, true) | bvec4(false, true, true, false) | bvec4(true, true, false, false) | bvec4(false, true, true, false) | bvec4(true, true, true, true) | bvec4(false, false, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_to_vec4
+ values
+ {
+ input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(1, 1) ];
+ output vec4 out0 = [ vec4(-0.5, -2.25, 0.0, 0.0) | vec4(0.0, 0.5, 0.0, -2.0) | vec4(-32.0, 64.0, -32.0, 64.0) | vec4(1.0, 1.25, 0.0, 0.0) | vec4(-0.75, -0.0322580645161, 1.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_to_ivec4
+ values
+ {
+ input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(1, 1) ];
+ output ivec4 out0 = [ ivec4(0, -2, 0, 0) | ivec4(0, 0, 0, -2) | ivec4(-32, 64, -32, 64) | ivec4(1, 1, 0, 0) | ivec4(0, 0, 1, 1) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_to_bvec4
+ values
+ {
+ input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(1, 1) ];
+ output bvec4 out0 = [ bvec4(true, true, false, false) | bvec4(false, true, false, true) | bvec4(true, true, true, true) | bvec4(true, true, false, false) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bvec2_to_vec4
+ values
+ {
+ input vec2 in0 = [ vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(0.0, 0.5) ];
+ input bvec2 in1 = [ bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, true) | bvec2(false, false) ];
+ output vec4 out0 = [ vec4(-32.0, 64.0, 0.0, 0.0) | vec4(-0.5, -2.25, 1.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.75, -0.0322580645161, 0.0, 1.0) | vec4(0.0, 0.5, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bvec2_to_ivec4
+ values
+ {
+ input vec2 in0 = [ vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(0.0, 0.5) ];
+ input bvec2 in1 = [ bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, true) | bvec2(false, false) ];
+ output ivec4 out0 = [ ivec4(-32, 64, 0, 0) | ivec4(0, -2, 1, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 1) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bvec2_to_bvec4
+ values
+ {
+ input vec2 in0 = [ vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(0.0, 0.5) ];
+ input bvec2 in1 = [ bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, false, false) | bvec4(true, true, true, false) | bvec4(true, true, true, true) | bvec4(true, true, false, true) | bvec4(false, true, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_float_to_vec4
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, true, false) | bvec3(false, true, false) | bvec3(true, true, true) ];
+ input float in1 = [ -8.25 | -20.125 | 2.0 | 0.0 | -0.5 | 3.5 | 36.8125 | 1.0 ];
+ output vec4 out0 = [ vec4(1.0, 0.0, 0.0, -8.25) | vec4(0.0, 0.0, 0.0, -20.125) | vec4(0.0, 0.0, 0.0, 2.0) | vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 0.0, 0.0, -0.5) | vec4(0.0, 1.0, 0.0, 3.5) | vec4(0.0, 1.0, 0.0, 36.8125) | vec4(1.0, 1.0, 1.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_float_to_ivec4
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, true, false) | bvec3(false, true, false) | bvec3(true, true, true) ];
+ input float in1 = [ -8.25 | -20.125 | 2.0 | 0.0 | -0.5 | 3.5 | 36.8125 | 1.0 ];
+ output ivec4 out0 = [ ivec4(1, 0, 0, -8) | ivec4(0, 0, 0, -20) | ivec4(0, 0, 0, 2) | ivec4(0, 0, 0, 0) | ivec4(1, 0, 0, 0) | ivec4(0, 1, 0, 3) | ivec4(0, 1, 0, 36) | ivec4(1, 1, 1, 1) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_float_to_bvec4
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, true, false) | bvec3(false, true, false) | bvec3(true, true, true) ];
+ input float in1 = [ -8.25 | -20.125 | 2.0 | 0.0 | -0.5 | 3.5 | 36.8125 | 1.0 ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, false, false, true) | bvec4(false, false, false, false) | bvec4(true, false, false, true) | bvec4(false, true, false, true) | bvec4(false, true, false, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_float_to_vec4
+ values
+ {
+ input vec3 in0 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ];
+ input float in1 = [ 0.0 | 2.0 | 36.8125 | 3.5 | 1.0 | -0.5 | -8.25 | -20.125 ];
+ output vec4 out0 = [ vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.0) | vec4(0.0, 0.5, 0.75, 2.0) | vec4(-0.5, -2.25, -4.875, 36.8125) | vec4(0.0, 0.5, 0.75, 3.5) | vec4(1.0, 1.25, 1.125, 1.0) | vec4(-0.5, -2.25, -4.875, -0.5) | vec4(-32.0, 64.0, -51.0, -8.25) | vec4(1.0, 1.25, 1.125, -20.125) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_float_to_ivec4
+ values
+ {
+ input vec3 in0 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ];
+ input float in1 = [ 0.0 | 2.0 | 36.8125 | 3.5 | 1.0 | -0.5 | -8.25 | -20.125 ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, 2) | ivec4(0, -2, -4, 36) | ivec4(0, 0, 0, 3) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 0) | ivec4(-32, 64, -51, -8) | ivec4(1, 1, 1, -20) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_float_to_bvec4
+ values
+ {
+ input vec3 in0 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ];
+ input float in1 = [ 0.0 | 2.0 | 36.8125 | 3.5 | 1.0 | -0.5 | -8.25 | -20.125 ];
+ output bvec4 out0 = [ bvec4(true, true, true, false) | bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_ivec2_int_to_vec4
+ values
+ {
+ input int in0 = [ -66 | 8 | -192 | 255 | 5 | -12 | 0 | 2 | 1 | 11 ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, -2) | ivec2(0, 0) ];
+ input int in2 = [ 8 | 2 | 11 | -192 | 255 | -12 | 0 | -66 | 1 | 5 ];
+ output vec4 out0 = [ vec4(-66.0, 0.0, 0.0, 8.0) | vec4(8.0, 0.0, 0.0, 2.0) | vec4(-192.0, -32.0, 64.0, 11.0) | vec4(255.0, -32.0, 64.0, -192.0) | vec4(5.0, 1.0, 1.0, 255.0) | vec4(-12.0, 0.0, 0.0, -12.0) | vec4(0.0, 1.0, 1.0, 0.0) | vec4(2.0, 0.0, -2.0, -66.0) | vec4(1.0, 0.0, -2.0, 1.0) | vec4(11.0, 0.0, 0.0, 5.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_ivec2_int_to_ivec4
+ values
+ {
+ input int in0 = [ -66 | 8 | -192 | 255 | 5 | -12 | 0 | 2 | 1 | 11 ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, -2) | ivec2(0, 0) ];
+ input int in2 = [ 8 | 2 | 11 | -192 | 255 | -12 | 0 | -66 | 1 | 5 ];
+ output ivec4 out0 = [ ivec4(-66, 0, 0, 8) | ivec4(8, 0, 0, 2) | ivec4(-192, -32, 64, 11) | ivec4(255, -32, 64, -192) | ivec4(5, 1, 1, 255) | ivec4(-12, 0, 0, -12) | ivec4(0, 1, 1, 0) | ivec4(2, 0, -2, -66) | ivec4(1, 0, -2, 1) | ivec4(11, 0, 0, 5) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_ivec2_int_to_bvec4
+ values
+ {
+ input int in0 = [ -66 | 8 | -192 | 255 | 5 | -12 | 0 | 2 | 1 | 11 ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, -2) | ivec2(0, 0) ];
+ input int in2 = [ 8 | 2 | 11 | -192 | 255 | -12 | 0 | -66 | 1 | 5 ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, false, false, true) | bvec4(false, true, true, false) | bvec4(true, false, true, true) | bvec4(true, false, true, true) | bvec4(true, false, false, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_ivec2_to_vec4
+ values
+ {
+ input bool in0 = [ true | true | true | true | false | false | false | false ];
+ input float in1 = [ 2.0 | 0.0 | 3.5 | -8.25 | 36.8125 | -20.125 | 1.0 | -0.5 ];
+ input ivec2 in2 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) ];
+ output vec4 out0 = [ vec4(1.0, 2.0, 0.0, 0.0) | vec4(1.0, 0.0, 0.0, 0.0) | vec4(1.0, 3.5, -32.0, 64.0) | vec4(1.0, -8.25, 1.0, 1.0) | vec4(0.0, 36.8125, 0.0, -2.0) | vec4(0.0, -20.125, 0.0, -2.0) | vec4(0.0, 1.0, 1.0, 1.0) | vec4(0.0, -0.5, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_ivec2_to_ivec4
+ values
+ {
+ input bool in0 = [ true | true | true | true | false | false | false | false ];
+ input float in1 = [ 2.0 | 0.0 | 3.5 | -8.25 | 36.8125 | -20.125 | 1.0 | -0.5 ];
+ input ivec2 in2 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) ];
+ output ivec4 out0 = [ ivec4(1, 2, 0, 0) | ivec4(1, 0, 0, 0) | ivec4(1, 3, -32, 64) | ivec4(1, -8, 1, 1) | ivec4(0, 36, 0, -2) | ivec4(0, -20, 0, -2) | ivec4(0, 1, 1, 1) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_ivec2_to_bvec4
+ values
+ {
+ input bool in0 = [ true | true | true | true | false | false | false | false ];
+ input float in1 = [ 2.0 | 0.0 | 3.5 | -8.25 | 36.8125 | -20.125 | 1.0 | -0.5 ];
+ input ivec2 in2 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) ];
+ output bvec4 out0 = [ bvec4(true, true, false, false) | bvec4(true, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, true, false, true) | bvec4(false, true, false, true) | bvec4(false, true, true, true) | bvec4(false, true, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_to_vec3
+ values
+ {
+ input float in0 = [ 3.5 | 2.0 | -20.125 | -8.25 | 36.8125 | 1.0 | 0.0 | -0.5 ];
+ input float in1 = [ -0.5 | 1.0 | 2.0 | -20.125 | 0.0 | -8.25 | 36.8125 | 3.5 ];
+ input float in2 = [ 0.0 | 1.0 | 3.5 | -8.25 | -0.5 | 36.8125 | -20.125 | 2.0 ];
+ output vec3 out0 = [ vec3(3.5, -0.5, 0.0) | vec3(2.0, 1.0, 1.0) | vec3(-20.125, 2.0, 3.5) | vec3(-8.25, -20.125, -8.25) | vec3(36.8125, 0.0, -0.5) | vec3(1.0, -8.25, 36.8125) | vec3(0.0, 36.8125, -20.125) | vec3(-0.5, 3.5, 2.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_to_ivec3
+ values
+ {
+ input float in0 = [ 3.5 | 2.0 | -20.125 | -8.25 | 36.8125 | 1.0 | 0.0 | -0.5 ];
+ input float in1 = [ -0.5 | 1.0 | 2.0 | -20.125 | 0.0 | -8.25 | 36.8125 | 3.5 ];
+ input float in2 = [ 0.0 | 1.0 | 3.5 | -8.25 | -0.5 | 36.8125 | -20.125 | 2.0 ];
+ output ivec3 out0 = [ ivec3(3, 0, 0) | ivec3(2, 1, 1) | ivec3(-20, 2, 3) | ivec3(-8, -20, -8) | ivec3(36, 0, 0) | ivec3(1, -8, 36) | ivec3(0, 36, -20) | ivec3(0, 3, 2) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_to_bvec3
+ values
+ {
+ input float in0 = [ 3.5 | 2.0 | -20.125 | -8.25 | 36.8125 | 1.0 | 0.0 | -0.5 ];
+ input float in1 = [ -0.5 | 1.0 | 2.0 | -20.125 | 0.0 | -8.25 | 36.8125 | 3.5 ];
+ input float in2 = [ 0.0 | 1.0 | 3.5 | -8.25 | -0.5 | 36.8125 | -20.125 | 2.0 ];
+ output bvec3 out0 = [ bvec3(true, true, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_to_vec3
+ values
+ {
+ input int in0 = [ 0 | 2 | 1 | 5 | 255 | 8 | -66 | 11 | -12 | -192 ];
+ input int in1 = [ 2 | 8 | 11 | -12 | -192 | 1 | -66 | 5 | 255 | 0 ];
+ input int in2 = [ -192 | -12 | -66 | 8 | 1 | 2 | 5 | 11 | 255 | 0 ];
+ output vec3 out0 = [ vec3(0.0, 2.0, -192.0) | vec3(2.0, 8.0, -12.0) | vec3(1.0, 11.0, -66.0) | vec3(5.0, -12.0, 8.0) | vec3(255.0, -192.0, 1.0) | vec3(8.0, 1.0, 2.0) | vec3(-66.0, -66.0, 5.0) | vec3(11.0, 5.0, 11.0) | vec3(-12.0, 255.0, 255.0) | vec3(-192.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_to_ivec3
+ values
+ {
+ input int in0 = [ 0 | 2 | 1 | 5 | 255 | 8 | -66 | 11 | -12 | -192 ];
+ input int in1 = [ 2 | 8 | 11 | -12 | -192 | 1 | -66 | 5 | 255 | 0 ];
+ input int in2 = [ -192 | -12 | -66 | 8 | 1 | 2 | 5 | 11 | 255 | 0 ];
+ output ivec3 out0 = [ ivec3(0, 2, -192) | ivec3(2, 8, -12) | ivec3(1, 11, -66) | ivec3(5, -12, 8) | ivec3(255, -192, 1) | ivec3(8, 1, 2) | ivec3(-66, -66, 5) | ivec3(11, 5, 11) | ivec3(-12, 255, 255) | ivec3(-192, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_to_bvec3
+ values
+ {
+ input int in0 = [ 0 | 2 | 1 | 5 | 255 | 8 | -66 | 11 | -12 | -192 ];
+ input int in1 = [ 2 | 8 | 11 | -12 | -192 | 1 | -66 | 5 | 255 | 0 ];
+ input int in2 = [ -192 | -12 | -66 | 8 | 1 | 2 | 5 | 11 | 255 | 0 ];
+ output bvec3 out0 = [ bvec3(false, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_to_vec3
+ values
+ {
+ input bool in0 = [ false | true ];
+ input bool in1 = [ false | true ];
+ input bool in2 = [ false | true ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_to_ivec3
+ values
+ {
+ input bool in0 = [ false | true ];
+ input bool in1 = [ false | true ];
+ input bool in2 = [ false | true ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_to_bvec3
+ values
+ {
+ input bool in0 = [ false | true ];
+ input bool in1 = [ false | true ];
+ input bool in2 = [ false | true ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_to_vec3
+ values
+ {
+ input bool in0 = [ false | true | false | true | false | true | false | true | false | true ];
+ input float in1 = [ 0.0 | 2.0 | 1.0 | -0.5 | -8.25 | 3.5 | -20.125 | 1.0 | 0.0 | 36.8125 ];
+ input int in2 = [ -12 | -192 | 2 | 5 | -66 | 255 | 11 | 0 | 8 | 1 ];
+ output vec3 out0 = [ vec3(0.0, 0.0, -12.0) | vec3(1.0, 2.0, -192.0) | vec3(0.0, 1.0, 2.0) | vec3(1.0, -0.5, 5.0) | vec3(0.0, -8.25, -66.0) | vec3(1.0, 3.5, 255.0) | vec3(0.0, -20.125, 11.0) | vec3(1.0, 1.0, 0.0) | vec3(0.0, 0.0, 8.0) | vec3(1.0, 36.8125, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_to_ivec3
+ values
+ {
+ input bool in0 = [ false | true | false | true | false | true | false | true | false | true ];
+ input float in1 = [ 0.0 | 2.0 | 1.0 | -0.5 | -8.25 | 3.5 | -20.125 | 1.0 | 0.0 | 36.8125 ];
+ input int in2 = [ -12 | -192 | 2 | 5 | -66 | 255 | 11 | 0 | 8 | 1 ];
+ output ivec3 out0 = [ ivec3(0, 0, -12) | ivec3(1, 2, -192) | ivec3(0, 1, 2) | ivec3(1, 0, 5) | ivec3(0, -8, -66) | ivec3(1, 3, 255) | ivec3(0, -20, 11) | ivec3(1, 1, 0) | ivec3(0, 0, 8) | ivec3(1, 36, 1) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_to_bvec3
+ values
+ {
+ input bool in0 = [ false | true | false | true | false | true | false | true | false | true ];
+ input float in1 = [ 0.0 | 2.0 | 1.0 | -0.5 | -8.25 | 3.5 | -20.125 | 1.0 | 0.0 | 36.8125 ];
+ input int in2 = [ -12 | -192 | 2 | 5 | -66 | 255 | 11 | 0 | 8 | 1 ];
+ output bvec3 out0 = [ bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, false) | bvec3(false, false, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bool_to_vec3
+ values
+ {
+ input vec2 in0 = [ vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) ];
+ input bool in1 = [ false | true | false | true | true ];
+ output vec3 out0 = [ vec3(-0.75, -0.0322580645161, 0.0) | vec3(1.0, 1.25, 1.0) | vec3(-0.5, -2.25, 0.0) | vec3(0.0, 0.5, 1.0) | vec3(-32.0, 64.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bool_to_ivec3
+ values
+ {
+ input vec2 in0 = [ vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) ];
+ input bool in1 = [ false | true | false | true | true ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, 0) | ivec3(0, 0, 1) | ivec3(-32, 64, 1) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bool_to_bvec3
+ values
+ {
+ input vec2 in0 = [ vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) ];
+ input bool in1 = [ false | true | false | true | true ];
+ output bvec3 out0 = [ bvec3(true, true, false) | bvec3(true, true, true) | bvec3(true, true, false) | bvec3(false, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_float_to_vec3
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ];
+ input float in1 = [ 2.0 | 36.8125 | 0.0 | -20.125 | 1.0 | -0.5 | -8.25 | 3.5 ];
+ output vec3 out0 = [ vec3(1.0, 0.0, 2.0) | vec3(0.0, 0.0, 36.8125) | vec3(1.0, 0.0, 0.0) | vec3(0.0, 1.0, -20.125) | vec3(0.0, 0.0, 1.0) | vec3(0.0, 1.0, -0.5) | vec3(0.0, 0.0, -8.25) | vec3(1.0, 1.0, 3.5) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_float_to_ivec3
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ];
+ input float in1 = [ 2.0 | 36.8125 | 0.0 | -20.125 | 1.0 | -0.5 | -8.25 | 3.5 ];
+ output ivec3 out0 = [ ivec3(1, 0, 2) | ivec3(0, 0, 36) | ivec3(1, 0, 0) | ivec3(0, 1, -20) | ivec3(0, 0, 1) | ivec3(0, 1, 0) | ivec3(0, 0, -8) | ivec3(1, 1, 3) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_float_to_bvec3
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ];
+ input float in1 = [ 2.0 | 36.8125 | 0.0 | -20.125 | 1.0 | -0.5 | -8.25 | 3.5 ];
+ output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, false, true) | bvec3(true, false, false) | bvec3(false, true, true) | bvec3(false, false, true) | bvec3(false, true, true) | bvec3(false, false, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_int_to_vec3
+ values
+ {
+ input bvec2 in0 = [ bvec2(false, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) | bvec2(true, false) | bvec2(false, false) ];
+ input int in1 = [ 0 | 255 | 1 | 2 | 8 | 11 | -192 | 5 | -12 | -66 ];
+ output vec3 out0 = [ vec3(0.0, 1.0, 0.0) | vec3(0.0, 1.0, 255.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 2.0) | vec3(0.0, 0.0, 8.0) | vec3(0.0, 0.0, 11.0) | vec3(1.0, 1.0, -192.0) | vec3(1.0, 0.0, 5.0) | vec3(1.0, 0.0, -12.0) | vec3(0.0, 0.0, -66.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_int_to_ivec3
+ values
+ {
+ input bvec2 in0 = [ bvec2(false, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) | bvec2(true, false) | bvec2(false, false) ];
+ input int in1 = [ 0 | 255 | 1 | 2 | 8 | 11 | -192 | 5 | -12 | -66 ];
+ output ivec3 out0 = [ ivec3(0, 1, 0) | ivec3(0, 1, 255) | ivec3(1, 1, 1) | ivec3(0, 0, 2) | ivec3(0, 0, 8) | ivec3(0, 0, 11) | ivec3(1, 1, -192) | ivec3(1, 0, 5) | ivec3(1, 0, -12) | ivec3(0, 0, -66) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_int_to_bvec3
+ values
+ {
+ input bvec2 in0 = [ bvec2(false, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) | bvec2(true, false) | bvec2(false, false) ];
+ input int in1 = [ 0 | 255 | 1 | 2 | 8 | 11 | -192 | 5 | -12 | -66 ];
+ output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, false, true) | bvec3(false, false, true) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(true, false, true) | bvec3(true, false, true) | bvec3(false, false, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_ivec2_to_vec3
+ values
+ {
+ input bool in0 = [ false | true | false | true | true ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 0.0, -2.0) | vec3(0.0, 0.0, 0.0) | vec3(1.0, -32.0, 64.0) | vec3(1.0, 1.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_ivec2_to_ivec3
+ values
+ {
+ input bool in0 = [ false | true | false | true | true ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 0, -2) | ivec3(0, 0, 0) | ivec3(1, -32, 64) | ivec3(1, 1, 1) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_ivec2_to_bvec3
+ values
+ {
+ input bool in0 = [ false | true | false | true | true ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, false, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_to_vec2
+ values
+ {
+ input float in0 = [ 2.0 | 3.5 | -8.25 | -0.5 | 0.0 | -20.125 | 36.8125 | 1.0 ];
+ input float in1 = [ 3.5 | -20.125 | -0.5 | 2.0 | 1.0 | 0.0 | 36.8125 | -8.25 ];
+ output vec2 out0 = [ vec2(2.0, 3.5) | vec2(3.5, -20.125) | vec2(-8.25, -0.5) | vec2(-0.5, 2.0) | vec2(0.0, 1.0) | vec2(-20.125, 0.0) | vec2(36.8125, 36.8125) | vec2(1.0, -8.25) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_to_ivec2
+ values
+ {
+ input float in0 = [ 2.0 | 3.5 | -8.25 | -0.5 | 0.0 | -20.125 | 36.8125 | 1.0 ];
+ input float in1 = [ 3.5 | -20.125 | -0.5 | 2.0 | 1.0 | 0.0 | 36.8125 | -8.25 ];
+ output ivec2 out0 = [ ivec2(2, 3) | ivec2(3, -20) | ivec2(-8, 0) | ivec2(0, 2) | ivec2(0, 1) | ivec2(-20, 0) | ivec2(36, 36) | ivec2(1, -8) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_to_bvec2
+ values
+ {
+ input float in0 = [ 2.0 | 3.5 | -8.25 | -0.5 | 0.0 | -20.125 | 36.8125 | 1.0 ];
+ input float in1 = [ 3.5 | -20.125 | -0.5 | 2.0 | 1.0 | 0.0 | 36.8125 | -8.25 ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(false, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_to_vec2
+ values
+ {
+ input int in0 = [ 8 | 255 | -192 | 2 | 0 | 1 | -12 | 11 | -66 | 5 ];
+ input int in1 = [ -66 | 2 | 255 | 8 | -12 | 5 | -192 | 0 | 1 | 11 ];
+ output vec2 out0 = [ vec2(8.0, -66.0) | vec2(255.0, 2.0) | vec2(-192.0, 255.0) | vec2(2.0, 8.0) | vec2(0.0, -12.0) | vec2(1.0, 5.0) | vec2(-12.0, -192.0) | vec2(11.0, 0.0) | vec2(-66.0, 1.0) | vec2(5.0, 11.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_to_ivec2
+ values
+ {
+ input int in0 = [ 8 | 255 | -192 | 2 | 0 | 1 | -12 | 11 | -66 | 5 ];
+ input int in1 = [ -66 | 2 | 255 | 8 | -12 | 5 | -192 | 0 | 1 | 11 ];
+ output ivec2 out0 = [ ivec2(8, -66) | ivec2(255, 2) | ivec2(-192, 255) | ivec2(2, 8) | ivec2(0, -12) | ivec2(1, 5) | ivec2(-12, -192) | ivec2(11, 0) | ivec2(-66, 1) | ivec2(5, 11) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_to_bvec2
+ values
+ {
+ input int in0 = [ 8 | 255 | -192 | 2 | 0 | 1 | -12 | 11 | -66 | 5 ];
+ input int in1 = [ -66 | 2 | 255 | 8 | -12 | 5 | -192 | 0 | 1 | 11 ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_to_vec2
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ true | false ];
+ output vec2 out0 = [ vec2(1.0, 1.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_to_ivec2
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ true | false ];
+ output ivec2 out0 = [ ivec2(1, 1) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_to_bvec2
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ true | false ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_int_to_vec2
+ values
+ {
+ input float in0 = [ 1.0 | -0.5 | -20.125 | 0.0 | 3.5 | -8.25 | 36.8125 | 2.0 | 1.0 | 0.0 ];
+ input int in1 = [ -192 | -66 | 255 | 1 | 2 | 0 | -12 | 5 | 11 | 8 ];
+ output vec2 out0 = [ vec2(1.0, -192.0) | vec2(-0.5, -66.0) | vec2(-20.125, 255.0) | vec2(0.0, 1.0) | vec2(3.5, 2.0) | vec2(-8.25, 0.0) | vec2(36.8125, -12.0) | vec2(2.0, 5.0) | vec2(1.0, 11.0) | vec2(0.0, 8.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_int_to_ivec2
+ values
+ {
+ input float in0 = [ 1.0 | -0.5 | -20.125 | 0.0 | 3.5 | -8.25 | 36.8125 | 2.0 | 1.0 | 0.0 ];
+ input int in1 = [ -192 | -66 | 255 | 1 | 2 | 0 | -12 | 5 | 11 | 8 ];
+ output ivec2 out0 = [ ivec2(1, -192) | ivec2(0, -66) | ivec2(-20, 255) | ivec2(0, 1) | ivec2(3, 2) | ivec2(-8, 0) | ivec2(36, -12) | ivec2(2, 5) | ivec2(1, 11) | ivec2(0, 8) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_int_to_bvec2
+ values
+ {
+ input float in0 = [ 1.0 | -0.5 | -20.125 | 0.0 | 3.5 | -8.25 | 36.8125 | 2.0 | 1.0 | 0.0 ];
+ input int in1 = [ -192 | -66 | 255 | 1 | 2 | 0 | -12 | 5 | 11 | 8 ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(false, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_bool_to_vec2
+ values
+ {
+ input float in0 = [ 2.0 | -20.125 | 0.0 | 1.0 | -8.25 | -0.5 | 36.8125 | 3.5 ];
+ input bool in1 = [ true | false | false | false | true | true | false | true ];
+ output vec2 out0 = [ vec2(2.0, 1.0) | vec2(-20.125, 0.0) | vec2(0.0, 0.0) | vec2(1.0, 0.0) | vec2(-8.25, 1.0) | vec2(-0.5, 1.0) | vec2(36.8125, 0.0) | vec2(3.5, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_bool_to_ivec2
+ values
+ {
+ input float in0 = [ 2.0 | -20.125 | 0.0 | 1.0 | -8.25 | -0.5 | 36.8125 | 3.5 ];
+ input bool in1 = [ true | false | false | false | true | true | false | true ];
+ output ivec2 out0 = [ ivec2(2, 1) | ivec2(-20, 0) | ivec2(0, 0) | ivec2(1, 0) | ivec2(-8, 1) | ivec2(0, 1) | ivec2(36, 0) | ivec2(3, 1) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_bool_to_bvec2
+ values
+ {
+ input float in0 = [ 2.0 | -20.125 | 0.0 | 1.0 | -8.25 | -0.5 | 36.8125 | 3.5 ];
+ input bool in1 = [ true | false | false | false | true | true | false | true ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_bool_to_vec2
+ values
+ {
+ input int in0 = [ 8 | 255 | 11 | -66 | 0 | -192 | -12 | 1 | 5 | 2 ];
+ input bool in1 = [ true | false | true | false | true | false | false | true | false | true ];
+ output vec2 out0 = [ vec2(8.0, 1.0) | vec2(255.0, 0.0) | vec2(11.0, 1.0) | vec2(-66.0, 0.0) | vec2(0.0, 1.0) | vec2(-192.0, 0.0) | vec2(-12.0, 0.0) | vec2(1.0, 1.0) | vec2(5.0, 0.0) | vec2(2.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_bool_to_ivec2
+ values
+ {
+ input int in0 = [ 8 | 255 | 11 | -66 | 0 | -192 | -12 | 1 | 5 | 2 ];
+ input bool in1 = [ true | false | true | false | true | false | false | true | false | true ];
+ output ivec2 out0 = [ ivec2(8, 1) | ivec2(255, 0) | ivec2(11, 1) | ivec2(-66, 0) | ivec2(0, 1) | ivec2(-192, 0) | ivec2(-12, 0) | ivec2(1, 1) | ivec2(5, 0) | ivec2(2, 1) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_bool_to_bvec2
+ values
+ {
+ input int in0 = [ 8 | 255 | 11 | -66 | 0 | -192 | -12 | 1 | 5 | 2 ];
+ input bool in1 = [ true | false | true | false | true | false | false | true | false | true ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, false) | bvec2(false, true) | bvec2(true, false) | bvec2(true, false) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # vector_combine
+group matrix_combine "Matrix Combine Constructors"
+
+ case vec2_vec2_to_mat2
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) ];
+ input vec2 in1 = [ vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(0.0, 0.5) | vec2(1.0, 1.25) ];
+ output mat2 out0 = [ mat2(0.0, 0.5, -0.5, -2.25) | mat2(1.0, 1.25, -0.75, -0.0322580645161) | mat2(-32.0, 64.0, -32.0, 64.0) | mat2(-0.75, -0.0322580645161, 0.0, 0.5) | mat2(-0.5, -2.25, 1.0, 1.25) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_bvec2_to_mat2
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ];
+ input bvec2 in1 = [ bvec2(true, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, true) ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 1.0, 1.0) | mat2(0.0, 0.0, 0.0, 0.0) | mat2(0.0, 1.0, 1.0, 0.0) | mat2(0.0, 0.0, 0.0, 0.0) | mat2(1.0, 1.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_float_to_mat2
+ values
+ {
+ input float in0 = [ 0.0 | -0.5 | -20.125 | 2.0 | 36.8125 | 1.0 | 3.5 | -8.25 ];
+ input float in1 = [ -8.25 | 2.0 | -0.5 | -20.125 | 3.5 | 1.0 | 36.8125 | 0.0 ];
+ input float in2 = [ 36.8125 | -8.25 | 3.5 | 2.0 | -0.5 | -20.125 | 1.0 | 0.0 ];
+ input float in3 = [ 36.8125 | 0.0 | 2.0 | 3.5 | -8.25 | -0.5 | -20.125 | 1.0 ];
+ output mat2 out0 = [ mat2(0.0, -8.25, 36.8125, 36.8125) | mat2(-0.5, 2.0, -8.25, 0.0) | mat2(-20.125, -0.5, 3.5, 2.0) | mat2(2.0, -20.125, 2.0, 3.5) | mat2(36.8125, 3.5, -0.5, -8.25) | mat2(1.0, 1.0, -20.125, -0.5) | mat2(3.5, 36.8125, 1.0, -20.125) | mat2(-8.25, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_int_to_mat2
+ values
+ {
+ input int in0 = [ 2 | 0 | -66 | 8 | 1 | 255 | 5 | -12 | 11 | -192 ];
+ input int in1 = [ -192 | 2 | 5 | -12 | -66 | 255 | 8 | 1 | 11 | 0 ];
+ input int in2 = [ 2 | 11 | -192 | 255 | 1 | 5 | 0 | -12 | 8 | -66 ];
+ input int in3 = [ 255 | 0 | 11 | -66 | 2 | 8 | -192 | 1 | -12 | 5 ];
+ output mat2 out0 = [ mat2(2.0, -192.0, 2.0, 255.0) | mat2(0.0, 2.0, 11.0, 0.0) | mat2(-66.0, 5.0, -192.0, 11.0) | mat2(8.0, -12.0, 255.0, -66.0) | mat2(1.0, -66.0, 1.0, 2.0) | mat2(255.0, 255.0, 5.0, 8.0) | mat2(5.0, 8.0, 0.0, -192.0) | mat2(-12.0, 1.0, -12.0, 1.0) | mat2(11.0, 11.0, 8.0, -12.0) | mat2(-192.0, 0.0, -66.0, 5.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_bool_to_mat2
+ values
+ {
+ input bool in0 = [ false | true ];
+ input bool in1 = [ false | true ];
+ input bool in2 = [ true | false ];
+ input bool in3 = [ false | true ];
+ output mat2 out0 = [ mat2(0.0, 0.0, 1.0, 0.0) | mat2(1.0, 1.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_bool_to_mat2
+ values
+ {
+ input bool in0 = [ false | true | true | false | false | true | true | true | false | false ];
+ input float in1 = [ -0.5 | -20.125 | 3.5 | 2.0 | 1.0 | 0.0 | 0.0 | 1.0 | 36.8125 | -8.25 ];
+ input int in2 = [ -66 | -192 | 5 | 255 | 0 | -12 | 11 | 1 | 2 | 8 ];
+ input bool in3 = [ true | false | true | false | false | false | true | false | true | true ];
+ output mat2 out0 = [ mat2(0.0, -0.5, -66.0, 1.0) | mat2(1.0, -20.125, -192.0, 0.0) | mat2(1.0, 3.5, 5.0, 1.0) | mat2(0.0, 2.0, 255.0, 0.0) | mat2(0.0, 1.0, 0.0, 0.0) | mat2(1.0, 0.0, -12.0, 0.0) | mat2(1.0, 0.0, 11.0, 1.0) | mat2(1.0, 1.0, 1.0, 0.0) | mat2(0.0, 36.8125, 2.0, 1.0) | mat2(0.0, -8.25, 8.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_to_mat2
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) ];
+ input ivec2 in1 = [ ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) ];
+ output mat2 out0 = [ mat2(0.0, 0.5, -32.0, 64.0) | mat2(-32.0, 64.0, 0.0, 0.0) | mat2(-0.5, -2.25, 0.0, -2.0) | mat2(-0.75, -0.0322580645161, 0.0, 0.0) | mat2(1.0, 1.25, 1.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bvec2_to_mat2
+ values
+ {
+ input vec2 in0 = [ vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(0.0, 0.5) ];
+ input bvec2 in1 = [ bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) ];
+ output mat2 out0 = [ mat2(-32.0, 64.0, 0.0, 1.0) | mat2(-0.5, -2.25, 0.0, 0.0) | mat2(-0.75, -0.0322580645161, 1.0, 0.0) | mat2(1.0, 1.25, 0.0, 0.0) | mat2(0.0, 0.5, 1.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_float_to_mat2
+ values
+ {
+ input bvec3 in0 = [ bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, true, false) | bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, false, false) ];
+ input float in1 = [ -20.125 | -0.5 | 3.5 | -8.25 | 0.0 | 1.0 | 2.0 | 36.8125 ];
+ output mat2 out0 = [ mat2(0.0, 1.0, 0.0, -20.125) | mat2(1.0, 1.0, 1.0, -0.5) | mat2(0.0, 0.0, 0.0, 3.5) | mat2(1.0, 0.0, 0.0, -8.25) | mat2(0.0, 1.0, 0.0, 0.0) | mat2(1.0, 0.0, 0.0, 1.0) | mat2(0.0, 0.0, 0.0, 2.0) | mat2(0.0, 0.0, 0.0, 36.8125) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_float_to_mat2
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) | vec3(1.0, 1.25, 1.125) ];
+ input float in1 = [ -8.25 | 36.8125 | -0.5 | -20.125 | 1.0 | 2.0 | 0.0 | 3.5 ];
+ output mat2 out0 = [ mat2(0.0, 0.5, 0.75, -8.25) | mat2(1.0, 1.25, 1.125, 36.8125) | mat2(-0.75, -0.0322580645161, 0.0526315789474, -0.5) | mat2(-0.5, -2.25, -4.875, -20.125) | mat2(0.0, 0.5, 0.75, 1.0) | mat2(-32.0, 64.0, -51.0, 2.0) | mat2(-0.5, -2.25, -4.875, 0.0) | mat2(1.0, 1.25, 1.125, 3.5) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_ivec2_int_to_mat2
+ values
+ {
+ input int in0 = [ -66 | 255 | 8 | 0 | 5 | -12 | 1 | -192 | 2 | 11 ];
+ input ivec2 in1 = [ ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) ];
+ input int in2 = [ 0 | -12 | 8 | -66 | 11 | 5 | 255 | 2 | 1 | -192 ];
+ output mat2 out0 = [ mat2(-66.0, 0.0, -2.0, 0.0) | mat2(255.0, 0.0, 0.0, -12.0) | mat2(8.0, -32.0, 64.0, 8.0) | mat2(0.0, 1.0, 1.0, -66.0) | mat2(5.0, 0.0, 0.0, 11.0) | mat2(-12.0, 0.0, 0.0, 5.0) | mat2(1.0, -32.0, 64.0, 255.0) | mat2(-192.0, 0.0, -2.0, 2.0) | mat2(2.0, 0.0, 0.0, 1.0) | mat2(11.0, 1.0, 1.0, -192.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_ivec2_to_mat2
+ values
+ {
+ input bool in0 = [ true | true | true | false | true | false | false | false ];
+ input float in1 = [ 0.0 | 1.0 | 2.0 | -0.5 | 3.5 | -20.125 | 36.8125 | -8.25 ];
+ input ivec2 in2 = [ ivec2(1, 1) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 1.0, 1.0) | mat2(1.0, 1.0, 1.0, 1.0) | mat2(1.0, 2.0, 0.0, -2.0) | mat2(0.0, -0.5, 0.0, 0.0) | mat2(1.0, 3.5, -32.0, 64.0) | mat2(0.0, -20.125, 0.0, -2.0) | mat2(0.0, 36.8125, 0.0, 0.0) | mat2(0.0, -8.25, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_vec3_vec3_to_mat3
+ values
+ {
+ input vec3 in0 = [ vec3(1.0, 1.25, 1.125) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) ];
+ input vec3 in1 = [ vec3(-0.5, -2.25, -4.875) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ];
+ input vec3 in2 = [ vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ];
+ output mat3 out0 = [ mat3(1.0, 1.25, 1.125, -0.5, -2.25, -4.875, -0.5, -2.25, -4.875) | mat3(-0.75, -0.0322580645161, 0.0526315789474, -0.75, -0.0322580645161, 0.0526315789474, 0.0, 0.5, 0.75) | mat3(-32.0, 64.0, -51.0, 0.0, 0.5, 0.75, -0.75, -0.0322580645161, 0.0526315789474) | mat3(-0.5, -2.25, -4.875, -32.0, 64.0, -51.0, -32.0, 64.0, -51.0) | mat3(0.0, 0.5, 0.75, 1.0, 1.25, 1.125, 1.0, 1.25, 1.125) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_ivec3_ivec3_to_mat3
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, -2, -4) | ivec3(1, 1, 1) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) | ivec3(0, 0, 0) ];
+ input ivec3 in1 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ input ivec3 in2 = [ ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(0, 0, 0) | ivec3(-32, 64, -51) | ivec3(0, -2, -4) ];
+ output mat3 out0 = [ mat3(0.0, -2.0, -4.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat3(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0) | mat3(-32.0, 64.0, -51.0, 0.0, -2.0, -4.0, 0.0, 0.0, 0.0) | mat3(0.0, 0.0, 0.0, -32.0, 64.0, -51.0, -32.0, 64.0, -51.0) | mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, -4.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_float_float_int_bool_bool_to_mat3
+ values
+ {
+ input vec2 in0 = [ vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) ];
+ input ivec2 in1 = [ ivec2(-32, 64) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 0) ];
+ input float in2 = [ -20.125 | -8.25 | 3.5 | 1.0 | 1.0 | -0.5 | 2.0 | 0.0 | 36.8125 | 0.0 ];
+ input float in3 = [ 0.0 | -0.5 | 1.0 | -20.125 | 36.8125 | 0.0 | -8.25 | 2.0 | 3.5 | 1.0 ];
+ input int in4 = [ 2 | 11 | 1 | 0 | 8 | 5 | -66 | 255 | -192 | -12 ];
+ input bool in5 = [ false | true | true | false | false | true | false | true | false | true ];
+ input bool in6 = [ false | true | false | false | true | true | true | true | false | false ];
+ output mat3 out0 = [ mat3(-0.75, -0.0322580645161, -32.0, 64.0, -20.125, 0.0, 2.0, 0.0, 0.0) | mat3(1.0, 1.25, 0.0, -2.0, -8.25, -0.5, 11.0, 1.0, 1.0) | mat3(0.0, 0.5, 1.0, 1.0, 3.5, 1.0, 1.0, 1.0, 0.0) | mat3(-32.0, 64.0, 0.0, 0.0, 1.0, -20.125, 0.0, 0.0, 0.0) | mat3(-0.5, -2.25, 0.0, 0.0, 1.0, 36.8125, 8.0, 0.0, 1.0) | mat3(-32.0, 64.0, 0.0, -2.0, -0.5, 0.0, 5.0, 1.0, 1.0) | mat3(-0.75, -0.0322580645161, -32.0, 64.0, 2.0, -8.25, -66.0, 0.0, 1.0) | mat3(1.0, 1.25, 0.0, 0.0, 0.0, 2.0, 255.0, 1.0, 1.0) | mat3(0.0, 0.5, 1.0, 1.0, 36.8125, 3.5, -192.0, 0.0, 0.0) | mat3(-0.5, -2.25, 0.0, 0.0, 0.0, 1.0, -12.0, 1.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0, in1, in2, in3, in4, in5, in6);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_vec2_bool_bvec2_float_to_mat3
+ values
+ {
+ input bool in0 = [ false | false | false | true | false | false | true | true | true | true ];
+ input float in1 = [ 3.5 | -20.125 | 36.8125 | 0.0 | 2.0 | -8.25 | 1.0 | -0.5 | 1.0 | 0.0 ];
+ input int in2 = [ 255 | -192 | 11 | 0 | 8 | 5 | -66 | 2 | -12 | 1 ];
+ input vec2 in3 = [ vec2(0.0, 0.5) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) ];
+ input bool in4 = [ true | true | false | false | false | true | false | true | false | true ];
+ input bvec2 in5 = [ bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) | bvec2(true, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, true) ];
+ input float in6 = [ 0.0 | 36.8125 | 3.5 | -0.5 | -8.25 | 1.0 | 0.0 | 1.0 | -20.125 | 2.0 ];
+ output mat3 out0 = [ mat3(0.0, 3.5, 255.0, 0.0, 0.5, 1.0, 0.0, 0.0, 0.0) | mat3(0.0, -20.125, -192.0, 0.0, 0.5, 1.0, 0.0, 0.0, 36.8125) | mat3(0.0, 36.8125, 11.0, -0.5, -2.25, 0.0, 1.0, 1.0, 3.5) | mat3(1.0, 0.0, 0.0, 1.0, 1.25, 0.0, 0.0, 1.0, -0.5) | mat3(0.0, 2.0, 8.0, -0.5, -2.25, 0.0, 1.0, 1.0, -8.25) | mat3(0.0, -8.25, 5.0, -0.75, -0.0322580645161, 1.0, 0.0, 0.0, 1.0) | mat3(1.0, 1.0, -66.0, -32.0, 64.0, 0.0, 1.0, 0.0, 0.0) | mat3(1.0, -0.5, 2.0, 1.0, 1.25, 1.0, 1.0, 0.0, 1.0) | mat3(1.0, 1.0, -12.0, -0.75, -0.0322580645161, 0.0, 0.0, 0.0, -20.125) | mat3(1.0, 0.0, 1.0, -32.0, 64.0, 1.0, 0.0, 1.0, 2.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0, in1, in2, in3, in4, in5, in6);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bvec2_int_vec4_bool_to_mat3
+ values
+ {
+ input bool in0 = [ true | false | false | false | false | true | true | true | true | false ];
+ input bvec2 in1 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) | bvec2(false, true) ];
+ input int in2 = [ 2 | -66 | 1 | 8 | -12 | 0 | 5 | 11 | 255 | -192 ];
+ input vec4 in3 = [ vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.5, -2.25, -4.875, 9.0) ];
+ input bool in4 = [ false | false | true | true | true | false | true | false | false | true ];
+ output mat3 out0 = [ mat3(1.0, 1.0, 1.0, 2.0, 1.0, 1.25, 1.125, 1.75, 0.0) | mat3(0.0, 0.0, 0.0, -66.0, -0.5, -2.25, -4.875, 9.0, 0.0) | mat3(0.0, 0.0, 1.0, 1.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 1.0) | mat3(0.0, 0.0, 0.0, 8.0, 1.0, 1.25, 1.125, 1.75, 1.0) | mat3(0.0, 0.0, 0.0, -12.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 1.0) | mat3(1.0, 1.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 0.0) | mat3(1.0, 0.0, 0.0, 5.0, 0.0, 0.5, 0.75, 0.825, 1.0) | mat3(1.0, 1.0, 1.0, 11.0, 0.0, 0.5, 0.75, 0.825, 0.0) | mat3(1.0, 1.0, 0.0, 255.0, -32.0, 64.0, -51.0, 24.0, 0.0) | mat3(0.0, 0.0, 1.0, -192.0, -0.5, -2.25, -4.875, 9.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0, in1, in2, in3, in4);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_bvec4_ivec2_bool_bool_to_mat3
+ values
+ {
+ input float in0 = [ -0.5 | 36.8125 | 1.0 | 0.0 | -20.125 | 2.0 | -8.25 | 3.5 ];
+ input bvec4 in1 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(true, false, false, true) | bvec4(false, true, false, false) ];
+ input ivec2 in2 = [ ivec2(1, 1) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) | ivec2(-32, 64) ];
+ input bool in3 = [ true | false | true | false | true | false | false | true ];
+ input bool in4 = [ false | true | false | true | false | false | true | true ];
+ output mat3 out0 = [ mat3(-0.5, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0) | mat3(36.8125, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3(0.0, 0.0, 1.0, 0.0, 0.0, 0.0, -2.0, 0.0, 1.0) | mat3(-20.125, 1.0, 1.0, 1.0, 1.0, 0.0, -2.0, 1.0, 0.0) | mat3(2.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat3(-8.25, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0) | mat3(3.5, 0.0, 1.0, 0.0, 0.0, -32.0, 64.0, 1.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0, in1, in2, in3, in4);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_vec4_vec4_vec4_to_mat4
+ values
+ {
+ input vec4 in0 = [ vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) ];
+ input vec4 in1 = [ vec4(1.0, 1.25, 1.125, 1.75) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(0.0, 0.5, 0.75, 0.825) ];
+ input vec4 in2 = [ vec4(-32.0, 64.0, -51.0, 24.0) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) ];
+ input vec4 in3 = [ vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(0.0, 0.5, 0.75, 0.825) ];
+ output mat4 out0 = [ mat4(-32.0, 64.0, -51.0, 24.0, 1.0, 1.25, 1.125, 1.75, -32.0, 64.0, -51.0, 24.0, -0.5, -2.25, -4.875, 9.0) | mat4(-0.75, -0.0322580645161, 0.0526315789474, 0.25, -32.0, 64.0, -51.0, 24.0, 0.0, 0.5, 0.75, 0.825, -32.0, 64.0, -51.0, 24.0) | mat4(-0.5, -2.25, -4.875, 9.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 1.0, 1.25, 1.125, 1.75) | mat4(1.0, 1.25, 1.125, 1.75, -0.5, -2.25, -4.875, 9.0, 1.0, 1.25, 1.125, 1.75, -0.75, -0.0322580645161, 0.0526315789474, 0.25) | mat4(0.0, 0.5, 0.75, 0.825, 0.0, 0.5, 0.75, 0.825, -0.5, -2.25, -4.875, 9.0, 0.0, 0.5, 0.75, 0.825) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_ivec4_ivec4_ivec4_to_mat4
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) ];
+ input ivec4 in1 = [ ivec4(0, -2, -4, 9) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) ];
+ input ivec4 in2 = [ ivec4(0, 0, 0, 0) | ivec4(0, -2, -4, 9) | ivec4(1, 1, 1, 1) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ input ivec4 in3 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) ];
+ output mat4 out0 = [ mat4(0.0, 0.0, 0.0, 0.0, 0.0, -2.0, -4.0, 9.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4(-32.0, 64.0, -51.0, 24.0, 1.0, 1.0, 1.0, 1.0, 0.0, -2.0, -4.0, 9.0, 1.0, 1.0, 1.0, 1.0) | mat4(1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, -2.0, -4.0, 9.0) | mat4(0.0, -2.0, -4.0, 9.0, 0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 0.0, 0.0, 0.0, 0.0) | mat4(0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_bvec4_bvec4_bvec4_to_mat4
+ values
+ {
+ input bvec4 in0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, false, false, true) | bvec4(false, true, false, false) | bvec4(false, false, false, true) ];
+ input bvec4 in1 = [ bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, false, false, true) | bvec4(false, false, false, false) ];
+ input bvec4 in2 = [ bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(false, false, false, false) | bvec4(true, false, false, true) | bvec4(false, true, false, false) ];
+ input bvec4 in3 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) ];
+ output mat4 out0 = [ mat4(0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0) | mat4(1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat4(1.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0) | mat4(0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4(0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_ivec3_bvec3_vec4_ivec2_float_vec2_to_mat4
+ values
+ {
+ input float in0 = [ -0.5 | -20.125 | 1.0 | 2.0 | 3.5 | 36.8125 | -8.25 | 0.0 ];
+ input ivec3 in1 = [ ivec3(1, 1, 1) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) | ivec3(0, -2, -4) | ivec3(0, 0, 0) | ivec3(0, -2, -4) ];
+ input bvec3 in2 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) ];
+ input vec4 in3 = [ vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) ];
+ input ivec2 in4 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) ];
+ input float in5 = [ 3.5 | -20.125 | -8.25 | 0.0 | 36.8125 | -0.5 | 1.0 | 2.0 ];
+ input vec2 in6 = [ vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) ];
+ output mat4 out0 = [ mat4(-0.5, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.25, 1.125, 1.75, 0.0, 0.0, 3.5, -32.0, 64.0) | mat4(-20.125, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, -0.5, -2.25, -4.875, 9.0, 0.0, -2.0, -20.125, 1.0, 1.25) | mat4(1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.75, 0.825, 0.0, 0.0, -8.25, -0.75, -0.0322580645161) | mat4(2.0, -32.0, 64.0, -51.0, 0.0, 1.0, 0.0, 0.0, 0.5, 0.75, 0.825, -32.0, 64.0, 0.0, -0.5, -2.25) | mat4(3.5, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, -32.0, 64.0, -51.0, 24.0, 1.0, 1.0, 36.8125, 1.0, 1.25) | mat4(36.8125, 0.0, -2.0, -4.0, 1.0, 0.0, 0.0, 1.0, 1.25, 1.125, 1.75, 0.0, -2.0, -0.5, 0.0, 0.5) | mat4(-8.25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 0.0, 0.0, 1.0, 0.0, 0.5) | mat4(0.0, 0.0, -2.0, -4.0, 0.0, 1.0, 0.0, -0.5, -2.25, -4.875, 9.0, 1.0, 1.0, 2.0, -0.5, -2.25) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0, in1, in2, in3, in4, in5, in6);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # matrix_combine
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_matrix_combine.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_matrix_combine.html
new file mode 100644
index 0000000000..8b36a38db8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_matrix_combine.html
@@ -0,0 +1,42 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'conversions_matrix_combine';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_matrix_combine.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_matrix_combine.test
new file mode 100644
index 0000000000..43e32a614e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_matrix_combine.test
@@ -0,0 +1,553 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+group matrix_combine "Matrix Combine Constructors"
+
+ case vec2_vec2_to_mat2
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) ];
+ input vec2 in1 = [ vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(0.0, 0.5) | vec2(1.0, 1.25) ];
+ output mat2 out0 = [ mat2(0.0, 0.5, -0.5, -2.25) | mat2(1.0, 1.25, -0.75, -0.0322580645161) | mat2(-32.0, 64.0, -32.0, 64.0) | mat2(-0.75, -0.0322580645161, 0.0, 0.5) | mat2(-0.5, -2.25, 1.0, 1.25) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_bvec2_to_mat2
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ];
+ input bvec2 in1 = [ bvec2(true, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, true) ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 1.0, 1.0) | mat2(0.0, 0.0, 0.0, 0.0) | mat2(0.0, 1.0, 1.0, 0.0) | mat2(0.0, 0.0, 0.0, 0.0) | mat2(1.0, 1.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_float_to_mat2
+ values
+ {
+ input float in0 = [ 0.0 | -0.5 | -20.125 | 2.0 | 36.8125 | 1.0 | 3.5 | -8.25 ];
+ input float in1 = [ -8.25 | 2.0 | -0.5 | -20.125 | 3.5 | 1.0 | 36.8125 | 0.0 ];
+ input float in2 = [ 36.8125 | -8.25 | 3.5 | 2.0 | -0.5 | -20.125 | 1.0 | 0.0 ];
+ input float in3 = [ 36.8125 | 0.0 | 2.0 | 3.5 | -8.25 | -0.5 | -20.125 | 1.0 ];
+ output mat2 out0 = [ mat2(0.0, -8.25, 36.8125, 36.8125) | mat2(-0.5, 2.0, -8.25, 0.0) | mat2(-20.125, -0.5, 3.5, 2.0) | mat2(2.0, -20.125, 2.0, 3.5) | mat2(36.8125, 3.5, -0.5, -8.25) | mat2(1.0, 1.0, -20.125, -0.5) | mat2(3.5, 36.8125, 1.0, -20.125) | mat2(-8.25, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_int_to_mat2
+ values
+ {
+ input int in0 = [ 2 | 0 | -66 | 8 | 1 | 255 | 5 | -12 | 11 | -192 ];
+ input int in1 = [ -192 | 2 | 5 | -12 | -66 | 255 | 8 | 1 | 11 | 0 ];
+ input int in2 = [ 2 | 11 | -192 | 255 | 1 | 5 | 0 | -12 | 8 | -66 ];
+ input int in3 = [ 255 | 0 | 11 | -66 | 2 | 8 | -192 | 1 | -12 | 5 ];
+ output mat2 out0 = [ mat2(2.0, -192.0, 2.0, 255.0) | mat2(0.0, 2.0, 11.0, 0.0) | mat2(-66.0, 5.0, -192.0, 11.0) | mat2(8.0, -12.0, 255.0, -66.0) | mat2(1.0, -66.0, 1.0, 2.0) | mat2(255.0, 255.0, 5.0, 8.0) | mat2(5.0, 8.0, 0.0, -192.0) | mat2(-12.0, 1.0, -12.0, 1.0) | mat2(11.0, 11.0, 8.0, -12.0) | mat2(-192.0, 0.0, -66.0, 5.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_bool_to_mat2
+ values
+ {
+ input bool in0 = [ false | true ];
+ input bool in1 = [ false | true ];
+ input bool in2 = [ true | false ];
+ input bool in3 = [ false | true ];
+ output mat2 out0 = [ mat2(0.0, 0.0, 1.0, 0.0) | mat2(1.0, 1.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_bool_to_mat2
+ values
+ {
+ input bool in0 = [ false | true | true | false | false | true | true | true | false | false ];
+ input float in1 = [ -0.5 | -20.125 | 3.5 | 2.0 | 1.0 | 0.0 | 0.0 | 1.0 | 36.8125 | -8.25 ];
+ input int in2 = [ -66 | -192 | 5 | 255 | 0 | -12 | 11 | 1 | 2 | 8 ];
+ input bool in3 = [ true | false | true | false | false | false | true | false | true | true ];
+ output mat2 out0 = [ mat2(0.0, -0.5, -66.0, 1.0) | mat2(1.0, -20.125, -192.0, 0.0) | mat2(1.0, 3.5, 5.0, 1.0) | mat2(0.0, 2.0, 255.0, 0.0) | mat2(0.0, 1.0, 0.0, 0.0) | mat2(1.0, 0.0, -12.0, 0.0) | mat2(1.0, 0.0, 11.0, 1.0) | mat2(1.0, 1.0, 1.0, 0.0) | mat2(0.0, 36.8125, 2.0, 1.0) | mat2(0.0, -8.25, 8.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_to_mat2
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) ];
+ input ivec2 in1 = [ ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) ];
+ output mat2 out0 = [ mat2(0.0, 0.5, -32.0, 64.0) | mat2(-32.0, 64.0, 0.0, 0.0) | mat2(-0.5, -2.25, 0.0, -2.0) | mat2(-0.75, -0.0322580645161, 0.0, 0.0) | mat2(1.0, 1.25, 1.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bvec2_to_mat2
+ values
+ {
+ input vec2 in0 = [ vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(0.0, 0.5) ];
+ input bvec2 in1 = [ bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) ];
+ output mat2 out0 = [ mat2(-32.0, 64.0, 0.0, 1.0) | mat2(-0.5, -2.25, 0.0, 0.0) | mat2(-0.75, -0.0322580645161, 1.0, 0.0) | mat2(1.0, 1.25, 0.0, 0.0) | mat2(0.0, 0.5, 1.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_float_to_mat2
+ values
+ {
+ input bvec3 in0 = [ bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, true, false) | bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, false, false) ];
+ input float in1 = [ -20.125 | -0.5 | 3.5 | -8.25 | 0.0 | 1.0 | 2.0 | 36.8125 ];
+ output mat2 out0 = [ mat2(0.0, 1.0, 0.0, -20.125) | mat2(1.0, 1.0, 1.0, -0.5) | mat2(0.0, 0.0, 0.0, 3.5) | mat2(1.0, 0.0, 0.0, -8.25) | mat2(0.0, 1.0, 0.0, 0.0) | mat2(1.0, 0.0, 0.0, 1.0) | mat2(0.0, 0.0, 0.0, 2.0) | mat2(0.0, 0.0, 0.0, 36.8125) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_float_to_mat2
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) | vec3(1.0, 1.25, 1.125) ];
+ input float in1 = [ -8.25 | 36.8125 | -0.5 | -20.125 | 1.0 | 2.0 | 0.0 | 3.5 ];
+ output mat2 out0 = [ mat2(0.0, 0.5, 0.75, -8.25) | mat2(1.0, 1.25, 1.125, 36.8125) | mat2(-0.75, -0.0322580645161, 0.0526315789474, -0.5) | mat2(-0.5, -2.25, -4.875, -20.125) | mat2(0.0, 0.5, 0.75, 1.0) | mat2(-32.0, 64.0, -51.0, 2.0) | mat2(-0.5, -2.25, -4.875, 0.0) | mat2(1.0, 1.25, 1.125, 3.5) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_ivec2_int_to_mat2
+ values
+ {
+ input int in0 = [ -66 | 255 | 8 | 0 | 5 | -12 | 1 | -192 | 2 | 11 ];
+ input ivec2 in1 = [ ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) ];
+ input int in2 = [ 0 | -12 | 8 | -66 | 11 | 5 | 255 | 2 | 1 | -192 ];
+ output mat2 out0 = [ mat2(-66.0, 0.0, -2.0, 0.0) | mat2(255.0, 0.0, 0.0, -12.0) | mat2(8.0, -32.0, 64.0, 8.0) | mat2(0.0, 1.0, 1.0, -66.0) | mat2(5.0, 0.0, 0.0, 11.0) | mat2(-12.0, 0.0, 0.0, 5.0) | mat2(1.0, -32.0, 64.0, 255.0) | mat2(-192.0, 0.0, -2.0, 2.0) | mat2(2.0, 0.0, 0.0, 1.0) | mat2(11.0, 1.0, 1.0, -192.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_ivec2_to_mat2
+ values
+ {
+ input bool in0 = [ true | true | true | false | true | false | false | false ];
+ input float in1 = [ 0.0 | 1.0 | 2.0 | -0.5 | 3.5 | -20.125 | 36.8125 | -8.25 ];
+ input ivec2 in2 = [ ivec2(1, 1) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 1.0, 1.0) | mat2(1.0, 1.0, 1.0, 1.0) | mat2(1.0, 2.0, 0.0, -2.0) | mat2(0.0, -0.5, 0.0, 0.0) | mat2(1.0, 3.5, -32.0, 64.0) | mat2(0.0, -20.125, 0.0, -2.0) | mat2(0.0, 36.8125, 0.0, 0.0) | mat2(0.0, -8.25, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_vec3_vec3_to_mat3
+ values
+ {
+ input vec3 in0 = [ vec3(1.0, 1.25, 1.125) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) ];
+ input vec3 in1 = [ vec3(-0.5, -2.25, -4.875) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ];
+ input vec3 in2 = [ vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ];
+ output mat3 out0 = [ mat3(1.0, 1.25, 1.125, -0.5, -2.25, -4.875, -0.5, -2.25, -4.875) | mat3(-0.75, -0.0322580645161, 0.0526315789474, -0.75, -0.0322580645161, 0.0526315789474, 0.0, 0.5, 0.75) | mat3(-32.0, 64.0, -51.0, 0.0, 0.5, 0.75, -0.75, -0.0322580645161, 0.0526315789474) | mat3(-0.5, -2.25, -4.875, -32.0, 64.0, -51.0, -32.0, 64.0, -51.0) | mat3(0.0, 0.5, 0.75, 1.0, 1.25, 1.125, 1.0, 1.25, 1.125) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_ivec3_ivec3_to_mat3
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, -2, -4) | ivec3(1, 1, 1) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) | ivec3(0, 0, 0) ];
+ input ivec3 in1 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ input ivec3 in2 = [ ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(0, 0, 0) | ivec3(-32, 64, -51) | ivec3(0, -2, -4) ];
+ output mat3 out0 = [ mat3(0.0, -2.0, -4.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat3(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0) | mat3(-32.0, 64.0, -51.0, 0.0, -2.0, -4.0, 0.0, 0.0, 0.0) | mat3(0.0, 0.0, 0.0, -32.0, 64.0, -51.0, -32.0, 64.0, -51.0) | mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, -4.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_float_float_int_bool_bool_to_mat3
+ values
+ {
+ input vec2 in0 = [ vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) ];
+ input ivec2 in1 = [ ivec2(-32, 64) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 0) ];
+ input float in2 = [ -20.125 | -8.25 | 3.5 | 1.0 | 1.0 | -0.5 | 2.0 | 0.0 | 36.8125 | 0.0 ];
+ input float in3 = [ 0.0 | -0.5 | 1.0 | -20.125 | 36.8125 | 0.0 | -8.25 | 2.0 | 3.5 | 1.0 ];
+ input int in4 = [ 2 | 11 | 1 | 0 | 8 | 5 | -66 | 255 | -192 | -12 ];
+ input bool in5 = [ false | true | true | false | false | true | false | true | false | true ];
+ input bool in6 = [ false | true | false | false | true | true | true | true | false | false ];
+ output mat3 out0 = [ mat3(-0.75, -0.0322580645161, -32.0, 64.0, -20.125, 0.0, 2.0, 0.0, 0.0) | mat3(1.0, 1.25, 0.0, -2.0, -8.25, -0.5, 11.0, 1.0, 1.0) | mat3(0.0, 0.5, 1.0, 1.0, 3.5, 1.0, 1.0, 1.0, 0.0) | mat3(-32.0, 64.0, 0.0, 0.0, 1.0, -20.125, 0.0, 0.0, 0.0) | mat3(-0.5, -2.25, 0.0, 0.0, 1.0, 36.8125, 8.0, 0.0, 1.0) | mat3(-32.0, 64.0, 0.0, -2.0, -0.5, 0.0, 5.0, 1.0, 1.0) | mat3(-0.75, -0.0322580645161, -32.0, 64.0, 2.0, -8.25, -66.0, 0.0, 1.0) | mat3(1.0, 1.25, 0.0, 0.0, 0.0, 2.0, 255.0, 1.0, 1.0) | mat3(0.0, 0.5, 1.0, 1.0, 36.8125, 3.5, -192.0, 0.0, 0.0) | mat3(-0.5, -2.25, 0.0, 0.0, 0.0, 1.0, -12.0, 1.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0, in1, in2, in3, in4, in5, in6);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_vec2_bool_bvec2_float_to_mat3
+ values
+ {
+ input bool in0 = [ false | false | false | true | false | false | true | true | true | true ];
+ input float in1 = [ 3.5 | -20.125 | 36.8125 | 0.0 | 2.0 | -8.25 | 1.0 | -0.5 | 1.0 | 0.0 ];
+ input int in2 = [ 255 | -192 | 11 | 0 | 8 | 5 | -66 | 2 | -12 | 1 ];
+ input vec2 in3 = [ vec2(0.0, 0.5) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) ];
+ input bool in4 = [ true | true | false | false | false | true | false | true | false | true ];
+ input bvec2 in5 = [ bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) | bvec2(true, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, true) ];
+ input float in6 = [ 0.0 | 36.8125 | 3.5 | -0.5 | -8.25 | 1.0 | 0.0 | 1.0 | -20.125 | 2.0 ];
+ output mat3 out0 = [ mat3(0.0, 3.5, 255.0, 0.0, 0.5, 1.0, 0.0, 0.0, 0.0) | mat3(0.0, -20.125, -192.0, 0.0, 0.5, 1.0, 0.0, 0.0, 36.8125) | mat3(0.0, 36.8125, 11.0, -0.5, -2.25, 0.0, 1.0, 1.0, 3.5) | mat3(1.0, 0.0, 0.0, 1.0, 1.25, 0.0, 0.0, 1.0, -0.5) | mat3(0.0, 2.0, 8.0, -0.5, -2.25, 0.0, 1.0, 1.0, -8.25) | mat3(0.0, -8.25, 5.0, -0.75, -0.0322580645161, 1.0, 0.0, 0.0, 1.0) | mat3(1.0, 1.0, -66.0, -32.0, 64.0, 0.0, 1.0, 0.0, 0.0) | mat3(1.0, -0.5, 2.0, 1.0, 1.25, 1.0, 1.0, 0.0, 1.0) | mat3(1.0, 1.0, -12.0, -0.75, -0.0322580645161, 0.0, 0.0, 0.0, -20.125) | mat3(1.0, 0.0, 1.0, -32.0, 64.0, 1.0, 0.0, 1.0, 2.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0, in1, in2, in3, in4, in5, in6);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bvec2_int_vec4_bool_to_mat3
+ values
+ {
+ input bool in0 = [ true | false | false | false | false | true | true | true | true | false ];
+ input bvec2 in1 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) | bvec2(false, true) ];
+ input int in2 = [ 2 | -66 | 1 | 8 | -12 | 0 | 5 | 11 | 255 | -192 ];
+ input vec4 in3 = [ vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.5, -2.25, -4.875, 9.0) ];
+ input bool in4 = [ false | false | true | true | true | false | true | false | false | true ];
+ output mat3 out0 = [ mat3(1.0, 1.0, 1.0, 2.0, 1.0, 1.25, 1.125, 1.75, 0.0) | mat3(0.0, 0.0, 0.0, -66.0, -0.5, -2.25, -4.875, 9.0, 0.0) | mat3(0.0, 0.0, 1.0, 1.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 1.0) | mat3(0.0, 0.0, 0.0, 8.0, 1.0, 1.25, 1.125, 1.75, 1.0) | mat3(0.0, 0.0, 0.0, -12.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 1.0) | mat3(1.0, 1.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 0.0) | mat3(1.0, 0.0, 0.0, 5.0, 0.0, 0.5, 0.75, 0.825, 1.0) | mat3(1.0, 1.0, 1.0, 11.0, 0.0, 0.5, 0.75, 0.825, 0.0) | mat3(1.0, 1.0, 0.0, 255.0, -32.0, 64.0, -51.0, 24.0, 0.0) | mat3(0.0, 0.0, 1.0, -192.0, -0.5, -2.25, -4.875, 9.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0, in1, in2, in3, in4);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_bvec4_ivec2_bool_bool_to_mat3
+ values
+ {
+ input float in0 = [ -0.5 | 36.8125 | 1.0 | 0.0 | -20.125 | 2.0 | -8.25 | 3.5 ];
+ input bvec4 in1 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(true, false, false, true) | bvec4(false, true, false, false) ];
+ input ivec2 in2 = [ ivec2(1, 1) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) | ivec2(-32, 64) ];
+ input bool in3 = [ true | false | true | false | true | false | false | true ];
+ input bool in4 = [ false | true | false | true | false | false | true | true ];
+ output mat3 out0 = [ mat3(-0.5, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0) | mat3(36.8125, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3(0.0, 0.0, 1.0, 0.0, 0.0, 0.0, -2.0, 0.0, 1.0) | mat3(-20.125, 1.0, 1.0, 1.0, 1.0, 0.0, -2.0, 1.0, 0.0) | mat3(2.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat3(-8.25, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0) | mat3(3.5, 0.0, 1.0, 0.0, 0.0, -32.0, 64.0, 1.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0, in1, in2, in3, in4);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_vec4_vec4_vec4_to_mat4
+ values
+ {
+ input vec4 in0 = [ vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) ];
+ input vec4 in1 = [ vec4(1.0, 1.25, 1.125, 1.75) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(0.0, 0.5, 0.75, 0.825) ];
+ input vec4 in2 = [ vec4(-32.0, 64.0, -51.0, 24.0) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) ];
+ input vec4 in3 = [ vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(0.0, 0.5, 0.75, 0.825) ];
+ output mat4 out0 = [ mat4(-32.0, 64.0, -51.0, 24.0, 1.0, 1.25, 1.125, 1.75, -32.0, 64.0, -51.0, 24.0, -0.5, -2.25, -4.875, 9.0) | mat4(-0.75, -0.0322580645161, 0.0526315789474, 0.25, -32.0, 64.0, -51.0, 24.0, 0.0, 0.5, 0.75, 0.825, -32.0, 64.0, -51.0, 24.0) | mat4(-0.5, -2.25, -4.875, 9.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 1.0, 1.25, 1.125, 1.75) | mat4(1.0, 1.25, 1.125, 1.75, -0.5, -2.25, -4.875, 9.0, 1.0, 1.25, 1.125, 1.75, -0.75, -0.0322580645161, 0.0526315789474, 0.25) | mat4(0.0, 0.5, 0.75, 0.825, 0.0, 0.5, 0.75, 0.825, -0.5, -2.25, -4.875, 9.0, 0.0, 0.5, 0.75, 0.825) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_ivec4_ivec4_ivec4_to_mat4
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) ];
+ input ivec4 in1 = [ ivec4(0, -2, -4, 9) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) ];
+ input ivec4 in2 = [ ivec4(0, 0, 0, 0) | ivec4(0, -2, -4, 9) | ivec4(1, 1, 1, 1) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ input ivec4 in3 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) ];
+ output mat4 out0 = [ mat4(0.0, 0.0, 0.0, 0.0, 0.0, -2.0, -4.0, 9.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4(-32.0, 64.0, -51.0, 24.0, 1.0, 1.0, 1.0, 1.0, 0.0, -2.0, -4.0, 9.0, 1.0, 1.0, 1.0, 1.0) | mat4(1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, -2.0, -4.0, 9.0) | mat4(0.0, -2.0, -4.0, 9.0, 0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 0.0, 0.0, 0.0, 0.0) | mat4(0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_bvec4_bvec4_bvec4_to_mat4
+ values
+ {
+ input bvec4 in0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, false, false, true) | bvec4(false, true, false, false) | bvec4(false, false, false, true) ];
+ input bvec4 in1 = [ bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, false, false, true) | bvec4(false, false, false, false) ];
+ input bvec4 in2 = [ bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(false, false, false, false) | bvec4(true, false, false, true) | bvec4(false, true, false, false) ];
+ input bvec4 in3 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) ];
+ output mat4 out0 = [ mat4(0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0) | mat4(1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat4(1.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0) | mat4(0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4(0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_ivec3_bvec3_vec4_ivec2_float_vec2_to_mat4
+ values
+ {
+ input float in0 = [ -0.5 | -20.125 | 1.0 | 2.0 | 3.5 | 36.8125 | -8.25 | 0.0 ];
+ input ivec3 in1 = [ ivec3(1, 1, 1) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) | ivec3(0, -2, -4) | ivec3(0, 0, 0) | ivec3(0, -2, -4) ];
+ input bvec3 in2 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) ];
+ input vec4 in3 = [ vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) ];
+ input ivec2 in4 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) ];
+ input float in5 = [ 3.5 | -20.125 | -8.25 | 0.0 | 36.8125 | -0.5 | 1.0 | 2.0 ];
+ input vec2 in6 = [ vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) ];
+ output mat4 out0 = [ mat4(-0.5, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.25, 1.125, 1.75, 0.0, 0.0, 3.5, -32.0, 64.0) | mat4(-20.125, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, -0.5, -2.25, -4.875, 9.0, 0.0, -2.0, -20.125, 1.0, 1.25) | mat4(1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.75, 0.825, 0.0, 0.0, -8.25, -0.75, -0.0322580645161) | mat4(2.0, -32.0, 64.0, -51.0, 0.0, 1.0, 0.0, 0.0, 0.5, 0.75, 0.825, -32.0, 64.0, 0.0, -0.5, -2.25) | mat4(3.5, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, -32.0, 64.0, -51.0, 24.0, 1.0, 1.0, 36.8125, 1.0, 1.25) | mat4(36.8125, 0.0, -2.0, -4.0, 1.0, 0.0, 0.0, 1.0, 1.25, 1.125, 1.75, 0.0, -2.0, -0.5, 0.0, 0.5) | mat4(-8.25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 0.0, 0.0, 1.0, 0.0, 0.5) | mat4(0.0, 0.0, -2.0, -4.0, 0.0, 1.0, 0.0, -0.5, -2.25, -4.875, 9.0, 1.0, 1.0, 2.0, -0.5, -2.25) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0, in1, in2, in3, in4, in5, in6);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # matrix_combine
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_matrix_to_matrix.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_matrix_to_matrix.html
new file mode 100644
index 0000000000..c7def9ec14
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_matrix_to_matrix.html
@@ -0,0 +1,42 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'conversions_matrix_to_matrix';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_matrix_to_matrix.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_matrix_to_matrix.test
new file mode 100644
index 0000000000..86826940a4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_matrix_to_matrix.test
@@ -0,0 +1,206 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+group matrix_to_matrix "Matrix to Matrix Conversions"
+
+ case mat4_to_mat4
+ values
+ {
+ input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ];
+ output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4_to_mat3
+ values
+ {
+ input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4_to_mat2
+ values
+ {
+ input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3_to_mat4
+ values
+ {
+ input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.03125, 0.0625, -0.75, 0.015625, 0.03125) ];
+ output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, 0.0, 12.5, 0.03125, 0.0625, 0.0, -0.75, 0.015625, 0.03125, 0.0, 0.0, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3_to_mat3
+ values
+ {
+ input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.03125, 0.0625, -0.75, 0.015625, 0.03125) ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.03125, 0.0625, -0.75, 0.015625, 0.03125) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3_to_mat2
+ values
+ {
+ input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.03125, 0.0625, -0.75, 0.015625, 0.03125) ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.03125) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2_to_mat4
+ values
+ {
+ input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ];
+ output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(8.0, -24.0, 0.0, 0.0, 16.0, -16.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(0.125, 0.03125, 0.0, 0.0, 0.0625, 0.015625, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(-18.725, -0.0125, 0.0, 0.0, -0.5, 19.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2_to_mat3
+ values
+ {
+ input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 1.0) | mat3(8.0, -24.0, 0.0, 16.0, -16.0, 0.0, 0.0, 0.0, 1.0) | mat3(0.125, 0.03125, 0.0, 0.0625, 0.015625, 0.0, 0.0, 0.0, 1.0) | mat3(-18.725, -0.0125, 0.0, -0.5, 19.975, 0.0, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2_to_mat2
+ values
+ {
+ input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # matrix_to_matrix
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_scalar_to_matrix.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_scalar_to_matrix.html
new file mode 100644
index 0000000000..94dd7c4f8d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_scalar_to_matrix.html
@@ -0,0 +1,42 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'conversions_scalar_to_matrix';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_scalar_to_matrix.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_scalar_to_matrix.test
new file mode 100644
index 0000000000..d08377901f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_scalar_to_matrix.test
@@ -0,0 +1,206 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+group scalar_to_matrix "Scalar to Matrix Conversions"
+
+ case float_to_mat4
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output mat4 out0 = [ mat4(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.0, 0.0, 0.0, 0.0) | mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0) | mat4(3.5, 0.0, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 0.0, 3.5) | mat4(-0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0, -0.5) | mat4(-8.25, 0.0, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, 0.0, -8.25) | mat4(-20.125, 0.0, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, 0.0, -20.125) | mat4(36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_mat3
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output mat3 out0 = [ mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0) | mat3(3.5, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 3.5) | mat3(-0.5, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, -0.5) | mat3(-8.25, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, -8.25) | mat3(-20.125, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, -20.125) | mat3(36.8125, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 36.8125) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_mat2
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output mat2 out0 = [ mat2(0.0, 0.0, 0.0, 0.0) | mat2(1.0, 0.0, 0.0, 1.0) | mat2(2.0, 0.0, 0.0, 2.0) | mat2(3.5, 0.0, 0.0, 3.5) | mat2(-0.5, 0.0, 0.0, -0.5) | mat2(-8.25, 0.0, 0.0, -8.25) | mat2(-20.125, 0.0, 0.0, -20.125) | mat2(36.8125, 0.0, 0.0, 36.8125) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_mat4
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output mat4 out0 = [ mat4(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.0, 0.0, 0.0, 0.0) | mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0) | mat4(5.0, 0.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 5.0) | mat4(8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 8.0) | mat4(11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0, 11.0) | mat4(-12.0, 0.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, 0.0, -12.0) | mat4(-66.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, 0.0, -66.0) | mat4(-192.0, 0.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, 0.0, -192.0) | mat4(255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0, 255.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_mat3
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output mat3 out0 = [ mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0) | mat3(5.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 5.0) | mat3(8.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 8.0) | mat3(11.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 11.0) | mat3(-12.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, -12.0) | mat3(-66.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, -66.0) | mat3(-192.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, -192.0) | mat3(255.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 255.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_mat2
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output mat2 out0 = [ mat2(0.0, 0.0, 0.0, 0.0) | mat2(1.0, 0.0, 0.0, 1.0) | mat2(2.0, 0.0, 0.0, 2.0) | mat2(5.0, 0.0, 0.0, 5.0) | mat2(8.0, 0.0, 0.0, 8.0) | mat2(11.0, 0.0, 0.0, 11.0) | mat2(-12.0, 0.0, 0.0, -12.0) | mat2(-66.0, 0.0, 0.0, -66.0) | mat2(-192.0, 0.0, 0.0, -192.0) | mat2(255.0, 0.0, 0.0, 255.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_mat4
+ values
+ {
+ input bool in0 = [ true | false ];
+ output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(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.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_mat3
+ values
+ {
+ input bool in0 = [ true | false ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_mat2
+ values
+ {
+ input bool in0 = [ true | false ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # scalar_to_matrix
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_scalar_to_scalar.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_scalar_to_scalar.html
new file mode 100644
index 0000000000..4909afd403
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_scalar_to_scalar.html
@@ -0,0 +1,42 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'conversions_scalar_to_scalar';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_scalar_to_scalar.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_scalar_to_scalar.test
new file mode 100644
index 0000000000..4fe66869b5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_scalar_to_scalar.test
@@ -0,0 +1,206 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+group scalar_to_scalar "Scalar to Scalar Conversions"
+
+ case float_to_float
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output float out0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_int
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output int out0 = [ 0 | 1 | 2 | 3 | 0 | -8 | -20 | 36 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_bool
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output bool out0 = [ false | true | true | true | true | true | true | true ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_float
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output float out0 = [ 0.0 | 1.0 | 2.0 | 5.0 | 8.0 | 11.0 | -12.0 | -66.0 | -192.0 | 255.0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_int
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output int out0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_bool
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output bool out0 = [ false | true | true | true | true | true | true | true | true | true ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_float
+ values
+ {
+ input bool in0 = [ true | false ];
+ output float out0 = [ 1.0 | 0.0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_int
+ values
+ {
+ input bool in0 = [ true | false ];
+ output int out0 = [ 1 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_bool
+ values
+ {
+ input bool in0 = [ true | false ];
+ output bool out0 = [ true | false ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # scalar_to_scalar
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_scalar_to_vector.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_scalar_to_vector.html
new file mode 100644
index 0000000000..0cc94ce54c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_scalar_to_vector.html
@@ -0,0 +1,42 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'conversions_scalar_to_vector';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_scalar_to_vector.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_scalar_to_vector.test
new file mode 100644
index 0000000000..6bb14d8a63
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_scalar_to_vector.test
@@ -0,0 +1,602 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+group scalar_to_vector "Scalar to Vector Conversions"
+
+ case float_to_vec2
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(2.0, 2.0) | vec2(3.5, 3.5) | vec2(-0.5, -0.5) | vec2(-8.25, -8.25) | vec2(-20.125, -20.125) | vec2(36.8125, 36.8125) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_vec3
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(2.0, 2.0, 2.0) | vec3(3.5, 3.5, 3.5) | vec3(-0.5, -0.5, -0.5) | vec3(-8.25, -8.25, -8.25) | vec3(-20.125, -20.125, -20.125) | vec3(36.8125, 36.8125, 36.8125) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_vec4
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(2.0, 2.0, 2.0, 2.0) | vec4(3.5, 3.5, 3.5, 3.5) | vec4(-0.5, -0.5, -0.5, -0.5) | vec4(-8.25, -8.25, -8.25, -8.25) | vec4(-20.125, -20.125, -20.125, -20.125) | vec4(36.8125, 36.8125, 36.8125, 36.8125) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_ivec2
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(2, 2) | ivec2(3, 3) | ivec2(0, 0) | ivec2(-8, -8) | ivec2(-20, -20) | ivec2(36, 36) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_ivec3
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(2, 2, 2) | ivec3(3, 3, 3) | ivec3(0, 0, 0) | ivec3(-8, -8, -8) | ivec3(-20, -20, -20) | ivec3(36, 36, 36) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_ivec4
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(2, 2, 2, 2) | ivec4(3, 3, 3, 3) | ivec4(0, 0, 0, 0) | ivec4(-8, -8, -8, -8) | ivec4(-20, -20, -20, -20) | ivec4(36, 36, 36, 36) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_bvec2
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_bvec3
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_bvec4
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_vec2
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(2.0, 2.0) | vec2(5.0, 5.0) | vec2(8.0, 8.0) | vec2(11.0, 11.0) | vec2(-12.0, -12.0) | vec2(-66.0, -66.0) | vec2(-192.0, -192.0) | vec2(255.0, 255.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_vec3
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(2.0, 2.0, 2.0) | vec3(5.0, 5.0, 5.0) | vec3(8.0, 8.0, 8.0) | vec3(11.0, 11.0, 11.0) | vec3(-12.0, -12.0, -12.0) | vec3(-66.0, -66.0, -66.0) | vec3(-192.0, -192.0, -192.0) | vec3(255.0, 255.0, 255.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_vec4
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(2.0, 2.0, 2.0, 2.0) | vec4(5.0, 5.0, 5.0, 5.0) | vec4(8.0, 8.0, 8.0, 8.0) | vec4(11.0, 11.0, 11.0, 11.0) | vec4(-12.0, -12.0, -12.0, -12.0) | vec4(-66.0, -66.0, -66.0, -66.0) | vec4(-192.0, -192.0, -192.0, -192.0) | vec4(255.0, 255.0, 255.0, 255.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_ivec2
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(2, 2) | ivec2(5, 5) | ivec2(8, 8) | ivec2(11, 11) | ivec2(-12, -12) | ivec2(-66, -66) | ivec2(-192, -192) | ivec2(255, 255) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_ivec3
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(2, 2, 2) | ivec3(5, 5, 5) | ivec3(8, 8, 8) | ivec3(11, 11, 11) | ivec3(-12, -12, -12) | ivec3(-66, -66, -66) | ivec3(-192, -192, -192) | ivec3(255, 255, 255) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_ivec4
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(2, 2, 2, 2) | ivec4(5, 5, 5, 5) | ivec4(8, 8, 8, 8) | ivec4(11, 11, 11, 11) | ivec4(-12, -12, -12, -12) | ivec4(-66, -66, -66, -66) | ivec4(-192, -192, -192, -192) | ivec4(255, 255, 255, 255) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_bvec2
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_bvec3
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_bvec4
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_vec2
+ values
+ {
+ input bool in0 = [ true | false ];
+ output vec2 out0 = [ vec2(1.0, 1.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_vec3
+ values
+ {
+ input bool in0 = [ true | false ];
+ output vec3 out0 = [ vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_vec4
+ values
+ {
+ input bool in0 = [ true | false ];
+ output vec4 out0 = [ vec4(1.0, 1.0, 1.0, 1.0) | vec4(0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_ivec2
+ values
+ {
+ input bool in0 = [ true | false ];
+ output ivec2 out0 = [ ivec2(1, 1) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_ivec3
+ values
+ {
+ input bool in0 = [ true | false ];
+ output ivec3 out0 = [ ivec3(1, 1, 1) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_ivec4
+ values
+ {
+ input bool in0 = [ true | false ];
+ output ivec4 out0 = [ ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_bvec2
+ values
+ {
+ input bool in0 = [ true | false ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_bvec3
+ values
+ {
+ input bool in0 = [ true | false ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_bvec4
+ values
+ {
+ input bool in0 = [ true | false ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # scalar_to_vector
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_combine.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_combine.html
new file mode 100644
index 0000000000..81ec48f331
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_combine.html
@@ -0,0 +1,42 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'conversions_vector_combine';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_combine.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_combine.test
new file mode 100644
index 0000000000..222d3e6bfe
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_combine.test
@@ -0,0 +1,1844 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+group vector_combine "Vector Combine Constructors"
+
+ case vec2_vec2_to_vec4
+ values
+ {
+ input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) ];
+ input vec2 in1 = [ vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) ];
+ output vec4 out0 = [ vec4(-0.5, -2.25, -32.0, 64.0) | vec4(-32.0, 64.0, 1.0, 1.25) | vec4(1.0, 1.25, 0.0, 0.5) | vec4(0.0, 0.5, -0.5, -2.25) | vec4(-0.75, -0.0322580645161, -0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_vec2_to_ivec4
+ values
+ {
+ input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) ];
+ input vec2 in1 = [ vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) ];
+ output ivec4 out0 = [ ivec4(0, -2, -32, 64) | ivec4(-32, 64, 1, 1) | ivec4(1, 1, 0, 0) | ivec4(0, 0, 0, -2) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_vec2_to_bvec4
+ values
+ {
+ input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) ];
+ input vec2 in1 = [ vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, false, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_bvec2_to_vec4
+ values
+ {
+ input bvec2 in0 = [ bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ];
+ input bvec2 in1 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 1.0, 0.0) | vec4(1.0, 0.0, 0.0, 0.0) | vec4(0.0, 1.0, 0.0, 1.0) | vec4(0.0, 0.0, 1.0, 1.0) | vec4(1.0, 1.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_bvec2_to_ivec4
+ values
+ {
+ input bvec2 in0 = [ bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ];
+ input bvec2 in1 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output ivec4 out0 = [ ivec4(0, 0, 1, 0) | ivec4(1, 0, 0, 0) | ivec4(0, 1, 0, 1) | ivec4(0, 0, 1, 1) | ivec4(1, 1, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_bvec2_to_bvec4
+ values
+ {
+ input bvec2 in0 = [ bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ];
+ input bvec2 in1 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(true, false, false, false) | bvec4(false, true, false, true) | bvec4(false, false, true, true) | bvec4(true, true, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_float_to_vec4
+ values
+ {
+ input float in0 = [ 1.0 | 0.0 | -0.5 | -8.25 | 3.5 | -20.125 | 36.8125 | 2.0 ];
+ input float in1 = [ 0.0 | 36.8125 | -8.25 | 2.0 | 3.5 | 1.0 | -20.125 | -0.5 ];
+ input float in2 = [ 3.5 | 36.8125 | -8.25 | 1.0 | 2.0 | 0.0 | -20.125 | -0.5 ];
+ input float in3 = [ 3.5 | 36.8125 | 1.0 | -8.25 | 2.0 | 0.0 | -0.5 | -20.125 ];
+ output vec4 out0 = [ vec4(1.0, 0.0, 3.5, 3.5) | vec4(0.0, 36.8125, 36.8125, 36.8125) | vec4(-0.5, -8.25, -8.25, 1.0) | vec4(-8.25, 2.0, 1.0, -8.25) | vec4(3.5, 3.5, 2.0, 2.0) | vec4(-20.125, 1.0, 0.0, 0.0) | vec4(36.8125, -20.125, -20.125, -0.5) | vec4(2.0, -0.5, -0.5, -20.125) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_float_to_ivec4
+ values
+ {
+ input float in0 = [ 1.0 | 0.0 | -0.5 | -8.25 | 3.5 | -20.125 | 36.8125 | 2.0 ];
+ input float in1 = [ 0.0 | 36.8125 | -8.25 | 2.0 | 3.5 | 1.0 | -20.125 | -0.5 ];
+ input float in2 = [ 3.5 | 36.8125 | -8.25 | 1.0 | 2.0 | 0.0 | -20.125 | -0.5 ];
+ input float in3 = [ 3.5 | 36.8125 | 1.0 | -8.25 | 2.0 | 0.0 | -0.5 | -20.125 ];
+ output ivec4 out0 = [ ivec4(1, 0, 3, 3) | ivec4(0, 36, 36, 36) | ivec4(0, -8, -8, 1) | ivec4(-8, 2, 1, -8) | ivec4(3, 3, 2, 2) | ivec4(-20, 1, 0, 0) | ivec4(36, -20, -20, 0) | ivec4(2, 0, 0, -20) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_float_to_bvec4
+ values
+ {
+ input float in0 = [ 1.0 | 0.0 | -0.5 | -8.25 | 3.5 | -20.125 | 36.8125 | 2.0 ];
+ input float in1 = [ 0.0 | 36.8125 | -8.25 | 2.0 | 3.5 | 1.0 | -20.125 | -0.5 ];
+ input float in2 = [ 3.5 | 36.8125 | -8.25 | 1.0 | 2.0 | 0.0 | -20.125 | -0.5 ];
+ input float in3 = [ 3.5 | 36.8125 | 1.0 | -8.25 | 2.0 | 0.0 | -0.5 | -20.125 ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_int_to_vec4
+ values
+ {
+ input int in0 = [ -12 | -66 | 2 | 5 | 8 | -192 | 255 | 1 | 0 | 11 ];
+ input int in1 = [ 2 | 5 | -66 | 11 | -192 | 8 | -12 | 1 | 255 | 0 ];
+ input int in2 = [ 11 | 255 | 5 | 8 | 2 | -192 | -12 | -66 | 1 | 0 ];
+ input int in3 = [ -192 | -66 | 8 | -12 | 1 | 2 | 0 | 255 | 5 | 11 ];
+ output vec4 out0 = [ vec4(-12.0, 2.0, 11.0, -192.0) | vec4(-66.0, 5.0, 255.0, -66.0) | vec4(2.0, -66.0, 5.0, 8.0) | vec4(5.0, 11.0, 8.0, -12.0) | vec4(8.0, -192.0, 2.0, 1.0) | vec4(-192.0, 8.0, -192.0, 2.0) | vec4(255.0, -12.0, -12.0, 0.0) | vec4(1.0, 1.0, -66.0, 255.0) | vec4(0.0, 255.0, 1.0, 5.0) | vec4(11.0, 0.0, 0.0, 11.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_int_to_ivec4
+ values
+ {
+ input int in0 = [ -12 | -66 | 2 | 5 | 8 | -192 | 255 | 1 | 0 | 11 ];
+ input int in1 = [ 2 | 5 | -66 | 11 | -192 | 8 | -12 | 1 | 255 | 0 ];
+ input int in2 = [ 11 | 255 | 5 | 8 | 2 | -192 | -12 | -66 | 1 | 0 ];
+ input int in3 = [ -192 | -66 | 8 | -12 | 1 | 2 | 0 | 255 | 5 | 11 ];
+ output ivec4 out0 = [ ivec4(-12, 2, 11, -192) | ivec4(-66, 5, 255, -66) | ivec4(2, -66, 5, 8) | ivec4(5, 11, 8, -12) | ivec4(8, -192, 2, 1) | ivec4(-192, 8, -192, 2) | ivec4(255, -12, -12, 0) | ivec4(1, 1, -66, 255) | ivec4(0, 255, 1, 5) | ivec4(11, 0, 0, 11) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_int_to_bvec4
+ values
+ {
+ input int in0 = [ -12 | -66 | 2 | 5 | 8 | -192 | 255 | 1 | 0 | 11 ];
+ input int in1 = [ 2 | 5 | -66 | 11 | -192 | 8 | -12 | 1 | 255 | 0 ];
+ input int in2 = [ 11 | 255 | 5 | 8 | 2 | -192 | -12 | -66 | 1 | 0 ];
+ input int in3 = [ -192 | -66 | 8 | -12 | 1 | 2 | 0 | 255 | 5 | 11 ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, false) | bvec4(true, true, true, true) | bvec4(false, true, true, true) | bvec4(true, false, false, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_bool_to_vec4
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ false | true ];
+ input bool in2 = [ true | false ];
+ input bool in3 = [ false | true ];
+ output vec4 out0 = [ vec4(1.0, 0.0, 1.0, 0.0) | vec4(0.0, 1.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_bool_to_ivec4
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ false | true ];
+ input bool in2 = [ true | false ];
+ input bool in3 = [ false | true ];
+ output ivec4 out0 = [ ivec4(1, 0, 1, 0) | ivec4(0, 1, 0, 1) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_bool_to_bvec4
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ false | true ];
+ input bool in2 = [ true | false ];
+ input bool in3 = [ false | true ];
+ output bvec4 out0 = [ bvec4(true, false, true, false) | bvec4(false, true, false, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_bool_to_vec4
+ values
+ {
+ input bool in0 = [ true | true | true | false | false | false | true | false | true | false ];
+ input float in1 = [ 1.0 | 2.0 | 1.0 | 0.0 | 36.8125 | -8.25 | -0.5 | 3.5 | -20.125 | 0.0 ];
+ input int in2 = [ -192 | -12 | 2 | -66 | 255 | 8 | 0 | 5 | 11 | 1 ];
+ input bool in3 = [ true | true | false | false | true | false | false | false | true | true ];
+ output vec4 out0 = [ vec4(1.0, 1.0, -192.0, 1.0) | vec4(1.0, 2.0, -12.0, 1.0) | vec4(1.0, 1.0, 2.0, 0.0) | vec4(0.0, 0.0, -66.0, 0.0) | vec4(0.0, 36.8125, 255.0, 1.0) | vec4(0.0, -8.25, 8.0, 0.0) | vec4(1.0, -0.5, 0.0, 0.0) | vec4(0.0, 3.5, 5.0, 0.0) | vec4(1.0, -20.125, 11.0, 1.0) | vec4(0.0, 0.0, 1.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_bool_to_ivec4
+ values
+ {
+ input bool in0 = [ true | true | true | false | false | false | true | false | true | false ];
+ input float in1 = [ 1.0 | 2.0 | 1.0 | 0.0 | 36.8125 | -8.25 | -0.5 | 3.5 | -20.125 | 0.0 ];
+ input int in2 = [ -192 | -12 | 2 | -66 | 255 | 8 | 0 | 5 | 11 | 1 ];
+ input bool in3 = [ true | true | false | false | true | false | false | false | true | true ];
+ output ivec4 out0 = [ ivec4(1, 1, -192, 1) | ivec4(1, 2, -12, 1) | ivec4(1, 1, 2, 0) | ivec4(0, 0, -66, 0) | ivec4(0, 36, 255, 1) | ivec4(0, -8, 8, 0) | ivec4(1, 0, 0, 0) | ivec4(0, 3, 5, 0) | ivec4(1, -20, 11, 1) | ivec4(0, 0, 1, 1) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_bool_to_bvec4
+ values
+ {
+ input bool in0 = [ true | true | true | false | false | false | true | false | true | false ];
+ input float in1 = [ 1.0 | 2.0 | 1.0 | 0.0 | 36.8125 | -8.25 | -0.5 | 3.5 | -20.125 | 0.0 ];
+ input int in2 = [ -192 | -12 | 2 | -66 | 255 | 8 | 0 | 5 | 11 | 1 ];
+ input bool in3 = [ true | true | false | false | true | false | false | false | true | true ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, false) | bvec4(false, false, true, false) | bvec4(false, true, true, true) | bvec4(false, true, true, false) | bvec4(true, true, false, false) | bvec4(false, true, true, false) | bvec4(true, true, true, true) | bvec4(false, false, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_to_vec4
+ values
+ {
+ input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(1, 1) ];
+ output vec4 out0 = [ vec4(-0.5, -2.25, 0.0, 0.0) | vec4(0.0, 0.5, 0.0, -2.0) | vec4(-32.0, 64.0, -32.0, 64.0) | vec4(1.0, 1.25, 0.0, 0.0) | vec4(-0.75, -0.0322580645161, 1.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_to_ivec4
+ values
+ {
+ input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(1, 1) ];
+ output ivec4 out0 = [ ivec4(0, -2, 0, 0) | ivec4(0, 0, 0, -2) | ivec4(-32, 64, -32, 64) | ivec4(1, 1, 0, 0) | ivec4(0, 0, 1, 1) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_to_bvec4
+ values
+ {
+ input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(1, 1) ];
+ output bvec4 out0 = [ bvec4(true, true, false, false) | bvec4(false, true, false, true) | bvec4(true, true, true, true) | bvec4(true, true, false, false) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bvec2_to_vec4
+ values
+ {
+ input vec2 in0 = [ vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(0.0, 0.5) ];
+ input bvec2 in1 = [ bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, true) | bvec2(false, false) ];
+ output vec4 out0 = [ vec4(-32.0, 64.0, 0.0, 0.0) | vec4(-0.5, -2.25, 1.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.75, -0.0322580645161, 0.0, 1.0) | vec4(0.0, 0.5, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bvec2_to_ivec4
+ values
+ {
+ input vec2 in0 = [ vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(0.0, 0.5) ];
+ input bvec2 in1 = [ bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, true) | bvec2(false, false) ];
+ output ivec4 out0 = [ ivec4(-32, 64, 0, 0) | ivec4(0, -2, 1, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 1) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bvec2_to_bvec4
+ values
+ {
+ input vec2 in0 = [ vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(0.0, 0.5) ];
+ input bvec2 in1 = [ bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, false, false) | bvec4(true, true, true, false) | bvec4(true, true, true, true) | bvec4(true, true, false, true) | bvec4(false, true, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_float_to_vec4
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, true, false) | bvec3(false, true, false) | bvec3(true, true, true) ];
+ input float in1 = [ -8.25 | -20.125 | 2.0 | 0.0 | -0.5 | 3.5 | 36.8125 | 1.0 ];
+ output vec4 out0 = [ vec4(1.0, 0.0, 0.0, -8.25) | vec4(0.0, 0.0, 0.0, -20.125) | vec4(0.0, 0.0, 0.0, 2.0) | vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 0.0, 0.0, -0.5) | vec4(0.0, 1.0, 0.0, 3.5) | vec4(0.0, 1.0, 0.0, 36.8125) | vec4(1.0, 1.0, 1.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_float_to_ivec4
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, true, false) | bvec3(false, true, false) | bvec3(true, true, true) ];
+ input float in1 = [ -8.25 | -20.125 | 2.0 | 0.0 | -0.5 | 3.5 | 36.8125 | 1.0 ];
+ output ivec4 out0 = [ ivec4(1, 0, 0, -8) | ivec4(0, 0, 0, -20) | ivec4(0, 0, 0, 2) | ivec4(0, 0, 0, 0) | ivec4(1, 0, 0, 0) | ivec4(0, 1, 0, 3) | ivec4(0, 1, 0, 36) | ivec4(1, 1, 1, 1) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_float_to_bvec4
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, true, false) | bvec3(false, true, false) | bvec3(true, true, true) ];
+ input float in1 = [ -8.25 | -20.125 | 2.0 | 0.0 | -0.5 | 3.5 | 36.8125 | 1.0 ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, false, false, true) | bvec4(false, false, false, false) | bvec4(true, false, false, true) | bvec4(false, true, false, true) | bvec4(false, true, false, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_float_to_vec4
+ values
+ {
+ input vec3 in0 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ];
+ input float in1 = [ 0.0 | 2.0 | 36.8125 | 3.5 | 1.0 | -0.5 | -8.25 | -20.125 ];
+ output vec4 out0 = [ vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.0) | vec4(0.0, 0.5, 0.75, 2.0) | vec4(-0.5, -2.25, -4.875, 36.8125) | vec4(0.0, 0.5, 0.75, 3.5) | vec4(1.0, 1.25, 1.125, 1.0) | vec4(-0.5, -2.25, -4.875, -0.5) | vec4(-32.0, 64.0, -51.0, -8.25) | vec4(1.0, 1.25, 1.125, -20.125) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_float_to_ivec4
+ values
+ {
+ input vec3 in0 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ];
+ input float in1 = [ 0.0 | 2.0 | 36.8125 | 3.5 | 1.0 | -0.5 | -8.25 | -20.125 ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, 2) | ivec4(0, -2, -4, 36) | ivec4(0, 0, 0, 3) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 0) | ivec4(-32, 64, -51, -8) | ivec4(1, 1, 1, -20) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_float_to_bvec4
+ values
+ {
+ input vec3 in0 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ];
+ input float in1 = [ 0.0 | 2.0 | 36.8125 | 3.5 | 1.0 | -0.5 | -8.25 | -20.125 ];
+ output bvec4 out0 = [ bvec4(true, true, true, false) | bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_ivec2_int_to_vec4
+ values
+ {
+ input int in0 = [ -66 | 8 | -192 | 255 | 5 | -12 | 0 | 2 | 1 | 11 ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, -2) | ivec2(0, 0) ];
+ input int in2 = [ 8 | 2 | 11 | -192 | 255 | -12 | 0 | -66 | 1 | 5 ];
+ output vec4 out0 = [ vec4(-66.0, 0.0, 0.0, 8.0) | vec4(8.0, 0.0, 0.0, 2.0) | vec4(-192.0, -32.0, 64.0, 11.0) | vec4(255.0, -32.0, 64.0, -192.0) | vec4(5.0, 1.0, 1.0, 255.0) | vec4(-12.0, 0.0, 0.0, -12.0) | vec4(0.0, 1.0, 1.0, 0.0) | vec4(2.0, 0.0, -2.0, -66.0) | vec4(1.0, 0.0, -2.0, 1.0) | vec4(11.0, 0.0, 0.0, 5.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_ivec2_int_to_ivec4
+ values
+ {
+ input int in0 = [ -66 | 8 | -192 | 255 | 5 | -12 | 0 | 2 | 1 | 11 ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, -2) | ivec2(0, 0) ];
+ input int in2 = [ 8 | 2 | 11 | -192 | 255 | -12 | 0 | -66 | 1 | 5 ];
+ output ivec4 out0 = [ ivec4(-66, 0, 0, 8) | ivec4(8, 0, 0, 2) | ivec4(-192, -32, 64, 11) | ivec4(255, -32, 64, -192) | ivec4(5, 1, 1, 255) | ivec4(-12, 0, 0, -12) | ivec4(0, 1, 1, 0) | ivec4(2, 0, -2, -66) | ivec4(1, 0, -2, 1) | ivec4(11, 0, 0, 5) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_ivec2_int_to_bvec4
+ values
+ {
+ input int in0 = [ -66 | 8 | -192 | 255 | 5 | -12 | 0 | 2 | 1 | 11 ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, -2) | ivec2(0, 0) ];
+ input int in2 = [ 8 | 2 | 11 | -192 | 255 | -12 | 0 | -66 | 1 | 5 ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, false, false, true) | bvec4(false, true, true, false) | bvec4(true, false, true, true) | bvec4(true, false, true, true) | bvec4(true, false, false, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_ivec2_to_vec4
+ values
+ {
+ input bool in0 = [ true | true | true | true | false | false | false | false ];
+ input float in1 = [ 2.0 | 0.0 | 3.5 | -8.25 | 36.8125 | -20.125 | 1.0 | -0.5 ];
+ input ivec2 in2 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) ];
+ output vec4 out0 = [ vec4(1.0, 2.0, 0.0, 0.0) | vec4(1.0, 0.0, 0.0, 0.0) | vec4(1.0, 3.5, -32.0, 64.0) | vec4(1.0, -8.25, 1.0, 1.0) | vec4(0.0, 36.8125, 0.0, -2.0) | vec4(0.0, -20.125, 0.0, -2.0) | vec4(0.0, 1.0, 1.0, 1.0) | vec4(0.0, -0.5, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_ivec2_to_ivec4
+ values
+ {
+ input bool in0 = [ true | true | true | true | false | false | false | false ];
+ input float in1 = [ 2.0 | 0.0 | 3.5 | -8.25 | 36.8125 | -20.125 | 1.0 | -0.5 ];
+ input ivec2 in2 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) ];
+ output ivec4 out0 = [ ivec4(1, 2, 0, 0) | ivec4(1, 0, 0, 0) | ivec4(1, 3, -32, 64) | ivec4(1, -8, 1, 1) | ivec4(0, 36, 0, -2) | ivec4(0, -20, 0, -2) | ivec4(0, 1, 1, 1) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_ivec2_to_bvec4
+ values
+ {
+ input bool in0 = [ true | true | true | true | false | false | false | false ];
+ input float in1 = [ 2.0 | 0.0 | 3.5 | -8.25 | 36.8125 | -20.125 | 1.0 | -0.5 ];
+ input ivec2 in2 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) ];
+ output bvec4 out0 = [ bvec4(true, true, false, false) | bvec4(true, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, true, false, true) | bvec4(false, true, false, true) | bvec4(false, true, true, true) | bvec4(false, true, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_to_vec3
+ values
+ {
+ input float in0 = [ 3.5 | 2.0 | -20.125 | -8.25 | 36.8125 | 1.0 | 0.0 | -0.5 ];
+ input float in1 = [ -0.5 | 1.0 | 2.0 | -20.125 | 0.0 | -8.25 | 36.8125 | 3.5 ];
+ input float in2 = [ 0.0 | 1.0 | 3.5 | -8.25 | -0.5 | 36.8125 | -20.125 | 2.0 ];
+ output vec3 out0 = [ vec3(3.5, -0.5, 0.0) | vec3(2.0, 1.0, 1.0) | vec3(-20.125, 2.0, 3.5) | vec3(-8.25, -20.125, -8.25) | vec3(36.8125, 0.0, -0.5) | vec3(1.0, -8.25, 36.8125) | vec3(0.0, 36.8125, -20.125) | vec3(-0.5, 3.5, 2.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_to_ivec3
+ values
+ {
+ input float in0 = [ 3.5 | 2.0 | -20.125 | -8.25 | 36.8125 | 1.0 | 0.0 | -0.5 ];
+ input float in1 = [ -0.5 | 1.0 | 2.0 | -20.125 | 0.0 | -8.25 | 36.8125 | 3.5 ];
+ input float in2 = [ 0.0 | 1.0 | 3.5 | -8.25 | -0.5 | 36.8125 | -20.125 | 2.0 ];
+ output ivec3 out0 = [ ivec3(3, 0, 0) | ivec3(2, 1, 1) | ivec3(-20, 2, 3) | ivec3(-8, -20, -8) | ivec3(36, 0, 0) | ivec3(1, -8, 36) | ivec3(0, 36, -20) | ivec3(0, 3, 2) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_to_bvec3
+ values
+ {
+ input float in0 = [ 3.5 | 2.0 | -20.125 | -8.25 | 36.8125 | 1.0 | 0.0 | -0.5 ];
+ input float in1 = [ -0.5 | 1.0 | 2.0 | -20.125 | 0.0 | -8.25 | 36.8125 | 3.5 ];
+ input float in2 = [ 0.0 | 1.0 | 3.5 | -8.25 | -0.5 | 36.8125 | -20.125 | 2.0 ];
+ output bvec3 out0 = [ bvec3(true, true, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_to_vec3
+ values
+ {
+ input int in0 = [ 0 | 2 | 1 | 5 | 255 | 8 | -66 | 11 | -12 | -192 ];
+ input int in1 = [ 2 | 8 | 11 | -12 | -192 | 1 | -66 | 5 | 255 | 0 ];
+ input int in2 = [ -192 | -12 | -66 | 8 | 1 | 2 | 5 | 11 | 255 | 0 ];
+ output vec3 out0 = [ vec3(0.0, 2.0, -192.0) | vec3(2.0, 8.0, -12.0) | vec3(1.0, 11.0, -66.0) | vec3(5.0, -12.0, 8.0) | vec3(255.0, -192.0, 1.0) | vec3(8.0, 1.0, 2.0) | vec3(-66.0, -66.0, 5.0) | vec3(11.0, 5.0, 11.0) | vec3(-12.0, 255.0, 255.0) | vec3(-192.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_to_ivec3
+ values
+ {
+ input int in0 = [ 0 | 2 | 1 | 5 | 255 | 8 | -66 | 11 | -12 | -192 ];
+ input int in1 = [ 2 | 8 | 11 | -12 | -192 | 1 | -66 | 5 | 255 | 0 ];
+ input int in2 = [ -192 | -12 | -66 | 8 | 1 | 2 | 5 | 11 | 255 | 0 ];
+ output ivec3 out0 = [ ivec3(0, 2, -192) | ivec3(2, 8, -12) | ivec3(1, 11, -66) | ivec3(5, -12, 8) | ivec3(255, -192, 1) | ivec3(8, 1, 2) | ivec3(-66, -66, 5) | ivec3(11, 5, 11) | ivec3(-12, 255, 255) | ivec3(-192, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_to_bvec3
+ values
+ {
+ input int in0 = [ 0 | 2 | 1 | 5 | 255 | 8 | -66 | 11 | -12 | -192 ];
+ input int in1 = [ 2 | 8 | 11 | -12 | -192 | 1 | -66 | 5 | 255 | 0 ];
+ input int in2 = [ -192 | -12 | -66 | 8 | 1 | 2 | 5 | 11 | 255 | 0 ];
+ output bvec3 out0 = [ bvec3(false, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_to_vec3
+ values
+ {
+ input bool in0 = [ false | true ];
+ input bool in1 = [ false | true ];
+ input bool in2 = [ false | true ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_to_ivec3
+ values
+ {
+ input bool in0 = [ false | true ];
+ input bool in1 = [ false | true ];
+ input bool in2 = [ false | true ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_to_bvec3
+ values
+ {
+ input bool in0 = [ false | true ];
+ input bool in1 = [ false | true ];
+ input bool in2 = [ false | true ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_to_vec3
+ values
+ {
+ input bool in0 = [ false | true | false | true | false | true | false | true | false | true ];
+ input float in1 = [ 0.0 | 2.0 | 1.0 | -0.5 | -8.25 | 3.5 | -20.125 | 1.0 | 0.0 | 36.8125 ];
+ input int in2 = [ -12 | -192 | 2 | 5 | -66 | 255 | 11 | 0 | 8 | 1 ];
+ output vec3 out0 = [ vec3(0.0, 0.0, -12.0) | vec3(1.0, 2.0, -192.0) | vec3(0.0, 1.0, 2.0) | vec3(1.0, -0.5, 5.0) | vec3(0.0, -8.25, -66.0) | vec3(1.0, 3.5, 255.0) | vec3(0.0, -20.125, 11.0) | vec3(1.0, 1.0, 0.0) | vec3(0.0, 0.0, 8.0) | vec3(1.0, 36.8125, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_to_ivec3
+ values
+ {
+ input bool in0 = [ false | true | false | true | false | true | false | true | false | true ];
+ input float in1 = [ 0.0 | 2.0 | 1.0 | -0.5 | -8.25 | 3.5 | -20.125 | 1.0 | 0.0 | 36.8125 ];
+ input int in2 = [ -12 | -192 | 2 | 5 | -66 | 255 | 11 | 0 | 8 | 1 ];
+ output ivec3 out0 = [ ivec3(0, 0, -12) | ivec3(1, 2, -192) | ivec3(0, 1, 2) | ivec3(1, 0, 5) | ivec3(0, -8, -66) | ivec3(1, 3, 255) | ivec3(0, -20, 11) | ivec3(1, 1, 0) | ivec3(0, 0, 8) | ivec3(1, 36, 1) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_to_bvec3
+ values
+ {
+ input bool in0 = [ false | true | false | true | false | true | false | true | false | true ];
+ input float in1 = [ 0.0 | 2.0 | 1.0 | -0.5 | -8.25 | 3.5 | -20.125 | 1.0 | 0.0 | 36.8125 ];
+ input int in2 = [ -12 | -192 | 2 | 5 | -66 | 255 | 11 | 0 | 8 | 1 ];
+ output bvec3 out0 = [ bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, false) | bvec3(false, false, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bool_to_vec3
+ values
+ {
+ input vec2 in0 = [ vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) ];
+ input bool in1 = [ false | true | false | true | true ];
+ output vec3 out0 = [ vec3(-0.75, -0.0322580645161, 0.0) | vec3(1.0, 1.25, 1.0) | vec3(-0.5, -2.25, 0.0) | vec3(0.0, 0.5, 1.0) | vec3(-32.0, 64.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bool_to_ivec3
+ values
+ {
+ input vec2 in0 = [ vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) ];
+ input bool in1 = [ false | true | false | true | true ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, 0) | ivec3(0, 0, 1) | ivec3(-32, 64, 1) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bool_to_bvec3
+ values
+ {
+ input vec2 in0 = [ vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) ];
+ input bool in1 = [ false | true | false | true | true ];
+ output bvec3 out0 = [ bvec3(true, true, false) | bvec3(true, true, true) | bvec3(true, true, false) | bvec3(false, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_float_to_vec3
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ];
+ input float in1 = [ 2.0 | 36.8125 | 0.0 | -20.125 | 1.0 | -0.5 | -8.25 | 3.5 ];
+ output vec3 out0 = [ vec3(1.0, 0.0, 2.0) | vec3(0.0, 0.0, 36.8125) | vec3(1.0, 0.0, 0.0) | vec3(0.0, 1.0, -20.125) | vec3(0.0, 0.0, 1.0) | vec3(0.0, 1.0, -0.5) | vec3(0.0, 0.0, -8.25) | vec3(1.0, 1.0, 3.5) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_float_to_ivec3
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ];
+ input float in1 = [ 2.0 | 36.8125 | 0.0 | -20.125 | 1.0 | -0.5 | -8.25 | 3.5 ];
+ output ivec3 out0 = [ ivec3(1, 0, 2) | ivec3(0, 0, 36) | ivec3(1, 0, 0) | ivec3(0, 1, -20) | ivec3(0, 0, 1) | ivec3(0, 1, 0) | ivec3(0, 0, -8) | ivec3(1, 1, 3) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_float_to_bvec3
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ];
+ input float in1 = [ 2.0 | 36.8125 | 0.0 | -20.125 | 1.0 | -0.5 | -8.25 | 3.5 ];
+ output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, false, true) | bvec3(true, false, false) | bvec3(false, true, true) | bvec3(false, false, true) | bvec3(false, true, true) | bvec3(false, false, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_int_to_vec3
+ values
+ {
+ input bvec2 in0 = [ bvec2(false, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) | bvec2(true, false) | bvec2(false, false) ];
+ input int in1 = [ 0 | 255 | 1 | 2 | 8 | 11 | -192 | 5 | -12 | -66 ];
+ output vec3 out0 = [ vec3(0.0, 1.0, 0.0) | vec3(0.0, 1.0, 255.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 2.0) | vec3(0.0, 0.0, 8.0) | vec3(0.0, 0.0, 11.0) | vec3(1.0, 1.0, -192.0) | vec3(1.0, 0.0, 5.0) | vec3(1.0, 0.0, -12.0) | vec3(0.0, 0.0, -66.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_int_to_ivec3
+ values
+ {
+ input bvec2 in0 = [ bvec2(false, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) | bvec2(true, false) | bvec2(false, false) ];
+ input int in1 = [ 0 | 255 | 1 | 2 | 8 | 11 | -192 | 5 | -12 | -66 ];
+ output ivec3 out0 = [ ivec3(0, 1, 0) | ivec3(0, 1, 255) | ivec3(1, 1, 1) | ivec3(0, 0, 2) | ivec3(0, 0, 8) | ivec3(0, 0, 11) | ivec3(1, 1, -192) | ivec3(1, 0, 5) | ivec3(1, 0, -12) | ivec3(0, 0, -66) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_int_to_bvec3
+ values
+ {
+ input bvec2 in0 = [ bvec2(false, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) | bvec2(true, false) | bvec2(false, false) ];
+ input int in1 = [ 0 | 255 | 1 | 2 | 8 | 11 | -192 | 5 | -12 | -66 ];
+ output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, false, true) | bvec3(false, false, true) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(true, false, true) | bvec3(true, false, true) | bvec3(false, false, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_ivec2_to_vec3
+ values
+ {
+ input bool in0 = [ false | true | false | true | true ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 0.0, -2.0) | vec3(0.0, 0.0, 0.0) | vec3(1.0, -32.0, 64.0) | vec3(1.0, 1.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_ivec2_to_ivec3
+ values
+ {
+ input bool in0 = [ false | true | false | true | true ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 0, -2) | ivec3(0, 0, 0) | ivec3(1, -32, 64) | ivec3(1, 1, 1) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_ivec2_to_bvec3
+ values
+ {
+ input bool in0 = [ false | true | false | true | true ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, false, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_to_vec2
+ values
+ {
+ input float in0 = [ 2.0 | 3.5 | -8.25 | -0.5 | 0.0 | -20.125 | 36.8125 | 1.0 ];
+ input float in1 = [ 3.5 | -20.125 | -0.5 | 2.0 | 1.0 | 0.0 | 36.8125 | -8.25 ];
+ output vec2 out0 = [ vec2(2.0, 3.5) | vec2(3.5, -20.125) | vec2(-8.25, -0.5) | vec2(-0.5, 2.0) | vec2(0.0, 1.0) | vec2(-20.125, 0.0) | vec2(36.8125, 36.8125) | vec2(1.0, -8.25) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_to_ivec2
+ values
+ {
+ input float in0 = [ 2.0 | 3.5 | -8.25 | -0.5 | 0.0 | -20.125 | 36.8125 | 1.0 ];
+ input float in1 = [ 3.5 | -20.125 | -0.5 | 2.0 | 1.0 | 0.0 | 36.8125 | -8.25 ];
+ output ivec2 out0 = [ ivec2(2, 3) | ivec2(3, -20) | ivec2(-8, 0) | ivec2(0, 2) | ivec2(0, 1) | ivec2(-20, 0) | ivec2(36, 36) | ivec2(1, -8) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_to_bvec2
+ values
+ {
+ input float in0 = [ 2.0 | 3.5 | -8.25 | -0.5 | 0.0 | -20.125 | 36.8125 | 1.0 ];
+ input float in1 = [ 3.5 | -20.125 | -0.5 | 2.0 | 1.0 | 0.0 | 36.8125 | -8.25 ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(false, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_to_vec2
+ values
+ {
+ input int in0 = [ 8 | 255 | -192 | 2 | 0 | 1 | -12 | 11 | -66 | 5 ];
+ input int in1 = [ -66 | 2 | 255 | 8 | -12 | 5 | -192 | 0 | 1 | 11 ];
+ output vec2 out0 = [ vec2(8.0, -66.0) | vec2(255.0, 2.0) | vec2(-192.0, 255.0) | vec2(2.0, 8.0) | vec2(0.0, -12.0) | vec2(1.0, 5.0) | vec2(-12.0, -192.0) | vec2(11.0, 0.0) | vec2(-66.0, 1.0) | vec2(5.0, 11.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_to_ivec2
+ values
+ {
+ input int in0 = [ 8 | 255 | -192 | 2 | 0 | 1 | -12 | 11 | -66 | 5 ];
+ input int in1 = [ -66 | 2 | 255 | 8 | -12 | 5 | -192 | 0 | 1 | 11 ];
+ output ivec2 out0 = [ ivec2(8, -66) | ivec2(255, 2) | ivec2(-192, 255) | ivec2(2, 8) | ivec2(0, -12) | ivec2(1, 5) | ivec2(-12, -192) | ivec2(11, 0) | ivec2(-66, 1) | ivec2(5, 11) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_to_bvec2
+ values
+ {
+ input int in0 = [ 8 | 255 | -192 | 2 | 0 | 1 | -12 | 11 | -66 | 5 ];
+ input int in1 = [ -66 | 2 | 255 | 8 | -12 | 5 | -192 | 0 | 1 | 11 ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_to_vec2
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ true | false ];
+ output vec2 out0 = [ vec2(1.0, 1.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_to_ivec2
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ true | false ];
+ output ivec2 out0 = [ ivec2(1, 1) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_to_bvec2
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ true | false ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_int_to_vec2
+ values
+ {
+ input float in0 = [ 1.0 | -0.5 | -20.125 | 0.0 | 3.5 | -8.25 | 36.8125 | 2.0 | 1.0 | 0.0 ];
+ input int in1 = [ -192 | -66 | 255 | 1 | 2 | 0 | -12 | 5 | 11 | 8 ];
+ output vec2 out0 = [ vec2(1.0, -192.0) | vec2(-0.5, -66.0) | vec2(-20.125, 255.0) | vec2(0.0, 1.0) | vec2(3.5, 2.0) | vec2(-8.25, 0.0) | vec2(36.8125, -12.0) | vec2(2.0, 5.0) | vec2(1.0, 11.0) | vec2(0.0, 8.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_int_to_ivec2
+ values
+ {
+ input float in0 = [ 1.0 | -0.5 | -20.125 | 0.0 | 3.5 | -8.25 | 36.8125 | 2.0 | 1.0 | 0.0 ];
+ input int in1 = [ -192 | -66 | 255 | 1 | 2 | 0 | -12 | 5 | 11 | 8 ];
+ output ivec2 out0 = [ ivec2(1, -192) | ivec2(0, -66) | ivec2(-20, 255) | ivec2(0, 1) | ivec2(3, 2) | ivec2(-8, 0) | ivec2(36, -12) | ivec2(2, 5) | ivec2(1, 11) | ivec2(0, 8) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_int_to_bvec2
+ values
+ {
+ input float in0 = [ 1.0 | -0.5 | -20.125 | 0.0 | 3.5 | -8.25 | 36.8125 | 2.0 | 1.0 | 0.0 ];
+ input int in1 = [ -192 | -66 | 255 | 1 | 2 | 0 | -12 | 5 | 11 | 8 ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(false, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_bool_to_vec2
+ values
+ {
+ input float in0 = [ 2.0 | -20.125 | 0.0 | 1.0 | -8.25 | -0.5 | 36.8125 | 3.5 ];
+ input bool in1 = [ true | false | false | false | true | true | false | true ];
+ output vec2 out0 = [ vec2(2.0, 1.0) | vec2(-20.125, 0.0) | vec2(0.0, 0.0) | vec2(1.0, 0.0) | vec2(-8.25, 1.0) | vec2(-0.5, 1.0) | vec2(36.8125, 0.0) | vec2(3.5, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_bool_to_ivec2
+ values
+ {
+ input float in0 = [ 2.0 | -20.125 | 0.0 | 1.0 | -8.25 | -0.5 | 36.8125 | 3.5 ];
+ input bool in1 = [ true | false | false | false | true | true | false | true ];
+ output ivec2 out0 = [ ivec2(2, 1) | ivec2(-20, 0) | ivec2(0, 0) | ivec2(1, 0) | ivec2(-8, 1) | ivec2(0, 1) | ivec2(36, 0) | ivec2(3, 1) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_bool_to_bvec2
+ values
+ {
+ input float in0 = [ 2.0 | -20.125 | 0.0 | 1.0 | -8.25 | -0.5 | 36.8125 | 3.5 ];
+ input bool in1 = [ true | false | false | false | true | true | false | true ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_bool_to_vec2
+ values
+ {
+ input int in0 = [ 8 | 255 | 11 | -66 | 0 | -192 | -12 | 1 | 5 | 2 ];
+ input bool in1 = [ true | false | true | false | true | false | false | true | false | true ];
+ output vec2 out0 = [ vec2(8.0, 1.0) | vec2(255.0, 0.0) | vec2(11.0, 1.0) | vec2(-66.0, 0.0) | vec2(0.0, 1.0) | vec2(-192.0, 0.0) | vec2(-12.0, 0.0) | vec2(1.0, 1.0) | vec2(5.0, 0.0) | vec2(2.0, 1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_bool_to_ivec2
+ values
+ {
+ input int in0 = [ 8 | 255 | 11 | -66 | 0 | -192 | -12 | 1 | 5 | 2 ];
+ input bool in1 = [ true | false | true | false | true | false | false | true | false | true ];
+ output ivec2 out0 = [ ivec2(8, 1) | ivec2(255, 0) | ivec2(11, 1) | ivec2(-66, 0) | ivec2(0, 1) | ivec2(-192, 0) | ivec2(-12, 0) | ivec2(1, 1) | ivec2(5, 0) | ivec2(2, 1) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_bool_to_bvec2
+ values
+ {
+ input int in0 = [ 8 | 255 | 11 | -66 | 0 | -192 | -12 | 1 | 5 | 2 ];
+ input bool in1 = [ true | false | true | false | true | false | false | true | false | true ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, false) | bvec2(false, true) | bvec2(true, false) | bvec2(true, false) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # vector_combine
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_illegal.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_illegal.html
new file mode 100644
index 0000000000..95b31cf26b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_illegal.html
@@ -0,0 +1,42 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'conversions_vector_illegal';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_illegal.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_illegal.test
new file mode 100644
index 0000000000..3728ea7023
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_illegal.test
@@ -0,0 +1,548 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+group vector_illegal "Illegal Vector Conversions"
+
+ case vec2_to_vec3
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec2 in0 = vec2(0.0, 0.5);
+ vec3 out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_ivec3
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec2 in0 = vec2(0.0, 0.5);
+ ivec3 out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_bvec3
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec2 in0 = vec2(0.0, 0.5);
+ bvec3 out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_vec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec2 in0 = vec2(0.0, 0.5);
+ vec4 out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_ivec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec2 in0 = vec2(0.0, 0.5);
+ ivec4 out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_bvec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec2 in0 = vec2(0.0, 0.5);
+ bvec4 out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_vec3
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec2 in0 = ivec2(0, 0);
+ vec3 out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_ivec3
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec2 in0 = ivec2(0, 0);
+ ivec3 out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_bvec3
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec2 in0 = ivec2(0, 0);
+ bvec3 out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_vec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec2 in0 = ivec2(0, 0);
+ vec4 out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_ivec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec2 in0 = ivec2(0, 0);
+ ivec4 out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_bvec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec2 in0 = ivec2(0, 0);
+ bvec4 out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_vec3
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec2 in0 = bvec2(true, false);
+ vec3 out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_ivec3
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec2 in0 = bvec2(true, false);
+ ivec3 out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_bvec3
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec2 in0 = bvec2(true, false);
+ bvec3 out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_vec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec2 in0 = bvec2(true, false);
+ vec4 out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_ivec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec2 in0 = bvec2(true, false);
+ ivec4 out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_bvec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec2 in0 = bvec2(true, false);
+ bvec4 out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_vec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec3 in0 = vec3(0.0, 0.5, 0.75);
+ vec4 out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_ivec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec3 in0 = vec3(0.0, 0.5, 0.75);
+ ivec4 out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_bvec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec3 in0 = vec3(0.0, 0.5, 0.75);
+ bvec4 out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_vec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec3 in0 = ivec3(0, 0, 0);
+ vec4 out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_ivec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec3 in0 = ivec3(0, 0, 0);
+ ivec4 out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_bvec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec3 in0 = ivec3(0, 0, 0);
+ bvec4 out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_vec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec3 in0 = bvec3(true, false, false);
+ vec4 out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_ivec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec3 in0 = bvec3(true, false, false);
+ ivec4 out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_bvec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec3 in0 = bvec3(true, false, false);
+ bvec4 out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # vector_illegal
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_to_scalar.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_to_scalar.html
new file mode 100644
index 0000000000..0ce230eb20
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_to_scalar.html
@@ -0,0 +1,42 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'conversions_vector_to_scalar';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_to_scalar.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_to_scalar.test
new file mode 100644
index 0000000000..8d9bb65c53
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_to_scalar.test
@@ -0,0 +1,602 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+group vector_to_scalar "Vector to Scalar Conversions"
+
+ case vec2_to_float
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_int
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_bool
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output bool out0 = [ false | true | true | true | true ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_float
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_int
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_bool
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output bool out0 = [ false | true | true | true | true ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_float
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_int
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_bool
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output bool out0 = [ false | true | true | true | true ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_float
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output float out0 = [ 0.0 | 1.0 | 0.0 | -32.0 | 0.0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_int
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_bool
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output bool out0 = [ false | true | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_float
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output float out0 = [ 0.0 | 1.0 | 0.0 | -32.0 | 0.0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_int
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_bool
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output bool out0 = [ false | true | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_float
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output float out0 = [ 0.0 | 1.0 | 0.0 | -32.0 | 0.0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_int
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_bool
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output bool out0 = [ false | true | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_float
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output float out0 = [ 1.0 | 0.0 | 0.0 | 1.0 | 0.0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_int
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output int out0 = [ 1 | 0 | 0 | 1 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_bool
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_float
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output float out0 = [ 1.0 | 0.0 | 0.0 | 1.0 | 0.0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_int
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output int out0 = [ 1 | 0 | 0 | 1 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_bool
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_float
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output float out0 = [ 1.0 | 0.0 | 0.0 | 1.0 | 0.0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_int
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output int out0 = [ 1 | 0 | 0 | 1 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_bool
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # vector_to_scalar
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_to_vector.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_to_vector.html
new file mode 100644
index 0000000000..d2d1ce47e5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_to_vector.html
@@ -0,0 +1,42 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'conversions_vector_to_vector';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_to_vector.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_to_vector.test
new file mode 100644
index 0000000000..3ff9db6f8d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/conversions_vector_to_vector.test
@@ -0,0 +1,1196 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+group vector_to_vector "Vector to Vector Conversions"
+
+ case vec4_to_vec4
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_vec3
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_vec2
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_ivec4
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_ivec3
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_ivec2
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_bvec4
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output bvec4 out0 = [ bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_bvec3
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output bvec3 out0 = [ bvec3(false, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_bvec2
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output bvec2 out0 = [ bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_vec4
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(0.0, -2.0, -4.0, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_vec3
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, -2.0, -4.0) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_vec2
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, -2.0) | vec2(-32.0, 64.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_ivec4
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_ivec3
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_ivec2
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_bvec4
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_bvec3
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_bvec2
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_vec4
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output vec4 out0 = [ vec4(1.0, 0.0, 0.0, 1.0) | vec4(0.0, 0.0, 0.0, 1.0) | vec4(0.0, 1.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_vec3
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output vec3 out0 = [ vec3(1.0, 0.0, 0.0) | vec3(0.0, 0.0, 0.0) | vec3(0.0, 1.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_vec2
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output vec2 out0 = [ vec2(1.0, 0.0) | vec2(0.0, 0.0) | vec2(0.0, 1.0) | vec2(1.0, 1.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_ivec4
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output ivec4 out0 = [ ivec4(1, 0, 0, 1) | ivec4(0, 0, 0, 1) | ivec4(0, 1, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_ivec3
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output ivec3 out0 = [ ivec3(1, 0, 0) | ivec3(0, 0, 0) | ivec3(0, 1, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_ivec2
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output ivec2 out0 = [ ivec2(1, 0) | ivec2(0, 0) | ivec2(0, 1) | ivec2(1, 1) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_bvec4
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_bvec3
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_bvec2
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_vec3
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_vec2
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_ivec3
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_ivec2
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_bvec3
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output bvec3 out0 = [ bvec3(false, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_bvec2
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output bvec2 out0 = [ bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_vec3
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, -2.0, -4.0) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_vec2
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, -2.0) | vec2(-32.0, 64.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_ivec3
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_ivec2
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_bvec3
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_bvec2
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_vec3
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output vec3 out0 = [ vec3(1.0, 0.0, 0.0) | vec3(0.0, 0.0, 0.0) | vec3(0.0, 1.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_vec2
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output vec2 out0 = [ vec2(1.0, 0.0) | vec2(0.0, 0.0) | vec2(0.0, 1.0) | vec2(1.0, 1.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_ivec3
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output ivec3 out0 = [ ivec3(1, 0, 0) | ivec3(0, 0, 0) | ivec3(0, 1, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_ivec2
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output ivec2 out0 = [ ivec2(1, 0) | ivec2(0, 0) | ivec2(0, 1) | ivec2(1, 1) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_bvec3
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_bvec2
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_vec2
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_ivec2
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_bvec2
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output bvec2 out0 = [ bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_vec2
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, -2.0) | vec2(-32.0, 64.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_ivec2
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_bvec2
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_vec2
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output vec2 out0 = [ vec2(1.0, 0.0) | vec2(0.0, 0.0) | vec2(0.0, 1.0) | vec2(1.0, 1.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_ivec2
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output ivec2 out0 = [ ivec2(1, 0) | ivec2(0, 0) | ivec2(0, 1) | ivec2(1, 1) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_bvec2
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # vector_to_vector
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/declarations.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/declarations.html
new file mode 100644
index 0000000000..f8f9435fb5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/declarations.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'declarations';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/declarations.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/declarations.test
new file mode 100644
index 0000000000..4dfb0a4a7d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/declarations.test
@@ -0,0 +1,140 @@
+group invalid_declarations "Invalid declarations"
+ case attribute_in_vertex_main
+ expect compile_fail
+ vertex ""
+ void main()
+ {
+ attribute mediump float val;
+ gl_Position = vec4(1.0);
+ }
+ ""
+ fragment ""
+ void main()
+ {
+ gl_FragColor = vec4(1.0);
+ }
+ ""
+ end
+
+ case attribute_in_fragment
+ expect compile_fail
+ vertex ""
+ void main()
+ {
+ gl_Position = vec4(1.0);
+ }
+ ""
+ fragment ""
+ attribute mediump float val;
+ void main()
+ {
+ gl_FragColor = vec4(1.0);
+ }
+ ""
+ end
+
+ case uniform_in_vertex_main
+ expect compile_fail
+ vertex ""
+ void main()
+ {
+ uniform mediump float val;
+ gl_Position = vec4(1.0);
+ }
+ ""
+ fragment ""
+ void main()
+ {
+ gl_FragColor = vec4(1.0);
+ }
+ ""
+ end
+
+ case uniform_in_fragment_main
+ expect compile_fail
+ vertex ""
+ void main()
+ {
+ gl_Position = vec4(1.0);
+ }
+ ""
+ fragment ""
+ void main()
+ {
+ uniform mediump float val;
+ gl_FragColor = vec4(1.0);
+ }
+ ""
+ end
+
+ case varying_in_vertex_main
+ expect compile_fail
+ vertex ""
+ void main()
+ {
+ varying mediump float val;
+ gl_Position = vec4(1.0);
+ }
+ ""
+ fragment ""
+ varying mediump float val;
+ void main()
+ {
+ gl_FragColor = vec4(1.0);
+ }
+ ""
+ end
+
+ case varying_in_fragment_main
+ expect compile_fail
+ vertex ""
+ varying mediump float val;
+ void main()
+ {
+ gl_Position = vec4(1.0);
+ }
+ ""
+ fragment ""
+ void main()
+ {
+ varying mediump float val;
+ gl_FragColor = vec4(1.0);
+ }
+ ""
+ end
+
+ case invariant_attribute
+ expect compile_fail
+ vertex ""
+ invariant attribute mediump float val;
+ void main()
+ {
+ gl_Position = vec4(1.0);
+ }
+ ""
+ fragment ""
+ void main()
+ {
+ gl_FragColor = vec4(1.0);
+ }
+ ""
+ end
+
+ case invariant_uniform
+ expect compile_fail
+ vertex ""
+ invariant uniform mediump float val;
+ void main()
+ {
+ gl_Position = vec4(1.0);
+ }
+ ""
+ fragment ""
+ void main()
+ {
+ gl_FragColor = vec4(1.0);
+ }
+ ""
+ end
+
+end # invalid_declarations
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/fragdata.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/fragdata.html
new file mode 100644
index 0000000000..1e6f7e83ac
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/fragdata.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'fragdata';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/fragdata.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/fragdata.test
new file mode 100644
index 0000000000..f7ba4f2957
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/fragdata.test
@@ -0,0 +1,76 @@
+
+case invalid_assign_to_1
+ version 100 es
+ expect compile_fail
+ vertex ""
+ void main (void)
+ {
+ gl_Position = vec4(1.0);
+ }
+ ""
+ fragment ""
+ void main (void)
+ {
+ gl_FragData[1] = vec4(1.0);
+ }
+ ""
+end
+
+case write_fragcolor_and_fragdata_simple
+ version 100 es
+ expect compile_fail
+ vertex ""
+ void main (void)
+ {
+ gl_Position = vec4(1.0);
+ }
+ ""
+ fragment ""
+ void main (void)
+ {
+ gl_FragColor = vec4(1.0);
+ gl_FragData[0] = vec4(1.0);
+ }
+ ""
+end
+
+case write_fragcolor_and_fragdata_static_if
+ version 100 es
+ expect compile_fail
+ vertex ""
+ void main (void)
+ {
+ gl_Position = vec4(1.0);
+ }
+ ""
+ fragment ""
+ void main (void)
+ {
+ if (false)
+ gl_FragColor = vec4(1.0);
+ else
+ gl_FragData[0] = vec4(1.0);
+ }
+ ""
+end
+
+case write_fragcolor_and_fragdata_unused_func
+ version 100 es
+ expect compile_fail
+ vertex ""
+ void main (void)
+ {
+ gl_Position = vec4(1.0);
+ }
+ ""
+ fragment ""
+ void unused (void)
+ {
+ gl_FragData[0] = vec4(1.0);
+ }
+ void main (void)
+ {
+ gl_FragColor = vec4(1.0);
+ }
+ ""
+end
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/functions.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/functions.html
new file mode 100644
index 0000000000..f197df89a0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/functions.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'functions';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/functions.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/functions.test
new file mode 100644
index 0000000000..2161a4c81b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/functions.test
@@ -0,0 +1,3475 @@
+# Tests todo:
+# - inout with varyings, attributes, uniforms (and arrays of 'em)
+# - inout with arrays, array elements
+# - inout with array elements
+# - inout by-value semantics (arrays & elements & structs)
+
+# Done:
+# - control flow: return, return in loop, etc.
+
+group datatypes "Function Parameter Data Types"
+
+ case float_float
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float a)
+ {
+ return -a;
+ }
+
+ void main()
+ {
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_vec2
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 1.0) | vec2(2.0, 2.5) ];
+ output float out0 = [ -1.0 | -4.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (vec2 a)
+ {
+ return -(a.x + a.y);
+ }
+
+ void main()
+ {
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_vec3
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 1.0, -2.0) | vec3(2.0, 2.5, -4.0) ];
+ output float out0 = [ 1.0 | -0.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (vec3 a)
+ {
+ return -(a.x + a.y + a.z);
+ }
+
+ void main()
+ {
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_vec4
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 1.0, -2.0, 0.5) | vec4(2.0, 2.5, 4.0, -7.0) ];
+ output float out0 = [ 0.5 | -1.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (vec4 a)
+ {
+ return -(a.x + a.y + a.z + a.w);
+ }
+
+ void main()
+ {
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_mat2
+ values
+ {
+ input mat2 in0 = mat2(0.5, -1.0, 0.2, -1.0);
+ output float out0 = 0.5;
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (mat2 a)
+ {
+ //return -(a[0][0] + a[0][1] + a[1][0] + a[1][1]);
+ return a[0][0];
+ }
+
+ void main()
+ {
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_mat3
+ values
+ {
+ input mat3 in0 = [ mat3(0.0, 1.0, -2.0, 0.5, 1.0, -1.0, 2.0, 4.0, -1.0) | mat3(2.0, 2.5, 4.0, -7.0, 2.5, 3.0, 0.5, -3.5, 1.0) ];
+ output float out0 = [ -4.5 | -5.0 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (mat3 a)
+ {
+ return -(a[0][0] + a[0][1] + a[0][2] + a[1][0] + a[1][1] + a[1][2] + a[2][0] + a[2][1] + a[2][2]);
+ }
+
+ void main()
+ {
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_mat4
+ values
+ {
+ input mat4 in0 = [ mat4(0.0, 1.0, -2.0, 0.5, 1.0, -1.0, 2.0, 4.0, -1.0, 1.0, 1.0, 1.0, 1.0, 1.0, -2.0, -2.0) | mat4(2.0, 2.5, 4.0, -7.0, 2.5, 3.0, 0.5, -3.5, 1.0, 0.0, 2.0, -1.0, 1.0, 0.0, -1.0, 3.0) ];
+ output float out0 = [ -5.5 | -9.0 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (mat4 a)
+ {
+ return -(a[0][0] + a[0][1] + a[0][2] + a[0][3] + a[1][0] + a[1][1] + a[1][2] + a[1][3] + a[2][0] + a[2][1] + a[2][2] + a[2][3] + a[3][0] + a[3][1] + a[3][2] + a[3][3]);
+ }
+
+ void main()
+ {
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int
+ values
+ {
+ input int in0 = [ -1 | 0 | 1 | 4 ];
+ output int out0 = [ 1 | 0 | -1 | -4 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (int a)
+ {
+ return -a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_ivec2
+ values
+ {
+ input ivec2 in0 = [ ivec2(-1, 0) | ivec2(1, 4) ];
+ output int out0 = [ 1 | -5 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (ivec2 a)
+ {
+ return -(a.x + a.y);
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_ivec3
+ values
+ {
+ input ivec3 in0 = [ ivec3(-1, 0, 2) | ivec3(1, 4, -8) ];
+ output int out0 = [ -1 | 3 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (ivec3 a)
+ {
+ return -(a.x + a.y + a.z);
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_ivec4
+ values
+ {
+ input ivec4 in0 = [ ivec4(-1, 0, 2, 2) | ivec4(1, 4, -8, 2) ];
+ output int out0 = [ -3 | 1 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (ivec4 a)
+ {
+ return -(a.x + a.y + a.z + a.w);
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool
+ values
+ {
+ input bool in0 = [ true | false ];
+ output bool out0 = [ false | true ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ bool func (bool a)
+ {
+ return !a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bvec2
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, true) | bvec2(false, true) ];
+ output bool out0 = [ false | true ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ bool func (bvec2 a)
+ {
+ return !(a.x == a.y);
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bvec3
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, true, false) | bvec3(true, false, false) ];
+ output bool out0 = [ false | true ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ bool func (bvec3 a)
+ {
+ return (a.x == a.y) == a.z;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bvec4
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, true, true, false) | bvec4(false, false, true, true) | bvec4(true, false, false, true) ];
+ output bool out0 = [ false | true | true ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ bool func (bvec4 a)
+ {
+ return ((a.x == a.y) == (a.z == a.w));
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2
+ values
+ {
+ input mat2 in0 = [ mat2(-2.0, 0.5, -1.0, 1.0) | mat2(1.0, -3.5, -3.5, 2.5) | mat2(-2.0, -2.0, 3.5, 0.0) ];
+ output mat2 out0 = [ mat2(4.0, -1.0, 2.0, -2.0) | mat2(-2.0, 7.0, 7.0, -5.0) | mat2(4.0, 4.0, -7.0, -0.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ mat2 func (mat2 a)
+ {
+ return -2.0*a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mat3
+ values
+ {
+ input mat3 in0 = [ mat3(2.5, 0.0, 1.0, -2.5, 1.0, 3.0, 0.0, 2.0, 1.5) | mat3(-3.5, 2.0, 0.5, -1.5, -3.5, 2.5, 0.0, 1.5, 3.0) | mat3(1.5, 3.0, -1.0, 2.5, -0.5, 3.5, 3.0, -3.0, -2.5) ];
+ output mat3 out0 = [ mat3(-5.0, -0.0, -2.0, 5.0, -2.0, -6.0, -0.0, -4.0, -3.0) | mat3(7.0, -4.0, -1.0, 3.0, 7.0, -5.0, -0.0, -3.0, -6.0) | mat3(-3.0, -6.0, 2.0, -5.0, 1.0, -7.0, -6.0, 6.0, 5.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ mat3 func (mat3 a)
+ {
+ return -2.0*a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mat4
+ values
+ {
+ input mat4 in0 = [ mat4(-2.0, 3.5, -0.5, 1.0, -1.5, 0.0, -1.0, -1.0, 0.5, 0.5, 3.0, 1.5, 3.0, 2.5, 3.5, 1.5) | mat4(-2.5, 2.5, 3.5, 3.0, 0.5, 1.5, -2.0, 2.5, 0.5, -1.5, -3.5, 2.5, 3.5, -3.0, 2.5, -0.5) | mat4(-2.5, -1.5, 2.0, 3.0, -3.5, 1.0, -3.5, 1.5, -1.5, 3.0, 3.5, 0.0, 3.5, -1.5, -3.0, 0.5) ];
+ output mat4 out0 = [ mat4(4.0, -7.0, 1.0, -2.0, 3.0, -0.0, 2.0, 2.0, -1.0, -1.0, -6.0, -3.0, -6.0, -5.0, -7.0, -3.0) | mat4(5.0, -5.0, -7.0, -6.0, -1.0, -3.0, 4.0, -5.0, -1.0, 3.0, 7.0, -5.0, -7.0, 6.0, -5.0, 1.0) | mat4(5.0, 3.0, -4.0, -6.0, 7.0, -2.0, 7.0, -3.0, 3.0, -6.0, -7.0, -0.0, -7.0, 3.0, 6.0, -1.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ mat4 func (mat4 a)
+ {
+ return -2.0*a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_struct
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 1.0, -2.0) | vec3(2.0, 2.5, -4.0) ];
+ output float out0 = [ 1.0 | -0.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ struct Pos { float a, b, c; };
+
+ float func (Pos p)
+ {
+ return -(p.a + p.b + p.c);
+ }
+
+ void main()
+ {
+ Pos p = Pos(in0.x, in0.y, in0.z);
+ out0 = func(p);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case struct_struct
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 1.0, -2.0) | vec3(2.0, 2.5, -4.0) ];
+ output float out0 = [ 1.0 | -0.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ struct Pos { float a, b, c; };
+
+ Pos func (Pos p)
+ {
+ return Pos(-p.a, -p.b, -p.c);
+ }
+
+ void main()
+ {
+ Pos p = Pos(in0.x, in0.y, in0.z);
+ p = func(p);
+ out0 = p.a + p.b + p.c;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case struct_nested_struct
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 1.0, -2.0) | vec3(2.0, 2.5, -4.0) ];
+ output float out0 = [ 1.0 | -0.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ struct Pos { float a, b, c; };
+ struct Line { Pos start, end; };
+
+ Line func (Pos p)
+ {
+ return Line(p, Pos(-p.a, -p.b, -p.c));
+ }
+
+ float sum (Pos p)
+ {
+ return (p.a + p.b + p.c);
+ }
+
+ void main()
+ {
+ Pos p = Pos(in0.x, in0.y, in0.z);
+ Line line = func(p);
+ out0 = sum(line.start) + (2.0 * sum(line.end));
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # datatypes
+
+group qualifiers "Function Parameter Qualifiers"
+
+ case in_float
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ float func (in float a)
+ {
+ a = -a;
+ return 2.0 * a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float f = in0;
+ float g = func(f);
+ out0 = f + g;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case out_float
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ void func (out float a)
+ {
+ a = -1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float f = 1.0;
+ func(f);
+ out0 = f * in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case inout_float
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ void func (inout float a)
+ {
+ a = -a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float f = 1.0;
+ func(f);
+ out0 = f * in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case in_lowp_float
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ float func (in lowp float a)
+ {
+ a = -a;
+ return 2.0 * a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float f = in0;
+ float g = func(f);
+ out0 = f + g;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case out_lowp_float
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ void func (out lowp float a)
+ {
+ a = -1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float f = 1.0;
+ func(f);
+ out0 = f * in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case inout_lowp_float
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ void func (inout lowp float a)
+ {
+ a = -a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float f = 1.0;
+ func(f);
+ out0 = f * in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case in_highp_float
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ float func (in highp float a)
+ {
+ a = -a;
+ return 2.0 * a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float f = in0;
+ float g = func(f);
+ out0 = f + g;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case out_highp_float
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ void func (out highp float a)
+ {
+ a = -1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float f = 1.0;
+ func(f);
+ out0 = f * in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case inout_highp_float
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ void func (inout highp float a)
+ {
+ a = -a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float f = 1.0;
+ func(f);
+ out0 = f * in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case const_float
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ float func (const float a)
+ {
+ float b = -a;
+ return 2.0 * b;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float f = in0;
+ float g = func(f);
+ out0 = f + g;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case const_in_float
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ float func (const in float a)
+ {
+ float b = -a;
+ return 2.0 * b;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float f = in0;
+ float g = func(f);
+ out0 = f + g;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case in_int
+ values
+ {
+ input int in0 = [ 0 | 1 | -2 | 4 ];
+ output int out0 = [ 0 | -1 | 2 | -4 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (in int a)
+ {
+ a = -a;
+ return 2 * a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ int f = in0;
+ int g = func(f);
+ out0 = f + g;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case out_int
+ values
+ {
+ input int in0 = [ 0 | 1 | -2 | 6 ];
+ output int out0 = [ 0 | -1 | 2 | -6 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ void func (out int a)
+ {
+ a = -1;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ int f = 1;
+ func(f);
+ out0 = f * in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case inout_int
+ values
+ {
+ input int in0 = [ 0 | 1 | -2 | 6 ];
+ output int out0 = [ 0 | -1 | 2 | -6 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ void func (inout int a)
+ {
+ a = -a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ int f = 1;
+ func(f);
+ out0 = f * in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case in_lowp_int
+ values
+ {
+ input int in0 = [ 0 | 1 | -2 | 4 ];
+ output int out0 = [ 0 | -1 | 2 | -4 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (in lowp int a)
+ {
+ a = -a;
+ return 2 * a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ int f = in0;
+ int g = func(f);
+ out0 = f + g;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case out_lowp_int
+ values
+ {
+ input int in0 = [ 0 | 1 | -2 | 6 ];
+ output int out0 = [ 0 | -1 | 2 | -6 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ void func (out lowp int a)
+ {
+ a = -1;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ int f = 1;
+ func(f);
+ out0 = f * in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case inout_lowp_int
+ values
+ {
+ input int in0 = [ 0 | 1 | -2 | 6 ];
+ output int out0 = [ 0 | -1 | 2 | -6 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ void func (inout lowp int a)
+ {
+ a = -a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ int f = 1;
+ func(f);
+ out0 = f * in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case in_highp_int
+ values
+ {
+ input int in0 = [ 0 | 1 | -2 | 4 ];
+ output int out0 = [ 0 | -1 | 2 | -4 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (in highp int a)
+ {
+ a = -a;
+ return 2 * a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ int f = in0;
+ int g = func(f);
+ out0 = f + g;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case out_highp_int
+ values
+ {
+ input int in0 = [ 0 | 1 | -2 | 6 ];
+ output int out0 = [ 0 | -1 | 2 | -6 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ void func (out highp int a)
+ {
+ a = -1;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ int f = 1;
+ func(f);
+ out0 = f * in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case inout_highp_int
+ values
+ {
+ input int in0 = [ 0 | 1 | -2 | 6 ];
+ output int out0 = [ 0 | -1 | 2 | -6 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ void func (inout highp int a)
+ {
+ a = -a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ int f = 1;
+ func(f);
+ out0 = f * in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case const_int
+ values
+ {
+ input int in0 = [ 0 | 1 | -2 | 4 ];
+ output int out0 = [ 0 | -1 | 2 | -4 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (const int a)
+ {
+ int b = -a;
+ return 2 * b;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ int f = in0;
+ int g = func(f);
+ out0 = f + g;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case const_in_int
+ values
+ {
+ input int in0 = [ 0 | 1 | -2 | 4 ];
+ output int out0 = [ 0 | -1 | 2 | -4 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (const in int a)
+ {
+ int b = -a;
+ return 2 * b;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ int f = in0;
+ int g = func(f);
+ out0 = f + g;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case in_bool
+ values
+ {
+ input bool in0 = [ true | false ];
+ output bool out0 = [ true | true ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ bool func (in bool a)
+ {
+ a = !a;
+ return a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ bool f = in0;
+ bool g = func(f);
+ out0 = (f != g);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case out_bool
+ values
+ {
+ input bool in0 = [ true | false ];
+ output bool out0 = [ false | true ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func (out bool a)
+ {
+ a = false;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ bool f = true;
+ func(f);
+ out0 = (in0 == f);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case inout_bool
+ values
+ {
+ input bool in0 = [ true | false ];
+ output bool out0 = [ false | true ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func (inout bool a)
+ {
+ a = !a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ bool f = true;
+ func(f);
+ out0 = (in0 == f);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # qualifiers
+
+group declarations "Function Declarations"
+
+ case void_vs_no_void
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func ();
+
+ void main()
+ {
+ out0 = func() * in0;
+ ${OUTPUT}
+ }
+
+ float func (void)
+ {
+ return -1.0;
+ }
+ ""
+ end
+
+ case in_vs_no_in
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float f);
+
+ void main()
+ {
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+
+ float func (in float f)
+ {
+ return -f;
+ }
+ ""
+ end
+
+ case default_vs_explicit_precision
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float f);
+
+ void main()
+ {
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+
+ float func (mediump float f)
+ {
+ return -f;
+ }
+ ""
+ end
+
+end # declarations
+
+group overloading "Function Overloading"
+
+ case user_func_arg_type_simple
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ float func (float a)
+ {
+ return -a;
+ }
+
+ int func (int a)
+ {
+ return -a;
+ }
+
+ void main()
+ {
+ out0 = func(in0) * float(func(-1));
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case user_func_arg_float_types
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ float func (float a) { return -a; }
+ vec2 func (vec2 a) { return a.yx; }
+ vec3 func (vec3 a) { return a.xxx; }
+ vec4 func (vec4 a) { return a.wwww; }
+
+ void main()
+ {
+ out0 = func(func(func(func(vec4(in0)).xyz).xy).x);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case user_func_arg_int_types
+ values
+ {
+ input int in0 = [ 0 | 1 | -2 | 6 ];
+ output int out0 = [ 0 | -1 | 2 | -6 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (int a) { return -a; }
+ ivec2 func (ivec2 a) { return a.yx; }
+ ivec3 func (ivec3 a) { return a.xxx; }
+ ivec4 func (ivec4 a) { return a.wwww; }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(func(func(func(ivec4(in0)).xyz).xy).x);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case user_func_arg_bool_types
+ values
+ {
+ input bool in0 = [ true | false ];
+ output bool out0 = [ false | true ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ bool func (bool a) { return !a; }
+ bvec2 func (bvec2 a) { return a.yx; }
+ bvec3 func (bvec3 a) { return a.xxx; }
+ bvec4 func (bvec4 a) { return a.wwww; }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(func(func(func(bvec4(in0)).xyz).xy).x);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case user_func_arg_basic_types
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ float func (float a) { return -a; }
+ vec2 func (vec2 a) { return a.yx; }
+ vec3 func (vec3 a) { return a.xxx; }
+ vec4 func (vec4 a) { return a.wwww; }
+ int func (int a) { return -a; }
+ ivec2 func (ivec2 a) { return a.yx; }
+ ivec3 func (ivec3 a) { return a.xxx; }
+ ivec4 func (ivec4 a) { return a.wwww; }
+ bool func (bool a) { return !a; }
+ bvec2 func (bvec2 a) { return a.yx; }
+ bvec3 func (bvec3 a) { return a.xxx; }
+ bvec4 func (bvec4 a) { return a.wwww; }
+
+ void main()
+ {
+ ${SETUP}
+ if (func(func(bvec4(false)).x))
+ out0 = func(in0) * float(func(-1));
+ else
+ out0 = float(func(func(ivec4(func(func(func(vec4(0.5)).xyz).xy).xxxx)).xy).x);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case user_func_arg_complex_types
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ struct Pos { float a, b, c; };
+ struct Line { Pos start, end; };
+
+ float func (float a) { return -a; }
+ float func (float a[4]) { return a[0] + a[3]; }
+ vec2 func (vec2 a) { return a.yx; }
+ vec3 func (vec3 a) { return a.xxx; }
+ vec4 func (vec4 a) { return a.wwww; }
+ vec4 func (vec4 a[4]) { return a[1] + a[2]; }
+ int func (int a) { return -a; }
+ ivec2 func (ivec2 a) { return a.yx; }
+ ivec3 func (ivec3 a) { return a.xxx; }
+ ivec4 func (ivec4 a) { return a.wwww; }
+ bool func (bool a) { return !a; }
+ bvec2 func (bvec2 a) { return a.yx; }
+ bvec3 func (bvec3 a) { return a.xxx; }
+ bvec4 func (bvec4 a) { return a.wwww; }
+ Pos func (Pos a) { return a; }
+ Line func (Line a) { return Line(a.end, a.start); }
+
+ void main()
+ {
+ ${SETUP}
+ float arr[4];
+ vec4 arr2[4];
+ out0 = func(arr) + func(arr2).x;
+ if (func(func(bvec4(false)).x))
+ out0 = func(in0) * float(func(-1));
+ else
+ out0 = float(func(func(ivec4(func(func(func(vec4(0.5)).xyz).xy).xxxx)).xy).x);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case user_func_arguments
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float a)
+ {
+ return -a;
+ }
+
+ float func (float a, float b)
+ {
+ return a * b;
+ }
+
+ void main()
+ {
+ out0 = func(in0) * func(-0.5, -2.0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case builtin_sin
+ values
+ {
+ input int in0 = [ -1 | 0 | 1 | 4 ];
+ output int out0 = [ 1 | 0 | -1 | -4 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int sin(int a) { return -a; }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = sin(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case builtin_step
+ values
+ {
+ input int in0 = [ -1 | 0 | 1 | 4 ];
+ output int out0 = [ 1 | 0 | -1 | -4 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int step (float i, float j, int a) { return -a; }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = step(0.0, 1.0, in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case array_size
+ values
+ {
+ output float out0 = [ 1.0 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float f[3])
+ {
+ return f[0];
+ }
+
+ float func (float f[4])
+ {
+ return f[1];
+ }
+
+ void main ()
+ {
+ ${SETUP}
+ float x[4];
+ x[0] = -1.0;
+ x[1] = 1.0;
+ x[2] = x[3] = 0.0;
+ out0 = func(x);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # overloading
+
+group array_arguments "Arrays as Arguments"
+
+ case local_in_float
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ];
+ output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (in float a[4])
+ {
+ a[0] = -1.0;
+ a[2] = -4.0;
+ a[3] = -3.0 * a[1];
+ return a[0];
+ }
+
+ void main()
+ {
+ float arr[4];
+ arr[0] = in0.x;
+ arr[1] = in0.y;
+ arr[2] = in0.z;
+ arr[3] = in0.w;
+ float f = func(arr);
+ out0 = f * vec4(arr[0], arr[1], arr[2], arr[3]);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case global_in_float
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ];
+ output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (in float a[4])
+ {
+ a[0] = -1.0;
+ a[2] = -4.0;
+ a[3] = -3.0 * a[1];
+ return a[0];
+ }
+
+ float arr[4];
+
+ void main()
+ {
+ arr[0] = in0.x;
+ arr[1] = in0.y;
+ arr[2] = in0.z;
+ arr[3] = in0.w;
+ float f = func(arr);
+ out0 = f * vec4(arr[0], arr[1], arr[2], arr[3]);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case local_in_int
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 1, 2, -4) | ivec4(-7, -11, 13, 19) ];
+ output ivec4 out0 = [ ivec4(0, -1, -2, 4) | ivec4(7, 11, -13, -19) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (in int a[4])
+ {
+ a[0] = -1;
+ a[2] = -4;
+ a[3] = -3 * a[1];
+ return a[0];
+ }
+
+ void main()
+ {
+ ${SETUP}
+ int arr[4];
+ arr[0] = in0.x;
+ arr[1] = in0.y;
+ arr[2] = in0.z;
+ arr[3] = in0.w;
+ int f = func(arr);
+ out0 = f * ivec4(arr[0], arr[1], arr[2], arr[3]);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case global_in_int
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 1, 2, 4) | ivec4(-7, -11, 13, 19) ];
+ output ivec4 out0 = [ ivec4(0, -1, -2, -4) | ivec4(7, 11, -13, -19) ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (in int a[4])
+ {
+ a[0] = -1;
+ a[2] = -4;
+ a[3] = -3 * a[1];
+ return a[0];
+ }
+
+ int arr[4];
+
+ void main()
+ {
+ ${SETUP}
+ arr[0] = in0.x;
+ arr[1] = in0.y;
+ arr[2] = in0.z;
+ arr[3] = in0.w;
+ int f = func(arr);
+ out0 = f * ivec4(arr[0], arr[1], arr[2], arr[3]);
+ ${OUTPUT}
+ }
+
+ ""
+ end
+
+ case local_in_bool
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, true, false, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ bool func (in bool a[4])
+ {
+ a[0] = false;
+ a[2] = true;
+ a[3] = !a[1];
+ return a[0];
+ }
+
+ void main()
+ {
+ ${SETUP}
+ bool arr[4];
+ arr[0] = !in0.x;
+ arr[1] = !in0.y;
+ arr[2] = !in0.z;
+ arr[3] = !in0.w;
+ func(arr);
+ out0 = bvec4(arr[0], arr[1], arr[2], arr[3]);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case global_in_bool
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, true, false, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ bool func (in bool a[4])
+ {
+ a[0] = false;
+ a[2] = true;
+ a[3] = !a[1];
+ return a[0];
+ }
+
+ bool arr[4];
+
+ void main()
+ {
+ ${SETUP}
+ arr[0] = !in0.x;
+ arr[1] = !in0.y;
+ arr[2] = !in0.z;
+ arr[3] = !in0.w;
+ func(arr);
+ out0 = bvec4(arr[0], arr[1], arr[2], arr[3]);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case test_helpers
+ desc "Check that helper functions are supported properly."
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ];
+ output float out0 = [ 1.0 | 1.0 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ vec4 get (in float arr[4]);
+ void set (out float arr[4], vec4 val);
+ void negate (inout float arr[4]);
+ bool test (in float arr[4], vec4 ref);
+ bool isEqual (in float a[4], in float b[4]);
+
+ void main()
+ {
+ float arr[4];
+ set(arr, in0);
+ negate(arr);
+ out0 = float(test(arr, -in0));
+ ${OUTPUT}
+ }
+
+ float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); }
+ vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); }
+ void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; }
+ void negate (inout float arr[4]) { set(arr, -get(arr)); }
+ bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); }
+ bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); }
+ ""
+ end
+
+ case copy_local_in_on_call
+ desc "Check that local 'in' arguments are copied on call and don't alias."
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ];
+ output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ vec4 get (in float arr[4]);
+ void set (out float arr[4], vec4 val);
+ void negate (inout float arr[4]);
+ bool test (in float arr[4], vec4 ref);
+ bool isEqual (in float a[4], in float b[4]);
+
+ float func (in float a[4], in float b[4])
+ {
+ a[0] = 2.123;
+ a[2] = -4.123;
+ return isEqual(a, b) ? 1.0 : -1.0;
+ }
+
+ void main()
+ {
+ float arr[4];
+ set(arr, in0);
+ out0 = in0 * func(arr, arr);
+ ${OUTPUT}
+ }
+
+ float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); }
+ vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); }
+ void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; }
+ void negate (inout float arr[4]) { set(arr, -get(arr)); }
+ bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); }
+ bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); }
+ ""
+ end
+
+ case copy_global_in_on_call
+ desc "Check that global 'in' arguments are copied on call and don't alias."
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ];
+ output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ vec4 get (in float arr[4]);
+ void set (out float arr[4], vec4 val);
+ void negate (inout float arr[4]);
+ bool test (in float arr[4], vec4 ref);
+ bool isEqual (in float a[4], in float b[4]);
+
+ float func (in float a[4], in float b[4])
+ {
+ a[0] = 2.123;
+ a[2] = -4.123;
+ return isEqual(a, b) ? 1.0 : -1.0;
+ }
+
+ float arr[4];
+
+ void main()
+ {
+ set(arr, in0);
+ out0 = in0 * func(arr, arr);
+ ${OUTPUT}
+ }
+
+ float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); }
+ vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); }
+ void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; }
+ void negate (inout float arr[4]) { set(arr, -get(arr)); }
+ bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); }
+ bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); }
+ ""
+ end
+
+ case copy_local_inout_on_call
+ desc "Check that local 'in' arguments are copied on call and don't alias."
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ];
+ output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ vec4 get (in float arr[4]);
+ void set (out float arr[4], vec4 val);
+ void negate (inout float arr[4]);
+ bool test (in float arr[4], vec4 ref);
+ bool isEqual (in float a[4], in float b[4]);
+
+ float func (inout float a[4], inout float b[4])
+ {
+ negate(a);
+ return isEqual(a, b) ? 1.0 : -1.0;
+ }
+
+ void main()
+ {
+ float arr[4];
+ set(arr, in0);
+ float m = func(arr, arr); // returns -1.0
+ float n = float(test(arr, in0) || test(arr, -in0));
+ out0 = in0 * m * n;
+ ${OUTPUT}
+ }
+
+ float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); }
+ vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); }
+ void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; }
+ void negate (inout float arr[4]) { set(arr, -get(arr)); }
+ bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); }
+ bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); }
+ ""
+ end
+
+ case copy_global_inout_on_call
+ desc "Check that global 'in' arguments are copied on call and don't alias."
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ];
+ output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ vec4 get (in float arr[4]);
+ void set (out float arr[4], vec4 val);
+ void negate (inout float arr[4]);
+ bool test (in float arr[4], vec4 ref);
+ bool isEqual (in float a[4], in float b[4]);
+
+ float func (in float a[4], in float b[4])
+ {
+ negate(a);
+ return isEqual(a, b) ? 1.0 : -1.0;
+ }
+
+ float arr[4];
+
+ void main()
+ {
+ set(arr, in0);
+ float m = func(arr, arr); // returns -1.0
+ float n = float(test(arr, in0) || test(arr, -in0));
+ out0 = in0 * m * n;
+ ${OUTPUT}
+ }
+
+ float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); }
+ vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); }
+ void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; }
+ void negate (inout float arr[4]) { set(arr, -get(arr)); }
+ bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); }
+ bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); }
+ ""
+ end
+
+# vec4 get (in float arr[4]);
+# void set (out float arr[4], vec4 val);
+# void negate (inout float arr[4]);
+# bool test (in float arr[4], vec4 ref);
+# bool isEqual (in float a[4], in float b[4]);
+
+# float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); }
+# vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); }
+# void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; }
+# void negate (inout float arr[4]) { set(arr, -get(arr)); }
+# bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); }
+# bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); }
+
+end # array_arguments
+
+#group qualifiers "Function Parameter Qualifiers"
+#
+#end # qualifiers
+
+group control_flow "Control Flow In Functions"
+
+ case simple_return
+ values
+ {
+ input float in0 = [ -0.5 | 1.5 ];
+ output float out0 = [ 0.5 | -1.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float a)
+ {
+ return -a;
+ a = a * -1.0;
+ return 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case return_in_if
+ values
+ {
+ input float in0 = [ -0.5 | 1.5 ];
+ output float out0 = [ 0.5 | -1.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float a)
+ {
+ if (a != 0.0)
+ return -a;
+ return 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case return_in_else
+ values
+ {
+ input float in0 = [ -0.5 | 1.5 ];
+ output float out0 = [ 0.5 | -1.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float a)
+ {
+ if (a == 0.0)
+ return 1.0;
+ else
+ return -a;
+ return 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case return_in_loop
+ values
+ {
+ input float in0 = [ -0.5 | 1.5 ];
+ output float out0 = [ 0.5 | -1.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float a)
+ {
+ for (int i = 0; i < 1; i++)
+ return -a;
+ return 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case return_in_loop_if
+ values
+ {
+ input float in0 = [ -0.5 | 1.5 ];
+ output float out0 = [ 0.5 | -1.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float a)
+ {
+ for (int i = 0; i < 3; i++)
+ {
+ if (i == 1)
+ return a;
+ else if (i > 1)
+ return -1.0;
+ a = -a;
+ }
+ return 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case return_after_loop
+ values
+ {
+ input float in0 = [ -0.5 | 1.5 ];
+ output float out0 = [ 0.5 | -1.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float a)
+ {
+ for (int i = 0; i < 5; i++)
+ a = -a;
+ return a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case return_after_break
+ values
+ {
+ input float in0 = [ -0.5 | 1.5 ];
+ output float out0 = [ 0.5 | -1.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float a)
+ {
+ for (int i = 0; i < 6; i++)
+ {
+ a = -a;
+ if (i == 4)
+ break;
+ }
+ return a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case return_after_continue
+ values
+ {
+ input float in0 = [ -0.5 | 1.5 ];
+ output float out0 = [ 0.5 | -1.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float a)
+ {
+ for (int i = 0; i < 6; i++)
+ {
+ if (i == 4)
+ continue;
+ a = -a;
+ }
+ return a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case return_in_nested_loop
+ values
+ {
+ input float in0 = [ -0.5 | 1.5 ];
+ output float out0 = [ 0.5 | -1.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float a)
+ {
+ for (int i = 0; i < 6; i++)
+ {
+ a = -a;
+ for (int j = 0; j < 4; j++)
+ {
+ a = -a;
+ if (i == 1)
+ return a;
+ }
+ if (i == 4)
+ return 1.0;
+ }
+ return 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case return_after_loop_sequence
+ values
+ {
+ input float in0 = [ -0.5 | 1.5 ];
+ output float out0 = [ 0.5 | -1.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float a)
+ {
+ for (int i = 0; i < 6; i++) // negate a
+ {
+ a = -a;
+ if (i == 4)
+ a = -a;
+ }
+
+ for (int i = 6; i < 10; i++) // keep a
+ {
+ if (i == 8)
+ continue;
+ else if (i == 9)
+ break;
+ a = -a;
+ }
+
+ return a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mixed_return_break_continue
+ values
+ {
+ input float in0 = [ -0.5 | 1.5 ];
+ output float out0 = [ 0.5 | -1.5 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float a)
+ {
+ for (int i = 0; i < 6; i++)
+ {
+ if (i == 0)
+ continue;
+ else if (i == 1)
+ {
+ }
+ else if (i == 3)
+ break;
+ else
+ return a;
+ a = -a;
+ }
+
+ return 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # control_flow
+
+group misc "Miscellaneous"
+
+ case multi_arg_float
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 1.0, -2.0, 0.5) | vec4(2.0, 2.5, 4.0, -7.0) ];
+ output float out0 = [ 0.5 | -1.5 ]; # -sum(in0)
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float sum(vec4 v) { return (v.x + v.y + v.z + v.w); }
+
+ float func (float a, vec3 b, vec2 c, vec2 d, vec4 e)
+ {
+ return -sum(vec4(a, b) + vec4(c, d)) + sum(e);
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0.y, in0.xzw, in0.wz, in0.yx, in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case multi_arg_int
+ values
+ {
+ input ivec4 in0 = [ ivec4(-1, 0, 2, 2) | ivec4(1, 4, -8, 2) ];
+ output int out0 = [ -3 | 1 ];
+ }
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int sum(ivec4 v) { return (v.x + v.y + v.z + v.w); }
+
+ int func (int a, ivec3 b, ivec2 c, ivec2 d, ivec4 e)
+ {
+ return -sum(ivec4(a, b) + ivec4(c, d)) + sum(e);
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0.y, in0.xzw, in0.wz, in0.yx, in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case argument_eval_order_1
+ values
+ {
+ input int in0 = [ 0 | 1 | 3 | 5 ];
+ output int out0 = [ -1 | 5 | 11 | 17 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ int func (float a, int b, bool c, int d)
+ {
+ if (c)
+ return b + int(a) + d;
+ else
+ return -1;
+ }
+
+ void main ()
+ {
+ ${SETUP}
+ float v0 = float(in0);
+ int v1 = in0;
+ out0 = func((v0 += 1.0), v1++, (v0 > 1.5), v1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case argument_eval_order_2
+ values
+ {
+ input int in0 = [ 0 | -1 | 3 | 5 ];
+ output int out0 = [ 3 | -1 | 9 | 13 ];
+ }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ int g;
+
+ int modG (int v)
+ {
+ g += v;
+ return v;
+ }
+
+ int func (float a, int b, bool c, int d)
+ {
+ if (c)
+ return b + int(a) + d;
+ else
+ return -1;
+ }
+
+ void main ()
+ {
+ ${SETUP}
+ out0 = func(float(g = in0), modG(2), --g > 0, g);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case missing_returns
+ values
+ {
+ input float in0 = [ 1.0 | 2.0 | 3.0 ];
+ output float out0 = [ -1.0 | -2.0 | -3.0 ];
+ }
+ both ""
+ // Note specification says that returned value is undefined if no return
+ // statement has been executed. In this case func() is called only with
+ // positive values.
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float f)
+ {
+ if (f > 0.0)
+ return -f;
+ }
+
+ void main ()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # misc
+
+group invalid "Invalid Functions"
+ case break_in_body
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ void func ()
+ {
+ break;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case continue_in_body
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ void func ()
+ {
+ continue;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case return_value_from_void_function
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ void func ()
+ {
+ return 1.0;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case extra_arguments
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ void func (float f)
+ {
+ }
+
+ void main ()
+ {
+ func(1.0, 2.0);
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case missing_arguments
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ void func (float f)
+ {
+ }
+
+ void main ()
+ {
+ func();
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case missing_argument_type
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ void func (in f)
+ {
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case argument_basetype_mismatch
+ expect compile_fail
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ void func (float f)
+ {
+ }
+
+ void main ()
+ {
+ func(2);
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case argument_scalar_vector_mismatch
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ void func (vec2 f)
+ {
+ }
+
+ void main ()
+ {
+ func(2.0);
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case argument_vector_size_mismatch
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ void func (vec3 f)
+ {
+ }
+
+ void main ()
+ {
+ func(vec2(2.0));
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case duplicate_function
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ void func (vec3 f);
+
+ void func (vec3 f)
+ {
+ }
+
+ void func (vec3 f)
+ {
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case prototype_mismatch_return_type
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ void func (vec3 f);
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+
+ float func (vec3 f)
+ {
+ return f.x;
+ }
+ ""
+ end
+
+ case prototype_unspecified_array_size
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ void func (vec3 f[]);
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case call_mismatch_argument_array_size
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ void func (vec3 f[3]);
+ void func (vec3 f[3])
+ {
+ }
+
+ void main ()
+ {
+ vec3 array[4];
+ func(array);
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case prototype_mismatch_argument_const
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ void func (vec3 f);
+ void func (const vec3 f)
+ {
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case prototype_mismatch_argument_array_const
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ void func (vec3 f[3]);
+ void func (const vec3 f[3])
+ {
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case prototype_mismatch_array_inout
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ void func (out vec3 f);
+ void func (inout vec3 f)
+ {
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case missing_return_type
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ func (float f);
+ func (inout vec3 f[3])
+ {
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case call_before_definition
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ void main ()
+ {
+ func(1.0);
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+
+ void func (float f)
+ {
+ }
+
+ ""
+ end
+
+ case return_array_in_struct
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ struct Foo
+ {
+ float f;
+ float arr[2];
+ };
+
+ Foo func ()
+ {
+ Foo f;
+ f.f = 1.0;
+ f.arr[0] = 2.0;
+ return f;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case argument_precision_overload
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ float func (lowp float f)
+ {
+ return f;
+ }
+
+ float func (mediump float f)
+ {
+ return f;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case argument_in_out_overload
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ void func (in float f)
+ {
+ }
+
+ void func (out float f)
+ {
+ f = 1.0;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case argument_in_inout_overload
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ void func (in float f)
+ {
+ }
+
+ void func (inout float f)
+ {
+ f = -f;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case argument_out_inout_overload
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ void func (out float f)
+ {
+ f = -1.0;
+ }
+
+ void func (inout float f)
+ {
+ f = -f;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case return_type_overload
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ float func (float f)
+ {
+ return f;
+ }
+
+ int func (float f)
+ {
+ return int(f);
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case return_type_precision_overload
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ lowp float func (float f)
+ {
+ return f;
+ }
+
+ mediump float func (float f)
+ {
+ return f;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case return_type_const_overload
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ float func (float f)
+ {
+ return f;
+ }
+
+ const float func (float f)
+ {
+ return f;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case return_without_value
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ float func (float f)
+ {
+ return;
+ return 1.0;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case local_function_prototype
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ void main ()
+ {
+ float func (float f);
+
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case local_function_definition
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ void main ()
+ {
+ float func (float f)
+ {
+ return 1.0;
+ }
+
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case name_type_conflict
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ struct foo { float a; }
+
+ float foo (float f)
+ {
+ return 1.0;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case const_overload
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ void func (vec3 f)
+ {
+ }
+
+ void func (const vec3 f)
+ {
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case uniform_local
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ void func (vec3 f)
+ {
+ uniform float u;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case varying_local
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ void func (vec3 f)
+ {
+ varying float v;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case attribute_local
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ void func (vec3 f)
+ {
+ attribute float a;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case uniform_argument
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ void func (uniform vec3 f)
+ {
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case varying_argument
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ void func (varying vec3 f)
+ {
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case attribute_argument
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ void func (attribute vec3 f)
+ {
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case uniform_return_type
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ uniform float func (vec3 f)
+ {
+ return f.x;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case varying_return_type
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ varying float func (vec3 f)
+ {
+ return f.x;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case attribute_return_type
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ attribute float func (vec3 f)
+ {
+ return f.x;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case main_invalid_return_type
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ float main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case main_has_arguments
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ void main (float f)
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case main_missing_return_type
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case write_const_arg
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ func (const float f)
+ {
+ f = 1.0;
+ }
+
+ main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case write_const_array_arg
+ expect compile_fail
+ both ""
+ precision mediump float;
+
+ func (const float f[3])
+ {
+ f[0] = 1.0;
+ }
+
+ main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case modify_const_arg
+ expect compile_fail
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (const int a)
+ {
+ a = -a;
+ return 2 * a;
+ }
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(func(3));
+ }
+ ""
+ end
+
+ case init_const_local_from_const_arg
+ expect compile_fail
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (const int a)
+ {
+ const int b = -a;
+ return 2 * b;
+ }
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(func(3));
+ }
+ ""
+ end
+
+ case array_size_from_const_arg
+ expect compile_fail
+ both ""
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (const int a)
+ {
+ int arr[a];
+ arr[1] = 3;
+ return arr[1];
+ }
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(func(3));
+ }
+ ""
+ end
+
+ case double_declare
+ expect compile_fail
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float f);
+ float func (float f);
+
+ float func (float f)
+ {
+ return -f;
+ }
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(func(1.0));
+ }
+ ""
+ end
+
+end # invalid
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/invalid_texture_functions.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/invalid_texture_functions.html
new file mode 100644
index 0000000000..2085a16a63
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/invalid_texture_functions.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'invalid_texture_functions';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/invalid_texture_functions.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/invalid_texture_functions.test
new file mode 100644
index 0000000000..7641da2282
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/invalid_texture_functions.test
@@ -0,0 +1,90 @@
+
+case texture2d_bias_in_vertex
+ expect compile_fail
+ values {}
+
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ uniform lowp sampler2D s;
+
+ void main()
+ {
+ vec4 r = texture2D(s, vec2(1.0), 1.0);
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ void main()
+ {
+ gl_FragColor = vec4(1.0);
+ }
+ ""
+end
+
+case texturecube_bias_in_vertex
+ expect compile_fail
+ values {}
+
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ uniform lowp samplerCube s;
+
+ void main()
+ {
+ vec4 r = textureCube(s, vec3(1.0), 1.0);
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ void main()
+ {
+ gl_FragColor = vec4(1.0);
+ }
+ ""
+end
+
+case texture2dlod_in_fragment
+ expect compile_fail
+ values {}
+
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ uniform sampler2D s;
+
+ void main()
+ {
+ gl_FragColor = texture2DLod(s, vec2(0), 1.0);
+ }
+ ""
+end
+
+case texturecubelod_in_fragment
+ expect compile_fail
+ values {}
+
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ uniform samplerCube s;
+
+ void main()
+ {
+ gl_FragColor = textureCubeLod(s, vec3(0), 1.0);
+ }
+ ""
+end
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/keywords.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/keywords.html
new file mode 100644
index 0000000000..3c7b576ca4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/keywords.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'keywords';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/keywords.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/keywords.test
new file mode 100644
index 0000000000..16fc390654
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/keywords.test
@@ -0,0 +1,1613 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+
+group keywords "Usage of keywords as identifiers."
+
+ case attribute
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float attribute = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case const
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float const = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case uniform
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float uniform = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case varying
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float varying = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case break
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float break = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case continue
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float continue = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case do
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float do = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case for
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float for = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case while
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float while = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case if
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float if = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case else
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float else = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case in
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float in = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case out
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float out = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case inout
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float inout = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case float
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float float = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case int
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float int = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case void
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float void = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case bool
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float bool = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case true
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float true = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case false
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float false = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case lowp
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float lowp = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case mediump
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float mediump = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case highp
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float highp = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case precision
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float precision = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case invariant
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float invariant = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case discard
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float discard = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case return
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float return = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case mat2
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float mat2 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case mat3
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float mat3 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case mat4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float mat4 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case vec2
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float vec2 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case vec3
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float vec3 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case vec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float vec4 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case ivec2
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float ivec2 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case ivec3
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float ivec3 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case ivec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float ivec4 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case bvec2
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float bvec2 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case bvec3
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float bvec3 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case bvec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float bvec4 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case sampler2D
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float sampler2D = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case samplerCube
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float samplerCube = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case struct
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float struct = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # keywords
+group reserved_keywords "Usage of reserved keywords as identifiers."
+
+ case asm
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float asm = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case class
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float class = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case union
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float union = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case enum
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float enum = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case typedef
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float typedef = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case template
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float template = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case this
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float this = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case packed
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float packed = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case goto
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float goto = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case switch
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float switch = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case default
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float default = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case inline
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float inline = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case noinline
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float noinline = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case volatile
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float volatile = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case public
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float public = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case static
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float static = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case extern
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float extern = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case external
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float external = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case interface
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float interface = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case flat
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float flat = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case long
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float long = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case short
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float short = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case double
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float double = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case half
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float half = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case fixed
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float fixed = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case unsigned
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float unsigned = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case superp
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float superp = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case input
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float input = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case output
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float output = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case hvec2
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float hvec2 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case hvec3
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float hvec3 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case hvec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float hvec4 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case dvec2
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float dvec2 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case dvec3
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float dvec3 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case dvec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float dvec4 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case fvec2
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float fvec2 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case fvec3
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float fvec3 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case fvec4
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float fvec4 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case sampler1D
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float sampler1D = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case sampler3D
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float sampler3D = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case sampler1DShadow
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float sampler1DShadow = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case sampler2DShadow
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float sampler2DShadow = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case sampler2DRect
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float sampler2DRect = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case sampler3DRect
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float sampler3DRect = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case sampler2DRectShadow
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float sampler2DRectShadow = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case sizeof
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float sizeof = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case cast
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float cast = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case namespace
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float namespace = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case using
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float using = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # reserved_keywords
+group invalid_identifiers "Usage of invalid identifiers."
+
+ case gl_begin
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float gl_Invalid = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case digit
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float 0123 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case digit_begin
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float 0invalid = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # invalid_identifiers
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/linkage.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/linkage.html
new file mode 100644
index 0000000000..adf118b7da
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/linkage.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'linkage';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/linkage.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/linkage.test
new file mode 100644
index 0000000000..319a85858b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/linkage.test
@@ -0,0 +1,1715 @@
+# not declared in vertex shader, declared in fragment shader
+case varying_1
+ desc "varying declared in fragment shader, no reference in vertex shader"
+ values { output float out0 = 1.0; }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ varying mediump float var;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ out0 = 1.0;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+# declared in vertex shader, no reference in frag shader
+case varying_2
+ desc "varying declared in vertex shader, no reference in fragment shader"
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ varying mediump float var;
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ void main()
+ {
+ gl_FragColor = vec4(1.0);
+ }
+ ""
+end
+
+# declared in vertex shader, declared in frag shader
+case varying_3
+ desc "varying declared in both vertex and fragment shader, but not used"
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ varying mediump float var;
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ varying mediump float var;
+ void main()
+ {
+ gl_FragColor = vec4(1.0);
+ }
+ ""
+end
+
+# declared in vertex shader, static use in frag shader
+case varying_4
+ desc "varying declared in both shaders, statically used in fragment shader"
+ values { uniform bool u_false = false; }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ varying mediump float var;
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ varying mediump float var;
+ uniform bool u_false;
+ void main()
+ {
+ if (u_false)
+ gl_FragColor = vec4(var);
+ else
+ gl_FragColor = vec4(1.0);
+ }
+ ""
+end
+
+# static use in vertex shader, no reference in fragment shader
+case varying_5
+ desc "varying declared and statically used in vertex shader, no reference in fragment shader"
+ values { uniform bool u_false = false; }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ varying mediump float var;
+ void main()
+ {
+ if (u_false)
+ var = 1.0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ void main()
+ {
+ gl_FragColor = vec4(1.0);
+ }
+ ""
+end
+
+# static use in vertex shader, declared in fragment shader
+case varying_6
+ desc "varying declared and statically used in vertex shader, only declared in fragment shader"
+ values { uniform bool u_false = false; }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ varying mediump float var;
+ void main()
+ {
+ if (u_false)
+ var = 1.0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ varying mediump float var;
+ void main()
+ {
+ gl_FragColor = vec4(1.0);
+ }
+ ""
+end
+
+# static use in vertex shader, used in fragment shader
+case varying_7
+ desc "varying statically used in both vertex and fragment shader"
+ values { uniform bool u_false = false; }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ varying mediump float var;
+ void main()
+ {
+ if (u_false)
+ var = 1.0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ ${FRAGMENT_DECLARATIONS}
+ varying mediump float var;
+ void main()
+ {
+ if (u_false)
+ gl_FragColor = vec4(var);
+ else
+ gl_FragColor = vec4(1.0);
+ }
+ ""
+end
+
+case varying_type_float
+ desc "varying of type float"
+ values
+ {
+ input float in0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ];
+ output float out0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ];
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ varying mediump float var;
+ void main()
+ {
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ varying float var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case varying_type_vec2
+ desc "varying of type vec2"
+ values
+ {
+ input vec2 in0 = [ vec2(-1.25, 1.25) | vec2(-25.65, -7.25) | vec2(0.0, 1.0) | vec2(2.25, 2.25) | vec2(3.4, 9.5) | vec2(16.0, 32.0) ];
+ output vec2 out0 = [ vec2(-1.25, 1.25) | vec2(-25.65, -7.25) | vec2(0.0, 1.0) | vec2(2.25, 2.25) | vec2(3.4, 9.5) | vec2(16.0, 32.0) ];
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ varying mediump vec2 var;
+ void main()
+ {
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ varying vec2 var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case varying_type_vec3
+ desc "varying of type vec3"
+ values
+ {
+ input vec3 in0 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ];
+ output vec3 out0 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ];
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ varying mediump vec3 var;
+ void main()
+ {
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ varying vec3 var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case varying_type_vec4
+ desc "varying of type vec4"
+ values
+ {
+ input vec4 in0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ];
+ output vec4 out0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ];
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ varying mediump vec4 var;
+ void main()
+ {
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ varying vec4 var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case varying_type_mat2
+ desc "varying of type mat2"
+ values
+ {
+ input mat2 in0 = [ mat2(1.0, 1.0, 1.0, 1.0) | mat2(-1.25, 1.25, -9.5, -12.2) | mat2(-25.65, -7.25, 14.21, -77.7) | mat2(0.0, 1.0, -1.0, 2.0) | mat2(2.25, 2.25, 22.5, 225.0) | mat2(3.4, 9.5, 19.5, 29.5) | mat2(16.0, 32.0, -64.0, -128.0) ];
+ output mat2 out0 = [ mat2(1.0, 1.0, 1.0, 1.0) | mat2(-1.25, 1.25, -9.5, -12.2) | mat2(-25.65, -7.25, 14.21, -77.7) | mat2(0.0, 1.0, -1.0, 2.0) | mat2(2.25, 2.25, 22.5, 225.0) | mat2(3.4, 9.5, 19.5, 29.5) | mat2(16.0, 32.0, -64.0, -128.0) ];
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ varying mediump mat2 var;
+ void main()
+ {
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ varying mat2 var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case varying_type_mat3
+ desc "varying of type mat3"
+ values
+ {
+ input mat3 in0 = [ mat3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 9.9) | mat3(0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0, -9.9) | mat3(3.4, 9.5, 19.5, 29.5, 16.0, 32.0, -64.0, -128.0, 256.0) ];
+ output mat3 out0 = [ mat3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 9.9) | mat3(0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0, -9.9) | mat3(3.4, 9.5, 19.5, 29.5, 16.0, 32.0, -64.0, -128.0, 256.0) ];
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ varying mediump mat3 var;
+ void main()
+ {
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ varying mat3 var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case varying_type_mat4
+ desc "varying of type mat4"
+ values
+ {
+ input mat4 in0 = [ mat4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0) ];
+ output mat4 out0 = [ mat4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0) ];
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ varying mediump mat4 var;
+ void main()
+ {
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ varying mat4 var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+# differing precision tests
+case varying_differing_precision_1
+ desc "varying declared as highp in vertex shader, but mediump in fragment shader"
+ values
+ {
+ input float in0 = [ -1.25 | -25.55 | 1.0 | 2.25 | 3.4 | 16.0 ];
+ output float out0 = [ -1.25 | -25.55 | 1.0 | 2.25 | 3.4 | 16.0 ];
+ }
+
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ varying highp float var;
+ void main()
+ {
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ varying mediump float var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+# differing precision tests
+case varying_differing_precision_2
+ desc "varying declared as highp in vertex shader, but lowp in fragment shader"
+ values
+ {
+ input float in0 = [ -1.25 | -25.56 | 1.0 | 2.25 | 3.4 | 16.0 ];
+ output float out0 = [ -1.25 | -25.56 | 1.0 | 2.25 | 3.4 | 16.0 ];
+ }
+
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ varying highp vec2 var;
+ void main()
+ {
+ var = vec2(in0, 2.0*in0);
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ varying lowp vec2 var;
+ void main()
+ {
+ out0 = var.y - var.x;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+# differing precision tests
+case varying_differing_precision_3
+ desc "varying declared as lowp in vertex shader, but mediump in fragment shader"
+ values
+ {
+ input float in0 = [ -1.25 | -25.0 | 1.0 | 2.25 | 3.4 | 16.0 ];
+ output float out0 = [ -1.25 | -25.0 | 1.0 | 2.25 | 3.4 | 16.0 ];
+ }
+
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ varying lowp vec4 var;
+ void main()
+ {
+ var = vec4(in0, 2.0*in0, -in0, -in0);
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ varying mediump vec4 var;
+ void main()
+ {
+ out0 = var.x + var.y + var.z + var.w;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+# mismatched type, static use but no runtime use in the fragment shader
+case varying_type_mismatch_1
+ desc "varying type mismatch (float vs. vec2), static use but no runtime use in the fragment shader"
+ expect link_fail
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ varying mediump float var;
+ void main()
+ {
+ var = 2.0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ varying mediump vec2 var;
+ void main()
+ {
+ if (false)
+ {
+ gl_FragColor = vec4(var.y);
+ }
+ else
+ {
+ ${FRAG_COLOR} = vec4(1.0);
+ }
+ }
+ ""
+end
+
+# mismatched type, varyings used
+case varying_type_mismatch_2
+ desc "varying type mismatch (float vs. vec2)"
+ expect link_fail
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ varying mediump float var;
+ void main()
+ {
+ var = 2.0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ varying mediump vec2 var;
+ void main()
+ {
+ gl_FragColor = var.xyyx;
+ }
+ ""
+end
+
+# no declaration in vertex shader, but static use in fragment
+case varying_illegal_usage_1
+ desc "varying not declared in vertex shader, but statically used in fragment shader"
+ expect link_fail
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ varying mediump float var;
+ void main()
+ {
+ gl_FragColor = vec4(var);
+ }
+ ""
+end
+
+# integer varyings not allowed
+case invalid_varying_type_int
+ desc "integer varying used"
+ expect compile_fail
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ varying mediump int var;
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ varying mediump int var;
+ void main()
+ {
+ gl_FragColor = vec4(1.0);
+ }
+ ""
+end
+
+# bool varyings not allowed
+case invalid_varying_type_bool
+ desc "boolean varying used"
+ expect compile_fail
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ varying bool var;
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ varying bool var;
+ void main()
+ {
+ gl_FragColor = vec4(1.0);
+ }
+ ""
+end
+
+# struct varyings not allowed
+case invalid_varying_type_struct
+ desc "struct varying used"
+ expect compile_fail
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ varying struct { mediump float foo; } var;
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ varying struct { mediump float foo; } var;
+ void main()
+ {
+ gl_FragColor = vec4(1.0);
+ }
+ ""
+end
+
+case varying_readback_1
+ desc "read back (an already written) varying in the vertex shader"
+ values
+ {
+ input float in0 = [ 1.0 | 0.0 | -2.0 | 10.0 ];
+ output float out0 = [ 3.0 | 0.0 | -6.0 | 30.0 ];
+ }
+ vertex ""
+ precision mediump float;
+ ${VERTEX_DECLARATIONS}
+ varying float var1;
+ varying float var2;
+
+ void main()
+ {
+ var1 = in0;
+ var2 = var1 + in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ varying float var1;
+ varying float var2;
+
+ void main()
+ {
+ out0 = var1 + var2;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case varying_writeback_1
+ desc "write back a varying in the fragment shader"
+ expect compile_fail
+ vertex ""
+ precision mediump float;
+ ${VERTEX_DECLARATIONS}
+ varying float var1;
+ varying float var2;
+
+ void main()
+ {
+ var1 = in0;
+ var2 = var1 + in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ varying float var1;
+ varying float var2;
+
+ void main()
+ {
+ var2 = var1;
+ out0 = var1;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+# Struct linkage handling
+case uniform_struct
+ desc "Same uniform struct in both shaders"
+ values {
+ uniform float val.a = 1.0;
+ uniform float val.b = 2.0;
+ output float out0 = 3.0;
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump float a; mediump float b;};
+ uniform Struct val;
+ varying mediump float dummy;
+ void main()
+ {
+ dummy = val.a + val.b;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Struct {mediump float a; mediump float b;};
+ uniform Struct val;
+ varying mediump float dummy;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ out0 = val.b + val.a;
+ out0 = out0 + dummy;
+ out0 = out0 - dummy;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_vertex_only
+ desc "Uniform struct declared in both, used only in vertex."
+ values {
+ uniform float val.a = 1.0;
+ uniform float val.b = 2.0;
+ output float out0 = 3.0;
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump float a; mediump float b;};
+ uniform Struct val;
+ varying mediump float res;
+ void main()
+ {
+ res = val.a + val.b;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Struct {mediump float a; mediump float b;};
+ uniform Struct val;
+ varying mediump float res;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ out0 = res;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_fragment_only
+ desc "Uniform struct declared in both, used only in fragment."
+ values {
+ uniform float val.a = 1.0;
+ uniform float val.b = 2.0;
+ output float out0 = 3.0;
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump float a; mediump float b;};
+ uniform Struct val;
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Struct {mediump float a; mediump float b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ out0 = val.a + val.b;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_partial
+ desc "Uniform struct declared in both, used partially in both."
+ values {
+ uniform float val.a = 1.0;
+ uniform float val.b = 2.0;
+ output float out0 = 3.0;
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump float a; mediump float b;};
+ uniform Struct val;
+ varying mediump float res;
+ void main()
+ {
+ res = val.a;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Struct {mediump float a; mediump float b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ varying mediump float res;
+ void main()
+ {
+ out0 = res + val.b;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_vec4
+ desc "Same uniform struct in both shaders. Datatype vec4"
+ values {
+ uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0);
+ uniform vec4 val.b = vec4(1.0, 2.0, 3.0, 4.0);
+ output float out0 = 3.0;
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec4 a; mediump vec4 b;};
+ uniform Struct val;
+ varying mediump float dummy;
+ void main()
+ {
+ dummy = val.a.x + val.b.y;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Struct {mediump vec4 a; mediump vec4 b;};
+ uniform Struct val;
+ varying mediump float dummy;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ out0 = val.b.y + val.a.x;
+ out0 = out0 + dummy;
+ out0 = out0 - dummy;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_vertex_only_vec4
+ desc "Uniform struct declared in both, used only in vertex. Datatype vec4 "
+ values {
+ uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0);
+ uniform vec4 val.b = vec4(1.0, 2.0, 3.0, 4.0);
+ output float out0 = 3.0;
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec4 a; mediump vec4 b;};
+ uniform Struct val;
+ varying mediump float res;
+ void main()
+ {
+ res = val.a.x + val.b.y;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Struct {mediump vec4 a; mediump vec4 b;};
+ uniform Struct val;
+ varying mediump float res;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ out0 = res;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_fragment_only_vec4
+ desc "Uniform struct declared in both, used only in fragment. Datatype vec4"
+ values {
+ uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0);
+ uniform vec4 val.b = vec4(1.0, 2.0, 3.0, 4.0);
+ output float out0 = 3.0;
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec4 a; mediump vec4 b;};
+ uniform Struct val;
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Struct {mediump vec4 a; mediump vec4 b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ out0 = val.a.x + val.b.y;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_partial_vec4
+ desc "Uniform struct declared in both, used partially in both. Datatype vec4"
+ values {
+ uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0);
+ uniform vec4 val.b = vec4(1.0, 2.0, 3.0, 4.0);
+ output float out0 = 3.0;
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec4 a; mediump vec4 b;};
+ uniform Struct val;
+ varying mediump float res;
+ void main()
+ {
+ res = val.a.x;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Struct {mediump vec4 a; mediump vec4 b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ varying mediump float res;
+ void main()
+ {
+ out0 = res + val.b.y;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_vec4_vec3
+ desc "Same uniform struct in both shaders. Datatype vec4 and vec3"
+ values {
+ uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0);
+ uniform vec3 val.b = vec3(1.0, 2.0, 3.0);
+ output float out0 = 3.0;
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec4 a; mediump vec3 b;};
+ uniform Struct val;
+ varying mediump float dummy;
+ void main()
+ {
+ dummy = val.a.x + val.b.y;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Struct {mediump vec4 a; mediump vec3 b;};
+ uniform Struct val;
+ varying mediump float dummy;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ out0 = val.b.y + val.a.x;
+ out0 = out0 + dummy;
+ out0 = out0 - dummy;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_vertex_only_vec4_vec3
+ desc "Uniform struct declared in both, used only in vertex. Datatype vec4 and vec3"
+ values {
+ uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0);
+ uniform vec3 val.b = vec3(1.0, 2.0, 3.0);
+ output float out0 = 3.0;
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec4 a; mediump vec3 b;};
+ uniform Struct val;
+ varying mediump float res;
+ void main()
+ {
+ res = val.a.x + val.b.y;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Struct {mediump vec4 a; mediump vec3 b;};
+ uniform Struct val;
+ varying mediump float res;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ out0 = res;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_fragment_only_vec4_vec3
+ desc "Uniform struct declared in both, used only in fragment. Datatype vec4 and vec3"
+ values {
+ uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0);
+ uniform vec3 val.b = vec3(1.0, 2.0, 3.0);
+ output float out0 = 3.0;
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec4 a; mediump vec3 b;};
+ uniform Struct val;
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Struct {mediump vec4 a; mediump vec3 b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ out0 = val.a.x + val.b.y;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_partial_vec4_vec3
+ desc "Uniform struct declared in both, used partially in both. Datatype vec4 and vec3"
+ values {
+ uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0);
+ uniform vec3 val.b = vec3(1.0, 2.0, 3.0);
+ output float out0 = 3.0;
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec4 a; mediump vec3 b;};
+ uniform Struct val;
+ varying mediump float res;
+ void main()
+ {
+ res = val.a.x;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Struct {mediump vec4 a; mediump vec3 b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ varying mediump float res;
+ void main()
+ {
+ out0 = res + val.b.y;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_vec4_float
+ desc "Same uniform struct in both shaders. Datatype vec4 and float"
+ values {
+ uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0);
+ uniform float val.b = 2.0;
+ output float out0 = 3.0;
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec4 a; mediump float b;};
+ uniform Struct val;
+ varying mediump float dummy;
+ void main()
+ {
+ dummy = val.a.x + val.b;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Struct {mediump vec4 a; mediump float b;};
+ uniform Struct val;
+ varying mediump float dummy;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ out0 = val.b + val.a.x;
+ out0 = out0 + dummy;
+ out0 = out0 - dummy;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_vertex_only_vec4_float
+ desc "Uniform struct declared in both, used only in vertex. Datatype vec4 and float"
+ values {
+ uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0);
+ uniform float val.b = 2.0;
+ output float out0 = 3.0;
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec4 a; mediump float b;};
+ uniform Struct val;
+ varying mediump float res;
+ void main()
+ {
+ res = val.a.x + val.b;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Struct {mediump vec4 a; mediump float b;};
+ uniform Struct val;
+ varying mediump float res;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ out0 = res;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_fragment_only_vec4_float
+ desc "Uniform struct declared in both, used only in fragment. Datatype vec4 and float"
+ values {
+ uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0);
+ uniform float val.b = 2.0;
+ output float out0 = 3.0;
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec4 a; mediump float b;};
+ uniform Struct val;
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Struct {mediump vec4 a; mediump float b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ out0 = val.a.x + val.b;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_partial_vec4_float
+ desc "Uniform struct declared in both, used partially in both. Datatype vec4 and float"
+ values {
+ uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0);
+ uniform float val.b = 2.0;
+ output float out0 = 3.0;
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec4 a; mediump float b;};
+ uniform Struct val;
+ varying mediump float res;
+ void main()
+ {
+ res = val.a.x;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Struct {mediump vec4 a; mediump float b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ varying mediump float res;
+ void main()
+ {
+ out0 = res + val.b;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_partial_vec4_struct
+ desc "Uniform struct declared in both, used partially in both. Datatype vec4 and struct with vec4"
+ values {
+ uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0);
+ uniform vec4 val.b.c = vec4(1.0, 2.0, 3.0, 4.0);
+ output float out0 = 3.0;
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Inner {mediump vec4 c;};
+ struct Struct {mediump vec4 a; Inner b;};
+ uniform Struct val;
+ varying mediump float res;
+ void main()
+ {
+ res = val.a.x;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Inner {mediump vec4 c;};
+ struct Struct {mediump vec4 a; Inner b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ varying mediump float res;
+ void main()
+ {
+ out0 = res + val.b.c.y;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+
+
+case uniform_struct_partial_vec4_vec3_struct
+ desc "Uniform struct declared in both, used partially in both. Datatype vec4 and struct with vec3"
+ values {
+ uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0);
+ uniform vec3 val.b.c = vec3(1.0, 2.0, 3.0);
+ output float out0 = 3.0;
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Inner {mediump vec3 c;};
+ struct Struct {mediump vec4 a; Inner b;};
+ uniform Struct val;
+ varying mediump float res;
+ void main()
+ {
+ res = val.a.x;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Inner {mediump vec3 c;};
+ struct Struct {mediump vec4 a; Inner b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ varying mediump float res;
+ void main()
+ {
+ out0 = res + val.b.c.y;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_partial_vec2_vec3
+ desc "Uniform struct declared in both, used partially in both. Datatype vec2 and vec3"
+ values {
+ uniform vec2 val.a = vec2(1.0, 2.0);
+ uniform vec3 val.b = vec3(1.0, 2.0, 3.0);
+ output float out0 = 3.0;
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec2 a; mediump vec3 b;};
+ uniform Struct val;
+ varying mediump float res;
+ void main()
+ {
+ res = val.a.x;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Struct {mediump vec2 a; mediump vec3 b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ varying mediump float res;
+ void main()
+ {
+ out0 = res + val.b.y;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_partial_vec2_int
+ desc "Uniform struct declared in both, used partially in both. Datatype vec2 and int"
+ values {
+ uniform vec2 val.a = vec2(1.0, 2.0);
+ uniform int val.b = 2;
+ output float out0 = 3.0;
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec2 a; mediump int b;};
+ uniform Struct val;
+ varying mediump float res;
+ void main()
+ {
+ res = val.a.x;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Struct {mediump vec2 a; mediump int b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ varying mediump float res;
+ void main()
+ {
+ out0 = res + float(val.b);
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_partial_int_float
+ desc "Uniform struct declared in both, used partially in both. Datatype int and float"
+ values {
+ uniform float val.a = 1.0;
+ uniform int val.b = 2;
+ output float out0 = 3.0;
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump float a; mediump int b;};
+ uniform Struct val;
+ varying mediump float res;
+ void main()
+ {
+ res = val.a;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Struct {mediump float a; mediump int b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ varying mediump float res;
+ void main()
+ {
+ out0 = res + float(val.b);
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_partial_bvec2_vec2
+ desc "Uniform struct declared in both, used partially in both. Datatype bvec2 and vec2"
+ values {
+ uniform bvec2 val.a = bvec2(true, true);
+ uniform vec2 val.b = vec2(1.0, 2.0);
+ output float out0 = 3.0;
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Struct {bvec2 a; mediump vec2 b;};
+ uniform Struct val;
+ varying mediump float res;
+ void main()
+ {
+ res = float(val.a.x);
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Struct {bvec2 a; mediump vec2 b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ varying mediump float res;
+ void main()
+ {
+ out0 = res + val.b.y;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_partial_ivec2_vec2
+ desc "Uniform struct declared in both, used partially in both. Datatype ivec2 and vec2"
+ values {
+ uniform ivec2 val.a = ivec2(1, 2);
+ uniform vec2 val.b = vec2(1.0, 2.0);
+ output float out0 = 3.0;
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump ivec2 a; mediump vec2 b;};
+ uniform Struct val;
+ varying mediump float res;
+ void main()
+ {
+ res = vec2(val.a).x;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Struct {mediump ivec2 a; mediump vec2 b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ varying mediump float res;
+ void main()
+ {
+ out0 = res + val.b.y;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_partial_ivec2_ivec2
+ desc "Uniform struct declared in both, used partially in both. Datatype ivec2 and ivec2"
+ values {
+ uniform ivec2 val.a = ivec2(1, 2);
+ uniform ivec2 val.b = ivec2(1, 2);
+ output float out0 = 3.0;
+ }
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump ivec2 a; mediump ivec2 b;};
+ uniform Struct val;
+ varying mediump float res;
+ void main()
+ {
+ res = vec2(val.a).x;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Struct {mediump ivec2 a; mediump ivec2 b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ varying mediump float res;
+ void main()
+ {
+ out0 = res + vec2(val.b).y;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_type_conflict_1
+ desc "Fragment struct has one less member than fragment version"
+ expect link_fail
+ values {output float out0 = 3.0;}
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump float a; mediump float b;};
+ uniform Struct val;
+ varying mediump float res;
+ void main()
+ {
+ res = val.a;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Struct {mediump float a;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ varying mediump float res;
+ void main()
+ {
+ out0 = res + val.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_type_conflict_2
+ desc "Vertex struct has int, fragment struct has float."
+ expect link_fail
+ values {output float out0 = 3.0;}
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump int a;};
+ uniform Struct val;
+ varying mediump float res;
+ void main()
+ {
+ res = float(val.a);
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Struct {mediump float a;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ varying mediump float res;
+ void main()
+ {
+ out0 = val.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_type_conflict_3
+ desc "Vertex struct has vec3, fragment struct has vec4."
+ expect link_fail
+ values {output float out0 = 3.0;}
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec3 a;};
+ uniform Struct val;
+ varying mediump float res;
+ void main()
+ {
+ res = float(val.a.x);
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Struct {mediump vec4 a;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ varying mediump float res;
+ void main()
+ {
+ out0 = val.a.x;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_precision_conflict_1
+ desc "Vertex side struct has highp, fragment side struct mediump."
+ expect link_fail
+ values {output float out0 = 3.0;}
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Struct {highp float a;};
+ uniform Struct val;
+ varying mediump float res;
+ void main()
+ {
+ res = val.a;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Struct {mediump float a;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ varying mediump float res;
+ void main()
+ {
+ out0 = val.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_precision_conflict_2
+ desc "Vertex side struct has mediump, fragment side struct lowp."
+ expect link_fail
+ values {output float out0 = 3.0;}
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump float a;};
+ uniform Struct val;
+ varying mediump float res;
+ void main()
+ {
+ res = val.a;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Struct {lowp float a;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ varying mediump float res;
+ void main()
+ {
+ out0 = val.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_precision_conflict_3
+ desc "Vertex side struct has lowp, fragment side struct mediump."
+ expect link_fail
+ values {output float out0 = 3.0;}
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Struct {lowp float a;};
+ uniform Struct val;
+ varying mediump float res;
+ void main()
+ {
+ res = val.a;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Struct {mediump float a;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ varying mediump float res;
+ void main()
+ {
+ out0 = val.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_precision_conflict_4
+ desc "Vertex side struct has lowp, fragment side struct implicit mediump."
+ expect link_fail
+ values {output float out0 = 3.0;}
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ struct Struct {lowp float a;};
+ uniform Struct val;
+ varying mediump float res;
+ void main()
+ {
+ res = val.a;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Struct {float a;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ varying mediump float res;
+ void main()
+ {
+ out0 = val.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_use_case_rip
+ desc "Complex Light struct from use case tests."
+ values {
+ uniform float val.constantAttenuation = 1.0;
+ uniform float val.quadraticAttenuation = 1.0;
+ output float out0 = 2.0;
+ }
+ vertex ""
+ struct Light
+ {
+ mediump vec3 color;
+ highp vec4 position;
+ highp vec3 direction;
+ mediump float constantAttenuation;
+ mediump float linearAttenuation;
+ mediump float quadraticAttenuation;
+ };
+ ${VERTEX_DECLARATIONS}
+ uniform Light val;
+ varying mediump float res;
+ void main()
+ {
+ res = val.constantAttenuation;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Light
+ {
+ mediump vec3 color;
+ highp vec4 position;
+ highp vec3 direction;
+ mediump float constantAttenuation;
+ mediump float linearAttenuation;
+ mediump float quadraticAttenuation;
+ };
+ struct Struct {float a;};
+ uniform Light val;
+ ${FRAGMENT_DECLARATIONS}
+ varying mediump float res;
+ void main()
+ {
+ out0 = res + val.quadraticAttenuation;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case uniform_struct_use_case_rip_sans_highp
+ desc "Complex Light struct from use case tests, without highp usage"
+ values {
+ uniform float val.constantAttenuation = 1.0;
+ uniform float val.quadraticAttenuation = 1.0;
+ output float out0 = 2.0;
+ }
+ vertex ""
+ struct Light
+ {
+ mediump vec3 color;
+ mediump vec4 position;
+ mediump vec3 direction;
+ mediump float constantAttenuation;
+ mediump float linearAttenuation;
+ mediump float quadraticAttenuation;
+ };
+ ${VERTEX_DECLARATIONS}
+ uniform Light val;
+ varying mediump float res;
+ void main()
+ {
+ res = val.constantAttenuation;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ precision mediump float;
+ struct Light
+ {
+ mediump vec3 color;
+ mediump vec4 position;
+ mediump vec3 direction;
+ mediump float constantAttenuation;
+ mediump float linearAttenuation;
+ mediump float quadraticAttenuation;
+ };
+ struct Struct {float a;};
+ uniform Light val;
+ ${FRAGMENT_DECLARATIONS}
+ varying mediump float res;
+ void main()
+ {
+ out0 = res + val.quadraticAttenuation;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/preprocessor.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/preprocessor.html
new file mode 100644
index 0000000000..ac91d22806
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/preprocessor.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'preprocessor';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/preprocessor.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/preprocessor.test
new file mode 100644
index 0000000000..7e3d251493
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/preprocessor.test
@@ -0,0 +1,4287 @@
+group basic "Basic Tests"
+
+ case correct_phases
+ expect compile_fail
+ both ""
+ #define e +1
+ void main()
+ {
+ mediump int n = 1e;
+ }
+ ""
+ end
+
+ case invalid_identifier
+ expect compile_fail
+ both ""
+ #define e +1
+
+ void main()
+ {
+ mediump int 1xyz = 1;
+ }
+ ""
+ end
+
+ case null_directive
+ values { output float out0 = 0.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ #
+ # // comment
+ /*sfd*/ # /* */
+
+ void main()
+ {
+ out0 = 0.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case invalid_directive
+ expect compile_fail
+ both ""
+ #defin AAA
+
+ void main()
+ {
+ }
+ ""
+ end
+
+ case missing_identifier
+ expect compile_fail
+ both ""
+ #define
+
+ void main()
+ {
+ }
+ ""
+ end
+
+ case empty_object
+ values { output float out0 = -1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ # define VALUE
+
+ void main()
+ {
+ out0 = VALUE - 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case empty_function
+ values { output float out0 = -1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ # define VALUE(a)
+
+ void main()
+ {
+ out0 = VALUE(2.0) - 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case empty_directive
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ #
+
+ void main()
+ {
+ out0 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case identifier_with_double_underscore
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ # define __VALUE__ 1
+
+ void main()
+ {
+ // __VALUE__ not used since it might be set by an "underlying software layer"
+ out0 = float(1.0);
+ ${OUTPUT}
+ }
+ ""
+ end
+end # basic
+
+group definitions "Symbol Definition Tests"
+
+ case define_value_and_function
+ values { output float out0 = 6.0; }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS:single-line}
+ # define VALUE (1.5 + 2.5)
+ # define FUNCTION(__LINE__, b) __LINE__+b
+
+ void main()
+ {
+ out0 = FUNCTION(VALUE, ((0.2) + 1.8) );
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case undefine_object_invalid_syntax
+ expect compile_fail
+ both ""
+ precision mediump float;
+ #define VAL 2.0
+ #undef VAL sdflkjfds
+ #define VAL 1.0
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(VAL);
+ }
+ ""
+ end
+
+ case undefine_invalid_object_1
+ expect compile_fail
+ both ""
+ precision mediump float;
+ #undef __LINE__
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(__LINE__);
+ }
+ ""
+ end
+
+ case undefine_invalid_object_2
+ expect compile_fail
+ both ""
+ precision mediump float;
+ #undef __FILE__
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(__FILE__);
+ }
+ ""
+ end
+
+ case undefine_invalid_object_3
+ expect compile_fail
+ both ""
+ precision mediump float;
+ #undef __VERSION__
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(__VERSION__);
+ }
+ ""
+ end
+
+ case undefine_invalid_object_4
+ expect compile_fail
+ both ""
+ precision mediump float;
+ #undef GL_ES
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(GL_ES);
+ }
+ ""
+ end
+
+ case undefine_function
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ #define FUNCTION(a,b) a+b
+ #undef FUNCTION
+ #define FUNCTION(a,b) a-b
+
+ void main()
+ {
+ out0 = FUNCTION(3.0, 2.0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # definitions
+
+group invalid_definitions "Invalid Definition Tests"
+
+ case define_non_identifier
+ expect compile_fail
+ both ""
+ precision mediump float;
+ #define 123 321
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case undef_non_identifier_1
+ expect compile_fail
+ both ""
+ precision mediump float;
+ #undef 123
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case undef_non_identifier_2
+ expect compile_fail
+ both ""
+ precision mediump float;
+ #undef foo.bar
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+
+end # invalid_definitions
+
+group object_redefinitions "Object Redefinition Tests"
+
+ case invalid_object_ident
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define AAA 2.0
+ # define AAAA 2.1
+ # define VALUE (AAA - 1.0)
+ # define VALUE (AAAA - 1.0)
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(VALUE);
+ }
+ ""
+ end
+
+ case invalid_object_whitespace
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define AAA 2.0
+ # define VALUE (AAA - 1.0)
+ # define VALUE (AAA- 1.0)
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(VALUE);
+ }
+ ""
+ end
+
+ case invalid_object_op
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define AAA 2.0
+ # define VALUE (AAA - 1.0)
+ # define VALUE (AAA + 1.0)
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(VALUE);
+ }
+ ""
+ end
+
+ case invalid_object_floatval_1
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define AAA 2.0
+ # define VALUE (AAA - 1.0)
+ # define VALUE (AAA - 1.1)
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(VALUE);
+ }
+ ""
+ end
+
+ case invalid_object_floatval_2
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define AAA 2.0
+ # define VALUE (AAA - 1.0)
+ # define VALUE (AAA - 1.0e-1)
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(VALUE);
+ }
+ ""
+ end
+
+ case invalid_object_intval_1
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define AAA 2
+ # define VALUE (AAA - 1)
+ # define VALUE (AAA - 2)
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(VALUE);
+ }
+ ""
+ end
+
+ case invalid_object_intval_2
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define AAA 2
+ # define VALUE (AAA - 1)
+ # define VALUE (AAA - 0x1)
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(VALUE);
+ }
+ ""
+ end
+
+ case redefine_object_1
+ values { output float out0 = 6.0; }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ # define VAL1 1.0
+ #define VAL2 2.0
+
+ #define RES2 (RES1 * VAL2)
+ #define RES1 (VAL2 / VAL1)
+ #define RES2 (RES1 * VAL2)
+ #define VALUE (RES2 + RES1)
+
+ void main()
+ {
+ out0 = VALUE;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case redefine_object_ifdef
+ values { output float out0 = 1.0; }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ #define ADEFINE 1
+ #define ADEFINE 1
+
+ #ifdef ADEFINE
+ #define VALUE 1.0
+ #else
+ #define VALUE 0.0
+ #endif
+
+ void main()
+ {
+ out0 = VALUE;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case redefine_object_undef_ifdef
+ values { output float out0 = 1.0; }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ #define ADEFINE 1
+ #define ADEFINE 1
+ #undef ADEFINE
+
+ #ifdef ADEFINE
+ #define VALUE 0.0
+ #else
+ #define VALUE 1.0
+ #endif
+
+ void main()
+ {
+ out0 = VALUE;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case redefine_object_ifndef
+ values { output float out0 = 1.0; }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ #define ADEFINE 1
+ #define ADEFINE 1
+
+ #ifndef ADEFINE
+ #define VALUE 0.0
+ #else
+ #define VALUE 1.0
+ #endif
+
+ void main()
+ {
+ out0 = VALUE;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case redefine_object_defined_1
+ values { output float out0 = 1.0; }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ #define ADEFINE 1
+ #define ADEFINE 1
+
+ #if defined(ADEFINE)
+ #define VALUE 1.0
+ #else
+ #define VALUE 0.0
+ #endif
+
+ void main()
+ {
+ out0 = VALUE;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case redefine_object_defined_2
+ values { output float out0 = 1.0; }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ #define ADEFINE 1
+ #define ADEFINE 1
+
+ #if defined ADEFINE
+ #define VALUE 1.0
+ #else
+ #define VALUE 0.0
+ #endif
+
+ void main()
+ {
+ out0 = VALUE;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case redefine_object_comment
+ values { output float out0 = 6.0; }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ # define VAL1 1.0
+ #define VAL2 2.0
+
+ #define RES2 /* fdsjklfdsjkl dsfjkhfdsjkh fdsjklhfdsjkh */ (RES1 * VAL2)
+ #define RES1 (VAL2 / VAL1)
+ #define RES2 /* ewrlkjhsadf */ (RES1 * VAL2)
+ #define VALUE (RES2 + RES1)
+
+ void main()
+ {
+ out0 = VALUE;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case redefine_object_multiline_comment
+ values { output float out0 = 6.0; }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ # define VAL1 1.0
+ #define VAL2 2.0
+
+ #define RES2 /* fdsjklfdsjkl
+ dsfjkhfdsjkh
+ fdsjklhfdsjkh */ (RES1 * VAL2)
+ #define RES1 (VAL2 / VAL1)
+ #define RES2 /* ewrlkjhsadf */ (RES1 * VAL2)
+ #define VALUE (RES2 + RES1)
+
+ void main()
+ {
+ out0 = VALUE;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # object_redefinitions
+
+group invalid_redefinitions "Invalid Redefinitions Tests"
+
+ case invalid_identifier_2
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define GL_VALUE 1.0
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(GL_VALUE);
+ }
+ ""
+ end
+
+end # invalid_redefinitions
+
+group comments "Comment Tests"
+
+ case multiline_comment_define
+ values { output float out0 = 4.2; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ #define VALUE /* current
+ value */ 4.2
+
+ void main()
+ {
+ out0 = VALUE;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case nested_comment
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 0.0;
+ /* /* */
+ out0 = 1.0;
+ // */
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case comment_trick_1
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ /*/
+ out0 = 0.0;
+ /*/
+ out0 = 1.0;
+ /**/
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case comment_trick_2
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ /**/
+ out0 = 1.0;
+ /*/
+ out0 = 0.0;
+ /**/
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case invalid_comment
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ /* /* */ */
+ ${POSITION_FRAG_COLOR} = 1.0;
+ }
+ ""
+ end
+
+ case unterminated_comment_1
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ /*
+ }
+ ""
+ end
+
+ case unterminated_comment_2
+ expect compile_fail
+ both ""
+ /*
+ precision mediump float;
+ void main()
+ {
+ }
+ ""
+ end
+
+end # comments
+
+group function_definitions "Function Definitions Tests"
+
+ case same_object_and_function_param
+ values { output float out0 = 1.0; }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ #define VALUE 1.0
+ #define FUNCTION(VALUE, B) (VALUE-B)
+
+ void main()
+ {
+ out0 = FUNCTION(3.0, 2.0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case complex_func
+ values { output float out0 = 518.5; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ #define AAA(a,b) a*(BBB(a,b))
+ #define BBB(a,b) a-b
+
+ void main()
+ {
+ out0 = BBB(AAA(8.0/4.0, 2.0)*BBB(2.0*2.0,0.75*2.0), AAA(40.0,10.0*BBB(5.0,3.0)));
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case function_definition_with_comments
+ values { output float out0 = 3.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ /* sdfljk */ #/* sdfljk */define /* sdfljk */ FUNC( /* jklsfd*/a /*sfdjklh*/, /*sdfklj */b /*sdfklj*/) a+b
+
+ void main()
+ {
+ out0 = FUNC(1.0, 2.0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # function_definitions
+
+group recursion "Recursions Tests"
+
+ case recursion_1
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define AAA AAA
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(AAA);
+ }
+ ""
+ end
+
+ case recursion_2
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define AAA BBB
+ #define BBB AAA
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(AAA);
+ }
+ ""
+ end
+
+ case recursion_3
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define AAA (1.0+BBB)
+ #define BBB (2.0+AAA)
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(AAA);
+ }
+ ""
+ end
+
+ case recursion_4
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define AAA(a) AAA(a)
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(AAA(1.0));
+ }
+ ""
+ end
+
+ case recursion_5
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define AAA(a, b) AAA(b, a)
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(AAA(1.0, 2.0));
+ }
+ ""
+ end
+
+end # recursion
+
+group function_redefinitions "Function Redefinition Tests"
+
+ case function_redefinition_1
+ values { output float out0 = 3.0; }
+ both ""
+ precision mediump float;
+ # define FUNC(a,b) a+b
+ # define FUNC( a, b) a+b
+
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = FUNC(1.0, 2.0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case function_redefinition_2
+ values { output float out0 = 3.0; }
+ both ""
+ precision mediump float;
+ # define FUNC(a,b) (a +b)
+ # define FUNC( a, b )(a +b)
+
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = FUNC(1.0, 2.0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case function_redefinition_3
+ values { output float out0 = 3.0; }
+ both ""
+ precision mediump float;
+ # define FUNC(a,b) (a +b)
+ # define FUNC(a,b)(a /* comment
+ */ +b)
+
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = FUNC(1.0, 2.0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case invalid_function_redefinition_param_1
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define FUNC(a,b) a+b
+ # define FUNC(A,b) A+b
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0, 2.0));
+ }
+ ""
+ end
+
+ case invalid_function_redefinition_param_2
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define FUNC(a,b) a+b
+ # define FUNC(a,b,c) a+b+c
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0, 2.0, 3.0));
+ }
+ ""
+ end
+
+ case invalid_function_redefinition_param_3
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define FUNC(a,b) a+b
+ # define FUNC(a,b) b+a
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0, 2.0));
+ }
+ ""
+ end
+
+end # functions_redefinitions
+
+group invalid_function_definitions "Invalid Function Definition Tests"
+
+ case arguments_1
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define FUNC(a,b) a+b
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC);
+ }
+ ""
+ end
+
+ case arguments_2
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define FUNC(a,b) a+b
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC());
+ }
+ ""
+ end
+
+ case arguments_3
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define FUNC(a,b) a+b
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC((();
+ }
+ ""
+ end
+
+ case arguments_4
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define FUNC(a,b) a+b
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC));
+ }
+ ""
+ end
+
+ case arguments_5
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define FUNC(a,b) a+b
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0));
+ }
+ ""
+ end
+
+ case arguments_6
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define FUNC(a,b) a+b
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0);
+ }
+ ""
+ end
+
+ case arguments_7
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define FUNC(a,b) a+b
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,));
+ }
+ ""
+ end
+
+ case arguments_8
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define FUNC(a,b) a+b
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0, 2.0, 3.0));
+ }
+ ""
+ end
+
+ case unique_param_name
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define FUNC(a,a) a+a
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0));
+ }
+ ""
+ end
+
+ case argument_list_1
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define FUNC(a b) a+b
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0));
+ }
+ ""
+ end
+
+ case argument_list_2
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define FUNC(a + b) a+b
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0));
+ }
+ ""
+ end
+
+ case argument_list_3
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define FUNC(,a,b) a+b
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0));
+ }
+ ""
+ end
+
+ case no_closing_parenthesis_1
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define FUNC(
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0));
+ }
+ ""
+ end
+
+ case no_closing_parenthesis_2
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define FUNC(A a+b
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0));
+ }
+ ""
+ end
+
+ case no_closing_parenthesis_3
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define FUNC(A,B,C a+b
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0));
+ }
+ ""
+ end
+
+ case no_closing_parenthesis_4
+ expect compile_fail
+ both ""
+ precision mediump float;
+ # define FUNC(
+ ""
+ end
+
+end # invalid_function_definitions
+
+group semantic "Semantic Tests"
+
+ case ops_as_arguments
+ values { output float out0 = 20.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ #define FOO(a, b) (1 a 9) b 2
+
+ void main()
+ {
+ out0 = float(FOO(+, *));
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case correct_order
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ #define FUNC(A) A
+ #define A 2.0
+
+ void main()
+ {
+ out0 = FUNC(A - 1.0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # semantic
+
+group predefined_macros "Predefined Macros Tests"
+
+ case version
+ values { output float out0 = 100.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define AAA __VERSION__
+ out0 = float(AAA);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case gl_es_1
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ out0 = float(GL_ES);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case gl_es_2
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ #define AAA(A) A
+
+ void main()
+ {
+ out0 = float(AAA(GL_ES));
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case line_1
+ values { output float out0 = 1.0; }
+ both ""
+ const mediump int line = __LINE__;
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = float(line);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case line_2
+ # Note: Arguments are macro replaced in the first stage.
+ # Macro replacement list is expanded in the last stage.
+ values { output vec4 out0 = vec4(11.0, 11.0, 9.0, 10.0); }
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS:single-line}
+ #define BBB __LINE__, /*
+ */ __LINE__
+ #define AAA(a,b) BBB, a, b
+
+ void main()
+ {
+ out0 = vec4(AAA(__LINE__,
+ __LINE__
+ ));
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case file
+ values { output float out0 = 0.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = float(__FILE__);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case if_gl_es
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if GL_ES
+ out0 = 1.0;
+ #else
+ out0 = -1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case if_version
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if __VERSION__ == 100
+ out0 = 1.0;
+ #else
+ out0 = -1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # predefined_macros
+
+group conditional_inclusion "Conditional Inclusion Tests"
+
+ case basic_1
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define AAA asdf
+
+ #if defined AAA && !defined(BBB)
+ out0 = 1.0;
+ #else
+ out0 = 0.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case basic_2
+ values { output float out0 = 1.0; }
+ # Note: this is expected to fail contrary to native dEQP,
+ # see https://github.com/KhronosGroup/WebGL/pull/1523
+ expect compile_fail
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define AAA defined(BBB)
+
+ #if !AAA
+ out0 = 1.0;
+ #else
+ out0 = 0.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case basic_3
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 0
+ out0 = -1.0;
+ #elif 0
+ out0 = -2.0;
+ #elif 1
+ out0 = 1.0;
+ #else
+ out0 = -3.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case basic_4
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 0
+ out0 = -1.0;
+ #elif 0
+ out0 = -2.0;
+ #else
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case basic_5
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 1
+ out0 = 1.0;
+ #elif 0
+ out0 = -2.0;
+ #else
+ out0 = -1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case unary_ops_1
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if !((~2 >> 1) & 1)
+ out0 = 1.0;
+ #else
+ out0 = -1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case unary_ops_2
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if !((~(- - - - - 1 + + + + + +1) >> 1) & 1)
+ out0 = -1.0;
+ #else
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # conditional_inclusion
+
+group invalid_ops "Invalid Operations Tests"
+
+ case invalid_op_1
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if !((~(+ ++1 - - - -1) >> 1) & 1)
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #endif
+ }
+ ""
+ end
+
+ case invalid_op_2
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if !((~(+ + +1 - -- -1) >> 1) & 1)
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #endif
+ }
+ ""
+ end
+
+ case invalid_defined_expected_identifier_1
+ expect compile_fail
+ both ""
+ precision mediump float;
+ #define AAA 1
+
+ void main()
+ {
+ #if defined
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #endif
+ }
+ ""
+ end
+
+ case invalid_defined_expected_identifier_2
+ expect compile_fail
+ both ""
+ precision mediump float;
+ #define AAA 1
+
+ void main()
+ {
+ #if defined()
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #endif
+ }
+ ""
+ end
+
+ case invalid_defined_expected_identifier_3
+ expect compile_fail
+ both ""
+ precision mediump float;
+ #define AAA 1
+
+ void main()
+ {
+ #if defined(
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #endif
+ }
+ ""
+ end
+
+ case invalid_defined_expected_identifier_4
+ expect compile_fail
+ both ""
+ precision mediump float;
+ #define AAA 1
+
+ void main()
+ {
+ #if defined)
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #endif
+ }
+ ""
+ end
+
+ case invalid_defined_expected_identifier_5
+ expect compile_fail
+ both ""
+ precision mediump float;
+ #define AAA 1
+
+ void main()
+ {
+ #if defined((AAA))
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0);
+ #endif
+ }
+ ""
+ end
+
+ case invalid_defined_expected_rparen
+ expect compile_fail
+ both ""
+ precision mediump float;
+ #define AAA 1
+
+ void main()
+ {
+ #if defined(AAA
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #endif
+ }
+ ""
+ end
+
+ case defined_define
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ #define define 1
+ #define AAA 1.0
+
+ void main()
+ {
+ out0 = AAA;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # invalid_ops
+
+group undefined_identifiers "Undefined Identifiers Tests"
+
+ case valid_undefined_identifier_1
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 1 || AAA
+ out0 = 1.0;
+ #else
+ out0 = -1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case valid_undefined_identifier_2
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 0 && AAA
+ out0 = -1.0;
+ #else
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case undefined_identifier_1
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if 1 - CCC + (-AAA || BBB)
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #endif
+ }
+ ""
+ end
+
+ case undefined_identifier_2
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if !A
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #endif
+ }
+ ""
+ end
+
+ case undefined_identifier_3
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if -A
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #endif
+ }
+ ""
+ end
+
+ case undefined_identifier_4
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if ~A
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #endif
+ }
+ ""
+ end
+
+ case undefined_identifier_5
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if A && B
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #endif
+ }
+ ""
+ end
+
+ case undefined_identifier_6
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #define A 1
+ #if A && B
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #endif
+ }
+ ""
+ end
+
+ case undefined_identifier_7
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #define B 1
+ #if A && B
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #endif
+ }
+ ""
+ end
+
+ case undefined_identifier_8
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #define B 1
+ #define A 2
+ #undef A
+ #if A && B
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #endif
+ }
+ ""
+ end
+
+ case undefined_identifier_9
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if A || B
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #endif
+ }
+ ""
+ end
+
+ case undefined_identifier_10
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #define A 0
+ #if A || B
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #endif
+ }
+ ""
+ end
+
+ case undefined_identifier_11
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #define A 0
+ #define B 2
+ #undef B
+ #if A || B
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #endif
+ }
+ ""
+ end
+
+ case undefined_identifier_12
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #define B 1
+ #if A || B
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #endif
+ }
+ ""
+ end
+
+end # undefined_identifiers
+
+group invalid_conditionals "Invalid Conditionals Tests"
+
+ case empty_if
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case empty_ifdef
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #ifdef
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case empty_ifndef
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #ifndef
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case empty_if_defined
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if defined
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case unterminated_if_1
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if 1
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case unterminated_if_2
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if 0
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case unterminated_ifdef
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #ifdef FOOBAR
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case unterminated_ifndef
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #ifndef GL_ES
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case unterminated_else_1
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if 1
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case unterminated_else_2
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if 0
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case unterminated_elif_1
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if 0
+ #elif 1
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case unterminated_elif_2
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if 1
+ #elif 0
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case unterminated_elif_3
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if 0
+ #elif 0
+ ${POSITION_FRAG_COLOR} = vec4(2.0);
+ }
+ ""
+ end
+
+ case elif_after_else
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if 0
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #elif 1
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ #endif
+ }
+ ""
+ end
+
+ case else_without_if
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #endif
+ }
+ ""
+ end
+
+ case elif_without_if
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #elif 1
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #endif
+ }
+ ""
+ end
+
+ case endif_without_if
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #endif
+ }
+ ""
+ end
+
+ case else_after_else
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if !GL_ES
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #endif
+ }
+ ""
+ end
+
+ case nested_elif_without_if
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if 1
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ # elif
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ # endif
+ #endif
+ }
+ ""
+ end
+
+ case if_float
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if 1.231
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ # elif
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ # endif
+ #endif
+ }
+ ""
+ end
+
+ case tokens_after_if
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if 1 foobar
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #endif
+ }
+ ""
+ end
+
+ case tokens_after_elif
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if 0
+ #elif foobar
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #endif
+ }
+ ""
+ end
+
+ case tokens_after_else
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if 1
+ #else foobar 1.231
+ #endif
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case tokens_after_endif
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if 1
+ #else
+ #endif foobar
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case tokens_after_ifdef
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #ifdef FOOBAR foobar
+ #else
+ #endif
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case tokens_after_ifndef
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #ifndef FOOBAR ,, +- << barbar
+ #else
+ #endif
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+end # invalid_conditionals
+
+group conditionals "Conditionals Tests"
+
+ case unterminated_nested_blocks
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if 1
+ # if 1
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case ifdef_1
+ values { output float out0 = 1.0; }
+ both ""
+ #define AAA
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #ifdef AAA
+ out0 = 1.0;
+ #else
+ out0 = -1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ifdef_2
+ values { output float out0 = 1.0; }
+ both ""
+ #define AAA
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if defined ( AAA)
+ out0 = 1.0;
+ #else
+ out0 = -1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ifdef_3
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #ifdef AAA
+ out0 = -1.0;
+ #else
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case invalid_ifdef
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #ifdef 1
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #endif
+ }
+ ""
+ end
+
+ case ifndef_1
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #ifndef AAA
+ out0 = 1.0;
+ #else
+ out0 = -1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ifndef_2
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ #define AAA
+ void main()
+ {
+ #ifndef AAA
+ out0 = -1.0;
+ #else
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case invalid_ifndef
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #ifndef 1
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #endif
+ }
+ ""
+ end
+
+ case mixed_conditional_inclusion
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #ifndef AAA
+ out0 = 1.0;
+ #elif 1
+ out0 = -1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case nested_if_1
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if GL_ES
+ # if __VERSION__ != 100
+ out0 = -1.0;
+ # else
+ out0 = 1.0;
+ # endif
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case nested_if_2
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 1
+ # if 0
+ out0 = -1.0;
+ # else
+ # if 0
+ out0 = -1.0;
+ # elif 1
+ out0 = 1.0;
+ # else
+ out0 = -1.0;
+ # endif
+ # endif
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case nested_if_3
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 0
+ # if 1
+ out0 = -1.0;
+ # endif
+ #else
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # conditionals
+
+group directive "Directive Tests"
+
+ case version
+ values { output float out0 = 1.0; }
+ both ""
+ /* asdf */
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case version_is_less
+ expect compile_fail
+ both ""
+ #version 99
+ precision mediump float;
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case version_is_more
+ expect compile_fail
+ both ""
+ #version 101
+ precision mediump float;
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case version_missing
+ expect compile_fail
+ both ""
+ #version
+ precision mediump float;
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case version_not_first_statement_1
+ expect compile_fail
+ both ""
+ precision mediump float;
+ #version 100
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case version_not_first_statement_2
+ expect compile_fail
+ both ""
+ #define FOO BAR
+ #version 100
+ precision mediump float;
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case version_invalid_token_1
+ expect compile_fail
+ both ""
+ #version 100.0
+ precision mediump float;
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case version_invalid_token_2
+ expect compile_fail
+ both ""
+ #version foobar
+ precision mediump float;
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case invalid_version
+ expect compile_fail
+ both ""
+ #version AAA
+ precision mediump float;
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case additional_tokens
+ expect compile_fail
+ both ""
+ #version 100 foobar
+ precision mediump float;
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case error_with_no_tokens
+ expect compile_fail
+ both ""
+ #error
+ precision mediump float;
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case error
+ expect compile_fail
+ both ""
+ #define AAA asdf
+ #error 1 * AAA /* comment */
+ precision mediump float;
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+end # directive
+
+group builtin "Built-in Symbol Tests"
+
+ case line
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #line 1
+ out0 = float(__LINE__);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case line_and_file
+ values { output vec4 out0 = vec4(234.0, 234.0, 10.0, 10.0); }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #line 234 10
+ out0 = vec4(__LINE__, __LINE__, __FILE__, __FILE__);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case line_expression
+ values { output float out0 = 20.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #line +20
+ out0 = float(__LINE__);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case line_and_file_expression
+ values { output vec4 out0 = vec4(243.0, 243.0, 10.0, 10.0); }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #line (233 +10) (+10)
+ out0 = vec4(__LINE__, __LINE__, __FILE__, __FILE__);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case line_defined_1
+ values { output float out0 = 4.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define A 4
+ #line A
+ out0 = float(__LINE__);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case line_defined_2
+ values { output vec4 out0 = vec4(234.0, 234.0, 10.0, 10.0); }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define A 10
+ #line 234 A
+ out0 = vec4(__LINE__, __LINE__, __FILE__, __FILE__);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case empty_line
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #line
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case invalid_line_file_1
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #line 22 1.234
+ ${POSITION_FRAG_COLOR} = vec4(__LINE__, __LINE__, __FILE__, __FILE__);
+ }
+ ""
+ end
+
+ case invalid_line_file_3
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #line 233 10 2
+ ${POSITION_FRAG_COLOR} = vec4(__LINE__, __LINE__, __FILE__, __FILE__);
+ }
+ ""
+ end
+
+ case invalid_line_file_4
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #line foobar
+ ${POSITION_FRAG_COLOR} = vec4(__LINE__, __LINE__, __FILE__, __FILE__);
+ }
+ ""
+ end
+
+end # builtin
+
+group pragmas "Pragma Tests"
+
+ # Note: pragma_vertex was removed compared to the native dEQP.
+ # This test was in the gles2-failures.txt skip list in the
+ # native dEQP. While it seemed theoretically correct, in
+ # practice, linking the program failed on Mac OS on all GPU
+ # types. Since this version of the dEQP is unlikely to be
+ # revisited, the test was removed here, rather than adding it
+ # to tcuSkipList.js.
+
+ # Note: pragma_fragment was removed compared to the native dEQP.
+ # This test was buggy; it required that a varying that was not
+ # invariant in the vertex shader, but invariant in the fragment
+ # shader, must link. The test was in the gles2-failures.txt skip
+ # list in the native test suite. To avoid confusion the test was
+ # removed here, rather than adding it to tcuSkipList.js.
+
+ case pragma_macro_exp
+ values { output float out0 = 1.0; }
+ both ""
+ #define off INVALID
+ /* pragma line not macro expanded */
+ #pragma debug(off)
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case pragma_unrecognized_debug
+ expect build_successful
+ both ""
+ #pragma debug(1.23)
+
+ // unrecognized preprocessor token
+
+ precision mediump float;
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case pragma_unrecognized_token
+ expect build_successful
+ both ""
+ #pragma **%
+
+ // trailing bytes form a valid but unrecognized preprocessor token
+
+ precision mediump float;
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+end # pragmas
+
+group extensions "Extension Tests"
+
+ case basic
+ values { output float out0 = 1.0; }
+ both ""
+ #extension all : warn
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case macro_exp
+ values { output float out0 = 1.0; }
+ both ""
+ #define warn enable
+
+ #extension all : warn
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case missing_extension_name
+ expect compile_fail
+ both ""
+ #extension
+ precision mediump float;
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case invalid_extension_name
+ expect compile_fail
+ both ""
+ #extension 2 : all
+ precision mediump float;
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case missing_colon
+ expect compile_fail
+ both ""
+ #extension all
+ precision mediump float;
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case expected_colon
+ expect compile_fail
+ both ""
+ #extension all ;
+ precision mediump float;
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case missing_behavior
+ expect compile_fail
+ both ""
+ #extension all :
+ precision mediump float;
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case invalid_behavior_1
+ expect compile_fail
+ both ""
+ #extension all : WARN
+ precision mediump float;
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case invalid_behavior_2
+ expect compile_fail
+ both ""
+ #extension all : require
+ precision mediump float;
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case invalid_char_in_name
+ expect compile_fail
+ both ""
+ #extension all* : warn
+ precision mediump float;
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case invalid_char_in_behavior
+ expect compile_fail
+ both ""
+ #extension all : war*n
+ precision mediump float;
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case unterminated_comment
+ expect compile_fail
+ both ""
+ #extension all : warn /*asd
+ precision mediump float;
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+end # extensions
+
+group expressions "Expression Tests"
+
+ case shift_left
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL 4
+ out0 = 0.0;
+ #if (VAL << 2) == 16
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case shift_right
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL 5
+ out0 = 0.0;
+ #if (VAL >> 1) == 2
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case cmp_less_than
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL 5
+ out0 = 0.0;
+ #if (VAL < 6) && (-VAL < -4)
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case less_or_equal
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL 6
+ out0 = 0.0;
+ #if (VAL <= 6) && (-VAL <= -6)
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case or
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL 6
+ out0 = 0.0;
+ #if (VAL | 5) == 7
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case and
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL 6
+ out0 = 0.0;
+ #if (VAL & 5) == 4
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case xor
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL 6
+ out0 = 0.0;
+ #if (VAL ^ 5) == 3
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mod
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL 12
+ out0 = 0.0;
+ #if (VAL % 5) == 2
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case parenthesis_value
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL (( (4 ) ) )
+ out0 = 0.0;
+ #if VAL >= 4
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case parenthesis_tricky
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL (( (4 ) )
+ out0 = 0.0;
+ #if VAL) >= 4
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case parenthesis_if_no
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL 4
+ out0 = 0.0;
+ #if VAL >= 4
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case parenthesis_if
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL 4
+ out0 = 0.0;
+ #if (VAL >= 4)
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case parenthesis_multi_if
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL (4)
+ out0 = 0.0;
+ #if (((VAL)) >= (4))
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case parenthesis_single_if
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL 4
+ out0 = 0.0;
+ #if (VAL >= 4)
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case parenthesis_ifelse_true
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL 4
+ #if (VAL >= 4)
+ out0 = 1.0;
+ #else
+ out0 = 0.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case parenthesis_ifelse_false
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL 4
+ #if (VAL > 4)
+ out0 = 0.0;
+ #else
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case eval_basic_0
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if -4 + 5 == 1
+ out0 = 1.0;
+ #else
+ out0 = 0.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case eval_basic_1
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if (2 * 2) - 3 >= 0
+ out0 = 1.0;
+ #else
+ out0 = 0.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case eval_simple_precedence_0
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 2 * 3 - 3 == 3
+ out0 = 1.0;
+ #else
+ out0 = 0.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case eval_simple_precedence_1
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 2 - 2 / 2 == 1
+ out0 = 1.0;
+ #else
+ out0 = 0.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case defined_1
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ #define X 0
+ void main()
+ {
+ #if defined(X)
+ out0 = 1.0;
+ #else
+ out0 = 0.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case defined_2
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ #define X 0
+ #define Y 1
+ void main()
+ {
+ #if defined(X) == Y
+ out0 = 1.0;
+ #else
+ out0 = 0.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case defined_3
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ #define X 0
+ #define Y 1
+ void main()
+ {
+ #if defined(X) && defined(Y)
+ out0 = 1.0;
+ #else
+ out0 = 0.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case defined_4
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ #define X 0
+ #define Y 1
+ #undef X
+ void main()
+ {
+ #if defined(X) && defined(Y)
+ out0 = 0.0;
+ #else
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case defined_5
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ #define X 0
+ #define Y 1
+ #undef X
+ void main()
+ {
+ #if defined(X) || defined(Y)
+ out0 = 1.0;
+ #else
+ out0 = 0.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case defined_6
+ values { output float out0 = 1.0; }
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+ #define X 0
+ #define Y 1
+ #undef Y
+ void main()
+ {
+ #if defined(X) && (defined(Y) || (X == 0))
+ out0 = 1.0;
+ #else
+ out0 = 0.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # expressions
+
+group invalid_expressions "Invalid Expression Tests"
+
+ case invalid_unary_expr
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if !
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case invalid_binary_expr
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if 3+4+
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case missing_expr
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case invalid_expr_1
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if 4 4
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case invalid_expr_2
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if 4 * * 4
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case invalid_expr_3
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if (4)(4)
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case unopened_parenthesis
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if 4)
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case unclosed_parenthesis
+ expect compile_fail
+ both ""
+ precision mediump float;
+ void main()
+ {
+ #if ((4 + 7)
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+end # invalid_expressions
+
+group operator_precedence "Operator precedence"
+
+
+ case modulo_vs_not
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 % ! 0 ) == 0
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case div_vs_not
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 / ! 0 ) == 8
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mul_vs_not
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 * ! 0 ) == 8
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case modulo_vs_bit_invert
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 % ~ 4 ) == 3
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case modulo_vs_minus
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 % - 2 ) == 0
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case modulo_vs_plus
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 % + 2 ) == 0
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case div_vs_bit_invert
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 / ~ 2 ) == -2
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case div_vs_minus
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 / - 2 ) == -4
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case div_vs_plus
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 / + 2 ) == 4
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mul_vs_bit_invert
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 * ~ 2 ) == -24
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mul_vs_minus
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 * - 2 ) == -16
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mul_vs_plus
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 * + 2 ) == 16
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case sub_vs_modulo
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 - 3 % 2 ) == 7
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case sub_vs_div
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 - 3 / 2 ) == 7
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case sub_vs_mul
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 - 3 * 2 ) == 2
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case add_vs_modulo
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 + 3 % 2 ) == 9
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case add_vs_div
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 + 3 / 2 ) == 9
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case add_vs_mul
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 + 3 * 2 ) == 14
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case rshift_vs_sub
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 >> 3 - 2 ) == 4
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case rshift_vs_add
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 >> 3 + 2 ) == 0
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case lshift_vs_sub
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 << 3 - 2 ) == 16
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case lshift_vs_add
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 << 3 + 2 ) == 256
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case greater_or_equal_vs_rshift
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 >= 3 >> 2 ) == 1
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case greater_or_equal_vs_lshift
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 >= 3 << 2 ) == 0
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case less_or_equal_vs_rshift
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 <= 3 >> 2 ) == 0
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case less_or_equal_vs_lshift
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 <= 3 << 2 ) == 1
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case greater_vs_rshift
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 > 3 >> 2 ) == 1
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case greater_vs_lshift
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 > 3 << 2 ) == 0
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case less_vs_rshift
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 < 3 >> 2 ) == 0
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case less_vs_lshift
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 < 3 << 2 ) == 1
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case not_equal_vs_greater_or_equal
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 != 3 >= 2 ) == 1
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case not_equal_vs_less_or_equal
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 != 3 <= 2 ) == 1
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case not_equal_vs_greater
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 != 3 > 2 ) == 1
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case not_equal_vs_less
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 != 3 < 2 ) == 1
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case equal_vs_greater_or_equal
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 == 3 >= 2 ) == 0
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case equal_vs_less_or_equal
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 == 3 <= 2 ) == 0
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case equal_vs_greater
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 == 3 > 2 ) == 0
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case equal_vs_less
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 == 3 < 2 ) == 0
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bitwise_and_vs_not_equal
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 & 3 != 2 ) == 0
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bitwise_and_vs_equal
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 & 3 == 2 ) == 0
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case xor_vs_bitwise_and
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 ^ 3 & 2 ) == 10
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bitwise_or_vs_xor
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 8 | 3 ^ 2 ) == 9
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case logical_and_vs_bitwise_or
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 0 && 3 | 2 )
+ #define VAL 0.0
+ #else
+ #define VAL 1.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case logical_and_vs_bitwise_and
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 0 && 4 & 2 )
+ #define VAL 0.0
+ #else
+ #define VAL 1.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case logical_or_vs_logical_and
+ values { output float out0 = 1.0; }
+ both ""
+
+ #if ( 0 || 4 && 0 )
+ #define VAL 0.0
+ #else
+ #define VAL 1.0
+ #endif
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # operator_precedence
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/qualification_order.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/qualification_order.html
new file mode 100644
index 0000000000..be660758b1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/qualification_order.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'qualification_order';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/qualification_order.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/qualification_order.test
new file mode 100644
index 0000000000..4b20ad8ee8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/qualification_order.test
@@ -0,0 +1,785 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+
+group variables "Order of qualification in variable declarations."
+
+ group valid "Valid orderings."
+
+ case invariant_storage_precision
+ expect pass
+ values {}
+
+ vertex ""
+ precision mediump float;
+ attribute highp vec4 dEQP_Position;
+
+ invariant varying lowp float x0;
+
+ uniform mediump float x1;
+
+ attribute mediump float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ precision mediump float;
+
+ invariant varying lowp float x0;
+
+ uniform mediump float x1;
+
+ void main()
+ {
+ float result = x0 + x1;
+ gl_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case storage_precision
+ expect pass
+ values {}
+
+ vertex ""
+ precision mediump float;
+ attribute highp vec4 dEQP_Position;
+
+ varying lowp float x0;
+
+ uniform mediump float x1;
+
+ attribute mediump float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ precision mediump float;
+
+ varying lowp float x0;
+
+ uniform mediump float x1;
+
+ void main()
+ {
+ float result = x0 + x1;
+ gl_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case invariant_storage
+ expect pass
+ values {}
+
+ vertex ""
+ precision mediump float;
+ attribute highp vec4 dEQP_Position;
+
+ invariant varying float x0;
+
+ uniform float x1;
+
+ attribute float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ precision mediump float;
+
+ invariant varying float x0;
+
+ uniform float x1;
+
+ void main()
+ {
+ float result = x0 + x1;
+ gl_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+
+ end # valid
+ group invalid "Invalid orderings."
+
+ case invariant_precision_storage
+ expect compile_fail
+ values {}
+
+ vertex ""
+ precision mediump float;
+ attribute highp vec4 dEQP_Position;
+
+ invariant lowp varying float x0;
+
+ mediump uniform float x1;
+
+ mediump attribute float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ precision mediump float;
+
+ invariant lowp varying float x0;
+
+ mediump uniform float x1;
+
+ void main()
+ {
+ float result = x0 + x1;
+ gl_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case storage_invariant_precision
+ expect compile_fail
+ values {}
+
+ vertex ""
+ precision mediump float;
+ attribute highp vec4 dEQP_Position;
+
+ varying invariant lowp float x0;
+
+ uniform mediump float x1;
+
+ attribute mediump float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ precision mediump float;
+
+ varying invariant lowp float x0;
+
+ uniform mediump float x1;
+
+ void main()
+ {
+ float result = x0 + x1;
+ gl_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case storage_precision_invariant
+ expect compile_fail
+ values {}
+
+ vertex ""
+ precision mediump float;
+ attribute highp vec4 dEQP_Position;
+
+ varying lowp invariant float x0;
+
+ uniform mediump float x1;
+
+ attribute mediump float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ precision mediump float;
+
+ varying lowp invariant float x0;
+
+ uniform mediump float x1;
+
+ void main()
+ {
+ float result = x0 + x1;
+ gl_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case precision_invariant_storage
+ expect compile_fail
+ values {}
+
+ vertex ""
+ precision mediump float;
+ attribute highp vec4 dEQP_Position;
+
+ lowp invariant varying float x0;
+
+ mediump uniform float x1;
+
+ mediump attribute float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ precision mediump float;
+
+ lowp invariant varying float x0;
+
+ mediump uniform float x1;
+
+ void main()
+ {
+ float result = x0 + x1;
+ gl_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case precision_storage_invariant
+ expect compile_fail
+ values {}
+
+ vertex ""
+ precision mediump float;
+ attribute highp vec4 dEQP_Position;
+
+ lowp varying invariant float x0;
+
+ mediump uniform float x1;
+
+ mediump attribute float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ precision mediump float;
+
+ lowp varying invariant float x0;
+
+ mediump uniform float x1;
+
+ void main()
+ {
+ float result = x0 + x1;
+ gl_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case precision_storage
+ expect compile_fail
+ values {}
+
+ vertex ""
+ precision mediump float;
+ attribute highp vec4 dEQP_Position;
+
+ lowp varying float x0;
+
+ mediump uniform float x1;
+
+ mediump attribute float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ precision mediump float;
+
+ lowp varying float x0;
+
+ mediump uniform float x1;
+
+ void main()
+ {
+ float result = x0 + x1;
+ gl_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case storage_invariant
+ expect compile_fail
+ values {}
+
+ vertex ""
+ precision mediump float;
+ attribute highp vec4 dEQP_Position;
+
+ varying invariant float x0;
+
+ uniform float x1;
+
+ attribute float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ precision mediump float;
+
+ varying invariant float x0;
+
+ uniform float x1;
+
+ void main()
+ {
+ float result = x0 + x1;
+ gl_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+
+ end # invalid
+
+end # variables
+group parameters "Order of qualification in function parameters."
+
+ group valid "Valid orderings."
+
+ case storage_parameter_precision
+ expect pass
+ values {}
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float foo0 (const in lowp float x)
+ {
+ return x + 1.0;
+ }
+
+ void foo1 ( out mediump float x)
+ {
+ x = 1.0;
+ }
+
+ float foo2 ( inout mediump float x)
+ {
+ return x + 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float result;
+ foo1(result);
+ float x0 = foo0(1.0);
+ foo2(result);
+ ${OUTPUT}
+ }
+ ""
+ end
+ case storage_parameter
+ expect pass
+ values {}
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float foo0 (const in float x)
+ {
+ return x + 1.0;
+ }
+
+ void foo1 ( out float x)
+ {
+ x = 1.0;
+ }
+
+ float foo2 ( inout float x)
+ {
+ return x + 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float result;
+ foo1(result);
+ float x0 = foo0(1.0);
+ foo2(result);
+ ${OUTPUT}
+ }
+ ""
+ end
+ case storage_precision
+ expect pass
+ values {}
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float foo0 (const lowp float x)
+ {
+ return x + 1.0;
+ }
+
+ void foo1 ( mediump float x)
+ {
+ x = 1.0;
+ }
+
+ float foo2 ( mediump float x)
+ {
+ return x + 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float result;
+ foo1(result);
+ float x0 = foo0(1.0);
+ foo2(result);
+ ${OUTPUT}
+ }
+ ""
+ end
+ case parameter_precision
+ expect pass
+ values {}
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float foo0 (in lowp float x)
+ {
+ return x + 1.0;
+ }
+
+ void foo1 (out mediump float x)
+ {
+ x = 1.0;
+ }
+
+ float foo2 (inout mediump float x)
+ {
+ return x + 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float result;
+ foo1(result);
+ float x0 = foo0(1.0);
+ foo2(result);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ end # valid
+ group invalid "Invalid orderings."
+
+ case storage_precision_parameter
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float foo0 (const lowp in float x)
+ {
+ return x + 1.0;
+ }
+
+ void foo1 ( mediump out float x)
+ {
+ x = 1.0;
+ }
+
+ float foo2 ( mediump inout float x)
+ {
+ return x + 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float result;
+ foo1(result);
+ float x0 = foo0(1.0);
+ foo2(result);
+ ${OUTPUT}
+ }
+ ""
+ end
+ case parameter_storage_precision
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float foo0 (in const lowp float x)
+ {
+ return x + 1.0;
+ }
+
+ void foo1 (out mediump float x)
+ {
+ x = 1.0;
+ }
+
+ float foo2 (inout mediump float x)
+ {
+ return x + 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float result;
+ foo1(result);
+ float x0 = foo0(1.0);
+ foo2(result);
+ ${OUTPUT}
+ }
+ ""
+ end
+ case parameter_precision_storage
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float foo0 (in lowp const float x)
+ {
+ return x + 1.0;
+ }
+
+ void foo1 (out mediump float x)
+ {
+ x = 1.0;
+ }
+
+ float foo2 (inout mediump float x)
+ {
+ return x + 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float result;
+ foo1(result);
+ float x0 = foo0(1.0);
+ foo2(result);
+ ${OUTPUT}
+ }
+ ""
+ end
+ case precision_storage_parameter
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float foo0 (lowp const in float x)
+ {
+ return x + 1.0;
+ }
+
+ void foo1 (mediump out float x)
+ {
+ x = 1.0;
+ }
+
+ float foo2 (mediump inout float x)
+ {
+ return x + 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float result;
+ foo1(result);
+ float x0 = foo0(1.0);
+ foo2(result);
+ ${OUTPUT}
+ }
+ ""
+ end
+ case precision_parameter_storage
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float foo0 (lowp in const float x)
+ {
+ return x + 1.0;
+ }
+
+ void foo1 (mediump out float x)
+ {
+ x = 1.0;
+ }
+
+ float foo2 (mediump inout float x)
+ {
+ return x + 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float result;
+ foo1(result);
+ float x0 = foo0(1.0);
+ foo2(result);
+ ${OUTPUT}
+ }
+ ""
+ end
+ case parameter_storage
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float foo0 (in const float x)
+ {
+ return x + 1.0;
+ }
+
+ void foo1 (out float x)
+ {
+ x = 1.0;
+ }
+
+ float foo2 (inout float x)
+ {
+ return x + 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float result;
+ foo1(result);
+ float x0 = foo0(1.0);
+ foo2(result);
+ ${OUTPUT}
+ }
+ ""
+ end
+ case precision_storage
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float foo0 (lowp const float x)
+ {
+ return x + 1.0;
+ }
+
+ void foo1 (mediump float x)
+ {
+ x = 1.0;
+ }
+
+ float foo2 (mediump float x)
+ {
+ return x + 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float result;
+ foo1(result);
+ float x0 = foo0(1.0);
+ foo2(result);
+ ${OUTPUT}
+ }
+ ""
+ end
+ case precision_parameter
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float foo0 (lowp in float x)
+ {
+ return x + 1.0;
+ }
+
+ void foo1 (mediump out float x)
+ {
+ x = 1.0;
+ }
+
+ float foo2 (mediump inout float x)
+ {
+ return x + 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float result;
+ foo1(result);
+ float x0 = foo0(1.0);
+ foo2(result);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ end # invalid
+
+end # parameters
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/reserved_operators.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/reserved_operators.html
new file mode 100644
index 0000000000..b98b97b773
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/reserved_operators.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'reserved_operators';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/reserved_operators.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/reserved_operators.test
new file mode 100644
index 0000000000..dda1f1aade
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/reserved_operators.test
@@ -0,0 +1,250 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+
+case operator_modulo
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ int value = 100;
+ value % 1;
+ ${OUTPUT}
+ }
+ ""
+end
+case operator_bitwise_not
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ int value = 100;
+ value = ~value;
+ ${OUTPUT}
+ }
+ ""
+end
+case operator_bitwise_shift_left
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ int value = 100;
+ value << 1;
+ ${OUTPUT}
+ }
+ ""
+end
+case operator_bitwise_shift_right
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ int value = 100;
+ value >> 1;
+ ${OUTPUT}
+ }
+ ""
+end
+case operator_bitwise_and
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ int value = 100;
+ value & 1;
+ ${OUTPUT}
+ }
+ ""
+end
+case operator_bitwise_xor
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ int value = 100;
+ value ^ 1;
+ ${OUTPUT}
+ }
+ ""
+end
+case operator_bitwise_or
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ int value = 100;
+ value | 1;
+ ${OUTPUT}
+ }
+ ""
+end
+case operator_assign_modulo
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ int value = 100;
+ value %= 1;
+ ${OUTPUT}
+ }
+ ""
+end
+case operator_assign_shift_left
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ int value = 100;
+ value <<= 1;
+ ${OUTPUT}
+ }
+ ""
+end
+case operator_assign_shift_right
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ int value = 100;
+ value >>= 1;
+ ${OUTPUT}
+ }
+ ""
+end
+case operator_assign_and
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ int value = 100;
+ value &= 1;
+ ${OUTPUT}
+ }
+ ""
+end
+case operator_assign_xor
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ int value = 100;
+ value ^= 1;
+ ${OUTPUT}
+ }
+ ""
+end
+case operator_assign_or
+ expect compile_fail
+ values {}
+
+ both ""
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ int value = 100;
+ value |= 1;
+ ${OUTPUT}
+ }
+ ""
+end
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/scoping.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/scoping.html
new file mode 100644
index 0000000000..5d01ef844f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/scoping.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'scoping';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/scoping.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/scoping.test
new file mode 100644
index 0000000000..a387631af4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/scoping.test
@@ -0,0 +1,823 @@
+group valid "Valid scoping and name redeclaration cases"
+
+ case local_variable_hides_global_variable
+ version 100 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ int a = -1;
+
+ void main()
+ {
+ ${SETUP}
+ int a = in0;
+
+ out0 = a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case block_variable_hides_local_variable
+ version 100 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${SETUP}
+ int a = in0;
+ {
+ int a = -1;
+ }
+ out0 = a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case block_variable_hides_global_variable
+ version 100 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ int a = -1;
+
+ void main()
+ {
+ ${SETUP}
+ {
+ int a = in0;
+
+ out0 = a;
+ }
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case for_init_statement_variable_hides_local_variable
+ version 100 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${SETUP}
+ int a = in0;
+ for (int a = 0; a < 10; a++)
+ {
+ }
+ out0 = a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case for_init_statement_variable_hides_global_variable
+ version 100 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ int a = 5;
+
+ void main()
+ {
+ ${SETUP}
+ for (int a = 0; a < 10; a++)
+ {
+ }
+ out0 = in0 + a - 5;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case variable_in_if_hides_global_variable
+ version 100 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ int a = 1;
+
+ void main()
+ {
+ ${SETUP}
+ if (true)
+ int a = 42;
+ out0 = a*in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case variable_from_outer_scope_visible_in_initializer
+ version 100 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${SETUP}
+ int a = in0;
+ {
+ int a = a+5, b = a-5;
+ out0 = b;
+ a = 42;
+ }
+ out0 = out0 + a - in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case local_int_variable_hides_struct_type
+ version 100 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ struct S { int val; };
+
+ void main()
+ {
+ ${SETUP}
+ int S = S(in0).val;
+ out0 = S;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case local_struct_variable_hides_struct_type
+ version 100 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ struct S { int val; };
+
+ void main()
+ {
+ ${SETUP}
+ S S = S(in0);
+ out0 = S.val;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case local_variable_hides_function
+ version 100 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ int foo (int x) { return x; }
+
+ void main()
+ {
+ ${SETUP}
+ int foo = in0;
+ out0 = foo;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case function_parameter_hides_global_variable
+ version 100 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ int a = -1;
+
+ int func (int a) { return a; }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case function_parameter_hides_struct_type
+ version 100 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ struct S { int x; };
+
+ int func (int S) { return S; }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case function_parameter_hides_function
+ version 100 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ int func (int func) { return func; }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case local_variable_in_inner_scope_hides_function_parameter
+ version 100 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+ int func (int inp, int x) { { int x = 5; return inp + x - 5; } }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0, 42);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end
+
+group invalid "Invalid scoping behavior"
+
+ case redeclare_global_variable
+ version 100 es
+ expect compile_fail
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ int a;
+ float a;
+
+ void main()
+ {
+ a = 1.0;
+ ${POSITION_FRAG_COLOR} = vec4(a);
+ }
+ ""
+ end
+
+ case redeclare_local_variable
+ version 100 es
+ expect compile_fail
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ int a;
+ float a;
+ a = 1.0;
+ ${POSITION_FRAG_COLOR} = vec4(a);
+ }
+ ""
+ end
+
+ case redeclare_for_init_statement_variable
+ version 100 es
+ expect compile_fail
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ for (int i = 0; i < 10; i++)
+ {
+ int i = 11;
+ }
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ }
+ ""
+ end
+
+ case redeclare_for_condition_variable
+ version 100 es
+ expect compile_fail
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ for (int i = 0; int a = (i < 10); i++)
+ {
+ int a = 0;
+ }
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ }
+ ""
+ end
+
+ case redeclare_for_init_statement_variable_in_for_condition
+ version 100 es
+ expect compile_fail
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ float a;
+ for (int i = 0; int i = (i < 10); i++)
+ {
+ a = sin(i);
+ }
+ ${POSITION_FRAG_COLOR} = vec4(a);
+ }
+ ""
+ end
+
+ case redeclare_while_condition_variable
+ version 100 es
+ expect compile_fail
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ int a = 0;
+ while (int i = (a < 5))
+ {
+ int i = 11;
+ a += i;
+ }
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ }
+ ""
+ end
+
+ case redeclare_function
+ version 100 es
+ expect compile_fail
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func(float x);
+ float func(float x);
+
+ float func(float x) { return x + 1.0; }
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(func(1.0));
+ }
+ ""
+ end
+
+ case redefine_function
+ version 100 es
+ expect compile_fail
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func(float x);
+
+ float func(float x) { return x + 1.0; }
+ float func(float x) { return x + 2.0; }
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(func(1.0));
+ }
+ ""
+ end
+
+ case redeclare_builtin
+ version 100 es
+ expect compile_fail
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float sin(float x);
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(sin(1.0));
+ }
+ ""
+ end
+
+ case redefine_builtin
+ version 100 es
+ expect compile_fail
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float sin(float x) { return x + 1.0; }
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(sin(1.0));
+ }
+ ""
+ end
+
+ case conflict_function_struct
+ version 100 es
+ expect compile_fail
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void f(int x);
+ struct f { int x; };
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1);
+ }
+ ""
+ end
+
+ case conflict_function_variable
+ version 100 es
+ expect compile_fail
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void f(int x);
+ float f;
+
+ void main()
+ {
+ f = 1.0;
+ ${POSITION_FRAG_COLOR} = vec4(f);
+ }
+ ""
+ end
+
+ case use_global_variable_before_declaration
+ version 100 es
+ expect compile_fail
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func()
+ {
+ a = 2.0;
+ }
+
+ float a;
+
+ void main()
+ {
+ func();
+ ${POSITION_FRAG_COLOR} = vec4(a);
+ }
+ ""
+ end
+
+ case use_local_variable_before_declaration
+ version 100 es
+ expect compile_fail
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ float a = 1.0;
+ a = b;
+ float b = 2.0;
+
+ ${POSITION_FRAG_COLOR} = vec4(a);
+ }
+ ""
+ end
+
+ case use_struct_type_before_declaration
+ version 100 es
+ expect compile_fail
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float x) { return S(x).val; }
+ struct S { float val; };
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(func(1.0));
+ }
+ ""
+ end
+
+ case use_function_before_declaration
+ version 100 es
+ expect compile_fail
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float x) { return bar(x); }
+ float bar (float x) { return x; }
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(func(1.0));
+ }
+ ""
+ end
+
+ case use_variable_from_block_in_outer_scope
+ version 100 es
+ expect compile_fail
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ {
+ float a = 1.0;
+ }
+ ${POSITION_FRAG_COLOR} = vec4(a);
+ }
+ ""
+ end
+
+ case use_variable_from_if_in_outer_scope
+ version 100 es
+ expect compile_fail
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ if (true)
+ float a = 1.0;
+ ${POSITION_FRAG_COLOR} = vec4(a);
+ }
+ ""
+ end
+
+ case use_variable_from_else_in_outer_scope
+ version 100 es
+ expect compile_fail
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ if (false)
+ float a = 1.0;
+ else
+ float b = 2.0;
+ ${POSITION_FRAG_COLOR} = vec4(b);
+ }
+ ""
+ end
+
+ case use_variable_from_if_in_else
+ version 100 es
+ expect compile_fail
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ float a = 1.0;
+ if (true)
+ {
+ float b = 2.0;
+ }
+ else
+ {
+ a = b;
+ }
+ ${POSITION_FRAG_COLOR} = vec4(a);
+ }
+ ""
+ end
+
+ case use_variable_from_for_init_statement_in_outer_scope
+ version 100 es
+ expect compile_fail
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ float x = 0.0;
+ for (int i = 0; i < 10; i++)
+ {
+ x += sin(i);
+ }
+ ${POSITION_FRAG_COLOR} = vec4(float(i));
+ }
+ ""
+ end
+
+ case use_variable_from_while_condition_in_outer_scope
+ version 100 es
+ expect compile_fail
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ int a = 1;
+ while (bool b = (a == 1))
+ {
+ a++;
+ }
+ ${POSITION_FRAG_COLOR} = vec4(float(b));
+ }
+ ""
+ end
+
+ case use_parameter_names_from_function_declaration
+ version 100 es
+ expect compile_fail
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func(float a, float b);
+
+ float func(float x, float y) { return a+b; }
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(func(1.0, 2.0));
+ }
+ ""
+ end
+
+ case variable_not_visible_in_own_initializer
+ version 100 es
+ expect compile_fail
+ both ""
+ #version 100
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ float x = x;
+ ${POSITION_FRAG_COLOR} = vec4(x);
+ }
+ ""
+ end
+
+end # invalid
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/shader-lib-test.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/shader-lib-test.html
new file mode 100644
index 0000000000..864ad80465
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/shader-lib-test.html
@@ -0,0 +1,462 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="shader-utils.js"></script>
+<script src="shader-library.js"></script>
+<script src="shader-library-case.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+
+ description("Testing the .test parser components.");
+
+ var wtu = WebGLTestUtils;
+ var successfullyParsed = false;
+ var parser = new shaderLibrary.Parser();
+
+
+ // this array of functions is processed sequentially.
+ // returning false will abort
+ var tests = [
+
+
+ function() {
+ var result = shaderLibrary.isWhitespace(" ");
+ test_result(
+ "Checking isWhitespace. Passing \" \". Expecting true",
+ result === true, result
+ );
+ return true;
+ },
+ function() {
+ var result = shaderLibrary.isWhitespace("q");
+ test_result(
+ "Checking isWhitespace. Passing \"q\". Expecting false",
+ result === false, result
+ );
+ return true;
+ },
+ function() {
+ var result = shaderLibrary.isWhitespace(" \r\n\t");
+ test_result(
+ "Checking isWhitespace. Passing \" \\r\\n\\t\". Expecting true",
+ result === true, result
+ );
+ return true;
+ },
+ function() {
+ var result = shaderLibrary.isWhitespace(" \r\n\tq");
+ test_result(
+ "Checking isWhitespace. Passing \" \\r\\n\\tq\". Expecting false",
+ result === false, result
+ );
+ return true;
+ },
+
+ function() {
+ try {
+ var result = shaderLibrary.removeExtraIndentation(
+ "\t\t\taaaa\n\t \t\tbbbb\n\t\t\tcccc\r\n\t\t\tdddd"
+ );
+ } catch (err) {
+ result = "aborted";
+ }
+
+ test_result(
+ "Checking removeExtraIndentation. \
+ Passing \"\t\t\taaaa\n\t \t\tbbbb\n\t\t\tcccc\r\n\t\t\tdddd\". \
+ Expecting \"aaaa\n\tbbbb\ncccc\ndddd\"",
+ result === "aaaa\n\tbbbb\ncccc\ndddd",
+ result
+ );
+ return true;
+ },
+
+
+ function() {
+ // looking for private access to the parser object
+ var result = (typeof parser.priv != 'undefined');
+ test_result("looking for private member access", result, result);
+ return result;
+ },
+
+ function() {
+ try {
+ var result = parser.priv.parseIntLiteral("42");
+ } catch (err) {
+ result = "aborted";
+ }
+ test_result(
+ "Checking int parser. Passing \"42\". Expecting 42",
+ result === 42, result
+ );
+ return true;
+ },
+ function() {
+ try {
+ var result = parser.priv.parseIntLiteral("-5");
+ } catch (err) {
+ result = "aborted";
+ }
+ test_result(
+ "Checking int parser. Passing \"-5\". Expecting -5",
+ result === -5, result
+ );
+ return true;
+ },
+ function() {
+ try {
+ var result = parser.priv.parseIntLiteral("42.9");
+ } catch (err) {
+ result = "aborted";
+ }
+ test_result(
+ "Checking int parser. Passing \"42.9\". Expecting 42",
+ result === 42, result
+ );
+ return true;
+ },
+ function() {
+ try {
+ var result = parser.priv.parseFloatLiteral("42.9");
+ } catch (err) {
+ result = "aborted";
+ }
+ test_result(
+ "Checking float parser. Passing \"42.9\". Expecting 42.9",
+ result === 42.9, result
+ );
+ return true;
+ },
+
+
+ function() {
+ try {
+ var result = parser.priv.parseStringLiteral("\"hello world\"");
+ } catch (err) {
+ result = "aborted";
+ }
+ test_result(
+ "Checking string parser. Passing \"\"hello world\"\". Expecting \"hello world\"",
+ result == "hello world", result
+ );
+ return true;
+ },
+ function() {
+ try {
+ var result = parser.priv.parseStringLiteral("\"hello world\"extra");
+ } catch (err) {
+ result = "aborted";
+ }
+ test_result(
+ "Checking string parser. Passing \"\"hello world\"extra\". Expecting \"hello world\"",
+ result == "hello world", result
+ );
+ return true;
+ },
+ function() {
+ try {
+ var result = parser.priv.parseStringLiteral("\"\\\"\\\"\\\"\"\\\"\"");
+ } catch (err) {
+ result = "aborted";
+ }
+ test_result(
+ "Checking string parser. Passing \"\"\\\"\\\"\\\"\"\\\"\"\". Expecting \"\"\"\"\"",
+ result == "\"\"\"", result
+ );
+ return true;
+ },
+ function() {
+ try {
+ var result = parser.priv.parseStringLiteral("\"newline test\\nnewline test\"");
+ } catch (err) {
+ result = "aborted";
+ }
+ test_result(
+ "Checking string parser. Passing \"\"newline test\\nnewline test\"\". Expecting \"newline test\nnewline test\"",
+ result == "newline test\nnewline test", result
+ );
+ return true;
+ },
+ function() {
+ try {
+ var result = parser.priv.parseStringLiteral("\"tab test\\ttab test\"");
+ } catch (err) {
+ result = "aborted";
+ }
+ test_result(
+ "Checking string parser. Passing \"\"tab test\\ttab test\"\". Expecting \"tab test\ttab test\"",
+ result == "tab test\ttab test", result
+ );
+ return true;
+ },
+
+ function() {
+ try {
+ var result = parser.priv.parseShaderSource(
+ "\"\"\t\t\taaaa\n\t \t\tbbbb\n\t\t\tcccc\r\n\t\t\tdddd\"\""
+ );
+ } catch (err) {
+ result = "aborted";
+ }
+
+ test_result(
+ "Checking parseShaderSource. \
+ Passing \"\"\"\t\t\taaaa\n\t \t\tbbbb\n\t\t\tcccc\r\n\t\t\tdddd\"\"\". \
+ Expecting \"aaaa\n\tbbbb\ncccc\ndddd\"",
+ result === "aaaa\n\tbbbb\ncccc\ndddd",
+ result
+ );
+ return true;
+ },
+
+ function() {
+ try {
+ var result = parser.priv.advanceTokenTester("bool value = true;", 0);
+ } catch (err) {
+ result = "aborted";
+ }
+ test_result(
+ "Checking advanceToken. Passing \"bool value = true;\", 0",
+ result.idType == parser.priv.Token.TOKEN_BOOL && result.value == "bool",
+ result.name + ": " + result.value
+ );
+ },
+
+ function() {
+ try {
+ var result = parser.priv.advanceTokenTester("bool value = true;", 4);
+ } catch (err) {
+ result = "aborted";
+ }
+ test_result(
+ "Checking advanceToken. Passing \"bool value = true;\", 4",
+ result.idType == parser.priv.Token.TOKEN_IDENTIFIER && result.value == "value",
+ result.name + ": " + result.value
+ );
+ },
+ //*
+ function() {
+ try {
+ var result = parser.priv.advanceTokenTester("bool value = true;", 11);
+ } catch (err) {
+ result = "aborted";
+ }
+ test_result(
+ "Checking advanceToken. Passing \"bool value = true;\", 11",
+ result.idType == parser.priv.Token.TOKEN_ASSIGN,
+ result.name + ": " + result.value
+ );
+ },
+ //*/
+ function() {
+ try {
+ var result = parser.priv.advanceTokenTester("bool value = true;", 12);
+ } catch (err) {
+ result = "aborted";
+ }
+ test_result(
+ "Checking advanceToken. Passing \"bool value = true;\", 12",
+ result.idType == parser.priv.Token.TOKEN_TRUE && result.value == "true",
+ result.name + ": " + result.value
+ );
+ },
+ function() {
+ try {
+ var result = parser.priv.advanceTokenTester("bool value = true;", 17);
+ } catch (err) {
+ result = "aborted";
+ }
+ test_result(
+ "Checking advanceToken. Passing \"bool value = true;\", 17",
+ result.idType == parser.priv.Token.TOKEN_SEMI_COLON && result.value == ";",
+ result.name + ": " + result.value
+ );
+ },
+ function() {
+ try {
+ var result = parser.priv.advanceTokenTester("-7", 0);
+ } catch (err) {
+ result = "aborted";
+ }
+ test_result(
+ "Checking advanceToken. Passing \"-7\", 0",
+ result.idType == parser.priv.Token.TOKEN_MINUS && result.value == "-",
+ result.name + ": " + result.value
+ );
+ },
+ function() {
+ try {
+ var result = parser.priv.advanceTokenTester("-7", 1);
+ } catch (err) {
+ result = "aborted";
+ }
+ test_result(
+ "Checking advanceToken. Passing \"-7\", 1",
+ result.idType == parser.priv.Token.TOKEN_INT_LITERAL && result.value == "7",
+ result.name + ": " + result.value
+ );
+ },
+ function() {
+ try {
+ var result = parser.priv.advanceTokenTester("3.145", 0);
+ } catch (err) {
+ result = "aborted";
+ }
+ test_result(
+ "Checking advanceToken. Passing \"3.145\", 0",
+ result.idType == parser.priv.Token.TOKEN_FLOAT_LITERAL && result.value == "3.145",
+ result.name + ": " + result.value
+ );
+ },
+ function() {
+ try {
+ var result = parser.priv.advanceTokenTester("1.0e+10", 0);
+ } catch (err) {
+ result = "aborted";
+ }
+ test_result(
+ "Checking advanceToken. Passing \"1.0e+10\", 0",
+ result.idType == parser.priv.Token.TOKEN_FLOAT_LITERAL && result.value == "1.0e+10",
+ result.name + ": " + result.value
+ );
+ },
+ function() {
+ try {
+ var result = parser.priv.advanceTokenTester("1.0e", 0);
+ } catch (err) {
+ result = "aborted";
+ }
+ test_result(
+ "Checking advanceToken. Passing \"1.0e\", 0",
+ result === "aborted",
+ result
+ );
+ },
+ function() {
+ try {
+ var result = parser.priv.advanceTokenTester("\"\"shader source\"\";", 0);
+ } catch (err) {
+ result = "aborted";
+ }
+ test_result(
+ "Checking advanceToken. Passing \"\"\"shader source\"\";\", 0",
+ result.idType == parser.priv.Token.TOKEN_SHADER_SOURCE && result.value == "\"\"shader source\"\"",
+ result.name + ": " + result.value
+ );
+ },
+ function() {
+ try {
+ var result = parser.priv.advanceTokenTester("\"string\";", 0);
+ } catch (err) {
+ result = "aborted";
+ }
+ test_result(
+ "Checking advanceToken. Passing \"\"string\";\", 0",
+ result.idType == parser.priv.Token.TOKEN_STRING && result.value == "\"string\"",
+ result.name + ": " + result.value
+ );
+ },
+ function() {
+ try {
+ var result = parser.priv.advanceTokenTester("\'string\';", 0);
+ } catch (err) {
+ result = "aborted";
+ }
+ test_result(
+ "Checking advanceToken. Passing \"\'string\';\", 0",
+ result.idType == parser.priv.Token.TOKEN_STRING && result.value == "\'string\'",
+ result.name + ": " + result.value
+ );
+ },
+ function() {
+ try {
+ var result = parser.priv.advanceTokenTester("\'string\";", 0);
+ } catch (err) {
+ result = "aborted";
+ }
+ test_result(
+ "Checking advanceToken. Passing \"\'string\";\", 0",
+ result === "aborted",
+ result
+ );
+ },
+ function() {
+ try {
+ var result = parser.priv.advanceTokenTester("\'string\\", 0);
+ } catch (err) {
+ result = "aborted";
+ }
+ test_result(
+ "Checking advanceToken. Passing \"\'string\\\", 0",
+ result === "aborted",
+ result
+ );
+ },
+ function() {
+ try {
+ var result = parser.priv.mapDataTypeToken(parser.priv.Token.TOKEN_INT);
+ } catch (err) {
+ var result = "aborted";
+ }
+ test_result(
+ "Checking advanceToken. Passing parser.priv.Token.TOKEN_INT",
+ result === shaderUtils.DataType.TYPE_INT,
+ result
+ );
+ },
+
+ function() {
+ successfullyParsed = true;i
+ return true;
+ },
+
+ ];
+
+ var current = 0;
+
+ function test_result(description, result, additional) {
+ switch (typeof(additional)) {
+ case "undefined":
+ break;
+ case "string":
+ description += ": \"" + additional + "\"";
+ break;
+ default:
+ description += ": " + additional;
+ break;
+ }
+ if (result) {
+ testPassed(description);
+ } else {
+ testFailed(description);
+ }
+ }
+
+ function do_next() {
+ if (tests[current]() !== false && tests.length > ++current) {
+ setTimeout(do_next, 0);
+ } else {
+ on_complete();
+ }
+ }
+
+ function on_complete() {
+ var testPost = document.createElement('script');
+ testPost.src = "../../../../js/js-test-post.js";
+ document.body.appendChild(testPost);
+ }
+
+ do_next();
+
+//
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/split-conversions.js b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/split-conversions.js
new file mode 100644
index 0000000000..2322f0bf23
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/split-conversions.js
@@ -0,0 +1,33 @@
+/*
+
+run with
+ node split-conversions.js
+
+notes:
+
+conversions.test is generated from the C++ based dEQP tests
+https://github.com/KhronosGroup/VK-GL-CTS/blob/main/modules/gles2/scripts/gen-conversions.py
+
+You need to manually add these tests to the 00_test_list.txt
+
+*/
+
+const fs = require('fs');
+
+process.chdir(__dirname);
+
+const testWarning = `\
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+`;
+
+const conversionsHTML = fs.readFileSync('conversions.template', {encoding: 'utf8'});
+const conversions = fs.readFileSync('conversions.test', {encoding: 'utf8'});
+const groupMatches = conversions.matchAll(/group ([a-zA-Z0-9_]+) [\s\S]+?end #.*?\n/g);
+for (const [str, groupName] of groupMatches) {
+ const baseName = `conversions_${groupName}`;
+ fs.writeFileSync(`${baseName}.test`, `${testWarning}${str}`);
+ fs.writeFileSync(`${baseName}.html`, `<!--\n${testWarning}-->\n${conversionsHTML.replace("'conversions'", `'${baseName}'`)}`);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/split-swizzles.js b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/split-swizzles.js
new file mode 100644
index 0000000000..4a67bfc7a4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/split-swizzles.js
@@ -0,0 +1,47 @@
+/*
+
+run with
+ node split-swizzles.js
+
+notes:
+
+swizzles.test is generated from the C++ based dEQP tests
+https://github.com/KhronosGroup/VK-GL-CTS/blob/main/modules/gles2/scripts/gen-swizzles.py
+
+You need to manually add these tests to the 00_test_list.txt
+
+*/
+
+const fs = require('fs');
+
+process.chdir(__dirname);
+
+const testWarning = `\
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+`;
+
+const swizzlesHTML = fs.readFileSync('swizzles.template', {encoding: 'utf8'});
+const swizzles = fs.readFileSync('swizzles.test', {encoding: 'utf8'});
+const caseMatches = swizzles.matchAll(/\scase (\w+)_(\w+)_(\w+)\n[\s\S]+?end\n/g);
+
+// quick sanity check
+const numCases = swizzles.matchAll('\bcase\b').length;
+if (caseMatches.length !== numCases) {
+ throw Error(`numCases(${numCases}) does not match caseMatches.length(${caseMatches.length})`);
+}
+
+const byType = {}
+for (const [str, precision, type, swizzle] of caseMatches) {
+ byType[type] = byType[type] || [];
+ byType[type].push(str);
+}
+
+for (const [type, cases] of Object.entries(byType)) {
+ const baseName = `swizzles_${type}`;
+ const str = `group ${type}_swizzles "${type} swizzles"\n\n${cases.join('\n\n')}\n\nend # ${type}_swizzles`;
+ fs.writeFileSync(`${baseName}.test`, `${testWarning}${str}`);
+ fs.writeFileSync(`${baseName}.html`, `<!--\n${testWarning}-->\n${swizzlesHTML.replace("'swizzles'", `'${baseName}'`)}`);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles.template b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles.template
new file mode 100644
index 0000000000..542ca92d0f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles.template
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'swizzles';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles.test
new file mode 100644
index 0000000000..7e82c3e60d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles.test
@@ -0,0 +1,6811 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+
+group vector_swizzles "Vector Swizzles"
+
+ case mediump_vec2_x
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_xx
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(-0.5, -0.5) | vec2(-32.0, -32.0) | vec2(-0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_xy
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_yx
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.5, 0.0) | vec2(1.25, 1.0) | vec2(-2.25, -0.5) | vec2(64.0, -32.0) | vec2(-0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_yxy
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yxy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_xyxx
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_yyyy
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyyy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_s
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_ss
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(-0.5, -0.5) | vec2(-32.0, -32.0) | vec2(-0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_st
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.st;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_ts
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.5, 0.0) | vec2(1.25, 1.0) | vec2(-2.25, -0.5) | vec2(64.0, -32.0) | vec2(-0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_tst
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tst;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_stss
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_tttt
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tttt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_r
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_rr
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(-0.5, -0.5) | vec2(-32.0, -32.0) | vec2(-0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_rg
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_gr
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.5, 0.0) | vec2(1.25, 1.0) | vec2(-2.25, -0.5) | vec2(64.0, -32.0) | vec2(-0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_grg
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.grg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_rgrr
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_gggg
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gggg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_x
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_z
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output float out0 = [ 0.75 | 1.125 | -4.875 | -51.0 | 0.0526315789474 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.z;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_xz
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec2 out0 = [ vec2(0.0, 0.75) | vec2(1.0, 1.125) | vec2(-0.5, -4.875) | vec2(-32.0, -51.0) | vec2(-0.75, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_zz
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec2 out0 = [ vec2(0.75, 0.75) | vec2(1.125, 1.125) | vec2(-4.875, -4.875) | vec2(-51.0, -51.0) | vec2(0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_xyz
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_zyx
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.5, 0.0) | vec3(1.125, 1.25, 1.0) | vec3(-4.875, -2.25, -0.5) | vec3(-51.0, 64.0, -32.0) | vec3(0.0526315789474, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_xxx
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(-0.5, -0.5, -0.5) | vec3(-32.0, -32.0, -32.0) | vec3(-0.75, -0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_zzz
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.75, 0.75) | vec3(1.125, 1.125, 1.125) | vec3(-4.875, -4.875, -4.875) | vec3(-51.0, -51.0, -51.0) | vec3(0.0526315789474, 0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_zzy
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.75, 0.5) | vec3(1.125, 1.125, 1.25) | vec3(-4.875, -4.875, -2.25) | vec3(-51.0, -51.0, 64.0) | vec3(0.0526315789474, 0.0526315789474, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_yxy
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yxy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_xzx
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.75, 0.0) | vec3(1.0, 1.125, 1.0) | vec3(-0.5, -4.875, -0.5) | vec3(-32.0, -51.0, -32.0) | vec3(-0.75, 0.0526315789474, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xzx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_xyyx
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.5, 0.0) | vec4(1.0, 1.25, 1.25, 1.0) | vec4(-0.5, -2.25, -2.25, -0.5) | vec4(-32.0, 64.0, 64.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_zzzz
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec4 out0 = [ vec4(0.75, 0.75, 0.75, 0.75) | vec4(1.125, 1.125, 1.125, 1.125) | vec4(-4.875, -4.875, -4.875, -4.875) | vec4(-51.0, -51.0, -51.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzzz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_s
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_p
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output float out0 = [ 0.75 | 1.125 | -4.875 | -51.0 | 0.0526315789474 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.p;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_sp
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec2 out0 = [ vec2(0.0, 0.75) | vec2(1.0, 1.125) | vec2(-0.5, -4.875) | vec2(-32.0, -51.0) | vec2(-0.75, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_pp
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec2 out0 = [ vec2(0.75, 0.75) | vec2(1.125, 1.125) | vec2(-4.875, -4.875) | vec2(-51.0, -51.0) | vec2(0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_stp
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_pts
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.5, 0.0) | vec3(1.125, 1.25, 1.0) | vec3(-4.875, -2.25, -0.5) | vec3(-51.0, 64.0, -32.0) | vec3(0.0526315789474, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_sss
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(-0.5, -0.5, -0.5) | vec3(-32.0, -32.0, -32.0) | vec3(-0.75, -0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_ppp
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.75, 0.75) | vec3(1.125, 1.125, 1.125) | vec3(-4.875, -4.875, -4.875) | vec3(-51.0, -51.0, -51.0) | vec3(0.0526315789474, 0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_ppt
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.75, 0.5) | vec3(1.125, 1.125, 1.25) | vec3(-4.875, -4.875, -2.25) | vec3(-51.0, -51.0, 64.0) | vec3(0.0526315789474, 0.0526315789474, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_tst
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tst;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_sps
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.75, 0.0) | vec3(1.0, 1.125, 1.0) | vec3(-0.5, -4.875, -0.5) | vec3(-32.0, -51.0, -32.0) | vec3(-0.75, 0.0526315789474, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sps;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_stts
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.5, 0.0) | vec4(1.0, 1.25, 1.25, 1.0) | vec4(-0.5, -2.25, -2.25, -0.5) | vec4(-32.0, 64.0, 64.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_pppp
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec4 out0 = [ vec4(0.75, 0.75, 0.75, 0.75) | vec4(1.125, 1.125, 1.125, 1.125) | vec4(-4.875, -4.875, -4.875, -4.875) | vec4(-51.0, -51.0, -51.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pppp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_r
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_b
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output float out0 = [ 0.75 | 1.125 | -4.875 | -51.0 | 0.0526315789474 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.b;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_rb
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec2 out0 = [ vec2(0.0, 0.75) | vec2(1.0, 1.125) | vec2(-0.5, -4.875) | vec2(-32.0, -51.0) | vec2(-0.75, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_bb
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec2 out0 = [ vec2(0.75, 0.75) | vec2(1.125, 1.125) | vec2(-4.875, -4.875) | vec2(-51.0, -51.0) | vec2(0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_rgb
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_bgr
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.5, 0.0) | vec3(1.125, 1.25, 1.0) | vec3(-4.875, -2.25, -0.5) | vec3(-51.0, 64.0, -32.0) | vec3(0.0526315789474, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bgr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_rrr
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(-0.5, -0.5, -0.5) | vec3(-32.0, -32.0, -32.0) | vec3(-0.75, -0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_bbb
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.75, 0.75) | vec3(1.125, 1.125, 1.125) | vec3(-4.875, -4.875, -4.875) | vec3(-51.0, -51.0, -51.0) | vec3(0.0526315789474, 0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_bbg
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.75, 0.5) | vec3(1.125, 1.125, 1.25) | vec3(-4.875, -4.875, -2.25) | vec3(-51.0, -51.0, 64.0) | vec3(0.0526315789474, 0.0526315789474, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_grg
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.grg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_rbr
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.75, 0.0) | vec3(1.0, 1.125, 1.0) | vec3(-0.5, -4.875, -0.5) | vec3(-32.0, -51.0, -32.0) | vec3(-0.75, 0.0526315789474, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rbr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_rggr
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.5, 0.0) | vec4(1.0, 1.25, 1.25, 1.0) | vec4(-0.5, -2.25, -2.25, -0.5) | vec4(-32.0, 64.0, 64.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rggr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_bbbb
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec4 out0 = [ vec4(0.75, 0.75, 0.75, 0.75) | vec4(1.125, 1.125, 1.125, 1.125) | vec4(-4.875, -4.875, -4.875, -4.875) | vec4(-51.0, -51.0, -51.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbbb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_x
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_w
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output float out0 = [ 0.825 | 1.75 | 9.0 | 24.0 | 0.25 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.w;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_wx
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec2 out0 = [ vec2(0.825, 0.0) | vec2(1.75, 1.0) | vec2(9.0, -0.5) | vec2(24.0, -32.0) | vec2(0.25, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_wz
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec2 out0 = [ vec2(0.825, 0.75) | vec2(1.75, 1.125) | vec2(9.0, -4.875) | vec2(24.0, -51.0) | vec2(0.25, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_www
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.825, 0.825, 0.825) | vec3(1.75, 1.75, 1.75) | vec3(9.0, 9.0, 9.0) | vec3(24.0, 24.0, 24.0) | vec3(0.25, 0.25, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.www;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_yyw
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.5, 0.5, 0.825) | vec3(1.25, 1.25, 1.75) | vec3(-2.25, -2.25, 9.0) | vec3(64.0, 64.0, 24.0) | vec3(-0.0322580645161, -0.0322580645161, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_wzy
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.825, 0.75, 0.5) | vec3(1.75, 1.125, 1.25) | vec3(9.0, -4.875, -2.25) | vec3(24.0, -51.0, 64.0) | vec3(0.25, 0.0526315789474, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_xyzw
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyzw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_wzyx
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.75, 0.5, 0.0) | vec4(1.75, 1.125, 1.25, 1.0) | vec4(9.0, -4.875, -2.25, -0.5) | vec4(24.0, -51.0, 64.0, -32.0) | vec4(0.25, 0.0526315789474, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_xxxx
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(-0.5, -0.5, -0.5, -0.5) | vec4(-32.0, -32.0, -32.0, -32.0) | vec4(-0.75, -0.75, -0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xxxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_yyyy
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyyy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_wwww
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.825) | vec4(1.75, 1.75, 1.75, 1.75) | vec4(9.0, 9.0, 9.0, 9.0) | vec4(24.0, 24.0, 24.0, 24.0) | vec4(0.25, 0.25, 0.25, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wwww;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_wzzw
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.75, 0.75, 0.825) | vec4(1.75, 1.125, 1.125, 1.75) | vec4(9.0, -4.875, -4.875, 9.0) | vec4(24.0, -51.0, -51.0, 24.0) | vec4(0.25, 0.0526315789474, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzzw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_wwwy
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.5) | vec4(1.75, 1.75, 1.75, 1.25) | vec4(9.0, 9.0, 9.0, -2.25) | vec4(24.0, 24.0, 24.0, 64.0) | vec4(0.25, 0.25, 0.25, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wwwy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_xyxx
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_zzwz
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.75, 0.75, 0.825, 0.75) | vec4(1.125, 1.125, 1.75, 1.125) | vec4(-4.875, -4.875, 9.0, -4.875) | vec4(-51.0, -51.0, 24.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.25, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzwz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_s
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_q
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output float out0 = [ 0.825 | 1.75 | 9.0 | 24.0 | 0.25 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.q;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_qs
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec2 out0 = [ vec2(0.825, 0.0) | vec2(1.75, 1.0) | vec2(9.0, -0.5) | vec2(24.0, -32.0) | vec2(0.25, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qs;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_qp
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec2 out0 = [ vec2(0.825, 0.75) | vec2(1.75, 1.125) | vec2(9.0, -4.875) | vec2(24.0, -51.0) | vec2(0.25, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_qqq
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.825, 0.825, 0.825) | vec3(1.75, 1.75, 1.75) | vec3(9.0, 9.0, 9.0) | vec3(24.0, 24.0, 24.0) | vec3(0.25, 0.25, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_ttq
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.5, 0.5, 0.825) | vec3(1.25, 1.25, 1.75) | vec3(-2.25, -2.25, 9.0) | vec3(64.0, 64.0, 24.0) | vec3(-0.0322580645161, -0.0322580645161, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ttq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_qpt
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.825, 0.75, 0.5) | vec3(1.75, 1.125, 1.25) | vec3(9.0, -4.875, -2.25) | vec3(24.0, -51.0, 64.0) | vec3(0.25, 0.0526315789474, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qpt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_stpq
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stpq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_qpts
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.75, 0.5, 0.0) | vec4(1.75, 1.125, 1.25, 1.0) | vec4(9.0, -4.875, -2.25, -0.5) | vec4(24.0, -51.0, 64.0, -32.0) | vec4(0.25, 0.0526315789474, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qpts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_ssss
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(-0.5, -0.5, -0.5, -0.5) | vec4(-32.0, -32.0, -32.0, -32.0) | vec4(-0.75, -0.75, -0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ssss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_tttt
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tttt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_qqqq
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.825) | vec4(1.75, 1.75, 1.75, 1.75) | vec4(9.0, 9.0, 9.0, 9.0) | vec4(24.0, 24.0, 24.0, 24.0) | vec4(0.25, 0.25, 0.25, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqqq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_qppq
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.75, 0.75, 0.825) | vec4(1.75, 1.125, 1.125, 1.75) | vec4(9.0, -4.875, -4.875, 9.0) | vec4(24.0, -51.0, -51.0, 24.0) | vec4(0.25, 0.0526315789474, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qppq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_qqqt
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.5) | vec4(1.75, 1.75, 1.75, 1.25) | vec4(9.0, 9.0, 9.0, -2.25) | vec4(24.0, 24.0, 24.0, 64.0) | vec4(0.25, 0.25, 0.25, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqqt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_stss
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_ppqp
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.75, 0.75, 0.825, 0.75) | vec4(1.125, 1.125, 1.75, 1.125) | vec4(-4.875, -4.875, 9.0, -4.875) | vec4(-51.0, -51.0, 24.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.25, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppqp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_r
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_a
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output float out0 = [ 0.825 | 1.75 | 9.0 | 24.0 | 0.25 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_ar
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec2 out0 = [ vec2(0.825, 0.0) | vec2(1.75, 1.0) | vec2(9.0, -0.5) | vec2(24.0, -32.0) | vec2(0.25, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ar;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_ab
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec2 out0 = [ vec2(0.825, 0.75) | vec2(1.75, 1.125) | vec2(9.0, -4.875) | vec2(24.0, -51.0) | vec2(0.25, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ab;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_aaa
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.825, 0.825, 0.825) | vec3(1.75, 1.75, 1.75) | vec3(9.0, 9.0, 9.0) | vec3(24.0, 24.0, 24.0) | vec3(0.25, 0.25, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaa;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_gga
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.5, 0.5, 0.825) | vec3(1.25, 1.25, 1.75) | vec3(-2.25, -2.25, 9.0) | vec3(64.0, 64.0, 24.0) | vec3(-0.0322580645161, -0.0322580645161, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gga;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_abg
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.825, 0.75, 0.5) | vec3(1.75, 1.125, 1.25) | vec3(9.0, -4.875, -2.25) | vec3(24.0, -51.0, 64.0) | vec3(0.25, 0.0526315789474, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_rgba
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgba;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_abgr
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.75, 0.5, 0.0) | vec4(1.75, 1.125, 1.25, 1.0) | vec4(9.0, -4.875, -2.25, -0.5) | vec4(24.0, -51.0, 64.0, -32.0) | vec4(0.25, 0.0526315789474, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abgr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_rrrr
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(-0.5, -0.5, -0.5, -0.5) | vec4(-32.0, -32.0, -32.0, -32.0) | vec4(-0.75, -0.75, -0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rrrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_gggg
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gggg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_aaaa
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.825) | vec4(1.75, 1.75, 1.75, 1.75) | vec4(9.0, 9.0, 9.0, 9.0) | vec4(24.0, 24.0, 24.0, 24.0) | vec4(0.25, 0.25, 0.25, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaaa;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_abba
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.75, 0.75, 0.825) | vec4(1.75, 1.125, 1.125, 1.75) | vec4(9.0, -4.875, -4.875, 9.0) | vec4(24.0, -51.0, -51.0, 24.0) | vec4(0.25, 0.0526315789474, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abba;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_aaag
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.5) | vec4(1.75, 1.75, 1.75, 1.25) | vec4(9.0, 9.0, 9.0, -2.25) | vec4(24.0, 24.0, 24.0, 64.0) | vec4(0.25, 0.25, 0.25, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaag;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_rgrr
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_bbab
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.75, 0.75, 0.825, 0.75) | vec4(1.125, 1.125, 1.75, 1.125) | vec4(-4.875, -4.875, 9.0, -4.875) | vec4(-51.0, -51.0, 24.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.25, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbab;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_x
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_xx
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_xy
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_yx
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-2, 0) | ivec2(64, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_yxy
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yxy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_xyxx
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_yyyy
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyyy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_s
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_ss
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_st
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.st;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_ts
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-2, 0) | ivec2(64, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_tst
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tst;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_stss
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_tttt
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tttt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_r
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_rr
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_rg
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_gr
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-2, 0) | ivec2(64, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_grg
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.grg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_rgrr
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_gggg
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gggg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_x
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_z
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | -4 | -51 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.z;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_xz
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -4) | ivec2(-32, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_zz
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-4, -4) | ivec2(-51, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_xyz
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_zyx
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -2, 0) | ivec3(-51, 64, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_xxx
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, -32, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_zzz
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -4) | ivec3(-51, -51, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_zzy
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -2) | ivec3(-51, -51, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_yxy
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yxy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_xzx
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -4, 0) | ivec3(-32, -51, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xzx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_xyyx
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -2, 0) | ivec4(-32, 64, 64, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_zzzz
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, -4, -4) | ivec4(-51, -51, -51, -51) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzzz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_s
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_p
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | -4 | -51 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.p;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_sp
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -4) | ivec2(-32, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_pp
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-4, -4) | ivec2(-51, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_stp
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_pts
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -2, 0) | ivec3(-51, 64, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_sss
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, -32, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_ppp
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -4) | ivec3(-51, -51, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_ppt
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -2) | ivec3(-51, -51, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_tst
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tst;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_sps
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -4, 0) | ivec3(-32, -51, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sps;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_stts
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -2, 0) | ivec4(-32, 64, 64, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_pppp
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, -4, -4) | ivec4(-51, -51, -51, -51) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pppp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_r
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_b
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | -4 | -51 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.b;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_rb
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -4) | ivec2(-32, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_bb
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-4, -4) | ivec2(-51, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_rgb
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_bgr
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -2, 0) | ivec3(-51, 64, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bgr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_rrr
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, -32, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_bbb
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -4) | ivec3(-51, -51, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_bbg
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -2) | ivec3(-51, -51, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_grg
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.grg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_rbr
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -4, 0) | ivec3(-32, -51, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rbr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_rggr
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -2, 0) | ivec4(-32, 64, 64, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rggr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_bbbb
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, -4, -4) | ivec4(-51, -51, -51, -51) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbbb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_x
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_w
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 9 | 24 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.w;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_wx
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, 0) | ivec2(24, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_wz
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, -4) | ivec2(24, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_www
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, 9, 9) | ivec3(24, 24, 24) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.www;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_yyw
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, -2, 9) | ivec3(64, 64, 24) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_wzy
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, -4, -2) | ivec3(24, -51, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_xyzw
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyzw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_wzyx
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -2, 0) | ivec4(24, -51, 64, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_xxxx
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, -32, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xxxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_yyyy
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyyy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_wwww
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, 9) | ivec4(24, 24, 24, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wwww;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_wzzw
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -4, 9) | ivec4(24, -51, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzzw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_wwwy
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, -2) | ivec4(24, 24, 24, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wwwy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_xyxx
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_zzwz
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, 9, -4) | ivec4(-51, -51, 24, -51) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzwz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_s
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_q
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 9 | 24 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.q;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_qs
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, 0) | ivec2(24, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qs;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_qp
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, -4) | ivec2(24, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_qqq
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, 9, 9) | ivec3(24, 24, 24) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_ttq
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, -2, 9) | ivec3(64, 64, 24) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ttq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_qpt
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, -4, -2) | ivec3(24, -51, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qpt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_stpq
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stpq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_qpts
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -2, 0) | ivec4(24, -51, 64, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qpts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_ssss
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, -32, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ssss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_tttt
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tttt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_qqqq
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, 9) | ivec4(24, 24, 24, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqqq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_qppq
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -4, 9) | ivec4(24, -51, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qppq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_qqqt
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, -2) | ivec4(24, 24, 24, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqqt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_stss
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_ppqp
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, 9, -4) | ivec4(-51, -51, 24, -51) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppqp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_r
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_a
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 9 | 24 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_ar
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, 0) | ivec2(24, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ar;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_ab
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, -4) | ivec2(24, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ab;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_aaa
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, 9, 9) | ivec3(24, 24, 24) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaa;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_gga
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, -2, 9) | ivec3(64, 64, 24) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gga;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_abg
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, -4, -2) | ivec3(24, -51, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_rgba
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgba;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_abgr
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -2, 0) | ivec4(24, -51, 64, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abgr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_rrrr
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, -32, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rrrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_gggg
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gggg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_aaaa
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, 9) | ivec4(24, 24, 24, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaaa;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_abba
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -4, 9) | ivec4(24, -51, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abba;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_aaag
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, -2) | ivec4(24, 24, 24, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaag;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_rgrr
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_bbab
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, 9, -4) | ivec4(-51, -51, 24, -51) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbab;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_x
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_xx
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_xy
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_yx
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_yxy
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yxy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_xyxx
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_yyyy
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyyy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_s
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_ss
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_st
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.st;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_ts
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_tst
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tst;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_stss
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_tttt
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tttt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_r
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_rr
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_rg
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_gr
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_grg
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.grg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_rgrr
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_gggg
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gggg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_x
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_z
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bool out0 = [ false | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.z;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_xz
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_zz
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_xyz
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_zyx
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_xxx
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_zzz
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_zzy
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_yxy
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yxy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_xzx
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xzx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_xyyx
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_zzzz
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzzz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_s
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_p
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bool out0 = [ false | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.p;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_sp
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_pp
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_stp
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_pts
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_sss
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_ppp
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_ppt
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_tst
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tst;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_sps
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sps;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_stts
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_pppp
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pppp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_r
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_b
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bool out0 = [ false | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.b;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_rb
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_bb
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_rgb
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_bgr
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bgr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_rrr
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_bbb
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_bbg
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_grg
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.grg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_rbr
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rbr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_rggr
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rggr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_bbbb
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbbb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_x
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_w
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bool out0 = [ true | true | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.w;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_wx
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_wz
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_www
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.www;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_yyw
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, true) | bvec3(true, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_wzy
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(true, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_xyzw
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyzw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_wzyx
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, false) | bvec4(false, false, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_xxxx
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xxxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_yyyy
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyyy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_wwww
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wwww;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_wzzw
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzzw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_wwwy
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, false) | bvec4(true, true, true, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wwwy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_xyxx
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_zzwz
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(false, false, true, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzwz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_s
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_q
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bool out0 = [ true | true | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.q;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_qs
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qs;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_qp
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_qqq
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_ttq
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, true) | bvec3(true, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ttq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_qpt
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(true, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qpt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_stpq
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stpq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_qpts
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, false) | bvec4(false, false, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qpts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_ssss
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ssss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_tttt
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tttt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_qqqq
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqqq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_qppq
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qppq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_qqqt
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, false) | bvec4(true, true, true, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqqt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_stss
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_ppqp
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(false, false, true, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppqp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_r
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_a
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bool out0 = [ true | true | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_ar
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ar;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_ab
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ab;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_aaa
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaa;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_gga
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, true) | bvec3(true, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gga;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_abg
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(true, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_rgba
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgba;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_abgr
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, false) | bvec4(false, false, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abgr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_rrrr
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rrrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_gggg
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gggg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_aaaa
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaaa;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_abba
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abba;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_aaag
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, false) | bvec4(true, true, true, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaag;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_rgrr
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_bbab
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(false, false, true, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbab;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # vector_swizzles
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_bvec2.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_bvec2.html
new file mode 100644
index 0000000000..7a98a4562c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_bvec2.html
@@ -0,0 +1,42 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'swizzles_bvec2';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_bvec2.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_bvec2.test
new file mode 100644
index 0000000000..1f74f6228a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_bvec2.test
@@ -0,0 +1,469 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+group bvec2_swizzles "bvec2 swizzles"
+
+ case mediump_bvec2_x
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_xx
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_xy
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_yx
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_yxy
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yxy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_xyxx
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_yyyy
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyyy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_s
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_ss
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_st
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.st;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_ts
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_tst
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tst;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_stss
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_tttt
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tttt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_r
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_rr
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_rg
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_gr
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_grg
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.grg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_rgrr
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_gggg
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gggg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # bvec2_swizzles \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_bvec3.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_bvec3.html
new file mode 100644
index 0000000000..ae73ac5f54
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_bvec3.html
@@ -0,0 +1,42 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'swizzles_bvec3';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_bvec3.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_bvec3.test
new file mode 100644
index 0000000000..7e14baabee
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_bvec3.test
@@ -0,0 +1,865 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+group bvec3_swizzles "bvec3 swizzles"
+
+ case mediump_bvec3_x
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_z
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bool out0 = [ false | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.z;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_xz
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_zz
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_xyz
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_zyx
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_xxx
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_zzz
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_zzy
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_yxy
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yxy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_xzx
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xzx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_xyyx
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_zzzz
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzzz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_s
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_p
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bool out0 = [ false | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.p;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_sp
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_pp
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_stp
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_pts
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_sss
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_ppp
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_ppt
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_tst
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tst;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_sps
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sps;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_stts
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_pppp
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pppp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_r
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_b
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bool out0 = [ false | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.b;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_rb
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_bb
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_rgb
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_bgr
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bgr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_rrr
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_bbb
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_bbg
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_grg
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.grg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_rbr
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rbr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_rggr
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rggr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_bbbb
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbbb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # bvec3_swizzles \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_bvec4.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_bvec4.html
new file mode 100644
index 0000000000..9a9c6e6552
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_bvec4.html
@@ -0,0 +1,42 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'swizzles_bvec4';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_bvec4.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_bvec4.test
new file mode 100644
index 0000000000..b5cfcabb0d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_bvec4.test
@@ -0,0 +1,1063 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+group bvec4_swizzles "bvec4 swizzles"
+
+ case mediump_bvec4_x
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_w
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bool out0 = [ true | true | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.w;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_wx
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_wz
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_www
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.www;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_yyw
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, true) | bvec3(true, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_wzy
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(true, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_xyzw
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyzw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_wzyx
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, false) | bvec4(false, false, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_xxxx
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xxxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_yyyy
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyyy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_wwww
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wwww;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_wzzw
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzzw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_wwwy
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, false) | bvec4(true, true, true, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wwwy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_xyxx
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_zzwz
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(false, false, true, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzwz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_s
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_q
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bool out0 = [ true | true | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.q;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_qs
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qs;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_qp
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_qqq
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_ttq
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, true) | bvec3(true, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ttq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_qpt
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(true, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qpt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_stpq
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stpq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_qpts
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, false) | bvec4(false, false, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qpts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_ssss
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ssss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_tttt
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tttt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_qqqq
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqqq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_qppq
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qppq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_qqqt
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, false) | bvec4(true, true, true, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqqt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_stss
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_ppqp
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(false, false, true, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppqp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_r
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_a
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bool out0 = [ true | true | false | true | false ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_ar
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ar;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_ab
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ab;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_aaa
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaa;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_gga
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, true) | bvec3(true, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gga;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_abg
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(true, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_rgba
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgba;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_abgr
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, false) | bvec4(false, false, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abgr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_rrrr
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rrrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_gggg
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gggg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_aaaa
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaaa;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_abba
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abba;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_aaag
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, false) | bvec4(true, true, true, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaag;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_rgrr
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_bbab
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(false, false, true, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbab;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # bvec4_swizzles \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_ivec2.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_ivec2.html
new file mode 100644
index 0000000000..f48565709f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_ivec2.html
@@ -0,0 +1,42 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'swizzles_ivec2';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_ivec2.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_ivec2.test
new file mode 100644
index 0000000000..6b4ca23c4b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_ivec2.test
@@ -0,0 +1,469 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+group ivec2_swizzles "ivec2 swizzles"
+
+ case mediump_ivec2_x
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_xx
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_xy
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_yx
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-2, 0) | ivec2(64, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_yxy
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yxy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_xyxx
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_yyyy
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyyy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_s
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_ss
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_st
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.st;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_ts
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-2, 0) | ivec2(64, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_tst
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tst;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_stss
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_tttt
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tttt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_r
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_rr
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_rg
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_gr
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-2, 0) | ivec2(64, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_grg
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.grg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_rgrr
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_gggg
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gggg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # ivec2_swizzles \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_ivec3.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_ivec3.html
new file mode 100644
index 0000000000..a23797c0a2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_ivec3.html
@@ -0,0 +1,42 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'swizzles_ivec3';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_ivec3.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_ivec3.test
new file mode 100644
index 0000000000..11a06227fb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_ivec3.test
@@ -0,0 +1,865 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+group ivec3_swizzles "ivec3 swizzles"
+
+ case mediump_ivec3_x
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_z
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | -4 | -51 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.z;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_xz
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -4) | ivec2(-32, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_zz
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-4, -4) | ivec2(-51, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_xyz
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_zyx
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -2, 0) | ivec3(-51, 64, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_xxx
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, -32, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_zzz
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -4) | ivec3(-51, -51, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_zzy
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -2) | ivec3(-51, -51, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_yxy
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yxy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_xzx
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -4, 0) | ivec3(-32, -51, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xzx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_xyyx
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -2, 0) | ivec4(-32, 64, 64, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_zzzz
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, -4, -4) | ivec4(-51, -51, -51, -51) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzzz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_s
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_p
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | -4 | -51 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.p;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_sp
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -4) | ivec2(-32, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_pp
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-4, -4) | ivec2(-51, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_stp
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_pts
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -2, 0) | ivec3(-51, 64, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_sss
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, -32, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_ppp
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -4) | ivec3(-51, -51, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_ppt
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -2) | ivec3(-51, -51, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_tst
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tst;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_sps
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -4, 0) | ivec3(-32, -51, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sps;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_stts
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -2, 0) | ivec4(-32, 64, 64, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_pppp
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, -4, -4) | ivec4(-51, -51, -51, -51) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pppp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_r
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_b
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | -4 | -51 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.b;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_rb
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -4) | ivec2(-32, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_bb
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-4, -4) | ivec2(-51, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_rgb
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_bgr
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -2, 0) | ivec3(-51, 64, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bgr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_rrr
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, -32, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_bbb
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -4) | ivec3(-51, -51, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_bbg
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -2) | ivec3(-51, -51, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_grg
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.grg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_rbr
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -4, 0) | ivec3(-32, -51, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rbr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_rggr
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -2, 0) | ivec4(-32, 64, 64, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rggr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_bbbb
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, -4, -4) | ivec4(-51, -51, -51, -51) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbbb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # ivec3_swizzles \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_ivec4.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_ivec4.html
new file mode 100644
index 0000000000..2b155d1f7a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_ivec4.html
@@ -0,0 +1,42 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'swizzles_ivec4';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_ivec4.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_ivec4.test
new file mode 100644
index 0000000000..f9fe122449
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_ivec4.test
@@ -0,0 +1,1063 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+group ivec4_swizzles "ivec4 swizzles"
+
+ case mediump_ivec4_x
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_w
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 9 | 24 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.w;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_wx
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, 0) | ivec2(24, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_wz
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, -4) | ivec2(24, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_www
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, 9, 9) | ivec3(24, 24, 24) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.www;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_yyw
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, -2, 9) | ivec3(64, 64, 24) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_wzy
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, -4, -2) | ivec3(24, -51, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_xyzw
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyzw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_wzyx
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -2, 0) | ivec4(24, -51, 64, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_xxxx
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, -32, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xxxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_yyyy
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyyy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_wwww
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, 9) | ivec4(24, 24, 24, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wwww;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_wzzw
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -4, 9) | ivec4(24, -51, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzzw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_wwwy
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, -2) | ivec4(24, 24, 24, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wwwy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_xyxx
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_zzwz
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, 9, -4) | ivec4(-51, -51, 24, -51) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzwz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_s
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_q
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 9 | 24 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.q;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_qs
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, 0) | ivec2(24, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qs;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_qp
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, -4) | ivec2(24, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_qqq
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, 9, 9) | ivec3(24, 24, 24) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_ttq
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, -2, 9) | ivec3(64, 64, 24) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ttq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_qpt
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, -4, -2) | ivec3(24, -51, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qpt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_stpq
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stpq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_qpts
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -2, 0) | ivec4(24, -51, 64, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qpts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_ssss
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, -32, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ssss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_tttt
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tttt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_qqqq
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, 9) | ivec4(24, 24, 24, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqqq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_qppq
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -4, 9) | ivec4(24, -51, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qppq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_qqqt
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, -2) | ivec4(24, 24, 24, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqqt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_stss
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_ppqp
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, 9, -4) | ivec4(-51, -51, 24, -51) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppqp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_r
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_a
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 9 | 24 | 0 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_ar
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, 0) | ivec2(24, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ar;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_ab
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, -4) | ivec2(24, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ab;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_aaa
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, 9, 9) | ivec3(24, 24, 24) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaa;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_gga
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, -2, 9) | ivec3(64, 64, 24) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gga;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_abg
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, -4, -2) | ivec3(24, -51, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_rgba
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgba;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_abgr
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -2, 0) | ivec4(24, -51, 64, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abgr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_rrrr
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, -32, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rrrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_gggg
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gggg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_aaaa
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, 9) | ivec4(24, 24, 24, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaaa;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_abba
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -4, 9) | ivec4(24, -51, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abba;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_aaag
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, -2) | ivec4(24, 24, 24, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaag;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_rgrr
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_bbab
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, 9, -4) | ivec4(-51, -51, 24, -51) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbab;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # ivec4_swizzles \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_vec2.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_vec2.html
new file mode 100644
index 0000000000..bd16703c52
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_vec2.html
@@ -0,0 +1,42 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'swizzles_vec2';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_vec2.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_vec2.test
new file mode 100644
index 0000000000..6a0eb1ddb7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_vec2.test
@@ -0,0 +1,469 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+group vec2_swizzles "vec2 swizzles"
+
+ case mediump_vec2_x
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_xx
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(-0.5, -0.5) | vec2(-32.0, -32.0) | vec2(-0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_xy
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_yx
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.5, 0.0) | vec2(1.25, 1.0) | vec2(-2.25, -0.5) | vec2(64.0, -32.0) | vec2(-0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_yxy
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yxy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_xyxx
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_yyyy
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyyy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_s
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_ss
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(-0.5, -0.5) | vec2(-32.0, -32.0) | vec2(-0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_st
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.st;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_ts
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.5, 0.0) | vec2(1.25, 1.0) | vec2(-2.25, -0.5) | vec2(64.0, -32.0) | vec2(-0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_tst
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tst;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_stss
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_tttt
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tttt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_r
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_rr
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(-0.5, -0.5) | vec2(-32.0, -32.0) | vec2(-0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_rg
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_gr
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.5, 0.0) | vec2(1.25, 1.0) | vec2(-2.25, -0.5) | vec2(64.0, -32.0) | vec2(-0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_grg
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.grg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_rgrr
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_gggg
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gggg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # vec2_swizzles \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_vec3.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_vec3.html
new file mode 100644
index 0000000000..4caa0fc2a0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_vec3.html
@@ -0,0 +1,42 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'swizzles_vec3';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_vec3.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_vec3.test
new file mode 100644
index 0000000000..f099dcfd2d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_vec3.test
@@ -0,0 +1,865 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+group vec3_swizzles "vec3 swizzles"
+
+ case mediump_vec3_x
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_z
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output float out0 = [ 0.75 | 1.125 | -4.875 | -51.0 | 0.0526315789474 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.z;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_xz
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec2 out0 = [ vec2(0.0, 0.75) | vec2(1.0, 1.125) | vec2(-0.5, -4.875) | vec2(-32.0, -51.0) | vec2(-0.75, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_zz
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec2 out0 = [ vec2(0.75, 0.75) | vec2(1.125, 1.125) | vec2(-4.875, -4.875) | vec2(-51.0, -51.0) | vec2(0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_xyz
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_zyx
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.5, 0.0) | vec3(1.125, 1.25, 1.0) | vec3(-4.875, -2.25, -0.5) | vec3(-51.0, 64.0, -32.0) | vec3(0.0526315789474, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_xxx
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(-0.5, -0.5, -0.5) | vec3(-32.0, -32.0, -32.0) | vec3(-0.75, -0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_zzz
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.75, 0.75) | vec3(1.125, 1.125, 1.125) | vec3(-4.875, -4.875, -4.875) | vec3(-51.0, -51.0, -51.0) | vec3(0.0526315789474, 0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_zzy
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.75, 0.5) | vec3(1.125, 1.125, 1.25) | vec3(-4.875, -4.875, -2.25) | vec3(-51.0, -51.0, 64.0) | vec3(0.0526315789474, 0.0526315789474, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_yxy
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yxy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_xzx
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.75, 0.0) | vec3(1.0, 1.125, 1.0) | vec3(-0.5, -4.875, -0.5) | vec3(-32.0, -51.0, -32.0) | vec3(-0.75, 0.0526315789474, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xzx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_xyyx
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.5, 0.0) | vec4(1.0, 1.25, 1.25, 1.0) | vec4(-0.5, -2.25, -2.25, -0.5) | vec4(-32.0, 64.0, 64.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_zzzz
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec4 out0 = [ vec4(0.75, 0.75, 0.75, 0.75) | vec4(1.125, 1.125, 1.125, 1.125) | vec4(-4.875, -4.875, -4.875, -4.875) | vec4(-51.0, -51.0, -51.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzzz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_s
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_p
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output float out0 = [ 0.75 | 1.125 | -4.875 | -51.0 | 0.0526315789474 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.p;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_sp
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec2 out0 = [ vec2(0.0, 0.75) | vec2(1.0, 1.125) | vec2(-0.5, -4.875) | vec2(-32.0, -51.0) | vec2(-0.75, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_pp
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec2 out0 = [ vec2(0.75, 0.75) | vec2(1.125, 1.125) | vec2(-4.875, -4.875) | vec2(-51.0, -51.0) | vec2(0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_stp
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_pts
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.5, 0.0) | vec3(1.125, 1.25, 1.0) | vec3(-4.875, -2.25, -0.5) | vec3(-51.0, 64.0, -32.0) | vec3(0.0526315789474, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_sss
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(-0.5, -0.5, -0.5) | vec3(-32.0, -32.0, -32.0) | vec3(-0.75, -0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_ppp
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.75, 0.75) | vec3(1.125, 1.125, 1.125) | vec3(-4.875, -4.875, -4.875) | vec3(-51.0, -51.0, -51.0) | vec3(0.0526315789474, 0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_ppt
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.75, 0.5) | vec3(1.125, 1.125, 1.25) | vec3(-4.875, -4.875, -2.25) | vec3(-51.0, -51.0, 64.0) | vec3(0.0526315789474, 0.0526315789474, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_tst
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tst;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_sps
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.75, 0.0) | vec3(1.0, 1.125, 1.0) | vec3(-0.5, -4.875, -0.5) | vec3(-32.0, -51.0, -32.0) | vec3(-0.75, 0.0526315789474, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sps;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_stts
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.5, 0.0) | vec4(1.0, 1.25, 1.25, 1.0) | vec4(-0.5, -2.25, -2.25, -0.5) | vec4(-32.0, 64.0, 64.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_pppp
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec4 out0 = [ vec4(0.75, 0.75, 0.75, 0.75) | vec4(1.125, 1.125, 1.125, 1.125) | vec4(-4.875, -4.875, -4.875, -4.875) | vec4(-51.0, -51.0, -51.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pppp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_r
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_b
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output float out0 = [ 0.75 | 1.125 | -4.875 | -51.0 | 0.0526315789474 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.b;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_rb
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec2 out0 = [ vec2(0.0, 0.75) | vec2(1.0, 1.125) | vec2(-0.5, -4.875) | vec2(-32.0, -51.0) | vec2(-0.75, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_bb
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec2 out0 = [ vec2(0.75, 0.75) | vec2(1.125, 1.125) | vec2(-4.875, -4.875) | vec2(-51.0, -51.0) | vec2(0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_rgb
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_bgr
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.5, 0.0) | vec3(1.125, 1.25, 1.0) | vec3(-4.875, -2.25, -0.5) | vec3(-51.0, 64.0, -32.0) | vec3(0.0526315789474, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bgr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_rrr
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(-0.5, -0.5, -0.5) | vec3(-32.0, -32.0, -32.0) | vec3(-0.75, -0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_bbb
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.75, 0.75) | vec3(1.125, 1.125, 1.125) | vec3(-4.875, -4.875, -4.875) | vec3(-51.0, -51.0, -51.0) | vec3(0.0526315789474, 0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_bbg
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.75, 0.5) | vec3(1.125, 1.125, 1.25) | vec3(-4.875, -4.875, -2.25) | vec3(-51.0, -51.0, 64.0) | vec3(0.0526315789474, 0.0526315789474, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_grg
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.grg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_rbr
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.75, 0.0) | vec3(1.0, 1.125, 1.0) | vec3(-0.5, -4.875, -0.5) | vec3(-32.0, -51.0, -32.0) | vec3(-0.75, 0.0526315789474, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rbr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_rggr
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.5, 0.0) | vec4(1.0, 1.25, 1.25, 1.0) | vec4(-0.5, -2.25, -2.25, -0.5) | vec4(-32.0, 64.0, 64.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rggr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_bbbb
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec4 out0 = [ vec4(0.75, 0.75, 0.75, 0.75) | vec4(1.125, 1.125, 1.125, 1.125) | vec4(-4.875, -4.875, -4.875, -4.875) | vec4(-51.0, -51.0, -51.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbbb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # vec3_swizzles \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_vec4.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_vec4.html
new file mode 100644
index 0000000000..be64d18af1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_vec4.html
@@ -0,0 +1,42 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'swizzles_vec4';
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_vec4.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_vec4.test
new file mode 100644
index 0000000000..3fba360a42
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/swizzles_vec4.test
@@ -0,0 +1,1063 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+group vec4_swizzles "vec4 swizzles"
+
+ case mediump_vec4_x
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_w
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output float out0 = [ 0.825 | 1.75 | 9.0 | 24.0 | 0.25 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.w;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_wx
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec2 out0 = [ vec2(0.825, 0.0) | vec2(1.75, 1.0) | vec2(9.0, -0.5) | vec2(24.0, -32.0) | vec2(0.25, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_wz
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec2 out0 = [ vec2(0.825, 0.75) | vec2(1.75, 1.125) | vec2(9.0, -4.875) | vec2(24.0, -51.0) | vec2(0.25, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_www
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.825, 0.825, 0.825) | vec3(1.75, 1.75, 1.75) | vec3(9.0, 9.0, 9.0) | vec3(24.0, 24.0, 24.0) | vec3(0.25, 0.25, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.www;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_yyw
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.5, 0.5, 0.825) | vec3(1.25, 1.25, 1.75) | vec3(-2.25, -2.25, 9.0) | vec3(64.0, 64.0, 24.0) | vec3(-0.0322580645161, -0.0322580645161, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_wzy
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.825, 0.75, 0.5) | vec3(1.75, 1.125, 1.25) | vec3(9.0, -4.875, -2.25) | vec3(24.0, -51.0, 64.0) | vec3(0.25, 0.0526315789474, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_xyzw
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyzw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_wzyx
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.75, 0.5, 0.0) | vec4(1.75, 1.125, 1.25, 1.0) | vec4(9.0, -4.875, -2.25, -0.5) | vec4(24.0, -51.0, 64.0, -32.0) | vec4(0.25, 0.0526315789474, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_xxxx
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(-0.5, -0.5, -0.5, -0.5) | vec4(-32.0, -32.0, -32.0, -32.0) | vec4(-0.75, -0.75, -0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xxxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_yyyy
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyyy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_wwww
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.825) | vec4(1.75, 1.75, 1.75, 1.75) | vec4(9.0, 9.0, 9.0, 9.0) | vec4(24.0, 24.0, 24.0, 24.0) | vec4(0.25, 0.25, 0.25, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wwww;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_wzzw
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.75, 0.75, 0.825) | vec4(1.75, 1.125, 1.125, 1.75) | vec4(9.0, -4.875, -4.875, 9.0) | vec4(24.0, -51.0, -51.0, 24.0) | vec4(0.25, 0.0526315789474, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzzw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_wwwy
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.5) | vec4(1.75, 1.75, 1.75, 1.25) | vec4(9.0, 9.0, 9.0, -2.25) | vec4(24.0, 24.0, 24.0, 64.0) | vec4(0.25, 0.25, 0.25, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wwwy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_xyxx
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_zzwz
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.75, 0.75, 0.825, 0.75) | vec4(1.125, 1.125, 1.75, 1.125) | vec4(-4.875, -4.875, 9.0, -4.875) | vec4(-51.0, -51.0, 24.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.25, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzwz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_s
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_q
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output float out0 = [ 0.825 | 1.75 | 9.0 | 24.0 | 0.25 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.q;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_qs
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec2 out0 = [ vec2(0.825, 0.0) | vec2(1.75, 1.0) | vec2(9.0, -0.5) | vec2(24.0, -32.0) | vec2(0.25, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qs;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_qp
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec2 out0 = [ vec2(0.825, 0.75) | vec2(1.75, 1.125) | vec2(9.0, -4.875) | vec2(24.0, -51.0) | vec2(0.25, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_qqq
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.825, 0.825, 0.825) | vec3(1.75, 1.75, 1.75) | vec3(9.0, 9.0, 9.0) | vec3(24.0, 24.0, 24.0) | vec3(0.25, 0.25, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_ttq
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.5, 0.5, 0.825) | vec3(1.25, 1.25, 1.75) | vec3(-2.25, -2.25, 9.0) | vec3(64.0, 64.0, 24.0) | vec3(-0.0322580645161, -0.0322580645161, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ttq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_qpt
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.825, 0.75, 0.5) | vec3(1.75, 1.125, 1.25) | vec3(9.0, -4.875, -2.25) | vec3(24.0, -51.0, 64.0) | vec3(0.25, 0.0526315789474, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qpt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_stpq
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stpq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_qpts
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.75, 0.5, 0.0) | vec4(1.75, 1.125, 1.25, 1.0) | vec4(9.0, -4.875, -2.25, -0.5) | vec4(24.0, -51.0, 64.0, -32.0) | vec4(0.25, 0.0526315789474, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qpts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_ssss
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(-0.5, -0.5, -0.5, -0.5) | vec4(-32.0, -32.0, -32.0, -32.0) | vec4(-0.75, -0.75, -0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ssss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_tttt
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tttt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_qqqq
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.825) | vec4(1.75, 1.75, 1.75, 1.75) | vec4(9.0, 9.0, 9.0, 9.0) | vec4(24.0, 24.0, 24.0, 24.0) | vec4(0.25, 0.25, 0.25, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqqq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_qppq
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.75, 0.75, 0.825) | vec4(1.75, 1.125, 1.125, 1.75) | vec4(9.0, -4.875, -4.875, 9.0) | vec4(24.0, -51.0, -51.0, 24.0) | vec4(0.25, 0.0526315789474, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qppq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_qqqt
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.5) | vec4(1.75, 1.75, 1.75, 1.25) | vec4(9.0, 9.0, 9.0, -2.25) | vec4(24.0, 24.0, 24.0, 64.0) | vec4(0.25, 0.25, 0.25, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqqt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_stss
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_ppqp
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.75, 0.75, 0.825, 0.75) | vec4(1.125, 1.125, 1.75, 1.125) | vec4(-4.875, -4.875, 9.0, -4.875) | vec4(-51.0, -51.0, 24.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.25, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppqp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_r
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_a
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output float out0 = [ 0.825 | 1.75 | 9.0 | 24.0 | 0.25 ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_ar
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec2 out0 = [ vec2(0.825, 0.0) | vec2(1.75, 1.0) | vec2(9.0, -0.5) | vec2(24.0, -32.0) | vec2(0.25, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ar;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_ab
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec2 out0 = [ vec2(0.825, 0.75) | vec2(1.75, 1.125) | vec2(9.0, -4.875) | vec2(24.0, -51.0) | vec2(0.25, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ab;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_aaa
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.825, 0.825, 0.825) | vec3(1.75, 1.75, 1.75) | vec3(9.0, 9.0, 9.0) | vec3(24.0, 24.0, 24.0) | vec3(0.25, 0.25, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaa;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_gga
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.5, 0.5, 0.825) | vec3(1.25, 1.25, 1.75) | vec3(-2.25, -2.25, 9.0) | vec3(64.0, 64.0, 24.0) | vec3(-0.0322580645161, -0.0322580645161, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gga;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_abg
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.825, 0.75, 0.5) | vec3(1.75, 1.125, 1.25) | vec3(9.0, -4.875, -2.25) | vec3(24.0, -51.0, 64.0) | vec3(0.25, 0.0526315789474, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_rgba
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgba;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_abgr
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.75, 0.5, 0.0) | vec4(1.75, 1.125, 1.25, 1.0) | vec4(9.0, -4.875, -2.25, -0.5) | vec4(24.0, -51.0, 64.0, -32.0) | vec4(0.25, 0.0526315789474, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abgr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_rrrr
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(-0.5, -0.5, -0.5, -0.5) | vec4(-32.0, -32.0, -32.0, -32.0) | vec4(-0.75, -0.75, -0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rrrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_gggg
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gggg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_aaaa
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.825) | vec4(1.75, 1.75, 1.75, 1.75) | vec4(9.0, 9.0, 9.0, 9.0) | vec4(24.0, 24.0, 24.0, 24.0) | vec4(0.25, 0.25, 0.25, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaaa;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_abba
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.75, 0.75, 0.825) | vec4(1.75, 1.125, 1.125, 1.75) | vec4(9.0, -4.875, -4.875, 9.0) | vec4(24.0, -51.0, -51.0, 24.0) | vec4(0.25, 0.0526315789474, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abba;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_aaag
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.5) | vec4(1.75, 1.75, 1.75, 1.25) | vec4(9.0, 9.0, 9.0, -2.25) | vec4(24.0, 24.0, 24.0, 64.0) | vec4(0.25, 0.25, 0.25, -0.0322580645161) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaag;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_rgrr
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_bbab
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.75, 0.75, 0.825, 0.75) | vec4(1.125, 1.125, 1.75, 1.125) | vec4(-4.875, -4.875, 9.0, -4.875) | vec4(-51.0, -51.0, 24.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.25, 0.0526315789474) ];
+ }
+
+ both ""
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbab;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # vec4_swizzles \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/template.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/template.html
new file mode 100644
index 0000000000..8d56d4dbe2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles2/shaders/template.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = ___TEST_NAME___;
+description("Shader test: " + testName + ".");
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/00_test_list.txt
new file mode 100644
index 0000000000..a556c4b7ab
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/00_test_list.txt
@@ -0,0 +1,33 @@
+arrays.html
+conditionals.html
+constants.html
+constant_expressions.html
+--min-version 2.0.1 conversions_matrix_combine.html
+--min-version 2.0.1 conversions_matrix_to_matrix.html
+--min-version 2.0.1 conversions_scalar_to_matrix.html
+--min-version 2.0.1 conversions_scalar_to_scalar.html
+--min-version 2.0.1 conversions_scalar_to_vector.html
+--min-version 2.0.1 conversions_vector_combine.html
+--min-version 2.0.1 conversions_vector_illegal.html
+--min-version 2.0.1 conversions_vector_to_scalar.html
+--min-version 2.0.1 conversions_vector_to_vector.html
+declarations.html
+fragdata.html
+functions.html
+invalid_texture_functions.html
+keywords.html
+linkage.html
+negative.html
+preprocessor.html
+qualification_order.html
+scoping.html
+switch.html
+--min-version 2.0.1 swizzles_bvec2.html
+--min-version 2.0.1 swizzles_bvec3.html
+--min-version 2.0.1 swizzles_bvec4.html
+--min-version 2.0.1 swizzles_ivec2.html
+--min-version 2.0.1 swizzles_ivec3.html
+--min-version 2.0.1 swizzles_ivec4.html
+--min-version 2.0.1 swizzles_vec2.html
+--min-version 2.0.1 swizzles_vec3.html
+--min-version 2.0.1 swizzles_vec4.html
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/arrays.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/arrays.html
new file mode 100644
index 0000000000..1a79102d02
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/arrays.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'arrays';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/arrays.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/arrays.test
new file mode 100644
index 0000000000..f6276522b4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/arrays.test
@@ -0,0 +1,1962 @@
+#X1. Type: float[5] // An array type with 5 elements
+#X2. Return value: float[5] func() { ... } // Function with a 5-element array return value
+#X3. Array constructor: float[3] (1.0, 2.0, 5.5) // 3-element array with given elements
+# // Fails with array of matrices!
+#X4. As unnamed parameter: void func(float[5]);
+#X5. Variable declaration: float[5] a; // Equivalent to float a[5]; (?)
+#X6. Empty brackets: float x[] = float[] (1.0, 2.0, 3.0); // Size of x is 3
+# float y[] = float[3] (1.0, 2.0, 3.0); // Size of y is 3 (equivalent)
+# float z[] = y; // Size of z is 3
+#X7. Testing that 2-dimensional arrays don't work: float a[5][3]; // Illegal
+# float[5] a[3]; // Illegal
+#X8. Testing that array declaration with dynamic variables as array size won't work.
+#X9. Testing length() operator: z.length(); // Returns 3 for z defined before
+#X10. Test C/C++ style {}-constructor
+#X11. Test struct arrays
+#X12. Test array element access at initialization with const/dynamic values
+
+group constructor "Array constructors"
+
+ case float3
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ];
+ output vec3 out0 = [ vec3(2.0, 0.5, 1.0) | vec3(2.0, 7.4, -1.0) | vec3(-2.0, 3.0, 1.6) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float[3] x;
+ x = float[3] (in0.z, in0.x, in0.y);
+ out0 = vec3(x[0], x[1], x[2]);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float4
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.5, 1.0, 2.0, 0.2) | vec4(7.4, -1.0, 2.0, -1.3) | vec4(3.0, 1.6, -2.0, 0.5) ];
+ output vec4 out0 = [ vec4(2.0, 0.5, 0.2, 1.0) | vec4(2.0, 7.4, -1.3, -1.0) | vec4(-2.0, 3.0, 0.5, 1.6) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float[4] x;
+ x = float[4] (in0.z, in0.x, in0.w, in0.y);
+ out0 = vec4(x[0], x[1], x[2], x[3]);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int3
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ];
+ output ivec3 out0 = [ ivec3(2, 0, 1) | ivec3(2, 7, -1) | ivec3(-2, 3, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump int;
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ int[3] x;
+ x = int[3] (in0.z, in0.x, in0.y);
+ out0 = ivec3(x[0], x[1], x[2]);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int4
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 1, 2, 0) | ivec4(7, -1, 2, -1) | ivec4(3, 1, -2, 0) ];
+ output ivec4 out0 = [ ivec4(2, 0, 0, 1) | ivec4(2, 7, -1, -1) | ivec4(-2, 3, 0, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump int;
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ int[4] x;
+ x = int[4] (in0.z, in0.x, in0.w, in0.y);
+ out0 = ivec4(x[0], x[1], x[2], x[3]);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool3
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, true, false) ];
+ output bvec3 out0 = [ bvec3(false, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bool[3] x;
+ x = bool[3] (in0.z, in0.x, in0.y);
+ out0 = bvec3(x[0], x[1], x[2]);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool4
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, true, false, false) ];
+ output bvec4 out0 = [ bvec4(false, true, true, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bool[4] x;
+ x = bool[4] (in0.z, in0.x, in0.y, in0.w);
+ out0 = bvec4(x[0], x[1], x[2], x[3]);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case struct3
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
+ output vec3 out0 = [ vec3(2.0, -0.5, -1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+
+
+ void main()
+ {
+ ${SETUP}
+
+ struct test
+ {
+ float f;
+ vec3 v;
+ };
+
+ test a = test(in0.z, vec3(in0.x, in0.y, in0.z));
+ test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
+ test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x));
+
+ test[3] x = test[3] (a, b, c);
+
+ out0 = vec3(x[0].f, x[1].v.y, x[2].v.x);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case struct4
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.5, 1.0, 2.0, 1.5) ];
+ output vec4 out0 = [ vec4(2.0, -0.5, -1.0, -1.5) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+
+ void main()
+ {
+ ${SETUP}
+
+
+ struct test
+ {
+ float f;
+ vec3 v;
+ };
+
+ test a = test(in0.z, vec3(in0.x, in0.y, in0.z));
+ test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
+ test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x));
+ test d = test(-in0.w, vec3(-in0.w, -in0.x, -in0.z));
+
+ test[4] x = test[4] (a, b, c, d);
+
+ out0 = vec4(x[0].f, x[1].v.y, x[2].v.x, x[3].v.x);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case float_vec3
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ];
+ output vec3 out0 = [ vec3(0.5, -2.0, 1.0) | vec3(7.4, -2.0, -1.0) | vec3(3.0, 2.0, 1.6) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+
+ vec3[3] x;
+ x = vec3[3] ( vec3(in0.x, in0.y, in0.z) ,
+ vec3(-in0.y, -in0.z, -in0.x),
+ vec3(in0.z, in0.x, in0.y) );
+ out0 = vec3(x[0].x, x[1].y, x[2].z);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_vec3
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ];
+ output ivec3 out0 = [ ivec3(5, -2, 1) | ivec3(7, -2, -1) | ivec3(3, 2, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump int;
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+
+ ivec3[3] x;
+ x = ivec3[3] ( ivec3(in0.x, in0.y, in0.z) ,
+ ivec3(-in0.y, -in0.z, -in0.x),
+ ivec3(in0.z, in0.x, in0.y) );
+ out0 = ivec3(x[0].x, x[1].y, x[2].z);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_vec3
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, true) ];
+ output bvec3 out0 = [ bvec3(true, true, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+
+ bvec3[3] x;
+ x = bvec3[3] ( bvec3(in0.x, in0.y, in0.z) ,
+ bvec3(in0.y, in0.z, in0.x),
+ bvec3(in0.z, in0.x, in0.y) );
+ out0 = bvec3(x[0].x, x[1].y, x[2].z);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_mat3
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ];
+ output vec3 out0 = [ vec3(0.5, -1.0, 1.0) | vec3(-1.5, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ mat3[3] a = mat3[3] ( mat3( in0.x, in0.y, in0.z,
+ in0.x, in0.y, in0.z,
+ in0.x, in0.y, in0.z) ,
+ mat3( in0.z, in0.x, -in0.y,
+ in0.z, in0.x, -in0.y,
+ in0.z, in0.x, -in0.y) ,
+ mat3( -in0.z, -in0.z, in0.z,
+ -in0.y, -in0.y, in0.y,
+ -in0.x, -in0.x, in0.x) );
+
+ mat3 a0 = a[0];
+ mat3 a1 = a[1];
+ mat3 a2 = a[2];
+
+ float ret0 = a0[2][0];
+ float ret1 = a1[0][2];
+ float ret2 = a2[1][2];
+
+ out0 = vec3(ret0, ret1, ret2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_mat3
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(-1, 0, -2) ];
+ output ivec3 out0 = [ ivec3(0, -1, 1) | ivec3(-1, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump int;
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ mat3[3] a = mat3[3] ( mat3( in0.x, in0.y, in0.z,
+ in0.x, in0.y, in0.z,
+ in0.x, in0.y, in0.z) ,
+ mat3( in0.z, in0.x, -in0.y,
+ in0.z, in0.x, -in0.y,
+ in0.z, in0.x, -in0.y) ,
+ mat3( -in0.z, -in0.z, in0.z,
+ -in0.y, -in0.y, in0.y,
+ -in0.x, -in0.x, in0.x) );
+
+ mat3 a0 = a[0];
+ mat3 a1 = a[1];
+ mat3 a2 = a[2];
+
+ float ret0 = a0[2][0];
+ float ret1 = a1[0][2];
+ float ret2 = a2[1][2];
+
+ out0 = ivec3(ret0, ret1, ret2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_mat3
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, true) ];
+ output bvec3 out0 = [ bvec3(true, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ mat3[3] a = mat3[3] ( mat3( in0.x, in0.y, in0.z,
+ in0.x, in0.y, in0.z,
+ in0.x, in0.y, in0.z) ,
+ mat3( in0.z, in0.x, in0.y,
+ in0.z, in0.x, in0.y,
+ in0.z, in0.x, in0.y) ,
+ mat3( in0.z, in0.z, in0.z,
+ in0.y, in0.y, in0.y,
+ in0.x, in0.x, in0.x) );
+
+ mat3 a0 = a[0];
+ mat3 a1 = a[1];
+ mat3 a2 = a[2];
+
+ float ret0 = a0[2][0];
+ float ret1 = a1[0][2];
+ float ret2 = a2[1][2];
+
+ out0 = bvec3(ret0, ret1, ret2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # type
+
+group return "Arrays as return value"
+
+ case float
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ];
+ output vec3 out0 = [ vec3(2.0, -0.5, 1.0) | vec3(2.0, -7.4, -1.0) | vec3(-2.0, -3.0, 1.6) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float[3] func(vec3 a)
+ {
+ return float[3] (a.z, -a.x, a.y);
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float[3] x = func(in0);
+ out0 = vec3(x[0], x[1], x[2]);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(4, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ];
+ output ivec3 out0 = [ ivec3(2, -4, 1) | ivec3(2, -7, -1) | ivec3(-2, -3, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump int;
+ precision mediump float;
+ ${DECLARATIONS}
+
+ int[3] func(ivec3 a)
+ {
+ return int[3] (a.z, -a.x, a.y);
+ }
+
+ void main()
+ {
+ ${SETUP}
+ int[3] x = func(in0);
+ out0 = ivec3(x[0], x[1], x[2]);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(false, true, true) ];
+ output bvec3 out0 = [ bvec3(true, false, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ bool[3] func(bvec3 a)
+ {
+ return bool[3] (a.z, a.x, a.y);
+ }
+
+ void main()
+ {
+ ${SETUP}
+ bool[3] x = func(in0);
+ out0 = bvec3(x[0], x[1], x[2]);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+
+ case float_vec3
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-0.5, 11.2, -1.0) ];
+ output vec3 out0 = [ vec3(1.0, 0.5, -2.0) | vec3(11.2, -0.5, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ vec3[3] func(vec3[3] a)
+ {
+ return vec3[3] (a[1], a[2], a[0]);
+ }
+
+ void main()
+ {
+ ${SETUP}
+ vec3[3] x = vec3[3](vec3(in0.x, in0.y, -in0.z) ,
+ vec3(in0.y, -in0.z, in0.x) ,
+ vec3(-in0.z, in0.x, in0.y) );
+ x = func(x);
+ out0 = vec3(x[0].x, x[1].y, x[2].z);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case struct
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
+ output vec3 out0 = [ vec3(-1.0, 2.0, 0.5) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ struct test
+ {
+ float f;
+ vec3 v;
+ };
+
+ test[3] func(test[3] a)
+ {
+ return test[3] (a[1], a[2], a[0]);
+ }
+
+ void main()
+ {
+ ${SETUP}
+
+ test a = test(in0.z, vec3(in0.x, in0.y, in0.z));
+ test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
+ test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x));
+
+ test[3] t = test[3] (a, b, c);
+ test[3] x = func(t);
+
+ out0 = vec3(x[0].v.z, x[1].v.y, x[2].v.x);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_vec3
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(-5, 11, -1) ];
+ output ivec3 out0 = [ ivec3(1, 5, -2) | ivec3(11, -5, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump int;
+ precision mediump float;
+ ${DECLARATIONS}
+
+ ivec3[3] func(ivec3[3] a)
+ {
+ return ivec3[3] (a[1], a[2], a[0]);
+ }
+
+ void main()
+ {
+ ${SETUP}
+ ivec3[3] x = ivec3[3]( ivec3(in0.x, in0.y, -in0.z) ,
+ ivec3(in0.y, -in0.z, in0.x) ,
+ ivec3(-in0.z, in0.x, in0.y) );
+ x = func(x);
+ out0 = ivec3(x[0].x, x[1].y, x[2].z);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_vec3
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) ];
+ output bvec3 out0 = [ bvec3(false, true, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump int;
+ precision mediump float;
+ ${DECLARATIONS}
+
+ bvec3[3] func(bvec3[3] a)
+ {
+ return bvec3[3] (a[1], a[2], a[0]);
+ }
+
+ void main()
+ {
+ ${SETUP}
+ bvec3[3] x = bvec3[3]( bvec3(in0.x, in0.y, in0.z) ,
+ bvec3(in0.y, in0.z, in0.x) ,
+ bvec3(in0.z, in0.x, in0.y) );
+ x = func(x);
+ out0 = bvec3(x[0].x, x[1].y, x[2].z);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_mat3
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ];
+ output vec3 out0 = [ vec3(2.0, -1.0, 2.0) | vec3(-2.3, 0.0, -2.3) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ mat3[3] func(mat3[3] x)
+ {
+ mat3[3] r;
+ r[0] = x[1];
+ r[1] = x[2];
+ r[2] = x[0];
+ return r;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ mat3[3] a, b;
+ a[0] = mat3(in0.x, in0.y, in0.z,
+ in0.x, in0.y, in0.z,
+ in0.x, in0.y, in0.z);
+ a[1] = mat3(in0.z, in0.x, -in0.y,
+ in0.z, in0.x, -in0.y,
+ in0.z, in0.x, -in0.y);
+ a[2] = mat3(-in0.z, -in0.z, in0.z,
+ -in0.y, -in0.y, in0.y,
+ -in0.x, -in0.x, in0.x);
+
+ b = func(a);
+
+ mat3 b0 = b[0];
+ mat3 b1 = b[1];
+ mat3 b2 = b[2];
+
+ float ret0 = b0[0][0];
+ float ret1 = b1[1][1];
+ float ret2 = b2[2][2];
+
+ out0 = vec3(ret0, ret1, ret2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_mat3
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(-1, 0, -2) ];
+ output ivec3 out0 = [ ivec3(2, -1, 2) | ivec3(-2, 0, -2) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump int;
+ precision mediump float;
+ ${DECLARATIONS}
+
+ mat3[3] func(mat3[3] x)
+ {
+ mat3[3] r;
+ r[0] = x[1];
+ r[1] = x[2];
+ r[2] = x[0];
+ return r;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ mat3[3] a, b;
+ a[0] = mat3(in0.x, in0.y, in0.z,
+ in0.x, in0.y, in0.z,
+ in0.x, in0.y, in0.z);
+ a[1] = mat3(in0.z, in0.x, -in0.y,
+ in0.z, in0.x, -in0.y,
+ in0.z, in0.x, -in0.y);
+ a[2] = mat3(-in0.z, -in0.z, in0.z,
+ -in0.y, -in0.y, in0.y,
+ -in0.x, -in0.x, in0.x);
+
+ b = func(a);
+
+ mat3 b0 = b[0];
+ mat3 b1 = b[1];
+ mat3 b2 = b[2];
+
+ float ret0 = b0[0][0];
+ float ret1 = b1[1][1];
+ float ret2 = b2[2][2];
+
+ out0 = ivec3(ret0, ret1, ret2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_mat3
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, true) | bvec3(true, true, false) ];
+ output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, true, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ mat3[3] func(mat3[3] x)
+ {
+ mat3[3] r;
+ r[0] = x[1];
+ r[1] = x[2];
+ r[2] = x[0];
+ return r;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ mat3[3] a, b;
+ a[0] = mat3(in0.x, in0.y, in0.z,
+ in0.x, in0.y, in0.z,
+ in0.x, in0.y, in0.z);
+ a[1] = mat3(in0.z, in0.x, in0.y,
+ in0.z, in0.x, in0.y,
+ in0.z, in0.x, in0.y);
+ a[2] = mat3(in0.z, in0.z, in0.z,
+ in0.y, in0.y, in0.y,
+ in0.x, in0.x, in0.x);
+
+ b = func(a);
+
+ mat3 b0 = b[0];
+ mat3 b1 = b[1];
+ mat3 b2 = b[2];
+
+ float ret0 = b0[0][0];
+ float ret1 = b1[1][1];
+ float ret2 = b2[2][2];
+
+ out0 = bvec3(ret0, ret1, ret2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # return
+
+group unnamed_parameter "Array type as unnamed parameter of a function prototype"
+
+ case float
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ];
+ output vec3 out0 = [ vec3(2.0, 0.5, 1.0) | vec3(2.0, 7.4, -1.0) | vec3(-2.0, 3.0, 1.6) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float[3] func(float[3]);
+
+ void main()
+ {
+ ${SETUP}
+ float[3] a = float[3] (in0.x, in0.y, in0.z);
+ float[3] b = func(a);
+ out0 = vec3(b[0], b[1], b[2]);
+ ${OUTPUT}
+ }
+
+ float[3] func(float[3] a)
+ {
+ return float[3] (a[2], a[0], a[1]);
+ }
+
+ ""
+ end
+
+ case int
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ];
+ output ivec3 out0 = [ ivec3(2, 0, 1) | ivec3(2, 7, -1) | ivec3(-2, 3, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump int;
+ precision mediump float;
+ ${DECLARATIONS}
+
+ int[3] func(int[3]);
+
+ void main()
+ {
+ ${SETUP}
+ int[3] a = int[3] (in0.x, in0.y, in0.z);
+ int[3] b = func(a);
+ out0 = ivec3(b[0], b[1], b[2]);
+ ${OUTPUT}
+ }
+
+ int[3] func(int[3] a)
+ {
+ return int[3] (a[2], a[0], a[1]);
+ }
+
+ ""
+ end
+
+ case bool
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(false, true, true) ];
+ output bvec3 out0 = [ bvec3(true, false, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ bool[3] func(bool[3]);
+
+ void main()
+ {
+ ${SETUP}
+ bool[3] a = bool[3] (in0.x, in0.y, in0.z);
+ bool[3] b = func(a);
+ out0 = bvec3(b[0], b[1], b[2]);
+ ${OUTPUT}
+ }
+
+ bool[3] func(bool[3] a)
+ {
+ return bool[3] (a[2], a[0], a[1]);
+ }
+
+ ""
+ end
+
+ case struct
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
+ output vec3 out0 = [ vec3(-1.0, 2.0, 0.5) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ struct test
+ {
+ float f;
+ vec3 v;
+ };
+
+ test[3] func(test[3]);
+
+ void main()
+ {
+ ${SETUP}
+
+ test a = test(in0.z, vec3(in0.x, in0.y, in0.z));
+ test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
+ test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x));
+
+ test[3] t = test[3] (a, b, c);
+ test[3] x = func(t);
+ out0 = vec3(x[0].v.z, x[1].v.y, x[2].v.x);
+ ${OUTPUT}
+ }
+
+ test[3] func(test[3] a)
+ {
+ return test[3] (a[1], a[2], a[0]);
+ }
+
+ ""
+ end
+
+ case float_vec3
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-0.5, 11.2, -1.0) ];
+ output vec3 out0 = [ vec3(1.0, 0.5, -2.0) | vec3(11.2, -0.5, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ vec3[3] func(vec3[3]);
+
+ void main()
+ {
+ ${SETUP}
+ vec3[3] x = vec3[3](vec3(in0.x, in0.y, -in0.z) ,
+ vec3(in0.y, -in0.z, in0.x) ,
+ vec3(-in0.z, in0.x, in0.y) );
+ x = func(x);
+ out0 = vec3(x[0].x, x[1].y, x[2].z);
+ ${OUTPUT}
+ }
+
+ vec3[3] func(vec3[3] a)
+ {
+ return vec3[3] (a[1], a[2], a[0]);
+ }
+ ""
+ end
+
+ case int_vec3
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(-5, 11, -1) ];
+ output ivec3 out0 = [ ivec3(1, 5, -2) | ivec3(11, -5, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump int;
+ precision mediump float;
+ ${DECLARATIONS}
+
+ ivec3[3] func(ivec3[3]);
+
+ void main()
+ {
+ ${SETUP}
+ ivec3[3] x = ivec3[3]( ivec3(in0.x, in0.y, -in0.z) ,
+ ivec3(in0.y, -in0.z, in0.x) ,
+ ivec3(-in0.z, in0.x, in0.y) );
+ x = func(x);
+ out0 = ivec3(x[0].x, x[1].y, x[2].z);
+ ${OUTPUT}
+ }
+
+ ivec3[3] func(ivec3[3] a)
+ {
+ return ivec3[3] (a[1], a[2], a[0]);
+ }
+ ""
+ end
+
+ case bool_vec3
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) ];
+ output bvec3 out0 = [ bvec3(false, true, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump int;
+ precision mediump float;
+ ${DECLARATIONS}
+
+ bvec3[3] func(bvec3[3]);
+
+ void main()
+ {
+ ${SETUP}
+ bvec3[3] x = bvec3[3]( bvec3(in0.x, in0.y, in0.z) ,
+ bvec3(in0.y, in0.z, in0.x) ,
+ bvec3(in0.z, in0.x, in0.y) );
+ x = func(x);
+ out0 = bvec3(x[0].x, x[1].y, x[2].z);
+ ${OUTPUT}
+ }
+
+ bvec3[3] func(bvec3[3] a)
+ {
+ return bvec3[3] (a[1], a[2], a[0]);
+ }
+
+ ""
+ end
+
+ case float_mat3
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ];
+ output vec3 out0 = [ vec3(2.0, -1.0, 2.0) | vec3(-2.3, 0.0, -2.3) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ mat3[3] func(mat3[3]);
+
+ void main()
+ {
+ ${SETUP}
+ mat3[3] a, b;
+ a[0] = mat3(in0.x, in0.y, in0.z,
+ in0.x, in0.y, in0.z,
+ in0.x, in0.y, in0.z);
+ a[1] = mat3(in0.z, in0.x, -in0.y,
+ in0.z, in0.x, -in0.y,
+ in0.z, in0.x, -in0.y);
+ a[2] = mat3(-in0.z, -in0.z, in0.z,
+ -in0.y, -in0.y, in0.y,
+ -in0.x, -in0.x, in0.x);
+
+ b = func(a);
+
+ mat3 b0 = b[0];
+ mat3 b1 = b[1];
+ mat3 b2 = b[2];
+
+ float ret0 = b0[0][0];
+ float ret1 = b1[1][1];
+ float ret2 = b2[2][2];
+
+ out0 = vec3(ret0, ret1, ret2);
+ ${OUTPUT}
+ }
+
+ mat3[3] func(mat3[3] x)
+ {
+ mat3[3] r;
+ r[0] = x[1];
+ r[1] = x[2];
+ r[2] = x[0];
+ return r;
+ }
+ ""
+ end
+
+ case int_mat3
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(-1, 0, -2) ];
+ output ivec3 out0 = [ ivec3(2, -1, 2) | ivec3(-2, 0, -2) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump int;
+ precision mediump float;
+ ${DECLARATIONS}
+
+ mat3[3] func(mat3[3]);
+
+ void main()
+ {
+ ${SETUP}
+ mat3[3] a, b;
+ a[0] = mat3(in0.x, in0.y, in0.z,
+ in0.x, in0.y, in0.z,
+ in0.x, in0.y, in0.z);
+ a[1] = mat3(in0.z, in0.x, -in0.y,
+ in0.z, in0.x, -in0.y,
+ in0.z, in0.x, -in0.y);
+ a[2] = mat3(-in0.z, -in0.z, in0.z,
+ -in0.y, -in0.y, in0.y,
+ -in0.x, -in0.x, in0.x);
+
+ b = func(a);
+
+ mat3 b0 = b[0];
+ mat3 b1 = b[1];
+ mat3 b2 = b[2];
+
+ float ret0 = b0[0][0];
+ float ret1 = b1[1][1];
+ float ret2 = b2[2][2];
+
+ out0 = ivec3(ret0, ret1, ret2);
+ ${OUTPUT}
+ }
+
+ mat3[3] func(mat3[3] x)
+ {
+ mat3[3] r;
+ r[0] = x[1];
+ r[1] = x[2];
+ r[2] = x[0];
+ return r;
+ }
+ ""
+ end
+
+ case bool_mat3
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, true) | bvec3(true, true, false) ];
+ output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, true, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ mat3[3] func(mat3[3]);
+ void main()
+ {
+ ${SETUP}
+ mat3[3] a, b;
+ a[0] = mat3(in0.x, in0.y, in0.z,
+ in0.x, in0.y, in0.z,
+ in0.x, in0.y, in0.z);
+ a[1] = mat3(in0.z, in0.x, in0.y,
+ in0.z, in0.x, in0.y,
+ in0.z, in0.x, in0.y);
+ a[2] = mat3(in0.z, in0.z, in0.z,
+ in0.y, in0.y, in0.y,
+ in0.x, in0.x, in0.x);
+
+ b = func(a);
+
+ mat3 b0 = b[0];
+ mat3 b1 = b[1];
+ mat3 b2 = b[2];
+
+ float ret0 = b0[0][0];
+ float ret1 = b1[1][1];
+ float ret2 = b2[2][2];
+
+ out0 = bvec3(ret0, ret1, ret2);
+ ${OUTPUT}
+ }
+
+ mat3[3] func(mat3[3] x)
+ {
+ mat3[3] r;
+ r[0] = x[1];
+ r[1] = x[2];
+ r[2] = x[0];
+ return r;
+ }
+ ""
+ end
+
+end # unnamed_parameter
+
+group declaration "Declaring arrays"
+
+ case implicit_size_float
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ];
+ output vec3 out0 = [ vec3(2.0, 0.5, 1.0) | vec3(2.0, 7.4, -1.0) | vec3(-2.0, 3.0, 1.6) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float[] x = float[] (in0.z, in0.x, in0.y);
+ float[] y = x;
+
+ out0 = vec3(y[0], y[1], y[2]);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case implicit_size_int
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ];
+ output ivec3 out0 = [ ivec3(2, 0, 1) | ivec3(2, 7, -1) | ivec3(-2, 3, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump int;
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ int[] x = int[] (in0.z, in0.x, in0.y);
+ int[] y = x;
+
+ out0 = ivec3(y[0], y[1], y[2]);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case implicit_size_bool
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(false, true, true) ];
+ output bvec3 out0 = [ bvec3(true, false, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bool[] x = bool[] (in0.z, in0.x, in0.y);
+ bool[] y = x;
+
+ out0 = bvec3(y[0], y[1], y[2]);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case implicit_size_struct
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
+ output vec3 out0 = [ vec3(-1.0, -0.5, 2.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ struct test
+ {
+ float f;
+ vec3 v;
+ };
+
+ void main()
+ {
+ ${SETUP}
+
+ test a = test(in0.z, vec3(in0.x, in0.y, in0.z));
+ test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
+ test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x));
+
+ test[] x = test[] (c, b, a);
+ test[] y = x;
+
+ out0 = vec3(y[0].v.x, y[1].v.y, y[2].v.z);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case implicit_size_float_vec3
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-0.5, 11.2, -1.0) ];
+ output vec3 out0 = [ vec3(0.5, -2.0, 1.0) | vec3(-0.5, 1.0, 11.2) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec3[] x = vec3[] ( vec3(in0.x, in0.y, -in0.z) ,
+ vec3(in0.y, -in0.z, in0.x) ,
+ vec3(-in0.z, in0.x, in0.y) );
+ vec3[] y = x;
+ out0 = vec3(y[0].x, y[1].y, y[2].z);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case implicit_size_int_ivec3
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(5, 11, -1) ];
+ output ivec3 out0 = [ ivec3(0, -2, 1) | ivec3(5, 1, 11) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump int;
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec3[] x = ivec3[] ( ivec3(in0.x, in0.y, -in0.z) ,
+ ivec3(in0.y, -in0.z, in0.x) ,
+ ivec3(-in0.z, in0.x, in0.y) );
+ ivec3[] y = x;
+ out0 = ivec3(y[0].x, y[1].y, y[2].z);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case implicit_size_bool_bvec3
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, true) ];
+ output bvec3 out0 = [ bvec3(true, true, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec3[] x = bvec3[] ( bvec3(in0.x, in0.y, in0.z) ,
+ bvec3(in0.y, in0.z, in0.x) ,
+ bvec3(in0.z, in0.x, in0.y) );
+ bvec3[] y = x;
+ out0 = bvec3(y[0].x, y[1].y, y[2].z);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case implicit_size_float_mat3
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ];
+ output vec3 out0 = [ vec3(0.5, -1.0, 1.0) | vec3(-1.5, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ mat3[] a = mat3[] ( mat3( in0.x, in0.y, in0.z,
+ in0.x, in0.y, in0.z,
+ in0.x, in0.y, in0.z) ,
+ mat3( in0.z, in0.x, -in0.y,
+ in0.z, in0.x, -in0.y,
+ in0.z, in0.x, -in0.y) ,
+ mat3( -in0.z, -in0.z, in0.z,
+ -in0.y, -in0.y, in0.y,
+ -in0.x, -in0.x, in0.x) );
+
+ mat3 a0 = a[0];
+ mat3 a1 = a[1];
+ mat3 a2 = a[2];
+
+ float ret0 = a0[2][0];
+ float ret1 = a1[0][2];
+ float ret2 = a2[1][2];
+
+ out0 = vec3(ret0, ret1, ret2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case implicit_size_int_mat3
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(-1, 0, -2) ];
+ output ivec3 out0 = [ ivec3(0, -1, 1) | ivec3(-1, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump int;
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ mat3[] a = mat3[] ( mat3( in0.x, in0.y, in0.z,
+ in0.x, in0.y, in0.z,
+ in0.x, in0.y, in0.z) ,
+ mat3( in0.z, in0.x, -in0.y,
+ in0.z, in0.x, -in0.y,
+ in0.z, in0.x, -in0.y) ,
+ mat3( -in0.z, -in0.z, in0.z,
+ -in0.y, -in0.y, in0.y,
+ -in0.x, -in0.x, in0.x) );
+
+ mat3 a0 = a[0];
+ mat3 a1 = a[1];
+ mat3 a2 = a[2];
+
+ float ret0 = a0[2][0];
+ float ret1 = a1[0][2];
+ float ret2 = a2[1][2];
+
+ out0 = ivec3(ret0, ret1, ret2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case implicit_size_bool_mat3
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, true) ];
+ output bvec3 out0 = [ bvec3(true, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ mat3[] a = mat3[] ( mat3( in0.x, in0.y, in0.z,
+ in0.x, in0.y, in0.z,
+ in0.x, in0.y, in0.z) ,
+ mat3( in0.z, in0.x, in0.y,
+ in0.z, in0.x, in0.y,
+ in0.z, in0.x, in0.y) ,
+ mat3( in0.z, in0.z, in0.z,
+ in0.y, in0.y, in0.y,
+ in0.x, in0.x, in0.x) );
+
+ mat3 a0 = a[0];
+ mat3 a1 = a[1];
+ mat3 a2 = a[2];
+
+ float ret0 = a0[2][0];
+ float ret1 = a1[0][2];
+ float ret2 = a2[1][2];
+
+ out0 = bvec3(ret0, ret1, ret2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case constant_expression_array_size
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ const int a = 4;
+
+ void main ()
+ {
+ const int b = 5;
+ float[a] array1;
+ float[b] array2;
+ float[array1.length()] array3;
+ float[a+b] array4;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case constant_expression_array_access
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
+ output vec3 out0 = [ vec3(-2.0, -1.0, -0.5) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ const int a = 3;
+
+ void main ()
+ {
+ ${SETUP}
+ const int b = 2;
+ float x = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [a];
+ float y = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [b+2];
+ float z = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [5];
+ out0 = vec3(x, y, z);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case dynamic_expression_array_access
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
+ input ivec2 in1 = ivec2(3, 2);
+ output vec3 out0 = [ vec3(-2.0, -1.0, -0.5) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ ${SETUP}
+ float x = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [in1.x];
+ float y = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [in1.y+2];
+ float z = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [in1.x+in1.y];
+ out0 = vec3(x, y, z);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case multiple_declarations_single_statement_explicit
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
+ output vec3 out0 = [ vec3(2.0, -1.0, 0.5) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ ${SETUP}
+ float[] x = float[6] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x),
+ y = float[2] (in0.x, -in0.y);
+ out0 = vec3(x[2], y[1], x[0]);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case multiple_declarations_single_statement_implicit
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(5, 1, 2) ];
+ output ivec3 out0 = [ ivec3(2, -1, 5) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ ${SETUP}
+ int[] x = int[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x),
+ y = int[] (in0.x, -in0.y);
+ out0 = ivec3(x[2], y[1], x[0]);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # declaration
+
+group length "Array length method"
+
+ case float
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
+ output ivec3 out0 = [ ivec3(3, 5, 13) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float[] x = float[3] (in0.z, in0.x, in0.y);
+ float[] y = float[] (in0.z, in0.x, in0.y, in0.x, in0.y);
+ float[13] z;
+
+ out0 = ivec3(x.length(), y.length(), z.length());
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 1, 2) ];
+ output ivec3 out0 = [ ivec3(3, 5, 13) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump int;
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ int[] x = int[3] (in0.z, in0.x, in0.y);
+ int[] y = int[] (in0.z, in0.x, in0.y, in0.x, in0.y);
+ int[13] z;
+
+ out0 = ivec3(x.length(), y.length(), z.length());
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, true) ];
+ output ivec3 out0 = [ ivec3(3, 5, 13) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bool[] x = bool[3] (in0.z, in0.x, in0.y);
+ bool[] y = bool[] (in0.z, in0.x, in0.y, in0.x, in0.y);
+ bool[13] z;
+
+ out0 = ivec3(x.length(), y.length(), z.length());
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case struct
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
+ output ivec3 out0 = [ ivec3(3, 5, 13) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ struct test
+ {
+ float f;
+ vec3 v;
+ };
+
+ void main()
+ {
+ ${SETUP}
+
+ test a = test(in0.z, vec3(in0.x, in0.y, in0.z));
+ test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
+ test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x));
+
+ test[] x = test[3] (a, b, c);
+ test[] y = test[] (c, a, b, b, a);
+ test[13] z;
+
+ out0 = ivec3(x.length(), y.length(), z.length());
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # length
+
+group invalid "Invalid Functions"
+
+ case multidimensional_array1
+ version 300 es
+ expect compile_fail
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ float a[5][3];
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case multidimensional_array2
+ version 300 es
+ expect compile_fail
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ float[5] a[3];
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case multidimensional_uniform_array
+ version 300 es
+ expect compile_fail
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform float a[3][2];
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case multidimensional_array_in_uniform_block
+ version 300 es
+ expect compile_fail
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform MyBlock
+ {
+ float a[3][2];
+ };
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case dynamic_expression_array_size
+ version 300 es
+ expect compile_fail
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ int a = 5;
+ float[a] array;
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case empty_declaration_without_var_name
+ version 300 es
+ expect compile_or_link_fail
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ int[];
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case empty_declaration_with_var_name
+ version 300 es
+ expect compile_or_link_fail
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ int[] a;
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case constructor_c-style1
+ version 300 es
+ expect compile_fail
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ float a[];
+ a = float[3] { 1.0, 2.0, 3.0 };
+
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case constructor_c-style2
+ version 300 es
+ expect compile_fail
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ float a[5] = { 1.0, 2.0, 3.0 };
+
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+end # invalid
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conditionals.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conditionals.html
new file mode 100644
index 0000000000..e786e14224
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conditionals.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'conditionals';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conditionals.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conditionals.test
new file mode 100644
index 0000000000..a3a5b476fc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conditionals.test
@@ -0,0 +1,381 @@
+group if "If Statements"
+
+ case single_statement
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 ];
+ output float out0 = [ 0.0 | 1.0 | 1.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 0.0;
+ if (in0 >= 1.0)
+ out0 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case compound_statement
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 ];
+ output float out0 = [ 0.0 | 1.0 | 1.0 ];
+ output float out1 = [ 1.0 | 0.0 | 0.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 0.0;
+ out1 = 1.0;
+ if (in0 >= 1.0)
+ {
+ out0 = 1.0;
+ out1 = 0.0;
+ }
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case sequence_statements
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 ];
+ output float out0 = [ 0.0 | 1.0 | 1.0 ];
+ output float out1 = [ 1.0 | 0.0 | 0.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 0.0;
+ out1 = 1.0;
+ if (in0 >= 1.0)
+ out0 = 1.0, out1 = 0.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case sequence_condition
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 ];
+ output float out0 = [ 0.0 | 1.0 | 1.0 ];
+ output float out1 = [ 1.0 | 0.0 | 0.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 0.0;
+ out1 = 1.0;
+ if (false, in0 >= 1.0)
+ out0 = 1.0, out1 = 0.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case complex_condition
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 ];
+ output float out0 = [ 0.0 | 1.0 | 1.0 ];
+ output float out1 = [ 1.0 | 0.0 | 0.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 0.0;
+ out1 = 1.0;
+ if (false || (in0 >= 1.0) && (in0 - 2.0*in0 < 0.0))
+ out0 = 1.0, out1 = 0.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case if_else
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 ];
+ output float out0 = [ 0.0 | 1.0 | 1.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ if (in0 >= 1.0)
+ out0 = 1.0;
+ else
+ out0 = 0.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case if_elseif
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 ];
+ output float out0 = [ 0.0 | 1.0 | 2.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 0.0;
+ if (in0 >= 2.0)
+ out0 = 2.0;
+ else if (in0 >= 1.0)
+ out0 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case if_elseif_else
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 ];
+ output float out0 = [ 0.0 | 1.0 | 2.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ if (in0 >= 2.0)
+ out0 = 2.0;
+ else if (in0 >= 1.0)
+ out0 = 1.0;
+ else
+ out0 = 0.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mixed_if_elseif_else
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 ];
+ output float out0 = [ 0.0 | 1.0 | 2.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ if (in0 >= 2.0)
+ {
+ out0 = 2.0;
+ }
+ else if (in0 >= 1.0)
+ out0 = 2.0, out0 = 1.0;
+ else
+ out0 = 0.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # if
+
+group invalid_if "Invalid If Conditionals"
+
+ case missing_parenthesis
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ if true
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case unclosed_parenthesis
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ if (true
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case int_condition
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ if (5)
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case int_zero_condition
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ if (0)
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case int_one_condition
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ if (1)
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case int_uniform_condition
+ version 300 es
+ expect compile_fail
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ uniform int u0;
+ ${DECLARATIONS}
+ void main()
+ {
+ if (u0)
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case float_condition
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ if (5.0)
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case float_zero_condition
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ if (0.0)
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case float_one_condition
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ if (1.0)
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case sampler_condition
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ uniform sampler2D s0;
+ ${DECLARATIONS}
+ void main()
+ {
+ if (s0)
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+end # invalid_if
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constant_expressions.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constant_expressions.html
new file mode 100644
index 0000000000..e74ca678f9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constant_expressions.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'constant_expressions';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constant_expressions.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constant_expressions.test
new file mode 100644
index 0000000000..59c6cb6ffb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constant_expressions.test
@@ -0,0 +1,483 @@
+group trivial "Trivial expressions"
+
+ case float
+ version 300 es
+ values { output float out0 = 5.0; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const float a = 5.0;
+ out0 = a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int
+ version 300 es
+ values { output int out0 = 5; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const int a = 5;
+ out0 = a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool
+ version 300 es
+ values { output bool out0 = true; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const bool a = true;
+ out0 = a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case cast
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const float a = float(int(bool(true)));
+ out0 = a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # trivial
+
+group operators "Operators"
+
+ case math_float
+ version 300 es
+ values { output float out0 = 2.19; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const float a = 6.0/3.5 + 1.8*2.6 - 4.2;
+ out0 = a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case math_vec
+ version 300 es
+ values { output float out0 = 15.0; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const vec3 a = (vec4(1.0, 2.0, 3.0, 4.0).zyx * vec3(1.0, 1.5, 3.0).xyz).xzy + (vec2(5.0)/vec2(2.5)).xxy;
+ out0 = a.x + a.y + a.z;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case math_int
+ version 300 es
+ values { output int out0 = 7; }
+ both ""
+ #version 300 es
+ precision highp int;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const int a = 25%7 + 2*3 - 9/3;
+ out0 = a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case math_ivec
+ version 300 es
+ values { output int out0 = 21; }
+ both ""
+ #version 300 es
+ precision highp int;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const ivec3 a = ivec2(25%7, 4).xxy + ivec4(1*3, 9/3, 1+2, 8/4).xyz;
+ out0 = a.x + a.y + a.z;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case math_mat
+ version 300 es
+ values { output float out0 = 8.0; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const mat3 a = mat3(3.0) * mat3(4.0);
+ const mat4 b = mat4(a[1][1])*2.0;
+ const mat2 c = mat2(b[0][0]) / 3.0;
+ out0 = c[0][0]+c[1][0];
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bitwise
+ version 300 es
+ values { output int out0 = 678332; }
+ both ""
+ #version 300 es
+ precision highp int;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const int a = (((0xABBA<<4) ^ 0xCAFE) | (0xDCBA & (0xABCD>>2))) ^ (~0xDEAD & 0xBEEF);
+ out0 = a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case logical
+ version 300 es
+ values { output bool out0 = true; }
+ both ""
+ #version 300 es
+ precision highp int;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const bool a = (!false || false) && (true ^^ false);
+ out0 = a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case compare
+ version 300 es
+ values { output bool out0 = true; }
+ both ""
+ #version 300 es
+ precision highp int;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const bool a = (false == false) && (true != false) && (1 < 2) && (3 <= 3) && ((1 > 1) != (1 >= 1));
+ out0 = a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case selection
+ version 300 es
+ values { output float out0 = 5.3; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const float a = false ? 0.0 : (true ? 5.3 : 1.0);
+ out0 = a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # operators
+
+group complex_types "Arrays & Structs"
+
+ case struct
+ version 300 es
+ values { output float out0 = 260.922; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+
+ struct S
+ {
+ vec4 a;
+ int b;
+ };
+
+ void main()
+ {
+ const S s = S(vec4(1.5), 123);
+ out0 = length(s.a.xy)*float(s.b);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case nested_struct
+ version 300 es
+ values { output float out0 = 965.9; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+
+ struct S
+ {
+ vec4 v;
+ int i;
+ };
+
+ struct T
+ {
+ S s;
+ bool b;
+ int i;
+ };
+
+ struct U
+ {
+ S s;
+ T t;
+ };
+
+ void main()
+ {
+ const S s = S(vec4(1.5), 123);
+ const T t = T(s, false, 3);
+ const U u = U(s, t);
+ const U v = U(S(vec4(1.3), 4), T(S(vec4(2.0), 5), true, 6));
+ out0 = float(u.s.i*v.t.i + v.t.s.i)*v.s.v.x; // float(123*6 + 5)*1.3
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case array_size
+ version 300 es
+ values { output int out0 = 1; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const int a[max(-1, 1)] = int[1](1);
+ out0 = a[0];
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case array_length
+ version 300 es
+ values { output int out0 = 2; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const int a[1] = int[1](1);
+ out0 = a.length() + a[0];
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case array
+ version 300 es
+ values { output float out0 = 4.0; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const float a[1+2+5] = float[8](0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0);
+ const float f = a[1+2+4];
+ out0 = f + float(a.length()-8);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # complex_types
+
+group other "Other operations"
+
+ case switch_case
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.0 | 4.0 | 5.0 ];
+ output int out0 = [ 0 | 1 | 2 | 3 | 4 | 10];
+ }
+
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const int _0 = 0;
+ const int _1 = 1;
+ const int _2 = 2;
+ const int _3 = 3;
+ const int _4 = 4;
+
+ switch(int(in0))
+ {
+ case _0:
+ out0 = 0;
+ break;
+ case _1:
+ out0 = 1;
+ break;
+ case _2:
+ out0 = 2;
+ break;
+ case _3:
+ out0 = 3;
+ break;
+ case _4:
+ out0 = 4;
+ break;
+ case 5:
+ out0 = 10;
+ break;
+ default:
+ out0 = 100;
+
+ }
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case nested_builtin_funcs
+ version 300 es
+ values { output float out0 = 3.05; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ const float a = sqrt( atan(sin(1.5)/cos(1.5)) /*1.5*/ * log2(exp2(log(exp(6.2) + 0.1)) + 0.1) /*~6.2*/);
+ out0 = a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case complex
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.0 | 4.0 | 5.0 ];
+ output int out0 = [ 0 | 1 | 2 | 3 | 4 | 10];
+ }
+
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+
+ struct T
+ {
+ vec4 v;
+ };
+
+ struct S
+ {
+ T t;
+ int i;
+ bool b;
+ };
+
+ void main()
+ {
+ const T t = T(vec4(1.0));
+ const S s = S(t, 42, true);
+ const int _0 = int(sin(0.0));
+ const int _1 = int(1.0);
+ const int _2 = 2 + int(float(_0>_1));
+ const int _3 = min(gl_MaxVertexAttribs, 16)/4 - 1;
+ const int _4 = min(gl_MaxDrawBuffers, 4);
+ const ivec4 nums = ivec4(0, 1, 2, 3);
+
+ switch(int(in0))
+ {
+ case int(float(_0)):
+ out0 = ((true!=false) && (!false)) ? 0 : 25;
+ break;
+ case ivec3(_1).x:
+ out0 = 3*18/9-5;
+ break;
+ case nums[_2]:
+ out0 = int(length(vec4(1.0))+0.001);
+ break;
+ case _3:
+ out0 = 3;
+ break;
+ case clamp(_4, 1, 6):
+ out0 = (s.i-2)/10;
+ break;
+ case max(3, 5):
+ out0 = 10;
+ break;
+ default:
+ out0 = 100;
+
+ }
+ ${OUTPUT}
+ }
+ ""
+ end
+end
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constants.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constants.html
new file mode 100644
index 0000000000..891af46e5a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constants.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'constants';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constants.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constants.test
new file mode 100644
index 0000000000..93e71b72b6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/constants.test
@@ -0,0 +1,1153 @@
+case float_input
+ version 300 es
+ values
+ {
+ input float in0 = [ 1.123 | 0.75 | -512.0 | -72.13 | 199.91 ];
+ output float out0 = [ 1.123 | 0.75 | -512.0 | -72.13 | 199.91 ];
+ }
+ values
+ {
+ input float in0 = [ -1.123 | -0.75 | 512.0 | -72.13 | -199.91 ];
+ output float out0 = [ -1.123 | -0.75 | 512.0 | -72.13 | -199.91 ];
+ }
+
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = in0;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case float_uniform
+ version 300 es
+ values
+ {
+ uniform float uni0 = [ 1.123 | 0.75 | -512.0 | -72.13 | 199.91 ];
+ output float out0 = [ 1.123 | 0.75 | -512.0 | -72.13 | 199.91 ];
+ }
+
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+ uniform float uni0;
+ void main()
+ {
+ out0 = uni0;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case float_0
+ version 300 es
+ values { output float out0 = 1.123; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = +1.123;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case float_1
+ version 300 es
+ values { output float out0 = -1.123; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = -1.123;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case float_2
+ version 300 es
+ values { output float out0 = 123.0; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 123.;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case float_3
+ version 300 es
+ values { output float out0 = 0.123; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = .123;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case float_4
+ version 300 es
+ values { output float out0 = 123.0; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 1.23e+2;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case float_5
+ version 300 es
+ values { output float out0 = -123.0; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = -1.23E+2;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case float_6
+ version 300 es
+ values { output float out0 = -123.0; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = -1.23e2;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case float_7
+ version 300 es
+ values { output float out0 = 0.123; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 1.23e-1;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case float_8
+ version 300 es
+ values { output float out0 = 1000.0; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 1e3;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case float_f_suffix_0
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main ()
+ {
+ ${SETUP}
+ float value = 1.0f;
+ out0 = value;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case float_f_suffix_1
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main ()
+ {
+ ${SETUP}
+ float value = 1.0F;
+ out0 = value;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case int_0
+ version 300 es
+ values { output int out0 = 123; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 123;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case int_1
+ version 300 es
+ values { output int out0 = -321; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = -321;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case int_2
+ version 300 es
+ values { output int out0 = 123; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 0x7B;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case int_3
+ version 300 es
+ values { output int out0 = 123; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 0X7b;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case int_4
+ version 300 es
+ values { output int out0 = 123; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 0173;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case bool_0
+ version 300 es
+ values { output bool out0 = true; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = true;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case bool_1
+ version 300 es
+ values { output bool out0 = false; }
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = false;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_global
+ version 300 es
+ values { output float out0 = 1000.0; }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ const float theConstant = 1000.0;
+ void main()
+ {
+ out0 = theConstant;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_main
+ version 300 es
+ values { output float out0 = -1000.0; }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ const float theConstant = -1000.0;
+ out0 = theConstant;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_function
+ version 300 es
+ values { output float out0 = -0.012; }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ float func()
+ {
+ const float theConstant = -0.012;
+ return theConstant;
+ }
+ void main()
+ {
+ out0 = func();
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_scope
+ version 300 es
+ values { output float out0 = 1.0; }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ {
+ const float theConstant = 1.0;
+ out0 = theConstant;
+ }
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_scope_shawdowing_1
+ version 300 es
+ values { output float out0 = 1.0; }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ const float theConstant = 100.0;
+ {
+ const float theConstant = 1.0;
+ out0 = theConstant;
+ }
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_scope_shawdowing_2
+ version 300 es
+ values { output float out0 = 1.0; }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ const float theConstant = 100.0;
+ void main()
+ {
+ {
+ const float theConstant = 1.0;
+ out0 = theConstant;
+ }
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_scope_shawdowing_3
+ version 300 es
+ values { output float out0 = 1.0; }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ const float theConstant = 100.0;
+ void main()
+ {
+ const float theConstant = -100.0;
+ {
+ const float theConstant = 1.0;
+ out0 = theConstant;
+ }
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_scope_shawdowing_4
+ version 300 es
+ values { output float out0 = 2.0; }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ const float theConstant = 100.0;
+ float func()
+ {
+ const float theConstant = 2.0;
+ return theConstant;
+ }
+ void main()
+ {
+ const float theConstant = -100.0;
+ {
+ const float theConstant = 1.0;
+ out0 = func();
+ }
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_operations_with_const
+ version 300 es
+ values { output float out0 = 21.0; }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ const float theGlobalConstant = 10.0;
+ float func()
+ {
+ const float theConstant = 2.0;
+ return theConstant;
+ }
+ void main()
+ {
+ const float theConstant = -100.0;
+ {
+ const float theConstant = 1.0;
+ out0 = func() * theGlobalConstant + theConstant;
+ }
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_assignment_1
+ version 300 es
+ values { output float out0 = 10.0; }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ const float theConstant1 = 10.0;
+ const float theConstant2 = theConstant1;
+ out0 = theConstant2;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_assignment_2
+ version 300 es
+ values { output float out0 = 10.0; }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ const float theConstant1 = 10.0;
+ {
+ const float theConstant2 = theConstant1;
+ out0 = theConstant2;
+ }
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_assignment_3
+ version 300 es
+ values { output float out0 = 10.0; }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ const float theConstant1 = 10.0;
+ void main()
+ {
+ const float theConstant2 = theConstant1;
+ out0 = theConstant2;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_assignment_4
+ version 300 es
+ values { output float out0 = 10.0; }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ const float theConstant1 = 10.0;
+ float func()
+ {
+ const float theConstant2 = theConstant1;
+ return theConstant2;
+ }
+ void main()
+ {
+ out0 = func();
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_assign_uniform
+ version 300 es
+ expect compile_fail
+ values { output float out0 = 10.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform float theUniform;
+ void main()
+ {
+ const float theConstant = theUniform;
+ out0 = theConstant;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_assign_varying
+ version 300 es
+ expect compile_fail
+ values { output float out0 = 10.0; }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ out float theVarying;
+ void main()
+ {
+ theVarying = 1.0;
+ gl_Position = vec(1.0);
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ in float theVarying;
+ void main()
+ {
+ const float theConstant = theVarying;
+ out0 = theConstant;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+end
+
+case const_float_function_gotcha
+ version 300 es
+ desc "Function constant parameters are not really constants, so using them as constant expressions should fail."
+ expect compile_fail
+ values { output float out0 = 20.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ float func(const float gotcha)
+ {
+ const float theConstant2 = gotcha;
+ return theConstant2*2.0;
+ }
+ void main()
+ {
+ const float theConstant = 10.0;
+ out0 = func(theConstant);
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_from_int
+ version 300 es
+ values { output float out0 = 10.0; }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ const float theConstant = float(10);
+ void main()
+ {
+ out0 = theConstant;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_from_vec2
+ version 300 es
+ values { output float out0 = 10.0; }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ const float theConstant = vec2(1.0, 10.0).y;
+ void main()
+ {
+ out0 = theConstant;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_from_vec3
+ version 300 es
+ values { output float out0 = 10.0; }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ const float theConstant = vec3(1.0, 10.0, 20.0).y;
+ void main()
+ {
+ out0 = theConstant;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_from_vec4
+ version 300 es
+ values { output float out0 = 10.0; }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ const float theConstant = vec4(1.0, 10.0, 20.0, -10.0).y;
+ void main()
+ {
+ out0 = theConstant;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_assign_variable_1
+ version 300 es
+ expect compile_fail
+ values { output float out0 = 20.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ float theVariable = 20.0;
+ const float theConstant = theVariable;
+ out0 = theConstant;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_assign_variable_2
+ version 300 es
+ expect compile_fail
+ values { output float out0 = 50.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ float theVariable = 20.0;
+ theVariable += 30.0;
+ const float theConstant = theVariable;
+ out0 = theConstant;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case const_float_assign_user_func
+ version 300 es
+ expect compile_fail
+ values { output float out0 = 50.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ float func()
+ {
+ return 50.0;
+ }
+ void main()
+ {
+ const float theConstant = func();
+ out0 = theConstant;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case int_decimal
+ version 300 es
+ values { output int out0 = 7; }
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ void main ()
+ {
+ ${SETUP}
+ int value = 7;
+ out0 = value;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case int_octal
+ version 300 es
+ values { output int out0 = 15; }
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ void main ()
+ {
+ ${SETUP}
+ int value = 017;
+ out0 = value;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case int_hexadecimal_0
+ version 300 es
+ values { output int out0 = 47; }
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ void main ()
+ {
+ ${SETUP}
+ int value = 0x2f;
+ out0 = value;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case int_hexadecimal_1
+ version 300 es
+ values { output int out0 = 47; }
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ void main ()
+ {
+ ${SETUP}
+ int value = 0X2f;
+ out0 = value;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case uint_decimal_0
+ version 300 es
+ values { output uint out0 = 7; }
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ void main ()
+ {
+ ${SETUP}
+ uint value = 7u;
+ out0 = value;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case uint_decimal_1
+ version 300 es
+ values { output uint out0 = 7; }
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ void main ()
+ {
+ ${SETUP}
+ uint value = 7U;
+ out0 = value;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case uint_octal_0
+ version 300 es
+ values { output uint out0 = 15; }
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ void main ()
+ {
+ ${SETUP}
+ uint value = 017u;
+ out0 = value;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case uint_octal_1
+ version 300 es
+ values { output uint out0 = 15; }
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ void main ()
+ {
+ ${SETUP}
+ uint value = 017U;
+ out0 = value;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case uint_hexadecimal_0
+ version 300 es
+ values { output uint out0 = 47; }
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ void main ()
+ {
+ ${SETUP}
+ uint value = 0x2fU;
+ out0 = value;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case uint_hexadecimal_1
+ version 300 es
+ values { output uint out0 = 47; }
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ void main ()
+ {
+ ${SETUP}
+ uint value = 0X2fu;
+ out0 = value;
+ ${OUTPUT}
+ }
+ ""
+end
+
+case int_from_uint
+ expect compile_fail
+ version 300 es
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ void main ()
+ {
+ int value = 7u;
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ }
+ ""
+end
+
+case uint_from_int
+ expect compile_fail
+ version 300 es
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ void main ()
+ {
+ uint value = 7;
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ }
+ ""
+end
+
+case int_from_float
+ expect compile_fail
+ version 300 es
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ void main ()
+ {
+ int value = 7.0;
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ }
+ ""
+end
+
+case uint_from_float
+ expect compile_fail
+ version 300 es
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ void main ()
+ {
+ uint value = 7.0;
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ }
+ ""
+end
+
+case bool_from_int
+ expect compile_fail
+ version 300 es
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ void main ()
+ {
+ bool value = 1;
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ }
+ ""
+end
+
+case bool_from_uint
+ expect compile_fail
+ version 300 es
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ void main ()
+ {
+ bool value = 1u;
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ }
+ ""
+end
+
+case bool_from_float
+ expect compile_fail
+ version 300 es
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ void main ()
+ {
+ bool value = 1.0;
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ }
+ ""
+end
+
+case float_int_f_suffix_0
+ expect compile_fail
+ version 300 es
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main ()
+ {
+ ${SETUP}
+ float value = 1f;
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ }
+ ""
+end
+
+case float_int_f_suffix_1
+ expect compile_fail
+ version 300 es
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main ()
+ {
+ ${SETUP}
+ float value = 1F;
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ }
+ ""
+end
+
+case int_l_suffix
+ expect compile_fail
+ version 300 es
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ void main ()
+ {
+ int value = 1l;
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ }
+ ""
+end
+
+case uint_ul_suffix
+ expect compile_fail
+ version 300 es
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ void main ()
+ {
+ uint value = 1ul;
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ }
+ ""
+end
+
+case invalid_octal_0
+ expect compile_fail
+ version 300 es
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ void main ()
+ {
+ int value = 018;
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ }
+ ""
+end
+
+case invalid_octal_1
+ expect compile_fail
+ version 300 es
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ void main ()
+ {
+ uint value = 09U;
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ }
+ ""
+end
+
+case invalid_hexadecimal_0
+ expect compile_fail
+ version 300 es
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ void main ()
+ {
+ int value = 0x2g7;
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ }
+ ""
+end
+
+case invalid_hexadecimal_1
+ expect compile_fail
+ version 300 es
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ void main ()
+ {
+ uint value = 0X1h7u;
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ }
+ ""
+end
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions.template b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions.template
new file mode 100644
index 0000000000..3a42d5c193
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions.template
@@ -0,0 +1,25 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'conversions';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+modules.shared.glsShaderLibrary.run(testName);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions.test
new file mode 100644
index 0000000000..968c2d264f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions.test
@@ -0,0 +1,14246 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+
+group scalar_to_scalar "Scalar to Scalar Conversions"
+
+ case float_to_float
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output float out0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_int
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output int out0 = [ 0 | 1 | 2 | 3 | 0 | -8 | -20 | 36 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_bool
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output bool out0 = [ false | true | true | true | true | true | true | true ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_float
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output float out0 = [ 0.0 | 1.0 | 2.0 | 5.0 | 8.0 | 11.0 | -12.0 | -66.0 | -192.0 | 255.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_int
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output int out0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_bool
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output bool out0 = [ false | true | true | true | true | true | true | true | true | true ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_float
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output float out0 = [ 0.0 | 2.0 | 3.0 | 8.0 | 9.0 | 12.0 | 10.0 | 45.0 | 193.0 | 255.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_int
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output int out0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_bool
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output bool out0 = [ false | true | true | true | true | true | true | true | true | true ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_float
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output float out0 = [ 1.0 | 0.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_int
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output int out0 = [ 1 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_bool
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output bool out0 = [ true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_uint
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | 0.5 | 8.25 | 20.125 | 36.8125 ];
+ output uint out0 = [ 0 | 1 | 2 | 3 | 0 | 8 | 20 | 36 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_uint
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | 12 | 66 | 192 | 255 ];
+ output uint out0 = [ 0 | 1 | 2 | 5 | 8 | 11 | 12 | 66 | 192 | 255 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_uint
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output uint out0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_uint
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output uint out0 = [ 1 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # scalar_to_scalar
+group scalar_to_vector "Scalar to Vector Conversions"
+
+ case float_to_vec2
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(2.0, 2.0) | vec2(3.5, 3.5) | vec2(-0.5, -0.5) | vec2(-8.25, -8.25) | vec2(-20.125, -20.125) | vec2(36.8125, 36.8125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_vec3
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(2.0, 2.0, 2.0) | vec3(3.5, 3.5, 3.5) | vec3(-0.5, -0.5, -0.5) | vec3(-8.25, -8.25, -8.25) | vec3(-20.125, -20.125, -20.125) | vec3(36.8125, 36.8125, 36.8125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_vec4
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(2.0, 2.0, 2.0, 2.0) | vec4(3.5, 3.5, 3.5, 3.5) | vec4(-0.5, -0.5, -0.5, -0.5) | vec4(-8.25, -8.25, -8.25, -8.25) | vec4(-20.125, -20.125, -20.125, -20.125) | vec4(36.8125, 36.8125, 36.8125, 36.8125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_ivec2
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(2, 2) | ivec2(3, 3) | ivec2(0, 0) | ivec2(-8, -8) | ivec2(-20, -20) | ivec2(36, 36) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_ivec3
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(2, 2, 2) | ivec3(3, 3, 3) | ivec3(0, 0, 0) | ivec3(-8, -8, -8) | ivec3(-20, -20, -20) | ivec3(36, 36, 36) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_ivec4
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(2, 2, 2, 2) | ivec4(3, 3, 3, 3) | ivec4(0, 0, 0, 0) | ivec4(-8, -8, -8, -8) | ivec4(-20, -20, -20, -20) | ivec4(36, 36, 36, 36) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_bvec2
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_bvec3
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_bvec4
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_vec2
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(2.0, 2.0) | vec2(5.0, 5.0) | vec2(8.0, 8.0) | vec2(11.0, 11.0) | vec2(-12.0, -12.0) | vec2(-66.0, -66.0) | vec2(-192.0, -192.0) | vec2(255.0, 255.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_vec3
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(2.0, 2.0, 2.0) | vec3(5.0, 5.0, 5.0) | vec3(8.0, 8.0, 8.0) | vec3(11.0, 11.0, 11.0) | vec3(-12.0, -12.0, -12.0) | vec3(-66.0, -66.0, -66.0) | vec3(-192.0, -192.0, -192.0) | vec3(255.0, 255.0, 255.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_vec4
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(2.0, 2.0, 2.0, 2.0) | vec4(5.0, 5.0, 5.0, 5.0) | vec4(8.0, 8.0, 8.0, 8.0) | vec4(11.0, 11.0, 11.0, 11.0) | vec4(-12.0, -12.0, -12.0, -12.0) | vec4(-66.0, -66.0, -66.0, -66.0) | vec4(-192.0, -192.0, -192.0, -192.0) | vec4(255.0, 255.0, 255.0, 255.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_ivec2
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(2, 2) | ivec2(5, 5) | ivec2(8, 8) | ivec2(11, 11) | ivec2(-12, -12) | ivec2(-66, -66) | ivec2(-192, -192) | ivec2(255, 255) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_ivec3
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(2, 2, 2) | ivec3(5, 5, 5) | ivec3(8, 8, 8) | ivec3(11, 11, 11) | ivec3(-12, -12, -12) | ivec3(-66, -66, -66) | ivec3(-192, -192, -192) | ivec3(255, 255, 255) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_ivec4
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(2, 2, 2, 2) | ivec4(5, 5, 5, 5) | ivec4(8, 8, 8, 8) | ivec4(11, 11, 11, 11) | ivec4(-12, -12, -12, -12) | ivec4(-66, -66, -66, -66) | ivec4(-192, -192, -192, -192) | ivec4(255, 255, 255, 255) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_bvec2
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_bvec3
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_bvec4
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_vec2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(2.0, 2.0) | vec2(3.0, 3.0) | vec2(8.0, 8.0) | vec2(9.0, 9.0) | vec2(12.0, 12.0) | vec2(10.0, 10.0) | vec2(45.0, 45.0) | vec2(193.0, 193.0) | vec2(255.0, 255.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_vec3
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(2.0, 2.0, 2.0) | vec3(3.0, 3.0, 3.0) | vec3(8.0, 8.0, 8.0) | vec3(9.0, 9.0, 9.0) | vec3(12.0, 12.0, 12.0) | vec3(10.0, 10.0, 10.0) | vec3(45.0, 45.0, 45.0) | vec3(193.0, 193.0, 193.0) | vec3(255.0, 255.0, 255.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_vec4
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(2.0, 2.0, 2.0, 2.0) | vec4(3.0, 3.0, 3.0, 3.0) | vec4(8.0, 8.0, 8.0, 8.0) | vec4(9.0, 9.0, 9.0, 9.0) | vec4(12.0, 12.0, 12.0, 12.0) | vec4(10.0, 10.0, 10.0, 10.0) | vec4(45.0, 45.0, 45.0, 45.0) | vec4(193.0, 193.0, 193.0, 193.0) | vec4(255.0, 255.0, 255.0, 255.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_ivec2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(2, 2) | ivec2(3, 3) | ivec2(8, 8) | ivec2(9, 9) | ivec2(12, 12) | ivec2(10, 10) | ivec2(45, 45) | ivec2(193, 193) | ivec2(255, 255) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_ivec3
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(2, 2, 2) | ivec3(3, 3, 3) | ivec3(8, 8, 8) | ivec3(9, 9, 9) | ivec3(12, 12, 12) | ivec3(10, 10, 10) | ivec3(45, 45, 45) | ivec3(193, 193, 193) | ivec3(255, 255, 255) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_ivec4
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(2, 2, 2, 2) | ivec4(3, 3, 3, 3) | ivec4(8, 8, 8, 8) | ivec4(9, 9, 9, 9) | ivec4(12, 12, 12, 12) | ivec4(10, 10, 10, 10) | ivec4(45, 45, 45, 45) | ivec4(193, 193, 193, 193) | ivec4(255, 255, 255, 255) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_bvec2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_bvec3
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_bvec4
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_vec2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output vec2 out0 = [ vec2(1.0, 1.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_vec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output vec3 out0 = [ vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_vec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output vec4 out0 = [ vec4(1.0, 1.0, 1.0, 1.0) | vec4(0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_ivec2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output ivec2 out0 = [ ivec2(1, 1) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_ivec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output ivec3 out0 = [ ivec3(1, 1, 1) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_ivec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output ivec4 out0 = [ ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_bvec2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_bvec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_bvec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_uvec2
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | 0.5 | 8.25 | 20.125 | 36.8125 ];
+ output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(2, 2) | uvec2(3, 3) | uvec2(0, 0) | uvec2(8, 8) | uvec2(20, 20) | uvec2(36, 36) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_uvec3
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | 0.5 | 8.25 | 20.125 | 36.8125 ];
+ output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(2, 2, 2) | uvec3(3, 3, 3) | uvec3(0, 0, 0) | uvec3(8, 8, 8) | uvec3(20, 20, 20) | uvec3(36, 36, 36) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_uvec4
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | 0.5 | 8.25 | 20.125 | 36.8125 ];
+ output uvec4 out0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(2, 2, 2, 2) | uvec4(3, 3, 3, 3) | uvec4(0, 0, 0, 0) | uvec4(8, 8, 8, 8) | uvec4(20, 20, 20, 20) | uvec4(36, 36, 36, 36) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_uvec2
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | 12 | 66 | 192 | 255 ];
+ output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(2, 2) | uvec2(5, 5) | uvec2(8, 8) | uvec2(11, 11) | uvec2(12, 12) | uvec2(66, 66) | uvec2(192, 192) | uvec2(255, 255) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_uvec3
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | 12 | 66 | 192 | 255 ];
+ output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(2, 2, 2) | uvec3(5, 5, 5) | uvec3(8, 8, 8) | uvec3(11, 11, 11) | uvec3(12, 12, 12) | uvec3(66, 66, 66) | uvec3(192, 192, 192) | uvec3(255, 255, 255) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_uvec4
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | 12 | 66 | 192 | 255 ];
+ output uvec4 out0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(2, 2, 2, 2) | uvec4(5, 5, 5, 5) | uvec4(8, 8, 8, 8) | uvec4(11, 11, 11, 11) | uvec4(12, 12, 12, 12) | uvec4(66, 66, 66, 66) | uvec4(192, 192, 192, 192) | uvec4(255, 255, 255, 255) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_uvec2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output uvec2 out0 = [ uvec2(0, 0) | uvec2(2, 2) | uvec2(3, 3) | uvec2(8, 8) | uvec2(9, 9) | uvec2(12, 12) | uvec2(10, 10) | uvec2(45, 45) | uvec2(193, 193) | uvec2(255, 255) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_uvec3
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(2, 2, 2) | uvec3(3, 3, 3) | uvec3(8, 8, 8) | uvec3(9, 9, 9) | uvec3(12, 12, 12) | uvec3(10, 10, 10) | uvec3(45, 45, 45) | uvec3(193, 193, 193) | uvec3(255, 255, 255) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_uvec4
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output uvec4 out0 = [ uvec4(0, 0, 0, 0) | uvec4(2, 2, 2, 2) | uvec4(3, 3, 3, 3) | uvec4(8, 8, 8, 8) | uvec4(9, 9, 9, 9) | uvec4(12, 12, 12, 12) | uvec4(10, 10, 10, 10) | uvec4(45, 45, 45, 45) | uvec4(193, 193, 193, 193) | uvec4(255, 255, 255, 255) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_uvec2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output uvec2 out0 = [ uvec2(1, 1) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_uvec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output uvec3 out0 = [ uvec3(1, 1, 1) | uvec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_uvec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output uvec4 out0 = [ uvec4(1, 1, 1, 1) | uvec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # scalar_to_vector
+group vector_to_scalar "Vector to Scalar Conversions"
+
+ case vec2_to_float
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_int
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_bool
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output bool out0 = [ false | true | true | true | true ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_float
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_int
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_bool
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output bool out0 = [ false | true | true | true | true ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_float
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_int
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_bool
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output bool out0 = [ false | true | true | true | true ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_float
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output float out0 = [ 0.0 | 1.0 | 0.0 | -32.0 | 0.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_int
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_bool
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output bool out0 = [ false | true | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_float
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output float out0 = [ 0.0 | 1.0 | 0.0 | -32.0 | 0.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_int
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_bool
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output bool out0 = [ false | true | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_float
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output float out0 = [ 0.0 | 1.0 | 0.0 | -32.0 | 0.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_int
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_bool
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output bool out0 = [ false | true | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_float
+ version 300 es
+ values
+ {
+ input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ output float out0 = [ 0.0 | 1.0 | 0.0 | 32.0 | 0.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_int
+ version 300 es
+ values
+ {
+ input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | 32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_bool
+ version 300 es
+ values
+ {
+ input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ output bool out0 = [ false | true | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_float
+ version 300 es
+ values
+ {
+ input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ output float out0 = [ 0.0 | 1.0 | 0.0 | 32.0 | 0.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_int
+ version 300 es
+ values
+ {
+ input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | 32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_bool
+ version 300 es
+ values
+ {
+ input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ output bool out0 = [ false | true | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_float
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output float out0 = [ 0.0 | 1.0 | 0.0 | 32.0 | 0.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_int
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | 32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_bool
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output bool out0 = [ false | true | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_float
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output float out0 = [ 1.0 | 0.0 | 0.0 | 1.0 | 0.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_int
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output int out0 = [ 1 | 0 | 0 | 1 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_bool
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_float
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output float out0 = [ 1.0 | 0.0 | 0.0 | 1.0 | 0.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_int
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output int out0 = [ 1 | 0 | 0 | 1 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_bool
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_float
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output float out0 = [ 1.0 | 0.0 | 0.0 | 1.0 | 0.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_int
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output int out0 = [ 1 | 0 | 0 | 1 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_bool
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_uint
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(0.5, 2.25) | vec2(32.0, 64.0) | vec2(0.75, 0.0322580645161) ];
+ output uint out0 = [ 0 | 1 | 0 | 32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_uint
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(0.5, 2.25, 4.875) | vec3(32.0, 64.0, 51.0) | vec3(0.75, 0.0322580645161, 0.0526315789474) ];
+ output uint out0 = [ 0 | 1 | 0 | 32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_uint
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.5, 2.25, 4.875, 9.0) | vec4(32.0, 64.0, 51.0, 24.0) | vec4(0.75, 0.0322580645161, 0.0526315789474, 0.25) ];
+ output uint out0 = [ 0 | 1 | 0 | 32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_uint
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 2) | ivec2(32, 64) | ivec2(0, 0) ];
+ output uint out0 = [ 0 | 1 | 0 | 32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_uint
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 2, 4) | ivec3(32, 64, 51) | ivec3(0, 0, 0) ];
+ output uint out0 = [ 0 | 1 | 0 | 32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_uint
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 2, 4, 9) | ivec4(32, 64, 51, 24) | ivec4(0, 0, 0, 0) ];
+ output uint out0 = [ 0 | 1 | 0 | 32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_uint
+ version 300 es
+ values
+ {
+ input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ output uint out0 = [ 0 | 1 | 0 | 32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_uint
+ version 300 es
+ values
+ {
+ input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ output uint out0 = [ 0 | 1 | 0 | 32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_uint
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output uint out0 = [ 0 | 1 | 0 | 32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_uint
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output uint out0 = [ 1 | 0 | 0 | 1 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_uint
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output uint out0 = [ 1 | 0 | 0 | 1 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_uint
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output uint out0 = [ 1 | 0 | 0 | 1 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # vector_to_scalar
+group vector_illegal "Illegal Vector Conversions"
+
+ case vec2_to_vec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec2 in0 = vec2(0.0, 0.5);
+ vec3 out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_ivec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec2 in0 = vec2(0.0, 0.5);
+ ivec3 out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_uvec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec2 in0 = vec2(0.0, 0.5);
+ uvec3 out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_bvec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec2 in0 = vec2(0.0, 0.5);
+ bvec3 out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_vec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec2 in0 = vec2(0.0, 0.5);
+ vec4 out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_ivec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec2 in0 = vec2(0.0, 0.5);
+ ivec4 out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_uvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec2 in0 = vec2(0.0, 0.5);
+ uvec4 out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_bvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec2 in0 = vec2(0.0, 0.5);
+ bvec4 out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_vec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec2 in0 = ivec2(0, 0);
+ vec3 out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_ivec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec2 in0 = ivec2(0, 0);
+ ivec3 out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_uvec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec2 in0 = ivec2(0, 0);
+ uvec3 out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_bvec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec2 in0 = ivec2(0, 0);
+ bvec3 out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_vec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec2 in0 = ivec2(0, 0);
+ vec4 out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_ivec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec2 in0 = ivec2(0, 0);
+ ivec4 out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_uvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec2 in0 = ivec2(0, 0);
+ uvec4 out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_bvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec2 in0 = ivec2(0, 0);
+ bvec4 out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_vec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ uvec2 in0 = uvec2(0, 0);
+ vec3 out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_ivec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ uvec2 in0 = uvec2(0, 0);
+ ivec3 out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_uvec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ uvec2 in0 = uvec2(0, 0);
+ uvec3 out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_bvec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ uvec2 in0 = uvec2(0, 0);
+ bvec3 out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_vec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ uvec2 in0 = uvec2(0, 0);
+ vec4 out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_ivec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ uvec2 in0 = uvec2(0, 0);
+ ivec4 out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_uvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ uvec2 in0 = uvec2(0, 0);
+ uvec4 out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_bvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ uvec2 in0 = uvec2(0, 0);
+ bvec4 out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_vec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec2 in0 = bvec2(true, false);
+ vec3 out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_ivec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec2 in0 = bvec2(true, false);
+ ivec3 out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_uvec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec2 in0 = bvec2(true, false);
+ uvec3 out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_bvec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec2 in0 = bvec2(true, false);
+ bvec3 out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_vec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec2 in0 = bvec2(true, false);
+ vec4 out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_ivec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec2 in0 = bvec2(true, false);
+ ivec4 out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_uvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec2 in0 = bvec2(true, false);
+ uvec4 out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_bvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec2 in0 = bvec2(true, false);
+ bvec4 out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_vec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec3 in0 = vec3(0.0, 0.5, 0.75);
+ vec4 out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_ivec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec3 in0 = vec3(0.0, 0.5, 0.75);
+ ivec4 out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_uvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec3 in0 = vec3(0.0, 0.5, 0.75);
+ uvec4 out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_bvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec3 in0 = vec3(0.0, 0.5, 0.75);
+ bvec4 out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_vec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec3 in0 = ivec3(0, 0, 0);
+ vec4 out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_ivec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec3 in0 = ivec3(0, 0, 0);
+ ivec4 out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_uvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec3 in0 = ivec3(0, 0, 0);
+ uvec4 out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_bvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec3 in0 = ivec3(0, 0, 0);
+ bvec4 out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_vec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ uvec3 in0 = uvec3(0, 0, 0);
+ vec4 out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_ivec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ uvec3 in0 = uvec3(0, 0, 0);
+ ivec4 out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_uvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ uvec3 in0 = uvec3(0, 0, 0);
+ uvec4 out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_bvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ uvec3 in0 = uvec3(0, 0, 0);
+ bvec4 out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_vec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec3 in0 = bvec3(true, false, false);
+ vec4 out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_ivec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec3 in0 = bvec3(true, false, false);
+ ivec4 out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_uvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec3 in0 = bvec3(true, false, false);
+ uvec4 out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_bvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec3 in0 = bvec3(true, false, false);
+ bvec4 out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # vector_illegal
+group vector_to_vector "Vector to Vector Conversions"
+
+ case vec4_to_vec4
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_vec3
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_vec2
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_ivec4
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_ivec3
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_ivec2
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_bvec4
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output bvec4 out0 = [ bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_bvec3
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output bvec3 out0 = [ bvec3(false, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_bvec2
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output bvec2 out0 = [ bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_vec4
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(0.0, -2.0, -4.0, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_vec3
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, -2.0, -4.0) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_vec2
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, -2.0) | vec2(-32.0, 64.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_ivec4
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_ivec3
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_ivec2
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_bvec4
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_bvec3
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_bvec2
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_vec4
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(0.0, 2.0, 4.0, 9.0) | vec4(32.0, 64.0, 51.0, 24.0) | vec4(0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_vec3
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, 2.0, 4.0) | vec3(32.0, 64.0, 51.0) | vec3(0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_vec2
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, 2.0) | vec2(32.0, 64.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_ivec4
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 2, 4, 9) | ivec4(32, 64, 51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_ivec3
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 2, 4) | ivec3(32, 64, 51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_ivec2
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 2) | ivec2(32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_bvec4
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_bvec3
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_bvec2
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_vec4
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output vec4 out0 = [ vec4(1.0, 0.0, 0.0, 1.0) | vec4(0.0, 0.0, 0.0, 1.0) | vec4(0.0, 1.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_vec3
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output vec3 out0 = [ vec3(1.0, 0.0, 0.0) | vec3(0.0, 0.0, 0.0) | vec3(0.0, 1.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_vec2
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output vec2 out0 = [ vec2(1.0, 0.0) | vec2(0.0, 0.0) | vec2(0.0, 1.0) | vec2(1.0, 1.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_ivec4
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output ivec4 out0 = [ ivec4(1, 0, 0, 1) | ivec4(0, 0, 0, 1) | ivec4(0, 1, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_ivec3
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output ivec3 out0 = [ ivec3(1, 0, 0) | ivec3(0, 0, 0) | ivec3(0, 1, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_ivec2
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output ivec2 out0 = [ ivec2(1, 0) | ivec2(0, 0) | ivec2(0, 1) | ivec2(1, 1) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_bvec4
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_bvec3
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_bvec2
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_uvec4
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.5, 2.25, 4.875, 9.0) | vec4(32.0, 64.0, 51.0, 24.0) | vec4(0.75, 0.0322580645161, 0.0526315789474, 0.25) ];
+ output uvec4 out0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_uvec3
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.5, 2.25, 4.875, 9.0) | vec4(32.0, 64.0, 51.0, 24.0) | vec4(0.75, 0.0322580645161, 0.0526315789474, 0.25) ];
+ output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_uvec2
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.5, 2.25, 4.875, 9.0) | vec4(32.0, 64.0, 51.0, 24.0) | vec4(0.75, 0.0322580645161, 0.0526315789474, 0.25) ];
+ output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_uvec4
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 2, 4, 9) | ivec4(32, 64, 51, 24) | ivec4(0, 0, 0, 0) ];
+ output uvec4 out0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_uvec3
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 2, 4, 9) | ivec4(32, 64, 51, 24) | ivec4(0, 0, 0, 0) ];
+ output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_uvec2
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 2, 4, 9) | ivec4(32, 64, 51, 24) | ivec4(0, 0, 0, 0) ];
+ output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_uvec4
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output uvec4 out0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_uvec3
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_uvec2
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_uvec4
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output uvec4 out0 = [ uvec4(1, 0, 0, 1) | uvec4(0, 0, 0, 1) | uvec4(0, 1, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_uvec3
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output uvec3 out0 = [ uvec3(1, 0, 0) | uvec3(0, 0, 0) | uvec3(0, 1, 0) | uvec3(1, 1, 1) | uvec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_uvec2
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output uvec2 out0 = [ uvec2(1, 0) | uvec2(0, 0) | uvec2(0, 1) | uvec2(1, 1) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_vec3
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_vec2
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_ivec3
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_ivec2
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_bvec3
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output bvec3 out0 = [ bvec3(false, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_bvec2
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output bvec2 out0 = [ bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_vec3
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, -2.0, -4.0) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_vec2
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, -2.0) | vec2(-32.0, 64.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_ivec3
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_ivec2
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_bvec3
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_bvec2
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_vec3
+ version 300 es
+ values
+ {
+ input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, 2.0, 4.0) | vec3(32.0, 64.0, 51.0) | vec3(0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_vec2
+ version 300 es
+ values
+ {
+ input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, 2.0) | vec2(32.0, 64.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_ivec3
+ version 300 es
+ values
+ {
+ input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 2, 4) | ivec3(32, 64, 51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_ivec2
+ version 300 es
+ values
+ {
+ input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 2) | ivec2(32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_bvec3
+ version 300 es
+ values
+ {
+ input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_bvec2
+ version 300 es
+ values
+ {
+ input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_vec3
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output vec3 out0 = [ vec3(1.0, 0.0, 0.0) | vec3(0.0, 0.0, 0.0) | vec3(0.0, 1.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_vec2
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output vec2 out0 = [ vec2(1.0, 0.0) | vec2(0.0, 0.0) | vec2(0.0, 1.0) | vec2(1.0, 1.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_ivec3
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output ivec3 out0 = [ ivec3(1, 0, 0) | ivec3(0, 0, 0) | ivec3(0, 1, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_ivec2
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output ivec2 out0 = [ ivec2(1, 0) | ivec2(0, 0) | ivec2(0, 1) | ivec2(1, 1) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_bvec3
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_bvec2
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_uvec3
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(0.5, 2.25, 4.875) | vec3(32.0, 64.0, 51.0) | vec3(0.75, 0.0322580645161, 0.0526315789474) ];
+ output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_uvec2
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(0.5, 2.25, 4.875) | vec3(32.0, 64.0, 51.0) | vec3(0.75, 0.0322580645161, 0.0526315789474) ];
+ output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_uvec3
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 2, 4) | ivec3(32, 64, 51) | ivec3(0, 0, 0) ];
+ output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_uvec2
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 2, 4) | ivec3(32, 64, 51) | ivec3(0, 0, 0) ];
+ output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_uvec3
+ version 300 es
+ values
+ {
+ input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_uvec2
+ version 300 es
+ values
+ {
+ input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_uvec3
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output uvec3 out0 = [ uvec3(1, 0, 0) | uvec3(0, 0, 0) | uvec3(0, 1, 0) | uvec3(1, 1, 1) | uvec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_uvec2
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output uvec2 out0 = [ uvec2(1, 0) | uvec2(0, 0) | uvec2(0, 1) | uvec2(1, 1) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_vec2
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_ivec2
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_bvec2
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output bvec2 out0 = [ bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_vec2
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, -2.0) | vec2(-32.0, 64.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_ivec2
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_bvec2
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_vec2
+ version 300 es
+ values
+ {
+ input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, 2.0) | vec2(32.0, 64.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_ivec2
+ version 300 es
+ values
+ {
+ input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 2) | ivec2(32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_bvec2
+ version 300 es
+ values
+ {
+ input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_vec2
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output vec2 out0 = [ vec2(1.0, 0.0) | vec2(0.0, 0.0) | vec2(0.0, 1.0) | vec2(1.0, 1.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_ivec2
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output ivec2 out0 = [ ivec2(1, 0) | ivec2(0, 0) | ivec2(0, 1) | ivec2(1, 1) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_bvec2
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_uvec2
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(0.5, 2.25) | vec2(32.0, 64.0) | vec2(0.75, 0.0322580645161) ];
+ output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_uvec2
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 2) | ivec2(32, 64) | ivec2(0, 0) ];
+ output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_uvec2
+ version 300 es
+ values
+ {
+ input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_uvec2
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output uvec2 out0 = [ uvec2(1, 0) | uvec2(0, 0) | uvec2(0, 1) | uvec2(1, 1) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # vector_to_vector
+group scalar_to_matrix "Scalar to Matrix Conversions"
+
+ case float_to_mat4
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output mat4 out0 = [ mat4(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.0, 0.0, 0.0, 0.0) | mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0) | mat4(3.5, 0.0, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 0.0, 3.5) | mat4(-0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0, -0.5) | mat4(-8.25, 0.0, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, 0.0, -8.25) | mat4(-20.125, 0.0, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, 0.0, -20.125) | mat4(36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_mat4x3
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output mat4x3 out0 = [ mat4x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0) | mat4x3(3.5, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0) | mat4x3(-0.5, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0) | mat4x3(-8.25, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0) | mat4x3(-20.125, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0) | mat4x3(36.8125, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_mat4x2
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output mat4x2 out0 = [ mat4x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(2.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(3.5, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 0.0) | mat4x2(-0.5, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0) | mat4x2(-8.25, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, 0.0) | mat4x2(-20.125, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, 0.0) | mat4x2(36.8125, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_mat3x4
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output mat3x4 out0 = [ mat3x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0) | mat3x4(3.5, 0.0, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 0.0, 3.5, 0.0) | mat3x4(-0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0) | mat3x4(-8.25, 0.0, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, 0.0, -8.25, 0.0) | mat3x4(-20.125, 0.0, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, 0.0, -20.125, 0.0) | mat3x4(36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_mat3
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output mat3 out0 = [ mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0) | mat3(3.5, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 3.5) | mat3(-0.5, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, -0.5) | mat3(-8.25, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, -8.25) | mat3(-20.125, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, -20.125) | mat3(36.8125, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 36.8125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_mat3x2
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output mat3x2 out0 = [ mat3x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(2.0, 0.0, 0.0, 2.0, 0.0, 0.0) | mat3x2(3.5, 0.0, 0.0, 3.5, 0.0, 0.0) | mat3x2(-0.5, 0.0, 0.0, -0.5, 0.0, 0.0) | mat3x2(-8.25, 0.0, 0.0, -8.25, 0.0, 0.0) | mat3x2(-20.125, 0.0, 0.0, -20.125, 0.0, 0.0) | mat3x2(36.8125, 0.0, 0.0, 36.8125, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_mat2x4
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output mat2x4 out0 = [ mat2x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0) | mat2x4(3.5, 0.0, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0) | mat2x4(-0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0) | mat2x4(-8.25, 0.0, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0) | mat2x4(-20.125, 0.0, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0) | mat2x4(36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_mat2x3
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output mat2x3 out0 = [ mat2x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0) | mat2x3(3.5, 0.0, 0.0, 0.0, 3.5, 0.0) | mat2x3(-0.5, 0.0, 0.0, 0.0, -0.5, 0.0) | mat2x3(-8.25, 0.0, 0.0, 0.0, -8.25, 0.0) | mat2x3(-20.125, 0.0, 0.0, 0.0, -20.125, 0.0) | mat2x3(36.8125, 0.0, 0.0, 0.0, 36.8125, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_mat2
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output mat2 out0 = [ mat2(0.0, 0.0, 0.0, 0.0) | mat2(1.0, 0.0, 0.0, 1.0) | mat2(2.0, 0.0, 0.0, 2.0) | mat2(3.5, 0.0, 0.0, 3.5) | mat2(-0.5, 0.0, 0.0, -0.5) | mat2(-8.25, 0.0, 0.0, -8.25) | mat2(-20.125, 0.0, 0.0, -20.125) | mat2(36.8125, 0.0, 0.0, 36.8125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_mat4
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output mat4 out0 = [ mat4(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.0, 0.0, 0.0, 0.0) | mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0) | mat4(5.0, 0.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 5.0) | mat4(8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 8.0) | mat4(11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0, 11.0) | mat4(-12.0, 0.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, 0.0, -12.0) | mat4(-66.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, 0.0, -66.0) | mat4(-192.0, 0.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, 0.0, -192.0) | mat4(255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0, 255.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_mat4x3
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output mat4x3 out0 = [ mat4x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0) | mat4x3(5.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0) | mat4x3(8.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0) | mat4x3(11.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0) | mat4x3(-12.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0) | mat4x3(-66.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0) | mat4x3(-192.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0) | mat4x3(255.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_mat4x2
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output mat4x2 out0 = [ mat4x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(2.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(5.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(8.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(11.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(-12.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(-66.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(-192.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(255.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_mat3x4
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output mat3x4 out0 = [ mat3x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0) | mat3x4(5.0, 0.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 5.0, 0.0) | mat3x4(8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0) | mat3x4(11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0) | mat3x4(-12.0, 0.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, 0.0, -12.0, 0.0) | mat3x4(-66.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0) | mat3x4(-192.0, 0.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, 0.0, -192.0, 0.0) | mat3x4(255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_mat3
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output mat3 out0 = [ mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0) | mat3(5.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 5.0) | mat3(8.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 8.0) | mat3(11.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 11.0) | mat3(-12.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, -12.0) | mat3(-66.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, -66.0) | mat3(-192.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, -192.0) | mat3(255.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 255.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_mat3x2
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output mat3x2 out0 = [ mat3x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(2.0, 0.0, 0.0, 2.0, 0.0, 0.0) | mat3x2(5.0, 0.0, 0.0, 5.0, 0.0, 0.0) | mat3x2(8.0, 0.0, 0.0, 8.0, 0.0, 0.0) | mat3x2(11.0, 0.0, 0.0, 11.0, 0.0, 0.0) | mat3x2(-12.0, 0.0, 0.0, -12.0, 0.0, 0.0) | mat3x2(-66.0, 0.0, 0.0, -66.0, 0.0, 0.0) | mat3x2(-192.0, 0.0, 0.0, -192.0, 0.0, 0.0) | mat3x2(255.0, 0.0, 0.0, 255.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_mat2x4
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output mat2x4 out0 = [ mat2x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0) | mat2x4(5.0, 0.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0) | mat2x4(8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0) | mat2x4(11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0) | mat2x4(-12.0, 0.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0) | mat2x4(-66.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0) | mat2x4(-192.0, 0.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0) | mat2x4(255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_mat2x3
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output mat2x3 out0 = [ mat2x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0) | mat2x3(5.0, 0.0, 0.0, 0.0, 5.0, 0.0) | mat2x3(8.0, 0.0, 0.0, 0.0, 8.0, 0.0) | mat2x3(11.0, 0.0, 0.0, 0.0, 11.0, 0.0) | mat2x3(-12.0, 0.0, 0.0, 0.0, -12.0, 0.0) | mat2x3(-66.0, 0.0, 0.0, 0.0, -66.0, 0.0) | mat2x3(-192.0, 0.0, 0.0, 0.0, -192.0, 0.0) | mat2x3(255.0, 0.0, 0.0, 0.0, 255.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_mat2
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output mat2 out0 = [ mat2(0.0, 0.0, 0.0, 0.0) | mat2(1.0, 0.0, 0.0, 1.0) | mat2(2.0, 0.0, 0.0, 2.0) | mat2(5.0, 0.0, 0.0, 5.0) | mat2(8.0, 0.0, 0.0, 8.0) | mat2(11.0, 0.0, 0.0, 11.0) | mat2(-12.0, 0.0, 0.0, -12.0) | mat2(-66.0, 0.0, 0.0, -66.0) | mat2(-192.0, 0.0, 0.0, -192.0) | mat2(255.0, 0.0, 0.0, 255.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_mat4
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output mat4 out0 = [ mat4(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.0, 0.0, 0.0, 0.0) | mat4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0) | mat4(3.0, 0.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 0.0, 3.0) | mat4(8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 8.0) | mat4(9.0, 0.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 0.0, 9.0) | mat4(12.0, 0.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0, 0.0, 12.0) | mat4(10.0, 0.0, 0.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 0.0, 10.0) | mat4(45.0, 0.0, 0.0, 0.0, 0.0, 45.0, 0.0, 0.0, 0.0, 0.0, 45.0, 0.0, 0.0, 0.0, 0.0, 45.0) | mat4(193.0, 0.0, 0.0, 0.0, 0.0, 193.0, 0.0, 0.0, 0.0, 0.0, 193.0, 0.0, 0.0, 0.0, 0.0, 193.0) | mat4(255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0, 255.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_mat4x3
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output mat4x3 out0 = [ mat4x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4x3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0) | mat4x3(3.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0) | mat4x3(8.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0) | mat4x3(9.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0) | mat4x3(12.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0) | mat4x3(10.0, 0.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0) | mat4x3(45.0, 0.0, 0.0, 0.0, 45.0, 0.0, 0.0, 0.0, 45.0, 0.0, 0.0, 0.0) | mat4x3(193.0, 0.0, 0.0, 0.0, 193.0, 0.0, 0.0, 0.0, 193.0, 0.0, 0.0, 0.0) | mat4x3(255.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_mat4x2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output mat4x2 out0 = [ mat4x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(2.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(3.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(8.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(9.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(12.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(10.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(45.0, 0.0, 0.0, 45.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(193.0, 0.0, 0.0, 193.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(255.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_mat3x4
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output mat3x4 out0 = [ mat3x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0) | mat3x4(3.0, 0.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 0.0, 3.0, 0.0) | mat3x4(8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0) | mat3x4(9.0, 0.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 0.0, 9.0, 0.0) | mat3x4(12.0, 0.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0, 0.0, 12.0, 0.0) | mat3x4(10.0, 0.0, 0.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 0.0, 10.0, 0.0) | mat3x4(45.0, 0.0, 0.0, 0.0, 0.0, 45.0, 0.0, 0.0, 0.0, 0.0, 45.0, 0.0) | mat3x4(193.0, 0.0, 0.0, 0.0, 0.0, 193.0, 0.0, 0.0, 0.0, 0.0, 193.0, 0.0) | mat3x4(255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_mat3
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output mat3 out0 = [ mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0) | mat3(3.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 3.0) | mat3(8.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 8.0) | mat3(9.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 9.0) | mat3(12.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0, 12.0) | mat3(10.0, 0.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 10.0) | mat3(45.0, 0.0, 0.0, 0.0, 45.0, 0.0, 0.0, 0.0, 45.0) | mat3(193.0, 0.0, 0.0, 0.0, 193.0, 0.0, 0.0, 0.0, 193.0) | mat3(255.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 255.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_mat3x2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output mat3x2 out0 = [ mat3x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(2.0, 0.0, 0.0, 2.0, 0.0, 0.0) | mat3x2(3.0, 0.0, 0.0, 3.0, 0.0, 0.0) | mat3x2(8.0, 0.0, 0.0, 8.0, 0.0, 0.0) | mat3x2(9.0, 0.0, 0.0, 9.0, 0.0, 0.0) | mat3x2(12.0, 0.0, 0.0, 12.0, 0.0, 0.0) | mat3x2(10.0, 0.0, 0.0, 10.0, 0.0, 0.0) | mat3x2(45.0, 0.0, 0.0, 45.0, 0.0, 0.0) | mat3x2(193.0, 0.0, 0.0, 193.0, 0.0, 0.0) | mat3x2(255.0, 0.0, 0.0, 255.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_mat2x4
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output mat2x4 out0 = [ mat2x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0) | mat2x4(3.0, 0.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0) | mat2x4(8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0) | mat2x4(9.0, 0.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0) | mat2x4(12.0, 0.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0) | mat2x4(10.0, 0.0, 0.0, 0.0, 0.0, 10.0, 0.0, 0.0) | mat2x4(45.0, 0.0, 0.0, 0.0, 0.0, 45.0, 0.0, 0.0) | mat2x4(193.0, 0.0, 0.0, 0.0, 0.0, 193.0, 0.0, 0.0) | mat2x4(255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_mat2x3
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output mat2x3 out0 = [ mat2x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0) | mat2x3(3.0, 0.0, 0.0, 0.0, 3.0, 0.0) | mat2x3(8.0, 0.0, 0.0, 0.0, 8.0, 0.0) | mat2x3(9.0, 0.0, 0.0, 0.0, 9.0, 0.0) | mat2x3(12.0, 0.0, 0.0, 0.0, 12.0, 0.0) | mat2x3(10.0, 0.0, 0.0, 0.0, 10.0, 0.0) | mat2x3(45.0, 0.0, 0.0, 0.0, 45.0, 0.0) | mat2x3(193.0, 0.0, 0.0, 0.0, 193.0, 0.0) | mat2x3(255.0, 0.0, 0.0, 0.0, 255.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_mat2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output mat2 out0 = [ mat2(0.0, 0.0, 0.0, 0.0) | mat2(2.0, 0.0, 0.0, 2.0) | mat2(3.0, 0.0, 0.0, 3.0) | mat2(8.0, 0.0, 0.0, 8.0) | mat2(9.0, 0.0, 0.0, 9.0) | mat2(12.0, 0.0, 0.0, 12.0) | mat2(10.0, 0.0, 0.0, 10.0) | mat2(45.0, 0.0, 0.0, 45.0) | mat2(193.0, 0.0, 0.0, 193.0) | mat2(255.0, 0.0, 0.0, 255.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_mat4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(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.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_mat4x3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_mat4x2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_mat3x4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_mat3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_mat3x2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_mat2x4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_mat2x3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_mat2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # scalar_to_matrix
+group matrix_to_matrix "Matrix to Matrix Conversions"
+
+ case mat4_to_mat4
+ version 300 es
+ values
+ {
+ input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ];
+ output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4_to_mat4x3
+ version 300 es
+ values
+ {
+ input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ];
+ output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4_to_mat4x2
+ version 300 es
+ values
+ {
+ input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ];
+ output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4_to_mat3x4
+ version 300 es
+ values
+ {
+ input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ];
+ output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4_to_mat3
+ version 300 es
+ values
+ {
+ input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4_to_mat3x2
+ version 300 es
+ values
+ {
+ input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ];
+ output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4_to_mat2x4
+ version 300 es
+ values
+ {
+ input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ];
+ output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4_to_mat2x3
+ version 300 es
+ values
+ {
+ input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ];
+ output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4_to_mat2
+ version 300 es
+ values
+ {
+ input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x3_to_mat4
+ version 300 es
+ values
+ {
+ input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ];
+ output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0, -0.75, -8.425, 0.03125, 0.0, 9.975, -6.542, 0.015625, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x3_to_mat4x3
+ version 300 es
+ values
+ {
+ input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ];
+ output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x3_to_mat4x2
+ version 300 es
+ values
+ {
+ input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ];
+ output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x3_to_mat3x4
+ version 300 es
+ values
+ {
+ input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ];
+ output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0, -0.75, -8.425, 0.03125, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x3_to_mat3
+ version 300 es
+ values
+ {
+ input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x3_to_mat3x2
+ version 300 es
+ values
+ {
+ input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ];
+ output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x3_to_mat2x4
+ version 300 es
+ values
+ {
+ input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ];
+ output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x3_to_mat2x3
+ version 300 es
+ values
+ {
+ input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ];
+ output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x3_to_mat2
+ version 300 es
+ values
+ {
+ input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x2_to_mat4
+ version 300 es
+ values
+ {
+ input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ];
+ output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.0, 0.0, 12.5, 0.0208333333333, 0.0, 0.0, -0.75, -8.425, 1.0, 0.0, 9.975, -6.542, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x2_to_mat4x3
+ version 300 es
+ values
+ {
+ input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ];
+ output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.0, 12.5, 0.0208333333333, 0.0, -0.75, -8.425, 1.0, 9.975, -6.542, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x2_to_mat4x2
+ version 300 es
+ values
+ {
+ input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ];
+ output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x2_to_mat3x4
+ version 300 es
+ values
+ {
+ input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ];
+ output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.0, 0.0, 12.5, 0.0208333333333, 0.0, 0.0, -0.75, -8.425, 1.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x2_to_mat3
+ version 300 es
+ values
+ {
+ input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.0, 12.5, 0.0208333333333, 0.0, -0.75, -8.425, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x2_to_mat3x2
+ version 300 es
+ values
+ {
+ input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ];
+ output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x2_to_mat2x4
+ version 300 es
+ values
+ {
+ input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ];
+ output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.0, 0.0, 12.5, 0.0208333333333, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x2_to_mat2x3
+ version 300 es
+ values
+ {
+ input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ];
+ output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.0, 12.5, 0.0208333333333, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x2_to_mat2
+ version 300 es
+ values
+ {
+ input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x4_to_mat4
+ version 300 es
+ values
+ {
+ input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ];
+ output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 0.0, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x4_to_mat4x3
+ version 300 es
+ values
+ {
+ input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ];
+ output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x4_to_mat4x2
+ version 300 es
+ values
+ {
+ input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ];
+ output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x4_to_mat3x4
+ version 300 es
+ values
+ {
+ input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ];
+ output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x4_to_mat3
+ version 300 es
+ values
+ {
+ input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x4_to_mat3x2
+ version 300 es
+ values
+ {
+ input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ];
+ output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x4_to_mat2x4
+ version 300 es
+ values
+ {
+ input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ];
+ output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x4_to_mat2x3
+ version 300 es
+ values
+ {
+ input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ];
+ output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x4_to_mat2
+ version 300 es
+ values
+ {
+ input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3_to_mat4
+ version 300 es
+ values
+ {
+ input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ];
+ output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0, -0.75, -8.425, 0.03125, 0.0, 0.0, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3_to_mat4x3
+ version 300 es
+ values
+ {
+ input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ];
+ output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3_to_mat4x2
+ version 300 es
+ values
+ {
+ input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ];
+ output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3_to_mat3x4
+ version 300 es
+ values
+ {
+ input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ];
+ output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0, -0.75, -8.425, 0.03125, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3_to_mat3
+ version 300 es
+ values
+ {
+ input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3_to_mat3x2
+ version 300 es
+ values
+ {
+ input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ];
+ output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3_to_mat2x4
+ version 300 es
+ values
+ {
+ input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ];
+ output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3_to_mat2x3
+ version 300 es
+ values
+ {
+ input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ];
+ output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3_to_mat2
+ version 300 es
+ values
+ {
+ input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x2_to_mat4
+ version 300 es
+ values
+ {
+ input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.0, 0.0, 12.5, 0.0208333333333, 0.0, 0.0, -0.75, -8.425, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x2_to_mat4x3
+ version 300 es
+ values
+ {
+ input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.0, 12.5, 0.0208333333333, 0.0, -0.75, -8.425, 1.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x2_to_mat4x2
+ version 300 es
+ values
+ {
+ input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x2_to_mat3x4
+ version 300 es
+ values
+ {
+ input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.0, 0.0, 12.5, 0.0208333333333, 0.0, 0.0, -0.75, -8.425, 1.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x2_to_mat3
+ version 300 es
+ values
+ {
+ input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.0, 12.5, 0.0208333333333, 0.0, -0.75, -8.425, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x2_to_mat3x2
+ version 300 es
+ values
+ {
+ input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x2_to_mat2x4
+ version 300 es
+ values
+ {
+ input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.0, 0.0, 12.5, 0.0208333333333, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x2_to_mat2x3
+ version 300 es
+ values
+ {
+ input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.0, 12.5, 0.0208333333333, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x2_to_mat2
+ version 300 es
+ values
+ {
+ input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x4_to_mat4
+ version 300 es
+ values
+ {
+ input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ];
+ output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x4_to_mat4x3
+ version 300 es
+ values
+ {
+ input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ];
+ output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x4_to_mat4x2
+ version 300 es
+ values
+ {
+ input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ];
+ output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x4_to_mat3x4
+ version 300 es
+ values
+ {
+ input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ];
+ output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, 0.0, 0.0, 1.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x4_to_mat3
+ version 300 es
+ values
+ {
+ input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x4_to_mat3x2
+ version 300 es
+ values
+ {
+ input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ];
+ output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x4_to_mat2x4
+ version 300 es
+ values
+ {
+ input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ];
+ output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x4_to_mat2x3
+ version 300 es
+ values
+ {
+ input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ];
+ output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x4_to_mat2
+ version 300 es
+ values
+ {
+ input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x3_to_mat4
+ version 300 es
+ values
+ {
+ input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x3_to_mat4x3
+ version 300 es
+ values
+ {
+ input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x3_to_mat4x2
+ version 300 es
+ values
+ {
+ input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x3_to_mat3x4
+ version 300 es
+ values
+ {
+ input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0, 0.0, 0.0, 1.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x3_to_mat3
+ version 300 es
+ values
+ {
+ input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x3_to_mat3x2
+ version 300 es
+ values
+ {
+ input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x3_to_mat2x4
+ version 300 es
+ values
+ {
+ input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x3_to_mat2x3
+ version 300 es
+ values
+ {
+ input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x3_to_mat2
+ version 300 es
+ values
+ {
+ input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2_to_mat4
+ version 300 es
+ values
+ {
+ input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ];
+ output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(8.0, -24.0, 0.0, 0.0, 16.0, -16.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(0.125, 0.03125, 0.0, 0.0, 0.0625, 0.015625, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(-18.725, -0.0125, 0.0, 0.0, -0.5, 19.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2_to_mat4x3
+ version 300 es
+ values
+ {
+ input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ];
+ output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(8.0, -24.0, 0.0, 16.0, -16.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(0.125, 0.03125, 0.0, 0.0625, 0.015625, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(-18.725, -0.0125, 0.0, -0.5, 19.975, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2_to_mat4x2
+ version 300 es
+ values
+ {
+ input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ];
+ output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, -0.75, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, -0.75, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0) | mat4x2(8.0, -24.0, 16.0, -16.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(0.125, 0.03125, 0.0625, 0.015625, 0.0, 0.0, 0.0, 0.0) | mat4x2(-18.725, -0.0125, -0.5, 19.975, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2_to_mat3x4
+ version 300 es
+ values
+ {
+ input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ];
+ output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(8.0, -24.0, 0.0, 0.0, 16.0, -16.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(0.125, 0.03125, 0.0, 0.0, 0.0625, 0.015625, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(-18.725, -0.0125, 0.0, 0.0, -0.5, 19.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2_to_mat3
+ version 300 es
+ values
+ {
+ input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 1.0) | mat3(8.0, -24.0, 0.0, 16.0, -16.0, 0.0, 0.0, 0.0, 1.0) | mat3(0.125, 0.03125, 0.0, 0.0625, 0.015625, 0.0, 0.0, 0.0, 1.0) | mat3(-18.725, -0.0125, 0.0, -0.5, 19.975, 0.0, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2_to_mat3x2
+ version 300 es
+ values
+ {
+ input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ];
+ output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, -0.75, 12.5, 9.975, 0.0, 0.0) | mat3x2(6.5, -0.75, 12.5, 9.975, 0.0, 0.0) | mat3x2(8.0, -24.0, 16.0, -16.0, 0.0, 0.0) | mat3x2(0.125, 0.03125, 0.0625, 0.015625, 0.0, 0.0) | mat3x2(-18.725, -0.0125, -0.5, 19.975, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2_to_mat2x4
+ version 300 es
+ values
+ {
+ input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ];
+ output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0) | mat2x4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0) | mat2x4(8.0, -24.0, 0.0, 0.0, 16.0, -16.0, 0.0, 0.0) | mat2x4(0.125, 0.03125, 0.0, 0.0, 0.0625, 0.015625, 0.0, 0.0) | mat2x4(-18.725, -0.0125, 0.0, 0.0, -0.5, 19.975, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2_to_mat2x3
+ version 300 es
+ values
+ {
+ input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ];
+ output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0) | mat2x3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0) | mat2x3(8.0, -24.0, 0.0, 16.0, -16.0, 0.0) | mat2x3(0.125, 0.03125, 0.0, 0.0625, 0.015625, 0.0) | mat2x3(-18.725, -0.0125, 0.0, -0.5, 19.975, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2_to_mat2
+ version 300 es
+ values
+ {
+ input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # matrix_to_matrix
+group vector_combine "Vector Combine Constructors"
+
+ case vec2_vec2_to_vec4
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) ];
+ input vec2 in1 = [ vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) ];
+ output vec4 out0 = [ vec4(-0.5, -2.25, -32.0, 64.0) | vec4(-32.0, 64.0, 1.0, 1.25) | vec4(1.0, 1.25, 0.0, 0.5) | vec4(0.0, 0.5, -0.5, -2.25) | vec4(-0.75, -0.0322580645161, -0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_vec2_to_ivec4
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) ];
+ input vec2 in1 = [ vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) ];
+ output ivec4 out0 = [ ivec4(0, -2, -32, 64) | ivec4(-32, 64, 1, 1) | ivec4(1, 1, 0, 0) | ivec4(0, 0, 0, -2) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_vec2_to_bvec4
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) ];
+ input vec2 in1 = [ vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, false, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_bvec2_to_vec4
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ];
+ input bvec2 in1 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 1.0, 0.0) | vec4(1.0, 0.0, 0.0, 0.0) | vec4(0.0, 1.0, 0.0, 1.0) | vec4(0.0, 0.0, 1.0, 1.0) | vec4(1.0, 1.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_bvec2_to_ivec4
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ];
+ input bvec2 in1 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output ivec4 out0 = [ ivec4(0, 0, 1, 0) | ivec4(1, 0, 0, 0) | ivec4(0, 1, 0, 1) | ivec4(0, 0, 1, 1) | ivec4(1, 1, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_bvec2_to_bvec4
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ];
+ input bvec2 in1 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(true, false, false, false) | bvec4(false, true, false, true) | bvec4(false, false, true, true) | bvec4(true, true, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_float_to_vec4
+ version 300 es
+ values
+ {
+ input float in0 = [ 1.0 | 0.0 | -0.5 | -8.25 | 3.5 | -20.125 | 36.8125 | 2.0 ];
+ input float in1 = [ 0.0 | 36.8125 | -8.25 | 2.0 | 3.5 | 1.0 | -20.125 | -0.5 ];
+ input float in2 = [ 3.5 | 36.8125 | -8.25 | 1.0 | 2.0 | 0.0 | -20.125 | -0.5 ];
+ input float in3 = [ 3.5 | 36.8125 | 1.0 | -8.25 | 2.0 | 0.0 | -0.5 | -20.125 ];
+ output vec4 out0 = [ vec4(1.0, 0.0, 3.5, 3.5) | vec4(0.0, 36.8125, 36.8125, 36.8125) | vec4(-0.5, -8.25, -8.25, 1.0) | vec4(-8.25, 2.0, 1.0, -8.25) | vec4(3.5, 3.5, 2.0, 2.0) | vec4(-20.125, 1.0, 0.0, 0.0) | vec4(36.8125, -20.125, -20.125, -0.5) | vec4(2.0, -0.5, -0.5, -20.125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_float_to_ivec4
+ version 300 es
+ values
+ {
+ input float in0 = [ 1.0 | 0.0 | -0.5 | -8.25 | 3.5 | -20.125 | 36.8125 | 2.0 ];
+ input float in1 = [ 0.0 | 36.8125 | -8.25 | 2.0 | 3.5 | 1.0 | -20.125 | -0.5 ];
+ input float in2 = [ 3.5 | 36.8125 | -8.25 | 1.0 | 2.0 | 0.0 | -20.125 | -0.5 ];
+ input float in3 = [ 3.5 | 36.8125 | 1.0 | -8.25 | 2.0 | 0.0 | -0.5 | -20.125 ];
+ output ivec4 out0 = [ ivec4(1, 0, 3, 3) | ivec4(0, 36, 36, 36) | ivec4(0, -8, -8, 1) | ivec4(-8, 2, 1, -8) | ivec4(3, 3, 2, 2) | ivec4(-20, 1, 0, 0) | ivec4(36, -20, -20, 0) | ivec4(2, 0, 0, -20) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_float_to_bvec4
+ version 300 es
+ values
+ {
+ input float in0 = [ 1.0 | 0.0 | -0.5 | -8.25 | 3.5 | -20.125 | 36.8125 | 2.0 ];
+ input float in1 = [ 0.0 | 36.8125 | -8.25 | 2.0 | 3.5 | 1.0 | -20.125 | -0.5 ];
+ input float in2 = [ 3.5 | 36.8125 | -8.25 | 1.0 | 2.0 | 0.0 | -20.125 | -0.5 ];
+ input float in3 = [ 3.5 | 36.8125 | 1.0 | -8.25 | 2.0 | 0.0 | -0.5 | -20.125 ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_int_to_vec4
+ version 300 es
+ values
+ {
+ input int in0 = [ -12 | -66 | 2 | 5 | 8 | -192 | 255 | 1 | 0 | 11 ];
+ input int in1 = [ 2 | 5 | -66 | 11 | -192 | 8 | -12 | 1 | 255 | 0 ];
+ input int in2 = [ 11 | 255 | 5 | 8 | 2 | -192 | -12 | -66 | 1 | 0 ];
+ input int in3 = [ -192 | -66 | 8 | -12 | 1 | 2 | 0 | 255 | 5 | 11 ];
+ output vec4 out0 = [ vec4(-12.0, 2.0, 11.0, -192.0) | vec4(-66.0, 5.0, 255.0, -66.0) | vec4(2.0, -66.0, 5.0, 8.0) | vec4(5.0, 11.0, 8.0, -12.0) | vec4(8.0, -192.0, 2.0, 1.0) | vec4(-192.0, 8.0, -192.0, 2.0) | vec4(255.0, -12.0, -12.0, 0.0) | vec4(1.0, 1.0, -66.0, 255.0) | vec4(0.0, 255.0, 1.0, 5.0) | vec4(11.0, 0.0, 0.0, 11.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_int_to_ivec4
+ version 300 es
+ values
+ {
+ input int in0 = [ -12 | -66 | 2 | 5 | 8 | -192 | 255 | 1 | 0 | 11 ];
+ input int in1 = [ 2 | 5 | -66 | 11 | -192 | 8 | -12 | 1 | 255 | 0 ];
+ input int in2 = [ 11 | 255 | 5 | 8 | 2 | -192 | -12 | -66 | 1 | 0 ];
+ input int in3 = [ -192 | -66 | 8 | -12 | 1 | 2 | 0 | 255 | 5 | 11 ];
+ output ivec4 out0 = [ ivec4(-12, 2, 11, -192) | ivec4(-66, 5, 255, -66) | ivec4(2, -66, 5, 8) | ivec4(5, 11, 8, -12) | ivec4(8, -192, 2, 1) | ivec4(-192, 8, -192, 2) | ivec4(255, -12, -12, 0) | ivec4(1, 1, -66, 255) | ivec4(0, 255, 1, 5) | ivec4(11, 0, 0, 11) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_int_to_bvec4
+ version 300 es
+ values
+ {
+ input int in0 = [ -12 | -66 | 2 | 5 | 8 | -192 | 255 | 1 | 0 | 11 ];
+ input int in1 = [ 2 | 5 | -66 | 11 | -192 | 8 | -12 | 1 | 255 | 0 ];
+ input int in2 = [ 11 | 255 | 5 | 8 | 2 | -192 | -12 | -66 | 1 | 0 ];
+ input int in3 = [ -192 | -66 | 8 | -12 | 1 | 2 | 0 | 255 | 5 | 11 ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, false) | bvec4(true, true, true, true) | bvec4(false, true, true, true) | bvec4(true, false, false, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uint_uint_uint_to_vec4
+ version 300 es
+ values
+ {
+ input uint in0 = [ 193 | 3 | 255 | 8 | 10 | 9 | 2 | 12 | 0 | 45 ];
+ input uint in1 = [ 12 | 45 | 193 | 2 | 8 | 255 | 0 | 3 | 9 | 10 ];
+ input uint in2 = [ 9 | 8 | 12 | 2 | 255 | 45 | 3 | 0 | 193 | 10 ];
+ input uint in3 = [ 3 | 9 | 12 | 2 | 255 | 193 | 0 | 10 | 45 | 8 ];
+ output vec4 out0 = [ vec4(193.0, 12.0, 9.0, 3.0) | vec4(3.0, 45.0, 8.0, 9.0) | vec4(255.0, 193.0, 12.0, 12.0) | vec4(8.0, 2.0, 2.0, 2.0) | vec4(10.0, 8.0, 255.0, 255.0) | vec4(9.0, 255.0, 45.0, 193.0) | vec4(2.0, 0.0, 3.0, 0.0) | vec4(12.0, 3.0, 0.0, 10.0) | vec4(0.0, 9.0, 193.0, 45.0) | vec4(45.0, 10.0, 10.0, 8.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uint_uint_uint_to_ivec4
+ version 300 es
+ values
+ {
+ input uint in0 = [ 193 | 3 | 255 | 8 | 10 | 9 | 2 | 12 | 0 | 45 ];
+ input uint in1 = [ 12 | 45 | 193 | 2 | 8 | 255 | 0 | 3 | 9 | 10 ];
+ input uint in2 = [ 9 | 8 | 12 | 2 | 255 | 45 | 3 | 0 | 193 | 10 ];
+ input uint in3 = [ 3 | 9 | 12 | 2 | 255 | 193 | 0 | 10 | 45 | 8 ];
+ output ivec4 out0 = [ ivec4(193, 12, 9, 3) | ivec4(3, 45, 8, 9) | ivec4(255, 193, 12, 12) | ivec4(8, 2, 2, 2) | ivec4(10, 8, 255, 255) | ivec4(9, 255, 45, 193) | ivec4(2, 0, 3, 0) | ivec4(12, 3, 0, 10) | ivec4(0, 9, 193, 45) | ivec4(45, 10, 10, 8) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uint_uint_uint_to_bvec4
+ version 300 es
+ values
+ {
+ input uint in0 = [ 193 | 3 | 255 | 8 | 10 | 9 | 2 | 12 | 0 | 45 ];
+ input uint in1 = [ 12 | 45 | 193 | 2 | 8 | 255 | 0 | 3 | 9 | 10 ];
+ input uint in2 = [ 9 | 8 | 12 | 2 | 255 | 45 | 3 | 0 | 193 | 10 ];
+ input uint in3 = [ 3 | 9 | 12 | 2 | 255 | 193 | 0 | 10 | 45 | 8 ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, false, true, false) | bvec4(true, true, false, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_bool_to_vec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ true | false ];
+ input bool in2 = [ false | true ];
+ input bool in3 = [ false | true ];
+ output vec4 out0 = [ vec4(1.0, 1.0, 0.0, 0.0) | vec4(0.0, 0.0, 1.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_bool_to_ivec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ true | false ];
+ input bool in2 = [ false | true ];
+ input bool in3 = [ false | true ];
+ output ivec4 out0 = [ ivec4(1, 1, 0, 0) | ivec4(0, 0, 1, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_bool_to_bvec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ true | false ];
+ input bool in2 = [ false | true ];
+ input bool in3 = [ false | true ];
+ output bvec4 out0 = [ bvec4(true, true, false, false) | bvec4(false, false, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_bool_to_vec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | true | false | false | false | true | false | false | true | true ];
+ input float in1 = [ 36.8125 | 0.0 | -8.25 | 1.0 | -0.5 | 0.0 | 2.0 | -20.125 | 3.5 | 1.0 ];
+ input int in2 = [ -66 | 2 | 255 | 11 | 1 | 8 | -192 | -12 | 0 | 5 ];
+ input bool in3 = [ true | true | false | false | true | true | false | true | false | false ];
+ output vec4 out0 = [ vec4(1.0, 36.8125, -66.0, 1.0) | vec4(1.0, 0.0, 2.0, 1.0) | vec4(0.0, -8.25, 255.0, 0.0) | vec4(0.0, 1.0, 11.0, 0.0) | vec4(0.0, -0.5, 1.0, 1.0) | vec4(1.0, 0.0, 8.0, 1.0) | vec4(0.0, 2.0, -192.0, 0.0) | vec4(0.0, -20.125, -12.0, 1.0) | vec4(1.0, 3.5, 0.0, 0.0) | vec4(1.0, 1.0, 5.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_bool_to_ivec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | true | false | false | false | true | false | false | true | true ];
+ input float in1 = [ 36.8125 | 0.0 | -8.25 | 1.0 | -0.5 | 0.0 | 2.0 | -20.125 | 3.5 | 1.0 ];
+ input int in2 = [ -66 | 2 | 255 | 11 | 1 | 8 | -192 | -12 | 0 | 5 ];
+ input bool in3 = [ true | true | false | false | true | true | false | true | false | false ];
+ output ivec4 out0 = [ ivec4(1, 36, -66, 1) | ivec4(1, 0, 2, 1) | ivec4(0, -8, 255, 0) | ivec4(0, 1, 11, 0) | ivec4(0, 0, 1, 1) | ivec4(1, 0, 8, 1) | ivec4(0, 2, -192, 0) | ivec4(0, -20, -12, 1) | ivec4(1, 3, 0, 0) | ivec4(1, 1, 5, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_bool_to_bvec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | true | false | false | false | true | false | false | true | true ];
+ input float in1 = [ 36.8125 | 0.0 | -8.25 | 1.0 | -0.5 | 0.0 | 2.0 | -20.125 | 3.5 | 1.0 ];
+ input int in2 = [ -66 | 2 | 255 | 11 | 1 | 8 | -192 | -12 | 0 | 5 ];
+ input bool in3 = [ true | true | false | false | true | true | false | true | false | false ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, false, true, true) | bvec4(false, true, true, false) | bvec4(false, true, true, false) | bvec4(false, true, true, true) | bvec4(true, false, true, true) | bvec4(false, true, true, false) | bvec4(false, true, true, true) | bvec4(true, true, false, false) | bvec4(true, true, true, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_to_vec4
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(-0.75, -0.0322580645161, 0.0, -2.0) | vec4(-0.5, -2.25, 0.0, 0.0) | vec4(-32.0, 64.0, -32.0, 64.0) | vec4(1.0, 1.25, 1.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_to_ivec4
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, -2) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, 64) | ivec4(1, 1, 1, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_to_bvec4
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) ];
+ output bvec4 out0 = [ bvec4(false, true, false, false) | bvec4(true, true, false, true) | bvec4(true, true, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bvec2_to_vec4
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) ];
+ input bvec2 in1 = [ bvec2(false, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) ];
+ output vec4 out0 = [ vec4(-0.75, -0.0322580645161, 0.0, 1.0) | vec4(-32.0, 64.0, 0.0, 0.0) | vec4(1.0, 1.25, 0.0, 0.0) | vec4(0.0, 0.5, 1.0, 1.0) | vec4(-0.5, -2.25, 1.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bvec2_to_ivec4
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) ];
+ input bvec2 in1 = [ bvec2(false, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 1) | ivec4(-32, 64, 0, 0) | ivec4(1, 1, 0, 0) | ivec4(0, 0, 1, 1) | ivec4(0, -2, 1, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bvec2_to_bvec4
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) ];
+ input bvec2 in1 = [ bvec2(false, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) ];
+ output bvec4 out0 = [ bvec4(true, true, false, true) | bvec4(true, true, false, false) | bvec4(true, true, false, false) | bvec4(false, true, true, true) | bvec4(true, true, true, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_float_to_vec4
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, true, false) ];
+ input float in1 = [ -0.5 | 3.5 | 2.0 | 0.0 | -8.25 | 1.0 | 36.8125 | -20.125 ];
+ output vec4 out0 = [ vec4(1.0, 0.0, 0.0, -0.5) | vec4(0.0, 0.0, 0.0, 3.5) | vec4(0.0, 1.0, 0.0, 2.0) | vec4(1.0, 1.0, 1.0, 0.0) | vec4(0.0, 0.0, 0.0, -8.25) | vec4(0.0, 0.0, 0.0, 1.0) | vec4(1.0, 0.0, 0.0, 36.8125) | vec4(0.0, 1.0, 0.0, -20.125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_float_to_ivec4
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, true, false) ];
+ input float in1 = [ -0.5 | 3.5 | 2.0 | 0.0 | -8.25 | 1.0 | 36.8125 | -20.125 ];
+ output ivec4 out0 = [ ivec4(1, 0, 0, 0) | ivec4(0, 0, 0, 3) | ivec4(0, 1, 0, 2) | ivec4(1, 1, 1, 0) | ivec4(0, 0, 0, -8) | ivec4(0, 0, 0, 1) | ivec4(1, 0, 0, 36) | ivec4(0, 1, 0, -20) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_float_to_bvec4
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, true, false) ];
+ input float in1 = [ -0.5 | 3.5 | 2.0 | 0.0 | -8.25 | 1.0 | 36.8125 | -20.125 ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, true) | bvec4(true, true, true, false) | bvec4(false, false, false, true) | bvec4(false, false, false, true) | bvec4(true, false, false, true) | bvec4(false, true, false, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_float_to_vec4
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) ];
+ input float in1 = [ -0.5 | 0.0 | 3.5 | -20.125 | 2.0 | -8.25 | 1.0 | 36.8125 ];
+ output vec4 out0 = [ vec4(-32.0, 64.0, -51.0, -0.5) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.0) | vec4(1.0, 1.25, 1.125, 3.5) | vec4(-0.5, -2.25, -4.875, -20.125) | vec4(0.0, 0.5, 0.75, 2.0) | vec4(-0.5, -2.25, -4.875, -8.25) | vec4(0.0, 0.5, 0.75, 1.0) | vec4(1.0, 1.25, 1.125, 36.8125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_float_to_ivec4
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) ];
+ input float in1 = [ -0.5 | 0.0 | 3.5 | -20.125 | 2.0 | -8.25 | 1.0 | 36.8125 ];
+ output ivec4 out0 = [ ivec4(-32, 64, -51, 0) | ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 3) | ivec4(0, -2, -4, -20) | ivec4(0, 0, 0, 2) | ivec4(0, -2, -4, -8) | ivec4(0, 0, 0, 1) | ivec4(1, 1, 1, 36) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_float_to_bvec4
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) ];
+ input float in1 = [ -0.5 | 0.0 | 3.5 | -20.125 | 2.0 | -8.25 | 1.0 | 36.8125 ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_ivec2_int_to_vec4
+ version 300 es
+ values
+ {
+ input int in0 = [ -12 | 11 | 8 | 255 | 0 | 1 | -66 | 2 | -192 | 5 ];
+ input ivec2 in1 = [ ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, 0) | ivec2(0, 0) ];
+ input int in2 = [ 1 | 11 | 2 | -66 | -192 | 0 | -12 | 255 | 5 | 8 ];
+ output vec4 out0 = [ vec4(-12.0, 0.0, -2.0, 1.0) | vec4(11.0, -32.0, 64.0, 11.0) | vec4(8.0, 0.0, 0.0, 2.0) | vec4(255.0, 0.0, -2.0, -66.0) | vec4(0.0, 1.0, 1.0, -192.0) | vec4(1.0, 0.0, 0.0, 0.0) | vec4(-66.0, -32.0, 64.0, -12.0) | vec4(2.0, 1.0, 1.0, 255.0) | vec4(-192.0, 0.0, 0.0, 5.0) | vec4(5.0, 0.0, 0.0, 8.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_ivec2_int_to_ivec4
+ version 300 es
+ values
+ {
+ input int in0 = [ -12 | 11 | 8 | 255 | 0 | 1 | -66 | 2 | -192 | 5 ];
+ input ivec2 in1 = [ ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, 0) | ivec2(0, 0) ];
+ input int in2 = [ 1 | 11 | 2 | -66 | -192 | 0 | -12 | 255 | 5 | 8 ];
+ output ivec4 out0 = [ ivec4(-12, 0, -2, 1) | ivec4(11, -32, 64, 11) | ivec4(8, 0, 0, 2) | ivec4(255, 0, -2, -66) | ivec4(0, 1, 1, -192) | ivec4(1, 0, 0, 0) | ivec4(-66, -32, 64, -12) | ivec4(2, 1, 1, 255) | ivec4(-192, 0, 0, 5) | ivec4(5, 0, 0, 8) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_ivec2_int_to_bvec4
+ version 300 es
+ values
+ {
+ input int in0 = [ -12 | 11 | 8 | 255 | 0 | 1 | -66 | 2 | -192 | 5 ];
+ input ivec2 in1 = [ ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, 0) | ivec2(0, 0) ];
+ input int in2 = [ 1 | 11 | 2 | -66 | -192 | 0 | -12 | 255 | 5 | 8 ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(true, true, true, true) | bvec4(true, false, false, true) | bvec4(true, false, true, true) | bvec4(false, true, true, true) | bvec4(true, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, false, false, true) | bvec4(true, false, false, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_ivec2_to_vec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false | false | false | true | true | true | false ];
+ input float in1 = [ 1.0 | 0.0 | 2.0 | 3.5 | -20.125 | -0.5 | 36.8125 | -8.25 ];
+ input ivec2 in2 = [ ivec2(1, 1) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) ];
+ output vec4 out0 = [ vec4(1.0, 1.0, 1.0, 1.0) | vec4(0.0, 0.0, -32.0, 64.0) | vec4(0.0, 2.0, 0.0, 0.0) | vec4(0.0, 3.5, 0.0, 0.0) | vec4(1.0, -20.125, 0.0, -2.0) | vec4(1.0, -0.5, 0.0, -2.0) | vec4(1.0, 36.8125, 0.0, 0.0) | vec4(0.0, -8.25, 1.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_ivec2_to_ivec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false | false | false | true | true | true | false ];
+ input float in1 = [ 1.0 | 0.0 | 2.0 | 3.5 | -20.125 | -0.5 | 36.8125 | -8.25 ];
+ input ivec2 in2 = [ ivec2(1, 1) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) ];
+ output ivec4 out0 = [ ivec4(1, 1, 1, 1) | ivec4(0, 0, -32, 64) | ivec4(0, 2, 0, 0) | ivec4(0, 3, 0, 0) | ivec4(1, -20, 0, -2) | ivec4(1, 0, 0, -2) | ivec4(1, 36, 0, 0) | ivec4(0, -8, 1, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_ivec2_to_bvec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false | false | false | true | true | true | false ];
+ input float in1 = [ 1.0 | 0.0 | 2.0 | 3.5 | -20.125 | -0.5 | 36.8125 | -8.25 ];
+ input ivec2 in2 = [ ivec2(1, 1) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, true, true) | bvec4(false, true, false, false) | bvec4(false, true, false, false) | bvec4(true, true, false, true) | bvec4(true, true, false, true) | bvec4(true, true, false, false) | bvec4(false, true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_uvec3_to_vec4
+ version 300 es
+ values
+ {
+ input float in0 = [ 1.0 | -20.125 | -8.25 | -0.5 | 0.0 | 2.0 | 3.5 | 36.8125 ];
+ input uvec3 in1 = [ uvec3(0, 0, 0) | uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) ];
+ output vec4 out0 = [ vec4(1.0, 0.0, 0.0, 0.0) | vec4(-20.125, 0.0, 0.0, 0.0) | vec4(-8.25, 1.0, 1.0, 1.0) | vec4(-0.5, 0.0, 2.0, 4.0) | vec4(0.0, 0.0, 0.0, 0.0) | vec4(2.0, 1.0, 1.0, 1.0) | vec4(3.5, 0.0, 2.0, 4.0) | vec4(36.8125, 32.0, 64.0, 51.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_uvec3_to_ivec4
+ version 300 es
+ values
+ {
+ input float in0 = [ 1.0 | -20.125 | -8.25 | -0.5 | 0.0 | 2.0 | 3.5 | 36.8125 ];
+ input uvec3 in1 = [ uvec3(0, 0, 0) | uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) ];
+ output ivec4 out0 = [ ivec4(1, 0, 0, 0) | ivec4(-20, 0, 0, 0) | ivec4(-8, 1, 1, 1) | ivec4(0, 0, 2, 4) | ivec4(0, 0, 0, 0) | ivec4(2, 1, 1, 1) | ivec4(3, 0, 2, 4) | ivec4(36, 32, 64, 51) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_uvec3_to_bvec4
+ version 300 es
+ values
+ {
+ input float in0 = [ 1.0 | -20.125 | -8.25 | -0.5 | 0.0 | 2.0 | 3.5 | 36.8125 ];
+ input uvec3 in1 = [ uvec3(0, 0, 0) | uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) ];
+ output bvec4 out0 = [ bvec4(true, false, false, false) | bvec4(true, false, false, false) | bvec4(true, true, true, true) | bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, false, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_uvec2_bool_to_vec4
+ version 300 es
+ values
+ {
+ input int in0 = [ 1 | -192 | -66 | -12 | 0 | 2 | 11 | 8 | 255 | 5 ];
+ input uvec2 in1 = [ uvec2(0, 2) | uvec2(1, 1) | uvec2(0, 0) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) | uvec2(32, 64) | uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 0) ];
+ input bool in2 = [ false | false | true | true | true | true | true | false | false | false ];
+ output vec4 out0 = [ vec4(1.0, 0.0, 2.0, 0.0) | vec4(-192.0, 1.0, 1.0, 0.0) | vec4(-66.0, 0.0, 0.0, 1.0) | vec4(-12.0, 0.0, 2.0, 1.0) | vec4(0.0, 32.0, 64.0, 1.0) | vec4(2.0, 0.0, 0.0, 1.0) | vec4(11.0, 32.0, 64.0, 1.0) | vec4(8.0, 0.0, 0.0, 0.0) | vec4(255.0, 1.0, 1.0, 0.0) | vec4(5.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_uvec2_bool_to_ivec4
+ version 300 es
+ values
+ {
+ input int in0 = [ 1 | -192 | -66 | -12 | 0 | 2 | 11 | 8 | 255 | 5 ];
+ input uvec2 in1 = [ uvec2(0, 2) | uvec2(1, 1) | uvec2(0, 0) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) | uvec2(32, 64) | uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 0) ];
+ input bool in2 = [ false | false | true | true | true | true | true | false | false | false ];
+ output ivec4 out0 = [ ivec4(1, 0, 2, 0) | ivec4(-192, 1, 1, 0) | ivec4(-66, 0, 0, 1) | ivec4(-12, 0, 2, 1) | ivec4(0, 32, 64, 1) | ivec4(2, 0, 0, 1) | ivec4(11, 32, 64, 1) | ivec4(8, 0, 0, 0) | ivec4(255, 1, 1, 0) | ivec4(5, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_uvec2_bool_to_bvec4
+ version 300 es
+ values
+ {
+ input int in0 = [ 1 | -192 | -66 | -12 | 0 | 2 | 11 | 8 | 255 | 5 ];
+ input uvec2 in1 = [ uvec2(0, 2) | uvec2(1, 1) | uvec2(0, 0) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) | uvec2(32, 64) | uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 0) ];
+ input bool in2 = [ false | false | true | true | true | true | true | false | false | false ];
+ output bvec4 out0 = [ bvec4(true, false, true, false) | bvec4(true, true, true, false) | bvec4(true, false, false, true) | bvec4(true, false, true, true) | bvec4(false, true, true, true) | bvec4(true, false, false, true) | bvec4(true, true, true, true) | bvec4(true, false, false, false) | bvec4(true, true, true, false) | bvec4(true, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_vec2_to_uvec4
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(32.0, 64.0) | vec2(0.75, 0.0322580645161) | vec2(0.0, 0.5) | vec2(0.5, 2.25) | vec2(1.0, 1.25) ];
+ input vec2 in1 = [ vec2(0.5, 2.25) | vec2(1.0, 1.25) | vec2(32.0, 64.0) | vec2(0.0, 0.5) | vec2(0.75, 0.0322580645161) ];
+ output uvec4 out0 = [ uvec4(32, 64, 0, 2) | uvec4(0, 0, 1, 1) | uvec4(0, 0, 32, 64) | uvec4(0, 2, 0, 0) | uvec4(1, 1, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_bvec2_to_uvec4
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) | bvec2(false, false) ];
+ input bvec2 in1 = [ bvec2(true, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) ];
+ output uvec4 out0 = [ uvec4(1, 0, 1, 1) | uvec4(0, 1, 0, 0) | uvec4(1, 1, 1, 0) | uvec4(0, 0, 0, 1) | uvec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_float_to_uvec4
+ version 300 es
+ values
+ {
+ input float in0 = [ 2.0 | 36.8125 | 0.0 | 20.125 | 1.0 | 0.5 | 8.25 | 3.5 ];
+ input float in1 = [ 1.0 | 8.25 | 2.0 | 20.125 | 36.8125 | 0.0 | 0.5 | 3.5 ];
+ input float in2 = [ 0.0 | 8.25 | 2.0 | 1.0 | 36.8125 | 20.125 | 0.5 | 3.5 ];
+ input float in3 = [ 1.0 | 8.25 | 0.0 | 2.0 | 20.125 | 3.5 | 0.5 | 36.8125 ];
+ output uvec4 out0 = [ uvec4(2, 1, 0, 1) | uvec4(36, 8, 8, 8) | uvec4(0, 2, 2, 0) | uvec4(20, 20, 1, 2) | uvec4(1, 36, 36, 20) | uvec4(0, 0, 20, 3) | uvec4(8, 0, 0, 0) | uvec4(3, 3, 3, 36) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_int_to_uvec4
+ version 300 es
+ values
+ {
+ input int in0 = [ 192 | 2 | 12 | 11 | 0 | 8 | 5 | 66 | 1 | 255 ];
+ input int in1 = [ 66 | 12 | 5 | 1 | 0 | 192 | 8 | 255 | 11 | 2 ];
+ input int in2 = [ 192 | 5 | 1 | 66 | 255 | 11 | 8 | 12 | 2 | 0 ];
+ input int in3 = [ 255 | 5 | 11 | 12 | 2 | 1 | 66 | 0 | 8 | 192 ];
+ output uvec4 out0 = [ uvec4(192, 66, 192, 255) | uvec4(2, 12, 5, 5) | uvec4(12, 5, 1, 11) | uvec4(11, 1, 66, 12) | uvec4(0, 0, 255, 2) | uvec4(8, 192, 11, 1) | uvec4(5, 8, 8, 66) | uvec4(66, 255, 12, 0) | uvec4(1, 11, 2, 8) | uvec4(255, 2, 0, 192) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uint_uint_uint_to_uvec4
+ version 300 es
+ values
+ {
+ input uint in0 = [ 255 | 8 | 3 | 193 | 45 | 2 | 0 | 12 | 9 | 10 ];
+ input uint in1 = [ 255 | 45 | 0 | 12 | 2 | 10 | 8 | 9 | 193 | 3 ];
+ input uint in2 = [ 3 | 0 | 2 | 9 | 12 | 10 | 255 | 45 | 193 | 8 ];
+ input uint in3 = [ 2 | 255 | 10 | 193 | 8 | 12 | 3 | 9 | 0 | 45 ];
+ output uvec4 out0 = [ uvec4(255, 255, 3, 2) | uvec4(8, 45, 0, 255) | uvec4(3, 0, 2, 10) | uvec4(193, 12, 9, 193) | uvec4(45, 2, 12, 8) | uvec4(2, 10, 10, 12) | uvec4(0, 8, 255, 3) | uvec4(12, 9, 45, 9) | uvec4(9, 193, 193, 0) | uvec4(10, 3, 8, 45) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_bool_to_uvec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ false | true ];
+ input bool in1 = [ false | true ];
+ input bool in2 = [ true | false ];
+ input bool in3 = [ true | false ];
+ output uvec4 out0 = [ uvec4(0, 0, 1, 1) | uvec4(1, 1, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_bool_to_uvec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false | false | true | false | true | true | true | false | false ];
+ input float in1 = [ 20.125 | 0.0 | 1.0 | 3.5 | 1.0 | 0.0 | 0.5 | 8.25 | 2.0 | 36.8125 ];
+ input int in2 = [ 66 | 192 | 1 | 2 | 5 | 11 | 8 | 12 | 255 | 0 ];
+ input bool in3 = [ true | true | true | true | false | true | false | false | false | false ];
+ output uvec4 out0 = [ uvec4(1, 20, 66, 1) | uvec4(0, 0, 192, 1) | uvec4(0, 1, 1, 1) | uvec4(1, 3, 2, 1) | uvec4(0, 1, 5, 0) | uvec4(1, 0, 11, 1) | uvec4(1, 0, 8, 0) | uvec4(1, 8, 12, 0) | uvec4(0, 2, 255, 0) | uvec4(0, 36, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_to_uvec4
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.5, 2.25) | vec2(1.0, 1.25) | vec2(32.0, 64.0) | vec2(0.75, 0.0322580645161) | vec2(0.0, 0.5) ];
+ input ivec2 in1 = [ ivec2(1, 1) | ivec2(0, 2) | ivec2(32, 64) | ivec2(0, 0) | ivec2(0, 0) ];
+ output uvec4 out0 = [ uvec4(0, 2, 1, 1) | uvec4(1, 1, 0, 2) | uvec4(32, 64, 32, 64) | uvec4(0, 0, 0, 0) | uvec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bvec2_to_uvec4
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(32.0, 64.0) | vec2(0.75, 0.0322580645161) | vec2(0.5, 2.25) | vec2(0.0, 0.5) | vec2(1.0, 1.25) ];
+ input bvec2 in1 = [ bvec2(false, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(true, true) ];
+ output uvec4 out0 = [ uvec4(32, 64, 0, 0) | uvec4(0, 0, 0, 0) | uvec4(0, 2, 1, 0) | uvec4(0, 0, 0, 1) | uvec4(1, 1, 1, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_float_to_uvec4
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(true, true, true) | bvec3(false, true, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, false, false) | bvec3(false, false, false) ];
+ input float in1 = [ 2.0 | 0.0 | 36.8125 | 0.5 | 1.0 | 8.25 | 3.5 | 20.125 ];
+ output uvec4 out0 = [ uvec4(1, 0, 0, 2) | uvec4(1, 1, 1, 0) | uvec4(0, 1, 0, 36) | uvec4(0, 0, 0, 0) | uvec4(0, 0, 0, 1) | uvec4(0, 1, 0, 8) | uvec4(1, 0, 0, 3) | uvec4(0, 0, 0, 20) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_float_to_uvec4
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.5, 2.25, 4.875) | vec3(1.0, 1.25, 1.125) | vec3(0.0, 0.5, 0.75) | vec3(0.5, 2.25, 4.875) | vec3(32.0, 64.0, 51.0) | vec3(1.0, 1.25, 1.125) | vec3(0.75, 0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) ];
+ input float in1 = [ 8.25 | 1.0 | 0.0 | 36.8125 | 2.0 | 0.5 | 20.125 | 3.5 ];
+ output uvec4 out0 = [ uvec4(0, 2, 4, 8) | uvec4(1, 1, 1, 1) | uvec4(0, 0, 0, 0) | uvec4(0, 2, 4, 36) | uvec4(32, 64, 51, 2) | uvec4(1, 1, 1, 0) | uvec4(0, 0, 0, 20) | uvec4(0, 0, 0, 3) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_ivec2_int_to_uvec4
+ version 300 es
+ values
+ {
+ input int in0 = [ 8 | 1 | 11 | 192 | 255 | 12 | 66 | 2 | 0 | 5 ];
+ input ivec2 in1 = [ ivec2(1, 1) | ivec2(0, 0) | ivec2(1, 1) | ivec2(32, 64) | ivec2(0, 2) | ivec2(0, 2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(32, 64) | ivec2(0, 0) ];
+ input int in2 = [ 2 | 192 | 12 | 0 | 8 | 1 | 66 | 255 | 11 | 5 ];
+ output uvec4 out0 = [ uvec4(8, 1, 1, 2) | uvec4(1, 0, 0, 192) | uvec4(11, 1, 1, 12) | uvec4(192, 32, 64, 0) | uvec4(255, 0, 2, 8) | uvec4(12, 0, 2, 1) | uvec4(66, 0, 0, 66) | uvec4(2, 0, 0, 255) | uvec4(0, 32, 64, 11) | uvec4(5, 0, 0, 5) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_ivec2_to_uvec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | true | false | false | true | false | false | true ];
+ input float in1 = [ 8.25 | 0.5 | 2.0 | 20.125 | 0.0 | 36.8125 | 3.5 | 1.0 ];
+ input ivec2 in2 = [ ivec2(32, 64) | ivec2(1, 1) | ivec2(0, 2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, 2) | ivec2(1, 1) | ivec2(0, 0) ];
+ output uvec4 out0 = [ uvec4(1, 8, 32, 64) | uvec4(1, 0, 1, 1) | uvec4(0, 2, 0, 2) | uvec4(0, 20, 0, 0) | uvec4(1, 0, 0, 0) | uvec4(0, 36, 0, 2) | uvec4(0, 3, 1, 1) | uvec4(1, 1, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_uvec3_to_uvec4
+ version 300 es
+ values
+ {
+ input float in0 = [ 8.25 | 20.125 | 1.0 | 0.5 | 3.5 | 2.0 | 36.8125 | 0.0 ];
+ input uvec3 in1 = [ uvec3(0, 0, 0) | uvec3(0, 0, 0) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 2, 4) | uvec3(1, 1, 1) | uvec3(1, 1, 1) | uvec3(0, 0, 0) ];
+ output uvec4 out0 = [ uvec4(8, 0, 0, 0) | uvec4(20, 0, 0, 0) | uvec4(1, 0, 2, 4) | uvec4(0, 32, 64, 51) | uvec4(3, 0, 2, 4) | uvec4(2, 1, 1, 1) | uvec4(36, 1, 1, 1) | uvec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_uvec2_bool_to_uvec4
+ version 300 es
+ values
+ {
+ input int in0 = [ 2 | 1 | 11 | 66 | 192 | 12 | 8 | 255 | 0 | 5 ];
+ input uvec2 in1 = [ uvec2(1, 1) | uvec2(0, 0) | uvec2(0, 0) | uvec2(0, 2) | uvec2(0, 0) | uvec2(0, 2) | uvec2(32, 64) | uvec2(1, 1) | uvec2(32, 64) | uvec2(0, 0) ];
+ input bool in2 = [ true | false | false | false | false | true | true | true | false | true ];
+ output uvec4 out0 = [ uvec4(2, 1, 1, 1) | uvec4(1, 0, 0, 0) | uvec4(11, 0, 0, 0) | uvec4(66, 0, 2, 0) | uvec4(192, 0, 0, 0) | uvec4(12, 0, 2, 1) | uvec4(8, 32, 64, 1) | uvec4(255, 1, 1, 1) | uvec4(0, 32, 64, 0) | uvec4(5, 0, 0, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_to_vec3
+ version 300 es
+ values
+ {
+ input float in0 = [ -0.5 | 1.0 | 3.5 | -8.25 | 36.8125 | 0.0 | 2.0 | -20.125 ];
+ input float in1 = [ 2.0 | -20.125 | 3.5 | 36.8125 | -8.25 | 1.0 | -0.5 | 0.0 ];
+ input float in2 = [ 1.0 | 3.5 | 2.0 | -8.25 | -20.125 | -0.5 | 36.8125 | 0.0 ];
+ output vec3 out0 = [ vec3(-0.5, 2.0, 1.0) | vec3(1.0, -20.125, 3.5) | vec3(3.5, 3.5, 2.0) | vec3(-8.25, 36.8125, -8.25) | vec3(36.8125, -8.25, -20.125) | vec3(0.0, 1.0, -0.5) | vec3(2.0, -0.5, 36.8125) | vec3(-20.125, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_to_ivec3
+ version 300 es
+ values
+ {
+ input float in0 = [ -0.5 | 1.0 | 3.5 | -8.25 | 36.8125 | 0.0 | 2.0 | -20.125 ];
+ input float in1 = [ 2.0 | -20.125 | 3.5 | 36.8125 | -8.25 | 1.0 | -0.5 | 0.0 ];
+ input float in2 = [ 1.0 | 3.5 | 2.0 | -8.25 | -20.125 | -0.5 | 36.8125 | 0.0 ];
+ output ivec3 out0 = [ ivec3(0, 2, 1) | ivec3(1, -20, 3) | ivec3(3, 3, 2) | ivec3(-8, 36, -8) | ivec3(36, -8, -20) | ivec3(0, 1, 0) | ivec3(2, 0, 36) | ivec3(-20, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_to_bvec3
+ version 300 es
+ values
+ {
+ input float in0 = [ -0.5 | 1.0 | 3.5 | -8.25 | 36.8125 | 0.0 | 2.0 | -20.125 ];
+ input float in1 = [ 2.0 | -20.125 | 3.5 | 36.8125 | -8.25 | 1.0 | -0.5 | 0.0 ];
+ input float in2 = [ 1.0 | 3.5 | 2.0 | -8.25 | -20.125 | -0.5 | 36.8125 | 0.0 ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(true, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_to_vec3
+ version 300 es
+ values
+ {
+ input int in0 = [ -192 | 5 | -12 | 0 | 11 | 8 | 1 | -66 | 255 | 2 ];
+ input int in1 = [ 5 | 1 | 8 | 0 | 2 | -192 | -12 | 255 | -66 | 11 ];
+ input int in2 = [ -192 | 1 | 2 | 5 | -12 | 8 | 11 | 0 | 255 | -66 ];
+ output vec3 out0 = [ vec3(-192.0, 5.0, -192.0) | vec3(5.0, 1.0, 1.0) | vec3(-12.0, 8.0, 2.0) | vec3(0.0, 0.0, 5.0) | vec3(11.0, 2.0, -12.0) | vec3(8.0, -192.0, 8.0) | vec3(1.0, -12.0, 11.0) | vec3(-66.0, 255.0, 0.0) | vec3(255.0, -66.0, 255.0) | vec3(2.0, 11.0, -66.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_to_ivec3
+ version 300 es
+ values
+ {
+ input int in0 = [ -192 | 5 | -12 | 0 | 11 | 8 | 1 | -66 | 255 | 2 ];
+ input int in1 = [ 5 | 1 | 8 | 0 | 2 | -192 | -12 | 255 | -66 | 11 ];
+ input int in2 = [ -192 | 1 | 2 | 5 | -12 | 8 | 11 | 0 | 255 | -66 ];
+ output ivec3 out0 = [ ivec3(-192, 5, -192) | ivec3(5, 1, 1) | ivec3(-12, 8, 2) | ivec3(0, 0, 5) | ivec3(11, 2, -12) | ivec3(8, -192, 8) | ivec3(1, -12, 11) | ivec3(-66, 255, 0) | ivec3(255, -66, 255) | ivec3(2, 11, -66) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_to_bvec3
+ version 300 es
+ values
+ {
+ input int in0 = [ -192 | 5 | -12 | 0 | 11 | 8 | 1 | -66 | 255 | 2 ];
+ input int in1 = [ 5 | 1 | 8 | 0 | 2 | -192 | -12 | 255 | -66 | 11 ];
+ input int in2 = [ -192 | 1 | 2 | 5 | -12 | 8 | 11 | 0 | 255 | -66 ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, false) | bvec3(true, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uint_uint_to_vec3
+ version 300 es
+ values
+ {
+ input uint in0 = [ 8 | 45 | 2 | 3 | 255 | 193 | 12 | 0 | 9 | 10 ];
+ input uint in1 = [ 193 | 2 | 9 | 8 | 0 | 255 | 45 | 3 | 10 | 12 ];
+ input uint in2 = [ 12 | 2 | 193 | 255 | 8 | 10 | 45 | 0 | 3 | 9 ];
+ output vec3 out0 = [ vec3(8.0, 193.0, 12.0) | vec3(45.0, 2.0, 2.0) | vec3(2.0, 9.0, 193.0) | vec3(3.0, 8.0, 255.0) | vec3(255.0, 0.0, 8.0) | vec3(193.0, 255.0, 10.0) | vec3(12.0, 45.0, 45.0) | vec3(0.0, 3.0, 0.0) | vec3(9.0, 10.0, 3.0) | vec3(10.0, 12.0, 9.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uint_uint_to_ivec3
+ version 300 es
+ values
+ {
+ input uint in0 = [ 8 | 45 | 2 | 3 | 255 | 193 | 12 | 0 | 9 | 10 ];
+ input uint in1 = [ 193 | 2 | 9 | 8 | 0 | 255 | 45 | 3 | 10 | 12 ];
+ input uint in2 = [ 12 | 2 | 193 | 255 | 8 | 10 | 45 | 0 | 3 | 9 ];
+ output ivec3 out0 = [ ivec3(8, 193, 12) | ivec3(45, 2, 2) | ivec3(2, 9, 193) | ivec3(3, 8, 255) | ivec3(255, 0, 8) | ivec3(193, 255, 10) | ivec3(12, 45, 45) | ivec3(0, 3, 0) | ivec3(9, 10, 3) | ivec3(10, 12, 9) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uint_uint_to_bvec3
+ version 300 es
+ values
+ {
+ input uint in0 = [ 8 | 45 | 2 | 3 | 255 | 193 | 12 | 0 | 9 | 10 ];
+ input uint in1 = [ 193 | 2 | 9 | 8 | 0 | 255 | 45 | 3 | 10 | 12 ];
+ input uint in2 = [ 12 | 2 | 193 | 255 | 8 | 10 | 45 | 0 | 3 | 9 ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_to_vec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ true | false ];
+ input bool in2 = [ true | false ];
+ output vec3 out0 = [ vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_to_ivec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ true | false ];
+ input bool in2 = [ true | false ];
+ output ivec3 out0 = [ ivec3(1, 1, 1) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_to_bvec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ true | false ];
+ input bool in2 = [ true | false ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_to_vec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | true | false | false | true | false | true | false | false | true ];
+ input float in1 = [ 0.0 | 36.8125 | 0.0 | -8.25 | 1.0 | 3.5 | 1.0 | -0.5 | -20.125 | 2.0 ];
+ input int in2 = [ 8 | -192 | -66 | 2 | 1 | -12 | 11 | 255 | 5 | 0 ];
+ output vec3 out0 = [ vec3(1.0, 0.0, 8.0) | vec3(1.0, 36.8125, -192.0) | vec3(0.0, 0.0, -66.0) | vec3(0.0, -8.25, 2.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, 3.5, -12.0) | vec3(1.0, 1.0, 11.0) | vec3(0.0, -0.5, 255.0) | vec3(0.0, -20.125, 5.0) | vec3(1.0, 2.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_to_ivec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | true | false | false | true | false | true | false | false | true ];
+ input float in1 = [ 0.0 | 36.8125 | 0.0 | -8.25 | 1.0 | 3.5 | 1.0 | -0.5 | -20.125 | 2.0 ];
+ input int in2 = [ 8 | -192 | -66 | 2 | 1 | -12 | 11 | 255 | 5 | 0 ];
+ output ivec3 out0 = [ ivec3(1, 0, 8) | ivec3(1, 36, -192) | ivec3(0, 0, -66) | ivec3(0, -8, 2) | ivec3(1, 1, 1) | ivec3(0, 3, -12) | ivec3(1, 1, 11) | ivec3(0, 0, 255) | ivec3(0, -20, 5) | ivec3(1, 2, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_to_bvec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | true | false | false | true | false | true | false | false | true ];
+ input float in1 = [ 0.0 | 36.8125 | 0.0 | -8.25 | 1.0 | 3.5 | 1.0 | -0.5 | -20.125 | 2.0 ];
+ input int in2 = [ 8 | -192 | -66 | 2 | 1 | -12 | 11 | 255 | 5 | 0 ];
+ output bvec3 out0 = [ bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(false, true, true) | bvec3(true, true, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bool_to_vec3
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) ];
+ input bool in1 = [ false | true | true | true | false ];
+ output vec3 out0 = [ vec3(1.0, 1.25, 0.0) | vec3(-0.75, -0.0322580645161, 1.0) | vec3(-32.0, 64.0, 1.0) | vec3(-0.5, -2.25, 1.0) | vec3(0.0, 0.5, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bool_to_ivec3
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) ];
+ input bool in1 = [ false | true | true | true | false ];
+ output ivec3 out0 = [ ivec3(1, 1, 0) | ivec3(0, 0, 1) | ivec3(-32, 64, 1) | ivec3(0, -2, 1) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bool_to_bvec3
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) ];
+ input bool in1 = [ false | true | true | true | false ];
+ output bvec3 out0 = [ bvec3(true, true, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, true, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_float_to_vec3
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, true) | bvec2(false, true) | bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ input float in1 = [ -20.125 | 2.0 | 36.8125 | 1.0 | 3.5 | 0.0 | -8.25 | -0.5 ];
+ output vec3 out0 = [ vec3(1.0, 0.0, -20.125) | vec3(0.0, 1.0, 2.0) | vec3(0.0, 1.0, 36.8125) | vec3(1.0, 0.0, 1.0) | vec3(0.0, 0.0, 3.5) | vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, -8.25) | vec3(0.0, 0.0, -0.5) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_float_to_ivec3
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, true) | bvec2(false, true) | bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ input float in1 = [ -20.125 | 2.0 | 36.8125 | 1.0 | 3.5 | 0.0 | -8.25 | -0.5 ];
+ output ivec3 out0 = [ ivec3(1, 0, -20) | ivec3(0, 1, 2) | ivec3(0, 1, 36) | ivec3(1, 0, 1) | ivec3(0, 0, 3) | ivec3(0, 0, 0) | ivec3(1, 1, -8) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_float_to_bvec3
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, true) | bvec2(false, true) | bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ input float in1 = [ -20.125 | 2.0 | 36.8125 | 1.0 | 3.5 | 0.0 | -8.25 | -0.5 ];
+ output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, true, true) | bvec3(false, true, true) | bvec3(true, false, true) | bvec3(false, false, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_int_to_vec3
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ];
+ input int in1 = [ 1 | -66 | 255 | 8 | -192 | 2 | 5 | 11 | -12 | 0 ];
+ output vec3 out0 = [ vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, -66.0) | vec3(0.0, 0.0, 255.0) | vec3(1.0, 0.0, 8.0) | vec3(0.0, 0.0, -192.0) | vec3(0.0, 1.0, 2.0) | vec3(1.0, 0.0, 5.0) | vec3(0.0, 1.0, 11.0) | vec3(0.0, 0.0, -12.0) | vec3(1.0, 1.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_int_to_ivec3
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ];
+ input int in1 = [ 1 | -66 | 255 | 8 | -192 | 2 | 5 | 11 | -12 | 0 ];
+ output ivec3 out0 = [ ivec3(1, 1, 1) | ivec3(0, 0, -66) | ivec3(0, 0, 255) | ivec3(1, 0, 8) | ivec3(0, 0, -192) | ivec3(0, 1, 2) | ivec3(1, 0, 5) | ivec3(0, 1, 11) | ivec3(0, 0, -12) | ivec3(1, 1, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_int_to_bvec3
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ];
+ input int in1 = [ 1 | -66 | 255 | 8 | -192 | 2 | 5 | 11 | -12 | 0 ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, true) | bvec3(false, false, true) | bvec3(true, false, true) | bvec3(false, false, true) | bvec3(false, true, true) | bvec3(true, false, true) | bvec3(false, true, true) | bvec3(false, false, true) | bvec3(true, true, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_ivec2_to_vec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | true | false | false | true ];
+ input ivec2 in1 = [ ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) | ivec2(-32, 64) ];
+ output vec3 out0 = [ vec3(1.0, 0.0, -2.0) | vec3(1.0, 0.0, 0.0) | vec3(0.0, 0.0, 0.0) | vec3(0.0, 1.0, 1.0) | vec3(1.0, -32.0, 64.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_ivec2_to_ivec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | true | false | false | true ];
+ input ivec2 in1 = [ ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) | ivec2(-32, 64) ];
+ output ivec3 out0 = [ ivec3(1, 0, -2) | ivec3(1, 0, 0) | ivec3(0, 0, 0) | ivec3(0, 1, 1) | ivec3(1, -32, 64) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_ivec2_to_bvec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | true | false | false | true ];
+ input ivec2 in1 = [ ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) | ivec2(-32, 64) ];
+ output bvec3 out0 = [ bvec3(true, false, true) | bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_uvec2_to_vec3
+ version 300 es
+ values
+ {
+ input float in0 = [ -20.125 | 36.8125 | -8.25 | 2.0 | -0.5 | 0.0 | 3.5 | 1.0 ];
+ input uvec2 in1 = [ uvec2(0, 0) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) | uvec2(0, 2) | uvec2(0, 0) | uvec2(1, 1) | uvec2(1, 1) ];
+ output vec3 out0 = [ vec3(-20.125, 0.0, 0.0) | vec3(36.8125, 0.0, 2.0) | vec3(-8.25, 32.0, 64.0) | vec3(2.0, 0.0, 0.0) | vec3(-0.5, 0.0, 2.0) | vec3(0.0, 0.0, 0.0) | vec3(3.5, 1.0, 1.0) | vec3(1.0, 1.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_uvec2_to_ivec3
+ version 300 es
+ values
+ {
+ input float in0 = [ -20.125 | 36.8125 | -8.25 | 2.0 | -0.5 | 0.0 | 3.5 | 1.0 ];
+ input uvec2 in1 = [ uvec2(0, 0) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) | uvec2(0, 2) | uvec2(0, 0) | uvec2(1, 1) | uvec2(1, 1) ];
+ output ivec3 out0 = [ ivec3(-20, 0, 0) | ivec3(36, 0, 2) | ivec3(-8, 32, 64) | ivec3(2, 0, 0) | ivec3(0, 0, 2) | ivec3(0, 0, 0) | ivec3(3, 1, 1) | ivec3(1, 1, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_uvec2_to_bvec3
+ version 300 es
+ values
+ {
+ input float in0 = [ -20.125 | 36.8125 | -8.25 | 2.0 | -0.5 | 0.0 | 3.5 | 1.0 ];
+ input uvec2 in1 = [ uvec2(0, 0) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) | uvec2(0, 2) | uvec2(0, 0) | uvec2(1, 1) | uvec2(1, 1) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(true, false, false) | bvec3(true, false, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_to_uvec3
+ version 300 es
+ values
+ {
+ input float in0 = [ 8.25 | 20.125 | 2.0 | 3.5 | 0.5 | 36.8125 | 1.0 | 0.0 ];
+ input float in1 = [ 1.0 | 0.0 | 3.5 | 36.8125 | 8.25 | 2.0 | 0.5 | 20.125 ];
+ input float in2 = [ 20.125 | 0.5 | 8.25 | 36.8125 | 1.0 | 0.0 | 3.5 | 2.0 ];
+ output uvec3 out0 = [ uvec3(8, 1, 20) | uvec3(20, 0, 0) | uvec3(2, 3, 8) | uvec3(3, 36, 36) | uvec3(0, 8, 1) | uvec3(36, 2, 0) | uvec3(1, 0, 3) | uvec3(0, 20, 2) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_to_uvec3
+ version 300 es
+ values
+ {
+ input int in0 = [ 1 | 255 | 192 | 2 | 5 | 12 | 0 | 11 | 8 | 66 ];
+ input int in1 = [ 192 | 66 | 5 | 8 | 11 | 1 | 0 | 255 | 12 | 2 ];
+ input int in2 = [ 192 | 5 | 1 | 11 | 66 | 8 | 12 | 0 | 2 | 255 ];
+ output uvec3 out0 = [ uvec3(1, 192, 192) | uvec3(255, 66, 5) | uvec3(192, 5, 1) | uvec3(2, 8, 11) | uvec3(5, 11, 66) | uvec3(12, 1, 8) | uvec3(0, 0, 12) | uvec3(11, 255, 0) | uvec3(8, 12, 2) | uvec3(66, 2, 255) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uint_uint_to_uvec3
+ version 300 es
+ values
+ {
+ input uint in0 = [ 193 | 9 | 45 | 255 | 2 | 0 | 10 | 8 | 12 | 3 ];
+ input uint in1 = [ 3 | 45 | 2 | 9 | 10 | 0 | 8 | 12 | 255 | 193 ];
+ input uint in2 = [ 2 | 3 | 9 | 10 | 255 | 8 | 12 | 0 | 193 | 45 ];
+ output uvec3 out0 = [ uvec3(193, 3, 2) | uvec3(9, 45, 3) | uvec3(45, 2, 9) | uvec3(255, 9, 10) | uvec3(2, 10, 255) | uvec3(0, 0, 8) | uvec3(10, 8, 12) | uvec3(8, 12, 0) | uvec3(12, 255, 193) | uvec3(3, 193, 45) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_to_uvec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ false | true ];
+ input bool in1 = [ false | true ];
+ input bool in2 = [ true | false ];
+ output uvec3 out0 = [ uvec3(0, 0, 1) | uvec3(1, 1, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_to_uvec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false | true | false | false | true | false | true | true | false ];
+ input float in1 = [ 36.8125 | 20.125 | 1.0 | 0.0 | 3.5 | 1.0 | 2.0 | 0.5 | 0.0 | 8.25 ];
+ input int in2 = [ 1 | 0 | 8 | 66 | 2 | 11 | 192 | 5 | 12 | 255 ];
+ output uvec3 out0 = [ uvec3(1, 36, 1) | uvec3(0, 20, 0) | uvec3(1, 1, 8) | uvec3(0, 0, 66) | uvec3(0, 3, 2) | uvec3(1, 1, 11) | uvec3(0, 2, 192) | uvec3(1, 0, 5) | uvec3(1, 0, 12) | uvec3(0, 8, 255) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bool_to_uvec3
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(32.0, 64.0) | vec2(0.5, 2.25) | vec2(1.0, 1.25) | vec2(0.75, 0.0322580645161) ];
+ input bool in1 = [ false | false | true | true | true ];
+ output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(32, 64, 0) | uvec3(0, 2, 1) | uvec3(1, 1, 1) | uvec3(0, 0, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_float_to_uvec3
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, false) ];
+ input float in1 = [ 8.25 | 36.8125 | 20.125 | 2.0 | 0.0 | 1.0 | 0.5 | 3.5 ];
+ output uvec3 out0 = [ uvec3(1, 1, 8) | uvec3(1, 0, 36) | uvec3(0, 1, 20) | uvec3(0, 0, 2) | uvec3(1, 0, 0) | uvec3(0, 1, 1) | uvec3(0, 0, 0) | uvec3(0, 0, 3) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_int_to_uvec3
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, true) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, false) ];
+ input int in1 = [ 255 | 1 | 2 | 5 | 0 | 11 | 192 | 12 | 8 | 66 ];
+ output uvec3 out0 = [ uvec3(1, 1, 255) | uvec3(0, 1, 1) | uvec3(0, 0, 2) | uvec3(1, 1, 5) | uvec3(0, 0, 0) | uvec3(1, 0, 11) | uvec3(0, 0, 192) | uvec3(0, 0, 12) | uvec3(0, 1, 8) | uvec3(1, 0, 66) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_ivec2_to_uvec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false | true | true | false ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, 2) | ivec2(1, 1) | ivec2(0, 0) | ivec2(32, 64) ];
+ output uvec3 out0 = [ uvec3(1, 0, 0) | uvec3(0, 0, 2) | uvec3(1, 1, 1) | uvec3(1, 0, 0) | uvec3(0, 32, 64) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_uvec2_to_uvec3
+ version 300 es
+ values
+ {
+ input float in0 = [ 2.0 | 8.25 | 20.125 | 3.5 | 0.0 | 0.5 | 36.8125 | 1.0 ];
+ input uvec2 in1 = [ uvec2(0, 2) | uvec2(1, 1) | uvec2(32, 64) | uvec2(0, 0) | uvec2(0, 2) | uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 0) ];
+ output uvec3 out0 = [ uvec3(2, 0, 2) | uvec3(8, 1, 1) | uvec3(20, 32, 64) | uvec3(3, 0, 0) | uvec3(0, 0, 2) | uvec3(0, 0, 0) | uvec3(36, 1, 1) | uvec3(1, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_to_vec2
+ version 300 es
+ values
+ {
+ input float in0 = [ -0.5 | -20.125 | 1.0 | 2.0 | 3.5 | 36.8125 | -8.25 | 0.0 ];
+ input float in1 = [ 1.0 | -20.125 | 0.0 | 3.5 | -8.25 | 36.8125 | -0.5 | 2.0 ];
+ output vec2 out0 = [ vec2(-0.5, 1.0) | vec2(-20.125, -20.125) | vec2(1.0, 0.0) | vec2(2.0, 3.5) | vec2(3.5, -8.25) | vec2(36.8125, 36.8125) | vec2(-8.25, -0.5) | vec2(0.0, 2.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_to_ivec2
+ version 300 es
+ values
+ {
+ input float in0 = [ -0.5 | -20.125 | 1.0 | 2.0 | 3.5 | 36.8125 | -8.25 | 0.0 ];
+ input float in1 = [ 1.0 | -20.125 | 0.0 | 3.5 | -8.25 | 36.8125 | -0.5 | 2.0 ];
+ output ivec2 out0 = [ ivec2(0, 1) | ivec2(-20, -20) | ivec2(1, 0) | ivec2(2, 3) | ivec2(3, -8) | ivec2(36, 36) | ivec2(-8, 0) | ivec2(0, 2) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_to_bvec2
+ version 300 es
+ values
+ {
+ input float in0 = [ -0.5 | -20.125 | 1.0 | 2.0 | 3.5 | 36.8125 | -8.25 | 0.0 ];
+ input float in1 = [ 1.0 | -20.125 | 0.0 | 3.5 | -8.25 | 36.8125 | -0.5 | 2.0 ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(false, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_to_vec2
+ version 300 es
+ values
+ {
+ input int in0 = [ 2 | -66 | 0 | 5 | -12 | 8 | -192 | 1 | 11 | 255 ];
+ input int in1 = [ -192 | 8 | 1 | 0 | 5 | -66 | 2 | 255 | 11 | -12 ];
+ output vec2 out0 = [ vec2(2.0, -192.0) | vec2(-66.0, 8.0) | vec2(0.0, 1.0) | vec2(5.0, 0.0) | vec2(-12.0, 5.0) | vec2(8.0, -66.0) | vec2(-192.0, 2.0) | vec2(1.0, 255.0) | vec2(11.0, 11.0) | vec2(255.0, -12.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_to_ivec2
+ version 300 es
+ values
+ {
+ input int in0 = [ 2 | -66 | 0 | 5 | -12 | 8 | -192 | 1 | 11 | 255 ];
+ input int in1 = [ -192 | 8 | 1 | 0 | 5 | -66 | 2 | 255 | 11 | -12 ];
+ output ivec2 out0 = [ ivec2(2, -192) | ivec2(-66, 8) | ivec2(0, 1) | ivec2(5, 0) | ivec2(-12, 5) | ivec2(8, -66) | ivec2(-192, 2) | ivec2(1, 255) | ivec2(11, 11) | ivec2(255, -12) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_to_bvec2
+ version 300 es
+ values
+ {
+ input int in0 = [ 2 | -66 | 0 | 5 | -12 | 8 | -192 | 1 | 11 | 255 ];
+ input int in1 = [ -192 | 8 | 1 | 0 | 5 | -66 | 2 | 255 | 11 | -12 ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, true) | bvec2(false, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uint_to_vec2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 9 | 12 | 0 | 255 | 8 | 45 | 3 | 2 | 10 | 193 ];
+ input uint in1 = [ 8 | 9 | 45 | 2 | 12 | 193 | 255 | 0 | 3 | 10 ];
+ output vec2 out0 = [ vec2(9.0, 8.0) | vec2(12.0, 9.0) | vec2(0.0, 45.0) | vec2(255.0, 2.0) | vec2(8.0, 12.0) | vec2(45.0, 193.0) | vec2(3.0, 255.0) | vec2(2.0, 0.0) | vec2(10.0, 3.0) | vec2(193.0, 10.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uint_to_ivec2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 9 | 12 | 0 | 255 | 8 | 45 | 3 | 2 | 10 | 193 ];
+ input uint in1 = [ 8 | 9 | 45 | 2 | 12 | 193 | 255 | 0 | 3 | 10 ];
+ output ivec2 out0 = [ ivec2(9, 8) | ivec2(12, 9) | ivec2(0, 45) | ivec2(255, 2) | ivec2(8, 12) | ivec2(45, 193) | ivec2(3, 255) | ivec2(2, 0) | ivec2(10, 3) | ivec2(193, 10) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uint_to_bvec2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 9 | 12 | 0 | 255 | 8 | 45 | 3 | 2 | 10 | 193 ];
+ input uint in1 = [ 8 | 9 | 45 | 2 | 12 | 193 | 255 | 0 | 3 | 10 ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_to_vec2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ true | false ];
+ output vec2 out0 = [ vec2(1.0, 1.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_to_ivec2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ true | false ];
+ output ivec2 out0 = [ ivec2(1, 1) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_to_bvec2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ true | false ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_int_to_vec2
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 3.5 | 0.0 | 2.0 | -8.25 | 36.8125 | -20.125 | 1.0 | 1.0 | -0.5 ];
+ input int in1 = [ -66 | 1 | 255 | -192 | 8 | 2 | 0 | 5 | -12 | 11 ];
+ output vec2 out0 = [ vec2(0.0, -66.0) | vec2(3.5, 1.0) | vec2(0.0, 255.0) | vec2(2.0, -192.0) | vec2(-8.25, 8.0) | vec2(36.8125, 2.0) | vec2(-20.125, 0.0) | vec2(1.0, 5.0) | vec2(1.0, -12.0) | vec2(-0.5, 11.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_int_to_ivec2
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 3.5 | 0.0 | 2.0 | -8.25 | 36.8125 | -20.125 | 1.0 | 1.0 | -0.5 ];
+ input int in1 = [ -66 | 1 | 255 | -192 | 8 | 2 | 0 | 5 | -12 | 11 ];
+ output ivec2 out0 = [ ivec2(0, -66) | ivec2(3, 1) | ivec2(0, 255) | ivec2(2, -192) | ivec2(-8, 8) | ivec2(36, 2) | ivec2(-20, 0) | ivec2(1, 5) | ivec2(1, -12) | ivec2(0, 11) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_int_to_bvec2
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 3.5 | 0.0 | 2.0 | -8.25 | 36.8125 | -20.125 | 1.0 | 1.0 | -0.5 ];
+ input int in1 = [ -66 | 1 | 255 | -192 | 8 | 2 | 0 | 5 | -12 | 11 ];
+ output bvec2 out0 = [ bvec2(false, true) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_bool_to_vec2
+ version 300 es
+ values
+ {
+ input float in0 = [ 2.0 | 3.5 | 1.0 | -20.125 | -8.25 | 0.0 | -0.5 | 36.8125 ];
+ input bool in1 = [ false | true | true | false | false | true | false | true ];
+ output vec2 out0 = [ vec2(2.0, 0.0) | vec2(3.5, 1.0) | vec2(1.0, 1.0) | vec2(-20.125, 0.0) | vec2(-8.25, 0.0) | vec2(0.0, 1.0) | vec2(-0.5, 0.0) | vec2(36.8125, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_bool_to_ivec2
+ version 300 es
+ values
+ {
+ input float in0 = [ 2.0 | 3.5 | 1.0 | -20.125 | -8.25 | 0.0 | -0.5 | 36.8125 ];
+ input bool in1 = [ false | true | true | false | false | true | false | true ];
+ output ivec2 out0 = [ ivec2(2, 0) | ivec2(3, 1) | ivec2(1, 1) | ivec2(-20, 0) | ivec2(-8, 0) | ivec2(0, 1) | ivec2(0, 0) | ivec2(36, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_bool_to_bvec2
+ version 300 es
+ values
+ {
+ input float in0 = [ 2.0 | 3.5 | 1.0 | -20.125 | -8.25 | 0.0 | -0.5 | 36.8125 ];
+ input bool in1 = [ false | true | true | false | false | true | false | true ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, false) | bvec2(false, true) | bvec2(true, false) | bvec2(true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_bool_to_vec2
+ version 300 es
+ values
+ {
+ input int in0 = [ 255 | 2 | -12 | 1 | -192 | 5 | 8 | 0 | -66 | 11 ];
+ input bool in1 = [ true | false | false | false | true | false | true | false | true | true ];
+ output vec2 out0 = [ vec2(255.0, 1.0) | vec2(2.0, 0.0) | vec2(-12.0, 0.0) | vec2(1.0, 0.0) | vec2(-192.0, 1.0) | vec2(5.0, 0.0) | vec2(8.0, 1.0) | vec2(0.0, 0.0) | vec2(-66.0, 1.0) | vec2(11.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_bool_to_ivec2
+ version 300 es
+ values
+ {
+ input int in0 = [ 255 | 2 | -12 | 1 | -192 | 5 | 8 | 0 | -66 | 11 ];
+ input bool in1 = [ true | false | false | false | true | false | true | false | true | true ];
+ output ivec2 out0 = [ ivec2(255, 1) | ivec2(2, 0) | ivec2(-12, 0) | ivec2(1, 0) | ivec2(-192, 1) | ivec2(5, 0) | ivec2(8, 1) | ivec2(0, 0) | ivec2(-66, 1) | ivec2(11, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_bool_to_bvec2
+ version 300 es
+ values
+ {
+ input int in0 = [ 255 | 2 | -12 | 1 | -192 | 5 | 8 | 0 | -66 | 11 ];
+ input bool in1 = [ true | false | false | false | true | false | true | false | true | true ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(true, false) | bvec2(true, false) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(false, false) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_uint_to_vec2
+ version 300 es
+ values
+ {
+ input int in0 = [ -66 | 1 | -192 | -12 | 5 | 255 | 11 | 0 | 2 | 8 ];
+ input uint in1 = [ 193 | 0 | 2 | 10 | 255 | 12 | 45 | 8 | 9 | 3 ];
+ output vec2 out0 = [ vec2(-66.0, 193.0) | vec2(1.0, 0.0) | vec2(-192.0, 2.0) | vec2(-12.0, 10.0) | vec2(5.0, 255.0) | vec2(255.0, 12.0) | vec2(11.0, 45.0) | vec2(0.0, 8.0) | vec2(2.0, 9.0) | vec2(8.0, 3.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_uint_to_ivec2
+ version 300 es
+ values
+ {
+ input int in0 = [ -66 | 1 | -192 | -12 | 5 | 255 | 11 | 0 | 2 | 8 ];
+ input uint in1 = [ 193 | 0 | 2 | 10 | 255 | 12 | 45 | 8 | 9 | 3 ];
+ output ivec2 out0 = [ ivec2(-66, 193) | ivec2(1, 0) | ivec2(-192, 2) | ivec2(-12, 10) | ivec2(5, 255) | ivec2(255, 12) | ivec2(11, 45) | ivec2(0, 8) | ivec2(2, 9) | ivec2(8, 3) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_uint_to_bvec2
+ version 300 es
+ values
+ {
+ input int in0 = [ -66 | 1 | -192 | -12 | 5 | 255 | 11 | 0 | 2 | 8 ];
+ input uint in1 = [ 193 | 0 | 2 | 10 | 255 | 12 | 45 | 8 | 9 | 3 ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_float_to_vec2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 12 | 0 | 8 | 193 | 3 | 10 | 9 | 2 | 45 | 255 ];
+ input float in1 = [ -20.125 | 0.0 | 3.5 | -8.25 | 0.0 | 1.0 | 2.0 | 36.8125 | -0.5 | 1.0 ];
+ output vec2 out0 = [ vec2(12.0, -20.125) | vec2(0.0, 0.0) | vec2(8.0, 3.5) | vec2(193.0, -8.25) | vec2(3.0, 0.0) | vec2(10.0, 1.0) | vec2(9.0, 2.0) | vec2(2.0, 36.8125) | vec2(45.0, -0.5) | vec2(255.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_float_to_ivec2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 12 | 0 | 8 | 193 | 3 | 10 | 9 | 2 | 45 | 255 ];
+ input float in1 = [ -20.125 | 0.0 | 3.5 | -8.25 | 0.0 | 1.0 | 2.0 | 36.8125 | -0.5 | 1.0 ];
+ output ivec2 out0 = [ ivec2(12, -20) | ivec2(0, 0) | ivec2(8, 3) | ivec2(193, -8) | ivec2(3, 0) | ivec2(10, 1) | ivec2(9, 2) | ivec2(2, 36) | ivec2(45, 0) | ivec2(255, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_float_to_bvec2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 12 | 0 | 8 | 193 | 3 | 10 | 9 | 2 | 45 | 255 ];
+ input float in1 = [ -20.125 | 0.0 | 3.5 | -8.25 | 0.0 | 1.0 | 2.0 | 36.8125 | -0.5 | 1.0 ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_to_uvec2
+ version 300 es
+ values
+ {
+ input float in0 = [ 8.25 | 36.8125 | 1.0 | 0.5 | 20.125 | 0.0 | 2.0 | 3.5 ];
+ input float in1 = [ 0.5 | 36.8125 | 0.0 | 2.0 | 8.25 | 20.125 | 1.0 | 3.5 ];
+ output uvec2 out0 = [ uvec2(8, 0) | uvec2(36, 36) | uvec2(1, 0) | uvec2(0, 2) | uvec2(20, 8) | uvec2(0, 20) | uvec2(2, 1) | uvec2(3, 3) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_to_uvec2
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 12 | 8 | 11 | 255 | 66 | 192 | 2 | 5 | 1 ];
+ input int in1 = [ 11 | 12 | 2 | 5 | 66 | 192 | 255 | 0 | 1 | 8 ];
+ output uvec2 out0 = [ uvec2(0, 11) | uvec2(12, 12) | uvec2(8, 2) | uvec2(11, 5) | uvec2(255, 66) | uvec2(66, 192) | uvec2(192, 255) | uvec2(2, 0) | uvec2(5, 1) | uvec2(1, 8) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uint_to_uvec2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 3 | 9 | 10 | 193 | 8 | 0 | 255 | 45 | 2 | 12 ];
+ input uint in1 = [ 0 | 2 | 12 | 3 | 10 | 9 | 45 | 193 | 255 | 8 ];
+ output uvec2 out0 = [ uvec2(3, 0) | uvec2(9, 2) | uvec2(10, 12) | uvec2(193, 3) | uvec2(8, 10) | uvec2(0, 9) | uvec2(255, 45) | uvec2(45, 193) | uvec2(2, 255) | uvec2(12, 8) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_to_uvec2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ true | false ];
+ output uvec2 out0 = [ uvec2(1, 1) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_int_to_uvec2
+ version 300 es
+ values
+ {
+ input float in0 = [ 8.25 | 1.0 | 0.5 | 3.5 | 2.0 | 0.0 | 36.8125 | 1.0 | 0.0 | 20.125 ];
+ input int in1 = [ 0 | 255 | 12 | 5 | 192 | 2 | 66 | 11 | 1 | 8 ];
+ output uvec2 out0 = [ uvec2(8, 0) | uvec2(1, 255) | uvec2(0, 12) | uvec2(3, 5) | uvec2(2, 192) | uvec2(0, 2) | uvec2(36, 66) | uvec2(1, 11) | uvec2(0, 1) | uvec2(20, 8) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_bool_to_uvec2
+ version 300 es
+ values
+ {
+ input float in0 = [ 3.5 | 1.0 | 8.25 | 0.5 | 2.0 | 36.8125 | 0.0 | 20.125 ];
+ input bool in1 = [ true | false | true | false | true | false | false | true ];
+ output uvec2 out0 = [ uvec2(3, 1) | uvec2(1, 0) | uvec2(8, 1) | uvec2(0, 0) | uvec2(2, 1) | uvec2(36, 0) | uvec2(0, 0) | uvec2(20, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_bool_to_uvec2
+ version 300 es
+ values
+ {
+ input int in0 = [ 12 | 11 | 0 | 5 | 8 | 255 | 2 | 1 | 66 | 192 ];
+ input bool in1 = [ true | true | false | false | false | true | false | false | true | true ];
+ output uvec2 out0 = [ uvec2(12, 1) | uvec2(11, 1) | uvec2(0, 0) | uvec2(5, 0) | uvec2(8, 0) | uvec2(255, 1) | uvec2(2, 0) | uvec2(1, 0) | uvec2(66, 1) | uvec2(192, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_uint_to_uvec2
+ version 300 es
+ values
+ {
+ input int in0 = [ 8 | 5 | 1 | 0 | 11 | 12 | 192 | 66 | 255 | 2 ];
+ input uint in1 = [ 8 | 10 | 45 | 255 | 9 | 193 | 2 | 3 | 0 | 12 ];
+ output uvec2 out0 = [ uvec2(8, 8) | uvec2(5, 10) | uvec2(1, 45) | uvec2(0, 255) | uvec2(11, 9) | uvec2(12, 193) | uvec2(192, 2) | uvec2(66, 3) | uvec2(255, 0) | uvec2(2, 12) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_float_to_uvec2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 9 | 45 | 8 | 3 | 10 | 2 | 193 | 12 | 255 | 0 ];
+ input float in1 = [ 3.5 | 20.125 | 2.0 | 0.0 | 1.0 | 36.8125 | 8.25 | 1.0 | 0.0 | 0.5 ];
+ output uvec2 out0 = [ uvec2(9, 3) | uvec2(45, 20) | uvec2(8, 2) | uvec2(3, 0) | uvec2(10, 1) | uvec2(2, 36) | uvec2(193, 8) | uvec2(12, 1) | uvec2(255, 0) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # vector_combine
+group matrix_combine "Matrix Combine Constructors"
+
+ case vec2_vec2_to_mat2
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(1.0, 1.25) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(0.0, 0.5) ];
+ input vec2 in1 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) ];
+ output mat2 out0 = [ mat2(1.0, 1.25, 0.0, 0.5) | mat2(-32.0, 64.0, 1.0, 1.25) | mat2(-0.5, -2.25, -0.75, -0.0322580645161) | mat2(-0.75, -0.0322580645161, -32.0, 64.0) | mat2(0.0, 0.5, -0.5, -2.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_bvec2_to_mat2
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(false, true) | bvec2(true, true) | bvec2(true, false) | bvec2(false, false) | bvec2(false, false) ];
+ input bvec2 in1 = [ bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, true) ];
+ output mat2 out0 = [ mat2(0.0, 1.0, 0.0, 0.0) | mat2(1.0, 1.0, 1.0, 0.0) | mat2(1.0, 0.0, 0.0, 0.0) | mat2(0.0, 0.0, 1.0, 1.0) | mat2(0.0, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_float_to_mat2
+ version 300 es
+ values
+ {
+ input float in0 = [ -8.25 | 3.5 | 36.8125 | 2.0 | -20.125 | 1.0 | -0.5 | 0.0 ];
+ input float in1 = [ 3.5 | -20.125 | 1.0 | 0.0 | -8.25 | 2.0 | 36.8125 | -0.5 ];
+ input float in2 = [ 36.8125 | 3.5 | 0.0 | -20.125 | -0.5 | -8.25 | 1.0 | 2.0 ];
+ input float in3 = [ -0.5 | 0.0 | -8.25 | -20.125 | 2.0 | 3.5 | 1.0 | 36.8125 ];
+ output mat2 out0 = [ mat2(-8.25, 3.5, 36.8125, -0.5) | mat2(3.5, -20.125, 3.5, 0.0) | mat2(36.8125, 1.0, 0.0, -8.25) | mat2(2.0, 0.0, -20.125, -20.125) | mat2(-20.125, -8.25, -0.5, 2.0) | mat2(1.0, 2.0, -8.25, 3.5) | mat2(-0.5, 36.8125, 1.0, 1.0) | mat2(0.0, -0.5, 2.0, 36.8125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_int_to_mat2
+ version 300 es
+ values
+ {
+ input int in0 = [ 2 | 1 | -192 | 11 | -66 | 255 | 0 | 8 | -12 | 5 ];
+ input int in1 = [ 11 | 255 | 5 | -66 | 8 | 2 | 0 | -12 | 1 | -192 ];
+ input int in2 = [ 11 | 1 | -12 | 255 | 5 | 0 | 8 | -192 | 2 | -66 ];
+ input int in3 = [ 2 | 1 | 0 | 8 | 255 | -66 | -192 | 11 | 5 | -12 ];
+ output mat2 out0 = [ mat2(2.0, 11.0, 11.0, 2.0) | mat2(1.0, 255.0, 1.0, 1.0) | mat2(-192.0, 5.0, -12.0, 0.0) | mat2(11.0, -66.0, 255.0, 8.0) | mat2(-66.0, 8.0, 5.0, 255.0) | mat2(255.0, 2.0, 0.0, -66.0) | mat2(0.0, 0.0, 8.0, -192.0) | mat2(8.0, -12.0, -192.0, 11.0) | mat2(-12.0, 1.0, 2.0, 5.0) | mat2(5.0, -192.0, -66.0, -12.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uint_uint_uint_to_mat2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 193 | 9 | 12 | 45 | 10 | 2 | 8 | 3 | 255 | 0 ];
+ input uint in1 = [ 0 | 255 | 12 | 193 | 3 | 2 | 45 | 9 | 8 | 10 ];
+ input uint in2 = [ 3 | 9 | 10 | 2 | 12 | 193 | 255 | 0 | 8 | 45 ];
+ input uint in3 = [ 45 | 12 | 9 | 3 | 2 | 255 | 10 | 8 | 193 | 0 ];
+ output mat2 out0 = [ mat2(193.0, 0.0, 3.0, 45.0) | mat2(9.0, 255.0, 9.0, 12.0) | mat2(12.0, 12.0, 10.0, 9.0) | mat2(45.0, 193.0, 2.0, 3.0) | mat2(10.0, 3.0, 12.0, 2.0) | mat2(2.0, 2.0, 193.0, 255.0) | mat2(8.0, 45.0, 255.0, 10.0) | mat2(3.0, 9.0, 0.0, 8.0) | mat2(255.0, 8.0, 8.0, 193.0) | mat2(0.0, 10.0, 45.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_bool_to_mat2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ true | false ];
+ input bool in2 = [ true | false ];
+ input bool in3 = [ false | true ];
+ output mat2 out0 = [ mat2(1.0, 1.0, 1.0, 0.0) | mat2(0.0, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_bool_to_mat2
+ version 300 es
+ values
+ {
+ input bool in0 = [ false | true | false | true | true | false | true | true | false | false ];
+ input float in1 = [ 2.0 | -0.5 | 0.0 | 1.0 | 1.0 | 36.8125 | 3.5 | 0.0 | -8.25 | -20.125 ];
+ input int in2 = [ 0 | -12 | 8 | -192 | 1 | -66 | 5 | 11 | 2 | 255 ];
+ input bool in3 = [ true | false | true | false | true | false | false | true | true | false ];
+ output mat2 out0 = [ mat2(0.0, 2.0, 0.0, 1.0) | mat2(1.0, -0.5, -12.0, 0.0) | mat2(0.0, 0.0, 8.0, 1.0) | mat2(1.0, 1.0, -192.0, 0.0) | mat2(1.0, 1.0, 1.0, 1.0) | mat2(0.0, 36.8125, -66.0, 0.0) | mat2(1.0, 3.5, 5.0, 0.0) | mat2(1.0, 0.0, 11.0, 1.0) | mat2(0.0, -8.25, 2.0, 1.0) | mat2(0.0, -20.125, 255.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_to_mat2
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(1.0, 1.25) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(0.0, 0.5) ];
+ input ivec2 in1 = [ ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) ];
+ output mat2 out0 = [ mat2(1.0, 1.25, 0.0, -2.0) | mat2(-32.0, 64.0, 0.0, 0.0) | mat2(-0.5, -2.25, 0.0, 0.0) | mat2(-0.75, -0.0322580645161, -32.0, 64.0) | mat2(0.0, 0.5, 1.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bvec2_to_mat2
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(0.0, 0.5) ];
+ input bvec2 in1 = [ bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) ];
+ output mat2 out0 = [ mat2(-0.5, -2.25, 0.0, 0.0) | mat2(-32.0, 64.0, 1.0, 0.0) | mat2(1.0, 1.25, 0.0, 0.0) | mat2(-0.75, -0.0322580645161, 0.0, 1.0) | mat2(0.0, 0.5, 1.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_float_to_mat2
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, false, false) | bvec3(false, true, false) | bvec3(false, false, false) | bvec3(false, false, false) ];
+ input float in1 = [ 36.8125 | -8.25 | 1.0 | -0.5 | 2.0 | -20.125 | 0.0 | 3.5 ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 36.8125) | mat2(0.0, 1.0, 0.0, -8.25) | mat2(0.0, 0.0, 0.0, 1.0) | mat2(1.0, 1.0, 1.0, -0.5) | mat2(1.0, 0.0, 0.0, 2.0) | mat2(0.0, 1.0, 0.0, -20.125) | mat2(0.0, 0.0, 0.0, 0.0) | mat2(0.0, 0.0, 0.0, 3.5) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_float_to_mat2
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-0.5, -2.25, -4.875) | vec3(1.0, 1.25, 1.125) | vec3(0.0, 0.5, 0.75) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.5, 0.75) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ input float in1 = [ -0.5 | -20.125 | 0.0 | 36.8125 | 3.5 | -8.25 | 2.0 | 1.0 ];
+ output mat2 out0 = [ mat2(1.0, 1.25, 1.125, -0.5) | mat2(-0.5, -2.25, -4.875, -20.125) | mat2(-0.5, -2.25, -4.875, 0.0) | mat2(1.0, 1.25, 1.125, 36.8125) | mat2(0.0, 0.5, 0.75, 3.5) | mat2(-32.0, 64.0, -51.0, -8.25) | mat2(0.0, 0.5, 0.75, 2.0) | mat2(-0.75, -0.0322580645161, 0.0526315789474, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_ivec2_int_to_mat2
+ version 300 es
+ values
+ {
+ input int in0 = [ 8 | -192 | 2 | 0 | -66 | 255 | 5 | 1 | -12 | 11 ];
+ input ivec2 in1 = [ ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, -2) | ivec2(1, 1) | ivec2(1, 1) ];
+ input int in2 = [ 2 | 1 | -12 | 0 | 11 | 8 | 255 | -192 | 5 | -66 ];
+ output mat2 out0 = [ mat2(8.0, 0.0, -2.0, 2.0) | mat2(-192.0, 0.0, 0.0, 1.0) | mat2(2.0, -32.0, 64.0, -12.0) | mat2(0.0, 0.0, 0.0, 0.0) | mat2(-66.0, 0.0, 0.0, 11.0) | mat2(255.0, -32.0, 64.0, 8.0) | mat2(5.0, 0.0, 0.0, 255.0) | mat2(1.0, 0.0, -2.0, -192.0) | mat2(-12.0, 1.0, 1.0, 5.0) | mat2(11.0, 1.0, 1.0, -66.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_ivec2_to_mat2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | true | true | false | false | true | false | false ];
+ input float in1 = [ 1.0 | -0.5 | -20.125 | 36.8125 | 2.0 | 0.0 | -8.25 | 3.5 ];
+ input ivec2 in2 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, -2) ];
+ output mat2 out0 = [ mat2(1.0, 1.0, 0.0, 0.0) | mat2(1.0, -0.5, 0.0, 0.0) | mat2(1.0, -20.125, 1.0, 1.0) | mat2(0.0, 36.8125, 0.0, 0.0) | mat2(0.0, 2.0, 1.0, 1.0) | mat2(1.0, 0.0, 0.0, -2.0) | mat2(0.0, -8.25, -32.0, 64.0) | mat2(0.0, 3.5, 0.0, -2.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_uvec3_to_mat2
+ version 300 es
+ values
+ {
+ input float in0 = [ 36.8125 | 2.0 | -0.5 | 0.0 | -20.125 | 1.0 | 3.5 | -8.25 ];
+ input uvec3 in1 = [ uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(0, 2, 4) | uvec3(0, 0, 0) | uvec3(32, 64, 51) | uvec3(0, 0, 0) | uvec3(0, 0, 0) | uvec3(1, 1, 1) ];
+ output mat2 out0 = [ mat2(36.8125, 1.0, 1.0, 1.0) | mat2(2.0, 0.0, 2.0, 4.0) | mat2(-0.5, 0.0, 2.0, 4.0) | mat2(0.0, 0.0, 0.0, 0.0) | mat2(-20.125, 32.0, 64.0, 51.0) | mat2(1.0, 0.0, 0.0, 0.0) | mat2(3.5, 0.0, 0.0, 0.0) | mat2(-8.25, 1.0, 1.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_uvec2_bool_to_mat2
+ version 300 es
+ values
+ {
+ input int in0 = [ 1 | -66 | 5 | -192 | 11 | 0 | 8 | 2 | -12 | 255 ];
+ input uvec2 in1 = [ uvec2(0, 2) | uvec2(32, 64) | uvec2(1, 1) | uvec2(0, 0) | uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(0, 0) | uvec2(0, 0) | uvec2(32, 64) ];
+ input bool in2 = [ true | false | true | false | false | false | true | true | true | false ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 2.0, 1.0) | mat2(-66.0, 32.0, 64.0, 0.0) | mat2(5.0, 1.0, 1.0, 1.0) | mat2(-192.0, 0.0, 0.0, 0.0) | mat2(11.0, 0.0, 0.0, 0.0) | mat2(0.0, 1.0, 1.0, 0.0) | mat2(8.0, 0.0, 2.0, 1.0) | mat2(2.0, 0.0, 0.0, 1.0) | mat2(-12.0, 0.0, 0.0, 1.0) | mat2(255.0, 32.0, 64.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_vec3_to_mat2x3
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(1.0, 1.25, 1.125) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.5, 0.75) ];
+ input vec3 in1 = [ vec3(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output mat2x3 out0 = [ mat2x3(1.0, 1.25, 1.125, -32.0, 64.0, -51.0) | mat2x3(-0.75, -0.0322580645161, 0.0526315789474, -0.5, -2.25, -4.875) | mat2x3(-0.5, -2.25, -4.875, 0.0, 0.5, 0.75) | mat2x3(-32.0, 64.0, -51.0, 1.0, 1.25, 1.125) | mat2x3(0.0, 0.5, 0.75, -0.75, -0.0322580645161, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_bvec3_to_mat2x3
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, true, false) | bvec3(true, false, false) ];
+ input bvec3 in1 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) ];
+ output mat2x3 out0 = [ mat2x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x3(0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat2x3(1.0, 1.0, 1.0, 1.0, 0.0, 0.0) | mat2x3(0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_float_float_float_to_mat2x3
+ version 300 es
+ values
+ {
+ input float in0 = [ 1.0 | -8.25 | -20.125 | 36.8125 | -0.5 | 2.0 | 3.5 | 0.0 ];
+ input float in1 = [ -0.5 | -20.125 | 36.8125 | -8.25 | 2.0 | 1.0 | 3.5 | 0.0 ];
+ input float in2 = [ 3.5 | 1.0 | 36.8125 | -20.125 | -8.25 | -0.5 | 2.0 | 0.0 ];
+ input float in3 = [ 1.0 | -8.25 | 0.0 | -20.125 | 2.0 | 3.5 | -0.5 | 36.8125 ];
+ input float in4 = [ 1.0 | 0.0 | 3.5 | 2.0 | -8.25 | -20.125 | -0.5 | 36.8125 ];
+ input float in5 = [ 2.0 | -20.125 | -8.25 | -0.5 | 3.5 | 1.0 | 36.8125 | 0.0 ];
+ output mat2x3 out0 = [ mat2x3(1.0, -0.5, 3.5, 1.0, 1.0, 2.0) | mat2x3(-8.25, -20.125, 1.0, -8.25, 0.0, -20.125) | mat2x3(-20.125, 36.8125, 36.8125, 0.0, 3.5, -8.25) | mat2x3(36.8125, -8.25, -20.125, -20.125, 2.0, -0.5) | mat2x3(-0.5, 2.0, -8.25, 2.0, -8.25, 3.5) | mat2x3(2.0, 1.0, -0.5, 3.5, -20.125, 1.0) | mat2x3(3.5, 3.5, 2.0, -0.5, -0.5, 36.8125) | mat2x3(0.0, 0.0, 0.0, 36.8125, 36.8125, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_int_int_int_to_mat2x3
+ version 300 es
+ values
+ {
+ input int in0 = [ 2 | 8 | -192 | 0 | 5 | -12 | 1 | 255 | -66 | 11 ];
+ input int in1 = [ 1 | -192 | 8 | 0 | -12 | 2 | 11 | 255 | -66 | 5 ];
+ input int in2 = [ -192 | 2 | -66 | 8 | 11 | 255 | 0 | 5 | -12 | 1 ];
+ input int in3 = [ 2 | 11 | 255 | 0 | -66 | -12 | 5 | -192 | 8 | 1 ];
+ input int in4 = [ 8 | 0 | -12 | -192 | 2 | -66 | 1 | 255 | 5 | 11 ];
+ input int in5 = [ 0 | 11 | 5 | 8 | -12 | 255 | -192 | 2 | 1 | -66 ];
+ output mat2x3 out0 = [ mat2x3(2.0, 1.0, -192.0, 2.0, 8.0, 0.0) | mat2x3(8.0, -192.0, 2.0, 11.0, 0.0, 11.0) | mat2x3(-192.0, 8.0, -66.0, 255.0, -12.0, 5.0) | mat2x3(0.0, 0.0, 8.0, 0.0, -192.0, 8.0) | mat2x3(5.0, -12.0, 11.0, -66.0, 2.0, -12.0) | mat2x3(-12.0, 2.0, 255.0, -12.0, -66.0, 255.0) | mat2x3(1.0, 11.0, 0.0, 5.0, 1.0, -192.0) | mat2x3(255.0, 255.0, 5.0, -192.0, 255.0, 2.0) | mat2x3(-66.0, -66.0, -12.0, 8.0, 5.0, 1.0) | mat2x3(11.0, 5.0, 1.0, 1.0, 11.0, -66.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_bool_bool_bool_to_mat2x3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ false | true ];
+ input bool in2 = [ false | true ];
+ input bool in3 = [ true | false ];
+ input bool in4 = [ true | false ];
+ input bool in5 = [ true | false ];
+ output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat2x3(0.0, 1.0, 1.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_bool_float_int_to_mat2x3
+ version 300 es
+ values
+ {
+ input bool in0 = [ false | true | false | true | false | true | false | true | true | false ];
+ input float in1 = [ 0.0 | -8.25 | 2.0 | -20.125 | 3.5 | 0.0 | -0.5 | 36.8125 | 1.0 | 1.0 ];
+ input int in2 = [ -66 | -12 | 2 | 8 | 255 | 11 | -192 | 1 | 5 | 0 ];
+ input bool in3 = [ true | false | true | false | false | true | true | false | true | false ];
+ input float in4 = [ 1.0 | 0.0 | -8.25 | 1.0 | 3.5 | -20.125 | -0.5 | 0.0 | 2.0 | 36.8125 ];
+ input int in5 = [ 255 | -192 | 1 | 2 | -12 | -66 | 8 | 0 | 11 | 5 ];
+ output mat2x3 out0 = [ mat2x3(0.0, 0.0, -66.0, 1.0, 1.0, 255.0) | mat2x3(1.0, -8.25, -12.0, 0.0, 0.0, -192.0) | mat2x3(0.0, 2.0, 2.0, 1.0, -8.25, 1.0) | mat2x3(1.0, -20.125, 8.0, 0.0, 1.0, 2.0) | mat2x3(0.0, 3.5, 255.0, 0.0, 3.5, -12.0) | mat2x3(1.0, 0.0, 11.0, 1.0, -20.125, -66.0) | mat2x3(0.0, -0.5, -192.0, 1.0, -0.5, 8.0) | mat2x3(1.0, 36.8125, 1.0, 0.0, 0.0, 0.0) | mat2x3(1.0, 1.0, 5.0, 1.0, 2.0, 11.0) | mat2x3(0.0, 1.0, 0.0, 0.0, 36.8125, 5.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_ivec3_to_mat2x3
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.5, 0.75) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ input ivec3 in1 = [ ivec3(1, 1, 1) | ivec3(-32, 64, -51) | ivec3(0, -2, -4) | ivec3(0, 0, 0) | ivec3(0, 0, 0) ];
+ output mat2x3 out0 = [ mat2x3(1.0, 1.25, 1.125, 1.0, 1.0, 1.0) | mat2x3(-0.5, -2.25, -4.875, -32.0, 64.0, -51.0) | mat2x3(-32.0, 64.0, -51.0, 0.0, -2.0, -4.0) | mat2x3(0.0, 0.5, 0.75, 0.0, 0.0, 0.0) | mat2x3(-0.75, -0.0322580645161, 0.0526315789474, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bvec4_to_mat2x3
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(-32.0, 64.0) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) ];
+ input bvec4 in1 = [ bvec4(true, false, false, true) | bvec4(false, true, false, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output mat2x3 out0 = [ mat2x3(-32.0, 64.0, 1.0, 0.0, 0.0, 1.0) | mat2x3(0.0, 0.5, 0.0, 1.0, 0.0, 0.0) | mat2x3(-0.5, -2.25, 0.0, 0.0, 0.0, 1.0) | mat2x3(1.0, 1.25, 1.0, 1.0, 1.0, 1.0) | mat2x3(-0.75, -0.0322580645161, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_float_ivec2_to_mat2x3
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, false, false) | bvec3(false, true, false) ];
+ input float in1 = [ 1.0 | -8.25 | 36.8125 | 2.0 | 3.5 | -0.5 | -20.125 | 0.0 ];
+ input ivec2 in2 = [ ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) ];
+ output mat2x3 out0 = [ mat2x3(0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat2x3(0.0, 0.0, 0.0, -8.25, 0.0, 0.0) | mat2x3(1.0, 1.0, 1.0, 36.8125, -32.0, 64.0) | mat2x3(1.0, 0.0, 0.0, 2.0, 0.0, -2.0) | mat2x3(0.0, 0.0, 0.0, 3.5, 1.0, 1.0) | mat2x3(0.0, 1.0, 0.0, -0.5, 0.0, -2.0) | mat2x3(1.0, 0.0, 0.0, -20.125, 0.0, 0.0) | mat2x3(0.0, 1.0, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_float_bvec2_to_mat2x3
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ];
+ input float in1 = [ 0.0 | 36.8125 | 3.5 | -0.5 | -8.25 | 2.0 | 1.0 | -20.125 ];
+ input bvec2 in2 = [ bvec2(false, false) | bvec2(false, true) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, false) ];
+ output mat2x3 out0 = [ mat2x3(0.0, 0.5, 0.75, 0.0, 0.0, 0.0) | mat2x3(-0.5, -2.25, -4.875, 36.8125, 0.0, 1.0) | mat2x3(0.0, 0.5, 0.75, 3.5, 1.0, 0.0) | mat2x3(1.0, 1.25, 1.125, -0.5, 0.0, 1.0) | mat2x3(-0.5, -2.25, -4.875, -8.25, 0.0, 0.0) | mat2x3(-0.75, -0.0322580645161, 0.0526315789474, 2.0, 1.0, 0.0) | mat2x3(-32.0, 64.0, -51.0, 1.0, 1.0, 1.0) | mat2x3(1.0, 1.25, 1.125, -20.125, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_vec3_vec2_to_mat2x4
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(-0.5, -2.25, -4.875) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-32.0, 64.0, -51.0) ];
+ input vec3 in1 = [ vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ];
+ input vec2 in2 = [ vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) ];
+ output mat2x4 out0 = [ mat2x4(-0.5, -2.25, -4.875, 0.0, 0.5, 0.75, -0.75, -0.0322580645161) | mat2x4(-0.75, -0.0322580645161, 0.0526315789474, -0.5, -2.25, -4.875, -32.0, 64.0) | mat2x4(0.0, 0.5, 0.75, -0.75, -0.0322580645161, 0.0526315789474, 1.0, 1.25) | mat2x4(1.0, 1.25, 1.125, -32.0, 64.0, -51.0, 0.0, 0.5) | mat2x4(-32.0, 64.0, -51.0, 1.0, 1.25, 1.125, -0.5, -2.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_ivec3_ivec2_to_mat2x4
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, -2, -4) | ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, 64, -51) ];
+ input ivec3 in1 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ input ivec2 in2 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, 64) ];
+ output mat2x4 out0 = [ mat2x4(0.0, -2.0, -4.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x4(0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, -2.0) | mat2x4(1.0, 1.0, 1.0, 0.0, -2.0, -4.0, 1.0, 1.0) | mat2x4(0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 0.0, 0.0) | mat2x4(-32.0, 64.0, -51.0, 0.0, 0.0, 0.0, -32.0, 64.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_float_float_int_bool_to_mat2x4
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) ];
+ input ivec2 in1 = [ ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) ];
+ input float in2 = [ -8.25 | -0.5 | 3.5 | 36.8125 | 0.0 | 0.0 | 2.0 | -20.125 | 1.0 | 1.0 ];
+ input float in3 = [ 1.0 | 2.0 | -0.5 | 3.5 | 36.8125 | -8.25 | 1.0 | 0.0 | 0.0 | -20.125 ];
+ input int in4 = [ 255 | 8 | 11 | -12 | -192 | 0 | 2 | 1 | -66 | 5 ];
+ input bool in5 = [ true | false | false | true | false | true | true | false | true | false ];
+ output mat2x4 out0 = [ mat2x4(0.0, 0.5, 1.0, 1.0, -8.25, 1.0, 255.0, 1.0) | mat2x4(-32.0, 64.0, 0.0, -2.0, -0.5, 2.0, 8.0, 0.0) | mat2x4(-0.5, -2.25, -32.0, 64.0, 3.5, -0.5, 11.0, 0.0) | mat2x4(0.0, 0.5, 0.0, -2.0, 36.8125, 3.5, -12.0, 1.0) | mat2x4(-32.0, 64.0, 0.0, 0.0, 0.0, 36.8125, -192.0, 0.0) | mat2x4(1.0, 1.25, 0.0, 0.0, 0.0, -8.25, 0.0, 1.0) | mat2x4(-0.75, -0.0322580645161, -32.0, 64.0, 2.0, 1.0, 2.0, 1.0) | mat2x4(1.0, 1.25, 0.0, 0.0, -20.125, 0.0, 1.0, 0.0) | mat2x4(-0.5, -2.25, 0.0, 0.0, 1.0, 0.0, -66.0, 1.0) | mat2x4(-0.75, -0.0322580645161, 1.0, 1.0, 1.0, -20.125, 5.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_vec2_bool_bvec2_to_mat2x4
+ version 300 es
+ values
+ {
+ input bool in0 = [ false | true | false | true | true | true | false | false | false | true ];
+ input float in1 = [ 0.0 | -0.5 | -20.125 | -8.25 | 0.0 | 2.0 | 3.5 | 1.0 | 1.0 | 36.8125 ];
+ input int in2 = [ 2 | 1 | 255 | 8 | -66 | 0 | -12 | 5 | -192 | 11 ];
+ input vec2 in3 = [ vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) ];
+ input bool in4 = [ true | false | false | true | false | false | true | true | true | false ];
+ input bvec2 in5 = [ bvec2(true, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, false) ];
+ output mat2x4 out0 = [ mat2x4(0.0, 0.0, 2.0, -32.0, 64.0, 1.0, 1.0, 0.0) | mat2x4(1.0, -0.5, 1.0, -0.5, -2.25, 0.0, 1.0, 1.0) | mat2x4(0.0, -20.125, 255.0, 1.0, 1.25, 0.0, 0.0, 1.0) | mat2x4(1.0, -8.25, 8.0, -0.75, -0.0322580645161, 1.0, 1.0, 1.0) | mat2x4(1.0, 0.0, -66.0, 0.0, 0.5, 0.0, 0.0, 0.0) | mat2x4(1.0, 2.0, 0.0, 1.0, 1.25, 0.0, 0.0, 1.0) | mat2x4(0.0, 3.5, -12.0, -32.0, 64.0, 1.0, 0.0, 0.0) | mat2x4(0.0, 1.0, 5.0, -0.5, -2.25, 1.0, 0.0, 0.0) | mat2x4(0.0, 1.0, -192.0, 0.0, 0.5, 1.0, 0.0, 0.0) | mat2x4(1.0, 36.8125, 11.0, -0.75, -0.0322580645161, 0.0, 1.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bvec2_int_vec4_to_mat2x4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | true | true | false | false | false | false | false | true | true ];
+ input bvec2 in1 = [ bvec2(true, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, true) | bvec2(false, false) ];
+ input int in2 = [ 8 | 1 | 5 | -66 | -192 | 11 | 255 | 0 | -12 | 2 ];
+ input vec4 in3 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) ];
+ output mat2x4 out0 = [ mat2x4(1.0, 1.0, 1.0, 8.0, 0.0, 0.5, 0.75, 0.825) | mat2x4(1.0, 0.0, 0.0, 1.0, 0.0, 0.5, 0.75, 0.825) | mat2x4(1.0, 1.0, 0.0, 5.0, -32.0, 64.0, -51.0, 24.0) | mat2x4(0.0, 0.0, 0.0, -66.0, 1.0, 1.25, 1.125, 1.75) | mat2x4(0.0, 1.0, 1.0, -192.0, -0.5, -2.25, -4.875, 9.0) | mat2x4(0.0, 1.0, 0.0, 11.0, 1.0, 1.25, 1.125, 1.75) | mat2x4(0.0, 0.0, 1.0, 255.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25) | mat2x4(0.0, 0.0, 0.0, 0.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25) | mat2x4(1.0, 0.0, 1.0, -12.0, -0.5, -2.25, -4.875, 9.0) | mat2x4(1.0, 0.0, 0.0, 2.0, -32.0, 64.0, -51.0, 24.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_bvec4_ivec2_bool_to_mat2x4
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 3.5 | 2.0 | -8.25 | -20.125 | 36.8125 | 1.0 | -0.5 ];
+ input bvec4 in1 = [ bvec4(true, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(false, true, false, false) | bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, false, false, false) ];
+ input ivec2 in2 = [ ivec2(0, -2) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(1, 1) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) ];
+ input bool in3 = [ true | true | false | true | false | false | false | true ];
+ output mat2x4 out0 = [ mat2x4(0.0, 1.0, 0.0, 0.0, 1.0, 0.0, -2.0, 1.0) | mat2x4(3.5, 1.0, 1.0, 1.0, 1.0, -32.0, 64.0, 1.0) | mat2x4(2.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0) | mat2x4(-8.25, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat2x4(-20.125, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x4(36.8125, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat2x4(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat2x4(-0.5, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_vec3_to_mat3x2
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ];
+ input vec3 in1 = [ vec3(1.0, 1.25, 1.125) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) ];
+ output mat3x2 out0 = [ mat3x2(-0.75, -0.0322580645161, 0.0526315789474, 1.0, 1.25, 1.125) | mat3x2(-0.5, -2.25, -4.875, -0.75, -0.0322580645161, 0.0526315789474) | mat3x2(0.0, 0.5, 0.75, -32.0, 64.0, -51.0) | mat3x2(-32.0, 64.0, -51.0, -0.5, -2.25, -4.875) | mat3x2(1.0, 1.25, 1.125, 0.0, 0.5, 0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_bvec3_to_mat3x2
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ input bvec3 in1 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, true, false) | bvec3(true, false, false) ];
+ output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat3x2(1.0, 1.0, 1.0, 0.0, 1.0, 0.0) | mat3x2(0.0, 0.0, 0.0, 1.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_float_float_float_to_mat3x2
+ version 300 es
+ values
+ {
+ input float in0 = [ -8.25 | 36.8125 | -20.125 | -0.5 | 3.5 | 1.0 | 2.0 | 0.0 ];
+ input float in1 = [ 2.0 | 3.5 | -20.125 | 36.8125 | 1.0 | 0.0 | -8.25 | -0.5 ];
+ input float in2 = [ -0.5 | 2.0 | 1.0 | 0.0 | -8.25 | 36.8125 | -20.125 | 3.5 ];
+ input float in3 = [ 36.8125 | 0.0 | 1.0 | -0.5 | 2.0 | 3.5 | -20.125 | -8.25 ];
+ input float in4 = [ 36.8125 | 2.0 | 0.0 | -0.5 | 3.5 | -20.125 | -8.25 | 1.0 ];
+ input float in5 = [ 0.0 | 36.8125 | -20.125 | -0.5 | 3.5 | 2.0 | 1.0 | -8.25 ];
+ output mat3x2 out0 = [ mat3x2(-8.25, 2.0, -0.5, 36.8125, 36.8125, 0.0) | mat3x2(36.8125, 3.5, 2.0, 0.0, 2.0, 36.8125) | mat3x2(-20.125, -20.125, 1.0, 1.0, 0.0, -20.125) | mat3x2(-0.5, 36.8125, 0.0, -0.5, -0.5, -0.5) | mat3x2(3.5, 1.0, -8.25, 2.0, 3.5, 3.5) | mat3x2(1.0, 0.0, 36.8125, 3.5, -20.125, 2.0) | mat3x2(2.0, -8.25, -20.125, -20.125, -8.25, 1.0) | mat3x2(0.0, -0.5, 3.5, -8.25, 1.0, -8.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_int_int_int_to_mat3x2
+ version 300 es
+ values
+ {
+ input int in0 = [ 8 | -192 | 2 | 11 | 255 | -66 | 5 | -12 | 1 | 0 ];
+ input int in1 = [ 1 | 2 | -12 | 5 | 0 | 255 | 8 | 11 | -192 | -66 ];
+ input int in2 = [ -12 | 11 | 2 | 1 | 8 | -66 | -192 | 5 | 255 | 0 ];
+ input int in3 = [ -192 | 0 | -12 | 11 | 1 | -66 | 8 | 255 | 2 | 5 ];
+ input int in4 = [ -12 | 5 | 0 | -66 | 255 | 8 | -192 | 11 | 2 | 1 ];
+ input int in5 = [ -66 | -12 | 8 | 2 | 255 | 0 | -192 | 11 | 1 | 5 ];
+ output mat3x2 out0 = [ mat3x2(8.0, 1.0, -12.0, -192.0, -12.0, -66.0) | mat3x2(-192.0, 2.0, 11.0, 0.0, 5.0, -12.0) | mat3x2(2.0, -12.0, 2.0, -12.0, 0.0, 8.0) | mat3x2(11.0, 5.0, 1.0, 11.0, -66.0, 2.0) | mat3x2(255.0, 0.0, 8.0, 1.0, 255.0, 255.0) | mat3x2(-66.0, 255.0, -66.0, -66.0, 8.0, 0.0) | mat3x2(5.0, 8.0, -192.0, 8.0, -192.0, -192.0) | mat3x2(-12.0, 11.0, 5.0, 255.0, 11.0, 11.0) | mat3x2(1.0, -192.0, 255.0, 2.0, 2.0, 1.0) | mat3x2(0.0, -66.0, 0.0, 5.0, 1.0, 5.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_bool_bool_bool_to_mat3x2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ false | true ];
+ input bool in2 = [ false | true ];
+ input bool in3 = [ false | true ];
+ input bool in4 = [ false | true ];
+ input bool in5 = [ false | true ];
+ output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(0.0, 1.0, 1.0, 1.0, 1.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_bool_float_int_to_mat3x2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false | true | true | false | true | false | true | false | false ];
+ input float in1 = [ -20.125 | 0.0 | 3.5 | 0.0 | 1.0 | -8.25 | 1.0 | 2.0 | 36.8125 | -0.5 ];
+ input int in2 = [ 255 | -66 | 8 | -192 | 5 | 11 | 1 | 2 | 0 | -12 ];
+ input bool in3 = [ true | false | false | true | false | true | true | false | false | true ];
+ input float in4 = [ 0.0 | -20.125 | 1.0 | -8.25 | 0.0 | -0.5 | 2.0 | 3.5 | 1.0 | 36.8125 ];
+ input int in5 = [ -192 | 8 | 2 | 255 | -66 | -12 | 11 | 0 | 5 | 1 ];
+ output mat3x2 out0 = [ mat3x2(1.0, -20.125, 255.0, 1.0, 0.0, -192.0) | mat3x2(0.0, 0.0, -66.0, 0.0, -20.125, 8.0) | mat3x2(1.0, 3.5, 8.0, 0.0, 1.0, 2.0) | mat3x2(1.0, 0.0, -192.0, 1.0, -8.25, 255.0) | mat3x2(0.0, 1.0, 5.0, 0.0, 0.0, -66.0) | mat3x2(1.0, -8.25, 11.0, 1.0, -0.5, -12.0) | mat3x2(0.0, 1.0, 1.0, 1.0, 2.0, 11.0) | mat3x2(1.0, 2.0, 2.0, 0.0, 3.5, 0.0) | mat3x2(0.0, 36.8125, 0.0, 0.0, 1.0, 5.0) | mat3x2(0.0, -0.5, -12.0, 1.0, 36.8125, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_ivec3_to_mat3x2
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) ];
+ input ivec3 in1 = [ ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output mat3x2 out0 = [ mat3x2(0.0, 0.5, 0.75, 1.0, 1.0, 1.0) | mat3x2(1.0, 1.25, 1.125, 0.0, 0.0, 0.0) | mat3x2(-0.75, -0.0322580645161, 0.0526315789474, 0.0, -2.0, -4.0) | mat3x2(-32.0, 64.0, -51.0, -32.0, 64.0, -51.0) | mat3x2(-0.5, -2.25, -4.875, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bvec4_to_mat3x2
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) ];
+ input bvec4 in1 = [ bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(false, false, false, false) | bvec4(true, false, false, true) | bvec4(false, true, false, false) ];
+ output mat3x2 out0 = [ mat3x2(0.0, 0.5, 1.0, 1.0, 1.0, 1.0) | mat3x2(-0.75, -0.0322580645161, 0.0, 0.0, 0.0, 1.0) | mat3x2(-32.0, 64.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(-0.5, -2.25, 1.0, 0.0, 0.0, 1.0) | mat3x2(1.0, 1.25, 0.0, 1.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_float_ivec2_to_mat3x2
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, false, false) | bvec3(false, true, false) | bvec3(true, false, false) ];
+ input float in1 = [ -8.25 | 1.0 | 2.0 | -0.5 | -20.125 | 0.0 | 36.8125 | 3.5 ];
+ input ivec2 in2 = [ ivec2(1, 1) | ivec2(1, 1) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(-32, 64) ];
+ output mat3x2 out0 = [ mat3x2(0.0, 0.0, 0.0, -8.25, 1.0, 1.0) | mat3x2(1.0, 1.0, 1.0, 1.0, 1.0, 1.0) | mat3x2(0.0, 0.0, 0.0, 2.0, 0.0, 0.0) | mat3x2(0.0, 0.0, 0.0, -0.5, 0.0, -2.0) | mat3x2(0.0, 1.0, 0.0, -20.125, 0.0, 0.0) | mat3x2(1.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(0.0, 1.0, 0.0, 36.8125, 0.0, -2.0) | mat3x2(1.0, 0.0, 0.0, 3.5, -32.0, 64.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_float_bvec2_to_mat3x2
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(1.0, 1.25, 1.125) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.5, 0.75) | vec3(0.0, 0.5, 0.75) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ input float in1 = [ -8.25 | 36.8125 | -0.5 | 3.5 | 2.0 | -20.125 | 0.0 | 1.0 ];
+ input bvec2 in2 = [ bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) | bvec2(false, true) | bvec2(false, true) | bvec2(true, false) | bvec2(false, false) ];
+ output mat3x2 out0 = [ mat3x2(1.0, 1.25, 1.125, -8.25, 1.0, 0.0) | mat3x2(1.0, 1.25, 1.125, 36.8125, 0.0, 0.0) | mat3x2(-0.5, -2.25, -4.875, -0.5, 1.0, 1.0) | mat3x2(-0.5, -2.25, -4.875, 3.5, 0.0, 0.0) | mat3x2(-32.0, 64.0, -51.0, 2.0, 0.0, 1.0) | mat3x2(0.0, 0.5, 0.75, -20.125, 0.0, 1.0) | mat3x2(0.0, 0.5, 0.75, 0.0, 1.0, 0.0) | mat3x2(-0.75, -0.0322580645161, 0.0526315789474, 1.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_vec3_vec3_to_mat3
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.5, 0.75) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ input vec3 in1 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(1.0, 1.25, 1.125) | vec3(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) ];
+ input vec3 in2 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) | vec3(1.0, 1.25, 1.125) | vec3(0.0, 0.5, 0.75) ];
+ output mat3 out0 = [ mat3(1.0, 1.25, 1.125, -0.75, -0.0322580645161, 0.0526315789474, -0.75, -0.0322580645161, 0.0526315789474) | mat3(-0.5, -2.25, -4.875, 1.0, 1.25, 1.125, -32.0, 64.0, -51.0) | mat3(-32.0, 64.0, -51.0, -32.0, 64.0, -51.0, -0.5, -2.25, -4.875) | mat3(0.0, 0.5, 0.75, -0.5, -2.25, -4.875, 1.0, 1.25, 1.125) | mat3(-0.75, -0.0322580645161, 0.0526315789474, 0.0, 0.5, 0.75, 0.0, 0.5, 0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_ivec3_ivec3_to_mat3
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(0, 0, 0) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ input ivec3 in1 = [ ivec3(0, 0, 0) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) | ivec3(1, 1, 1) ];
+ input ivec3 in2 = [ ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, 64, -51) | ivec3(0, -2, -4) | ivec3(0, 0, 0) ];
+ output mat3 out0 = [ mat3(1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat3(0.0, -2.0, -4.0, 0.0, -2.0, -4.0, 0.0, 0.0, 0.0) | mat3(0.0, 0.0, 0.0, -32.0, 64.0, -51.0, -32.0, 64.0, -51.0) | mat3(-32.0, 64.0, -51.0, 0.0, 0.0, 0.0, 0.0, -2.0, -4.0) | mat3(0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_float_float_int_bool_bool_to_mat3
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(-32, 64) ];
+ input float in2 = [ -0.5 | 3.5 | 0.0 | -20.125 | 1.0 | -8.25 | 0.0 | 1.0 | 2.0 | 36.8125 ];
+ input float in3 = [ 3.5 | 0.0 | -20.125 | 36.8125 | 2.0 | -8.25 | -0.5 | 1.0 | 0.0 | 1.0 ];
+ input int in4 = [ 0 | 11 | 5 | -192 | 8 | -66 | 1 | 2 | 255 | -12 ];
+ input bool in5 = [ true | true | true | false | true | false | false | false | true | false ];
+ input bool in6 = [ false | false | true | false | false | false | true | true | true | true ];
+ output mat3 out0 = [ mat3(1.0, 1.25, 0.0, 0.0, -0.5, 3.5, 0.0, 1.0, 0.0) | mat3(-0.5, -2.25, 0.0, -2.0, 3.5, 0.0, 11.0, 1.0, 0.0) | mat3(0.0, 0.5, 1.0, 1.0, 0.0, -20.125, 5.0, 1.0, 1.0) | mat3(-0.75, -0.0322580645161, 0.0, -2.0, -20.125, 36.8125, -192.0, 0.0, 0.0) | mat3(-32.0, 64.0, 0.0, 0.0, 1.0, 2.0, 8.0, 1.0, 0.0) | mat3(-0.75, -0.0322580645161, 0.0, 0.0, -8.25, -8.25, -66.0, 0.0, 0.0) | mat3(-0.5, -2.25, 1.0, 1.0, 0.0, -0.5, 1.0, 0.0, 1.0) | mat3(1.0, 1.25, -32.0, 64.0, 1.0, 1.0, 2.0, 0.0, 1.0) | mat3(0.0, 0.5, 0.0, 0.0, 2.0, 0.0, 255.0, 1.0, 1.0) | mat3(-32.0, 64.0, -32.0, 64.0, 36.8125, 1.0, -12.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0, in1, in2, in3, in4, in5, in6);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_vec2_bool_bvec2_float_to_mat3
+ version 300 es
+ values
+ {
+ input bool in0 = [ false | true | true | true | true | true | false | false | false | false ];
+ input float in1 = [ -8.25 | 1.0 | -0.5 | 36.8125 | 0.0 | 3.5 | -20.125 | 1.0 | 0.0 | 2.0 ];
+ input int in2 = [ 8 | -66 | 5 | 1 | 0 | 2 | -12 | -192 | 11 | 255 ];
+ input vec2 in3 = [ vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) ];
+ input bool in4 = [ true | false | true | false | false | true | true | false | true | false ];
+ input bvec2 in5 = [ bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) ];
+ input float in6 = [ -0.5 | 1.0 | 1.0 | 0.0 | 36.8125 | 2.0 | 0.0 | 3.5 | -20.125 | -8.25 ];
+ output mat3 out0 = [ mat3(0.0, -8.25, 8.0, 0.0, 0.5, 1.0, 0.0, 1.0, -0.5) | mat3(1.0, 1.0, -66.0, -32.0, 64.0, 0.0, 0.0, 0.0, 1.0) | mat3(1.0, -0.5, 5.0, 1.0, 1.25, 1.0, 1.0, 0.0, 1.0) | mat3(1.0, 36.8125, 1.0, -32.0, 64.0, 0.0, 0.0, 0.0, 0.0) | mat3(1.0, 0.0, 0.0, -0.5, -2.25, 0.0, 1.0, 1.0, 36.8125) | mat3(1.0, 3.5, 2.0, -0.75, -0.0322580645161, 1.0, 0.0, 0.0, 2.0) | mat3(0.0, -20.125, -12.0, -0.5, -2.25, 1.0, 1.0, 0.0, 0.0) | mat3(0.0, 1.0, -192.0, 0.0, 0.5, 0.0, 0.0, 0.0, 3.5) | mat3(0.0, 0.0, 11.0, 1.0, 1.25, 1.0, 0.0, 1.0, -20.125) | mat3(0.0, 2.0, 255.0, -0.75, -0.0322580645161, 0.0, 1.0, 1.0, -8.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0, in1, in2, in3, in4, in5, in6);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bvec2_int_vec4_bool_to_mat3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false | true | true | false | false | true | false | false | true ];
+ input bvec2 in1 = [ bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) | bvec2(true, true) | bvec2(false, false) | bvec2(false, true) | bvec2(true, false) | bvec2(true, false) | bvec2(false, false) ];
+ input int in2 = [ -192 | 2 | 0 | 5 | 1 | -66 | 11 | -12 | 8 | 255 ];
+ input vec4 in3 = [ vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ input bool in4 = [ false | true | false | true | false | false | false | true | true | true ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, -192.0, -32.0, 64.0, -51.0, 24.0, 0.0) | mat3(0.0, 0.0, 1.0, 2.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 1.0) | mat3(1.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.75, 0.825, 0.0) | mat3(1.0, 1.0, 1.0, 5.0, -32.0, 64.0, -51.0, 24.0, 1.0) | mat3(0.0, 1.0, 1.0, 1.0, 1.0, 1.25, 1.125, 1.75, 0.0) | mat3(0.0, 0.0, 0.0, -66.0, 0.0, 0.5, 0.75, 0.825, 0.0) | mat3(1.0, 0.0, 1.0, 11.0, 1.0, 1.25, 1.125, 1.75, 0.0) | mat3(0.0, 1.0, 0.0, -12.0, -0.5, -2.25, -4.875, 9.0, 1.0) | mat3(0.0, 1.0, 0.0, 8.0, -0.5, -2.25, -4.875, 9.0, 1.0) | mat3(1.0, 0.0, 0.0, 255.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0, in1, in2, in3, in4);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_bvec4_ivec2_bool_bool_to_mat3
+ version 300 es
+ values
+ {
+ input float in0 = [ -8.25 | 2.0 | 36.8125 | 3.5 | 1.0 | -0.5 | -20.125 | 0.0 ];
+ input bvec4 in1 = [ bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, false, false, true) | bvec4(false, false, false, true) ];
+ input ivec2 in2 = [ ivec2(1, 1) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(1, 1) ];
+ input bool in3 = [ false | true | false | true | true | false | true | false ];
+ input bool in4 = [ true | false | false | false | true | true | false | true ];
+ output mat3 out0 = [ mat3(-8.25, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0) | mat3(2.0, 0.0, 1.0, 0.0, 0.0, 0.0, -2.0, 1.0, 0.0) | mat3(36.8125, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat3(3.5, 1.0, 1.0, 1.0, 1.0, -32.0, 64.0, 1.0, 0.0) | mat3(1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0) | mat3(-0.5, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat3(-20.125, 1.0, 0.0, 0.0, 1.0, 0.0, -2.0, 1.0, 0.0) | mat3(0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0, in1, in2, in3, in4);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_vec4_vec4_to_mat3x4
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(0.0, 0.5, 0.75, 0.825) ];
+ input vec4 in1 = [ vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) ];
+ input vec4 in2 = [ vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(0.0, 0.5, 0.75, 0.825) ];
+ output mat3x4 out0 = [ mat3x4(-0.75, -0.0322580645161, 0.0526315789474, 0.25, -0.75, -0.0322580645161, 0.0526315789474, 0.25, -32.0, 64.0, -51.0, 24.0) | mat3x4(1.0, 1.25, 1.125, 1.75, -0.5, -2.25, -4.875, 9.0, 1.0, 1.25, 1.125, 1.75) | mat3x4(-32.0, 64.0, -51.0, 24.0, 0.0, 0.5, 0.75, 0.825, -0.75, -0.0322580645161, 0.0526315789474, 0.25) | mat3x4(-0.5, -2.25, -4.875, 9.0, -32.0, 64.0, -51.0, 24.0, -0.5, -2.25, -4.875, 9.0) | mat3x4(0.0, 0.5, 0.75, 0.825, 1.0, 1.25, 1.125, 1.75, 0.0, 0.5, 0.75, 0.825) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_ivec4_ivec4_to_mat3x4
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) ];
+ input ivec4 in1 = [ ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) ];
+ input ivec4 in2 = [ ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) ];
+ output mat3x4 out0 = [ mat3x4(0.0, -2.0, -4.0, 9.0, 0.0, -2.0, -4.0, 9.0, 0.0, -2.0, -4.0, 9.0) | mat3x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x4(-32.0, 64.0, -51.0, 24.0, -32.0, 64.0, -51.0, 24.0, 1.0, 1.0, 1.0, 1.0) | mat3x4(0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat3x4(1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_float_float_float_int_int_bool_bool_bool_to_mat3x4
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(-0.5, -2.25) ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(1, 1) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(0, -2) ];
+ input float in2 = [ 1.0 | -8.25 | 2.0 | 3.5 | -20.125 | 36.8125 | 0.0 | 1.0 | -0.5 | 0.0 ];
+ input float in3 = [ -0.5 | 36.8125 | 1.0 | 1.0 | 0.0 | 3.5 | 2.0 | 0.0 | -8.25 | -20.125 ];
+ input float in4 = [ -8.25 | 1.0 | 1.0 | 0.0 | 2.0 | 36.8125 | 0.0 | -20.125 | 3.5 | -0.5 ];
+ input int in5 = [ 11 | 2 | 8 | 5 | 0 | -192 | 1 | -12 | 255 | -66 ];
+ input int in6 = [ -12 | 5 | 8 | 1 | 0 | 255 | 11 | -192 | -66 | 2 ];
+ input bool in7 = [ true | true | true | false | false | false | true | false | true | false ];
+ input bool in8 = [ true | true | true | false | true | false | true | false | false | false ];
+ input bool in9 = [ true | false | true | false | true | true | false | false | false | true ];
+ output mat3x4 out0 = [ mat3x4(1.0, 1.25, 0.0, 0.0, 1.0, -0.5, -8.25, 11.0, -12.0, 1.0, 1.0, 1.0) | mat3x4(0.0, 0.5, 0.0, 0.0, -8.25, 36.8125, 1.0, 2.0, 5.0, 1.0, 1.0, 0.0) | mat3x4(0.0, 0.5, -32.0, 64.0, 2.0, 1.0, 1.0, 8.0, 8.0, 1.0, 1.0, 1.0) | mat3x4(-32.0, 64.0, 1.0, 1.0, 3.5, 1.0, 0.0, 5.0, 1.0, 0.0, 0.0, 0.0) | mat3x4(-32.0, 64.0, 1.0, 1.0, -20.125, 0.0, 2.0, 0.0, 0.0, 0.0, 1.0, 1.0) | mat3x4(-0.75, -0.0322580645161, -32.0, 64.0, 36.8125, 3.5, 36.8125, -192.0, 255.0, 0.0, 0.0, 1.0) | mat3x4(1.0, 1.25, 0.0, 0.0, 0.0, 2.0, 0.0, 1.0, 11.0, 1.0, 1.0, 0.0) | mat3x4(-0.75, -0.0322580645161, 0.0, -2.0, 1.0, 0.0, -20.125, -12.0, -192.0, 0.0, 0.0, 0.0) | mat3x4(-0.5, -2.25, 0.0, 0.0, -0.5, -8.25, 3.5, 255.0, -66.0, 1.0, 0.0, 0.0) | mat3x4(-0.5, -2.25, 0.0, -2.0, 0.0, -20.125, -0.5, -66.0, 2.0, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0, in1, in2, in3, in4, in5, in6, in7, in8, in9);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_vec3_bool_bvec3_float_bool_to_mat3x4
+ version 300 es
+ values
+ {
+ input bool in0 = [ false | false | true | true | true | true | false | false | false | true ];
+ input float in1 = [ 36.8125 | -8.25 | 1.0 | 0.0 | 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -20.125 ];
+ input int in2 = [ -66 | -192 | 255 | 8 | 0 | -12 | 5 | 2 | 11 | 1 ];
+ input vec3 in3 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.5, 0.75) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-0.5, -2.25, -4.875) ];
+ input bool in4 = [ false | true | true | true | false | false | true | true | false | false ];
+ input bvec3 in5 = [ bvec3(true, false, false) | bvec3(true, false, false) | bvec3(false, true, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) ];
+ input float in6 = [ -8.25 | 1.0 | -0.5 | 36.8125 | 0.0 | 2.0 | -20.125 | 1.0 | 0.0 | 3.5 ];
+ input bool in7 = [ true | false | false | true | true | false | true | false | false | true ];
+ output mat3x4 out0 = [ mat3x4(0.0, 36.8125, -66.0, -0.75, -0.0322580645161, 0.0526315789474, 0.0, 1.0, 0.0, 0.0, -8.25, 1.0) | mat3x4(0.0, -8.25, -192.0, -32.0, 64.0, -51.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(1.0, 1.0, 255.0, 0.0, 0.5, 0.75, 1.0, 0.0, 1.0, 0.0, -0.5, 0.0) | mat3x4(1.0, 0.0, 8.0, -0.75, -0.0322580645161, 0.0526315789474, 1.0, 0.0, 0.0, 0.0, 36.8125, 1.0) | mat3x4(1.0, 0.0, 0.0, 0.0, 0.5, 0.75, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0) | mat3x4(1.0, 1.0, -12.0, -32.0, 64.0, -51.0, 0.0, 1.0, 1.0, 1.0, 2.0, 0.0) | mat3x4(0.0, 2.0, 5.0, 1.0, 1.25, 1.125, 1.0, 1.0, 1.0, 1.0, -20.125, 1.0) | mat3x4(0.0, 3.5, 2.0, 1.0, 1.25, 1.125, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(0.0, -0.5, 11.0, -0.5, -2.25, -4.875, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x4(1.0, -20.125, 1.0, -0.5, -2.25, -4.875, 0.0, 0.0, 0.0, 0.0, 3.5, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0, in1, in2, in3, in4, in5, in6, in7);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bvec4_int_vec4_bool_float_to_mat3x4
+ version 300 es
+ values
+ {
+ input bool in0 = [ false | true | true | true | false | false | false | true | false | true ];
+ input bvec4 in1 = [ bvec4(false, false, false, false) | bvec4(true, false, false, true) | bvec4(false, true, false, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, false, false, true) ];
+ input int in2 = [ 255 | 2 | -192 | -12 | 11 | 1 | 0 | -66 | 8 | 5 ];
+ input vec4 in3 = [ vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) ];
+ input bool in4 = [ true | true | true | false | false | false | true | true | false | false ];
+ input float in5 = [ 36.8125 | 2.0 | -8.25 | 0.0 | 1.0 | 1.0 | -0.5 | 3.5 | 0.0 | -20.125 ];
+ output mat3x4 out0 = [ mat3x4(0.0, 0.0, 0.0, 0.0, 0.0, 255.0, -0.5, -2.25, -4.875, 9.0, 1.0, 36.8125) | mat3x4(1.0, 1.0, 0.0, 0.0, 1.0, 2.0, 1.0, 1.25, 1.125, 1.75, 1.0, 2.0) | mat3x4(1.0, 0.0, 1.0, 0.0, 0.0, -192.0, 1.0, 1.25, 1.125, 1.75, 1.0, -8.25) | mat3x4(1.0, 0.0, 0.0, 0.0, 1.0, -12.0, 0.0, 0.5, 0.75, 0.825, 0.0, 0.0) | mat3x4(0.0, 1.0, 1.0, 1.0, 1.0, 11.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 0.0, 1.0) | mat3x4(0.0, 0.0, 0.0, 0.0, 1.0, 1.0, -32.0, 64.0, -51.0, 24.0, 0.0, 1.0) | mat3x4(0.0, 1.0, 1.0, 1.0, 1.0, 0.0, -32.0, 64.0, -51.0, 24.0, 1.0, -0.5) | mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.5, 0.75, 0.825, 1.0, 3.5) | mat3x4(0.0, 0.0, 1.0, 0.0, 0.0, 8.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 0.0, 0.0) | mat3x4(1.0, 1.0, 0.0, 0.0, 1.0, 5.0, -0.5, -2.25, -4.875, 9.0, 0.0, -20.125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_bvec4_ivec4_bool_bool_int_to_mat3x4
+ version 300 es
+ values
+ {
+ input float in0 = [ 36.8125 | 1.0 | 0.0 | 3.5 | -8.25 | -20.125 | 2.0 | 0.0 | 1.0 | -0.5 ];
+ input bvec4 in1 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(false, true, false, false) | bvec4(false, false, false, true) | bvec4(false, false, false, false) ];
+ input ivec4 in2 = [ ivec4(0, 0, 0, 0) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) ];
+ input bool in3 = [ true | false | true | true | false | true | true | false | false | false ];
+ input bool in4 = [ true | false | false | true | true | false | false | false | true | true ];
+ input int in5 = [ 1 | 5 | -12 | 8 | -192 | 2 | -66 | 255 | 11 | 0 ];
+ output mat3x4 out0 = [ mat3x4(36.8125, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, -4.0, 9.0, 0.0, 0.0, 5.0) | mat3x4(0.0, 0.0, 1.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 1.0, 0.0, -12.0) | mat3x4(3.5, 0.0, 0.0, 0.0, 1.0, 0.0, -2.0, -4.0, 9.0, 1.0, 1.0, 8.0) | mat3x4(-8.25, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, -192.0) | mat3x4(-20.125, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 2.0) | mat3x4(2.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, -66.0) | mat3x4(0.0, 0.0, 1.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 0.0, 0.0, 255.0) | mat3x4(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 11.0) | mat3x4(-0.5, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 1.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_vec3_vec2_to_mat4x2
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(1.0, 1.25, 1.125) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ input vec3 in1 = [ vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) ];
+ input vec2 in2 = [ vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(0.0, 0.5) ];
+ output mat4x2 out0 = [ mat4x2(1.0, 1.25, 1.125, -32.0, 64.0, -51.0, 1.0, 1.25) | mat4x2(-32.0, 64.0, -51.0, -0.75, -0.0322580645161, 0.0526315789474, -0.5, -2.25) | mat4x2(0.0, 0.5, 0.75, -0.5, -2.25, -4.875, -0.75, -0.0322580645161) | mat4x2(-0.5, -2.25, -4.875, 0.0, 0.5, 0.75, -32.0, 64.0) | mat4x2(-0.75, -0.0322580645161, 0.0526315789474, 1.0, 1.25, 1.125, 0.0, 0.5) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_ivec3_ivec2_to_mat4x2
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(0, 0, 0) | ivec3(-32, 64, -51) ];
+ input ivec3 in1 = [ ivec3(0, -2, -4) | ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, 64, -51) ];
+ input ivec2 in2 = [ ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) ];
+ output mat4x2 out0 = [ mat4x2(0.0, 0.0, 0.0, 0.0, -2.0, -4.0, -32.0, 64.0) | mat4x2(1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(0.0, -2.0, -4.0, 1.0, 1.0, 1.0, 0.0, 0.0) | mat4x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0) | mat4x2(-32.0, 64.0, -51.0, -32.0, 64.0, -51.0, 0.0, -2.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_float_float_int_bool_to_mat4x2
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) ];
+ input ivec2 in1 = [ ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) ];
+ input float in2 = [ 3.5 | -8.25 | 2.0 | 36.8125 | -0.5 | 1.0 | 1.0 | 0.0 | -20.125 | 0.0 ];
+ input float in3 = [ 0.0 | 36.8125 | 3.5 | 1.0 | -0.5 | -8.25 | 2.0 | 0.0 | -20.125 | 1.0 ];
+ input int in4 = [ -12 | -66 | 11 | 5 | 8 | 255 | -192 | 2 | 1 | 0 ];
+ input bool in5 = [ true | true | false | true | false | true | false | true | false | false ];
+ output mat4x2 out0 = [ mat4x2(-0.5, -2.25, 0.0, -2.0, 3.5, 0.0, -12.0, 1.0) | mat4x2(0.0, 0.5, 0.0, 0.0, -8.25, 36.8125, -66.0, 1.0) | mat4x2(1.0, 1.25, -32.0, 64.0, 2.0, 3.5, 11.0, 0.0) | mat4x2(0.0, 0.5, 1.0, 1.0, 36.8125, 1.0, 5.0, 1.0) | mat4x2(-32.0, 64.0, 1.0, 1.0, -0.5, -0.5, 8.0, 0.0) | mat4x2(-0.75, -0.0322580645161, 0.0, 0.0, 1.0, -8.25, 255.0, 1.0) | mat4x2(-0.75, -0.0322580645161, -32.0, 64.0, 1.0, 2.0, -192.0, 0.0) | mat4x2(-32.0, 64.0, 0.0, 0.0, 0.0, 0.0, 2.0, 1.0) | mat4x2(-0.5, -2.25, 0.0, 0.0, -20.125, -20.125, 1.0, 0.0) | mat4x2(1.0, 1.25, 0.0, -2.0, 0.0, 1.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_vec2_bool_bvec2_to_mat4x2
+ version 300 es
+ values
+ {
+ input bool in0 = [ false | false | true | true | true | false | false | true | false | true ];
+ input float in1 = [ 36.8125 | -8.25 | 3.5 | 1.0 | 2.0 | -0.5 | 0.0 | 1.0 | -20.125 | 0.0 ];
+ input int in2 = [ -66 | 1 | -192 | 2 | 11 | 0 | 255 | 8 | 5 | -12 ];
+ input vec2 in3 = [ vec2(-0.75, -0.0322580645161) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) ];
+ input bool in4 = [ true | false | false | false | false | true | true | true | false | true ];
+ input bvec2 in5 = [ bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) | bvec2(true, false) ];
+ output mat4x2 out0 = [ mat4x2(0.0, 36.8125, -66.0, -0.75, -0.0322580645161, 1.0, 0.0, 0.0) | mat4x2(0.0, -8.25, 1.0, -0.75, -0.0322580645161, 0.0, 0.0, 1.0) | mat4x2(1.0, 3.5, -192.0, -32.0, 64.0, 0.0, 0.0, 0.0) | mat4x2(1.0, 1.0, 2.0, 0.0, 0.5, 0.0, 1.0, 1.0) | mat4x2(1.0, 2.0, 11.0, 1.0, 1.25, 0.0, 1.0, 0.0) | mat4x2(0.0, -0.5, 0.0, 1.0, 1.25, 1.0, 0.0, 1.0) | mat4x2(0.0, 0.0, 255.0, -0.5, -2.25, 1.0, 0.0, 0.0) | mat4x2(1.0, 1.0, 8.0, -32.0, 64.0, 1.0, 1.0, 1.0) | mat4x2(0.0, -20.125, 5.0, 0.0, 0.5, 0.0, 0.0, 0.0) | mat4x2(1.0, 0.0, -12.0, -0.5, -2.25, 1.0, 1.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bvec2_int_vec4_to_mat4x2
+ version 300 es
+ values
+ {
+ input bool in0 = [ false | false | true | false | true | false | true | true | true | false ];
+ input bvec2 in1 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(true, true) ];
+ input int in2 = [ -12 | 8 | 2 | 255 | 5 | -192 | 0 | 11 | 1 | -66 ];
+ input vec4 in3 = [ vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) ];
+ output mat4x2 out0 = [ mat4x2(0.0, 1.0, 0.0, -12.0, 1.0, 1.25, 1.125, 1.75) | mat4x2(0.0, 0.0, 0.0, 8.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25) | mat4x2(1.0, 0.0, 0.0, 2.0, -32.0, 64.0, -51.0, 24.0) | mat4x2(0.0, 0.0, 0.0, 255.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25) | mat4x2(1.0, 1.0, 0.0, 5.0, -0.5, -2.25, -4.875, 9.0) | mat4x2(0.0, 0.0, 1.0, -192.0, -0.5, -2.25, -4.875, 9.0) | mat4x2(1.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.75, 0.825) | mat4x2(1.0, 0.0, 1.0, 11.0, -32.0, 64.0, -51.0, 24.0) | mat4x2(1.0, 1.0, 1.0, 1.0, 1.0, 1.25, 1.125, 1.75) | mat4x2(0.0, 1.0, 1.0, -66.0, 0.0, 0.5, 0.75, 0.825) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_bvec4_ivec2_bool_to_mat4x2
+ version 300 es
+ values
+ {
+ input float in0 = [ 1.0 | -8.25 | -20.125 | 3.5 | -0.5 | 2.0 | 36.8125 | 0.0 ];
+ input bvec4 in1 = [ bvec4(false, false, false, true) | bvec4(true, false, false, true) | bvec4(true, true, true, true) | bvec4(false, true, false, false) | bvec4(false, false, false, false) | bvec4(true, false, false, true) | bvec4(false, true, false, false) | bvec4(false, false, false, true) ];
+ input ivec2 in2 = [ ivec2(-32, 64) | ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) ];
+ input bool in3 = [ true | true | false | true | true | false | false | false ];
+ output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 0.0, 1.0, -32.0, 64.0, 1.0) | mat4x2(-8.25, 1.0, 0.0, 0.0, 1.0, 0.0, -2.0, 1.0) | mat4x2(-20.125, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0) | mat4x2(3.5, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4x2(-0.5, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat4x2(2.0, 1.0, 0.0, 0.0, 1.0, 0.0, -2.0, 0.0) | mat4x2(36.8125, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.0) | mat4x2(0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_vec4_vec4_to_mat4x3
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) ];
+ input vec4 in1 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ input vec4 in2 = [ vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output mat4x3 out0 = [ mat4x3(-0.5, -2.25, -4.875, 9.0, 0.0, 0.5, 0.75, 0.825, -32.0, 64.0, -51.0, 24.0) | mat4x3(1.0, 1.25, 1.125, 1.75, -0.5, -2.25, -4.875, 9.0, 1.0, 1.25, 1.125, 1.75) | mat4x3(0.0, 0.5, 0.75, 0.825, -32.0, 64.0, -51.0, 24.0, -0.5, -2.25, -4.875, 9.0) | mat4x3(-0.75, -0.0322580645161, 0.0526315789474, 0.25, 1.0, 1.25, 1.125, 1.75, 0.0, 0.5, 0.75, 0.825) | mat4x3(-32.0, 64.0, -51.0, 24.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, -0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_ivec4_ivec4_to_mat4x3
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ input ivec4 in1 = [ ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) | ivec4(0, -2, -4, 9) | ivec4(1, 1, 1, 1) ];
+ input ivec4 in2 = [ ivec4(-32, 64, -51, 24) | ivec4(0, -2, -4, 9) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, 0) ];
+ output mat4x3 out0 = [ mat4x3(1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0) | mat4x3(0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 0.0, -2.0, -4.0, 9.0) | mat4x3(0.0, -2.0, -4.0, 9.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0) | mat4x3(-32.0, 64.0, -51.0, 24.0, 0.0, -2.0, -4.0, 9.0, 0.0, 0.0, 0.0, 0.0) | mat4x3(0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_float_float_float_int_int_bool_bool_bool_to_mat4x3
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ input ivec2 in1 = [ ivec2(0, -2) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) ];
+ input float in2 = [ -20.125 | 3.5 | 2.0 | -0.5 | -8.25 | 0.0 | 1.0 | 0.0 | 1.0 | 36.8125 ];
+ input float in3 = [ 0.0 | -8.25 | 36.8125 | 1.0 | 0.0 | -20.125 | 3.5 | 2.0 | -0.5 | 1.0 ];
+ input float in4 = [ 0.0 | 1.0 | 3.5 | -20.125 | 0.0 | 36.8125 | 1.0 | -8.25 | 2.0 | -0.5 ];
+ input int in5 = [ 2 | 8 | 1 | -192 | 0 | -12 | 11 | 255 | 5 | -66 ];
+ input int in6 = [ 2 | -12 | 5 | 8 | 11 | 255 | 0 | -66 | 1 | -192 ];
+ input bool in7 = [ true | true | false | true | false | false | false | true | false | true ];
+ input bool in8 = [ true | false | false | true | true | false | true | true | false | false ];
+ input bool in9 = [ false | true | false | false | false | false | true | true | true | true ];
+ output mat4x3 out0 = [ mat4x3(-0.5, -2.25, 0.0, -2.0, -20.125, 0.0, 0.0, 2.0, 2.0, 1.0, 1.0, 0.0) | mat4x3(0.0, 0.5, -32.0, 64.0, 3.5, -8.25, 1.0, 8.0, -12.0, 1.0, 0.0, 1.0) | mat4x3(0.0, 0.5, 1.0, 1.0, 2.0, 36.8125, 3.5, 1.0, 5.0, 0.0, 0.0, 0.0) | mat4x3(1.0, 1.25, -32.0, 64.0, -0.5, 1.0, -20.125, -192.0, 8.0, 1.0, 1.0, 0.0) | mat4x3(-0.75, -0.0322580645161, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, 11.0, 0.0, 1.0, 0.0) | mat4x3(-0.5, -2.25, 0.0, 0.0, 0.0, -20.125, 36.8125, -12.0, 255.0, 0.0, 0.0, 0.0) | mat4x3(-32.0, 64.0, 0.0, 0.0, 1.0, 3.5, 1.0, 11.0, 0.0, 0.0, 1.0, 1.0) | mat4x3(1.0, 1.25, 0.0, -2.0, 0.0, 2.0, -8.25, 255.0, -66.0, 1.0, 1.0, 1.0) | mat4x3(-32.0, 64.0, 0.0, 0.0, 1.0, -0.5, 2.0, 5.0, 1.0, 0.0, 0.0, 1.0) | mat4x3(-0.75, -0.0322580645161, 1.0, 1.0, 36.8125, 1.0, -0.5, -66.0, -192.0, 1.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0, in1, in2, in3, in4, in5, in6, in7, in8, in9);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_vec3_bool_bvec3_float_bool_to_mat4x3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | true | false | false | true | true | true | false | false | false ];
+ input float in1 = [ -8.25 | 2.0 | 1.0 | -0.5 | 0.0 | 0.0 | 36.8125 | -20.125 | 3.5 | 1.0 ];
+ input int in2 = [ 255 | 2 | 11 | 1 | 8 | -192 | 0 | -66 | -12 | 5 ];
+ input vec3 in3 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) | vec3(0.0, 0.5, 0.75) | vec3(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) | vec3(1.0, 1.25, 1.125) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ input bool in4 = [ true | true | false | false | true | false | false | false | true | true ];
+ input bvec3 in5 = [ bvec3(false, false, false) | bvec3(false, true, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, false, false) | bvec3(true, false, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) ];
+ input float in6 = [ 1.0 | 0.0 | -0.5 | 36.8125 | 1.0 | -20.125 | 2.0 | 0.0 | -8.25 | 3.5 ];
+ input bool in7 = [ true | true | false | false | false | false | true | true | false | true ];
+ output mat4x3 out0 = [ mat4x3(1.0, -8.25, 255.0, -0.75, -0.0322580645161, 0.0526315789474, 1.0, 0.0, 0.0, 0.0, 1.0, 1.0) | mat4x3(1.0, 2.0, 2.0, 0.0, 0.5, 0.75, 1.0, 0.0, 1.0, 0.0, 0.0, 1.0) | mat4x3(0.0, 1.0, 11.0, 0.0, 0.5, 0.75, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0) | mat4x3(0.0, -0.5, 1.0, -32.0, 64.0, -51.0, 0.0, 0.0, 1.0, 0.0, 36.8125, 0.0) | mat4x3(1.0, 0.0, 8.0, -0.5, -2.25, -4.875, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0) | mat4x3(1.0, 0.0, -192.0, 1.0, 1.25, 1.125, 0.0, 1.0, 0.0, 0.0, -20.125, 0.0) | mat4x3(1.0, 36.8125, 0.0, -32.0, 64.0, -51.0, 0.0, 1.0, 1.0, 1.0, 2.0, 1.0) | mat4x3(0.0, -20.125, -66.0, 1.0, 1.25, 1.125, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0) | mat4x3(0.0, 3.5, -12.0, -0.5, -2.25, -4.875, 1.0, 0.0, 0.0, 0.0, -8.25, 0.0) | mat4x3(0.0, 1.0, 5.0, -0.75, -0.0322580645161, 0.0526315789474, 1.0, 0.0, 0.0, 0.0, 3.5, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0, in1, in2, in3, in4, in5, in6, in7);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bvec4_int_vec4_bool_float_to_mat4x3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | true | true | false | true | false | false | true | false | false ];
+ input bvec4 in1 = [ bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, false, false, false) | bvec4(false, false, false, true) ];
+ input int in2 = [ 5 | 11 | 0 | -192 | -66 | 255 | 1 | -12 | 8 | 2 ];
+ input vec4 in3 = [ vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(0.0, 0.5, 0.75, 0.825) ];
+ input bool in4 = [ false | true | true | false | true | false | true | true | false | false ];
+ input float in5 = [ -20.125 | 0.0 | 1.0 | -0.5 | 3.5 | -8.25 | 0.0 | 1.0 | 2.0 | 36.8125 ];
+ output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 0.0, 5.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 0.0, -20.125) | mat4x3(1.0, 0.0, 1.0, 0.0, 0.0, 11.0, -32.0, 64.0, -51.0, 24.0, 1.0, 0.0) | mat4x3(1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 1.25, 1.125, 1.75, 1.0, 1.0) | mat4x3(0.0, 1.0, 1.0, 1.0, 1.0, -192.0, -0.5, -2.25, -4.875, 9.0, 0.0, -0.5) | mat4x3(1.0, 1.0, 1.0, 1.0, 1.0, -66.0, 1.0, 1.25, 1.125, 1.75, 1.0, 3.5) | mat4x3(0.0, 1.0, 0.0, 0.0, 1.0, 255.0, -32.0, 64.0, -51.0, 24.0, 0.0, -8.25) | mat4x3(0.0, 1.0, 0.0, 0.0, 1.0, 1.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 1.0, 0.0) | mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, -12.0, -0.5, -2.25, -4.875, 9.0, 1.0, 1.0) | mat4x3(0.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.5, 0.75, 0.825, 0.0, 2.0) | mat4x3(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 0.0, 0.5, 0.75, 0.825, 0.0, 36.8125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_bvec4_ivec4_bool_bool_int_to_mat4x3
+ version 300 es
+ values
+ {
+ input float in0 = [ 36.8125 | -0.5 | 3.5 | 2.0 | 1.0 | -20.125 | 0.0 | 0.0 | -8.25 | 1.0 ];
+ input bvec4 in1 = [ bvec4(false, false, false, false) | bvec4(false, false, false, true) | bvec4(true, false, false, true) | bvec4(false, true, false, false) | bvec4(false, false, false, false) | bvec4(true, false, false, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, true, false, false) | bvec4(false, false, false, true) ];
+ input ivec4 in2 = [ ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(0, -2, -4, 9) ];
+ input bool in3 = [ false | true | false | true | false | false | false | true | true | true ];
+ input bool in4 = [ false | true | false | true | false | true | false | false | true | true ];
+ input int in5 = [ 2 | 1 | 8 | 11 | 255 | 5 | 0 | -66 | -192 | -12 ];
+ output mat4x3 out0 = [ mat4x3(36.8125, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 2.0) | mat4x3(-0.5, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat4x3(3.5, 1.0, 0.0, 0.0, 1.0, -32.0, 64.0, -51.0, 24.0, 0.0, 0.0, 8.0) | mat4x3(2.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 11.0) | mat4x3(1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 255.0) | mat4x3(-20.125, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 5.0) | mat4x3(0.0, 1.0, 1.0, 1.0, 1.0, -32.0, 64.0, -51.0, 24.0, 0.0, 0.0, 0.0) | mat4x3(0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, -66.0) | mat4x3(-8.25, 0.0, 1.0, 0.0, 0.0, 0.0, -2.0, -4.0, 9.0, 1.0, 1.0, -192.0) | mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, -2.0, -4.0, 9.0, 1.0, 1.0, -12.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_vec4_vec4_vec4_to_mat4
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) ];
+ input vec4 in1 = [ vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) ];
+ input vec4 in2 = [ vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) ];
+ input vec4 in3 = [ vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-0.5, -2.25, -4.875, 9.0) ];
+ output mat4 out0 = [ mat4(-0.75, -0.0322580645161, 0.0526315789474, 0.25, -0.75, -0.0322580645161, 0.0526315789474, 0.25, -32.0, 64.0, -51.0, 24.0, -32.0, 64.0, -51.0, 24.0) | mat4(-32.0, 64.0, -51.0, 24.0, -32.0, 64.0, -51.0, 24.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, -0.75, -0.0322580645161, 0.0526315789474, 0.25) | mat4(-0.5, -2.25, -4.875, 9.0, -0.5, -2.25, -4.875, 9.0, -0.5, -2.25, -4.875, 9.0, 1.0, 1.25, 1.125, 1.75) | mat4(1.0, 1.25, 1.125, 1.75, 1.0, 1.25, 1.125, 1.75, 1.0, 1.25, 1.125, 1.75, 0.0, 0.5, 0.75, 0.825) | mat4(0.0, 0.5, 0.75, 0.825, 0.0, 0.5, 0.75, 0.825, 0.0, 0.5, 0.75, 0.825, -0.5, -2.25, -4.875, 9.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_ivec4_ivec4_ivec4_to_mat4
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(-32, 64, -51, 24) | ivec4(0, -2, -4, 9) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, 0) ];
+ input ivec4 in1 = [ ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ input ivec4 in2 = [ ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) | ivec4(0, -2, -4, 9) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) ];
+ input ivec4 in3 = [ ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) ];
+ output mat4 out0 = [ mat4(-32.0, 64.0, -51.0, 24.0, 1.0, 1.0, 1.0, 1.0, -32.0, 64.0, -51.0, 24.0, 1.0, 1.0, 1.0, 1.0) | mat4(0.0, -2.0, -4.0, 9.0, 0.0, -2.0, -4.0, 9.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, -4.0, 9.0) | mat4(1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, -4.0, 9.0, 0.0, 0.0, 0.0, 0.0) | mat4(0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_bvec4_bvec4_bvec4_to_mat4
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(false, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(true, false, false, true) ];
+ input bvec4 in1 = [ bvec4(false, true, false, false) | bvec4(false, false, false, true) | bvec4(true, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ input bvec4 in2 = [ bvec4(false, true, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(true, false, false, true) ];
+ input bvec4 in3 = [ bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, false, false, true) ];
+ output mat4 out0 = [ mat4(0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0) | mat4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0) | mat4(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_ivec3_bvec3_vec4_ivec2_float_vec2_to_mat4
+ version 300 es
+ values
+ {
+ input float in0 = [ 2.0 | 1.0 | 3.5 | 0.0 | -20.125 | 36.8125 | -0.5 | -8.25 ];
+ input ivec3 in1 = [ ivec3(0, 0, 0) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(0, 0, 0) | ivec3(0, -2, -4) ];
+ input bvec3 in2 = [ bvec3(true, false, false) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(false, false, false) | bvec3(false, true, false) ];
+ input vec4 in3 = [ vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(0.0, 0.5, 0.75, 0.825) ];
+ input ivec2 in4 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, -2) ];
+ input float in5 = [ 2.0 | 3.5 | 36.8125 | -8.25 | 0.0 | -20.125 | 1.0 | -0.5 ];
+ input vec2 in6 = [ vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(1.0, 1.25) ];
+ output mat4 out0 = [ mat4(2.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, -0.5, -2.25, -4.875, 9.0, 0.0, 0.0, 2.0, 0.0, 0.5) | mat4(1.0, -32.0, 64.0, -51.0, 1.0, 1.0, 1.0, 1.0, 1.25, 1.125, 1.75, 1.0, 1.0, 3.5, -0.5, -2.25) | mat4(3.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.75, 0.825, 0.0, -2.0, 36.8125, -32.0, 64.0) | mat4(0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, -0.5, -2.25, -4.875, 9.0, 0.0, 0.0, -8.25, 0.0, 0.5) | mat4(-20.125, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 1.25, 1.125, 1.75, 1.0, 1.0, 0.0, -0.75, -0.0322580645161) | mat4(36.8125, 0.0, -2.0, -4.0, 0.0, 1.0, 0.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, -32.0, 64.0, -20.125, -0.5, -2.25) | mat4(-0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 0.0, 0.0, 1.0, 1.0, 1.25) | mat4(-8.25, 0.0, -2.0, -4.0, 0.0, 1.0, 0.0, 0.0, 0.5, 0.75, 0.825, 0.0, -2.0, -0.5, 1.0, 1.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0, in1, in2, in3, in4, in5, in6);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # matrix_combine
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_matrix_combine.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_matrix_combine.html
new file mode 100644
index 0000000000..0f01ce529f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_matrix_combine.html
@@ -0,0 +1,31 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'conversions_matrix_combine';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+modules.shared.glsShaderLibrary.run(testName);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_matrix_combine.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_matrix_combine.test
new file mode 100644
index 0000000000..ef74206d87
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_matrix_combine.test
@@ -0,0 +1,1887 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+group matrix_combine "Matrix Combine Constructors"
+
+ case vec2_vec2_to_mat2
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(1.0, 1.25) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(0.0, 0.5) ];
+ input vec2 in1 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) ];
+ output mat2 out0 = [ mat2(1.0, 1.25, 0.0, 0.5) | mat2(-32.0, 64.0, 1.0, 1.25) | mat2(-0.5, -2.25, -0.75, -0.0322580645161) | mat2(-0.75, -0.0322580645161, -32.0, 64.0) | mat2(0.0, 0.5, -0.5, -2.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_bvec2_to_mat2
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(false, true) | bvec2(true, true) | bvec2(true, false) | bvec2(false, false) | bvec2(false, false) ];
+ input bvec2 in1 = [ bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, true) ];
+ output mat2 out0 = [ mat2(0.0, 1.0, 0.0, 0.0) | mat2(1.0, 1.0, 1.0, 0.0) | mat2(1.0, 0.0, 0.0, 0.0) | mat2(0.0, 0.0, 1.0, 1.0) | mat2(0.0, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_float_to_mat2
+ version 300 es
+ values
+ {
+ input float in0 = [ -8.25 | 3.5 | 36.8125 | 2.0 | -20.125 | 1.0 | -0.5 | 0.0 ];
+ input float in1 = [ 3.5 | -20.125 | 1.0 | 0.0 | -8.25 | 2.0 | 36.8125 | -0.5 ];
+ input float in2 = [ 36.8125 | 3.5 | 0.0 | -20.125 | -0.5 | -8.25 | 1.0 | 2.0 ];
+ input float in3 = [ -0.5 | 0.0 | -8.25 | -20.125 | 2.0 | 3.5 | 1.0 | 36.8125 ];
+ output mat2 out0 = [ mat2(-8.25, 3.5, 36.8125, -0.5) | mat2(3.5, -20.125, 3.5, 0.0) | mat2(36.8125, 1.0, 0.0, -8.25) | mat2(2.0, 0.0, -20.125, -20.125) | mat2(-20.125, -8.25, -0.5, 2.0) | mat2(1.0, 2.0, -8.25, 3.5) | mat2(-0.5, 36.8125, 1.0, 1.0) | mat2(0.0, -0.5, 2.0, 36.8125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_int_to_mat2
+ version 300 es
+ values
+ {
+ input int in0 = [ 2 | 1 | -192 | 11 | -66 | 255 | 0 | 8 | -12 | 5 ];
+ input int in1 = [ 11 | 255 | 5 | -66 | 8 | 2 | 0 | -12 | 1 | -192 ];
+ input int in2 = [ 11 | 1 | -12 | 255 | 5 | 0 | 8 | -192 | 2 | -66 ];
+ input int in3 = [ 2 | 1 | 0 | 8 | 255 | -66 | -192 | 11 | 5 | -12 ];
+ output mat2 out0 = [ mat2(2.0, 11.0, 11.0, 2.0) | mat2(1.0, 255.0, 1.0, 1.0) | mat2(-192.0, 5.0, -12.0, 0.0) | mat2(11.0, -66.0, 255.0, 8.0) | mat2(-66.0, 8.0, 5.0, 255.0) | mat2(255.0, 2.0, 0.0, -66.0) | mat2(0.0, 0.0, 8.0, -192.0) | mat2(8.0, -12.0, -192.0, 11.0) | mat2(-12.0, 1.0, 2.0, 5.0) | mat2(5.0, -192.0, -66.0, -12.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uint_uint_uint_to_mat2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 193 | 9 | 12 | 45 | 10 | 2 | 8 | 3 | 255 | 0 ];
+ input uint in1 = [ 0 | 255 | 12 | 193 | 3 | 2 | 45 | 9 | 8 | 10 ];
+ input uint in2 = [ 3 | 9 | 10 | 2 | 12 | 193 | 255 | 0 | 8 | 45 ];
+ input uint in3 = [ 45 | 12 | 9 | 3 | 2 | 255 | 10 | 8 | 193 | 0 ];
+ output mat2 out0 = [ mat2(193.0, 0.0, 3.0, 45.0) | mat2(9.0, 255.0, 9.0, 12.0) | mat2(12.0, 12.0, 10.0, 9.0) | mat2(45.0, 193.0, 2.0, 3.0) | mat2(10.0, 3.0, 12.0, 2.0) | mat2(2.0, 2.0, 193.0, 255.0) | mat2(8.0, 45.0, 255.0, 10.0) | mat2(3.0, 9.0, 0.0, 8.0) | mat2(255.0, 8.0, 8.0, 193.0) | mat2(0.0, 10.0, 45.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_bool_to_mat2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ true | false ];
+ input bool in2 = [ true | false ];
+ input bool in3 = [ false | true ];
+ output mat2 out0 = [ mat2(1.0, 1.0, 1.0, 0.0) | mat2(0.0, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_bool_to_mat2
+ version 300 es
+ values
+ {
+ input bool in0 = [ false | true | false | true | true | false | true | true | false | false ];
+ input float in1 = [ 2.0 | -0.5 | 0.0 | 1.0 | 1.0 | 36.8125 | 3.5 | 0.0 | -8.25 | -20.125 ];
+ input int in2 = [ 0 | -12 | 8 | -192 | 1 | -66 | 5 | 11 | 2 | 255 ];
+ input bool in3 = [ true | false | true | false | true | false | false | true | true | false ];
+ output mat2 out0 = [ mat2(0.0, 2.0, 0.0, 1.0) | mat2(1.0, -0.5, -12.0, 0.0) | mat2(0.0, 0.0, 8.0, 1.0) | mat2(1.0, 1.0, -192.0, 0.0) | mat2(1.0, 1.0, 1.0, 1.0) | mat2(0.0, 36.8125, -66.0, 0.0) | mat2(1.0, 3.5, 5.0, 0.0) | mat2(1.0, 0.0, 11.0, 1.0) | mat2(0.0, -8.25, 2.0, 1.0) | mat2(0.0, -20.125, 255.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_to_mat2
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(1.0, 1.25) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(0.0, 0.5) ];
+ input ivec2 in1 = [ ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) ];
+ output mat2 out0 = [ mat2(1.0, 1.25, 0.0, -2.0) | mat2(-32.0, 64.0, 0.0, 0.0) | mat2(-0.5, -2.25, 0.0, 0.0) | mat2(-0.75, -0.0322580645161, -32.0, 64.0) | mat2(0.0, 0.5, 1.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bvec2_to_mat2
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(0.0, 0.5) ];
+ input bvec2 in1 = [ bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) ];
+ output mat2 out0 = [ mat2(-0.5, -2.25, 0.0, 0.0) | mat2(-32.0, 64.0, 1.0, 0.0) | mat2(1.0, 1.25, 0.0, 0.0) | mat2(-0.75, -0.0322580645161, 0.0, 1.0) | mat2(0.0, 0.5, 1.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_float_to_mat2
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, false, false) | bvec3(false, true, false) | bvec3(false, false, false) | bvec3(false, false, false) ];
+ input float in1 = [ 36.8125 | -8.25 | 1.0 | -0.5 | 2.0 | -20.125 | 0.0 | 3.5 ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 36.8125) | mat2(0.0, 1.0, 0.0, -8.25) | mat2(0.0, 0.0, 0.0, 1.0) | mat2(1.0, 1.0, 1.0, -0.5) | mat2(1.0, 0.0, 0.0, 2.0) | mat2(0.0, 1.0, 0.0, -20.125) | mat2(0.0, 0.0, 0.0, 0.0) | mat2(0.0, 0.0, 0.0, 3.5) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_float_to_mat2
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-0.5, -2.25, -4.875) | vec3(1.0, 1.25, 1.125) | vec3(0.0, 0.5, 0.75) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.5, 0.75) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ input float in1 = [ -0.5 | -20.125 | 0.0 | 36.8125 | 3.5 | -8.25 | 2.0 | 1.0 ];
+ output mat2 out0 = [ mat2(1.0, 1.25, 1.125, -0.5) | mat2(-0.5, -2.25, -4.875, -20.125) | mat2(-0.5, -2.25, -4.875, 0.0) | mat2(1.0, 1.25, 1.125, 36.8125) | mat2(0.0, 0.5, 0.75, 3.5) | mat2(-32.0, 64.0, -51.0, -8.25) | mat2(0.0, 0.5, 0.75, 2.0) | mat2(-0.75, -0.0322580645161, 0.0526315789474, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_ivec2_int_to_mat2
+ version 300 es
+ values
+ {
+ input int in0 = [ 8 | -192 | 2 | 0 | -66 | 255 | 5 | 1 | -12 | 11 ];
+ input ivec2 in1 = [ ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, -2) | ivec2(1, 1) | ivec2(1, 1) ];
+ input int in2 = [ 2 | 1 | -12 | 0 | 11 | 8 | 255 | -192 | 5 | -66 ];
+ output mat2 out0 = [ mat2(8.0, 0.0, -2.0, 2.0) | mat2(-192.0, 0.0, 0.0, 1.0) | mat2(2.0, -32.0, 64.0, -12.0) | mat2(0.0, 0.0, 0.0, 0.0) | mat2(-66.0, 0.0, 0.0, 11.0) | mat2(255.0, -32.0, 64.0, 8.0) | mat2(5.0, 0.0, 0.0, 255.0) | mat2(1.0, 0.0, -2.0, -192.0) | mat2(-12.0, 1.0, 1.0, 5.0) | mat2(11.0, 1.0, 1.0, -66.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_ivec2_to_mat2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | true | true | false | false | true | false | false ];
+ input float in1 = [ 1.0 | -0.5 | -20.125 | 36.8125 | 2.0 | 0.0 | -8.25 | 3.5 ];
+ input ivec2 in2 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, -2) ];
+ output mat2 out0 = [ mat2(1.0, 1.0, 0.0, 0.0) | mat2(1.0, -0.5, 0.0, 0.0) | mat2(1.0, -20.125, 1.0, 1.0) | mat2(0.0, 36.8125, 0.0, 0.0) | mat2(0.0, 2.0, 1.0, 1.0) | mat2(1.0, 0.0, 0.0, -2.0) | mat2(0.0, -8.25, -32.0, 64.0) | mat2(0.0, 3.5, 0.0, -2.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_uvec3_to_mat2
+ version 300 es
+ values
+ {
+ input float in0 = [ 36.8125 | 2.0 | -0.5 | 0.0 | -20.125 | 1.0 | 3.5 | -8.25 ];
+ input uvec3 in1 = [ uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(0, 2, 4) | uvec3(0, 0, 0) | uvec3(32, 64, 51) | uvec3(0, 0, 0) | uvec3(0, 0, 0) | uvec3(1, 1, 1) ];
+ output mat2 out0 = [ mat2(36.8125, 1.0, 1.0, 1.0) | mat2(2.0, 0.0, 2.0, 4.0) | mat2(-0.5, 0.0, 2.0, 4.0) | mat2(0.0, 0.0, 0.0, 0.0) | mat2(-20.125, 32.0, 64.0, 51.0) | mat2(1.0, 0.0, 0.0, 0.0) | mat2(3.5, 0.0, 0.0, 0.0) | mat2(-8.25, 1.0, 1.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_uvec2_bool_to_mat2
+ version 300 es
+ values
+ {
+ input int in0 = [ 1 | -66 | 5 | -192 | 11 | 0 | 8 | 2 | -12 | 255 ];
+ input uvec2 in1 = [ uvec2(0, 2) | uvec2(32, 64) | uvec2(1, 1) | uvec2(0, 0) | uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(0, 0) | uvec2(0, 0) | uvec2(32, 64) ];
+ input bool in2 = [ true | false | true | false | false | false | true | true | true | false ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 2.0, 1.0) | mat2(-66.0, 32.0, 64.0, 0.0) | mat2(5.0, 1.0, 1.0, 1.0) | mat2(-192.0, 0.0, 0.0, 0.0) | mat2(11.0, 0.0, 0.0, 0.0) | mat2(0.0, 1.0, 1.0, 0.0) | mat2(8.0, 0.0, 2.0, 1.0) | mat2(2.0, 0.0, 0.0, 1.0) | mat2(-12.0, 0.0, 0.0, 1.0) | mat2(255.0, 32.0, 64.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_vec3_to_mat2x3
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(1.0, 1.25, 1.125) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.5, 0.75) ];
+ input vec3 in1 = [ vec3(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output mat2x3 out0 = [ mat2x3(1.0, 1.25, 1.125, -32.0, 64.0, -51.0) | mat2x3(-0.75, -0.0322580645161, 0.0526315789474, -0.5, -2.25, -4.875) | mat2x3(-0.5, -2.25, -4.875, 0.0, 0.5, 0.75) | mat2x3(-32.0, 64.0, -51.0, 1.0, 1.25, 1.125) | mat2x3(0.0, 0.5, 0.75, -0.75, -0.0322580645161, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_bvec3_to_mat2x3
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, true, false) | bvec3(true, false, false) ];
+ input bvec3 in1 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) ];
+ output mat2x3 out0 = [ mat2x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x3(0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat2x3(1.0, 1.0, 1.0, 1.0, 0.0, 0.0) | mat2x3(0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_float_float_float_to_mat2x3
+ version 300 es
+ values
+ {
+ input float in0 = [ 1.0 | -8.25 | -20.125 | 36.8125 | -0.5 | 2.0 | 3.5 | 0.0 ];
+ input float in1 = [ -0.5 | -20.125 | 36.8125 | -8.25 | 2.0 | 1.0 | 3.5 | 0.0 ];
+ input float in2 = [ 3.5 | 1.0 | 36.8125 | -20.125 | -8.25 | -0.5 | 2.0 | 0.0 ];
+ input float in3 = [ 1.0 | -8.25 | 0.0 | -20.125 | 2.0 | 3.5 | -0.5 | 36.8125 ];
+ input float in4 = [ 1.0 | 0.0 | 3.5 | 2.0 | -8.25 | -20.125 | -0.5 | 36.8125 ];
+ input float in5 = [ 2.0 | -20.125 | -8.25 | -0.5 | 3.5 | 1.0 | 36.8125 | 0.0 ];
+ output mat2x3 out0 = [ mat2x3(1.0, -0.5, 3.5, 1.0, 1.0, 2.0) | mat2x3(-8.25, -20.125, 1.0, -8.25, 0.0, -20.125) | mat2x3(-20.125, 36.8125, 36.8125, 0.0, 3.5, -8.25) | mat2x3(36.8125, -8.25, -20.125, -20.125, 2.0, -0.5) | mat2x3(-0.5, 2.0, -8.25, 2.0, -8.25, 3.5) | mat2x3(2.0, 1.0, -0.5, 3.5, -20.125, 1.0) | mat2x3(3.5, 3.5, 2.0, -0.5, -0.5, 36.8125) | mat2x3(0.0, 0.0, 0.0, 36.8125, 36.8125, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_int_int_int_to_mat2x3
+ version 300 es
+ values
+ {
+ input int in0 = [ 2 | 8 | -192 | 0 | 5 | -12 | 1 | 255 | -66 | 11 ];
+ input int in1 = [ 1 | -192 | 8 | 0 | -12 | 2 | 11 | 255 | -66 | 5 ];
+ input int in2 = [ -192 | 2 | -66 | 8 | 11 | 255 | 0 | 5 | -12 | 1 ];
+ input int in3 = [ 2 | 11 | 255 | 0 | -66 | -12 | 5 | -192 | 8 | 1 ];
+ input int in4 = [ 8 | 0 | -12 | -192 | 2 | -66 | 1 | 255 | 5 | 11 ];
+ input int in5 = [ 0 | 11 | 5 | 8 | -12 | 255 | -192 | 2 | 1 | -66 ];
+ output mat2x3 out0 = [ mat2x3(2.0, 1.0, -192.0, 2.0, 8.0, 0.0) | mat2x3(8.0, -192.0, 2.0, 11.0, 0.0, 11.0) | mat2x3(-192.0, 8.0, -66.0, 255.0, -12.0, 5.0) | mat2x3(0.0, 0.0, 8.0, 0.0, -192.0, 8.0) | mat2x3(5.0, -12.0, 11.0, -66.0, 2.0, -12.0) | mat2x3(-12.0, 2.0, 255.0, -12.0, -66.0, 255.0) | mat2x3(1.0, 11.0, 0.0, 5.0, 1.0, -192.0) | mat2x3(255.0, 255.0, 5.0, -192.0, 255.0, 2.0) | mat2x3(-66.0, -66.0, -12.0, 8.0, 5.0, 1.0) | mat2x3(11.0, 5.0, 1.0, 1.0, 11.0, -66.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_bool_bool_bool_to_mat2x3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ false | true ];
+ input bool in2 = [ false | true ];
+ input bool in3 = [ true | false ];
+ input bool in4 = [ true | false ];
+ input bool in5 = [ true | false ];
+ output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat2x3(0.0, 1.0, 1.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_bool_float_int_to_mat2x3
+ version 300 es
+ values
+ {
+ input bool in0 = [ false | true | false | true | false | true | false | true | true | false ];
+ input float in1 = [ 0.0 | -8.25 | 2.0 | -20.125 | 3.5 | 0.0 | -0.5 | 36.8125 | 1.0 | 1.0 ];
+ input int in2 = [ -66 | -12 | 2 | 8 | 255 | 11 | -192 | 1 | 5 | 0 ];
+ input bool in3 = [ true | false | true | false | false | true | true | false | true | false ];
+ input float in4 = [ 1.0 | 0.0 | -8.25 | 1.0 | 3.5 | -20.125 | -0.5 | 0.0 | 2.0 | 36.8125 ];
+ input int in5 = [ 255 | -192 | 1 | 2 | -12 | -66 | 8 | 0 | 11 | 5 ];
+ output mat2x3 out0 = [ mat2x3(0.0, 0.0, -66.0, 1.0, 1.0, 255.0) | mat2x3(1.0, -8.25, -12.0, 0.0, 0.0, -192.0) | mat2x3(0.0, 2.0, 2.0, 1.0, -8.25, 1.0) | mat2x3(1.0, -20.125, 8.0, 0.0, 1.0, 2.0) | mat2x3(0.0, 3.5, 255.0, 0.0, 3.5, -12.0) | mat2x3(1.0, 0.0, 11.0, 1.0, -20.125, -66.0) | mat2x3(0.0, -0.5, -192.0, 1.0, -0.5, 8.0) | mat2x3(1.0, 36.8125, 1.0, 0.0, 0.0, 0.0) | mat2x3(1.0, 1.0, 5.0, 1.0, 2.0, 11.0) | mat2x3(0.0, 1.0, 0.0, 0.0, 36.8125, 5.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_ivec3_to_mat2x3
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.5, 0.75) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ input ivec3 in1 = [ ivec3(1, 1, 1) | ivec3(-32, 64, -51) | ivec3(0, -2, -4) | ivec3(0, 0, 0) | ivec3(0, 0, 0) ];
+ output mat2x3 out0 = [ mat2x3(1.0, 1.25, 1.125, 1.0, 1.0, 1.0) | mat2x3(-0.5, -2.25, -4.875, -32.0, 64.0, -51.0) | mat2x3(-32.0, 64.0, -51.0, 0.0, -2.0, -4.0) | mat2x3(0.0, 0.5, 0.75, 0.0, 0.0, 0.0) | mat2x3(-0.75, -0.0322580645161, 0.0526315789474, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bvec4_to_mat2x3
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(-32.0, 64.0) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) ];
+ input bvec4 in1 = [ bvec4(true, false, false, true) | bvec4(false, true, false, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output mat2x3 out0 = [ mat2x3(-32.0, 64.0, 1.0, 0.0, 0.0, 1.0) | mat2x3(0.0, 0.5, 0.0, 1.0, 0.0, 0.0) | mat2x3(-0.5, -2.25, 0.0, 0.0, 0.0, 1.0) | mat2x3(1.0, 1.25, 1.0, 1.0, 1.0, 1.0) | mat2x3(-0.75, -0.0322580645161, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_float_ivec2_to_mat2x3
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, false, false) | bvec3(false, true, false) ];
+ input float in1 = [ 1.0 | -8.25 | 36.8125 | 2.0 | 3.5 | -0.5 | -20.125 | 0.0 ];
+ input ivec2 in2 = [ ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) ];
+ output mat2x3 out0 = [ mat2x3(0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat2x3(0.0, 0.0, 0.0, -8.25, 0.0, 0.0) | mat2x3(1.0, 1.0, 1.0, 36.8125, -32.0, 64.0) | mat2x3(1.0, 0.0, 0.0, 2.0, 0.0, -2.0) | mat2x3(0.0, 0.0, 0.0, 3.5, 1.0, 1.0) | mat2x3(0.0, 1.0, 0.0, -0.5, 0.0, -2.0) | mat2x3(1.0, 0.0, 0.0, -20.125, 0.0, 0.0) | mat2x3(0.0, 1.0, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_float_bvec2_to_mat2x3
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ];
+ input float in1 = [ 0.0 | 36.8125 | 3.5 | -0.5 | -8.25 | 2.0 | 1.0 | -20.125 ];
+ input bvec2 in2 = [ bvec2(false, false) | bvec2(false, true) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, false) ];
+ output mat2x3 out0 = [ mat2x3(0.0, 0.5, 0.75, 0.0, 0.0, 0.0) | mat2x3(-0.5, -2.25, -4.875, 36.8125, 0.0, 1.0) | mat2x3(0.0, 0.5, 0.75, 3.5, 1.0, 0.0) | mat2x3(1.0, 1.25, 1.125, -0.5, 0.0, 1.0) | mat2x3(-0.5, -2.25, -4.875, -8.25, 0.0, 0.0) | mat2x3(-0.75, -0.0322580645161, 0.0526315789474, 2.0, 1.0, 0.0) | mat2x3(-32.0, 64.0, -51.0, 1.0, 1.0, 1.0) | mat2x3(1.0, 1.25, 1.125, -20.125, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_vec3_vec2_to_mat2x4
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(-0.5, -2.25, -4.875) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-32.0, 64.0, -51.0) ];
+ input vec3 in1 = [ vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ];
+ input vec2 in2 = [ vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) ];
+ output mat2x4 out0 = [ mat2x4(-0.5, -2.25, -4.875, 0.0, 0.5, 0.75, -0.75, -0.0322580645161) | mat2x4(-0.75, -0.0322580645161, 0.0526315789474, -0.5, -2.25, -4.875, -32.0, 64.0) | mat2x4(0.0, 0.5, 0.75, -0.75, -0.0322580645161, 0.0526315789474, 1.0, 1.25) | mat2x4(1.0, 1.25, 1.125, -32.0, 64.0, -51.0, 0.0, 0.5) | mat2x4(-32.0, 64.0, -51.0, 1.0, 1.25, 1.125, -0.5, -2.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_ivec3_ivec2_to_mat2x4
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, -2, -4) | ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, 64, -51) ];
+ input ivec3 in1 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ input ivec2 in2 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, 64) ];
+ output mat2x4 out0 = [ mat2x4(0.0, -2.0, -4.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x4(0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, -2.0) | mat2x4(1.0, 1.0, 1.0, 0.0, -2.0, -4.0, 1.0, 1.0) | mat2x4(0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 0.0, 0.0) | mat2x4(-32.0, 64.0, -51.0, 0.0, 0.0, 0.0, -32.0, 64.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_float_float_int_bool_to_mat2x4
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) ];
+ input ivec2 in1 = [ ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) ];
+ input float in2 = [ -8.25 | -0.5 | 3.5 | 36.8125 | 0.0 | 0.0 | 2.0 | -20.125 | 1.0 | 1.0 ];
+ input float in3 = [ 1.0 | 2.0 | -0.5 | 3.5 | 36.8125 | -8.25 | 1.0 | 0.0 | 0.0 | -20.125 ];
+ input int in4 = [ 255 | 8 | 11 | -12 | -192 | 0 | 2 | 1 | -66 | 5 ];
+ input bool in5 = [ true | false | false | true | false | true | true | false | true | false ];
+ output mat2x4 out0 = [ mat2x4(0.0, 0.5, 1.0, 1.0, -8.25, 1.0, 255.0, 1.0) | mat2x4(-32.0, 64.0, 0.0, -2.0, -0.5, 2.0, 8.0, 0.0) | mat2x4(-0.5, -2.25, -32.0, 64.0, 3.5, -0.5, 11.0, 0.0) | mat2x4(0.0, 0.5, 0.0, -2.0, 36.8125, 3.5, -12.0, 1.0) | mat2x4(-32.0, 64.0, 0.0, 0.0, 0.0, 36.8125, -192.0, 0.0) | mat2x4(1.0, 1.25, 0.0, 0.0, 0.0, -8.25, 0.0, 1.0) | mat2x4(-0.75, -0.0322580645161, -32.0, 64.0, 2.0, 1.0, 2.0, 1.0) | mat2x4(1.0, 1.25, 0.0, 0.0, -20.125, 0.0, 1.0, 0.0) | mat2x4(-0.5, -2.25, 0.0, 0.0, 1.0, 0.0, -66.0, 1.0) | mat2x4(-0.75, -0.0322580645161, 1.0, 1.0, 1.0, -20.125, 5.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_vec2_bool_bvec2_to_mat2x4
+ version 300 es
+ values
+ {
+ input bool in0 = [ false | true | false | true | true | true | false | false | false | true ];
+ input float in1 = [ 0.0 | -0.5 | -20.125 | -8.25 | 0.0 | 2.0 | 3.5 | 1.0 | 1.0 | 36.8125 ];
+ input int in2 = [ 2 | 1 | 255 | 8 | -66 | 0 | -12 | 5 | -192 | 11 ];
+ input vec2 in3 = [ vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) ];
+ input bool in4 = [ true | false | false | true | false | false | true | true | true | false ];
+ input bvec2 in5 = [ bvec2(true, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, false) ];
+ output mat2x4 out0 = [ mat2x4(0.0, 0.0, 2.0, -32.0, 64.0, 1.0, 1.0, 0.0) | mat2x4(1.0, -0.5, 1.0, -0.5, -2.25, 0.0, 1.0, 1.0) | mat2x4(0.0, -20.125, 255.0, 1.0, 1.25, 0.0, 0.0, 1.0) | mat2x4(1.0, -8.25, 8.0, -0.75, -0.0322580645161, 1.0, 1.0, 1.0) | mat2x4(1.0, 0.0, -66.0, 0.0, 0.5, 0.0, 0.0, 0.0) | mat2x4(1.0, 2.0, 0.0, 1.0, 1.25, 0.0, 0.0, 1.0) | mat2x4(0.0, 3.5, -12.0, -32.0, 64.0, 1.0, 0.0, 0.0) | mat2x4(0.0, 1.0, 5.0, -0.5, -2.25, 1.0, 0.0, 0.0) | mat2x4(0.0, 1.0, -192.0, 0.0, 0.5, 1.0, 0.0, 0.0) | mat2x4(1.0, 36.8125, 11.0, -0.75, -0.0322580645161, 0.0, 1.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bvec2_int_vec4_to_mat2x4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | true | true | false | false | false | false | false | true | true ];
+ input bvec2 in1 = [ bvec2(true, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, true) | bvec2(false, false) ];
+ input int in2 = [ 8 | 1 | 5 | -66 | -192 | 11 | 255 | 0 | -12 | 2 ];
+ input vec4 in3 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) ];
+ output mat2x4 out0 = [ mat2x4(1.0, 1.0, 1.0, 8.0, 0.0, 0.5, 0.75, 0.825) | mat2x4(1.0, 0.0, 0.0, 1.0, 0.0, 0.5, 0.75, 0.825) | mat2x4(1.0, 1.0, 0.0, 5.0, -32.0, 64.0, -51.0, 24.0) | mat2x4(0.0, 0.0, 0.0, -66.0, 1.0, 1.25, 1.125, 1.75) | mat2x4(0.0, 1.0, 1.0, -192.0, -0.5, -2.25, -4.875, 9.0) | mat2x4(0.0, 1.0, 0.0, 11.0, 1.0, 1.25, 1.125, 1.75) | mat2x4(0.0, 0.0, 1.0, 255.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25) | mat2x4(0.0, 0.0, 0.0, 0.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25) | mat2x4(1.0, 0.0, 1.0, -12.0, -0.5, -2.25, -4.875, 9.0) | mat2x4(1.0, 0.0, 0.0, 2.0, -32.0, 64.0, -51.0, 24.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_bvec4_ivec2_bool_to_mat2x4
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 3.5 | 2.0 | -8.25 | -20.125 | 36.8125 | 1.0 | -0.5 ];
+ input bvec4 in1 = [ bvec4(true, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(false, true, false, false) | bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, false, false, false) ];
+ input ivec2 in2 = [ ivec2(0, -2) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(1, 1) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) ];
+ input bool in3 = [ true | true | false | true | false | false | false | true ];
+ output mat2x4 out0 = [ mat2x4(0.0, 1.0, 0.0, 0.0, 1.0, 0.0, -2.0, 1.0) | mat2x4(3.5, 1.0, 1.0, 1.0, 1.0, -32.0, 64.0, 1.0) | mat2x4(2.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0) | mat2x4(-8.25, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat2x4(-20.125, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x4(36.8125, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat2x4(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat2x4(-0.5, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_vec3_to_mat3x2
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) ];
+ input vec3 in1 = [ vec3(1.0, 1.25, 1.125) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) ];
+ output mat3x2 out0 = [ mat3x2(-0.75, -0.0322580645161, 0.0526315789474, 1.0, 1.25, 1.125) | mat3x2(-0.5, -2.25, -4.875, -0.75, -0.0322580645161, 0.0526315789474) | mat3x2(0.0, 0.5, 0.75, -32.0, 64.0, -51.0) | mat3x2(-32.0, 64.0, -51.0, -0.5, -2.25, -4.875) | mat3x2(1.0, 1.25, 1.125, 0.0, 0.5, 0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_bvec3_to_mat3x2
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ input bvec3 in1 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, true, false) | bvec3(true, false, false) ];
+ output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat3x2(1.0, 1.0, 1.0, 0.0, 1.0, 0.0) | mat3x2(0.0, 0.0, 0.0, 1.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_float_float_float_to_mat3x2
+ version 300 es
+ values
+ {
+ input float in0 = [ -8.25 | 36.8125 | -20.125 | -0.5 | 3.5 | 1.0 | 2.0 | 0.0 ];
+ input float in1 = [ 2.0 | 3.5 | -20.125 | 36.8125 | 1.0 | 0.0 | -8.25 | -0.5 ];
+ input float in2 = [ -0.5 | 2.0 | 1.0 | 0.0 | -8.25 | 36.8125 | -20.125 | 3.5 ];
+ input float in3 = [ 36.8125 | 0.0 | 1.0 | -0.5 | 2.0 | 3.5 | -20.125 | -8.25 ];
+ input float in4 = [ 36.8125 | 2.0 | 0.0 | -0.5 | 3.5 | -20.125 | -8.25 | 1.0 ];
+ input float in5 = [ 0.0 | 36.8125 | -20.125 | -0.5 | 3.5 | 2.0 | 1.0 | -8.25 ];
+ output mat3x2 out0 = [ mat3x2(-8.25, 2.0, -0.5, 36.8125, 36.8125, 0.0) | mat3x2(36.8125, 3.5, 2.0, 0.0, 2.0, 36.8125) | mat3x2(-20.125, -20.125, 1.0, 1.0, 0.0, -20.125) | mat3x2(-0.5, 36.8125, 0.0, -0.5, -0.5, -0.5) | mat3x2(3.5, 1.0, -8.25, 2.0, 3.5, 3.5) | mat3x2(1.0, 0.0, 36.8125, 3.5, -20.125, 2.0) | mat3x2(2.0, -8.25, -20.125, -20.125, -8.25, 1.0) | mat3x2(0.0, -0.5, 3.5, -8.25, 1.0, -8.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_int_int_int_to_mat3x2
+ version 300 es
+ values
+ {
+ input int in0 = [ 8 | -192 | 2 | 11 | 255 | -66 | 5 | -12 | 1 | 0 ];
+ input int in1 = [ 1 | 2 | -12 | 5 | 0 | 255 | 8 | 11 | -192 | -66 ];
+ input int in2 = [ -12 | 11 | 2 | 1 | 8 | -66 | -192 | 5 | 255 | 0 ];
+ input int in3 = [ -192 | 0 | -12 | 11 | 1 | -66 | 8 | 255 | 2 | 5 ];
+ input int in4 = [ -12 | 5 | 0 | -66 | 255 | 8 | -192 | 11 | 2 | 1 ];
+ input int in5 = [ -66 | -12 | 8 | 2 | 255 | 0 | -192 | 11 | 1 | 5 ];
+ output mat3x2 out0 = [ mat3x2(8.0, 1.0, -12.0, -192.0, -12.0, -66.0) | mat3x2(-192.0, 2.0, 11.0, 0.0, 5.0, -12.0) | mat3x2(2.0, -12.0, 2.0, -12.0, 0.0, 8.0) | mat3x2(11.0, 5.0, 1.0, 11.0, -66.0, 2.0) | mat3x2(255.0, 0.0, 8.0, 1.0, 255.0, 255.0) | mat3x2(-66.0, 255.0, -66.0, -66.0, 8.0, 0.0) | mat3x2(5.0, 8.0, -192.0, 8.0, -192.0, -192.0) | mat3x2(-12.0, 11.0, 5.0, 255.0, 11.0, 11.0) | mat3x2(1.0, -192.0, 255.0, 2.0, 2.0, 1.0) | mat3x2(0.0, -66.0, 0.0, 5.0, 1.0, 5.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_bool_bool_bool_to_mat3x2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ false | true ];
+ input bool in2 = [ false | true ];
+ input bool in3 = [ false | true ];
+ input bool in4 = [ false | true ];
+ input bool in5 = [ false | true ];
+ output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(0.0, 1.0, 1.0, 1.0, 1.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_bool_float_int_to_mat3x2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false | true | true | false | true | false | true | false | false ];
+ input float in1 = [ -20.125 | 0.0 | 3.5 | 0.0 | 1.0 | -8.25 | 1.0 | 2.0 | 36.8125 | -0.5 ];
+ input int in2 = [ 255 | -66 | 8 | -192 | 5 | 11 | 1 | 2 | 0 | -12 ];
+ input bool in3 = [ true | false | false | true | false | true | true | false | false | true ];
+ input float in4 = [ 0.0 | -20.125 | 1.0 | -8.25 | 0.0 | -0.5 | 2.0 | 3.5 | 1.0 | 36.8125 ];
+ input int in5 = [ -192 | 8 | 2 | 255 | -66 | -12 | 11 | 0 | 5 | 1 ];
+ output mat3x2 out0 = [ mat3x2(1.0, -20.125, 255.0, 1.0, 0.0, -192.0) | mat3x2(0.0, 0.0, -66.0, 0.0, -20.125, 8.0) | mat3x2(1.0, 3.5, 8.0, 0.0, 1.0, 2.0) | mat3x2(1.0, 0.0, -192.0, 1.0, -8.25, 255.0) | mat3x2(0.0, 1.0, 5.0, 0.0, 0.0, -66.0) | mat3x2(1.0, -8.25, 11.0, 1.0, -0.5, -12.0) | mat3x2(0.0, 1.0, 1.0, 1.0, 2.0, 11.0) | mat3x2(1.0, 2.0, 2.0, 0.0, 3.5, 0.0) | mat3x2(0.0, 36.8125, 0.0, 0.0, 1.0, 5.0) | mat3x2(0.0, -0.5, -12.0, 1.0, 36.8125, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_ivec3_to_mat3x2
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) ];
+ input ivec3 in1 = [ ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output mat3x2 out0 = [ mat3x2(0.0, 0.5, 0.75, 1.0, 1.0, 1.0) | mat3x2(1.0, 1.25, 1.125, 0.0, 0.0, 0.0) | mat3x2(-0.75, -0.0322580645161, 0.0526315789474, 0.0, -2.0, -4.0) | mat3x2(-32.0, 64.0, -51.0, -32.0, 64.0, -51.0) | mat3x2(-0.5, -2.25, -4.875, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bvec4_to_mat3x2
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) ];
+ input bvec4 in1 = [ bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(false, false, false, false) | bvec4(true, false, false, true) | bvec4(false, true, false, false) ];
+ output mat3x2 out0 = [ mat3x2(0.0, 0.5, 1.0, 1.0, 1.0, 1.0) | mat3x2(-0.75, -0.0322580645161, 0.0, 0.0, 0.0, 1.0) | mat3x2(-32.0, 64.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(-0.5, -2.25, 1.0, 0.0, 0.0, 1.0) | mat3x2(1.0, 1.25, 0.0, 1.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_float_ivec2_to_mat3x2
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, false, false) | bvec3(false, true, false) | bvec3(true, false, false) ];
+ input float in1 = [ -8.25 | 1.0 | 2.0 | -0.5 | -20.125 | 0.0 | 36.8125 | 3.5 ];
+ input ivec2 in2 = [ ivec2(1, 1) | ivec2(1, 1) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(-32, 64) ];
+ output mat3x2 out0 = [ mat3x2(0.0, 0.0, 0.0, -8.25, 1.0, 1.0) | mat3x2(1.0, 1.0, 1.0, 1.0, 1.0, 1.0) | mat3x2(0.0, 0.0, 0.0, 2.0, 0.0, 0.0) | mat3x2(0.0, 0.0, 0.0, -0.5, 0.0, -2.0) | mat3x2(0.0, 1.0, 0.0, -20.125, 0.0, 0.0) | mat3x2(1.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(0.0, 1.0, 0.0, 36.8125, 0.0, -2.0) | mat3x2(1.0, 0.0, 0.0, 3.5, -32.0, 64.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_float_bvec2_to_mat3x2
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(1.0, 1.25, 1.125) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.5, 0.75) | vec3(0.0, 0.5, 0.75) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ input float in1 = [ -8.25 | 36.8125 | -0.5 | 3.5 | 2.0 | -20.125 | 0.0 | 1.0 ];
+ input bvec2 in2 = [ bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) | bvec2(false, true) | bvec2(false, true) | bvec2(true, false) | bvec2(false, false) ];
+ output mat3x2 out0 = [ mat3x2(1.0, 1.25, 1.125, -8.25, 1.0, 0.0) | mat3x2(1.0, 1.25, 1.125, 36.8125, 0.0, 0.0) | mat3x2(-0.5, -2.25, -4.875, -0.5, 1.0, 1.0) | mat3x2(-0.5, -2.25, -4.875, 3.5, 0.0, 0.0) | mat3x2(-32.0, 64.0, -51.0, 2.0, 0.0, 1.0) | mat3x2(0.0, 0.5, 0.75, -20.125, 0.0, 1.0) | mat3x2(0.0, 0.5, 0.75, 0.0, 1.0, 0.0) | mat3x2(-0.75, -0.0322580645161, 0.0526315789474, 1.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_vec3_vec3_to_mat3
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.5, 0.75) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ input vec3 in1 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(1.0, 1.25, 1.125) | vec3(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) ];
+ input vec3 in2 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) | vec3(1.0, 1.25, 1.125) | vec3(0.0, 0.5, 0.75) ];
+ output mat3 out0 = [ mat3(1.0, 1.25, 1.125, -0.75, -0.0322580645161, 0.0526315789474, -0.75, -0.0322580645161, 0.0526315789474) | mat3(-0.5, -2.25, -4.875, 1.0, 1.25, 1.125, -32.0, 64.0, -51.0) | mat3(-32.0, 64.0, -51.0, -32.0, 64.0, -51.0, -0.5, -2.25, -4.875) | mat3(0.0, 0.5, 0.75, -0.5, -2.25, -4.875, 1.0, 1.25, 1.125) | mat3(-0.75, -0.0322580645161, 0.0526315789474, 0.0, 0.5, 0.75, 0.0, 0.5, 0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_ivec3_ivec3_to_mat3
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(0, 0, 0) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ input ivec3 in1 = [ ivec3(0, 0, 0) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) | ivec3(1, 1, 1) ];
+ input ivec3 in2 = [ ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, 64, -51) | ivec3(0, -2, -4) | ivec3(0, 0, 0) ];
+ output mat3 out0 = [ mat3(1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat3(0.0, -2.0, -4.0, 0.0, -2.0, -4.0, 0.0, 0.0, 0.0) | mat3(0.0, 0.0, 0.0, -32.0, 64.0, -51.0, -32.0, 64.0, -51.0) | mat3(-32.0, 64.0, -51.0, 0.0, 0.0, 0.0, 0.0, -2.0, -4.0) | mat3(0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_float_float_int_bool_bool_to_mat3
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(-32, 64) ];
+ input float in2 = [ -0.5 | 3.5 | 0.0 | -20.125 | 1.0 | -8.25 | 0.0 | 1.0 | 2.0 | 36.8125 ];
+ input float in3 = [ 3.5 | 0.0 | -20.125 | 36.8125 | 2.0 | -8.25 | -0.5 | 1.0 | 0.0 | 1.0 ];
+ input int in4 = [ 0 | 11 | 5 | -192 | 8 | -66 | 1 | 2 | 255 | -12 ];
+ input bool in5 = [ true | true | true | false | true | false | false | false | true | false ];
+ input bool in6 = [ false | false | true | false | false | false | true | true | true | true ];
+ output mat3 out0 = [ mat3(1.0, 1.25, 0.0, 0.0, -0.5, 3.5, 0.0, 1.0, 0.0) | mat3(-0.5, -2.25, 0.0, -2.0, 3.5, 0.0, 11.0, 1.0, 0.0) | mat3(0.0, 0.5, 1.0, 1.0, 0.0, -20.125, 5.0, 1.0, 1.0) | mat3(-0.75, -0.0322580645161, 0.0, -2.0, -20.125, 36.8125, -192.0, 0.0, 0.0) | mat3(-32.0, 64.0, 0.0, 0.0, 1.0, 2.0, 8.0, 1.0, 0.0) | mat3(-0.75, -0.0322580645161, 0.0, 0.0, -8.25, -8.25, -66.0, 0.0, 0.0) | mat3(-0.5, -2.25, 1.0, 1.0, 0.0, -0.5, 1.0, 0.0, 1.0) | mat3(1.0, 1.25, -32.0, 64.0, 1.0, 1.0, 2.0, 0.0, 1.0) | mat3(0.0, 0.5, 0.0, 0.0, 2.0, 0.0, 255.0, 1.0, 1.0) | mat3(-32.0, 64.0, -32.0, 64.0, 36.8125, 1.0, -12.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0, in1, in2, in3, in4, in5, in6);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_vec2_bool_bvec2_float_to_mat3
+ version 300 es
+ values
+ {
+ input bool in0 = [ false | true | true | true | true | true | false | false | false | false ];
+ input float in1 = [ -8.25 | 1.0 | -0.5 | 36.8125 | 0.0 | 3.5 | -20.125 | 1.0 | 0.0 | 2.0 ];
+ input int in2 = [ 8 | -66 | 5 | 1 | 0 | 2 | -12 | -192 | 11 | 255 ];
+ input vec2 in3 = [ vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) ];
+ input bool in4 = [ true | false | true | false | false | true | true | false | true | false ];
+ input bvec2 in5 = [ bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) ];
+ input float in6 = [ -0.5 | 1.0 | 1.0 | 0.0 | 36.8125 | 2.0 | 0.0 | 3.5 | -20.125 | -8.25 ];
+ output mat3 out0 = [ mat3(0.0, -8.25, 8.0, 0.0, 0.5, 1.0, 0.0, 1.0, -0.5) | mat3(1.0, 1.0, -66.0, -32.0, 64.0, 0.0, 0.0, 0.0, 1.0) | mat3(1.0, -0.5, 5.0, 1.0, 1.25, 1.0, 1.0, 0.0, 1.0) | mat3(1.0, 36.8125, 1.0, -32.0, 64.0, 0.0, 0.0, 0.0, 0.0) | mat3(1.0, 0.0, 0.0, -0.5, -2.25, 0.0, 1.0, 1.0, 36.8125) | mat3(1.0, 3.5, 2.0, -0.75, -0.0322580645161, 1.0, 0.0, 0.0, 2.0) | mat3(0.0, -20.125, -12.0, -0.5, -2.25, 1.0, 1.0, 0.0, 0.0) | mat3(0.0, 1.0, -192.0, 0.0, 0.5, 0.0, 0.0, 0.0, 3.5) | mat3(0.0, 0.0, 11.0, 1.0, 1.25, 1.0, 0.0, 1.0, -20.125) | mat3(0.0, 2.0, 255.0, -0.75, -0.0322580645161, 0.0, 1.0, 1.0, -8.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0, in1, in2, in3, in4, in5, in6);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bvec2_int_vec4_bool_to_mat3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false | true | true | false | false | true | false | false | true ];
+ input bvec2 in1 = [ bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) | bvec2(true, true) | bvec2(false, false) | bvec2(false, true) | bvec2(true, false) | bvec2(true, false) | bvec2(false, false) ];
+ input int in2 = [ -192 | 2 | 0 | 5 | 1 | -66 | 11 | -12 | 8 | 255 ];
+ input vec4 in3 = [ vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ input bool in4 = [ false | true | false | true | false | false | false | true | true | true ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, -192.0, -32.0, 64.0, -51.0, 24.0, 0.0) | mat3(0.0, 0.0, 1.0, 2.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 1.0) | mat3(1.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.75, 0.825, 0.0) | mat3(1.0, 1.0, 1.0, 5.0, -32.0, 64.0, -51.0, 24.0, 1.0) | mat3(0.0, 1.0, 1.0, 1.0, 1.0, 1.25, 1.125, 1.75, 0.0) | mat3(0.0, 0.0, 0.0, -66.0, 0.0, 0.5, 0.75, 0.825, 0.0) | mat3(1.0, 0.0, 1.0, 11.0, 1.0, 1.25, 1.125, 1.75, 0.0) | mat3(0.0, 1.0, 0.0, -12.0, -0.5, -2.25, -4.875, 9.0, 1.0) | mat3(0.0, 1.0, 0.0, 8.0, -0.5, -2.25, -4.875, 9.0, 1.0) | mat3(1.0, 0.0, 0.0, 255.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0, in1, in2, in3, in4);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_bvec4_ivec2_bool_bool_to_mat3
+ version 300 es
+ values
+ {
+ input float in0 = [ -8.25 | 2.0 | 36.8125 | 3.5 | 1.0 | -0.5 | -20.125 | 0.0 ];
+ input bvec4 in1 = [ bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, false, false, true) | bvec4(false, false, false, true) ];
+ input ivec2 in2 = [ ivec2(1, 1) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(1, 1) ];
+ input bool in3 = [ false | true | false | true | true | false | true | false ];
+ input bool in4 = [ true | false | false | false | true | true | false | true ];
+ output mat3 out0 = [ mat3(-8.25, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0) | mat3(2.0, 0.0, 1.0, 0.0, 0.0, 0.0, -2.0, 1.0, 0.0) | mat3(36.8125, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat3(3.5, 1.0, 1.0, 1.0, 1.0, -32.0, 64.0, 1.0, 0.0) | mat3(1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0) | mat3(-0.5, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat3(-20.125, 1.0, 0.0, 0.0, 1.0, 0.0, -2.0, 1.0, 0.0) | mat3(0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0, in1, in2, in3, in4);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_vec4_vec4_to_mat3x4
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(0.0, 0.5, 0.75, 0.825) ];
+ input vec4 in1 = [ vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) ];
+ input vec4 in2 = [ vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(0.0, 0.5, 0.75, 0.825) ];
+ output mat3x4 out0 = [ mat3x4(-0.75, -0.0322580645161, 0.0526315789474, 0.25, -0.75, -0.0322580645161, 0.0526315789474, 0.25, -32.0, 64.0, -51.0, 24.0) | mat3x4(1.0, 1.25, 1.125, 1.75, -0.5, -2.25, -4.875, 9.0, 1.0, 1.25, 1.125, 1.75) | mat3x4(-32.0, 64.0, -51.0, 24.0, 0.0, 0.5, 0.75, 0.825, -0.75, -0.0322580645161, 0.0526315789474, 0.25) | mat3x4(-0.5, -2.25, -4.875, 9.0, -32.0, 64.0, -51.0, 24.0, -0.5, -2.25, -4.875, 9.0) | mat3x4(0.0, 0.5, 0.75, 0.825, 1.0, 1.25, 1.125, 1.75, 0.0, 0.5, 0.75, 0.825) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_ivec4_ivec4_to_mat3x4
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) ];
+ input ivec4 in1 = [ ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) ];
+ input ivec4 in2 = [ ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) ];
+ output mat3x4 out0 = [ mat3x4(0.0, -2.0, -4.0, 9.0, 0.0, -2.0, -4.0, 9.0, 0.0, -2.0, -4.0, 9.0) | mat3x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x4(-32.0, 64.0, -51.0, 24.0, -32.0, 64.0, -51.0, 24.0, 1.0, 1.0, 1.0, 1.0) | mat3x4(0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat3x4(1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_float_float_float_int_int_bool_bool_bool_to_mat3x4
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(-0.5, -2.25) ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(1, 1) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(0, -2) ];
+ input float in2 = [ 1.0 | -8.25 | 2.0 | 3.5 | -20.125 | 36.8125 | 0.0 | 1.0 | -0.5 | 0.0 ];
+ input float in3 = [ -0.5 | 36.8125 | 1.0 | 1.0 | 0.0 | 3.5 | 2.0 | 0.0 | -8.25 | -20.125 ];
+ input float in4 = [ -8.25 | 1.0 | 1.0 | 0.0 | 2.0 | 36.8125 | 0.0 | -20.125 | 3.5 | -0.5 ];
+ input int in5 = [ 11 | 2 | 8 | 5 | 0 | -192 | 1 | -12 | 255 | -66 ];
+ input int in6 = [ -12 | 5 | 8 | 1 | 0 | 255 | 11 | -192 | -66 | 2 ];
+ input bool in7 = [ true | true | true | false | false | false | true | false | true | false ];
+ input bool in8 = [ true | true | true | false | true | false | true | false | false | false ];
+ input bool in9 = [ true | false | true | false | true | true | false | false | false | true ];
+ output mat3x4 out0 = [ mat3x4(1.0, 1.25, 0.0, 0.0, 1.0, -0.5, -8.25, 11.0, -12.0, 1.0, 1.0, 1.0) | mat3x4(0.0, 0.5, 0.0, 0.0, -8.25, 36.8125, 1.0, 2.0, 5.0, 1.0, 1.0, 0.0) | mat3x4(0.0, 0.5, -32.0, 64.0, 2.0, 1.0, 1.0, 8.0, 8.0, 1.0, 1.0, 1.0) | mat3x4(-32.0, 64.0, 1.0, 1.0, 3.5, 1.0, 0.0, 5.0, 1.0, 0.0, 0.0, 0.0) | mat3x4(-32.0, 64.0, 1.0, 1.0, -20.125, 0.0, 2.0, 0.0, 0.0, 0.0, 1.0, 1.0) | mat3x4(-0.75, -0.0322580645161, -32.0, 64.0, 36.8125, 3.5, 36.8125, -192.0, 255.0, 0.0, 0.0, 1.0) | mat3x4(1.0, 1.25, 0.0, 0.0, 0.0, 2.0, 0.0, 1.0, 11.0, 1.0, 1.0, 0.0) | mat3x4(-0.75, -0.0322580645161, 0.0, -2.0, 1.0, 0.0, -20.125, -12.0, -192.0, 0.0, 0.0, 0.0) | mat3x4(-0.5, -2.25, 0.0, 0.0, -0.5, -8.25, 3.5, 255.0, -66.0, 1.0, 0.0, 0.0) | mat3x4(-0.5, -2.25, 0.0, -2.0, 0.0, -20.125, -0.5, -66.0, 2.0, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0, in1, in2, in3, in4, in5, in6, in7, in8, in9);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_vec3_bool_bvec3_float_bool_to_mat3x4
+ version 300 es
+ values
+ {
+ input bool in0 = [ false | false | true | true | true | true | false | false | false | true ];
+ input float in1 = [ 36.8125 | -8.25 | 1.0 | 0.0 | 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -20.125 ];
+ input int in2 = [ -66 | -192 | 255 | 8 | 0 | -12 | 5 | 2 | 11 | 1 ];
+ input vec3 in3 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.5, 0.75) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-0.5, -2.25, -4.875) ];
+ input bool in4 = [ false | true | true | true | false | false | true | true | false | false ];
+ input bvec3 in5 = [ bvec3(true, false, false) | bvec3(true, false, false) | bvec3(false, true, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) ];
+ input float in6 = [ -8.25 | 1.0 | -0.5 | 36.8125 | 0.0 | 2.0 | -20.125 | 1.0 | 0.0 | 3.5 ];
+ input bool in7 = [ true | false | false | true | true | false | true | false | false | true ];
+ output mat3x4 out0 = [ mat3x4(0.0, 36.8125, -66.0, -0.75, -0.0322580645161, 0.0526315789474, 0.0, 1.0, 0.0, 0.0, -8.25, 1.0) | mat3x4(0.0, -8.25, -192.0, -32.0, 64.0, -51.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(1.0, 1.0, 255.0, 0.0, 0.5, 0.75, 1.0, 0.0, 1.0, 0.0, -0.5, 0.0) | mat3x4(1.0, 0.0, 8.0, -0.75, -0.0322580645161, 0.0526315789474, 1.0, 0.0, 0.0, 0.0, 36.8125, 1.0) | mat3x4(1.0, 0.0, 0.0, 0.0, 0.5, 0.75, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0) | mat3x4(1.0, 1.0, -12.0, -32.0, 64.0, -51.0, 0.0, 1.0, 1.0, 1.0, 2.0, 0.0) | mat3x4(0.0, 2.0, 5.0, 1.0, 1.25, 1.125, 1.0, 1.0, 1.0, 1.0, -20.125, 1.0) | mat3x4(0.0, 3.5, 2.0, 1.0, 1.25, 1.125, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(0.0, -0.5, 11.0, -0.5, -2.25, -4.875, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x4(1.0, -20.125, 1.0, -0.5, -2.25, -4.875, 0.0, 0.0, 0.0, 0.0, 3.5, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0, in1, in2, in3, in4, in5, in6, in7);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bvec4_int_vec4_bool_float_to_mat3x4
+ version 300 es
+ values
+ {
+ input bool in0 = [ false | true | true | true | false | false | false | true | false | true ];
+ input bvec4 in1 = [ bvec4(false, false, false, false) | bvec4(true, false, false, true) | bvec4(false, true, false, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, false, false, true) ];
+ input int in2 = [ 255 | 2 | -192 | -12 | 11 | 1 | 0 | -66 | 8 | 5 ];
+ input vec4 in3 = [ vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) ];
+ input bool in4 = [ true | true | true | false | false | false | true | true | false | false ];
+ input float in5 = [ 36.8125 | 2.0 | -8.25 | 0.0 | 1.0 | 1.0 | -0.5 | 3.5 | 0.0 | -20.125 ];
+ output mat3x4 out0 = [ mat3x4(0.0, 0.0, 0.0, 0.0, 0.0, 255.0, -0.5, -2.25, -4.875, 9.0, 1.0, 36.8125) | mat3x4(1.0, 1.0, 0.0, 0.0, 1.0, 2.0, 1.0, 1.25, 1.125, 1.75, 1.0, 2.0) | mat3x4(1.0, 0.0, 1.0, 0.0, 0.0, -192.0, 1.0, 1.25, 1.125, 1.75, 1.0, -8.25) | mat3x4(1.0, 0.0, 0.0, 0.0, 1.0, -12.0, 0.0, 0.5, 0.75, 0.825, 0.0, 0.0) | mat3x4(0.0, 1.0, 1.0, 1.0, 1.0, 11.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 0.0, 1.0) | mat3x4(0.0, 0.0, 0.0, 0.0, 1.0, 1.0, -32.0, 64.0, -51.0, 24.0, 0.0, 1.0) | mat3x4(0.0, 1.0, 1.0, 1.0, 1.0, 0.0, -32.0, 64.0, -51.0, 24.0, 1.0, -0.5) | mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.5, 0.75, 0.825, 1.0, 3.5) | mat3x4(0.0, 0.0, 1.0, 0.0, 0.0, 8.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 0.0, 0.0) | mat3x4(1.0, 1.0, 0.0, 0.0, 1.0, 5.0, -0.5, -2.25, -4.875, 9.0, 0.0, -20.125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_bvec4_ivec4_bool_bool_int_to_mat3x4
+ version 300 es
+ values
+ {
+ input float in0 = [ 36.8125 | 1.0 | 0.0 | 3.5 | -8.25 | -20.125 | 2.0 | 0.0 | 1.0 | -0.5 ];
+ input bvec4 in1 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(false, true, false, false) | bvec4(false, false, false, true) | bvec4(false, false, false, false) ];
+ input ivec4 in2 = [ ivec4(0, 0, 0, 0) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) ];
+ input bool in3 = [ true | false | true | true | false | true | true | false | false | false ];
+ input bool in4 = [ true | false | false | true | true | false | false | false | true | true ];
+ input int in5 = [ 1 | 5 | -12 | 8 | -192 | 2 | -66 | 255 | 11 | 0 ];
+ output mat3x4 out0 = [ mat3x4(36.8125, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, -4.0, 9.0, 0.0, 0.0, 5.0) | mat3x4(0.0, 0.0, 1.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 1.0, 0.0, -12.0) | mat3x4(3.5, 0.0, 0.0, 0.0, 1.0, 0.0, -2.0, -4.0, 9.0, 1.0, 1.0, 8.0) | mat3x4(-8.25, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, -192.0) | mat3x4(-20.125, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 2.0) | mat3x4(2.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, -66.0) | mat3x4(0.0, 0.0, 1.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 0.0, 0.0, 255.0) | mat3x4(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 11.0) | mat3x4(-0.5, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 1.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_vec3_vec2_to_mat4x2
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(1.0, 1.25, 1.125) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ input vec3 in1 = [ vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) ];
+ input vec2 in2 = [ vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(0.0, 0.5) ];
+ output mat4x2 out0 = [ mat4x2(1.0, 1.25, 1.125, -32.0, 64.0, -51.0, 1.0, 1.25) | mat4x2(-32.0, 64.0, -51.0, -0.75, -0.0322580645161, 0.0526315789474, -0.5, -2.25) | mat4x2(0.0, 0.5, 0.75, -0.5, -2.25, -4.875, -0.75, -0.0322580645161) | mat4x2(-0.5, -2.25, -4.875, 0.0, 0.5, 0.75, -32.0, 64.0) | mat4x2(-0.75, -0.0322580645161, 0.0526315789474, 1.0, 1.25, 1.125, 0.0, 0.5) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_ivec3_ivec2_to_mat4x2
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(0, 0, 0) | ivec3(-32, 64, -51) ];
+ input ivec3 in1 = [ ivec3(0, -2, -4) | ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, 64, -51) ];
+ input ivec2 in2 = [ ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) ];
+ output mat4x2 out0 = [ mat4x2(0.0, 0.0, 0.0, 0.0, -2.0, -4.0, -32.0, 64.0) | mat4x2(1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(0.0, -2.0, -4.0, 1.0, 1.0, 1.0, 0.0, 0.0) | mat4x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0) | mat4x2(-32.0, 64.0, -51.0, -32.0, 64.0, -51.0, 0.0, -2.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_float_float_int_bool_to_mat4x2
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) ];
+ input ivec2 in1 = [ ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) ];
+ input float in2 = [ 3.5 | -8.25 | 2.0 | 36.8125 | -0.5 | 1.0 | 1.0 | 0.0 | -20.125 | 0.0 ];
+ input float in3 = [ 0.0 | 36.8125 | 3.5 | 1.0 | -0.5 | -8.25 | 2.0 | 0.0 | -20.125 | 1.0 ];
+ input int in4 = [ -12 | -66 | 11 | 5 | 8 | 255 | -192 | 2 | 1 | 0 ];
+ input bool in5 = [ true | true | false | true | false | true | false | true | false | false ];
+ output mat4x2 out0 = [ mat4x2(-0.5, -2.25, 0.0, -2.0, 3.5, 0.0, -12.0, 1.0) | mat4x2(0.0, 0.5, 0.0, 0.0, -8.25, 36.8125, -66.0, 1.0) | mat4x2(1.0, 1.25, -32.0, 64.0, 2.0, 3.5, 11.0, 0.0) | mat4x2(0.0, 0.5, 1.0, 1.0, 36.8125, 1.0, 5.0, 1.0) | mat4x2(-32.0, 64.0, 1.0, 1.0, -0.5, -0.5, 8.0, 0.0) | mat4x2(-0.75, -0.0322580645161, 0.0, 0.0, 1.0, -8.25, 255.0, 1.0) | mat4x2(-0.75, -0.0322580645161, -32.0, 64.0, 1.0, 2.0, -192.0, 0.0) | mat4x2(-32.0, 64.0, 0.0, 0.0, 0.0, 0.0, 2.0, 1.0) | mat4x2(-0.5, -2.25, 0.0, 0.0, -20.125, -20.125, 1.0, 0.0) | mat4x2(1.0, 1.25, 0.0, -2.0, 0.0, 1.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_vec2_bool_bvec2_to_mat4x2
+ version 300 es
+ values
+ {
+ input bool in0 = [ false | false | true | true | true | false | false | true | false | true ];
+ input float in1 = [ 36.8125 | -8.25 | 3.5 | 1.0 | 2.0 | -0.5 | 0.0 | 1.0 | -20.125 | 0.0 ];
+ input int in2 = [ -66 | 1 | -192 | 2 | 11 | 0 | 255 | 8 | 5 | -12 ];
+ input vec2 in3 = [ vec2(-0.75, -0.0322580645161) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) ];
+ input bool in4 = [ true | false | false | false | false | true | true | true | false | true ];
+ input bvec2 in5 = [ bvec2(false, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) | bvec2(true, false) ];
+ output mat4x2 out0 = [ mat4x2(0.0, 36.8125, -66.0, -0.75, -0.0322580645161, 1.0, 0.0, 0.0) | mat4x2(0.0, -8.25, 1.0, -0.75, -0.0322580645161, 0.0, 0.0, 1.0) | mat4x2(1.0, 3.5, -192.0, -32.0, 64.0, 0.0, 0.0, 0.0) | mat4x2(1.0, 1.0, 2.0, 0.0, 0.5, 0.0, 1.0, 1.0) | mat4x2(1.0, 2.0, 11.0, 1.0, 1.25, 0.0, 1.0, 0.0) | mat4x2(0.0, -0.5, 0.0, 1.0, 1.25, 1.0, 0.0, 1.0) | mat4x2(0.0, 0.0, 255.0, -0.5, -2.25, 1.0, 0.0, 0.0) | mat4x2(1.0, 1.0, 8.0, -32.0, 64.0, 1.0, 1.0, 1.0) | mat4x2(0.0, -20.125, 5.0, 0.0, 0.5, 0.0, 0.0, 0.0) | mat4x2(1.0, 0.0, -12.0, -0.5, -2.25, 1.0, 1.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bvec2_int_vec4_to_mat4x2
+ version 300 es
+ values
+ {
+ input bool in0 = [ false | false | true | false | true | false | true | true | true | false ];
+ input bvec2 in1 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(true, true) ];
+ input int in2 = [ -12 | 8 | 2 | 255 | 5 | -192 | 0 | 11 | 1 | -66 ];
+ input vec4 in3 = [ vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) ];
+ output mat4x2 out0 = [ mat4x2(0.0, 1.0, 0.0, -12.0, 1.0, 1.25, 1.125, 1.75) | mat4x2(0.0, 0.0, 0.0, 8.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25) | mat4x2(1.0, 0.0, 0.0, 2.0, -32.0, 64.0, -51.0, 24.0) | mat4x2(0.0, 0.0, 0.0, 255.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25) | mat4x2(1.0, 1.0, 0.0, 5.0, -0.5, -2.25, -4.875, 9.0) | mat4x2(0.0, 0.0, 1.0, -192.0, -0.5, -2.25, -4.875, 9.0) | mat4x2(1.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.75, 0.825) | mat4x2(1.0, 0.0, 1.0, 11.0, -32.0, 64.0, -51.0, 24.0) | mat4x2(1.0, 1.0, 1.0, 1.0, 1.0, 1.25, 1.125, 1.75) | mat4x2(0.0, 1.0, 1.0, -66.0, 0.0, 0.5, 0.75, 0.825) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_bvec4_ivec2_bool_to_mat4x2
+ version 300 es
+ values
+ {
+ input float in0 = [ 1.0 | -8.25 | -20.125 | 3.5 | -0.5 | 2.0 | 36.8125 | 0.0 ];
+ input bvec4 in1 = [ bvec4(false, false, false, true) | bvec4(true, false, false, true) | bvec4(true, true, true, true) | bvec4(false, true, false, false) | bvec4(false, false, false, false) | bvec4(true, false, false, true) | bvec4(false, true, false, false) | bvec4(false, false, false, true) ];
+ input ivec2 in2 = [ ivec2(-32, 64) | ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) ];
+ input bool in3 = [ true | true | false | true | true | false | false | false ];
+ output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 0.0, 1.0, -32.0, 64.0, 1.0) | mat4x2(-8.25, 1.0, 0.0, 0.0, 1.0, 0.0, -2.0, 1.0) | mat4x2(-20.125, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0) | mat4x2(3.5, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4x2(-0.5, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat4x2(2.0, 1.0, 0.0, 0.0, 1.0, 0.0, -2.0, 0.0) | mat4x2(36.8125, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.0) | mat4x2(0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_vec4_vec4_to_mat4x3
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) ];
+ input vec4 in1 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ input vec4 in2 = [ vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output mat4x3 out0 = [ mat4x3(-0.5, -2.25, -4.875, 9.0, 0.0, 0.5, 0.75, 0.825, -32.0, 64.0, -51.0, 24.0) | mat4x3(1.0, 1.25, 1.125, 1.75, -0.5, -2.25, -4.875, 9.0, 1.0, 1.25, 1.125, 1.75) | mat4x3(0.0, 0.5, 0.75, 0.825, -32.0, 64.0, -51.0, 24.0, -0.5, -2.25, -4.875, 9.0) | mat4x3(-0.75, -0.0322580645161, 0.0526315789474, 0.25, 1.0, 1.25, 1.125, 1.75, 0.0, 0.5, 0.75, 0.825) | mat4x3(-32.0, 64.0, -51.0, 24.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, -0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_ivec4_ivec4_to_mat4x3
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ input ivec4 in1 = [ ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) | ivec4(0, -2, -4, 9) | ivec4(1, 1, 1, 1) ];
+ input ivec4 in2 = [ ivec4(-32, 64, -51, 24) | ivec4(0, -2, -4, 9) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, 0) ];
+ output mat4x3 out0 = [ mat4x3(1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0) | mat4x3(0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 0.0, -2.0, -4.0, 9.0) | mat4x3(0.0, -2.0, -4.0, 9.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0) | mat4x3(-32.0, 64.0, -51.0, 24.0, 0.0, -2.0, -4.0, 9.0, 0.0, 0.0, 0.0, 0.0) | mat4x3(0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_float_float_float_int_int_bool_bool_bool_to_mat4x3
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(0.0, 0.5) | vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ input ivec2 in1 = [ ivec2(0, -2) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) ];
+ input float in2 = [ -20.125 | 3.5 | 2.0 | -0.5 | -8.25 | 0.0 | 1.0 | 0.0 | 1.0 | 36.8125 ];
+ input float in3 = [ 0.0 | -8.25 | 36.8125 | 1.0 | 0.0 | -20.125 | 3.5 | 2.0 | -0.5 | 1.0 ];
+ input float in4 = [ 0.0 | 1.0 | 3.5 | -20.125 | 0.0 | 36.8125 | 1.0 | -8.25 | 2.0 | -0.5 ];
+ input int in5 = [ 2 | 8 | 1 | -192 | 0 | -12 | 11 | 255 | 5 | -66 ];
+ input int in6 = [ 2 | -12 | 5 | 8 | 11 | 255 | 0 | -66 | 1 | -192 ];
+ input bool in7 = [ true | true | false | true | false | false | false | true | false | true ];
+ input bool in8 = [ true | false | false | true | true | false | true | true | false | false ];
+ input bool in9 = [ false | true | false | false | false | false | true | true | true | true ];
+ output mat4x3 out0 = [ mat4x3(-0.5, -2.25, 0.0, -2.0, -20.125, 0.0, 0.0, 2.0, 2.0, 1.0, 1.0, 0.0) | mat4x3(0.0, 0.5, -32.0, 64.0, 3.5, -8.25, 1.0, 8.0, -12.0, 1.0, 0.0, 1.0) | mat4x3(0.0, 0.5, 1.0, 1.0, 2.0, 36.8125, 3.5, 1.0, 5.0, 0.0, 0.0, 0.0) | mat4x3(1.0, 1.25, -32.0, 64.0, -0.5, 1.0, -20.125, -192.0, 8.0, 1.0, 1.0, 0.0) | mat4x3(-0.75, -0.0322580645161, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, 11.0, 0.0, 1.0, 0.0) | mat4x3(-0.5, -2.25, 0.0, 0.0, 0.0, -20.125, 36.8125, -12.0, 255.0, 0.0, 0.0, 0.0) | mat4x3(-32.0, 64.0, 0.0, 0.0, 1.0, 3.5, 1.0, 11.0, 0.0, 0.0, 1.0, 1.0) | mat4x3(1.0, 1.25, 0.0, -2.0, 0.0, 2.0, -8.25, 255.0, -66.0, 1.0, 1.0, 1.0) | mat4x3(-32.0, 64.0, 0.0, 0.0, 1.0, -0.5, 2.0, 5.0, 1.0, 0.0, 0.0, 1.0) | mat4x3(-0.75, -0.0322580645161, 1.0, 1.0, 36.8125, 1.0, -0.5, -66.0, -192.0, 1.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0, in1, in2, in3, in4, in5, in6, in7, in8, in9);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_vec3_bool_bvec3_float_bool_to_mat4x3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | true | false | false | true | true | true | false | false | false ];
+ input float in1 = [ -8.25 | 2.0 | 1.0 | -0.5 | 0.0 | 0.0 | 36.8125 | -20.125 | 3.5 | 1.0 ];
+ input int in2 = [ 255 | 2 | 11 | 1 | 8 | -192 | 0 | -66 | -12 | 5 ];
+ input vec3 in3 = [ vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) | vec3(0.0, 0.5, 0.75) | vec3(-32.0, 64.0, -51.0) | vec3(-0.5, -2.25, -4.875) | vec3(1.0, 1.25, 1.125) | vec3(-32.0, 64.0, -51.0) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ input bool in4 = [ true | true | false | false | true | false | false | false | true | true ];
+ input bvec3 in5 = [ bvec3(false, false, false) | bvec3(false, true, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, false, false) | bvec3(true, false, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) ];
+ input float in6 = [ 1.0 | 0.0 | -0.5 | 36.8125 | 1.0 | -20.125 | 2.0 | 0.0 | -8.25 | 3.5 ];
+ input bool in7 = [ true | true | false | false | false | false | true | true | false | true ];
+ output mat4x3 out0 = [ mat4x3(1.0, -8.25, 255.0, -0.75, -0.0322580645161, 0.0526315789474, 1.0, 0.0, 0.0, 0.0, 1.0, 1.0) | mat4x3(1.0, 2.0, 2.0, 0.0, 0.5, 0.75, 1.0, 0.0, 1.0, 0.0, 0.0, 1.0) | mat4x3(0.0, 1.0, 11.0, 0.0, 0.5, 0.75, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0) | mat4x3(0.0, -0.5, 1.0, -32.0, 64.0, -51.0, 0.0, 0.0, 1.0, 0.0, 36.8125, 0.0) | mat4x3(1.0, 0.0, 8.0, -0.5, -2.25, -4.875, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0) | mat4x3(1.0, 0.0, -192.0, 1.0, 1.25, 1.125, 0.0, 1.0, 0.0, 0.0, -20.125, 0.0) | mat4x3(1.0, 36.8125, 0.0, -32.0, 64.0, -51.0, 0.0, 1.0, 1.0, 1.0, 2.0, 1.0) | mat4x3(0.0, -20.125, -66.0, 1.0, 1.25, 1.125, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0) | mat4x3(0.0, 3.5, -12.0, -0.5, -2.25, -4.875, 1.0, 0.0, 0.0, 0.0, -8.25, 0.0) | mat4x3(0.0, 1.0, 5.0, -0.75, -0.0322580645161, 0.0526315789474, 1.0, 0.0, 0.0, 0.0, 3.5, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0, in1, in2, in3, in4, in5, in6, in7);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bvec4_int_vec4_bool_float_to_mat4x3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | true | true | false | true | false | false | true | false | false ];
+ input bvec4 in1 = [ bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, false, false, false) | bvec4(false, false, false, true) ];
+ input int in2 = [ 5 | 11 | 0 | -192 | -66 | 255 | 1 | -12 | 8 | 2 ];
+ input vec4 in3 = [ vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(0.0, 0.5, 0.75, 0.825) ];
+ input bool in4 = [ false | true | true | false | true | false | true | true | false | false ];
+ input float in5 = [ -20.125 | 0.0 | 1.0 | -0.5 | 3.5 | -8.25 | 0.0 | 1.0 | 2.0 | 36.8125 ];
+ output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 0.0, 5.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 0.0, -20.125) | mat4x3(1.0, 0.0, 1.0, 0.0, 0.0, 11.0, -32.0, 64.0, -51.0, 24.0, 1.0, 0.0) | mat4x3(1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 1.25, 1.125, 1.75, 1.0, 1.0) | mat4x3(0.0, 1.0, 1.0, 1.0, 1.0, -192.0, -0.5, -2.25, -4.875, 9.0, 0.0, -0.5) | mat4x3(1.0, 1.0, 1.0, 1.0, 1.0, -66.0, 1.0, 1.25, 1.125, 1.75, 1.0, 3.5) | mat4x3(0.0, 1.0, 0.0, 0.0, 1.0, 255.0, -32.0, 64.0, -51.0, 24.0, 0.0, -8.25) | mat4x3(0.0, 1.0, 0.0, 0.0, 1.0, 1.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, 1.0, 0.0) | mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, -12.0, -0.5, -2.25, -4.875, 9.0, 1.0, 1.0) | mat4x3(0.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.5, 0.75, 0.825, 0.0, 2.0) | mat4x3(0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 0.0, 0.5, 0.75, 0.825, 0.0, 36.8125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_bvec4_ivec4_bool_bool_int_to_mat4x3
+ version 300 es
+ values
+ {
+ input float in0 = [ 36.8125 | -0.5 | 3.5 | 2.0 | 1.0 | -20.125 | 0.0 | 0.0 | -8.25 | 1.0 ];
+ input bvec4 in1 = [ bvec4(false, false, false, false) | bvec4(false, false, false, true) | bvec4(true, false, false, true) | bvec4(false, true, false, false) | bvec4(false, false, false, false) | bvec4(true, false, false, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, true, false, false) | bvec4(false, false, false, true) ];
+ input ivec4 in2 = [ ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(0, -2, -4, 9) ];
+ input bool in3 = [ false | true | false | true | false | false | false | true | true | true ];
+ input bool in4 = [ false | true | false | true | false | true | false | false | true | true ];
+ input int in5 = [ 2 | 1 | 8 | 11 | 255 | 5 | 0 | -66 | -192 | -12 ];
+ output mat4x3 out0 = [ mat4x3(36.8125, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 2.0) | mat4x3(-0.5, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0) | mat4x3(3.5, 1.0, 0.0, 0.0, 1.0, -32.0, 64.0, -51.0, 24.0, 0.0, 0.0, 8.0) | mat4x3(2.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 11.0) | mat4x3(1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 255.0) | mat4x3(-20.125, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 5.0) | mat4x3(0.0, 1.0, 1.0, 1.0, 1.0, -32.0, 64.0, -51.0, 24.0, 0.0, 0.0, 0.0) | mat4x3(0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, -66.0) | mat4x3(-8.25, 0.0, 1.0, 0.0, 0.0, 0.0, -2.0, -4.0, 9.0, 1.0, 1.0, -192.0) | mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, -2.0, -4.0, 9.0, 1.0, 1.0, -12.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0, in1, in2, in3, in4, in5);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_vec4_vec4_vec4_to_mat4
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) ];
+ input vec4 in1 = [ vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) ];
+ input vec4 in2 = [ vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) ];
+ input vec4 in3 = [ vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-0.5, -2.25, -4.875, 9.0) ];
+ output mat4 out0 = [ mat4(-0.75, -0.0322580645161, 0.0526315789474, 0.25, -0.75, -0.0322580645161, 0.0526315789474, 0.25, -32.0, 64.0, -51.0, 24.0, -32.0, 64.0, -51.0, 24.0) | mat4(-32.0, 64.0, -51.0, 24.0, -32.0, 64.0, -51.0, 24.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, -0.75, -0.0322580645161, 0.0526315789474, 0.25) | mat4(-0.5, -2.25, -4.875, 9.0, -0.5, -2.25, -4.875, 9.0, -0.5, -2.25, -4.875, 9.0, 1.0, 1.25, 1.125, 1.75) | mat4(1.0, 1.25, 1.125, 1.75, 1.0, 1.25, 1.125, 1.75, 1.0, 1.25, 1.125, 1.75, 0.0, 0.5, 0.75, 0.825) | mat4(0.0, 0.5, 0.75, 0.825, 0.0, 0.5, 0.75, 0.825, 0.0, 0.5, 0.75, 0.825, -0.5, -2.25, -4.875, 9.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_ivec4_ivec4_ivec4_to_mat4
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(-32, 64, -51, 24) | ivec4(0, -2, -4, 9) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, 0) ];
+ input ivec4 in1 = [ ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ input ivec4 in2 = [ ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) | ivec4(0, -2, -4, 9) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) ];
+ input ivec4 in3 = [ ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, 0) | ivec4(-32, 64, -51, 24) ];
+ output mat4 out0 = [ mat4(-32.0, 64.0, -51.0, 24.0, 1.0, 1.0, 1.0, 1.0, -32.0, 64.0, -51.0, 24.0, 1.0, 1.0, 1.0, 1.0) | mat4(0.0, -2.0, -4.0, 9.0, 0.0, -2.0, -4.0, 9.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, -4.0, 9.0) | mat4(1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0, -4.0, 9.0, 0.0, 0.0, 0.0, 0.0) | mat4(0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_bvec4_bvec4_bvec4_to_mat4
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(false, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(true, false, false, true) ];
+ input bvec4 in1 = [ bvec4(false, true, false, false) | bvec4(false, false, false, true) | bvec4(true, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ input bvec4 in2 = [ bvec4(false, true, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(true, false, false, true) ];
+ input bvec4 in3 = [ bvec4(true, true, true, true) | bvec4(false, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, false, false, true) ];
+ output mat4 out0 = [ mat4(0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0) | mat4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0) | mat4(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_ivec3_bvec3_vec4_ivec2_float_vec2_to_mat4
+ version 300 es
+ values
+ {
+ input float in0 = [ 2.0 | 1.0 | 3.5 | 0.0 | -20.125 | 36.8125 | -0.5 | -8.25 ];
+ input ivec3 in1 = [ ivec3(0, 0, 0) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(0, 0, 0) | ivec3(0, -2, -4) ];
+ input bvec3 in2 = [ bvec3(true, false, false) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(false, false, false) | bvec3(false, true, false) ];
+ input vec4 in3 = [ vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.0, 0.5, 0.75, 0.825) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(0.0, 0.5, 0.75, 0.825) ];
+ input ivec2 in4 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, -2) ];
+ input float in5 = [ 2.0 | 3.5 | 36.8125 | -8.25 | 0.0 | -20.125 | 1.0 | -0.5 ];
+ input vec2 in6 = [ vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(1.0, 1.25) | vec2(1.0, 1.25) ];
+ output mat4 out0 = [ mat4(2.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, -0.5, -2.25, -4.875, 9.0, 0.0, 0.0, 2.0, 0.0, 0.5) | mat4(1.0, -32.0, 64.0, -51.0, 1.0, 1.0, 1.0, 1.0, 1.25, 1.125, 1.75, 1.0, 1.0, 3.5, -0.5, -2.25) | mat4(3.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.75, 0.825, 0.0, -2.0, 36.8125, -32.0, 64.0) | mat4(0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, -0.5, -2.25, -4.875, 9.0, 0.0, 0.0, -8.25, 0.0, 0.5) | mat4(-20.125, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 1.25, 1.125, 1.75, 1.0, 1.0, 0.0, -0.75, -0.0322580645161) | mat4(36.8125, 0.0, -2.0, -4.0, 0.0, 1.0, 0.0, -0.75, -0.0322580645161, 0.0526315789474, 0.25, -32.0, 64.0, -20.125, -0.5, -2.25) | mat4(-0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -32.0, 64.0, -51.0, 24.0, 0.0, 0.0, 1.0, 1.0, 1.25) | mat4(-8.25, 0.0, -2.0, -4.0, 0.0, 1.0, 0.0, 0.0, 0.5, 0.75, 0.825, 0.0, -2.0, -0.5, 1.0, 1.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0, in1, in2, in3, in4, in5, in6);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # matrix_combine
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_matrix_to_matrix.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_matrix_to_matrix.html
new file mode 100644
index 0000000000..35da4acd0d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_matrix_to_matrix.html
@@ -0,0 +1,31 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'conversions_matrix_to_matrix';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+modules.shared.glsShaderLibrary.run(testName);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_matrix_to_matrix.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_matrix_to_matrix.test
new file mode 100644
index 0000000000..bbf36658fb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_matrix_to_matrix.test
@@ -0,0 +1,1952 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+group matrix_to_matrix "Matrix to Matrix Conversions"
+
+ case mat4_to_mat4
+ version 300 es
+ values
+ {
+ input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ];
+ output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4_to_mat4x3
+ version 300 es
+ values
+ {
+ input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ];
+ output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4_to_mat4x2
+ version 300 es
+ values
+ {
+ input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ];
+ output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4_to_mat3x4
+ version 300 es
+ values
+ {
+ input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ];
+ output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4_to_mat3
+ version 300 es
+ values
+ {
+ input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4_to_mat3x2
+ version 300 es
+ values
+ {
+ input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ];
+ output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4_to_mat2x4
+ version 300 es
+ values
+ {
+ input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ];
+ output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4_to_mat2x3
+ version 300 es
+ values
+ {
+ input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ];
+ output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4_to_mat2
+ version 300 es
+ values
+ {
+ input mat4 in0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 9.975, -6.542, 0.015625, 9.975) ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x3_to_mat4
+ version 300 es
+ values
+ {
+ input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ];
+ output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0, -0.75, -8.425, 0.03125, 0.0, 9.975, -6.542, 0.015625, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x3_to_mat4x3
+ version 300 es
+ values
+ {
+ input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ];
+ output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x3_to_mat4x2
+ version 300 es
+ values
+ {
+ input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ];
+ output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x3_to_mat3x4
+ version 300 es
+ values
+ {
+ input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ];
+ output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0, -0.75, -8.425, 0.03125, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x3_to_mat3
+ version 300 es
+ values
+ {
+ input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x3_to_mat3x2
+ version 300 es
+ values
+ {
+ input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ];
+ output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x3_to_mat2x4
+ version 300 es
+ values
+ {
+ input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ];
+ output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x3_to_mat2x3
+ version 300 es
+ values
+ {
+ input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ];
+ output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x3_to_mat2
+ version 300 es
+ values
+ {
+ input mat4x3 in0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 9.975, -6.542, 0.015625) ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x2_to_mat4
+ version 300 es
+ values
+ {
+ input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ];
+ output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.0, 0.0, 12.5, 0.0208333333333, 0.0, 0.0, -0.75, -8.425, 1.0, 0.0, 9.975, -6.542, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x2_to_mat4x3
+ version 300 es
+ values
+ {
+ input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ];
+ output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.0, 12.5, 0.0208333333333, 0.0, -0.75, -8.425, 1.0, 9.975, -6.542, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x2_to_mat4x2
+ version 300 es
+ values
+ {
+ input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ];
+ output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x2_to_mat3x4
+ version 300 es
+ values
+ {
+ input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ];
+ output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.0, 0.0, 12.5, 0.0208333333333, 0.0, 0.0, -0.75, -8.425, 1.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x2_to_mat3
+ version 300 es
+ values
+ {
+ input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.0, 12.5, 0.0208333333333, 0.0, -0.75, -8.425, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x2_to_mat3x2
+ version 300 es
+ values
+ {
+ input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ];
+ output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x2_to_mat2x4
+ version 300 es
+ values
+ {
+ input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ];
+ output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.0, 0.0, 12.5, 0.0208333333333, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x2_to_mat2x3
+ version 300 es
+ values
+ {
+ input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ];
+ output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.0, 12.5, 0.0208333333333, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x2_to_mat2
+ version 300 es
+ values
+ {
+ input mat4x2 in0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 9.975, -6.542) ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x4_to_mat4
+ version 300 es
+ values
+ {
+ input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ];
+ output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125, 0.0, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x4_to_mat4x3
+ version 300 es
+ values
+ {
+ input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ];
+ output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x4_to_mat4x2
+ version 300 es
+ values
+ {
+ input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ];
+ output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x4_to_mat3x4
+ version 300 es
+ values
+ {
+ input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ];
+ output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x4_to_mat3
+ version 300 es
+ values
+ {
+ input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x4_to_mat3x2
+ version 300 es
+ values
+ {
+ input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ];
+ output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x4_to_mat2x4
+ version 300 es
+ values
+ {
+ input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ];
+ output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x4_to_mat2x3
+ version 300 es
+ values
+ {
+ input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ];
+ output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x4_to_mat2
+ version 300 es
+ values
+ {
+ input mat3x4 in0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, -0.75, -8.425, 0.03125, -0.0125) ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3_to_mat4
+ version 300 es
+ values
+ {
+ input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ];
+ output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0, -0.75, -8.425, 0.03125, 0.0, 0.0, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3_to_mat4x3
+ version 300 es
+ values
+ {
+ input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ];
+ output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3_to_mat4x2
+ version 300 es
+ values
+ {
+ input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ];
+ output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3_to_mat3x4
+ version 300 es
+ values
+ {
+ input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ];
+ output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0, -0.75, -8.425, 0.03125, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3_to_mat3
+ version 300 es
+ values
+ {
+ input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3_to_mat3x2
+ version 300 es
+ values
+ {
+ input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ];
+ output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3_to_mat2x4
+ version 300 es
+ values
+ {
+ input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ];
+ output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3_to_mat2x3
+ version 300 es
+ values
+ {
+ input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ];
+ output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3_to_mat2
+ version 300 es
+ values
+ {
+ input mat3 in0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, -0.75, -8.425, 0.03125) ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x2_to_mat4
+ version 300 es
+ values
+ {
+ input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.0, 0.0, 12.5, 0.0208333333333, 0.0, 0.0, -0.75, -8.425, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x2_to_mat4x3
+ version 300 es
+ values
+ {
+ input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.0, 12.5, 0.0208333333333, 0.0, -0.75, -8.425, 1.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x2_to_mat4x2
+ version 300 es
+ values
+ {
+ input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x2_to_mat3x4
+ version 300 es
+ values
+ {
+ input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.0, 0.0, 12.5, 0.0208333333333, 0.0, 0.0, -0.75, -8.425, 1.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x2_to_mat3
+ version 300 es
+ values
+ {
+ input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.0, 12.5, 0.0208333333333, 0.0, -0.75, -8.425, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x2_to_mat3x2
+ version 300 es
+ values
+ {
+ input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x2_to_mat2x4
+ version 300 es
+ values
+ {
+ input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.0, 0.0, 12.5, 0.0208333333333, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x2_to_mat2x3
+ version 300 es
+ values
+ {
+ input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.0, 12.5, 0.0208333333333, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x2_to_mat2
+ version 300 es
+ values
+ {
+ input mat3x2 in0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, -0.75, -8.425) ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x4_to_mat4
+ version 300 es
+ values
+ {
+ input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ];
+ output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x4_to_mat4x3
+ version 300 es
+ values
+ {
+ input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ];
+ output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x4_to_mat4x2
+ version 300 es
+ values
+ {
+ input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ];
+ output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x4_to_mat3x4
+ version 300 es
+ values
+ {
+ input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ];
+ output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5, 0.0, 0.0, 1.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x4_to_mat3
+ version 300 es
+ values
+ {
+ input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x4_to_mat3x2
+ version 300 es
+ values
+ {
+ input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ];
+ output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x4_to_mat2x4
+ version 300 es
+ values
+ {
+ input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ];
+ output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x4_to_mat2x3
+ version 300 es
+ values
+ {
+ input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ];
+ output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x4_to_mat2
+ version 300 es
+ values
+ {
+ input mat2x4 in0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, -6.725, 12.5, 0.0208333333333, 0.0625, -0.5) ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x3_to_mat4
+ version 300 es
+ values
+ {
+ input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x3_to_mat4x3
+ version 300 es
+ values
+ {
+ input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x3_to_mat4x2
+ version 300 es
+ values
+ {
+ input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, 32.0, 12.5, 0.0208333333333, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x3_to_mat3x4
+ version 300 es
+ values
+ {
+ input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0, 0.0, 0.0, 1.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x3_to_mat3
+ version 300 es
+ values
+ {
+ input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x3_to_mat3x2
+ version 300 es
+ values
+ {
+ input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, 32.0, 12.5, 0.0208333333333, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x3_to_mat2x4
+ version 300 es
+ values
+ {
+ input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, 32.0, 0.125, 0.0, 12.5, 0.0208333333333, 0.0625, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x3_to_mat2x3
+ version 300 es
+ values
+ {
+ input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x3_to_mat2
+ version 300 es
+ values
+ {
+ input mat2x3 in0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, 32.0, 0.125, 12.5, 0.0208333333333, 0.0625) ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, 32.0, 12.5, 0.0208333333333) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2_to_mat4
+ version 300 es
+ values
+ {
+ input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ];
+ output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(8.0, -24.0, 0.0, 0.0, 16.0, -16.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(0.125, 0.03125, 0.0, 0.0, 0.0625, 0.015625, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(-18.725, -0.0125, 0.0, 0.0, -0.5, 19.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2_to_mat4x3
+ version 300 es
+ values
+ {
+ input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ];
+ output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(8.0, -24.0, 0.0, 16.0, -16.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(0.125, 0.03125, 0.0, 0.0625, 0.015625, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(-18.725, -0.0125, 0.0, -0.5, 19.975, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2_to_mat4x2
+ version 300 es
+ values
+ {
+ input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ];
+ output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, -0.75, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0) | mat4x2(6.5, -0.75, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0) | mat4x2(8.0, -24.0, 16.0, -16.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(0.125, 0.03125, 0.0625, 0.015625, 0.0, 0.0, 0.0, 0.0) | mat4x2(-18.725, -0.0125, -0.5, 19.975, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2_to_mat3x4
+ version 300 es
+ values
+ {
+ input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ];
+ output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(8.0, -24.0, 0.0, 0.0, 16.0, -16.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(0.125, 0.03125, 0.0, 0.0, 0.0625, 0.015625, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(-18.725, -0.0125, 0.0, 0.0, -0.5, 19.975, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2_to_mat3
+ version 300 es
+ values
+ {
+ input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 1.0) | mat3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0, 0.0, 0.0, 1.0) | mat3(8.0, -24.0, 0.0, 16.0, -16.0, 0.0, 0.0, 0.0, 1.0) | mat3(0.125, 0.03125, 0.0, 0.0625, 0.015625, 0.0, 0.0, 0.0, 1.0) | mat3(-18.725, -0.0125, 0.0, -0.5, 19.975, 0.0, 0.0, 0.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2_to_mat3x2
+ version 300 es
+ values
+ {
+ input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ];
+ output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(6.5, -0.75, 12.5, 9.975, 0.0, 0.0) | mat3x2(6.5, -0.75, 12.5, 9.975, 0.0, 0.0) | mat3x2(8.0, -24.0, 16.0, -16.0, 0.0, 0.0) | mat3x2(0.125, 0.03125, 0.0625, 0.015625, 0.0, 0.0) | mat3x2(-18.725, -0.0125, -0.5, 19.975, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2_to_mat2x4
+ version 300 es
+ values
+ {
+ input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ];
+ output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0) | mat2x4(6.5, -0.75, 0.0, 0.0, 12.5, 9.975, 0.0, 0.0) | mat2x4(8.0, -24.0, 0.0, 0.0, 16.0, -16.0, 0.0, 0.0) | mat2x4(0.125, 0.03125, 0.0, 0.0, 0.0625, 0.015625, 0.0, 0.0) | mat2x4(-18.725, -0.0125, 0.0, 0.0, -0.5, 19.975, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2_to_mat2x3
+ version 300 es
+ values
+ {
+ input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ];
+ output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0) | mat2x3(6.5, -0.75, 0.0, 12.5, 9.975, 0.0) | mat2x3(8.0, -24.0, 0.0, 16.0, -16.0, 0.0) | mat2x3(0.125, 0.03125, 0.0, 0.0625, 0.015625, 0.0) | mat2x3(-18.725, -0.0125, 0.0, -0.5, 19.975, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2_to_mat2
+ version 300 es
+ values
+ {
+ input mat2 in0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(6.5, -0.75, 12.5, 9.975) | mat2(8.0, -24.0, 16.0, -16.0) | mat2(0.125, 0.03125, 0.0625, 0.015625) | mat2(-18.725, -0.0125, -0.5, 19.975) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # matrix_to_matrix
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_scalar_to_matrix.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_scalar_to_matrix.html
new file mode 100644
index 0000000000..34b523530e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_scalar_to_matrix.html
@@ -0,0 +1,31 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'conversions_scalar_to_matrix';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+modules.shared.glsShaderLibrary.run(testName);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_scalar_to_matrix.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_scalar_to_matrix.test
new file mode 100644
index 0000000000..f141323840
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_scalar_to_matrix.test
@@ -0,0 +1,872 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+group scalar_to_matrix "Scalar to Matrix Conversions"
+
+ case float_to_mat4
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output mat4 out0 = [ mat4(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.0, 0.0, 0.0, 0.0) | mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0) | mat4(3.5, 0.0, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 0.0, 3.5) | mat4(-0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0, -0.5) | mat4(-8.25, 0.0, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, 0.0, -8.25) | mat4(-20.125, 0.0, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, 0.0, -20.125) | mat4(36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_mat4x3
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output mat4x3 out0 = [ mat4x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0) | mat4x3(3.5, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0) | mat4x3(-0.5, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0) | mat4x3(-8.25, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0) | mat4x3(-20.125, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0) | mat4x3(36.8125, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_mat4x2
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output mat4x2 out0 = [ mat4x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(2.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(3.5, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 0.0) | mat4x2(-0.5, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0) | mat4x2(-8.25, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, 0.0) | mat4x2(-20.125, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, 0.0) | mat4x2(36.8125, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_mat3x4
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output mat3x4 out0 = [ mat3x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0) | mat3x4(3.5, 0.0, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 0.0, 3.5, 0.0) | mat3x4(-0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0) | mat3x4(-8.25, 0.0, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, 0.0, -8.25, 0.0) | mat3x4(-20.125, 0.0, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, 0.0, -20.125, 0.0) | mat3x4(36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_mat3
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output mat3 out0 = [ mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0) | mat3(3.5, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0, 0.0, 3.5) | mat3(-0.5, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0, -0.5) | mat3(-8.25, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0, 0.0, -8.25) | mat3(-20.125, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0, 0.0, -20.125) | mat3(36.8125, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0, 0.0, 36.8125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_mat3x2
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output mat3x2 out0 = [ mat3x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(2.0, 0.0, 0.0, 2.0, 0.0, 0.0) | mat3x2(3.5, 0.0, 0.0, 3.5, 0.0, 0.0) | mat3x2(-0.5, 0.0, 0.0, -0.5, 0.0, 0.0) | mat3x2(-8.25, 0.0, 0.0, -8.25, 0.0, 0.0) | mat3x2(-20.125, 0.0, 0.0, -20.125, 0.0, 0.0) | mat3x2(36.8125, 0.0, 0.0, 36.8125, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_mat2x4
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output mat2x4 out0 = [ mat2x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0) | mat2x4(3.5, 0.0, 0.0, 0.0, 0.0, 3.5, 0.0, 0.0) | mat2x4(-0.5, 0.0, 0.0, 0.0, 0.0, -0.5, 0.0, 0.0) | mat2x4(-8.25, 0.0, 0.0, 0.0, 0.0, -8.25, 0.0, 0.0) | mat2x4(-20.125, 0.0, 0.0, 0.0, 0.0, -20.125, 0.0, 0.0) | mat2x4(36.8125, 0.0, 0.0, 0.0, 0.0, 36.8125, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_mat2x3
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output mat2x3 out0 = [ mat2x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0) | mat2x3(3.5, 0.0, 0.0, 0.0, 3.5, 0.0) | mat2x3(-0.5, 0.0, 0.0, 0.0, -0.5, 0.0) | mat2x3(-8.25, 0.0, 0.0, 0.0, -8.25, 0.0) | mat2x3(-20.125, 0.0, 0.0, 0.0, -20.125, 0.0) | mat2x3(36.8125, 0.0, 0.0, 0.0, 36.8125, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_mat2
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output mat2 out0 = [ mat2(0.0, 0.0, 0.0, 0.0) | mat2(1.0, 0.0, 0.0, 1.0) | mat2(2.0, 0.0, 0.0, 2.0) | mat2(3.5, 0.0, 0.0, 3.5) | mat2(-0.5, 0.0, 0.0, -0.5) | mat2(-8.25, 0.0, 0.0, -8.25) | mat2(-20.125, 0.0, 0.0, -20.125) | mat2(36.8125, 0.0, 0.0, 36.8125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_mat4
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output mat4 out0 = [ mat4(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.0, 0.0, 0.0, 0.0) | mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0) | mat4(5.0, 0.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 5.0) | mat4(8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 8.0) | mat4(11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0, 11.0) | mat4(-12.0, 0.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, 0.0, -12.0) | mat4(-66.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, 0.0, -66.0) | mat4(-192.0, 0.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, 0.0, -192.0) | mat4(255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0, 255.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_mat4x3
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output mat4x3 out0 = [ mat4x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0) | mat4x3(5.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0) | mat4x3(8.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0) | mat4x3(11.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0) | mat4x3(-12.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0) | mat4x3(-66.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0) | mat4x3(-192.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0) | mat4x3(255.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_mat4x2
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output mat4x2 out0 = [ mat4x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(2.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(5.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(8.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(11.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(-12.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(-66.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(-192.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(255.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_mat3x4
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output mat3x4 out0 = [ mat3x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0) | mat3x4(5.0, 0.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 5.0, 0.0) | mat3x4(8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0) | mat3x4(11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0) | mat3x4(-12.0, 0.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, 0.0, -12.0, 0.0) | mat3x4(-66.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0) | mat3x4(-192.0, 0.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, 0.0, -192.0, 0.0) | mat3x4(255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_mat3
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output mat3 out0 = [ mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0) | mat3(5.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 5.0) | mat3(8.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 8.0) | mat3(11.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 11.0) | mat3(-12.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0, 0.0, -12.0) | mat3(-66.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0, 0.0, -66.0) | mat3(-192.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0, 0.0, -192.0) | mat3(255.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 255.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_mat3x2
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output mat3x2 out0 = [ mat3x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(2.0, 0.0, 0.0, 2.0, 0.0, 0.0) | mat3x2(5.0, 0.0, 0.0, 5.0, 0.0, 0.0) | mat3x2(8.0, 0.0, 0.0, 8.0, 0.0, 0.0) | mat3x2(11.0, 0.0, 0.0, 11.0, 0.0, 0.0) | mat3x2(-12.0, 0.0, 0.0, -12.0, 0.0, 0.0) | mat3x2(-66.0, 0.0, 0.0, -66.0, 0.0, 0.0) | mat3x2(-192.0, 0.0, 0.0, -192.0, 0.0, 0.0) | mat3x2(255.0, 0.0, 0.0, 255.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_mat2x4
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output mat2x4 out0 = [ mat2x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0) | mat2x4(5.0, 0.0, 0.0, 0.0, 0.0, 5.0, 0.0, 0.0) | mat2x4(8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0) | mat2x4(11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0) | mat2x4(-12.0, 0.0, 0.0, 0.0, 0.0, -12.0, 0.0, 0.0) | mat2x4(-66.0, 0.0, 0.0, 0.0, 0.0, -66.0, 0.0, 0.0) | mat2x4(-192.0, 0.0, 0.0, 0.0, 0.0, -192.0, 0.0, 0.0) | mat2x4(255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_mat2x3
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output mat2x3 out0 = [ mat2x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0) | mat2x3(5.0, 0.0, 0.0, 0.0, 5.0, 0.0) | mat2x3(8.0, 0.0, 0.0, 0.0, 8.0, 0.0) | mat2x3(11.0, 0.0, 0.0, 0.0, 11.0, 0.0) | mat2x3(-12.0, 0.0, 0.0, 0.0, -12.0, 0.0) | mat2x3(-66.0, 0.0, 0.0, 0.0, -66.0, 0.0) | mat2x3(-192.0, 0.0, 0.0, 0.0, -192.0, 0.0) | mat2x3(255.0, 0.0, 0.0, 0.0, 255.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_mat2
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output mat2 out0 = [ mat2(0.0, 0.0, 0.0, 0.0) | mat2(1.0, 0.0, 0.0, 1.0) | mat2(2.0, 0.0, 0.0, 2.0) | mat2(5.0, 0.0, 0.0, 5.0) | mat2(8.0, 0.0, 0.0, 8.0) | mat2(11.0, 0.0, 0.0, 11.0) | mat2(-12.0, 0.0, 0.0, -12.0) | mat2(-66.0, 0.0, 0.0, -66.0) | mat2(-192.0, 0.0, 0.0, -192.0) | mat2(255.0, 0.0, 0.0, 255.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_mat4
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output mat4 out0 = [ mat4(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.0, 0.0, 0.0, 0.0) | mat4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0) | mat4(3.0, 0.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 0.0, 3.0) | mat4(8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 8.0) | mat4(9.0, 0.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 0.0, 9.0) | mat4(12.0, 0.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0, 0.0, 12.0) | mat4(10.0, 0.0, 0.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 0.0, 10.0) | mat4(45.0, 0.0, 0.0, 0.0, 0.0, 45.0, 0.0, 0.0, 0.0, 0.0, 45.0, 0.0, 0.0, 0.0, 0.0, 45.0) | mat4(193.0, 0.0, 0.0, 0.0, 0.0, 193.0, 0.0, 0.0, 0.0, 0.0, 193.0, 0.0, 0.0, 0.0, 0.0, 193.0) | mat4(255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0, 255.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_mat4x3
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output mat4x3 out0 = [ mat4x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4x3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0) | mat4x3(3.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0) | mat4x3(8.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0) | mat4x3(9.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0) | mat4x3(12.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0) | mat4x3(10.0, 0.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0) | mat4x3(45.0, 0.0, 0.0, 0.0, 45.0, 0.0, 0.0, 0.0, 45.0, 0.0, 0.0, 0.0) | mat4x3(193.0, 0.0, 0.0, 0.0, 193.0, 0.0, 0.0, 0.0, 193.0, 0.0, 0.0, 0.0) | mat4x3(255.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_mat4x2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output mat4x2 out0 = [ mat4x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(2.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(3.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(8.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(9.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(12.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(10.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(45.0, 0.0, 0.0, 45.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(193.0, 0.0, 0.0, 193.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(255.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_mat3x4
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output mat3x4 out0 = [ mat3x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0) | mat3x4(3.0, 0.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 0.0, 3.0, 0.0) | mat3x4(8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0) | mat3x4(9.0, 0.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 0.0, 9.0, 0.0) | mat3x4(12.0, 0.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0, 0.0, 12.0, 0.0) | mat3x4(10.0, 0.0, 0.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 0.0, 10.0, 0.0) | mat3x4(45.0, 0.0, 0.0, 0.0, 0.0, 45.0, 0.0, 0.0, 0.0, 0.0, 45.0, 0.0) | mat3x4(193.0, 0.0, 0.0, 0.0, 0.0, 193.0, 0.0, 0.0, 0.0, 0.0, 193.0, 0.0) | mat3x4(255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_mat3
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output mat3 out0 = [ mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 2.0) | mat3(3.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 3.0) | mat3(8.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0, 0.0, 8.0) | mat3(9.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 9.0) | mat3(12.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0, 12.0) | mat3(10.0, 0.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 10.0) | mat3(45.0, 0.0, 0.0, 0.0, 45.0, 0.0, 0.0, 0.0, 45.0) | mat3(193.0, 0.0, 0.0, 0.0, 193.0, 0.0, 0.0, 0.0, 193.0) | mat3(255.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0, 0.0, 255.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_mat3x2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output mat3x2 out0 = [ mat3x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat3x2(2.0, 0.0, 0.0, 2.0, 0.0, 0.0) | mat3x2(3.0, 0.0, 0.0, 3.0, 0.0, 0.0) | mat3x2(8.0, 0.0, 0.0, 8.0, 0.0, 0.0) | mat3x2(9.0, 0.0, 0.0, 9.0, 0.0, 0.0) | mat3x2(12.0, 0.0, 0.0, 12.0, 0.0, 0.0) | mat3x2(10.0, 0.0, 0.0, 10.0, 0.0, 0.0) | mat3x2(45.0, 0.0, 0.0, 45.0, 0.0, 0.0) | mat3x2(193.0, 0.0, 0.0, 193.0, 0.0, 0.0) | mat3x2(255.0, 0.0, 0.0, 255.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_mat2x4
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output mat2x4 out0 = [ mat2x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0) | mat2x4(3.0, 0.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0) | mat2x4(8.0, 0.0, 0.0, 0.0, 0.0, 8.0, 0.0, 0.0) | mat2x4(9.0, 0.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0) | mat2x4(12.0, 0.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0) | mat2x4(10.0, 0.0, 0.0, 0.0, 0.0, 10.0, 0.0, 0.0) | mat2x4(45.0, 0.0, 0.0, 0.0, 0.0, 45.0, 0.0, 0.0) | mat2x4(193.0, 0.0, 0.0, 0.0, 0.0, 193.0, 0.0, 0.0) | mat2x4(255.0, 0.0, 0.0, 0.0, 0.0, 255.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_mat2x3
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output mat2x3 out0 = [ mat2x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) | mat2x3(2.0, 0.0, 0.0, 0.0, 2.0, 0.0) | mat2x3(3.0, 0.0, 0.0, 0.0, 3.0, 0.0) | mat2x3(8.0, 0.0, 0.0, 0.0, 8.0, 0.0) | mat2x3(9.0, 0.0, 0.0, 0.0, 9.0, 0.0) | mat2x3(12.0, 0.0, 0.0, 0.0, 12.0, 0.0) | mat2x3(10.0, 0.0, 0.0, 0.0, 10.0, 0.0) | mat2x3(45.0, 0.0, 0.0, 0.0, 45.0, 0.0) | mat2x3(193.0, 0.0, 0.0, 0.0, 193.0, 0.0) | mat2x3(255.0, 0.0, 0.0, 0.0, 255.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_mat2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output mat2 out0 = [ mat2(0.0, 0.0, 0.0, 0.0) | mat2(2.0, 0.0, 0.0, 2.0) | mat2(3.0, 0.0, 0.0, 3.0) | mat2(8.0, 0.0, 0.0, 8.0) | mat2(9.0, 0.0, 0.0, 9.0) | mat2(12.0, 0.0, 0.0, 12.0) | mat2(10.0, 0.0, 0.0, 10.0) | mat2(45.0, 0.0, 0.0, 45.0) | mat2(193.0, 0.0, 0.0, 193.0) | mat2(255.0, 0.0, 0.0, 255.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_mat4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output mat4 out0 = [ mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0) | mat4(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.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_mat4x3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output mat4x3 out0 = [ mat4x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) | mat4x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_mat4x2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output mat4x2 out0 = [ mat4x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) | mat4x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat4x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_mat3x4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output mat3x4 out0 = [ mat3x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat3x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_mat3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output mat3 out0 = [ mat3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0) | mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_mat3x2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output mat3x2 out0 = [ mat3x2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat3x2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat3x2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_mat2x4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output mat2x4 out0 = [ mat2x4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) | mat2x4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_mat2x3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output mat2x3 out0 = [ mat2x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0) | mat2x3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2x3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_mat2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output mat2 out0 = [ mat2(1.0, 0.0, 0.0, 1.0) | mat2(0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = mat2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # scalar_to_matrix
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_scalar_to_scalar.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_scalar_to_scalar.html
new file mode 100644
index 0000000000..bc29993f90
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_scalar_to_scalar.html
@@ -0,0 +1,31 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'conversions_scalar_to_scalar';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+modules.shared.glsShaderLibrary.run(testName);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_scalar_to_scalar.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_scalar_to_scalar.test
new file mode 100644
index 0000000000..07b4112d54
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_scalar_to_scalar.test
@@ -0,0 +1,392 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+group scalar_to_scalar "Scalar to Scalar Conversions"
+
+ case float_to_float
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output float out0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_int
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output int out0 = [ 0 | 1 | 2 | 3 | 0 | -8 | -20 | 36 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_bool
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output bool out0 = [ false | true | true | true | true | true | true | true ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_float
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output float out0 = [ 0.0 | 1.0 | 2.0 | 5.0 | 8.0 | 11.0 | -12.0 | -66.0 | -192.0 | 255.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_int
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output int out0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_bool
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output bool out0 = [ false | true | true | true | true | true | true | true | true | true ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_float
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output float out0 = [ 0.0 | 2.0 | 3.0 | 8.0 | 9.0 | 12.0 | 10.0 | 45.0 | 193.0 | 255.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_int
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output int out0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_bool
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output bool out0 = [ false | true | true | true | true | true | true | true | true | true ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_float
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output float out0 = [ 1.0 | 0.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_int
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output int out0 = [ 1 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_bool
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output bool out0 = [ true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_uint
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | 0.5 | 8.25 | 20.125 | 36.8125 ];
+ output uint out0 = [ 0 | 1 | 2 | 3 | 0 | 8 | 20 | 36 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_uint
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | 12 | 66 | 192 | 255 ];
+ output uint out0 = [ 0 | 1 | 2 | 5 | 8 | 11 | 12 | 66 | 192 | 255 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_uint
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output uint out0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_uint
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output uint out0 = [ 1 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # scalar_to_scalar
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_scalar_to_vector.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_scalar_to_vector.html
new file mode 100644
index 0000000000..cf3838f8aa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_scalar_to_vector.html
@@ -0,0 +1,31 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'conversions_scalar_to_vector';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+modules.shared.glsShaderLibrary.run(testName);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_scalar_to_vector.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_scalar_to_vector.test
new file mode 100644
index 0000000000..ae9e8b53d2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_scalar_to_vector.test
@@ -0,0 +1,1160 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+group scalar_to_vector "Scalar to Vector Conversions"
+
+ case float_to_vec2
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(2.0, 2.0) | vec2(3.5, 3.5) | vec2(-0.5, -0.5) | vec2(-8.25, -8.25) | vec2(-20.125, -20.125) | vec2(36.8125, 36.8125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_vec3
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(2.0, 2.0, 2.0) | vec3(3.5, 3.5, 3.5) | vec3(-0.5, -0.5, -0.5) | vec3(-8.25, -8.25, -8.25) | vec3(-20.125, -20.125, -20.125) | vec3(36.8125, 36.8125, 36.8125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_vec4
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(2.0, 2.0, 2.0, 2.0) | vec4(3.5, 3.5, 3.5, 3.5) | vec4(-0.5, -0.5, -0.5, -0.5) | vec4(-8.25, -8.25, -8.25, -8.25) | vec4(-20.125, -20.125, -20.125, -20.125) | vec4(36.8125, 36.8125, 36.8125, 36.8125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_ivec2
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(2, 2) | ivec2(3, 3) | ivec2(0, 0) | ivec2(-8, -8) | ivec2(-20, -20) | ivec2(36, 36) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_ivec3
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(2, 2, 2) | ivec3(3, 3, 3) | ivec3(0, 0, 0) | ivec3(-8, -8, -8) | ivec3(-20, -20, -20) | ivec3(36, 36, 36) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_ivec4
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(2, 2, 2, 2) | ivec4(3, 3, 3, 3) | ivec4(0, 0, 0, 0) | ivec4(-8, -8, -8, -8) | ivec4(-20, -20, -20, -20) | ivec4(36, 36, 36, 36) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_bvec2
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_bvec3
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_bvec4
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | -0.5 | -8.25 | -20.125 | 36.8125 ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_vec2
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(2.0, 2.0) | vec2(5.0, 5.0) | vec2(8.0, 8.0) | vec2(11.0, 11.0) | vec2(-12.0, -12.0) | vec2(-66.0, -66.0) | vec2(-192.0, -192.0) | vec2(255.0, 255.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_vec3
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(2.0, 2.0, 2.0) | vec3(5.0, 5.0, 5.0) | vec3(8.0, 8.0, 8.0) | vec3(11.0, 11.0, 11.0) | vec3(-12.0, -12.0, -12.0) | vec3(-66.0, -66.0, -66.0) | vec3(-192.0, -192.0, -192.0) | vec3(255.0, 255.0, 255.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_vec4
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(2.0, 2.0, 2.0, 2.0) | vec4(5.0, 5.0, 5.0, 5.0) | vec4(8.0, 8.0, 8.0, 8.0) | vec4(11.0, 11.0, 11.0, 11.0) | vec4(-12.0, -12.0, -12.0, -12.0) | vec4(-66.0, -66.0, -66.0, -66.0) | vec4(-192.0, -192.0, -192.0, -192.0) | vec4(255.0, 255.0, 255.0, 255.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_ivec2
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(2, 2) | ivec2(5, 5) | ivec2(8, 8) | ivec2(11, 11) | ivec2(-12, -12) | ivec2(-66, -66) | ivec2(-192, -192) | ivec2(255, 255) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_ivec3
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(2, 2, 2) | ivec3(5, 5, 5) | ivec3(8, 8, 8) | ivec3(11, 11, 11) | ivec3(-12, -12, -12) | ivec3(-66, -66, -66) | ivec3(-192, -192, -192) | ivec3(255, 255, 255) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_ivec4
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(2, 2, 2, 2) | ivec4(5, 5, 5, 5) | ivec4(8, 8, 8, 8) | ivec4(11, 11, 11, 11) | ivec4(-12, -12, -12, -12) | ivec4(-66, -66, -66, -66) | ivec4(-192, -192, -192, -192) | ivec4(255, 255, 255, 255) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_bvec2
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_bvec3
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_bvec4
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | -12 | -66 | -192 | 255 ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_vec2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(2.0, 2.0) | vec2(3.0, 3.0) | vec2(8.0, 8.0) | vec2(9.0, 9.0) | vec2(12.0, 12.0) | vec2(10.0, 10.0) | vec2(45.0, 45.0) | vec2(193.0, 193.0) | vec2(255.0, 255.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_vec3
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(2.0, 2.0, 2.0) | vec3(3.0, 3.0, 3.0) | vec3(8.0, 8.0, 8.0) | vec3(9.0, 9.0, 9.0) | vec3(12.0, 12.0, 12.0) | vec3(10.0, 10.0, 10.0) | vec3(45.0, 45.0, 45.0) | vec3(193.0, 193.0, 193.0) | vec3(255.0, 255.0, 255.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_vec4
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(2.0, 2.0, 2.0, 2.0) | vec4(3.0, 3.0, 3.0, 3.0) | vec4(8.0, 8.0, 8.0, 8.0) | vec4(9.0, 9.0, 9.0, 9.0) | vec4(12.0, 12.0, 12.0, 12.0) | vec4(10.0, 10.0, 10.0, 10.0) | vec4(45.0, 45.0, 45.0, 45.0) | vec4(193.0, 193.0, 193.0, 193.0) | vec4(255.0, 255.0, 255.0, 255.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_ivec2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(2, 2) | ivec2(3, 3) | ivec2(8, 8) | ivec2(9, 9) | ivec2(12, 12) | ivec2(10, 10) | ivec2(45, 45) | ivec2(193, 193) | ivec2(255, 255) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_ivec3
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(2, 2, 2) | ivec3(3, 3, 3) | ivec3(8, 8, 8) | ivec3(9, 9, 9) | ivec3(12, 12, 12) | ivec3(10, 10, 10) | ivec3(45, 45, 45) | ivec3(193, 193, 193) | ivec3(255, 255, 255) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_ivec4
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(2, 2, 2, 2) | ivec4(3, 3, 3, 3) | ivec4(8, 8, 8, 8) | ivec4(9, 9, 9, 9) | ivec4(12, 12, 12, 12) | ivec4(10, 10, 10, 10) | ivec4(45, 45, 45, 45) | ivec4(193, 193, 193, 193) | ivec4(255, 255, 255, 255) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_bvec2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_bvec3
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_bvec4
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_vec2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output vec2 out0 = [ vec2(1.0, 1.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_vec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output vec3 out0 = [ vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_vec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output vec4 out0 = [ vec4(1.0, 1.0, 1.0, 1.0) | vec4(0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_ivec2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output ivec2 out0 = [ ivec2(1, 1) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_ivec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output ivec3 out0 = [ ivec3(1, 1, 1) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_ivec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output ivec4 out0 = [ ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_bvec2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_bvec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_bvec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_uvec2
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | 0.5 | 8.25 | 20.125 | 36.8125 ];
+ output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(2, 2) | uvec2(3, 3) | uvec2(0, 0) | uvec2(8, 8) | uvec2(20, 20) | uvec2(36, 36) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_uvec3
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | 0.5 | 8.25 | 20.125 | 36.8125 ];
+ output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(2, 2, 2) | uvec3(3, 3, 3) | uvec3(0, 0, 0) | uvec3(8, 8, 8) | uvec3(20, 20, 20) | uvec3(36, 36, 36) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_to_uvec4
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | 2.0 | 3.5 | 0.5 | 8.25 | 20.125 | 36.8125 ];
+ output uvec4 out0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(2, 2, 2, 2) | uvec4(3, 3, 3, 3) | uvec4(0, 0, 0, 0) | uvec4(8, 8, 8, 8) | uvec4(20, 20, 20, 20) | uvec4(36, 36, 36, 36) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_uvec2
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | 12 | 66 | 192 | 255 ];
+ output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(2, 2) | uvec2(5, 5) | uvec2(8, 8) | uvec2(11, 11) | uvec2(12, 12) | uvec2(66, 66) | uvec2(192, 192) | uvec2(255, 255) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_uvec3
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | 12 | 66 | 192 | 255 ];
+ output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(2, 2, 2) | uvec3(5, 5, 5) | uvec3(8, 8, 8) | uvec3(11, 11, 11) | uvec3(12, 12, 12) | uvec3(66, 66, 66) | uvec3(192, 192, 192) | uvec3(255, 255, 255) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_to_uvec4
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 2 | 5 | 8 | 11 | 12 | 66 | 192 | 255 ];
+ output uvec4 out0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(2, 2, 2, 2) | uvec4(5, 5, 5, 5) | uvec4(8, 8, 8, 8) | uvec4(11, 11, 11, 11) | uvec4(12, 12, 12, 12) | uvec4(66, 66, 66, 66) | uvec4(192, 192, 192, 192) | uvec4(255, 255, 255, 255) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_uvec2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output uvec2 out0 = [ uvec2(0, 0) | uvec2(2, 2) | uvec2(3, 3) | uvec2(8, 8) | uvec2(9, 9) | uvec2(12, 12) | uvec2(10, 10) | uvec2(45, 45) | uvec2(193, 193) | uvec2(255, 255) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_uvec3
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(2, 2, 2) | uvec3(3, 3, 3) | uvec3(8, 8, 8) | uvec3(9, 9, 9) | uvec3(12, 12, 12) | uvec3(10, 10, 10) | uvec3(45, 45, 45) | uvec3(193, 193, 193) | uvec3(255, 255, 255) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_to_uvec4
+ version 300 es
+ values
+ {
+ input uint in0 = [ 0 | 2 | 3 | 8 | 9 | 12 | 10 | 45 | 193 | 255 ];
+ output uvec4 out0 = [ uvec4(0, 0, 0, 0) | uvec4(2, 2, 2, 2) | uvec4(3, 3, 3, 3) | uvec4(8, 8, 8, 8) | uvec4(9, 9, 9, 9) | uvec4(12, 12, 12, 12) | uvec4(10, 10, 10, 10) | uvec4(45, 45, 45, 45) | uvec4(193, 193, 193, 193) | uvec4(255, 255, 255, 255) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_uvec2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output uvec2 out0 = [ uvec2(1, 1) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_uvec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output uvec3 out0 = [ uvec3(1, 1, 1) | uvec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_to_uvec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output uvec4 out0 = [ uvec4(1, 1, 1, 1) | uvec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # scalar_to_vector
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_combine.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_combine.html
new file mode 100644
index 0000000000..d53c1ae55c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_combine.html
@@ -0,0 +1,31 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'conversions_vector_combine';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+modules.shared.glsShaderLibrary.run(testName);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_combine.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_combine.test
new file mode 100644
index 0000000000..900b5b70d2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_combine.test
@@ -0,0 +1,3480 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+group vector_combine "Vector Combine Constructors"
+
+ case vec2_vec2_to_vec4
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) ];
+ input vec2 in1 = [ vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) ];
+ output vec4 out0 = [ vec4(-0.5, -2.25, -32.0, 64.0) | vec4(-32.0, 64.0, 1.0, 1.25) | vec4(1.0, 1.25, 0.0, 0.5) | vec4(0.0, 0.5, -0.5, -2.25) | vec4(-0.75, -0.0322580645161, -0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_vec2_to_ivec4
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) ];
+ input vec2 in1 = [ vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) ];
+ output ivec4 out0 = [ ivec4(0, -2, -32, 64) | ivec4(-32, 64, 1, 1) | ivec4(1, 1, 0, 0) | ivec4(0, 0, 0, -2) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_vec2_to_bvec4
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) ];
+ input vec2 in1 = [ vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) | vec2(-0.75, -0.0322580645161) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, false, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_bvec2_to_vec4
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ];
+ input bvec2 in1 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 1.0, 0.0) | vec4(1.0, 0.0, 0.0, 0.0) | vec4(0.0, 1.0, 0.0, 1.0) | vec4(0.0, 0.0, 1.0, 1.0) | vec4(1.0, 1.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_bvec2_to_ivec4
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ];
+ input bvec2 in1 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output ivec4 out0 = [ ivec4(0, 0, 1, 0) | ivec4(1, 0, 0, 0) | ivec4(0, 1, 0, 1) | ivec4(0, 0, 1, 1) | ivec4(1, 1, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_bvec2_to_bvec4
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ];
+ input bvec2 in1 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(true, false, false, false) | bvec4(false, true, false, true) | bvec4(false, false, true, true) | bvec4(true, true, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_float_to_vec4
+ version 300 es
+ values
+ {
+ input float in0 = [ 1.0 | 0.0 | -0.5 | -8.25 | 3.5 | -20.125 | 36.8125 | 2.0 ];
+ input float in1 = [ 0.0 | 36.8125 | -8.25 | 2.0 | 3.5 | 1.0 | -20.125 | -0.5 ];
+ input float in2 = [ 3.5 | 36.8125 | -8.25 | 1.0 | 2.0 | 0.0 | -20.125 | -0.5 ];
+ input float in3 = [ 3.5 | 36.8125 | 1.0 | -8.25 | 2.0 | 0.0 | -0.5 | -20.125 ];
+ output vec4 out0 = [ vec4(1.0, 0.0, 3.5, 3.5) | vec4(0.0, 36.8125, 36.8125, 36.8125) | vec4(-0.5, -8.25, -8.25, 1.0) | vec4(-8.25, 2.0, 1.0, -8.25) | vec4(3.5, 3.5, 2.0, 2.0) | vec4(-20.125, 1.0, 0.0, 0.0) | vec4(36.8125, -20.125, -20.125, -0.5) | vec4(2.0, -0.5, -0.5, -20.125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_float_to_ivec4
+ version 300 es
+ values
+ {
+ input float in0 = [ 1.0 | 0.0 | -0.5 | -8.25 | 3.5 | -20.125 | 36.8125 | 2.0 ];
+ input float in1 = [ 0.0 | 36.8125 | -8.25 | 2.0 | 3.5 | 1.0 | -20.125 | -0.5 ];
+ input float in2 = [ 3.5 | 36.8125 | -8.25 | 1.0 | 2.0 | 0.0 | -20.125 | -0.5 ];
+ input float in3 = [ 3.5 | 36.8125 | 1.0 | -8.25 | 2.0 | 0.0 | -0.5 | -20.125 ];
+ output ivec4 out0 = [ ivec4(1, 0, 3, 3) | ivec4(0, 36, 36, 36) | ivec4(0, -8, -8, 1) | ivec4(-8, 2, 1, -8) | ivec4(3, 3, 2, 2) | ivec4(-20, 1, 0, 0) | ivec4(36, -20, -20, 0) | ivec4(2, 0, 0, -20) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_float_to_bvec4
+ version 300 es
+ values
+ {
+ input float in0 = [ 1.0 | 0.0 | -0.5 | -8.25 | 3.5 | -20.125 | 36.8125 | 2.0 ];
+ input float in1 = [ 0.0 | 36.8125 | -8.25 | 2.0 | 3.5 | 1.0 | -20.125 | -0.5 ];
+ input float in2 = [ 3.5 | 36.8125 | -8.25 | 1.0 | 2.0 | 0.0 | -20.125 | -0.5 ];
+ input float in3 = [ 3.5 | 36.8125 | 1.0 | -8.25 | 2.0 | 0.0 | -0.5 | -20.125 ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_int_to_vec4
+ version 300 es
+ values
+ {
+ input int in0 = [ -12 | -66 | 2 | 5 | 8 | -192 | 255 | 1 | 0 | 11 ];
+ input int in1 = [ 2 | 5 | -66 | 11 | -192 | 8 | -12 | 1 | 255 | 0 ];
+ input int in2 = [ 11 | 255 | 5 | 8 | 2 | -192 | -12 | -66 | 1 | 0 ];
+ input int in3 = [ -192 | -66 | 8 | -12 | 1 | 2 | 0 | 255 | 5 | 11 ];
+ output vec4 out0 = [ vec4(-12.0, 2.0, 11.0, -192.0) | vec4(-66.0, 5.0, 255.0, -66.0) | vec4(2.0, -66.0, 5.0, 8.0) | vec4(5.0, 11.0, 8.0, -12.0) | vec4(8.0, -192.0, 2.0, 1.0) | vec4(-192.0, 8.0, -192.0, 2.0) | vec4(255.0, -12.0, -12.0, 0.0) | vec4(1.0, 1.0, -66.0, 255.0) | vec4(0.0, 255.0, 1.0, 5.0) | vec4(11.0, 0.0, 0.0, 11.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_int_to_ivec4
+ version 300 es
+ values
+ {
+ input int in0 = [ -12 | -66 | 2 | 5 | 8 | -192 | 255 | 1 | 0 | 11 ];
+ input int in1 = [ 2 | 5 | -66 | 11 | -192 | 8 | -12 | 1 | 255 | 0 ];
+ input int in2 = [ 11 | 255 | 5 | 8 | 2 | -192 | -12 | -66 | 1 | 0 ];
+ input int in3 = [ -192 | -66 | 8 | -12 | 1 | 2 | 0 | 255 | 5 | 11 ];
+ output ivec4 out0 = [ ivec4(-12, 2, 11, -192) | ivec4(-66, 5, 255, -66) | ivec4(2, -66, 5, 8) | ivec4(5, 11, 8, -12) | ivec4(8, -192, 2, 1) | ivec4(-192, 8, -192, 2) | ivec4(255, -12, -12, 0) | ivec4(1, 1, -66, 255) | ivec4(0, 255, 1, 5) | ivec4(11, 0, 0, 11) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_int_to_bvec4
+ version 300 es
+ values
+ {
+ input int in0 = [ -12 | -66 | 2 | 5 | 8 | -192 | 255 | 1 | 0 | 11 ];
+ input int in1 = [ 2 | 5 | -66 | 11 | -192 | 8 | -12 | 1 | 255 | 0 ];
+ input int in2 = [ 11 | 255 | 5 | 8 | 2 | -192 | -12 | -66 | 1 | 0 ];
+ input int in3 = [ -192 | -66 | 8 | -12 | 1 | 2 | 0 | 255 | 5 | 11 ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, false) | bvec4(true, true, true, true) | bvec4(false, true, true, true) | bvec4(true, false, false, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uint_uint_uint_to_vec4
+ version 300 es
+ values
+ {
+ input uint in0 = [ 193 | 3 | 255 | 8 | 10 | 9 | 2 | 12 | 0 | 45 ];
+ input uint in1 = [ 12 | 45 | 193 | 2 | 8 | 255 | 0 | 3 | 9 | 10 ];
+ input uint in2 = [ 9 | 8 | 12 | 2 | 255 | 45 | 3 | 0 | 193 | 10 ];
+ input uint in3 = [ 3 | 9 | 12 | 2 | 255 | 193 | 0 | 10 | 45 | 8 ];
+ output vec4 out0 = [ vec4(193.0, 12.0, 9.0, 3.0) | vec4(3.0, 45.0, 8.0, 9.0) | vec4(255.0, 193.0, 12.0, 12.0) | vec4(8.0, 2.0, 2.0, 2.0) | vec4(10.0, 8.0, 255.0, 255.0) | vec4(9.0, 255.0, 45.0, 193.0) | vec4(2.0, 0.0, 3.0, 0.0) | vec4(12.0, 3.0, 0.0, 10.0) | vec4(0.0, 9.0, 193.0, 45.0) | vec4(45.0, 10.0, 10.0, 8.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uint_uint_uint_to_ivec4
+ version 300 es
+ values
+ {
+ input uint in0 = [ 193 | 3 | 255 | 8 | 10 | 9 | 2 | 12 | 0 | 45 ];
+ input uint in1 = [ 12 | 45 | 193 | 2 | 8 | 255 | 0 | 3 | 9 | 10 ];
+ input uint in2 = [ 9 | 8 | 12 | 2 | 255 | 45 | 3 | 0 | 193 | 10 ];
+ input uint in3 = [ 3 | 9 | 12 | 2 | 255 | 193 | 0 | 10 | 45 | 8 ];
+ output ivec4 out0 = [ ivec4(193, 12, 9, 3) | ivec4(3, 45, 8, 9) | ivec4(255, 193, 12, 12) | ivec4(8, 2, 2, 2) | ivec4(10, 8, 255, 255) | ivec4(9, 255, 45, 193) | ivec4(2, 0, 3, 0) | ivec4(12, 3, 0, 10) | ivec4(0, 9, 193, 45) | ivec4(45, 10, 10, 8) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uint_uint_uint_to_bvec4
+ version 300 es
+ values
+ {
+ input uint in0 = [ 193 | 3 | 255 | 8 | 10 | 9 | 2 | 12 | 0 | 45 ];
+ input uint in1 = [ 12 | 45 | 193 | 2 | 8 | 255 | 0 | 3 | 9 | 10 ];
+ input uint in2 = [ 9 | 8 | 12 | 2 | 255 | 45 | 3 | 0 | 193 | 10 ];
+ input uint in3 = [ 3 | 9 | 12 | 2 | 255 | 193 | 0 | 10 | 45 | 8 ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, false, true, false) | bvec4(true, true, false, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_bool_to_vec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ true | false ];
+ input bool in2 = [ false | true ];
+ input bool in3 = [ false | true ];
+ output vec4 out0 = [ vec4(1.0, 1.0, 0.0, 0.0) | vec4(0.0, 0.0, 1.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_bool_to_ivec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ true | false ];
+ input bool in2 = [ false | true ];
+ input bool in3 = [ false | true ];
+ output ivec4 out0 = [ ivec4(1, 1, 0, 0) | ivec4(0, 0, 1, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_bool_to_bvec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ true | false ];
+ input bool in2 = [ false | true ];
+ input bool in3 = [ false | true ];
+ output bvec4 out0 = [ bvec4(true, true, false, false) | bvec4(false, false, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_bool_to_vec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | true | false | false | false | true | false | false | true | true ];
+ input float in1 = [ 36.8125 | 0.0 | -8.25 | 1.0 | -0.5 | 0.0 | 2.0 | -20.125 | 3.5 | 1.0 ];
+ input int in2 = [ -66 | 2 | 255 | 11 | 1 | 8 | -192 | -12 | 0 | 5 ];
+ input bool in3 = [ true | true | false | false | true | true | false | true | false | false ];
+ output vec4 out0 = [ vec4(1.0, 36.8125, -66.0, 1.0) | vec4(1.0, 0.0, 2.0, 1.0) | vec4(0.0, -8.25, 255.0, 0.0) | vec4(0.0, 1.0, 11.0, 0.0) | vec4(0.0, -0.5, 1.0, 1.0) | vec4(1.0, 0.0, 8.0, 1.0) | vec4(0.0, 2.0, -192.0, 0.0) | vec4(0.0, -20.125, -12.0, 1.0) | vec4(1.0, 3.5, 0.0, 0.0) | vec4(1.0, 1.0, 5.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_bool_to_ivec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | true | false | false | false | true | false | false | true | true ];
+ input float in1 = [ 36.8125 | 0.0 | -8.25 | 1.0 | -0.5 | 0.0 | 2.0 | -20.125 | 3.5 | 1.0 ];
+ input int in2 = [ -66 | 2 | 255 | 11 | 1 | 8 | -192 | -12 | 0 | 5 ];
+ input bool in3 = [ true | true | false | false | true | true | false | true | false | false ];
+ output ivec4 out0 = [ ivec4(1, 36, -66, 1) | ivec4(1, 0, 2, 1) | ivec4(0, -8, 255, 0) | ivec4(0, 1, 11, 0) | ivec4(0, 0, 1, 1) | ivec4(1, 0, 8, 1) | ivec4(0, 2, -192, 0) | ivec4(0, -20, -12, 1) | ivec4(1, 3, 0, 0) | ivec4(1, 1, 5, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_bool_to_bvec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | true | false | false | false | true | false | false | true | true ];
+ input float in1 = [ 36.8125 | 0.0 | -8.25 | 1.0 | -0.5 | 0.0 | 2.0 | -20.125 | 3.5 | 1.0 ];
+ input int in2 = [ -66 | 2 | 255 | 11 | 1 | 8 | -192 | -12 | 0 | 5 ];
+ input bool in3 = [ true | true | false | false | true | true | false | true | false | false ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, false, true, true) | bvec4(false, true, true, false) | bvec4(false, true, true, false) | bvec4(false, true, true, true) | bvec4(true, false, true, true) | bvec4(false, true, true, false) | bvec4(false, true, true, true) | bvec4(true, true, false, false) | bvec4(true, true, true, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_to_vec4
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(-0.75, -0.0322580645161, 0.0, -2.0) | vec4(-0.5, -2.25, 0.0, 0.0) | vec4(-32.0, 64.0, -32.0, 64.0) | vec4(1.0, 1.25, 1.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_to_ivec4
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(0, 0, 0, -2) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, 64) | ivec4(1, 1, 1, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_to_bvec4
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(-0.75, -0.0322580645161) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, -2) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) ];
+ output bvec4 out0 = [ bvec4(false, true, false, false) | bvec4(true, true, false, true) | bvec4(true, true, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bvec2_to_vec4
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) ];
+ input bvec2 in1 = [ bvec2(false, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) ];
+ output vec4 out0 = [ vec4(-0.75, -0.0322580645161, 0.0, 1.0) | vec4(-32.0, 64.0, 0.0, 0.0) | vec4(1.0, 1.25, 0.0, 0.0) | vec4(0.0, 0.5, 1.0, 1.0) | vec4(-0.5, -2.25, 1.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bvec2_to_ivec4
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) ];
+ input bvec2 in1 = [ bvec2(false, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 1) | ivec4(-32, 64, 0, 0) | ivec4(1, 1, 0, 0) | ivec4(0, 0, 1, 1) | ivec4(0, -2, 1, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bvec2_to_bvec4
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(1.0, 1.25) | vec2(0.0, 0.5) | vec2(-0.5, -2.25) ];
+ input bvec2 in1 = [ bvec2(false, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(true, false) ];
+ output bvec4 out0 = [ bvec4(true, true, false, true) | bvec4(true, true, false, false) | bvec4(true, true, false, false) | bvec4(false, true, true, true) | bvec4(true, true, true, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_float_to_vec4
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, true, false) ];
+ input float in1 = [ -0.5 | 3.5 | 2.0 | 0.0 | -8.25 | 1.0 | 36.8125 | -20.125 ];
+ output vec4 out0 = [ vec4(1.0, 0.0, 0.0, -0.5) | vec4(0.0, 0.0, 0.0, 3.5) | vec4(0.0, 1.0, 0.0, 2.0) | vec4(1.0, 1.0, 1.0, 0.0) | vec4(0.0, 0.0, 0.0, -8.25) | vec4(0.0, 0.0, 0.0, 1.0) | vec4(1.0, 0.0, 0.0, 36.8125) | vec4(0.0, 1.0, 0.0, -20.125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_float_to_ivec4
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, true, false) ];
+ input float in1 = [ -0.5 | 3.5 | 2.0 | 0.0 | -8.25 | 1.0 | 36.8125 | -20.125 ];
+ output ivec4 out0 = [ ivec4(1, 0, 0, 0) | ivec4(0, 0, 0, 3) | ivec4(0, 1, 0, 2) | ivec4(1, 1, 1, 0) | ivec4(0, 0, 0, -8) | ivec4(0, 0, 0, 1) | ivec4(1, 0, 0, 36) | ivec4(0, 1, 0, -20) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_float_to_bvec4
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, false, false) | bvec3(false, true, false) ];
+ input float in1 = [ -0.5 | 3.5 | 2.0 | 0.0 | -8.25 | 1.0 | 36.8125 | -20.125 ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, true) | bvec4(true, true, true, false) | bvec4(false, false, false, true) | bvec4(false, false, false, true) | bvec4(true, false, false, true) | bvec4(false, true, false, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_float_to_vec4
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) ];
+ input float in1 = [ -0.5 | 0.0 | 3.5 | -20.125 | 2.0 | -8.25 | 1.0 | 36.8125 ];
+ output vec4 out0 = [ vec4(-32.0, 64.0, -51.0, -0.5) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.0) | vec4(1.0, 1.25, 1.125, 3.5) | vec4(-0.5, -2.25, -4.875, -20.125) | vec4(0.0, 0.5, 0.75, 2.0) | vec4(-0.5, -2.25, -4.875, -8.25) | vec4(0.0, 0.5, 0.75, 1.0) | vec4(1.0, 1.25, 1.125, 36.8125) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_float_to_ivec4
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) ];
+ input float in1 = [ -0.5 | 0.0 | 3.5 | -20.125 | 2.0 | -8.25 | 1.0 | 36.8125 ];
+ output ivec4 out0 = [ ivec4(-32, 64, -51, 0) | ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 3) | ivec4(0, -2, -4, -20) | ivec4(0, 0, 0, 2) | ivec4(0, -2, -4, -8) | ivec4(0, 0, 0, 1) | ivec4(1, 1, 1, 36) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_float_to_bvec4
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(-0.5, -2.25, -4.875) | vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) ];
+ input float in1 = [ -0.5 | 0.0 | 3.5 | -20.125 | 2.0 | -8.25 | 1.0 | 36.8125 ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_ivec2_int_to_vec4
+ version 300 es
+ values
+ {
+ input int in0 = [ -12 | 11 | 8 | 255 | 0 | 1 | -66 | 2 | -192 | 5 ];
+ input ivec2 in1 = [ ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, 0) | ivec2(0, 0) ];
+ input int in2 = [ 1 | 11 | 2 | -66 | -192 | 0 | -12 | 255 | 5 | 8 ];
+ output vec4 out0 = [ vec4(-12.0, 0.0, -2.0, 1.0) | vec4(11.0, -32.0, 64.0, 11.0) | vec4(8.0, 0.0, 0.0, 2.0) | vec4(255.0, 0.0, -2.0, -66.0) | vec4(0.0, 1.0, 1.0, -192.0) | vec4(1.0, 0.0, 0.0, 0.0) | vec4(-66.0, -32.0, 64.0, -12.0) | vec4(2.0, 1.0, 1.0, 255.0) | vec4(-192.0, 0.0, 0.0, 5.0) | vec4(5.0, 0.0, 0.0, 8.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_ivec2_int_to_ivec4
+ version 300 es
+ values
+ {
+ input int in0 = [ -12 | 11 | 8 | 255 | 0 | 1 | -66 | 2 | -192 | 5 ];
+ input ivec2 in1 = [ ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, 0) | ivec2(0, 0) ];
+ input int in2 = [ 1 | 11 | 2 | -66 | -192 | 0 | -12 | 255 | 5 | 8 ];
+ output ivec4 out0 = [ ivec4(-12, 0, -2, 1) | ivec4(11, -32, 64, 11) | ivec4(8, 0, 0, 2) | ivec4(255, 0, -2, -66) | ivec4(0, 1, 1, -192) | ivec4(1, 0, 0, 0) | ivec4(-66, -32, 64, -12) | ivec4(2, 1, 1, 255) | ivec4(-192, 0, 0, 5) | ivec4(5, 0, 0, 8) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_ivec2_int_to_bvec4
+ version 300 es
+ values
+ {
+ input int in0 = [ -12 | 11 | 8 | 255 | 0 | 1 | -66 | 2 | -192 | 5 ];
+ input ivec2 in1 = [ ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, -2) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, 64) | ivec2(1, 1) | ivec2(0, 0) | ivec2(0, 0) ];
+ input int in2 = [ 1 | 11 | 2 | -66 | -192 | 0 | -12 | 255 | 5 | 8 ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(true, true, true, true) | bvec4(true, false, false, true) | bvec4(true, false, true, true) | bvec4(false, true, true, true) | bvec4(true, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, false, false, true) | bvec4(true, false, false, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_ivec2_to_vec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false | false | false | true | true | true | false ];
+ input float in1 = [ 1.0 | 0.0 | 2.0 | 3.5 | -20.125 | -0.5 | 36.8125 | -8.25 ];
+ input ivec2 in2 = [ ivec2(1, 1) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) ];
+ output vec4 out0 = [ vec4(1.0, 1.0, 1.0, 1.0) | vec4(0.0, 0.0, -32.0, 64.0) | vec4(0.0, 2.0, 0.0, 0.0) | vec4(0.0, 3.5, 0.0, 0.0) | vec4(1.0, -20.125, 0.0, -2.0) | vec4(1.0, -0.5, 0.0, -2.0) | vec4(1.0, 36.8125, 0.0, 0.0) | vec4(0.0, -8.25, 1.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_ivec2_to_ivec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false | false | false | true | true | true | false ];
+ input float in1 = [ 1.0 | 0.0 | 2.0 | 3.5 | -20.125 | -0.5 | 36.8125 | -8.25 ];
+ input ivec2 in2 = [ ivec2(1, 1) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) ];
+ output ivec4 out0 = [ ivec4(1, 1, 1, 1) | ivec4(0, 0, -32, 64) | ivec4(0, 2, 0, 0) | ivec4(0, 3, 0, 0) | ivec4(1, -20, 0, -2) | ivec4(1, 0, 0, -2) | ivec4(1, 36, 0, 0) | ivec4(0, -8, 1, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_ivec2_to_bvec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false | false | false | true | true | true | false ];
+ input float in1 = [ 1.0 | 0.0 | 2.0 | 3.5 | -20.125 | -0.5 | 36.8125 | -8.25 ];
+ input ivec2 in2 = [ ivec2(1, 1) | ivec2(-32, 64) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, -2) | ivec2(0, -2) | ivec2(0, 0) | ivec2(1, 1) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, true, true) | bvec4(false, true, false, false) | bvec4(false, true, false, false) | bvec4(true, true, false, true) | bvec4(true, true, false, true) | bvec4(true, true, false, false) | bvec4(false, true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_uvec3_to_vec4
+ version 300 es
+ values
+ {
+ input float in0 = [ 1.0 | -20.125 | -8.25 | -0.5 | 0.0 | 2.0 | 3.5 | 36.8125 ];
+ input uvec3 in1 = [ uvec3(0, 0, 0) | uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) ];
+ output vec4 out0 = [ vec4(1.0, 0.0, 0.0, 0.0) | vec4(-20.125, 0.0, 0.0, 0.0) | vec4(-8.25, 1.0, 1.0, 1.0) | vec4(-0.5, 0.0, 2.0, 4.0) | vec4(0.0, 0.0, 0.0, 0.0) | vec4(2.0, 1.0, 1.0, 1.0) | vec4(3.5, 0.0, 2.0, 4.0) | vec4(36.8125, 32.0, 64.0, 51.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_uvec3_to_ivec4
+ version 300 es
+ values
+ {
+ input float in0 = [ 1.0 | -20.125 | -8.25 | -0.5 | 0.0 | 2.0 | 3.5 | 36.8125 ];
+ input uvec3 in1 = [ uvec3(0, 0, 0) | uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) ];
+ output ivec4 out0 = [ ivec4(1, 0, 0, 0) | ivec4(-20, 0, 0, 0) | ivec4(-8, 1, 1, 1) | ivec4(0, 0, 2, 4) | ivec4(0, 0, 0, 0) | ivec4(2, 1, 1, 1) | ivec4(3, 0, 2, 4) | ivec4(36, 32, 64, 51) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_uvec3_to_bvec4
+ version 300 es
+ values
+ {
+ input float in0 = [ 1.0 | -20.125 | -8.25 | -0.5 | 0.0 | 2.0 | 3.5 | 36.8125 ];
+ input uvec3 in1 = [ uvec3(0, 0, 0) | uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) ];
+ output bvec4 out0 = [ bvec4(true, false, false, false) | bvec4(true, false, false, false) | bvec4(true, true, true, true) | bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, false, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_uvec2_bool_to_vec4
+ version 300 es
+ values
+ {
+ input int in0 = [ 1 | -192 | -66 | -12 | 0 | 2 | 11 | 8 | 255 | 5 ];
+ input uvec2 in1 = [ uvec2(0, 2) | uvec2(1, 1) | uvec2(0, 0) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) | uvec2(32, 64) | uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 0) ];
+ input bool in2 = [ false | false | true | true | true | true | true | false | false | false ];
+ output vec4 out0 = [ vec4(1.0, 0.0, 2.0, 0.0) | vec4(-192.0, 1.0, 1.0, 0.0) | vec4(-66.0, 0.0, 0.0, 1.0) | vec4(-12.0, 0.0, 2.0, 1.0) | vec4(0.0, 32.0, 64.0, 1.0) | vec4(2.0, 0.0, 0.0, 1.0) | vec4(11.0, 32.0, 64.0, 1.0) | vec4(8.0, 0.0, 0.0, 0.0) | vec4(255.0, 1.0, 1.0, 0.0) | vec4(5.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_uvec2_bool_to_ivec4
+ version 300 es
+ values
+ {
+ input int in0 = [ 1 | -192 | -66 | -12 | 0 | 2 | 11 | 8 | 255 | 5 ];
+ input uvec2 in1 = [ uvec2(0, 2) | uvec2(1, 1) | uvec2(0, 0) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) | uvec2(32, 64) | uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 0) ];
+ input bool in2 = [ false | false | true | true | true | true | true | false | false | false ];
+ output ivec4 out0 = [ ivec4(1, 0, 2, 0) | ivec4(-192, 1, 1, 0) | ivec4(-66, 0, 0, 1) | ivec4(-12, 0, 2, 1) | ivec4(0, 32, 64, 1) | ivec4(2, 0, 0, 1) | ivec4(11, 32, 64, 1) | ivec4(8, 0, 0, 0) | ivec4(255, 1, 1, 0) | ivec4(5, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_uvec2_bool_to_bvec4
+ version 300 es
+ values
+ {
+ input int in0 = [ 1 | -192 | -66 | -12 | 0 | 2 | 11 | 8 | 255 | 5 ];
+ input uvec2 in1 = [ uvec2(0, 2) | uvec2(1, 1) | uvec2(0, 0) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) | uvec2(32, 64) | uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 0) ];
+ input bool in2 = [ false | false | true | true | true | true | true | false | false | false ];
+ output bvec4 out0 = [ bvec4(true, false, true, false) | bvec4(true, true, true, false) | bvec4(true, false, false, true) | bvec4(true, false, true, true) | bvec4(false, true, true, true) | bvec4(true, false, false, true) | bvec4(true, true, true, true) | bvec4(true, false, false, false) | bvec4(true, true, true, false) | bvec4(true, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_vec2_to_uvec4
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(32.0, 64.0) | vec2(0.75, 0.0322580645161) | vec2(0.0, 0.5) | vec2(0.5, 2.25) | vec2(1.0, 1.25) ];
+ input vec2 in1 = [ vec2(0.5, 2.25) | vec2(1.0, 1.25) | vec2(32.0, 64.0) | vec2(0.0, 0.5) | vec2(0.75, 0.0322580645161) ];
+ output uvec4 out0 = [ uvec4(32, 64, 0, 2) | uvec4(0, 0, 1, 1) | uvec4(0, 0, 32, 64) | uvec4(0, 2, 0, 0) | uvec4(1, 1, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_bvec2_to_uvec4
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) | bvec2(false, false) ];
+ input bvec2 in1 = [ bvec2(true, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) ];
+ output uvec4 out0 = [ uvec4(1, 0, 1, 1) | uvec4(0, 1, 0, 0) | uvec4(1, 1, 1, 0) | uvec4(0, 0, 0, 1) | uvec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_float_to_uvec4
+ version 300 es
+ values
+ {
+ input float in0 = [ 2.0 | 36.8125 | 0.0 | 20.125 | 1.0 | 0.5 | 8.25 | 3.5 ];
+ input float in1 = [ 1.0 | 8.25 | 2.0 | 20.125 | 36.8125 | 0.0 | 0.5 | 3.5 ];
+ input float in2 = [ 0.0 | 8.25 | 2.0 | 1.0 | 36.8125 | 20.125 | 0.5 | 3.5 ];
+ input float in3 = [ 1.0 | 8.25 | 0.0 | 2.0 | 20.125 | 3.5 | 0.5 | 36.8125 ];
+ output uvec4 out0 = [ uvec4(2, 1, 0, 1) | uvec4(36, 8, 8, 8) | uvec4(0, 2, 2, 0) | uvec4(20, 20, 1, 2) | uvec4(1, 36, 36, 20) | uvec4(0, 0, 20, 3) | uvec4(8, 0, 0, 0) | uvec4(3, 3, 3, 36) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_int_to_uvec4
+ version 300 es
+ values
+ {
+ input int in0 = [ 192 | 2 | 12 | 11 | 0 | 8 | 5 | 66 | 1 | 255 ];
+ input int in1 = [ 66 | 12 | 5 | 1 | 0 | 192 | 8 | 255 | 11 | 2 ];
+ input int in2 = [ 192 | 5 | 1 | 66 | 255 | 11 | 8 | 12 | 2 | 0 ];
+ input int in3 = [ 255 | 5 | 11 | 12 | 2 | 1 | 66 | 0 | 8 | 192 ];
+ output uvec4 out0 = [ uvec4(192, 66, 192, 255) | uvec4(2, 12, 5, 5) | uvec4(12, 5, 1, 11) | uvec4(11, 1, 66, 12) | uvec4(0, 0, 255, 2) | uvec4(8, 192, 11, 1) | uvec4(5, 8, 8, 66) | uvec4(66, 255, 12, 0) | uvec4(1, 11, 2, 8) | uvec4(255, 2, 0, 192) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uint_uint_uint_to_uvec4
+ version 300 es
+ values
+ {
+ input uint in0 = [ 255 | 8 | 3 | 193 | 45 | 2 | 0 | 12 | 9 | 10 ];
+ input uint in1 = [ 255 | 45 | 0 | 12 | 2 | 10 | 8 | 9 | 193 | 3 ];
+ input uint in2 = [ 3 | 0 | 2 | 9 | 12 | 10 | 255 | 45 | 193 | 8 ];
+ input uint in3 = [ 2 | 255 | 10 | 193 | 8 | 12 | 3 | 9 | 0 | 45 ];
+ output uvec4 out0 = [ uvec4(255, 255, 3, 2) | uvec4(8, 45, 0, 255) | uvec4(3, 0, 2, 10) | uvec4(193, 12, 9, 193) | uvec4(45, 2, 12, 8) | uvec4(2, 10, 10, 12) | uvec4(0, 8, 255, 3) | uvec4(12, 9, 45, 9) | uvec4(9, 193, 193, 0) | uvec4(10, 3, 8, 45) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_bool_to_uvec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ false | true ];
+ input bool in1 = [ false | true ];
+ input bool in2 = [ true | false ];
+ input bool in3 = [ true | false ];
+ output uvec4 out0 = [ uvec4(0, 0, 1, 1) | uvec4(1, 1, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_bool_to_uvec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false | false | true | false | true | true | true | false | false ];
+ input float in1 = [ 20.125 | 0.0 | 1.0 | 3.5 | 1.0 | 0.0 | 0.5 | 8.25 | 2.0 | 36.8125 ];
+ input int in2 = [ 66 | 192 | 1 | 2 | 5 | 11 | 8 | 12 | 255 | 0 ];
+ input bool in3 = [ true | true | true | true | false | true | false | false | false | false ];
+ output uvec4 out0 = [ uvec4(1, 20, 66, 1) | uvec4(0, 0, 192, 1) | uvec4(0, 1, 1, 1) | uvec4(1, 3, 2, 1) | uvec4(0, 1, 5, 0) | uvec4(1, 0, 11, 1) | uvec4(1, 0, 8, 0) | uvec4(1, 8, 12, 0) | uvec4(0, 2, 255, 0) | uvec4(0, 36, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1, in2, in3);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_ivec2_to_uvec4
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.5, 2.25) | vec2(1.0, 1.25) | vec2(32.0, 64.0) | vec2(0.75, 0.0322580645161) | vec2(0.0, 0.5) ];
+ input ivec2 in1 = [ ivec2(1, 1) | ivec2(0, 2) | ivec2(32, 64) | ivec2(0, 0) | ivec2(0, 0) ];
+ output uvec4 out0 = [ uvec4(0, 2, 1, 1) | uvec4(1, 1, 0, 2) | uvec4(32, 64, 32, 64) | uvec4(0, 0, 0, 0) | uvec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bvec2_to_uvec4
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(32.0, 64.0) | vec2(0.75, 0.0322580645161) | vec2(0.5, 2.25) | vec2(0.0, 0.5) | vec2(1.0, 1.25) ];
+ input bvec2 in1 = [ bvec2(false, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(true, true) ];
+ output uvec4 out0 = [ uvec4(32, 64, 0, 0) | uvec4(0, 0, 0, 0) | uvec4(0, 2, 1, 0) | uvec4(0, 0, 0, 1) | uvec4(1, 1, 1, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_float_to_uvec4
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(true, true, true) | bvec3(false, true, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, false, false) | bvec3(false, false, false) ];
+ input float in1 = [ 2.0 | 0.0 | 36.8125 | 0.5 | 1.0 | 8.25 | 3.5 | 20.125 ];
+ output uvec4 out0 = [ uvec4(1, 0, 0, 2) | uvec4(1, 1, 1, 0) | uvec4(0, 1, 0, 36) | uvec4(0, 0, 0, 0) | uvec4(0, 0, 0, 1) | uvec4(0, 1, 0, 8) | uvec4(1, 0, 0, 3) | uvec4(0, 0, 0, 20) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_float_to_uvec4
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.5, 2.25, 4.875) | vec3(1.0, 1.25, 1.125) | vec3(0.0, 0.5, 0.75) | vec3(0.5, 2.25, 4.875) | vec3(32.0, 64.0, 51.0) | vec3(1.0, 1.25, 1.125) | vec3(0.75, 0.0322580645161, 0.0526315789474) | vec3(0.0, 0.5, 0.75) ];
+ input float in1 = [ 8.25 | 1.0 | 0.0 | 36.8125 | 2.0 | 0.5 | 20.125 | 3.5 ];
+ output uvec4 out0 = [ uvec4(0, 2, 4, 8) | uvec4(1, 1, 1, 1) | uvec4(0, 0, 0, 0) | uvec4(0, 2, 4, 36) | uvec4(32, 64, 51, 2) | uvec4(1, 1, 1, 0) | uvec4(0, 0, 0, 20) | uvec4(0, 0, 0, 3) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_ivec2_int_to_uvec4
+ version 300 es
+ values
+ {
+ input int in0 = [ 8 | 1 | 11 | 192 | 255 | 12 | 66 | 2 | 0 | 5 ];
+ input ivec2 in1 = [ ivec2(1, 1) | ivec2(0, 0) | ivec2(1, 1) | ivec2(32, 64) | ivec2(0, 2) | ivec2(0, 2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(32, 64) | ivec2(0, 0) ];
+ input int in2 = [ 2 | 192 | 12 | 0 | 8 | 1 | 66 | 255 | 11 | 5 ];
+ output uvec4 out0 = [ uvec4(8, 1, 1, 2) | uvec4(1, 0, 0, 192) | uvec4(11, 1, 1, 12) | uvec4(192, 32, 64, 0) | uvec4(255, 0, 2, 8) | uvec4(12, 0, 2, 1) | uvec4(66, 0, 0, 66) | uvec4(2, 0, 0, 255) | uvec4(0, 32, 64, 11) | uvec4(5, 0, 0, 5) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_ivec2_to_uvec4
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | true | false | false | true | false | false | true ];
+ input float in1 = [ 8.25 | 0.5 | 2.0 | 20.125 | 0.0 | 36.8125 | 3.5 | 1.0 ];
+ input ivec2 in2 = [ ivec2(32, 64) | ivec2(1, 1) | ivec2(0, 2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(0, 2) | ivec2(1, 1) | ivec2(0, 0) ];
+ output uvec4 out0 = [ uvec4(1, 8, 32, 64) | uvec4(1, 0, 1, 1) | uvec4(0, 2, 0, 2) | uvec4(0, 20, 0, 0) | uvec4(1, 0, 0, 0) | uvec4(0, 36, 0, 2) | uvec4(0, 3, 1, 1) | uvec4(1, 1, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_uvec3_to_uvec4
+ version 300 es
+ values
+ {
+ input float in0 = [ 8.25 | 20.125 | 1.0 | 0.5 | 3.5 | 2.0 | 36.8125 | 0.0 ];
+ input uvec3 in1 = [ uvec3(0, 0, 0) | uvec3(0, 0, 0) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 2, 4) | uvec3(1, 1, 1) | uvec3(1, 1, 1) | uvec3(0, 0, 0) ];
+ output uvec4 out0 = [ uvec4(8, 0, 0, 0) | uvec4(20, 0, 0, 0) | uvec4(1, 0, 2, 4) | uvec4(0, 32, 64, 51) | uvec4(3, 0, 2, 4) | uvec4(2, 1, 1, 1) | uvec4(36, 1, 1, 1) | uvec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_uvec2_bool_to_uvec4
+ version 300 es
+ values
+ {
+ input int in0 = [ 2 | 1 | 11 | 66 | 192 | 12 | 8 | 255 | 0 | 5 ];
+ input uvec2 in1 = [ uvec2(1, 1) | uvec2(0, 0) | uvec2(0, 0) | uvec2(0, 2) | uvec2(0, 0) | uvec2(0, 2) | uvec2(32, 64) | uvec2(1, 1) | uvec2(32, 64) | uvec2(0, 0) ];
+ input bool in2 = [ true | false | false | false | false | true | true | true | false | true ];
+ output uvec4 out0 = [ uvec4(2, 1, 1, 1) | uvec4(1, 0, 0, 0) | uvec4(11, 0, 0, 0) | uvec4(66, 0, 2, 0) | uvec4(192, 0, 0, 0) | uvec4(12, 0, 2, 1) | uvec4(8, 32, 64, 1) | uvec4(255, 1, 1, 1) | uvec4(0, 32, 64, 0) | uvec4(5, 0, 0, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_to_vec3
+ version 300 es
+ values
+ {
+ input float in0 = [ -0.5 | 1.0 | 3.5 | -8.25 | 36.8125 | 0.0 | 2.0 | -20.125 ];
+ input float in1 = [ 2.0 | -20.125 | 3.5 | 36.8125 | -8.25 | 1.0 | -0.5 | 0.0 ];
+ input float in2 = [ 1.0 | 3.5 | 2.0 | -8.25 | -20.125 | -0.5 | 36.8125 | 0.0 ];
+ output vec3 out0 = [ vec3(-0.5, 2.0, 1.0) | vec3(1.0, -20.125, 3.5) | vec3(3.5, 3.5, 2.0) | vec3(-8.25, 36.8125, -8.25) | vec3(36.8125, -8.25, -20.125) | vec3(0.0, 1.0, -0.5) | vec3(2.0, -0.5, 36.8125) | vec3(-20.125, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_to_ivec3
+ version 300 es
+ values
+ {
+ input float in0 = [ -0.5 | 1.0 | 3.5 | -8.25 | 36.8125 | 0.0 | 2.0 | -20.125 ];
+ input float in1 = [ 2.0 | -20.125 | 3.5 | 36.8125 | -8.25 | 1.0 | -0.5 | 0.0 ];
+ input float in2 = [ 1.0 | 3.5 | 2.0 | -8.25 | -20.125 | -0.5 | 36.8125 | 0.0 ];
+ output ivec3 out0 = [ ivec3(0, 2, 1) | ivec3(1, -20, 3) | ivec3(3, 3, 2) | ivec3(-8, 36, -8) | ivec3(36, -8, -20) | ivec3(0, 1, 0) | ivec3(2, 0, 36) | ivec3(-20, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_to_bvec3
+ version 300 es
+ values
+ {
+ input float in0 = [ -0.5 | 1.0 | 3.5 | -8.25 | 36.8125 | 0.0 | 2.0 | -20.125 ];
+ input float in1 = [ 2.0 | -20.125 | 3.5 | 36.8125 | -8.25 | 1.0 | -0.5 | 0.0 ];
+ input float in2 = [ 1.0 | 3.5 | 2.0 | -8.25 | -20.125 | -0.5 | 36.8125 | 0.0 ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(true, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_to_vec3
+ version 300 es
+ values
+ {
+ input int in0 = [ -192 | 5 | -12 | 0 | 11 | 8 | 1 | -66 | 255 | 2 ];
+ input int in1 = [ 5 | 1 | 8 | 0 | 2 | -192 | -12 | 255 | -66 | 11 ];
+ input int in2 = [ -192 | 1 | 2 | 5 | -12 | 8 | 11 | 0 | 255 | -66 ];
+ output vec3 out0 = [ vec3(-192.0, 5.0, -192.0) | vec3(5.0, 1.0, 1.0) | vec3(-12.0, 8.0, 2.0) | vec3(0.0, 0.0, 5.0) | vec3(11.0, 2.0, -12.0) | vec3(8.0, -192.0, 8.0) | vec3(1.0, -12.0, 11.0) | vec3(-66.0, 255.0, 0.0) | vec3(255.0, -66.0, 255.0) | vec3(2.0, 11.0, -66.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_to_ivec3
+ version 300 es
+ values
+ {
+ input int in0 = [ -192 | 5 | -12 | 0 | 11 | 8 | 1 | -66 | 255 | 2 ];
+ input int in1 = [ 5 | 1 | 8 | 0 | 2 | -192 | -12 | 255 | -66 | 11 ];
+ input int in2 = [ -192 | 1 | 2 | 5 | -12 | 8 | 11 | 0 | 255 | -66 ];
+ output ivec3 out0 = [ ivec3(-192, 5, -192) | ivec3(5, 1, 1) | ivec3(-12, 8, 2) | ivec3(0, 0, 5) | ivec3(11, 2, -12) | ivec3(8, -192, 8) | ivec3(1, -12, 11) | ivec3(-66, 255, 0) | ivec3(255, -66, 255) | ivec3(2, 11, -66) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_to_bvec3
+ version 300 es
+ values
+ {
+ input int in0 = [ -192 | 5 | -12 | 0 | 11 | 8 | 1 | -66 | 255 | 2 ];
+ input int in1 = [ 5 | 1 | 8 | 0 | 2 | -192 | -12 | 255 | -66 | 11 ];
+ input int in2 = [ -192 | 1 | 2 | 5 | -12 | 8 | 11 | 0 | 255 | -66 ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, false) | bvec3(true, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uint_uint_to_vec3
+ version 300 es
+ values
+ {
+ input uint in0 = [ 8 | 45 | 2 | 3 | 255 | 193 | 12 | 0 | 9 | 10 ];
+ input uint in1 = [ 193 | 2 | 9 | 8 | 0 | 255 | 45 | 3 | 10 | 12 ];
+ input uint in2 = [ 12 | 2 | 193 | 255 | 8 | 10 | 45 | 0 | 3 | 9 ];
+ output vec3 out0 = [ vec3(8.0, 193.0, 12.0) | vec3(45.0, 2.0, 2.0) | vec3(2.0, 9.0, 193.0) | vec3(3.0, 8.0, 255.0) | vec3(255.0, 0.0, 8.0) | vec3(193.0, 255.0, 10.0) | vec3(12.0, 45.0, 45.0) | vec3(0.0, 3.0, 0.0) | vec3(9.0, 10.0, 3.0) | vec3(10.0, 12.0, 9.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uint_uint_to_ivec3
+ version 300 es
+ values
+ {
+ input uint in0 = [ 8 | 45 | 2 | 3 | 255 | 193 | 12 | 0 | 9 | 10 ];
+ input uint in1 = [ 193 | 2 | 9 | 8 | 0 | 255 | 45 | 3 | 10 | 12 ];
+ input uint in2 = [ 12 | 2 | 193 | 255 | 8 | 10 | 45 | 0 | 3 | 9 ];
+ output ivec3 out0 = [ ivec3(8, 193, 12) | ivec3(45, 2, 2) | ivec3(2, 9, 193) | ivec3(3, 8, 255) | ivec3(255, 0, 8) | ivec3(193, 255, 10) | ivec3(12, 45, 45) | ivec3(0, 3, 0) | ivec3(9, 10, 3) | ivec3(10, 12, 9) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uint_uint_to_bvec3
+ version 300 es
+ values
+ {
+ input uint in0 = [ 8 | 45 | 2 | 3 | 255 | 193 | 12 | 0 | 9 | 10 ];
+ input uint in1 = [ 193 | 2 | 9 | 8 | 0 | 255 | 45 | 3 | 10 | 12 ];
+ input uint in2 = [ 12 | 2 | 193 | 255 | 8 | 10 | 45 | 0 | 3 | 9 ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_to_vec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ true | false ];
+ input bool in2 = [ true | false ];
+ output vec3 out0 = [ vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_to_ivec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ true | false ];
+ input bool in2 = [ true | false ];
+ output ivec3 out0 = [ ivec3(1, 1, 1) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_to_bvec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ true | false ];
+ input bool in2 = [ true | false ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_to_vec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | true | false | false | true | false | true | false | false | true ];
+ input float in1 = [ 0.0 | 36.8125 | 0.0 | -8.25 | 1.0 | 3.5 | 1.0 | -0.5 | -20.125 | 2.0 ];
+ input int in2 = [ 8 | -192 | -66 | 2 | 1 | -12 | 11 | 255 | 5 | 0 ];
+ output vec3 out0 = [ vec3(1.0, 0.0, 8.0) | vec3(1.0, 36.8125, -192.0) | vec3(0.0, 0.0, -66.0) | vec3(0.0, -8.25, 2.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, 3.5, -12.0) | vec3(1.0, 1.0, 11.0) | vec3(0.0, -0.5, 255.0) | vec3(0.0, -20.125, 5.0) | vec3(1.0, 2.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_to_ivec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | true | false | false | true | false | true | false | false | true ];
+ input float in1 = [ 0.0 | 36.8125 | 0.0 | -8.25 | 1.0 | 3.5 | 1.0 | -0.5 | -20.125 | 2.0 ];
+ input int in2 = [ 8 | -192 | -66 | 2 | 1 | -12 | 11 | 255 | 5 | 0 ];
+ output ivec3 out0 = [ ivec3(1, 0, 8) | ivec3(1, 36, -192) | ivec3(0, 0, -66) | ivec3(0, -8, 2) | ivec3(1, 1, 1) | ivec3(0, 3, -12) | ivec3(1, 1, 11) | ivec3(0, 0, 255) | ivec3(0, -20, 5) | ivec3(1, 2, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_to_bvec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | true | false | false | true | false | true | false | false | true ];
+ input float in1 = [ 0.0 | 36.8125 | 0.0 | -8.25 | 1.0 | 3.5 | 1.0 | -0.5 | -20.125 | 2.0 ];
+ input int in2 = [ 8 | -192 | -66 | 2 | 1 | -12 | 11 | 255 | 5 | 0 ];
+ output bvec3 out0 = [ bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(false, true, true) | bvec3(true, true, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bool_to_vec3
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) ];
+ input bool in1 = [ false | true | true | true | false ];
+ output vec3 out0 = [ vec3(1.0, 1.25, 0.0) | vec3(-0.75, -0.0322580645161, 1.0) | vec3(-32.0, 64.0, 1.0) | vec3(-0.5, -2.25, 1.0) | vec3(0.0, 0.5, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bool_to_ivec3
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) ];
+ input bool in1 = [ false | true | true | true | false ];
+ output ivec3 out0 = [ ivec3(1, 1, 0) | ivec3(0, 0, 1) | ivec3(-32, 64, 1) | ivec3(0, -2, 1) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bool_to_bvec3
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(1.0, 1.25) | vec2(-0.75, -0.0322580645161) | vec2(-32.0, 64.0) | vec2(-0.5, -2.25) | vec2(0.0, 0.5) ];
+ input bool in1 = [ false | true | true | true | false ];
+ output bvec3 out0 = [ bvec3(true, true, false) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, true, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_float_to_vec3
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, true) | bvec2(false, true) | bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ input float in1 = [ -20.125 | 2.0 | 36.8125 | 1.0 | 3.5 | 0.0 | -8.25 | -0.5 ];
+ output vec3 out0 = [ vec3(1.0, 0.0, -20.125) | vec3(0.0, 1.0, 2.0) | vec3(0.0, 1.0, 36.8125) | vec3(1.0, 0.0, 1.0) | vec3(0.0, 0.0, 3.5) | vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, -8.25) | vec3(0.0, 0.0, -0.5) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_float_to_ivec3
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, true) | bvec2(false, true) | bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ input float in1 = [ -20.125 | 2.0 | 36.8125 | 1.0 | 3.5 | 0.0 | -8.25 | -0.5 ];
+ output ivec3 out0 = [ ivec3(1, 0, -20) | ivec3(0, 1, 2) | ivec3(0, 1, 36) | ivec3(1, 0, 1) | ivec3(0, 0, 3) | ivec3(0, 0, 0) | ivec3(1, 1, -8) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_float_to_bvec3
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, true) | bvec2(false, true) | bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ input float in1 = [ -20.125 | 2.0 | 36.8125 | 1.0 | 3.5 | 0.0 | -8.25 | -0.5 ];
+ output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, true, true) | bvec3(false, true, true) | bvec3(true, false, true) | bvec3(false, false, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_int_to_vec3
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ];
+ input int in1 = [ 1 | -66 | 255 | 8 | -192 | 2 | 5 | 11 | -12 | 0 ];
+ output vec3 out0 = [ vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, -66.0) | vec3(0.0, 0.0, 255.0) | vec3(1.0, 0.0, 8.0) | vec3(0.0, 0.0, -192.0) | vec3(0.0, 1.0, 2.0) | vec3(1.0, 0.0, 5.0) | vec3(0.0, 1.0, 11.0) | vec3(0.0, 0.0, -12.0) | vec3(1.0, 1.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_int_to_ivec3
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ];
+ input int in1 = [ 1 | -66 | 255 | 8 | -192 | 2 | 5 | 11 | -12 | 0 ];
+ output ivec3 out0 = [ ivec3(1, 1, 1) | ivec3(0, 0, -66) | ivec3(0, 0, 255) | ivec3(1, 0, 8) | ivec3(0, 0, -192) | ivec3(0, 1, 2) | ivec3(1, 0, 5) | ivec3(0, 1, 11) | ivec3(0, 0, -12) | ivec3(1, 1, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_int_to_bvec3
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) ];
+ input int in1 = [ 1 | -66 | 255 | 8 | -192 | 2 | 5 | 11 | -12 | 0 ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, true) | bvec3(false, false, true) | bvec3(true, false, true) | bvec3(false, false, true) | bvec3(false, true, true) | bvec3(true, false, true) | bvec3(false, true, true) | bvec3(false, false, true) | bvec3(true, true, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_ivec2_to_vec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | true | false | false | true ];
+ input ivec2 in1 = [ ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) | ivec2(-32, 64) ];
+ output vec3 out0 = [ vec3(1.0, 0.0, -2.0) | vec3(1.0, 0.0, 0.0) | vec3(0.0, 0.0, 0.0) | vec3(0.0, 1.0, 1.0) | vec3(1.0, -32.0, 64.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_ivec2_to_ivec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | true | false | false | true ];
+ input ivec2 in1 = [ ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) | ivec2(-32, 64) ];
+ output ivec3 out0 = [ ivec3(1, 0, -2) | ivec3(1, 0, 0) | ivec3(0, 0, 0) | ivec3(0, 1, 1) | ivec3(1, -32, 64) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_ivec2_to_bvec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | true | false | false | true ];
+ input ivec2 in1 = [ ivec2(0, -2) | ivec2(0, 0) | ivec2(0, 0) | ivec2(1, 1) | ivec2(-32, 64) ];
+ output bvec3 out0 = [ bvec3(true, false, true) | bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_uvec2_to_vec3
+ version 300 es
+ values
+ {
+ input float in0 = [ -20.125 | 36.8125 | -8.25 | 2.0 | -0.5 | 0.0 | 3.5 | 1.0 ];
+ input uvec2 in1 = [ uvec2(0, 0) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) | uvec2(0, 2) | uvec2(0, 0) | uvec2(1, 1) | uvec2(1, 1) ];
+ output vec3 out0 = [ vec3(-20.125, 0.0, 0.0) | vec3(36.8125, 0.0, 2.0) | vec3(-8.25, 32.0, 64.0) | vec3(2.0, 0.0, 0.0) | vec3(-0.5, 0.0, 2.0) | vec3(0.0, 0.0, 0.0) | vec3(3.5, 1.0, 1.0) | vec3(1.0, 1.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_uvec2_to_ivec3
+ version 300 es
+ values
+ {
+ input float in0 = [ -20.125 | 36.8125 | -8.25 | 2.0 | -0.5 | 0.0 | 3.5 | 1.0 ];
+ input uvec2 in1 = [ uvec2(0, 0) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) | uvec2(0, 2) | uvec2(0, 0) | uvec2(1, 1) | uvec2(1, 1) ];
+ output ivec3 out0 = [ ivec3(-20, 0, 0) | ivec3(36, 0, 2) | ivec3(-8, 32, 64) | ivec3(2, 0, 0) | ivec3(0, 0, 2) | ivec3(0, 0, 0) | ivec3(3, 1, 1) | ivec3(1, 1, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_uvec2_to_bvec3
+ version 300 es
+ values
+ {
+ input float in0 = [ -20.125 | 36.8125 | -8.25 | 2.0 | -0.5 | 0.0 | 3.5 | 1.0 ];
+ input uvec2 in1 = [ uvec2(0, 0) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) | uvec2(0, 2) | uvec2(0, 0) | uvec2(1, 1) | uvec2(1, 1) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(true, false, false) | bvec3(true, false, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_float_to_uvec3
+ version 300 es
+ values
+ {
+ input float in0 = [ 8.25 | 20.125 | 2.0 | 3.5 | 0.5 | 36.8125 | 1.0 | 0.0 ];
+ input float in1 = [ 1.0 | 0.0 | 3.5 | 36.8125 | 8.25 | 2.0 | 0.5 | 20.125 ];
+ input float in2 = [ 20.125 | 0.5 | 8.25 | 36.8125 | 1.0 | 0.0 | 3.5 | 2.0 ];
+ output uvec3 out0 = [ uvec3(8, 1, 20) | uvec3(20, 0, 0) | uvec3(2, 3, 8) | uvec3(3, 36, 36) | uvec3(0, 8, 1) | uvec3(36, 2, 0) | uvec3(1, 0, 3) | uvec3(0, 20, 2) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_int_to_uvec3
+ version 300 es
+ values
+ {
+ input int in0 = [ 1 | 255 | 192 | 2 | 5 | 12 | 0 | 11 | 8 | 66 ];
+ input int in1 = [ 192 | 66 | 5 | 8 | 11 | 1 | 0 | 255 | 12 | 2 ];
+ input int in2 = [ 192 | 5 | 1 | 11 | 66 | 8 | 12 | 0 | 2 | 255 ];
+ output uvec3 out0 = [ uvec3(1, 192, 192) | uvec3(255, 66, 5) | uvec3(192, 5, 1) | uvec3(2, 8, 11) | uvec3(5, 11, 66) | uvec3(12, 1, 8) | uvec3(0, 0, 12) | uvec3(11, 255, 0) | uvec3(8, 12, 2) | uvec3(66, 2, 255) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uint_uint_to_uvec3
+ version 300 es
+ values
+ {
+ input uint in0 = [ 193 | 9 | 45 | 255 | 2 | 0 | 10 | 8 | 12 | 3 ];
+ input uint in1 = [ 3 | 45 | 2 | 9 | 10 | 0 | 8 | 12 | 255 | 193 ];
+ input uint in2 = [ 2 | 3 | 9 | 10 | 255 | 8 | 12 | 0 | 193 | 45 ];
+ output uvec3 out0 = [ uvec3(193, 3, 2) | uvec3(9, 45, 3) | uvec3(45, 2, 9) | uvec3(255, 9, 10) | uvec3(2, 10, 255) | uvec3(0, 0, 8) | uvec3(10, 8, 12) | uvec3(8, 12, 0) | uvec3(12, 255, 193) | uvec3(3, 193, 45) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_bool_to_uvec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ false | true ];
+ input bool in1 = [ false | true ];
+ input bool in2 = [ true | false ];
+ output uvec3 out0 = [ uvec3(0, 0, 1) | uvec3(1, 1, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_float_int_to_uvec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false | true | false | false | true | false | true | true | false ];
+ input float in1 = [ 36.8125 | 20.125 | 1.0 | 0.0 | 3.5 | 1.0 | 2.0 | 0.5 | 0.0 | 8.25 ];
+ input int in2 = [ 1 | 0 | 8 | 66 | 2 | 11 | 192 | 5 | 12 | 255 ];
+ output uvec3 out0 = [ uvec3(1, 36, 1) | uvec3(0, 20, 0) | uvec3(1, 1, 8) | uvec3(0, 0, 66) | uvec3(0, 3, 2) | uvec3(1, 1, 11) | uvec3(0, 2, 192) | uvec3(1, 0, 5) | uvec3(1, 0, 12) | uvec3(0, 8, 255) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0, in1, in2);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_bool_to_uvec3
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(32.0, 64.0) | vec2(0.5, 2.25) | vec2(1.0, 1.25) | vec2(0.75, 0.0322580645161) ];
+ input bool in1 = [ false | false | true | true | true ];
+ output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(32, 64, 0) | uvec3(0, 2, 1) | uvec3(1, 1, 1) | uvec3(0, 0, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_float_to_uvec3
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, true) | bvec2(false, false) | bvec2(false, false) ];
+ input float in1 = [ 8.25 | 36.8125 | 20.125 | 2.0 | 0.0 | 1.0 | 0.5 | 3.5 ];
+ output uvec3 out0 = [ uvec3(1, 1, 8) | uvec3(1, 0, 36) | uvec3(0, 1, 20) | uvec3(0, 0, 2) | uvec3(1, 0, 0) | uvec3(0, 1, 1) | uvec3(0, 0, 0) | uvec3(0, 0, 3) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_int_to_uvec3
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, true) | bvec2(false, true) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) | bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, false) ];
+ input int in1 = [ 255 | 1 | 2 | 5 | 0 | 11 | 192 | 12 | 8 | 66 ];
+ output uvec3 out0 = [ uvec3(1, 1, 255) | uvec3(0, 1, 1) | uvec3(0, 0, 2) | uvec3(1, 1, 5) | uvec3(0, 0, 0) | uvec3(1, 0, 11) | uvec3(0, 0, 192) | uvec3(0, 0, 12) | uvec3(0, 1, 8) | uvec3(1, 0, 66) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_ivec2_to_uvec3
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false | true | true | false ];
+ input ivec2 in1 = [ ivec2(0, 0) | ivec2(0, 2) | ivec2(1, 1) | ivec2(0, 0) | ivec2(32, 64) ];
+ output uvec3 out0 = [ uvec3(1, 0, 0) | uvec3(0, 0, 2) | uvec3(1, 1, 1) | uvec3(1, 0, 0) | uvec3(0, 32, 64) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_uvec2_to_uvec3
+ version 300 es
+ values
+ {
+ input float in0 = [ 2.0 | 8.25 | 20.125 | 3.5 | 0.0 | 0.5 | 36.8125 | 1.0 ];
+ input uvec2 in1 = [ uvec2(0, 2) | uvec2(1, 1) | uvec2(32, 64) | uvec2(0, 0) | uvec2(0, 2) | uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 0) ];
+ output uvec3 out0 = [ uvec3(2, 0, 2) | uvec3(8, 1, 1) | uvec3(20, 32, 64) | uvec3(3, 0, 0) | uvec3(0, 0, 2) | uvec3(0, 0, 0) | uvec3(36, 1, 1) | uvec3(1, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_to_vec2
+ version 300 es
+ values
+ {
+ input float in0 = [ -0.5 | -20.125 | 1.0 | 2.0 | 3.5 | 36.8125 | -8.25 | 0.0 ];
+ input float in1 = [ 1.0 | -20.125 | 0.0 | 3.5 | -8.25 | 36.8125 | -0.5 | 2.0 ];
+ output vec2 out0 = [ vec2(-0.5, 1.0) | vec2(-20.125, -20.125) | vec2(1.0, 0.0) | vec2(2.0, 3.5) | vec2(3.5, -8.25) | vec2(36.8125, 36.8125) | vec2(-8.25, -0.5) | vec2(0.0, 2.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_to_ivec2
+ version 300 es
+ values
+ {
+ input float in0 = [ -0.5 | -20.125 | 1.0 | 2.0 | 3.5 | 36.8125 | -8.25 | 0.0 ];
+ input float in1 = [ 1.0 | -20.125 | 0.0 | 3.5 | -8.25 | 36.8125 | -0.5 | 2.0 ];
+ output ivec2 out0 = [ ivec2(0, 1) | ivec2(-20, -20) | ivec2(1, 0) | ivec2(2, 3) | ivec2(3, -8) | ivec2(36, 36) | ivec2(-8, 0) | ivec2(0, 2) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_to_bvec2
+ version 300 es
+ values
+ {
+ input float in0 = [ -0.5 | -20.125 | 1.0 | 2.0 | 3.5 | 36.8125 | -8.25 | 0.0 ];
+ input float in1 = [ 1.0 | -20.125 | 0.0 | 3.5 | -8.25 | 36.8125 | -0.5 | 2.0 ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(false, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_to_vec2
+ version 300 es
+ values
+ {
+ input int in0 = [ 2 | -66 | 0 | 5 | -12 | 8 | -192 | 1 | 11 | 255 ];
+ input int in1 = [ -192 | 8 | 1 | 0 | 5 | -66 | 2 | 255 | 11 | -12 ];
+ output vec2 out0 = [ vec2(2.0, -192.0) | vec2(-66.0, 8.0) | vec2(0.0, 1.0) | vec2(5.0, 0.0) | vec2(-12.0, 5.0) | vec2(8.0, -66.0) | vec2(-192.0, 2.0) | vec2(1.0, 255.0) | vec2(11.0, 11.0) | vec2(255.0, -12.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_to_ivec2
+ version 300 es
+ values
+ {
+ input int in0 = [ 2 | -66 | 0 | 5 | -12 | 8 | -192 | 1 | 11 | 255 ];
+ input int in1 = [ -192 | 8 | 1 | 0 | 5 | -66 | 2 | 255 | 11 | -12 ];
+ output ivec2 out0 = [ ivec2(2, -192) | ivec2(-66, 8) | ivec2(0, 1) | ivec2(5, 0) | ivec2(-12, 5) | ivec2(8, -66) | ivec2(-192, 2) | ivec2(1, 255) | ivec2(11, 11) | ivec2(255, -12) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_to_bvec2
+ version 300 es
+ values
+ {
+ input int in0 = [ 2 | -66 | 0 | 5 | -12 | 8 | -192 | 1 | 11 | 255 ];
+ input int in1 = [ -192 | 8 | 1 | 0 | 5 | -66 | 2 | 255 | 11 | -12 ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, true) | bvec2(false, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uint_to_vec2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 9 | 12 | 0 | 255 | 8 | 45 | 3 | 2 | 10 | 193 ];
+ input uint in1 = [ 8 | 9 | 45 | 2 | 12 | 193 | 255 | 0 | 3 | 10 ];
+ output vec2 out0 = [ vec2(9.0, 8.0) | vec2(12.0, 9.0) | vec2(0.0, 45.0) | vec2(255.0, 2.0) | vec2(8.0, 12.0) | vec2(45.0, 193.0) | vec2(3.0, 255.0) | vec2(2.0, 0.0) | vec2(10.0, 3.0) | vec2(193.0, 10.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uint_to_ivec2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 9 | 12 | 0 | 255 | 8 | 45 | 3 | 2 | 10 | 193 ];
+ input uint in1 = [ 8 | 9 | 45 | 2 | 12 | 193 | 255 | 0 | 3 | 10 ];
+ output ivec2 out0 = [ ivec2(9, 8) | ivec2(12, 9) | ivec2(0, 45) | ivec2(255, 2) | ivec2(8, 12) | ivec2(45, 193) | ivec2(3, 255) | ivec2(2, 0) | ivec2(10, 3) | ivec2(193, 10) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uint_to_bvec2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 9 | 12 | 0 | 255 | 8 | 45 | 3 | 2 | 10 | 193 ];
+ input uint in1 = [ 8 | 9 | 45 | 2 | 12 | 193 | 255 | 0 | 3 | 10 ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_to_vec2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ true | false ];
+ output vec2 out0 = [ vec2(1.0, 1.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_to_ivec2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ true | false ];
+ output ivec2 out0 = [ ivec2(1, 1) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_to_bvec2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ true | false ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_int_to_vec2
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 3.5 | 0.0 | 2.0 | -8.25 | 36.8125 | -20.125 | 1.0 | 1.0 | -0.5 ];
+ input int in1 = [ -66 | 1 | 255 | -192 | 8 | 2 | 0 | 5 | -12 | 11 ];
+ output vec2 out0 = [ vec2(0.0, -66.0) | vec2(3.5, 1.0) | vec2(0.0, 255.0) | vec2(2.0, -192.0) | vec2(-8.25, 8.0) | vec2(36.8125, 2.0) | vec2(-20.125, 0.0) | vec2(1.0, 5.0) | vec2(1.0, -12.0) | vec2(-0.5, 11.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_int_to_ivec2
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 3.5 | 0.0 | 2.0 | -8.25 | 36.8125 | -20.125 | 1.0 | 1.0 | -0.5 ];
+ input int in1 = [ -66 | 1 | 255 | -192 | 8 | 2 | 0 | 5 | -12 | 11 ];
+ output ivec2 out0 = [ ivec2(0, -66) | ivec2(3, 1) | ivec2(0, 255) | ivec2(2, -192) | ivec2(-8, 8) | ivec2(36, 2) | ivec2(-20, 0) | ivec2(1, 5) | ivec2(1, -12) | ivec2(0, 11) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_int_to_bvec2
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 3.5 | 0.0 | 2.0 | -8.25 | 36.8125 | -20.125 | 1.0 | 1.0 | -0.5 ];
+ input int in1 = [ -66 | 1 | 255 | -192 | 8 | 2 | 0 | 5 | -12 | 11 ];
+ output bvec2 out0 = [ bvec2(false, true) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_bool_to_vec2
+ version 300 es
+ values
+ {
+ input float in0 = [ 2.0 | 3.5 | 1.0 | -20.125 | -8.25 | 0.0 | -0.5 | 36.8125 ];
+ input bool in1 = [ false | true | true | false | false | true | false | true ];
+ output vec2 out0 = [ vec2(2.0, 0.0) | vec2(3.5, 1.0) | vec2(1.0, 1.0) | vec2(-20.125, 0.0) | vec2(-8.25, 0.0) | vec2(0.0, 1.0) | vec2(-0.5, 0.0) | vec2(36.8125, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_bool_to_ivec2
+ version 300 es
+ values
+ {
+ input float in0 = [ 2.0 | 3.5 | 1.0 | -20.125 | -8.25 | 0.0 | -0.5 | 36.8125 ];
+ input bool in1 = [ false | true | true | false | false | true | false | true ];
+ output ivec2 out0 = [ ivec2(2, 0) | ivec2(3, 1) | ivec2(1, 1) | ivec2(-20, 0) | ivec2(-8, 0) | ivec2(0, 1) | ivec2(0, 0) | ivec2(36, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_bool_to_bvec2
+ version 300 es
+ values
+ {
+ input float in0 = [ 2.0 | 3.5 | 1.0 | -20.125 | -8.25 | 0.0 | -0.5 | 36.8125 ];
+ input bool in1 = [ false | true | true | false | false | true | false | true ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, false) | bvec2(false, true) | bvec2(true, false) | bvec2(true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_bool_to_vec2
+ version 300 es
+ values
+ {
+ input int in0 = [ 255 | 2 | -12 | 1 | -192 | 5 | 8 | 0 | -66 | 11 ];
+ input bool in1 = [ true | false | false | false | true | false | true | false | true | true ];
+ output vec2 out0 = [ vec2(255.0, 1.0) | vec2(2.0, 0.0) | vec2(-12.0, 0.0) | vec2(1.0, 0.0) | vec2(-192.0, 1.0) | vec2(5.0, 0.0) | vec2(8.0, 1.0) | vec2(0.0, 0.0) | vec2(-66.0, 1.0) | vec2(11.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_bool_to_ivec2
+ version 300 es
+ values
+ {
+ input int in0 = [ 255 | 2 | -12 | 1 | -192 | 5 | 8 | 0 | -66 | 11 ];
+ input bool in1 = [ true | false | false | false | true | false | true | false | true | true ];
+ output ivec2 out0 = [ ivec2(255, 1) | ivec2(2, 0) | ivec2(-12, 0) | ivec2(1, 0) | ivec2(-192, 1) | ivec2(5, 0) | ivec2(8, 1) | ivec2(0, 0) | ivec2(-66, 1) | ivec2(11, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_bool_to_bvec2
+ version 300 es
+ values
+ {
+ input int in0 = [ 255 | 2 | -12 | 1 | -192 | 5 | 8 | 0 | -66 | 11 ];
+ input bool in1 = [ true | false | false | false | true | false | true | false | true | true ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(true, false) | bvec2(true, false) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(false, false) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_uint_to_vec2
+ version 300 es
+ values
+ {
+ input int in0 = [ -66 | 1 | -192 | -12 | 5 | 255 | 11 | 0 | 2 | 8 ];
+ input uint in1 = [ 193 | 0 | 2 | 10 | 255 | 12 | 45 | 8 | 9 | 3 ];
+ output vec2 out0 = [ vec2(-66.0, 193.0) | vec2(1.0, 0.0) | vec2(-192.0, 2.0) | vec2(-12.0, 10.0) | vec2(5.0, 255.0) | vec2(255.0, 12.0) | vec2(11.0, 45.0) | vec2(0.0, 8.0) | vec2(2.0, 9.0) | vec2(8.0, 3.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_uint_to_ivec2
+ version 300 es
+ values
+ {
+ input int in0 = [ -66 | 1 | -192 | -12 | 5 | 255 | 11 | 0 | 2 | 8 ];
+ input uint in1 = [ 193 | 0 | 2 | 10 | 255 | 12 | 45 | 8 | 9 | 3 ];
+ output ivec2 out0 = [ ivec2(-66, 193) | ivec2(1, 0) | ivec2(-192, 2) | ivec2(-12, 10) | ivec2(5, 255) | ivec2(255, 12) | ivec2(11, 45) | ivec2(0, 8) | ivec2(2, 9) | ivec2(8, 3) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_uint_to_bvec2
+ version 300 es
+ values
+ {
+ input int in0 = [ -66 | 1 | -192 | -12 | 5 | 255 | 11 | 0 | 2 | 8 ];
+ input uint in1 = [ 193 | 0 | 2 | 10 | 255 | 12 | 45 | 8 | 9 | 3 ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_float_to_vec2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 12 | 0 | 8 | 193 | 3 | 10 | 9 | 2 | 45 | 255 ];
+ input float in1 = [ -20.125 | 0.0 | 3.5 | -8.25 | 0.0 | 1.0 | 2.0 | 36.8125 | -0.5 | 1.0 ];
+ output vec2 out0 = [ vec2(12.0, -20.125) | vec2(0.0, 0.0) | vec2(8.0, 3.5) | vec2(193.0, -8.25) | vec2(3.0, 0.0) | vec2(10.0, 1.0) | vec2(9.0, 2.0) | vec2(2.0, 36.8125) | vec2(45.0, -0.5) | vec2(255.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_float_to_ivec2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 12 | 0 | 8 | 193 | 3 | 10 | 9 | 2 | 45 | 255 ];
+ input float in1 = [ -20.125 | 0.0 | 3.5 | -8.25 | 0.0 | 1.0 | 2.0 | 36.8125 | -0.5 | 1.0 ];
+ output ivec2 out0 = [ ivec2(12, -20) | ivec2(0, 0) | ivec2(8, 3) | ivec2(193, -8) | ivec2(3, 0) | ivec2(10, 1) | ivec2(9, 2) | ivec2(2, 36) | ivec2(45, 0) | ivec2(255, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_float_to_bvec2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 12 | 0 | 8 | 193 | 3 | 10 | 9 | 2 | 45 | 255 ];
+ input float in1 = [ -20.125 | 0.0 | 3.5 | -8.25 | 0.0 | 1.0 | 2.0 | 36.8125 | -0.5 | 1.0 ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, false) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_float_to_uvec2
+ version 300 es
+ values
+ {
+ input float in0 = [ 8.25 | 36.8125 | 1.0 | 0.5 | 20.125 | 0.0 | 2.0 | 3.5 ];
+ input float in1 = [ 0.5 | 36.8125 | 0.0 | 2.0 | 8.25 | 20.125 | 1.0 | 3.5 ];
+ output uvec2 out0 = [ uvec2(8, 0) | uvec2(36, 36) | uvec2(1, 0) | uvec2(0, 2) | uvec2(20, 8) | uvec2(0, 20) | uvec2(2, 1) | uvec2(3, 3) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int_to_uvec2
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 12 | 8 | 11 | 255 | 66 | 192 | 2 | 5 | 1 ];
+ input int in1 = [ 11 | 12 | 2 | 5 | 66 | 192 | 255 | 0 | 1 | 8 ];
+ output uvec2 out0 = [ uvec2(0, 11) | uvec2(12, 12) | uvec2(8, 2) | uvec2(11, 5) | uvec2(255, 66) | uvec2(66, 192) | uvec2(192, 255) | uvec2(2, 0) | uvec2(5, 1) | uvec2(1, 8) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uint_to_uvec2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 3 | 9 | 10 | 193 | 8 | 0 | 255 | 45 | 2 | 12 ];
+ input uint in1 = [ 0 | 2 | 12 | 3 | 10 | 9 | 45 | 193 | 255 | 8 ];
+ output uvec2 out0 = [ uvec2(3, 0) | uvec2(9, 2) | uvec2(10, 12) | uvec2(193, 3) | uvec2(8, 10) | uvec2(0, 9) | uvec2(255, 45) | uvec2(45, 193) | uvec2(2, 255) | uvec2(12, 8) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool_to_uvec2
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ input bool in1 = [ true | false ];
+ output uvec2 out0 = [ uvec2(1, 1) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_int_to_uvec2
+ version 300 es
+ values
+ {
+ input float in0 = [ 8.25 | 1.0 | 0.5 | 3.5 | 2.0 | 0.0 | 36.8125 | 1.0 | 0.0 | 20.125 ];
+ input int in1 = [ 0 | 255 | 12 | 5 | 192 | 2 | 66 | 11 | 1 | 8 ];
+ output uvec2 out0 = [ uvec2(8, 0) | uvec2(1, 255) | uvec2(0, 12) | uvec2(3, 5) | uvec2(2, 192) | uvec2(0, 2) | uvec2(36, 66) | uvec2(1, 11) | uvec2(0, 1) | uvec2(20, 8) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_bool_to_uvec2
+ version 300 es
+ values
+ {
+ input float in0 = [ 3.5 | 1.0 | 8.25 | 0.5 | 2.0 | 36.8125 | 0.0 | 20.125 ];
+ input bool in1 = [ true | false | true | false | true | false | false | true ];
+ output uvec2 out0 = [ uvec2(3, 1) | uvec2(1, 0) | uvec2(8, 1) | uvec2(0, 0) | uvec2(2, 1) | uvec2(36, 0) | uvec2(0, 0) | uvec2(20, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_bool_to_uvec2
+ version 300 es
+ values
+ {
+ input int in0 = [ 12 | 11 | 0 | 5 | 8 | 255 | 2 | 1 | 66 | 192 ];
+ input bool in1 = [ true | true | false | false | false | true | false | false | true | true ];
+ output uvec2 out0 = [ uvec2(12, 1) | uvec2(11, 1) | uvec2(0, 0) | uvec2(5, 0) | uvec2(8, 0) | uvec2(255, 1) | uvec2(2, 0) | uvec2(1, 0) | uvec2(66, 1) | uvec2(192, 1) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_uint_to_uvec2
+ version 300 es
+ values
+ {
+ input int in0 = [ 8 | 5 | 1 | 0 | 11 | 12 | 192 | 66 | 255 | 2 ];
+ input uint in1 = [ 8 | 10 | 45 | 255 | 9 | 193 | 2 | 3 | 0 | 12 ];
+ output uvec2 out0 = [ uvec2(8, 8) | uvec2(5, 10) | uvec2(1, 45) | uvec2(0, 255) | uvec2(11, 9) | uvec2(12, 193) | uvec2(192, 2) | uvec2(66, 3) | uvec2(255, 0) | uvec2(2, 12) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_float_to_uvec2
+ version 300 es
+ values
+ {
+ input uint in0 = [ 9 | 45 | 8 | 3 | 10 | 2 | 193 | 12 | 255 | 0 ];
+ input float in1 = [ 3.5 | 20.125 | 2.0 | 0.0 | 1.0 | 36.8125 | 8.25 | 1.0 | 0.0 | 0.5 ];
+ output uvec2 out0 = [ uvec2(9, 3) | uvec2(45, 20) | uvec2(8, 2) | uvec2(3, 0) | uvec2(10, 1) | uvec2(2, 36) | uvec2(193, 8) | uvec2(12, 1) | uvec2(255, 0) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0, in1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # vector_combine
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_illegal.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_illegal.html
new file mode 100644
index 0000000000..73e3b7cbc1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_illegal.html
@@ -0,0 +1,31 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'conversions_vector_illegal';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+modules.shared.glsShaderLibrary.run(testName);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_illegal.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_illegal.test
new file mode 100644
index 0000000000..b4be51604d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_illegal.test
@@ -0,0 +1,1064 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+group vector_illegal "Illegal Vector Conversions"
+
+ case vec2_to_vec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec2 in0 = vec2(0.0, 0.5);
+ vec3 out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_ivec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec2 in0 = vec2(0.0, 0.5);
+ ivec3 out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_uvec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec2 in0 = vec2(0.0, 0.5);
+ uvec3 out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_bvec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec2 in0 = vec2(0.0, 0.5);
+ bvec3 out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_vec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec2 in0 = vec2(0.0, 0.5);
+ vec4 out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_ivec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec2 in0 = vec2(0.0, 0.5);
+ ivec4 out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_uvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec2 in0 = vec2(0.0, 0.5);
+ uvec4 out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_bvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec2 in0 = vec2(0.0, 0.5);
+ bvec4 out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_vec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec2 in0 = ivec2(0, 0);
+ vec3 out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_ivec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec2 in0 = ivec2(0, 0);
+ ivec3 out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_uvec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec2 in0 = ivec2(0, 0);
+ uvec3 out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_bvec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec2 in0 = ivec2(0, 0);
+ bvec3 out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_vec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec2 in0 = ivec2(0, 0);
+ vec4 out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_ivec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec2 in0 = ivec2(0, 0);
+ ivec4 out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_uvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec2 in0 = ivec2(0, 0);
+ uvec4 out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_bvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec2 in0 = ivec2(0, 0);
+ bvec4 out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_vec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ uvec2 in0 = uvec2(0, 0);
+ vec3 out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_ivec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ uvec2 in0 = uvec2(0, 0);
+ ivec3 out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_uvec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ uvec2 in0 = uvec2(0, 0);
+ uvec3 out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_bvec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ uvec2 in0 = uvec2(0, 0);
+ bvec3 out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_vec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ uvec2 in0 = uvec2(0, 0);
+ vec4 out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_ivec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ uvec2 in0 = uvec2(0, 0);
+ ivec4 out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_uvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ uvec2 in0 = uvec2(0, 0);
+ uvec4 out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_bvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ uvec2 in0 = uvec2(0, 0);
+ bvec4 out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_vec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec2 in0 = bvec2(true, false);
+ vec3 out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_ivec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec2 in0 = bvec2(true, false);
+ ivec3 out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_uvec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec2 in0 = bvec2(true, false);
+ uvec3 out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_bvec3
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec2 in0 = bvec2(true, false);
+ bvec3 out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_vec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec2 in0 = bvec2(true, false);
+ vec4 out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_ivec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec2 in0 = bvec2(true, false);
+ ivec4 out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_uvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec2 in0 = bvec2(true, false);
+ uvec4 out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_bvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec2 in0 = bvec2(true, false);
+ bvec4 out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_vec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec3 in0 = vec3(0.0, 0.5, 0.75);
+ vec4 out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_ivec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec3 in0 = vec3(0.0, 0.5, 0.75);
+ ivec4 out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_uvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec3 in0 = vec3(0.0, 0.5, 0.75);
+ uvec4 out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_bvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ vec3 in0 = vec3(0.0, 0.5, 0.75);
+ bvec4 out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_vec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec3 in0 = ivec3(0, 0, 0);
+ vec4 out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_ivec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec3 in0 = ivec3(0, 0, 0);
+ ivec4 out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_uvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec3 in0 = ivec3(0, 0, 0);
+ uvec4 out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_bvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ ivec3 in0 = ivec3(0, 0, 0);
+ bvec4 out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_vec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ uvec3 in0 = uvec3(0, 0, 0);
+ vec4 out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_ivec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ uvec3 in0 = uvec3(0, 0, 0);
+ ivec4 out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_uvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ uvec3 in0 = uvec3(0, 0, 0);
+ uvec4 out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_bvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ uvec3 in0 = uvec3(0, 0, 0);
+ bvec4 out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_vec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec3 in0 = bvec3(true, false, false);
+ vec4 out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_ivec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec3 in0 = bvec3(true, false, false);
+ ivec4 out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_uvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec3 in0 = bvec3(true, false, false);
+ uvec4 out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_bvec4
+ version 300 es
+ expect compile_fail
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ bvec3 in0 = bvec3(true, false, false);
+ bvec4 out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # vector_illegal
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_to_scalar.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_to_scalar.html
new file mode 100644
index 0000000000..e9e1fa0ca2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_to_scalar.html
@@ -0,0 +1,31 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'conversions_vector_to_scalar';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+modules.shared.glsShaderLibrary.run(testName);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_to_scalar.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_to_scalar.test
new file mode 100644
index 0000000000..7d1fe121ae
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_to_scalar.test
@@ -0,0 +1,1160 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+group vector_to_scalar "Vector to Scalar Conversions"
+
+ case vec2_to_float
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_int
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_bool
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output bool out0 = [ false | true | true | true | true ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_float
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_int
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_bool
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output bool out0 = [ false | true | true | true | true ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_float
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_int
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_bool
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output bool out0 = [ false | true | true | true | true ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_float
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output float out0 = [ 0.0 | 1.0 | 0.0 | -32.0 | 0.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_int
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_bool
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output bool out0 = [ false | true | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_float
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output float out0 = [ 0.0 | 1.0 | 0.0 | -32.0 | 0.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_int
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_bool
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output bool out0 = [ false | true | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_float
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output float out0 = [ 0.0 | 1.0 | 0.0 | -32.0 | 0.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_int
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_bool
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output bool out0 = [ false | true | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_float
+ version 300 es
+ values
+ {
+ input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ output float out0 = [ 0.0 | 1.0 | 0.0 | 32.0 | 0.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_int
+ version 300 es
+ values
+ {
+ input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | 32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_bool
+ version 300 es
+ values
+ {
+ input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ output bool out0 = [ false | true | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_float
+ version 300 es
+ values
+ {
+ input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ output float out0 = [ 0.0 | 1.0 | 0.0 | 32.0 | 0.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_int
+ version 300 es
+ values
+ {
+ input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | 32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_bool
+ version 300 es
+ values
+ {
+ input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ output bool out0 = [ false | true | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_float
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output float out0 = [ 0.0 | 1.0 | 0.0 | 32.0 | 0.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_int
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | 32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_bool
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output bool out0 = [ false | true | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_float
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output float out0 = [ 1.0 | 0.0 | 0.0 | 1.0 | 0.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_int
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output int out0 = [ 1 | 0 | 0 | 1 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_bool
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_float
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output float out0 = [ 1.0 | 0.0 | 0.0 | 1.0 | 0.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_int
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output int out0 = [ 1 | 0 | 0 | 1 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_bool
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_float
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output float out0 = [ 1.0 | 0.0 | 0.0 | 1.0 | 0.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = float(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_int
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output int out0 = [ 1 | 0 | 0 | 1 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = int(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_bool
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bool(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_uint
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(0.5, 2.25) | vec2(32.0, 64.0) | vec2(0.75, 0.0322580645161) ];
+ output uint out0 = [ 0 | 1 | 0 | 32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_uint
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(0.5, 2.25, 4.875) | vec3(32.0, 64.0, 51.0) | vec3(0.75, 0.0322580645161, 0.0526315789474) ];
+ output uint out0 = [ 0 | 1 | 0 | 32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_uint
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.5, 2.25, 4.875, 9.0) | vec4(32.0, 64.0, 51.0, 24.0) | vec4(0.75, 0.0322580645161, 0.0526315789474, 0.25) ];
+ output uint out0 = [ 0 | 1 | 0 | 32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_uint
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 2) | ivec2(32, 64) | ivec2(0, 0) ];
+ output uint out0 = [ 0 | 1 | 0 | 32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_uint
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 2, 4) | ivec3(32, 64, 51) | ivec3(0, 0, 0) ];
+ output uint out0 = [ 0 | 1 | 0 | 32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_uint
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 2, 4, 9) | ivec4(32, 64, 51, 24) | ivec4(0, 0, 0, 0) ];
+ output uint out0 = [ 0 | 1 | 0 | 32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_uint
+ version 300 es
+ values
+ {
+ input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ output uint out0 = [ 0 | 1 | 0 | 32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_uint
+ version 300 es
+ values
+ {
+ input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ output uint out0 = [ 0 | 1 | 0 | 32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_uint
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output uint out0 = [ 0 | 1 | 0 | 32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_uint
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output uint out0 = [ 1 | 0 | 0 | 1 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_uint
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output uint out0 = [ 1 | 0 | 0 | 1 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_uint
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output uint out0 = [ 1 | 0 | 0 | 1 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uint(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # vector_to_scalar
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_to_vector.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_to_vector.html
new file mode 100644
index 0000000000..c7452d81ac
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_to_vector.html
@@ -0,0 +1,31 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'conversions_vector_to_vector';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+modules.shared.glsShaderLibrary.run(testName);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_to_vector.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_to_vector.test
new file mode 100644
index 0000000000..b112327284
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/conversions_vector_to_vector.test
@@ -0,0 +1,2312 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+group vector_to_vector "Vector to Vector Conversions"
+
+ case vec4_to_vec4
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_vec3
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_vec2
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_ivec4
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_ivec3
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_ivec2
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_bvec4
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output bvec4 out0 = [ bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_bvec3
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output bvec3 out0 = [ bvec3(false, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_bvec2
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output bvec2 out0 = [ bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_vec4
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(0.0, -2.0, -4.0, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_vec3
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, -2.0, -4.0) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_vec2
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, -2.0) | vec2(-32.0, 64.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_ivec4
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_ivec3
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_ivec2
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_bvec4
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_bvec3
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_bvec2
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_vec4
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(0.0, 2.0, 4.0, 9.0) | vec4(32.0, 64.0, 51.0, 24.0) | vec4(0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_vec3
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, 2.0, 4.0) | vec3(32.0, 64.0, 51.0) | vec3(0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_vec2
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, 2.0) | vec2(32.0, 64.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_ivec4
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 2, 4, 9) | ivec4(32, 64, 51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_ivec3
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 2, 4) | ivec3(32, 64, 51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_ivec2
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 2) | ivec2(32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_bvec4
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_bvec3
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_bvec2
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_vec4
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output vec4 out0 = [ vec4(1.0, 0.0, 0.0, 1.0) | vec4(0.0, 0.0, 0.0, 1.0) | vec4(0.0, 1.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(0.0, 0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_vec3
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output vec3 out0 = [ vec3(1.0, 0.0, 0.0) | vec3(0.0, 0.0, 0.0) | vec3(0.0, 1.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_vec2
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output vec2 out0 = [ vec2(1.0, 0.0) | vec2(0.0, 0.0) | vec2(0.0, 1.0) | vec2(1.0, 1.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_ivec4
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output ivec4 out0 = [ ivec4(1, 0, 0, 1) | ivec4(0, 0, 0, 1) | ivec4(0, 1, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_ivec3
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output ivec3 out0 = [ ivec3(1, 0, 0) | ivec3(0, 0, 0) | ivec3(0, 1, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_ivec2
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output ivec2 out0 = [ ivec2(1, 0) | ivec2(0, 0) | ivec2(0, 1) | ivec2(1, 1) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_bvec4
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_bvec3
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_bvec2
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_uvec4
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.5, 2.25, 4.875, 9.0) | vec4(32.0, 64.0, 51.0, 24.0) | vec4(0.75, 0.0322580645161, 0.0526315789474, 0.25) ];
+ output uvec4 out0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_uvec3
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.5, 2.25, 4.875, 9.0) | vec4(32.0, 64.0, 51.0, 24.0) | vec4(0.75, 0.0322580645161, 0.0526315789474, 0.25) ];
+ output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_to_uvec2
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(0.5, 2.25, 4.875, 9.0) | vec4(32.0, 64.0, 51.0, 24.0) | vec4(0.75, 0.0322580645161, 0.0526315789474, 0.25) ];
+ output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_uvec4
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 2, 4, 9) | ivec4(32, 64, 51, 24) | ivec4(0, 0, 0, 0) ];
+ output uvec4 out0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_uvec3
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 2, 4, 9) | ivec4(32, 64, 51, 24) | ivec4(0, 0, 0, 0) ];
+ output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4_to_uvec2
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 2, 4, 9) | ivec4(32, 64, 51, 24) | ivec4(0, 0, 0, 0) ];
+ output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_uvec4
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output uvec4 out0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_uvec3
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4_to_uvec2
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(0, 0, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 2, 4, 9) | uvec4(32, 64, 51, 24) | uvec4(0, 0, 0, 0) ];
+ output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_uvec4
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output uvec4 out0 = [ uvec4(1, 0, 0, 1) | uvec4(0, 0, 0, 1) | uvec4(0, 1, 0, 0) | uvec4(1, 1, 1, 1) | uvec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec4(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_uvec3
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output uvec3 out0 = [ uvec3(1, 0, 0) | uvec3(0, 0, 0) | uvec3(0, 1, 0) | uvec3(1, 1, 1) | uvec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec4_to_uvec2
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output uvec2 out0 = [ uvec2(1, 0) | uvec2(0, 0) | uvec2(0, 1) | uvec2(1, 1) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_vec3
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_vec2
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_ivec3
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_ivec2
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_bvec3
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output bvec3 out0 = [ bvec3(false, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) | bvec3(true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_bvec2
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output bvec2 out0 = [ bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_vec3
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, -2.0, -4.0) | vec3(-32.0, 64.0, -51.0) | vec3(0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_vec2
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, -2.0) | vec2(-32.0, 64.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_ivec3
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_ivec2
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_bvec3
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_bvec2
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_vec3
+ version 300 es
+ values
+ {
+ input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, 2.0, 4.0) | vec3(32.0, 64.0, 51.0) | vec3(0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_vec2
+ version 300 es
+ values
+ {
+ input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, 2.0) | vec2(32.0, 64.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_ivec3
+ version 300 es
+ values
+ {
+ input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 2, 4) | ivec3(32, 64, 51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_ivec2
+ version 300 es
+ values
+ {
+ input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 2) | ivec2(32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_bvec3
+ version 300 es
+ values
+ {
+ input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, true, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_bvec2
+ version 300 es
+ values
+ {
+ input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_vec3
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output vec3 out0 = [ vec3(1.0, 0.0, 0.0) | vec3(0.0, 0.0, 0.0) | vec3(0.0, 1.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(0.0, 0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_vec2
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output vec2 out0 = [ vec2(1.0, 0.0) | vec2(0.0, 0.0) | vec2(0.0, 1.0) | vec2(1.0, 1.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_ivec3
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output ivec3 out0 = [ ivec3(1, 0, 0) | ivec3(0, 0, 0) | ivec3(0, 1, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_ivec2
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output ivec2 out0 = [ ivec2(1, 0) | ivec2(0, 0) | ivec2(0, 1) | ivec2(1, 1) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_bvec3
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_bvec2
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_uvec3
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(0.5, 2.25, 4.875) | vec3(32.0, 64.0, 51.0) | vec3(0.75, 0.0322580645161, 0.0526315789474) ];
+ output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec3_to_uvec2
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(0.5, 2.25, 4.875) | vec3(32.0, 64.0, 51.0) | vec3(0.75, 0.0322580645161, 0.0526315789474) ];
+ output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_uvec3
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 2, 4) | ivec3(32, 64, 51) | ivec3(0, 0, 0) ];
+ output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3_to_uvec2
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 2, 4) | ivec3(32, 64, 51) | ivec3(0, 0, 0) ];
+ output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_uvec3
+ version 300 es
+ values
+ {
+ input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ output uvec3 out0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3_to_uvec2
+ version 300 es
+ values
+ {
+ input uvec3 in0 = [ uvec3(0, 0, 0) | uvec3(1, 1, 1) | uvec3(0, 2, 4) | uvec3(32, 64, 51) | uvec3(0, 0, 0) ];
+ output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_uvec3
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output uvec3 out0 = [ uvec3(1, 0, 0) | uvec3(0, 0, 0) | uvec3(0, 1, 0) | uvec3(1, 1, 1) | uvec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec3(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec3_to_uvec2
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output uvec2 out0 = [ uvec2(1, 0) | uvec2(0, 0) | uvec2(0, 1) | uvec2(1, 1) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_vec2
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_ivec2
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_bvec2
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output bvec2 out0 = [ bvec2(false, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) | bvec2(true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_vec2
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, -2.0) | vec2(-32.0, 64.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_ivec2
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_bvec2
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_vec2
+ version 300 es
+ values
+ {
+ input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(0.0, 2.0) | vec2(32.0, 64.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_ivec2
+ version 300 es
+ values
+ {
+ input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 2) | ivec2(32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_bvec2
+ version 300 es
+ values
+ {
+ input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(true, true) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_vec2
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output vec2 out0 = [ vec2(1.0, 0.0) | vec2(0.0, 0.0) | vec2(0.0, 1.0) | vec2(1.0, 1.0) | vec2(0.0, 0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = vec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_ivec2
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output ivec2 out0 = [ ivec2(1, 0) | ivec2(0, 0) | ivec2(0, 1) | ivec2(1, 1) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = ivec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_bvec2
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = bvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case vec2_to_uvec2
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(0.5, 2.25) | vec2(32.0, 64.0) | vec2(0.75, 0.0322580645161) ];
+ output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2_to_uvec2
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 2) | ivec2(32, 64) | ivec2(0, 0) ];
+ output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2_to_uvec2
+ version 300 es
+ values
+ {
+ input uvec2 in0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ output uvec2 out0 = [ uvec2(0, 0) | uvec2(1, 1) | uvec2(0, 2) | uvec2(32, 64) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bvec2_to_uvec2
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output uvec2 out0 = [ uvec2(1, 0) | uvec2(0, 0) | uvec2(0, 1) | uvec2(1, 1) | uvec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = uvec2(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # vector_to_vector
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/declarations.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/declarations.html
new file mode 100644
index 0000000000..025d5933e1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/declarations.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'declarations';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/declarations.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/declarations.test
new file mode 100644
index 0000000000..86f98d9832
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/declarations.test
@@ -0,0 +1,591 @@
+group invalid_declarations "Invalid declarations"
+ case in_in_vertex_main
+ version 300 es
+ expect compile_fail
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ void main()
+ {
+ in mediump float val;
+ gl_Position = vec4(1.0);
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ ${FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case out_in_vertex_main
+ version 300 es
+ expect compile_fail
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ void main()
+ {
+ out mediump float val;
+ gl_Position = vec4(1.0);
+ }
+ ""
+ fragment ""
+ #version 300 es
+ in mediump float val;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ ${FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case in_in_fragment_main
+ version 300 es
+ expect compile_fail
+ vertex ""
+ #version 300 es
+ out mediump float val;
+ ${VERTEX_DECLARATIONS}
+ void main()
+ {
+ gl_Position = vec4(1.0);
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ in mediump float val;
+ ${FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case out_in_fragment_main
+ version 300 es
+ expect compile_fail
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ void main()
+ {
+ gl_Position = vec4(1.0);
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ out mediump float val;
+ ${FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case uniform_in_vertex_main
+ version 300 es
+ expect compile_fail
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ void main()
+ {
+ uniform mediump float val;
+ gl_Position = vec4(1.0);
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ ${FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case uniform_in_fragment_main
+ version 300 es
+ expect compile_fail
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ void main()
+ {
+ gl_Position = vec4(1.0);
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ uniform mediump float val;
+ ${FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case uniform_block_in_main
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ void main()
+ {
+ uniform Block { mediump float val; };
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case invariant_attribute
+ version 300 es
+ expect compile_fail
+ vertex ""
+ #version 300 es
+ invariant in mediump float val;
+ ${VERTEX_DECLARATIONS}
+ void main()
+ {
+ gl_Position = vec4(1.0);
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ ${FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case invariant_uniform
+ version 300 es
+ expect compile_fail
+ vertex ""
+ #version 300 es
+ invariant uniform mediump float val;
+ ${VERTEX_DECLARATIONS}
+ void main()
+ {
+ gl_Position = vec4(1.0);
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ ${FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case invariant_uniform_block_1
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ invariant uniform Block { mediump float val; };
+ ${DECLARATIONS}
+ void main()
+ {
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case invariant_uniform_block_2
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ uniform Block { invariant mediump float val; };
+ ${DECLARATIONS}
+ void main()
+ {
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uniform_block_layout_qualifier
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ layout(foobar) uniform Block
+ {
+ mediump float val;
+ };
+ ${DECLARATIONS}
+ void main()
+ {
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uniform_block_member_layout_qualifier
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ uniform Block
+ {
+ layout(foobar) uniform mediump float val;
+ };
+ void main()
+ {
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uniform_block_nested_struct_definition
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ uniform Block
+ {
+ struct S
+ {
+ mediump float v;
+ struct T
+ {
+ highp int i;
+ } t;
+ } s;
+ };
+ void main()
+ {
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case nested_uniform_block
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ uniform Block
+ {
+ uniform Block2
+ {
+ mediump float v;
+ } block2;
+ } block;
+ void main()
+ {
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uniform_block_sampler_2d
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ uniform Block
+ {
+ uniform sampler2D s;
+ };
+ void main()
+ {
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uniform_block_sampler_cube
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ uniform Block
+ {
+ uniform samplerCube s;
+ };
+ void main()
+ {
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uniform_block_missing_member_semicolon
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ uniform Block
+ {
+ mediump float var
+ };
+ void main()
+ {
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uniform_block_missing_end_semicolon
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ uniform Block
+ {
+ mediump float var;
+ }
+ void main()
+ {
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uniform_block_duplicate_member_name_1
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ uniform Block
+ {
+ mediump float var;
+ mediump float var;
+ };
+ void main()
+ {
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uniform_block_duplicate_member_name_2
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ uniform Block
+ {
+ mediump float var;
+ };
+ uniform Block2
+ {
+ mediump float var;
+ };
+ void main()
+ {
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uniform_block_duplicate_member_name_3
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ uniform mediump float var;
+ uniform Block
+ {
+ mediump float var;
+ };
+ void main()
+ {
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uniform_block_duplicate_block_name
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ uniform Block
+ {
+ mediump float var;
+ };
+ uniform Block
+ {
+ mediump float var2;
+ };
+ void main()
+ {
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uniform_block_duplicate_instance_name_1
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ uniform Block
+ {
+ mediump float var;
+ } block;
+ uniform Block2
+ {
+ mediump float var2;
+ } block;
+ void main()
+ {
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uniform_block_duplicate_instance_name_2
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ uniform mediump float block;
+ uniform Block
+ {
+ mediump float var;
+ } block;
+ void main()
+ {
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uniform_block_duplicate_instance_name_3
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ uniform Block
+ {
+ mediump float block;
+ };
+ uniform Block2
+ {
+ mediump float var2;
+ } block;
+ void main()
+ {
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uniform_block_array_without_instance_name_1
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ uniform Block[2]
+ {
+ mediump float var;
+ };
+ void main()
+ {
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uniform_block_array_without_instance_name_2
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ uniform Block
+ {
+ mediump float var;
+ } [2];
+ void main()
+ {
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uniform_block_in
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ uniform Block
+ {
+ in mediump float var;
+ };
+ void main()
+ {
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uniform_block_out
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ uniform Block
+ {
+ out mediump float var;
+ };
+ void main()
+ {
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uniform_block_const
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ uniform Block
+ {
+ const mediump float var;
+ };
+ void main()
+ {
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # invalid_declarations
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/fragdata.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/fragdata.html
new file mode 100644
index 0000000000..3e531413ad
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/fragdata.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'fragdata';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/fragdata.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/fragdata.test
new file mode 100644
index 0000000000..f7ba4f2957
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/fragdata.test
@@ -0,0 +1,76 @@
+
+case invalid_assign_to_1
+ version 100 es
+ expect compile_fail
+ vertex ""
+ void main (void)
+ {
+ gl_Position = vec4(1.0);
+ }
+ ""
+ fragment ""
+ void main (void)
+ {
+ gl_FragData[1] = vec4(1.0);
+ }
+ ""
+end
+
+case write_fragcolor_and_fragdata_simple
+ version 100 es
+ expect compile_fail
+ vertex ""
+ void main (void)
+ {
+ gl_Position = vec4(1.0);
+ }
+ ""
+ fragment ""
+ void main (void)
+ {
+ gl_FragColor = vec4(1.0);
+ gl_FragData[0] = vec4(1.0);
+ }
+ ""
+end
+
+case write_fragcolor_and_fragdata_static_if
+ version 100 es
+ expect compile_fail
+ vertex ""
+ void main (void)
+ {
+ gl_Position = vec4(1.0);
+ }
+ ""
+ fragment ""
+ void main (void)
+ {
+ if (false)
+ gl_FragColor = vec4(1.0);
+ else
+ gl_FragData[0] = vec4(1.0);
+ }
+ ""
+end
+
+case write_fragcolor_and_fragdata_unused_func
+ version 100 es
+ expect compile_fail
+ vertex ""
+ void main (void)
+ {
+ gl_Position = vec4(1.0);
+ }
+ ""
+ fragment ""
+ void unused (void)
+ {
+ gl_FragData[0] = vec4(1.0);
+ }
+ void main (void)
+ {
+ gl_FragColor = vec4(1.0);
+ }
+ ""
+end
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/functions.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/functions.html
new file mode 100644
index 0000000000..65ff88fbbe
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/functions.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'functions';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/functions.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/functions.test
new file mode 100644
index 0000000000..767a03599e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/functions.test
@@ -0,0 +1,4345 @@
+# Tests todo:
+# - inout with varyings, attributes, uniforms (and arrays of 'em)
+# - inout with arrays, array elements
+# - inout with array elements
+# - inout by-value semantics (arrays & elements & structs)
+
+# Done:
+# - control flow: return, return in loop, etc.
+
+group datatypes "Function Parameter Data Types"
+
+ case float_float
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float a)
+ {
+ return -a;
+ }
+
+ void main()
+ {
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_vec2
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 1.0) | vec2(2.0, 2.5) ];
+ output float out0 = [ -1.0 | -4.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (vec2 a)
+ {
+ return -(a.x + a.y);
+ }
+
+ void main()
+ {
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_vec3
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 1.0, -2.0) | vec3(2.0, 2.5, -4.0) ];
+ output float out0 = [ 1.0 | -0.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (vec3 a)
+ {
+ return -(a.x + a.y + a.z);
+ }
+
+ void main()
+ {
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_vec4
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 1.0, -2.0, 0.5) | vec4(2.0, 2.5, 4.0, -7.0) ];
+ output float out0 = [ 0.5 | -1.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (vec4 a)
+ {
+ return -(a.x + a.y + a.z + a.w);
+ }
+
+ void main()
+ {
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_mat2
+ version 300 es
+ values
+ {
+ input mat2 in0 = [ mat2(0.0, 1.0, -2.0, 0.5) | mat2(2.0, 2.5, 4.0, -7.0) ];
+ output float out0 = [ 0.5 | -1.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (mat2 a)
+ {
+ return -(a[0][0] + a[0][1] + a[1][0] + a[1][1]);
+ }
+
+ void main()
+ {
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_mat3
+ version 300 es
+ values
+ {
+ input mat3 in0 = [ mat3(0.0, 1.0, -2.0, 0.5, 1.0, -1.0, 2.0, 4.0, -1.0) | mat3(2.0, 2.5, 4.0, -7.0, 2.5, 3.0, 0.5, -3.5, 1.0) ];
+ output float out0 = [ -4.5 | -5.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (mat3 a)
+ {
+ return -(a[0][0] + a[0][1] + a[0][2] + a[1][0] + a[1][1] + a[1][2] + a[2][0] + a[2][1] + a[2][2]);
+ }
+
+ void main()
+ {
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_mat4
+ version 300 es
+ values
+ {
+ input mat4 in0 = [ mat4(0.0, 1.0, -2.0, 0.5, 1.0, -1.0, 2.0, 4.0, -1.0, 1.0, 1.0, 1.0, 1.0, 1.0, -2.0, -2.0) | mat4(2.0, 2.5, 4.0, -7.0, 2.5, 3.0, 0.5, -3.5, 1.0, 0.0, 2.0, -1.0, 1.0, 0.0, -1.0, 3.0) ];
+ output float out0 = [ -5.5 | -9.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (mat4 a)
+ {
+ return -(a[0][0] + a[0][1] + a[0][2] + a[0][3] + a[1][0] + a[1][1] + a[1][2] + a[1][3] + a[2][0] + a[2][1] + a[2][2] + a[2][3] + a[3][0] + a[3][1] + a[3][2] + a[3][3]);
+ }
+
+ void main()
+ {
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_int
+ version 300 es
+ values
+ {
+ input int in0 = [ -1 | 0 | 1 | 4 ];
+ output int out0 = [ 1 | 0 | -1 | -4 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (int a)
+ {
+ return -a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_ivec2
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(-1, 0) | ivec2(1, 4) ];
+ output int out0 = [ 1 | -5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (ivec2 a)
+ {
+ return -(a.x + a.y);
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_ivec3
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(-1, 0, 2) | ivec3(1, 4, -8) ];
+ output int out0 = [ -1 | 3 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (ivec3 a)
+ {
+ return -(a.x + a.y + a.z);
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case int_ivec4
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(-1, 0, 2, 2) | ivec4(1, 4, -8, 2) ];
+ output int out0 = [ -3 | 1 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (ivec4 a)
+ {
+ return -(a.x + a.y + a.z + a.w);
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uint
+ version 300 es
+ values
+ {
+ input uint in0 = [ 1 | 0 | 2 | 4 ];
+ output uint out0 = [ 1 | 0 | 4 | 16 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ uint func (uint a)
+ {
+ return a*a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uvec2
+ version 300 es
+ values
+ {
+ input uvec2 in0 = [ uvec2(1, 0) | uvec2(2, 4) ];
+ output uint out0 = [ 1 | 6 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ uint func (uvec2 a)
+ {
+ return (a.x + a.y);
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uvec3
+ version 300 es
+ values
+ {
+ input uvec3 in0 = [ uvec3(1, 0, 2) | uvec3(1, 4, 8) ];
+ output uint out0 = [ 3 | 13 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ uint func (uvec3 a)
+ {
+ return (a.x + a.y + a.z);
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case uint_uvec4
+ version 300 es
+ values
+ {
+ input uvec4 in0 = [ uvec4(1, 0, 2, 2) | uvec4(1, 4, 8, 2) ];
+ output uint out0 = [ 5 | 15 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ uint func (uvec4 a)
+ {
+ return (a.x + a.y + a.z + a.w);
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bool
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output bool out0 = [ false | true ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ bool func (bool a)
+ {
+ return !a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bvec2
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, true) | bvec2(false, true) ];
+ output bool out0 = [ false | true ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ bool func (bvec2 a)
+ {
+ return !(a.x == a.y);
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bvec3
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, true, false) | bvec3(true, false, false) ];
+ output bool out0 = [ false | true ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ bool func (bvec3 a)
+ {
+ return (a.x == a.y) == a.z;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bool_bvec4
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, true, true, false) | bvec4(false, false, true, true) | bvec4(true, false, false, true) ];
+ output bool out0 = [ false | true | true ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ bool func (bvec4 a)
+ {
+ return ((a.x == a.y) == (a.z == a.w));
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mat2
+ version 300 es
+ values
+ {
+ input mat2 in0 = [ mat2(-2.0, 0.5, -1.0, 1.0) | mat2(1.0, -3.5, -3.5, 2.5) | mat2(-2.0, -2.0, 3.5, 0.0) ];
+ output mat2 out0 = [ mat2(4.0, -1.0, 2.0, -2.0) | mat2(-2.0, 7.0, 7.0, -5.0) | mat2(4.0, 4.0, -7.0, -0.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ mat2 func (mat2 a)
+ {
+ return -2.0*a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mat2x3
+ version 300 es
+ values
+ {
+ input mat2x3 in0 = [ mat2x3(2.5, 0.0, 1.0, -2.5, 1.0, 3.0) | mat2x3(0.0, 2.0, 1.5, -3.5, 2.0, 0.5) | mat2x3(-1.5, -3.5, 2.5, 0.0, 1.5, 3.0) ];
+ output mat2x3 out0 = [ mat2x3(-5.0, -0.0, -2.0, 5.0, -2.0, -6.0) | mat2x3(-0.0, -4.0, -3.0, 7.0, -4.0, -1.0) | mat2x3(3.0, 7.0, -5.0, -0.0, -3.0, -6.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ mat2x3 func (mat2x3 a)
+ {
+ return -2.0*a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mat2x4
+ version 300 es
+ values
+ {
+ input mat2x4 in0 = [ mat2x4(1.5, 3.0, -1.0, 2.5, -0.5, 3.5, 3.0, -3.0) | mat2x4(-2.5, -2.0, 3.5, -0.5, 1.0, -1.5, 0.0, -1.0) | mat2x4(-1.0, 0.5, 0.5, 3.0, 1.5, 3.0, 2.5, 3.5) ];
+ output mat2x4 out0 = [ mat2x4(-3.0, -6.0, 2.0, -5.0, 1.0, -7.0, -6.0, 6.0) | mat2x4(5.0, 4.0, -7.0, 1.0, -2.0, 3.0, -0.0, 2.0) | mat2x4(2.0, -1.0, -1.0, -6.0, -3.0, -6.0, -5.0, -7.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ mat2x4 func (mat2x4 a)
+ {
+ return -2.0*a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mat3x2
+ version 300 es
+ values
+ {
+ input mat3x2 in0 = [ mat3x2(1.5, -2.5, 2.5, 3.5, 3.0, 0.5) | mat3x2(1.5, -2.0, 2.5, 0.5, -1.5, -3.5) | mat3x2(2.5, 3.5, -3.0, 2.5, -0.5, -2.5) ];
+ output mat3x2 out0 = [ mat3x2(-3.0, 5.0, -5.0, -7.0, -6.0, -1.0) | mat3x2(-3.0, 4.0, -5.0, -1.0, 3.0, 7.0) | mat3x2(-5.0, -7.0, 6.0, -5.0, 1.0, 5.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ mat3x2 func (mat3x2 a)
+ {
+ return -2.0*a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mat3
+ version 300 es
+ values
+ {
+ input mat3 in0 = [ mat3(-1.5, 2.0, 3.0, -3.5, 1.0, -3.5, 1.5, -1.5, 3.0) | mat3(3.5, 0.0, 3.5, -1.5, -3.0, 0.5, -3.5, -2.5, -0.5) | mat3(1.0, -2.5, -3.5, 3.0, -1.5, 3.5, 3.0, -1.0, -0.5) ];
+ output mat3 out0 = [ mat3(3.0, -4.0, -6.0, 7.0, -2.0, 7.0, -3.0, 3.0, -6.0) | mat3(-7.0, -0.0, -7.0, 3.0, 6.0, -1.0, 7.0, 5.0, 1.0) | mat3(-2.0, 5.0, 7.0, -6.0, 3.0, -7.0, -6.0, 2.0, 1.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ mat3 func (mat3 a)
+ {
+ return -2.0*a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mat3x4
+ version 300 es
+ values
+ {
+ input mat3x4 in0 = [ mat3x4(0.0, 1.0, 0.5, 0.5, 1.0, 3.5, 0.0, -0.5, 1.5, -2.0, -1.5, 3.5) | mat3x4(0.0, 0.5, -3.5, -0.5, 0.5, -3.5, 1.0, 1.0, -3.5, 1.0, -0.5, 1.5) | mat3x4(-1.0, 1.5, 2.0, -3.5, -3.5, 1.5, 3.5, -2.0, -0.5, 0.5, -1.5, -1.0) ];
+ output mat3x4 out0 = [ mat3x4(-0.0, -2.0, -1.0, -1.0, -2.0, -7.0, -0.0, 1.0, -3.0, 4.0, 3.0, -7.0) | mat3x4(-0.0, -1.0, 7.0, 1.0, -1.0, 7.0, -2.0, -2.0, 7.0, -2.0, 1.0, -3.0) | mat3x4(2.0, -3.0, -4.0, 7.0, 7.0, -3.0, -7.0, 4.0, 1.0, -1.0, 3.0, 2.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ mat3x4 func (mat3x4 a)
+ {
+ return -2.0*a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mat4x2
+ version 300 es
+ values
+ {
+ input mat4x2 in0 = [ mat4x2(-1.5, -1.0, 0.5, -1.5, -1.0, 2.0, -3.5, 0.5) | mat4x2(2.0, -1.5, -2.0, 2.5, -2.0, -2.5, -0.5, 1.5) | mat4x2(-3.0, -1.5, -1.0, 2.5, -0.5, 2.5, -2.5, -1.0) ];
+ output mat4x2 out0 = [ mat4x2(3.0, 2.0, -1.0, 3.0, 2.0, -4.0, 7.0, -1.0) | mat4x2(-4.0, 3.0, 4.0, -5.0, 4.0, 5.0, 1.0, -3.0) | mat4x2(6.0, 3.0, 2.0, -5.0, 1.0, -5.0, 5.0, 2.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ mat4x2 func (mat4x2 a)
+ {
+ return -2.0*a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mat4x3
+ version 300 es
+ values
+ {
+ input mat4x3 in0 = [ mat4x3(1.0, 3.0, -0.5, -2.0, -3.0, 0.0, -2.5, 2.5, 2.5, -2.5, -1.5, 2.5) | mat4x3(1.0, 2.5, -1.0, -3.0, -1.5, 2.0, -1.5, -1.0, -0.5, -0.5, -0.5, 3.0) | mat4x3(-2.5, -3.5, 3.5, 3.0, 3.5, -0.5, 3.5, 3.0, -2.0, 2.0, 2.5, 1.0) ];
+ output mat4x3 out0 = [ mat4x3(-2.0, -6.0, 1.0, 4.0, 6.0, -0.0, 5.0, -5.0, -5.0, 5.0, 3.0, -5.0) | mat4x3(-2.0, -5.0, 2.0, 6.0, 3.0, -4.0, 3.0, 2.0, 1.0, 1.0, 1.0, -6.0) | mat4x3(5.0, 7.0, -7.0, -6.0, -7.0, 1.0, -7.0, -6.0, 4.0, -4.0, -5.0, -2.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ mat4x3 func (mat4x3 a)
+ {
+ return -2.0*a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mat4
+ version 300 es
+ values
+ {
+ input mat4 in0 = [ mat4(0.0, -1.5, -1.0, -2.0, -3.0, 0.5, -1.5, 2.5, -3.5, 3.0, 1.5, 3.0, 3.0, 3.0, 0.5, -3.5) | mat4(2.0, -2.5, -1.5, 1.0, 0.0, -0.5, 3.5, 1.0, -1.0, -2.0, 2.5, 0.0, 2.0, -1.0, -2.5, 0.5) | mat4(2.5, -2.5, 2.0, 3.0, 2.5, 2.5, -3.5, 1.0, 2.5, -3.5, -1.5, -1.5, 0.0, -0.5, 0.0, 2.0) ];
+ output mat4 out0 = [ mat4(-0.0, 3.0, 2.0, 4.0, 6.0, -1.0, 3.0, -5.0, 7.0, -6.0, -3.0, -6.0, -6.0, -6.0, -1.0, 7.0) | mat4(-4.0, 5.0, 3.0, -2.0, -0.0, 1.0, -7.0, -2.0, 2.0, 4.0, -5.0, -0.0, -4.0, 2.0, 5.0, -1.0) | mat4(-5.0, 5.0, -4.0, -6.0, -5.0, -5.0, 7.0, -2.0, -5.0, 7.0, 3.0, 3.0, -0.0, 1.0, -0.0, -4.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ mat4 func (mat4 a)
+ {
+ return -2.0*a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case float_struct
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 1.0, -2.0) | vec3(2.0, 2.5, -4.0) ];
+ output float out0 = [ 1.0 | -0.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ struct Pos { float a, b, c; };
+
+ float func (Pos p)
+ {
+ return -(p.a + p.b + p.c);
+ }
+
+ void main()
+ {
+ Pos p = Pos(in0.x, in0.y, in0.z);
+ out0 = func(p);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case struct_struct
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 1.0, -2.0) | vec3(2.0, 2.5, -4.0) ];
+ output float out0 = [ 1.0 | -0.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ struct Pos { float a, b, c; };
+
+ Pos func (Pos p)
+ {
+ return Pos(-p.a, -p.b, -p.c);
+ }
+
+ void main()
+ {
+ Pos p = Pos(in0.x, in0.y, in0.z);
+ p = func(p);
+ out0 = p.a + p.b + p.c;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case struct_nested_struct
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 1.0, -2.0) | vec3(2.0, 2.5, -4.0) ];
+ output float out0 = [ 1.0 | -0.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ struct Pos { float a, b, c; };
+ struct Line { Pos start, end; };
+
+ Line func (Pos p)
+ {
+ return Line(p, Pos(-p.a, -p.b, -p.c));
+ }
+
+ float sum (Pos p)
+ {
+ return (p.a + p.b + p.c);
+ }
+
+ void main()
+ {
+ Pos p = Pos(in0.x, in0.y, in0.z);
+ Line line = func(p);
+ out0 = sum(line.start) + (2.0 * sum(line.end));
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # datatypes
+
+group qualifiers "Function Parameter Qualifiers"
+
+ case in_float
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ float func (in float a)
+ {
+ a = -a;
+ return 2.0 * a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float f = in0;
+ float g = func(f);
+ out0 = f + g;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case out_float
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ void func (out float a)
+ {
+ a = -1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float f = 1.0;
+ func(f);
+ out0 = f * in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case inout_float
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ void func (inout float a)
+ {
+ a = -a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float f = 1.0;
+ func(f);
+ out0 = f * in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case in_lowp_float
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ float func (in lowp float a)
+ {
+ a = -a;
+ return 2.0 * a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float f = in0;
+ float g = func(f);
+ out0 = f + g;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case out_lowp_float
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ void func (out lowp float a)
+ {
+ a = -1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float f = 1.0;
+ func(f);
+ out0 = f * in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case inout_lowp_float
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ void func (inout lowp float a)
+ {
+ a = -a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float f = 1.0;
+ func(f);
+ out0 = f * in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case in_highp_float
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ float func (in highp float a)
+ {
+ a = -a;
+ return 2.0 * a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float f = in0;
+ float g = func(f);
+ out0 = f + g;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case out_highp_float
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ void func (out highp float a)
+ {
+ a = -1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float f = 1.0;
+ func(f);
+ out0 = f * in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case inout_highp_float
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ void func (inout highp float a)
+ {
+ a = -a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float f = 1.0;
+ func(f);
+ out0 = f * in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case const_float
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ float func (const float a)
+ {
+ float b = -a;
+ return 2.0 * b;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float f = in0;
+ float g = func(f);
+ out0 = f + g;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case const_in_float
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ float func (const in float a)
+ {
+ float b = -a;
+ return 2.0 * b;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float f = in0;
+ float g = func(f);
+ out0 = f + g;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case in_int
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | -2 | 4 ];
+ output int out0 = [ 0 | -1 | 2 | -4 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (in int a)
+ {
+ a = -a;
+ return 2 * a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ int f = in0;
+ int g = func(f);
+ out0 = f + g;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case out_int
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | -2 | 6 ];
+ output int out0 = [ 0 | -1 | 2 | -6 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ void func (out int a)
+ {
+ a = -1;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ int f = 1;
+ func(f);
+ out0 = f * in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case inout_int
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | -2 | 6 ];
+ output int out0 = [ 0 | -1 | 2 | -6 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ void func (inout int a)
+ {
+ a = -a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ int f = 1;
+ func(f);
+ out0 = f * in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case in_lowp_int
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | -2 | 4 ];
+ output int out0 = [ 0 | -1 | 2 | -4 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (in lowp int a)
+ {
+ a = -a;
+ return 2 * a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ int f = in0;
+ int g = func(f);
+ out0 = f + g;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case out_lowp_int
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | -2 | 6 ];
+ output int out0 = [ 0 | -1 | 2 | -6 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ void func (out lowp int a)
+ {
+ a = -1;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ int f = 1;
+ func(f);
+ out0 = f * in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case inout_lowp_int
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | -2 | 6 ];
+ output int out0 = [ 0 | -1 | 2 | -6 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ void func (inout lowp int a)
+ {
+ a = -a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ int f = 1;
+ func(f);
+ out0 = f * in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case in_highp_int
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | -2 | 4 ];
+ output int out0 = [ 0 | -1 | 2 | -4 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (in highp int a)
+ {
+ a = -a;
+ return 2 * a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ int f = in0;
+ int g = func(f);
+ out0 = f + g;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case out_highp_int
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | -2 | 6 ];
+ output int out0 = [ 0 | -1 | 2 | -6 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ void func (out highp int a)
+ {
+ a = -1;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ int f = 1;
+ func(f);
+ out0 = f * in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case inout_highp_int
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | -2 | 6 ];
+ output int out0 = [ 0 | -1 | 2 | -6 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ void func (inout highp int a)
+ {
+ a = -a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ int f = 1;
+ func(f);
+ out0 = f * in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case const_int
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | -2 | 4 ];
+ output int out0 = [ 0 | -1 | 2 | -4 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (const int a)
+ {
+ int b = -a;
+ return 2 * b;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ int f = in0;
+ int g = func(f);
+ out0 = f + g;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case const_in_int
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | -2 | 4 ];
+ output int out0 = [ 0 | -1 | 2 | -4 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (const in int a)
+ {
+ int b = -a;
+ return 2 * b;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ int f = in0;
+ int g = func(f);
+ out0 = f + g;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case in_bool
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output bool out0 = [ true | true ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ bool func (in bool a)
+ {
+ a = !a;
+ return a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ bool f = in0;
+ bool g = func(f);
+ out0 = (f != g);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case out_bool
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output bool out0 = [ false | true ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func (out bool a)
+ {
+ a = false;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ bool f = true;
+ func(f);
+ out0 = (in0 == f);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case inout_bool
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output bool out0 = [ false | true ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func (inout bool a)
+ {
+ a = !a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ bool f = true;
+ func(f);
+ out0 = (in0 == f);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case const_bool
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output bool out0 = [ true | true ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ bool func (const bool a)
+ {
+ bool b = !a;
+ return b;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ bool f = in0;
+ bool g = func(f);
+ out0 = (f != g);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # qualifiers
+
+group declarations "Function Declarations"
+
+ case basic
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (void);
+
+ float func (void)
+ {
+ return -1.0;
+ }
+
+ void main()
+ {
+ out0 = func() * in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case basic_arg
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float f);
+
+ float func (float f)
+ {
+ return -f;
+ }
+
+ void main()
+ {
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case define_after_use
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (void);
+
+ void main()
+ {
+ out0 = func() * in0;
+ ${OUTPUT}
+ }
+
+ float func (void)
+ {
+ return -1.0;
+ }
+ ""
+ end
+
+ case double_declare
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (void);
+
+ float func (void);
+
+ float func (void)
+ {
+ return -1.0;
+ }
+
+ void main()
+ {
+ out0 = func() * in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case declare_after_define
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (void)
+ {
+ return -1.0;
+ }
+
+ float func (void);
+
+ void main()
+ {
+ out0 = func() * in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case void_vs_no_void
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func ();
+
+ void main()
+ {
+ out0 = func() * in0;
+ ${OUTPUT}
+ }
+
+ float func (void)
+ {
+ return -1.0;
+ }
+ ""
+ end
+
+ case in_vs_no_in
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float f);
+
+ void main()
+ {
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+
+ float func (in float f)
+ {
+ return -f;
+ }
+ ""
+ end
+
+ case default_vs_explicit_precision
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float f);
+
+ void main()
+ {
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+
+ float func (mediump float f)
+ {
+ return -f;
+ }
+ ""
+ end
+
+
+end # declarations
+
+group overloading "Function Overloading"
+
+ case user_func_arg_type_simple
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ float func (float a)
+ {
+ return -a;
+ }
+
+ int func (int a)
+ {
+ return -a;
+ }
+
+ void main()
+ {
+ out0 = func(in0) * float(func(-1));
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case user_func_arg_float_types
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ float func (float a) { return -a; }
+ vec2 func (vec2 a) { return a.yx; }
+ vec3 func (vec3 a) { return a.xxx; }
+ vec4 func (vec4 a) { return a.wwww; }
+
+ void main()
+ {
+ out0 = func(func(func(func(vec4(in0)).xyz).xy).x);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case user_func_arg_int_types
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | -2 | 6 ];
+ output int out0 = [ 0 | -1 | 2 | -6 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (int a) { return -a; }
+ ivec2 func (ivec2 a) { return a.yx; }
+ ivec3 func (ivec3 a) { return a.xxx; }
+ ivec4 func (ivec4 a) { return a.wwww; }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(func(func(func(ivec4(in0)).xyz).xy).x);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case user_func_arg_bool_types
+ version 300 es
+ values
+ {
+ input bool in0 = [ true | false ];
+ output bool out0 = [ false | true ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ bool func (bool a) { return !a; }
+ bvec2 func (bvec2 a) { return a.yx; }
+ bvec3 func (bvec3 a) { return a.xxx; }
+ bvec4 func (bvec4 a) { return a.wwww; }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(func(func(func(bvec4(in0)).xyz).xy).x);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case user_func_arg_basic_types
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ float func (float a) { return -a; }
+ vec2 func (vec2 a) { return a.yx; }
+ vec3 func (vec3 a) { return a.xxx; }
+ vec4 func (vec4 a) { return a.wwww; }
+ int func (int a) { return -a; }
+ ivec2 func (ivec2 a) { return a.yx; }
+ ivec3 func (ivec3 a) { return a.xxx; }
+ ivec4 func (ivec4 a) { return a.wwww; }
+ bool func (bool a) { return !a; }
+ bvec2 func (bvec2 a) { return a.yx; }
+ bvec3 func (bvec3 a) { return a.xxx; }
+ bvec4 func (bvec4 a) { return a.wwww; }
+
+ void main()
+ {
+ ${SETUP}
+ if (func(func(bvec4(false)).x))
+ out0 = func(in0) * float(func(-1));
+ else
+ out0 = float(func(func(ivec4(func(func(func(vec4(0.5)).xyz).xy).xxxx)).xy).x);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case user_func_arg_complex_types
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ struct Pos { float a, b, c; };
+ struct Line { Pos start, end; };
+
+ float func (float a) { return -a; }
+ float func (float a[4]) { return a[0] + a[3]; }
+ vec2 func (vec2 a) { return a.yx; }
+ vec3 func (vec3 a) { return a.xxx; }
+ vec4 func (vec4 a) { return a.wwww; }
+ vec4 func (vec4 a[4]) { return a[1] + a[2]; }
+ int func (int a) { return -a; }
+ ivec2 func (ivec2 a) { return a.yx; }
+ ivec3 func (ivec3 a) { return a.xxx; }
+ ivec4 func (ivec4 a) { return a.wwww; }
+ bool func (bool a) { return !a; }
+ bvec2 func (bvec2 a) { return a.yx; }
+ bvec3 func (bvec3 a) { return a.xxx; }
+ bvec4 func (bvec4 a) { return a.wwww; }
+ Pos func (Pos a) { return a; }
+ Line func (Line a) { return Line(a.end, a.start); }
+
+ void main()
+ {
+ ${SETUP}
+ float arr[4];
+ vec4 arr2[4];
+ out0 = func(arr) + func(arr2).x;
+ if (func(func(bvec4(false)).x))
+ out0 = func(in0) * float(func(-1));
+ else
+ out0 = float(func(func(ivec4(func(func(func(vec4(0.5)).xyz).xy).xxxx)).xy).x);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case user_func_arguments
+ version 300 es
+ values
+ {
+ input float in0 = [ 0.0 | 1.0 | -2.0 | 2.5 ];
+ output float out0 = [ 0.0 | -1.0 | 2.0 | -2.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float a)
+ {
+ return -a;
+ }
+
+ float func (float a, float b)
+ {
+ return a * b;
+ }
+
+ void main()
+ {
+ out0 = func(in0) * func(-0.5, -2.0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case array_size
+ version 300 es
+ values
+ {
+ output float out0 = [ 1.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float f[3])
+ {
+ return f[0];
+ }
+
+ float func (float f[4])
+ {
+ return f[1];
+ }
+
+ void main ()
+ {
+ ${SETUP}
+ float[4] x = float[4] (-1.0, 1.0, 0.0, 0.0);
+ out0 = func(x);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # overloading
+
+group array_arguments "Arrays as Arguments"
+
+ case local_in_float
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ];
+ output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (in float a[4])
+ {
+ a[0] = -1.0;
+ a[2] = -4.0;
+ a[3] = -3.0 * a[1];
+ return a[0];
+ }
+
+ void main()
+ {
+ float arr[4];
+ arr[0] = in0.x;
+ arr[1] = in0.y;
+ arr[2] = in0.z;
+ arr[3] = in0.w;
+ float f = func(arr);
+ out0 = f * vec4(arr[0], arr[1], arr[2], arr[3]);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case global_in_float
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ];
+ output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (in float a[4])
+ {
+ a[0] = -1.0;
+ a[2] = -4.0;
+ a[3] = -3.0 * a[1];
+ return a[0];
+ }
+
+ float arr[4];
+
+ void main()
+ {
+ arr[0] = in0.x;
+ arr[1] = in0.y;
+ arr[2] = in0.z;
+ arr[3] = in0.w;
+ float f = func(arr);
+ out0 = f * vec4(arr[0], arr[1], arr[2], arr[3]);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case local_in_int
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 1, 2, -4) | ivec4(-7, -11, 13, 19) ];
+ output ivec4 out0 = [ ivec4(0, -1, -2, 4) | ivec4(7, 11, -13, -19) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (in int a[4])
+ {
+ a[0] = -1;
+ a[2] = -4;
+ a[3] = -3 * a[1];
+ return a[0];
+ }
+
+ void main()
+ {
+ ${SETUP}
+ int arr[4];
+ arr[0] = in0.x;
+ arr[1] = in0.y;
+ arr[2] = in0.z;
+ arr[3] = in0.w;
+ int f = func(arr);
+ out0 = f * ivec4(arr[0], arr[1], arr[2], arr[3]);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case global_in_int
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 1, 2, 4) | ivec4(-7, -11, 13, 19) ];
+ output ivec4 out0 = [ ivec4(0, -1, -2, -4) | ivec4(7, 11, -13, -19) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (in int a[4])
+ {
+ a[0] = -1;
+ a[2] = -4;
+ a[3] = -3 * a[1];
+ return a[0];
+ }
+
+ int arr[4];
+
+ void main()
+ {
+ ${SETUP}
+ arr[0] = in0.x;
+ arr[1] = in0.y;
+ arr[2] = in0.z;
+ arr[3] = in0.w;
+ int f = func(arr);
+ out0 = f * ivec4(arr[0], arr[1], arr[2], arr[3]);
+ ${OUTPUT}
+ }
+
+ ""
+ end
+
+ case local_in_bool
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, true, false, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ bool func (in bool a[4])
+ {
+ a[0] = false;
+ a[2] = true;
+ a[3] = !a[1];
+ return a[0];
+ }
+
+ void main()
+ {
+ ${SETUP}
+ bool arr[4];
+ arr[0] = !in0.x;
+ arr[1] = !in0.y;
+ arr[2] = !in0.z;
+ arr[3] = !in0.w;
+ func(arr);
+ out0 = bvec4(arr[0], arr[1], arr[2], arr[3]);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case global_in_bool
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, true, false, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(true, true, true, true) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ bool func (in bool a[4])
+ {
+ a[0] = false;
+ a[2] = true;
+ a[3] = !a[1];
+ return a[0];
+ }
+
+ bool arr[4];
+
+ void main()
+ {
+ ${SETUP}
+ arr[0] = !in0.x;
+ arr[1] = !in0.y;
+ arr[2] = !in0.z;
+ arr[3] = !in0.w;
+ func(arr);
+ out0 = bvec4(arr[0], arr[1], arr[2], arr[3]);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case test_helpers
+ version 300 es
+ desc "Check that helper functions are supported properly."
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ];
+ output float out0 = [ 1.0 | 1.0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ vec4 get (in float arr[4]);
+ void set (out float arr[4], vec4 val);
+ void negate (inout float arr[4]);
+ bool test (in float arr[4], vec4 ref);
+ bool isEqual (in float a[4], in float b[4]);
+
+ void main()
+ {
+ float arr[4];
+ set(arr, in0);
+ negate(arr);
+ out0 = float(test(arr, -in0));
+ ${OUTPUT}
+ }
+
+ float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); }
+ vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); }
+ void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; }
+ void negate (inout float arr[4]) { set(arr, -get(arr)); }
+ bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); }
+ bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); }
+ ""
+ end
+
+ case copy_local_in_on_call
+ version 300 es
+ desc "Check that local 'in' arguments are copied on call and don't alias."
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ];
+ output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ vec4 get (in float arr[4]);
+ void set (out float arr[4], vec4 val);
+ void negate (inout float arr[4]);
+ bool test (in float arr[4], vec4 ref);
+ bool isEqual (in float a[4], in float b[4]);
+
+ float func (in float a[4], in float b[4])
+ {
+ a[0] = 2.123;
+ a[2] = -4.123;
+ return isEqual(a, b) ? 1.0 : -1.0;
+ }
+
+ void main()
+ {
+ float arr[4];
+ set(arr, in0);
+ out0 = in0 * func(arr, arr);
+ ${OUTPUT}
+ }
+
+ float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); }
+ vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); }
+ void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; }
+ void negate (inout float arr[4]) { set(arr, -get(arr)); }
+ bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); }
+ bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); }
+ ""
+ end
+
+ case copy_global_in_on_call
+ version 300 es
+ desc "Check that global 'in' arguments are copied on call and don't alias."
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ];
+ output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ vec4 get (in float arr[4]);
+ void set (out float arr[4], vec4 val);
+ void negate (inout float arr[4]);
+ bool test (in float arr[4], vec4 ref);
+ bool isEqual (in float a[4], in float b[4]);
+
+ float func (in float a[4], in float b[4])
+ {
+ a[0] = 2.123;
+ a[2] = -4.123;
+ return isEqual(a, b) ? 1.0 : -1.0;
+ }
+
+ float arr[4];
+
+ void main()
+ {
+ set(arr, in0);
+ out0 = in0 * func(arr, arr);
+ ${OUTPUT}
+ }
+
+ float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); }
+ vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); }
+ void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; }
+ void negate (inout float arr[4]) { set(arr, -get(arr)); }
+ bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); }
+ bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); }
+ ""
+ end
+
+ case copy_local_inout_on_call
+ version 300 es
+ desc "Check that local 'in' arguments are copied on call and don't alias."
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ];
+ output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ vec4 get (in float arr[4]);
+ void set (out float arr[4], vec4 val);
+ void negate (inout float arr[4]);
+ bool test (in float arr[4], vec4 ref);
+ bool isEqual (in float a[4], in float b[4]);
+
+ float func (inout float a[4], inout float b[4])
+ {
+ negate(a);
+ return isEqual(a, b) ? 1.0 : -1.0;
+ }
+
+ void main()
+ {
+ float arr[4];
+ set(arr, in0);
+ float m = func(arr, arr); // returns -1.0
+ float n = float(test(arr, in0) || test(arr, -in0));
+ out0 = in0 * m * n;
+ ${OUTPUT}
+ }
+
+ float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); }
+ vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); }
+ void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; }
+ void negate (inout float arr[4]) { set(arr, -get(arr)); }
+ bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); }
+ bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); }
+ ""
+ end
+
+ case copy_global_inout_on_call
+ version 300 es
+ desc "Check that global 'in' arguments are copied on call and don't alias."
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 1.0, 2.0, -4.0) | vec4(-7.5, 12.125, -0.25, 16.0) ];
+ output vec4 out0 = [ vec4(0.0, -1.0, -2.0, 4.0) | vec4(7.5, -12.125, 0.25, -16.0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ vec4 get (in float arr[4]);
+ void set (out float arr[4], vec4 val);
+ void negate (inout float arr[4]);
+ bool test (in float arr[4], vec4 ref);
+ bool isEqual (in float a[4], in float b[4]);
+
+ float func (in float a[4], in float b[4])
+ {
+ negate(a);
+ return isEqual(a, b) ? 1.0 : -1.0;
+ }
+
+ float arr[4];
+
+ void main()
+ {
+ set(arr, in0);
+ float m = func(arr, arr); // returns -1.0
+ float n = float(test(arr, in0) || test(arr, -in0));
+ out0 = in0 * m * n;
+ ${OUTPUT}
+ }
+
+ float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); }
+ vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); }
+ void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; }
+ void negate (inout float arr[4]) { set(arr, -get(arr)); }
+ bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); }
+ bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); }
+ ""
+ end
+
+# vec4 get (in float arr[4]);
+# void set (out float arr[4], vec4 val);
+# void negate (inout float arr[4]);
+# bool test (in float arr[4], vec4 ref);
+# bool isEqual (in float a[4], in float b[4]);
+
+# float absDiff (vec4 a, vec4 b) { vec4 d = abs(a - b); return max(max(d.x, d.y), max(d.z, d.w)); }
+# vec4 get (in float arr[4]) { return vec4(arr[0], arr[1], arr[2], arr[3]); }
+# void set (out float arr[4], vec4 val) { arr[0] = val.x; arr[1] = val.y; arr[2] = val.z; arr[3] = val.w; }
+# void negate (inout float arr[4]) { set(arr, -get(arr)); }
+# bool test (in float arr[4], vec4 ref) { return (absDiff(get(arr), ref) < 0.1); }
+# bool isEqual (in float a[4], in float b[4]) { return (absDiff(get(a), get(b)) < 0.1); }
+
+end # array_arguments
+
+#group qualifiers "Function Parameter Qualifiers"
+#
+#end # qualifiers
+
+group control_flow "Control Flow In Functions"
+
+ case simple_return
+ version 300 es
+ values
+ {
+ input float in0 = [ -0.5 | 1.5 ];
+ output float out0 = [ 0.5 | -1.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float a)
+ {
+ return -a;
+ a = a * -1.0;
+ return 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case return_in_if
+ version 300 es
+ values
+ {
+ input float in0 = [ -0.5 | 1.5 ];
+ output float out0 = [ 0.5 | -1.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float a)
+ {
+ if (a != 0.0)
+ return -a;
+ return 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case return_in_else
+ version 300 es
+ values
+ {
+ input float in0 = [ -0.5 | 1.5 ];
+ output float out0 = [ 0.5 | -1.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float a)
+ {
+ if (a == 0.0)
+ return 1.0;
+ else
+ return -a;
+ return 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case return_in_loop
+ version 300 es
+ values
+ {
+ input float in0 = [ -0.5 | 1.5 ];
+ output float out0 = [ 0.5 | -1.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float a)
+ {
+ while (a < 100.0)
+ return -a;
+ return 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case return_in_loop_if
+ version 300 es
+ values
+ {
+ input float in0 = [ -0.5 | 1.5 ];
+ output float out0 = [ 0.5 | -1.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float a)
+ {
+ while (a < 100.0)
+ {
+ a = -a;
+ if (a != 0.0)
+ return a;
+ else
+ return -1.0;
+ }
+ return 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case return_after_loop
+ version 300 es
+ values
+ {
+ input float in0 = [ -0.5 | 1.5 ];
+ output float out0 = [ 0.5 | -1.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float a)
+ {
+ for (int i = 0; i < 5; i++)
+ a = -a;
+ return a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case return_after_break
+ version 300 es
+ values
+ {
+ input float in0 = [ -0.5 | 1.5 ];
+ output float out0 = [ 0.5 | -1.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float a)
+ {
+ for (int i = 0; i < 6; i++)
+ {
+ a = -a;
+ if (i == 4)
+ break;
+ }
+ return a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case return_after_continue
+ version 300 es
+ values
+ {
+ input float in0 = [ -0.5 | 1.5 ];
+ output float out0 = [ 0.5 | -1.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float a)
+ {
+ for (int i = 0; i < 6; i++)
+ {
+ if (i == 4)
+ continue;
+ a = -a;
+ }
+ return a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case return_in_nested_loop
+ version 300 es
+ values
+ {
+ input float in0 = [ -0.5 | 1.5 ];
+ output float out0 = [ 0.5 | -1.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float a)
+ {
+ for (int i = 0; i < 6; i++)
+ {
+ a = -a;
+ for (int j = 0; j < 4; j++)
+ {
+ a = -a;
+ if (i == 1)
+ return a;
+ }
+ if (i == 4)
+ return 1.0;
+ }
+ return 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case return_after_loop_sequence
+ version 300 es
+ values
+ {
+ input float in0 = [ -0.5 | 1.5 ];
+ output float out0 = [ 0.5 | -1.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float a)
+ {
+ int i;
+ for (i = 0; i < 6; i++) // negate a
+ {
+ a = -a;
+ if (i == 4)
+ a = -a;
+ }
+
+ for (; i < 10; i++) // keep a
+ {
+ if (i == 8)
+ continue;
+ else if (i == 9)
+ break;
+ a = -a;
+ }
+
+ return a;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mixed_return_break_continue
+ version 300 es
+ values
+ {
+ input float in0 = [ -0.5 | 1.5 ];
+ output float out0 = [ 0.5 | -1.5 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float a)
+ {
+ int i;
+ for (i = 0; i < 6; i++)
+ {
+ if (i == 0)
+ continue;
+ else if (i == 1)
+ {
+ }
+ else if (i == 3)
+ break;
+ else
+ return a;
+ a = -a;
+ }
+
+ return 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # control_flow
+
+group misc "Miscellaneous"
+
+ case multi_arg_float
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 1.0, -2.0, 0.5) | vec4(2.0, 2.5, 4.0, -7.0) ];
+ output float out0 = [ 0.5 | -1.5 ]; # -sum(in0)
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float sum(vec4 v) { return (v.x + v.y + v.z + v.w); }
+
+ float func (float a, vec3 b, vec2 c, vec2 d, vec4 e)
+ {
+ return -sum(vec4(a, b) + vec4(c, d)) + sum(e);
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0.y, in0.xzw, in0.wz, in0.yx, in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case multi_arg_int
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(-1, 0, 2, 2) | ivec4(1, 4, -8, 2) ];
+ output int out0 = [ -3 | 1 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int sum(ivec4 v) { return (v.x + v.y + v.z + v.w); }
+
+ int func (int a, ivec3 b, ivec2 c, ivec2 d, ivec4 e)
+ {
+ return -sum(ivec4(a, b) + ivec4(c, d)) + sum(e);
+ }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0.y, in0.xzw, in0.wz, in0.yx, in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case argument_eval_order_1
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | 1 | 3 | 5 ];
+ output int out0 = [ -1 | 5 | 11 | 17 ];
+ }
+
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+
+ int func (float a, int b, bool c, int d)
+ {
+ if (c)
+ return b + int(a) + d;
+ else
+ return -1;
+ }
+
+ void main ()
+ {
+ ${SETUP}
+ float v0 = float(in0);
+ int v1 = in0;
+ out0 = func((v0 += 1.0), v1++, (v0 > 1.5), v1);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case argument_eval_order_2
+ version 300 es
+ values
+ {
+ input int in0 = [ 0 | -1 | 3 | 5 ];
+ output int out0 = [ 3 | -1 | 9 | 13 ];
+ }
+
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+
+ int g;
+
+ int modG (int v)
+ {
+ g += v;
+ return v;
+ }
+
+ int func (float a, int b, bool c, int d)
+ {
+ if (c)
+ return b + int(a) + d;
+ else
+ return -1;
+ }
+
+ void main ()
+ {
+ ${SETUP}
+ out0 = func(float(g = in0), modG(2), --g > 0, g);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # misc
+
+group invalid "Invalid Functions"
+ case break_in_body
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func ()
+ {
+ break;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case continue_in_body
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func ()
+ {
+ continue;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case return_value_from_void_function
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func ()
+ {
+ return 1.0;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case extra_arguments
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func (float f)
+ {
+ }
+
+ void main ()
+ {
+ func(1.0, 2.0);
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case missing_arguments
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func (float f)
+ {
+ }
+
+ void main ()
+ {
+ func();
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case missing_argument_type
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func (in f)
+ {
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case argument_basetype_mismatch
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ void func (float f)
+ {
+ }
+
+ void main ()
+ {
+ func(2);
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case argument_scalar_vector_mismatch
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func (vec2 f)
+ {
+ }
+
+ void main ()
+ {
+ func(2.0);
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case argument_vector_size_mismatch
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func (vec3 f)
+ {
+ }
+
+ void main ()
+ {
+ func(vec2(2.0));
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case duplicate_function
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func (vec3 f);
+
+ void func (vec3 f)
+ {
+ }
+
+ void func (vec3 f)
+ {
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case prototype_mismatch_return_type
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func (vec3 f);
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+
+ float func (vec3 f)
+ {
+ return f.x;
+ }
+ ""
+ end
+
+ case prototype_unspecified_array_size
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func (vec3 f[]);
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case call_mismatch_argument_array_size
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func (vec3 f[3]);
+ void func (vec3 f[3])
+ {
+ }
+
+ void main ()
+ {
+ vec3 array[4];
+ func(array);
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case prototype_mismatch_argument_const
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func (vec3 f);
+ void func (const vec3 f)
+ {
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case prototype_mismatch_argument_array_const
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func (vec3 f[3]);
+ void func (const vec3 f[3])
+ {
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case prototype_mismatch_array_inout
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func (out vec3 f);
+ void func (inout vec3 f)
+ {
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case missing_return_type
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ func (float f);
+ func (inout vec3 f[3])
+ {
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case call_before_definition
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ func(1.0);
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+
+ void func (float f)
+ {
+ }
+
+ ""
+ end
+
+ case argument_precision_overload
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (lowp float f)
+ {
+ return f;
+ }
+
+ float func (mediump float f)
+ {
+ return f;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case argument_in_out_overload
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func (in float f)
+ {
+ }
+
+ void func (out float f)
+ {
+ f = 1.0;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case argument_in_inout_overload
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func (in float f)
+ {
+ }
+
+ void func (inout float f)
+ {
+ f = -f;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case argument_out_inout_overload
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func (out float f)
+ {
+ f = -1.0;
+ }
+
+ void func (inout float f)
+ {
+ f = -f;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case return_type_overload
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float f)
+ {
+ return f;
+ }
+
+ int func (float f)
+ {
+ return int(f);
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case return_type_precision_overload
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ lowp float func (float f)
+ {
+ return f;
+ }
+
+ mediump float func (float f)
+ {
+ return f;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case return_type_const_overload
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float f)
+ {
+ return f;
+ }
+
+ const float func (float f)
+ {
+ return f;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case return_without_value
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float f)
+ {
+ return;
+ return 1.0;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case local_function_prototype
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ float func (float f);
+
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case local_function_definition
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ float func (float f)
+ {
+ return 1.0;
+ }
+
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case name_type_conflict
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ struct foo { float a; }
+
+ float foo (float f)
+ {
+ return 1.0;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case const_overload
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func (vec3 f)
+ {
+ }
+
+ void func (const vec3 f)
+ {
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case uniform_local
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func (vec3 f)
+ {
+ uniform float u;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case in_local
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func (vec3 f)
+ {
+ in float v;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case out_local
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func (vec3 f)
+ {
+ in float a;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case inout_local
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func (vec3 f)
+ {
+ inout float a;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case uniform_argument
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func (uniform vec3 f)
+ {
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case uniform_return_type
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ uniform float func (vec3 f)
+ {
+ return f.x;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case in_return_type
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ in float func (vec3 f)
+ {
+ return f.x;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(func(vec3(1.0)));
+ }
+ ""
+ end
+
+ case out_return_type
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ out float func (vec3 f)
+ {
+ return f.x;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(func(vec3(1.0)));
+ }
+ ""
+ end
+
+ case inout_return_type
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ inout float func (vec3 f)
+ {
+ return f.x;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(func(vec3(1.0)));
+ }
+ ""
+ end
+
+ case main_invalid_return_type
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case main_has_arguments
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main (float f)
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case main_missing_return_type
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case write_const_arg
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (const float f)
+ {
+ f = 1.0;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case write_const_array_arg
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (const float f[3])
+ {
+ f[0] = 1.0;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case use_const_arg_in_const_expr
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (const int i)
+ {
+ const int z = i+1;
+ return float(z);
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(func(1));
+ }
+ ""
+ end
+
+ case use_const_arg_as_array_size
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (const int i)
+ {
+ float f[i];
+ f[0] = 1.0;
+ return f[0];
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(func(1));
+ }
+ ""
+ end
+
+ case overload_builtin_function
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ int sin (int x)
+ {
+ return int(sin(float(x)));
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(sin(1));
+ }
+ ""
+ end
+
+ case redefine_builtin_function
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float sin (float x)
+ {
+ return 0.0;
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(sin(1.0));
+ }
+ ""
+ end
+
+ case basic_recursion
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float fib (float x)
+ {
+ if (x <= 1.0)
+ return x;
+ else
+ return fib(x-2.0) + fib(x-1.0);
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(fib(5.0));
+ }
+ ""
+ end
+
+ case simple_tail_recursion
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float rec (float x)
+ {
+ if (x <= 0.0)
+ return 0.0;
+ else
+ return rec(x-1.0);
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(rec(5.0));
+ }
+ ""
+ end
+
+ case dynamic_conditional_recursion
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform float ua;
+ uniform float ub;
+
+ float funcA (float x);
+ float funcB (float x);
+
+ float funcA (float x)
+ {
+ if (ub+x > 0.0)
+ funcB(x*2.0);
+ else
+ return ub;
+ }
+
+ float funcB (float x)
+ {
+ return sqrt(funcA(x));
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(funcB(ua));
+ }
+ ""
+ end
+
+ case dynamic_loop_recursion
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform float ua;
+ uniform float ub;
+
+ float funcA (float x);
+ float funcB (float x);
+
+ float funcA (float x)
+ {
+ for (float z = 0.0; z < ub+x; z++)
+ {
+ if (z > 2.0)
+ funcB(z*2.0);
+ else
+ return z;
+ }
+ }
+
+ float funcB (float x)
+ {
+ return sqrt(funcA(x));
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(funcB(ua));
+ }
+ ""
+ end
+
+ case dynamic_switch_recursion
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform float ua;
+ uniform mediump int ub;
+
+ float funcA (float x);
+ float funcB (float x);
+
+ float funcA (float x)
+ {
+ switch (ub + int(x))
+ {
+ case 0: return ua-1.0;
+ case 1: return ua;
+ case 2: return funcB(x*2.0);
+ default: return 0.0;
+ }
+ }
+
+ float funcB (float x)
+ {
+ return sqrt(funcA(x));
+ }
+
+ void main ()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(funcB(ua));
+ }
+ ""
+ end
+
+ case modify_const_arg
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (const int a)
+ {
+ a = -a;
+ return 2 * a;
+ }
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(func(3));
+ }
+ ""
+ end
+
+ case init_const_local_from_const_arg
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (const int a)
+ {
+ const int b = -a;
+ return 2 * b;
+ }
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(func(3));
+ }
+ ""
+ end
+
+ case array_size_from_const_arg
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ precision mediump int;
+ ${DECLARATIONS}
+
+ int func (const int a)
+ {
+ int arr[a];
+ arr[1] = 3;
+ return arr[1];
+ }
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(func(3));
+ }
+ ""
+ end
+
+end # invalid
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/invalid_texture_functions.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/invalid_texture_functions.html
new file mode 100644
index 0000000000..98c13381d3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/invalid_texture_functions.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'invalid_texture_functions';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/invalid_texture_functions.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/invalid_texture_functions.test
new file mode 100644
index 0000000000..10d65b22ed
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/invalid_texture_functions.test
@@ -0,0 +1,1143 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+
+case texture_sampler3dshadow_vec4
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump sampler3DShadow s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(texture(s, vec4(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case texture_sampler2darrayshadow_vec4_float
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump sampler2DArrayShadow s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(texture(s, vec4(0), float(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureproj_samplercube_vec4
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump samplerCube s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureProj(s, vec4(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureproj_isamplercube_vec4
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump isamplerCube s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureProj(s, vec4(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureproj_usamplercube_vec4
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump usamplerCube s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureProj(s, vec4(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureproj_samplercube_vec4_float
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump samplerCube s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureProj(s, vec4(0), float(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureproj_isamplercube_vec4_float
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump isamplerCube s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureProj(s, vec4(0), float(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureproj_usamplercube_vec4_float
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump usamplerCube s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureProj(s, vec4(0), float(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureproj_sampler2darrayshadow_vec4
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump sampler2DArrayShadow s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureProj(s, vec4(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureproj_sampler2darrayshadow_vec4_float
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump sampler2DArrayShadow s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureProj(s, vec4(0), float(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case texturelod_samplercubeshadow_vec4_float
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump samplerCubeShadow s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureLod(s, vec4(0), float(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case texturelod_sampler2darrayshadow_vec4_float
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump sampler2DArrayShadow s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureLod(s, vec4(0), float(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureoffset_samplercube_vec3_ivec2
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump samplerCube s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec2(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureoffset_isamplercube_vec3_ivec2
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump isamplerCube s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec2(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureoffset_usamplercube_vec3_ivec2
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump usamplerCube s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec2(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureoffset_samplercube_vec3_ivec3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump samplerCube s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec3(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureoffset_isamplercube_vec3_ivec3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump isamplerCube s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec3(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureoffset_usamplercube_vec3_ivec3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump usamplerCube s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec3(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureoffset_samplercube_vec3_ivec2_float
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump samplerCube s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec2(0), float(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureoffset_samplercube_vec3_ivec3_float
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump samplerCube s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec3(0), float(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureoffset_sampler2darray_vec3_ivec3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump sampler2DArray s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec3(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureoffset_sampler2darray_vec3_ivec3_float
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump sampler2DArray s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec3(0), ivec3(0), float(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureoffset_samplercubeshadow_vec4_ivec2
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump samplerCubeShadow s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec4(0), ivec2(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureoffset_samplercubeshadow_vec4_ivec3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump samplerCubeShadow s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec4(0), ivec3(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureoffset_sampler2darrayshadow_vec4_ivec2
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump sampler2DArrayShadow s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec4(0), ivec2(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureoffset_sampler2darrayshadow_vec4_ivec2_float
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump sampler2DArrayShadow s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureOffset(s, vec4(0), ivec2(0), float(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case texelfetch_samplercube_ivec3_int
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump samplerCube s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec3(0), int(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case texelfetch_isamplercube_ivec3_int
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump isamplerCube s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec3(0), int(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case texelfetch_usamplercube_ivec3_int
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump usamplerCube s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec3(0), int(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case texelfetch_sampler2dshadow_ivec2_int
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump sampler2DShadow s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec2(0), int(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case texelfetch_samplercubeshadow_ivec3_int
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump samplerCubeShadow s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec3(0), int(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case texelfetch_sampler2darrayshadow_ivec3_int
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump sampler2DArrayShadow s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec3(0), int(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case texelfetch_samplercube_ivec3_int_ivec3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump samplerCube s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec3(0), int(0), ivec3(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case texelfetch_sampler2dshadow_ivec2_int_ivec2
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump sampler2DShadow s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec2(0), int(0), ivec2(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case texelfetch_samplercubeshadow_ivec3_int_ivec3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump samplerCubeShadow s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec3(0), int(0), ivec3(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case texelfetch_sampler2darrayshadow_ivec3_int_ivec3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump sampler2DArrayShadow s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(texelFetch(s, ivec3(0), int(0), ivec3(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureprojoffset_samplercube_vec4_ivec2
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump samplerCube s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureProjOffset(s, vec4(0), ivec2(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureprojoffset_samplercube_vec4_ivec3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump samplerCube s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureProjOffset(s, vec4(0), ivec3(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureprojoffset_samplercubeshadow_vec4_ivec3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump samplerCubeShadow s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureProjOffset(s, vec4(0), ivec3(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureprojoffset_sampler2darrayshadow_vec4_ivec2
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump sampler2DArrayShadow s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureProjOffset(s, vec4(0), ivec2(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureprojoffset_sampler2darrayshadow_vec4_ivec3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump sampler2DArrayShadow s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureProjOffset(s, vec4(0), ivec3(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case texturelodoffset_samplercube_vec3_float_ivec2
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump samplerCube s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureLodOffset(s, vec3(0), float(0), ivec2(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case texturelodoffset_samplercube_vec3_float_ivec3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump samplerCube s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureLodOffset(s, vec3(0), float(0), ivec3(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case texturelodoffset_samplercubeshadow_vec3_float_ivec3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump samplerCubeShadow s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureLodOffset(s, vec3(0), float(0), ivec3(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case texturelodoffset_sampler2darrayshadow_vec3_float_ivec2
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump sampler2DArrayShadow s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureLodOffset(s, vec3(0), float(0), ivec2(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case texturelodoffset_sampler2darrayshadow_vec3_float_ivec3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump sampler2DArrayShadow s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureLodOffset(s, vec3(0), float(0), ivec3(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureprojlod_samplercube_vec4_float
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump samplerCube s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureProjLod(s, vec4(0), float(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureprojlod_sampler2darray_vec4_float
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump sampler2DArray s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureProjLod(s, vec4(0), float(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureprojlod_sampler2darrayshadow_vec4_float
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump sampler2DArrayShadow s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureProjLod(s, vec4(0), float(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case texturegrad_sampler2darray_vec3_vec3_vec3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump sampler2DArray s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureGrad(s, vec3(0), vec3(0), vec3(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case texturegradoffset_samplercube_vec3_vec3_vec3_ivec2
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump samplerCube s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureGradOffset(s, vec3(0), vec3(0), vec3(0), ivec2(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case texturegradoffset_samplercube_vec3_vec3_vec3_ivec3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump samplerCube s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureGradOffset(s, vec3(0), vec3(0), vec3(0), ivec3(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case texturegradoffset_samplercubeshadow_vec4_vec3_vec3_ivec2
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump samplerCubeShadow s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureGradOffset(s, vec4(0), vec3(0), vec3(0), ivec2(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case texturegradoffset_samplercubeshadow_vec4_vec3_vec3_ivec3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump samplerCubeShadow s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureGradOffset(s, vec4(0), vec3(0), vec3(0), ivec3(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureprojgrad_samplercube_vec4_vec3_vec3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump samplerCube s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureProjGrad(s, vec4(0), vec3(0), vec3(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureprojgrad_sampler2darray_vec4_vec2_vec2
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump sampler2DArray s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureProjGrad(s, vec4(0), vec2(0), vec2(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureprojgradoffset_samplercube_vec4_vec3_vec3_ivec2
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump samplerCube s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureProjGradOffset(s, vec4(0), vec3(0), vec3(0), ivec2(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureprojgradoffset_samplercube_vec4_vec3_vec3_ivec3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump samplerCube s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureProjGradOffset(s, vec4(0), vec3(0), vec3(0), ivec3(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureprojgradoffset_sampler2darray_vec4_vec2_vec2_ivec2
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump sampler2DArray s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureProjGradOffset(s, vec4(0), vec2(0), vec2(0), ivec2(0)));
+ ${OUTPUT}
+ }
+ ""
+end
+case textureprojgradoffset_sampler2darray_vec4_vec2_vec2_ivec3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ uniform mediump sampler2DArray s;
+
+ void main()
+ {
+ ${SETUP}
+ ${POSITION_FRAG_COLOR} = vec4(textureProjGradOffset(s, vec4(0), vec2(0), vec2(0), ivec3(0)));
+ ${OUTPUT}
+ }
+ ""
+end
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/keywords.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/keywords.html
new file mode 100644
index 0000000000..5899a9a279
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/keywords.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'keywords';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/keywords.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/keywords.test
new file mode 100644
index 0000000000..b588cd74e3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/keywords.test
@@ -0,0 +1,3219 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+
+group keywords "Usage of keywords as identifiers."
+
+ case const
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float const = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case uniform
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float uniform = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case layout
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float layout = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case centroid
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float centroid = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case flat
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float flat = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case smooth
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float smooth = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case break
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float break = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case continue
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float continue = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case do
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float do = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case for
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float for = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case while
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float while = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case switch
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float switch = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case case
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float case = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case default
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float default = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case if
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float if = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case else
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float else = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case in
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float in = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case out
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float out = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case inout
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float inout = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case float
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float float = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case int
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float int = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case void
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float void = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case bool
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float bool = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case true
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float true = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case false
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float false = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case invariant
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float invariant = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case discard
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float discard = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case return
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float return = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case mat2
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float mat2 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case mat3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float mat3 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case mat4
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float mat4 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case mat2x2
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float mat2x2 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case mat2x3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float mat2x3 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case mat2x4
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float mat2x4 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case mat3x2
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float mat3x2 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case mat3x3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float mat3x3 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case mat3x4
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float mat3x4 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case mat4x2
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float mat4x2 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case mat4x3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float mat4x3 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case mat4x4
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float mat4x4 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case vec2
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float vec2 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case vec3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float vec3 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case vec4
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float vec4 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case ivec2
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float ivec2 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case ivec3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float ivec3 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case ivec4
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float ivec4 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case bvec2
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float bvec2 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case bvec3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float bvec3 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case bvec4
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float bvec4 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case uint
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float uint = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case uvec2
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float uvec2 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case uvec3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float uvec3 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case uvec4
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float uvec4 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case lowp
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float lowp = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case mediump
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float mediump = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case highp
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float highp = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case precision
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float precision = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case sampler2D
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float sampler2D = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case sampler3D
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float sampler3D = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case samplerCube
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float samplerCube = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case sampler2DShadow
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float sampler2DShadow = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case samplerCubeShadow
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float samplerCubeShadow = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case sampler2DArray
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float sampler2DArray = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case sampler2DArrayShadow
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float sampler2DArrayShadow = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case isampler2D
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float isampler2D = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case isampler3D
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float isampler3D = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case isamplerCube
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float isamplerCube = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case isampler2DArray
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float isampler2DArray = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case usampler2D
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float usampler2D = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case usampler3D
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float usampler3D = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case usamplerCube
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float usamplerCube = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case usampler2DArray
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float usampler2DArray = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case struct
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float struct = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # keywords
+group reserved_keywords "Usage of reserved keywords as identifiers."
+
+ case attribute
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float attribute = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case varying
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float varying = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case coherent
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float coherent = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case restrict
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float restrict = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case readonly
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float readonly = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case writeonly
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float writeonly = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case resource
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float resource = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case atomic_uint
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float atomic_uint = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case noperspective
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float noperspective = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case patch
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float patch = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case sample
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float sample = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case subroutine
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float subroutine = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case common
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float common = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case partition
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float partition = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case active
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float active = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case asm
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float asm = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case class
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float class = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case union
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float union = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case enum
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float enum = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case typedef
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float typedef = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case template
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float template = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case this
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float this = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case goto
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float goto = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case inline
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float inline = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case noinline
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float noinline = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case volatile
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float volatile = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case public
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float public = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case static
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float static = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case extern
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float extern = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case external
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float external = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case interface
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float interface = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case long
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float long = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case short
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float short = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case double
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float double = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case half
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float half = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case fixed
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float fixed = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case unsigned
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float unsigned = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case superp
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float superp = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case input
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float input = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case output
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float output = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case hvec2
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float hvec2 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case hvec3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float hvec3 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case hvec4
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float hvec4 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case dvec2
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float dvec2 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case dvec3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float dvec3 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case dvec4
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float dvec4 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case fvec2
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float fvec2 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case fvec3
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float fvec3 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case fvec4
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float fvec4 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case sampler3DRect
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float sampler3DRect = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case filter
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float filter = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case image1D
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float image1D = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case image2D
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float image2D = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case image3D
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float image3D = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case imageCube
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float imageCube = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case iimage1D
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float iimage1D = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case iimage2D
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float iimage2D = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case iimage3D
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float iimage3D = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case iimageCube
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float iimageCube = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case uimage1D
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float uimage1D = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case uimage2D
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float uimage2D = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case uimage3D
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float uimage3D = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case uimageCube
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float uimageCube = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case image1DArray
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float image1DArray = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case image2DArray
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float image2DArray = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case iimage1DArray
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float iimage1DArray = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case iimage2DArray
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float iimage2DArray = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case uimage1DArray
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float uimage1DArray = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case uimage2DArray
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float uimage2DArray = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case image1DShadow
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float image1DShadow = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case image2DShadow
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float image2DShadow = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case image1DArrayShadow
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float image1DArrayShadow = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case image2DArrayShadow
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float image2DArrayShadow = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case imageBuffer
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float imageBuffer = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case iimageBuffer
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float iimageBuffer = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case uimageBuffer
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float uimageBuffer = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case sampler1D
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float sampler1D = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case sampler1DShadow
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float sampler1DShadow = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case sampler1DArray
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float sampler1DArray = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case sampler1DArrayShadow
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float sampler1DArrayShadow = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case isampler1D
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float isampler1D = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case isampler1DArray
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float isampler1DArray = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case usampler1D
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float usampler1D = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case usampler1DArray
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float usampler1DArray = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case sampler2DRect
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float sampler2DRect = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case sampler2DRectShadow
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float sampler2DRectShadow = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case isampler2DRect
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float isampler2DRect = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case usampler2DRect
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float usampler2DRect = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case samplerBuffer
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float samplerBuffer = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case isamplerBuffer
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float isamplerBuffer = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case usamplerBuffer
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float usamplerBuffer = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case sampler2DMS
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float sampler2DMS = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case isampler2DMS
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float isampler2DMS = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case usampler2DMS
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float usampler2DMS = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case sampler2DMSArray
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float sampler2DMSArray = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case isampler2DMSArray
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float isampler2DMSArray = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case usampler2DMSArray
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float usampler2DMSArray = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case sizeof
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float sizeof = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case cast
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float cast = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case namespace
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float namespace = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case using
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float using = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # reserved_keywords
+group invalid_identifiers "Usage of invalid identifiers."
+
+ case gl_begin
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float gl_Invalid = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case digit
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float 0123 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case digit_begin
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float 0invalid = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+ case max_length
+ expect compile_fail
+ values {}
+ version 300 es
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ float abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdX = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # invalid_identifiers
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/linkage.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/linkage.html
new file mode 100644
index 0000000000..c6ebbbc051
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/linkage.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'linkage';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/linkage.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/linkage.test
new file mode 100644
index 0000000000..4cdaa06180
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/linkage.test
@@ -0,0 +1,3833 @@
+
+# Varying tests
+group varying "Varying linkage"
+
+ # Linking rules
+ group rules "Varying linking rules"
+ # not declared in vertex shader, declared in fragment shader
+ case fragment_declare
+ version 300 es
+ desc "varying declared in fragment shader, no reference in vertex shader"
+ values { output float out0 = 1.0; }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ in mediump float var;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ out0 = 1.0;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ # declared in vertex shader, no reference in frag shader
+ case vertex_declare
+ version 300 es
+ desc "varying declared in vertex shader, no reference in fragment shader"
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ out mediump float var;
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ ${FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ # declared in vertex shader, declared in frag shader
+ case both_declare
+ version 300 es
+ desc "varying declared in both vertex and fragment shader, but not used"
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ out mediump float var;
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ in mediump float var;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ ${FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ # declared in vertex shader, static use in frag shader
+ case vertex_declare_fragment_use
+ version 300 es
+ desc "varying declared in both shaders, statically used in fragment shader"
+ values { uniform bool u_false = false; }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ out mediump float var;
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ in mediump float var;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ if (u_false)
+ ${FRAG_COLOR} = vec4(var);
+ else
+ ${FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ # static use in vertex shader, no reference in fragment shader
+ case vertex_use_fragment_declare
+ version 300 es
+ desc "varying declared and statically used in vertex shader, no reference in fragment shader"
+ values { uniform bool u_false = false; }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ out mediump float var;
+ void main()
+ {
+ if (u_false)
+ var = 1.0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ ${FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ # static use in vertex shader, declared in fragment shader
+ case vertex_use_declare_fragment
+ version 300 es
+ desc "varying declared and statically used in vertex shader, only declared in fragment shader"
+ values { uniform bool u_false = false; }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ out mediump float var;
+ void main()
+ {
+ if (u_false)
+ var = 1.0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ in mediump float var;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ ${FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ # static use in vertex shader, used in fragment shader
+ case vertex_use_fragment_use
+ version 300 es
+ desc "varying statically used in both vertex and fragment shader"
+ values { uniform bool u_false = false; }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ out mediump float var;
+ void main()
+ {
+ if (u_false)
+ var = 1.0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float var;
+ void main()
+ {
+ if (u_false)
+ ${FRAG_COLOR} = vec4(var);
+ else
+ ${FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ # differing precision tests
+ case differing_precision_1
+ version 300 es
+ desc "varying declared as highp in vertex shader, but mediump in fragment shader"
+ values
+ {
+ input float in0 = [ -1.25 | -25.55 | 1.0 | 2.25 | 3.4 | 16.0 ];
+ output float out0 = [ -1.25 | -25.55 | 1.0 | 2.25 | 3.4 | 16.0 ];
+ }
+
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ out highp float var;
+ void main()
+ {
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ # differing precision tests
+ case differing_precision_2
+ version 300 es
+ desc "varying declared as highp in vertex shader, but lowp in fragment shader"
+ values
+ {
+ input float in0 = [ -1.25 | -25.56 | 1.0 | 2.25 | 3.4 | 16.0 ];
+ output float out0 = [ -1.25 | -25.56 | 1.0 | 2.25 | 3.4 | 16.0 ];
+ }
+
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ out highp vec2 var;
+ void main()
+ {
+ var = vec2(in0, 2.0*in0);
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ in lowp vec2 var;
+ void main()
+ {
+ out0 = var.y - var.x;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ # differing precision tests
+ case differing_precision_3
+ version 300 es
+ desc "varying declared as lowp in vertex shader, but mediump in fragment shader"
+ values
+ {
+ input float in0 = [ -1.25 | -25.0 | 1.0 | 2.25 | 3.4 | 16.0 ];
+ output float out0 = [ -1.25 | -25.0 | 1.0 | 2.25 | 3.4 | 16.0 ];
+ }
+
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ out lowp vec4 var;
+ void main()
+ {
+ var = vec4(in0, 2.0*in0, -in0, -in0);
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump vec4 var;
+ void main()
+ {
+ out0 = var.x + var.y + var.z + var.w;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ # mismatched type, static use but no runtime use in the fragment shader
+ case type_mismatch_1
+ version 300 es
+ desc "varying type mismatch (float vs. vec2), static use but no runtime use in the fragment shader"
+ expect link_fail
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ out mediump float var;
+ void main()
+ {
+ var = 2.0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ in mediump vec2 var;
+ void main()
+ {
+ if (false)
+ {
+ ${FRAG_COLOR} = vec4(var.y);
+ }
+ else
+ {
+ ${FRAG_COLOR} = vec4(1.0);
+ }
+ }
+ ""
+ end
+
+ # mismatched type, varyings used
+ case type_mismatch_2
+ version 300 es
+ desc "varying type mismatch (float vs. vec2)"
+ expect link_fail
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ out mediump float var;
+ void main()
+ {
+ var = 2.0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ in mediump vec2 var;
+ void main()
+ {
+ ${FRAG_COLOR} = var.xyyx;
+ }
+ ""
+ end
+
+ # mismatched type, varyings used
+ case type_mismatch_3
+ version 300 es
+ desc "varying type mismatch (int vs. uint)"
+ expect link_fail
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ flat out mediump int var;
+ void main()
+ {
+ var = 2;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ flat in mediump uint var;
+ void main()
+ {
+ ${FRAG_COLOR} = vec4(var);
+ }
+ ""
+ end
+
+ # mismatched type, varyings used
+ case struct_type_mismatch_1
+ version 300 es
+ desc "struct member mismatch"
+ expect link_fail
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct S { highp float a; highp vec2 b; };
+ out S var;
+ void main()
+ {
+ var.a = 2.0;
+ var.b = vec2(1.0, 0.0);
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ struct S { highp float a; highp vec3 b; };
+ in S var;
+ void main()
+ {
+ ${FRAG_COLOR} = vec4(var.a, var.b);
+ }
+ ""
+ end
+
+ # mismatched type, varyings unused in fragment shader (runtime)
+ case struct_type_mismatch_2
+ version 300 es
+ desc "struct member mismatch"
+ expect link_fail
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct S { highp float a; highp vec2 b; };
+ out S var;
+ void main()
+ {
+ var.a = 2.0;
+ var.b = vec2(1.0, 0.0);
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ struct S { highp float a; highp vec3 b; };
+ in S var;
+ void main()
+ {
+ ${FRAG_COLOR} = vec4(var.a);
+ if (false)
+ ${FRAG_COLOR}.yzw = var.b;
+ }
+ ""
+ end
+
+ # mismatched type, varyings unused in both (runtime)
+ case struct_type_mismatch_3
+ version 300 es
+ desc "struct member mismatch"
+ expect link_fail
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct S { highp float a; highp vec2 b; };
+ out S var;
+ void main()
+ {
+ var.a = 2.0;
+ if (false)
+ var.b = vec2(1.0, 0.0);
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ struct S { highp float a; highp vec3 b; };
+ in S var;
+ void main()
+ {
+ ${FRAG_COLOR} = vec4(var.a);
+ if (false)
+ ${FRAG_COLOR}.yzw = var.b;
+ }
+ ""
+ end
+
+ # interpolation_mismatch
+ case interpolation_mismatch_1
+ version 300 es
+ desc "varying interpolation different (flat vs. smooth)"
+ expect link_fail
+
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ in highp float in0;
+ flat out mediump float var;
+ void main()
+ {
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float var;
+ void main()
+ {
+ ${FRAG_COLOR} = vec4(var);
+ }
+ ""
+ end
+
+ # different interpolation
+ case differing_interpolation_2
+ version 300 es
+ desc "varying interpolation different (smooth vs. centroid)"
+ values
+ {
+ input float in0 = [ -1.25 | -25.0 | 1.0 | 2.25 | 3.4 | 16.0 ];
+ output float out0 = [ -1.25 | -25.0 | 1.0 | 2.25 | 3.4 | 16.0 ];
+ }
+
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ smooth out mediump float var;
+ void main()
+ {
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ centroid in mediump float var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ # no declaration in vertex shader, but static use in fragment
+ case illegal_usage_1
+ version 300 es
+ desc "varying not declared in vertex shader, but statically used in fragment shader"
+ expect link_fail
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float var;
+ void main()
+ {
+ ${FRAG_COLOR} = vec4(var);
+ }
+ ""
+ end
+
+ # non-flat integer varyings not allowed
+ case invalid_type_int
+ version 300 es
+ desc "integer varying used"
+ expect compile_fail
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ out mediump int var;
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ in mediump int var;
+ void main()
+ {
+ ${FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ # non-flat integer varyings not allowed
+ case invalid_type_uint
+ version 300 es
+ desc "integer varying used"
+ expect compile_fail
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ out mediump uint var;
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ in mediump uint var;
+ void main()
+ {
+ ${FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ # bool varyings not allowed
+ case invalid_type_bool
+ version 300 es
+ desc "boolean varying used"
+ expect compile_fail
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ out bool var;
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ in bool var;
+ void main()
+ {
+ ${FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case invalid_type_struct_array
+ version 300 es
+ desc "float array inside struct"
+ expect compile_fail
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct S { mediump float a[3]; };
+ out S var;
+ void main()
+ {
+ var.a[0] = 1.0;
+ var.a[1] = 1.0;
+ var.a[2] = 1.0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ struct S { mediump float a[3]; };
+ in S var;
+ void main()
+ {
+ ${FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case invalid_type_struct_struct
+ version 300 es
+ desc "struct inside struct"
+ expect compile_fail
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct S { mediump float a; };
+ struct T { S s; };
+ out T var;
+ void main()
+ {
+ var.s.a = 1.0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ struct S { mediump float a; };
+ struct T { S s; };
+ in T var;
+ void main()
+ {
+ ${FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case invalid_type_array_struct
+ version 300 es
+ desc "array of structs"
+ expect compile_fail
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct S { mediump int a; };
+ flat out S var[2];
+ void main()
+ {
+ ${VERTEX_SETUP}
+ var[0].a = 1;
+ var[1].a = 1;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ struct S { mediump int a; };
+ flat in S var[2];
+ void main()
+ {
+ ${FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case invalid_type_array_array
+ version 300 es
+ desc "array of arrays"
+ expect compile_fail
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ out mediump float var[2][2];
+ void main()
+ {
+ ${VERTEX_SETUP}
+ var[0][0] = 1.0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float var[2][2];
+ void main()
+ {
+ ${FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+ end
+
+ group basic_types "Basic varying types"
+ case float
+ version 300 es
+ desc "varying of type float"
+ values
+ {
+ input float in0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ];
+ output float out0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ out mediump float var;
+ void main()
+ {
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ in float var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case vec2
+ version 300 es
+ desc "varying of type vec2"
+ values
+ {
+ input vec2 in0 = [ vec2(-1.25, 1.25) | vec2(-25.65, -7.25) | vec2(0.0, 1.0) | vec2(2.25, 2.25) | vec2(3.4, 9.5) | vec2(16.0, 32.0) ];
+ output vec2 out0 = [ vec2(-1.25, 1.25) | vec2(-25.65, -7.25) | vec2(0.0, 1.0) | vec2(2.25, 2.25) | vec2(3.4, 9.5) | vec2(16.0, 32.0) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ out mediump vec2 var;
+ void main()
+ {
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ in vec2 var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case vec3
+ version 300 es
+ desc "varying of type vec3"
+ values
+ {
+ input vec3 in0 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ];
+ output vec3 out0 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ out mediump vec3 var;
+ void main()
+ {
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ in vec3 var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case vec4
+ version 300 es
+ desc "varying of type vec4"
+ values
+ {
+ input vec4 in0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ];
+ output vec4 out0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ out mediump vec4 var;
+ void main()
+ {
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ in vec4 var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case mat2
+ version 300 es
+ desc "varying of type mat2"
+ values
+ {
+ input mat2 in0 = [ mat2(1.0, 1.0, 1.0, 1.0) | mat2(-1.25, 1.25, -9.5, -12.2) | mat2(-25.65, -7.25, 14.21, -77.7) | mat2(0.0, 1.0, -1.0, 2.0) | mat2(2.25, 2.25, 22.5, 225.0) | mat2(3.4, 9.5, 19.5, 29.5) | mat2(16.0, 32.0, -64.0, -128.0) ];
+ output mat2 out0 = [ mat2(1.0, 1.0, 1.0, 1.0) | mat2(-1.25, 1.25, -9.5, -12.2) | mat2(-25.65, -7.25, 14.21, -77.7) | mat2(0.0, 1.0, -1.0, 2.0) | mat2(2.25, 2.25, 22.5, 225.0) | mat2(3.4, 9.5, 19.5, 29.5) | mat2(16.0, 32.0, -64.0, -128.0) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ out mediump mat2 var;
+ void main()
+ {
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ in mat2 var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x3
+ version 300 es
+ desc "varying of type mat2x3"
+ values
+ {
+ input mat2x3 in0 = [ mat2x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ];
+ output mat2x3 out0 = [ mat2x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ out mediump mat2x3 var;
+ void main()
+ {
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ in mat2x3 var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x4
+ version 300 es
+ desc "varying of type mat2x4"
+ values
+ {
+ input mat2x4 in0 = [ mat2x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ];
+ output mat2x4 out0 = [ mat2x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ out mediump mat2x4 var;
+ void main()
+ {
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ in mat2x4 var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x2
+ version 300 es
+ desc "varying of type mat3x2"
+ values
+ {
+ input mat3x2 in0 = [ mat3x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ];
+ output mat3x2 out0 = [ mat3x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ out mediump mat3x2 var;
+ void main()
+ {
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ in mat3x2 var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case mat3
+ version 300 es
+ desc "varying of type mat3"
+ values
+ {
+ input mat3 in0 = [ mat3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 9.9) | mat3(0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0, -9.9) | mat3(3.4, 9.5, 19.5, 29.5, 16.0, 32.0, -64.0, -128.0, 256.0) ];
+ output mat3 out0 = [ mat3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 9.9) | mat3(0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0, -9.9) | mat3(3.4, 9.5, 19.5, 29.5, 16.0, 32.0, -64.0, -128.0, 256.0) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ out mediump mat3 var;
+ void main()
+ {
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ in mat3 var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x4
+ version 300 es
+ desc "varying of type mat3x4"
+ values
+ {
+ input mat3x4 in0 = [ mat3x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ];
+ output mat3x4 out0 = [ mat3x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ out mediump mat3x4 var;
+ void main()
+ {
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ in mat3x4 var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x2
+ version 300 es
+ desc "varying of type mat4x2"
+ values
+ {
+ input mat4x2 in0 = [ mat4x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ];
+ output mat4x2 out0 = [ mat4x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ out mediump mat4x2 var;
+ void main()
+ {
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ in mat4x2 var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x3
+ version 300 es
+ desc "varying of type mat4x3"
+ values
+ {
+ input mat4x3 in0 = [ mat4x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ];
+ output mat4x3 out0 = [ mat4x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ out mediump mat4x3 var;
+ void main()
+ {
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ in mat4x3 var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case mat4
+ version 300 es
+ desc "varying of type mat4"
+ values
+ {
+ input mat4 in0 = [ mat4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0) ];
+ output mat4 out0 = [ mat4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ out mediump mat4 var;
+ void main()
+ {
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ in mat4 var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case int
+ version 300 es
+ desc "varying of type int"
+ values
+ {
+ input int in0 = [ -1 | -25 | 1 | 2 | 3 | 16 ];
+ output int out0 = [ -1 | -25 | 1 | 2 | 3 | 16 ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ flat out mediump int var;
+ void main()
+ {
+ ${VERTEX_SETUP}
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ flat in int var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2
+ version 300 es
+ desc "varying of type ivec2"
+ values
+ {
+ input ivec2 in0 = [ ivec2(-1, 1) | ivec2(-25, 25) | ivec2(1, 1) | ivec2(2, 3) | ivec2(16, 17) ];
+ output ivec2 out0 = [ ivec2(-1, 1) | ivec2(-25, 25) | ivec2(1, 1) | ivec2(2, 3) | ivec2(16, 17) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ flat out mediump ivec2 var;
+ void main()
+ {
+ ${VERTEX_SETUP}
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ flat in ivec2 var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3
+ version 300 es
+ desc "varying of type ivec3"
+ values
+ {
+ input ivec3 in0 = [ ivec3(-1, 1, -2) | ivec3(-25, 25, -3) | ivec3(1, 1, 1) | ivec3(2, 3, 4) | ivec3(16, 17, 18) ];
+ output ivec3 out0 = [ ivec3(-1, 1, -2) | ivec3(-25, 25, -3) | ivec3(1, 1, 1) | ivec3(2, 3, 4) | ivec3(16, 17, 18) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ flat out mediump ivec3 var;
+ void main()
+ {
+ ${VERTEX_SETUP}
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ flat in ivec3 var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4
+ version 300 es
+ desc "varying of type ivec4"
+ values
+ {
+ input ivec4 in0 = [ ivec4(-1, 1, -2, 2) | ivec4(-25, 25, -3, 3) | ivec4(1, 1, 1, 1) | ivec4(2, 3, 4, 5) | ivec4(16, 17, 18, 19) ];
+ output ivec4 out0 = [ ivec4(-1, 1, -2, 2) | ivec4(-25, 25, -3, 3) | ivec4(1, 1, 1, 1) | ivec4(2, 3, 4, 5) | ivec4(16, 17, 18, 19) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ flat out mediump ivec4 var;
+ void main()
+ {
+ ${VERTEX_SETUP}
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ flat in ivec4 var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case uint
+ version 300 es
+ desc "varying of type int"
+ values
+ {
+ input uint in0 = [ 1 | 2 | 3 | 16 ];
+ output uint out0 = [ 1 | 2 | 3 | 16 ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ flat out mediump uint var;
+ void main()
+ {
+ ${VERTEX_SETUP}
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ flat in uint var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2
+ version 300 es
+ desc "varying of type uvec2"
+ values
+ {
+ input uvec2 in0 = [ uvec2(1, 1) | uvec2(25, 25) | uvec2(1, 1) | uvec2(2, 3) | uvec2(16, 17) ];
+ output uvec2 out0 = [ uvec2(1, 1) | uvec2(25, 25) | uvec2(1, 1) | uvec2(2, 3) | uvec2(16, 17) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ flat out mediump uvec2 var;
+ void main()
+ {
+ ${VERTEX_SETUP}
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ flat in uvec2 var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3
+ version 300 es
+ desc "varying of type uvec3"
+ values
+ {
+ input uvec3 in0 = [ uvec3(1, 1, 2) | uvec3(25, 25, 3) | uvec3(1, 1, 1) | uvec3(2, 3, 4) | uvec3(16, 17, 18) ];
+ output uvec3 out0 = [ uvec3(1, 1, 2) | uvec3(25, 25, 3) | uvec3(1, 1, 1) | uvec3(2, 3, 4) | uvec3(16, 17, 18) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ flat out mediump uvec3 var;
+ void main()
+ {
+ ${VERTEX_SETUP}
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ flat in uvec3 var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4
+ version 300 es
+ desc "varying of type uvec4"
+ values
+ {
+ input uvec4 in0 = [ uvec4(1, 1, 2, 2) | uvec4(25, 25, 3, 3) | uvec4(1, 1, 1, 1) | uvec4(2, 3, 4, 5) | uvec4(16, 17, 18, 19) ];
+ output uvec4 out0 = [ uvec4(1, 1, 2, 2) | uvec4(25, 25, 3, 3) | uvec4(1, 1, 1, 1) | uvec4(2, 3, 4, 5) | uvec4(16, 17, 18, 19) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ flat out mediump uvec4 var;
+ void main()
+ {
+ ${VERTEX_SETUP}
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ flat in uvec4 var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+ end
+
+ group struct "Structure varyings"
+ case float
+ version 300 es
+ desc "varying of type float inside struct"
+ values
+ {
+ input float in0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ];
+ output float out0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct S { mediump float a; };
+ out S var;
+ void main()
+ {
+ var.a = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ struct S { mediump float a; };
+ in S var;
+ void main()
+ {
+ out0 = var.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case vec2
+ version 300 es
+ desc "varying of type vec2 inside struct"
+ values
+ {
+ input vec2 in0 = [ vec2(-1.25, 1.25) | vec2(-25.65, -7.25) | vec2(0.0, 1.0) | vec2(2.25, 2.25) | vec2(3.4, 9.5) | vec2(16.0, 32.0) ];
+ output vec2 out0 = [ vec2(-1.25, 1.25) | vec2(-25.65, -7.25) | vec2(0.0, 1.0) | vec2(2.25, 2.25) | vec2(3.4, 9.5) | vec2(16.0, 32.0) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct S { mediump vec2 a; };
+ out S var;
+ void main()
+ {
+ var.a = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ struct S { mediump vec2 a; };
+ in S var;
+ void main()
+ {
+ out0 = var.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case vec3
+ version 300 es
+ desc "varying of type vec3 inside struct"
+ values
+ {
+ input vec3 in0 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ];
+ output vec3 out0 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct S { mediump vec3 a; };
+ out S var;
+ void main()
+ {
+ var.a = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ struct S { mediump vec3 a; };
+ in S var;
+ void main()
+ {
+ out0 = var.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case vec4
+ version 300 es
+ desc "varying of type vec4 inside struct"
+ values
+ {
+ input vec4 in0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ];
+ output vec4 out0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct S { mediump vec4 a; };
+ out S var;
+ void main()
+ {
+ var.a = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ struct S { mediump vec4 a; };
+ in S var;
+ void main()
+ {
+ out0 = var.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case mat2
+ version 300 es
+ desc "varying of type mat2 inside struct"
+ values
+ {
+ input mat2 in0 = [ mat2(1.0, 1.0, 1.0, 1.0) | mat2(-1.25, 1.25, -9.5, -12.2) | mat2(-25.65, -7.25, 14.21, -77.7) | mat2(0.0, 1.0, -1.0, 2.0) | mat2(2.25, 2.25, 22.5, 225.0) | mat2(3.4, 9.5, 19.5, 29.5) | mat2(16.0, 32.0, -64.0, -128.0) ];
+ output mat2 out0 = [ mat2(1.0, 1.0, 1.0, 1.0) | mat2(-1.25, 1.25, -9.5, -12.2) | mat2(-25.65, -7.25, 14.21, -77.7) | mat2(0.0, 1.0, -1.0, 2.0) | mat2(2.25, 2.25, 22.5, 225.0) | mat2(3.4, 9.5, 19.5, 29.5) | mat2(16.0, 32.0, -64.0, -128.0) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct S { mediump mat2 a; };
+ out S var;
+ void main()
+ {
+ var.a = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ struct S { mediump mat2 a; };
+ in S var;
+ void main()
+ {
+ out0 = var.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x3
+ version 300 es
+ desc "varying of type mat2x3 inside struct"
+ values
+ {
+ input mat2x3 in0 = [ mat2x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ];
+ output mat2x3 out0 = [ mat2x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct S { mediump mat2x3 a; };
+ out S var;
+ void main()
+ {
+ var.a = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ struct S { mediump mat2x3 a; };
+ in S var;
+ void main()
+ {
+ out0 = var.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case mat2x4
+ version 300 es
+ desc "varying of type mat2x4 inside struct"
+ values
+ {
+ input mat2x4 in0 = [ mat2x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ];
+ output mat2x4 out0 = [ mat2x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct S { mediump mat2x4 a; };
+ out S var;
+ void main()
+ {
+ var.a = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ struct S { mediump mat2x4 a; };
+ in S var;
+ void main()
+ {
+ out0 = var.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x2
+ version 300 es
+ desc "varying of type mat3x2 inside struct"
+ values
+ {
+ input mat3x2 in0 = [ mat3x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ];
+ output mat3x2 out0 = [ mat3x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct S { mediump mat3x2 a; };
+ out S var;
+ void main()
+ {
+ var.a = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ struct S { mediump mat3x2 a; };
+ in S var;
+ void main()
+ {
+ out0 = var.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case mat3
+ version 300 es
+ desc "varying of type mat3 inside struct"
+ values
+ {
+ input mat3 in0 = [ mat3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 9.9) | mat3(0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0, -9.9) | mat3(3.4, 9.5, 19.5, 29.5, 16.0, 32.0, -64.0, -128.0, 256.0) ];
+ output mat3 out0 = [ mat3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 9.9) | mat3(0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0, -9.9) | mat3(3.4, 9.5, 19.5, 29.5, 16.0, 32.0, -64.0, -128.0, 256.0) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct S { mediump mat3 a; };
+ out S var;
+ void main()
+ {
+ var.a = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ struct S { mediump mat3 a; };
+ in S var;
+ void main()
+ {
+ out0 = var.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case mat3x4
+ version 300 es
+ desc "varying of type mat3x4 inside struct"
+ values
+ {
+ input mat3x4 in0 = [ mat3x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ];
+ output mat3x4 out0 = [ mat3x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct S { mediump mat3x4 a; };
+ out S var;
+ void main()
+ {
+ var.a = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ struct S { mediump mat3x4 a; };
+ in S var;
+ void main()
+ {
+ out0 = var.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x2
+ version 300 es
+ desc "varying of type mat4x2 inside struct"
+ values
+ {
+ input mat4x2 in0 = [ mat4x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ];
+ output mat4x2 out0 = [ mat4x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct S { mediump mat4x2 a; };
+ out S var;
+ void main()
+ {
+ var.a = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ struct S { mediump mat4x2 a; };
+ in S var;
+ void main()
+ {
+ out0 = var.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case mat4x3
+ version 300 es
+ desc "varying of type mat4x3 inside struct"
+ values
+ {
+ input mat4x3 in0 = [ mat4x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ];
+ output mat4x3 out0 = [ mat4x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct S { mediump mat4x3 a; };
+ out S var;
+ void main()
+ {
+ var.a = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ struct S { mediump mat4x3 a; };
+ in S var;
+ void main()
+ {
+ out0 = var.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case mat4
+ version 300 es
+ desc "varying of type mat4 inside struct"
+ values
+ {
+ input mat4 in0 = [ mat4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0) ];
+ output mat4 out0 = [ mat4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct S { mediump mat4 a; };
+ out S var;
+ void main()
+ {
+ var.a = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ struct S { mediump mat4 a; };
+ in S var;
+ void main()
+ {
+ out0 = var.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case int
+ version 300 es
+ desc "varying of type int inside struct"
+ values
+ {
+ input int in0 = [ -1 | -25 | 1 | 2 | 3 | 16 ];
+ output int out0 = [ -1 | -25 | 1 | 2 | 3 | 16 ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct S { mediump int a; };
+ flat out S var;
+ void main()
+ {
+ ${VERTEX_SETUP}
+ var.a = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ struct S { mediump int a; };
+ flat in S var;
+ void main()
+ {
+ out0 = var.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case ivec2
+ version 300 es
+ desc "varying of type ivec2 inside struct"
+ values
+ {
+ input ivec2 in0 = [ ivec2(-1, 1) | ivec2(-25, 25) | ivec2(1, 1) | ivec2(2, 3) | ivec2(16, 17) ];
+ output ivec2 out0 = [ ivec2(-1, 1) | ivec2(-25, 25) | ivec2(1, 1) | ivec2(2, 3) | ivec2(16, 17) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct S { mediump ivec2 a; };
+ flat out S var;
+ void main()
+ {
+ ${VERTEX_SETUP}
+ var.a = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ struct S { mediump ivec2 a; };
+ flat in S var;
+ void main()
+ {
+ out0 = var.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case ivec3
+ version 300 es
+ desc "varying of type ivec3 inside struct"
+ values
+ {
+ input ivec3 in0 = [ ivec3(-1, 1, -2) | ivec3(-25, 25, -3) | ivec3(1, 1, 1) | ivec3(2, 3, 4) | ivec3(16, 17, 18) ];
+ output ivec3 out0 = [ ivec3(-1, 1, -2) | ivec3(-25, 25, -3) | ivec3(1, 1, 1) | ivec3(2, 3, 4) | ivec3(16, 17, 18) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct S { mediump ivec3 a; };
+ flat out S var;
+ void main()
+ {
+ ${VERTEX_SETUP}
+ var.a = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ struct S { mediump ivec3 a; };
+ flat in S var;
+ void main()
+ {
+ out0 = var.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case ivec4
+ version 300 es
+ desc "varying of type ivec4 inside struct"
+ values
+ {
+ input ivec4 in0 = [ ivec4(-1, 1, -2, 2) | ivec4(-25, 25, -3, 3) | ivec4(1, 1, 1, 1) | ivec4(2, 3, 4, 5) | ivec4(16, 17, 18, 19) ];
+ output ivec4 out0 = [ ivec4(-1, 1, -2, 2) | ivec4(-25, 25, -3, 3) | ivec4(1, 1, 1, 1) | ivec4(2, 3, 4, 5) | ivec4(16, 17, 18, 19) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct S { mediump ivec4 a; };
+ flat out S var;
+ void main()
+ {
+ ${VERTEX_SETUP}
+ var.a = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ struct S { mediump ivec4 a; };
+ flat in S var;
+ void main()
+ {
+ out0 = var.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case uint
+ version 300 es
+ desc "varying of type uint in struct"
+ values
+ {
+ input uint in0 = [ 1 | 2 | 3 | 16 ];
+ output uint out0 = [ 1 | 2 | 3 | 16 ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct S { mediump uint a; };
+ flat out S var;
+ void main()
+ {
+ ${VERTEX_SETUP}
+ var.a = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ struct S { mediump uint a; };
+ flat in S var;
+ void main()
+ {
+ out0 = var.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case uvec2
+ version 300 es
+ desc "varying of type uvec2 inside struct"
+ values
+ {
+ input uvec2 in0 = [ uvec2(1, 1) | uvec2(25, 25) | uvec2(1, 1) | uvec2(2, 3) | uvec2(16, 17) ];
+ output uvec2 out0 = [ uvec2(1, 1) | uvec2(25, 25) | uvec2(1, 1) | uvec2(2, 3) | uvec2(16, 17) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct S { mediump uvec2 a; };
+ flat out S var;
+ void main()
+ {
+ ${VERTEX_SETUP}
+ var.a = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ struct S { mediump uvec2 a; };
+ flat in S var;
+ void main()
+ {
+ out0 = var.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case uvec3
+ version 300 es
+ desc "varying of type uvec3 inside struct"
+ values
+ {
+ input uvec3 in0 = [ uvec3(1, 1, 2) | uvec3(25, 25, 3) | uvec3(1, 1, 1) | uvec3(2, 3, 4) | uvec3(16, 17, 18) ];
+ output uvec3 out0 = [ uvec3(1, 1, 2) | uvec3(25, 25, 3) | uvec3(1, 1, 1) | uvec3(2, 3, 4) | uvec3(16, 17, 18) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct S { mediump uvec3 a; };
+ flat out S var;
+ void main()
+ {
+ ${VERTEX_SETUP}
+ var.a = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ struct S { mediump uvec3 a; };
+ flat in S var;
+ void main()
+ {
+ out0 = var.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case uvec4
+ version 300 es
+ desc "varying of type uvec4 inside struct"
+ values
+ {
+ input uvec4 in0 = [ uvec4(1, 1, 2, 2) | uvec4(25, 25, 3, 3) | uvec4(1, 1, 1, 1) | uvec4(2, 3, 4, 5) | uvec4(16, 17, 18, 19) ];
+ output uvec4 out0 = [ uvec4(1, 1, 2, 2) | uvec4(25, 25, 3, 3) | uvec4(1, 1, 1, 1) | uvec4(2, 3, 4, 5) | uvec4(16, 17, 18, 19) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct S { mediump uvec4 a; };
+ flat out S var;
+ void main()
+ {
+ ${VERTEX_SETUP}
+ var.a = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ struct S { mediump uvec4 a; };
+ flat in S var;
+ void main()
+ {
+ out0 = var.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case float_vec3
+ version 300 es
+ desc "varyings of type float and vec3 inside struct"
+ values
+ {
+ input float in0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ];
+ output float out0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ];
+ input vec3 in1 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ];
+ output vec3 out1 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct S { mediump float a; highp vec3 b; };
+ out S var;
+ void main()
+ {
+ var.a = in0;
+ var.b = in1;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ struct S { mediump float a; highp vec3 b; };
+ in S var;
+ void main()
+ {
+ out0 = var.a;
+ out1 = var.b;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case float_uvec2_vec3
+ version 300 es
+ desc "varyings of type float and vec3 inside struct"
+ values
+ {
+ input float in0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ];
+ output float out0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ];
+ input uvec2 in1 = [ uvec2(1, 1) | uvec2(25, 25) | uvec2(1, 1) | uvec2(2, 3) | uvec2(16, 17) | uvec2(8, 7) ];
+ output uvec2 out1 = [ uvec2(1, 1) | uvec2(25, 25) | uvec2(1, 1) | uvec2(2, 3) | uvec2(16, 17) | uvec2(8, 7) ];
+ input vec3 in2 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ];
+ output vec3 out2 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct S { mediump float a; highp uvec2 b; highp vec3 c; };
+ flat out S var;
+ void main()
+ {
+ ${VERTEX_SETUP}
+ var.a = in0;
+ var.b = in1;
+ var.c = in2;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ struct S { mediump float a; highp uvec2 b; highp vec3 c; };
+ flat in S var;
+ void main()
+ {
+ out0 = var.a;
+ out1 = var.b;
+ out2 = var.c;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+ end
+
+ group interpolation "Varying interpolation modes"
+ case smooth
+ version 300 es
+ desc "varying of type vec4"
+ values
+ {
+ input vec4 in0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ];
+ output vec4 out0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ smooth out mediump vec4 var;
+ void main()
+ {
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ smooth in vec4 var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case centroid
+ version 300 es
+ desc "varying of type vec4"
+ values
+ {
+ input vec4 in0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ];
+ output vec4 out0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ centroid out mediump vec4 var;
+ void main()
+ {
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ centroid in vec4 var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case flat
+ version 300 es
+ desc "varying of type vec4"
+ values
+ {
+ input vec4 in0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ];
+ output vec4 out0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ];
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ flat out mediump vec4 var;
+ void main()
+ {
+ var = in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ flat in vec4 var;
+ void main()
+ {
+ out0 = var;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+ end
+
+ group usage "Varying usage in shaders"
+ case readback_1
+ version 300 es
+ desc "read back (an already written) varying in the vertex shader"
+ values
+ {
+ input float in0 = [ 1.0 | 0.0 | -2.0 | 10.0 ];
+ output float out0 = [ 3.0 | 0.0 | -6.0 | 30.0 ];
+ }
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ ${VERTEX_DECLARATIONS}
+ out float var1;
+ out float var2;
+
+ void main()
+ {
+ var1 = in0;
+ var2 = var1 + in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ in float var1;
+ in float var2;
+
+ void main()
+ {
+ out0 = var1 + var2;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case writeback_1
+ version 300 es
+ desc "write back a varying in the fragment shader"
+ values
+ {
+ input float in0 = [ 1.0 | 0.0 | -2.0 | 10.0 ];
+ }
+ expect compile_fail
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ ${VERTEX_DECLARATIONS}
+ out float var1;
+ out float var2;
+
+ void main()
+ {
+ var1 = in0;
+ var2 = var1 + in0;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ in float var1;
+ in float var2;
+
+ void main()
+ {
+ var2 = var1;
+ out0 = var1;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+ end
+end
+
+group uniform "Uniform linkage"
+ group basic "Default block uniforms of scalar and vector types"
+ case precision_conflict_1
+ version 300 es
+ desc "Vertex side uniform has highp, fragment side uniform mediump."
+ expect link_fail
+ values {output float out0 = 3.0;}
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ uniform highp float u_val;
+ out mediump float res;
+ void main()
+ {
+ res = u_val;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ uniform float u_val;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ {
+ out0 = u_val + res;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+ case precision_conflict_2
+ version 300 es
+ desc "Vertex side uniform has highp, fragment side uniform mediump."
+ expect link_fail
+ values {output float out0 = 3.0;}
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ uniform highp float u_val;
+ out mediump float res;
+ void main()
+ {
+ res = u_val;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision highp float;
+ uniform mediump float u_val;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ {
+ out0 = u_val + res;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+ case precision_conflict_3
+ version 300 es
+ desc "Vertex side uniform has lowp, fragment side uniform highp."
+ expect link_fail
+ values {output float out0 = 3.0;}
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ uniform lowp int u_val;
+ out mediump float res;
+ void main()
+ {
+ res = float(u_val);
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision highp float;
+ uniform highp int u_val;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ {
+ out0 = float(u_val) + res;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+ case precision_conflict_4
+ version 300 es
+ desc "Vertex side uniform has lowp, fragment side uniform mediump."
+ expect link_fail
+ values {output float out0 = 3.0;}
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ uniform lowp vec3 u_val;
+ out mediump float res;
+ void main()
+ {
+ res = u_val.y;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision highp float;
+ uniform mediump vec3 u_val;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ {
+ out0 = u_val.z + res;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+ end
+
+ group struct "Uniform structs"
+ # Struct linkage handling
+ case basic
+ version 300 es
+ desc "Same uniform struct in both shaders"
+ values {
+ uniform float val.a = 1.0;
+ uniform float val.b = 2.0;
+ output float out0 = 3.0;
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump float a; mediump float b;};
+ uniform Struct val;
+ out mediump float dummy;
+ void main()
+ {
+ dummy = val.a + val.b;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Struct {mediump float a; mediump float b;};
+ uniform Struct val;
+ in mediump float dummy;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ out0 = val.b + val.a;
+ out0 = out0 + dummy;
+ out0 = out0 - dummy;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case vertex_only
+ version 300 es
+ desc "Uniform struct declared in both, used only in vertex."
+ values {
+ uniform float val.a = 1.0;
+ uniform float val.b = 2.0;
+ output float out0 = 3.0;
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump float a; mediump float b;};
+ uniform Struct val;
+ out mediump float res;
+ void main()
+ {
+ res = val.a + val.b;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Struct {mediump float a; mediump float b;};
+ uniform Struct val;
+ in mediump float res;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ out0 = res;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case fragment_only
+ version 300 es
+ desc "Uniform struct declared in both, used only in fragment."
+ values {
+ uniform float val.a = 1.0;
+ uniform float val.b = 2.0;
+ output float out0 = 3.0;
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump float a; mediump float b;};
+ uniform Struct val;
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Struct {mediump float a; mediump float b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ out0 = val.a + val.b;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case partial
+ version 300 es
+ desc "Uniform struct declared in both, used partially in both."
+ values {
+ uniform float val.a = 1.0;
+ uniform float val.b = 2.0;
+ output float out0 = 3.0;
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump float a; mediump float b;};
+ uniform Struct val;
+ out mediump float res;
+ void main()
+ {
+ res = val.a;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Struct {mediump float a; mediump float b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ {
+ out0 = res + val.b;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case vec4
+ version 300 es
+ desc "Same uniform struct in both shaders. Datatype vec4"
+ values {
+ uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0);
+ uniform vec4 val.b = vec4(1.0, 2.0, 3.0, 4.0);
+ output float out0 = 3.0;
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec4 a; mediump vec4 b;};
+ uniform Struct val;
+ out mediump float dummy;
+ void main()
+ {
+ dummy = val.a.x + val.b.y;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Struct {mediump vec4 a; mediump vec4 b;};
+ uniform Struct val;
+ in mediump float dummy;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ out0 = val.b.y + val.a.x;
+ out0 = out0 + dummy;
+ out0 = out0 - dummy;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case vertex_only_vec4
+ version 300 es
+ desc "Uniform struct declared in both, used only in vertex. Datatype vec4 "
+ values {
+ uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0);
+ uniform vec4 val.b = vec4(1.0, 2.0, 3.0, 4.0);
+ output float out0 = 3.0;
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec4 a; mediump vec4 b;};
+ uniform Struct val;
+ out mediump float res;
+ void main()
+ {
+ res = val.a.x + val.b.y;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Struct {mediump vec4 a; mediump vec4 b;};
+ uniform Struct val;
+ in mediump float res;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ { out0 = res;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case fragment_only_vec4
+ version 300 es
+ desc "Uniform struct declared in both, used only in fragment. Datatype vec4"
+ values {
+ uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0);
+ uniform vec4 val.b = vec4(1.0, 2.0, 3.0, 4.0);
+ output float out0 = 3.0;
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec4 a; mediump vec4 b;};
+ uniform Struct val;
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Struct {mediump vec4 a; mediump vec4 b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ { out0 = val.a.x + val.b.y;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case partial_vec4
+ version 300 es
+ desc "Uniform struct declared in both, used partially in both. Datatype vec4"
+ values {
+ uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0);
+ uniform vec4 val.b = vec4(1.0, 2.0, 3.0, 4.0);
+ output float out0 = 3.0;
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec4 a; mediump vec4 b;};
+ uniform Struct val;
+ out mediump float res;
+ void main()
+ {
+ res = val.a.x;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Struct {mediump vec4 a; mediump vec4 b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ { out0 = res + val.b.y;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_vec3
+ version 300 es
+ desc "Same uniform struct in both shaders. Datatype vec4 and vec3"
+ values {
+ uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0);
+ uniform vec3 val.b = vec3(1.0, 2.0, 3.0);
+ output float out0 = 3.0;
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec4 a; mediump vec3 b;};
+ uniform Struct val;
+ out mediump float dummy;
+ void main()
+ {
+ dummy = val.a.x + val.b.y;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Struct {mediump vec4 a; mediump vec3 b;};
+ uniform Struct val;
+ in mediump float dummy;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ { out0 = val.b.y + val.a.x;
+ out0 = out0 + dummy;
+ out0 = out0 - dummy;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case vertex_only_vec4_vec3
+ version 300 es
+ desc "Uniform struct declared in both, used only in vertex. Datatype vec4 and vec3"
+ values {
+ uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0);
+ uniform vec3 val.b = vec3(1.0, 2.0, 3.0);
+ output float out0 = 3.0;
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec4 a; mediump vec3 b;};
+ uniform Struct val;
+ out mediump float res;
+ void main()
+ {
+ res = val.a.x + val.b.y;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Struct {mediump vec4 a; mediump vec3 b;};
+ uniform Struct val;
+ in mediump float res;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ { out0 = res;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case fragment_only_vec4_vec3
+ version 300 es
+ desc "Uniform struct declared in both, used only in fragment. Datatype vec4 and vec3"
+ values {
+ uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0);
+ uniform vec3 val.b = vec3(1.0, 2.0, 3.0);
+ output float out0 = 3.0;
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec4 a; mediump vec3 b;};
+ uniform Struct val;
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Struct {mediump vec4 a; mediump vec3 b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ { out0 = val.a.x + val.b.y;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case partial_vec4_vec3
+ version 300 es
+ desc "Uniform struct declared in both, used partially in both. Datatype vec4 and vec3"
+ values {
+ uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0);
+ uniform vec3 val.b = vec3(1.0, 2.0, 3.0);
+ output float out0 = 3.0;
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec4 a; mediump vec3 b;};
+ uniform Struct val;
+ out mediump float res;
+ void main()
+ {
+ res = val.a.x;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Struct {mediump vec4 a; mediump vec3 b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ { out0 = res + val.b.y;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case vec4_float
+ version 300 es
+ desc "Same uniform struct in both shaders. Datatype vec4 and float"
+ values {
+ uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0);
+ uniform float val.b = 2.0;
+ output float out0 = 3.0;
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec4 a; mediump float b;};
+ uniform Struct val;
+ out mediump float dummy;
+ void main()
+ {
+ dummy = val.a.x + val.b;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Struct {mediump vec4 a; mediump float b;};
+ uniform Struct val;
+ in mediump float dummy;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ { out0 = val.b + val.a.x;
+ out0 = out0 + dummy;
+ out0 = out0 - dummy;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case vertex_only_vec4_float
+ version 300 es
+ desc "Uniform struct declared in both, used only in vertex. Datatype vec4 and float"
+ values {
+ uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0);
+ uniform float val.b = 2.0;
+ output float out0 = 3.0;
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec4 a; mediump float b;};
+ uniform Struct val;
+ out mediump float res;
+ void main()
+ {
+ res = val.a.x + val.b;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Struct {mediump vec4 a; mediump float b;};
+ uniform Struct val;
+ in mediump float res;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ { out0 = res;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case fragment_only_vec4_float
+ version 300 es
+ desc "Uniform struct declared in both, used only in fragment. Datatype vec4 and float"
+ values {
+ uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0);
+ uniform float val.b = 2.0;
+ output float out0 = 3.0;
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec4 a; mediump float b;};
+ uniform Struct val;
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Struct {mediump vec4 a; mediump float b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ { out0 = val.a.x + val.b;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case partial_vec4_float
+ version 300 es
+ desc "Uniform struct declared in both, used partially in both. Datatype vec4 and float"
+ values {
+ uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0);
+ uniform float val.b = 2.0;
+ output float out0 = 3.0;
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec4 a; mediump float b;};
+ uniform Struct val;
+ out mediump float res;
+ void main()
+ {
+ res = val.a.x;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Struct {mediump vec4 a; mediump float b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ { out0 = res + val.b;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case partial_vec4_struct
+ version 300 es
+ desc "Uniform struct declared in both, used partially in both. Datatype vec4 and struct with vec4"
+ values {
+ uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0);
+ uniform vec4 val.b.c = vec4(1.0, 2.0, 3.0, 4.0);
+ output float out0 = 3.0;
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Inner {mediump vec4 c;};
+ struct Struct {mediump vec4 a; Inner b;};
+ uniform Struct val;
+ out mediump float res;
+ void main()
+ {
+ res = val.a.x;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Inner {mediump vec4 c;};
+ struct Struct {mediump vec4 a; Inner b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ { out0 = res + val.b.c.y;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case partial_vec4_vec3_struct
+ version 300 es
+ desc "Uniform struct declared in both, used partially in both. Datatype vec4 and struct with vec3"
+ values {
+ uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0);
+ uniform vec3 val.b.c = vec3(1.0, 2.0, 3.0);
+ output float out0 = 3.0;
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Inner {mediump vec3 c;};
+ struct Struct {mediump vec4 a; Inner b;};
+ uniform Struct val;
+ out mediump float res;
+ void main()
+ {
+ res = val.a.x;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Inner {mediump vec3 c;};
+ struct Struct {mediump vec4 a; Inner b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ { out0 = res + val.b.c.y;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case partial_vec2_vec3
+ version 300 es
+ desc "Uniform struct declared in both, used partially in both. Datatype vec2 and vec3"
+ values {
+ uniform vec2 val.a = vec2(1.0, 2.0);
+ uniform vec3 val.b = vec3(1.0, 2.0, 3.0);
+ output float out0 = 3.0;
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec2 a; mediump vec3 b;};
+ uniform Struct val;
+ out mediump float res;
+ void main()
+ {
+ res = val.a.x;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Struct {mediump vec2 a; mediump vec3 b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ { out0 = res + val.b.y;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case partial_vec2_int
+ version 300 es
+ desc "Uniform struct declared in both, used partially in both. Datatype vec2 and int"
+ values {
+ uniform vec2 val.a = vec2(1.0, 2.0);
+ uniform int val.b = 2;
+ output float out0 = 3.0;
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec2 a; mediump int b;};
+ uniform Struct val;
+ out mediump float res;
+ void main()
+ {
+ res = val.a.x;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Struct {mediump vec2 a; mediump int b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ { out0 = res + float(val.b);
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case partial_int_float
+ version 300 es
+ desc "Uniform struct declared in both, used partially in both. Datatype int and float"
+ values {
+ uniform float val.a = 1.0;
+ uniform int val.b = 2;
+ output float out0 = 3.0;
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump float a; mediump int b;};
+ uniform Struct val;
+ out mediump float res;
+ void main()
+ {
+ res = val.a;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Struct {mediump float a; mediump int b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ { out0 = res + float(val.b);
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case partial_bvec2_vec2
+ version 300 es
+ desc "Uniform struct declared in both, used partially in both. Datatype bvec2 and vec2"
+ values {
+ uniform bvec2 val.a = bvec2(true, true);
+ uniform vec2 val.b = vec2(1.0, 2.0);
+ output float out0 = 3.0;
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Struct {bvec2 a; mediump vec2 b;};
+ uniform Struct val;
+ out mediump float res;
+ void main()
+ {
+ res = float(val.a.x);
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Struct {bvec2 a; mediump vec2 b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ { out0 = res + val.b.y;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case partial_ivec2_vec2
+ version 300 es
+ desc "Uniform struct declared in both, used partially in both. Datatype ivec2 and vec2"
+ values {
+ uniform ivec2 val.a = ivec2(1, 2);
+ uniform vec2 val.b = vec2(1.0, 2.0);
+ output float out0 = 3.0;
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump ivec2 a; mediump vec2 b;};
+ uniform Struct val;
+ out mediump float res;
+ void main()
+ {
+ res = vec2(val.a).x;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Struct {mediump ivec2 a; mediump vec2 b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ { out0 = res + val.b.y;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case partial_ivec2_ivec2
+ version 300 es
+ desc "Uniform struct declared in both, used partially in both. Datatype ivec2 and ivec2"
+ values {
+ uniform ivec2 val.a = ivec2(1, 2);
+ uniform ivec2 val.b = ivec2(1, 2);
+ output float out0 = 3.0;
+ }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump ivec2 a; mediump ivec2 b;};
+ uniform Struct val;
+ out mediump float res;
+ void main()
+ {
+ res = vec2(val.a).x;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Struct {mediump ivec2 a; mediump ivec2 b;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ { out0 = res + vec2(val.b).y;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case type_conflict_1
+ version 300 es
+ desc "Fragment struct has one less member than fragment version"
+ expect link_fail
+ values {output float out0 = 3.0;}
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump float a; mediump float b;};
+ uniform Struct val;
+ out mediump float res;
+ void main()
+ {
+ res = val.a;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Struct {mediump float a;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ { out0 = res + val.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case type_conflict_2
+ version 300 es
+ desc "Vertex struct has int, fragment struct has float."
+ expect link_fail
+ values {output float out0 = 3.0;}
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump int a;};
+ uniform Struct val;
+ out mediump float res;
+ void main()
+ {
+ res = float(val.a);
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Struct {mediump float a;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ { out0 = val.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case type_conflict_3
+ version 300 es
+ desc "Vertex struct has vec3, fragment struct has vec4."
+ expect link_fail
+ values {output float out0 = 3.0;}
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump vec3 a;};
+ uniform Struct val;
+ out mediump float res;
+ void main()
+ {
+ res = float(val.a.x);
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Struct {mediump vec4 a;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ { out0 = val.a.x;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case precision_conflict_1
+ version 300 es
+ desc "Vertex side struct has highp, fragment side struct mediump."
+ expect link_fail
+ values {output float out0 = 3.0;}
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Struct {highp float a;};
+ uniform Struct val;
+ out mediump float res;
+ void main()
+ {
+ res = val.a;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Struct {mediump float a;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ { out0 = val.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case precision_conflict_2
+ version 300 es
+ desc "Vertex side struct has mediump, fragment side struct lowp."
+ expect link_fail
+ values {output float out0 = 3.0;}
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Struct {mediump float a;};
+ uniform Struct val;
+ out mediump float res;
+ void main()
+ {
+ res = val.a;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Struct {lowp float a;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ { out0 = val.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case precision_conflict_3
+ version 300 es
+ desc "Vertex side struct has lowp, fragment side struct mediump."
+ expect link_fail
+ values {output float out0 = 3.0;}
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Struct {lowp float a;};
+ uniform Struct val;
+ out mediump float res;
+ void main()
+ {
+ res = val.a;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Struct {mediump float a;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ { out0 = val.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case precision_conflict_4
+ version 300 es
+ desc "Vertex side struct has lowp, fragment side struct implicit mediump."
+ expect link_fail
+ values {output float out0 = 3.0;}
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ struct Struct {lowp float a;};
+ uniform Struct val;
+ out mediump float res;
+ void main()
+ {
+ res = val.a;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Struct {float a;};
+ uniform Struct val;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ { out0 = val.a;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case light_struct_highp
+ version 300 es
+ desc "Complex Light struct from use case tests."
+ values {
+ uniform float val.constantAttenuation = 1.0;
+ uniform float val.quadraticAttenuation = 1.0;
+ output float out0 = 2.0;
+ }
+ vertex ""
+ #version 300 es
+ struct Light
+ {
+ mediump vec3 color;
+ highp vec4 position;
+ highp vec3 direction;
+ mediump float constantAttenuation;
+ mediump float linearAttenuation;
+ mediump float quadraticAttenuation;
+ };
+ ${VERTEX_DECLARATIONS}
+ uniform Light val;
+ out mediump float res;
+ void main()
+ {
+ res = val.constantAttenuation;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Light
+ {
+ mediump vec3 color;
+ highp vec4 position;
+ highp vec3 direction;
+ mediump float constantAttenuation;
+ mediump float linearAttenuation;
+ mediump float quadraticAttenuation;
+ };
+ struct Struct {float a;};
+ uniform Light val;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ {
+ out0 = res + val.quadraticAttenuation;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case light_struct_mediump
+ version 300 es
+ desc "Complex Light struct from use case tests, without highp usage"
+ values {
+ uniform float val.constantAttenuation = 1.0;
+ uniform float val.quadraticAttenuation = 1.0;
+ output float out0 = 2.0;
+ }
+ vertex ""
+ #version 300 es
+ struct Light
+ {
+ mediump vec3 color;
+ mediump vec4 position;
+ mediump vec3 direction;
+ mediump float constantAttenuation;
+ mediump float linearAttenuation;
+ mediump float quadraticAttenuation;
+ };
+ ${VERTEX_DECLARATIONS}
+ uniform Light val;
+ out mediump float res;
+ void main()
+ {
+ res = val.constantAttenuation;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ struct Light
+ {
+ mediump vec3 color;
+ mediump vec4 position;
+ mediump vec3 direction;
+ mediump float constantAttenuation;
+ mediump float linearAttenuation;
+ mediump float quadraticAttenuation;
+ };
+ struct Struct {float a;};
+ uniform Light val;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ {
+ out0 = res + val.quadraticAttenuation;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+ end
+
+ group block "Uniform blocks"
+ case type_mismatch
+ version 300 es
+ expect link_fail
+ vertex ""
+ #version 300 es
+
+ uniform Block
+ {
+ highp vec4 val;
+ };
+
+ ${VERTEX_DECLARATIONS}
+ out mediump float res;
+ void main()
+ {
+ res = val.x;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+
+ uniform Block
+ {
+ highp vec3 val;
+ };
+
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ {
+ dEQP_FragColor = vec4(val, 1.0);
+ }
+ ""
+ end
+
+ case members_mismatch
+ version 300 es
+ expect link_fail
+ vertex ""
+ #version 300 es
+
+ uniform Block
+ {
+ highp vec4 val;
+ };
+
+ ${VERTEX_DECLARATIONS}
+ out mediump float res;
+ void main()
+ {
+ res = val.x;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+
+ uniform Block
+ {
+ highp vec4 val;
+ lowp uint u;
+ };
+
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ {
+ dEQP_FragColor = vec4(val);
+ }
+ ""
+ end
+
+ case layout_qualifier_mismatch_2
+ version 300 es
+ expect compile_fail
+ vertex ""
+ #version 300 es
+
+ layout(shared) uniform Block
+ {
+ highp vec4 val;
+ };
+
+ ${VERTEX_DECLARATIONS}
+ out mediump float res;
+ void main()
+ {
+ res = val.x;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+
+ layout(packed) uniform Block
+ {
+ highp vec4 val;
+ };
+
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ {
+ dEQP_FragColor = vec4(val);
+ }
+ ""
+ end
+
+ case layout_qualifier_mismatch_3
+ version 300 es
+ expect link_fail
+ vertex ""
+ #version 300 es
+
+ layout(row_major) uniform Block
+ {
+ highp vec4 val;
+ };
+
+ ${VERTEX_DECLARATIONS}
+ out mediump float res;
+ void main()
+ {
+ res = val.x;
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+
+ layout(column_major) uniform Block
+ {
+ highp vec4 val;
+ };
+
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ {
+ dEQP_FragColor = vec4(val);
+ }
+ ""
+ end
+
+ case layout_qualifier_mismatch_4
+ version 300 es
+ expect link_fail
+ vertex ""
+ #version 300 es
+
+ layout(row_major) uniform Block
+ {
+ highp mat3 val;
+ };
+
+ ${VERTEX_DECLARATIONS}
+ out mediump float res;
+ void main()
+ {
+ res = val[0][1];
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+
+ layout(column_major) uniform Block
+ {
+ highp mat3 val;
+ };
+
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ {
+ dEQP_FragColor = vec4(val[2], 1.0);
+ }
+ ""
+ end
+
+ case layout_qualifier_mismatch_5
+ version 300 es
+ expect link_fail
+ vertex ""
+ #version 300 es
+
+ uniform Block
+ {
+ layout(row_major) uniform highp mat3 val;
+ };
+
+ ${VERTEX_DECLARATIONS}
+ out mediump float res;
+ void main()
+ {
+ res = val[0][1];
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+
+ uniform Block
+ {
+ layout(column_major) uniform highp mat3 val;
+ };
+
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ in mediump float res;
+ void main()
+ {
+ dEQP_FragColor = vec4(val[2], 1.0);
+ }
+ ""
+ end
+ end
+end
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/negative.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/negative.html
new file mode 100644
index 0000000000..89236e542f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/negative.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'negative';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/negative.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/negative.test
new file mode 100644
index 0000000000..c7b86eded4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/negative.test
@@ -0,0 +1,100 @@
+# Generic invalid cases that don't fall into other categories
+
+group c_cast "C-style casts"
+
+ case float_0
+ expect compile_fail
+ version 300 es
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+ void main ()
+ {
+ float a = 0.0;
+ float b = (float)a;
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ }
+ ""
+ end
+
+ case float_1
+ expect compile_fail
+ version 300 es
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+ void main ()
+ {
+ int a = 0;
+ float b = (float)a;
+ ${POSITION_FRAG_COLOR} = vec4(b);
+ }
+ ""
+ end
+
+ case float_2
+ expect compile_fail
+ version 300 es
+ both ""
+ #version 300 es
+ ${DECLARATIONS}
+ void main ()
+ {
+ highp float a = 0.0;
+ mediump float b = (mediump float)a;
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ }
+ ""
+ end
+
+ case int
+ expect compile_fail
+ version 300 es
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+ void main ()
+ {
+ float a = 0.0;
+ int b = (int)a;
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ }
+ ""
+ end
+
+ case uint
+ expect compile_fail
+ version 300 es
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+ void main ()
+ {
+ float a = 0.0;
+ uint b = (uint)a;
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ }
+ ""
+ end
+
+ case bool
+ expect compile_fail
+ version 300 es
+ both ""
+ #version 300 es
+ precision highp float;
+ ${DECLARATIONS}
+ void main ()
+ {
+ int a = 1;
+ bool b = (bool)a;
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ }
+ ""
+ end
+
+end # casts
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/preprocessor.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/preprocessor.html
new file mode 100644
index 0000000000..f472cec46f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/preprocessor.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'preprocessor';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/preprocessor.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/preprocessor.test
new file mode 100644
index 0000000000..ebe3851965
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/preprocessor.test
@@ -0,0 +1,5256 @@
+group basic "Basic Tests"
+
+ case correct_phases
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ #define e +1
+ ${DECLARATIONS}
+ void main()
+ {
+ mediump int n = 1e;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case invalid_identifier
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ #define e +1
+ ${DECLARATIONS}
+ void main()
+ {
+ mediump int 1xyz = 1;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case null_directive
+ version 300 es
+ values { output float out0 = 0.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ #
+ # // comment
+ /*sfd*/ # /* */
+
+ void main()
+ {
+ out0 = 0.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case invalid_directive
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ #defin AAA
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case missing_identifier
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ #define
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case empty_object
+ version 300 es
+ values { output float out0 = -1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ # define VALUE
+
+ void main()
+ {
+ out0 = VALUE - 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case empty_function
+ version 300 es
+ values { output float out0 = -1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ # define VALUE(a)
+
+ void main()
+ {
+ out0 = VALUE(2.0) - 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case empty_directive
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ #
+
+ void main()
+ {
+ out0 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case identifier_with_double_underscore
+ values { output float out0 = 1.0; }
+ version 300 es
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ # define __VALUE__ 1
+
+ void main()
+ {
+ // __VALUE__ not used since it might be set by an "underlying software layer"
+ out0 = float(1.0);
+ ${OUTPUT}
+ }
+ ""
+ end
+end # basic
+
+group definitions "Symbol Definition Tests"
+
+ case define_value_and_function
+ version 300 es
+ values { output float out0 = 6.0; }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS:single-line}
+ # define VALUE (1.5 + 2.5)
+ # define FUNCTION(__LINE__, b) __LINE__+b
+
+ void main()
+ {
+ out0 = FUNCTION(VALUE, ((0.2) + 1.8) );
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case undefine_object_invalid_syntax
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ #define VAL 2.0
+ #undef VAL sdflkjfds
+ #define VAL 1.0
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(VAL);
+ }
+ ""
+ end
+
+ case undefine_invalid_object_1
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ #undef __LINE__
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(__LINE__);
+ }
+ ""
+ end
+
+ case undefine_invalid_object_2
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ #undef __FILE__
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(__FILE__);
+ }
+ ""
+ end
+
+ case undefine_invalid_object_3
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ #undef __VERSION__
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(__VERSION__);
+ }
+ ""
+ end
+
+ case undefine_invalid_object_4
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ #undef GL_ES
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(GL_ES);
+ }
+ ""
+ end
+
+ case undefine_function
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ #define FUNCTION(a,b) a+b
+ #undef FUNCTION
+ #define FUNCTION(a,b) a-b
+ ${DECLARATIONS}
+
+ void main()
+ {
+ out0 = FUNCTION(3.0, 2.0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # definitions
+
+group invalid_definitions "Invalid Definition Tests"
+
+ case define_non_identifier
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ #define 123 321
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case undef_non_identifier_1
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ #undef 123
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case undef_non_identifier_2
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ #undef foo.bar
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+
+end # invalid_definitions
+
+group object_redefinitions "Object Redefinition Tests"
+
+ case invalid_object_ident
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ # define AAA 2.0
+ # define AAAA 2.1
+ # define VALUE (AAA - 1.0)
+ # define VALUE (AAAA - 1.0)
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(VALUE);
+ }
+ ""
+ end
+
+ case invalid_object_whitespace
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ # define AAA 2.0
+ # define VALUE (AAA - 1.0)
+ # define VALUE (AAA- 1.0)
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(VALUE);
+ }
+ ""
+ end
+
+ case invalid_object_op
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ # define AAA 2.0
+ # define VALUE (AAA - 1.0)
+ # define VALUE (AAA + 1.0)
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(VALUE);
+ }
+ ""
+ end
+
+ case invalid_object_floatval_1
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ # define AAA 2.0
+ # define VALUE (AAA - 1.0)
+ # define VALUE (AAA - 1.1)
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(VALUE);
+ }
+ ""
+ end
+
+ case invalid_object_floatval_2
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ # define AAA 2.0
+ # define VALUE (AAA - 1.0)
+ # define VALUE (AAA - 1.0e-1)
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(VALUE);
+ }
+ ""
+ end
+
+ case invalid_object_intval_1
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ # define AAA 2
+ # define VALUE (AAA - 1)
+ # define VALUE (AAA - 2)
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(VALUE);
+ }
+ ""
+ end
+
+ case invalid_object_intval_2
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ # define AAA 2
+ # define VALUE (AAA - 1)
+ # define VALUE (AAA - 0x1)
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(VALUE);
+ }
+ ""
+ end
+
+ case redefine_object_1
+ version 300 es
+ values { output float out0 = 6.0; }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ # define VAL1 1.0
+ #define VAL2 2.0
+
+ #define RES2 (RES1 * VAL2)
+ #define RES1 (VAL2 / VAL1)
+ #define RES2 (RES1 * VAL2)
+ #define VALUE (RES2 + RES1)
+
+ void main()
+ {
+ out0 = VALUE;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case redefine_object_ifdef
+ version 300 es
+ values { output float out0 = 1.0; }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ #define ADEFINE 1
+ #define ADEFINE 1
+
+ #ifdef ADEFINE
+ #define VALUE 1.0
+ #else
+ #define VALUE 0.0
+ #endif
+
+ void main()
+ {
+ out0 = VALUE;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case redefine_object_undef_ifdef
+ version 300 es
+ values { output float out0 = 1.0; }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ #define ADEFINE 1
+ #define ADEFINE 1
+ #undef ADEFINE
+
+ #ifdef ADEFINE
+ #define VALUE 0.0
+ #else
+ #define VALUE 1.0
+ #endif
+
+ void main()
+ {
+ out0 = VALUE;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case redefine_object_ifndef
+ version 300 es
+ values { output float out0 = 1.0; }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ #define ADEFINE 1
+ #define ADEFINE 1
+
+ #ifndef ADEFINE
+ #define VALUE 0.0
+ #else
+ #define VALUE 1.0
+ #endif
+
+ void main()
+ {
+ out0 = VALUE;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case redefine_object_defined_1
+ version 300 es
+ values { output float out0 = 1.0; }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ #define ADEFINE 1
+ #define ADEFINE 1
+
+ #if defined(ADEFINE)
+ #define VALUE 1.0
+ #else
+ #define VALUE 0.0
+ #endif
+
+ void main()
+ {
+ out0 = VALUE;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case redefine_object_defined_2
+ version 300 es
+ values { output float out0 = 1.0; }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ #define ADEFINE 1
+ #define ADEFINE 1
+
+ #if defined ADEFINE
+ #define VALUE 1.0
+ #else
+ #define VALUE 0.0
+ #endif
+
+ void main()
+ {
+ out0 = VALUE;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case redefine_object_comment
+ version 300 es
+ values { output float out0 = 6.0; }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ # define VAL1 1.0
+ #define VAL2 2.0
+
+ #define RES2 /* fdsjklfdsjkl dsfjkhfdsjkh fdsjklhfdsjkh */ (RES1 * VAL2)
+ #define RES1 (VAL2 / VAL1)
+ #define RES2 /* ewrlkjhsadf */ (RES1 * VAL2)
+ #define VALUE (RES2 + RES1)
+
+ void main()
+ {
+ out0 = VALUE;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case redefine_object_multiline_comment
+ version 300 es
+ values { output float out0 = 6.0; }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ # define VAL1 1.0
+ #define VAL2 2.0
+
+ #define RES2 /* fdsjklfdsjkl
+ dsfjkhfdsjkh
+ fdsjklhfdsjkh */ (RES1 * VAL2)
+ #define RES1 (VAL2 / VAL1)
+ #define RES2 /* ewrlkjhsadf */ (RES1 * VAL2)
+ #define VALUE (RES2 + RES1)
+
+ void main()
+ {
+ out0 = VALUE;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # object_redefinitions
+
+group invalid_redefinitions "Invalid Redefinitions Tests"
+
+ case invalid_identifier_2
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ # define GL_VALUE 1.0
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(GL_VALUE);
+ }
+ ""
+ end
+
+end # invalid_redefinitions
+
+group comments "Comment Tests"
+
+ case multiline_comment_define
+ version 300 es
+ values { output float out0 = 4.2; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ #define VALUE /* current
+ value */ 4.2
+
+ void main()
+ {
+ out0 = VALUE;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case nested_comment
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 0.0;
+ /* /* */
+ out0 = 1.0;
+ // */
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case comment_trick_1
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ /*/
+ out0 = 0.0;
+ /*/
+ out0 = 1.0;
+ /**/
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case comment_trick_2
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ /**/
+ out0 = 1.0;
+ /*/
+ out0 = 0.0;
+ /**/
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case invalid_comment
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ /* /* */ */
+ ${POSITION_FRAG_COLOR} = 1.0;
+ }
+ ""
+ end
+
+ case unterminated_comment_1
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ /*
+ }
+ ""
+ end
+
+ case unterminated_comment_2
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ /*
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ }
+ ""
+ end
+
+ case backslash_in_a_comment_1
+ version 300 es
+ expect build_successful
+ both ""
+ #version 300 es
+ // \\note these are some declarations
+ precision mediump float;
+ ${DECLARATIONS}
+ // \\note this is the main function
+ void main()
+ {
+ // \\note this is a function body
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case backslash_in_a_comment_2
+ version 300 es
+ expect build_successful
+ both ""
+ #version 300 es
+ /* \\note these are some declarations */
+ precision mediump float;
+ ${DECLARATIONS}
+ /* \\note this is the main function */
+ void main()
+ {
+ /* \\note this is a function body */
+ ${OUTPUT}
+ }
+ ""
+ end
+end # comments
+
+group line_continuation "Line Continuation Tests"
+
+ case comment
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ out0 = 1.0;
+ // comment \\
+ out0 = -1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case define
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ #define A(X) \\
+ (-1.0*(X))
+
+ void main ()
+ {
+ out0 = A(-1.0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case preprocessing_token
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ #def\\
+ ine A(X) (-1.0*(X))
+
+ void main ()
+ {
+ out0 = A(-1.0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case token
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ float f\\
+ oo = 1.0;
+ out0 = foo;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case middle_of_line
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ #define A a \\ b
+ #define B 1.0
+
+ void main ()
+ {
+ out0 = B;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # line_continuation
+
+group function_definitions "Function Definitions Tests"
+
+ case same_object_and_function_param
+ version 300 es
+ values { output float out0 = 1.0; }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ #define VALUE 1.0
+ #define FUNCTION(VALUE, B) (VALUE-B)
+
+ void main()
+ {
+ out0 = FUNCTION(3.0, 2.0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case complex_func
+ version 300 es
+ values { output float out0 = 518.5; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ #define AAA(a,b) a*(BBB(a,b))
+ #define BBB(a,b) a-b
+
+ void main()
+ {
+ out0 = BBB(AAA(8.0/4.0, 2.0)*BBB(2.0*2.0,0.75*2.0), AAA(40.0,10.0*BBB(5.0,3.0)));
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case function_definition_with_comments
+ version 300 es
+ values { output float out0 = 3.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ /* sdfljk */ #/* sdfljk */define /* sdfljk */ FUNC( /* jklsfd*/a /*sfdjklh*/, /*sdfklj */b /*sdfklj*/) a+b
+
+ void main()
+ {
+ out0 = FUNC(1.0, 2.0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # function_definitions
+
+group recursion "Recursions Tests"
+
+ case recursion_1
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ # define AAA AAA
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(AAA);
+ }
+ ""
+ end
+
+ case recursion_2
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ # define AAA BBB
+ #define BBB AAA
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(AAA);
+ }
+ ""
+ end
+
+ case recursion_3
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ # define AAA (1.0+BBB)
+ #define BBB (2.0+AAA)
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(AAA);
+ }
+ ""
+ end
+
+ case recursion_4
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ # define AAA(a) AAA(a)
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(AAA(1.0));
+ }
+ ""
+ end
+
+ case recursion_5
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ # define AAA(a, b) AAA(b, a)
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(AAA(1.0, 2.0));
+ }
+ ""
+ end
+
+end # recursion
+
+group function_redefinitions "Function Redefinition Tests"
+
+ case function_redefinition_1
+ version 300 es
+ values { output float out0 = 3.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ # define FUNC(a,b) a+b
+ # define FUNC( a, b) a+b
+
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = FUNC(1.0, 2.0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case function_redefinition_2
+ version 300 es
+ values { output float out0 = 3.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ # define FUNC(a,b) (a +b)
+ # define FUNC( a, b )(a +b)
+
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = FUNC(1.0, 2.0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case function_redefinition_3
+ version 300 es
+ values { output float out0 = 3.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ # define FUNC(a,b) (a +b)
+ # define FUNC(a,b)(a /* comment
+ */ +b)
+
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = FUNC(1.0, 2.0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case invalid_function_redefinition_param_1
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ # define FUNC(a,b) a+b
+ # define FUNC(A,b) A+b
+
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0, 2.0));
+ }
+ ""
+ end
+
+ case invalid_function_redefinition_param_2
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ # define FUNC(a,b) a+b
+ # define FUNC(a,b,c) a+b+c
+
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0, 2.0, 3.0));
+ }
+ ""
+ end
+
+ case invalid_function_redefinition_param_3
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ # define FUNC(a,b) a+b
+ # define FUNC(a,b) b+a
+
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0, 2.0));
+ }
+ ""
+ end
+
+end # functions_redefinitions
+
+group invalid_function_definitions "Invalid Function Definition Tests"
+
+ case arguments_1
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ # define FUNC(a,b) a+b
+
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC);
+ }
+ ""
+ end
+
+ case arguments_2
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ # define FUNC(a,b) a+b
+
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC());
+ }
+ ""
+ end
+
+ case arguments_3
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ # define FUNC(a,b) a+b
+
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC((();
+ }
+ ""
+ end
+
+ case arguments_4
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ # define FUNC(a,b) a+b
+
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC));
+ }
+ ""
+ end
+
+ case arguments_5
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ # define FUNC(a,b) a+b
+
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0));
+ }
+ ""
+ end
+
+ case arguments_6
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ # define FUNC(a,b) a+b
+
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0);
+ }
+ ""
+ end
+
+ case arguments_7
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ # define FUNC(a,b) a+b
+
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,));
+ }
+ ""
+ end
+
+ case arguments_8
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ # define FUNC(a,b) a+b
+
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0, 2.0, 3.0));
+ }
+ ""
+ end
+
+ case unique_param_name
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ # define FUNC(a,a) a+a
+
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0));
+ }
+ ""
+ end
+
+ case argument_list_1
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ # define FUNC(a b) a+b
+
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0));
+ }
+ ""
+ end
+
+ case argument_list_2
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ # define FUNC(a + b) a+b
+
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0));
+ }
+ ""
+ end
+
+ case argument_list_3
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ # define FUNC(,a,b) a+b
+
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0));
+ }
+ ""
+ end
+
+ case no_closing_parenthesis_1
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ # define FUNC(
+
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0));
+ }
+ ""
+ end
+
+ case no_closing_parenthesis_2
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ # define FUNC(A a+b
+
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0));
+ }
+ ""
+ end
+
+ case no_closing_parenthesis_3
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ # define FUNC(A,B,C a+b
+
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0));
+ }
+ ""
+ end
+
+ case no_closing_parenthesis_4
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ # define FUNC(
+ ""
+ end
+
+end # invalid_function_definitions
+
+group semantic "Semantic Tests"
+
+ case ops_as_arguments
+ version 300 es
+ values { output float out0 = 20.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ #define FOO(a, b) (1 a 9) b 2
+
+ void main()
+ {
+ out0 = float(FOO(+, *));
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case correct_order
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ #define FUNC(A) A
+ #define A 2.0
+
+ void main()
+ {
+ out0 = FUNC(A - 1.0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # semantic
+
+group predefined_macros "Predefined Macros Tests"
+
+ case version
+ version 300 es
+ values { output float out0 = 300.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define AAA __VERSION__
+ out0 = float(AAA);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case gl_es_1
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ out0 = float(GL_ES);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case gl_es_2
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ #define AAA(A) A
+
+ void main()
+ {
+ out0 = float(AAA(GL_ES));
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case line_1
+ version 300 es
+ values { output float out0 = 2.0; }
+ both ""
+ #version 300 es
+ const mediump int line = __LINE__;
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = float(line);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case line_2
+ version 300 es
+ # Note: Arguments are macro replaced in the first stage.
+ # Macro replacement list is expanded in the last stage.
+ values { output vec4 out0 = vec4(12.0, 12.0, 10.0, 11.0); }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS:single-line}
+ #define BBB __LINE__, /*
+ */ __LINE__
+ #define AAA(a,b) BBB, a, b
+
+ void main()
+ {
+ out0 = vec4(AAA(__LINE__,
+ __LINE__
+ ));
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case file
+ version 300 es
+ values { output float out0 = 0.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = float(__FILE__);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case if_gl_es
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if GL_ES
+ out0 = 1.0;
+ #else
+ out0 = -1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case if_version
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if __VERSION__ == 300
+ out0 = 1.0;
+ #else
+ out0 = -1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # predefined_macros
+
+group conditional_inclusion "Conditional Inclusion Tests"
+
+ case basic_1
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define AAA asdf
+
+ #if defined AAA && !defined(BBB)
+ out0 = 1.0;
+ #else
+ out0 = 0.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case basic_2
+ version 300 es
+ values { output float out0 = 1.0; }
+ # Note: this is expected to fail contrary to native dEQP,
+ # see https://github.com/KhronosGroup/WebGL/pull/1523
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define AAA defined(BBB)
+
+ #if !AAA
+ out0 = 1.0;
+ #else
+ out0 = 0.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case defined_macro_defined_test
+ version 300 es
+ values { output float out0 = 1.0; }
+ # Note: this is expected to fail contrary to native dEQP,
+ # see https://github.com/KhronosGroup/WebGL/pull/1523
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define AAA defined
+
+ #if AAA AAA
+ out0 = 1.0;
+ #else
+ out0 = 0.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case defined_macro_undef
+ version 300 es
+ values { output float out0 = 1.0; }
+ # Note: this is expected to fail contrary to native dEQP,
+ # see https://github.com/KhronosGroup/WebGL/pull/1523
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define BBB 1
+ #define AAA defined(BBB)
+ #undef BBB
+
+ #if !AAA
+ out0 = 1.0;
+ #else
+ out0 = 0.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case define_defined
+ version 300 es
+ values { output float out0 = 1.0; }
+ # Note: this is expected to fail contrary to native dEQP,
+ # see https://github.com/KhronosGroup/WebGL/pull/1523
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define CCC 1
+ #define defined BBB
+ #define AAA defined
+
+ #if AAA CCC
+ out0 = 1.0;
+ #else
+ out0 = 0.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case define_defined_outside_if
+ version 300 es
+ values { output float out0 = 1.0; }
+ # Note: this is expected to fail contrary to native dEQP,
+ # see https://github.com/KhronosGroup/WebGL/pull/1523
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define CCC - 0.5
+ #define defined 0.5
+ #define AAA defined
+ out0 = 1.0 - (AAA CCC);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case defined_invalid_before_all_macros_replaced
+ version 300 es
+ expect compile_fail
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define FOO 1
+ #define OPEN defined(
+ #define CLOSE FOO)
+
+ #if OPEN CLOSE
+ out0 = 1.0;
+ #else
+ out0 = 0.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case basic_3
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 0
+ out0 = -1.0;
+ #elif 0
+ out0 = -2.0;
+ #elif 1
+ out0 = 1.0;
+ #else
+ out0 = -3.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case basic_4
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 0
+ out0 = -1.0;
+ #elif 0
+ out0 = -2.0;
+ #else
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case basic_5
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 1
+ out0 = 1.0;
+ #elif 0
+ out0 = -2.0;
+ #else
+ out0 = -1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case unary_ops_1
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if !((~2 >> 1) & 1)
+ out0 = 1.0;
+ #else
+ out0 = -1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case unary_ops_2
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if !((~(- - - - - 1 + + + + + +1) >> 1) & 1)
+ out0 = -1.0;
+ #else
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # conditional_inclusion
+
+group invalid_ops "Invalid Operations Tests"
+
+ case invalid_op_1
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if !((~(+ ++1 - - - -1) >> 1) & 1)
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #endif
+ }
+ ""
+ end
+
+ case invalid_op_2
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if !((~(+ + +1 - -- -1) >> 1) & 1)
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #endif
+ }
+ ""
+ end
+
+ case invalid_defined_expected_identifier_1
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ #define AAA 1
+
+ ${DECLARATIONS}
+ void main()
+ {
+ #if defined
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #endif
+ }
+ ""
+ end
+
+ case invalid_defined_expected_identifier_2
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ #define AAA 1
+
+ ${DECLARATIONS}
+ void main()
+ {
+ #if defined()
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #endif
+ }
+ ""
+ end
+
+ case invalid_defined_expected_identifier_3
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ #define AAA 1
+
+ ${DECLARATIONS}
+ void main()
+ {
+ #if defined(
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #endif
+ }
+ ""
+ end
+
+ case invalid_defined_expected_identifier_4
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ #define AAA 1
+
+ ${DECLARATIONS}
+ void main()
+ {
+ #if defined)
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #endif
+ }
+ ""
+ end
+
+ case invalid_defined_expected_identifier_5
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ #define AAA 1
+
+ ${DECLARATIONS}
+ void main()
+ {
+ #if defined((AAA))
+ ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0);
+ #endif
+ }
+ ""
+ end
+
+ case invalid_defined_expected_rparen
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ #define AAA 1
+
+ ${DECLARATIONS}
+ void main()
+ {
+ #if defined(AAA
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #endif
+ }
+ ""
+ end
+
+ case defined_define
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ #define define 1
+ #define AAA 1.0
+
+ void main()
+ {
+ out0 = AAA;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # invalid_ops
+
+group undefined_identifiers "Undefined Identifiers Tests"
+
+ case valid_undefined_identifier_1
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 1 || AAA
+ out0 = 1.0;
+ #else
+ out0 = -1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case valid_undefined_identifier_2
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 0 && AAA
+ out0 = -1.0;
+ #else
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case undefined_identifier_1
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 1 - CCC + (-AAA || BBB)
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #endif
+ }
+ ""
+ end
+
+ case undefined_identifier_2
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if !A
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #endif
+ }
+ ""
+ end
+
+ case undefined_identifier_3
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if -A
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #endif
+ }
+ ""
+ end
+
+ case undefined_identifier_4
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if ~A
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #endif
+ }
+ ""
+ end
+
+ case undefined_identifier_5
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if A && B
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #endif
+ }
+ ""
+ end
+
+ case undefined_identifier_6
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define A 1
+ #if A && B
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #endif
+ }
+ ""
+ end
+
+ case undefined_identifier_7
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define B 1
+ #if A && B
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #endif
+ }
+ ""
+ end
+
+ case undefined_identifier_8
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define B 1
+ #define A 2
+ #undef A
+ #if A && B
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #endif
+ }
+ ""
+ end
+
+ case undefined_identifier_9
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if A || B
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #endif
+ }
+ ""
+ end
+
+ case undefined_identifier_10
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define A 0
+ #if A || B
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #endif
+ }
+ ""
+ end
+
+ case undefined_identifier_11
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define A 0
+ #define B 2
+ #undef B
+ #if A || B
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #endif
+ }
+ ""
+ end
+
+ case undefined_identifier_12
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define B 1
+ #if A || B
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #endif
+ }
+ ""
+ end
+
+end # undefined_identifiers
+
+group invalid_conditionals "Invalid Conditionals Tests"
+
+ case empty_if
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case empty_ifdef
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #ifdef
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case empty_ifndef
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #ifndef
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case invalid_ifdef
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #ifdef 1
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #endif
+ }
+ ""
+ end
+
+ case invalid_ifndef
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #ifndef 1
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #endif
+ }
+ ""
+ end
+
+ case empty_if_defined
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if defined
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case unterminated_if_1
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 1
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case unterminated_if_2
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 0
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case unterminated_ifdef
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #ifdef FOOBAR
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case unterminated_ifndef
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #ifndef GL_ES
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case unterminated_else_1
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 1
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case unterminated_else_2
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 0
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case unterminated_elif_1
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 0
+ #elif 1
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case unterminated_elif_2
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 1
+ #elif 0
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case unterminated_elif_3
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 0
+ #elif 0
+ ${POSITION_FRAG_COLOR} = vec4(2.0);
+ }
+ ""
+ end
+
+ case elif_after_else
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 0
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #elif 1
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ #endif
+ }
+ ""
+ end
+
+ case else_without_if
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #endif
+ }
+ ""
+ end
+
+ case elif_without_if
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #elif 1
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #endif
+ }
+ ""
+ end
+
+ case endif_without_if
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #endif
+ }
+ ""
+ end
+
+ case else_after_else
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if !GL_ES
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #else
+ ${POSITION_FRAG_COLOR} = vec4(-1.0);
+ #endif
+ }
+ ""
+ end
+
+ case nested_elif_without_if
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 1
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ # elif
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ # endif
+ #endif
+ }
+ ""
+ end
+
+ case if_float
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 1.231
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ # elif
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ # endif
+ #endif
+ }
+ ""
+ end
+
+ case tokens_after_if
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 1 foobar
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #endif
+ }
+ ""
+ end
+
+ case tokens_after_elif
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 0
+ #elif foobar
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ #endif
+ }
+ ""
+ end
+
+ case tokens_after_else
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 1
+ #else foobar 1.231
+ #endif
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case tokens_after_endif
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 1
+ #else
+ #endif foobar
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case tokens_after_ifdef
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #ifdef FOOBAR foobar
+ #else
+ #endif
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case tokens_after_ifndef
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #ifndef FOOBAR ,, +- << barbar
+ #else
+ #endif
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case unterminated_nested_blocks
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 1
+ # if 1
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+end # invalid_conditionals
+
+group conditionals "Conditionals Tests"
+
+ case ifdef_1
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #define AAA
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #ifdef AAA
+ out0 = 1.0;
+ #else
+ out0 = -1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ifdef_2
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #define AAA
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if defined ( AAA)
+ out0 = 1.0;
+ #else
+ out0 = -1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ifdef_3
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #ifdef AAA
+ out0 = -1.0;
+ #else
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ifndef_1
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #ifndef AAA
+ out0 = 1.0;
+ #else
+ out0 = -1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case ifndef_2
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ #define AAA
+ void main()
+ {
+ #ifndef AAA
+ out0 = -1.0;
+ #else
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mixed_conditional_inclusion
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #ifndef AAA
+ out0 = 1.0;
+ #elif 1
+ out0 = -1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case nested_if_1
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if GL_ES
+ # if __VERSION__ != 300
+ out0 = -1.0;
+ # else
+ out0 = 1.0;
+ # endif
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case nested_if_2
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 1
+ # if 0
+ out0 = -1.0;
+ # else
+ # if 0
+ out0 = -1.0;
+ # elif 1
+ out0 = 1.0;
+ # else
+ out0 = -1.0;
+ # endif
+ # endif
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case nested_if_3
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 0
+ # if 1
+ out0 = -1.0;
+ # endif
+ #else
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # conditionals
+
+group directive "Directive Tests"
+
+ case version_is_less
+ expect compile_fail
+ version 300 es
+ both ""
+ #version 299 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case version_is_more
+ expect compile_fail
+ version 300 es
+ both ""
+ #version 301 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case version_missing_es
+ expect compile_fail
+ version 300 es
+ both ""
+ #version 300
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case version_missing
+ expect compile_fail
+ version 300 es
+ both ""
+ #version
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case version_not_first_statement_1
+ expect compile_fail
+ version 300 es
+ both ""
+ precision mediump float;
+ #version 300 es
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case version_not_first_statement_2
+ expect compile_fail
+ version 300 es
+ both ""
+ #define FOO BAR
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case version_invalid_token_1
+ expect compile_fail
+ version 300 es
+ both ""
+ #version 300 es.0
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case version_invalid_token_2
+ expect compile_fail
+ version 300 es
+ both ""
+ #version foobar
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case invalid_version
+ expect compile_fail
+ version 300 es
+ both ""
+ #version AAA
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case additional_tokens
+ expect compile_fail
+ version 300 es
+ both ""
+ #version 300 es foobar
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case error_with_no_tokens
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ #error
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case error
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ #define AAA asdf
+ #error 1 * AAA /* comment */
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+end # directive
+
+group builtin "Built-in Symbol Tests"
+
+ case line
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #line 1
+ out0 = float(__LINE__);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case line_and_file
+ version 300 es
+ values { output vec4 out0 = vec4(234.0, 234.0, 10.0, 10.0); }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #line 234 10
+ out0 = vec4(__LINE__, __LINE__, __FILE__, __FILE__);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case line_expression
+ version 300 es
+ values { output float out0 = 20.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #line +20
+ out0 = float(__LINE__);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case line_and_file_expression
+ version 300 es
+ values { output vec4 out0 = vec4(243.0, 243.0, 10.0, 10.0); }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #line (233 +10) (+10)
+ out0 = vec4(__LINE__, __LINE__, __FILE__, __FILE__);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case line_defined_1
+ version 300 es
+ values { output float out0 = 4.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define A 4
+ #line A
+ out0 = float(__LINE__);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case line_defined_2
+ version 300 es
+ values { output vec4 out0 = vec4(234.0, 234.0, 10.0, 10.0); }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define A 10
+ #line 234 A
+ out0 = vec4(__LINE__, __LINE__, __FILE__, __FILE__);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case empty_line
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #line
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case invalid_line_file_1
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #line 22 1.234
+ ${POSITION_FRAG_COLOR} = vec4(__LINE__, __LINE__, __FILE__, __FILE__);
+ }
+ ""
+ end
+
+ case invalid_line_file_3
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #line 233 10 2
+ ${POSITION_FRAG_COLOR} = vec4(__LINE__, __LINE__, __FILE__, __FILE__);
+ }
+ ""
+ end
+
+ case invalid_line_file_4
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #line foobar
+ ${POSITION_FRAG_COLOR} = vec4(__LINE__, __LINE__, __FILE__, __FILE__);
+ }
+ ""
+ end
+
+end # builtin
+
+group pragmas "Pragma Tests"
+
+ case pragma_vertex
+ version 300 es
+ values { output float out0 = 1.0; }
+ vertex ""
+ #version 300 es
+ #pragma
+ #pragma STDGL invariant(all)
+ #pragma debug(off)
+ #pragma optimize(off)
+
+ ${VERTEX_DECLARATIONS}
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ out0 = 1.0;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case pragma_fragment
+ version 300 es
+ values { output float out0 = 1.0; }
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ #pragma
+ #pragma debug(off)
+ #pragma optimize(off)
+
+ precision mediump float;
+ ${FRAGMENT_DECLARATIONS}
+ void main()
+ {
+ out0 = 1.0;
+ ${FRAGMENT_OUTPUT}
+ }
+ ""
+ end
+
+ case pragma_macro_exp
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #define off INVALID
+ /* pragma line not macro expanded */
+ #pragma debug(off)
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case pragma_unrecognized_debug
+ version 300 es
+ expect build_successful
+ both ""
+ #version 300 es
+ #pragma debug(1.23)
+
+ // unrecognized preprocessor token
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case pragma_unrecognized_token
+ # Note: upstream dEQP uses unicode characters here but we can't test
+ # this in WebGL because it requires strings passed to glShaderSource
+ # to be ASCII. This would cause the test to fail at glShaderSource
+ # instead of glCompileShader, which is not what we want to test.
+ version 300 es
+ expect build_successful
+ both ""
+ #version 300 es
+ #pragma **%
+
+ // trailing bytes form a valid but unrecognized preprocessor token
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+end # pragmas
+
+group extensions "Extension Tests"
+
+ case basic
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #extension all : warn
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case macro_exp
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #define warn enable
+
+ #extension all : warn
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = 1.0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case missing_extension_name
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ #extension
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case invalid_extension_name
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ #extension 2 : all
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case missing_colon
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ #extension all
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case expected_colon
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ #extension all ;
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case missing_behavior
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ #extension all :
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case invalid_behavior_1
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ #extension all : WARN
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case invalid_behavior_2
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ #extension all : require
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case invalid_char_in_name
+ # Note: upstream dEQP uses unicode characters here but we can't test
+ # this in WebGL because it requires strings passed to glShaderSource
+ # to be ASCII. This would cause the test to fail at glShaderSource
+ # instead of glCompileShader, which is not what we want to test.
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ #extension all* : warn
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case invalid_char_in_behavior
+ # Note: upstream dEQP uses unicode characters here but we can't test
+ # this in WebGL because it requires strings passed to glShaderSource
+ # to be ASCII. This would cause the test to fail at glShaderSource
+ # instead of glCompileShader, which is not what we want to test.
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ #extension all : war*n
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case unterminated_comment
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ #extension all : warn /*asd
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case after_non_preprocessing_tokens
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ #extension all : warn
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #extension all : disable
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+end # extensions
+
+group expressions "Expression Tests"
+
+ case shift_left
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL 4
+ out0 = 0.0;
+ #if (VAL << 2) == 16
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case shift_right
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL 5
+ out0 = 0.0;
+ #if (VAL >> 1) == 2
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case cmp_less_than
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL 5
+ out0 = 0.0;
+ #if (VAL < 6) && (-VAL < -4)
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case less_or_equal
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL 6
+ out0 = 0.0;
+ #if (VAL <= 6) && (-VAL <= -6)
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case or
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL 6
+ out0 = 0.0;
+ #if (VAL | 5) == 7
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case and
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL 6
+ out0 = 0.0;
+ #if (VAL & 5) == 4
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case xor
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL 6
+ out0 = 0.0;
+ #if (VAL ^ 5) == 3
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mod
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL 12
+ out0 = 0.0;
+ #if (VAL % 5) == 2
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case parenthesis_value
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL (( (4 ) ) )
+ out0 = 0.0;
+ #if VAL >= 4
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case parenthesis_tricky
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL (( (4 ) )
+ out0 = 0.0;
+ #if VAL) >= 4
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case parenthesis_if_no
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL 4
+ out0 = 0.0;
+ #if VAL >= 4
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case parenthesis_if
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL 4
+ out0 = 0.0;
+ #if (VAL >= 4)
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case parenthesis_multi_if
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL (4)
+ out0 = 0.0;
+ #if (((VAL)) >= (4))
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case parenthesis_single_if
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL 4
+ out0 = 0.0;
+ #if (VAL >= 4)
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case parenthesis_ifelse_true
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL 4
+ #if (VAL >= 4)
+ out0 = 1.0;
+ #else
+ out0 = 0.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case parenthesis_ifelse_false
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #define VAL 4
+ #if (VAL > 4)
+ out0 = 0.0;
+ #else
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case eval_basic_0
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if -4 + 5 == 1
+ out0 = 1.0;
+ #else
+ out0 = 0.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case eval_basic_1
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if (2 * 2) - 3 >= 0
+ out0 = 1.0;
+ #else
+ out0 = 0.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case eval_simple_precedence_0
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 2 * 3 - 3 == 3
+ out0 = 1.0;
+ #else
+ out0 = 0.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case eval_simple_precedence_1
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 2 - 2 / 2 == 1
+ out0 = 1.0;
+ #else
+ out0 = 0.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case defined_1
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ #define X 0
+ void main()
+ {
+ #if defined(X)
+ out0 = 1.0;
+ #else
+ out0 = 0.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case defined_2
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ #define X 0
+ #define Y 1
+ void main()
+ {
+ #if defined(X) == Y
+ out0 = 1.0;
+ #else
+ out0 = 0.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case defined_3
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ #define X 0
+ #define Y 1
+ void main()
+ {
+ #if defined(X) && defined(Y)
+ out0 = 1.0;
+ #else
+ out0 = 0.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case defined_4
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ #define X 0
+ #define Y 1
+ #undef X
+ void main()
+ {
+ #if defined(X) && defined(Y)
+ out0 = 0.0;
+ #else
+ out0 = 1.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case defined_5
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ #define X 0
+ #define Y 1
+ #undef X
+ void main()
+ {
+ #if defined(X) || defined(Y)
+ out0 = 1.0;
+ #else
+ out0 = 0.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case defined_6
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ #define X 0
+ #define Y 1
+ #undef Y
+ void main()
+ {
+ #if defined(X) && (defined(Y) || (X == 0))
+ out0 = 1.0;
+ #else
+ out0 = 0.0;
+ #endif
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # expressions
+
+group invalid_expressions "Invalid Expression Tests"
+
+ case invalid_unary_expr
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if !
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case invalid_binary_expr
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 3+4+
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case missing_expr
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case invalid_expr_1
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 4 4
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case invalid_expr_2
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 4 * * 4
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case invalid_expr_3
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if (4)(4)
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case unopened_parenthesis
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if 4)
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+ case unclosed_parenthesis
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ #if ((4 + 7)
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+ ""
+ end
+
+end # invalid_expressions
+
+group operator_precedence "Operator precedence"
+
+
+ case modulo_vs_not
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 % ! 0 ) == 0
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case div_vs_not
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 / ! 0 ) == 8
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mul_vs_not
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 * ! 0 ) == 8
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case modulo_vs_bit_invert
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 % ~ 4 ) == 3
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case modulo_vs_minus
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 % - 2 ) == 0
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case modulo_vs_plus
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 % + 2 ) == 0
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case div_vs_bit_invert
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 / ~ 2 ) == -2
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case div_vs_minus
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 / - 2 ) == -4
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case div_vs_plus
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 / + 2 ) == 4
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mul_vs_bit_invert
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 * ~ 2 ) == -24
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mul_vs_minus
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 * - 2 ) == -16
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mul_vs_plus
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 * + 2 ) == 16
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case sub_vs_modulo
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 - 3 % 2 ) == 7
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case sub_vs_div
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 - 3 / 2 ) == 7
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case sub_vs_mul
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 - 3 * 2 ) == 2
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case add_vs_modulo
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 + 3 % 2 ) == 9
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case add_vs_div
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 + 3 / 2 ) == 9
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case add_vs_mul
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 + 3 * 2 ) == 14
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case rshift_vs_sub
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 >> 3 - 2 ) == 4
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case rshift_vs_add
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 >> 3 + 2 ) == 0
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case lshift_vs_sub
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 << 3 - 2 ) == 16
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case lshift_vs_add
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 << 3 + 2 ) == 256
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case greater_or_equal_vs_rshift
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 >= 3 >> 2 ) == 1
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case greater_or_equal_vs_lshift
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 >= 3 << 2 ) == 0
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case less_or_equal_vs_rshift
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 <= 3 >> 2 ) == 0
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case less_or_equal_vs_lshift
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 <= 3 << 2 ) == 1
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case greater_vs_rshift
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 > 3 >> 2 ) == 1
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case greater_vs_lshift
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 > 3 << 2 ) == 0
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case less_vs_rshift
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 < 3 >> 2 ) == 0
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case less_vs_lshift
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 < 3 << 2 ) == 1
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case not_equal_vs_greater_or_equal
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 != 3 >= 2 ) == 1
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case not_equal_vs_less_or_equal
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 != 3 <= 2 ) == 1
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case not_equal_vs_greater
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 != 3 > 2 ) == 1
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case not_equal_vs_less
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 != 3 < 2 ) == 1
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case equal_vs_greater_or_equal
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 == 3 >= 2 ) == 0
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case equal_vs_less_or_equal
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 == 3 <= 2 ) == 0
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case equal_vs_greater
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 == 3 > 2 ) == 0
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case equal_vs_less
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 == 3 < 2 ) == 0
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bitwise_and_vs_not_equal
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 & 3 != 2 ) == 0
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bitwise_and_vs_equal
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 & 3 == 2 ) == 0
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case xor_vs_bitwise_and
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 ^ 3 & 2 ) == 10
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case bitwise_or_vs_xor
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 8 | 3 ^ 2 ) == 9
+ #define VAL 1.0
+ #else
+ #define VAL 0.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case logical_and_vs_bitwise_or
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 0 && 3 | 2 )
+ #define VAL 0.0
+ #else
+ #define VAL 1.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case logical_and_vs_bitwise_and
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 0 && 4 & 2 )
+ #define VAL 0.0
+ #else
+ #define VAL 1.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case logical_or_vs_logical_and
+ version 300 es
+ values { output float out0 = 1.0; }
+ both ""
+ #version 300 es
+ #if ( 0 || 4 && 0 )
+ #define VAL 0.0
+ #else
+ #define VAL 1.0
+ #endif
+
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ out0 = VAL;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end # operator_precedence
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/qualification_order.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/qualification_order.html
new file mode 100644
index 0000000000..d381f96f66
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/qualification_order.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'qualification_order';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/qualification_order.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/qualification_order.test
new file mode 100644
index 0000000000..42c5b357f2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/qualification_order.test
@@ -0,0 +1,2714 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+
+group variables "Order of qualification in variable declarations."
+
+ group valid "Valid orderings."
+
+ case invariant_interp_storage_precision
+ expect pass
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ invariant smooth centroid out lowp float x0;
+
+ flat out mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ smooth centroid in lowp float x0;
+
+ flat in mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case interp_storage_precision
+ expect pass
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ smooth centroid out lowp float x0;
+
+ flat out mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ smooth centroid in lowp float x0;
+
+ flat in mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case invariant_interp_storage
+ expect pass
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ invariant smooth centroid out float x0;
+
+ flat out float x1;
+
+ uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ smooth centroid in float x0;
+
+ flat in float x1;
+
+ uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case invariant_storage_precision
+ expect pass
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ invariant centroid out lowp float x0;
+
+ out mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ centroid in lowp float x0;
+
+ in mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case storage_precision
+ expect pass
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ centroid out lowp float x0;
+
+ out mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ centroid in lowp float x0;
+
+ in mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case interp_storage
+ expect pass
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ smooth centroid out float x0;
+
+ flat out float x1;
+
+ uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ smooth centroid in float x0;
+
+ flat in float x1;
+
+ uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case invariant_storage
+ expect pass
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ invariant centroid out float x0;
+
+ out float x1;
+
+ uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ centroid in float x0;
+
+ in float x1;
+
+ uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+
+ end # valid
+ group invalid "Invalid orderings."
+
+ case invariant_interp_precision_storage
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ invariant smooth lowp centroid out float x0;
+
+ flat mediump out float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ smooth lowp centroid in float x0;
+
+ flat mediump in float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case invariant_storage_interp_precision
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ invariant centroid out smooth lowp float x0;
+
+ out flat mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ centroid in smooth lowp float x0;
+
+ in flat mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case invariant_storage_precision_interp
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ invariant centroid out lowp smooth float x0;
+
+ out mediump flat float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ centroid in lowp smooth float x0;
+
+ in mediump flat float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case invariant_precision_interp_storage
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ invariant lowp smooth centroid out float x0;
+
+ mediump flat out float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ lowp smooth centroid in float x0;
+
+ mediump flat in float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case invariant_precision_storage_interp
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ invariant lowp centroid out smooth float x0;
+
+ mediump out flat float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ lowp centroid in smooth float x0;
+
+ mediump in flat float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case interp_invariant_storage_precision
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ smooth invariant centroid out lowp float x0;
+
+ flat out mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ smooth centroid in lowp float x0;
+
+ flat in mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case interp_invariant_precision_storage
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ smooth invariant lowp centroid out float x0;
+
+ flat mediump out float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ smooth lowp centroid in float x0;
+
+ flat mediump in float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case interp_storage_invariant_precision
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ smooth centroid out invariant lowp float x0;
+
+ flat out mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ smooth centroid in lowp float x0;
+
+ flat in mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case interp_storage_precision_invariant
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ smooth centroid out lowp invariant float x0;
+
+ flat out mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ smooth centroid in lowp float x0;
+
+ flat in mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case interp_precision_invariant_storage
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ smooth lowp invariant centroid out float x0;
+
+ flat mediump out float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ smooth lowp centroid in float x0;
+
+ flat mediump in float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case interp_precision_storage_invariant
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ smooth lowp centroid out invariant float x0;
+
+ flat mediump out float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ smooth lowp centroid in float x0;
+
+ flat mediump in float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case storage_invariant_interp_precision
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ centroid out invariant smooth lowp float x0;
+
+ out flat mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ centroid in smooth lowp float x0;
+
+ in flat mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case storage_invariant_precision_interp
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ centroid out invariant lowp smooth float x0;
+
+ out mediump flat float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ centroid in lowp smooth float x0;
+
+ in mediump flat float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case storage_interp_invariant_precision
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ centroid out smooth invariant lowp float x0;
+
+ out flat mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ centroid in smooth lowp float x0;
+
+ in flat mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case storage_interp_precision_invariant
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ centroid out smooth lowp invariant float x0;
+
+ out flat mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ centroid in smooth lowp float x0;
+
+ in flat mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case storage_precision_invariant_interp
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ centroid out lowp invariant smooth float x0;
+
+ out mediump flat float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ centroid in lowp smooth float x0;
+
+ in mediump flat float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case storage_precision_interp_invariant
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ centroid out lowp smooth invariant float x0;
+
+ out mediump flat float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ centroid in lowp smooth float x0;
+
+ in mediump flat float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case precision_invariant_interp_storage
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ lowp invariant smooth centroid out float x0;
+
+ mediump flat out float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ lowp smooth centroid in float x0;
+
+ mediump flat in float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case precision_invariant_storage_interp
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ lowp invariant centroid out smooth float x0;
+
+ mediump out flat float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ lowp centroid in smooth float x0;
+
+ mediump in flat float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case precision_interp_invariant_storage
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ lowp smooth invariant centroid out float x0;
+
+ mediump flat out float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ lowp smooth centroid in float x0;
+
+ mediump flat in float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case precision_interp_storage_invariant
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ lowp smooth centroid out invariant float x0;
+
+ mediump flat out float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ lowp smooth centroid in float x0;
+
+ mediump flat in float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case precision_storage_invariant_interp
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ lowp centroid out invariant smooth float x0;
+
+ mediump out flat float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ lowp centroid in smooth float x0;
+
+ mediump in flat float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case precision_storage_interp_invariant
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ lowp centroid out smooth invariant float x0;
+
+ mediump out flat float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ lowp centroid in smooth float x0;
+
+ mediump in flat float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case interp_precision_storage
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ smooth lowp centroid out float x0;
+
+ flat mediump out float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ smooth lowp centroid in float x0;
+
+ flat mediump in float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case storage_interp_precision
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ centroid out smooth lowp float x0;
+
+ out flat mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ centroid in smooth lowp float x0;
+
+ in flat mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case storage_precision_interp
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ centroid out lowp smooth float x0;
+
+ out mediump flat float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ centroid in lowp smooth float x0;
+
+ in mediump flat float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case precision_interp_storage
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ lowp smooth centroid out float x0;
+
+ mediump flat out float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ lowp smooth centroid in float x0;
+
+ mediump flat in float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case precision_storage_interp
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ lowp centroid out smooth float x0;
+
+ mediump out flat float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ lowp centroid in smooth float x0;
+
+ mediump in flat float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case invariant_storage_interp
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ invariant centroid out smooth float x0;
+
+ out flat float x1;
+
+ uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ centroid in smooth float x0;
+
+ in flat float x1;
+
+ uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case interp_invariant_storage
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ smooth invariant centroid out float x0;
+
+ flat out float x1;
+
+ uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ smooth centroid in float x0;
+
+ flat in float x1;
+
+ uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case interp_storage_invariant
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ smooth centroid out invariant float x0;
+
+ flat out float x1;
+
+ uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ smooth centroid in float x0;
+
+ flat in float x1;
+
+ uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case storage_invariant_interp
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ centroid out invariant smooth float x0;
+
+ out flat float x1;
+
+ uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ centroid in smooth float x0;
+
+ in flat float x1;
+
+ uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case storage_interp_invariant
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ centroid out smooth invariant float x0;
+
+ out flat float x1;
+
+ uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ centroid in smooth float x0;
+
+ in flat float x1;
+
+ uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case invariant_precision_storage
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ invariant lowp centroid out float x0;
+
+ mediump out float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ lowp centroid in float x0;
+
+ mediump in float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case storage_invariant_precision
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ centroid out invariant lowp float x0;
+
+ out mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ centroid in lowp float x0;
+
+ in mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case storage_precision_invariant
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ centroid out lowp invariant float x0;
+
+ out mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ centroid in lowp float x0;
+
+ in mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case precision_invariant_storage
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ lowp invariant centroid out float x0;
+
+ mediump out float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ lowp centroid in float x0;
+
+ mediump in float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case precision_storage_invariant
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ lowp centroid out invariant float x0;
+
+ mediump out float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ lowp centroid in float x0;
+
+ mediump in float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case precision_storage
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ lowp centroid out float x0;
+
+ mediump out float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ lowp centroid in float x0;
+
+ mediump in float x1;
+
+ highp uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case storage_interp
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ centroid out smooth float x0;
+
+ out flat float x1;
+
+ uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ centroid in smooth float x0;
+
+ in flat float x1;
+
+ uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case storage_invariant
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ centroid out invariant float x0;
+
+ out float x1;
+
+ uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ centroid in float x0;
+
+ in float x1;
+
+ uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case invariant_interp_storage_precision_invariant_input
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ invariant smooth centroid out lowp float x0;
+
+ flat out mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ invariant smooth centroid in lowp float x0;
+
+ flat in mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case interp_storage_precision_invariant_input
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ smooth centroid out lowp float x0;
+
+ flat out mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ invariant smooth centroid in lowp float x0;
+
+ flat in mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case invariant_interp_storage_invariant_input
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ invariant smooth centroid out float x0;
+
+ flat out float x1;
+
+ uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ invariant smooth centroid in float x0;
+
+ flat in float x1;
+
+ uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case invariant_storage_precision_invariant_input
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ invariant centroid out lowp float x0;
+
+ out mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ invariant centroid in lowp float x0;
+
+ in mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case storage_precision_invariant_input
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ centroid out lowp float x0;
+
+ out mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ invariant centroid in lowp float x0;
+
+ in mediump float x1;
+
+ uniform highp float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case interp_storage_invariant_input
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ smooth centroid out float x0;
+
+ flat out float x1;
+
+ uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ invariant smooth centroid in float x0;
+
+ flat in float x1;
+
+ uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+ case invariant_storage_invariant_input
+ expect compile_fail
+ values {}
+
+ vertex ""
+ #version 300 es
+ precision mediump float;
+ in highp vec4 dEQP_Position;
+
+ invariant centroid out float x0;
+
+ out float x1;
+
+ uniform float x2;
+
+ void main()
+ {
+ x0 = 1.0;
+ x1 = 2.0;
+ gl_Position = dEQP_Position;
+ }
+ ""
+
+ fragment ""
+ #version 300 es
+ precision mediump float;
+ layout(location = 0) out mediump vec4 dEQP_FragColor;
+
+ invariant centroid in float x0;
+
+ in float x1;
+
+ uniform float x2;
+
+ void main()
+ {
+ float result = (x0 + x1 + x2) / 3.0;
+ dEQP_FragColor = vec4(result, result, result, 1.0);
+ }
+ ""
+ end
+
+ end # invalid
+
+end # variables
+group parameters "Order of qualification in function parameters."
+
+ group valid "Valid orderings."
+
+ case storage_parameter_precision
+ expect pass
+ version 300 es
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float foo0 (const in lowp float x)
+ {
+ return x + 1.0;
+ }
+
+ void foo1 ( out mediump float x)
+ {
+ x = 1.0;
+ }
+
+ float foo2 ( inout highp float x)
+ {
+ return x + 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float result;
+ foo1(result);
+ float x0 = foo0(1.0);
+ foo2(result);
+ ${OUTPUT}
+ }
+ ""
+ end
+ case storage_parameter
+ expect pass
+ version 300 es
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float foo0 (const in float x)
+ {
+ return x + 1.0;
+ }
+
+ void foo1 ( out float x)
+ {
+ x = 1.0;
+ }
+
+ float foo2 ( inout float x)
+ {
+ return x + 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float result;
+ foo1(result);
+ float x0 = foo0(1.0);
+ foo2(result);
+ ${OUTPUT}
+ }
+ ""
+ end
+ case storage_precision
+ expect pass
+ version 300 es
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float foo0 (const lowp float x)
+ {
+ return x + 1.0;
+ }
+
+ void foo1 ( mediump float x)
+ {
+ x = 1.0;
+ }
+
+ float foo2 ( highp float x)
+ {
+ return x + 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float result;
+ foo1(result);
+ float x0 = foo0(1.0);
+ foo2(result);
+ ${OUTPUT}
+ }
+ ""
+ end
+ case parameter_precision
+ expect pass
+ version 300 es
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float foo0 (in lowp float x)
+ {
+ return x + 1.0;
+ }
+
+ void foo1 (out mediump float x)
+ {
+ x = 1.0;
+ }
+
+ float foo2 (inout highp float x)
+ {
+ return x + 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float result;
+ foo1(result);
+ float x0 = foo0(1.0);
+ foo2(result);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ end # valid
+ group invalid "Invalid orderings."
+
+ case storage_precision_parameter
+ expect compile_fail
+ version 300 es
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float foo0 (const lowp in float x)
+ {
+ return x + 1.0;
+ }
+
+ void foo1 ( mediump out float x)
+ {
+ x = 1.0;
+ }
+
+ float foo2 ( highp inout float x)
+ {
+ return x + 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float result;
+ foo1(result);
+ float x0 = foo0(1.0);
+ foo2(result);
+ ${OUTPUT}
+ }
+ ""
+ end
+ case parameter_storage_precision
+ expect compile_fail
+ version 300 es
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float foo0 (in const lowp float x)
+ {
+ return x + 1.0;
+ }
+
+ void foo1 (out mediump float x)
+ {
+ x = 1.0;
+ }
+
+ float foo2 (inout highp float x)
+ {
+ return x + 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float result;
+ foo1(result);
+ float x0 = foo0(1.0);
+ foo2(result);
+ ${OUTPUT}
+ }
+ ""
+ end
+ case parameter_precision_storage
+ expect compile_fail
+ version 300 es
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float foo0 (in lowp const float x)
+ {
+ return x + 1.0;
+ }
+
+ void foo1 (out mediump float x)
+ {
+ x = 1.0;
+ }
+
+ float foo2 (inout highp float x)
+ {
+ return x + 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float result;
+ foo1(result);
+ float x0 = foo0(1.0);
+ foo2(result);
+ ${OUTPUT}
+ }
+ ""
+ end
+ case precision_storage_parameter
+ expect compile_fail
+ version 300 es
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float foo0 (lowp const in float x)
+ {
+ return x + 1.0;
+ }
+
+ void foo1 (mediump out float x)
+ {
+ x = 1.0;
+ }
+
+ float foo2 (highp inout float x)
+ {
+ return x + 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float result;
+ foo1(result);
+ float x0 = foo0(1.0);
+ foo2(result);
+ ${OUTPUT}
+ }
+ ""
+ end
+ case precision_parameter_storage
+ expect compile_fail
+ version 300 es
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float foo0 (lowp in const float x)
+ {
+ return x + 1.0;
+ }
+
+ void foo1 (mediump out float x)
+ {
+ x = 1.0;
+ }
+
+ float foo2 (highp inout float x)
+ {
+ return x + 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float result;
+ foo1(result);
+ float x0 = foo0(1.0);
+ foo2(result);
+ ${OUTPUT}
+ }
+ ""
+ end
+ case parameter_storage
+ expect compile_fail
+ version 300 es
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float foo0 (in const float x)
+ {
+ return x + 1.0;
+ }
+
+ void foo1 (out float x)
+ {
+ x = 1.0;
+ }
+
+ float foo2 (inout float x)
+ {
+ return x + 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float result;
+ foo1(result);
+ float x0 = foo0(1.0);
+ foo2(result);
+ ${OUTPUT}
+ }
+ ""
+ end
+ case precision_storage
+ expect compile_fail
+ version 300 es
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float foo0 (lowp const float x)
+ {
+ return x + 1.0;
+ }
+
+ void foo1 (mediump float x)
+ {
+ x = 1.0;
+ }
+
+ float foo2 (highp float x)
+ {
+ return x + 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float result;
+ foo1(result);
+ float x0 = foo0(1.0);
+ foo2(result);
+ ${OUTPUT}
+ }
+ ""
+ end
+ case precision_parameter
+ expect compile_fail
+ version 300 es
+ values {}
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float foo0 (lowp in float x)
+ {
+ return x + 1.0;
+ }
+
+ void foo1 (mediump out float x)
+ {
+ x = 1.0;
+ }
+
+ float foo2 (highp inout float x)
+ {
+ return x + 1.0;
+ }
+
+ void main()
+ {
+ ${SETUP}
+ float result;
+ foo1(result);
+ float x0 = foo0(1.0);
+ foo2(result);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ end # invalid
+
+end # parameters
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/scoping.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/scoping.html
new file mode 100644
index 0000000000..c525b32b68
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/scoping.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'scoping';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/scoping.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/scoping.test
new file mode 100644
index 0000000000..4f195250f3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/scoping.test
@@ -0,0 +1,901 @@
+group valid "Valid scoping and name redeclaration cases"
+
+ case local_variable_hides_global_variable
+ version 300 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ int a = -1;
+
+ void main()
+ {
+ ${SETUP}
+ int a = in0;
+
+ out0 = a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case block_variable_hides_local_variable
+ version 300 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${SETUP}
+ int a = in0;
+ {
+ int a = -1;
+ }
+ out0 = a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case block_variable_hides_global_variable
+ version 300 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ int a = -1;
+
+ void main()
+ {
+ ${SETUP}
+ {
+ int a = in0;
+
+ out0 = a;
+ }
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case for_init_statement_variable_hides_local_variable
+ version 300 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${SETUP}
+ int a = in0;
+ for (int a = 0; a < 10; a++)
+ {
+ }
+ out0 = a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case while_condition_variable_hides_local_variable
+ version 300 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${SETUP}
+ int a = in0;
+ int i = 0;
+ while (bool a = (i < 1))
+ {
+ i++;
+ }
+ out0 = a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case for_init_statement_variable_hides_global_variable
+ version 300 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ int a = 5;
+
+ void main()
+ {
+ ${SETUP}
+ for (int a = 0; a < 10; a++)
+ {
+ }
+ out0 = in0 + a - 5;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case while_condition_variable_hides_global_variable
+ version 300 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ int a = 5;
+
+ void main()
+ {
+ ${SETUP}
+ int i = 0;
+ while (bool a = (i < 1))
+ {
+ i++;
+ }
+ out0 = in0 + a - 5;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case variable_in_if_hides_global_variable
+ version 300 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ int a = 1;
+
+ void main()
+ {
+ ${SETUP}
+ if (true)
+ int a = 42;
+ out0 = a*in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case variable_from_outer_scope_visible_in_initializer
+ version 300 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ void main()
+ {
+ ${SETUP}
+ int a = in0;
+ {
+ int a = a+5, b = a-5;
+ out0 = b;
+ a = 42;
+ }
+ out0 = out0 + a - in0;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case local_int_variable_hides_struct_type
+ version 300 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ struct S { int val; };
+
+ void main()
+ {
+ ${SETUP}
+ int S = S(in0).val;
+ out0 = S;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case local_struct_variable_hides_struct_type
+ version 300 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ struct S { int val; };
+
+ void main()
+ {
+ ${SETUP}
+ S S = S(in0);
+ out0 = S.val;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case local_variable_hides_function
+ version 300 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ int foo (int x) { return x; }
+
+ void main()
+ {
+ ${SETUP}
+ int foo = in0;
+ out0 = foo;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case function_parameter_hides_global_variable
+ version 300 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ int a = -1;
+
+ int func (int a) { return a; }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case function_parameter_hides_struct_type
+ version 300 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ struct S { int x; };
+
+ int func (int S) { return S; }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case function_parameter_hides_function
+ version 300 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ int func (int func) { return func; }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case local_variable_in_inner_scope_hides_function_parameter
+ version 300 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ int func (int inp, int x) { { int x = 5; return inp + x - 5; } }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0, 42);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case redeclare_function
+ version 300 es
+ values
+ {
+ input int in0 = [ 1 | 2 | 3 ];
+ output int out0 = [ 1 | 2 | 3 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ int func (int x);
+ int func (int);
+ int func (int inp) { return inp; }
+
+ void main()
+ {
+ ${SETUP}
+ out0 = func(in0);
+ ${OUTPUT}
+ }
+ ""
+ end
+
+end
+
+group invalid "Invalid scoping behavior"
+
+ case redeclare_global_variable
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ int a;
+ float a;
+
+ void main()
+ {
+ a = 1.0;
+ ${POSITION_FRAG_COLOR} = vec4(a);
+ }
+ ""
+ end
+
+ case redeclare_local_variable
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ int a;
+ float a;
+ a = 1.0;
+ ${POSITION_FRAG_COLOR} = vec4(a);
+ }
+ ""
+ end
+
+ case redeclare_for_init_statement_variable
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ for (int i = 0; i < 10; i++)
+ {
+ int i = 11;
+ }
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ }
+ ""
+ end
+
+ case redeclare_for_condition_variable
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ for (int i = 0; int a = (i < 10); i++)
+ {
+ int a = 0;
+ }
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ }
+ ""
+ end
+
+ case redeclare_for_init_statement_variable_in_for_condition
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ float a;
+ for (int i = 0; int i = (i < 10); i++)
+ {
+ a = sin(i);
+ }
+ ${POSITION_FRAG_COLOR} = vec4(a);
+ }
+ ""
+ end
+
+ case redeclare_while_condition_variable
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ int a = 0;
+ while (int i = (a < 5))
+ {
+ int i = 11;
+ a += i;
+ }
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ }
+ ""
+ end
+
+ case redefine_function
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func(float x);
+
+ float func(float x) { return x + 1.0; }
+ float func(float x) { return x + 2.0; }
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(func(1.0));
+ }
+ ""
+ end
+
+ case redeclare_builtin
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float sin(float x);
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(sin(1.0));
+ }
+ ""
+ end
+
+ case redefine_builtin
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float sin(float x) { return x + 1.0; }
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(sin(1.0));
+ }
+ ""
+ end
+
+ case conflict_function_struct
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void f(int x);
+ struct f { int x; };
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1);
+ }
+ ""
+ end
+
+ case conflict_function_variable
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void f(int x);
+ float f;
+
+ void main()
+ {
+ f = 1.0;
+ ${POSITION_FRAG_COLOR} = vec4(f);
+ }
+ ""
+ end
+
+ case use_global_variable_before_declaration
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void func()
+ {
+ a = 2.0;
+ }
+
+ float a;
+
+ void main()
+ {
+ func();
+ ${POSITION_FRAG_COLOR} = vec4(a);
+ }
+ ""
+ end
+
+ case use_local_variable_before_declaration
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ float a = 1.0;
+ a = b;
+ float b = 2.0;
+
+ ${POSITION_FRAG_COLOR} = vec4(a);
+ }
+ ""
+ end
+
+ case use_struct_type_before_declaration
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float x) { return S(x).val; }
+ struct S { float val; };
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(func(1.0));
+ }
+ ""
+ end
+
+ case use_function_before_declaration
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func (float x) { return bar(x); }
+ float bar (float x) { return x; }
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(func(1.0));
+ }
+ ""
+ end
+
+ case use_variable_from_block_in_outer_scope
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ {
+ float a = 1.0;
+ }
+ ${POSITION_FRAG_COLOR} = vec4(a);
+ }
+ ""
+ end
+
+ case use_variable_from_if_in_outer_scope
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ if (true)
+ float a = 1.0;
+ ${POSITION_FRAG_COLOR} = vec4(a);
+ }
+ ""
+ end
+
+ case use_variable_from_else_in_outer_scope
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ if (false)
+ float a = 1.0;
+ else
+ float b = 2.0;
+ ${POSITION_FRAG_COLOR} = vec4(b);
+ }
+ ""
+ end
+
+ case use_variable_from_if_in_else
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ float a = 1.0;
+ if (true)
+ {
+ float b = 2.0;
+ }
+ else
+ {
+ a = b;
+ }
+ ${POSITION_FRAG_COLOR} = vec4(a);
+ }
+ ""
+ end
+
+ case use_variable_from_for_init_statement_in_outer_scope
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ float x = 0.0;
+ for (int i = 0; i < 10; i++)
+ {
+ x += sin(i);
+ }
+ ${POSITION_FRAG_COLOR} = vec4(float(i));
+ }
+ ""
+ end
+
+ case use_variable_from_while_condition_in_outer_scope
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ int a = 1;
+ while (bool b = (a == 1))
+ {
+ a++;
+ }
+ ${POSITION_FRAG_COLOR} = vec4(float(b));
+ }
+ ""
+ end
+
+ case use_parameter_names_from_function_declaration
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ float func(float a, float b);
+
+ float func(float x, float y) { return a+b; }
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(func(1.0, 2.0));
+ }
+ ""
+ end
+
+ case variable_not_visible_in_own_initializer
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main()
+ {
+ float x = x;
+ ${POSITION_FRAG_COLOR} = vec4(x);
+ }
+ ""
+ end
+
+ case local_variable_hides_function_parameter
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+ float func (float inp, float x) { int x = 5.0; return inp + x - 5.0; }
+
+ void main()
+ {
+ ${POSITION_FRAG_COLOR} = vec4(func(1.0, 2.0));
+ }
+ ""
+ end
+
+end # invalid
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/split-conversions.js b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/split-conversions.js
new file mode 100644
index 0000000000..c3eeb7928f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/split-conversions.js
@@ -0,0 +1,33 @@
+/*
+
+run with
+ node split-conversions.js
+
+notes:
+
+conversions.test is generated from the C++ based dEQP tests
+https://github.com/KhronosGroup/VK-GL-CTS/blob/main/modules/gles3/scripts/gen-conversions.py
+
+You need to manually add these tests to the 00_test_list.txt
+
+*/
+
+const fs = require('fs');
+
+process.chdir(__dirname);
+
+const testWarning = `\
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-conversions.js
+
+`;
+
+const conversionsHTML = fs.readFileSync('conversions.template', {encoding: 'utf8'});
+const conversions = fs.readFileSync('conversions.test', {encoding: 'utf8'});
+const groupMatches = conversions.matchAll(/group ([a-zA-Z0-9_]+) [\s\S]+?end #.*?\n/g);
+for (const [str, groupName] of groupMatches) {
+ const baseName = `conversions_${groupName}`;
+ fs.writeFileSync(`${baseName}.test`, `${testWarning}${str}`);
+ fs.writeFileSync(`${baseName}.html`, `<!--\n${testWarning}-->\n${conversionsHTML.replace("'conversions'", `'${baseName}'`)}`);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/split-swizzles.js b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/split-swizzles.js
new file mode 100644
index 0000000000..7205d82afd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/split-swizzles.js
@@ -0,0 +1,47 @@
+/*
+
+run with
+ node split-swizzles.js
+
+notes:
+
+swizzles.test is generated from the C++ based dEQP tests
+https://github.com/KhronosGroup/VK-GL-CTS/blob/main/modules/gles3/scripts/gen-swizzles.py
+
+You need to manually add these tests to the 00_test_list.txt
+
+*/
+
+const fs = require('fs');
+
+process.chdir(__dirname);
+
+const testWarning = `\
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+`;
+
+const swizzlesHTML = fs.readFileSync('swizzles.template', {encoding: 'utf8'});
+const swizzles = fs.readFileSync('swizzles.test', {encoding: 'utf8'});
+const caseMatches = swizzles.matchAll(/\scase (\w+)_(\w+)_(\w+)\n[\s\S]+?end\n/g);
+
+// quick sanity check
+const numCases = swizzles.matchAll('\bcase\b').length;
+if (caseMatches.length !== numCases) {
+ throw Error(`numCases(${numCases}) does not match caseMatches.length(${caseMatches.length})`);
+}
+
+const byType = {}
+for (const [str, precision, type, swizzle] of caseMatches) {
+ byType[type] = byType[type] || [];
+ byType[type].push(str);
+}
+
+for (const [type, cases] of Object.entries(byType)) {
+ const baseName = `swizzles_${type}`;
+ const str = `group ${type}_swizzles "${type} swizzles"\n\n${cases.join('\n\n')}\n\nend # ${type}_swizzles`;
+ fs.writeFileSync(`${baseName}.test`, `${testWarning}${str}`);
+ fs.writeFileSync(`${baseName}.html`, `<!--\n${testWarning}-->\n${swizzlesHTML.replace("'swizzles'", `'${baseName}'`)}`);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/switch.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/switch.html
new file mode 100644
index 0000000000..9c9a5a0e1b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/switch.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'switch';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/switch.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/switch.test
new file mode 100644
index 0000000000..687eb7ebab
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/switch.test
@@ -0,0 +1,633 @@
+
+case empty_condition
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ switch ()
+ {
+ case 1:
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+
+ ${OUTPUT}
+ }
+ ""
+end
+
+case condition_float
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ float c = 1.0;
+ switch (c)
+ {
+ case 1:
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+
+ ${OUTPUT}
+ }
+ ""
+end
+
+case condition_bool
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ bool c = true;
+ switch (c)
+ {
+ case 1:
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+
+ ${OUTPUT}
+ }
+ ""
+end
+
+case condition_ivec2
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ ivec2 c = ivec2(1, 1);
+ switch (c)
+ {
+ case 1:
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+
+ ${OUTPUT}
+ }
+ ""
+end
+
+case condition_struct
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ struct S { int m; };
+
+ void main ()
+ {
+ S c = S(1);
+ switch (c)
+ {
+ case 1:
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+
+ ${OUTPUT}
+ }
+ ""
+end
+
+case duplicate_label
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ int c = 1;
+ switch (c)
+ {
+ case 1:
+ case 1:
+ break;
+ }
+
+ ${OUTPUT}
+ }
+ ""
+end
+
+case float_label
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ int c = 1;
+ switch (c)
+ {
+ case 1.0:
+ break;
+ }
+
+ ${OUTPUT}
+ }
+ ""
+end
+
+case non_const_int_label
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ int c = 1;
+ int l = 2;
+ switch (c)
+ {
+ case l:
+ break;
+ }
+
+ ${OUTPUT}
+ }
+ ""
+end
+
+case statement_before_label
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ switch (1)
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ case 1:
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ }
+
+ ${OUTPUT}
+ }
+ ""
+end
+
+case statement_before_default_label
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ switch (1)
+ {
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ default:
+ ${POSITION_FRAG_COLOR} = vec4(0.0);
+ }
+
+ ${OUTPUT}
+ }
+ ""
+end
+
+case no_statement_after_label
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ switch (1)
+ {
+ case 0:
+ break;
+ case 1:
+ }
+
+ ${OUTPUT}
+ }
+ ""
+end
+
+case no_statement_after_default_label
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ switch (1)
+ {
+ case 0:
+ break;
+ default:
+ }
+
+ ${OUTPUT}
+ }
+ ""
+end
+
+case case_in_if
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ float f = 1.0;
+ switch (1)
+ {
+ case 0:
+ f = 0.0;
+ if (f > 0.0)
+ {
+ case 1:
+ f *= 2.0;
+ }
+ break;
+ case 2:
+ break;
+ }
+
+ ${OUTPUT}
+ }
+ ""
+end
+
+case default_in_if
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ float f = 1.0;
+ switch (1)
+ {
+ case 0:
+ f = 0.0;
+ if (f > 0.0)
+ {
+ default:
+ f *= 2.0;
+ }
+ break;
+ case 2:
+ break;
+ }
+
+ ${OUTPUT}
+ }
+ ""
+end
+
+case case_in_for_loop
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ float f = 1.0;
+ switch (1)
+ {
+ case 0:
+ f = 0.0;
+ for (int i = 0; i < 2; i++)
+ {
+ case 1:
+ f *= 2.0;
+ }
+ break;
+ case 2:
+ break;
+ }
+
+ ${OUTPUT}
+ }
+ ""
+end
+
+case default_in_for_loop
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ float f = 1.0;
+ switch (1)
+ {
+ case 0:
+ f = 0.0;
+ for (int i = 0; i < 2; i++)
+ {
+ default:
+ f *= 2.0;
+ }
+ break;
+ case 2:
+ break;
+ }
+
+ ${OUTPUT}
+ }
+ ""
+end
+
+case case_in_while_loop
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ float f = 1.0;
+ switch (1)
+ {
+ case 0:
+ f = 0.0;
+ while (f > 0.0)
+ {
+ case 1:
+ f *= 2.0;
+ }
+ break;
+ case 2:
+ break;
+ }
+
+ ${OUTPUT}
+ }
+ ""
+end
+
+case default_in_while_loop
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ float f = 1.0;
+ switch (1)
+ {
+ case 0:
+ f = 0.0;
+ while (f > 0.0)
+ {
+ default:
+ f *= 2.0;
+ }
+ break;
+ case 2:
+ break;
+ }
+
+ ${OUTPUT}
+ }
+ ""
+end
+
+case case_in_do_while_loop
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ float f = 1.0;
+ switch (1)
+ {
+ case 0:
+ f = 0.0;
+ do
+ {
+ case 1:
+ f *= 2.0;
+ } while (f > 0.0);
+ break;
+ case 2:
+ break;
+ }
+
+ ${OUTPUT}
+ }
+ ""
+end
+
+case default_in_do_while_loop
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ float f = 1.0;
+ switch (1)
+ {
+ case 0:
+ f = 0.0;
+ do
+ {
+ default:
+ f *= 2.0;
+ } while (f > 0.0);
+ break;
+ case 2:
+ break;
+ }
+
+ ${OUTPUT}
+ }
+ ""
+end
+
+case missing_colon
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ switch (1)
+ {
+ case 1
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+
+ ${OUTPUT}
+ }
+ ""
+end
+
+case missing_opening_brace
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ switch (1)
+ case 1:
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+
+ ${OUTPUT}
+ }
+ ""
+end
+
+case missing_closing_brace
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ switch (1)
+ {
+ case 1:
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+
+ ${OUTPUT}
+ }
+ ""
+end
+
+case double_case
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ switch (1)
+ {
+ case case 1:
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+
+ ${OUTPUT}
+ }
+ ""
+end
+
+case double_default_1
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ switch (1)
+ {
+ default:
+ break;
+ default:
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+
+ ${OUTPUT}
+ }
+ ""
+end
+
+case double_default_2
+ version 300 es
+ expect compile_fail
+ both ""
+ #version 300 es
+ precision mediump float;
+ ${DECLARATIONS}
+
+ void main ()
+ {
+ switch (1)
+ {
+ default default:
+ ${POSITION_FRAG_COLOR} = vec4(1.0);
+ }
+
+ ${OUTPUT}
+ }
+ ""
+end
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles.template b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles.template
new file mode 100644
index 0000000000..6f633be636
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles.template
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'swizzles';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles.test
new file mode 100644
index 0000000000..2477ebb064
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles.test
@@ -0,0 +1,7459 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+
+group vector_swizzles "Vector Swizzles"
+
+ case mediump_vec2_x
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_xx
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(-0.5, -0.5) | vec2(-32.0, -32.0) | vec2(-0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_xy
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_yx
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.5, 0.0) | vec2(1.25, 1.0) | vec2(-2.25, -0.5) | vec2(64.0, -32.0) | vec2(-0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_yxy
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yxy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_xyxx
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_yyyy
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyyy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_s
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_ss
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(-0.5, -0.5) | vec2(-32.0, -32.0) | vec2(-0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_st
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.st;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_ts
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.5, 0.0) | vec2(1.25, 1.0) | vec2(-2.25, -0.5) | vec2(64.0, -32.0) | vec2(-0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_tst
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tst;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_stss
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_tttt
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tttt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_r
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_rr
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(-0.5, -0.5) | vec2(-32.0, -32.0) | vec2(-0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_rg
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_gr
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.5, 0.0) | vec2(1.25, 1.0) | vec2(-2.25, -0.5) | vec2(64.0, -32.0) | vec2(-0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_grg
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.grg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_rgrr
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec2_gggg
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gggg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_x
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_z
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output float out0 = [ 0.75 | 1.125 | -4.875 | -51.0 | 0.0526315789474 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.z;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_xz
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec2 out0 = [ vec2(0.0, 0.75) | vec2(1.0, 1.125) | vec2(-0.5, -4.875) | vec2(-32.0, -51.0) | vec2(-0.75, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_zz
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec2 out0 = [ vec2(0.75, 0.75) | vec2(1.125, 1.125) | vec2(-4.875, -4.875) | vec2(-51.0, -51.0) | vec2(0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_xyz
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_zyx
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.5, 0.0) | vec3(1.125, 1.25, 1.0) | vec3(-4.875, -2.25, -0.5) | vec3(-51.0, 64.0, -32.0) | vec3(0.0526315789474, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_xxx
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(-0.5, -0.5, -0.5) | vec3(-32.0, -32.0, -32.0) | vec3(-0.75, -0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_zzz
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.75, 0.75) | vec3(1.125, 1.125, 1.125) | vec3(-4.875, -4.875, -4.875) | vec3(-51.0, -51.0, -51.0) | vec3(0.0526315789474, 0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_zzy
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.75, 0.5) | vec3(1.125, 1.125, 1.25) | vec3(-4.875, -4.875, -2.25) | vec3(-51.0, -51.0, 64.0) | vec3(0.0526315789474, 0.0526315789474, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_yxy
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yxy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_xzx
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.75, 0.0) | vec3(1.0, 1.125, 1.0) | vec3(-0.5, -4.875, -0.5) | vec3(-32.0, -51.0, -32.0) | vec3(-0.75, 0.0526315789474, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xzx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_xyyx
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.5, 0.0) | vec4(1.0, 1.25, 1.25, 1.0) | vec4(-0.5, -2.25, -2.25, -0.5) | vec4(-32.0, 64.0, 64.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_zzzz
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec4 out0 = [ vec4(0.75, 0.75, 0.75, 0.75) | vec4(1.125, 1.125, 1.125, 1.125) | vec4(-4.875, -4.875, -4.875, -4.875) | vec4(-51.0, -51.0, -51.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzzz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_s
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_p
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output float out0 = [ 0.75 | 1.125 | -4.875 | -51.0 | 0.0526315789474 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.p;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_sp
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec2 out0 = [ vec2(0.0, 0.75) | vec2(1.0, 1.125) | vec2(-0.5, -4.875) | vec2(-32.0, -51.0) | vec2(-0.75, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_pp
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec2 out0 = [ vec2(0.75, 0.75) | vec2(1.125, 1.125) | vec2(-4.875, -4.875) | vec2(-51.0, -51.0) | vec2(0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_stp
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_pts
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.5, 0.0) | vec3(1.125, 1.25, 1.0) | vec3(-4.875, -2.25, -0.5) | vec3(-51.0, 64.0, -32.0) | vec3(0.0526315789474, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_sss
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(-0.5, -0.5, -0.5) | vec3(-32.0, -32.0, -32.0) | vec3(-0.75, -0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_ppp
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.75, 0.75) | vec3(1.125, 1.125, 1.125) | vec3(-4.875, -4.875, -4.875) | vec3(-51.0, -51.0, -51.0) | vec3(0.0526315789474, 0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_ppt
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.75, 0.5) | vec3(1.125, 1.125, 1.25) | vec3(-4.875, -4.875, -2.25) | vec3(-51.0, -51.0, 64.0) | vec3(0.0526315789474, 0.0526315789474, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_tst
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tst;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_sps
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.75, 0.0) | vec3(1.0, 1.125, 1.0) | vec3(-0.5, -4.875, -0.5) | vec3(-32.0, -51.0, -32.0) | vec3(-0.75, 0.0526315789474, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sps;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_stts
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.5, 0.0) | vec4(1.0, 1.25, 1.25, 1.0) | vec4(-0.5, -2.25, -2.25, -0.5) | vec4(-32.0, 64.0, 64.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_pppp
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec4 out0 = [ vec4(0.75, 0.75, 0.75, 0.75) | vec4(1.125, 1.125, 1.125, 1.125) | vec4(-4.875, -4.875, -4.875, -4.875) | vec4(-51.0, -51.0, -51.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pppp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_r
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_b
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output float out0 = [ 0.75 | 1.125 | -4.875 | -51.0 | 0.0526315789474 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.b;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_rb
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec2 out0 = [ vec2(0.0, 0.75) | vec2(1.0, 1.125) | vec2(-0.5, -4.875) | vec2(-32.0, -51.0) | vec2(-0.75, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_bb
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec2 out0 = [ vec2(0.75, 0.75) | vec2(1.125, 1.125) | vec2(-4.875, -4.875) | vec2(-51.0, -51.0) | vec2(0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_rgb
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_bgr
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.5, 0.0) | vec3(1.125, 1.25, 1.0) | vec3(-4.875, -2.25, -0.5) | vec3(-51.0, 64.0, -32.0) | vec3(0.0526315789474, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bgr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_rrr
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(-0.5, -0.5, -0.5) | vec3(-32.0, -32.0, -32.0) | vec3(-0.75, -0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_bbb
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.75, 0.75) | vec3(1.125, 1.125, 1.125) | vec3(-4.875, -4.875, -4.875) | vec3(-51.0, -51.0, -51.0) | vec3(0.0526315789474, 0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_bbg
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.75, 0.5) | vec3(1.125, 1.125, 1.25) | vec3(-4.875, -4.875, -2.25) | vec3(-51.0, -51.0, 64.0) | vec3(0.0526315789474, 0.0526315789474, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_grg
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.grg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_rbr
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.75, 0.0) | vec3(1.0, 1.125, 1.0) | vec3(-0.5, -4.875, -0.5) | vec3(-32.0, -51.0, -32.0) | vec3(-0.75, 0.0526315789474, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rbr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_rggr
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.5, 0.0) | vec4(1.0, 1.25, 1.25, 1.0) | vec4(-0.5, -2.25, -2.25, -0.5) | vec4(-32.0, 64.0, 64.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rggr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec3_bbbb
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec4 out0 = [ vec4(0.75, 0.75, 0.75, 0.75) | vec4(1.125, 1.125, 1.125, 1.125) | vec4(-4.875, -4.875, -4.875, -4.875) | vec4(-51.0, -51.0, -51.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbbb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_x
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_w
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output float out0 = [ 0.825 | 1.75 | 9.0 | 24.0 | 0.25 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.w;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_wx
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec2 out0 = [ vec2(0.825, 0.0) | vec2(1.75, 1.0) | vec2(9.0, -0.5) | vec2(24.0, -32.0) | vec2(0.25, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_wz
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec2 out0 = [ vec2(0.825, 0.75) | vec2(1.75, 1.125) | vec2(9.0, -4.875) | vec2(24.0, -51.0) | vec2(0.25, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_www
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.825, 0.825, 0.825) | vec3(1.75, 1.75, 1.75) | vec3(9.0, 9.0, 9.0) | vec3(24.0, 24.0, 24.0) | vec3(0.25, 0.25, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.www;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_yyw
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.5, 0.5, 0.825) | vec3(1.25, 1.25, 1.75) | vec3(-2.25, -2.25, 9.0) | vec3(64.0, 64.0, 24.0) | vec3(-0.0322580645161, -0.0322580645161, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_wzy
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.825, 0.75, 0.5) | vec3(1.75, 1.125, 1.25) | vec3(9.0, -4.875, -2.25) | vec3(24.0, -51.0, 64.0) | vec3(0.25, 0.0526315789474, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_xyzw
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyzw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_wzyx
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.75, 0.5, 0.0) | vec4(1.75, 1.125, 1.25, 1.0) | vec4(9.0, -4.875, -2.25, -0.5) | vec4(24.0, -51.0, 64.0, -32.0) | vec4(0.25, 0.0526315789474, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_xxxx
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(-0.5, -0.5, -0.5, -0.5) | vec4(-32.0, -32.0, -32.0, -32.0) | vec4(-0.75, -0.75, -0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xxxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_yyyy
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyyy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_wwww
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.825) | vec4(1.75, 1.75, 1.75, 1.75) | vec4(9.0, 9.0, 9.0, 9.0) | vec4(24.0, 24.0, 24.0, 24.0) | vec4(0.25, 0.25, 0.25, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wwww;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_wzzw
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.75, 0.75, 0.825) | vec4(1.75, 1.125, 1.125, 1.75) | vec4(9.0, -4.875, -4.875, 9.0) | vec4(24.0, -51.0, -51.0, 24.0) | vec4(0.25, 0.0526315789474, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzzw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_wwwy
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.5) | vec4(1.75, 1.75, 1.75, 1.25) | vec4(9.0, 9.0, 9.0, -2.25) | vec4(24.0, 24.0, 24.0, 64.0) | vec4(0.25, 0.25, 0.25, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wwwy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_xyxx
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_zzwz
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.75, 0.75, 0.825, 0.75) | vec4(1.125, 1.125, 1.75, 1.125) | vec4(-4.875, -4.875, 9.0, -4.875) | vec4(-51.0, -51.0, 24.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.25, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzwz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_s
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_q
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output float out0 = [ 0.825 | 1.75 | 9.0 | 24.0 | 0.25 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.q;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_qs
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec2 out0 = [ vec2(0.825, 0.0) | vec2(1.75, 1.0) | vec2(9.0, -0.5) | vec2(24.0, -32.0) | vec2(0.25, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qs;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_qp
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec2 out0 = [ vec2(0.825, 0.75) | vec2(1.75, 1.125) | vec2(9.0, -4.875) | vec2(24.0, -51.0) | vec2(0.25, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_qqq
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.825, 0.825, 0.825) | vec3(1.75, 1.75, 1.75) | vec3(9.0, 9.0, 9.0) | vec3(24.0, 24.0, 24.0) | vec3(0.25, 0.25, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_ttq
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.5, 0.5, 0.825) | vec3(1.25, 1.25, 1.75) | vec3(-2.25, -2.25, 9.0) | vec3(64.0, 64.0, 24.0) | vec3(-0.0322580645161, -0.0322580645161, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ttq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_qpt
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.825, 0.75, 0.5) | vec3(1.75, 1.125, 1.25) | vec3(9.0, -4.875, -2.25) | vec3(24.0, -51.0, 64.0) | vec3(0.25, 0.0526315789474, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qpt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_stpq
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stpq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_qpts
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.75, 0.5, 0.0) | vec4(1.75, 1.125, 1.25, 1.0) | vec4(9.0, -4.875, -2.25, -0.5) | vec4(24.0, -51.0, 64.0, -32.0) | vec4(0.25, 0.0526315789474, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qpts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_ssss
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(-0.5, -0.5, -0.5, -0.5) | vec4(-32.0, -32.0, -32.0, -32.0) | vec4(-0.75, -0.75, -0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ssss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_tttt
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tttt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_qqqq
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.825) | vec4(1.75, 1.75, 1.75, 1.75) | vec4(9.0, 9.0, 9.0, 9.0) | vec4(24.0, 24.0, 24.0, 24.0) | vec4(0.25, 0.25, 0.25, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqqq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_qppq
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.75, 0.75, 0.825) | vec4(1.75, 1.125, 1.125, 1.75) | vec4(9.0, -4.875, -4.875, 9.0) | vec4(24.0, -51.0, -51.0, 24.0) | vec4(0.25, 0.0526315789474, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qppq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_qqqt
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.5) | vec4(1.75, 1.75, 1.75, 1.25) | vec4(9.0, 9.0, 9.0, -2.25) | vec4(24.0, 24.0, 24.0, 64.0) | vec4(0.25, 0.25, 0.25, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqqt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_stss
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_ppqp
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.75, 0.75, 0.825, 0.75) | vec4(1.125, 1.125, 1.75, 1.125) | vec4(-4.875, -4.875, 9.0, -4.875) | vec4(-51.0, -51.0, 24.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.25, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppqp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_r
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_a
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output float out0 = [ 0.825 | 1.75 | 9.0 | 24.0 | 0.25 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_ar
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec2 out0 = [ vec2(0.825, 0.0) | vec2(1.75, 1.0) | vec2(9.0, -0.5) | vec2(24.0, -32.0) | vec2(0.25, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ar;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_ab
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec2 out0 = [ vec2(0.825, 0.75) | vec2(1.75, 1.125) | vec2(9.0, -4.875) | vec2(24.0, -51.0) | vec2(0.25, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ab;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_aaa
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.825, 0.825, 0.825) | vec3(1.75, 1.75, 1.75) | vec3(9.0, 9.0, 9.0) | vec3(24.0, 24.0, 24.0) | vec3(0.25, 0.25, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaa;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_gga
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.5, 0.5, 0.825) | vec3(1.25, 1.25, 1.75) | vec3(-2.25, -2.25, 9.0) | vec3(64.0, 64.0, 24.0) | vec3(-0.0322580645161, -0.0322580645161, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gga;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_abg
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.825, 0.75, 0.5) | vec3(1.75, 1.125, 1.25) | vec3(9.0, -4.875, -2.25) | vec3(24.0, -51.0, 64.0) | vec3(0.25, 0.0526315789474, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_rgba
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgba;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_abgr
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.75, 0.5, 0.0) | vec4(1.75, 1.125, 1.25, 1.0) | vec4(9.0, -4.875, -2.25, -0.5) | vec4(24.0, -51.0, 64.0, -32.0) | vec4(0.25, 0.0526315789474, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abgr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_rrrr
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(-0.5, -0.5, -0.5, -0.5) | vec4(-32.0, -32.0, -32.0, -32.0) | vec4(-0.75, -0.75, -0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rrrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_gggg
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gggg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_aaaa
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.825) | vec4(1.75, 1.75, 1.75, 1.75) | vec4(9.0, 9.0, 9.0, 9.0) | vec4(24.0, 24.0, 24.0, 24.0) | vec4(0.25, 0.25, 0.25, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaaa;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_abba
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.75, 0.75, 0.825) | vec4(1.75, 1.125, 1.125, 1.75) | vec4(9.0, -4.875, -4.875, 9.0) | vec4(24.0, -51.0, -51.0, 24.0) | vec4(0.25, 0.0526315789474, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abba;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_aaag
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.5) | vec4(1.75, 1.75, 1.75, 1.25) | vec4(9.0, 9.0, 9.0, -2.25) | vec4(24.0, 24.0, 24.0, 64.0) | vec4(0.25, 0.25, 0.25, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaag;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_rgrr
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_vec4_bbab
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.75, 0.75, 0.825, 0.75) | vec4(1.125, 1.125, 1.75, 1.125) | vec4(-4.875, -4.875, 9.0, -4.875) | vec4(-51.0, -51.0, 24.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.25, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbab;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_x
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_xx
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_xy
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_yx
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-2, 0) | ivec2(64, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_yxy
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yxy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_xyxx
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_yyyy
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyyy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_s
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_ss
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_st
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.st;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_ts
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-2, 0) | ivec2(64, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_tst
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tst;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_stss
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_tttt
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tttt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_r
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_rr
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_rg
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_gr
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-2, 0) | ivec2(64, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_grg
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.grg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_rgrr
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec2_gggg
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gggg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_x
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_z
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | -4 | -51 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.z;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_xz
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -4) | ivec2(-32, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_zz
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-4, -4) | ivec2(-51, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_xyz
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_zyx
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -2, 0) | ivec3(-51, 64, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_xxx
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, -32, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_zzz
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -4) | ivec3(-51, -51, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_zzy
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -2) | ivec3(-51, -51, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_yxy
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yxy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_xzx
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -4, 0) | ivec3(-32, -51, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xzx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_xyyx
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -2, 0) | ivec4(-32, 64, 64, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_zzzz
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, -4, -4) | ivec4(-51, -51, -51, -51) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzzz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_s
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_p
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | -4 | -51 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.p;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_sp
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -4) | ivec2(-32, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_pp
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-4, -4) | ivec2(-51, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_stp
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_pts
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -2, 0) | ivec3(-51, 64, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_sss
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, -32, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_ppp
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -4) | ivec3(-51, -51, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_ppt
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -2) | ivec3(-51, -51, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_tst
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tst;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_sps
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -4, 0) | ivec3(-32, -51, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sps;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_stts
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -2, 0) | ivec4(-32, 64, 64, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_pppp
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, -4, -4) | ivec4(-51, -51, -51, -51) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pppp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_r
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_b
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | -4 | -51 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.b;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_rb
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -4) | ivec2(-32, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_bb
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-4, -4) | ivec2(-51, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_rgb
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_bgr
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -2, 0) | ivec3(-51, 64, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bgr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_rrr
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, -32, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_bbb
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -4) | ivec3(-51, -51, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_bbg
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -2) | ivec3(-51, -51, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_grg
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.grg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_rbr
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -4, 0) | ivec3(-32, -51, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rbr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_rggr
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -2, 0) | ivec4(-32, 64, 64, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rggr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec3_bbbb
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, -4, -4) | ivec4(-51, -51, -51, -51) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbbb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_x
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_w
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 9 | 24 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.w;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_wx
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, 0) | ivec2(24, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_wz
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, -4) | ivec2(24, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_www
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, 9, 9) | ivec3(24, 24, 24) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.www;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_yyw
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, -2, 9) | ivec3(64, 64, 24) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_wzy
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, -4, -2) | ivec3(24, -51, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_xyzw
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyzw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_wzyx
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -2, 0) | ivec4(24, -51, 64, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_xxxx
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, -32, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xxxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_yyyy
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyyy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_wwww
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, 9) | ivec4(24, 24, 24, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wwww;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_wzzw
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -4, 9) | ivec4(24, -51, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzzw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_wwwy
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, -2) | ivec4(24, 24, 24, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wwwy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_xyxx
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_zzwz
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, 9, -4) | ivec4(-51, -51, 24, -51) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzwz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_s
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_q
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 9 | 24 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.q;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_qs
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, 0) | ivec2(24, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qs;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_qp
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, -4) | ivec2(24, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_qqq
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, 9, 9) | ivec3(24, 24, 24) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_ttq
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, -2, 9) | ivec3(64, 64, 24) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ttq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_qpt
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, -4, -2) | ivec3(24, -51, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qpt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_stpq
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stpq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_qpts
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -2, 0) | ivec4(24, -51, 64, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qpts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_ssss
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, -32, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ssss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_tttt
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tttt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_qqqq
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, 9) | ivec4(24, 24, 24, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqqq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_qppq
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -4, 9) | ivec4(24, -51, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qppq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_qqqt
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, -2) | ivec4(24, 24, 24, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqqt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_stss
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_ppqp
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, 9, -4) | ivec4(-51, -51, 24, -51) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppqp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_r
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_a
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 9 | 24 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_ar
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, 0) | ivec2(24, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ar;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_ab
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, -4) | ivec2(24, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ab;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_aaa
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, 9, 9) | ivec3(24, 24, 24) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaa;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_gga
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, -2, 9) | ivec3(64, 64, 24) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gga;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_abg
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, -4, -2) | ivec3(24, -51, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_rgba
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgba;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_abgr
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -2, 0) | ivec4(24, -51, 64, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abgr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_rrrr
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, -32, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rrrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_gggg
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gggg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_aaaa
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, 9) | ivec4(24, 24, 24, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaaa;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_abba
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -4, 9) | ivec4(24, -51, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abba;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_aaag
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, -2) | ivec4(24, 24, 24, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaag;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_rgrr
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_ivec4_bbab
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, 9, -4) | ivec4(-51, -51, 24, -51) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbab;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_x
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_xx
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_xy
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_yx
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_yxy
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yxy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_xyxx
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_yyyy
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyyy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_s
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_ss
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_st
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.st;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_ts
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_tst
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tst;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_stss
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_tttt
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tttt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_r
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_rr
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_rg
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_gr
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_grg
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.grg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_rgrr
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec2_gggg
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gggg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_x
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_z
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bool out0 = [ false | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.z;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_xz
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_zz
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_xyz
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_zyx
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_xxx
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_zzz
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_zzy
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_yxy
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yxy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_xzx
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xzx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_xyyx
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_zzzz
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzzz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_s
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_p
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bool out0 = [ false | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.p;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_sp
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_pp
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_stp
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_pts
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_sss
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_ppp
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_ppt
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_tst
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tst;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_sps
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sps;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_stts
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_pppp
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pppp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_r
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_b
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bool out0 = [ false | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.b;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_rb
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_bb
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_rgb
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_bgr
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bgr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_rrr
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_bbb
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_bbg
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_grg
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.grg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_rbr
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rbr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_rggr
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rggr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec3_bbbb
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbbb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_x
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_w
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bool out0 = [ true | true | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.w;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_wx
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_wz
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_www
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.www;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_yyw
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, true) | bvec3(true, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_wzy
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(true, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_xyzw
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyzw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_wzyx
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, false) | bvec4(false, false, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_xxxx
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xxxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_yyyy
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyyy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_wwww
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wwww;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_wzzw
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzzw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_wwwy
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, false) | bvec4(true, true, true, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wwwy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_xyxx
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_zzwz
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(false, false, true, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzwz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_s
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_q
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bool out0 = [ true | true | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.q;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_qs
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qs;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_qp
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_qqq
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_ttq
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, true) | bvec3(true, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ttq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_qpt
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(true, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qpt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_stpq
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stpq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_qpts
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, false) | bvec4(false, false, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qpts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_ssss
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ssss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_tttt
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tttt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_qqqq
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqqq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_qppq
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qppq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_qqqt
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, false) | bvec4(true, true, true, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqqt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_stss
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_ppqp
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(false, false, true, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppqp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_r
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_a
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bool out0 = [ true | true | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_ar
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ar;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_ab
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ab;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_aaa
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaa;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_gga
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, true) | bvec3(true, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gga;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_abg
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(true, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_rgba
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgba;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_abgr
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, false) | bvec4(false, false, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abgr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_rrrr
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rrrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_gggg
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gggg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_aaaa
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaaa;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_abba
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abba;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_aaag
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, false) | bvec4(true, true, true, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaag;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_rgrr
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+ case mediump_bvec4_bbab
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(false, false, true, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbab;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # vector_swizzles
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_bvec2.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_bvec2.html
new file mode 100644
index 0000000000..b83b4d4644
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_bvec2.html
@@ -0,0 +1,42 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'swizzles_bvec2';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_bvec2.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_bvec2.test
new file mode 100644
index 0000000000..f1d20ef1ae
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_bvec2.test
@@ -0,0 +1,511 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+group bvec2_swizzles "bvec2 swizzles"
+
+ case mediump_bvec2_x
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_xx
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_xy
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_yx
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_yxy
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yxy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_xyxx
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_yyyy
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyyy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_s
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_ss
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_st
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.st;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_ts
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_tst
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tst;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_stss
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_tttt
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tttt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_r
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_rr
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_rg
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_gr
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec2 out0 = [ bvec2(false, true) | bvec2(false, false) | bvec2(true, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_grg
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.grg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_rgrr
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec2_gggg
+ version 300 es
+ values
+ {
+ input bvec2 in0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, true) | bvec2(true, true) | bvec2(false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gggg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # bvec2_swizzles \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_bvec3.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_bvec3.html
new file mode 100644
index 0000000000..20ab741356
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_bvec3.html
@@ -0,0 +1,42 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'swizzles_bvec3';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_bvec3.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_bvec3.test
new file mode 100644
index 0000000000..31a2ab07f4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_bvec3.test
@@ -0,0 +1,943 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+group bvec3_swizzles "bvec3 swizzles"
+
+ case mediump_bvec3_x
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_z
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bool out0 = [ false | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.z;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_xz
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_zz
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_xyz
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_zyx
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_xxx
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_zzz
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_zzy
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_yxy
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yxy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_xzx
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xzx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_xyyx
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_zzzz
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzzz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_s
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_p
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bool out0 = [ false | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.p;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_sp
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_pp
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_stp
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_pts
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_sss
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_ppp
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_ppt
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_tst
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tst;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_sps
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sps;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_stts
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_pppp
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pppp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_r
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_b
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bool out0 = [ false | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.b;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_rb
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_bb
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec2 out0 = [ bvec2(false, false) | bvec2(false, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_rgb
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_bgr
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bgr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_rrr
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_bbb
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_bbg
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, false) | bvec3(false, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_grg
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, true, false) | bvec3(false, false, false) | bvec3(true, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.grg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_rbr
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, false, false) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rbr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_rggr
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(false, true, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rggr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec3_bbbb
+ version 300 es
+ values
+ {
+ input bvec3 in0 = [ bvec3(true, false, false) | bvec3(false, false, false) | bvec3(false, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbbb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # bvec3_swizzles \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_bvec4.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_bvec4.html
new file mode 100644
index 0000000000..39a59c3417
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_bvec4.html
@@ -0,0 +1,42 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'swizzles_bvec4';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_bvec4.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_bvec4.test
new file mode 100644
index 0000000000..55b85c8b05
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_bvec4.test
@@ -0,0 +1,1159 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+group bvec4_swizzles "bvec4 swizzles"
+
+ case mediump_bvec4_x
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_w
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bool out0 = [ true | true | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.w;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_wx
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_wz
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_www
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.www;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_yyw
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, true) | bvec3(true, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_wzy
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(true, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_xyzw
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyzw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_wzyx
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, false) | bvec4(false, false, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_xxxx
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xxxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_yyyy
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyyy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_wwww
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wwww;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_wzzw
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzzw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_wwwy
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, false) | bvec4(true, true, true, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wwwy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_xyxx
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_zzwz
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(false, false, true, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzwz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_s
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_q
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bool out0 = [ true | true | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.q;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_qs
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qs;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_qp
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_qqq
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_ttq
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, true) | bvec3(true, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ttq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_qpt
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(true, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qpt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_stpq
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stpq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_qpts
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, false) | bvec4(false, false, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qpts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_ssss
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ssss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_tttt
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tttt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_qqqq
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqqq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_qppq
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qppq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_qqqt
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, false) | bvec4(true, true, true, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqqt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_stss
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_ppqp
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(false, false, true, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppqp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_r
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bool out0 = [ true | false | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_a
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bool out0 = [ true | true | false | true | false ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_ar
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, true) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ar;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_ab
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec2 out0 = [ bvec2(true, false) | bvec2(true, false) | bvec2(false, false) | bvec2(true, true) | bvec2(false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ab;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_aaa
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, true, true) | bvec3(true, true, true) | bvec3(false, false, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaa;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_gga
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(false, false, true) | bvec3(false, false, true) | bvec3(true, true, false) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gga;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_abg
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec3 out0 = [ bvec3(true, false, false) | bvec3(true, false, false) | bvec3(false, false, true) | bvec3(true, true, true) | bvec3(false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_rgba
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgba;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_abgr
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, false) | bvec4(false, false, true, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abgr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_rrrr
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rrrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_gggg
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, false, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gggg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_aaaa
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaaa;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_abba
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, false, true) | bvec4(true, false, false, true) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abba;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_aaag
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, true, true, false) | bvec4(true, true, true, false) | bvec4(false, false, false, true) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaag;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_rgrr
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(true, false, true, true) | bvec4(false, false, false, false) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_bvec4_bbab
+ version 300 es
+ values
+ {
+ input bvec4 in0 = [ bvec4(true, false, false, true) | bvec4(false, false, false, true) | bvec4(false, true, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ output bvec4 out0 = [ bvec4(false, false, true, false) | bvec4(false, false, true, false) | bvec4(false, false, false, false) | bvec4(true, true, true, true) | bvec4(false, false, false, false) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbab;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # bvec4_swizzles \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_ivec2.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_ivec2.html
new file mode 100644
index 0000000000..76f159b008
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_ivec2.html
@@ -0,0 +1,42 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'swizzles_ivec2';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_ivec2.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_ivec2.test
new file mode 100644
index 0000000000..b26d29b41b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_ivec2.test
@@ -0,0 +1,511 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+group ivec2_swizzles "ivec2 swizzles"
+
+ case mediump_ivec2_x
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_xx
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_xy
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_yx
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-2, 0) | ivec2(64, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_yxy
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yxy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_xyxx
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_yyyy
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyyy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_s
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_ss
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_st
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.st;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_ts
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-2, 0) | ivec2(64, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_tst
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tst;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_stss
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_tttt
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tttt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_r
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_rr
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, 0) | ivec2(-32, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_rg
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_gr
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-2, 0) | ivec2(64, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_grg
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.grg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_rgrr
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec2_gggg
+ version 300 es
+ values
+ {
+ input ivec2 in0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -2) | ivec2(-32, 64) | ivec2(0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gggg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # ivec2_swizzles \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_ivec3.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_ivec3.html
new file mode 100644
index 0000000000..ce29c8b8a3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_ivec3.html
@@ -0,0 +1,42 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'swizzles_ivec3';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_ivec3.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_ivec3.test
new file mode 100644
index 0000000000..277cbff7f5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_ivec3.test
@@ -0,0 +1,943 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+group ivec3_swizzles "ivec3 swizzles"
+
+ case mediump_ivec3_x
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_z
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | -4 | -51 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.z;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_xz
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -4) | ivec2(-32, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_zz
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-4, -4) | ivec2(-51, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_xyz
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_zyx
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -2, 0) | ivec3(-51, 64, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_xxx
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, -32, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_zzz
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -4) | ivec3(-51, -51, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_zzy
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -2) | ivec3(-51, -51, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_yxy
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yxy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_xzx
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -4, 0) | ivec3(-32, -51, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xzx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_xyyx
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -2, 0) | ivec4(-32, 64, 64, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_zzzz
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, -4, -4) | ivec4(-51, -51, -51, -51) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzzz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_s
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_p
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | -4 | -51 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.p;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_sp
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -4) | ivec2(-32, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_pp
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-4, -4) | ivec2(-51, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_stp
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_pts
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -2, 0) | ivec3(-51, 64, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_sss
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, -32, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_ppp
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -4) | ivec3(-51, -51, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_ppt
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -2) | ivec3(-51, -51, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_tst
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tst;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_sps
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -4, 0) | ivec3(-32, -51, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sps;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_stts
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -2, 0) | ivec4(-32, 64, 64, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_pppp
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, -4, -4) | ivec4(-51, -51, -51, -51) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pppp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_r
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_b
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output int out0 = [ 0 | 1 | -4 | -51 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.b;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_rb
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(0, -4) | ivec2(-32, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_bb
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(-4, -4) | ivec2(-51, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_rgb
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_bgr
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -2, 0) | ivec3(-51, 64, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bgr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_rrr
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, 0, 0) | ivec3(-32, -32, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_bbb
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -4) | ivec3(-51, -51, -51) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_bbg
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-4, -4, -2) | ivec3(-51, -51, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_grg
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, 0, -2) | ivec3(64, -32, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.grg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_rbr
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -4, 0) | ivec3(-32, -51, -32) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rbr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_rggr
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -2, 0) | ivec4(-32, 64, 64, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rggr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec3_bbbb
+ version 300 es
+ values
+ {
+ input ivec3 in0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(0, -2, -4) | ivec3(-32, 64, -51) | ivec3(0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, -4, -4) | ivec4(-51, -51, -51, -51) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbbb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # ivec3_swizzles \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_ivec4.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_ivec4.html
new file mode 100644
index 0000000000..3323b9fbb3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_ivec4.html
@@ -0,0 +1,42 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'swizzles_ivec4';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_ivec4.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_ivec4.test
new file mode 100644
index 0000000000..22d17df0ae
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_ivec4.test
@@ -0,0 +1,1159 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+group ivec4_swizzles "ivec4 swizzles"
+
+ case mediump_ivec4_x
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_w
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 9 | 24 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.w;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_wx
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, 0) | ivec2(24, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_wz
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, -4) | ivec2(24, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_www
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, 9, 9) | ivec3(24, 24, 24) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.www;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_yyw
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, -2, 9) | ivec3(64, 64, 24) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_wzy
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, -4, -2) | ivec3(24, -51, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_xyzw
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyzw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_wzyx
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -2, 0) | ivec4(24, -51, 64, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_xxxx
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, -32, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xxxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_yyyy
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyyy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_wwww
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, 9) | ivec4(24, 24, 24, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wwww;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_wzzw
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -4, 9) | ivec4(24, -51, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzzw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_wwwy
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, -2) | ivec4(24, 24, 24, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wwwy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_xyxx
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_zzwz
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, 9, -4) | ivec4(-51, -51, 24, -51) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzwz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_s
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_q
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 9 | 24 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.q;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_qs
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, 0) | ivec2(24, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qs;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_qp
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, -4) | ivec2(24, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_qqq
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, 9, 9) | ivec3(24, 24, 24) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_ttq
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, -2, 9) | ivec3(64, 64, 24) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ttq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_qpt
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, -4, -2) | ivec3(24, -51, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qpt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_stpq
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stpq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_qpts
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -2, 0) | ivec4(24, -51, 64, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qpts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_ssss
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, -32, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ssss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_tttt
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tttt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_qqqq
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, 9) | ivec4(24, 24, 24, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqqq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_qppq
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -4, 9) | ivec4(24, -51, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qppq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_qqqt
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, -2) | ivec4(24, 24, 24, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqqt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_stss
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_ppqp
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, 9, -4) | ivec4(-51, -51, 24, -51) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppqp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_r
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 0 | -32 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_a
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output int out0 = [ 0 | 1 | 9 | 24 | 0 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_ar
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, 0) | ivec2(24, -32) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ar;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_ab
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec2 out0 = [ ivec2(0, 0) | ivec2(1, 1) | ivec2(9, -4) | ivec2(24, -51) | ivec2(0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ab;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_aaa
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, 9, 9) | ivec3(24, 24, 24) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaa;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_gga
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(-2, -2, 9) | ivec3(64, 64, 24) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gga;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_abg
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec3 out0 = [ ivec3(0, 0, 0) | ivec3(1, 1, 1) | ivec3(9, -4, -2) | ivec3(24, -51, 64) | ivec3(0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_rgba
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgba;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_abgr
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -2, 0) | ivec4(24, -51, 64, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abgr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_rrrr
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, 0, 0, 0) | ivec4(-32, -32, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rrrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_gggg
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-2, -2, -2, -2) | ivec4(64, 64, 64, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gggg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_aaaa
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, 9) | ivec4(24, 24, 24, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaaa;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_abba
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, -4, -4, 9) | ivec4(24, -51, -51, 24) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abba;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_aaag
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(9, 9, 9, -2) | ivec4(24, 24, 24, 64) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaag;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_rgrr
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, 0, 0) | ivec4(-32, 64, -32, -32) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_ivec4_bbab
+ version 300 es
+ values
+ {
+ input ivec4 in0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(0, -2, -4, 9) | ivec4(-32, 64, -51, 24) | ivec4(0, 0, 0, 0) ];
+ output ivec4 out0 = [ ivec4(0, 0, 0, 0) | ivec4(1, 1, 1, 1) | ivec4(-4, -4, 9, -4) | ivec4(-51, -51, 24, -51) | ivec4(0, 0, 0, 0) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbab;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # ivec4_swizzles \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_vec2.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_vec2.html
new file mode 100644
index 0000000000..c70c9e24d1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_vec2.html
@@ -0,0 +1,42 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'swizzles_vec2';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_vec2.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_vec2.test
new file mode 100644
index 0000000000..dba3acaf6b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_vec2.test
@@ -0,0 +1,511 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+group vec2_swizzles "vec2 swizzles"
+
+ case mediump_vec2_x
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_xx
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(-0.5, -0.5) | vec2(-32.0, -32.0) | vec2(-0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_xy
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_yx
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.5, 0.0) | vec2(1.25, 1.0) | vec2(-2.25, -0.5) | vec2(64.0, -32.0) | vec2(-0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_yxy
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yxy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_xyxx
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_yyyy
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyyy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_s
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_ss
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(-0.5, -0.5) | vec2(-32.0, -32.0) | vec2(-0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_st
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.st;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_ts
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.5, 0.0) | vec2(1.25, 1.0) | vec2(-2.25, -0.5) | vec2(64.0, -32.0) | vec2(-0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_tst
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tst;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_stss
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_tttt
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tttt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_r
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_rr
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.0, 0.0) | vec2(1.0, 1.0) | vec2(-0.5, -0.5) | vec2(-32.0, -32.0) | vec2(-0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_rg
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_gr
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec2 out0 = [ vec2(0.5, 0.0) | vec2(1.25, 1.0) | vec2(-2.25, -0.5) | vec2(64.0, -32.0) | vec2(-0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_grg
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.grg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_rgrr
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec2_gggg
+ version 300 es
+ values
+ {
+ input vec2 in0 = [ vec2(0.0, 0.5) | vec2(1.0, 1.25) | vec2(-0.5, -2.25) | vec2(-32.0, 64.0) | vec2(-0.75, -0.0322580645161) ];
+ output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gggg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # vec2_swizzles \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_vec3.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_vec3.html
new file mode 100644
index 0000000000..475d91f002
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_vec3.html
@@ -0,0 +1,42 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'swizzles_vec3';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_vec3.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_vec3.test
new file mode 100644
index 0000000000..d733347215
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_vec3.test
@@ -0,0 +1,943 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+group vec3_swizzles "vec3 swizzles"
+
+ case mediump_vec3_x
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_z
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output float out0 = [ 0.75 | 1.125 | -4.875 | -51.0 | 0.0526315789474 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.z;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_xz
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec2 out0 = [ vec2(0.0, 0.75) | vec2(1.0, 1.125) | vec2(-0.5, -4.875) | vec2(-32.0, -51.0) | vec2(-0.75, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_zz
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec2 out0 = [ vec2(0.75, 0.75) | vec2(1.125, 1.125) | vec2(-4.875, -4.875) | vec2(-51.0, -51.0) | vec2(0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_xyz
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_zyx
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.5, 0.0) | vec3(1.125, 1.25, 1.0) | vec3(-4.875, -2.25, -0.5) | vec3(-51.0, 64.0, -32.0) | vec3(0.0526315789474, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_xxx
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(-0.5, -0.5, -0.5) | vec3(-32.0, -32.0, -32.0) | vec3(-0.75, -0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_zzz
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.75, 0.75) | vec3(1.125, 1.125, 1.125) | vec3(-4.875, -4.875, -4.875) | vec3(-51.0, -51.0, -51.0) | vec3(0.0526315789474, 0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_zzy
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.75, 0.5) | vec3(1.125, 1.125, 1.25) | vec3(-4.875, -4.875, -2.25) | vec3(-51.0, -51.0, 64.0) | vec3(0.0526315789474, 0.0526315789474, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_yxy
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yxy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_xzx
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.75, 0.0) | vec3(1.0, 1.125, 1.0) | vec3(-0.5, -4.875, -0.5) | vec3(-32.0, -51.0, -32.0) | vec3(-0.75, 0.0526315789474, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xzx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_xyyx
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.5, 0.0) | vec4(1.0, 1.25, 1.25, 1.0) | vec4(-0.5, -2.25, -2.25, -0.5) | vec4(-32.0, 64.0, 64.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_zzzz
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec4 out0 = [ vec4(0.75, 0.75, 0.75, 0.75) | vec4(1.125, 1.125, 1.125, 1.125) | vec4(-4.875, -4.875, -4.875, -4.875) | vec4(-51.0, -51.0, -51.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzzz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_s
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_p
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output float out0 = [ 0.75 | 1.125 | -4.875 | -51.0 | 0.0526315789474 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.p;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_sp
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec2 out0 = [ vec2(0.0, 0.75) | vec2(1.0, 1.125) | vec2(-0.5, -4.875) | vec2(-32.0, -51.0) | vec2(-0.75, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_pp
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec2 out0 = [ vec2(0.75, 0.75) | vec2(1.125, 1.125) | vec2(-4.875, -4.875) | vec2(-51.0, -51.0) | vec2(0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_stp
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_pts
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.5, 0.0) | vec3(1.125, 1.25, 1.0) | vec3(-4.875, -2.25, -0.5) | vec3(-51.0, 64.0, -32.0) | vec3(0.0526315789474, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_sss
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(-0.5, -0.5, -0.5) | vec3(-32.0, -32.0, -32.0) | vec3(-0.75, -0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_ppp
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.75, 0.75) | vec3(1.125, 1.125, 1.125) | vec3(-4.875, -4.875, -4.875) | vec3(-51.0, -51.0, -51.0) | vec3(0.0526315789474, 0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_ppt
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.75, 0.5) | vec3(1.125, 1.125, 1.25) | vec3(-4.875, -4.875, -2.25) | vec3(-51.0, -51.0, 64.0) | vec3(0.0526315789474, 0.0526315789474, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_tst
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tst;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_sps
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.75, 0.0) | vec3(1.0, 1.125, 1.0) | vec3(-0.5, -4.875, -0.5) | vec3(-32.0, -51.0, -32.0) | vec3(-0.75, 0.0526315789474, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.sps;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_stts
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.5, 0.0) | vec4(1.0, 1.25, 1.25, 1.0) | vec4(-0.5, -2.25, -2.25, -0.5) | vec4(-32.0, 64.0, 64.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_pppp
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec4 out0 = [ vec4(0.75, 0.75, 0.75, 0.75) | vec4(1.125, 1.125, 1.125, 1.125) | vec4(-4.875, -4.875, -4.875, -4.875) | vec4(-51.0, -51.0, -51.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.pppp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_r
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_b
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output float out0 = [ 0.75 | 1.125 | -4.875 | -51.0 | 0.0526315789474 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.b;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_rb
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec2 out0 = [ vec2(0.0, 0.75) | vec2(1.0, 1.125) | vec2(-0.5, -4.875) | vec2(-32.0, -51.0) | vec2(-0.75, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_bb
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec2 out0 = [ vec2(0.75, 0.75) | vec2(1.125, 1.125) | vec2(-4.875, -4.875) | vec2(-51.0, -51.0) | vec2(0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_rgb
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_bgr
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.5, 0.0) | vec3(1.125, 1.25, 1.0) | vec3(-4.875, -2.25, -0.5) | vec3(-51.0, 64.0, -32.0) | vec3(0.0526315789474, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bgr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_rrr
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.0, 0.0) | vec3(1.0, 1.0, 1.0) | vec3(-0.5, -0.5, -0.5) | vec3(-32.0, -32.0, -32.0) | vec3(-0.75, -0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_bbb
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.75, 0.75) | vec3(1.125, 1.125, 1.125) | vec3(-4.875, -4.875, -4.875) | vec3(-51.0, -51.0, -51.0) | vec3(0.0526315789474, 0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_bbg
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.75, 0.75, 0.5) | vec3(1.125, 1.125, 1.25) | vec3(-4.875, -4.875, -2.25) | vec3(-51.0, -51.0, 64.0) | vec3(0.0526315789474, 0.0526315789474, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_grg
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.5, 0.0, 0.5) | vec3(1.25, 1.0, 1.25) | vec3(-2.25, -0.5, -2.25) | vec3(64.0, -32.0, 64.0) | vec3(-0.0322580645161, -0.75, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.grg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_rbr
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec3 out0 = [ vec3(0.0, 0.75, 0.0) | vec3(1.0, 1.125, 1.0) | vec3(-0.5, -4.875, -0.5) | vec3(-32.0, -51.0, -32.0) | vec3(-0.75, 0.0526315789474, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rbr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_rggr
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.5, 0.0) | vec4(1.0, 1.25, 1.25, 1.0) | vec4(-0.5, -2.25, -2.25, -0.5) | vec4(-32.0, 64.0, 64.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rggr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec3_bbbb
+ version 300 es
+ values
+ {
+ input vec3 in0 = [ vec3(0.0, 0.5, 0.75) | vec3(1.0, 1.25, 1.125) | vec3(-0.5, -2.25, -4.875) | vec3(-32.0, 64.0, -51.0) | vec3(-0.75, -0.0322580645161, 0.0526315789474) ];
+ output vec4 out0 = [ vec4(0.75, 0.75, 0.75, 0.75) | vec4(1.125, 1.125, 1.125, 1.125) | vec4(-4.875, -4.875, -4.875, -4.875) | vec4(-51.0, -51.0, -51.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.0526315789474, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbbb;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # vec3_swizzles \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_vec4.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_vec4.html
new file mode 100644
index 0000000000..1121c06fec
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_vec4.html
@@ -0,0 +1,42 @@
+<!--
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = 'swizzles_vec4';
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_vec4.test b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_vec4.test
new file mode 100644
index 0000000000..df22f5b493
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/swizzles_vec4.test
@@ -0,0 +1,1159 @@
+# WARNING: This file is auto-generated. Do NOT modify it manually, but rather
+# modify the generating script file. Otherwise changes will be lost!
+# See split-swizzles.js
+
+group vec4_swizzles "vec4 swizzles"
+
+ case mediump_vec4_x
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.x;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_w
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output float out0 = [ 0.825 | 1.75 | 9.0 | 24.0 | 0.25 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.w;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_wx
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec2 out0 = [ vec2(0.825, 0.0) | vec2(1.75, 1.0) | vec2(9.0, -0.5) | vec2(24.0, -32.0) | vec2(0.25, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_wz
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec2 out0 = [ vec2(0.825, 0.75) | vec2(1.75, 1.125) | vec2(9.0, -4.875) | vec2(24.0, -51.0) | vec2(0.25, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_www
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.825, 0.825, 0.825) | vec3(1.75, 1.75, 1.75) | vec3(9.0, 9.0, 9.0) | vec3(24.0, 24.0, 24.0) | vec3(0.25, 0.25, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.www;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_yyw
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.5, 0.5, 0.825) | vec3(1.25, 1.25, 1.75) | vec3(-2.25, -2.25, 9.0) | vec3(64.0, 64.0, 24.0) | vec3(-0.0322580645161, -0.0322580645161, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_wzy
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.825, 0.75, 0.5) | vec3(1.75, 1.125, 1.25) | vec3(9.0, -4.875, -2.25) | vec3(24.0, -51.0, 64.0) | vec3(0.25, 0.0526315789474, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_xyzw
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyzw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_wzyx
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.75, 0.5, 0.0) | vec4(1.75, 1.125, 1.25, 1.0) | vec4(9.0, -4.875, -2.25, -0.5) | vec4(24.0, -51.0, 64.0, -32.0) | vec4(0.25, 0.0526315789474, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzyx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_xxxx
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(-0.5, -0.5, -0.5, -0.5) | vec4(-32.0, -32.0, -32.0, -32.0) | vec4(-0.75, -0.75, -0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xxxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_yyyy
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.yyyy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_wwww
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.825) | vec4(1.75, 1.75, 1.75, 1.75) | vec4(9.0, 9.0, 9.0, 9.0) | vec4(24.0, 24.0, 24.0, 24.0) | vec4(0.25, 0.25, 0.25, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wwww;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_wzzw
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.75, 0.75, 0.825) | vec4(1.75, 1.125, 1.125, 1.75) | vec4(9.0, -4.875, -4.875, 9.0) | vec4(24.0, -51.0, -51.0, 24.0) | vec4(0.25, 0.0526315789474, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wzzw;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_wwwy
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.5) | vec4(1.75, 1.75, 1.75, 1.25) | vec4(9.0, 9.0, 9.0, -2.25) | vec4(24.0, 24.0, 24.0, 64.0) | vec4(0.25, 0.25, 0.25, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.wwwy;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_xyxx
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.xyxx;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_zzwz
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.75, 0.75, 0.825, 0.75) | vec4(1.125, 1.125, 1.75, 1.125) | vec4(-4.875, -4.875, 9.0, -4.875) | vec4(-51.0, -51.0, 24.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.25, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.zzwz;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_s
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.s;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_q
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output float out0 = [ 0.825 | 1.75 | 9.0 | 24.0 | 0.25 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.q;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_qs
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec2 out0 = [ vec2(0.825, 0.0) | vec2(1.75, 1.0) | vec2(9.0, -0.5) | vec2(24.0, -32.0) | vec2(0.25, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qs;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_qp
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec2 out0 = [ vec2(0.825, 0.75) | vec2(1.75, 1.125) | vec2(9.0, -4.875) | vec2(24.0, -51.0) | vec2(0.25, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_qqq
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.825, 0.825, 0.825) | vec3(1.75, 1.75, 1.75) | vec3(9.0, 9.0, 9.0) | vec3(24.0, 24.0, 24.0) | vec3(0.25, 0.25, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_ttq
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.5, 0.5, 0.825) | vec3(1.25, 1.25, 1.75) | vec3(-2.25, -2.25, 9.0) | vec3(64.0, 64.0, 24.0) | vec3(-0.0322580645161, -0.0322580645161, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ttq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_qpt
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.825, 0.75, 0.5) | vec3(1.75, 1.125, 1.25) | vec3(9.0, -4.875, -2.25) | vec3(24.0, -51.0, 64.0) | vec3(0.25, 0.0526315789474, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qpt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_stpq
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stpq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_qpts
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.75, 0.5, 0.0) | vec4(1.75, 1.125, 1.25, 1.0) | vec4(9.0, -4.875, -2.25, -0.5) | vec4(24.0, -51.0, 64.0, -32.0) | vec4(0.25, 0.0526315789474, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qpts;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_ssss
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(-0.5, -0.5, -0.5, -0.5) | vec4(-32.0, -32.0, -32.0, -32.0) | vec4(-0.75, -0.75, -0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ssss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_tttt
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.tttt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_qqqq
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.825) | vec4(1.75, 1.75, 1.75, 1.75) | vec4(9.0, 9.0, 9.0, 9.0) | vec4(24.0, 24.0, 24.0, 24.0) | vec4(0.25, 0.25, 0.25, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqqq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_qppq
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.75, 0.75, 0.825) | vec4(1.75, 1.125, 1.125, 1.75) | vec4(9.0, -4.875, -4.875, 9.0) | vec4(24.0, -51.0, -51.0, 24.0) | vec4(0.25, 0.0526315789474, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qppq;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_qqqt
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.5) | vec4(1.75, 1.75, 1.75, 1.25) | vec4(9.0, 9.0, 9.0, -2.25) | vec4(24.0, 24.0, 24.0, 64.0) | vec4(0.25, 0.25, 0.25, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.qqqt;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_stss
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.stss;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_ppqp
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.75, 0.75, 0.825, 0.75) | vec4(1.125, 1.125, 1.75, 1.125) | vec4(-4.875, -4.875, 9.0, -4.875) | vec4(-51.0, -51.0, 24.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.25, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ppqp;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_r
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output float out0 = [ 0.0 | 1.0 | -0.5 | -32.0 | -0.75 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.r;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_a
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output float out0 = [ 0.825 | 1.75 | 9.0 | 24.0 | 0.25 ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.a;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_ar
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec2 out0 = [ vec2(0.825, 0.0) | vec2(1.75, 1.0) | vec2(9.0, -0.5) | vec2(24.0, -32.0) | vec2(0.25, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ar;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_ab
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec2 out0 = [ vec2(0.825, 0.75) | vec2(1.75, 1.125) | vec2(9.0, -4.875) | vec2(24.0, -51.0) | vec2(0.25, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.ab;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_aaa
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.825, 0.825, 0.825) | vec3(1.75, 1.75, 1.75) | vec3(9.0, 9.0, 9.0) | vec3(24.0, 24.0, 24.0) | vec3(0.25, 0.25, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaa;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_gga
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.5, 0.5, 0.825) | vec3(1.25, 1.25, 1.75) | vec3(-2.25, -2.25, 9.0) | vec3(64.0, 64.0, 24.0) | vec3(-0.0322580645161, -0.0322580645161, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gga;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_abg
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec3 out0 = [ vec3(0.825, 0.75, 0.5) | vec3(1.75, 1.125, 1.25) | vec3(9.0, -4.875, -2.25) | vec3(24.0, -51.0, 64.0) | vec3(0.25, 0.0526315789474, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_rgba
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgba;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_abgr
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.75, 0.5, 0.0) | vec4(1.75, 1.125, 1.25, 1.0) | vec4(9.0, -4.875, -2.25, -0.5) | vec4(24.0, -51.0, 64.0, -32.0) | vec4(0.25, 0.0526315789474, -0.0322580645161, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abgr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_rrrr
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.0, 0.0, 0.0) | vec4(1.0, 1.0, 1.0, 1.0) | vec4(-0.5, -0.5, -0.5, -0.5) | vec4(-32.0, -32.0, -32.0, -32.0) | vec4(-0.75, -0.75, -0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rrrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_gggg
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.5, 0.5, 0.5, 0.5) | vec4(1.25, 1.25, 1.25, 1.25) | vec4(-2.25, -2.25, -2.25, -2.25) | vec4(64.0, 64.0, 64.0, 64.0) | vec4(-0.0322580645161, -0.0322580645161, -0.0322580645161, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.gggg;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_aaaa
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.825) | vec4(1.75, 1.75, 1.75, 1.75) | vec4(9.0, 9.0, 9.0, 9.0) | vec4(24.0, 24.0, 24.0, 24.0) | vec4(0.25, 0.25, 0.25, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaaa;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_abba
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.75, 0.75, 0.825) | vec4(1.75, 1.125, 1.125, 1.75) | vec4(9.0, -4.875, -4.875, 9.0) | vec4(24.0, -51.0, -51.0, 24.0) | vec4(0.25, 0.0526315789474, 0.0526315789474, 0.25) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.abba;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_aaag
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.825, 0.825, 0.825, 0.5) | vec4(1.75, 1.75, 1.75, 1.25) | vec4(9.0, 9.0, 9.0, -2.25) | vec4(24.0, 24.0, 24.0, 64.0) | vec4(0.25, 0.25, 0.25, -0.0322580645161) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.aaag;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_rgrr
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.0, 0.5, 0.0, 0.0) | vec4(1.0, 1.25, 1.0, 1.0) | vec4(-0.5, -2.25, -0.5, -0.5) | vec4(-32.0, 64.0, -32.0, -32.0) | vec4(-0.75, -0.0322580645161, -0.75, -0.75) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.rgrr;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+ case mediump_vec4_bbab
+ version 300 es
+ values
+ {
+ input vec4 in0 = [ vec4(0.0, 0.5, 0.75, 0.825) | vec4(1.0, 1.25, 1.125, 1.75) | vec4(-0.5, -2.25, -4.875, 9.0) | vec4(-32.0, 64.0, -51.0, 24.0) | vec4(-0.75, -0.0322580645161, 0.0526315789474, 0.25) ];
+ output vec4 out0 = [ vec4(0.75, 0.75, 0.825, 0.75) | vec4(1.125, 1.125, 1.75, 1.125) | vec4(-4.875, -4.875, 9.0, -4.875) | vec4(-51.0, -51.0, 24.0, -51.0) | vec4(0.0526315789474, 0.0526315789474, 0.25, 0.0526315789474) ];
+ }
+
+ both ""
+ #version 300 es
+ precision mediump float;
+
+ ${DECLARATIONS}
+
+ void main()
+ {
+ ${SETUP}
+ out0 = in0.bbab;
+ ${OUTPUT}
+ }
+ ""
+ end
+
+
+end # vec4_swizzles \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/template.html b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/template.html
new file mode 100644
index 0000000000..a1937f2ca7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/data/gles3/shaders/template.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('modules.shared.glsShaderLibrary');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+testName = ___TEST_NAME___;
+description("Shader test: " + testName + ".");
+WebGLTestUtils.setDefault3DContextVersion(2);
+
+var getFilter = function() {
+ var queryVars = window.location.search.substring(1).split('&');
+
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'filter')
+ return decodeURIComponent(value[1]);
+ }
+}
+
+modules.shared.glsShaderLibrary.run(testName, getFilter())
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/deqp-deps.js b/dom/canvas/test/webgl-conf/checkout/deqp/deqp-deps.js
new file mode 100644
index 0000000000..4b38dce6c4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/deqp-deps.js
@@ -0,0 +1,141 @@
+// This file was autogenerated by ../closure-library/closure/bin/build/depswriter.py.
+// Please do not edit.
+goog.addDependency('../../../deqp/framework/common/tcuBilinearImageCompare.js', ['framework.common.tcuBilinearImageCompare'], ['framework.common.tcuRGBA', 'framework.common.tcuTexture', 'framework.delibs.debase.deMath'], false);
+goog.addDependency('../../../deqp/framework/common/tcuCompressedTexture.js', ['framework.common.tcuCompressedTexture'], ['framework.common.tcuTexture', 'framework.delibs.debase.deMath'], false);
+goog.addDependency('../../../deqp/framework/common/tcuFloat.js', ['framework.common.tcuFloat'], ['framework.delibs.debase.deMath'], false);
+goog.addDependency('../../../deqp/framework/common/tcuFloatFormat.js', ['framework.common.tcuFloatFormat'], ['framework.common.tcuInterval', 'framework.delibs.debase.deMath'], false);
+goog.addDependency('../../../deqp/framework/common/tcuFuzzyImageCompare.js', ['framework.common.tcuFuzzyImageCompare'], ['framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom'], false);
+goog.addDependency('../../../deqp/framework/common/tcuImageCompare.js', ['framework.common.tcuImageCompare'], ['framework.common.tcuBilinearImageCompare', 'framework.common.tcuFloat', 'framework.common.tcuFuzzyImageCompare', 'framework.common.tcuLogImage', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath'], false);
+goog.addDependency('../../../deqp/framework/common/tcuInterval.js', ['framework.common.tcuInterval'], ['framework.delibs.debase.deMath'], false);
+goog.addDependency('../../../deqp/framework/common/tcuLogImage.js', ['framework.common.tcuLogImage'], ['framework.common.tcuSurface', 'framework.common.tcuTexture', 'framework.delibs.debase.deMath'], false);
+goog.addDependency('../../../deqp/framework/common/tcuMatrix.js', ['framework.common.tcuMatrix'], ['framework.delibs.debase.deMath'], false);
+goog.addDependency('../../../deqp/framework/common/tcuMatrixUtil.js', ['framework.common.tcuMatrixUtil'], ['framework.common.tcuMatrix'], false);
+goog.addDependency('../../../deqp/framework/common/tcuPixelFormat.js', ['framework.common.tcuPixelFormat'], [], false);
+goog.addDependency('../../../deqp/framework/common/tcuRGBA.js', ['framework.common.tcuRGBA'], ['framework.delibs.debase.deMath'], false);
+goog.addDependency('../../../deqp/framework/common/tcuSkipList.js', ['framework.common.tcuSkipList'], [], false);
+goog.addDependency('../../../deqp/framework/common/tcuStringTemplate.js', ['framework.common.tcuStringTemplate'], [], false);
+goog.addDependency('../../../deqp/framework/common/tcuSurface.js', ['framework.common.tcuSurface'], ['framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.opengl.gluTextureUtil'], false);
+goog.addDependency('../../../deqp/framework/common/tcuTestCase.js', ['framework.common.tcuTestCase'], ['framework.common.tcuSkipList'], false);
+goog.addDependency('../../../deqp/framework/common/tcuTexCompareVerifier.js', ['framework.common.tcuTexCompareVerifier'], ['framework.common.tcuTexVerifierUtil', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath'], false);
+goog.addDependency('../../../deqp/framework/common/tcuTexLookupVerifier.js', ['framework.common.tcuTexLookupVerifier'], ['framework.common.tcuTexVerifierUtil', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath'], false);
+goog.addDependency('../../../deqp/framework/common/tcuTexVerifierUtil.js', ['framework.common.tcuTexVerifierUtil'], ['framework.common.tcuFloat', 'framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deUtil'], false);
+goog.addDependency('../../../deqp/framework/common/tcuTexture.js', ['framework.common.tcuTexture'], ['framework.common.tcuFloat', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deString', 'framework.delibs.debase.deUtil'], false);
+goog.addDependency('../../../deqp/framework/common/tcuTextureUtil.js', ['framework.common.tcuTextureUtil'], ['framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom'], false);
+goog.addDependency('../../../deqp/framework/delibs/debase/deMath.js', ['framework.delibs.debase.deMath'], [], false);
+goog.addDependency('../../../deqp/framework/delibs/debase/deRandom.js', ['framework.delibs.debase.deRandom'], [], false);
+goog.addDependency('../../../deqp/framework/delibs/debase/deString.js', ['framework.delibs.debase.deString'], ['framework.delibs.debase.deMath'], false);
+goog.addDependency('../../../deqp/framework/delibs/debase/deUtil.js', ['framework.delibs.debase.deUtil'], ['framework.delibs.debase.deMath'], false);
+goog.addDependency('../../../deqp/framework/opengl/gluDrawUtil.js', ['framework.opengl.gluDrawUtil'], ['framework.opengl.gluShaderProgram'], false);
+goog.addDependency('../../../deqp/framework/opengl/gluObjectWrapper.js', ['framework.opengl.gluObjectWrapper'], [], false);
+goog.addDependency('../../../deqp/framework/opengl/gluPixelTransfer.js', ['framework.opengl.gluPixelTransfer'], ['framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.opengl.gluTextureUtil'], false);
+goog.addDependency('../../../deqp/framework/opengl/gluShaderProgram.js', ['framework.opengl.gluShaderProgram'], [], false);
+goog.addDependency('../../../deqp/framework/opengl/gluShaderUtil.js', ['framework.opengl.gluShaderUtil'], ['framework.delibs.debase.deMath'], false);
+goog.addDependency('../../../deqp/framework/opengl/gluStrUtil.js', ['framework.opengl.gluStrUtil'], [], false);
+goog.addDependency('../../../deqp/framework/opengl/gluTexture.js', ['framework.opengl.gluTexture'], ['framework.common.tcuCompressedTexture', 'framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.opengl.gluTextureUtil'], false);
+goog.addDependency('../../../deqp/framework/opengl/gluTextureUtil.js', ['framework.opengl.gluTextureUtil'], ['framework.common.tcuCompressedTexture', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deString', 'framework.opengl.gluShaderUtil'], false);
+goog.addDependency('../../../deqp/framework/opengl/gluVarType.js', ['framework.opengl.gluVarType'], ['framework.opengl.gluShaderUtil'], false);
+goog.addDependency('../../../deqp/framework/opengl/gluVarTypeUtil.js', ['framework.opengl.gluVarTypeUtil'], ['framework.opengl.gluShaderUtil', 'framework.opengl.gluVarType'], false);
+goog.addDependency('../../../deqp/framework/opengl/simplereference/sglrGLContext.js', ['framework.opengl.simplereference.sglrGLContext'], ['framework.common.tcuPixelFormat', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTextureUtil', 'framework.opengl.simplereference.sglrShaderProgram', 'framework.referencerenderer.rrDefs', 'framework.referencerenderer.rrMultisamplePixelBufferAccess', 'framework.referencerenderer.rrRenderState', 'framework.referencerenderer.rrRenderer', 'framework.referencerenderer.rrVertexAttrib'], false);
+goog.addDependency('../../../deqp/framework/opengl/simplereference/sglrReferenceContext.js', ['framework.opengl.simplereference.sglrReferenceContext'], ['framework.common.tcuMatrix', 'framework.common.tcuMatrixUtil', 'framework.common.tcuPixelFormat', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTextureUtil', 'framework.opengl.simplereference.sglrReferenceUtils', 'framework.opengl.simplereference.sglrShaderProgram', 'framework.referencerenderer.rrDefs', 'framework.referencerenderer.rrGenericVector', 'framework.referencerenderer.rrMultisamplePixelBufferAccess', 'framework.referencerenderer.rrRenderState', 'framework.referencerenderer.rrRenderer', 'framework.referencerenderer.rrVertexAttrib'], false);
+goog.addDependency('../../../deqp/framework/opengl/simplereference/sglrReferenceContextTest.js', ['framework.opengl.simplereference.sglrReferenceContextTest'], ['framework.common.tcuLogImage', 'framework.common.tcuPixelFormat', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.opengl.gluDrawUtil', 'framework.opengl.simplereference.sglrReferenceContext', 'framework.opengl.simplereference.sglrShaderProgram', 'framework.referencerenderer.rrFragmentOperations', 'framework.referencerenderer.rrGenericVector', 'framework.referencerenderer.rrShadingContext', 'framework.referencerenderer.rrVertexAttrib', 'framework.referencerenderer.rrVertexPacket'], false);
+goog.addDependency('../../../deqp/framework/opengl/simplereference/sglrReferenceUtils.js', ['framework.opengl.simplereference.sglrReferenceUtils'], ['framework.common.tcuFloat', 'framework.delibs.debase.deMath', 'framework.referencerenderer.rrDefs', 'framework.referencerenderer.rrGenericVector', 'framework.referencerenderer.rrRenderState', 'framework.referencerenderer.rrRenderer', 'framework.referencerenderer.rrShaders', 'framework.referencerenderer.rrVertexAttrib'], false);
+goog.addDependency('../../../deqp/framework/opengl/simplereference/sglrShaderProgram.js', ['framework.opengl.simplereference.sglrShaderProgram'], ['framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTextureUtil', 'framework.referencerenderer.rrDefs', 'framework.referencerenderer.rrFragmentOperations', 'framework.referencerenderer.rrGenericVector', 'framework.referencerenderer.rrShaders', 'framework.referencerenderer.rrShadingContext', 'framework.referencerenderer.rrVertexAttrib', 'framework.referencerenderer.rrVertexPacket'], false);
+goog.addDependency('../../../deqp/framework/referencerenderer/rrDefs.js', ['framework.referencerenderer.rrDefs'], [], false);
+goog.addDependency('../../../deqp/framework/referencerenderer/rrFragmentOperations.js', ['framework.referencerenderer.rrFragmentOperations'], ['framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.referencerenderer.rrRenderState'], false);
+goog.addDependency('../../../deqp/framework/referencerenderer/rrGenericVector.js', ['framework.referencerenderer.rrGenericVector'], [], false);
+goog.addDependency('../../../deqp/framework/referencerenderer/rrMultisamplePixelBufferAccess.js', ['framework.referencerenderer.rrMultisamplePixelBufferAccess'], ['framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath'], false);
+goog.addDependency('../../../deqp/framework/referencerenderer/rrRenderState.js', ['framework.referencerenderer.rrRenderState'], ['framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.referencerenderer.rrDefs', 'framework.referencerenderer.rrMultisamplePixelBufferAccess'], false);
+goog.addDependency('../../../deqp/framework/referencerenderer/rrRenderer.js', ['framework.referencerenderer.rrRenderer'], ['framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deString', 'framework.delibs.debase.deUtil', 'framework.opengl.simplereference.sglrShaderProgram', 'framework.referencerenderer.rrDefs', 'framework.referencerenderer.rrFragmentOperations', 'framework.referencerenderer.rrGenericVector', 'framework.referencerenderer.rrMultisamplePixelBufferAccess', 'framework.referencerenderer.rrRenderState', 'framework.referencerenderer.rrShadingContext', 'framework.referencerenderer.rrVertexAttrib', 'framework.referencerenderer.rrVertexPacket'], false);
+goog.addDependency('../../../deqp/framework/referencerenderer/rrShaders.js', ['framework.referencerenderer.rrShaders'], ['framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.referencerenderer.rrGenericVector', 'framework.referencerenderer.rrShadingContext', 'framework.referencerenderer.rrVertexAttrib', 'framework.referencerenderer.rrVertexPacket'], false);
+goog.addDependency('../../../deqp/framework/referencerenderer/rrShadingContext.js', ['framework.referencerenderer.rrShadingContext'], ['framework.delibs.debase.deMath', 'framework.referencerenderer.rrDefs', 'framework.referencerenderer.rrFragmentOperations', 'framework.referencerenderer.rrGenericVector'], false);
+goog.addDependency('../../../deqp/framework/referencerenderer/rrUtil.js', ['framework.referencerenderer.rrUtil'], ['framework.opengl.simplereference.sglrGLContext', 'framework.opengl.simplereference.sglrReferenceContext'], false);
+goog.addDependency('../../../deqp/framework/referencerenderer/rrVertexAttrib.js', ['framework.referencerenderer.rrVertexAttrib'], ['framework.common.tcuFloat', 'framework.delibs.debase.deMath', 'framework.referencerenderer.rrGenericVector'], false);
+goog.addDependency('../../../deqp/framework/referencerenderer/rrVertexPacket.js', ['framework.referencerenderer.rrVertexPacket'], ['framework.common.tcuTexture', 'framework.delibs.debase.deMath'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fApiCase.js', ['functional.gles3.es3fApiCase'], ['framework.common.tcuTestCase', 'framework.opengl.gluStrUtil'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fAttribLocationTests.js', ['functional.gles3.es3fAttribLocationTests'], ['framework.opengl.gluShaderUtil', 'modules.shared.glsAttributeLocationTests'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fBooleanStateQuery.js', ['functional.gles3.es3fBooleanStateQuery'], ['framework.common.tcuTestCase', 'functional.gles3.es3fApiCase', 'modules.shared.glsStateQuery'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fBufferCopyTests.js', ['functional.gles3.es3fBufferCopyTests'], ['framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'modules.shared.glsBufferTestUtil'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fBufferObjectQueryTests.js', ['functional.gles3.es3fBufferObjectQueryTests'], ['framework.common.tcuTestCase', 'framework.delibs.debase.deRandom', 'functional.gles3.es3fApiCase'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fBuiltinPrecisionTests.js', ['functional.gles3.es3fBuiltinPrecisionTests'], ['framework.common.tcuTestCase', 'framework.opengl.gluShaderProgram', 'modules.shared.glsBuiltinPrecisionTests'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fClippingTests.js', ['functional.gles3.es3fClippingTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuRGBA', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.opengl.gluShaderUtil', 'framework.referencerenderer.rrUtil', 'functional.gles3.es3fFboTestCase', 'functional.gles3.es3fFboTestUtil'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fDefaultVertexAttributeTests.js', ['functional.gles3.es3fDefaultVertexAttributeTests'], ['framework.common.tcuLogImage', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fDrawTests.js', ['functional.gles3.es3fDrawTests'], ['framework.common.tcuLogImage', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.delibs.debase.deUtil', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTexture', 'framework.opengl.gluVarType', 'framework.opengl.simplereference.sglrGLContext', 'framework.opengl.simplereference.sglrShaderProgram', 'framework.referencerenderer.rrFragmentOperations', 'framework.referencerenderer.rrGenericVector', 'framework.referencerenderer.rrShadingContext', 'framework.referencerenderer.rrVertexAttrib', 'framework.referencerenderer.rrVertexPacket', 'modules.shared.glsDrawTests'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fFboColorbufferTests.js', ['functional.gles3.es3fFboColorbufferTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTextureUtil', 'framework.referencerenderer.rrUtil', 'functional.gles3.es3fFboTestCase', 'functional.gles3.es3fFboTestUtil'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fFboCompletenessTests.js', ['functional.gles3.es3fFboCompletenessTests'], ['framework.common.tcuTestCase', 'modules.shared.glsFboCompletenessTests', 'modules.shared.glsFboUtil'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fFboDepthbufferTests.js', ['functional.gles3.es3fFboDepthbufferTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTextureUtil', 'framework.referencerenderer.rrUtil', 'functional.gles3.es3fFboTestCase', 'functional.gles3.es3fFboTestUtil'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fFboInvalidateTests.js', ['functional.gles3.es3fFboInvalidateTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuRGBA', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTextureUtil', 'framework.referencerenderer.rrUtil', 'functional.gles3.es3fFboTestCase', 'functional.gles3.es3fFboTestUtil'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fFboMultisampleTests.js', ['functional.gles3.es3fFboMultisampleTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.opengl.gluTextureUtil', 'framework.referencerenderer.rrUtil', 'functional.gles3.es3fFboTestCase', 'functional.gles3.es3fFboTestUtil'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fFboRenderTest.js', ['functional.gles3.es3fFboRenderTest'], ['framework.common.tcuImageCompare', 'framework.common.tcuLogImage', 'framework.common.tcuPixelFormat', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.delibs.debase.deUtil', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTextureUtil', 'framework.opengl.simplereference.sglrGLContext', 'framework.opengl.simplereference.sglrReferenceContext', 'framework.referencerenderer.rrUtil', 'functional.gles3.es3fFboTestUtil'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fFboStateQueryTests.js', ['functional.gles3.es3fFboStateQueryTests'], ['framework.common.tcuTestCase', 'functional.gles3.es3fApiCase', 'modules.shared.glsStateQuery'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fFboStencilbufferTests.js', ['functional.gles3.es3fFboStencilbufferTests'], ['framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTextureUtil', 'framework.referencerenderer.rrUtil', 'functional.gles3.es3fFboTestCase', 'functional.gles3.es3fFboTestUtil'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fFboTestCase.js', ['functional.gles3.es3fFboTestCase'], ['framework.common.tcuImageCompare', 'framework.common.tcuPixelFormat', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.simplereference.sglrGLContext', 'framework.opengl.simplereference.sglrReferenceContext', 'framework.referencerenderer.rrRenderer', 'functional.gles3.es3fFboTestUtil'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fFboTestUtil.js', ['functional.gles3.es3fFboTestUtil'], ['framework.common.tcuMatrix', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTextureUtil', 'framework.opengl.simplereference.sglrGLContext', 'framework.opengl.simplereference.sglrReferenceContext', 'framework.opengl.simplereference.sglrShaderProgram', 'framework.referencerenderer.rrFragmentOperations', 'framework.referencerenderer.rrGenericVector', 'framework.referencerenderer.rrShadingContext', 'framework.referencerenderer.rrVertexAttrib', 'framework.referencerenderer.rrVertexPacket'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fFloatStateQueryTests.js', ['functional.gles3.es3fFloatStateQueryTests'], ['framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'functional.gles3.es3fApiCase', 'modules.shared.glsStateQuery'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fFragDepthTests.js', ['functional.gles3.es3fFragDepthTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram', 'modules.shared.glsShaderRenderCase'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fFragmentOutputTests.js', ['functional.gles3.es3fFragmentOutputTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTextureUtil', 'functional.gles3.es3fFboTestUtil'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fFramebufferBlitTests.js', ['functional.gles3.es3fFramebufferBlitTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTextureUtil', 'framework.opengl.simplereference.sglrGLContext', 'framework.opengl.simplereference.sglrReferenceContext', 'framework.referencerenderer.rrUtil', 'functional.gles3.es3fFboTestCase', 'functional.gles3.es3fFboTestUtil'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fIndexedStateQueryTests.js', ['functional.gles3.es3fIndexedStateQueryTests'], ['framework.common.tcuTestCase', 'functional.gles3.es3fApiCase'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fInstancedRenderingTests.js', ['functional.gles3.es3fInstancedRenderingTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTextureUtil'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fIntegerStateQueryTests.js', ['functional.gles3.es3fIntegerStateQueryTests'], ['framework.common.tcuTestCase', 'framework.delibs.debase.deRandom', 'functional.gles3.es3fApiCase', 'modules.shared.glsStateQuery'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fInternalFormatQueryTests.js', ['functional.gles3.es3fInternalFormatQueryTests'], ['framework.common.tcuTestCase', 'functional.gles3.es3fApiCase', 'modules.shared.glsStateQuery'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fLifetimeTests.js', ['functional.gles3.es3fLifetimeTests'], ['framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.delibs.debase.deRandom', 'framework.opengl.gluShaderProgram', 'modules.shared.glsLifetimeTests', 'modules.shared.glsTextureTestUtil'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fMultisampleTests.js', ['functional.gles3.es3fMultisampleTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuLogImage', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluStrUtil', 'framework.opengl.gluTextureUtil', 'modules.shared.glsTextureTestUtil'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fNegativeBufferApiTests.js', ['functional.gles3.es3fNegativeBufferApiTests'], ['framework.common.tcuTestCase', 'framework.opengl.gluStrUtil', 'functional.gles3.es3fApiCase'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fNegativeFragmentApiTests.js', ['functional.gles3.es3fNegativeFragmentApiTests'], ['framework.common.tcuTestCase', 'functional.gles3.es3fApiCase'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fNegativeShaderApiTests.js', ['functional.gles3.es3fNegativeShaderApiTests'], ['framework.common.tcuTestCase', 'framework.opengl.gluShaderProgram', 'functional.gles3.es3fApiCase'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fNegativeStateApiTests.js', ['functional.gles3.es3fNegativeStateApiTests'], ['framework.common.tcuTestCase', 'framework.opengl.gluShaderProgram', 'functional.gles3.es3fApiCase'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fNegativeTextureApiTests.js', ['functional.gles3.es3fNegativeTextureApiTests'], ['framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.opengl.gluTexture', 'functional.gles3.es3fApiCase'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fNegativeVertexArrayApiTests.js', ['functional.gles3.es3fNegativeVertexArrayApiTests'], ['framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.opengl.gluShaderProgram', 'framework.opengl.simplereference.sglrGLContext', 'functional.gles3.es3fApiCase'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fOcclusionQueryTests.js', ['functional.gles3.es3fOcclusionQueryTests'], ['framework.common.tcuLogImage', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluShaderProgram'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fPixelBufferObjectTest.js', ['functional.gles3.es3fPixelBufferObjectTest'], ['framework.common.tcuImageCompare', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluTextureUtil'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fPrimitiveRestartTests.js', ['functional.gles3.es3fPrimitiveRestartTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluTextureUtil'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fRasterizerDiscardTests.js', ['functional.gles3.es3fRasterizerDiscardTests'], ['framework.common.tcuLogImage', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fRboStateQueryTests.js', ['functional.gles3.es3fRboStateQueryTests'], ['framework.common.tcuTestCase', 'framework.delibs.debase.deRandom', 'functional.gles3.es3fApiCase', 'modules.shared.glsStateQuery'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fReadPixelTests.js', ['functional.gles3.es3fReadPixelTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuRGBA', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluTextureUtil'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fSamplerObjectTests.js', ['functional.gles3.es3fSamplerObjectTests'], ['framework.common.tcuTestCase', 'modules.shared.glsSamplerObjectTest'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fSamplerStateQueryTests.js', ['functional.gles3.es3fSamplerStateQueryTests'], ['framework.common.tcuTestCase', 'framework.delibs.debase.deRandom', 'functional.gles3.es3fApiCase', 'modules.shared.glsStateQuery'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fShaderApiTests.js', ['functional.gles3.es3fShaderApiTests'], ['framework.common.tcuTestCase', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluShaderProgram', 'functional.gles3.es3fApiCase'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fShaderBuiltinVarTests.js', ['functional.gles3.es3fShaderBuiltinVarTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuLogImage', 'framework.common.tcuPixelFormat', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluVarType', 'framework.opengl.simplereference.sglrReferenceContext', 'framework.opengl.simplereference.sglrShaderProgram', 'framework.referencerenderer.rrFragmentOperations', 'framework.referencerenderer.rrGenericVector', 'framework.referencerenderer.rrMultisamplePixelBufferAccess', 'framework.referencerenderer.rrRenderState', 'framework.referencerenderer.rrRenderer', 'framework.referencerenderer.rrShadingContext', 'framework.referencerenderer.rrVertexAttrib', 'framework.referencerenderer.rrVertexPacket', 'modules.shared.glsShaderExecUtil', 'modules.shared.glsShaderRenderCase'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fShaderCommonFunctionTests.js', ['functional.gles3.es3fShaderCommonFunctionTests'], ['framework.common.tcuFloat', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluVarType', 'modules.shared.glsShaderExecUtil'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fShaderDerivateTests.js', ['functional.gles3.es3fShaderDerivateTests'], ['framework.common.tcuFloat', 'framework.common.tcuInterval', 'framework.common.tcuLogImage', 'framework.common.tcuMatrix', 'framework.common.tcuPixelFormat', 'framework.common.tcuRGBA', 'framework.common.tcuStringTemplate', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluPixelTransfer', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTexture', 'modules.shared.glsShaderRenderCase'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fShaderIndexingTests.js', ['functional.gles3.es3fShaderIndexingTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuStringTemplate', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTexture', 'modules.shared.glsShaderRenderCase'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fShaderLoopTests.js', ['functional.gles3.es3fShaderLoopTests'], ['framework.common.tcuStringTemplate', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'modules.shared.glsShaderRenderCase'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fShaderMatrixTest.js', ['functional.gles3.es3fShaderMatrixTest'], ['framework.common.tcuMatrix', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.opengl.gluShaderUtil', 'modules.shared.glsShaderRenderCase'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fShaderOperatorTests.js', ['functional.gles3.es3fShaderOperatorTests'], ['framework.common.tcuMatrix', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'modules.shared.glsShaderRenderCase'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fShaderPackingFunctionTests.js', ['functional.gles3.es3fShaderPackingFunctionTests'], ['framework.common.tcuFloat', 'framework.common.tcuMatrixUtil', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluVarType', 'modules.shared.glsShaderExecUtil'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fShaderPrecisionTests.js', ['functional.gles3.es3fShaderPrecisionTests'], ['framework.common.tcuFloat', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fShaderStateQueryTests.js', ['functional.gles3.es3fShaderStateQueryTests'], ['framework.common.tcuMatrix', 'framework.common.tcuTestCase', 'framework.delibs.debase.deRandom', 'functional.gles3.es3fApiCase', 'modules.shared.glsStateQuery'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fShaderStructTests.js', ['functional.gles3.es3fShaderStructTests'], ['framework.common.tcuStringTemplate', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.opengl.gluTexture', 'modules.shared.glsShaderRenderCase'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fShaderSwitchTests.js', ['functional.gles3.es3fShaderSwitchTests'], ['framework.common.tcuStringTemplate', 'framework.common.tcuTestCase', 'modules.shared.glsShaderRenderCase'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fShaderTextureFunctionTests.js', ['functional.gles3.es3fShaderTextureFunctionTests'], ['framework.common.tcuMatrix', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTexture', 'framework.opengl.gluTextureUtil', 'modules.shared.glsShaderRenderCase'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fStringQueryTests.js', ['functional.gles3.es3fStringQueryTests'], ['framework.common.tcuTestCase', 'functional.gles3.es3fApiCase'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fSyncTests.js', ['functional.gles3.es3fSyncTests'], ['framework.common.tcuTestCase', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluShaderProgram'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fTextureFilteringTests.js', ['functional.gles3.es3fTextureFilteringTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuLogImage', 'framework.common.tcuPixelFormat', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexLookupVerifier', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTexture', 'framework.opengl.gluTextureUtil', 'functional.gles3.es3fFboTestUtil', 'modules.shared.glsTextureTestUtil'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fTextureFormatTests.js', ['functional.gles3.es3fTextureFormatTests'], ['framework.common.tcuCompressedTexture', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluStrUtil', 'framework.opengl.gluTexture', 'framework.opengl.gluTextureUtil', 'modules.shared.glsTextureTestUtil'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fTextureShadowTests.js', ['functional.gles3.es3fTextureShadowTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuLogImage', 'framework.common.tcuPixelFormat', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexCompareVerifier', 'framework.common.tcuTexLookupVerifier', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deString', 'framework.delibs.debase.deUtil', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTexture', 'framework.opengl.gluTextureUtil', 'framework.referencerenderer.rrMultisamplePixelBufferAccess', 'modules.shared.glsTextureTestUtil'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fTextureSpecificationTests.js', ['functional.gles3.es3fTextureSpecificationTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuLogImage', 'framework.common.tcuPixelFormat', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTextureUtil', 'framework.opengl.simplereference.sglrGLContext', 'framework.opengl.simplereference.sglrReferenceContext', 'framework.referencerenderer.rrUtil', 'functional.gles3.es3fFboTestUtil'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fTextureStateQuery.js', ['functional.gles3.es3fTextureStateQuery'], ['framework.common.tcuTestCase', 'framework.delibs.debase.deRandom', 'functional.gles3.es3fApiCase', 'modules.shared.glsStateQuery'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fTextureWrapTests.js', ['functional.gles3.es3fTextureWrapTests'], ['framework.common.tcuCompressedTexture', 'framework.common.tcuPixelFormat', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexLookupVerifier', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTexture', 'framework.opengl.gluTextureUtil', 'modules.shared.glsTextureTestUtil'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fTransformFeedbackTests.js', ['functional.gles3.es3fTransformFeedbackTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluVarType', 'framework.opengl.gluVarTypeUtil'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fUniformApiTests.js', ['functional.gles3.es3fUniformApiTests'], ['framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTexture', 'framework.opengl.gluVarType'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fUniformBlockTests.js', ['functional.gles3.es3fUniformBlockTests'], ['framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.opengl.gluShaderUtil', 'modules.shared.glsRandomUniformBlockCase', 'modules.shared.glsUniformBlockCase'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fVertexArrayObjectTests.js', ['functional.gles3.es3fVertexArrayObjectTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.delibs.debase.deUtil', 'framework.opengl.gluShaderProgram'], false);
+goog.addDependency('../../../deqp/functional/gles3/es3fVertexArrayTests.js', ['functional.gles3.es3fVertexArrayTests'], ['framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.delibs.debase.deUtil', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTexture', 'framework.opengl.gluVarType', 'modules.shared.glsVertexArrayTests'], false);
+goog.addDependency('../../../deqp/modules/shared/glsAttributeLocationTests.js', ['modules.shared.glsAttributeLocationTests'], ['framework.common.tcuStringTemplate', 'framework.common.tcuTestCase', 'framework.opengl.gluShaderUtil'], false);
+goog.addDependency('../../../deqp/modules/shared/glsBufferTestUtil.js', ['modules.shared.glsBufferTestUtil'], ['framework.common.tcuImageCompare', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.delibs.debase.deUtil', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil'], false);
+goog.addDependency('../../../deqp/modules/shared/glsBuiltinPrecisionTests.js', ['modules.shared.glsBuiltinPrecisionTests'], ['framework.common.tcuFloatFormat', 'framework.common.tcuInterval', 'framework.common.tcuMatrix', 'framework.common.tcuMatrixUtil', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluVarType', 'framework.opengl.simplereference.sglrGLContext', 'modules.shared.glsBuiltinPrecisionTestsUnitTests', 'modules.shared.glsShaderExecUtil'], false);
+goog.addDependency('../../../deqp/modules/shared/glsBuiltinPrecisionTestsUnitTests.js', ['modules.shared.glsBuiltinPrecisionTestsUnitTests'], ['framework.common.tcuInterval', 'framework.common.tcuMatrix'], false);
+goog.addDependency('../../../deqp/modules/shared/glsDrawTests.js', ['modules.shared.glsDrawTests'], ['framework.common.tcuFloat', 'framework.common.tcuImageCompare', 'framework.common.tcuPixelFormat', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluStrUtil', 'framework.opengl.simplereference.sglrGLContext', 'framework.opengl.simplereference.sglrReferenceContext', 'framework.opengl.simplereference.sglrShaderProgram', 'framework.referencerenderer.rrFragmentOperations', 'framework.referencerenderer.rrGenericVector', 'framework.referencerenderer.rrShadingContext', 'framework.referencerenderer.rrVertexAttrib', 'framework.referencerenderer.rrVertexPacket'], false);
+goog.addDependency('../../../deqp/modules/shared/glsFboCompletenessTests.js', ['modules.shared.glsFboCompletenessTests'], ['framework.common.tcuTestCase', 'framework.opengl.gluObjectWrapper', 'framework.opengl.gluStrUtil', 'modules.shared.glsFboUtil'], false);
+goog.addDependency('../../../deqp/modules/shared/glsFboUtil.js', ['modules.shared.glsFboUtil'], ['framework.opengl.gluTextureUtil'], false);
+goog.addDependency('../../../deqp/modules/shared/glsLifetimeTests.js', ['modules.shared.glsLifetimeTests'], ['framework.common.tcuImageCompare', 'framework.common.tcuStringTemplate', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.delibs.debase.deRandom', 'framework.opengl.gluShaderProgram', 'modules.shared.glsTextureTestUtil'], false);
+goog.addDependency('../../../deqp/modules/shared/glsRandomUniformBlockCase.js', ['modules.shared.glsRandomUniformBlockCase'], ['framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.opengl.gluShaderUtil', 'modules.shared.glsUniformBlockCase'], false);
+goog.addDependency('../../../deqp/modules/shared/glsSamplerObjectTest.js', ['modules.shared.glsSamplerObjectTest'], ['framework.common.tcuImageCompare', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.common.tcuTextureUtil', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluTextureUtil'], false);
+goog.addDependency('../../../deqp/modules/shared/glsShaderExecUtil.js', ['modules.shared.glsShaderExecUtil'], ['framework.common.tcuMatrix', 'framework.common.tcuMatrixUtil', 'framework.common.tcuTexture', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil', 'framework.opengl.gluTextureUtil', 'framework.opengl.gluVarType'], false);
+goog.addDependency('../../../deqp/modules/shared/glsShaderLibrary.js', ['modules.shared.glsShaderLibrary'], ['framework.common.tcuTestCase', 'framework.opengl.gluShaderUtil', 'modules.shared.glsShaderLibraryCase'], false);
+goog.addDependency('../../../deqp/modules/shared/glsShaderLibraryCase.js', ['modules.shared.glsShaderLibraryCase'], ['framework.common.tcuTestCase', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil'], false);
+goog.addDependency('../../../deqp/modules/shared/glsShaderRenderCase.js', ['modules.shared.glsShaderRenderCase'], ['framework.common.tcuImageCompare', 'framework.common.tcuMatrix', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluTexture', 'framework.opengl.gluTextureUtil'], false);
+goog.addDependency('../../../deqp/modules/shared/glsStateQuery.js', ['modules.shared.glsStateQuery'], [], false);
+goog.addDependency('../../../deqp/modules/shared/glsTextureTestUtil.js', ['modules.shared.glsTextureTestUtil'], ['framework.common.tcuImageCompare', 'framework.common.tcuPixelFormat', 'framework.common.tcuRGBA', 'framework.common.tcuStringTemplate', 'framework.common.tcuSurface', 'framework.common.tcuTexCompareVerifier', 'framework.common.tcuTexLookupVerifier', 'framework.common.tcuTexture', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil'], false);
+goog.addDependency('../../../deqp/modules/shared/glsUniformBlockCase.js', ['modules.shared.glsUniformBlockCase'], ['framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.delibs.debase.deString', 'framework.delibs.debase.deUtil', 'framework.opengl.gluDrawUtil', 'framework.opengl.gluShaderProgram', 'framework.opengl.gluShaderUtil'], false);
+goog.addDependency('../../../deqp/modules/shared/glsVertexArrayTests.js', ['modules.shared.glsVertexArrayTests'], ['framework.common.tcuFloat', 'framework.common.tcuImageCompare', 'framework.common.tcuLogImage', 'framework.common.tcuPixelFormat', 'framework.common.tcuRGBA', 'framework.common.tcuSurface', 'framework.common.tcuTestCase', 'framework.delibs.debase.deMath', 'framework.delibs.debase.deRandom', 'framework.opengl.gluShaderUtil', 'framework.opengl.simplereference.sglrGLContext', 'framework.opengl.simplereference.sglrReferenceContext', 'framework.opengl.simplereference.sglrShaderProgram', 'framework.referencerenderer.rrFragmentOperations', 'framework.referencerenderer.rrGenericVector', 'framework.referencerenderer.rrShadingContext', 'framework.referencerenderer.rrVertexAttrib', 'framework.referencerenderer.rrVertexPacket'], false);
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuBilinearImageCompare.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuBilinearImageCompare.js
new file mode 100644
index 0000000000..bc23104c09
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuBilinearImageCompare.js
@@ -0,0 +1,272 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.common.tcuBilinearImageCompare');
+goog.require('framework.common.tcuRGBA');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.delibs.debase.deMath');
+
+goog.scope(function() {
+
+ var tcuBilinearImageCompare = framework.common.tcuBilinearImageCompare;
+ var deMath = framework.delibs.debase.deMath;
+ var tcuTexture = framework.common.tcuTexture;
+ var tcuRGBA = framework.common.tcuRGBA;
+
+ var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+ };
+
+ // for bilinear interpolation
+ /** @const {number} */ tcuBilinearImageCompare.NUM_SUBPIXEL_BITS = 8;
+
+ // Algorithm assumes that colors are packed to 32-bit values as dictated by
+ // tcu::RGBA::*_SHIFT values.
+
+ function UintRGBA8_R(color) {
+ return (color >> 24) & 0xff;
+ }
+ function UintRGBA8_G(color) {
+ return (color >> 16) & 0xff;
+ }
+ function UintRGBA8_B(color) {
+ return (color >> 8) & 0xff;
+ }
+ function UintRGBA8_A(color) {
+ return color & 0xff;
+ }
+
+ /**
+ * @param {number} fx1 deUint32
+ * @param {number} fy1 deUint32
+ * @param {number} p00 deUint8
+ * @param {number} p01 deUint8
+ * @param {number} p10 deUint8
+ * @param {number} p11 deUint8
+ * @return {number} deUint8
+ */
+ tcuBilinearImageCompare.interpolateChannel = function(fx1, fy1, p00, p01, p10, p11) {
+ /** @const {number} */ var fx0 = (1 << tcuBilinearImageCompare.NUM_SUBPIXEL_BITS) - fx1;
+ /** @const {number} */ var fy0 = (1 << tcuBilinearImageCompare.NUM_SUBPIXEL_BITS) - fy1;
+ /** @const {number} */
+ var half = 1 << (tcuBilinearImageCompare.NUM_SUBPIXEL_BITS * 2 - 1);
+ /** @const {number} */ var sum =
+ (fx0 * fy0 * p00) +
+ (fx1 * fy0 * p10) +
+ (fx0 * fy1 * p01) +
+ (fx1 * fy1 * p11);
+ /** @const {number} */
+ var rounded = (sum + half) >> (tcuBilinearImageCompare.NUM_SUBPIXEL_BITS * 2);
+
+ DE_ASSERT(deMath.deInRange32(rounded, 0, 0xff));
+ return rounded;
+ };
+
+ tcuBilinearImageCompare.compareUintRGBA8Threshold = function(a, b, thr) {
+ if (a == b)
+ return true;
+
+ return (Math.abs(UintRGBA8_R(a) - UintRGBA8_R(b)) <= thr.getRed() &&
+ Math.abs(UintRGBA8_G(a) - UintRGBA8_G(b)) <= thr.getGreen() &&
+ Math.abs(UintRGBA8_B(a) - UintRGBA8_B(b)) <= thr.getBlue() &&
+ Math.abs(UintRGBA8_A(a) - UintRGBA8_A(b)) <= thr.getAlpha());
+ };
+
+ /**
+ * @param {tcuTexture.RGBA8View} view
+ * @param {number} u
+ * @param {number} v
+ * @return {number}
+ */
+ tcuBilinearImageCompare.bilinearSampleUintRGBA8 = function(view, u, v) {
+ /** @type {number} */ var x0 = u >> tcuBilinearImageCompare.NUM_SUBPIXEL_BITS;
+ /** @type {number} */ var y0 = v >> tcuBilinearImageCompare.NUM_SUBPIXEL_BITS;
+ /** @type {number} */ var x1 = x0 + 1;
+ /** @type {number} */ var y1 = y0 + 1;
+
+ DE_ASSERT(x1 < view.getWidth());
+ DE_ASSERT(y1 < view.getHeight());
+
+ /** @type {number} */ var fx1 = u - (x0 << tcuBilinearImageCompare.NUM_SUBPIXEL_BITS);
+ /** @type {number} */ var fy1 = v - (y0 << tcuBilinearImageCompare.NUM_SUBPIXEL_BITS);
+
+ /** @type {Array<number>} */ var channelsP00 = view.readUintRGBA8(x0, y0);
+ /** @type {Array<number>} */ var channelsP10 = view.readUintRGBA8(x1, y0);
+ /** @type {Array<number>} */ var channelsP01 = view.readUintRGBA8(x0, y1);
+ /** @type {Array<number>} */ var channelsP11 = view.readUintRGBA8(x1, y1);
+
+ /** @type {number} */ var res = 0;
+
+ res = (tcuBilinearImageCompare.interpolateChannel(fx1, fy1, UintRGBA8_R(channelsP00),
+ UintRGBA8_R(channelsP01), UintRGBA8_R(channelsP10), UintRGBA8_R(channelsP11)) & 0xff) << 24;
+ res += (tcuBilinearImageCompare.interpolateChannel(fx1, fy1, UintRGBA8_G(channelsP00),
+ UintRGBA8_G(channelsP01), UintRGBA8_G(channelsP10), UintRGBA8_G(channelsP11)) & 0xff) << 16;
+ res += (tcuBilinearImageCompare.interpolateChannel(fx1, fy1, UintRGBA8_B(channelsP00),
+ UintRGBA8_B(channelsP01), UintRGBA8_B(channelsP10), UintRGBA8_B(channelsP11)) & 0xff) << 8;
+ res += tcuBilinearImageCompare.interpolateChannel(fx1, fy1, UintRGBA8_A(channelsP00),
+ UintRGBA8_A(channelsP01), UintRGBA8_A(channelsP10), UintRGBA8_A(channelsP11)) & 0xff;
+
+ return res;
+ };
+
+ /**
+ * @param {tcuTexture.RGBA8View} reference
+ * @param {tcuTexture.RGBA8View} result
+ * @param {tcuRGBA.RGBA} threshold
+ * @param {number} x
+ * @param {number} y
+ * @return {boolean}
+ */
+ tcuBilinearImageCompare.comparePixelRGBA8 = function(reference, result, threshold, x, y) {
+ /** @const {tcuRGBA.RGBA} */ var resPix = result.readUintRGBA8(x, y);
+
+ // Step 1: Compare result pixel to 3x3 neighborhood pixels in reference.
+ /** @const {number} */ var x0 = Math.max(x - 1, 0);
+ /** @const {number} */ var x1 = x;
+ /** @const {number} */
+ var x2 = Math.min(x + 1, reference.getWidth() - 1);
+ /** @const {number} */ var y0 = Math.max(y - 1, 0);
+ /** @const {number} */ var y1 = y;
+ /** @const {number} */
+ var y2 = Math.min(y + 1, reference.getHeight() - 1);
+
+ //tcuBilinearImageCompare.readRGBA8List (reference, x0, y0, x2, y2);
+
+ if (tcuBilinearImageCompare.compareUintRGBA8Threshold(resPix, reference.readUintRGBA8(x1, y1), threshold) ||
+ tcuBilinearImageCompare.compareUintRGBA8Threshold(resPix, reference.readUintRGBA8(x0, y1), threshold) ||
+ tcuBilinearImageCompare.compareUintRGBA8Threshold(resPix, reference.readUintRGBA8(x2, y1), threshold) ||
+ tcuBilinearImageCompare.compareUintRGBA8Threshold(resPix, reference.readUintRGBA8(x0, y0), threshold) ||
+ tcuBilinearImageCompare.compareUintRGBA8Threshold(resPix, reference.readUintRGBA8(x1, y0), threshold) ||
+ tcuBilinearImageCompare.compareUintRGBA8Threshold(resPix, reference.readUintRGBA8(x2, y0), threshold) ||
+ tcuBilinearImageCompare.compareUintRGBA8Threshold(resPix, reference.readUintRGBA8(x0, y2), threshold) ||
+ tcuBilinearImageCompare.compareUintRGBA8Threshold(resPix, reference.readUintRGBA8(x1, y2), threshold) ||
+ tcuBilinearImageCompare.compareUintRGBA8Threshold(resPix, reference.readUintRGBA8(x2, y2), threshold))
+ return true;
+
+ // Step 2: Compare using bilinear sampling.
+ // \todo [pyry] Optimize sample positions!
+ /** @const {Array<Array<number>>} */ var s_offsets = [
+ [226, 186],
+ [335, 235],
+ [279, 334],
+ [178, 272],
+ [112, 202],
+ [306, 117],
+ [396, 299],
+ [206, 382],
+ [146, 96],
+ [423, 155],
+ [361, 412],
+ [84, 339],
+ [48, 130],
+ [367, 43],
+ [455, 367],
+ [105, 439],
+ [83, 46],
+ [217, 24],
+ [461, 71],
+ [450, 459],
+ [239, 469],
+ [67, 267],
+ [459, 255],
+ [13, 416],
+ [10, 192],
+ [141, 502],
+ [503, 304],
+ [380, 506]
+ ];
+
+ for (var sampleNdx = 0; sampleNdx < s_offsets.length; sampleNdx++) {
+ /** @const {number} */
+ var u = ((x - 1) << tcuBilinearImageCompare.NUM_SUBPIXEL_BITS) + s_offsets[sampleNdx][0];
+ /** @const {number} */
+ var v = ((y - 1) << tcuBilinearImageCompare.NUM_SUBPIXEL_BITS) + s_offsets[sampleNdx][1];
+
+ if (!deMath.deInBounds32(u, 0, (reference.getWidth() - 1) << tcuBilinearImageCompare.NUM_SUBPIXEL_BITS) ||
+ !deMath.deInBounds32(v, 0, (reference.getHeight() - 1) << tcuBilinearImageCompare.NUM_SUBPIXEL_BITS))
+ continue;
+
+ if (tcuBilinearImageCompare.compareUintRGBA8Threshold(resPix, tcuBilinearImageCompare.bilinearSampleUintRGBA8(reference, u, v), threshold))
+ return true;
+ }
+
+ return false;
+ };
+
+ /**
+ * @param {tcuTexture.RGBA8View} reference
+ * @param {tcuTexture.RGBA8View} result
+ * @param {tcuTexture.PixelBufferAccess} errorMask
+ * @param {tcuRGBA.RGBA} threshold
+ * @return {boolean}
+ */
+ tcuBilinearImageCompare.bilinearCompareRGBA8 = function(reference, result, errorMask, threshold) {
+ DE_ASSERT(reference.getFormat().isEqual(new tcuTexture.TextureFormat(
+ tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8)));
+ DE_ASSERT(result.getFormat().isEqual(new tcuTexture.TextureFormat(
+ tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8)));
+
+ // Clear error mask first to green (faster this way).
+ errorMask.clear([0.0, 1.0, 0.0, 1.0]);
+
+ /** @type {boolean} */ var allOk = true;
+
+ for (var y = 0; y < reference.getHeight(); y++) {
+ for (var x = 0; x < reference.getWidth(); x++) {
+ if (!tcuBilinearImageCompare.comparePixelRGBA8(reference, result, threshold, x, y) &&
+ !tcuBilinearImageCompare.comparePixelRGBA8(result, reference, threshold, x, y)) {
+ allOk = false;
+ errorMask.setPixel([1.0, 0.0, 0.0, 1.0], x, y);
+ }
+ }
+ }
+
+ return allOk;
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} reference
+ * @param {tcuTexture.ConstPixelBufferAccess} result
+ * @param {tcuTexture.PixelBufferAccess} errorMask
+ * @param {tcuRGBA.RGBA} threshold
+ * @return {boolean}
+ */
+ tcuBilinearImageCompare.bilinearCompare = function(reference, result, errorMask, threshold) {
+ assertMsgOptions(result.getWidth() == reference.getWidth() && result.getHeight() == reference.getHeight() && result.getDepth() == reference.getDepth(),
+ 'Reference and result images have different dimensions', false, true);
+
+ assertMsgOptions(errorMask.getWidth() == reference.getWidth() && errorMask.getHeight() == reference.getHeight() && errorMask.getDepth() == reference.getDepth(),
+ 'Reference and error mask images have different dimensions', false, true);
+
+ /** @type {boolean} */ var isEqual = reference.getFormat().isEqual(
+ new tcuTexture.TextureFormat(
+ tcuTexture.ChannelOrder.RGBA,
+ tcuTexture.ChannelType.UNORM_INT8));
+ if (isEqual) {
+ /** @type {tcuTexture.RGBA8View} */ var refView = new tcuTexture.RGBA8View(reference);
+ /** @type {tcuTexture.RGBA8View} */ var resView = new tcuTexture.RGBA8View(result);
+ return tcuBilinearImageCompare.bilinearCompareRGBA8(refView, resView, errorMask, threshold);
+ } else
+ throw new Error('Unsupported format for bilinear comparison');
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuCompressedTexture.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuCompressedTexture.js
new file mode 100644
index 0000000000..a309f81cfd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuCompressedTexture.js
@@ -0,0 +1,967 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/*--------------------------------------------------------------------*//*!
+ * \brief Map tcu::TextureFormat to GL pixel transfer format.
+ *
+ * Maps generic texture format description to GL pixel transfer format.
+ * If no mapping is found, throws tcu::InternalError.
+ *
+ * \param texFormat Generic texture format.
+ * \return GL pixel transfer format.
+ *//*--------------------------------------------------------------------*/
+'use strict';
+goog.provide('framework.common.tcuCompressedTexture');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.delibs.debase.deMath');
+
+goog.scope(function() {
+
+var tcuCompressedTexture = framework.common.tcuCompressedTexture;
+var tcuTexture = framework.common.tcuTexture;
+var deMath = framework.delibs.debase.deMath;
+
+ var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+ };
+
+/**
+ * @enum
+ */
+tcuCompressedTexture.Format = {
+ ETC1_RGB8: 0,
+ EAC_R11: 1,
+ EAC_SIGNED_R11: 2,
+ EAC_RG11: 3,
+ EAC_SIGNED_RG11: 4,
+ ETC2_RGB8: 5,
+ ETC2_SRGB8: 6,
+ ETC2_RGB8_PUNCHTHROUGH_ALPHA1: 7,
+ ETC2_SRGB8_PUNCHTHROUGH_ALPHA1: 8,
+ ETC2_EAC_RGBA8: 9,
+ ETC2_EAC_SRGB8_ALPHA8: 10,
+
+ ASTC_4x4_RGBA: 11,
+ ASTC_5x4_RGBA: 12,
+ ASTC_5x5_RGBA: 13,
+ ASTC_6x5_RGBA: 14,
+ ASTC_6x6_RGBA: 15,
+ ASTC_8x5_RGBA: 16,
+ ASTC_8x6_RGBA: 17,
+ ASTC_8x8_RGBA: 18,
+ ASTC_10x5_RGBA: 19,
+ ASTC_10x6_RGBA: 20,
+ ASTC_10x8_RGBA: 21,
+ ASTC_10x10_RGBA: 22,
+ ASTC_12x10_RGBA: 23,
+ ASTC_12x12_RGBA: 24,
+ ASTC_4x4_SRGB8_ALPHA8: 25,
+ ASTC_5x4_SRGB8_ALPHA8: 26,
+ ASTC_5x5_SRGB8_ALPHA8: 27,
+ ASTC_6x5_SRGB8_ALPHA8: 28,
+ ASTC_6x6_SRGB8_ALPHA8: 29,
+ ASTC_8x5_SRGB8_ALPHA8: 30,
+ ASTC_8x6_SRGB8_ALPHA8: 31,
+ ASTC_8x8_SRGB8_ALPHA8: 32,
+ ASTC_10x5_SRGB8_ALPHA8: 33,
+ ASTC_10x6_SRGB8_ALPHA8: 34,
+ ASTC_10x8_SRGB8_ALPHA8: 35,
+ ASTC_10x10_SRGB8_ALPHA8: 36,
+ ASTC_12x10_SRGB8_ALPHA8: 37,
+ ASTC_12x12_SRGB8_ALPHA8: 38
+};
+
+tcuCompressedTexture.divRoundUp = function(a, b) {
+ return Math.floor(a / b) + ((a % b) ? 1 : 0);
+};
+
+tcuCompressedTexture.isEtcFormat = function(fmt) {
+ // WebGL2 supports ETC2 and EAC formats
+ switch (fmt) {
+ // case tcuCompressedTexture.Format.ETC1_RGB8:
+ case tcuCompressedTexture.Format.EAC_R11:
+ case tcuCompressedTexture.Format.EAC_SIGNED_R11:
+ case tcuCompressedTexture.Format.EAC_RG11:
+ case tcuCompressedTexture.Format.EAC_SIGNED_RG11:
+ case tcuCompressedTexture.Format.ETC2_RGB8:
+ case tcuCompressedTexture.Format.ETC2_SRGB8:
+ case tcuCompressedTexture.Format.ETC2_RGB8_PUNCHTHROUGH_ALPHA1:
+ case tcuCompressedTexture.Format.ETC2_SRGB8_PUNCHTHROUGH_ALPHA1:
+ case tcuCompressedTexture.Format.ETC2_EAC_RGBA8:
+ case tcuCompressedTexture.Format.ETC2_EAC_SRGB8_ALPHA8:
+ return true;
+
+ default:
+ return false;
+ }
+};
+
+tcuCompressedTexture.etcDecompressInternal = function() {
+
+var ETC2_BLOCK_WIDTH = 4;
+var ETC2_BLOCK_HEIGHT = 4;
+var ETC2_UNCOMPRESSED_PIXEL_SIZE_A8 = 1;
+var ETC2_UNCOMPRESSED_PIXEL_SIZE_R11 = 2;
+var ETC2_UNCOMPRESSED_PIXEL_SIZE_RG11 = 4;
+var ETC2_UNCOMPRESSED_PIXEL_SIZE_RGB8 = 3;
+var ETC2_UNCOMPRESSED_PIXEL_SIZE_RGBA8 = 4;
+var ETC2_UNCOMPRESSED_BLOCK_SIZE_A8 = ETC2_BLOCK_WIDTH * ETC2_BLOCK_HEIGHT * ETC2_UNCOMPRESSED_PIXEL_SIZE_A8;
+var ETC2_UNCOMPRESSED_BLOCK_SIZE_R11 = ETC2_BLOCK_WIDTH * ETC2_BLOCK_HEIGHT * ETC2_UNCOMPRESSED_PIXEL_SIZE_R11;
+var ETC2_UNCOMPRESSED_BLOCK_SIZE_RG11 = ETC2_BLOCK_WIDTH * ETC2_BLOCK_HEIGHT * ETC2_UNCOMPRESSED_PIXEL_SIZE_RG11;
+var ETC2_UNCOMPRESSED_BLOCK_SIZE_RGB8 = ETC2_BLOCK_WIDTH * ETC2_BLOCK_HEIGHT * ETC2_UNCOMPRESSED_PIXEL_SIZE_RGB8;
+var ETC2_UNCOMPRESSED_BLOCK_SIZE_RGBA8 = ETC2_BLOCK_WIDTH * ETC2_BLOCK_HEIGHT * ETC2_UNCOMPRESSED_PIXEL_SIZE_RGBA8;
+
+/**
+ * @param {ArrayBuffer} src Source ArrayBuffer
+ * @return {Uint8Array}
+ */
+var get64BitBlock = function(src, blockNdx) {
+ var block = new Uint8Array(src, blockNdx * 8, 8);
+ return block;
+};
+
+/**
+ * @param {ArrayBuffer} src Source ArrayBuffer
+ * Return the first 64 bits of a 128 bit block.
+ */
+var get128BitBlockStart = function(src, blockNdx) {
+ return get64BitBlock(src, 2 * blockNdx);
+};
+
+/**
+ * @param {ArrayBuffer} src Source ArrayBuffer
+ * Return the last 64 bits of a 128 bit block.
+ */
+var get128BitBlockEnd = function(src, blockNdx) {
+ return get64BitBlock(src, 2 * blockNdx + 1);
+};
+
+var mask8 = function(src, low, high) {
+ if (low > 7 || high < 0)
+ return {
+ value: 0,
+ bits: 0
+ };
+
+ var numBits = high - low + 1;
+ var mask = (1 << numBits) - 1;
+
+ return {
+ value: (src >> low) & mask,
+ bits: numBits
+ };
+};
+
+var getBits64 = function(src, low, high) {
+ var result = 0;
+ var bits = 0;
+ var lowIndex = low;
+ var highIndex = high;
+ for (var i = 7; i >= 0; i--) {
+ var v = mask8(src[i], Math.max(0, lowIndex), Math.min(7, highIndex));
+ lowIndex = lowIndex - 8;
+ highIndex = highIndex - 8;
+ result = result | (v.value << bits);
+ bits = v.bits;
+ }
+ return result;
+};
+
+var getBit64 = function(src, bit) {
+ return getBits64(src, bit, bit);
+};
+
+var extendSigned3To8 = function(src) {
+ var isNeg = (src & (1 << 2)) != 0;
+ var val = isNeg ? src - 8 : src;
+ return val;
+};
+
+var extend4To8 = function(src) {
+ return src * 255 / 15;
+};
+
+var extend5To8 = function(src) {
+ return src * 255 / 31;
+};
+
+var extend6To8 = function(src) {
+ return src * 255 / 63;
+};
+
+var extend7To8 = function(src) {
+ return src * 255 / 127;
+};
+
+var extend11To16 = function(src) {
+ return src * 32.015144;
+};
+
+var extend11To16WithSign = function(src) {
+ if (src < 0)
+ return -extend11To16(-src);
+ else
+ return extend11To16(src);
+};
+
+/**
+ * @param { (Uint16Array|Int16Array) } dst
+ * @param {Uint8Array} src
+ * @param {boolean} signedMode
+ */
+var decompressEAC11Block = function(dst, src, signedMode) {
+ var modifierTable = [
+ [-3, -6, -9, -15, 2, 5, 8, 14],
+ [-3, -7, -10, -13, 2, 6, 9, 12],
+ [-2, -5, -8, -13, 1, 4, 7, 12],
+ [-2, -4, -6, -13, 1, 3, 5, 12],
+ [-3, -6, -8, -12, 2, 5, 7, 11],
+ [-3, -7, -9, -11, 2, 6, 8, 10],
+ [-4, -7, -8, -11, 3, 6, 7, 10],
+ [-3, -5, -8, -11, 2, 4, 7, 10],
+ [-2, -6, -8, -10, 1, 5, 7, 9],
+ [-2, -5, -8, -10, 1, 4, 7, 9],
+ [-2, -4, -8, -10, 1, 3, 7, 9],
+ [-2, -5, -7, -10, 1, 4, 6, 9],
+ [-3, -4, -7, -10, 2, 3, 6, 9],
+ [-1, -2, -3, -10, 0, 1, 2, 9],
+ [-4, -6, -8, -9, 3, 5, 7, 8],
+ [-3, -5, -7, -9, 2, 4, 6, 8]
+ ];
+
+ var multiplier = getBits64(src, 52, 55);
+ var tableNdx = getBits64(src, 48, 51);
+ var baseCodeword = getBits64(src, 56, 63);
+
+ if (signedMode) {
+ if (baseCodeword > 127)
+ baseCodeword -= 256;
+ if (baseCodeword == -128)
+ baseCodeword = -127;
+ }
+
+ var pixelNdx = 0;
+ for (var x = 0; x < ETC2_BLOCK_WIDTH; x++) {
+ for (var y = 0; y < ETC2_BLOCK_HEIGHT; y++) {
+ var dstOffset = (y * ETC2_BLOCK_WIDTH + x);
+ var pixelBitNdx = 45 - 3 * pixelNdx;
+ var modifierNdx = (getBit64(src, pixelBitNdx + 2) << 2) | (getBit64(src, pixelBitNdx + 1) << 1) | getBit64(src, pixelBitNdx);
+ var modifier = modifierTable[tableNdx][modifierNdx];
+
+ if (signedMode) {
+ if (multiplier != 0)
+ dst[dstOffset] = deMath.clamp(baseCodeword * 8 + multiplier * modifier * 8, -1023, 1023);
+ else
+ dst[dstOffset] = deMath.clamp(baseCodeword * 8 + modifier, -1023, 1023);
+ } else {
+ if (multiplier != 0)
+ dst[dstOffset] = deMath.clamp(baseCodeword * 8 + 4 + multiplier * modifier * 8, 0, 2047);
+ else
+ dst[dstOffset] = deMath.clamp(baseCodeword * 8 + 4 + modifier, 0, 2047);
+ }
+ pixelNdx++;
+ }
+ }
+};
+
+var decompressEAC_R11 = function(/*const tcu::PixelBufferAccess&*/ dst, width, height, src, signedMode) {
+ /** @const */ var numBlocksX = tcuCompressedTexture.divRoundUp(width, 4);
+ /** @const */ var numBlocksY = tcuCompressedTexture.divRoundUp(height, 4);
+ var dstPtr;
+ var dstRowPitch = dst.getRowPitch();
+ var dstPixelSize = ETC2_UNCOMPRESSED_PIXEL_SIZE_R11;
+ var uncompressedBlockArray = new ArrayBuffer(ETC2_UNCOMPRESSED_BLOCK_SIZE_R11);
+ var uncompressedBlock16;
+ if (signedMode) {
+ dstPtr = new Int16Array(dst.m_data);
+ uncompressedBlock16 = new Int16Array(uncompressedBlockArray);
+ } else {
+ dstPtr = new Uint16Array(dst.m_data);
+ uncompressedBlock16 = new Uint16Array(uncompressedBlockArray);
+ }
+
+ for (var blockY = 0; blockY < numBlocksY; blockY++) {
+ for (var blockX = 0; blockX < numBlocksX; blockX++) {
+ /*const deUint64*/ var compressedBlock = get64BitBlock(src, blockY * numBlocksX + blockX);
+
+ // Decompress.
+ decompressEAC11Block(uncompressedBlock16, compressedBlock, signedMode);
+
+ // Write to dst.
+ var baseX = blockX * ETC2_BLOCK_WIDTH;
+ var baseY = blockY * ETC2_BLOCK_HEIGHT;
+ for (var y = 0; y < Math.min(ETC2_BLOCK_HEIGHT, height - baseY); y++) {
+ for (var x = 0; x < Math.min(ETC2_BLOCK_WIDTH, width - baseX); x++) {
+ DE_ASSERT(ETC2_UNCOMPRESSED_PIXEL_SIZE_R11 == 2);
+
+ if (signedMode) {
+ var srcIndex = y * ETC2_BLOCK_WIDTH + x;
+ var dstIndex = (baseY + y) * dstRowPitch / dstPixelSize + baseX + x;
+
+ dstPtr[dstIndex] = extend11To16WithSign(uncompressedBlock16[srcIndex]);
+ } else {
+ var srcIndex = y * ETC2_BLOCK_WIDTH + x;
+ var dstIndex = (baseY + y) * dstRowPitch / dstPixelSize + baseX + x;
+
+ dstPtr[dstIndex] = extend11To16(uncompressedBlock16[srcIndex]);
+ }
+ }
+ }
+ }
+ }
+};
+
+var decompressEAC_RG11 = function(/*const tcu::PixelBufferAccess&*/ dst, width, height, src, signedMode) {
+ /** @const */ var numBlocksX = tcuCompressedTexture.divRoundUp(width, 4);
+ /** @const */ var numBlocksY = tcuCompressedTexture.divRoundUp(height, 4);
+ var dstPtr;
+ var dstRowPitch = dst.getRowPitch();
+ var dstPixelSize = ETC2_UNCOMPRESSED_PIXEL_SIZE_RG11;
+ var uncompressedBlockArrayR = new ArrayBuffer(ETC2_UNCOMPRESSED_BLOCK_SIZE_R11);
+ var uncompressedBlockArrayG = new ArrayBuffer(ETC2_UNCOMPRESSED_BLOCK_SIZE_R11);
+ var uncompressedBlockR16;
+ var uncompressedBlockG16;
+ if (signedMode) {
+ dstPtr = new Int16Array(dst.m_data);
+ uncompressedBlockR16 = new Int16Array(uncompressedBlockArrayR);
+ uncompressedBlockG16 = new Int16Array(uncompressedBlockArrayG);
+ } else {
+ dstPtr = new Uint16Array(dst.m_data);
+ uncompressedBlockR16 = new Uint16Array(uncompressedBlockArrayR);
+ uncompressedBlockG16 = new Uint16Array(uncompressedBlockArrayG);
+ }
+
+ for (var blockY = 0; blockY < numBlocksY; blockY++) {
+ for (var blockX = 0; blockX < numBlocksX; blockX++) {
+ /*const deUint64*/ var compressedBlockR = get128BitBlockStart(src, blockY * numBlocksX + blockX);
+ /*const deUint64*/ var compressedBlockG = get128BitBlockEnd(src, blockY * numBlocksX + blockX);
+
+ // Decompress.
+ decompressEAC11Block(uncompressedBlockR16, compressedBlockR, signedMode);
+ decompressEAC11Block(uncompressedBlockG16, compressedBlockG, signedMode);
+
+ // Write to dst.
+ var baseX = blockX * ETC2_BLOCK_WIDTH;
+ var baseY = blockY * ETC2_BLOCK_HEIGHT;
+ for (var y = 0; y < Math.min(ETC2_BLOCK_HEIGHT, height - baseY); y++) {
+ for (var x = 0; x < Math.min(ETC2_BLOCK_WIDTH, width - baseX); x++) {
+ DE_ASSERT(ETC2_UNCOMPRESSED_PIXEL_SIZE_RG11 == 4);
+
+ if (signedMode) {
+ var srcIndex = y * ETC2_BLOCK_WIDTH + x;
+ var dstIndex = 2 * ((baseY + y) * dstRowPitch / dstPixelSize + baseX + x);
+
+ dstPtr[dstIndex] = extend11To16WithSign(uncompressedBlockR16[srcIndex]);
+ dstPtr[dstIndex + 1] = extend11To16WithSign(uncompressedBlockG16[srcIndex]);
+ } else {
+ var srcIndex = y * ETC2_BLOCK_WIDTH + x;
+ var dstIndex = 2 * ((baseY + y) * dstRowPitch / dstPixelSize + baseX + x);
+
+ dstPtr[dstIndex] = extend11To16(uncompressedBlockR16[srcIndex]);
+ dstPtr[dstIndex + 1] = extend11To16(uncompressedBlockG16[srcIndex]);
+ }
+ }
+ }
+ }
+ }
+};
+
+// if alphaMode is true, do PUNCHTHROUGH and store alpha to alphaDst; otherwise do ordinary ETC2 RGB8.
+/**
+ * @param {Uint8Array} dst Destination array
+ * @param {Uint8Array} src Source array
+ * @param {Uint8Array} alphaDst Optional Alpha output channel
+ */
+var decompressETC2Block = function(dst, src, alphaDst, alphaMode) {
+ /**
+ * enum
+ */
+ var Etc2Mode = {
+ MODE_INDIVIDUAL: 0,
+ MODE_DIFFERENTIAL: 1,
+ MODE_T: 2,
+ MODE_H: 3,
+ MODE_PLANAR: 4
+ };
+
+ var diffOpaqueBit = getBit64(src, 33);
+ var selBR = getBits64(src, 59, 63); // 5 bits.
+ var selBG = getBits64(src, 51, 55);
+ var selBB = getBits64(src, 43, 47);
+ var selDR = extendSigned3To8(getBits64(src, 56, 58)); // 3 bits.
+ var selDG = extendSigned3To8(getBits64(src, 48, 50));
+ var selDB = extendSigned3To8(getBits64(src, 40, 42));
+
+ var mode;
+
+ if (!alphaMode && diffOpaqueBit == 0)
+ mode = Etc2Mode.MODE_INDIVIDUAL;
+ else if (!deMath.deInRange32(selBR + selDR, 0, 31))
+ mode = Etc2Mode.MODE_T;
+ else if (!deMath.deInRange32(selBG + selDG, 0, 31))
+ mode = Etc2Mode.MODE_H;
+ else if (!deMath.deInRange32(selBB + selDB, 0, 31))
+ mode = Etc2Mode.MODE_PLANAR;
+ else
+ mode = Etc2Mode.MODE_DIFFERENTIAL;
+
+ if (mode == Etc2Mode.MODE_INDIVIDUAL || mode == Etc2Mode.MODE_DIFFERENTIAL) {
+ // Individual and differential modes have some steps in common, handle them here.
+ var modifierTable = [
+ // 00 01 10 11
+ [2, 8, -2, -8],
+ [5, 17, -5, -17],
+ [9, 29, -9, -29],
+ [13, 42, -13, -42],
+ [18, 60, -18, -60],
+ [24, 80, -24, -80],
+ [33, 106, -33, -106],
+ [47, 183, -47, -183]
+ ];
+
+ var flipBit = getBit64(src, 32);
+ var table = [getBits64(src, 37, 39), getBits64(src, 34, 36)];
+ var baseR = [];
+ var baseG = [];
+ var baseB = [];
+
+ if (mode == Etc2Mode.MODE_INDIVIDUAL) {
+ // Individual mode, initial values.
+ baseR[0] = extend4To8(getBits64(src, 60, 63));
+ baseR[1] = extend4To8(getBits64(src, 56, 59));
+ baseG[0] = extend4To8(getBits64(src, 52, 55));
+ baseG[1] = extend4To8(getBits64(src, 48, 51));
+ baseB[0] = extend4To8(getBits64(src, 44, 47));
+ baseB[1] = extend4To8(getBits64(src, 40, 43));
+ } else {
+ // Differential mode, initial values.
+ baseR[0] = extend5To8(selBR);
+ baseG[0] = extend5To8(selBG);
+ baseB[0] = extend5To8(selBB);
+
+ baseR[1] = extend5To8((selBR + selDR));
+ baseG[1] = extend5To8((selBG + selDG));
+ baseB[1] = extend5To8((selBB + selDB));
+ }
+
+ // Write final pixels for individual or differential mode.
+ var pixelNdx = 0;
+ for (var x = 0; x < ETC2_BLOCK_WIDTH; x++) {
+ for (var y = 0; y < ETC2_BLOCK_HEIGHT; y++, pixelNdx++) {
+ var dstOffset = (y * ETC2_BLOCK_WIDTH + x) * ETC2_UNCOMPRESSED_PIXEL_SIZE_RGB8;
+ var subBlock = ((flipBit ? y : x) >= 2) ? 1 : 0;
+ var tableNdx = table[subBlock];
+ var modifierNdx = (getBit64(src, 16 + pixelNdx) << 1) | getBit64(src, pixelNdx);
+ var alphaDstOffset = (y * ETC2_BLOCK_WIDTH + x) * ETC2_UNCOMPRESSED_PIXEL_SIZE_A8; // Only needed for PUNCHTHROUGH version.
+
+ // If doing PUNCHTHROUGH version (alphaMode), opaque bit may affect colors.
+ if (alphaMode && diffOpaqueBit == 0 && modifierNdx == 2) {
+ dst[dstOffset + 0] = 0;
+ dst[dstOffset + 1] = 0;
+ dst[dstOffset + 2] = 0;
+ alphaDst[alphaDstOffset] = 0;
+ } else {
+ var modifier;
+
+ // PUNCHTHROUGH version and opaque bit may also affect modifiers.
+ if (alphaMode && diffOpaqueBit == 0 && (modifierNdx == 0 || modifierNdx == 2))
+ modifier = 0;
+ else
+ modifier = modifierTable[tableNdx][modifierNdx];
+
+ dst[dstOffset + 0] = deMath.clamp(baseR[subBlock] + modifier, 0, 255);
+ dst[dstOffset + 1] = deMath.clamp(baseG[subBlock] + modifier, 0, 255);
+ dst[dstOffset + 2] = deMath.clamp(baseB[subBlock] + modifier, 0, 255);
+
+ if (alphaMode)
+ alphaDst[alphaDstOffset] = 255;
+ }
+ }
+ }
+ } else if (mode == Etc2Mode.MODE_T || mode == Etc2Mode.MODE_H) {
+ // T and H modes have some steps in common, handle them here.
+ var distTable = [3, 6, 11, 16, 23, 32, 41, 64];
+
+ var paintR = [];
+ var paintG = [];
+ var paintB = [];
+
+ if (mode == Etc2Mode.MODE_T) {
+ // T mode, calculate paint values.
+ var R1a = getBits64(src, 59, 60);
+ var R1b = getBits64(src, 56, 57);
+ var G1 = getBits64(src, 52, 55);
+ var B1 = getBits64(src, 48, 51);
+ var R2 = getBits64(src, 44, 47);
+ var G2 = getBits64(src, 40, 43);
+ var B2 = getBits64(src, 36, 39);
+ var distNdx = (getBits64(src, 34, 35) << 1) | getBit64(src, 32);
+ var dist = distTable[distNdx];
+
+ paintR[0] = extend4To8((R1a << 2) | R1b);
+ paintG[0] = extend4To8(G1);
+ paintB[0] = extend4To8(B1);
+ paintR[2] = extend4To8(R2);
+ paintG[2] = extend4To8(G2);
+ paintB[2] = extend4To8(B2);
+ paintR[1] = deMath.clamp(paintR[2] + dist, 0, 255);
+ paintG[1] = deMath.clamp(paintG[2] + dist, 0, 255);
+ paintB[1] = deMath.clamp(paintB[2] + dist, 0, 255);
+ paintR[3] = deMath.clamp(paintR[2] - dist, 0, 255);
+ paintG[3] = deMath.clamp(paintG[2] - dist, 0, 255);
+ paintB[3] = deMath.clamp(paintB[2] - dist, 0, 255);
+ } else {
+ // H mode, calculate paint values.
+ var R1 = getBits64(src, 59, 62);
+ var G1a = getBits64(src, 56, 58);
+ var G1b = getBit64(src, 52);
+ var B1a = getBit64(src, 51);
+ var B1b = getBits64(src, 47, 49);
+ var R2 = getBits64(src, 43, 46);
+ var G2 = getBits64(src, 39, 42);
+ var B2 = getBits64(src, 35, 38);
+ var baseR = [];
+ var baseG = [];
+ var baseB = [];
+ var baseValue = [];
+ var distNdx;
+ var dist;
+
+ baseR[0] = extend4To8(R1);
+ baseG[0] = extend4To8((G1a << 1) | G1b);
+ baseB[0] = extend4To8((B1a << 3) | B1b);
+ baseR[1] = extend4To8(R2);
+ baseG[1] = extend4To8(G2);
+ baseB[1] = extend4To8(B2);
+ baseValue[0] = ((baseR[0]) << 16) | ((baseG[0]) << 8) | baseB[0];
+ baseValue[1] = ((baseR[1]) << 16) | ((baseG[1]) << 8) | baseB[1];
+ distNdx = (getBit64(src, 34) << 2) | (getBit64(src, 32) << 1);
+ if (baseValue[0] >= baseValue[1])
+ distNdx += 1;
+ dist = distTable[distNdx];
+
+ paintR[0] = deMath.clamp(baseR[0] + dist, 0, 255);
+ paintG[0] = deMath.clamp(baseG[0] + dist, 0, 255);
+ paintB[0] = deMath.clamp(baseB[0] + dist, 0, 255);
+ paintR[1] = deMath.clamp(baseR[0] - dist, 0, 255);
+ paintG[1] = deMath.clamp(baseG[0] - dist, 0, 255);
+ paintB[1] = deMath.clamp(baseB[0] - dist, 0, 255);
+ paintR[2] = deMath.clamp(baseR[1] + dist, 0, 255);
+ paintG[2] = deMath.clamp(baseG[1] + dist, 0, 255);
+ paintB[2] = deMath.clamp(baseB[1] + dist, 0, 255);
+ paintR[3] = deMath.clamp(baseR[1] - dist, 0, 255);
+ paintG[3] = deMath.clamp(baseG[1] - dist, 0, 255);
+ paintB[3] = deMath.clamp(baseB[1] - dist, 0, 255);
+ }
+
+ // Write final pixels for T or H mode.
+ var pixelNdx = 0;
+ for (var x = 0; x < ETC2_BLOCK_WIDTH; x++) {
+ for (var y = 0; y < ETC2_BLOCK_HEIGHT; y++, pixelNdx++) {
+ var dstOffset = (y * ETC2_BLOCK_WIDTH + x) * ETC2_UNCOMPRESSED_PIXEL_SIZE_RGB8;
+ var paintNdx = (getBit64(src, 16 + pixelNdx) << 1) | getBit64(src, pixelNdx);
+ var alphaDstOffset = (y * ETC2_BLOCK_WIDTH + x) * ETC2_UNCOMPRESSED_PIXEL_SIZE_A8; // Only needed for PUNCHTHROUGH version.
+
+ if (alphaMode && diffOpaqueBit == 0 && paintNdx == 2) {
+ dst[dstOffset + 0] = 0;
+ dst[dstOffset + 1] = 0;
+ dst[dstOffset + 2] = 0;
+ alphaDst[alphaDstOffset] = 0;
+ } else {
+ dst[dstOffset + 0] = deMath.clamp(paintR[paintNdx], 0, 255);
+ dst[dstOffset + 1] = deMath.clamp(paintG[paintNdx], 0, 255);
+ dst[dstOffset + 2] = deMath.clamp(paintB[paintNdx], 0, 255);
+
+ if (alphaMode)
+ alphaDst[alphaDstOffset] = 255;
+ }
+ }
+ }
+ } else {
+ // Planar mode.
+ var GO1 = getBit64(src, 56);
+ var GO2 = getBits64(src, 49, 54);
+ var BO1 = getBit64(src, 48);
+ var BO2 = getBits64(src, 43, 44);
+ var BO3 = getBits64(src, 39, 41);
+ var RH1 = getBits64(src, 34, 38);
+ var RH2 = getBit64(src, 32);
+ var RO = extend6To8(getBits64(src, 57, 62));
+ var GO = extend7To8((GO1 << 6) | GO2);
+ var BO = extend6To8((BO1 << 5) | (BO2 << 3) | BO3);
+ var RH = extend6To8((RH1 << 1) | RH2);
+ var GH = extend7To8(getBits64(src, 25, 31));
+ var BH = extend6To8(getBits64(src, 19, 24));
+ var RV = extend6To8(getBits64(src, 13, 18));
+ var GV = extend7To8(getBits64(src, 6, 12));
+ var BV = extend6To8(getBits64(src, 0, 5));
+
+ // Write final pixels for planar mode.
+ for (var y = 0; y < 4; y++) {
+ for (var x = 0; x < 4; x++) {
+ var dstOffset = (y * ETC2_BLOCK_WIDTH + x) * ETC2_UNCOMPRESSED_PIXEL_SIZE_RGB8;
+ var unclampedR = (x * (RH - RO) + y * (RV - RO) + 4 * RO + 2) / 4;
+ var unclampedG = (x * (GH - GO) + y * (GV - GO) + 4 * GO + 2) / 4;
+ var unclampedB = (x * (BH - BO) + y * (BV - BO) + 4 * BO + 2) / 4;
+ var alphaDstOffset = (y * ETC2_BLOCK_WIDTH + x) * ETC2_UNCOMPRESSED_PIXEL_SIZE_A8; // Only needed for PUNCHTHROUGH version.
+
+ dst[dstOffset + 0] = deMath.clamp(unclampedR, 0, 255);
+ dst[dstOffset + 1] = deMath.clamp(unclampedG, 0, 255);
+ dst[dstOffset + 2] = deMath.clamp(unclampedB, 0, 255);
+
+ if (alphaMode)
+ alphaDst[alphaDstOffset] = 255;
+ }
+ }
+ }
+};
+
+var decompressEAC8Block = function(dst, src) {
+ var modifierTable = [
+ [-3, -6, -9, -15, 2, 5, 8, 14],
+ [-3, -7, -10, -13, 2, 6, 9, 12],
+ [-2, -5, -8, -13, 1, 4, 7, 12],
+ [-2, -4, -6, -13, 1, 3, 5, 12],
+ [-3, -6, -8, -12, 2, 5, 7, 11],
+ [-3, -7, -9, -11, 2, 6, 8, 10],
+ [-4, -7, -8, -11, 3, 6, 7, 10],
+ [-3, -5, -8, -11, 2, 4, 7, 10],
+ [-2, -6, -8, -10, 1, 5, 7, 9],
+ [-2, -5, -8, -10, 1, 4, 7, 9],
+ [-2, -4, -8, -10, 1, 3, 7, 9],
+ [-2, -5, -7, -10, 1, 4, 6, 9],
+ [-3, -4, -7, -10, 2, 3, 6, 9],
+ [-1, -2, -3, -10, 0, 1, 2, 9],
+ [-4, -6, -8, -9, 3, 5, 7, 8],
+ [-3, -5, -7, -9, 2, 4, 6, 8]
+ ];
+
+ var baseCodeword = getBits64(src, 56, 63);
+ var multiplier = getBits64(src, 52, 55);
+ var tableNdx = getBits64(src, 48, 51);
+
+ var pixelNdx = 0;
+ for (var x = 0; x < ETC2_BLOCK_WIDTH; x++) {
+ for (var y = 0; y < ETC2_BLOCK_HEIGHT; y++, pixelNdx++) {
+ var dstOffset = (y * ETC2_BLOCK_WIDTH + x);
+ var pixelBitNdx = 45 - 3 * pixelNdx;
+ var modifierNdx = (getBit64(src, pixelBitNdx + 2) << 2) | (getBit64(src, pixelBitNdx + 1) << 1) | getBit64(src, pixelBitNdx);
+ var modifier = modifierTable[tableNdx][modifierNdx];
+
+ dst[dstOffset] = deMath.clamp(baseCodeword + multiplier * modifier, 0, 255);
+ }
+ }
+};
+
+var decompressETC2 = function(/*const tcu::PixelBufferAccess&*/ dst, width, height, src) {
+ var numBlocksX = tcuCompressedTexture.divRoundUp(width, 4);
+ var numBlocksY = tcuCompressedTexture.divRoundUp(height, 4);
+ var dstPtr = new Uint8Array(dst.m_data);
+ var dstRowPitch = dst.getRowPitch();
+ var dstPixelSize = ETC2_UNCOMPRESSED_PIXEL_SIZE_RGB8;
+ var uncompressedBlockArray = new ArrayBuffer(ETC2_UNCOMPRESSED_BLOCK_SIZE_RGB8);
+ var uncompressedBlock = new Uint8Array(uncompressedBlockArray);
+
+ for (var blockY = 0; blockY < numBlocksY; blockY++) {
+ for (var blockX = 0; blockX < numBlocksX; blockX++) {
+ var compressedBlock = get64BitBlock(src, blockY * numBlocksX + blockX);
+
+ // Decompress.
+ decompressETC2Block(uncompressedBlock, compressedBlock, null, false);
+
+ // Write to dst.
+ var baseX = blockX * ETC2_BLOCK_WIDTH;
+ var baseY = blockY * ETC2_BLOCK_HEIGHT;
+ for (var y = 0; y < Math.min(ETC2_BLOCK_HEIGHT, height - baseY); y++) {
+ for (var x = 0; x < Math.min(ETC2_BLOCK_WIDTH, width - baseX); x++) {
+ var srcIndex = (y * ETC2_BLOCK_WIDTH + x) * ETC2_UNCOMPRESSED_PIXEL_SIZE_RGB8;
+ var dstIndex = (baseY + y) * dstRowPitch + (baseX + x) * dstPixelSize;
+
+ for (var i = 0; i < ETC2_UNCOMPRESSED_PIXEL_SIZE_RGB8; i++)
+ dstPtr[dstIndex + i] = uncompressedBlock[srcIndex + i];
+ }
+ }
+ }
+ }
+};
+
+var decompressETC2_EAC_RGBA8 = function(/*const tcu::PixelBufferAccess&*/ dst, width, height, src) {
+ var numBlocksX = tcuCompressedTexture.divRoundUp(width, 4);
+ var numBlocksY = tcuCompressedTexture.divRoundUp(height, 4);
+ var dstPtr = new Uint8Array(dst.m_data);
+ var dstRowPitch = dst.getRowPitch();
+ var dstPixelSize = ETC2_UNCOMPRESSED_PIXEL_SIZE_RGBA8;
+ var uncompressedBlockArray = new ArrayBuffer(ETC2_UNCOMPRESSED_BLOCK_SIZE_RGB8);
+ var uncompressedBlock = new Uint8Array(uncompressedBlockArray);
+ var uncompressedBlockAlphaArray = new ArrayBuffer(ETC2_UNCOMPRESSED_BLOCK_SIZE_A8);
+ var uncompressedBlockAlpha = new Uint8Array(uncompressedBlockAlphaArray);
+
+ for (var blockY = 0; blockY < numBlocksY; blockY++) {
+ for (var blockX = 0; blockX < numBlocksX; blockX++) {
+ var compressedBlockAlpha = get128BitBlockStart(src, blockY * numBlocksX + blockX);
+ var compressedBlockRGB = get128BitBlockEnd(src, blockY * numBlocksX + blockX);
+
+ // Decompress.
+ decompressETC2Block(uncompressedBlock, compressedBlockRGB, null, false);
+ decompressEAC8Block(uncompressedBlockAlpha, compressedBlockAlpha);
+
+ // Write to dst.
+ var baseX = blockX * ETC2_BLOCK_WIDTH;
+ var baseY = blockY * ETC2_BLOCK_HEIGHT;
+ for (var y = 0; y < Math.min(ETC2_BLOCK_HEIGHT, height - baseY); y++) {
+ for (var x = 0; x < Math.min(ETC2_BLOCK_WIDTH, width - baseX); x++) {
+ var srcIndex = (y * ETC2_BLOCK_WIDTH + x) * ETC2_UNCOMPRESSED_PIXEL_SIZE_RGB8;
+ var srcAlphaIndex = (y * ETC2_BLOCK_WIDTH + x) * ETC2_UNCOMPRESSED_PIXEL_SIZE_A8;
+ var dstIndex = (baseY + y) * dstRowPitch + (baseX + x) * dstPixelSize;
+
+ for (var i = 0; i < ETC2_UNCOMPRESSED_PIXEL_SIZE_RGBA8 - 1; i++)
+ dstPtr[dstIndex + i] = uncompressedBlock[srcIndex + i];
+ dstPtr[dstIndex + ETC2_UNCOMPRESSED_PIXEL_SIZE_RGBA8 - 1] = uncompressedBlockAlpha[srcAlphaIndex];
+
+ }
+ }
+ }
+ }
+};
+
+var decompressETC2_RGB8_PUNCHTHROUGH_ALPHA1 = function(/*const tcu::PixelBufferAccess&*/ dst, width, height, src) {
+ var numBlocksX = tcuCompressedTexture.divRoundUp(width, 4);
+ var numBlocksY = tcuCompressedTexture.divRoundUp(height, 4);
+ var dstPtr = new Uint8Array(dst.m_data);
+ var dstRowPitch = dst.getRowPitch();
+ var dstPixelSize = ETC2_UNCOMPRESSED_PIXEL_SIZE_RGBA8;
+ var uncompressedBlockArray = new ArrayBuffer(ETC2_UNCOMPRESSED_BLOCK_SIZE_RGB8);
+ var uncompressedBlock = new Uint8Array(uncompressedBlockArray);
+ var uncompressedBlockAlphaArray = new ArrayBuffer(ETC2_UNCOMPRESSED_BLOCK_SIZE_A8);
+ var uncompressedBlockAlpha = new Uint8Array(uncompressedBlockAlphaArray);
+
+ for (var blockY = 0; blockY < numBlocksY; blockY++) {
+ for (var blockX = 0; blockX < numBlocksX; blockX++) {
+ var compressedBlock = get64BitBlock(src, blockY * numBlocksX + blockX);
+
+ // Decompress.
+ decompressETC2Block(uncompressedBlock, compressedBlock, uncompressedBlockAlpha, true);
+
+ // Write to dst.
+ var baseX = blockX * ETC2_BLOCK_WIDTH;
+ var baseY = blockY * ETC2_BLOCK_HEIGHT;
+ for (var y = 0; y < Math.min(ETC2_BLOCK_HEIGHT, height - baseY); y++) {
+ for (var x = 0; x < Math.min(ETC2_BLOCK_WIDTH, width - baseX); x++) {
+ var srcIndex = (y * ETC2_BLOCK_WIDTH + x) * ETC2_UNCOMPRESSED_PIXEL_SIZE_RGB8;
+ var srcAlphaIndex = (y * ETC2_BLOCK_WIDTH + x) * ETC2_UNCOMPRESSED_PIXEL_SIZE_A8;
+ var dstIndex = (baseY + y) * dstRowPitch + (baseX + x) * dstPixelSize;
+
+ for (var i = 0; i < ETC2_UNCOMPRESSED_PIXEL_SIZE_RGBA8 - 1; i++)
+ dstPtr[dstIndex + i] = uncompressedBlock[srcIndex + i];
+ dstPtr[dstIndex + ETC2_UNCOMPRESSED_PIXEL_SIZE_RGBA8 - 1] = uncompressedBlockAlpha[srcAlphaIndex];
+
+ }
+ }
+ }
+ }
+};
+
+return {
+ decompressEAC_R11: decompressEAC_R11,
+ decompressEAC_RG11: decompressEAC_RG11,
+ decompressETC2: decompressETC2,
+ decompressETC2_RGB8_PUNCHTHROUGH_ALPHA1: decompressETC2_RGB8_PUNCHTHROUGH_ALPHA1,
+ decompressETC2_EAC_RGBA8: decompressETC2_EAC_RGBA8
+};
+
+}();
+
+/**
+ * @constructor
+ * @param {tcuCompressedTexture.Format} format
+ * @param {number} width
+ * @param {number} height
+ * @param {number=} depth
+ */
+tcuCompressedTexture.CompressedTexture = function(format, width, height, depth) {
+ depth = depth === undefined ? 1 : depth;
+ this.setStorage(format, width, height, depth);
+ /** @type {Uint8Array} */ this.m_data;
+};
+
+/**
+ * @return {number}
+ */
+tcuCompressedTexture.CompressedTexture.prototype.getDataSize = function() {
+ return this.m_data.length;
+};
+
+/**
+ * @return {Uint8Array}
+ */
+tcuCompressedTexture.CompressedTexture.prototype.getData = function() {
+ return this.m_data;
+};
+
+/**
+ * @return {number}
+ */
+tcuCompressedTexture.CompressedTexture.prototype.getWidth = function() {
+ return this.m_width;
+};
+
+/**
+ * @return {number}
+ */
+tcuCompressedTexture.CompressedTexture.prototype.getHeight = function() {
+ return this.m_height;
+};
+
+/**
+ * @return {tcuCompressedTexture.Format}
+ */
+tcuCompressedTexture.CompressedTexture.prototype.getFormat = function() {
+ return this.m_format;
+};
+
+tcuCompressedTexture.CompressedTexture.prototype.setStorage = function(format, width, height, depth) {
+ depth = depth === undefined ? 1 : depth;
+ this.m_format = format;
+ this.m_width = width;
+ this.m_height = height;
+ this.m_depth = depth;
+
+ if (tcuCompressedTexture.isEtcFormat(this.m_format)) {
+ DE_ASSERT(this.m_depth == 1);
+
+ var blockSizeMultiplier = 0; // How many 64-bit parts each compressed block contains.
+
+ switch (this.m_format) {
+ case tcuCompressedTexture.Format.ETC1_RGB8: blockSizeMultiplier = 1; break;
+ case tcuCompressedTexture.Format.EAC_R11: blockSizeMultiplier = 1; break;
+ case tcuCompressedTexture.Format.EAC_SIGNED_R11: blockSizeMultiplier = 1; break;
+ case tcuCompressedTexture.Format.EAC_RG11: blockSizeMultiplier = 2; break;
+ case tcuCompressedTexture.Format.EAC_SIGNED_RG11: blockSizeMultiplier = 2; break;
+ case tcuCompressedTexture.Format.ETC2_RGB8: blockSizeMultiplier = 1; break;
+ case tcuCompressedTexture.Format.ETC2_SRGB8: blockSizeMultiplier = 1; break;
+ case tcuCompressedTexture.Format.ETC2_RGB8_PUNCHTHROUGH_ALPHA1: blockSizeMultiplier = 1; break;
+ case tcuCompressedTexture.Format.ETC2_SRGB8_PUNCHTHROUGH_ALPHA1: blockSizeMultiplier = 1; break;
+ case tcuCompressedTexture.Format.ETC2_EAC_RGBA8: blockSizeMultiplier = 2; break;
+ case tcuCompressedTexture.Format.ETC2_EAC_SRGB8_ALPHA8: blockSizeMultiplier = 2; break;
+
+ default:
+ throw new Error('Unsupported format ' + format);
+ break;
+ }
+
+ this.m_array = new ArrayBuffer(blockSizeMultiplier * 8 * tcuCompressedTexture.divRoundUp(this.m_width, 4) * tcuCompressedTexture.divRoundUp(this.m_height, 4));
+ this.m_data = new Uint8Array(this.m_array);
+ }
+ // else if (isASTCFormat(this.m_format))
+ // {
+ // if (this.m_depth > 1)
+ // throw tcu::InternalError("3D ASTC textures not currently supported");
+
+ // const IVec3 blockSize = getASTCBlockSize(this.m_format);
+ // this.m_data.resize(ASTC_BLOCK_SIZE_BYTES * tcuCompressedTexture.divRoundUp(this.m_width, blockSize[0]) * tcuCompressedTexture.divRoundUp(this.m_height, blockSize[1]) * tcuCompressedTexture.divRoundUp(this.m_depth, blockSize[2]));
+ // }
+ // else
+ // {
+ // DE_ASSERT(this.m_format == FORMAT_LAST);
+ // DE_ASSERT(this.m_width == 0 && this.m_height == 0 && this.m_depth == 0);
+ // this.m_data.resize(0);
+ // }
+};
+
+/*--------------------------------------------------------------------*//*!
+ * \brief Get uncompressed texture format
+ *//*--------------------------------------------------------------------*/
+tcuCompressedTexture.CompressedTexture.prototype.getUncompressedFormat = function() {
+ if (tcuCompressedTexture.isEtcFormat(this.m_format)) {
+ switch (this.m_format) {
+ case tcuCompressedTexture.Format.ETC1_RGB8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNORM_INT8);
+ case tcuCompressedTexture.Format.EAC_R11: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.UNORM_INT16);
+ case tcuCompressedTexture.Format.EAC_SIGNED_R11: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.SNORM_INT16);
+ case tcuCompressedTexture.Format.EAC_RG11: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.UNORM_INT16);
+ case tcuCompressedTexture.Format.EAC_SIGNED_RG11: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.SNORM_INT16);
+ case tcuCompressedTexture.Format.ETC2_RGB8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNORM_INT8);
+ case tcuCompressedTexture.Format.ETC2_SRGB8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.sRGB, tcuTexture.ChannelType.UNORM_INT8);
+ case tcuCompressedTexture.Format.ETC2_RGB8_PUNCHTHROUGH_ALPHA1: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8);
+ case tcuCompressedTexture.Format.ETC2_SRGB8_PUNCHTHROUGH_ALPHA1: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.sRGBA, tcuTexture.ChannelType.UNORM_INT8);
+ case tcuCompressedTexture.Format.ETC2_EAC_RGBA8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8);
+ case tcuCompressedTexture.Format.ETC2_EAC_SRGB8_ALPHA8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.sRGBA, tcuTexture.ChannelType.UNORM_INT8);
+ default:
+ throw new Error('Unsupported format ' + this.m_format);
+ }
+ }
+ // else if (isASTCFormat(m_format))
+ // {
+ // if (isASTCSRGBFormat(m_format))
+ // return TextureFormat(tcuTexture.ChannelType.sRGBA, tcuTexture.ChannelType.UNORM_INT8);
+ // else
+ // return TextureFormat(tcuTexture.ChannelType.RGBA, tcuTexture.ChannelType.HALF_FLOAT);
+ // }
+ // else
+ // {
+ // DE_ASSERT(false);
+ // return TextureFormat();
+ // }
+};
+
+/**
+ * Decode to uncompressed pixel data
+ * @param {tcuTexture.PixelBufferAccess} dst Destination buffer
+ */
+tcuCompressedTexture.CompressedTexture.prototype.decompress = function(dst) {
+ DE_ASSERT(dst.getWidth() == this.m_width && dst.getHeight() == this.m_height && dst.getDepth() == 1);
+ var format = this.getUncompressedFormat();
+ if (dst.getFormat().order != format.order || dst.getFormat().type != format.type)
+ throw new Error('Formats do not match.');
+
+ if (tcuCompressedTexture.isEtcFormat(this.m_format)) {
+ switch (this.m_format) {
+ // case tcuCompressedTexture.Format.ETC1_RGB8: decompressETC1 (dst, this.m_width, this.m_height, this.m_data); break;
+ case tcuCompressedTexture.Format.EAC_R11: tcuCompressedTexture.etcDecompressInternal.decompressEAC_R11(dst, this.m_width, this.m_height, this.m_array, false); break;
+ case tcuCompressedTexture.Format.EAC_SIGNED_R11: tcuCompressedTexture.etcDecompressInternal.decompressEAC_R11(dst, this.m_width, this.m_height, this.m_array, true); break;
+ case tcuCompressedTexture.Format.EAC_RG11: tcuCompressedTexture.etcDecompressInternal.decompressEAC_RG11(dst, this.m_width, this.m_height, this.m_array, false); break;
+ case tcuCompressedTexture.Format.EAC_SIGNED_RG11: tcuCompressedTexture.etcDecompressInternal.decompressEAC_RG11(dst, this.m_width, this.m_height, this.m_array, true); break;
+ case tcuCompressedTexture.Format.ETC2_RGB8: tcuCompressedTexture.etcDecompressInternal.decompressETC2(dst, this.m_width, this.m_height, this.m_array); break;
+ case tcuCompressedTexture.Format.ETC2_SRGB8: tcuCompressedTexture.etcDecompressInternal.decompressETC2(dst, this.m_width, this.m_height, this.m_array); break;
+ case tcuCompressedTexture.Format.ETC2_RGB8_PUNCHTHROUGH_ALPHA1: tcuCompressedTexture.etcDecompressInternal.decompressETC2_RGB8_PUNCHTHROUGH_ALPHA1(dst, this.m_width, this.m_height, this.m_array); break;
+ case tcuCompressedTexture.Format.ETC2_SRGB8_PUNCHTHROUGH_ALPHA1: tcuCompressedTexture.etcDecompressInternal.decompressETC2_RGB8_PUNCHTHROUGH_ALPHA1(dst, this.m_width, this.m_height, this.m_array); break;
+ case tcuCompressedTexture.Format.ETC2_EAC_RGBA8: tcuCompressedTexture.etcDecompressInternal.decompressETC2_EAC_RGBA8(dst, this.m_width, this.m_height, this.m_array); break;
+ case tcuCompressedTexture.Format.ETC2_EAC_SRGB8_ALPHA8: tcuCompressedTexture.etcDecompressInternal.decompressETC2_EAC_RGBA8(dst, this.m_width, this.m_height, this.m_array); break;
+
+ default:
+ throw new Error('Unsupported format ' + this.m_format);
+ break;
+ }
+ }
+ // else if (isASTCFormat(m_format))
+ // {
+ // const tcu::IVec3 blockSize = getASTCBlockSize(m_format);
+ // const bool isSRGBFormat = isASTCSRGBFormat(m_format);
+
+ // if (blockSize[2] > 1)
+ // throw tcu::InternalError("3D ASTC textures not currently supported");
+
+ // decompressASTC(dst, m_width, m_height, &m_data[0], blockSize[0], blockSize[1], isSRGBFormat, isSRGBFormat || params.isASTCModeLDR);
+ // } /**/
+ else
+ throw new Error('Unsupported format ' + this.m_format);
+};
+
+ });
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuFloat.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuFloat.js
new file mode 100644
index 0000000000..0cc74fe5a9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuFloat.js
@@ -0,0 +1,862 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.common.tcuFloat');
+goog.require('framework.delibs.debase.deMath');
+
+goog.scope(function() {
+
+var tcuFloat = framework.common.tcuFloat;
+var deMath = framework.delibs.debase.deMath;
+
+var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+};
+
+tcuFloat.FloatFlags = {
+ FLOAT_HAS_SIGN: (1 << 0),
+ FLOAT_SUPPORT_DENORM: (1 << 1)
+};
+
+/**
+ * Defines a tcuFloat.FloatDescription object, which is an essential part of the tcuFloat.deFloat type.
+ * Holds the information that shapes the tcuFloat.deFloat.
+ * @constructor
+ */
+tcuFloat.FloatDescription = function(exponentBits, mantissaBits, exponentBias, flags) {
+ this.ExponentBits = exponentBits;
+ this.MantissaBits = mantissaBits;
+ this.ExponentBias = exponentBias;
+ this.Flags = flags;
+
+ this.totalBitSize = 1 + this.ExponentBits + this.MantissaBits;
+ this.totalByteSize = Math.floor(this.totalBitSize / 8) + ((this.totalBitSize % 8) > 0 ? 1 : 0);
+};
+
+/**
+ * Builds a zero float of the current binary description.
+ * @param {number} sign
+ * @return {tcuFloat.deFloat}
+ */
+tcuFloat.FloatDescription.prototype.zero = function(sign) {
+ return tcuFloat.newDeFloatFromParameters(this.zeroNumber(sign), this);
+};
+
+tcuFloat.FloatDescription.prototype.zeroNumber = function(sign) {
+ return deMath.shiftLeft((sign > 0 ? 0 : 1), (this.ExponentBits + this.MantissaBits));
+};
+
+/**
+ * Builds an infinity float representation of the current binary description.
+ * @param {number} sign
+ * @return {tcuFloat.deFloat}
+ */
+tcuFloat.FloatDescription.prototype.inf = function(sign) {
+ return tcuFloat.newDeFloatFromParameters(this.infNumber(sign), this);
+};
+
+tcuFloat.FloatDescription.prototype.infNumber = function(sign) {
+ return ((sign > 0 ? 0 : 1) << (this.ExponentBits + this.MantissaBits)) |
+ deMath.shiftLeft(((1 << this.ExponentBits) - 1), this.MantissaBits); //Unless using very large exponent types, native shift is safe here, i guess.
+};
+
+/**
+ * Builds a NaN float representation of the current binary description.
+ * @return {tcuFloat.deFloat}
+ */
+tcuFloat.FloatDescription.prototype.nan = function() {
+ return tcuFloat.newDeFloatFromParameters(this.nanNumber(), this);
+};
+
+tcuFloat.FloatDescription.prototype.nanNumber = function() {
+ return deMath.shiftLeft(1, (this.ExponentBits + this.MantissaBits)) - 1;
+};
+
+/**
+ * Builds a tcuFloat.deFloat number based on the description and the given
+ * sign, exponent and mantissa values.
+ * @param {number} sign
+ * @param {number} exponent
+ * @param {number} mantissa
+ * @return {tcuFloat.deFloat}
+ */
+tcuFloat.FloatDescription.prototype.construct = function(sign, exponent, mantissa) {
+ // Repurpose this otherwise invalid input as a shorthand notation for zero (no need for caller to care about internal representation)
+ /** @type {boolean} */ var isShorthandZero = exponent == 0 && mantissa == 0;
+
+ // Handles the typical notation for zero (min exponent, mantissa 0). Note that the exponent usually used exponent (-ExponentBias) for zero/subnormals is not used.
+ // Instead zero/subnormals have the (normally implicit) leading mantissa bit set to zero.
+
+ /** @type {boolean} */ var isDenormOrZero = (exponent == 1 - this.ExponentBias) && (deMath.shiftRight(mantissa, this.MantissaBits) == 0);
+ /** @type {number} */ var s = deMath.shiftLeft((sign < 0 ? 1 : 0), (this.ExponentBits + this.MantissaBits));
+ /** @type {number} */ var exp = (isShorthandZero || isDenormOrZero) ? 0 : exponent + this.ExponentBias;
+
+ DE_ASSERT(sign == +1 || sign == -1);
+ DE_ASSERT(isShorthandZero || isDenormOrZero || deMath.shiftRight(mantissa, this.MantissaBits) == 1);
+ DE_ASSERT((exp >> this.ExponentBits) == 0); //Native shift is safe
+
+ return tcuFloat.newDeFloatFromParameters(
+ deMath.binaryOp(
+ deMath.binaryOp(
+ s,
+ deMath.shiftLeft(exp, this.MantissaBits),
+ deMath.BinaryOp.OR
+ ),
+ deMath.binaryOp(
+ mantissa,
+ deMath.shiftLeft(1, this.MantissaBits) - 1,
+ deMath.BinaryOp.AND
+ ),
+ deMath.BinaryOp.OR
+ ),
+ this
+ );
+};
+
+/**
+ * Builds a tcuFloat.deFloat number based on the description and the given
+ * sign, exponent and binary mantissa values.
+ * @param {number} sign
+ * @param {number} exponent
+ * @param {number} mantissaBits The raw binary representation.
+ * @return {tcuFloat.deFloat}
+ */
+tcuFloat.FloatDescription.prototype.constructBits = function(sign, exponent, mantissaBits) {
+ /** @type {number} */ var signBit = sign < 0 ? 1 : 0;
+ /** @type {number} */ var exponentBits = exponent + this.ExponentBias;
+
+ DE_ASSERT(sign == +1 || sign == -1);
+ DE_ASSERT((exponentBits >> this.ExponentBits) == 0);
+ DE_ASSERT(deMath.shiftRight(mantissaBits, this.MantissaBits) == 0);
+
+ return tcuFloat.newDeFloatFromParameters(
+ deMath.binaryOp(
+ deMath.binaryOp(
+ deMath.shiftLeft(
+ signBit,
+ this.ExponentBits + this.MantissaBits
+ ),
+ deMath.shiftLeft(exponentBits, this.MantissaBits),
+ deMath.BinaryOp.OR
+ ),
+ mantissaBits,
+ deMath.BinaryOp.OR
+ ),
+ this
+ );
+};
+
+/**
+ * Converts a tcuFloat.deFloat from it's own format description into the format described
+ * by this description.
+ * @param {tcuFloat.deFloat} other Other float to convert to this format description.
+ * @return {tcuFloat.deFloat} converted tcuFloat.deFloat
+ */
+tcuFloat.FloatDescription.prototype.convert = function(other) {
+ /** @type {number} */ var otherExponentBits = other.description.ExponentBits;
+ /** @type {number} */ var otherMantissaBits = other.description.MantissaBits;
+ /** @type {number} */ var otherExponentBias = other.description.ExponentBias;
+ /** @type {number} */ var otherFlags = other.description.Flags;
+
+ /** @type {number} */ var bitDiff;
+ /** @type {number} */ var half;
+ /** @type {number} */ var bias;
+
+ if (!(this.Flags & tcuFloat.FloatFlags.FLOAT_HAS_SIGN) && other.sign() < 0) {
+ // Negative number, truncate to zero.
+ return this.zero(+1);
+ } else if (other.isInf()) {
+ return this.inf(other.sign());
+ } else if (other.isNaN()) {
+ return this.nan();
+ } else if (other.isZero()) {
+ return this.zero(other.sign());
+ } else {
+ /** @type {number} */ var eMin = 1 - this.ExponentBias;
+ /** @type {number} */ var eMax = ((1 << this.ExponentBits) - 2) - this.ExponentBias;
+
+ /** @type {number} */ var s = deMath.shiftLeft(other.signBit(), (this.ExponentBits + this.MantissaBits)); // \note Not sign, but sign bit.
+ /** @type {number} */ var e = other.exponent();
+ /** @type {number} */ var m = other.mantissa();
+
+ // Normalize denormalized values prior to conversion.
+ while (!deMath.binaryOp(m, deMath.shiftLeft(1, otherMantissaBits), deMath.BinaryOp.AND)) {
+ m = deMath.shiftLeft(m, 1);
+ e -= 1;
+ }
+
+ if (e < eMin) {
+ // Underflow.
+ if ((this.Flags & tcuFloat.FloatFlags.FLOAT_SUPPORT_DENORM) && (eMin - e - 1 <= this.MantissaBits)) {
+ // Shift and round (RTE).
+ bitDiff = (otherMantissaBits - this.MantissaBits) + (eMin - e);
+ half = deMath.shiftLeft(1, (bitDiff - 1)) - 1;
+ bias = deMath.binaryOp(deMath.shiftRight(m, bitDiff), 1, deMath.BinaryOp.AND);
+
+ return tcuFloat.newDeFloatFromParameters(
+ deMath.binaryOp(
+ s,
+ deMath.shiftRight(
+ m + half + bias,
+ bitDiff
+ ),
+ deMath.BinaryOp.OR
+ ),
+ this
+ );
+ } else
+ return this.zero(other.sign());
+ } else {
+ // Remove leading 1.
+ m = deMath.binaryOp(m, deMath.binaryNot(deMath.shiftLeft(1, otherMantissaBits)), deMath.BinaryOp.AND);
+
+ if (this.MantissaBits < otherMantissaBits) {
+ // Round mantissa (round to nearest even).
+ bitDiff = otherMantissaBits - this.MantissaBits;
+ half = deMath.shiftLeft(1, (bitDiff - 1)) - 1;
+ bias = deMath.binaryOp(deMath.shiftRight(m, bitDiff), 1, deMath.BinaryOp.AND);
+
+ m = deMath.shiftRight(m + half + bias, bitDiff);
+
+ if (deMath.binaryOp(m, deMath.shiftLeft(1, this.MantissaBits), deMath.BinaryOp.AND)) {
+ // Overflow in mantissa.
+ m = 0;
+ e += 1;
+ }
+ } else {
+ bitDiff = this.MantissaBits - otherMantissaBits;
+ m = deMath.shiftLeft(m, bitDiff);
+ }
+
+ if (e > eMax) {
+ // Overflow.
+ return this.inf(other.sign());
+ } else {
+ DE_ASSERT(deMath.deInRange32(e, eMin, eMax));
+ DE_ASSERT(deMath.binaryOp((e + this.ExponentBias), deMath.binaryNot(deMath.shiftLeft(1, this.ExponentBits) - 1), deMath.BinaryOp.AND) == 0);
+ DE_ASSERT(deMath.binaryOp(m, deMath.binaryNot(deMath.shiftLeft(1, this.MantissaBits) - 1), deMath.BinaryOp.AND) == 0);
+
+ return tcuFloat.newDeFloatFromParameters(
+ deMath.binaryOp(
+ deMath.binaryOp(
+ s,
+ deMath.shiftLeft(
+ e + this.ExponentBias,
+ this.MantissaBits
+ ),
+ deMath.BinaryOp.OR
+ ),
+ m,
+ deMath.BinaryOp.OR
+ ),
+ this
+ );
+ }
+ }
+ }
+};
+
+/**
+ * tcuFloat.deFloat class - Empty constructor, builds a 32 bit float by default
+ * @constructor
+ */
+tcuFloat.deFloat = function() {
+ this.description = tcuFloat.description32;
+
+ this.m_buffer = null;
+ this.m_array = null;
+ this.m_array32 = null;
+ this.bitValue = undefined;
+ this.signValue = undefined;
+ this.expValue = undefined;
+ this.mantissaValue = undefined;
+
+ this.m_value = 0;
+};
+
+/**
+ * buffer - Get the deFloat's existing ArrayBuffer or create one if none exists.
+ * @return {ArrayBuffer}
+ */
+tcuFloat.deFloat.prototype.buffer = function() {
+ if (!this.m_buffer)
+ this.m_buffer = new ArrayBuffer(this.description.totalByteSize);
+ return this.m_buffer;
+};
+
+/**
+ * array - Get the deFloat's existing Uint8Array or create one if none exists.
+ * @return {Uint8Array}
+ */
+tcuFloat.deFloat.prototype.array = function() {
+ if (!this.m_array)
+ this.m_array = new Uint8Array(this.buffer());
+ return this.m_array;
+};
+
+/**
+ * array32 - Get the deFloat's existing Uint32Array or create one if none exists.
+ * @return {Uint32Array}
+ */
+tcuFloat.deFloat.prototype.array32 = function() {
+ if (!this.m_array32)
+ this.m_array32 = new Uint32Array(this.buffer());
+ return this.m_array32;
+};
+
+/**
+ * deFloatNumber - To be used immediately after constructor
+ * Builds a 32-bit tcuFloat.deFloat based on a 64-bit JS number.
+ * @param {number} jsnumber
+ * @return {tcuFloat.deFloat}
+ */
+tcuFloat.deFloat.prototype.deFloatNumber = function(jsnumber) {
+ var view32 = new DataView(this.buffer());
+ view32.setFloat32(0, jsnumber, true); //little-endian
+ this.m_value = view32.getFloat32(0, true); //little-endian
+
+ // Clear cached values
+ this.bitValue = undefined;
+ this.signValue = undefined;
+ this.expValue = undefined;
+ this.mantissaValue = undefined;
+
+ return this;
+};
+
+/**
+ * deFloatNumber64 - To be used immediately after constructor
+ * Builds a 64-bit tcuFloat.deFloat based on a 64-bit JS number.
+ * @param {number} jsnumber
+ * @return {tcuFloat.deFloat}
+ */
+tcuFloat.deFloat.prototype.deFloatNumber64 = function(jsnumber) {
+ var view64 = new DataView(this.buffer());
+ view64.setFloat64(0, jsnumber, true); //little-endian
+ this.m_value = view64.getFloat64(0, true); //little-endian
+
+ // Clear cached values
+ this.bitValue = undefined;
+ this.signValue = undefined;
+ this.expValue = undefined;
+ this.mantissaValue = undefined;
+
+ return this;
+};
+
+/**
+ * Convenience function to build a 32-bit tcuFloat.deFloat based on a 64-bit JS number
+ * Builds a 32-bit tcuFloat.deFloat based on a 64-bit JS number.
+ * @param {number} jsnumber
+ * @return {tcuFloat.deFloat}
+ */
+tcuFloat.newDeFloatFromNumber = function(jsnumber) {
+ return new tcuFloat.deFloat().deFloatNumber(jsnumber);
+};
+
+/**
+ * deFloatBuffer - To be used immediately after constructor
+ * Builds a tcuFloat.deFloat based on a buffer and a format description.
+ * The buffer is assumed to contain data of the given description.
+ * @param {ArrayBuffer} buffer
+ * @param {tcuFloat.FloatDescription} description
+ * @return {tcuFloat.deFloat}
+ */
+tcuFloat.deFloat.prototype.deFloatBuffer = function(buffer, description) {
+ this.m_buffer = buffer;
+ this.m_array = new Uint8Array(this.m_buffer);
+ this.m_array32 = new Uint32Array(this.m_buffer);
+
+ this.m_value = deMath.arrayToNumber(this.m_array);
+
+ // Clear cached values
+ this.bitValue = undefined;
+ this.signValue = undefined;
+ this.expValue = undefined;
+ this.mantissaValue = undefined;
+
+ return this;
+};
+
+/**
+ * Convenience function to build a tcuFloat.deFloat based on a buffer and a format description
+ * The buffer is assumed to contain data of the given description.
+ * @param {ArrayBuffer} buffer
+ * @param {tcuFloat.FloatDescription} description
+ * @return {tcuFloat.deFloat}
+ */
+tcuFloat.newDeFloatFromBuffer = function(buffer, description) {
+ return new tcuFloat.deFloat().deFloatBuffer(buffer, description);
+};
+
+/**
+ * Set the tcuFloat.deFloat from the given bitwise representation.
+ *
+ * @param {number} jsnumber This is taken to be the bitwise representation of
+ * the floating point number represented by this deFloat. It must be an
+ * integer, less than 2^52, and compatible with the existing description.
+ * @return {tcuFloat.deFloat}
+ **/
+tcuFloat.deFloat.prototype.deFloatParametersNumber = function(jsnumber) {
+ /** @type {number} */ var jsnumberMax = -1 >>> (32 - this.description.totalBitSize);
+ DE_ASSERT(Number.isInteger(jsnumber) && jsnumber <= jsnumberMax);
+
+ this.m_value = jsnumber;
+ deMath.numberToArray(this.m_array, jsnumber);
+
+ // Clear cached values
+ this.bitValue = undefined;
+ this.signValue = undefined;
+ this.expValue = undefined;
+ this.mantissaValue = undefined;
+
+ return this;
+};
+
+/**
+ * Initializes a tcuFloat.deFloat from the given bitwise representation,
+ * with the specified format description.
+ *
+ * @param {number} jsnumber This is taken to be the bitwise representation of
+ * the floating point number represented by this deFloat. It must be an
+ * integer, less than 2^52, and compatible with the new description.
+ * @param {tcuFloat.FloatDescription} description
+ * @return {tcuFloat.deFloat}
+ **/
+tcuFloat.deFloat.prototype.deFloatParameters = function(jsnumber, description) {
+ /** @type {number} */ var maxUint52 = 0x10000000000000;
+ DE_ASSERT(Number.isInteger(jsnumber) && jsnumber < maxUint52);
+ if (description.totalBitSize > 52) {
+ // The jsnumber representation for this number can't possibly be valid.
+ // Make sure it has a sentinel 0 value.
+ DE_ASSERT(jsnumber === 0);
+ }
+
+ this.description = description;
+
+ this.m_buffer = new ArrayBuffer(this.description.totalByteSize);
+ this.m_array = new Uint8Array(this.m_buffer);
+
+ return this.deFloatParametersNumber(jsnumber);
+};
+
+/**
+ * Convenience function. Creates a tcuFloat.deFloat, then initializes it from
+ * the given bitwise representation, with the specified format description.
+ *
+ * @param {number} jsnumber This is taken to be the bitwise representation of
+ * the floating point number represented by this deFloat. It must be an
+ * integer, less than 2^52, and compatible with the new description.
+ * @param {tcuFloat.FloatDescription} description
+ * @return {tcuFloat.deFloat}
+ **/
+tcuFloat.newDeFloatFromParameters = function(jsnumber, description) {
+ return new tcuFloat.deFloat().deFloatParameters(jsnumber, description);
+};
+
+/**
+ * Returns bit range [begin, end)
+ * @param {number} begin
+ * @param {number} end
+ * @return {number}
+ */
+tcuFloat.deFloat.prototype.getBitRange = function(begin, end) {
+ if (this.description.totalBitSize <= 52) {
+ // this.bits() is invalid for more than 52 bits.
+ return deMath.getBitRange(this.bits(), begin, end);
+ } else {
+ return deMath.getArray32BitRange(this.array32(), begin, end);
+ }
+};
+
+/**
+ * Returns the raw binary representation value of the tcuFloat.deFloat
+ * @return {number}
+ */
+tcuFloat.deFloat.prototype.bits = function() {
+ if (typeof this.bitValue === 'undefined')
+ this.bitValue = deMath.arrayToNumber(this.array());
+ return this.bitValue;
+};
+
+/**
+ * Returns the raw binary sign bit
+ * @return {number}
+ */
+tcuFloat.deFloat.prototype.signBit = function() {
+ if (typeof this.signValue === 'undefined')
+ this.signValue = this.getBitRange(this.description.totalBitSize - 1, this.description.totalBitSize);
+ return this.signValue;
+};
+
+/**
+ * Returns the raw binary exponent bits
+ * @return {number}
+ */
+tcuFloat.deFloat.prototype.exponentBits = function() {
+ if (typeof this.expValue === 'undefined')
+ this.expValue = this.getBitRange(this.description.MantissaBits, this.description.MantissaBits + this.description.ExponentBits);
+ return this.expValue;
+};
+
+/**
+ * Returns the raw binary mantissa bits
+ * @return {number}
+ */
+tcuFloat.deFloat.prototype.mantissaBits = function() {
+ if (typeof this.mantissaValue === 'undefined')
+ this.mantissaValue = this.getBitRange(0, this.description.MantissaBits);
+ return this.mantissaValue;
+};
+
+/**
+ * Returns the sign as a factor (-1 or 1)
+ * @return {number}
+ */
+tcuFloat.deFloat.prototype.sign = function() {
+ var sign = this.signBit();
+ var signvalue = sign ? -1 : 1;
+ return signvalue;
+};
+
+/**
+ * Returns the real exponent, checking if it's a denorm or zero number or not
+ * @return {number}
+ */
+tcuFloat.deFloat.prototype.exponent = function() {return this.isDenorm() ? 1 - this.description.ExponentBias : this.exponentBits() - this.description.ExponentBias;};
+
+/**
+ * Returns the (still raw) mantissa, checking if it's a denorm or zero number or not
+ * Makes the normally implicit bit explicit.
+ * @return {number}
+ */
+tcuFloat.deFloat.prototype.mantissa = function() {return this.isZero() || this.isDenorm() ? this.mantissaBits() : deMath.binaryOp(this.mantissaBits(), deMath.shiftLeft(1, this.description.MantissaBits), deMath.BinaryOp.OR);};
+
+/**
+ * Returns if the number is infinity or not.
+ * @return {boolean}
+ */
+tcuFloat.deFloat.prototype.isInf = function() {return this.exponentBits() == ((1 << this.description.ExponentBits) - 1) && this.mantissaBits() == 0;};
+
+/**
+ * Returns if the number is NaN or not.
+ * @return {boolean}
+ */
+tcuFloat.deFloat.prototype.isNaN = function() {return this.exponentBits() == ((1 << this.description.ExponentBits) - 1) && this.mantissaBits() != 0;};
+
+/**
+ * Returns if the number is zero or not.
+ * @return {boolean}
+ */
+tcuFloat.deFloat.prototype.isZero = function() {return this.exponentBits() == 0 && this.mantissaBits() == 0;};
+
+/**
+ * Returns if the number is denormalized or not.
+ * @return {boolean}
+ */
+tcuFloat.deFloat.prototype.isDenorm = function() {return this.exponentBits() == 0 && this.mantissaBits() != 0;};
+
+/**
+ * Builds a zero float of the current binary description.
+ * @param {number} sign
+ * @return {tcuFloat.deFloat}
+ */
+tcuFloat.deFloat.prototype.zero = function(sign) {
+ return this.description.zero(sign);
+};
+
+/**
+ * Builds an infinity float representation of the current binary description.
+ * @param {number} sign
+ * @return {tcuFloat.deFloat}
+ */
+tcuFloat.deFloat.prototype.inf = function(sign) {
+ return this.description.inf(sign);
+};
+
+/**
+ * Builds a NaN float representation of the current binary description.
+ * @return {tcuFloat.deFloat}
+ */
+tcuFloat.deFloat.prototype.nan = function() {
+ return this.description.nan();
+};
+
+/**
+ * Builds a float of the current binary description.
+ * Given a sign, exponent and mantissa.
+ * @param {number} sign
+ * @param {number} exponent
+ * @param {number} mantissa
+ * @return {tcuFloat.deFloat}
+ */
+tcuFloat.deFloat.prototype.construct = function(sign, exponent, mantissa) {
+ return this.description.construct(sign, exponent, mantissa);
+};
+
+/**
+ * Builds a float of the current binary description.
+ * Given a sign, exponent and a raw binary mantissa.
+ * @param {number} sign
+ * @param {number} exponent
+ * @param {number} mantissaBits Raw binary mantissa.
+ * @return {tcuFloat.deFloat}
+ */
+tcuFloat.deFloat.prototype.constructBits = function(sign, exponent, mantissaBits) {
+ return this.description.constructBits(sign, exponent, mantissaBits);
+};
+
+/**
+ * Calculates the JS float number from the internal representation.
+ * @return {number} The JS float value represented by this tcuFloat.deFloat.
+ */
+tcuFloat.deFloat.prototype.getValue = function() {
+ if ((this.description.Flags | tcuFloat.FloatFlags.FLOAT_HAS_SIGN) === 0 && this.sign() < 0)
+ return 0;
+ if (this.isInf())
+ return Number.Infinity;
+ if (this.isNaN())
+ return Number.NaN;
+ if (this.isZero())
+ return this.sign() * 0;
+ /**@type {number} */ var mymantissa = this.mantissa();
+ /**@type {number} */ var myexponent = this.exponent();
+ /**@type {number} */ var sign = this.sign();
+
+ /**@type {number} */ var value = mymantissa / Math.pow(2, this.description.MantissaBits) * Math.pow(2, myexponent);
+
+ if (this.description.Flags | tcuFloat.FloatFlags.FLOAT_HAS_SIGN != 0)
+ value = value * sign;
+
+ return value;
+};
+
+tcuFloat.description10 = new tcuFloat.FloatDescription(5, 5, 15, 0);
+tcuFloat.description11 = new tcuFloat.FloatDescription(5, 6, 15, 0);
+tcuFloat.description16 = new tcuFloat.FloatDescription(5, 10, 15, tcuFloat.FloatFlags.FLOAT_HAS_SIGN);
+tcuFloat.description32 = new tcuFloat.FloatDescription(8, 23, 127, tcuFloat.FloatFlags.FLOAT_HAS_SIGN | tcuFloat.FloatFlags.FLOAT_SUPPORT_DENORM);
+tcuFloat.description64 = new tcuFloat.FloatDescription(11, 52, 1023, tcuFloat.FloatFlags.FLOAT_HAS_SIGN | tcuFloat.FloatFlags.FLOAT_SUPPORT_DENORM);
+
+tcuFloat.convertFloat32Inline = (function() {
+ var float32View = new Float32Array(1);
+ var int32View = new Int32Array(float32View.buffer);
+
+ return function(fval, description) {
+ float32View[0] = fval;
+ var fbits = int32View[0];
+
+ var exponentBits = (fbits >> 23) & 0xff;
+ var mantissaBits = fbits & 0x7fffff;
+ var signBit = (fbits & 0x80000000) ? 1 : 0;
+ var sign = signBit ? -1 : 1;
+
+ var isZero = exponentBits == 0 && mantissaBits == 0;
+
+ var bitDiff;
+ var half;
+ var bias;
+
+ if (!(description.Flags & tcuFloat.FloatFlags.FLOAT_HAS_SIGN) && sign < 0) {
+ // Negative number, truncate to zero.
+ return description.zeroNumber(+1);
+ } else if (exponentBits == ((1 << tcuFloat.description32.ExponentBits) - 1) && mantissaBits == 0) { // isInf
+ return description.infNumber(sign);
+ } else if (exponentBits == ((1 << tcuFloat.description32.ExponentBits) - 1) && mantissaBits != 0) { // isNaN
+ return description.nanNumber();
+ } else if (isZero) {
+ return description.zeroNumber(sign);
+ } else {
+ var eMin = 1 - description.ExponentBias;
+ var eMax = ((1 << description.ExponentBits) - 2) - description.ExponentBias;
+
+ var isDenorm = exponentBits == 0 && mantissaBits != 0;
+
+ var s = signBit << (description.ExponentBits + description.MantissaBits); // \note Not sign, but sign bit.
+ var e = isDenorm ? 1 - tcuFloat.description32.ExponentBias : exponentBits - tcuFloat.description32.ExponentBias;// other.exponent();
+ var m = isZero || isDenorm ? mantissaBits : mantissaBits | (1 << tcuFloat.description32.MantissaBits); // other.mantissa();
+
+ // Normalize denormalized values prior to conversion.
+ while (!(m & (1 << tcuFloat.description32.MantissaBits))) {
+ m = deMath.shiftLeft(m, 1);
+ e -= 1;
+ }
+
+ if (e < eMin) {
+ // Underflow.
+ if ((description.Flags & tcuFloat.FloatFlags.FLOAT_SUPPORT_DENORM) && (eMin - e - 1 <= description.MantissaBits)) {
+ // Shift and round (RTE).
+ bitDiff = (tcuFloat.description32.MantissaBits - description.MantissaBits) + (eMin - e);
+ half = (1 << (bitDiff - 1)) - 1;
+ bias = ((m >> bitDiff) & 1);
+ return (s | ((m + half + bias) >> bitDiff));
+ } else
+ return description.zeroNumber(sign);
+ } else {
+ // Remove leading 1.
+ m = (m & ~(1 << tcuFloat.description32.MantissaBits));
+
+ if (description.MantissaBits < tcuFloat.description32.MantissaBits) {
+ // Round mantissa (round to nearest even).
+ bitDiff = tcuFloat.description32.MantissaBits - description.MantissaBits;
+ half = (1 << (bitDiff - 1)) - 1;
+ bias = ((m >> bitDiff) & 1);
+
+ m = (m + half + bias) >> bitDiff;
+
+ if ((m & (1 << description.MantissaBits))) {
+ // Overflow in mantissa.
+ m = 0;
+ e += 1;
+ }
+ } else {
+ bitDiff = description.MantissaBits - tcuFloat.description32.MantissaBits;
+ m = (m << bitDiff);
+ }
+
+ if (e > eMax) {
+ // Overflow.
+ return description.infNumber(sign);
+ } else {
+ DE_ASSERT(deMath.deInRange32(e, eMin, eMax));
+ DE_ASSERT(((e + description.ExponentBias) & ~((1 << description.ExponentBits) - 1)) == 0);
+ DE_ASSERT((m & ~((1 << description.MantissaBits) - 1)) == 0);
+
+ return (s | ((e + description.ExponentBias) << description.MantissaBits)) | m;
+ }
+ }
+ }
+ };
+})();
+
+/**
+ * Builds a 10 bit tcuFloat.deFloat
+ * @param {number} value (64-bit JS float)
+ * @return {tcuFloat.deFloat}
+ */
+tcuFloat.newFloat10 = function(value) {
+ DE_ASSERT(Number.isInteger(value) && value <= 0x3ff);
+ /**@type {tcuFloat.deFloat} */ var other32 = new tcuFloat.deFloat().deFloatNumber(value);
+ return tcuFloat.description10.convert(other32);
+};
+
+/**
+ * Builds a 11 bit tcuFloat.deFloat
+ * @param {number} value (64-bit JS float)
+ * @return {tcuFloat.deFloat}
+ */
+tcuFloat.newFloat11 = function(value) {
+ /**@type {tcuFloat.deFloat} */ var other32 = new tcuFloat.deFloat().deFloatNumber(value);
+ return tcuFloat.description11.convert(other32);
+};
+
+/**
+ * Builds a 16 bit tcuFloat.deFloat
+ * @param {number} value (64-bit JS float)
+ * @return {tcuFloat.deFloat}
+ */
+tcuFloat.newFloat16 = function(value) {
+ /**@type {tcuFloat.deFloat} */ var other32 = new tcuFloat.deFloat().deFloatNumber(value);
+ return tcuFloat.description16.convert(other32);
+};
+
+/**
+ * Builds a 16 bit tcuFloat.deFloat from raw bits
+ * @param {number} value (16-bit value)
+ * @return {tcuFloat.deFloat}
+ */
+tcuFloat.newFloat32From16 = function(value) {
+ var other16 = tcuFloat.newDeFloatFromParameters(value, tcuFloat.description16);
+ return tcuFloat.description32.convert(other16);
+};
+
+/**
+ * Builds a 16 bit tcuFloat.deFloat with no denorm support
+ * @param {number} value (64-bit JS float)
+ * @return {tcuFloat.deFloat}
+ */
+tcuFloat.newFloat16NoDenorm = function(value) {
+ /**@type {tcuFloat.deFloat} */ var other32 = new tcuFloat.deFloat().deFloatNumber(value);
+ return tcuFloat.description16.convert(other32);
+};
+
+/**
+ * Builds a 32 bit tcuFloat.deFloat
+ * @param {number} value (64-bit JS float)
+ * @return {tcuFloat.deFloat}
+ */
+tcuFloat.newFloat32 = function(value) {
+ return new tcuFloat.deFloat().deFloatNumber(value);
+};
+
+tcuFloat.numberToFloat11 = function(value) {
+ return tcuFloat.convertFloat32Inline(value, tcuFloat.description11);
+};
+
+tcuFloat.float11ToNumber = (function() {
+ var x = tcuFloat.newDeFloatFromParameters(0, tcuFloat.description11);
+ return function(float11) {
+ x.deFloatParametersNumber(float11);
+ return x.getValue();
+ };
+})();
+
+tcuFloat.numberToFloat10 = function(value) {
+ return tcuFloat.convertFloat32Inline(value, tcuFloat.description10);
+};
+
+tcuFloat.float10ToNumber = (function() {
+ var x = tcuFloat.newDeFloatFromParameters(0, tcuFloat.description10);
+ return function(float10) {
+ x.deFloatParametersNumber(float10);
+ return x.getValue();
+ };
+})();
+
+tcuFloat.numberToHalfFloat = function(value) {
+ return tcuFloat.convertFloat32Inline(value, tcuFloat.description16);
+};
+
+tcuFloat.numberToHalfFloatNoDenorm = function(value) {
+ return tcuFloat.newFloat16NoDenorm(value).bits();
+};
+
+tcuFloat.halfFloatToNumber = (function() {
+ var x = tcuFloat.newDeFloatFromParameters(0, tcuFloat.description16);
+ return function(half) {
+ x.deFloatParametersNumber(half);
+ return x.getValue();
+ };
+})();
+
+tcuFloat.halfFloatToNumberNoDenorm = tcuFloat.halfFloatToNumber;
+
+/**
+ * Builds a 64 bit tcuFloat.deFloat
+ * @param {number} value (64-bit JS float)
+ * @return {tcuFloat.deFloat}
+ */
+tcuFloat.newFloat64 = function(value) {
+ return new tcuFloat.deFloat().deFloatParameters(0, tcuFloat.description64)
+ .deFloatNumber64(value);
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuFloatFormat.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuFloatFormat.js
new file mode 100644
index 0000000000..a0b4dc82cf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuFloatFormat.js
@@ -0,0 +1,349 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program Tester Core
+ * ----------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief Adjustable-precision floating point operations.
+ *//*--------------------------------------------------------------------*/
+ 'use strict';
+ goog.provide('framework.common.tcuFloatFormat');
+
+ goog.require('framework.common.tcuInterval');
+goog.require('framework.delibs.debase.deMath');
+
+ goog.scope(function() {
+
+ var tcuFloatFormat = framework.common.tcuFloatFormat;
+ var deMath = framework.delibs.debase.deMath;
+ var tcuInterval = framework.common.tcuInterval;
+
+ /**
+ * @param {tcuFloatFormat.YesNoMaybe} choice
+ * @param {tcuInterval.Interval} no
+ * @param {tcuInterval.Interval} yes
+ * @return {tcuInterval.Interval}
+ */
+ tcuFloatFormat.chooseInterval = function(choice, no, yes) {
+ switch (choice) {
+ case tcuFloatFormat.YesNoMaybe.NO: return no;
+ case tcuFloatFormat.YesNoMaybe.YES: return yes;
+ case tcuFloatFormat.YesNoMaybe.MAYBE: return no.operatorOrBinary(yes);
+ default: throw new Error('Impossible case');
+ }
+ };
+
+ /**
+ * @param {number} maxExp
+ * @param {number} fractionBits
+ * @return {number}
+ */
+ tcuFloatFormat.computeMaxValue = function(maxExp, fractionBits) {
+ return deMath.deLdExp(1, maxExp) + deMath.deLdExp(Math.pow(2, fractionBits) - 1, maxExp - fractionBits);
+ };
+
+ /**
+ * @enum {number}
+ */
+ tcuFloatFormat.YesNoMaybe = {
+ NO: 0,
+ MAYBE: 1,
+ YES: 2
+ };
+
+ /**
+ * @constructor
+ * @param {number} minExp
+ * @param {number} maxExp
+ * @param {number} fractionBits
+ * @param {boolean} exactPrecision
+ * @param {tcuFloatFormat.YesNoMaybe=} hasSubnormal
+ * @param {tcuFloatFormat.YesNoMaybe=} hasInf
+ * @param {tcuFloatFormat.YesNoMaybe=} hasNaN
+ */
+ tcuFloatFormat.FloatFormat = function(minExp, maxExp, fractionBits, exactPrecision, hasSubnormal, hasInf, hasNaN) {
+ // /** @type{number} */ var exponentShift (int exp) const;
+ // Interval clampValue (double d) const;
+
+ /** @type {number} */ this.m_minExp = minExp; // Minimum exponent, inclusive
+ /** @type {number} */ this.m_maxExp = maxExp; // Maximum exponent, inclusive
+ /** @type {number} */ this.m_fractionBits = fractionBits; // Number of fractional bits in significand
+ /** @type {tcuFloatFormat.YesNoMaybe} */ this.m_hasSubnormal = hasSubnormal === undefined ? tcuFloatFormat.YesNoMaybe.MAYBE : hasSubnormal; // Does the format support denormalized numbers?
+ /** @type {tcuFloatFormat.YesNoMaybe} */ this.m_hasInf = hasInf === undefined ? tcuFloatFormat.YesNoMaybe.MAYBE : hasInf; // Does the format support infinities?
+ /** @type {tcuFloatFormat.YesNoMaybe} */ this.m_hasNaN = hasNaN === undefined ? tcuFloatFormat.YesNoMaybe.MAYBE : hasNaN; // Does the format support NaNs?
+ /** @type {boolean} */ this.m_exactPrecision = exactPrecision; // Are larger precisions disallowed?
+ /** @type {number} */ this.m_maxValue = tcuFloatFormat.computeMaxValue(maxExp, fractionBits);
+ };
+
+ /**
+ * @return {number}
+ */
+ tcuFloatFormat.FloatFormat.prototype.getMinExp = function() {
+ return this.m_minExp;
+ };
+
+ /**
+ * @return {number}
+ */
+ tcuFloatFormat.FloatFormat.prototype.getMaxExp = function() {
+ return this.m_maxExp;
+ };
+
+ /**
+ * @return {number}
+ */
+ tcuFloatFormat.FloatFormat.prototype.getMaxValue = function() {
+ return this.m_maxValue;
+ };
+
+ /**
+ * @return {number}
+ */
+ tcuFloatFormat.FloatFormat.prototype.getFractionBits = function() {
+ return this.m_fractionBits;
+ };
+
+ /**
+ * @return {tcuFloatFormat.YesNoMaybe}
+ */
+ tcuFloatFormat.FloatFormat.prototype.hasSubnormal = function() {
+ return this.m_hasSubnormal;
+ };
+
+ /**
+ * @return {tcuFloatFormat.YesNoMaybe}
+ */
+ tcuFloatFormat.FloatFormat.prototype.hasInf = function() {
+ return this.m_hasInf;
+ };
+
+ /**
+ * @param {number} x
+ * @param {number} count
+ * @return {number}
+ */
+ tcuFloatFormat.FloatFormat.prototype.ulp = function(x, count) {
+ var breakdown = deMath.deFractExp(Math.abs(x));
+ /** @type {number} */ var exp = breakdown.exponent;
+ /** @type {number} */ var frac = breakdown.significand;
+
+ if (isNaN(frac))
+ return NaN;
+ else if (!isFinite(frac))
+ return deMath.deLdExp(1.0, this.m_maxExp - this.m_fractionBits);
+ else if (frac == 1.0) {
+ // Harrison's ULP: choose distance to closest (i.e. next lower) at binade
+ // boundary.
+ --exp;
+ } else if (frac == 0.0)
+ exp = this.m_minExp;
+
+ // ULP cannot be lower than the smallest quantum.
+ exp = Math.max(exp, this.m_minExp);
+
+ /** @type {number} */ var oneULP = deMath.deLdExp(1.0, exp - this.m_fractionBits);
+ // ScopedRoundingMode ctx (DE_ROUNDINGMODE_TO_POSITIVE_INF);
+
+ return oneULP * count;
+ };
+
+ /**
+ * Return the difference between the given nominal exponent and
+ * the exponent of the lowest significand bit of the
+ * representation of a number with this format.
+ * For normal numbers this is the number of significand bits, but
+ * for subnormals it is less and for values of exp where 2^exp is too
+ * small to represent it is <0
+ * @param {number} exp
+ * @return {number}
+ */
+ tcuFloatFormat.FloatFormat.prototype.exponentShift = function(exp) {
+ return this.m_fractionBits - Math.max(this.m_minExp - exp, 0);
+ };
+
+ /**
+ * @param {number} d
+ * @param {boolean} upward
+ * @return {number}
+ */
+ tcuFloatFormat.FloatFormat.prototype.round = function(d, upward) {
+ var breakdown = deMath.deFractExp(d);
+ /** @type {number} */ var exp = breakdown.exponent;
+ /** @type {number} */ var frac = breakdown.significand;
+
+ var shift = this.exponentShift(exp);
+ var shiftFrac = deMath.deLdExp(frac, shift);
+ var roundFrac = upward ? Math.ceil(shiftFrac) : Math.floor(shiftFrac);
+
+ return deMath.deLdExp(roundFrac, exp - shift);
+ };
+
+ /**
+ * Return the range of numbers that `d` might be converted to in the
+ * floatformat, given its limitations with infinities, subnormals and maximum
+ * exponent.
+ * @param {number} d
+ * @return {tcuInterval.Interval}
+ */
+ tcuFloatFormat.FloatFormat.prototype.clampValue = function(d) {
+ /** @type {number} */ var rSign = deMath.deSign(d);
+ /** @type {number} */ var rExp = 0;
+
+ // DE_ASSERT(!isNaN(d));
+
+ var breakdown = deMath.deFractExp(d);
+ rExp = breakdown.exponent;
+ if (rExp < this.m_minExp)
+ return tcuFloatFormat.chooseInterval(this.m_hasSubnormal, new tcuInterval.Interval(rSign * 0.0), new tcuInterval.Interval(d));
+ else if (!isFinite(d) || rExp > this.m_maxExp)
+ return tcuFloatFormat.chooseInterval(this.m_hasInf, new tcuInterval.Interval(rSign * this.getMaxValue()), new tcuInterval.Interval(rSign * Number.POSITIVE_INFINITY));
+
+ return new tcuInterval.Interval(d);
+ };
+
+ /**
+ * @param {number} d
+ * @param {boolean} upward
+ * @param {boolean} roundUnderOverflow
+ * @return {number}
+ */
+ tcuFloatFormat.FloatFormat.prototype.roundOutDir = function(d, upward, roundUnderOverflow) {
+ var breakdown = deMath.deFractExp(d);
+ var exp = breakdown.exponent;
+
+ if (roundUnderOverflow && exp > this.m_maxExp && (upward == (d < 0.0)))
+ return deMath.deSign(d) * this.getMaxValue();
+ else
+ return this.round(d, upward);
+ };
+
+ /**
+ * @param {tcuInterval.Interval} x
+ * @param {boolean} roundUnderOverflow
+ * @return {tcuInterval.Interval}
+ */
+ tcuFloatFormat.FloatFormat.prototype.roundOut = function(x, roundUnderOverflow) {
+ /** @type {tcuInterval.Interval} */ var ret = x.nan();
+
+ if (!x.empty()) {
+ var a = new tcuInterval.Interval(this.roundOutDir(x.lo(), false, roundUnderOverflow));
+ var b = new tcuInterval.Interval(this.roundOutDir(x.hi(), true, roundUnderOverflow));
+ ret.operatorOrAssignBinary(tcuInterval.withIntervals(a, b));
+ }
+ return ret;
+ };
+
+ //! Return the range of numbers that might be used with this format to
+ //! represent a number within `x`.
+ /**
+ * @param {tcuInterval.Interval} x
+ * @return {tcuInterval.Interval}
+ */
+ tcuFloatFormat.FloatFormat.prototype.convert = function(x) {
+ /** @type {tcuInterval.Interval} */ var ret = new tcuInterval.Interval();
+ /** @type {tcuInterval.Interval} */ var tmp = x;
+
+ if (x.hasNaN()) {
+ // If NaN might be supported, NaN is a legal return value
+ if (this.m_hasNaN != tcuFloatFormat.YesNoMaybe.NO)
+ ret.operatorOrAssignBinary(new tcuInterval.Interval(NaN));
+
+ // If NaN might not be supported, any (non-NaN) value is legal,
+ // _subject_ to clamping. Hence we modify tmp, not ret.
+ if (this.m_hasNaN != tcuFloatFormat.YesNoMaybe.YES)
+ tmp = tcuInterval.unbounded();
+ }
+
+ // Round both bounds _inwards_ to closest representable values.
+ if (!tmp.empty())
+ ret.operatorOrAssignBinary(
+ this.clampValue(this.round(tmp.lo(), true)).operatorOrBinary(
+ this.clampValue(this.round(tmp.hi(), false))));
+
+ // If this format's precision is not exact, the (possibly out-of-bounds)
+ // original value is also a possible result.
+ if (!this.m_exactPrecision)
+ ret.operatorOrAssignBinary(x);
+
+ return ret;
+ };
+
+ /**
+ * @param {number} x
+ * @return {string}
+ */
+ tcuFloatFormat.FloatFormat.prototype.floatToHex = function(x) {
+ if (isNaN(x))
+ return 'NaN';
+ else if (!isFinite(x))
+ return (x < 0.0 ? '-' : '+') + ('inf');
+ else if (x == 0.0) // \todo [2014-03-27 lauri] Negative zero
+ return '0.0';
+
+ return x.toString(10);
+ // TODO
+ // var breakdown = deMath.deFractExp(deAbs(x));
+ // /** @type{number} */ var exp = breakdown.exponent;
+ // /** @type{number} */ var frac = breakdown.significand;
+ // /** @type{number} */ var shift = this.exponentShift(exp);
+ // /** @type{number} */ var bits = deUint64(deLdExp(frac, shift));
+ // /** @type{number} */ var whole = bits >> m_fractionBits;
+ // /** @type{number} */ var fraction = bits & ((deUint64(1) << m_fractionBits) - 1);
+ // /** @type{number} */ var exponent = exp + m_fractionBits - shift;
+ // /** @type{number} */ var numDigits = (this.m_fractionBits + 3) / 4;
+ // /** @type{number} */ var aligned = fraction << (numDigits * 4 - m_fractionBits);
+ // /** @type{string} */ var oss = '';
+
+ // oss + (x < 0 ? '-' : '')
+ // + '0x' + whole + '.'
+ // + std::hex + std::setw(numDigits) + std::setfill('0') + aligned
+ // + 'p' + std::dec + std::setw(0) + exponent;
+ //return oss;
+ };
+
+ /**
+ * @param {tcuInterval.Interval} interval
+ * @return {string}
+ */
+ tcuFloatFormat.FloatFormat.prototype.intervalToHex = function(interval) {
+ if (interval.empty())
+ return interval.hasNaN() ? '{ NaN }' : '{}';
+
+ else if (interval.lo() == interval.hi())
+ return ((interval.hasNaN() ? '{ NaN, ' : '{ ') +
+ this.floatToHex(interval.lo()) + ' }');
+ else if (interval == tcuInterval.unbounded(true))
+ return '<any>';
+
+ return ((interval.hasNaN() ? '{ NaN } | ' : '') +
+ '[' + this.floatToHex(interval.lo()) + ', ' + this.floatToHex(interval.hi()) + ']');
+ };
+
+ /**
+ * @return {tcuFloatFormat.FloatFormat}
+ */
+ tcuFloatFormat.nativeDouble = function() {
+ return new tcuFloatFormat.FloatFormat(-1021 - 1, // min_exponent
+ 1024 - 1, // max_exponent
+ 53 - 1, // digits
+ true, // has_denorm
+ tcuFloatFormat.YesNoMaybe.YES, // has_infinity
+ tcuFloatFormat.YesNoMaybe.YES, // has_quiet_nan
+ tcuFloatFormat.YesNoMaybe.YES); // has_denorm
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuFuzzyImageCompare.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuFuzzyImageCompare.js
new file mode 100644
index 0000000000..828d830100
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuFuzzyImageCompare.js
@@ -0,0 +1,338 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.common.tcuFuzzyImageCompare');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+
+goog.scope(function() {
+
+var tcuFuzzyImageCompare = framework.common.tcuFuzzyImageCompare;
+var deMath = framework.delibs.debase.deMath;
+var deRandom = framework.delibs.debase.deRandom;
+var tcuTexture = framework.common.tcuTexture;
+var tcuTextureUtil = framework.common.tcuTextureUtil;
+
+ var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+ };
+
+ /**
+ * tcuFuzzyImageCompare.FuzzyCompareParams struct
+ * @constructor
+ * @param {number=} maxSampleSkip_
+ * @param {number=} minErrThreshold_
+ * @param {number=} errExp_
+ */
+ tcuFuzzyImageCompare.FuzzyCompareParams = function(maxSampleSkip_, minErrThreshold_, errExp_) {
+ /** @type {number} */ this.maxSampleSkip = maxSampleSkip_ === undefined ? 8 : maxSampleSkip_;
+ /** @type {number} */ this.minErrThreshold = minErrThreshold_ === undefined ? 4 : minErrThreshold_;
+ /** @type {number} */ this.errExp = errExp_ === undefined ? 4.0 : errExp_;
+ };
+
+ /**
+ * @param {Array<number>} v
+ * @return {Array<number>}
+ */
+ tcuFuzzyImageCompare.roundArray4ToUint8Sat = function(v) {
+ return [
+ deMath.clamp(Math.trunc(v[0] + 0.5), 0, 255),
+ deMath.clamp(Math.trunc(v[1] + 0.5), 0, 255),
+ deMath.clamp(Math.trunc(v[2] + 0.5), 0, 255),
+ deMath.clamp(Math.trunc(v[3] + 0.5), 0, 255)
+ ];
+ };
+
+ /**
+ * @param {Array<number>} pa
+ * @param {Array<number>} pb
+ * @param {number} minErrThreshold
+ * @return {number}
+ */
+ tcuFuzzyImageCompare.compareColors = function(pa, pb, minErrThreshold) {
+ /** @type {number}*/ var r = Math.max(Math.abs(pa[0] - pb[0]) - minErrThreshold, 0);
+ /** @type {number}*/ var g = Math.max(Math.abs(pa[1] - pb[1]) - minErrThreshold, 0);
+ /** @type {number}*/ var b = Math.max(Math.abs(pa[2] - pb[2]) - minErrThreshold, 0);
+ /** @type {number}*/ var a = Math.max(Math.abs(pa[3] - pb[3]) - minErrThreshold, 0);
+
+ /** @type {number}*/ var scale = 1.0 / (255 - minErrThreshold);
+ /** @type {number}*/ var sqSum = (r * r + g * g + b * b + a * a) * (scale * scale);
+
+ return Math.sqrt(sqSum);
+ };
+
+ /**
+ * @param {tcuTexture.RGBA8View} src
+ * @param {number} u
+ * @param {number} v
+ * @param {number} NumChannels
+ * @return {Array<number>}
+ */
+ tcuFuzzyImageCompare.bilinearSample = function(src, u, v, NumChannels) {
+ /** @type {number}*/ var w = src.width;
+ /** @type {number}*/ var h = src.height;
+
+ /** @type {number}*/ var x0 = Math.floor(u - 0.5);
+ /** @type {number}*/ var x1 = x0 + 1;
+ /** @type {number}*/ var y0 = Math.floor(v - 0.5);
+ /** @type {number}*/ var y1 = y0 + 1;
+
+ /** @type {number}*/ var i0 = deMath.clamp(x0, 0, w - 1);
+ /** @type {number}*/ var i1 = deMath.clamp(x1, 0, w - 1);
+ /** @type {number}*/ var j0 = deMath.clamp(y0, 0, h - 1);
+ /** @type {number}*/ var j1 = deMath.clamp(y1, 0, h - 1);
+
+ /** @type {number}*/ var a = (u - 0.5) - Math.floor(u - 0.5);
+ /** @type {number}*/ var b = (v - 0.5) - Math.floor(v - 0.5);
+
+ /** @type {Array<number>} */ var p00 = src.read(i0, j0, NumChannels);
+ /** @type {Array<number>} */ var p10 = src.read(i1, j0, NumChannels);
+ /** @type {Array<number>} */ var p01 = src.read(i0, j1, NumChannels);
+ /** @type {Array<number>} */ var p11 = src.read(i1, j1, NumChannels);
+ /** @type {number} */ var dst = 0;
+
+ // Interpolate.
+ /** @type {Array<number>}*/ var f = [];
+ for (var c = 0; c < NumChannels; c++) {
+ f[c] = p00[c] * (1.0 - a) * (1.0 - b) +
+ (p10[c] * a * (1.0 - b)) +
+ (p01[c] * (1.0 - a) * b) +
+ (p11[c] * a * b);
+ }
+
+ return tcuFuzzyImageCompare.roundArray4ToUint8Sat(f);
+ };
+
+ /**
+ * @param {tcuTexture.RGBA8View} dst
+ * @param {tcuTexture.RGBA8View} src
+ * @param {number} shiftX
+ * @param {number} shiftY
+ * @param {Array<number>} kernelX
+ * @param {Array<number>} kernelY
+ * @param {number} DstChannels
+ * @param {number} SrcChannels
+ */
+ tcuFuzzyImageCompare.separableConvolve = function(dst, src, shiftX, shiftY, kernelX, kernelY, DstChannels, SrcChannels) {
+ DE_ASSERT(dst.width == src.width && dst.height == src.height);
+
+ /** @type {tcuTexture.TextureLevel} */ var tmp = new tcuTexture.TextureLevel(dst.getFormat(), dst.height, dst.width);
+ var tmpView = new tcuTexture.RGBA8View(tmp.getAccess());
+
+ /** @type {number} */ var kw = kernelX.length;
+ /** @type {number} */ var kh = kernelY.length;
+
+ /** @type {Array<number>} */ var sum = [];
+ /** @type {number} */ var f;
+ /** @type {Array<number>} */ var p;
+
+ // Horizontal pass
+ // \note Temporary surface is written in column-wise order
+ for (var j = 0; j < src.height; j++) {
+ for (var i = 0; i < src.width; i++) {
+ sum[0] = sum[1] = sum[2] = sum[3] = 0;
+ for (var kx = 0; kx < kw; kx++) {
+ f = kernelX[kw - kx - 1];
+ p = src.read(deMath.clamp(i + kx - shiftX, 0, src.width - 1), j, SrcChannels);
+ sum = deMath.add(sum, deMath.scale(p, f));
+ }
+
+ sum = tcuFuzzyImageCompare.roundArray4ToUint8Sat(sum);
+ tmpView.write(j, i, sum, DstChannels);
+ }
+ }
+
+ // Vertical pass
+ for (var j = 0; j < src.height; j++) {
+ for (var i = 0; i < src.width; i++) {
+ sum[0] = sum[1] = sum[2] = sum[3] = 0;
+ for (var ky = 0; ky < kh; ky++) {
+ f = kernelY[kh - ky - 1];
+ p = tmpView.read(deMath.clamp(j + ky - shiftY, 0, tmpView.width - 1), i, DstChannels);
+ sum = deMath.add(sum, deMath.scale(p, f));
+ }
+
+ sum = tcuFuzzyImageCompare.roundArray4ToUint8Sat(sum);
+ dst.write(i, j, sum, DstChannels);
+ }
+ }
+ };
+
+ /**
+ * @param {tcuFuzzyImageCompare.FuzzyCompareParams} params
+ * @param {deRandom.Random} rnd
+ * @param {Array<number>} pixel
+ * @param {tcuTexture.RGBA8View} surface
+ * @param {number} x
+ * @param {number} y
+ * @param {number} NumChannels
+ * @return {number}
+ */
+ tcuFuzzyImageCompare.compareToNeighbor = function(params, rnd, pixel, surface, x, y, NumChannels) {
+ /** @type {number} */ var minErr = 100;
+
+ // (x, y) + (0, 0)
+ minErr = Math.min(minErr, tcuFuzzyImageCompare.compareColors(pixel, surface.read(x, y, NumChannels), params.minErrThreshold));
+ if (minErr == 0.0)
+ return minErr;
+
+ // Area around (x, y)
+ /** @type {Array<Array.<number>>} */ var s_coords =
+ [
+ [-1, -1],
+ [0, -1],
+ [1, -1],
+ [-1, 0],
+ [1, 0],
+ [-1, 1],
+ [0, 1],
+ [1, 1]
+ ];
+
+ /** @type {number} */ var dx;
+ /** @type {number} */ var dy;
+
+ for (var d = 0; d < s_coords.length; d++) {
+ dx = x + s_coords[d][0];
+ dy = y + s_coords[d][1];
+
+ if (!deMath.deInBounds32(dx, 0, surface.width) || !deMath.deInBounds32(dy, 0, surface.height))
+ continue;
+
+ minErr = Math.min(minErr, tcuFuzzyImageCompare.compareColors(pixel, surface.read(dx, dy, NumChannels), params.minErrThreshold));
+ if (minErr == 0.0)
+ return minErr;
+ }
+
+ // Random bilinear-interpolated samples around (x, y)
+ for (var s = 0; s < 32; s++) {
+ dx = x + rnd.getFloat() * 2.0 - 0.5;
+ dy = y + rnd.getFloat() * 2.0 - 0.5;
+
+ /** @type {Array<number>} */ var sample = tcuFuzzyImageCompare.bilinearSample(surface, dx, dy, NumChannels);
+
+ minErr = Math.min(minErr, tcuFuzzyImageCompare.compareColors(pixel, sample, params.minErrThreshold));
+ if (minErr == 0.0)
+ return minErr;
+ }
+
+ return minErr;
+ };
+
+ /**
+ * @param {Array<number>} c
+ * @return {number}
+ */
+ tcuFuzzyImageCompare.toGrayscale = function(c) {
+ return 0.2126 * c[0] + 0.7152 * c[1] + 0.0722 * c[2];
+ };
+
+ /**
+ * @param {tcuTexture.TextureFormat} format
+ * @return {boolean}
+ */
+ tcuFuzzyImageCompare.isFormatSupported = function(format) {
+ return format.type == tcuTexture.ChannelType.UNORM_INT8 && (format.order == tcuTexture.ChannelOrder.RGB || format.order == tcuTexture.ChannelOrder.RGBA);
+ };
+
+ /**
+ * @param {tcuFuzzyImageCompare.FuzzyCompareParams} params
+ * @param {tcuTexture.ConstPixelBufferAccess} ref
+ * @param {tcuTexture.ConstPixelBufferAccess} cmp
+ * @param {tcuTexture.PixelBufferAccess} errorMask
+ * @return {number}
+ */
+ tcuFuzzyImageCompare.fuzzyCompare = function(params, ref, cmp, errorMask) {
+ assertMsgOptions(ref.getWidth() == cmp.getWidth() && ref.getHeight() == cmp.getHeight(),
+ 'Reference and result images have different dimensions', false, true);
+
+ assertMsgOptions(ref.getWidth() == errorMask.getWidth() && ref.getHeight() == errorMask.getHeight(),
+ 'Reference and error mask images have different dimensions', false, true);
+
+ if (!tcuFuzzyImageCompare.isFormatSupported(ref.getFormat()) || !tcuFuzzyImageCompare.isFormatSupported(cmp.getFormat()))
+ throw new Error('Unsupported format in fuzzy comparison');
+
+ /** @type {number} */ var width = ref.getWidth();
+ /** @type {number} */ var height = ref.getHeight();
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(667);
+
+ // Filtered
+ /** @type {tcuTexture.TextureLevel} */ var refFiltered = new tcuTexture.TextureLevel(new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8), width, height);
+ /** @type {tcuTexture.TextureLevel} */ var cmpFiltered = new tcuTexture.TextureLevel(new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8), width, height);
+
+ var refView = new tcuTexture.RGBA8View(ref);
+ var cmpView = new tcuTexture.RGBA8View(cmp);
+ var refFilteredView = new tcuTexture.RGBA8View(tcuTexture.PixelBufferAccess.newFromTextureLevel(refFiltered));
+ var cmpFilteredView = new tcuTexture.RGBA8View(tcuTexture.PixelBufferAccess.newFromTextureLevel(cmpFiltered));
+
+ // Kernel = {0.15, 0.7, 0.15}
+ /** @type {Array<number>} */ var kernel = [0.1, 0.8, 0.1];
+ /** @type {number} */ var shift = Math.floor((kernel.length - 1) / 2);
+
+ switch (ref.getFormat().order) {
+ case tcuTexture.ChannelOrder.RGBA: tcuFuzzyImageCompare.separableConvolve(refFilteredView, refView, shift, shift, kernel, kernel, 4, 4); break;
+ case tcuTexture.ChannelOrder.RGB: tcuFuzzyImageCompare.separableConvolve(refFilteredView, refView, shift, shift, kernel, kernel, 4, 3); break;
+ default:
+ throw new Error('tcuFuzzyImageCompare.fuzzyCompare - Invalid ChannelOrder');
+ }
+
+ switch (cmp.getFormat().order) {
+ case tcuTexture.ChannelOrder.RGBA: tcuFuzzyImageCompare.separableConvolve(cmpFilteredView, cmpView, shift, shift, kernel, kernel, 4, 4); break;
+ case tcuTexture.ChannelOrder.RGB: tcuFuzzyImageCompare.separableConvolve(cmpFilteredView, cmpView, shift, shift, kernel, kernel, 4, 3); break;
+ default:
+ throw new Error('tcuFuzzyImageCompare.fuzzyCompare - Invalid ChannelOrder');
+ }
+
+ /** @type {number} */ var numSamples = 0;
+ /** @type {number} */ var errSum = 0.0;
+
+ // Clear error mask to green.
+ errorMask.clear([0.0, 1.0, 0.0, 1.0]);
+
+ for (var y = 1; y < height - 1; y++) {
+ for (var x = 1; x < width - 1; x += params.maxSampleSkip > 0 ? rnd.getInt(0, params.maxSampleSkip) : 1) {
+ /** @type {number} */ var err = Math.min(tcuFuzzyImageCompare.compareToNeighbor(params, rnd, refFilteredView.read(x, y, 4), cmpFilteredView, x, y, 4),
+ tcuFuzzyImageCompare.compareToNeighbor(params, rnd, cmpFilteredView.read(x, y, 4), refFilteredView, x, y, 4));
+
+ err = Math.pow(err, params.errExp);
+
+ errSum += err;
+ numSamples += 1;
+
+ // Build error image.
+ /** @type {number} */ var red = err * 500.0;
+ /** @type {number} */ var luma = tcuFuzzyImageCompare.toGrayscale(cmp.getPixel(x, y));
+ /** @type {number} */ var rF = 0.7 + 0.3 * luma;
+ errorMask.setPixel([red * rF, (1.0 - red) * rF, 0.0, 1.0], x, y);
+
+ }
+ }
+
+ // Scale error sum based on number of samples taken
+ errSum *= ((width - 2) * (height - 2)) / numSamples;
+
+ return errSum;
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuImageCompare.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuImageCompare.js
new file mode 100644
index 0000000000..3a8138ef23
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuImageCompare.js
@@ -0,0 +1,757 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuBilinearImageCompare');
+goog.require('framework.common.tcuFloat');
+goog.require('framework.common.tcuFuzzyImageCompare');
+goog.require('framework.common.tcuLogImage');
+goog.require('framework.common.tcuRGBA');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.delibs.debase.deMath');
+
+goog.scope(function() {
+
+var tcuImageCompare = framework.common.tcuImageCompare;
+var tcuSurface = framework.common.tcuSurface;
+var deMath = framework.delibs.debase.deMath;
+var tcuTexture = framework.common.tcuTexture;
+var tcuTextureUtil = framework.common.tcuTextureUtil;
+var tcuFloat = framework.common.tcuFloat;
+var tcuFuzzyImageCompare = framework.common.tcuFuzzyImageCompare;
+var tcuBilinearImageCompare = framework.common.tcuBilinearImageCompare;
+var tcuRGBA = framework.common.tcuRGBA;
+var tcuLogImage = framework.common.tcuLogImage;
+
+/**
+ * @enum
+ */
+tcuImageCompare.CompareLogMode = {
+ EVERYTHING: 0,
+ RESULT: 1,
+ ON_ERROR: 2
+};
+
+/**
+ * @param {framework.common.tcuTexture.ConstPixelBufferAccess} result
+ * @param {framework.common.tcuTexture.ConstPixelBufferAccess} reference
+ * @param {framework.common.tcuTexture.ConstPixelBufferAccess=} diff
+ */
+tcuImageCompare.displayImages = function(result, reference, diff) {
+ var limits = tcuImageCompare.computeScaleAndBias(reference, result);
+ tcuLogImage.logImage('Result', '', result, limits.scale, limits.bias);
+ tcuLogImage.logImage('Reference', '', reference, limits.scale, limits.bias);
+ if (diff)
+ tcuLogImage.logImage('Error', 'error mask', diff);
+};
+
+/**
+ * @param {tcuTexture.ConstPixelBufferAccess} reference
+ * @param {tcuTexture.ConstPixelBufferAccess} result
+ * @return {{scale: Array<number>, bias: Array<number>}}
+ */
+tcuImageCompare.computeScaleAndBias = function(reference, result) {
+ var minVal = [];
+ var maxVal = [];
+ var scale = [];
+ var bias = [];
+
+ var eps = 0.0001;
+ var referenceRange = tcuTextureUtil.estimatePixelValueRange(reference);
+ var resultRange = tcuTextureUtil.estimatePixelValueRange(result);
+
+ minVal[0] = Math.min(referenceRange[0][0], resultRange[0][0]);
+ minVal[1] = Math.min(referenceRange[0][1], resultRange[0][1]);
+ minVal[2] = Math.min(referenceRange[0][2], resultRange[0][2]);
+ minVal[3] = Math.min(referenceRange[0][3], resultRange[0][3]);
+
+ maxVal[0] = Math.max(referenceRange[1][0], resultRange[1][0]);
+ maxVal[1] = Math.max(referenceRange[1][1], resultRange[1][1]);
+ maxVal[2] = Math.max(referenceRange[1][2], resultRange[1][2]);
+ maxVal[3] = Math.max(referenceRange[1][3], resultRange[1][3]);
+
+ for (var c = 0; c < 4; c++) {
+ if (maxVal[c] - minVal[c] < eps) {
+ scale[c] = (maxVal[c] < eps) ? 1 : (1 / maxVal[c]);
+ bias[c] = (c == 3) ? (1 - maxVal[c] * scale[c]) : (0 - minVal[c] * scale[c]);
+ } else {
+ scale[c] = 1 / (maxVal[c] - minVal[c]);
+ bias[c] = 0 - minVal[c] * scale[c];
+ }
+ }
+ return {
+ scale: scale,
+ bias: bias
+ };
+};
+
+/**
+ * \brief Per-pixel threshold-based comparison
+ *
+ * This compare computes per-pixel differences between result and reference
+ * image. Comparison fails if any pixels exceed the given threshold value.
+ *
+ * This comparison can be used for integer- and fixed-point texture formats.
+ * Difference is computed in integer space.
+ *
+ * On failure error image is generated that shows where the failing pixels
+ * are.
+ *
+ * @param {string} imageSetName Name for image set when logging results
+ * @param {string} imageSetDesc Description for image set
+ * @param {tcuTexture.ConstPixelBufferAccess} reference Reference image
+ * @param {tcuTexture.ConstPixelBufferAccess} result Result image
+ * @param {Array<number>} threshold Maximum allowed difference
+ * @param {tcuImageCompare.CompareLogMode=} logMode
+ * @param {Array< Array<number> >} skipPixels pixels that are skipped comparison
+ * @return {boolean} true if comparison passes, false otherwise
+ */
+ tcuImageCompare.intThresholdCompare = function(imageSetName, imageSetDesc, reference, result, threshold, logMode, skipPixels) {
+ var width = reference.getWidth();
+ var height = reference.getHeight();
+ var depth = reference.getDepth();
+ var errorMask = new tcuSurface.Surface(width, height);
+
+ var maxDiff = [0, 0, 0, 0];
+ // var pixelBias = [0, 0, 0, 0]; // Vec4 // TODO: check, only used in computeScaleAndBias, which is not included
+ // var pixelScale = [1, 1, 1, 1]; // Vec4 // TODO: check, only used in computeScaleAndBias
+
+ assertMsgOptions(result.getWidth() == width && result.getHeight() == height && result.getDepth() == depth,
+ 'Reference and result images have different dimensions', false, true);
+
+ for (var z = 0; z < depth; z++) {
+ for (var y = 0; y < height; y++) {
+ for (var x = 0; x < width; x++) {
+ if (skipPixels && skipPixels.length > 0) {
+ var skip = false;
+ for (var ii = 0; ii < skipPixels.length; ++ii) {
+ var refZ = (skipPixels[ii].length > 2 ? skipPixels[ii][2] : 0);
+ if (x == skipPixels[ii][0] && y == skipPixels[ii][1] && z == refZ) {
+ skip = true;
+ break;
+ }
+ }
+ if (skip)
+ continue;
+ }
+ var refPix = reference.getPixelInt(x, y, z);
+ var cmpPix = result.getPixelInt(x, y, z);
+
+ var diff = deMath.absDiff(refPix, cmpPix);
+ var isOk = deMath.boolAll(deMath.lessThanEqual(diff, threshold));
+
+ maxDiff = deMath.max(maxDiff, diff);
+ var color = [0, 255, 0, 255];
+ if (!isOk)
+ color = [255, 0, 0, 255];
+ errorMask.setPixel(x, y, color);
+ }
+ }
+ }
+
+ var compareOk = deMath.boolAll(deMath.lessThanEqual(maxDiff, threshold));
+
+ if (!compareOk) {
+ debug('Image comparison failed: max difference = ' + maxDiff + ', threshold = ' + threshold);
+ tcuImageCompare.displayImages(result, reference, errorMask.getAccess());
+ }
+
+ return compareOk;
+};
+
+/**
+ * \brief Per-pixel threshold-based deviation-ignoring comparison
+ *
+ * This compare computes per-pixel differences between result and reference
+ * image. Pixel fails the test if there is no pixel matching the given
+ * threshold value in the search volume. Comparison fails if the number of
+ * failing pixels exceeds the given limit.
+ *
+ * If the search volume contains out-of-bounds pixels, comparison can be set
+ * to either ignore these pixels in search or to accept any pixel that has
+ * out-of-bounds pixels in its search volume.
+ *
+ * This comparison can be used for integer- and fixed-point texture formats.
+ * Difference is computed in integer space.
+ *
+ * On failure error image is generated that shows where the failing pixels
+ * are.
+ *
+ * @param {string} imageSetName Name for image set when logging results
+ * @param {string} imageSetDesc Description for image set
+ * @param {tcuTexture.ConstPixelBufferAccess} reference Reference image
+ * @param {tcuTexture.ConstPixelBufferAccess} result Result image
+ * @param {Array<number>} threshold Maximum allowed difference
+ * @param {Array<number>} maxPositionDeviation Maximum allowed distance in the search volume.
+ * @param {boolean} acceptOutOfBoundsAsAnyValue Accept any pixel in the boundary region
+ * @param {number} maxAllowedFailingPixels Maximum number of failing pixels
+ * @return {boolean} true if comparison passes, false otherwise
+ */
+tcuImageCompare.intThresholdPositionDeviationErrorThresholdCompare = function(
+ imageSetName, imageSetDesc, reference, result, threshold, maxPositionDeviation, acceptOutOfBoundsAsAnyValue, maxAllowedFailingPixels) {
+ /** @type {number} */ var width = reference.getWidth();
+ /** @type {number} */ var height = reference.getHeight();
+ /** @type {number} */ var depth = reference.getDepth();
+ /** @type {tcuSurface.Surface} */ var errorMask = new tcuSurface.Surface(width, height);
+ /** @type {number} */ var numFailingPixels = tcuImageCompare.findNumPositionDeviationFailingPixels(errorMask.getAccess(), reference, result, threshold, maxPositionDeviation, acceptOutOfBoundsAsAnyValue);
+ var compareOk = numFailingPixels <= maxAllowedFailingPixels;
+ /** @type {Array<number>} */ var pixelBias = [0.0, 0.0, 0.0, 0.0];
+ /** @type {Array<number>} */ var pixelScale = [1.0, 1.0, 1.0, 1.0];
+
+ if (!compareOk) {
+ debug('Position deviation error threshold image comparison failed: failed pixels = ' + numFailingPixels + ', threshold = ' + threshold);
+ tcuImageCompare.displayImages(result, reference, errorMask.getAccess());
+ } else
+ tcuLogImage.logImage('Result', '', result);
+
+ /*if (!compareOk) {
+ // All formats except normalized unsigned fixed point ones need remapping in order to fit into unorm channels in logged images.
+ if (tcuTexture.getTextureChannelClass(reference.getFormat().type) != tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT ||
+ tcuTexture.getTextureChannelClass(result.getFormat().type) != tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT) {
+ computeScaleAndBias(reference, result, pixelScale, pixelBias);
+ log << TestLog::Message << "Result and reference images are normalized with formula p * " << pixelScale << " + " << pixelBias << TestLog::EndMessage;
+ }
+
+ if (!compareOk)
+ log << TestLog::Message
+ << "Image comparison failed:\n"
+ << "\tallowed position deviation = " << maxPositionDeviation << "\n"
+ << "\tcolor threshold = " << threshold
+ << TestLog::EndMessage;
+ log << TestLog::Message << "Number of failing pixels = " << numFailingPixels << ", max allowed = " << maxAllowedFailingPixels << TestLog::EndMessage;
+
+ log << TestLog::ImageSet(imageSetName, imageSetDesc)
+ << TestLog::Image("Result", "Result", result, pixelScale, pixelBias)
+ << TestLog::Image("Reference", "Reference", reference, pixelScale, pixelBias)
+ << TestLog::Image("ErrorMask", "Error mask", errorMask)
+ << TestLog::EndImageSet;
+ } else if (logMode == COMPARE_LOG_RESULT) {
+ if (result.getFormat() != TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT8))
+ computePixelScaleBias(result, pixelScale, pixelBias);
+
+ log << TestLog::ImageSet(imageSetName, imageSetDesc)
+ << TestLog::Image("Result", "Result", result, pixelScale, pixelBias)
+ << TestLog::EndImageSet;
+ }*/
+
+ return compareOk;
+};
+
+/**
+ * tcuImageCompare.floatUlpThresholdCompare
+ * @param {string} imageSetName
+ * @param {string} imageSetDesc
+ * @param {tcuTexture.ConstPixelBufferAccess} reference
+ * @param {tcuTexture.ConstPixelBufferAccess} result
+ * @param {Array<number>} threshold - previously used as an Uint32Array
+ * @return {boolean}
+ */
+tcuImageCompare.floatUlpThresholdCompare = function(imageSetName, imageSetDesc, reference, result, threshold) {
+ /** @type {number} */ var width = reference.getWidth();
+ /** @type {number} */ var height = reference.getHeight();
+ /** @type {number} */ var depth = reference.getDepth();
+ /** @type {tcuSurface.Surface} */ var errorMask = new tcuSurface.Surface(width, height);
+
+ /** @type {Array<number>} */ var maxDiff = [0, 0, 0, 0]; // UVec4
+ // var pixelBias = [0, 0, 0, 0]; // Vec4
+ // var pixelScale = [1, 1, 1, 1]; // Vec4
+
+ assertMsgOptions(result.getWidth() == width && result.getHeight() == height && result.getDepth() == depth,
+ 'Reference and result images have different dimensions', false, true);
+
+ for (var z = 0; z < depth; z++) {
+ for (var y = 0; y < height; y++) {
+ for (var x = 0; x < width; x++) {
+ /** @type {ArrayBuffer} */ var arrayBufferRef = new ArrayBuffer(4 * 4);
+ /** @type {ArrayBuffer} */ var arrayBufferCmp = new ArrayBuffer(4 * 4);
+
+ /** @type {Array<number>} */ var refPix = reference.getPixel(x, y, z); // getPixel returns a Vec4 pixel color
+
+ /** @type {Array<number>} */ var cmpPix = result.getPixel(x, y, z); // getPixel returns a Vec4 pixel color
+
+ /** @type {Uint32Array} */ var refBits = new Uint32Array(arrayBufferRef); // UVec4
+ /** @type {Uint32Array} */ var cmpBits = new Uint32Array(arrayBufferCmp); // UVec4
+
+ // Instead of memcpy(), which is the way to do float->uint32 reinterpretation in C++
+ for (var i = 0; i < refPix.length; i++) {
+ refBits[i] = tcuFloat.convertFloat32Inline(refPix[i], tcuFloat.description32);
+ cmpBits[i] = tcuFloat.convertFloat32Inline(cmpPix[i], tcuFloat.description32);
+ }
+
+ /** @type {Array<number>} */ var diff = deMath.absDiff(refBits, cmpBits); // UVec4
+ /** @type {boolean} */ var isOk = deMath.boolAll(deMath.lessThanEqual(diff, threshold));
+
+ maxDiff = deMath.max(maxDiff, diff);
+
+ errorMask.setPixel(x, y, isOk ? [0, 255, 0, 255] : [255, 0, 0, 255]);
+ }
+ }
+ }
+
+ /** @type {boolean} */ var compareOk = deMath.boolAll(deMath.lessThanEqual(maxDiff, threshold));
+
+ if (!compareOk) {
+ debug('Image comparison failed: max difference = ' + maxDiff + ', threshold = ' + threshold);
+ tcuImageCompare.displayImages(result, reference, errorMask.getAccess());
+ }
+
+ /*if (!compareOk || logMode == COMPARE_LOG_EVERYTHING) {
+ // All formats except normalized unsigned fixed point ones need remapping in order to fit into unorm channels in logged images.
+ if (tcu::getTextureChannelClass(reference.getFormat().type) != tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT ||
+ tcu::getTextureChannelClass(result.getFormat().type) != tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT) {
+ computeScaleAndBias(reference, result, pixelScale, pixelBias);
+ log << TestLog::Message << "Result and reference images are normalized with formula p * " << pixelScale << " + " << pixelBias << TestLog::EndMessage;
+ }
+
+ if (!compareOk)
+ log << TestLog::Message << "Image comparison failed: max difference = " << maxDiff << ", threshold = " << threshold << TestLog::EndMessage;
+
+ log << TestLog::ImageSet(imageSetName, imageSetDesc)
+ << TestLog::Image("Result", "Result", result, pixelScale, pixelBias)
+ << TestLog::Image("Reference", "Reference", reference, pixelScale, pixelBias)
+ << TestLog::Image("ErrorMask", "Error mask", errorMask)
+ << TestLog::EndImageSet;
+ } else if (logMode == COMPARE_LOG_RESULT) {
+ if (result.getFormat() != TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT8))
+ computePixelScaleBias(result, pixelScale, pixelBias);
+
+ log << TestLog::ImageSet(imageSetName, imageSetDesc)
+ << TestLog::Image("Result", "Result", result, pixelScale, pixelBias)
+ << TestLog::EndImageSet;
+ }*/
+
+ return compareOk;
+};
+
+/**
+ * tcuImageCompare.floatThresholdCompare
+ * @param {string} imageSetName
+ * @param {string} imageSetDesc
+ * @param {tcuTexture.ConstPixelBufferAccess} reference
+ * @param {tcuTexture.ConstPixelBufferAccess} result
+ * @param {Array<number>} threshold
+ * @return {boolean}
+ */
+tcuImageCompare.floatThresholdCompare = function(imageSetName, imageSetDesc, reference, result, threshold) {
+ /** @type {number} */ var width = reference.getWidth();
+ /** @type {number} */ var height = reference.getHeight();
+ /** @type {number} */ var depth = reference.getDepth();
+ /** @type {tcuSurface.Surface} */ var errorMask = new tcuSurface.Surface(width, height);
+
+ /** @type {Array<number>} */ var maxDiff = [0, 0, 0, 0]; // Vec4
+ // var pixelBias = [0, 0, 0, 0]; // Vec4
+ // var pixelScale = [1, 1, 1, 1]; // Vec4
+
+ assertMsgOptions(result.getWidth() == width && result.getHeight() == height && result.getDepth() == depth,
+ 'Reference and result images have different dimensions', false, true);
+
+ for (var z = 0; z < depth; z++) {
+ for (var y = 0; y < height; y++) {
+ for (var x = 0; x < width; x++) {
+ var refPix = reference.getPixel(x, y, z); // Vec4
+ var cmpPix = result.getPixel(x, y, z); // Vec4
+
+ /** @type {Array<number>} */ var diff = deMath.absDiff(refPix, cmpPix); // Vec4
+ /** @type {boolean} */ var isOk = deMath.boolAll(deMath.lessThanEqual(diff, threshold));
+
+ maxDiff = deMath.max(maxDiff, diff);
+
+ errorMask.setPixel(x, y, isOk ? [0, 255, 0, 255] : [255, 0, 0, 255]);
+ }
+ }
+ }
+
+ /** @type {boolean} */ var compareOk = deMath.boolAll(deMath.lessThanEqual(maxDiff, threshold));
+
+ if (!compareOk) {
+ debug('Image comparison failed: max difference = ' + maxDiff + ', threshold = ' + threshold);
+ tcuImageCompare.displayImages(result, reference, errorMask.getAccess());
+ }
+
+ /*if (!compareOk || logMode == COMPARE_LOG_EVERYTHING) {
+ // All formats except normalized unsigned fixed point ones need remapping in order to fit into unorm channels in logged images.
+ if (tcu::getTextureChannelClass(reference.getFormat().type) != tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT ||
+ tcu::getTextureChannelClass(result.getFormat().type) != tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT) {
+ computeScaleAndBias(reference, result, pixelScale, pixelBias);
+ log << TestLog::Message << "Result and reference images are normalized with formula p * " << pixelScale << " + " << pixelBias << TestLog::EndMessage;
+ }
+
+ if (!compareOk)
+ log << TestLog::Message << "Image comparison failed: max difference = " << maxDiff << ", threshold = " << threshold << TestLog::EndMessage;
+
+ log << TestLog::ImageSet(imageSetName, imageSetDesc)
+ << TestLog::Image("Result", "Result", result, pixelScale, pixelBias)
+ << TestLog::Image("Reference", "Reference", reference, pixelScale, pixelBias)
+ << TestLog::Image("ErrorMask", "Error mask", errorMask)
+ << TestLog::EndImageSet;
+ } else if (logMode == COMPARE_LOG_RESULT) {
+ if (result.getFormat() != TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT8))
+ computePixelScaleBias(result, pixelScale, pixelBias);
+
+ log << TestLog::ImageSet(imageSetName, imageSetDesc)
+ << TestLog::Image("Result", "Result", result, pixelScale, pixelBias)
+ << TestLog::EndImageSet;
+ }*/
+
+ return compareOk;
+};
+
+/**
+ * \brief Per-pixel threshold-based comparison
+ *
+ * This compare computes per-pixel differences between result and reference
+ * image. Comparison fails if any pixels exceed the given threshold value.
+ *
+ * On failure error image is generated that shows where the failing pixels
+ * are.
+ *
+ * @param {string} imageSetName Name for image set when logging results
+ * @param {string} imageSetDesc Description for image set
+ * @param {tcuSurface.Surface} reference Reference image
+ * @param {tcuSurface.Surface} result Result image
+ * @param {Array<number>} threshold Maximum allowed difference
+ * @param {tcuImageCompare.CompareLogMode=} logMode
+ * @param {Array< Array<number> >} skipPixels pixels that are skipped comparison
+ * @return {boolean} true if comparison passes, false otherwise
+ */
+tcuImageCompare.pixelThresholdCompare = function(imageSetName, imageSetDesc, reference, result, threshold, logMode, skipPixels) {
+ return tcuImageCompare.intThresholdCompare(imageSetName, imageSetDesc, reference.getAccess(), result.getAccess(), threshold, logMode, skipPixels);
+};
+
+/**
+ * @param {tcuTexture.PixelBufferAccess} errorMask
+ * @param {tcuTexture.ConstPixelBufferAccess} reference
+ * @param {tcuTexture.ConstPixelBufferAccess} result
+ * @param {Array<number>} threshold
+ * @param {Array<number>} maxPositionDeviation
+ * @param {boolean} acceptOutOfBoundsAsAnyValue
+ * @return {number}
+ */
+tcuImageCompare.findNumPositionDeviationFailingPixels = function(errorMask, reference, result, threshold, maxPositionDeviation, acceptOutOfBoundsAsAnyValue) {
+ /** @type {number} */ var width = reference.getWidth();
+ /** @type {number} */ var height = reference.getHeight();
+ /** @type {number} */ var depth = reference.getDepth();
+ /** @type {number} */ var numFailingPixels = 0;
+
+ checkMessage(result.getWidth() == width && result.getHeight() == height && result.getDepth() == depth, 'Surfaces have different dimensions');
+
+ for (var z = 0; z < depth; z++) {
+ for (var y = 0; y < height; y++) {
+ for (var x = 0; x < width; x++) {
+ /** @type {Array<number>} */ var refPix = reference.getPixelInt(x, y, z);
+ /** @type {Array<number>} */ var cmpPix = result.getPixelInt(x, y, z);
+
+ // Exact match
+ /** @type {Array<number>} */ var diff = deMath.absDiff(refPix, cmpPix);
+ /** @type {boolean} */ var isOk = deMath.boolAll(deMath.lessThanEqual(diff, threshold));
+
+ if (isOk) {
+ errorMask.setPixel([0, 0xff, 0, 0xff], x, y, z);
+ continue;
+ }
+
+ // Accept over the image bounds pixels since they could be anything
+
+ if (acceptOutOfBoundsAsAnyValue &&
+ (x < maxPositionDeviation[0] || x + maxPositionDeviation[0] >= width ||
+ y < maxPositionDeviation[1] || y + maxPositionDeviation[1] >= height ||
+ z < maxPositionDeviation[2] || z + maxPositionDeviation[2] >= depth)) {
+ errorMask.setPixel([0, 0xff, 0, 0xff], x, y, z);
+ continue;
+ }
+
+ // Find matching pixels for both result and reference pixel
+
+ var pixelFoundForReference = false;
+ var pixelFoundForResult = false;
+
+ // Find deviated result pixel for reference
+
+ for (var sz = Math.max(0, z - maxPositionDeviation[2]); sz <= Math.min(depth - 1, z + maxPositionDeviation[2]) && !pixelFoundForReference; ++sz)
+ for (var sy = Math.max(0, y - maxPositionDeviation[1]); sy <= Math.min(height - 1, y + maxPositionDeviation[1]) && !pixelFoundForReference; ++sy)
+ for (var sx = Math.max(0, x - maxPositionDeviation[0]); sx <= Math.min(width - 1, x + maxPositionDeviation[0]) && !pixelFoundForReference; ++sx) {
+ /** @type {Array<number>} */ var deviatedCmpPix = result.getPixelInt(sx, sy, sz);
+ diff = deMath.absDiff(refPix, deviatedCmpPix);
+ isOk = deMath.boolAll(deMath.lessThanEqual(diff, threshold));
+
+ pixelFoundForReference |= isOk;
+ }
+
+ // Find deviated reference pixel for result
+
+ for (var sz = Math.max(0, z - maxPositionDeviation[2]); sz <= Math.min(depth - 1, z + maxPositionDeviation[2]) && !pixelFoundForResult; ++sz)
+ for (var sy = Math.max(0, y - maxPositionDeviation[1]); sy <= Math.min(height - 1, y + maxPositionDeviation[1]) && !pixelFoundForResult; ++sy)
+ for (var sx = Math.max(0, x - maxPositionDeviation[0]); sx <= Math.min(width - 1, x + maxPositionDeviation[0]) && !pixelFoundForResult; ++sx) {
+ /** @type {Array<number>} */ var deviatedRefPix = reference.getPixelInt(sx, sy, sz);
+ diff = deMath.absDiff(cmpPix, deviatedRefPix);
+ isOk = deMath.boolAll(deMath.lessThanEqual(diff, threshold));
+
+ pixelFoundForResult |= isOk;
+ }
+
+ if (pixelFoundForReference && pixelFoundForResult)
+ errorMask.setPixel([0, 0xff, 0, 0xff], x, y, z);
+ else {
+ errorMask.setPixel([0xff, 0, 0, 0xff], x, y, z);
+ ++numFailingPixels;
+ }
+ }
+ }
+ }
+
+ return numFailingPixels;
+};
+
+ /**
+ * tcuImageCompare.fuzzyCompare
+ * @param {string} imageSetName
+ * @param {string} imageSetDesc
+ * @param {tcuTexture.ConstPixelBufferAccess} reference
+ * @param {tcuTexture.ConstPixelBufferAccess} result
+ * @param {number} threshold
+ * @param {tcuImageCompare.CompareLogMode=} logMode
+ * @return {boolean}
+ */
+tcuImageCompare.fuzzyCompare = function(imageSetName, imageSetDesc, reference, result, threshold, logMode) {
+ /** @type {tcuFuzzyImageCompare.FuzzyCompareParams} */ var params = new tcuFuzzyImageCompare.FuzzyCompareParams(); // Use defaults.
+ /** @type {tcuTexture.TextureLevel} */ var errorMask = new tcuTexture.TextureLevel(
+ new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB,
+ tcuTexture.ChannelType.UNORM_INT8),
+ reference.getWidth(),
+ reference.getHeight()
+ );
+ /** @type {number} */ var difference = tcuFuzzyImageCompare.fuzzyCompare(
+ params,
+ reference,
+ result,
+ tcuTexture.PixelBufferAccess.newFromTextureLevel(errorMask)
+ );
+ /** @type {boolean} */ var isOk = difference <= threshold;
+ /** @type {Array<number>} */ var pixelBias = [0.0, 0.0, 0.0, 0.0];
+ /** @type {Array<number>} */ var pixelScale = [1.0, 1.0, 1.0, 1.0];
+
+ if (!isOk) {
+ debug('Fuzzy image comparison failed: difference = ' + difference + ', threshold = ' + threshold);
+ tcuImageCompare.displayImages(result, reference, errorMask.getAccess());
+ }
+
+ /*
+ if (!isOk || logMode == COMPARE_LOG_EVERYTHING) {
+ // Generate more accurate error mask.
+ params.maxSampleSkip = 0;
+ tcuImageCompare.fuzzyCompare(params, reference, result, errorMask.getAccess());
+
+ if (result.getFormat() != TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT8) && reference.getFormat() != TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT8))
+ computeScaleAndBias(reference, result, pixelScale, pixelBias);
+
+ if (!isOk)
+ log << TestLog::Message << "Image comparison failed: difference = " << difference << ", threshold = " << threshold << TestLog::EndMessage;
+
+ log << TestLog::ImageSet(imageSetName, imageSetDesc)
+ << TestLog::Image("Result", "Result", result, pixelScale, pixelBias)
+ << TestLog::Image("Reference", "Reference", reference, pixelScale, pixelBias)
+ << TestLog::Image("ErrorMask", "Error mask", errorMask)
+ << TestLog::EndImageSet;
+ } else if (logMode == COMPARE_LOG_RESULT) {
+ if (result.getFormat() != TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT8))
+ computePixelScaleBias(result, pixelScale, pixelBias);
+
+ log << TestLog::ImageSet(imageSetName, imageSetDesc)
+ << TestLog::Image("Result", "Result", result, pixelScale, pixelBias)
+ << TestLog::EndImageSet;
+ }
+ */
+ return isOk;
+};
+
+tcuImageCompare.unitTest = function() {
+ var width = 128;
+ var height = 128;
+
+ var weirdLevel = new tcuTexture.TextureLevel(new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.SNORM_INT32), width, height);
+ var access = weirdLevel.getAccess();
+ access.clear([0.1, 0.5, 0, 0]);
+ access.clear([0.11, 0.52, 0, 0], [0, width], [0, height / 2]);
+ access.clear([0.12, 0.52, 0, 0], [0, width], [height / 2, height / 2 + height / 8]);
+ var limits = tcuTextureUtil.computePixelScaleBias(access);
+ debug('Scale: ' + limits.scale);
+ debug('Bias: ' + limits.bias);
+ tcuLogImage.logImage('Weird', 'weird format without scaling', access);
+ tcuLogImage.logImage('Weird', 'weird format', access, limits.scale, limits.bias);
+
+ var srcLevel = new tcuTexture.TextureLevel(new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8), width, height);
+ var dstLevel = new tcuTexture.TextureLevel(new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8), width, height);
+ var src = srcLevel.getAccess();
+ var dst = dstLevel.getAccess();
+
+ src.clear();
+ dst.clear();
+
+ for (var i = 0; i < width - 1; i++) {
+ for (var j = 0; j < height - 1; j++) {
+ src.setPixelInt([i, j, 90, 255], i, j);
+ dst.setPixelInt([i, j, 90, 255], i + 1, j + 1);
+ }
+ }
+
+ debug('Src format: ' + src.getFormat());
+ debug('Destination: ' + dst);
+ debug(src);
+ tcuLogImage.logImage('Source', 'Source image', src);
+
+ if (!tcuImageCompare.fuzzyCompare('compare', 'compare similar images', src, dst, 0.05))
+ throw new Error('Compare should return true');
+
+ src.clear();
+ dst.clear();
+
+ for (var i = 0; i < width - 2; i++) {
+ for (var j = 0; j < height - 2; j++) {
+ src.setPixelInt([i, j, 90, 255], i, j);
+ dst.setPixelInt([i, j, 90, 255], i + 2, j + 2);
+ }
+ }
+
+ if (tcuImageCompare.fuzzyCompare('compare', 'compare different images', src, dst, 0.05))
+ throw new Error('Compare should return false');
+
+ debug('Passed');
+};
+
+tcuImageCompare.unitTest2 = function() {
+ var width = 128;
+ var height = 128;
+ var srcLevel = new tcuTexture.TextureLevel(new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8), width, height);
+ var dstLevel = new tcuTexture.TextureLevel(new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8), width, height);
+ var src = srcLevel.getAccess();
+ var dst = dstLevel.getAccess();
+ var threshold = tcuRGBA.newRGBAComponents(1, 1, 1, 1);
+ debug('Threshold: ' + threshold);
+
+ src.clear();
+ dst.clear();
+
+ for (var i = 0; i < width - 1; i++) {
+ for (var j = 0; j < height - 1; j++) {
+ src.setPixelInt([i, j, 90, 255], i, j);
+ dst.setPixelInt([i, j, 90, 255], i, j);
+ }
+ }
+ if (!tcuImageCompare.bilinearCompare('compare', 'compare similar images', src, dst, threshold))
+ throw new Error('Compare should return true');
+ debug('bilinear compare the same images passed');
+
+ src.clear();
+ dst.clear();
+
+ for (var i = 0; i < width - 1; i++) {
+ for (var j = 0; j < height - 1; j++) {
+ src.setPixelInt([i, j, 90, 255], i, j);
+ dst.setPixelInt([i, j + 1, 90, 255], i, j + 1);
+ }
+ }
+ if (!tcuImageCompare.bilinearCompare('compare', 'compare similar images', src, dst, threshold))
+ throw new Error('Compare should return true');
+ debug('bilinear compare very similar images passed');
+
+ src.clear();
+ dst.clear();
+
+ for (var i = 0; i < width - 2; i++) {
+ for (var j = 0; j < height - 2; j++) {
+ src.setPixelInt([i, j, 90, 255], i, j);
+ // dst.setPixelInt([i, j, 90, 255], i + 2, j + 2);
+ }
+ }
+
+ if (tcuImageCompare.bilinearCompare('compare', 'compare different images', src, dst, threshold))
+ throw new Error('Compare should return false');
+
+ debug('bilinear compare very different images passed');
+};
+
+/**
+ * Bilinear image comparison
+ * On failure error image is generated that shows where the failing pixels
+ * are.
+ * Currently supports only RGBA, UNORM_INT8 formats
+ *
+ * @param {string} imageSetName Name for image set when logging results
+ * @param {string} imageSetDesc Description for image set
+ * @param {tcuTexture.ConstPixelBufferAccess} reference Reference image
+ * @param {tcuTexture.ConstPixelBufferAccess} result Result image
+ * @param {tcuRGBA.RGBA} threshold Maximum local difference
+ * @param {tcuImageCompare.CompareLogMode=} logMode Logging mode
+ * @return {boolean} if comparison passes, false otherwise
+ */
+tcuImageCompare.bilinearCompare = function(imageSetName, imageSetDesc, reference, result, threshold, logMode) {
+ /** @type {tcuTexture.TextureLevel} */
+ var errorMask = new tcuTexture.TextureLevel(
+ new tcuTexture.TextureFormat(
+ tcuTexture.ChannelOrder.RGB,
+ tcuTexture.ChannelType.UNORM_INT8),
+ reference.getWidth(),
+ reference.getHeight());
+
+ /** @type {boolean} */
+ var isOk = tcuBilinearImageCompare.bilinearCompare(
+ reference,
+ result,
+ tcuTexture.PixelBufferAccess.newFromTextureLevel(errorMask),
+ threshold);
+
+ if (!isOk) {
+ debug('Image comparison failed: threshold = ' + threshold);
+ tcuImageCompare.displayImages(result, reference, errorMask.getAccess());
+ }
+
+ // /* @type {Array<number>} */ var pixelBias = [0.0, 0.0, 0.0, 0.0];
+ // /* @type {Array<number>} */ var pixelScale = [1.0, 1.0, 1.0, 1.0];
+ // if (!isOk || logMode == COMPARE_LOG_EVERYTHING)
+ // {
+ // if (result.getFormat() != TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT8) && reference.getFormat() != TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT8))
+ // computeScaleAndBias(reference, result, pixelScale, pixelBias);
+ //
+ // if (!isOk)
+ // log << TestLog::Message << "Image comparison failed, threshold = " << threshold << TestLog::EndMessage;
+ //
+ // log << TestLog::ImageSet(imageSetName, imageSetDesc)
+ // << TestLog::Image("Result", "Result", result, pixelScale, pixelBias)
+ // << TestLog::Image("Reference", "Reference", reference, pixelScale, pixelBias)
+ // << TestLog::Image("ErrorMask", "Error mask", errorMask)
+ // << TestLog::EndImageSet;
+ // }
+ // else if (logMode == COMPARE_LOG_RESULT)
+ // {
+ // if (result.getFormat() != TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT8))
+ // computePixelScaleBias(result, pixelScale, pixelBias);
+ //
+ // log << TestLog::ImageSet(imageSetName, imageSetDesc)
+ // << TestLog::Image("Result", "Result", result, pixelScale, pixelBias)
+ // << TestLog::EndImageSet;
+ // }
+
+ return isOk;
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuInterval.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuInterval.js
new file mode 100644
index 0000000000..23296c1f3f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuInterval.js
@@ -0,0 +1,609 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program Tester Core
+ * ----------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief Interval arithmetic and floating point precisions.
+ *//*--------------------------------------------------------------------*/
+ 'use strict';
+ goog.provide('framework.common.tcuInterval');
+ goog.require('framework.delibs.debase.deMath');
+
+ goog.scope(function() {
+
+ var tcuInterval = framework.common.tcuInterval;
+ var deMath = framework.delibs.debase.deMath;
+
+ /**
+ * @typedef {function(number):number}
+ */
+ tcuInterval.DoubleFunc1;
+
+ /**
+ * @typedef {function(number, number):number}
+ */
+ tcuInterval.DoubleFunc2;
+
+ /**
+ * @typedef {function(number,number,number):number}
+ */
+ tcuInterval.DoubleFunc3;
+
+ /**
+ * @typedef {function(number):tcuInterval.Interval}
+ */
+ tcuInterval.DoubleIntervalFunc1;
+
+ /**
+ * @typedef {function(number,number):tcuInterval.Interval}
+ */
+ tcuInterval.DoubleIntervalFunc2;
+
+ /**
+ * @typedef {function(number,number,number):tcuInterval.Interval}
+ */
+ tcuInterval.DoubleIntervalFunc3;
+
+ /**
+ * @param {function(number): number} func
+ * @param {tcuInterval.Interval} arg0
+ * @return {tcuInterval.Interval}
+ */
+ tcuInterval.applyMonotone1p = function(func, arg0) {
+ /**
+ * @param {number=} x
+ * @param {number=} y
+ * @return {number}
+ */
+ var body = function(x, y) {
+ x = x || 0;
+ return func(x);
+ };
+ return tcuInterval.applyMonotone1(arg0,
+ function(x) { return tcuInterval.setInterval(body, x); });
+ };
+
+ /**
+ * @param {function(number): tcuInterval.Interval} func
+ * @param {tcuInterval.Interval} arg0
+ * @return {tcuInterval.Interval}
+ */
+ tcuInterval.applyMonotone1i = function(func, arg0) {
+ return tcuInterval.withIntervals(func(arg0.lo()), func(arg0.hi()));
+ };
+
+ /**
+ * @param {function(number, number): number} func
+ * @param {tcuInterval.Interval} arg0
+ * @param {tcuInterval.Interval} arg1
+ * @return {tcuInterval.Interval}
+ */
+ tcuInterval.applyMonotone2p = function(func, arg0, arg1) {
+ /**
+ * @param {number=} x
+ * @param {number=} y
+ * @return {number}
+ */
+ var body = function(x, y) {
+ x = x || 0;
+ y = y || 0;
+ return func(x, y);
+ };
+ return tcuInterval.applyMonotone2(arg0, arg1,
+ function(x, y) { return tcuInterval.setInterval(body, x, y); });
+ };
+
+ /**
+ * @param {function(number, number): tcuInterval.Interval} func
+ * @param {tcuInterval.Interval} arg0
+ * @param {tcuInterval.Interval} arg1
+ * @return {tcuInterval.Interval}
+ */
+ tcuInterval.applyMonotone2i = function(func, arg0, arg1) {
+ /** @type {number} */ var lo0 = arg0.lo();
+ /** @type {number} */ var hi0 = arg0.hi();
+ /** @type {number} */ var lo1 = arg1.lo();
+ /** @type {number} */ var hi1 = arg1.hi();
+ var a = tcuInterval.withIntervals(func(lo0, lo1), func(lo0, hi1));
+ var b = tcuInterval.withIntervals(func(hi0, lo1), func(hi0, hi1));
+ return tcuInterval.withIntervals(a, b);
+ };
+
+ /**
+ * @constructor
+ * @param {number=} val
+ */
+ tcuInterval.Interval = function(val) {
+ if (val === undefined) {
+ this.m_hasNaN = false;
+ this.m_lo = Number.POSITIVE_INFINITY;
+ this.m_hi = Number.NEGATIVE_INFINITY;
+ } else {
+ this.m_hasNaN = isNaN(val);
+ this.m_lo = this.m_hasNaN ? Number.POSITIVE_INFINITY : val;
+ this.m_hi = this.m_hasNaN ? Number.NEGATIVE_INFINITY : val;
+ }
+ };
+
+ tcuInterval.Interval.prototype.toString = function() {
+ var str = 'Interval(' + this.m_lo + ', ' + this.m_hi;
+ if (this.m_hasNaN)
+ str += ', hasNaN';
+ str += ')';
+ return str;
+ };
+
+ /**
+ * @param {tcuInterval.Interval} a
+ * @param {tcuInterval.Interval} b
+ * @return {tcuInterval.Interval}
+ */
+ tcuInterval.withIntervals = function(a, b) {
+ /** @type {tcuInterval.Interval} */ var interval = new tcuInterval.Interval();
+ interval.m_hasNaN = (a.m_hasNaN || b.m_hasNaN);
+ interval.m_lo = Math.min(a.m_lo, b.m_lo);
+ interval.m_hi = Math.max(a.m_hi, b.m_hi);
+ return interval;
+ };
+
+ /**
+ * @param {number} a
+ * @param {number} b
+ * @return {tcuInterval.Interval}
+ */
+ tcuInterval.withNumbers = function(a, b) {
+ var x = new tcuInterval.Interval(a);
+ var y = new tcuInterval.Interval(b);
+ return tcuInterval.withIntervals(x, y);
+ };
+
+ /**
+ * @param {boolean} hasNaN_
+ * @param {number} lo_
+ * @param {number} hi_
+ * @return {tcuInterval.Interval}
+ */
+ tcuInterval.withParams = function(hasNaN_, lo_, hi_) {
+ /** @type {tcuInterval.Interval} */ var interval = new tcuInterval.Interval();
+ interval.m_hasNaN = hasNaN_;
+ interval.m_lo = lo_;
+ interval.m_hi = hi_;
+ return interval;
+ };
+
+ /**
+ * @return {number}
+ */
+ tcuInterval.Interval.prototype.length = function() {
+ return this.m_hi - this.m_lo;
+ };
+
+ /**
+ * @return {number}
+ */
+ tcuInterval.Interval.prototype.lo = function() {
+ return this.m_lo;
+ };
+
+ /**
+ * @return {number}
+ */
+ tcuInterval.Interval.prototype.hi = function() {
+ return this.m_hi;
+ };
+
+ /**
+ * @return {boolean}
+ */
+ tcuInterval.Interval.prototype.hasNaN = function() {
+ return this.m_hasNaN;
+ };
+
+ /**
+ * @return {tcuInterval.Interval}
+ */
+ tcuInterval.Interval.prototype.nan = function() {
+ return this.m_hasNaN ? new tcuInterval.Interval(NaN) : new tcuInterval.Interval();
+ };
+
+ /**
+ * @return {boolean}
+ */
+ tcuInterval.Interval.prototype.empty = function() {
+ return this.m_lo > this.m_hi;
+ };
+
+ /**
+ * @return {boolean}
+ */
+ tcuInterval.Interval.prototype.isFinite = function() {
+ return isFinite(this.m_lo) && isFinite(this.m_hi);
+ };
+
+ /**
+ * @return {boolean}
+ */
+ tcuInterval.Interval.prototype.isOrdinary = function() {
+ return !this.hasNaN() && !this.empty() && this.isFinite();
+ };
+
+ /**
+ * @param {tcuInterval.Interval} other
+ * @return {tcuInterval.Interval}
+ */
+ tcuInterval.Interval.prototype.operatorOrBinary = function(other) {
+ /** @type {tcuInterval.Interval} */ var temp = new tcuInterval.Interval();
+ temp.m_hasNaN = this.m_hasNaN || other.m_hasNaN;
+ temp.m_lo = Math.min(this.m_lo, other.m_lo);
+ temp.m_hi = Math.max(this.m_hi, other.m_hi);
+ return temp;
+ };
+
+ /**
+ * @param {tcuInterval.Interval} other
+ */
+ tcuInterval.Interval.prototype.operatorOrAssignBinary = function(other) {
+ /** @type {tcuInterval.Interval} */ var temp = this.operatorOrBinary(other);
+ this.m_hasNaN = temp.m_hasNaN;
+ this.m_lo = temp.m_lo;
+ this.m_hi = temp.m_hi;
+ };
+
+ /**
+ * @param {tcuInterval.Interval} other
+ * @return {tcuInterval.Interval}
+ */
+ tcuInterval.Interval.prototype.operatorAndBinary = function(other) {
+ /** @type {tcuInterval.Interval} */ var temp = new tcuInterval.Interval();
+ temp.m_hasNaN = this.m_hasNaN && other.m_hasNaN;
+ temp.m_lo = Math.max(this.m_lo, other.m_lo);
+ temp.m_hi = Math.min(this.m_hi, other.m_hi);
+ return temp;
+ };
+
+ /**
+ * @param {tcuInterval.Interval} other
+ */
+ tcuInterval.Interval.prototype.operatorAndAssignBinary = function(other) {
+ /** @type {tcuInterval.Interval} */ var temp = this.operatorAndBinary(other);
+ this.m_hasNaN = temp.m_hasNaN;
+ this.m_lo = temp.m_lo;
+ this.m_hi = temp.m_hi;
+ };
+
+ /**
+ * @param {tcuInterval.Interval} other
+ * @return {boolean}
+ */
+ tcuInterval.Interval.prototype.contains = function(other) {
+ return (other.lo() >= this.lo() && other.hi() <= this.hi() &&
+ (!other.hasNaN() || this.hasNaN()));
+ };
+
+ /**
+ * @param {tcuInterval.Interval} other
+ * @return {boolean}
+ */
+ tcuInterval.Interval.prototype.intersects = function(other) {
+ return ((other.hi() >= this.lo() && other.lo() >= this.hi()) ||
+ (other.hasNaN() && this.hasNaN()));
+ };
+
+ /**
+ * @return {tcuInterval.Interval}
+ */
+ tcuInterval.Interval.prototype.operatorNegative = function() {
+ /** @type {tcuInterval.Interval} */ var temp = new tcuInterval.Interval();
+ temp.m_hasNaN = this.m_hasNaN;
+ temp.m_lo = -this.m_hi;
+ temp.m_hi = -this.m_lo;
+ return temp;
+ };
+
+ /**
+ * @param {boolean=} nan
+ * @return {tcuInterval.Interval}
+ */
+ tcuInterval.unbounded = function(nan) {
+ if (nan === undefined)
+ nan = false;
+ return tcuInterval.withParams(nan, Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY);
+ };
+
+ /**
+ * @return {number}
+ */
+ tcuInterval.Interval.prototype.midpoint = function() {
+ return 0.5 * (this.hi() + this.lo()); // returns NaN when not bounded
+ };
+
+ /**
+ * @param {tcuInterval.Interval} other
+ * @return {boolean}
+ */
+ tcuInterval.Interval.prototype.operatorCompare = function(other) {
+ return ((this.m_hasNaN == other.m_hasNaN) &&
+ ((this.empty() && other.empty()) ||
+ (this.m_lo == other.m_lo && this.m_hi == other.m_hi)));
+ };
+
+ /**
+ * @param {tcuInterval.Interval} x
+ * @return {tcuInterval.Interval}
+ */
+ tcuInterval.Interval.operatorPositive = function(x) {
+ return x;
+ };
+
+ /**
+ * @param {tcuInterval.Interval} x
+ * @return {tcuInterval.Interval}
+ */
+ tcuInterval.Interval.exp2 = function(x) {
+ // std::pow
+ return tcuInterval.applyMonotone2p(Math.pow, new tcuInterval.Interval(2), x);
+ };
+
+ /**
+ * @param {tcuInterval.Interval} x
+ * @return {tcuInterval.Interval}
+ */
+ tcuInterval.Interval.exp = function(x) {
+ // std::exp
+ return tcuInterval.applyMonotone1p(Math.exp, x);
+ };
+
+ /**
+ * @param {tcuInterval.Interval} x
+ * @return {tcuInterval.Interval}
+ */
+ tcuInterval.Interval.sign = function(x) {
+ // TODO
+ throw new Error('Unimplemented');
+ };
+
+ /**
+ * @param {tcuInterval.Interval} x
+ * @param {tcuInterval.Interval} y
+ * @return {tcuInterval.Interval}
+ */
+ tcuInterval.Interval.operatorSum = function(x, y) {
+ /** @type {tcuInterval.Interval} */ var ret = new tcuInterval.Interval();
+
+ if (!x.empty() && !y.empty())
+ ret = tcuInterval.setIntervalBounds(function(dummy) {return x.lo() + y.lo();}, function(dummy) {return x.hi() + y.hi();});
+ if (x.hasNaN() || y.hasNaN())
+ ret.operatorOrAssignBinary(new tcuInterval.Interval(NaN));
+
+ return ret;
+ };
+
+ /**
+ * @param {tcuInterval.Interval} x
+ * @param {tcuInterval.Interval} y
+ * @return {tcuInterval.Interval}
+ */
+ tcuInterval.Interval.operatorSub = function(x, y) {
+ /** @type {tcuInterval.Interval} */ var ret = new tcuInterval.Interval();
+
+ /**
+ * @param {number=} x
+ * @param {number=} y
+ * @return {tcuInterval.Interval}
+ */
+ var body = function(x, y) {
+ return new tcuInterval.Interval(x - y);
+ };
+
+ ret = tcuInterval.applyMonotone2(x, y, body);
+ return ret;
+ };
+
+ /**
+ * @param {tcuInterval.Interval} x
+ * @param {tcuInterval.Interval} y
+ * @return {tcuInterval.Interval}
+ */
+ tcuInterval.Interval.operatorMul = function(x, y) {
+ /** @type {tcuInterval.Interval} */ var ret = new tcuInterval.Interval();
+
+ /**
+ * @param {number=} x
+ * @param {number=} y
+ * @return {tcuInterval.Interval}
+ */
+ var body = function(x, y) {
+ return new tcuInterval.Interval(x * y);
+ };
+
+ ret = tcuInterval.applyMonotone2(x, y, body);
+
+ return ret;
+ };
+
+ /**
+ * @param {tcuInterval.Interval} nom
+ * @param {tcuInterval.Interval} den
+ * @return {tcuInterval.Interval}
+ */
+ tcuInterval.Interval.operatorDiv = function(nom, den) {
+ if (den.contains(new tcuInterval.Interval(0))) {
+ // \todo [2014-03-21 lauri] Non-inf endpoint when one den endpoint is
+ // zero and nom doesn't cross zero?
+ return tcuInterval.unbounded();
+ } else {
+ /** @type {tcuInterval.Interval} */ var ret = new tcuInterval.Interval();
+ /**
+ * @param {number=} x
+ * @param {number=} y
+ * @return {tcuInterval.Interval}
+ */
+ var body = function(x, y) {
+ return new tcuInterval.Interval(x / y);
+ };
+
+ ret = tcuInterval.applyMonotone2(nom, den, body);
+
+ return ret;
+ }
+ };
+
+ /**
+ * @param {tcuInterval.Interval} x
+ * @return {tcuInterval.Interval}
+ */
+ tcuInterval.Interval.prototype.abs = function(x) {
+ //std::abs
+ /** @type {tcuInterval.Interval} */ var mono = tcuInterval.applyMonotone1p(Math.abs, x);
+ var zero = new tcuInterval.Interval(0);
+ if (x.contains(zero))
+ return tcuInterval.withIntervals(zero, mono);
+
+ return mono;
+ };
+
+ /**
+ * @param {tcuInterval.Interval} x
+ * @return {tcuInterval.Interval}
+ */
+ tcuInterval.Interval.sqrt = function(x) {
+ return tcuInterval.applyMonotone1p(Math.sqrt, x);
+ };
+
+ /**
+ * @param {tcuInterval.Interval} x
+ * @return {tcuInterval.Interval}
+ */
+ tcuInterval.Interval.inverseSqrt = function(x) {
+ var ret = new tcuInterval.Interval(1);
+ ret = tcuInterval.Interval.operatorDiv(ret, tcuInterval.Interval.sqrt(x));
+ return ret;
+ };
+
+/**
+ * @param {function(number=, number=): number} setLow
+ * @param {function(number=, number=): number} setHigh
+ * @param {number=} arg0
+ * @param {number=} arg1
+ * @return {tcuInterval.Interval}
+ */
+tcuInterval.setIntervalBounds = function(setLow, setHigh, arg0, arg1) {
+ // TODO: No support for rounding modes. Originally, setLow() was rounded down and setHigh() rounded up
+ var lo = new tcuInterval.Interval(setLow(arg0, arg1));
+ var hi = new tcuInterval.Interval(setHigh(arg0, arg1));
+ return lo.operatorOrBinary(hi);
+};
+
+/**
+ * @param {function(number=, number=): number} set
+ * @param {number=} arg0
+ * @param {number=} arg1
+ * @return {tcuInterval.Interval}
+ */
+tcuInterval.setInterval = function(set, arg0, arg1) {
+ return tcuInterval.setIntervalBounds(set, set, arg0, arg1);
+};
+
+/**
+ * @param {tcuInterval.Interval} arg
+ * @param {function(number): tcuInterval.Interval} body
+ * @return {tcuInterval.Interval}
+ */
+tcuInterval.applyMonotone1 = function(arg, body) {
+ var ret = new tcuInterval.Interval();
+
+ if (!arg.empty()) {
+ var lo = body(arg.lo());
+ var hi = body(arg.hi());
+ ret = lo.operatorOrBinary(hi);
+ }
+
+ if (arg.hasNaN()) {
+ ret = ret.operatorOrBinary(new tcuInterval.Interval(NaN));
+ }
+
+ return ret;
+};
+
+/**
+ * TODO: Check if this function works properly
+ * @param {tcuInterval.Interval} arg0
+ * @param {tcuInterval.Interval} arg1
+ * @param {function(number, number): tcuInterval.Interval} body
+ * @return {tcuInterval.Interval}
+ */
+tcuInterval.applyMonotone2 = function(arg0, arg1, body) {
+ var ret = new tcuInterval.Interval();
+
+ if (!arg0.empty() && !arg1.empty()) {
+ var lo0 = body(arg0.lo(), arg1.lo());
+ var lo1 = body(arg0.lo(), arg1.hi());
+ var hi0 = body(arg0.hi(), arg1.lo());
+ var hi1 = body(arg0.hi(), arg1.hi());
+ var a = lo0.operatorOrBinary(hi0);
+ var b = lo1.operatorOrBinary(hi1);
+ ret = a.operatorOrBinary(b);
+ }
+
+ if (arg0.hasNaN() || arg1.hasNaN()) {
+ ret = ret.operatorOrBinary(new tcuInterval.Interval(NaN));
+ }
+
+ return ret;
+};
+
+/**
+ * TODO: Check if this function works properly
+ * @param {tcuInterval.Interval} arg0
+ * @param {tcuInterval.Interval} arg1
+ * @param {tcuInterval.Interval} arg2
+ * @param {function(number, number, number): tcuInterval.Interval} body
+ * @return {tcuInterval.Interval}
+ */
+tcuInterval.applyMonotone3 = function(arg0, arg1, arg2, body) {
+ var ret = new tcuInterval.Interval();
+
+ if (!arg0.empty() && !arg1.empty() && !arg2.empty()) {
+ var i0 = body(arg0.lo(), arg1.lo(), arg2.lo());
+ var i1 = body(arg0.lo(), arg1.lo(), arg2.hi());
+ var i2 = body(arg0.lo(), arg1.hi(), arg2.lo());
+ var i3 = body(arg0.lo(), arg1.hi(), arg2.hi());
+ var i4 = body(arg0.hi(), arg1.lo(), arg2.lo());
+ var i5 = body(arg0.hi(), arg1.lo(), arg2.hi());
+ var i6 = body(arg0.hi(), arg1.hi(), arg2.lo());
+ var i7 = body(arg0.hi(), arg1.hi(), arg2.hi());
+
+ var low = Math.min(i0.lo(), i1.lo(), i2.lo(), i3.lo(), i4.lo(), i5.lo(), i6.lo(), i7.lo());
+ var high = Math.max(i0.hi(), i1.hi(), i2.hi(), i3.hi(), i4.hi(), i5.hi(), i6.hi(), i7.hi());
+ var hasNaN = i0.hasNaN() || i1.hasNaN() || i2.hasNaN() || i3.hasNaN() || i4.hasNaN() || i5.hasNaN() || i6.hasNaN() || i7.hasNaN();
+
+ ret = tcuInterval.withParams(hasNaN, low, high);
+ }
+
+ if (arg0.hasNaN() || arg1.hasNaN() || arg2.hasNaN()) {
+ ret = ret.operatorOrBinary(new tcuInterval.Interval(NaN));
+ }
+
+ return ret;
+};
+
+/** @const */ tcuInterval.POSITIVE_INFINITY = new tcuInterval.Interval(Infinity);
+/** @const */ tcuInterval.NEGATIVE_INFINITY = new tcuInterval.Interval(-Infinity);
+/** @const */ tcuInterval.ZERO = new tcuInterval.Interval(0);
+/** @const */ tcuInterval.NAN = new tcuInterval.Interval(NaN);
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuLogImage.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuLogImage.js
new file mode 100644
index 0000000000..2dabc9060b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuLogImage.js
@@ -0,0 +1,163 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.common.tcuLogImage');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.delibs.debase.deMath');
+
+goog.scope(function() {
+
+var tcuLogImage = framework.common.tcuLogImage;
+var tcuTexture = framework.common.tcuTexture;
+var tcuSurface = framework.common.tcuSurface;
+var deMath = framework.delibs.debase.deMath;
+
+/** @const */ var MAX_IMAGE_SIZE_2D = 4096;
+/**
+ * @param {tcuTexture.ConstPixelBufferAccess} src
+ */
+tcuLogImage.createImage = function(ctx, src) {
+ var w = src.getWidth();
+ var h = src.getHeight();
+ var pixelSize = src.getFormat().getPixelSize();
+ var imgData = ctx.createImageData(w, h);
+ var index = 0;
+ for (var y = 0; y < h; y++) {
+ for (var x = 0; x < w; x++) {
+ var pixel = src.getPixelInt(x, h - y - 1, 0);
+ for (var i = 0; i < pixelSize; i++) {
+ imgData.data[index] = pixel[i];
+ index = index + 1;
+ }
+ if (pixelSize < 4)
+ imgData.data[index++] = 255;
+ }
+ }
+ return imgData;
+};
+
+/**
+ * @param {tcuTexture.ConstPixelBufferAccess} image
+ * @param {string} info
+ */
+tcuLogImage.logImageWithInfo = function(image, info) {
+ var elem = document.getElementById('console');
+ var span = document.createElement('span');
+ tcuLogImage.logImage.counter = tcuLogImage.logImage.counter || 0;
+ var i = tcuLogImage.logImage.counter++;
+ var width = image.getWidth();
+ var height = image.getHeight();
+
+ elem.appendChild(span);
+ span.innerHTML = info + '<br> <canvas id="logImage' + i + '" width=' + width + ' height=' + height + '></canvas><br>';
+
+ var imageCanvas = document.getElementById('logImage' + i);
+ var ctx = imageCanvas.getContext('2d');
+ var data = tcuLogImage.createImage(ctx, image);
+ ctx.putImageData(data, 0, 0);
+};
+
+
+/**
+ * @param {Array<number>=} scale
+ * @param {Array<number>=} bias
+ * @return {string} HTML string to add to log.
+ */
+tcuLogImage.logScaleAndBias = function(scale, bias) {
+ if (scale && bias)
+ return '<br> Image normalized with formula p * (' + scale + ') + (' + bias + ')';
+ else if (scale)
+ return '<br> Image normalized with formula p * (' + scale + ')';
+ else if (bias)
+ return '<br> Image normalized with formula p + (' + bias + ')';
+ return '';
+};
+
+/**
+ * @param {string} name
+ * @param {string} description
+ * @param {tcuTexture.ConstPixelBufferAccess} image
+ * @param {Array<number>=} scale
+ * @param {Array<number>=} bias
+ */
+tcuLogImage.logImageRGB = function(name, description, image, scale, bias) {
+ var elem = document.getElementById('console');
+ var span = document.createElement('span');
+ var info = name + ' ' + description + '<br> ' + image;
+ if (scale || bias)
+ info += tcuLogImage.logScaleAndBias(scale, bias);
+ tcuLogImage.logImageWithInfo(image, info);
+};
+
+/**
+ * @param {string} name
+ * @param {string} description
+ * @param {tcuTexture.ConstPixelBufferAccess} access
+ * @param {Array<number>=} pixelScale
+ * @param {Array<number>=} pixelBias
+ */
+tcuLogImage.logImage = function(name, description, access, pixelScale, pixelBias) {
+ pixelScale = pixelScale || [1, 1, 1, 1];
+ pixelBias = pixelBias || [0, 0, 0, 0];
+ var format = access.getFormat();
+ var width = access.getWidth();
+ var height = access.getHeight();
+ var depth = access.getDepth();
+ var needScaling = pixelBias[0] != 0 || pixelBias[1] != 0 || pixelBias[2] != 0 || pixelBias[3] != 0 ||
+ pixelScale[0] != 1 || pixelScale[1] != 1 || pixelScale[2] != 1 || pixelScale[3] != 1;
+
+ if (depth == 1 && format.type == tcuTexture.ChannelType.UNORM_INT8 &&
+ width <= MAX_IMAGE_SIZE_2D && height <= MAX_IMAGE_SIZE_2D &&
+ (format.order == tcuTexture.ChannelOrder.RGB || tcuTexture.ChannelOrder.RGBA) &&
+ !needScaling)
+ // Fast-path.
+ tcuLogImage.logImageRGB(name, description, access);
+ else if (depth == 1) {
+ var sampler = new tcuTexture.Sampler(tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE,
+ tcuTexture.FilterMode.LINEAR, tcuTexture.FilterMode.NEAREST);
+ var logImageSize = [width, height]; /* TODO: Add scaling */
+ var logImageAccess = new tcuSurface.Surface(width, height).getAccess();
+
+ for (var y = 0; y < logImageAccess.getHeight(); y++) {
+ for (var x = 0; x < logImageAccess.getWidth(); x++) {
+ var yf = (y + 0.5) / logImageAccess.getHeight();
+ var xf = (x + 0.5) / logImageAccess.getWidth();
+ var s = access.sample2D(sampler, sampler.minFilter, xf, yf, 0);
+
+ if (needScaling)
+ s = deMath.add(deMath.multiply(s, pixelScale), pixelBias);
+
+ logImageAccess.setPixel(s, x, y);
+ }
+ }
+ var info = name + ' ' + description + '<br> ' + access;
+ if (needScaling) {
+ info += tcuLogImage.logScaleAndBias(pixelScale, pixelBias);
+ }
+
+ tcuLogImage.logImageWithInfo(logImageAccess, info);
+ } else {
+ /* TODO: Implement */
+ }
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuMatrix.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuMatrix.js
new file mode 100644
index 0000000000..e2959ecdc2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuMatrix.js
@@ -0,0 +1,354 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+'use strict';
+goog.provide('framework.common.tcuMatrix');
+goog.require('framework.delibs.debase.deMath');
+
+goog.scope(function() {
+
+ var tcuMatrix = framework.common.tcuMatrix;
+ var deMath = framework.delibs.debase.deMath;
+
+ var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+ };
+
+ /**
+ * @constructor
+ * @param {number} rows
+ * @param {number} cols
+ * @param {*=} value
+ * Initialize to identity.
+ */
+ tcuMatrix.Matrix = function(rows, cols, value) {
+ value = value == undefined ? 1 : value;
+ this.rows = rows;
+ this.cols = cols;
+ this.matrix = [];
+ for (var i = 0; i < cols; i++)
+ this.matrix[i] = [];
+ for (var row = 0; row < rows; row++)
+ for (var col = 0; col < cols; col++)
+ this.set(row, col, (row == col) ? value : 0);
+ };
+
+ /**
+ * @param {number} rows
+ * @param {number} cols
+ * @param {Array<number>} vector
+ * @return {tcuMatrix.Matrix}
+ */
+ tcuMatrix.matrixFromVector = function(rows, cols, vector) {
+ var matrix = new tcuMatrix.Matrix(rows, cols);
+ for (var row = 0; row < vector.length; row++)
+ for (var col = 0; col < vector.length; col++)
+ matrix.matrix[col][row] = row == col ? vector[row] : 0;
+ return matrix;
+ };
+
+ /**
+ * @param {number} rows
+ * @param {number} cols
+ * @param {Array<number>} src
+ * @return {tcuMatrix.Matrix}
+ */
+ tcuMatrix.matrixFromDataArray = function(rows, cols, src) {
+ var matrix = new tcuMatrix.Matrix(rows, cols);
+ for (var row = 0; row < rows; row++) {
+ for (var col = 0; col < cols; col++) {
+ matrix.matrix[col][row] = src[row * cols + col];
+ }
+ }
+ return matrix;
+ };
+
+ /**
+ * Fill the Matrix with data from array
+ * @param {number} rows
+ * @param {number} cols
+ * @param {Array<number>} array
+ * @return {tcuMatrix.Matrix}
+ */
+ tcuMatrix.matrixFromArray = function(rows, cols, array) {
+ DE_ASSERT(array.length === rows * cols);
+ var matrix = new tcuMatrix.Matrix(rows, cols);
+ for (var row = 0; row < rows; row++)
+ for (var col = 0; col < cols; col++)
+ matrix.matrix[col][row] = array[row * cols + col];
+ return matrix;
+ };
+
+ tcuMatrix.Matrix.prototype.set = function(x, y, value) {
+ this.isRangeValid(x, y);
+ this.matrix[y][x] = value;
+ };
+
+ tcuMatrix.Matrix.prototype.setRow = function(row, values) {
+ if (!deMath.deInBounds32(row, 0, this.rows))
+ throw new Error('Rows out of range');
+ if (values.length > this.cols)
+ throw new Error('Too many columns');
+ for (var col = 0; col < values.length; col++)
+ this.matrix[col][row] = values[col];
+ };
+
+ tcuMatrix.Matrix.prototype.setCol = function(col, values) {
+ if (!deMath.deInBounds32(col, 0, this.cols))
+ throw new Error('Columns out of range');
+ if (values.length > this.rows)
+ throw new Error('Too many rows');
+ for (var row = 0; row < values.length; row++)
+ this.matrix[col][row] = values[row];
+ };
+
+ tcuMatrix.Matrix.prototype.get = function(x, y) {
+ this.isRangeValid(x, y);
+ return this.matrix[y][x];
+ };
+
+ tcuMatrix.Matrix.prototype.getColumn = function(y) {
+ return this.matrix[y];
+ };
+
+ tcuMatrix.Matrix.prototype.isRangeValid = function(x, y) {
+ if (!deMath.deInBounds32(x, 0, this.rows))
+ throw new Error('Rows out of range');
+ if (!deMath.deInBounds32(y, 0, this.cols))
+ throw new Error('Columns out of range');
+ };
+
+ /**
+ * @return {Array<number>}
+ */
+ tcuMatrix.Matrix.prototype.getColumnMajorData = function() {
+ /** @type {Array<number>} */ var a = [];
+ for (var col = 0; col < this.cols; col++)
+ for (var row = 0; row < this.rows; row++)
+ a.push(this.get(row, col));
+ return a;
+ };
+
+ /**
+ * @param {tcuMatrix.Matrix} matrixA
+ * @param {tcuMatrix.Matrix} matrixB
+ * @return {tcuMatrix.Matrix}
+ */
+ tcuMatrix.add = function(matrixA, matrixB) {
+ var res = new tcuMatrix.Matrix(matrixA.rows, matrixB.cols);
+ for (var col = 0; col < matrixA.cols; col++)
+ for (var row = 0; row < matrixA.rows; row++)
+ res.set(row, col, matrixA.get(row, col) + matrixB.get(row, col));
+ return res;
+ };
+
+ /**
+ * @param {tcuMatrix.Matrix} matrixA
+ * @param {tcuMatrix.Matrix} matrixB
+ * @return {tcuMatrix.Matrix}
+ */
+ tcuMatrix.subtract = function(matrixA, matrixB) {
+ var res = new tcuMatrix.Matrix(matrixA.rows, matrixB.cols);
+ for (var col = 0; col < matrixA.cols; col++)
+ for (var row = 0; row < matrixA.rows; row++)
+ res.set(row, col, matrixA.get(row, col) - matrixB.get(row, col));
+ return res;
+ };
+
+ /**
+ * @param {tcuMatrix.Matrix} matrixA
+ * @param {tcuMatrix.Matrix} matrixB
+ * @return {tcuMatrix.Matrix}
+ * Multiplication of two matrices.
+ */
+ tcuMatrix.multiply = function(matrixA, matrixB) {
+ if (matrixA.cols != matrixB.rows)
+ throw new Error('Wrong matrices sizes');
+ var res = new tcuMatrix.Matrix(matrixA.rows, matrixB.cols);
+ for (var row = 0; row < matrixA.rows; row++)
+ for (var col = 0; col < matrixB.cols; col++) {
+ var v = 0;
+ for (var ndx = 0; ndx < matrixA.cols; ndx++)
+ v += matrixA.get(row, ndx) * matrixB.get(ndx, col);
+ res.set(row, col, v);
+ }
+ return res;
+ };
+
+ /**
+ * @param {tcuMatrix.Matrix} matrixA
+ * @param {tcuMatrix.Matrix} matrixB
+ * @return {tcuMatrix.Matrix}
+ */
+ tcuMatrix.divide = function(matrixA, matrixB) {
+ var res = new tcuMatrix.Matrix(matrixA.rows, matrixA.cols);
+ for (var col = 0; col < matrixA.cols; col++)
+ for (var row = 0; row < matrixA.rows; row++)
+ res.set(row, col, matrixA.get(row, col) / matrixB.get(row, col));
+ return res;
+ };
+
+ /**
+ * @param {tcuMatrix.Matrix} mtx
+ * @param {Array<number>} vec
+ * @return {Array<number>}
+ */
+ tcuMatrix.multiplyMatVec = function(mtx, vec) {
+ /** @type {Array<number>} */ var res = [];
+ /** @type {number} */ var value;
+ for (var row = 0; row < mtx.rows; row++) {
+ value = 0;
+ for (var col = 0; col < mtx.cols; col++)
+ value += mtx.get(row, col) * vec[col];
+ res[row] = value;
+ }
+
+ return res;
+ };
+
+ /**
+ * @param {Array<number>} vec
+ * @param {tcuMatrix.Matrix} mtx
+ * @return {Array<number>}
+ */
+ tcuMatrix.multiplyVecMat = function(vec, mtx) {
+ /** @type {Array<number>} */ var res = [];
+ /** @type {number} */ var value;
+ for (var col = 0; col < mtx.cols; col++) {
+ value = 0;
+ for (var row = 0; row < mtx.rows; row++)
+ value += mtx.get(row, col) * vec[row];
+ res[col] = value;
+ }
+
+ return res;
+ };
+
+ tcuMatrix.Matrix.prototype.toString = function() {
+ var str = 'mat' + this.cols;
+ if (this.rows !== this.cols)
+ str += 'x' + this.rows;
+ str += '(';
+ for (var col = 0; col < this.cols; col++) {
+ str += '[';
+ for (var row = 0; row < this.rows; row++) {
+ str += this.matrix[col][row];
+ if (row != this.rows - 1)
+ str += ', ';
+ }
+ str += ']';
+
+ if (col != this.cols - 1)
+ str += ', ';
+ }
+ str += ')';
+ return str;
+ };
+
+ /**
+ * @param {tcuMatrix.Matrix} mtx
+ * @param {number} scalar
+ * @return {tcuMatrix.Matrix}
+ */
+ tcuMatrix.subtractMatScal = function(mtx, scalar) {
+ /** @type {tcuMatrix.Matrix} */ var res = new tcuMatrix.Matrix(mtx.rows, mtx.cols);
+ for (var col = 0; col < mtx.cols; col++)
+ for (var row = 0; row < mtx.rows; row++)
+ res.set(row, col, mtx.get(row, col) - scalar);
+
+ return res;
+ };
+
+ /**
+ * @param {tcuMatrix.Matrix} mtx
+ * @param {number} scalar
+ * @return {tcuMatrix.Matrix}
+ */
+ tcuMatrix.addMatScal = function(mtx, scalar) {
+ /** @type {tcuMatrix.Matrix} */ var res = new tcuMatrix.Matrix(mtx.rows, mtx.cols);
+ for (var col = 0; col < mtx.cols; col++)
+ for (var row = 0; row < mtx.rows; row++)
+ res.set(row, col, mtx.get(row, col) + scalar);
+
+ return res;
+ };
+
+ /**
+ * @param {tcuMatrix.Matrix} mtx
+ * @param {number} scalar
+ * @return {tcuMatrix.Matrix}
+ */
+ tcuMatrix.multiplyMatScal = function(mtx, scalar) {
+ /** @type {tcuMatrix.Matrix} */ var res = new tcuMatrix.Matrix(mtx.rows, mtx.cols);
+ for (var col = 0; col < mtx.cols; col++)
+ for (var row = 0; row < mtx.rows; row++)
+ res.set(row, col, mtx.get(row, col) * scalar);
+
+ return res;
+ };
+
+ /**
+ * @param {tcuMatrix.Matrix} mtx
+ * @param {number} scalar
+ * @return {tcuMatrix.Matrix}
+ */
+ tcuMatrix.divideMatScal = function(mtx, scalar) {
+ /** @type {tcuMatrix.Matrix} */ var res = new tcuMatrix.Matrix(mtx.rows, mtx.cols);
+ for (var col = 0; col < mtx.cols; col++)
+ for (var row = 0; row < mtx.rows; row++)
+ res.set(row, col, mtx.get(row, col) / scalar);
+
+ return res;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuMatrix.Matrix}
+ */
+ tcuMatrix.Mat2 = function() {
+ tcuMatrix.Matrix.call(this, 2, 2);
+ };
+
+ tcuMatrix.Mat2.prototype = Object.create(tcuMatrix.Matrix.prototype);
+ tcuMatrix.Mat2.prototype.constructor = tcuMatrix.Mat2;
+
+ /**
+ * @constructor
+ * @extends {tcuMatrix.Matrix}
+ */
+ tcuMatrix.Mat3 = function() {
+ tcuMatrix.Matrix.call(this, 3, 3);
+ };
+
+ tcuMatrix.Mat3.prototype = Object.create(tcuMatrix.Matrix.prototype);
+ tcuMatrix.Mat3.prototype.constructor = tcuMatrix.Mat3;
+
+ /**
+ * @constructor
+ * @extends {tcuMatrix.Matrix}
+ */
+ tcuMatrix.Mat4 = function() {
+ tcuMatrix.Matrix.call(this, 4, 4);
+ };
+
+ tcuMatrix.Mat4.prototype = Object.create(tcuMatrix.Matrix.prototype);
+ tcuMatrix.Mat4.prototype.constructor = tcuMatrix.Mat4;
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuMatrixUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuMatrixUtil.js
new file mode 100644
index 0000000000..63dcaba871
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuMatrixUtil.js
@@ -0,0 +1,70 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+'use strict';
+goog.provide('framework.common.tcuMatrixUtil');
+goog.require('framework.common.tcuMatrix');
+
+goog.scope(function() {
+
+ var tcuMatrixUtil = framework.common.tcuMatrixUtil;
+ var tcuMatrix = framework.common.tcuMatrix;
+
+ /**
+ * @param {Array<number>} translation
+ * @return {tcuMatrix.Matrix}
+ */
+ tcuMatrixUtil.translationMatrix = function(translation) {
+ var len = translation.length;
+ var res = new tcuMatrix.Matrix(len + 1, len + 1);
+ for (var row = 0; row < len; row++)
+ res.set(row, len, translation[row]);
+ return res;
+ };
+
+ /**
+ * Flatten an array of arrays or matrices
+ * @param {(Array<Array<number>> | Array<tcuMatrix.Matrix>)} a
+ * @return {Array<number>}
+ */
+ tcuMatrixUtil.flatten = function(a) {
+ if (a[0] instanceof Array) {
+ var merged = [];
+ return merged.concat.apply(merged, a);
+ }
+
+ if (a[0] instanceof tcuMatrix.Matrix) {
+ /** @type {tcuMatrix.Matrix} */ var m = a[0];
+ var rows = m.rows;
+ var cols = m.cols;
+ var size = a.length;
+ var result = [];
+ for (var col = 0; col < cols; col++)
+ for (var i = 0; i < size; i++)
+ result.push(a[i].getColumn(col));
+ return [].concat.apply([], result);
+ }
+
+ if (typeof(a[0]) === 'number')
+ return a;
+
+ throw new Error('Invalid input');
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuPixelFormat.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuPixelFormat.js
new file mode 100644
index 0000000000..daf3297a93
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuPixelFormat.js
@@ -0,0 +1,79 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.common.tcuPixelFormat');
+
+goog.scope(function() {
+
+var tcuPixelFormat = framework.common.tcuPixelFormat;
+
+/**
+ * @constructor
+ * @param {number=} r
+ * @param {number=} g
+ * @param {number=} b
+ * @param {number=} a
+ */
+tcuPixelFormat.PixelFormat = function(r, g, b, a) {
+ this.redBits = r || 0;
+ this.greenBits = g || 0;
+ this.blueBits = b || 0;
+ this.alphaBits = a || 0;
+};
+
+/**
+ * @param {WebGL2RenderingContext} context
+ * @return {tcuPixelFormat.PixelFormat}
+ */
+tcuPixelFormat.PixelFormatFromContext = function(context) {
+ var r = /** @type {number} */ (context.getParameter(gl.RED_BITS));
+ var g = /** @type {number} */ (context.getParameter(gl.GREEN_BITS));
+ var b = /** @type {number} */ (context.getParameter(gl.BLUE_BITS));
+ var a = /** @type {number} */ (context.getParameter(gl.ALPHA_BITS));
+
+ return new tcuPixelFormat.PixelFormat(r, g, b, a);
+};
+
+/**
+ * @param {number} r
+ * @param {number} g
+ * @param {number} b
+ * @param {number} a
+ * @return {boolean}
+ */
+tcuPixelFormat.PixelFormat.prototype.equals = function(r, g, b, a) {
+ return this.redBits === r &&
+ this.greenBits === g &&
+ this.blueBits === b &&
+ this.alphaBits === a;
+};
+
+/**
+ * @return {Array<number>}
+ */
+tcuPixelFormat.PixelFormat.prototype.getColorThreshold = function() {
+ return [1 << (8 - this.redBits),
+ 1 << (8 - this.greenBits),
+ 1 << (8 - this.blueBits),
+ (this.alphaBits > 0) ? (1 << (8 - this.alphaBits)) : 0];
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuRGBA.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuRGBA.js
new file mode 100644
index 0000000000..0bab841d1b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuRGBA.js
@@ -0,0 +1,279 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.common.tcuRGBA');
+goog.require('framework.delibs.debase.deMath');
+
+goog.scope(function() {
+
+var tcuRGBA = framework.common.tcuRGBA;
+var deMath = framework.delibs.debase.deMath;
+
+ var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+ };
+
+ /**
+ * class tcuRGBA.RGBA
+ * @constructor
+ * @struct
+ * @param {goog.NumberArray=} value
+ */
+ tcuRGBA.RGBA = function(value) {
+ /** @type {goog.NumberArray} */ this.m_value = value || null;
+
+ };
+
+ /**
+ * @enum
+ * In JS, these are not shift values, but positions in a typed array
+ */
+ tcuRGBA.RGBA.Shift = {
+ RED: 0,
+ GREEN: 1,
+ BLUE: 2,
+ ALPHA: 3
+ };
+
+ /**
+ * @enum
+ * Mask used as flags
+ * Hopefully will not use typed arrays
+ */
+ tcuRGBA.RGBA.Mask = function() {
+ return {
+ RED: false,
+ GREEN: false,
+ BLUE: false,
+ ALPHA: false
+ };
+ };
+
+ /**
+ * Builds an tcuRGBA.RGBA object from color components
+ * @param {number} r
+ * @param {number} g
+ * @param {number} b
+ * @param {number} a
+ * @return {tcuRGBA.RGBA}
+ */
+ tcuRGBA.newRGBAComponents = function(r, g, b, a) {
+ DE_ASSERT(deMath.deInRange32(r, 0, 255));
+ DE_ASSERT(deMath.deInRange32(g, 0, 255));
+ DE_ASSERT(deMath.deInRange32(b, 0, 255));
+ DE_ASSERT(deMath.deInRange32(a, 0, 255));
+
+ return new tcuRGBA.RGBA([r, g, b, a]);
+ };
+
+ /**
+ * Builds an tcuRGBA.RGBA object from a number array
+ * @param {goog.NumberArray} v
+ * @return {tcuRGBA.RGBA}
+ */
+ tcuRGBA.newRGBAFromArray = function(v) {
+ return new tcuRGBA.RGBA(v.slice(0, 4));
+ };
+
+ /**
+ * @param {number} value
+ * @return {tcuRGBA.RGBA}
+ */
+ tcuRGBA.newRGBAFromValue = function(value) {
+ var rgba = new tcuRGBA.RGBA();
+ var array32 = new Uint32Array([value]);
+ rgba.m_value = (new Uint8Array(array32.buffer));
+ return rgba;
+ };
+
+ /**
+ * @param {Array<number>} v
+ * @return {tcuRGBA.RGBA}
+ */
+ tcuRGBA.newRGBAFromVec = function (v) {
+ var r = deMath.clamp(v[0] * 255.0, 0, 255);
+ var g = deMath.clamp(v[1] * 255.0, 0, 255);
+ var b = deMath.clamp(v[2] * 255.0, 0, 255);
+ var a = deMath.clamp(v[3] * 255.0, 0, 255);
+
+ return new tcuRGBA.RGBA([r, g, b, a]);
+ };
+
+ /**
+ * @param {number} v
+ */
+ tcuRGBA.RGBA.prototype.setRed = function(v) { DE_ASSERT(deMath.deInRange32(v, 0, 255)); this.m_value[tcuRGBA.RGBA.Shift.RED] = v; };
+
+ /**
+ * @param {number} v
+ */
+ tcuRGBA.RGBA.prototype.setGreen = function(v) { DE_ASSERT(deMath.deInRange32(v, 0, 255)); this.m_value[tcuRGBA.RGBA.Shift.GREEN] = v; };
+
+ /**
+ * @param {number} v
+ */
+ tcuRGBA.RGBA.prototype.setBlue = function(v) { DE_ASSERT(deMath.deInRange32(v, 0, 255)); this.m_value[tcuRGBA.RGBA.Shift.BLUE] = v; };
+
+ /**
+ * @param {number} v
+ */
+ tcuRGBA.RGBA.prototype.setAlpha = function(v) { DE_ASSERT(deMath.deInRange32(v, 0, 255)); this.m_value[tcuRGBA.RGBA.Shift.ALPHA] = v; };
+
+ /**
+ * @return {number}
+ */
+ tcuRGBA.RGBA.prototype.getRed = function() { return this.m_value[tcuRGBA.RGBA.Shift.RED]; };
+
+ /**
+ * @return {number}
+ */
+ tcuRGBA.RGBA.prototype.getGreen = function() { return this.m_value[tcuRGBA.RGBA.Shift.GREEN]; };
+
+ /**
+ * @return {number}
+ */
+ tcuRGBA.RGBA.prototype.getBlue = function() { return this.m_value[tcuRGBA.RGBA.Shift.BLUE]; };
+
+ /**
+ * @return {number}
+ */
+ tcuRGBA.RGBA.prototype.getAlpha = function() { return this.m_value[tcuRGBA.RGBA.Shift.ALPHA]; };
+
+ /**
+ * @param {tcuRGBA.RGBA} thr
+ * @return {boolean}
+ */
+ tcuRGBA.RGBA.prototype.isBelowThreshold = function(thr) { return (this.getRed() <= thr.getRed()) && (this.getGreen() <= thr.getGreen()) && (this.getBlue() <= thr.getBlue()) && (this.getAlpha() <= thr.getAlpha()); };
+
+ /**
+ * @param {Uint8Array} bytes
+ * @return {tcuRGBA.RGBA}
+ */
+ tcuRGBA.RGBA.fromBytes = function(bytes) { return tcuRGBA.newRGBAFromArray(bytes); };
+
+ /**
+ * @param {Uint8Array} bytes
+ */
+ tcuRGBA.RGBA.prototype.toBytes = function(bytes) { var result = new Uint8Array(this.m_value); bytes[0] = result[0]; bytes[1] = result[1]; bytes[2] = result[2]; bytes[3] = result[3]; };
+
+ /**
+ * @return {Array<number>}
+ */
+ tcuRGBA.RGBA.prototype.toVec = function() {
+ return [
+ this.getRed() / 255.0,
+ this.getGreen() / 255.0,
+ this.getBlue() / 255.0,
+ this.getAlpha() / 255.0
+ ];
+ };
+
+ /**
+ * @return {Array<number>}
+ */
+ tcuRGBA.RGBA.prototype.toIVec = function() {
+ return [
+ this.getRed(),
+ this.getGreen(),
+ this.getBlue(),
+ this.getAlpha()
+ ];
+ };
+
+ /**
+ * @param {tcuRGBA.RGBA} v
+ * @return {boolean}
+ */
+ tcuRGBA.RGBA.prototype.equals = function(v) {
+ return (
+ this.m_value[0] == v.m_value[0] &&
+ this.m_value[1] == v.m_value[1] &&
+ this.m_value[2] == v.m_value[2] &&
+ this.m_value[3] == v.m_value[3]
+ );
+ };
+
+ /**
+ * @param {tcuRGBA.RGBA} a
+ * @param {tcuRGBA.RGBA} b
+ * @param {tcuRGBA.RGBA} threshold
+ * @return {boolean}
+ */
+ tcuRGBA.compareThreshold = function(a, b, threshold) {
+ if (a.equals(b)) return true; // Quick-accept
+ return tcuRGBA.computeAbsDiff(a, b).isBelowThreshold(threshold);
+ };
+
+ /**
+ * @param {tcuRGBA.RGBA} a
+ * @param {tcuRGBA.RGBA} b
+ * @return {tcuRGBA.RGBA}
+ */
+ tcuRGBA.computeAbsDiff = function(a, b) {
+ return tcuRGBA.newRGBAComponents(
+ Math.abs(a.getRed() - b.getRed()),
+ Math.abs(a.getGreen() - b.getGreen()),
+ Math.abs(a.getBlue() - b.getBlue()),
+ Math.abs(a.getAlpha() - b.getAlpha())
+ );
+ };
+
+ /**
+ * @param {tcuRGBA.RGBA} a
+ * @param {number} b
+ * @return {tcuRGBA.RGBA}
+ */
+ tcuRGBA.multiply = function(a, b) {
+ return tcuRGBA.newRGBAComponents(
+ deMath.clamp(a.getRed() * b, 0, 255),
+ deMath.clamp(a.getGreen() * b, 0, 255),
+ deMath.clamp(a.getBlue() * b, 0, 255),
+ deMath.clamp(a.getAlpha() * b, 0, 255));
+ };
+
+ /**
+ * @param {tcuRGBA.RGBA} a
+ * @param {tcuRGBA.RGBA} b
+ * @return {tcuRGBA.RGBA}
+ */
+ tcuRGBA.max = function(a, b) {
+ return tcuRGBA.newRGBAComponents(
+ Math.max(a.getRed(), b.getRed()),
+ Math.max(a.getGreen(), b.getGreen()),
+ Math.max(a.getBlue(), b.getBlue()),
+ Math.max(a.getAlpha(), b.getAlpha())
+ );
+ };
+
+ tcuRGBA.RGBA.prototype.toString = function() {
+ return '[' + this.m_value[0] + ',' + this.m_value[1] + ',' + this.m_value[2] + ',' + this.m_value[3] + ']';
+ };
+
+ // Color constants
+ tcuRGBA.RGBA.red = tcuRGBA.newRGBAComponents(0xFF, 0, 0, 0xFF);
+ tcuRGBA.RGBA.green = tcuRGBA.newRGBAComponents(0, 0xFF, 0, 0xFF);
+ tcuRGBA.RGBA.blue = tcuRGBA.newRGBAComponents(0, 0, 0xFF, 0xFF);
+ tcuRGBA.RGBA.gray = tcuRGBA.newRGBAComponents(0x80, 0x80, 0x80, 0xFF);
+ tcuRGBA.RGBA.white = tcuRGBA.newRGBAComponents(0xFF, 0xFF, 0xFF, 0xFF);
+ tcuRGBA.RGBA.black = tcuRGBA.newRGBAComponents(0, 0, 0, 0xFF);
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuSkipList.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuSkipList.js
new file mode 100644
index 0000000000..286b1956be
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuSkipList.js
@@ -0,0 +1,245 @@
+/*
+Copyright (c) 2019 The Khronos Group Inc.
+Use of this source code is governed by an MIT-style license that can be
+found in the LICENSE.txt file.
+*/
+
+/**
+ * This class defines the individual tests which are skipped because
+ * of graphics driver bugs which simply can not be worked around in
+ * WebGL 2.0 implementations.
+ *
+ * The intent is that this list be kept as small as possible; and that
+ * bugs are filed with the respective GPU vendors for entries in this
+ * list.
+ *
+ * Pass the query argument "runSkippedTests" in the URL in order to
+ * force the skipped tests to be run. So, for example:
+ *
+ * http://localhost:8080/sdk/tests/deqp/functional/gles3/transformfeedback.html?filter=transform_feedback.basic_types.separate.points&runSkippedTests
+ */
+'use strict';
+goog.provide('framework.common.tcuSkipList');
+
+goog.scope(function() {
+
+ var tcuSkipList = framework.common.tcuSkipList;
+
+ var _skipEntries = {};
+ var _wildcardSkipEntries = {};
+ var _reason = "";
+
+ function _setReason(reason) {
+ _reason = reason;
+ }
+
+ function _skip(testName) {
+ if(testName.indexOf("*") >= 0){
+ testName = testName.split("*")[0];
+ _wildcardSkipEntries[testName] = _reason;
+ }else{
+ _skipEntries[testName] = _reason;
+ }
+ }
+
+ var runSkippedTests = false;
+ var queryVars = window.location.search.substring(1).split('&');
+ for (var i = 0; i < queryVars.length; i++) {
+ var value = queryVars[i].split('=');
+ if (decodeURIComponent(value[0]) === 'runSkippedTests') {
+ // Assume that presence of this query arg implies to run
+ // the skipped tests; the value is ignored.
+ runSkippedTests = true;
+ break;
+ }
+ }
+
+ if (!runSkippedTests) {
+ // Example usage:
+ //
+ // _setReason("Bugs in FooVendor 30.03 driver");
+ // _skip("transform_feedback.basic_types.separate.points.lowp_mat2");
+
+ // Please see https://android.googlesource.com/platform/external/deqp/+/7c5323116bb164d64bfecb68e8da1af634317b24
+ _setReason("Native dEQP also fails on these tests and suppresses them");
+ _skip("texture_functions.textureoffset.sampler3d_fixed_fragment");
+ _skip("texture_functions.textureoffset.isampler3d_fragment");
+ _skip("texture_functions.textureoffset.usampler3d_fragment");
+ _skip("texture_functions.textureprojoffset.sampler3d_fixed_fragment");
+ _skip("texture_functions.textureprojoffset.isampler3d_fragment");
+ _skip("texture_functions.textureprojoffset.usampler3d_fragment");
+ // Please see https://android.googlesource.com/platform/external/deqp/+/master/android/cts/master/src/gles3-hw-issues.txt
+ _skip("texture_functions.textureprojlod.isampler3d_vertex");
+ _skip("texture_functions.textureprojlod.usampler3d_vertex");
+ // Please see https://android.googlesource.com/platform/external/deqp/+/master/android/cts/master/src/gles3-test-issues.txt
+ _skip("texture_functions.textureprojlodoffset.usampler3d_vertex");
+ _skip("texture_functions.textureoffset.sampler3d_float_fragment");
+ _skip("texture_functions.textureprojoffset.sampler3d_float_fragment");
+ // Please see https://android.googlesource.com/platform/external/deqp/+/master/android/cts/master/src/gles3-driver-issues.txt
+ _skip("texture_functions.textureprojlodoffset.isampler3d_vertex");
+ _skip("texture_functions.texturegrad.samplercubeshadow*");
+ // Please see https://android.googlesource.com/platform/external/deqp/+/40ff528%5E%21/
+ // and https://bugs.chromium.org/p/angleproject/issues/detail?id=3094
+ _skip("texture_functions.texturelodoffset.sampler3d_float_vertex");
+
+ // https://android.googlesource.com/platform/external/deqp/+/0c1f83aee4709eef7ef2a3edd384f9c192f476fd/android/cts/master/src/gles3-hw-issues.txt#801
+ _setReason("Tricky blit rects can result in imperfect copies on some HW.");
+ _skip("blit.rect.nearest_consistency_mag");
+ _skip("blit.rect.nearest_consistency_mag_reverse_dst_x");
+ _skip("blit.rect.nearest_consistency_mag_reverse_src_dst_x");
+ _skip("blit.rect.nearest_consistency_mag_reverse_src_x");
+ _skip("blit.rect.nearest_consistency_mag_reverse_src_y");
+ _skip("blit.rect.nearest_consistency_min");
+ _skip("blit.rect.nearest_consistency_min_reverse_dst_x");
+ _skip("blit.rect.nearest_consistency_min_reverse_src_dst_x");
+ _skip("blit.rect.nearest_consistency_min_reverse_src_x");
+ _skip("blit.rect.nearest_consistency_out_of_bounds_mag");
+ _skip("blit.rect.nearest_consistency_out_of_bounds_mag_reverse_dst_x");
+ _skip("blit.rect.nearest_consistency_out_of_bounds_mag_reverse_src_dst_x");
+ _skip("blit.rect.nearest_consistency_out_of_bounds_mag_reverse_src_x");
+ _skip("blit.rect.nearest_consistency_out_of_bounds_mag_reverse_src_y");
+ _skip("blit.rect.nearest_consistency_out_of_bounds_min");
+ _skip("blit.rect.nearest_consistency_out_of_bounds_min_reverse_dst_x");
+ _skip("blit.rect.nearest_consistency_out_of_bounds_min_reverse_src_dst_x");
+ _skip("blit.rect.nearest_consistency_out_of_bounds_min_reverse_src_x");
+ _skip("blit.rect.nearest_consistency_out_of_bounds_min_reverse_src_y");
+
+ // https://android.googlesource.com/platform/external/deqp/+/0c1f83aee4709eef7ef2a3edd384f9c192f476fd/android/cts/master/src/gles3-driver-issues.txt#381
+ _setReason("Tricky blit rects can result in imperfect copies on some drivers.");
+ _skip("blit.rect.out_of_bounds_linear");
+ _skip("blit.rect.out_of_bounds_reverse_src_x_linear");
+ _skip("blit.rect.out_of_bounds_reverse_src_y_linear");
+ _skip("blit.rect.out_of_bounds_reverse_dst_x_linear");
+ _skip("blit.rect.out_of_bounds_reverse_dst_y_linear");
+ _skip("blit.rect.out_of_bounds_reverse_src_dst_x_linear");
+ _skip("blit.rect.out_of_bounds_reverse_src_dst_y_linear");
+
+ // https://android.googlesource.com/platform/external/deqp/+/0c1f83aee4709eef7ef2a3edd384f9c192f476fd/android/cts/master/src/gles3-driver-issues.txt#368
+ _skip("blit.rect.nearest_consistency_out_of_bounds_mag_reverse_dst_y");
+ _skip("blit.rect.nearest_consistency_out_of_bounds_mag_reverse_src_dst_y");
+ _skip("blit.rect.nearest_consistency_out_of_bounds_min_reverse_dst_y");
+ _skip("blit.rect.nearest_consistency_out_of_bounds_min_reverse_src_dst_y");
+
+ _setReason("Missing shadow sampler functions in D3D11");
+ // https://github.com/KhronosGroup/WebGL/issues/1870
+ // deqp/functional/gles3/shadertexturefunction/texture.html
+ _skip("texture_functions.texture.sampler2darrayshadow_vertex");
+ // deqp/functional/gles3/shadertexturefunction/texturelod.html
+ _skip("texture_functions.texturelod.sampler2dshadow_vertex");
+ _skip("texture_functions.texturelod.sampler2dshadow_fragment");
+ // deqp/functional/gles3/shadertexturefunction/texturelodoffset.html
+ _skip("texture_functions.texturelodoffset.sampler2dshadow_vertex");
+ _skip("texture_functions.texturelodoffset.sampler2dshadow_fragment");
+ // deqp/functional/gles3/shadertexturefunction/textureprojlod.html
+ _skip("texture_functions.textureprojlod.sampler2dshadow_vertex");
+ _skip("texture_functions.textureprojlod.sampler2dshadow_fragment");
+ // deqp/functional/gles3/shadertexturefunction/textureprojlodoffset.html
+ _skip("texture_functions.textureprojlodoffset.sampler2dshadow_vertex");
+ _skip("texture_functions.textureprojlodoffset.sampler2dshadow_fragment");
+ // deqp/functional/gles3/shadertexturefunction/texturegrad.html
+ _skip("texture_functions.texturegrad.sampler2dshadow_vertex");
+ _skip("texture_functions.texturegrad.sampler2dshadow_fragment");
+ _skip("texture_functions.texturegrad.sampler2darrayshadow_vertex");
+ _skip("texture_functions.texturegrad.sampler2darrayshadow_fragment");
+ // deqp/functional/gles3/shadertexturefunction/texturegradoffset.html
+ _skip("texture_functions.texturegradoffset.sampler2dshadow_vertex");
+ _skip("texture_functions.texturegradoffset.sampler2dshadow_fragment");
+ _skip("texture_functions.texturegradoffset.sampler2darrayshadow_vertex");
+ _skip("texture_functions.texturegradoffset.sampler2darrayshadow_fragment");
+ // deqp/functional/gles3/shadertexturefunction/textureprojgrad.html
+ _skip("texture_functions.textureprojgrad.sampler2dshadow_vertex");
+ _skip("texture_functions.textureprojgrad.sampler2dshadow_fragment");
+ // deqp/functional/gles3/shadertexturefunction/textureprojgradoffset.html
+ _skip("texture_functions.textureprojgradoffset.sampler2dshadow_vertex");
+ _skip("texture_functions.textureprojgradoffset.sampler2dshadow_fragment");
+
+ _setReason("MacOSX drivers share namespaces where they should not");
+ // https://github.com/KhronosGroup/WebGL/issues/1890
+ // deqp/data/gles3/shaders/scoping.html
+ _skip("scoping.valid.local_int_variable_hides_struct_type_vertex");
+ _skip("scoping.valid.local_int_variable_hides_struct_type_fragment");
+ _skip("scoping.valid.local_struct_variable_hides_struct_type_vertex");
+ _skip("scoping.valid.local_struct_variable_hides_struct_type_fragment");
+ _skip("scoping.valid.function_parameter_hides_struct_type_vertex");
+ _skip("scoping.valid.function_parameter_hides_struct_type_fragment");
+
+ _setReason("NVidia Linux drivers does not clamp gl_FragDepth to [0.0, 1.0]");
+ // Standalone Test case:
+ // https://github.com/Kangz/GLDriverBugs/blob/master/frag_depth_clamp_32f_depth/Main.cpp
+ // deqp/functional/gles3/fbodepthbuffer.html
+ _skip("depth.depth_write_clamp.depth_component32f");
+ _skip("depth.depth_write_clamp.depth32f_stencil8");
+ _skip("depth.depth_test_clamp.depth_component32f");
+ _skip("depth.depth_test_clamp.depth32f_stencil8");
+
+ _setReason("NVidia Linux driver bug in nested uniform block location assignment");
+ // crbug.com/621178
+ // deqp/functional/gles3/uniformapi/random.html
+ _skip("uniform_api.random.64");
+
+ _setReason("Mac AMD / Linux AMD / older mesa handles clipping of wide points incorrectly");
+ // crbug.com/642822
+ // deqp/functional/gles3/clipping.html
+ _skip("clipping.wide_points_full_viewport");
+ _skip("clipping.wide_points_partial_viewport");
+
+ _setReason("Some Windows AMD D3D11 drivers have issues with blit and depth/stencil formats.");
+ // crbug.com/638323
+ // deqp/functional/gles3/framebufferblit/depth_stencil.html
+ // Also see conformance2/rendering/blitframebuffer-stencil-only.html for 2.0.1 test.
+ _skip("blit.depth_stencil.depth24_stencil8_scale");
+ _skip("blit.depth_stencil.depth24_stencil8_stencil_only");
+
+ _setReason("Removed from native dEQP mustpass. Not passable on Adreno.");
+ // These tests have been skipped in native dEQP since 2015:
+ // https://android.googlesource.com/platform/external/deqp/+/ea026b329e6bf73f109cda914c90f08d5f7a5b8d
+ // They do not pass on Android/Qualcomm (Google Pixel 1, Pixel 3).
+ // It's not clear if the tests or the hardware are out-of-spec, but there's nothing we can do about it right now.
+ // See also: crbug.com/695679
+ _skip("derivate.dfdy.fbo_float.float_highp");
+ _skip("derivate.dfdy.fbo_float.vec2_highp");
+ _skip("derivate.dfdy.fbo_float.vec3_highp");
+ _skip("derivate.dfdy.fbo_float.vec4_highp");
+ _skip("derivate.dfdy.nicest.fbo_float.float_highp");
+ _skip("derivate.dfdy.nicest.fbo_float.vec2_highp");
+ _skip("derivate.dfdy.nicest.fbo_float.vec3_highp");
+ _skip("derivate.dfdy.nicest.fbo_float.vec4_highp");
+ _skip("derivate.dfdy.fastest.fbo_float.float_highp");
+ _skip("derivate.dfdy.fastest.fbo_float.vec2_highp");
+ _skip("derivate.dfdy.fastest.fbo_float.vec3_highp");
+ _skip("derivate.dfdy.fastest.fbo_float.vec4_highp");
+ } // if (!runSkippedTests)
+
+ /*
+ * Gets the skip status of the given test. Returns an
+ * object with the properties "skip", a boolean, and "reason", a
+ * string.
+ */
+ tcuSkipList.getSkipStatus = function(testName) {
+ var skipEntry = _skipEntries[testName];
+ if (skipEntry === undefined) {
+ return this._getWildcardSkipStatus(testName);
+ } else {
+ return { 'skip': true, 'reason': skipEntry };
+ }
+ }
+
+ /*
+ * Gets the skip status of the given tests like testpath*
+ * object with the properties "skip", a boolean, and "reason", a
+ * string.
+ */
+ tcuSkipList._getWildcardSkipStatus = function(testName) {
+ var skipEntry;
+ for (var key in _wildcardSkipEntries) {
+ if (testName.indexOf(key) >=0 ) {
+ skipEntry = _wildcardSkipEntries[key];
+ if (skipEntry != undefined) {
+ return { 'skip': true, 'reason': skipEntry };
+ }
+ }
+ }
+ return { 'skip': false, 'reason': '' };
+ }
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuStringTemplate.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuStringTemplate.js
new file mode 100644
index 0000000000..d70056733b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuStringTemplate.js
@@ -0,0 +1,42 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.common.tcuStringTemplate');
+
+goog.scope(function() {
+
+var tcuStringTemplate = framework.common.tcuStringTemplate;
+
+tcuStringTemplate.escapeRegExp = function(string) {
+ return string.replace(/([.*+?^=!:$ {}()|\[\]\/\\])/g, '\\$1');
+};
+
+tcuStringTemplate.specialize = function(str, params) {
+ var dst = str;
+ for (var key in params) {
+ var value = params[key];
+ var re = new RegExp(tcuStringTemplate.escapeRegExp('\$\{' + key + '\}'), 'g');
+ dst = dst.replace(re, value);
+ }
+ return dst;
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuSurface.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuSurface.js
new file mode 100644
index 0000000000..47d3634aad
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuSurface.js
@@ -0,0 +1,184 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.common.tcuSurface');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.opengl.gluTextureUtil');
+
+goog.scope(function() {
+
+var tcuSurface = framework.common.tcuSurface;
+var tcuTexture = framework.common.tcuTexture;
+var deMath = framework.delibs.debase.deMath;
+var gluTextureUtil = framework.opengl.gluTextureUtil;
+
+var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+};
+
+/**
+ * \brief RGBA8888 surface
+ *
+ * tcuSurface.Surface provides basic pixel storage functionality. Only single format
+ * (RGBA8888) is supported.
+ *
+ * PixelBufferAccess (see tcuTexture.h) provides much more flexible API
+ * for handling various pixel formats. This is mainly a convinience class.
+ * @constructor
+ * @param {number=} width
+ * @param {number=} height
+ */
+tcuSurface.Surface = function(width, height) {
+ width = width || 0;
+ height = height || 0;
+ this.setSize(width, height);
+};
+
+/**
+ * @param {number} width
+ * @param {number} height
+ */
+tcuSurface.Surface.prototype.setSize = function(width, height) {
+ this.m_width = width;
+ this.m_height = height;
+ if (width * height > 0) {
+ this.m_data = new ArrayBuffer(4 * width * height);
+ this.m_pixels = new Uint8Array(this.m_data);
+ } else {
+ this.m_data = null;
+ this.m_pixels = null;
+ }
+};
+
+/**
+ * @return {number}
+ */
+tcuSurface.Surface.prototype.getWidth = function() { return this.m_width; };
+
+/**
+ * @return {number}
+ */
+tcuSurface.Surface.prototype.getHeight = function() { return this.m_height; };
+
+/**
+ * @param {number} x
+ * @param {number} y
+ * @param {Array<number>} color Vec4 color
+ */
+tcuSurface.Surface.prototype.setPixel = function(x, y, color) {
+ DE_ASSERT(deMath.deInBounds32(x, 0, this.m_width));
+ DE_ASSERT(deMath.deInBounds32(y, 0, this.m_height));
+
+ var offset = 4 * (x + y * this.m_width);
+ for (var i = 0; i < 4; i++)
+ this.m_pixels[offset + i] = color[i];
+};
+
+/**
+ * @param {number} x
+ * @param {number} y
+ * @return {Array<number>}
+ */
+tcuSurface.Surface.prototype.getPixel = function(x, y) {
+ DE_ASSERT(deMath.deInBounds32(x, 0, this.m_width));
+ DE_ASSERT(deMath.deInBounds32(y, 0, this.m_height));
+
+ var color = [];
+ color.length = 4;
+
+ var offset = 4 * (x + y * this.m_width);
+ for (var i = 0; i < 4; i++)
+ color[i] = this.m_pixels[offset + i];
+
+ return color;
+};
+
+/**
+ * @param {number} x
+ * @param {number} y
+ * @return {number}
+ */
+tcuSurface.Surface.prototype.getPixelUintRGB8 = function(x, y) {
+ DE_ASSERT(deMath.deInBounds32(x, 0, this.m_width));
+ DE_ASSERT(deMath.deInBounds32(y, 0, this.m_height));
+
+ var offset = 4 * (x + y * this.m_width);
+ return (this.m_pixels[offset] << 16) +
+ (this.m_pixels[offset + 1] << 8) +
+ this.m_pixels[offset + 2];
+};
+
+/**
+ * Read the viewport contents into this surface
+ * @param {*=} ctx WebGL or ref context
+ * @param {(Array<number>|{x: number, y: number, width: number, height: number})=} view
+ */
+tcuSurface.Surface.prototype.readViewport = function(ctx, view) {
+ ctx = ctx || gl;
+ var v = view || /** @type {Array<number>} */ (ctx.getParameter(gl.VIEWPORT));
+ /** @type {number} */ var x;
+ /** @type {number} */ var y;
+ /** @type {number} */ var width;
+ /** @type {number} */ var height;
+ if (v instanceof Array || ArrayBuffer.isView(v)) {
+ x = v[0];
+ y = v[1];
+ width = v[2];
+ height = v[3];
+ } else {
+ x = v.x;
+ y = v.y;
+ width = v.width;
+ height = v.height;
+ }
+ if (width != this.m_width || height != this.m_height)
+ this.setSize(width, height);
+ ctx.readPixels(x, y, width, height, gl.RGBA, gl.UNSIGNED_BYTE, this.m_pixels);
+};
+
+/**
+ * @return {Uint8Array}
+ */
+tcuSurface.Surface.prototype.getPixels = function() { return this.m_pixels || null; };
+
+/**
+ * @return {tcuTexture.PixelBufferAccess} Pixel Buffer Access object
+ */
+tcuSurface.Surface.prototype.getAccess = function() {
+ return new tcuTexture.PixelBufferAccess({
+ format: new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8),
+ width: this.m_width,
+ height: this.m_height,
+ data: this.m_data
+ });
+
+};
+
+tcuSurface.Surface.prototype.getSubAccess = function(x, y, width, height) {
+ /* TODO: Implement. the deqp getSubAccess() looks broken. It will probably fail if
+ * x != 0 or width != m_width
+ */
+ throw new Error('Unimplemented');
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTestCase.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTestCase.js
new file mode 100644
index 0000000000..ec08eea5ca
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTestCase.js
@@ -0,0 +1,491 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/**
+ * This class allows one to create a hierarchy of tests and iterate over them.
+ * It replaces TestCase and TestCaseGroup classes.
+ */
+'use strict';
+goog.provide('framework.common.tcuTestCase');
+goog.require('framework.common.tcuSkipList');
+
+goog.scope(function() {
+
+ var tcuTestCase = framework.common.tcuTestCase;
+ var tcuSkipList = framework.common.tcuSkipList;
+
+ tcuTestCase.getQueryVal = function(key) {
+ const queryVars = window.location.search.substring(1).split('&');
+ for (let kv of queryVars) {
+ kv = kv.split('=');
+ if (decodeURIComponent(kv[0]) === key)
+ return decodeURIComponent(kv[1]);
+ }
+ return null;
+ };
+
+ tcuTestCase.isQuickMode = () => tcuTestCase.getQueryVal('quick') === '1';
+ tcuTestCase.isQuietMode = () => tcuTestCase.getQueryVal('quiet') === '1';
+
+ /**
+ * Reads the filter parameter from the URL to filter tests.
+ * @return {?string }
+ */
+ tcuTestCase.getFilter = () => tcuTestCase.getQueryVal('filter');
+
+ /**
+ * Indicates the state of an iteration operation.
+ * @enum {number}
+ */
+ tcuTestCase.IterateResult = {
+ STOP: 0,
+ CONTINUE: 1
+ };
+
+ /****************************************
+ * Runner
+ ***************************************/
+
+ /**
+ * A simple state machine.
+ * The purpose of this this object is to break
+ * long tests into small chunks that won't cause a timeout
+ * @constructor
+ */
+ tcuTestCase.Runner = function() {
+ /** @type {tcuTestCase.DeqpTest} */ this.currentTest = null;
+ /** @type {tcuTestCase.DeqpTest} */ this.nextTest = null;
+ /** @type {tcuTestCase.DeqpTest} */ this.testCases = null;
+ /** @type {?string } */ this.filter = tcuTestCase.getFilter();
+ };
+
+ /**
+ * @param {tcuTestCase.DeqpTest} root The root test of the test tree.
+ */
+ tcuTestCase.Runner.prototype.setRoot = function(root) {
+ this.currentTest = null;
+ this.testCases = root;
+ };
+
+ tcuTestCase.Runner.prototype.setRange = function(range) {
+ this.range = range;
+ };
+
+ /**
+ * Searches the test tree for the next executable test
+ * @return {?tcuTestCase.DeqpTest }
+ */
+ tcuTestCase.Runner.prototype.next = function() {
+
+ // First time? Use root test
+ if (!this.currentTest) {
+ this.currentTest = this.testCases;
+
+ // Root is executable? Use it
+ if (this.currentTest.isExecutable())
+ return this.currentTest;
+ }
+
+ // Should we proceed with the next test?
+ if (tcuTestCase.lastResult == tcuTestCase.IterateResult.STOP) {
+ // Look for next executable test
+ do {
+ if (this.range)
+ this.currentTest = this.currentTest.nextInRange(this.filter, this.range);
+ else
+ this.currentTest = this.currentTest.next(this.filter);
+ } while (this.currentTest && !this.currentTest.isExecutable());
+ }
+
+ return this.currentTest;
+ };
+
+ /**
+ * Schedule the callback to be run ASAP
+ * @param {function()} callback Callback to schedule
+ */
+ tcuTestCase.Runner.prototype.runCallback = function(callback) {
+ setTimeout(function() {
+ callback();
+ }.bind(this), 0);
+ };
+
+ /**
+ * Call this function at the end of the test
+ */
+ tcuTestCase.Runner.prototype.terminate = function() {
+ finishTest();
+ if (!tcuTestCase.isQuietMode()) {
+ console.log('finishTest() after (in ms):', performance.now());
+ }
+ };
+
+ tcuTestCase.runner = new tcuTestCase.Runner();
+
+ /** @type {tcuTestCase.IterateResult} */ tcuTestCase.lastResult = tcuTestCase.IterateResult.STOP;
+
+ /***************************************
+ * DeqpTest
+ ***************************************/
+
+ /**
+ * Assigns name, description and specification to test
+ * @constructor
+ * @param {?string} name
+ * @param {?string} description
+ * @param {Object=} spec
+ */
+ tcuTestCase.DeqpTest = function(name, description, spec) {
+ this.name = name || '';
+ this.description = description || '';
+ this.spec = spec;
+ this.currentTestNdx = 0;
+ this.parentTest = null;
+ this.childrenTests = [];
+ this.executeAlways = false;
+ };
+
+ /**
+ * Abstract init function(each particular test will implement it, or not)
+ */
+ tcuTestCase.DeqpTest.prototype.init = function() {};
+
+ /**
+ * Abstract deinit function(each particular test will implement it, or not)
+ */
+ tcuTestCase.DeqpTest.prototype.deinit = function() {};
+
+ /**
+ * Abstract iterate function(each particular test will implement it, or not)
+ * @return {tcuTestCase.IterateResult}
+ */
+ tcuTestCase.DeqpTest.prototype.iterate = function() { return tcuTestCase.IterateResult.STOP; };
+
+ /**
+ * Checks if the test is executable
+ * @return {boolean}
+ */
+ tcuTestCase.DeqpTest.prototype.isExecutable = function() {
+ return this.childrenTests.length == 0 || this.executeAlways;
+ };
+
+ /**
+ * Checks if the test is a leaf
+ */
+ tcuTestCase.DeqpTest.prototype.isLeaf = function() {
+ return this.childrenTests.length == 0;
+ };
+
+ /**
+ * Marks the test as always executable
+ */
+ tcuTestCase.DeqpTest.prototype.makeExecutable = function() {
+ this.executeAlways = true;
+ };
+
+ /**
+ * Adds a child test to the test's children
+ * @param {tcuTestCase.DeqpTest} test
+ */
+ tcuTestCase.DeqpTest.prototype.addChild = function(test) {
+ test.parentTest = this;
+ this.childrenTests.push(test);
+ };
+
+ /**
+ * Sets the whole children tests array
+ * @param {Array<tcuTestCase.DeqpTest>} tests
+ */
+ tcuTestCase.DeqpTest.prototype.setChildren = function(tests) {
+ for (var test in tests)
+ tests[test].parentTest = this;
+ this.childrenTests = tests;
+ };
+
+ /**
+ * Returns the next test in the hierarchy of tests
+ *
+ * @param {?string } pattern Optional pattern to search for
+ * @return {tcuTestCase.DeqpTest}
+ */
+ tcuTestCase.DeqpTest.prototype.next = function(pattern) {
+ return this._nextHonoringSkipList(pattern);
+ };
+
+ /**
+ * Returns the next test in the hierarchy of tests, honoring the
+ * skip list, and reporting skipped tests.
+ *
+ * @param {?string } pattern Optional pattern to search for
+ * @return {tcuTestCase.DeqpTest}
+ */
+ tcuTestCase.DeqpTest.prototype._nextHonoringSkipList = function(pattern) {
+ var tryAgain = false;
+ var test = null;
+ do {
+ tryAgain = false;
+ test = this._nextIgnoringSkipList(pattern);
+ if (test != null) {
+ // See whether the skip list vetoes the execution of
+ // this test.
+ var fullTestName = test.fullName();
+ var skipDisposition = tcuSkipList.getSkipStatus(fullTestName);
+ if (skipDisposition.skip) {
+ tryAgain = true;
+ setCurrentTestName(fullTestName);
+ checkMessage(false, 'Skipping test due to tcuSkipList: ' + fullTestName);
+ }
+ }
+ } while (tryAgain);
+ return test;
+ };
+
+
+ /**
+ * Returns the next test in the hierarchy of tests, ignoring the
+ * skip list.
+ *
+ * @param {?string } pattern Optional pattern to search for
+ * @return {tcuTestCase.DeqpTest}
+ */
+ tcuTestCase.DeqpTest.prototype._nextIgnoringSkipList = function(pattern) {
+ if (pattern)
+ return this._findIgnoringSkipList(pattern);
+
+ var test = null;
+
+ //Look for the next child
+ if (this.currentTestNdx < this.childrenTests.length) {
+ test = this.childrenTests[this.currentTestNdx];
+ this.currentTestNdx++;
+ }
+
+ // If no more children, get the next brother
+ if (test == null && this.parentTest != null) {
+ test = this.parentTest._nextIgnoringSkipList(null);
+ }
+
+ return test;
+ };
+
+ /**
+ * Returns the next test in the hierarchy of tests
+ * whose 1st level is in the given range
+ *
+ * @param {?string } pattern Optional pattern to search for
+ * @param {Array<number>} range
+ * @return {tcuTestCase.DeqpTest}
+ */
+ tcuTestCase.DeqpTest.prototype.nextInRange = function(pattern, range) {
+ while (true) {
+ var test = this._nextHonoringSkipList(pattern);
+ if (!test)
+ return null;
+ var topLevelId = tcuTestCase.runner.testCases.currentTestNdx - 1;
+ if (topLevelId >= range[0] && topLevelId < range[1])
+ return test;
+ }
+ };
+
+ /**
+ * Returns the full name of the test
+ *
+ * @return {string} Full test name.
+ */
+ tcuTestCase.DeqpTest.prototype.fullName = function() {
+ if (this.parentTest) {
+ var parentName = this.parentTest.fullName();
+ if (parentName)
+ return parentName + '.' + this.name;
+ }
+ return this.name;
+ };
+
+ /**
+ * Returns the description of the test
+ *
+ * @return {string} Test description.
+ */
+ tcuTestCase.DeqpTest.prototype.getDescription = function() {
+ return this.description;
+ };
+
+ /**
+ * Find a test with a matching name. Fast-forwards to a test whose
+ * full name matches the given pattern.
+ *
+ * @param {string} pattern Regular expression to search for
+ * @return {?tcuTestCase.DeqpTest } Found test or null.
+ */
+ tcuTestCase.DeqpTest.prototype.find = function(pattern) {
+ return this._findHonoringSkipList(pattern);
+ };
+
+ /**
+ * Find a test with a matching name. Fast-forwards to a test whose
+ * full name matches the given pattern, honoring the skip list, and
+ * reporting skipped tests.
+ *
+ * @param {string} pattern Regular expression to search for
+ * @return {?tcuTestCase.DeqpTest } Found test or null.
+ */
+ tcuTestCase.DeqpTest.prototype._findHonoringSkipList = function(pattern) {
+ var tryAgain = false;
+ var test = null;
+ do {
+ tryAgain = false;
+ test = this._findIgnoringSkipList(pattern);
+ if (test != null) {
+ // See whether the skip list vetoes the execution of
+ // this test.
+ var fullTestName = test.fullName();
+ var skipDisposition = tcuSkipList.getSkipStatus(fullTestName);
+ if (skipDisposition.skip) {
+ tryAgain = true;
+ checkMessage(false, 'Skipping test due to tcuSkipList: ' + fullTestName);
+ }
+ }
+ } while (tryAgain);
+ return test;
+ };
+
+ /**
+ * Find a test with a matching name. Fast-forwards to a test whose
+ * full name matches the given pattern.
+ *
+ * @param {string} pattern Regular expression to search for
+ * @return {?tcuTestCase.DeqpTest } Found test or null.
+ */
+ tcuTestCase.DeqpTest.prototype._findIgnoringSkipList = function(pattern) {
+ var test = this;
+ while (true) {
+ test = test._nextIgnoringSkipList(null);
+ if (!test)
+ break;
+ if (test.fullName().match(pattern) || test.executeAlways)
+ break;
+ }
+ return test;
+ };
+
+ /**
+ * Reset the iterator.
+ */
+ tcuTestCase.DeqpTest.prototype.reset = function() {
+ this.currentTestNdx = 0;
+
+ for (var i = 0; i < this.childrenTests.length; i++)
+ this.childrenTests[i].reset();
+ };
+
+ /**
+ * Defines a new test
+ *
+ * @param {?string} name Short test name
+ * @param {?string} description Description of the test
+ * @param {Object=} spec Test specification
+ *
+ * @return {tcuTestCase.DeqpTest} The new test
+ */
+ tcuTestCase.newTest = function(name, description, spec) {
+ var test = new tcuTestCase.DeqpTest(name, description, spec);
+
+ return test;
+ };
+
+ /**
+ * Defines a new executable test so it gets run even if it's not a leaf
+ *
+ * @param {string} name Short test name
+ * @param {string} description Description of the test
+ * @param {Object=} spec Test specification
+ *
+ * @return {tcuTestCase.DeqpTest} The new test
+ */
+ tcuTestCase.newExecutableTest = function(name, description, spec) {
+ var test = tcuTestCase.newTest(name, description, spec);
+ test.makeExecutable();
+
+ return test;
+ };
+
+ /**
+ * Run through the test cases giving time to system operation.
+ */
+ tcuTestCase.runTestCases = function() {
+ var state = tcuTestCase.runner;
+
+ if (state.next()) {
+ try {
+ // If proceeding with the next test, prepare it.
+ var fullTestName = state.currentTest.fullName();
+ var inited = true;
+ if (tcuTestCase.lastResult == tcuTestCase.IterateResult.STOP) {
+ // Update current test name
+ setCurrentTestName(fullTestName);
+ bufferedLogToConsole('Init testcase: ' + fullTestName); //Show also in console so we can see which test crashed the browser's tab
+
+ // Initialize particular test
+ inited = state.currentTest.init();
+ inited = inited === undefined ? true : inited;
+
+ //If it's a leaf test, notify of it's execution.
+ if (state.currentTest.isLeaf() && inited)
+ debug('<hr/><br/>Start testcase: ' + fullTestName);
+ }
+
+ if (inited) {
+ // Run the test, save the result.
+ tcuTestCase.lastResult = state.currentTest.iterate();
+ } else {
+ // Skip uninitialized test.
+ tcuTestCase.lastResult = tcuTestCase.IterateResult.STOP;
+ }
+
+ // Cleanup
+ if (tcuTestCase.lastResult == tcuTestCase.IterateResult.STOP)
+ state.currentTest.deinit();
+ }
+ catch (err) {
+ // If the exception was not thrown by a test check, log it, but don't throw it again
+ if (!(err instanceof TestFailedException)) {
+ //Stop execution of current test.
+ tcuTestCase.lastResult = tcuTestCase.IterateResult.STOP;
+ try {
+ // Cleanup
+ if (tcuTestCase.lastResult == tcuTestCase.IterateResult.STOP)
+ state.currentTest.deinit();
+ } catch (cerr) {
+ bufferedLogToConsole('Error while cleaning up test: ' + cerr);
+ }
+ var msg = err;
+ if (err.message)
+ msg = err.message;
+ testFailedOptions(msg, false);
+ }
+ bufferedLogToConsole(err);
+ }
+
+ tcuTestCase.runner.runCallback(tcuTestCase.runTestCases);
+ } else
+ tcuTestCase.runner.terminate();
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexCompareVerifier.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexCompareVerifier.js
new file mode 100644
index 0000000000..254963ae66
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexCompareVerifier.js
@@ -0,0 +1,1356 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.common.tcuTexCompareVerifier');
+goog.require('framework.common.tcuTexVerifierUtil');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.delibs.debase.deMath');
+
+goog.scope(function() {
+
+var tcuTexCompareVerifier = framework.common.tcuTexCompareVerifier;
+var tcuTexture = framework.common.tcuTexture;
+var deMath = framework.delibs.debase.deMath;
+var tcuTextureUtil = framework.common.tcuTextureUtil;
+var tcuTexVerifierUtil = framework.common.tcuTexVerifierUtil;
+
+/**
+ * \brief Texture compare (shadow) lookup precision parameters.
+ * @constructor
+ * @struct
+ * @param {Array<number>=} coordBits
+ * @param {Array<number>=} uvwBits
+ * @param {number=} pcfBits
+ * @param {number=} referenceBits
+ * @param {number=} resultBits
+ */
+tcuTexCompareVerifier.TexComparePrecision = function(coordBits, uvwBits, pcfBits, referenceBits, resultBits) {
+ this.coordBits = coordBits === undefined ? [22, 22, 22] : coordBits;
+ this.uvwBits = uvwBits === undefined ? [22, 22, 22] : uvwBits;
+ this.pcfBits = pcfBits === undefined ? 16 : pcfBits;
+ this.referenceBits = referenceBits === undefined ? 16 : referenceBits;
+ this.resultBits = resultBits === undefined ? 16 : resultBits;
+};
+
+/**
+ * @constructor
+ * @struct
+ */
+tcuTexCompareVerifier.CmpResultSet = function() {
+ this.isTrue = false;
+ this.isFalse = false;
+};
+
+/**
+ * @param {tcuTexture.CompareMode} compareMode
+ * @param {number} cmpValue_
+ * @param {number} cmpReference_
+ * @param {number} referenceBits
+ * @param {boolean} isFixedPoint
+ * @return {tcuTexCompareVerifier.CmpResultSet}
+ */
+tcuTexCompareVerifier.execCompare = function(compareMode,
+ cmpValue_,
+ cmpReference_,
+ referenceBits,
+ isFixedPoint) {
+ var clampValues = isFixedPoint; // if comparing against a floating point texture, ref (and value) is not clamped
+ var cmpValue = (clampValues) ? (deMath.clamp(cmpValue_, 0, 1)) : (cmpValue_);
+ var cmpReference = (clampValues) ? (deMath.clamp(cmpReference_, 0, 1)) : (cmpReference_);
+ var err = tcuTexVerifierUtil.computeFixedPointError(referenceBits);
+ var res = new tcuTexCompareVerifier.CmpResultSet();
+
+ switch (compareMode) {
+ case tcuTexture.CompareMode.COMPAREMODE_LESS:
+ res.isTrue = cmpReference - err < cmpValue;
+ res.isFalse = cmpReference + err >= cmpValue;
+ break;
+
+ case tcuTexture.CompareMode.COMPAREMODE_LESS_OR_EQUAL:
+ res.isTrue = cmpReference - err <= cmpValue;
+ res.isFalse = cmpReference + err > cmpValue;
+ break;
+
+ case tcuTexture.CompareMode.COMPAREMODE_GREATER:
+ res.isTrue = cmpReference + err > cmpValue;
+ res.isFalse = cmpReference - err <= cmpValue;
+ break;
+
+ case tcuTexture.CompareMode.COMPAREMODE_GREATER_OR_EQUAL:
+ res.isTrue = cmpReference + err >= cmpValue;
+ res.isFalse = cmpReference - err < cmpValue;
+ break;
+
+ case tcuTexture.CompareMode.COMPAREMODE_EQUAL:
+ res.isTrue = deMath.deInRange32(cmpValue, cmpReference - err, cmpReference + err);
+ res.isFalse = err != 0 || cmpValue != cmpReference;
+ break;
+
+ case tcuTexture.CompareMode.COMPAREMODE_NOT_EQUAL:
+ res.isTrue = err != 0 || cmpValue != cmpReference;
+ res.isFalse = deMath.deInRange32(cmpValue, cmpReference - err, cmpReference + err);
+ break;
+
+ case tcuTexture.CompareMode.COMPAREMODE_ALWAYS:
+ res.isTrue = true;
+ break;
+
+ case tcuTexture.CompareMode.COMPAREMODE_NEVER:
+ res.isFalse = true;
+ break;
+
+ default:
+ throw new Error('Invalid compare mode:' + compareMode);
+ }
+
+ assertMsgOptions(res.isTrue || res.isFalse, 'Both tests failed!', false, true);
+ return res;
+};
+
+/**
+ * @param {tcuTexture.TextureFormat} format
+ * @return {boolean}
+ */
+tcuTexCompareVerifier.isFixedPointDepthTextureFormat = function(format) {
+ var channelClass = tcuTexture.getTextureChannelClass(format.type);
+
+ if (format.order == tcuTexture.ChannelOrder.D) {
+ // depth internal formats cannot be non-normalized integers
+ return channelClass != tcuTexture.TextureChannelClass.FLOATING_POINT;
+ } else if (format.order == tcuTexture.ChannelOrder.DS) {
+ // combined formats have no single channel class, detect format manually
+ switch (format.type) {
+ case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV: return false;
+ case tcuTexture.ChannelType.UNSIGNED_INT_24_8: return true;
+
+ default:
+ throw new Error('Invalid texture format: ' + format);
+ }
+ }
+
+ return false;
+};
+
+/**
+ * @param {tcuTexture.CompareMode} compareMode
+ * @param {tcuTexCompareVerifier.TexComparePrecision} prec
+ * @param {Array<number>} depths
+ * @param {Array<number>} fBounds
+ * @param {number} cmpReference
+ * @param {number} result
+ * @param {boolean} isFixedPointDepth
+ * @return {boolean}
+ */
+tcuTexCompareVerifier.isLinearCompareValid = function(compareMode, prec, depths, fBounds, cmpReference, result, isFixedPointDepth) {
+ assertMsgOptions(fBounds[0] >= 0 && fBounds[0] <= fBounds[1] && fBounds[1] <= 1, 'Invalid fBounds', false, true);
+
+ var d0 = depths[0];
+ var d1 = depths[1];
+
+ var cmp0 = tcuTexCompareVerifier.execCompare(compareMode, d0, cmpReference, prec.referenceBits, isFixedPointDepth);
+ var cmp1 = tcuTexCompareVerifier.execCompare(compareMode, d1, cmpReference, prec.referenceBits, isFixedPointDepth);
+ var cmp = [cmp0, cmp1];
+
+ var isTrue = getMask(cmp, function(x) {return x.isTrue;});
+ var isFalse = getMask(cmp, function(x) {return x.isFalse;});
+
+ var f0 = fBounds[0];
+ var f1 = fBounds[1];
+
+ var pcfErr = tcuTexVerifierUtil.computeFixedPointError(prec.pcfBits);
+ var resErr = tcuTexVerifierUtil.computeFixedPointError(prec.resultBits);
+ var totalErr = pcfErr + resErr;
+
+ for (var comb = 0; comb < 4; comb++) {
+ if (((comb & isTrue) | (~comb & isFalse )) != 3)
+ continue;
+
+ var cmp0True = ((comb >> 0) & 1) != 0;
+ var cmp1True = ((comb >> 1) & 1) != 0;
+
+ var ref0 = cmp0True ? 1 : 0;
+ var ref1 = cmp1True ? 1 : 0;
+
+ var v0 = ref0 * (1 - f0) + ref1 * f0;
+ var v1 = ref0 * (1 - f1) + ref1 * f1;
+ var minV = Math.min(v0, v1);
+ var maxV = Math.max(v0, v1);
+ var minR = minV - totalErr;
+ var maxR = maxV + totalErr;
+
+ if (deMath.deInRange32(result, minR, maxR))
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {number} val
+ * @param {number} offset
+ * @return {Array<boolean>}
+ */
+tcuTexCompareVerifier.extractBVec4 = function(val, offset) {
+ return [
+ ((val >> (offset + 0)) & 1) != 0,
+ ((val >> (offset + 1)) & 1) != 0,
+ ((val >> (offset + 2)) & 1) != 0,
+ ((val >> (offset + 3)) & 1) != 0];
+};
+
+/**
+ * Values are in order (0,0), (1,0), (0,1), (1,1)
+ * @param {Array<number>} values
+ * @param {number} x
+ * @param {number} y
+ * @return {number}
+ */
+tcuTexCompareVerifier.bilinearInterpolate = function(values, x, y) {
+ var v00 = values[0];
+ var v10 = values[1];
+ var v01 = values[2];
+ var v11 = values[3];
+ var res = v00 * (1 - x) * (1 - y) + v10 * x * (1 - y) + v01 * (1 - x) * y + v11 * x * y;
+ return res;
+};
+
+/**
+ * @param {tcuTexture.CompareMode} compareMode
+ * @param {tcuTexCompareVerifier.TexComparePrecision} prec
+ * @param {Array<number>} depths vec4
+ * @param {number} cmpReference
+ * @param {number} result
+ * @param {boolean} isFixedPointDepth
+ * @return {boolean}
+ */
+tcuTexCompareVerifier.isBilinearAnyCompareValid = function(compareMode,
+ prec,
+ depths,
+ cmpReference,
+ result,
+ isFixedPointDepth) {
+ assertMsgOptions(prec.pcfBits === 0, 'PCF bits must be 0', false, true);
+
+ var d0 = depths[0];
+ var d1 = depths[1];
+ var d2 = depths[2];
+ var d3 = depths[3];
+
+ var cmp0 = tcuTexCompareVerifier.execCompare(compareMode, d0, cmpReference, prec.referenceBits, isFixedPointDepth);
+ var cmp1 = tcuTexCompareVerifier.execCompare(compareMode, d1, cmpReference, prec.referenceBits, isFixedPointDepth);
+ var cmp2 = tcuTexCompareVerifier.execCompare(compareMode, d2, cmpReference, prec.referenceBits, isFixedPointDepth);
+ var cmp3 = tcuTexCompareVerifier.execCompare(compareMode, d3, cmpReference, prec.referenceBits, isFixedPointDepth);
+
+ var canBeTrue = cmp0.isTrue || cmp1.isTrue || cmp2.isTrue || cmp3.isTrue;
+ var canBeFalse = cmp0.isFalse || cmp1.isFalse || cmp2.isFalse || cmp3.isFalse;
+
+ var resErr = tcuTexVerifierUtil.computeFixedPointError(prec.resultBits);
+
+ var minBound = canBeFalse ? 0 : 1;
+ var maxBound = canBeTrue ? 1 : 0;
+
+ return deMath.deInRange32(result, minBound - resErr, maxBound + resErr);
+};
+
+/**
+ * @param {Array<tcuTexCompareVerifier.CmpResultSet>} arr
+ * @param {function(tcuTexCompareVerifier.CmpResultSet): boolean} getValue
+ * @return {number}
+ */
+var getMask = function(arr, getValue) {
+ var mask = 0;
+ for (var i = 0; i < arr.length; i++) {
+ var val = getValue(arr[i]);
+ if (val)
+ mask |= 1 << i;
+ }
+ return mask;
+};
+
+/**
+ * @param {tcuTexture.CompareMode} compareMode
+ * @param {tcuTexCompareVerifier.TexComparePrecision} prec
+ * @param {Array<number>} depths vec4
+ * @param {Array<number>} xBounds vec2
+ * @param {Array<number>} yBounds vec2
+ * @param {number} cmpReference
+ * @param {number} result
+ * @param {boolean} isFixedPointDepth
+ * @return {boolean}
+ */
+tcuTexCompareVerifier.isBilinearPCFCompareValid = function(compareMode,
+ prec,
+ depths,
+ xBounds,
+ yBounds,
+ cmpReference,
+ result,
+ isFixedPointDepth) {
+ assertMsgOptions(0.0 <= xBounds[0] && xBounds[0] <= xBounds[1] && xBounds[1] <= 1.0, 'x coordinate out of bounds', false, true);
+ assertMsgOptions(0.0 <= yBounds[0] && yBounds[0] <= yBounds[1] && yBounds[1] <= 1.0, 'y coordinate out of bounds', false, true);
+ assertMsgOptions(prec.pcfBits > 0, 'PCF bits must be > 0', false, true);
+
+ var d0 = depths[0];
+ var d1 = depths[1];
+ var d2 = depths[2];
+ var d3 = depths[3];
+
+ /** @type {Array<tcuTexCompareVerifier.CmpResultSet>} */ var cmp = [];
+ cmp[0] = tcuTexCompareVerifier.execCompare(compareMode, d0, cmpReference, prec.referenceBits, isFixedPointDepth);
+ cmp[1] = tcuTexCompareVerifier.execCompare(compareMode, d1, cmpReference, prec.referenceBits, isFixedPointDepth);
+ cmp[2] = tcuTexCompareVerifier.execCompare(compareMode, d2, cmpReference, prec.referenceBits, isFixedPointDepth);
+ cmp[3] = tcuTexCompareVerifier.execCompare(compareMode, d3, cmpReference, prec.referenceBits, isFixedPointDepth);
+
+ var isTrue = getMask(cmp, function(x) {return x.isTrue});
+ var isFalse = getMask(cmp, function(x) {return x.isFalse});
+
+ // Interpolation parameters
+ var x0 = xBounds[0];
+ var x1 = xBounds[1];
+ var y0 = yBounds[0];
+ var y1 = yBounds[1];
+
+ // Error parameters
+ var pcfErr = tcuTexVerifierUtil.computeFixedPointError(prec.pcfBits);
+ var resErr = tcuTexVerifierUtil.computeFixedPointError(prec.resultBits);
+ var totalErr = pcfErr + resErr;
+
+ // Iterate over all valid combinations.
+ // \note It is not enough to compute minmax over all possible result sets, as ranges may
+ // not necessarily overlap, i.e. there are gaps between valid ranges.
+ for (var comb = 0; comb < (1 << 4); comb++) {
+ // Filter out invalid combinations:
+ // 1) True bit is set in comb but not in isTrue => sample can not be true
+ // 2) True bit is NOT set in comb and not in isFalse => sample can not be false
+ if (((comb & isTrue) | (~comb & isFalse)) != (1 << 4) - 1)
+ continue;
+
+ var cmpTrue = tcuTexCompareVerifier.extractBVec4(comb, 0);
+ var refVal = tcuTextureUtil.select([1, 1, 1, 1], [0, 0, 0, 0], cmpTrue);
+
+ var v0 = tcuTexCompareVerifier.bilinearInterpolate(refVal, x0, y0);
+ var v1 = tcuTexCompareVerifier.bilinearInterpolate(refVal, x1, y0);
+ var v2 = tcuTexCompareVerifier.bilinearInterpolate(refVal, x0, y1);
+ var v3 = tcuTexCompareVerifier.bilinearInterpolate(refVal, x1, y1);
+ var minV = Math.min(v0, v1, v2, v3);
+ var maxV = Math.max(v0, v1, v2, v3);
+ var minR = minV - totalErr;
+ var maxR = maxV + totalErr;
+
+ if (deMath.deInRange32(result, minR, maxR))
+ return true;
+ }
+
+ return false;
+};
+
+/**
+ * @param {tcuTexture.CompareMode} compareMode
+ * @param {tcuTexCompareVerifier.TexComparePrecision} prec
+ * @param {Array<number>} depths vec4
+ * @param {Array<number>} xBounds vec2
+ * @param {Array<number>} yBounds vec2
+ * @param {number} cmpReference
+ * @param {number} result
+ * @param {boolean} isFixedPointDepth
+ * @return {boolean}
+ */
+tcuTexCompareVerifier.isBilinearCompareValid = function(compareMode,
+ prec,
+ depths,
+ xBounds,
+ yBounds,
+ cmpReference,
+ result,
+ isFixedPointDepth) {
+ if (prec.pcfBits > 0)
+ return tcuTexCompareVerifier.isBilinearPCFCompareValid(compareMode, prec, depths, xBounds, yBounds, cmpReference, result, isFixedPointDepth);
+ else
+ return tcuTexCompareVerifier.isBilinearAnyCompareValid(compareMode, prec, depths, cmpReference, result, isFixedPointDepth);
+};
+/**
+ * @param {tcuTexture.ConstPixelBufferAccess} level
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexCompareVerifier.TexComparePrecision} prec
+ * @param {Array<number>} coord vec2 texture coordinates
+ * @param {number} coordZ
+ * @param {number} cmpReference
+ * @param {number} result
+ * @return {boolean}
+ */
+tcuTexCompareVerifier.isLinearCompareResultValid = function(level,
+ sampler,
+ prec,
+ coord,
+ coordZ,
+ cmpReference,
+ result) {
+ var isFixedPointDepth = tcuTexCompareVerifier.isFixedPointDepthTextureFormat(level.getFormat());
+ var uBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getWidth(), coord[0], prec.coordBits[0], prec.uvwBits[0]);
+ var vBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getHeight(), coord[1], prec.coordBits[1], prec.uvwBits[1]);
+
+ // Integer coordinate bounds for (x0,y0) - without wrap mode
+ var minI = Math.floor(uBounds[0] - 0.5);
+ var maxI = Math.floor(uBounds[1] - 0.5);
+ var minJ = Math.floor(vBounds[0] - 0.5);
+ var maxJ = Math.floor(vBounds[1] - 0.5);
+
+ var w = level.getWidth();
+ var h = level.getHeight();
+
+ // \todo [2013-07-03 pyry] This could be optimized by first computing ranges based on wrap mode.
+
+ for (var j = minJ; j <= maxJ; j++) {
+ for (var i = minI; i <= maxI; i++) {
+ // Wrapped coordinates
+ var x0 = tcuTexVerifierUtil.wrap(sampler.wrapS, i, w);
+ var x1 = tcuTexVerifierUtil.wrap(sampler.wrapS, i + 1, w);
+ var y0 = tcuTexVerifierUtil.wrap(sampler.wrapT, j, h);
+ var y1 = tcuTexVerifierUtil.wrap(sampler.wrapT, j + 1, h);
+
+ // Bounds for filtering factors
+ var minA = deMath.clamp((uBounds[0] - 0.5) - i, 0, 1);
+ var maxA = deMath.clamp((uBounds[1] - 0.5) - i, 0, 1);
+ var minB = deMath.clamp((vBounds[0] - 0.5) - j, 0, 1);
+ var maxB = deMath.clamp((vBounds[1] - 0.5) - j, 0, 1);
+
+ var depths = [
+ level.getPixDepth(x0, y0, coordZ),
+ level.getPixDepth(x1, y0, coordZ),
+ level.getPixDepth(x0, y1, coordZ),
+ level.getPixDepth(x1, y1, coordZ)
+ ];
+
+ if (tcuTexCompareVerifier.isBilinearCompareValid(sampler.compare, prec, depths, [minA, maxA], [minB, maxB], cmpReference, result, isFixedPointDepth))
+ return true;
+ }
+ }
+
+ return false;
+};
+
+/**
+ * @param {tcuTexCompareVerifier.CmpResultSet} resultSet
+ * @param {number} result
+ * @param {number} resultBits
+ */
+tcuTexCompareVerifier.isResultInSet = function(resultSet, result, resultBits) {
+ var err = tcuTexVerifierUtil.computeFixedPointError(resultBits);
+ var minR = result - err;
+ var maxR = result + err;
+
+ return (resultSet.isTrue && deMath.deInRange32(1, minR, maxR)) ||
+ (resultSet.isFalse && deMath.deInRange32(0, minR, maxR));
+};
+
+/**
+ * @param {tcuTexture.ConstPixelBufferAccess} level
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexCompareVerifier.TexComparePrecision} prec
+ * @param {Array<number>} coord vec2 texture coordinates
+ * @param {number} coordZ
+ * @param {number} cmpReference
+ * @param {number} result
+ * @return {boolean}
+ */
+tcuTexCompareVerifier.isNearestCompareResultValid = function(level,
+ sampler,
+ prec,
+ coord,
+ coordZ,
+ cmpReference,
+ result) {
+ var isFixedPointDepth = tcuTexCompareVerifier.isFixedPointDepthTextureFormat(level.getFormat());
+ var uBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getWidth(), coord[0], prec.coordBits[0], prec.uvwBits[0]);
+ var vBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getHeight(), coord[1], prec.coordBits[1], prec.uvwBits[1]);
+
+ // Integer coordinates - without wrap mode
+ var minI = Math.floor(uBounds[0]);
+ var maxI = Math.floor(uBounds[1]);
+ var minJ = Math.floor(vBounds[0]);
+ var maxJ = Math.floor(vBounds[1]);
+
+ for (var j = minJ; j <= maxJ; j++) {
+ for (var i = minI; i <= maxI; i++) {
+ var x = tcuTexVerifierUtil.wrap(sampler.wrapS, i, level.getWidth());
+ var y = tcuTexVerifierUtil.wrap(sampler.wrapT, j, level.getHeight());
+ var depth = level.getPixDepth(x, y, coordZ);
+ var resSet = tcuTexCompareVerifier.execCompare(sampler.compare, depth, cmpReference, prec.referenceBits, isFixedPointDepth);
+
+ if (tcuTexCompareVerifier.isResultInSet(resSet, result, prec.resultBits))
+ return true;
+ }
+ }
+
+ return false;
+};
+
+/**
+ * @param {tcuTexture.ConstPixelBufferAccess} level
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexture.FilterMode} filterMode
+ * @param {tcuTexCompareVerifier.TexComparePrecision} prec
+ * @param {Array<number>} coord vec2 texture coordinates
+ * @param {number} coordZ
+ * @param {number} cmpReference
+ * @param {number} result
+ * @return {boolean}
+ */
+tcuTexCompareVerifier.isLevelCompareResultValid = function(level,
+ sampler,
+ filterMode,
+ prec,
+ coord,
+ coordZ,
+ cmpReference,
+ result) {
+ if (filterMode == tcuTexture.FilterMode.LINEAR)
+ return tcuTexCompareVerifier.isLinearCompareResultValid(level, sampler, prec, coord, coordZ, cmpReference, result);
+ else
+ return tcuTexCompareVerifier.isNearestCompareResultValid(level, sampler, prec, coord, coordZ, cmpReference, result);
+};
+
+/**
+ * @param {tcuTexture.CompareMode} compareMode
+ * @param {tcuTexCompareVerifier.TexComparePrecision} prec
+ * @param {Array<number>} depths0 vec4
+ * @param {Array<number>} depths1 vec4
+ * @param {number} cmpReference
+ * @param {number} result
+ * @param {boolean} isFixedPointDepth
+ * @return {boolean}
+ */
+tcuTexCompareVerifier.isTrilinearAnyCompareValid = function(compareMode,
+ prec,
+ depths0,
+ depths1,
+ cmpReference,
+ result,
+ isFixedPointDepth) {
+ assertMsgOptions(prec.pcfBits === 0, 'PCF bits must be 0', false, true);
+
+ var cmp00 = tcuTexCompareVerifier.execCompare(compareMode, depths0[0], cmpReference, prec.referenceBits, isFixedPointDepth);
+ var cmp01 = tcuTexCompareVerifier.execCompare(compareMode, depths0[1], cmpReference, prec.referenceBits, isFixedPointDepth);
+ var cmp02 = tcuTexCompareVerifier.execCompare(compareMode, depths0[2], cmpReference, prec.referenceBits, isFixedPointDepth);
+ var cmp03 = tcuTexCompareVerifier.execCompare(compareMode, depths0[3], cmpReference, prec.referenceBits, isFixedPointDepth);
+ var cmp10 = tcuTexCompareVerifier.execCompare(compareMode, depths1[0], cmpReference, prec.referenceBits, isFixedPointDepth);
+ var cmp11 = tcuTexCompareVerifier.execCompare(compareMode, depths1[1], cmpReference, prec.referenceBits, isFixedPointDepth);
+ var cmp12 = tcuTexCompareVerifier.execCompare(compareMode, depths1[2], cmpReference, prec.referenceBits, isFixedPointDepth);
+ var cmp13 = tcuTexCompareVerifier.execCompare(compareMode, depths1[3], cmpReference, prec.referenceBits, isFixedPointDepth);
+
+ var canBeTrue = cmp00.isTrue ||
+ cmp01.isTrue ||
+ cmp02.isTrue ||
+ cmp03.isTrue ||
+ cmp10.isTrue ||
+ cmp11.isTrue ||
+ cmp12.isTrue ||
+ cmp13.isTrue;
+ var canBeFalse = cmp00.isFalse ||
+ cmp01.isFalse ||
+ cmp02.isFalse ||
+ cmp03.isFalse ||
+ cmp10.isFalse ||
+ cmp11.isFalse ||
+ cmp12.isFalse ||
+ cmp13.isFalse;
+
+ var resErr = tcuTexVerifierUtil.computeFixedPointError(prec.resultBits);
+
+ var minBound = canBeFalse ? 0 : 1;
+ var maxBound = canBeTrue ? 1 : 0;
+
+ return deMath.deInRange32(result, minBound - resErr, maxBound + resErr);
+};
+
+/**
+ * @param {tcuTexture.CompareMode} compareMode
+ * @param {tcuTexCompareVerifier.TexComparePrecision} prec
+ * @param {Array<number>} depths0 vec4
+ * @param {Array<number>} depths1 vec4
+ * @param {Array<number>} xBounds0
+ * @param {Array<number>} yBounds0
+ * @param {Array<number>} xBounds1
+ * @param {Array<number>} yBounds1
+ * @param {Array<number>} fBounds
+ * @param {number} cmpReference
+ * @param {number} result
+ * @param {boolean} isFixedPointDepth
+ * @return {boolean}
+ */
+tcuTexCompareVerifier.isTrilinearPCFCompareValid = function(compareMode,
+ prec,
+ depths0,
+ depths1,
+ xBounds0,
+ yBounds0,
+ xBounds1,
+ yBounds1,
+ fBounds,
+ cmpReference,
+ result,
+ isFixedPointDepth) {
+ assertMsgOptions(0.0 <= xBounds0[0] && xBounds0[0] <= xBounds0[1] && xBounds0[1] <= 1.0, 'x0 coordinate out of bounds', false, true);
+ assertMsgOptions(0.0 <= yBounds0[0] && yBounds0[0] <= yBounds0[1] && yBounds0[1] <= 1.0, 'y0 coordinate out of bounds', false, true);
+ assertMsgOptions(0.0 <= xBounds1[0] && xBounds1[0] <= xBounds1[1] && xBounds1[1] <= 1.0, 'x1 coordinate out of bounds', false, true);
+ assertMsgOptions(0.0 <= yBounds1[0] && yBounds1[0] <= yBounds1[1] && yBounds1[1] <= 1.0, 'y1 coordinate out of bounds', false, true);
+ assertMsgOptions(0.0 <= fBounds[0] && fBounds[0] <= fBounds[1] && fBounds[1] <= 1.0, 'linear factor out of bounds', false, true);
+ assertMsgOptions(prec.pcfBits > 0, 'PCF bits must be > 0', false, true);
+
+ /** @type {Array<tcuTexCompareVerifier.CmpResultSet>} */ var cmp = [];
+ cmp.push(tcuTexCompareVerifier.execCompare(compareMode, depths0[0], cmpReference, prec.referenceBits, isFixedPointDepth));
+ cmp.push(tcuTexCompareVerifier.execCompare(compareMode, depths0[1], cmpReference, prec.referenceBits, isFixedPointDepth));
+ cmp.push(tcuTexCompareVerifier.execCompare(compareMode, depths0[2], cmpReference, prec.referenceBits, isFixedPointDepth));
+ cmp.push(tcuTexCompareVerifier.execCompare(compareMode, depths0[3], cmpReference, prec.referenceBits, isFixedPointDepth));
+ cmp.push(tcuTexCompareVerifier.execCompare(compareMode, depths1[0], cmpReference, prec.referenceBits, isFixedPointDepth));
+ cmp.push(tcuTexCompareVerifier.execCompare(compareMode, depths1[1], cmpReference, prec.referenceBits, isFixedPointDepth));
+ cmp.push(tcuTexCompareVerifier.execCompare(compareMode, depths1[2], cmpReference, prec.referenceBits, isFixedPointDepth));
+ cmp.push(tcuTexCompareVerifier.execCompare(compareMode, depths1[3], cmpReference, prec.referenceBits, isFixedPointDepth));
+
+ var isTrue = getMask(cmp, function(x) {return x.isTrue});
+ var isFalse = getMask(cmp, function(x) {return x.isFalse});
+
+ // Error parameters
+ var pcfErr = tcuTexVerifierUtil.computeFixedPointError(prec.pcfBits);
+ var resErr = tcuTexVerifierUtil.computeFixedPointError(prec.resultBits);
+ var totalErr = pcfErr + resErr;
+
+ // Iterate over all valid combinations.
+ for (var comb = 0; comb < (1 << 8); comb++) {
+ // Filter out invalid combinations.
+ if (((comb & isTrue) | (~comb & isFalse)) != (1 << 8) - 1)
+ continue;
+
+ var cmpTrue0 = tcuTexCompareVerifier.extractBVec4(comb, 0);
+ var cmpTrue1 = tcuTexCompareVerifier.extractBVec4(comb, 4);
+ var refVal0 = tcuTextureUtil.select([1, 1, 1, 1], [0, 0, 0, 0], cmpTrue0);
+ var refVal1 = tcuTextureUtil.select([1, 1, 1, 1], [0, 0, 0, 0], cmpTrue1);
+
+ // Bilinear interpolation within levels.
+ var v00 = tcuTexCompareVerifier.bilinearInterpolate(refVal0, xBounds0[0], yBounds0[0]);
+ var v01 = tcuTexCompareVerifier.bilinearInterpolate(refVal0, xBounds0[1], yBounds0[0]);
+ var v02 = tcuTexCompareVerifier.bilinearInterpolate(refVal0, xBounds0[0], yBounds0[1]);
+ var v03 = tcuTexCompareVerifier.bilinearInterpolate(refVal0, xBounds0[1], yBounds0[1]);
+ var minV0 = Math.min(v00, v01, v02, v03);
+ var maxV0 = Math.max(v00, v01, v02, v03);
+
+ var v10 = tcuTexCompareVerifier.bilinearInterpolate(refVal1, xBounds1[0], yBounds1[0]);
+ var v11 = tcuTexCompareVerifier.bilinearInterpolate(refVal1, xBounds1[1], yBounds1[0]);
+ var v12 = tcuTexCompareVerifier.bilinearInterpolate(refVal1, xBounds1[0], yBounds1[1]);
+ var v13 = tcuTexCompareVerifier.bilinearInterpolate(refVal1, xBounds1[1], yBounds1[1]);
+ var minV1 = Math.min(v10, v11, v12, v13);
+ var maxV1 = Math.max(v10, v11, v12, v13);
+
+ // Compute min-max bounds by filtering between minimum bounds and maximum bounds between levels.
+ // HW can end up choosing pretty much any of samples between levels, and thus interpolating
+ // between minimums should yield lower bound for range, and same for upper bound.
+ // \todo [2013-07-17 pyry] This seems separable? Can this be optimized? At least ranges could be pre-computed and later combined.
+ var minF0 = minV0 * (1 - fBounds[0]) + minV1 * fBounds[0];
+ var minF1 = minV0 * (1 - fBounds[1]) + minV1 * fBounds[1];
+ var maxF0 = maxV0 * (1 - fBounds[0]) + maxV1 * fBounds[0];
+ var maxF1 = maxV0 * (1 - fBounds[1]) + maxV1 * fBounds[1];
+
+ var minF = Math.min(minF0, minF1);
+ var maxF = Math.max(maxF0, maxF1);
+
+ var minR = minF - totalErr;
+ var maxR = maxF + totalErr;
+
+ if (deMath.deInRange32(result, minR, maxR))
+ return true;
+ }
+
+ return false;
+
+};
+
+/**
+ * @param {tcuTexture.CompareMode} compareMode
+ * @param {tcuTexCompareVerifier.TexComparePrecision} prec
+ * @param {Array<number>} depths0 vec4
+ * @param {Array<number>} depths1 vec4
+ * @param {Array<number>} xBounds0
+ * @param {Array<number>} yBounds0
+ * @param {Array<number>} xBounds1
+ * @param {Array<number>} yBounds1
+ * @param {Array<number>} fBounds
+ * @param {number} cmpReference
+ * @param {number} result
+ * @param {boolean} isFixedPointDepth
+ * @return {boolean}
+ */
+tcuTexCompareVerifier.isTrilinearCompareValid = function(compareMode,
+ prec,
+ depths0,
+ depths1,
+ xBounds0,
+ yBounds0,
+ xBounds1,
+ yBounds1,
+ fBounds,
+ cmpReference,
+ result,
+ isFixedPointDepth) {
+ if (prec.pcfBits > 0)
+ return tcuTexCompareVerifier.isTrilinearPCFCompareValid(compareMode, prec, depths0, depths1, xBounds0, yBounds0, xBounds1, yBounds1, fBounds, cmpReference, result, isFixedPointDepth);
+ else
+ return tcuTexCompareVerifier.isTrilinearAnyCompareValid(compareMode, prec, depths0, depths1, cmpReference, result, isFixedPointDepth);
+};
+
+/**
+ * @param {tcuTexture.ConstPixelBufferAccess} level0
+ * @param {tcuTexture.ConstPixelBufferAccess} level1
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexCompareVerifier.TexComparePrecision} prec
+ * @param {Array<number>} coord vec2 texture coordinates
+ * @param {number} coordZ
+ * @param {Array<number>} fBounds vec2
+ * @param {number} cmpReference
+ * @param {number} result
+ * @return {boolean}
+ */
+tcuTexCompareVerifier.isLinearMipmapLinearCompareResultValid = function(level0,
+ level1,
+ sampler,
+ prec,
+ coord,
+ coordZ,
+ fBounds,
+ cmpReference,
+ result) {
+ var isFixedPointDepth = tcuTexCompareVerifier.isFixedPointDepthTextureFormat(level0.getFormat());
+
+ // \todo [2013-07-04 pyry] This is strictly not correct as coordinates between levels should be dependent.
+ // Right now this allows pairing any two valid bilinear quads.
+
+ var w0 = level0.getWidth();
+ var w1 = level1.getWidth();
+ var h0 = level0.getHeight();
+ var h1 = level1.getHeight();
+
+ var uBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, w0, coord[0], prec.coordBits[0], prec.uvwBits[0]);
+ var uBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, w1, coord[0], prec.coordBits[0], prec.uvwBits[0]);
+ var vBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, h0, coord[1], prec.coordBits[1], prec.uvwBits[1]);
+ var vBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, h1, coord[1], prec.coordBits[1], prec.uvwBits[1]);
+
+ // Integer coordinates - without wrap mode
+ var minI0 = Math.floor(uBounds0[0] - 0.5);
+ var maxI0 = Math.floor(uBounds0[1] - 0.5);
+ var minI1 = Math.floor(uBounds1[0] - 0.5);
+ var maxI1 = Math.floor(uBounds1[1] - 0.5);
+ var minJ0 = Math.floor(vBounds0[0] - 0.5);
+ var maxJ0 = Math.floor(vBounds0[1] - 0.5);
+ var minJ1 = Math.floor(vBounds1[0] - 0.5);
+ var maxJ1 = Math.floor(vBounds1[1] - 0.5);
+
+ for (var j0 = minJ0; j0 <= maxJ0; j0++) {
+ for (var i0 = minI0; i0 <= maxI0; i0++) {
+ var minA0 = deMath.clamp((uBounds0[0] - 0.5) - i0, 0, 1);
+ var maxA0 = deMath.clamp((uBounds0[1] - 0.5) - i0, 0, 1);
+ var minB0 = deMath.clamp((vBounds0[0] - 0.5) - j0, 0, 1);
+ var maxB0 = deMath.clamp((vBounds0[1] - 0.5) - j0, 0, 1);
+ var depths0 = [];
+
+ var x0 = tcuTexVerifierUtil.wrap(sampler.wrapS, i0, w0);
+ var x1 = tcuTexVerifierUtil.wrap(sampler.wrapS, i0 + 1, w0);
+ var y0 = tcuTexVerifierUtil.wrap(sampler.wrapT, j0, h0);
+ var y1 = tcuTexVerifierUtil.wrap(sampler.wrapT, j0 + 1, h0);
+
+ depths0[0] = level0.getPixDepth(x0, y0, coordZ);
+ depths0[1] = level0.getPixDepth(x1, y0, coordZ);
+ depths0[2] = level0.getPixDepth(x0, y1, coordZ);
+ depths0[3] = level0.getPixDepth(x1, y1, coordZ);
+
+ for (var j1 = minJ1; j1 <= maxJ1; j1++) {
+ for (var i1 = minI1; i1 <= maxI1; i1++) {
+ var minA1 = deMath.clamp((uBounds1[0] - 0.5) - i1, 0, 1);
+ var maxA1 = deMath.clamp((uBounds1[1] - 0.5) - i1, 0, 1);
+ var minB1 = deMath.clamp((vBounds1[0] - 0.5) - j1, 0, 1);
+ var maxB1 = deMath.clamp((vBounds1[1] - 0.5) - j1, 0, 1);
+ var depths1 = [];
+
+ x0 = tcuTexVerifierUtil.wrap(sampler.wrapS, i1, w1);
+ x1 = tcuTexVerifierUtil.wrap(sampler.wrapS, i1 + 1, w1);
+ y0 = tcuTexVerifierUtil.wrap(sampler.wrapT, j1, h1);
+ y1 = tcuTexVerifierUtil.wrap(sampler.wrapT, j1 + 1, h1);
+
+ depths1[0] = level1.getPixDepth(x0, y0, coordZ);
+ depths1[1] = level1.getPixDepth(x1, y0, coordZ);
+ depths1[2] = level1.getPixDepth(x0, y1, coordZ);
+ depths1[3] = level1.getPixDepth(x1, y1, coordZ);
+
+ if (tcuTexCompareVerifier.isTrilinearCompareValid(sampler.compare, prec, depths0, depths1,
+ [minA0, maxA0], [minB0, maxB0],
+ [minA1, maxA1], [minB1, maxB1],
+ fBounds, cmpReference, result, isFixedPointDepth))
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+};
+
+/**
+ * @param {tcuTexture.ConstPixelBufferAccess} level0
+ * @param {tcuTexture.ConstPixelBufferAccess} level1
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexCompareVerifier.TexComparePrecision} prec
+ * @param {Array<number>} coord vec2 texture coordinates
+ * @param {number} coordZ
+ * @param {Array<number>} fBounds vec2
+ * @param {number} cmpReference
+ * @param {number} result
+ * @return {boolean}
+ */
+tcuTexCompareVerifier.isNearestMipmapLinearCompareResultValid = function(level0,
+ level1,
+ sampler,
+ prec,
+ coord,
+ coordZ,
+ fBounds,
+ cmpReference,
+ result) {
+ var isFixedPointDepth = tcuTexCompareVerifier.isFixedPointDepthTextureFormat(level0.getFormat());
+
+ var w0 = level0.getWidth();
+ var w1 = level1.getWidth();
+ var h0 = level0.getHeight();
+ var h1 = level1.getHeight();
+
+ var uBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, w0, coord[0], prec.coordBits[0], prec.uvwBits[0]);
+ var uBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, w1, coord[0], prec.coordBits[0], prec.uvwBits[0]);
+ var vBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, h0, coord[1], prec.coordBits[1], prec.uvwBits[1]);
+ var vBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, h1, coord[1], prec.coordBits[1], prec.uvwBits[1]);
+
+ var minI0 = Math.floor(uBounds0[0]);
+ var maxI0 = Math.floor(uBounds0[1]);
+ var minI1 = Math.floor(uBounds1[0]);
+ var maxI1 = Math.floor(uBounds1[1]);
+ var minJ0 = Math.floor(vBounds0[0]);
+ var maxJ0 = Math.floor(vBounds0[1]);
+ var minJ1 = Math.floor(vBounds1[0]);
+ var maxJ1 = Math.floor(vBounds1[1]);
+
+ for (var j0 = minJ0; j0 <= maxJ0; j0++) {
+ for (var i0 = minI0; i0 <= maxI0; i0++) {
+ var x0 = tcuTexVerifierUtil.wrap(sampler.wrapS, i0, w0);
+ var y0 = tcuTexVerifierUtil.wrap(sampler.wrapT, j0, h0);
+
+ // Derivated from C++ dEQP function lookupDepth()
+ // Since x0 and y0 are wrapped, here lookupDepth() returns the same result as getPixDepth()
+ assertMsgOptions(deMath.deInBounds32(x0, 0, level0.getWidth()) && deMath.deInBounds32(y0, 0, level0.getHeight()) && deMath.deInBounds32(coordZ, 0, level0.getDepth()), 'x0, y0 or coordZ out of bound.', false, true);
+ var depth0 = level0.getPixDepth(x0, y0, coordZ);
+
+ for (var j1 = minJ1; j1 <= maxJ1; j1++) {
+ for (var i1 = minI1; i1 <= maxI1; i1++) {
+ var x1 = tcuTexVerifierUtil.wrap(sampler.wrapS, i1, w1);
+ var y1 = tcuTexVerifierUtil.wrap(sampler.wrapT, j1, h1);
+
+ // Derivated from C++ dEQP function lookupDepth()
+ // Since x1 and y1 are wrapped, here lookupDepth() returns the same result as getPixDepth()
+ assertMsgOptions(deMath.deInBounds32(x1, 0, level1.getWidth()) && deMath.deInBounds32(y1, 0, level1.getHeight()), 'x1 or y1 out of bound.', false, true);
+ var depth1 = level1.getPixDepth(x1, y1, coordZ);
+
+ if (tcuTexCompareVerifier.isLinearCompareValid(sampler.compare, prec, [depth0, depth1], fBounds, cmpReference, result, isFixedPointDepth))
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+};
+
+/**
+ * @param {tcuTexture.ConstPixelBufferAccess} level0
+ * @param {tcuTexture.ConstPixelBufferAccess} level1
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexture.FilterMode} levelFilter
+ * @param {tcuTexCompareVerifier.TexComparePrecision} prec
+ * @param {Array<number>} coord vec2 texture coordinates
+ * @param {number} coordZ
+ * @param {Array<number>} fBounds vec2
+ * @param {number} cmpReference
+ * @param {number} result
+ * @return {boolean}
+ */
+tcuTexCompareVerifier.isMipmapLinearCompareResultValid = function(level0,
+ level1,
+ sampler,
+ levelFilter,
+ prec,
+ coord,
+ coordZ,
+ fBounds,
+ cmpReference,
+ result) {
+ if (levelFilter == tcuTexture.FilterMode.LINEAR)
+ return tcuTexCompareVerifier.isLinearMipmapLinearCompareResultValid(level0, level1, sampler, prec, coord, coordZ, fBounds, cmpReference, result);
+ else
+ return tcuTexCompareVerifier.isNearestMipmapLinearCompareResultValid(level0, level1, sampler, prec, coord, coordZ, fBounds, cmpReference, result);
+};
+
+/**
+ * @param {tcuTexture.Texture2DView} texture
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexCompareVerifier.TexComparePrecision} prec
+ * @param {Array<number>} coord vec2 texture coordinates
+ * @param {Array<number>} lodBounds vec2 level-of-detail bounds
+ * @param {number} cmpReference
+ * @param {number} result
+ * @return {boolean}
+ */
+tcuTexCompareVerifier.isTexCompareResultValid2D = function(texture, sampler, prec, coord, lodBounds, cmpReference, result) {
+ var minLod = lodBounds[0];
+ var maxLod = lodBounds[1];
+ var canBeMagnified = minLod <= sampler.lodThreshold;
+ var canBeMinified = maxLod > sampler.lodThreshold;
+
+ if (canBeMagnified) {
+ if (tcuTexCompareVerifier.isLevelCompareResultValid(texture.getLevel(0), sampler, sampler.magFilter, prec, coord, 0, cmpReference, result))
+ return true;
+ }
+
+ if (canBeMinified) {
+ var isNearestMipmap = tcuTexVerifierUtil.isNearestMipmapFilter(sampler.minFilter);
+ var isLinearMipmap = tcuTexVerifierUtil.isLinearMipmapFilter(sampler.minFilter);
+ var minTexLevel = 0;
+ var maxTexLevel = texture.getNumLevels() - 1;
+
+ assertMsgOptions(minTexLevel < maxTexLevel, 'Invalid texture levels.', false, true);
+
+ if (isLinearMipmap) {
+ var minLevel = deMath.clamp(Math.floor(minLod), minTexLevel, maxTexLevel - 1);
+ var maxLevel = deMath.clamp(Math.floor(maxLod), minTexLevel, maxTexLevel - 1);
+
+ assertMsgOptions(minLevel <= maxLevel, 'Invalid texture levels.', false, true);
+
+ for (var level = minLevel; level <= maxLevel; level++) {
+ var minF = deMath.clamp(minLod - level, 0, 1);
+ var maxF = deMath.clamp(maxLod - level, 0, 1);
+
+ if (tcuTexCompareVerifier.isMipmapLinearCompareResultValid(texture.getLevel(level), texture.getLevel(level + 1), sampler, tcuTexVerifierUtil.getLevelFilter(sampler.minFilter), prec, coord, 0, [minF, maxF], cmpReference, result))
+ return true;
+ }
+ } else if (isNearestMipmap) {
+ // \note The accurate formula for nearest mipmapping is level = ceil(lod + 0.5) - 1 but Khronos has made
+ // decision to allow floor(lod + 0.5) as well.
+ var minLevel = deMath.clamp(Math.ceil(minLod + 0.5) - 1, minTexLevel, maxTexLevel);
+ var maxLevel = deMath.clamp(Math.floor(maxLod + 0.5), minTexLevel, maxTexLevel);
+
+ assertMsgOptions(minLevel <= maxLevel, 'Invalid texture levels.', false, true);
+
+ for (var level = minLevel; level <= maxLevel; level++) {
+ if (tcuTexCompareVerifier.isLevelCompareResultValid(texture.getLevel(level), sampler, tcuTexVerifierUtil.getLevelFilter(sampler.minFilter), prec, coord, 0, cmpReference, result))
+ return true;
+ }
+ } else {
+ if (tcuTexCompareVerifier.isLevelCompareResultValid(texture.getLevel(0), sampler, sampler.minFilter, prec, coord, 0, cmpReference, result))
+ return true;
+ }
+ }
+
+ return false;
+};
+
+/**
+ * @param {tcuTexture.TextureCubeView} texture
+ * @param {number} baseLevelNdx
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexCompareVerifier.TexComparePrecision} prec
+ * @param {tcuTexture.CubeFaceCoords} coords
+ * @param {Array<number>} fBounds vec2
+ * @param {number} cmpReference
+ * @param {number} result
+ * @return {boolean}
+ */
+tcuTexCompareVerifier.isSeamplessLinearMipmapLinearCompareResultValid = function(texture,
+ baseLevelNdx,
+ sampler,
+ prec,
+ coords,
+ fBounds,
+ cmpReference,
+ result) {
+ var isFixedPointDepth = tcuTexCompareVerifier.isFixedPointDepthTextureFormat(texture.getLevelFace(baseLevelNdx, tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X).getFormat());
+ var size0 = texture.getLevelFace(baseLevelNdx, coords.face).getWidth();
+ var size1 = texture.getLevelFace(baseLevelNdx + 1, coords.face).getWidth();
+
+ var uBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, size0, coords.s, prec.coordBits[0], prec.uvwBits[0]);
+ var uBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, size1, coords.s, prec.coordBits[0], prec.uvwBits[0]);
+ var vBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, size0, coords.t, prec.coordBits[1], prec.uvwBits[1]);
+ var vBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, size1, coords.t, prec.coordBits[1], prec.uvwBits[1]);
+
+ // Integer coordinates - without wrap mode
+ var minI0 = Math.floor(uBounds0[0] - 0.5);
+ var maxI0 = Math.floor(uBounds0[1] - 0.5);
+ var minI1 = Math.floor(uBounds1[0] - 0.5);
+ var maxI1 = Math.floor(uBounds1[1] - 0.5);
+ var minJ0 = Math.floor(vBounds0[0] - 0.5);
+ var maxJ0 = Math.floor(vBounds0[1] - 0.5);
+ var minJ1 = Math.floor(vBounds1[0] - 0.5);
+ var maxJ1 = Math.floor(vBounds1[1] - 0.5);
+
+ /** @type {Array<tcuTexture.ConstPixelBufferAccess>} */ var faces0 = [];
+ /** @type {Array<tcuTexture.ConstPixelBufferAccess>} */ var faces1 = [];
+
+ for (var key in tcuTexture.CubeFace) {
+ var face = tcuTexture.CubeFace[key];
+ faces0[face] = texture.getLevelFace(baseLevelNdx, face);
+ faces1[face] = texture.getLevelFace(baseLevelNdx + 1, face);
+ }
+
+ for (var j0 = minJ0; j0 <= maxJ0; j0++) {
+ for (var i0 = minI0; i0 <= maxI0; i0++) {
+ var minA0 = deMath.clamp((uBounds0[0] - 0.5) - i0, 0, 1);
+ var maxA0 = deMath.clamp((uBounds0[1] - 0.5) - i0, 0, 1);
+ var minB0 = deMath.clamp((vBounds0[0] - 0.5) - j0, 0, 1);
+ var maxB0 = deMath.clamp((vBounds0[1] - 0.5) - j0, 0, 1);
+ var depths0 = [];
+
+ var c00 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i0 + 0, j0 + 0]), size0);
+ var c10 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i0 + 1, j0 + 0]), size0);
+ var c01 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i0 + 0, j0 + 1]), size0);
+ var c11 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i0 + 1, j0 + 1]), size0);
+
+ // If any of samples is out of both edges, implementations can do pretty much anything according to spec.
+ // \todo [2013-07-08 pyry] Test the special case where all corner pixels have exactly the same color.
+ if (c00 == null || c01 == null || c10 == null || c11 == null)
+ return true;
+
+ depths0[0] = faces0[c00.face].getPixDepth(c00.s, c00.t);
+ depths0[1] = faces0[c10.face].getPixDepth(c10.s, c10.t);
+ depths0[2] = faces0[c01.face].getPixDepth(c01.s, c01.t);
+ depths0[3] = faces0[c11.face].getPixDepth(c11.s, c11.t);
+
+ for (var j1 = minJ1; j1 <= maxJ1; j1++) {
+ for (var i1 = minI1; i1 <= maxI1; i1++) {
+ var minA1 = deMath.clamp((uBounds1[0] - 0.5) - i1, 0, 1);
+ var maxA1 = deMath.clamp((uBounds1[1] - 0.5) - i1, 0, 1);
+ var minB1 = deMath.clamp((vBounds1[0] - 0.5) - j1, 0, 1);
+ var maxB1 = deMath.clamp((vBounds1[1] - 0.5) - j1, 0, 1);
+ var depths1 = [];
+
+ c00 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i1 + 0, j1 + 0]), size1);
+ c10 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i1 + 1, j1 + 0]), size1);
+ c01 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i1 + 0, j1 + 1]), size1);
+ c11 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i1 + 1, j1 + 1]), size1);
+
+ if (c00 == null || c01 == null || c10 == null || c11 == null)
+ return true;
+
+ depths1[0] = faces1[c00.face].getPixDepth(c00.s, c00.t);
+ depths1[1] = faces1[c10.face].getPixDepth(c10.s, c10.t);
+ depths1[2] = faces1[c01.face].getPixDepth(c01.s, c01.t);
+ depths1[3] = faces1[c11.face].getPixDepth(c11.s, c11.t);
+
+ if (tcuTexCompareVerifier.isTrilinearCompareValid(sampler.compare, prec, depths0, depths1,
+ [minA0, maxA0], [minB0, maxB0],
+ [minA1, maxA1], [minB1, maxB1],
+ fBounds, cmpReference, result, isFixedPointDepth))
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+};
+
+/**
+ * @param {tcuTexture.TextureCubeView} texture
+ * @param {number} levelNdx
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexCompareVerifier.TexComparePrecision} prec
+ * @param {tcuTexture.CubeFaceCoords} coords
+ * @param {number} cmpReference
+ * @param {number} result
+ * @return {boolean}
+ */
+
+tcuTexCompareVerifier.isSeamlessLinearCompareResultValid = function(texture,
+ levelNdx,
+ sampler,
+ prec,
+ coords,
+ cmpReference,
+ result) {
+ var isFixedPointDepth = tcuTexCompareVerifier.isFixedPointDepthTextureFormat(texture.getLevelFace(levelNdx, tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X).getFormat());
+ var size = texture.getLevelFace(levelNdx, coords.face).getWidth();
+
+ var uBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, size, coords.s, prec.coordBits[0], prec.uvwBits[0]);
+ var vBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, size, coords.t, prec.coordBits[1], prec.uvwBits[1]);
+
+ // Integer coordinate bounds for (x0,y0) - without wrap mode
+ var minI = Math.floor(uBounds[0] - 0.5);
+ var maxI = Math.floor(uBounds[1] - 0.5);
+ var minJ = Math.floor(vBounds[0] - 0.5);
+ var maxJ = Math.floor(vBounds[1] - 0.5);
+
+ // Face accesses
+ /** @type {Array<tcuTexture.ConstPixelBufferAccess>} */ var faces = [];
+
+ for (var key in tcuTexture.CubeFace) {
+ var face = tcuTexture.CubeFace[key];
+ faces[face] = texture.getLevelFace(levelNdx, face);
+ }
+
+ for (var j = minJ; j <= maxJ; j++) {
+ for (var i = minI; i <= maxI; i++) {
+ var c00 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i + 0, j + 0]), size);
+ var c10 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i + 1, j + 0]), size);
+ var c01 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i + 0, j + 1]), size);
+ var c11 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i + 1, j + 1]), size);
+
+ // If any of samples is out of both edges, implementations can do pretty much anything according to spec.
+ // \todo [2013-07-08 pyry] Test the special case where all corner pixels have exactly the same color.
+ if (!c00 || !c01 || !c10 || !c11)
+ return true;
+
+ // Bounds for filtering factors
+ var minA = deMath.clamp((uBounds[0] - 0.5) - i, 0, 1);
+ var maxA = deMath.clamp((uBounds[1] - 0.5) - i, 0, 1);
+ var minB = deMath.clamp((vBounds[0] - 0.5) - j, 0, 1);
+ var maxB = deMath.clamp((vBounds[1] - 0.5) - j, 0, 1);
+
+ var depths = [];
+ depths[0] = faces[c00.face].getPixDepth(c00.s, c00.t);
+ depths[1] = faces[c10.face].getPixDepth(c10.s, c10.t);
+ depths[2] = faces[c01.face].getPixDepth(c01.s, c01.t);
+ depths[3] = faces[c11.face].getPixDepth(c11.s, c11.t);
+
+ if (tcuTexCompareVerifier.isBilinearCompareValid(sampler.compare, prec, depths, [minA, maxA], [minB, maxB], cmpReference, result, isFixedPointDepth))
+ return true;
+ }
+ }
+
+ return false;
+};
+
+/**
+ * @param {tcuTexture.TextureCubeView} texture
+ * @param {number} levelNdx
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexture.FilterMode} filterMode
+ * @param {tcuTexCompareVerifier.TexComparePrecision} prec
+ * @param {tcuTexture.CubeFaceCoords} coords
+ * @param {number} cmpReference
+ * @param {number} result
+ * @return {boolean}
+ */
+tcuTexCompareVerifier.isCubeLevelCompareResultValid = function(texture,
+ levelNdx,
+ sampler,
+ filterMode,
+ prec,
+ coords,
+ cmpReference,
+ result) {
+ if (filterMode == tcuTexture.FilterMode.LINEAR) {
+ if (sampler.seamlessCubeMap)
+ return tcuTexCompareVerifier.isSeamlessLinearCompareResultValid(texture, levelNdx, sampler, prec, coords, cmpReference, result);
+ else
+ return tcuTexCompareVerifier.isLinearCompareResultValid(texture.getLevelFace(levelNdx, coords.face), sampler, prec, [coords.s, coords.t], 0, cmpReference, result);
+ } else
+ return tcuTexCompareVerifier.isNearestCompareResultValid(texture.getLevelFace(levelNdx, coords.face), sampler, prec, [coords.s, coords.t], 0, cmpReference, result);
+};
+
+/**
+ * @param {tcuTexture.TextureCubeView} texture
+ * @param {number} baseLevelNdx
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexture.FilterMode} levelFilter
+ * @param {tcuTexCompareVerifier.TexComparePrecision} prec
+ * @param {tcuTexture.CubeFaceCoords} coords
+ * @param {Array<number>} fBounds vec2
+ * @param {number} cmpReference
+ * @param {number} result
+ * @return {boolean}
+ */
+tcuTexCompareVerifier.isCubeMipmapLinearCompareResultValid = function(texture,
+ baseLevelNdx,
+ sampler,
+ levelFilter,
+ prec,
+ coords,
+ fBounds,
+ cmpReference,
+ result) {
+ if (levelFilter == tcuTexture.FilterMode.LINEAR) {
+ if (sampler.seamlessCubeMap)
+ return tcuTexCompareVerifier.isSeamplessLinearMipmapLinearCompareResultValid(texture, baseLevelNdx, sampler, prec, coords, fBounds, cmpReference, result);
+ else
+ return tcuTexCompareVerifier.isLinearMipmapLinearCompareResultValid(texture.getLevelFace(baseLevelNdx, coords.face),
+ texture.getLevelFace(baseLevelNdx + 1, coords.face),
+ sampler, prec, [coords.s, coords.t], 0, fBounds, cmpReference, result);
+ } else
+ return tcuTexCompareVerifier.isNearestMipmapLinearCompareResultValid(texture.getLevelFace(baseLevelNdx, coords.face),
+ texture.getLevelFace(baseLevelNdx + 1, coords.face),
+ sampler, prec, [coords.s, coords.t], 0, fBounds, cmpReference, result);
+};
+
+/**
+ * @param {tcuTexture.TextureCubeView} texture
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexCompareVerifier.TexComparePrecision} prec
+ * @param {Array<number>} coord vec2 texture coordinates
+ * @param {Array<number>} lodBounds vec2 level-of-detail bounds
+ * @param {number} cmpReference
+ * @param {number} result
+ * @return {boolean}
+ */
+tcuTexCompareVerifier.isTexCompareResultValidCube = function(texture, sampler, prec, coord, lodBounds, cmpReference, result) {
+ /** @type {Array<tcuTexture.CubeFace>} */var possibleFaces = tcuTexVerifierUtil.getPossibleCubeFaces(coord, prec.coordBits);
+
+ if (!possibleFaces)
+ return true; // Result is undefined.
+
+ for (var tryFaceNdx = 0; tryFaceNdx < possibleFaces.length; tryFaceNdx++) {
+ var face = possibleFaces[tryFaceNdx];
+ var faceCoords = new tcuTexture.CubeFaceCoords(face, tcuTexture.projectToFace(face, coord));
+ var minLod = lodBounds[0];
+ var maxLod = lodBounds[1];
+ var canBeMagnified = minLod <= sampler.lodThreshold;
+ var canBeMinified = maxLod > sampler.lodThreshold;
+
+ if (canBeMagnified) {
+ if (tcuTexCompareVerifier.isCubeLevelCompareResultValid(texture, 0, sampler, sampler.magFilter, prec, faceCoords, cmpReference, result))
+ return true;
+ }
+
+ if (canBeMinified) {
+ var isNearestMipmap = tcuTexVerifierUtil.isNearestMipmapFilter(sampler.minFilter);
+ var isLinearMipmap = tcuTexVerifierUtil.isLinearMipmapFilter(sampler.minFilter);
+ var minTexLevel = 0;
+ var maxTexLevel = texture.getNumLevels() - 1;
+
+ assertMsgOptions(minTexLevel < maxTexLevel, 'Invalid texture levels.', false, true);
+
+ if (isLinearMipmap) {
+ var minLevel = deMath.clamp(Math.floor(minLod), minTexLevel, maxTexLevel - 1);
+ var maxLevel = deMath.clamp(Math.floor(maxLod), minTexLevel, maxTexLevel - 1);
+
+ assertMsgOptions(minLevel <= maxLevel, 'Invalid texture levels.', false, true);
+
+ for (var level = minLevel; level <= maxLevel; level++) {
+ var minF = deMath.clamp(minLod - level, 0, 1);
+ var maxF = deMath.clamp(maxLod - level, 0, 1);
+
+ if (tcuTexCompareVerifier.isCubeMipmapLinearCompareResultValid(texture, level, sampler, tcuTexVerifierUtil.getLevelFilter(sampler.minFilter), prec, faceCoords, [minF, maxF], cmpReference, result))
+ return true;
+ }
+ } else if (isNearestMipmap) {
+ // \note The accurate formula for nearest mipmapping is level = ceil(lod + 0.5) - 1 but Khronos has made
+ // decision to allow floor(lod + 0.5) as well.
+ var minLevel = deMath.clamp(Math.ceil(minLod + 0.5) - 1, minTexLevel, maxTexLevel);
+ var maxLevel = deMath.clamp(Math.floor(maxLod + 0.5), minTexLevel, maxTexLevel);
+
+ assertMsgOptions(minLevel <= maxLevel, 'Invalid texture levels.', false, true);
+
+ for (var level = minLevel; level <= maxLevel; level++) {
+ if (tcuTexCompareVerifier.isCubeLevelCompareResultValid(texture, level, sampler, tcuTexVerifierUtil.getLevelFilter(sampler.minFilter), prec, faceCoords, cmpReference, result))
+ return true;
+ }
+ } else {
+ if (tcuTexCompareVerifier.isCubeLevelCompareResultValid(texture, 0, sampler, sampler.minFilter, prec, faceCoords, cmpReference, result))
+ return true;
+ }
+ }
+ }
+
+ return false;
+};
+
+/**
+ * @param {tcuTexture.Texture2DArrayView} texture
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexCompareVerifier.TexComparePrecision} prec
+ * @param {Array<number>} coord vec3 texture coordinates
+ * @param {Array<number>} lodBounds vec2 level-of-detail bounds
+ * @param {number} cmpReference
+ * @param {number} result
+ * @return {boolean}
+ */
+tcuTexCompareVerifier.isTexCompareResultValid2DArray = function(texture, sampler, prec, coord, lodBounds, cmpReference, result) {
+ var depthErr = tcuTexVerifierUtil.computeFloatingPointError(coord[2], prec.coordBits[2]) + tcuTexVerifierUtil.computeFixedPointError(prec.uvwBits[2]);
+ var minZ = coord[2] - depthErr;
+ var maxZ = coord[2] + depthErr;
+ var minLayer = deMath.clamp(Math.floor(minZ + 0.5), 0, texture.getNumLayers() - 1);
+ var maxLayer = deMath.clamp(Math.floor(maxZ + 0.5), 0, texture.getNumLayers() - 1);
+
+ for (var layer = minLayer; layer <= maxLayer; layer++) {
+ var minLod = lodBounds[0];
+ var maxLod = lodBounds[1];
+ var canBeMagnified = minLod <= sampler.lodThreshold;
+ var canBeMinified = maxLod > sampler.lodThreshold;
+
+ if (canBeMagnified) {
+ if (tcuTexCompareVerifier.isLevelCompareResultValid(texture.getLevel(0), sampler, sampler.magFilter, prec, deMath.swizzle(coord, [0, 1]), layer, cmpReference, result))
+ return true;
+ }
+
+ if (canBeMinified) {
+ var isNearestMipmap = tcuTexVerifierUtil.isNearestMipmapFilter(sampler.minFilter);
+ var isLinearMipmap = tcuTexVerifierUtil.isLinearMipmapFilter(sampler.minFilter);
+ var minTexLevel = 0;
+ var maxTexLevel = texture.getNumLevels() - 1;
+
+ assertMsgOptions(minTexLevel < maxTexLevel, 'Invalid texture levels.', false, true);
+
+ if (isLinearMipmap) {
+ var minLevel = deMath.clamp(Math.floor(minLod), minTexLevel, maxTexLevel - 1);
+ var maxLevel = deMath.clamp(Math.floor(maxLod), minTexLevel, maxTexLevel - 1);
+
+ assertMsgOptions(minLevel <= maxLevel, 'Invalid texture levels.', false, true);
+
+ for (var level = minLevel; level <= maxLevel; level++) {
+ var minF = deMath.clamp(minLod - level, 0, 1);
+ var maxF = deMath.clamp(maxLod - level, 0, 1);
+
+ if (tcuTexCompareVerifier.isMipmapLinearCompareResultValid(texture.getLevel(level), texture.getLevel(level + 1), sampler, tcuTexVerifierUtil.getLevelFilter(sampler.minFilter), prec, deMath.swizzle(coord, [0, 1]), layer, [minF, maxF], cmpReference, result))
+ return true;
+ }
+ } else if (isNearestMipmap) {
+ // \note The accurate formula for nearest mipmapping is level = ceil(lod + 0.5) - 1 but Khronos has made
+ // decision to allow floor(lod + 0.5) as well.
+ var minLevel = deMath.clamp(Math.ceil(minLod + 0.5) - 1, minTexLevel, maxTexLevel);
+ var maxLevel = deMath.clamp(Math.floor(maxLod + 0.5), minTexLevel, maxTexLevel);
+
+ assertMsgOptions(minLevel <= maxLevel, 'Invalid texture levels.', false, true);
+
+ for (var level = minLevel; level <= maxLevel; level++) {
+ if (tcuTexCompareVerifier.isLevelCompareResultValid(texture.getLevel(level), sampler, tcuTexVerifierUtil.getLevelFilter(sampler.minFilter), prec, deMath.swizzle(coord, [0, 1]), layer, cmpReference, result))
+ return true;
+ }
+ } else {
+ if (tcuTexCompareVerifier.isLevelCompareResultValid(texture.getLevel(0), sampler, sampler.minFilter, prec, deMath.swizzle(coord, [0, 1]), layer, cmpReference, result))
+ return true;
+ }
+ }
+ }
+
+ return false;
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexLookupVerifier.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexLookupVerifier.js
new file mode 100644
index 0000000000..6b471998aa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexLookupVerifier.js
@@ -0,0 +1,2225 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.common.tcuTexLookupVerifier');
+goog.require('framework.common.tcuTexVerifierUtil');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.delibs.debase.deMath');
+
+goog.scope(function() {
+
+ var tcuTexLookupVerifier = framework.common.tcuTexLookupVerifier;
+ var tcuTexture = framework.common.tcuTexture;
+ var tcuTextureUtil = framework.common.tcuTextureUtil;
+ var tcuTexVerifierUtil = framework.common.tcuTexVerifierUtil;
+ var deMath = framework.delibs.debase.deMath;
+
+ /** @typedef {(tcuTexLookupVerifier.LookupPrecision|{tcuTexLookupVerifier.LookupPrecision})} */
+ tcuTexLookupVerifier.PrecType;
+
+ /**
+ * Generic lookup precision parameters
+ * @constructor
+ * @struct
+ * @param {Array<number>=} coordBits
+ * @param {Array<number>=} uvwBits
+ * @param {Array<number>=} colorThreshold
+ * @param {Array<boolean>=} colorMask
+ */
+ tcuTexLookupVerifier.LookupPrecision = function(coordBits, uvwBits, colorThreshold, colorMask) {
+ /** @type {Array<number>} */ this.coordBits = coordBits || [22, 22, 22];
+ /** @type {Array<number>} */ this.uvwBits = uvwBits || [16, 16, 16];
+ /** @type {Array<number>} */ this.colorThreshold = colorThreshold || [0, 0, 0, 0];
+ /** @type {Array<boolean>} */ this.colorMask = colorMask || [true, true, true, true];
+ };
+
+ /**
+ * Lod computation precision parameters
+ * @constructor
+ * @struct
+ * @param {number=} derivateBits
+ * @param {number=} lodBits
+ */
+ tcuTexLookupVerifier.LodPrecision = function(derivateBits, lodBits) {
+ /** @type {number} */ this.derivateBits = derivateBits === undefined ? 22 : derivateBits;
+ /** @type {number} */ this.lodBits = lodBits === undefined ? 16 : lodBits;
+ };
+
+ /**
+ * @enum {number}
+ */
+ tcuTexLookupVerifier.TexLookupScaleMode = {
+ MINIFY: 0,
+ MAGNIFY: 1
+ };
+
+ // Generic utilities
+
+ /**
+ * @param {tcuTexture.Sampler} sampler
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isSamplerSupported = function(sampler) {
+ return sampler.compare == tcuTexture.CompareMode.COMPAREMODE_NONE &&
+ tcuTexVerifierUtil.isWrapModeSupported(sampler.wrapS) &&
+ tcuTexVerifierUtil.isWrapModeSupported(sampler.wrapT) &&
+ tcuTexVerifierUtil.isWrapModeSupported(sampler.wrapR);
+ };
+
+ // Color read & compare utilities
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} access
+ * @param {number} x
+ * @param {number} y
+ * @param {number} z
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.coordsInBounds = function(access, x, y, z) {
+ return deMath.deInBounds32(x, 0, access.getWidth()) && deMath.deInBounds32(y, 0, access.getHeight()) && deMath.deInBounds32(z, 0, access.getDepth());
+ };
+
+ /**
+ * @param {tcuTexture.TextureFormat} format
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isSRGB = function(format) {
+ return format.order == tcuTexture.ChannelOrder.sRGB || format.order == tcuTexture.ChannelOrder.sRGBA;
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} access
+ * @param {tcuTexture.Sampler} sampler
+ * @param {number} i
+ * @param {number} j
+ * @param {number} k
+ * @return {Array<number>}
+ */
+ tcuTexLookupVerifier.lookupScalar = function(access, sampler, i, j, k) {
+ if (tcuTexLookupVerifier.coordsInBounds(access, i, j, k))
+ return access.getPixel(i, j, k);
+ else
+ return deMath.toIVec(sampler.borderColor);
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} access
+ * @param {tcuTexture.Sampler} sampler
+ * @param {number} i
+ * @param {number} j
+ * @param {number} k
+ * @return {Array<number>}
+ */
+ tcuTexLookupVerifier.lookupFloat = function(access, sampler, i, j, k) {
+ // Specialization for float lookups: sRGB conversion is performed as specified in format.
+ if (tcuTexLookupVerifier.coordsInBounds(access, i, j, k)) {
+ /** @type {Array<number>} */ var p = access.getPixel(i, j, k);
+ return tcuTexLookupVerifier.isSRGB(access.getFormat()) ? tcuTextureUtil.sRGBToLinear(p) : p;
+ } else
+ return sampler.borderColor;
+ };
+ /**
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {Array<number>} ref
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isColorValid = function(prec, ref, result) {
+ return deMath.boolAll(
+ deMath.logicalOrBool(
+ deMath.lessThanEqual(deMath.absDiff(ref, result), prec.colorThreshold),
+ deMath.logicalNotBool(prec.colorMask)));
+ };
+
+ /**
+ * @constructor
+ * @struct
+ * @param {Array<number>=} p00
+ * @param {Array<number>=} p01
+ * @param {Array<number>=} p10
+ * @param {Array<number>=} p11
+ */
+ tcuTexLookupVerifier.ColorQuad = function(p00, p01, p10, p11) {
+ /** @type {Array<number>} */ this.p00 = p00 || null; //!< (0, 0)
+ /** @type {Array<number>} */ this.p01 = p01 || null; //!< (1, 0)
+ /** @type {Array<number>} */ this.p10 = p10 || null; //!< (0, 1)
+ /** @type {Array<number>} */ this.p11 = p11 || null; //!< (1, 1)
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} level
+ * @param {tcuTexture.Sampler} sampler
+ * @param {number} x0
+ * @param {number} x1
+ * @param {number} y0
+ * @param {number} y1
+ * @param {number} z
+ * @return {tcuTexLookupVerifier.ColorQuad}
+ */
+ tcuTexLookupVerifier.lookupQuad = function(level, sampler, x0, x1, y0, y1, z) {
+ var p00 = tcuTexLookupVerifier.lookupFloat(level, sampler, x0, y0, z);
+ var p10 = tcuTexLookupVerifier.lookupFloat(level, sampler, x1, y0, z);
+ var p01 = tcuTexLookupVerifier.lookupFloat(level, sampler, x0, y1, z);
+ var p11 = tcuTexLookupVerifier.lookupFloat(level, sampler, x1, y1, z);
+ return new tcuTexLookupVerifier.ColorQuad(p00, p01, p10, p11);
+ };
+
+ /**
+ * @constructor
+ * @struct
+ * @param {Array<number>=} p0
+ * @param {Array<number>=} p1
+ */
+ tcuTexLookupVerifier.ColorLine = function(p0, p1) {
+ /** @type {Array<number>} */ this.p0 = p0 || null; //!< 0
+ /** @type {Array<number>} */ this.p1 = p1 || null; //!< 1
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} level
+ * @param {tcuTexture.Sampler} sampler
+ * @param {number} x0
+ * @param {number} x1
+ * @param {number} y
+ * @return {tcuTexLookupVerifier.ColorLine}
+ */
+ tcuTexLookupVerifier.lookupLine = function(level, sampler, x0, x1, y) {
+ return new tcuTexLookupVerifier.ColorLine(
+ tcuTexLookupVerifier.lookupFloat(level, sampler, x0, y, 0),
+ tcuTexLookupVerifier.lookupFloat(level, sampler, x1, y, 0)
+ );
+ };
+
+ /**
+ * @param {Array<number>} vec
+ * @return {number}
+ */
+ tcuTexLookupVerifier.minComp = function(vec) {
+ /** @type {number} */ var minVal = vec[0];
+ for (var ndx = 1; ndx < vec.length; ndx++)
+ minVal = Math.min(minVal, vec[ndx]);
+ return minVal;
+ };
+
+ /**
+ * @param {Array<number>} vec
+ * @return {number}
+ */
+ tcuTexLookupVerifier.maxComp = function(vec) {
+ /** @type {number} */ var maxVal = vec[0];
+ for (var ndx = 1; ndx < vec.length; ndx++)
+ maxVal = Math.max(maxVal, vec[ndx]);
+ return maxVal;
+ };
+
+ /**
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {tcuTexLookupVerifier.ColorLine} line
+ * @return {number}
+ */
+ tcuTexLookupVerifier.computeBilinearSearchStepFromFloatLine = function(prec, line) {
+ assertMsgOptions(deMath.boolAll(deMath.greaterThan(prec.colorThreshold, [0, 0, 0, 0])), 'Threshold not greater than 0.', false, true);
+
+ /** @type {number} */ var maxSteps = 1 << 16;
+ /** @type {Array<number>} */ var d = deMath.absDiff(line.p1, line.p0);
+ /** @type {Array<number>} */ var stepCount = deMath.divide([d, d, d, d], prec.colorThreshold);
+ /** @type {Array<number>} */
+ var minStep = deMath.divide([1, 1, 1, 1], deMath.add(stepCount, [1, 1, 1, 1]));
+ /** @type {number} */ var step = Math.max(tcuTexLookupVerifier.minComp(minStep), 1 / maxSteps);
+
+ return step;
+ };
+
+ /**
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {tcuTexLookupVerifier.ColorQuad} quad
+ * @return {number}
+ */
+ tcuTexLookupVerifier.computeBilinearSearchStepFromFloatQuad = function(prec, quad) {
+ assertMsgOptions(deMath.boolAll(deMath.greaterThan(prec.colorThreshold, [0, 0, 0, 0])), 'Threshold not greater than 0.', false, true);
+
+ /** @type {number} */ var maxSteps = 1 << 16;
+ /** @type {Array<number>} */ var d0 = deMath.absDiff(quad.p10, quad.p00);
+ /** @type {Array<number>} */ var d1 = deMath.absDiff(quad.p01, quad.p00);
+ /** @type {Array<number>} */ var d2 = deMath.absDiff(quad.p11, quad.p10);
+ /** @type {Array<number>} */ var d3 = deMath.absDiff(quad.p11, quad.p01);
+ /** @type {Array<number>} */ var maxD = deMath.max(d0, deMath.max(d1, deMath.max(d2, d3)));
+ /** @type {Array<number>} */ var stepCount = deMath.divide(maxD, prec.colorThreshold);
+ /** @type {Array<number>} */ var minStep = deMath.divide([1, 1, 1, 1], deMath.add(stepCount, [1, 1, 1, 1]));
+ /** @type {number} */ var step = Math.max(tcuTexLookupVerifier.minComp(minStep), 1 / maxSteps);
+
+ return step;
+ };
+
+ /**
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @return {number}
+ */
+ tcuTexLookupVerifier.computeBilinearSearchStepForUnorm = function(prec) {
+ assertMsgOptions(deMath.boolAll(deMath.greaterThan(prec.colorThreshold, [0, 0, 0, 0])), 'Threshold not greater than 0.', false, true);
+
+ /** @type {Array<number>} */ var stepCount = deMath.divide([1, 1, 1, 1], prec.colorThreshold);
+ /** @type {Array<number>} */ var minStep = deMath.divide([1, 1, 1, 1], (deMath.add(stepCount, [1, 1, 1, 1])));
+ /** @type {number} */ var step = tcuTexLookupVerifier.minComp(minStep);
+
+ return step;
+ };
+
+ /**
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @return {number}
+ */
+ tcuTexLookupVerifier.computeBilinearSearchStepForSnorm = function(prec) {
+ assertMsgOptions(deMath.boolAll(deMath.greaterThan(prec.colorThreshold, [0, 0, 0, 0])), 'Threshold not greater than 0.', false, true);
+
+ /** @type {Array<number>} */ var stepCount = deMath.divide([2.0, 2.0, 2.0, 2.0], prec.colorThreshold);
+ /** @type {Array<number>} */ var minStep = deMath.divide([1, 1, 1, 1], deMath.add(stepCount, [1, 1, 1, 1]));
+ /** @type {number} */ var step = tcuTexLookupVerifier.minComp(minStep);
+
+ return step;
+ };
+
+ /**
+ * @param {tcuTexLookupVerifier.ColorLine} line
+ * @return {Array<number>}
+ */
+ tcuTexLookupVerifier.minLine = function(line) {
+ return deMath.min(line.p0, line.p1);
+ };
+
+ /**
+ * @param {tcuTexLookupVerifier.ColorLine} line
+ * @return {Array<number>}
+ */
+ tcuTexLookupVerifier.maxLine = function(line) {
+ var max = deMath.max;
+ return max(line.p0, line.p1);
+ };
+
+ /**
+ * @param {tcuTexLookupVerifier.ColorQuad} quad
+ * @return {Array<number>}
+ */
+ tcuTexLookupVerifier.minQuad = function(quad) {
+ var min = deMath.min;
+ return min(quad.p00, min(quad.p10, min(quad.p01, quad.p11)));
+ };
+
+ /**
+ * @param {tcuTexLookupVerifier.ColorQuad} quad
+ * @return {Array<number>}
+ */
+ tcuTexLookupVerifier.maxQuad = function(quad) {
+ var max = deMath.max;
+ return max(quad.p00, max(quad.p10, max(quad.p01, quad.p11)));
+ };
+
+ /**
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {tcuTexLookupVerifier.ColorQuad} quad
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isInColorBounds_1Quad = function(prec, quad, result) {
+ var quadMin = tcuTexLookupVerifier.minQuad;
+ var quadMax = tcuTexLookupVerifier.maxQuad;
+ /** @type {Array<number>} */ var minVal = deMath.subtract(quadMin(quad), prec.colorThreshold);
+ /** @type {Array<number>} */ var maxVal = deMath.add(quadMax(quad), prec.colorThreshold);
+ return deMath.boolAll(
+ deMath.logicalOrBool(
+ deMath.logicalAndBool(
+ deMath.greaterThanEqual(result, minVal),
+ deMath.lessThanEqual(result, maxVal)),
+ deMath.logicalNotBool(prec.colorMask)));
+ };
+
+ /**
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {tcuTexLookupVerifier.ColorQuad} quad0
+ * @param {tcuTexLookupVerifier.ColorQuad} quad1
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isInColorBounds_2Quad = function(prec, quad0, quad1, result) {
+ var min = deMath.min;
+ var max = deMath.max;
+ var quadMin = tcuTexLookupVerifier.minQuad;
+ var quadMax = tcuTexLookupVerifier.maxQuad;
+ /** @type {Array<number>} */ var minVal = deMath.subtract(min(quadMin(quad0), quadMin(quad1)), prec.colorThreshold);
+ /** @type {Array<number>} */ var maxVal = deMath.add(max(quadMax(quad0), quadMax(quad1)), prec.colorThreshold);
+ return deMath.boolAll(
+ deMath.logicalOrBool(
+ deMath.logicalAndBool(
+ deMath.greaterThanEqual(result, minVal),
+ deMath.lessThanEqual(result, maxVal)),
+ deMath.logicalNotBool(prec.colorMask)));
+ };
+
+ /**
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {tcuTexLookupVerifier.ColorLine} line0
+ * @param {tcuTexLookupVerifier.ColorLine} line1
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isInColorBounds_2Line = function(prec, line0, line1, result) {
+ var min = deMath.min;
+ var max = deMath.max;
+ var lineMin = tcuTexLookupVerifier.minLine;
+ var lineMax = tcuTexLookupVerifier.maxLine;
+ /** @type {Array<number>} */ var minVal = deMath.subtract(min(lineMin(line0), lineMin(line1)), prec.colorThreshold);
+ /** @type {Array<number>} */ var maxVal = deMath.add(max(lineMax(line0), lineMax(line1)), prec.colorThreshold);
+ return deMath.boolAll(
+ deMath.logicalOrBool(
+ deMath.logicalAndBool(
+ deMath.greaterThanEqual(result, minVal),
+ deMath.lessThanEqual(result, maxVal)),
+ deMath.logicalNotBool(prec.colorMask)));
+ };
+
+ /**
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {tcuTexLookupVerifier.ColorQuad} quad00
+ * @param {tcuTexLookupVerifier.ColorQuad} quad01
+ * @param {tcuTexLookupVerifier.ColorQuad} quad10
+ * @param {tcuTexLookupVerifier.ColorQuad} quad11
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isInColorBounds_4Quad = function(prec, quad00, quad01, quad10, quad11, result) {
+ var min = deMath.min;
+ var max = deMath.max;
+ var quadMin = tcuTexLookupVerifier.minQuad;
+ var quadMax = tcuTexLookupVerifier.maxQuad;
+ /** @type {Array<number>} */ var minVal = deMath.subtract(min(quadMin(quad00), min(quadMin(quad01), min(quadMin(quad10), quadMin(quad11)))), prec.colorThreshold);
+ /** @type {Array<number>} */ var maxVal = deMath.add(max(quadMax(quad00), max(quadMax(quad01), max(quadMax(quad10), quadMax(quad11)))), prec.colorThreshold);
+ return deMath.boolAll(
+ deMath.logicalOrBool(
+ deMath.logicalAndBool(
+ deMath.greaterThanEqual(result, minVal),
+ deMath.lessThanEqual(result, maxVal)),
+ deMath.logicalNotBool(prec.colorMask)));
+ };
+
+ // Range search utilities
+
+ /**
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {Array<number>} c0
+ * @param {Array<number>} c1
+ * @param {Array<number>} fBounds
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isLinearRangeValid = function(prec, c0, c1, fBounds, result) {
+ // This is basically line segment - AABB test. Valid interpolation line is checked
+ // against result AABB constructed by applying threshold.
+
+ /** @type {Array<number>} */ var rMin = deMath.subtract(result, prec.colorThreshold);
+ /** @type {Array<number>} */ var rMax = deMath.add(result, prec.colorThreshold);
+
+ // Algorithm: For each component check whether segment endpoints are inside, or intersect with slab.
+ // If all intersect or are inside, line segment intersects the whole 4D AABB.
+ for (var compNdx = 0; compNdx < 4; compNdx++) {
+ if (!prec.colorMask[compNdx])
+ continue;
+
+ /** @type {number} */ var i0 = c0[compNdx] * (1 - fBounds[0]) + c1[compNdx] * fBounds[0];
+ /** @type {number} */ var i1 = c0[compNdx] * (1 - fBounds[1]) + c1[compNdx] * fBounds[1];
+ if ((i0 > rMax[compNdx] && i1 > rMax[compNdx]) ||
+ (i0 < rMin[compNdx] && i1 < rMin[compNdx])) {
+ return false;
+ }
+ }
+
+ return true;
+ };
+
+ /**
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {tcuTexLookupVerifier.ColorQuad} quad
+ * @param {Array<number>} xBounds
+ * @param {Array<number>} yBounds
+ * @param {number} searchStep
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isBilinearRangeValid = function(prec, quad, xBounds, yBounds, searchStep, result) {
+ assertMsgOptions(xBounds[0] <= xBounds[1], 'Out of bounds: X direction.', false, true);
+ assertMsgOptions(yBounds[0] <= yBounds[1], 'Out of bounds: Y direction.', false, true);
+
+ if (!tcuTexLookupVerifier.isInColorBounds_1Quad(prec, quad, result))
+ return false;
+
+ for (var x = xBounds[0]; x < xBounds[1] + searchStep; x += searchStep) {
+ /** @type {number} */ var a = Math.min(x, xBounds[1]);
+ /** @type {Array<number>} */ var c0 = deMath.add(deMath.scale(quad.p00, (1 - a)), deMath.scale(quad.p10, a));
+ /** @type {Array<number>} */ var c1 = deMath.add(deMath.scale(quad.p01, (1 - a)), deMath.scale(quad.p11, a));
+
+ if (tcuTexLookupVerifier.isLinearRangeValid(prec, c0, c1, yBounds, result))
+ return true;
+ }
+
+ return false;
+ };
+
+ /**
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {tcuTexLookupVerifier.ColorQuad} quad0
+ * @param {tcuTexLookupVerifier.ColorQuad} quad1
+ * @param {Array<number>} xBounds
+ * @param {Array<number>} yBounds
+ * @param {Array<number>} zBounds
+ * @param {number} searchStep
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isTrilinearRangeValid = function(prec, quad0, quad1, xBounds, yBounds, zBounds, searchStep, result) {
+ assertMsgOptions(xBounds[0] <= xBounds[1], 'Out of bounds: X direction.', false, true);
+ assertMsgOptions(yBounds[0] <= yBounds[1], 'Out of bounds: Y direction.', false, true);
+ assertMsgOptions(zBounds[0] <= zBounds[1], 'Out of bounds: Z direction.', false, true);
+
+ if (!tcuTexLookupVerifier.isInColorBounds_2Quad(prec, quad0, quad1, result))
+ return false;
+
+ for (var x = xBounds[0]; x < xBounds[1] + searchStep; x += searchStep) {
+ for (var y = yBounds[0]; y < yBounds[1] + searchStep; y += searchStep) {
+ /** @type {number} */ var a = Math.min(x, xBounds[1]);
+ /** @type {number} */ var b = Math.min(y, yBounds[1]);
+ /** @type {Array<number>} */
+ var c0 = deMath.add(
+ deMath.add(
+ deMath.add(
+ deMath.scale(quad0.p00, (1 - a) * (1 - b)),
+ deMath.scale(quad0.p10, a * (1 - b))),
+ deMath.scale(quad0.p01, (1 - a) * b)),
+ deMath.scale(quad0.p11, a * b));
+ /** @type {Array<number>} */
+ var c1 = deMath.add(
+ deMath.add(
+ deMath.add(
+ deMath.scale(quad1.p00, (1 - a) * (1 - b)),
+ deMath.scale(quad1.p10, a * (1 - b))),
+ deMath.scale(quad1.p01, (1 - a) * b)),
+ deMath.scale(quad1.p11, a * b));
+
+ if (tcuTexLookupVerifier.isLinearRangeValid(prec, c0, c1, zBounds, result))
+ return true;
+ }
+ }
+
+ return false;
+ };
+
+ /**
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {tcuTexLookupVerifier.ColorQuad} quad0
+ * @param {tcuTexLookupVerifier.ColorQuad} quad1
+ * @param {Array<number>} xBounds0
+ * @param {Array<number>} yBounds0
+ * @param {Array<number>} xBounds1
+ * @param {Array<number>} yBounds1
+ * @param {Array<number>} zBounds
+ * @param {number} searchStep
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.is2DTrilinearFilterResultValid = function(prec, quad0, quad1, xBounds0, yBounds0, xBounds1, yBounds1, zBounds, searchStep, result) {
+ assertMsgOptions(xBounds0[0] <= xBounds0[1], 'Out of bounds: X direction.', false, true);
+ assertMsgOptions(yBounds0[0] <= yBounds0[1], 'Out of bounds: Y direction.', false, true);
+ assertMsgOptions(xBounds1[0] <= xBounds1[1], 'Out of bounds: X direction.', false, true);
+ assertMsgOptions(yBounds1[0] <= yBounds1[1], 'Out of bounds: Y direction.', false, true);
+
+ if (!tcuTexLookupVerifier.isInColorBounds_2Quad(prec, quad0, quad1, result))
+ return false;
+
+ for (var x0 = xBounds0[0]; x0 < xBounds0[1] + searchStep; x0 += searchStep) {
+ for (var y0 = yBounds0[0]; y0 < yBounds0[1] + searchStep; y0 += searchStep) {
+ /** @type {number} */ var a0 = Math.min(x0, xBounds0[1]);
+ /** @type {number} */ var b0 = Math.min(y0, yBounds0[1]);
+ /** @type {Array<number>} */
+ var c0 = deMath.add(
+ deMath.add(
+ deMath.add(
+ deMath.scale(quad0.p00, (1 - a0) * (1 - b0)),
+ deMath.scale(quad0.p10, a0 * (1 - b0))),
+ deMath.scale(quad0.p01, (1 - a0) * b0)),
+ deMath.scale(quad0.p11, a0 * b0));
+
+ for (var x1 = xBounds1[0]; x1 <= xBounds1[1]; x1 += searchStep) {
+ for (var y1 = yBounds1[0]; y1 <= yBounds1[1]; y1 += searchStep) {
+ /** @type {number} */ var a1 = Math.min(x1, xBounds1[1]);
+ /** @type {number} */ var b1 = Math.min(y1, yBounds1[1]);
+ /** @type {Array<number>} */
+ var c1 = deMath.add(
+ deMath.add(
+ deMath.add(
+ deMath.scale(quad1.p00, (1 - a1) * (1 - b1)),
+ deMath.scale(quad1.p10, a1 * (1 - b1))),
+ deMath.scale(quad1.p01, (1 - a1) * b1)),
+ deMath.scale(quad1.p11, a1 * b1));
+
+ if (tcuTexLookupVerifier.isLinearRangeValid(prec, c0, c1, zBounds, result))
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+ };
+
+ /**
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {tcuTexLookupVerifier.ColorQuad} quad00
+ * @param {tcuTexLookupVerifier.ColorQuad} quad01
+ * @param {tcuTexLookupVerifier.ColorQuad} quad10
+ * @param {tcuTexLookupVerifier.ColorQuad} quad11
+ * @param {Array<number>} xBounds0
+ * @param {Array<number>} yBounds0
+ * @param {Array<number>} zBounds0
+ * @param {Array<number>} xBounds1
+ * @param {Array<number>} yBounds1
+ * @param {Array<number>} zBounds1
+ * @param {Array<number>} wBounds
+ * @param {number} searchStep
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.is3DTrilinearFilterResultValid = function(prec, quad00, quad01, quad10, quad11, xBounds0, yBounds0, zBounds0, xBounds1, yBounds1, zBounds1, wBounds, searchStep, result) {
+ assertMsgOptions(xBounds0[0] <= xBounds0[1], 'Out of bounds: X direction.', false, true);
+ assertMsgOptions(yBounds0[0] <= yBounds0[1], 'Out of bounds: Y direction.', false, true);
+ assertMsgOptions(zBounds0[0] <= zBounds0[1], 'Out of bounds: Z direction.', false, true);
+ assertMsgOptions(xBounds1[0] <= xBounds1[1], 'Out of bounds: X direction.', false, true);
+ assertMsgOptions(yBounds1[0] <= yBounds1[1], 'Out of bounds: Y direction.', false, true);
+ assertMsgOptions(zBounds1[0] <= zBounds1[1], 'Out of bounds: Z direction.', false, true);
+
+ if (!tcuTexLookupVerifier.isInColorBounds_4Quad(prec, quad00, quad01, quad10, quad11, result))
+ return false;
+
+ function biInterp(result, p00, p01, p10, p11, s00, s01, s10, s11) {
+ for (var ii = 0; ii < 4; ++ii) {
+ result[ii] = p00[ii] * s00 + p10[ii] * s10 + p01[ii] * s01 + p11[ii] * s11;
+ }
+ }
+
+ function interp(result, p0, p1, s) {
+ for (var ii = 0; ii < 4; ++ii) {
+ result[ii] = p0[ii] * (1 - s) + p1[ii] * s;
+ }
+ }
+
+ /** @type {Array<number>} */ var c00 = [0, 0, 0, 0];
+ /** @type {Array<number>} */ var c01 = [0, 0, 0, 0];
+ /** @type {Array<number>} */ var c10 = [0, 0, 0, 0];
+ /** @type {Array<number>} */ var c11 = [0, 0, 0, 0];
+ /** @type {Array<number>} */ var cz0 = [0, 0, 0, 0];
+ /** @type {Array<number>} */ var cz1 = [0, 0, 0, 0];
+
+ for (var x0 = xBounds0[0]; x0 < xBounds0[1] + searchStep; x0 += searchStep) {
+ for (var y0 = yBounds0[0]; y0 < yBounds0[1] + searchStep; y0 += searchStep) {
+ /** @type {number} */ var a0 = Math.min(x0, xBounds0[1]);
+ /** @type {number} */ var b0 = Math.min(y0, yBounds0[1]);
+
+ /** @type {number} */ var s00 = (1 - a0) * (1 - b0);
+ /** @type {number} */ var s01 = (1 - a0) * b0;
+ /** @type {number} */ var s10 = a0 * (1 - b0);
+ /** @type {number} */ var s11 = a0 * b0;
+
+ biInterp(c00, quad00.p00, quad00.p01, quad00.p10, quad00.p11, s00, s01, s10, s11);
+ biInterp(c01, quad01.p00, quad01.p01, quad01.p10, quad01.p11, s00, s01, s10, s11);
+
+ for (var z0 = zBounds0[0]; z0 < zBounds0[1] + searchStep; z0 += searchStep) {
+ /** @type {number} */ var c0 = Math.min(z0, zBounds0[1]);
+ interp(cz0, c00, c01, c0);
+
+ for (var x1 = xBounds1[0]; x1 < xBounds1[1] + searchStep; x1 += searchStep) {
+ for (var y1 = yBounds1[0]; y1 < yBounds1[1] + searchStep; y1 += searchStep) {
+ /** @type {number} */ var a1 = Math.min(x1, xBounds1[1]);
+ /** @type {number} */ var b1 = Math.min(y1, yBounds1[1]);
+
+ /** @type {number} */ var t00 = (1 - a1) * (1 - b1);
+ /** @type {number} */ var t01 = (1 - a1) * b1;
+ /** @type {number} */ var t10 = a1 * (1 - b1);
+ /** @type {number} */ var t11 = a1 * b1;
+
+ biInterp(c10, quad10.p00, quad10.p01, quad10.p10, quad10.p11, t00, t01, t10, t11);
+ biInterp(c11, quad11.p00, quad11.p01, quad11.p10, quad11.p11, t00, t01, t10, t11);
+
+ for (var z1 = zBounds1[0]; z1 < zBounds1[1] + searchStep; z1 += searchStep) {
+ /** @type {number} */ var c1 = Math.min(z1, zBounds1[1]);
+ interp(cz1, c10, c11, c1);
+
+ if (tcuTexLookupVerifier.isLinearRangeValid(prec, cz0, cz1, wBounds, result))
+ return true;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return false;
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} level
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {number} coordX
+ * @param {number} coordY
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isNearestSampleResultValid_CoordXYAsNumber = function(level, sampler, prec, coordX, coordY, result) {
+ assertMsgOptions(level.getDepth() == 1, 'Depth must be 1.', false, true);
+
+ /** @type {Array<number>} */
+ var uBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, level.getWidth(), coordX, prec.coordBits[0], prec.uvwBits[0]);
+
+ /** @type {number} */ var minI = Math.floor(uBounds[0]);
+ /** @type {number} */ var maxI = Math.floor(uBounds[1]);
+
+ for (var i = minI; i <= maxI; i++) {
+ /** @type {number} */ var x = tcuTexVerifierUtil.wrap(sampler.wrapS, i, level.getWidth());
+ /** @type {Array<number>} */ var color;
+ if (tcuTexLookupVerifier.isSRGB(level.getFormat())) {
+ color = tcuTexLookupVerifier.lookupFloat(level, sampler, x, coordY, 0);
+ } else {
+ color = tcuTexLookupVerifier.lookupScalar(level, sampler, x, coordY, 0);
+ }
+
+ if (tcuTexLookupVerifier.isColorValid(prec, color, result))
+ return true;
+ }
+
+ return false;
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} level
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {Array<number>} coord vec2
+ * @param {number} coordZ int
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isNearestSampleResultValid_CoordAsVec2AndInt = function(level, sampler, prec, coord, coordZ, result) {
+ /** @type {Array<number>} */
+ var uBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, level.getWidth(), coord[0], prec.coordBits[0], prec.uvwBits[0]);
+ /** @type {Array<number>} */
+ var vBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, level.getHeight(), coord[1], prec.coordBits[1], prec.uvwBits[1]);
+
+ // Integer coordinates - without wrap mode
+ /** @type {number} */ var minI = Math.floor(uBounds[0]);
+ /** @type {number} */ var maxI = Math.floor(uBounds[1]);
+ /** @type {number} */ var minJ = Math.floor(vBounds[0]);
+ /** @type {number} */ var maxJ = Math.floor(vBounds[1]);
+
+ // \todo [2013-07-03 pyry] This could be optimized by first computing ranges based on wrap mode.
+
+ for (var j = minJ; j <= maxJ; j++)
+ for (var i = minI; i <= maxI; i++) {
+ /** @type {number} */ var x = tcuTexVerifierUtil.wrap(sampler.wrapS, i, level.getWidth());
+ /** @type {number} */ var y = tcuTexVerifierUtil.wrap(sampler.wrapT, j, level.getHeight());
+ /** @type {Array<number>} */ var color;
+ if (tcuTexLookupVerifier.isSRGB(level.getFormat())) {
+ color = tcuTexLookupVerifier.lookupFloat(level, sampler, x, y, coordZ);
+ } else {
+ color = tcuTexLookupVerifier.lookupScalar(level, sampler, x, y, coordZ);
+ }
+
+ if (tcuTexLookupVerifier.isColorValid(prec, color, result))
+ return true;
+ }
+
+ return false;
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} level
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {Array<number>} coord vec3
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isNearestSampleResultValid_CoordAsVec3 = function(level, sampler, prec, coord, result) {
+ /** @type {Array<number>} */
+ var uBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, level.getWidth(), coord[0], prec.coordBits[0], prec.uvwBits[0]);
+ /** @type {Array<number>} */
+ var vBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, level.getHeight(), coord[1], prec.coordBits[1], prec.uvwBits[1]);
+ /** @type {Array<number>} */
+ var wBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, level.getDepth(), coord[2], prec.coordBits[2], prec.uvwBits[2]);
+
+ // Integer coordinates - without wrap mode
+ /** @type {number} */ var minI = Math.floor(uBounds[0]);
+ /** @type {number} */ var maxI = Math.floor(uBounds[1]);
+ /** @type {number} */ var minJ = Math.floor(vBounds[0]);
+ /** @type {number} */ var maxJ = Math.floor(vBounds[1]);
+ /** @type {number} */ var minK = Math.floor(wBounds[0]);
+ /** @type {number} */ var maxK = Math.floor(wBounds[1]);
+
+ // \todo [2013-07-03 pyry] This could be optimized by first computing ranges based on wrap mode.
+
+ for (var k = minK; k <= maxK; k++) {
+ for (var j = minJ; j <= maxJ; j++) {
+ for (var i = minI; i <= maxI; i++) {
+ /** @type {number} */ var x = tcuTexVerifierUtil.wrap(sampler.wrapS, i, level.getWidth());
+ /** @type {number} */ var y = tcuTexVerifierUtil.wrap(sampler.wrapT, j, level.getHeight());
+ /** @type {number} */ var z = tcuTexVerifierUtil.wrap(sampler.wrapR, k, level.getDepth());
+ /** @type {Array<number>} */ var color;
+ if (tcuTexLookupVerifier.isSRGB(level.getFormat())) {
+ color = tcuTexLookupVerifier.lookupFloat(level, sampler, x, y, z);
+ } else {
+ color = tcuTexLookupVerifier.lookupScalar(level, sampler, x, y, z);
+ }
+
+ if (tcuTexLookupVerifier.isColorValid(prec, color, result))
+ return true;
+ }
+ }
+ }
+
+ return false;
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} level
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {number} coordX
+ * @param {number} coordY
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isLinearSampleResultValid_CoordXYAsNumber = function(level, sampler, prec, coordX, coordY, result) {
+ /** @type {Array<number>} */ var uBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getWidth(), coordX, prec.coordBits[0], prec.uvwBits[0]);
+
+ /** @type {number} */ var minI = Math.floor(uBounds[0] - 0.5);
+ /** @type {number} */ var maxI = Math.floor(uBounds[1] - 0.5);
+
+ /** @type {number} */ var w = level.getWidth();
+
+ for (var i = minI; i <= maxI; i++) {
+ // Wrapped coordinates
+ /** @type {number} */ var x0 = tcuTexVerifierUtil.wrap(sampler.wrapS, i, w);
+ /** @type {number} */ var x1 = tcuTexVerifierUtil.wrap(sampler.wrapS, i + 1, w);
+
+ // Bounds for filtering factors
+ /** @type {number} */ var minA = deMath.clamp((uBounds[0] - 0.5) - i, 0, 1);
+ /** @type {number} */ var maxA = deMath.clamp((uBounds[1] - 0.5) - i, 0, 1);
+
+ /** @type {Array<number>} */ var colorA = tcuTexLookupVerifier.lookupFloat(level, sampler, x0, coordY, 0);
+ /** @type {Array<number>} */ var colorB = tcuTexLookupVerifier.lookupFloat(level, sampler, x1, coordY, 0);
+
+ if (tcuTexLookupVerifier.isLinearRangeValid(prec, colorA, colorB, [minA, maxA], result))
+ return true;
+ }
+
+ return false;
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} level
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {Array<number>} coord vec2
+ * @param {number} coordZ int
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isLinearSampleResultValid_CoordAsVec2AndInt = function(level, sampler, prec, coord, coordZ, result) {
+ /** @type {Array<number>} */ var uBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getWidth(), coord[0], prec.coordBits[0], prec.uvwBits[0]);
+ /** @type {Array<number>} */ var vBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, level.getHeight(), coord[1], prec.coordBits[1], prec.uvwBits[1]);
+
+ // Integer coordinate bounds for (x0,y0) - without wrap mode
+ /** @type {number} */ var minI = Math.floor(uBounds[0] - 0.5);
+ /** @type {number} */ var maxI = Math.floor(uBounds[1] - 0.5);
+ /** @type {number} */ var minJ = Math.floor(vBounds[0] - 0.5);
+ /** @type {number} */ var maxJ = Math.floor(vBounds[1] - 0.5);
+
+ /** @type {number} */ var w = level.getWidth();
+ /** @type {number} */ var h = level.getHeight();
+
+ /** @type {tcuTexture.TextureChannelClass} */
+ var texClass = tcuTexture.getTextureChannelClass(level.getFormat().type);
+
+ /** @type {number} */
+ var searchStep = (texClass == tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT) ? tcuTexLookupVerifier.computeBilinearSearchStepForUnorm(prec) :
+ (texClass == tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT) ? tcuTexLookupVerifier.computeBilinearSearchStepForSnorm(prec) :
+ 0; // Step is computed for floating-point quads based on texel values.
+
+ // \todo [2013-07-03 pyry] This could be optimized by first computing ranges based on wrap mode.
+
+ for (var j = minJ; j <= maxJ; j++)
+ for (var i = minI; i <= maxI; i++) {
+ // Wrapped coordinates
+ /** @type {number} */ var x0 = tcuTexVerifierUtil.wrap(sampler.wrapS, i, w);
+ /** @type {number} */ var x1 = tcuTexVerifierUtil.wrap(sampler.wrapS, i + 1, w);
+ /** @type {number} */ var y0 = tcuTexVerifierUtil.wrap(sampler.wrapT, j, h);
+ /** @type {number} */ var y1 = tcuTexVerifierUtil.wrap(sampler.wrapT, j + 1, h);
+
+ // Bounds for filtering factors
+ /** @type {number} */ var minA = deMath.clamp((uBounds[0] - 0.5) - i, 0, 1);
+ /** @type {number} */ var maxA = deMath.clamp((uBounds[1] - 0.5) - i, 0, 1);
+ /** @type {number} */ var minB = deMath.clamp((vBounds[0] - 0.5) - j, 0, 1);
+ /** @type {number} */ var maxB = deMath.clamp((vBounds[1] - 0.5) - j, 0, 1);
+
+ /** @type {tcuTexLookupVerifier.ColorQuad} */
+ var quad = tcuTexLookupVerifier.lookupQuad(level, sampler, x0, x1, y0, y1, coordZ);
+
+ if (texClass == tcuTexture.TextureChannelClass.FLOATING_POINT)
+ searchStep = tcuTexLookupVerifier.computeBilinearSearchStepFromFloatQuad(prec, quad);
+
+ if (tcuTexLookupVerifier.isBilinearRangeValid(prec, quad, [minA, maxA], [minB, maxB], searchStep, result))
+ return true;
+ }
+
+ return false;
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} level
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {Array<number>} coord vec3
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isLinearSampleResultValid_CoordAsVec3 = function(level, sampler, prec, coord, result) {
+ /** @type {Array<number>} */
+ var uBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, level.getWidth(), coord[0], prec.coordBits[0], prec.uvwBits[0]);
+ /** @type {Array<number>} */
+ var vBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, level.getHeight(), coord[1], prec.coordBits[1], prec.uvwBits[1]);
+ /** @type {Array<number>} */
+ var wBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, level.getDepth(), coord[2], prec.coordBits[2], prec.uvwBits[2]);
+
+ // Integer coordinate bounds for (x0,y0) - without wrap mode
+ /** @type {number} */ var minI = Math.floor(uBounds[0] - 0.5);
+ /** @type {number} */ var maxI = Math.floor(uBounds[1] - 0.5);
+ /** @type {number} */ var minJ = Math.floor(vBounds[0] - 0.5);
+ /** @type {number} */ var maxJ = Math.floor(vBounds[1] - 0.5);
+ /** @type {number} */ var minK = Math.floor(wBounds[0] - 0.5);
+ /** @type {number} */ var maxK = Math.floor(wBounds[1] - 0.5);
+
+ /** @type {number} */ var w = level.getWidth();
+ /** @type {number} */ var h = level.getHeight();
+ /** @type {number} */ var d = level.getDepth();
+
+ /** @type {tcuTexture.TextureChannelClass} */
+ var texClass = tcuTexture.getTextureChannelClass(level.getFormat().type);
+ /** @type {number} */
+ var searchStep = (texClass == tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT) ? tcuTexLookupVerifier.computeBilinearSearchStepForUnorm(prec) :
+ (texClass == tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT) ? tcuTexLookupVerifier.computeBilinearSearchStepForSnorm(prec) :
+ 0; // Step is computed for floating-point quads based on texel values.
+
+ // \todo [2013-07-03 pyry] This could be optimized by first computing ranges based on wrap mode.
+
+ for (var k = minK; k <= maxK; k++) {
+ for (var j = minJ; j <= maxJ; j++) {
+ for (var i = minI; i <= maxI; i++) {
+ // Wrapped coordinates
+ /** @type {number} */ var x0 = tcuTexVerifierUtil.wrap(sampler.wrapS, i, w);
+ /** @type {number} */ var x1 = tcuTexVerifierUtil.wrap(sampler.wrapS, i + 1, w);
+ /** @type {number} */ var y0 = tcuTexVerifierUtil.wrap(sampler.wrapT, j, h);
+ /** @type {number} */ var y1 = tcuTexVerifierUtil.wrap(sampler.wrapT, j + 1, h);
+ /** @type {number} */ var z0 = tcuTexVerifierUtil.wrap(sampler.wrapR, k, d);
+ /** @type {number} */ var z1 = tcuTexVerifierUtil.wrap(sampler.wrapR, k + 1, d);
+
+ // Bounds for filtering factors
+ /** @type {number} */ var minA = deMath.clamp((uBounds[0] - 0.5) - i, 0, 1);
+ /** @type {number} */ var maxA = deMath.clamp((uBounds[1] - 0.5) - i, 0, 1);
+ /** @type {number} */ var minB = deMath.clamp((vBounds[0] - 0.5) - j, 0, 1);
+ /** @type {number} */ var maxB = deMath.clamp((vBounds[1] - 0.5) - j, 0, 1);
+ /** @type {number} */ var minC = deMath.clamp((wBounds[0] - 0.5) - k, 0, 1);
+ /** @type {number} */ var maxC = deMath.clamp((wBounds[1] - 0.5) - k, 0, 1);
+
+ /** @type {tcuTexLookupVerifier.ColorQuad} */
+ var quad0 = tcuTexLookupVerifier.lookupQuad(level, sampler, x0, x1, y0, y1, z0);
+ /** @type {tcuTexLookupVerifier.ColorQuad} */
+ var quad1 = tcuTexLookupVerifier.lookupQuad(level, sampler, x0, x1, y0, y1, z1);
+
+ if (texClass == tcuTexture.TextureChannelClass.FLOATING_POINT)
+ searchStep = Math.min(tcuTexLookupVerifier.computeBilinearSearchStepFromFloatQuad(prec, quad0), tcuTexLookupVerifier.computeBilinearSearchStepFromFloatQuad(prec, quad1));
+
+ if (tcuTexLookupVerifier.isTrilinearRangeValid(prec, quad0, quad1, [minA, maxA], [minB, maxB], [minC, maxC], searchStep, result))
+ return true;
+ }
+ }
+ }
+
+ return false;
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} level0
+ * @param {tcuTexture.ConstPixelBufferAccess} level1
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {number} coord
+ * @param {number} coordY
+ * @param {Array<number>} fBounds
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isNearestMipmapLinearSampleResultValid_CoordXYAsNumber = function(level0, level1, sampler, prec, coord, coordY, fBounds, result) {
+ /** @type {number} */ var w0 = level0.getWidth();
+ /** @type {number} */ var w1 = level1.getWidth();
+
+ /** @type {Array<number>} */
+ var uBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, w0, coord, prec.coordBits[0], prec.uvwBits[0]);
+ /** @type {Array<number>} */
+ var uBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, w1, coord, prec.coordBits[0], prec.uvwBits[0]);
+
+ // Integer coordinates - without wrap mode
+ /** @type {number} */ var minI0 = Math.floor(uBounds0[0]);
+ /** @type {number} */ var maxI0 = Math.floor(uBounds0[1]);
+ /** @type {number} */ var minI1 = Math.floor(uBounds1[0]);
+ /** @type {number} */ var maxI1 = Math.floor(uBounds1[1]);
+
+ for (var i0 = minI0; i0 <= maxI0; i0++) {
+ for (var i1 = minI1; i1 <= maxI1; i1++) {
+ /** @type {Array<number>} */
+ var c0 = tcuTexLookupVerifier.lookupFloat(level0, sampler, tcuTexVerifierUtil.wrap(sampler.wrapS, i0, w0), coordY, 0);
+ /** @type {Array<number>} */
+ var c1 = tcuTexLookupVerifier.lookupFloat(level1, sampler, tcuTexVerifierUtil.wrap(sampler.wrapS, i1, w1), coordY, 0);
+
+ if (tcuTexLookupVerifier.isLinearRangeValid(prec, c0, c1, fBounds, result))
+ return true;
+ }
+ }
+
+ return false;
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} level0
+ * @param {tcuTexture.ConstPixelBufferAccess} level1
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {Array<number>} coord
+ * @param {number} coordZ
+ * @param {Array<number>} fBounds
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isNearestMipmapLinearSampleResultValid_CoordAsVec2AndInt = function(level0, level1, sampler, prec, coord, coordZ, fBounds, result) {
+ /** @type {number} */ var w0 = level0.getWidth();
+ /** @type {number} */ var w1 = level1.getWidth();
+ /** @type {number} */ var h0 = level0.getHeight();
+ /** @type {number} */ var h1 = level1.getHeight();
+
+ /** @type {Array<number>} */
+ var uBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, w0, coord[0], prec.coordBits[0], prec.uvwBits[0]);
+ /** @type {Array<number>} */
+ var uBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, w1, coord[0], prec.coordBits[0], prec.uvwBits[0]);
+ /** @type {Array<number>} */
+ var vBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, h0, coord[1], prec.coordBits[1], prec.uvwBits[1]);
+ /** @type {Array<number>} */
+ var vBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, h1, coord[1], prec.coordBits[1], prec.uvwBits[1]);
+
+ // Integer coordinates - without wrap mode
+ /** @type {number} */ var minI0 = Math.floor(uBounds0[0]);
+ /** @type {number} */ var maxI0 = Math.floor(uBounds0[1]);
+ /** @type {number} */ var minI1 = Math.floor(uBounds1[0]);
+ /** @type {number} */ var maxI1 = Math.floor(uBounds1[1]);
+ /** @type {number} */ var minJ0 = Math.floor(vBounds0[0]);
+ /** @type {number} */ var maxJ0 = Math.floor(vBounds0[1]);
+ /** @type {number} */ var minJ1 = Math.floor(vBounds1[0]);
+ /** @type {number} */ var maxJ1 = Math.floor(vBounds1[1]);
+
+ for (var j0 = minJ0; j0 <= maxJ0; j0++) {
+ for (var i0 = minI0; i0 <= maxI0; i0++) {
+ for (var j1 = minJ1; j1 <= maxJ1; j1++) {
+ for (var i1 = minI1; i1 <= maxI1; i1++) {
+ /** @type {Array<number>} */ var c0 = tcuTexLookupVerifier.lookupFloat(level0, sampler, tcuTexVerifierUtil.wrap(sampler.wrapS, i0, w0), tcuTexVerifierUtil.wrap(sampler.wrapT, j0, h0), coordZ);
+ /** @type {Array<number>} */ var c1 = tcuTexLookupVerifier.lookupFloat(level1, sampler, tcuTexVerifierUtil.wrap(sampler.wrapS, i1, w1), tcuTexVerifierUtil.wrap(sampler.wrapT, j1, h1), coordZ);
+
+ if (tcuTexLookupVerifier.isLinearRangeValid(prec, c0, c1, fBounds, result))
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} level0
+ * @param {tcuTexture.ConstPixelBufferAccess} level1
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {Array<number>} coord
+ * @param {Array<number>} fBounds
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isNearestMipmapLinearSampleResultValid_CoordAsVec3 = function(level0, level1, sampler, prec, coord, fBounds, result) {
+ /** @type {number} */ var w0 = level0.getWidth();
+ /** @type {number} */ var w1 = level1.getWidth();
+ /** @type {number} */ var h0 = level0.getHeight();
+ /** @type {number} */ var h1 = level1.getHeight();
+ /** @type {number} */ var d0 = level0.getDepth();
+ /** @type {number} */ var d1 = level1.getDepth();
+
+ /** @type {Array<number>} */
+ var uBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, w0, coord[0], prec.coordBits[0], prec.uvwBits[0]);
+ /** @type {Array<number>} */
+ var uBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, w1, coord[0], prec.coordBits[0], prec.uvwBits[0]);
+ /** @type {Array<number>} */
+ var vBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, h0, coord[1], prec.coordBits[1], prec.uvwBits[1]);
+ /** @type {Array<number>} */
+ var vBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, h1, coord[1], prec.coordBits[1], prec.uvwBits[1]);
+ /** @type {Array<number>} */
+ var wBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, d0, coord[2], prec.coordBits[2], prec.uvwBits[2]);
+ /** @type {Array<number>} */
+ var wBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, d1, coord[2], prec.coordBits[2], prec.uvwBits[2]);
+
+ // Integer coordinates - without wrap mode
+ /** @type {number} */ var minI0 = Math.floor(uBounds0[0]);
+ /** @type {number} */ var maxI0 = Math.floor(uBounds0[1]);
+ /** @type {number} */ var minI1 = Math.floor(uBounds1[0]);
+ /** @type {number} */ var maxI1 = Math.floor(uBounds1[1]);
+ /** @type {number} */ var minJ0 = Math.floor(vBounds0[0]);
+ /** @type {number} */ var maxJ0 = Math.floor(vBounds0[1]);
+ /** @type {number} */ var minJ1 = Math.floor(vBounds1[0]);
+ /** @type {number} */ var maxJ1 = Math.floor(vBounds1[1]);
+ /** @type {number} */ var minK0 = Math.floor(wBounds0[0]);
+ /** @type {number} */ var maxK0 = Math.floor(wBounds0[1]);
+ /** @type {number} */ var minK1 = Math.floor(wBounds1[0]);
+ /** @type {number} */ var maxK1 = Math.floor(wBounds1[1]);
+
+ for (var k0 = minK0; k0 <= maxK0; k0++) {
+ for (var j0 = minJ0; j0 <= maxJ0; j0++) {
+ for (var i0 = minI0; i0 <= maxI0; i0++) {
+ for (var k1 = minK1; k1 <= maxK1; k1++) {
+ for (var j1 = minJ1; j1 <= maxJ1; j1++) {
+ for (var i1 = minI1; i1 <= maxI1; i1++) {
+ /** @type {Array<number>} */ var c0 = tcuTexLookupVerifier.lookupFloat(level0, sampler, tcuTexVerifierUtil.wrap(sampler.wrapS, i0, w0), tcuTexVerifierUtil.wrap(sampler.wrapT, j0, h0), tcuTexVerifierUtil.wrap(sampler.wrapR, k0, d0));
+ /** @type {Array<number>} */ var c1 = tcuTexLookupVerifier.lookupFloat(level1, sampler, tcuTexVerifierUtil.wrap(sampler.wrapS, i1, w1), tcuTexVerifierUtil.wrap(sampler.wrapT, j1, h1), tcuTexVerifierUtil.wrap(sampler.wrapR, k1, d1));
+
+ if (tcuTexLookupVerifier.isLinearRangeValid(prec, c0, c1, fBounds, result))
+ return true;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return false;
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} level0
+ * @param {tcuTexture.ConstPixelBufferAccess} level1
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {Array<number>} coord
+ * @param {number} coordZ
+ * @param {Array<number>} fBounds
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isLinearMipmapLinearSampleResultValid_CoordAsVec2AndInt = function(level0, level1, sampler, prec, coord, coordZ, fBounds, result) {
+ // \todo [2013-07-04 pyry] This is strictly not correct as coordinates between levels should be dependent.
+ // Right now this allows pairing any two valid bilinear quads.
+
+ /** @type {number} */ var w0 = level0.getWidth();
+ /** @type {number} */ var w1 = level1.getWidth();
+ /** @type {number} */ var h0 = level0.getHeight();
+ /** @type {number} */ var h1 = level1.getHeight();
+
+ /** @type {Array<number>} */
+ var uBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, w0, coord[0], prec.coordBits[0], prec.uvwBits[0]);
+ /** @type {Array<number>} */
+ var uBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, w1, coord[0], prec.coordBits[0], prec.uvwBits[0]);
+ /** @type {Array<number>} */
+ var vBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, h0, coord[1], prec.coordBits[1], prec.uvwBits[1]);
+ /** @type {Array<number>} */
+ var vBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, h1, coord[1], prec.coordBits[1], prec.uvwBits[1]);
+
+ // Integer coordinates - without wrap mode
+ /** @type {number} */ var minI0 = Math.floor(uBounds0[0] - 0.5);
+ /** @type {number} */ var maxI0 = Math.floor(uBounds0[1] - 0.5);
+ /** @type {number} */ var minI1 = Math.floor(uBounds1[0] - 0.5);
+ /** @type {number} */ var maxI1 = Math.floor(uBounds1[1] - 0.5);
+ /** @type {number} */ var minJ0 = Math.floor(vBounds0[0] - 0.5);
+ /** @type {number} */ var maxJ0 = Math.floor(vBounds0[1] - 0.5);
+ /** @type {number} */ var minJ1 = Math.floor(vBounds1[0] - 0.5);
+ /** @type {number} */ var maxJ1 = Math.floor(vBounds1[1] - 0.5);
+
+ /** @type {tcuTexture.TextureChannelClass} */
+ var texClass = tcuTexture.getTextureChannelClass(level0.getFormat().type);
+ /** @type {number} */ var cSearchStep = (texClass == tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT) ? tcuTexLookupVerifier.computeBilinearSearchStepForUnorm(prec) :
+ (texClass == tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT) ? tcuTexLookupVerifier.computeBilinearSearchStepForSnorm(prec) :
+ 0; // Step is computed for floating-point quads based on texel values.
+
+ /** @type {number} */ var x0;
+ /** @type {number} */ var x1;
+ /** @type {number} */ var y0;
+ /** @type {number} */ var y1;
+
+ for (var j0 = minJ0; j0 <= maxJ0; j0++) {
+ for (var i0 = minI0; i0 <= maxI0; i0++) {
+ /** @type {number} */ var searchStep0;
+
+ x0 = tcuTexVerifierUtil.wrap(sampler.wrapS, i0, w0);
+ x1 = tcuTexVerifierUtil.wrap(sampler.wrapS, i0 + 1, w0);
+ y0 = tcuTexVerifierUtil.wrap(sampler.wrapT, j0, h0);
+ y1 = tcuTexVerifierUtil.wrap(sampler.wrapT, j0 + 1, h0);
+
+ /** @type {tcuTexLookupVerifier.ColorQuad} */
+ var quad0 = tcuTexLookupVerifier.lookupQuad(level0, sampler, x0, x1, y0, y1, coordZ);
+
+ if (texClass == tcuTexture.TextureChannelClass.FLOATING_POINT)
+ searchStep0 = tcuTexLookupVerifier.computeBilinearSearchStepFromFloatQuad(prec, quad0);
+ else
+ searchStep0 = cSearchStep;
+
+ /** @type {number} */ var minA0 = deMath.clamp((uBounds0[0] - 0.5) - i0, 0, 1);
+ /** @type {number} */ var maxA0 = deMath.clamp((uBounds0[1] - 0.5) - i0, 0, 1);
+ /** @type {number} */ var minB0 = deMath.clamp((vBounds0[0] - 0.5) - j0, 0, 1);
+ /** @type {number} */ var maxB0 = deMath.clamp((vBounds0[1] - 0.5) - j0, 0, 1);
+
+ for (var j1 = minJ1; j1 <= maxJ1; j1++) {
+ for (var i1 = minI1; i1 <= maxI1; i1++) {
+ /** @type {number} */ var searchStep1;
+
+ x0 = tcuTexVerifierUtil.wrap(sampler.wrapS, i1, w1);
+ x1 = tcuTexVerifierUtil.wrap(sampler.wrapS, i1 + 1, w1);
+ y0 = tcuTexVerifierUtil.wrap(sampler.wrapT, j1, h1);
+ y1 = tcuTexVerifierUtil.wrap(sampler.wrapT, j1 + 1, h1);
+
+ /** @type {tcuTexLookupVerifier.ColorQuad} */
+ var quad1 = tcuTexLookupVerifier.lookupQuad(level1, sampler, x0, x1, y0, y1, coordZ);
+
+ if (texClass == tcuTexture.TextureChannelClass.FLOATING_POINT)
+ searchStep1 = tcuTexLookupVerifier.computeBilinearSearchStepFromFloatQuad(prec, quad1);
+ else
+ searchStep1 = cSearchStep;
+
+ /** @type {number} */ var minA1 = deMath.clamp((uBounds1[0] - 0.5) - i1, 0, 1);
+ /** @type {number} */ var maxA1 = deMath.clamp((uBounds1[1] - 0.5) - i1, 0, 1);
+ /** @type {number} */ var minB1 = deMath.clamp((vBounds1[0] - 0.5) - j1, 0, 1);
+ /** @type {number} */ var maxB1 = deMath.clamp((vBounds1[1] - 0.5) - j1, 0, 1);
+
+ if (tcuTexLookupVerifier.is2DTrilinearFilterResultValid(prec, quad0, quad1, [minA0, maxA0], [minB0, maxB0], [minA1, maxA1], [minB1, maxB1],
+ fBounds, Math.min(searchStep0, searchStep1), result))
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} level0
+ * @param {tcuTexture.ConstPixelBufferAccess} level1
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {Array<number>} coord
+ * @param {Array<number>} fBounds
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isLinearMipmapLinearSampleResultValid_CoordAsVec3 = function(level0, level1, sampler, prec, coord, fBounds, result) {
+ // \todo [2013-07-04 pyry] This is strictly not correct as coordinates between levels should be dependent.
+ // Right now this allows pairing any two valid bilinear quads.
+
+ /** @type {number} */ var w0 = level0.getWidth();
+ /** @type {number} */ var w1 = level1.getWidth();
+ /** @type {number} */ var h0 = level0.getHeight();
+ /** @type {number} */ var h1 = level1.getHeight();
+ /** @type {number} */ var d0 = level0.getDepth();
+ /** @type {number} */ var d1 = level1.getDepth();
+
+ /** @type {Array<number>} */
+ var uBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, w0, coord[0], prec.coordBits[0], prec.uvwBits[0]);
+ /** @type {Array<number>} */
+ var uBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, w1, coord[0], prec.coordBits[0], prec.uvwBits[0]);
+ /** @type {Array<number>} */
+ var vBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, h0, coord[1], prec.coordBits[1], prec.uvwBits[1]);
+ /** @type {Array<number>} */
+ var vBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, h1, coord[1], prec.coordBits[1], prec.uvwBits[1]);
+ /** @type {Array<number>} */
+ var wBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, d0, coord[2], prec.coordBits[2], prec.uvwBits[2]);
+ /** @type {Array<number>} */
+ var wBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(
+ sampler.normalizedCoords, d1, coord[2], prec.coordBits[2], prec.uvwBits[2]);
+
+ // Integer coordinates - without wrap mode
+ /** @type {number} */ var minI0 = Math.floor(uBounds0[0] - 0.5);
+ /** @type {number} */ var maxI0 = Math.floor(uBounds0[1] - 0.5);
+ /** @type {number} */ var minI1 = Math.floor(uBounds1[0] - 0.5);
+ /** @type {number} */ var maxI1 = Math.floor(uBounds1[1] - 0.5);
+ /** @type {number} */ var minJ0 = Math.floor(vBounds0[0] - 0.5);
+ /** @type {number} */ var maxJ0 = Math.floor(vBounds0[1] - 0.5);
+ /** @type {number} */ var minJ1 = Math.floor(vBounds1[0] - 0.5);
+ /** @type {number} */ var maxJ1 = Math.floor(vBounds1[1] - 0.5);
+ /** @type {number} */ var minK0 = Math.floor(wBounds0[0] - 0.5);
+ /** @type {number} */ var maxK0 = Math.floor(wBounds0[1] - 0.5);
+ /** @type {number} */ var minK1 = Math.floor(wBounds1[0] - 0.5);
+ /** @type {number} */ var maxK1 = Math.floor(wBounds1[1] - 0.5);
+
+ /** @type {tcuTexture.TextureChannelClass} */
+ var texClass = tcuTexture.getTextureChannelClass(level0.getFormat().type);
+ /** @type {number} */ var cSearchStep = texClass == tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT ? tcuTexLookupVerifier.computeBilinearSearchStepForUnorm(prec) :
+ texClass == tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT ? tcuTexLookupVerifier.computeBilinearSearchStepForSnorm(prec) :
+ 0; // Step is computed for floating-point quads based on texel values.
+
+ /** @type {number} */ var x0;
+ /** @type {number} */ var x1;
+ /** @type {number} */ var y0;
+ /** @type {number} */ var y1;
+ /** @type {number} */ var z0;
+ /** @type {number} */ var z1;
+
+ for (var k0 = minK0; k0 <= maxK0; k0++) {
+ for (var j0 = minJ0; j0 <= maxJ0; j0++) {
+ for (var i0 = minI0; i0 <= maxI0; i0++) {
+ /** @type {number} */ var searchStep0;
+
+ x0 = tcuTexVerifierUtil.wrap(sampler.wrapS, i0, w0);
+ x1 = tcuTexVerifierUtil.wrap(sampler.wrapS, i0 + 1, w0);
+ y0 = tcuTexVerifierUtil.wrap(sampler.wrapT, j0, h0);
+ y1 = tcuTexVerifierUtil.wrap(sampler.wrapT, j0 + 1, h0);
+ z0 = tcuTexVerifierUtil.wrap(sampler.wrapR, k0, d0);
+ z1 = tcuTexVerifierUtil.wrap(sampler.wrapR, k0 + 1, d0);
+ /** @type {tcuTexLookupVerifier.ColorQuad} */
+ var quad00 = tcuTexLookupVerifier.lookupQuad(level0, sampler, x0, x1, y0, y1, z0);
+ /** @type {tcuTexLookupVerifier.ColorQuad} */
+ var quad01 = tcuTexLookupVerifier.lookupQuad(level0, sampler, x0, x1, y0, y1, z1);
+
+ if (texClass == tcuTexture.TextureChannelClass.FLOATING_POINT)
+ searchStep0 = Math.min(tcuTexLookupVerifier.computeBilinearSearchStepFromFloatQuad(prec, quad00), tcuTexLookupVerifier.computeBilinearSearchStepFromFloatQuad(prec, quad01));
+ else
+ searchStep0 = cSearchStep;
+
+ /** @type {number} */ var minA0 = deMath.clamp((uBounds0[0] - 0.5) - i0, 0, 1);
+ /** @type {number} */ var maxA0 = deMath.clamp((uBounds0[1] - 0.5) - i0, 0, 1);
+ /** @type {number} */ var minB0 = deMath.clamp((vBounds0[0] - 0.5) - j0, 0, 1);
+ /** @type {number} */ var maxB0 = deMath.clamp((vBounds0[1] - 0.5) - j0, 0, 1);
+ /** @type {number} */ var minC0 = deMath.clamp((wBounds0[0] - 0.5) - k0, 0, 1);
+ /** @type {number} */ var maxC0 = deMath.clamp((wBounds0[1] - 0.5) - k0, 0, 1);
+
+ for (var k1 = minK1; k1 <= maxK1; k1++) {
+ for (var j1 = minJ1; j1 <= maxJ1; j1++) {
+ for (var i1 = minI1; i1 <= maxI1; i1++) {
+
+ /** @type {number} */ var searchStep1;
+
+ x0 = tcuTexVerifierUtil.wrap(sampler.wrapS, i1, w1);
+ x1 = tcuTexVerifierUtil.wrap(sampler.wrapS, i1 + 1, w1);
+ y0 = tcuTexVerifierUtil.wrap(sampler.wrapT, j1, h1);
+ y1 = tcuTexVerifierUtil.wrap(sampler.wrapT, j1 + 1, h1);
+ z0 = tcuTexVerifierUtil.wrap(sampler.wrapR, k1, d1);
+ z1 = tcuTexVerifierUtil.wrap(sampler.wrapR, k1 + 1, d1);
+ /** @type {tcuTexLookupVerifier.ColorQuad} */
+ var quad10 = tcuTexLookupVerifier.lookupQuad(level1, sampler, x0, x1, y0, y1, z0);
+ /** @type {tcuTexLookupVerifier.ColorQuad} */
+ var quad11 = tcuTexLookupVerifier.lookupQuad(level1, sampler, x0, x1, y0, y1, z1);
+
+ if (texClass == tcuTexture.TextureChannelClass.FLOATING_POINT)
+ searchStep1 = Math.min(tcuTexLookupVerifier.computeBilinearSearchStepFromFloatQuad(prec, quad10), tcuTexLookupVerifier.computeBilinearSearchStepFromFloatQuad(prec, quad11));
+ else
+ searchStep1 = cSearchStep;
+
+ /** @type {number} */ var minA1 = deMath.clamp((uBounds1[0] - 0.5) - i1, 0, 1);
+ /** @type {number} */ var maxA1 = deMath.clamp((uBounds1[1] - 0.5) - i1, 0, 1);
+ /** @type {number} */ var minB1 = deMath.clamp((vBounds1[0] - 0.5) - j1, 0, 1);
+ /** @type {number} */ var maxB1 = deMath.clamp((vBounds1[1] - 0.5) - j1, 0, 1);
+ /** @type {number} */ var minC1 = deMath.clamp((wBounds1[0] - 0.5) - k1, 0, 1);
+ /** @type {number} */ var maxC1 = deMath.clamp((wBounds1[1] - 0.5) - k1, 0, 1);
+
+ if (tcuTexLookupVerifier.is3DTrilinearFilterResultValid(
+ prec, quad00, quad01, quad10, quad11,
+ [minA0, maxA0], [minB0, maxB0], [minC0, maxC0],
+ [minA1, maxA1], [minB1, maxB1], [minC1, maxC1],
+ fBounds, Math.min(searchStep0, searchStep1), result))
+ return true;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return false;
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} level
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexture.FilterMode} filterMode
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {number} coordX
+ * @param {number} coordY
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isLevelSampleResultValid_CoordXYAsNumber = function(level, sampler, filterMode, prec, coordX, coordY, result) {
+ if (filterMode == tcuTexture.FilterMode.LINEAR)
+ return tcuTexLookupVerifier.isLinearSampleResultValid_CoordXYAsNumber(level, sampler, prec, coordX, coordY, result);
+ else
+ return tcuTexLookupVerifier.isNearestSampleResultValid_CoordXYAsNumber(level, sampler, prec, coordX, coordY, result);
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} level
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexture.FilterMode} filterMode
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {Array<number>} coord
+ * @param {number} coordZ
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isLevelSampleResultValid_CoordAsVec2AndInt = function(level, sampler, filterMode, prec, coord, coordZ, result) {
+ if (filterMode == tcuTexture.FilterMode.LINEAR)
+ return tcuTexLookupVerifier.isLinearSampleResultValid_CoordAsVec2AndInt(level, sampler, prec, coord, coordZ, result);
+ else
+ return tcuTexLookupVerifier.isNearestSampleResultValid_CoordAsVec2AndInt(level, sampler, prec, coord, coordZ, result);
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} level
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexture.FilterMode} filterMode
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {Array<number>} coord
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isLevelSampleResultValid_CoordAsVec3 = function(level, sampler, filterMode, prec, coord, result) {
+ if (filterMode == tcuTexture.FilterMode.LINEAR)
+ return tcuTexLookupVerifier.isLinearSampleResultValid_CoordAsVec3(level, sampler, prec, coord, result);
+ else
+ return tcuTexLookupVerifier.isNearestSampleResultValid_CoordAsVec3(level, sampler, prec, coord, result);
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} level0
+ * @param {tcuTexture.ConstPixelBufferAccess} level1
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexture.FilterMode} levelFilter
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {Array<number>} coord
+ * @param {number} coordZ
+ * @param {Array<number>} fBounds
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isMipmapLinearSampleResultValid_CoordAsVec2AndInt = function(level0, level1, sampler, levelFilter, prec, coord, coordZ, fBounds, result) {
+ if (levelFilter == tcuTexture.FilterMode.LINEAR)
+ return tcuTexLookupVerifier.isLinearMipmapLinearSampleResultValid_CoordAsVec2AndInt(level0, level1, sampler, prec, coord, coordZ, fBounds, result);
+ else
+ return tcuTexLookupVerifier.isNearestMipmapLinearSampleResultValid_CoordAsVec2AndInt(level0, level1, sampler, prec, coord, coordZ, fBounds, result);
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} level0
+ * @param {tcuTexture.ConstPixelBufferAccess} level1
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexture.FilterMode} levelFilter
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {Array<number>} coord
+ * @param {Array<number>} fBounds
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isMipmapLinearSampleResultValid_CoordAsVec3 = function(level0, level1, sampler, levelFilter, prec, coord, fBounds, result) {
+ if (levelFilter == tcuTexture.FilterMode.LINEAR)
+ return tcuTexLookupVerifier.isLinearMipmapLinearSampleResultValid_CoordAsVec3(level0, level1, sampler, prec, coord, fBounds, result);
+ else
+ return tcuTexLookupVerifier.isNearestMipmapLinearSampleResultValid_CoordAsVec3(level0, level1, sampler, prec, coord, fBounds, result);
+ };
+
+ /**
+ * @param {tcuTexture.Texture2DView} texture
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {Array<number>} coord
+ * @param {Array<number>} lodBounds
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isLookupResultValid_Texture2DView = function(texture, sampler, prec, coord, lodBounds, result) {
+ /** @type {number} */ var minLod = lodBounds[0];
+ /** @type {number} */ var maxLod = lodBounds[1];
+ /** @type {boolean} */ var canBeMagnified = minLod <= sampler.lodThreshold;
+ /** @type {boolean} */ var canBeMinified = maxLod > sampler.lodThreshold;
+
+ assertMsgOptions(tcuTexLookupVerifier.isSamplerSupported(sampler), 'Sampler not supported.', false, true);
+
+ /** @type {number} */ var minLevel;
+ /** @type {number} */ var maxLevel;
+
+ if (canBeMagnified)
+ if (tcuTexLookupVerifier.isLevelSampleResultValid_CoordAsVec2AndInt(texture.getLevel(0), sampler, sampler.magFilter, prec, coord, 0, result))
+ return true;
+
+ if (canBeMinified) {
+ /** @type {boolean} */ var isNearestMipmap = tcuTexVerifierUtil.isNearestMipmapFilter(sampler.minFilter);
+ /** @type {boolean} */ var isLinearMipmap = tcuTexVerifierUtil.isLinearMipmapFilter(sampler.minFilter);
+ /** @type {number} */ var minTexLevel = 0;
+ /** @type {number} */ var maxTexLevel = texture.getNumLevels() - 1;
+
+ assertMsgOptions(minTexLevel <= maxTexLevel, 'minTexLevel > maxTexLevel', false, true);
+
+ if (isLinearMipmap && minTexLevel < maxTexLevel) {
+ minLevel = deMath.clamp(Math.floor(minLod), minTexLevel, maxTexLevel - 1);
+ maxLevel = deMath.clamp(Math.floor(maxLod), minTexLevel, maxTexLevel - 1);
+
+ assertMsgOptions(minLevel <= maxLevel, 'minLevel > maxLevel', false, true);
+
+ for (var level = minLevel; level <= maxLevel; level++) {
+ /** @type {number} */ var minF = deMath.clamp(minLod - level, 0, 1);
+ /** @type {number} */ var maxF = deMath.clamp(maxLod - level, 0, 1);
+
+ if (tcuTexLookupVerifier.isMipmapLinearSampleResultValid_CoordAsVec2AndInt(texture.getLevel(level), texture.getLevel(level + 1), sampler, tcuTexVerifierUtil.getLevelFilter(sampler.minFilter), prec, coord, 0, [minF, maxF], result))
+ return true;
+ }
+ } else if (isNearestMipmap) {
+ // \note The accurate formula for nearest mipmapping is level = ceil(lod + 0.5) - 1 but Khronos has made
+ // decision to allow floor(lod + 0.5) as well.
+ minLevel = deMath.clamp(Math.ceil(minLod + 0.5) - 1, minTexLevel, maxTexLevel);
+ maxLevel = deMath.clamp(Math.floor(maxLod + 0.5), minTexLevel, maxTexLevel);
+
+ assertMsgOptions(minLevel <= maxLevel, 'minLevel > maxLevel', false, true);
+
+ for (var level = minLevel; level <= maxLevel; level++) {
+ if (tcuTexLookupVerifier.isLevelSampleResultValid_CoordAsVec2AndInt(texture.getLevel(level), sampler, tcuTexVerifierUtil.getLevelFilter(sampler.minFilter), prec, coord, 0, result))
+ return true;
+ }
+ } else {
+ if (tcuTexLookupVerifier.isLevelSampleResultValid_CoordAsVec2AndInt(texture.getLevel(0), sampler, sampler.minFilter, prec, coord, 0, result))
+ return true;
+ }
+ }
+
+ return false;
+ };
+
+ /**
+ * @param {tcuTexture.TextureCubeView} texture
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {Array<number>} coord
+ * @param {Array<number>} lodBounds
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isLookupResultValid_TextureCubeView = function(texture, sampler, prec, coord, lodBounds, result) {
+ /** @type {number} */ var numPossibleFaces = 0;
+
+ assertMsgOptions(tcuTexLookupVerifier.isSamplerSupported(sampler), 'Sampler not supported.', false, true);
+
+ /** @type {Array<tcuTexture.CubeFace>} */ var possibleFaces = tcuTexVerifierUtil.getPossibleCubeFaces(coord, prec.coordBits);
+
+ /** @type {number} */ var minLevel;
+ /** @type {number} */ var maxLevel;
+
+ if (!possibleFaces)
+ return true; // Result is undefined.
+
+ for (var tryFaceNdx = 0; tryFaceNdx < possibleFaces.length; tryFaceNdx++) {
+ /** @type {tcuTexture.CubeFaceCoords} */
+ var faceCoords = new tcuTexture.CubeFaceCoords(possibleFaces[tryFaceNdx], tcuTexture.projectToFace(possibleFaces[tryFaceNdx], coord));
+ /** @type {number} */ var minLod = lodBounds[0];
+ /** @type {number} */ var maxLod = lodBounds[1];
+ /** @type {boolean} */ var canBeMagnified = minLod <= sampler.lodThreshold;
+ /** @type {boolean} */ var canBeMinified = maxLod > sampler.lodThreshold;
+
+ /** @type {Array<tcuTexture.ConstPixelBufferAccess>} */ var faces = [];
+ if (canBeMagnified) {
+ tcuTexLookupVerifier.getCubeLevelFaces(texture, 0, faces);
+
+ if (tcuTexLookupVerifier.isCubeLevelSampleResultValid(faces, sampler, sampler.magFilter, prec, faceCoords, result))
+ return true;
+ }
+
+ if (canBeMinified) {
+ /** @type {boolean} */ var isNearestMipmap = tcuTexVerifierUtil.isNearestMipmapFilter(sampler.minFilter);
+ /** @type {boolean} */ var isLinearMipmap = tcuTexVerifierUtil.isLinearMipmapFilter(sampler.minFilter);
+ /** @type {number} */ var minTexLevel = 0;
+ /** @type {number} */ var maxTexLevel = texture.getNumLevels() - 1;
+
+ assertMsgOptions(minTexLevel <= maxTexLevel, 'minTexLevel > maxTexLevel', false, true);
+
+ if (isLinearMipmap && minTexLevel < maxTexLevel) {
+ minLevel = deMath.clamp(Math.floor(minLod), minTexLevel, maxTexLevel - 1);
+ maxLevel = deMath.clamp(Math.floor(maxLod), minTexLevel, maxTexLevel - 1);
+
+ assertMsgOptions(minLevel <= maxLevel, 'minLevel > maxLevel', false, true);
+
+ for (var levelNdx = minLevel; levelNdx <= maxLevel; levelNdx++) {
+ /** @type {number} */ var minF = deMath.clamp(minLod - levelNdx, 0, 1);
+ /** @type {number} */ var maxF = deMath.clamp(maxLod - levelNdx, 0, 1);
+
+ /** @type {Array<tcuTexture.ConstPixelBufferAccess>} */ var faces0 = [];
+ /** @type {Array<tcuTexture.ConstPixelBufferAccess>} */ var faces1 = [];
+
+ tcuTexLookupVerifier.getCubeLevelFaces(texture, levelNdx, faces0);
+ tcuTexLookupVerifier.getCubeLevelFaces(texture, levelNdx + 1, faces1);
+
+ if (tcuTexLookupVerifier.isCubeMipmapLinearSampleResultValid(faces0, faces1, sampler, tcuTexVerifierUtil.getLevelFilter(sampler.minFilter), prec, faceCoords, [minF, maxF], result))
+ return true;
+ }
+ } else if (isNearestMipmap) {
+ // \note The accurate formula for nearest mipmapping is level = ceil(lod + 0.5) - 1 but Khronos has made
+ // decision to allow floor(lod + 0.5) as well.
+ minLevel = deMath.clamp(Math.ceil(minLod + 0.5) - 1, minTexLevel, maxTexLevel);
+ maxLevel = deMath.clamp(Math.floor(maxLod + 0.5), minTexLevel, maxTexLevel);
+
+ assertMsgOptions(minLevel <= maxLevel, 'minLevel > maxLevel', false, true);
+
+ for (var levelNdx = minLevel; levelNdx <= maxLevel; levelNdx++) {
+ tcuTexLookupVerifier.getCubeLevelFaces(texture, levelNdx, faces);
+
+ if (tcuTexLookupVerifier.isCubeLevelSampleResultValid(faces, sampler, tcuTexVerifierUtil.getLevelFilter(sampler.minFilter), prec, faceCoords, result))
+ return true;
+ }
+ } else {
+ tcuTexLookupVerifier.getCubeLevelFaces(texture, 0, faces);
+
+ if (tcuTexLookupVerifier.isCubeLevelSampleResultValid(faces, sampler, sampler.minFilter, prec, faceCoords, result))
+ return true;
+ }
+ }
+ }
+
+ return false;
+ };
+
+ /**
+ * @param {tcuTexture.Texture2DArrayView} texture
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {Array<number>} coord
+ * @param {Array<number>} lodBounds
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isLookupResultValid_Texture2DArrayView = function(texture, sampler, prec, coord, lodBounds, result) {
+ /** @type {Array<number>} */ var layerRange = tcuTexLookupVerifier.computeLayerRange(texture.getNumLayers(), prec.coordBits[2], coord[2]);
+ /** @type {Array<number>} */ var coordXY = deMath.swizzle(coord, [0, 1]);
+ /** @type {number} */ var minLod = lodBounds[0];
+ /** @type {number} */ var maxLod = lodBounds[1];
+ /** @type {boolean} */ var canBeMagnified = minLod <= sampler.lodThreshold;
+ /** @type {boolean} */ var canBeMinified = maxLod > sampler.lodThreshold;
+
+ assertMsgOptions(tcuTexLookupVerifier.isSamplerSupported(sampler), 'Sampler not supported.', false, true);
+ /** @type {number} */ var minLevel;
+ /** @type {number} */ var maxLevel;
+
+ for (var layer = layerRange[0]; layer <= layerRange[1]; layer++) {
+ if (canBeMagnified) {
+ if (tcuTexLookupVerifier.isLevelSampleResultValid_CoordAsVec2AndInt(texture.getLevel(0), sampler, sampler.magFilter, prec, coordXY, layer, result))
+ return true;
+ }
+
+ if (canBeMinified) {
+ /** @type {boolean} */ var isNearestMipmap = tcuTexVerifierUtil.isNearestMipmapFilter(sampler.minFilter);
+ /** @type {boolean} */ var isLinearMipmap = tcuTexVerifierUtil.isLinearMipmapFilter(sampler.minFilter);
+ /** @type {number} */ var minTexLevel = 0;
+ /** @type {number} */ var maxTexLevel = texture.getNumLevels() - 1;
+
+ assertMsgOptions(minTexLevel <= maxTexLevel, 'minTexLevel > maxTexLevel', false, true);
+
+ if (isLinearMipmap && minTexLevel < maxTexLevel) {
+ minLevel = deMath.clamp(Math.floor(minLod), minTexLevel, maxTexLevel - 1);
+ maxLevel = deMath.clamp(Math.floor(maxLod), minTexLevel, maxTexLevel - 1);
+
+ assertMsgOptions(minLevel <= maxLevel, 'minLevel > maxLevel', false, true);
+
+ for (var level = minLevel; level <= maxLevel; level++) {
+ /** @type {number} */ var minF = deMath.clamp(minLod - level, 0, 1);
+ /** @type {number} */ var maxF = deMath.clamp(maxLod - level, 0, 1);
+
+ if (tcuTexLookupVerifier.isMipmapLinearSampleResultValid_CoordAsVec2AndInt(texture.getLevel(level), texture.getLevel(level + 1), sampler, tcuTexVerifierUtil.getLevelFilter(sampler.minFilter), prec, coordXY, layer, [minF, maxF], result))
+ return true;
+ }
+ } else if (isNearestMipmap) {
+ // \note The accurate formula for nearest mipmapping is level = ceil(lod + 0.5) - 1 but Khronos has made
+ // decision to allow floor(lod + 0.5) as well.
+ minLevel = deMath.clamp(Math.ceil(minLod + 0.5) - 1, minTexLevel, maxTexLevel);
+ maxLevel = deMath.clamp(Math.floor(maxLod + 0.5), minTexLevel, maxTexLevel);
+
+ assertMsgOptions(minLevel <= maxLevel, 'minLevel > maxLevel', false, true);
+
+ for (var level = minLevel; level <= maxLevel; level++) {
+ if (tcuTexLookupVerifier.isLevelSampleResultValid_CoordAsVec2AndInt(texture.getLevel(level), sampler, tcuTexVerifierUtil.getLevelFilter(sampler.minFilter), prec, coordXY, layer, result))
+ return true;
+ }
+ } else {
+ if (tcuTexLookupVerifier.isLevelSampleResultValid_CoordAsVec2AndInt(texture.getLevel(0), sampler, sampler.minFilter, prec, coordXY, layer, result))
+ return true;
+ }
+ }
+ }
+
+ return false;
+ };
+
+ /**
+ * @param {tcuTexture.Texture3DView} texture
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {Array<number>} coord
+ * @param {Array<number>} lodBounds
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isLookupResultValid = function(texture, sampler, prec, coord, lodBounds, result) {
+ /** @type {number} */ var minLod = lodBounds[0];
+ /** @type {number} */ var maxLod = lodBounds[1];
+ /** @type {boolean} */ var canBeMagnified = minLod <= sampler.lodThreshold;
+ /** @type {boolean} */ var canBeMinified = maxLod > sampler.lodThreshold;
+
+ assertMsgOptions(tcuTexLookupVerifier.isSamplerSupported(sampler), 'Sampler not supported.', false, true);
+
+ /** @type {number} */ var minLevel;
+ /** @type {number} */ var maxLevel;
+
+ if (canBeMagnified)
+ if (tcuTexLookupVerifier.isLevelSampleResultValid_CoordAsVec3(texture.getLevel(0), sampler, sampler.magFilter, prec, coord, result))
+ return true;
+
+ if (canBeMinified) {
+ /** @type {boolean} */ var isNearestMipmap = tcuTexVerifierUtil.isNearestMipmapFilter(sampler.minFilter);
+ /** @type {boolean} */ var isLinearMipmap = tcuTexVerifierUtil.isLinearMipmapFilter(sampler.minFilter);
+ /** @type {number} */ var minTexLevel = 0;
+ /** @type {number} */ var maxTexLevel = texture.getNumLevels() - 1;
+
+ assertMsgOptions(minTexLevel <= maxTexLevel, 'minTexLevel > maxTexLevel', false, true);
+
+ if (isLinearMipmap && minTexLevel < maxTexLevel) {
+ minLevel = deMath.clamp(Math.floor(minLod), minTexLevel, maxTexLevel - 1);
+ maxLevel = deMath.clamp(Math.floor(maxLod), minTexLevel, maxTexLevel - 1);
+
+ assertMsgOptions(minLevel <= maxLevel, 'minLevel > maxLevel', false, true);
+
+ for (var level = minLevel; level <= maxLevel; level++) {
+ /** @type {number} */ var minF = deMath.clamp(minLod - level, 0, 1);
+ /** @type {number} */ var maxF = deMath.clamp(maxLod - level, 0, 1);
+
+ if (tcuTexLookupVerifier.isMipmapLinearSampleResultValid_CoordAsVec3(texture.getLevel(level), texture.getLevel(level + 1), sampler, tcuTexVerifierUtil.getLevelFilter(sampler.minFilter), prec, coord, [minF, maxF], result))
+ return true;
+ }
+ } else if (isNearestMipmap) {
+ // \note The accurate formula for nearest mipmapping is level = ceil(lod + 0.5) - 1 but Khronos has made
+ // decision to allow floor(lod + 0.5) as well.
+ minLevel = deMath.clamp(Math.ceil(minLod + 0.5) - 1, minTexLevel, maxTexLevel);
+ maxLevel = deMath.clamp(Math.floor(maxLod + 0.5), minTexLevel, maxTexLevel);
+
+ assertMsgOptions(minLevel <= maxLevel, 'minLevel > maxLevel', false, true);
+
+ for (var level = minLevel; level <= maxLevel; level++) {
+ if (tcuTexLookupVerifier.isLevelSampleResultValid_CoordAsVec3(texture.getLevel(level), sampler, tcuTexVerifierUtil.getLevelFilter(sampler.minFilter), prec, coord, result))
+ return true;
+ }
+ } else {
+ if (tcuTexLookupVerifier.isLevelSampleResultValid_CoordAsVec3(texture.getLevel(0), sampler, sampler.minFilter, prec, coord, result))
+ return true;
+ }
+ }
+
+ return false;
+ };
+
+ /**
+ * @param {Array<tcuTexture.ConstPixelBufferAccess>} faces (&faces)[CUBEFACE_LAST]
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {tcuTexture.CubeFaceCoords} coords
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isSeamlessLinearSampleResultValid = function(faces, sampler, prec, coords, result) {
+ /** @type {number} */ var size = faces[coords.face].getWidth();
+
+ /** @type {Array<number>} */ var uBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, size, coords.s, prec.coordBits[0], prec.uvwBits[0]);
+ /** @type {Array<number>} */ var vBounds = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, size, coords.t, prec.coordBits[1], prec.uvwBits[1]);
+
+ // Integer coordinate bounds for (x0,y0) - without wrap mode
+ /** @type {number} */ var minI = Math.floor(uBounds[0] - 0.5);
+ /** @type {number} */ var maxI = Math.floor(uBounds[1] - 0.5);
+ /** @type {number} */ var minJ = Math.floor(vBounds[0] - 0.5);
+ /** @type {number} */ var maxJ = Math.floor(vBounds[1] - 0.5);
+
+ /** @type {tcuTexture.TextureChannelClass} */ var texClass = tcuTexture.getTextureChannelClass(faces[coords.face].getFormat().type);
+ /** @type {number} */ var searchStep = (texClass == tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT) ? tcuTexLookupVerifier.computeBilinearSearchStepForUnorm(prec) :
+ (texClass == tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT) ? tcuTexLookupVerifier.computeBilinearSearchStepForSnorm(prec) :
+ 0; // Step is computed for floating-point quads based on texel values.
+
+ for (var j = minJ; j <= maxJ; j++) {
+ for (var i = minI; i <= maxI; i++) {
+ /** @type {tcuTexture.CubeFaceCoords} */ var c00 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i + 0, j + 0]), size);
+ /** @type {tcuTexture.CubeFaceCoords} */ var c10 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i + 1, j + 0]), size);
+ /** @type {tcuTexture.CubeFaceCoords} */ var c01 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i + 0, j + 1]), size);
+ /** @type {tcuTexture.CubeFaceCoords} */ var c11 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i + 1, j + 1]), size);
+
+ // If any of samples is out of both edges, implementations can do pretty much anything according to spec.
+ // \todo [2013-07-08 pyry] Test the special case where all corner pixels have exactly the same color.
+ if (c00 == null || c01 == null || c10 == null || c11 == null ||
+ c00.face == null || c01.face == null || c10.face == null || c11.face == null)
+ return true;
+
+ // Bounds for filtering factors
+ /** @type {number} */ var minA = deMath.clamp((uBounds[0] - 0.5) - i, 0, 1);
+ /** @type {number} */ var maxA = deMath.clamp((uBounds[1] - 0.5) - i, 0, 1);
+ /** @type {number} */ var minB = deMath.clamp((vBounds[0] - 0.5) - j, 0, 1);
+ /** @type {number} */ var maxB = deMath.clamp((vBounds[1] - 0.5) - j, 0, 1);
+
+ /** @type {tcuTexLookupVerifier.ColorQuad} */
+ var quad = new tcuTexLookupVerifier.ColorQuad([], [], [], []);
+ quad.p00 = tcuTexLookupVerifier.lookupFloat(faces[c00.face], sampler, c00.s, c00.t, 0);
+ quad.p10 = tcuTexLookupVerifier.lookupFloat(faces[c10.face], sampler, c10.s, c10.t, 0);
+ quad.p01 = tcuTexLookupVerifier.lookupFloat(faces[c01.face], sampler, c01.s, c01.t, 0);
+ quad.p11 = tcuTexLookupVerifier.lookupFloat(faces[c11.face], sampler, c11.s, c11.t, 0);
+
+ if (texClass == tcuTexture.TextureChannelClass.FLOATING_POINT)
+ searchStep = tcuTexLookupVerifier.computeBilinearSearchStepFromFloatQuad(prec, quad);
+
+ if (tcuTexLookupVerifier.isBilinearRangeValid(prec, quad, [minA, maxA], [minB, maxB], searchStep, result))
+ return true;
+ }
+ }
+
+ return false;
+ };
+
+ /**
+ * @param {Array<tcuTexture.ConstPixelBufferAccess>} faces0 (&faces0)[CUBEFACE_LAST]
+ * @param {Array<tcuTexture.ConstPixelBufferAccess>} faces1 (&faces1)[CUBEFACE_LAST]
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {tcuTexture.CubeFaceCoords} coords
+ * @param {Array<number>} fBounds
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isSeamplessLinearMipmapLinearSampleResultValid = function(faces0, faces1, sampler, prec, coords, fBounds, result) {
+ // \todo [2013-07-04 pyry] This is strictly not correct as coordinates between levels should be dependent.
+ // Right now this allows pairing any two valid bilinear quads.
+ /** @type {number} */ var size0 = faces0[coords.face].getWidth();
+ /** @type {number} */ var size1 = faces1[coords.face].getWidth();
+
+ /** @type {Array<number>} */ var uBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, size0, coords.s, prec.coordBits[0], prec.uvwBits[0]);
+ /** @type {Array<number>} */ var uBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, size1, coords.s, prec.coordBits[0], prec.uvwBits[0]);
+ /** @type {Array<number>} */ var vBounds0 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, size0, coords.t, prec.coordBits[1], prec.uvwBits[1]);
+ /** @type {Array<number>} */ var vBounds1 = tcuTexVerifierUtil.computeNonNormalizedCoordBounds(sampler.normalizedCoords, size1, coords.t, prec.coordBits[1], prec.uvwBits[1]);
+
+ // Integer coordinates - without wrap mode
+ /** @type {number} */ var minI0 = Math.floor(uBounds0[0] - 0.5);
+ /** @type {number} */ var maxI0 = Math.floor(uBounds0[1] - 0.5);
+ /** @type {number} */ var minI1 = Math.floor(uBounds1[0] - 0.5);
+ /** @type {number} */ var maxI1 = Math.floor(uBounds1[1] - 0.5);
+ /** @type {number} */ var minJ0 = Math.floor(vBounds0[0] - 0.5);
+ /** @type {number} */ var maxJ0 = Math.floor(vBounds0[1] - 0.5);
+ /** @type {number} */ var minJ1 = Math.floor(vBounds1[0] - 0.5);
+ /** @type {number} */ var maxJ1 = Math.floor(vBounds1[1] - 0.5);
+
+ /** @type {tcuTexture.TextureChannelClass} */ var texClass = tcuTexture.getTextureChannelClass(faces0[coords.face].getFormat().type);
+ /** @type {number} */ var cSearchStep = (texClass == tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT) ? tcuTexLookupVerifier.computeBilinearSearchStepForUnorm(prec) :
+ (texClass == tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT) ? tcuTexLookupVerifier.computeBilinearSearchStepForSnorm(prec) :
+ 0; // Step is computed for floating-point quads based on texel values.
+
+ /** @type {tcuTexture.CubeFaceCoords} */ var c00;
+ /** @type {tcuTexture.CubeFaceCoords} */ var c10;
+ /** @type {tcuTexture.CubeFaceCoords} */ var c01;
+ /** @type {tcuTexture.CubeFaceCoords} */ var c11;
+
+ for (var j0 = minJ0; j0 <= maxJ0; j0++) {
+ for (var i0 = minI0; i0 <= maxI0; i0++) {
+ /** @type {tcuTexLookupVerifier.ColorQuad} */
+ var quad0 = new tcuTexLookupVerifier.ColorQuad([], [], [], []);
+ /** @type {number} */ var searchStep0;
+
+ c00 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i0 + 0, j0 + 0]), size0);
+ c10 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i0 + 1, j0 + 0]), size0);
+ c01 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i0 + 0, j0 + 1]), size0);
+ c11 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i0 + 1, j0 + 1]), size0);
+
+ // If any of samples is out of both edges, implementations can do pretty much anything according to spec.
+ // \todo [2013-07-08 pyry] Test the special case where all corner pixels have exactly the same color.
+ if (c00 == null || c01 == null || c10 == null || c11 == null ||
+ c00.face == null || c01.face == null || c10.face == null || c11.face == null)
+ return true;
+
+ quad0.p00 = tcuTexLookupVerifier.lookupFloat(faces0[c00.face], sampler, c00.s, c00.t, 0);
+ quad0.p10 = tcuTexLookupVerifier.lookupFloat(faces0[c10.face], sampler, c10.s, c10.t, 0);
+ quad0.p01 = tcuTexLookupVerifier.lookupFloat(faces0[c01.face], sampler, c01.s, c01.t, 0);
+ quad0.p11 = tcuTexLookupVerifier.lookupFloat(faces0[c11.face], sampler, c11.s, c11.t, 0);
+
+ if (texClass == tcuTexture.TextureChannelClass.FLOATING_POINT)
+ searchStep0 = tcuTexLookupVerifier.computeBilinearSearchStepFromFloatQuad(prec, quad0);
+ else
+ searchStep0 = cSearchStep;
+
+ /** @type {number} */ var minA0 = deMath.clamp((uBounds0[0] - 0.5) - i0, 0, 1);
+ /** @type {number} */ var maxA0 = deMath.clamp((uBounds0[1] - 0.5) - i0, 0, 1);
+ /** @type {number} */ var minB0 = deMath.clamp((vBounds0[0] - 0.5) - j0, 0, 1);
+ /** @type {number} */ var maxB0 = deMath.clamp((vBounds0[1] - 0.5) - j0, 0, 1);
+
+ for (var j1 = minJ1; j1 <= maxJ1; j1++) {
+ for (var i1 = minI1; i1 <= maxI1; i1++) {
+ /** @type {tcuTexLookupVerifier.ColorQuad} */
+ var quad1 = new tcuTexLookupVerifier.ColorQuad([], [], [], []);
+ /** @type {number} */ var searchStep1;
+
+ c00 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i1 + 0, j1 + 0]), size1);
+ c10 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i1 + 1, j1 + 0]), size1);
+ c01 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i1 + 0, j1 + 1]), size1);
+ c11 = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(coords.face, [i1 + 1, j1 + 1]), size1);
+
+ if (c00 == null || c01 == null || c10 == null || c11 == null ||
+ c00.face == null || c01.face == null || c10.face == null || c11.face == null)
+ return true;
+
+ quad1.p00 = tcuTexLookupVerifier.lookupFloat(faces1[c00.face], sampler, c00.s, c00.t, 0);
+ quad1.p10 = tcuTexLookupVerifier.lookupFloat(faces1[c10.face], sampler, c10.s, c10.t, 0);
+ quad1.p01 = tcuTexLookupVerifier.lookupFloat(faces1[c01.face], sampler, c01.s, c01.t, 0);
+ quad1.p11 = tcuTexLookupVerifier.lookupFloat(faces1[c11.face], sampler, c11.s, c11.t, 0);
+
+ if (texClass == tcuTexture.TextureChannelClass.FLOATING_POINT)
+ searchStep1 = tcuTexLookupVerifier.computeBilinearSearchStepFromFloatQuad(prec, quad1);
+ else
+ searchStep1 = cSearchStep;
+
+ /** @type {number} */ var minA1 = deMath.clamp((uBounds1[0] - 0.5) - i1, 0, 1);
+ /** @type {number} */ var maxA1 = deMath.clamp((uBounds1[1] - 0.5) - i1, 0, 1);
+ /** @type {number} */ var minB1 = deMath.clamp((vBounds1[0] - 0.5) - j1, 0, 1);
+ /** @type {number} */ var maxB1 = deMath.clamp((vBounds1[1] - 0.5) - j1, 0, 1);
+
+ if (tcuTexLookupVerifier.is2DTrilinearFilterResultValid(prec, quad0, quad1, [minA0, maxA0], [minB0, maxB0], [minA1, maxA1], [minB1, maxB1],
+ fBounds, Math.min(searchStep0, searchStep1), result))
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+ };
+
+ /**
+ * @param {Array<tcuTexture.ConstPixelBufferAccess>} level (&level)[CUBEFACE_LAST]
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexture.FilterMode} filterMode
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {tcuTexture.CubeFaceCoords} coords
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isCubeLevelSampleResultValid = function(level, sampler, filterMode, prec, coords, result) {
+ if (filterMode == tcuTexture.FilterMode.LINEAR) {
+ if (sampler.seamlessCubeMap)
+ return tcuTexLookupVerifier.isSeamlessLinearSampleResultValid(level, sampler, prec, coords, result);
+ else
+ return tcuTexLookupVerifier.isLinearSampleResultValid_CoordAsVec2AndInt(level[coords.face], sampler, prec, [coords.s, coords.t], 0, result);
+ } else
+ return tcuTexLookupVerifier.isNearestSampleResultValid_CoordAsVec2AndInt(level[coords.face], sampler, prec, [coords.s, coords.t], 0, result);
+ };
+
+ /**
+ * @param {Array<tcuTexture.ConstPixelBufferAccess>} faces0 (&faces0)[CUBEFACE_LAST]
+ * @param {Array<tcuTexture.ConstPixelBufferAccess>} faces1 (&faces1)[CUBEFACE_LAST]
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexture.FilterMode} levelFilter
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {tcuTexture.CubeFaceCoords} coords
+ * @param {Array<number>} fBounds
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isCubeMipmapLinearSampleResultValid = function(faces0, faces1, sampler, levelFilter, prec, coords, fBounds, result) {
+ if (levelFilter == tcuTexture.FilterMode.LINEAR) {
+ if (sampler.seamlessCubeMap)
+ return tcuTexLookupVerifier.isSeamplessLinearMipmapLinearSampleResultValid(faces0, faces1, sampler, prec, coords, fBounds, result);
+ else
+ return tcuTexLookupVerifier.isLinearMipmapLinearSampleResultValid_CoordAsVec2AndInt(faces0[coords.face], faces1[coords.face], sampler, prec, [coords.s, coords.t], 0, fBounds, result);
+ } else
+ return tcuTexLookupVerifier.isNearestMipmapLinearSampleResultValid_CoordAsVec2AndInt(faces0[coords.face], faces1[coords.face], sampler, prec, [coords.s, coords.t], 0, fBounds, result);
+ };
+
+ /**
+ * @param {tcuTexture.TextureCubeView} texture
+ * @param {number} levelNdx
+ * @param {Array<tcuTexture.ConstPixelBufferAccess>} out (&out)[CUBEFACE_LAST]
+ */
+ tcuTexLookupVerifier.getCubeLevelFaces = function(texture, levelNdx, out) {
+ for (var faceNdx = 0; faceNdx < 6; faceNdx++)
+ out[faceNdx] = texture.getLevelFace(levelNdx, /** @type {tcuTexture.CubeFace} */ (faceNdx));
+ };
+
+ /**
+ * @param {number} numLayers
+ * @param {number} numCoordBits
+ * @param {number} layerCoord
+ * @return {Array<number>}
+ */
+ tcuTexLookupVerifier.computeLayerRange = function(numLayers, numCoordBits, layerCoord) {
+ /** @type {number} */ var err = tcuTexVerifierUtil.computeFloatingPointError(layerCoord, numCoordBits);
+ /** @type {number} */ var minL = Math.floor(layerCoord - err + 0.5); // Round down
+ /** @type {number} */ var maxL = Math.ceil(layerCoord + err + 0.5) - 1; // Round up
+
+ assertMsgOptions(minL <= maxL, 'minL > maxL', false, true);
+
+ return [deMath.clamp(minL, 0, numLayers - 1), deMath.clamp(maxL, 0, numLayers - 1)];
+ };
+
+ /**
+ * @param {Array<number>} bits
+ * @return {Array<number>}
+ */
+ tcuTexLookupVerifier.computeFixedPointThreshold = function(bits) {
+ return tcuTexVerifierUtil.computeFixedPointError_Vector(bits);
+ };
+
+ /**
+ * @param {Array<number>} bits
+ * @param {Array<number>} value
+ * @return {Array<number>}
+ */
+ tcuTexLookupVerifier.computeFloatingPointThreshold = function(bits, value) {
+ return tcuTexVerifierUtil.computeFloatingPointError_Vector(value, bits);
+ };
+
+ /**
+ * @param {number} dudx
+ * @param {number} dvdx
+ * @param {number} dwdx
+ * @param {number} dudy
+ * @param {number} dvdy
+ * @param {number} dwdy
+ * @param {tcuTexLookupVerifier.LodPrecision} prec
+ * @return {Array<number>}
+ */
+ tcuTexLookupVerifier.computeLodBoundsFromDerivates = function(dudx, dvdx, dwdx, dudy, dvdy, dwdy, prec) {
+ /** @type {number} */ var mu = Math.max(Math.abs(dudx), Math.abs(dudy));
+ /** @type {number} */ var mv = Math.max(Math.abs(dvdx), Math.abs(dvdy));
+ /** @type {number} */ var mw = Math.max(Math.abs(dwdx), Math.abs(dwdy));
+ /** @type {number} */ var minDBound = Math.max(Math.max(mu, mv), mw);
+ /** @type {number} */ var maxDBound = mu + mv + mw;
+ /** @type {number} */ var minDErr = tcuTexVerifierUtil.computeFloatingPointError(minDBound, prec.derivateBits);
+ /** @type {number} */ var maxDErr = tcuTexVerifierUtil.computeFloatingPointError(maxDBound, prec.derivateBits);
+ /** @type {number} */ var minLod = Math.log2(minDBound - minDErr);
+ /** @type {number} */ var maxLod = Math.log2(maxDBound + maxDErr);
+ /** @type {number} */ var lodErr = tcuTexVerifierUtil.computeFixedPointError(prec.lodBits);
+
+ assertMsgOptions(minLod <= maxLod, 'Error: minLod > maxLod', false, true);
+ return [minLod - lodErr, maxLod + lodErr];
+ };
+
+ /**
+ * @param {number} dudx
+ * @param {number} dvdx
+ * @param {number} dudy
+ * @param {number} dvdy
+ * @param {tcuTexLookupVerifier.LodPrecision} prec
+ * @return {Array<number>}
+ */
+ tcuTexLookupVerifier.computeLodBoundsFromDerivatesUV = function(dudx, dvdx, dudy, dvdy, prec) {
+ return tcuTexLookupVerifier.computeLodBoundsFromDerivates(dudx, dvdx, 0, dudy, dvdy, 0, prec);
+ };
+
+ /**
+ * @param {number} dudx
+ * @param {number} dudy
+ * @param {tcuTexLookupVerifier.LodPrecision} prec
+ * @return {Array<number>}
+ */
+ tcuTexLookupVerifier.computeLodBoundsFromDerivatesU = function(dudx, dudy, prec) {
+ return tcuTexLookupVerifier.computeLodBoundsFromDerivates(dudx, 0, 0, dudy, 0, 0, prec);
+ };
+
+ /**
+ * @param {Array<number>} coord
+ * @param {Array<number>} coordDx
+ * @param {Array<number>} coordDy
+ * @param {number} faceSize
+ * @param {tcuTexLookupVerifier.LodPrecision} prec
+ * @return {Array<number>}
+ */
+ tcuTexLookupVerifier.computeCubeLodBoundsFromDerivates = function(coord, coordDx, coordDy, faceSize, prec) {
+ /** @type {boolean} */ var allowBrokenEdgeDerivate = false;
+ /** @type {tcuTexture.CubeFace} */ var face = tcuTexture.selectCubeFace(coord);
+ /** @type {number} */ var maNdx = 0;
+ /** @type {number} */ var sNdx = 0;
+ /** @type {number} */ var tNdx = 0;
+
+ // \note Derivate signs don't matter when computing lod
+ switch (face) {
+ case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X:
+ case tcuTexture.CubeFace.CUBEFACE_POSITIVE_X: maNdx = 0; sNdx = 2; tNdx = 1; break;
+ case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y:
+ case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y: maNdx = 1; sNdx = 0; tNdx = 2; break;
+ case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z:
+ case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z: maNdx = 2; sNdx = 0; tNdx = 1; break;
+ default:
+ throw new Error('Invalid CubeFace.');
+ }
+
+ /** @type {number} */ var sc = coord[sNdx];
+ /** @type {number} */ var tc = coord[tNdx];
+ /** @type {number} */ var ma = Math.abs(coord[maNdx]);
+ /** @type {number} */ var scdx = coordDx[sNdx];
+ /** @type {number} */ var tcdx = coordDx[tNdx];
+ /** @type {number} */ var madx = Math.abs(coordDx[maNdx]);
+ /** @type {number} */ var scdy = coordDy[sNdx];
+ /** @type {number} */ var tcdy = coordDy[tNdx];
+ /** @type {number} */ var mady = Math.abs(coordDy[maNdx]);
+ /** @type {number} */ var dudx = faceSize * 0.5 * (scdx * ma - sc * madx) / (ma * ma);
+ /** @type {number} */ var dvdx = faceSize * 0.5 * (tcdx * ma - tc * madx) / (ma * ma);
+ /** @type {number} */ var dudy = faceSize * 0.5 * (scdy * ma - sc * mady) / (ma * ma);
+ /** @type {number} */ var dvdy = faceSize * 0.5 * (tcdy * ma - tc * mady) / (ma * ma);
+ /** @type {Array<number>} */ var bounds = tcuTexLookupVerifier.computeLodBoundsFromDerivatesUV(dudx, dvdx, dudy, dvdy, prec);
+
+ // Implementations may compute derivate from projected (s, t) resulting in incorrect values at edges.
+ if (allowBrokenEdgeDerivate) {
+ /** @type {Array<number>} */ var dxErr = tcuTexVerifierUtil.computeFloatingPointError_Vector(coordDx, [prec.derivateBits, prec.derivateBits, prec.derivateBits]);
+ /** @type {Array<number>} */ var dyErr = tcuTexVerifierUtil.computeFloatingPointError_Vector(coordDy, [prec.derivateBits, prec.derivateBits, prec.derivateBits]);
+ /** @type {Array<number>} */ var xoffs = deMath.add(deMath.abs(coordDx), dxErr);
+ /** @type {Array<number>} */ var yoffs = deMath.add(deMath.abs(coordDy), dyErr);
+
+ if (tcuTexture.selectCubeFace(deMath.add(coord, xoffs)) != face ||
+ tcuTexture.selectCubeFace(deMath.subtract(coord, xoffs)) != face ||
+ tcuTexture.selectCubeFace(deMath.add(coord, yoffs)) != face ||
+ tcuTexture.selectCubeFace(deMath.subtract(coord, yoffs)) != face) {
+ return [bounds[0], 1000];
+ }
+ }
+
+ return bounds;
+ };
+
+ /**
+ * @param {Array<number>} lodBounds
+ * @param {Array<number>} lodMinMax
+ * @param {tcuTexLookupVerifier.LodPrecision} prec
+ * @return {Array<number>}
+ */
+ tcuTexLookupVerifier.clampLodBounds = function(lodBounds, lodMinMax, prec) {
+ /** @type {number} */ var lodErr = tcuTexVerifierUtil.computeFixedPointError(prec.lodBits);
+ /** @type {number} */ var a = lodMinMax[0];
+ /** @type {number} */ var b = lodMinMax[1];
+ return [deMath.clamp(lodBounds[0], a - lodErr, b - lodErr), deMath.clamp(lodBounds[1], a + lodErr, b + lodErr)];
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} access
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexLookupVerifier.TexLookupScaleMode} scaleMode
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {Array<number>} coord
+ * @param {number} coordZ
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isLevel2DLookupResultValid = function(access, sampler, scaleMode, prec, coord, coordZ, result) {
+ /** @type {tcuTexture.FilterMode} */
+ var filterMode = (scaleMode == tcuTexLookupVerifier.TexLookupScaleMode.MAGNIFY) ? sampler.magFilter : sampler.minFilter;
+ return tcuTexLookupVerifier.isLevelSampleResultValid_CoordAsVec2AndInt(access, sampler, filterMode, prec, coord, coordZ, result);
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} access
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexLookupVerifier.TexLookupScaleMode} scaleMode
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {Array<number>} coord
+ * @param {number} coordZ
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isLevel2DLookupResultValid_Int = function(access, sampler, scaleMode, prec, coord, coordZ, result) {
+ assertMsgOptions(sampler.minFilter == tcuTexture.FilterMode.NEAREST && sampler.magFilter == tcuTexture.FilterMode.NEAREST, 'minFilter and magFilter must be NEAREST', false, true);
+ return tcuTexLookupVerifier.isNearestSampleResultValid_CoordAsVec2AndInt(access, sampler, prec, coord, coordZ, result);
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} access
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexLookupVerifier.TexLookupScaleMode} scaleMode
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {Array<number>} coord
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isLevel3DLookupResultValid = function(access, sampler, scaleMode, prec, coord, result) {
+ /** @type {tcuTexture.FilterMode} */
+ var filterMode = (scaleMode == tcuTexLookupVerifier.TexLookupScaleMode.MAGNIFY) ? sampler.magFilter : sampler.minFilter;
+ return tcuTexLookupVerifier.isLevelSampleResultValid_CoordAsVec3(access, sampler, filterMode, prec, coord, result);
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} access
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexLookupVerifier.TexLookupScaleMode} scaleMode
+ * @param {tcuTexLookupVerifier.LookupPrecision} prec
+ * @param {Array<number>} coord
+ * @param {Array<number>} result
+ * @return {boolean}
+ */
+ tcuTexLookupVerifier.isLevel3DLookupResultValid_Int = function(access, sampler, scaleMode, prec, coord, result) {
+ assertMsgOptions(sampler.minFilter == tcuTexture.FilterMode.NEAREST && sampler.magFilter == tcuTexture.FilterMode.NEAREST, 'minFilter and magFilter must be NEAREST', false, true);
+ return tcuTexLookupVerifier.isNearestSampleResultValid_CoordAsVec3(access, sampler, prec, coord, result);
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexVerifierUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexVerifierUtil.js
new file mode 100644
index 0000000000..4c88f44608
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexVerifierUtil.js
@@ -0,0 +1,265 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.common.tcuTexVerifierUtil');
+goog.require('framework.common.tcuFloat');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deUtil');
+
+goog.scope(function() {
+
+ var tcuTexVerifierUtil = framework.common.tcuTexVerifierUtil;
+ var deMath = framework.delibs.debase.deMath;
+ var deUtil = framework.delibs.debase.deUtil;
+ var tcuFloat = framework.common.tcuFloat;
+ var tcuTexture = framework.common.tcuTexture;
+
+ /**
+ * @param {number} value
+ * @param {number} numAccurateBits
+ * @return {number}
+ */
+ tcuTexVerifierUtil.computeFloatingPointError = function(value, numAccurateBits) {
+ /** @type {number} */ var numGarbageBits = 23 - numAccurateBits;
+ /** @type {number} */ var mask = (1 << numGarbageBits) - 1;
+ /** @type {number} */ var exp = tcuFloat.newFloat32(value).exponent();
+
+ /** @type {tcuFloat.deFloat} */ var v1 = new tcuFloat.deFloat();
+ /** @type {tcuFloat.deFloat} */ var v2 = new tcuFloat.deFloat();
+ return v1.construct(1, exp, 1 << 23 | mask).getValue() - v2.construct(1, exp, 1 << 23).getValue();
+ };
+
+ /**
+ * @param {number} numAccurateBits
+ * @return {number}
+ */
+ tcuTexVerifierUtil.computeFixedPointError = function(numAccurateBits) {
+ return tcuTexVerifierUtil.computeFloatingPointError(1.0, numAccurateBits);
+ };
+
+ /**
+ * @param {Array<number>} numAccurateBits
+ * @return {Array<number>}
+ */
+ tcuTexVerifierUtil.computeFixedPointError_Vector = function(numAccurateBits) {
+ /** @type {Array<number>} */ var res = [];
+ for (var ndx = 0; ndx < numAccurateBits.length; ndx++)
+ res[ndx] = tcuTexVerifierUtil.computeFixedPointError(numAccurateBits[ndx]);
+ return res;
+ };
+
+ /**
+ * @param {Array<number>} value
+ * @param {Array<number>} numAccurateBits
+ * @return {Array<number>}
+ */
+ tcuTexVerifierUtil.computeFloatingPointError_Vector = function(value, numAccurateBits) {
+ assertMsgOptions(value.length === numAccurateBits.length, '', false, true);
+ /** @type {Array<number>} */ var res = [];
+ for (var ndx = 0; ndx < value.length; ndx++)
+ res[ndx] = tcuTexVerifierUtil.computeFloatingPointError(value[ndx], numAccurateBits[ndx]);
+ return res;
+ };
+
+ // Sampler introspection
+
+ /**
+ * @param {tcuTexture.FilterMode} mode
+ * @return {boolean}
+ */
+ tcuTexVerifierUtil.isNearestMipmapFilter = function(mode) {
+ return mode == tcuTexture.FilterMode.NEAREST_MIPMAP_NEAREST || mode == tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST;
+ };
+
+ /**
+ * @param {tcuTexture.FilterMode} mode
+ * @return {boolean}
+ */
+ tcuTexVerifierUtil.isLinearMipmapFilter = function(mode) {
+ return mode == tcuTexture.FilterMode.NEAREST_MIPMAP_LINEAR || mode == tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR;
+ };
+
+ /**
+ * @param {tcuTexture.FilterMode} mode
+ * @return {boolean}
+ */
+ tcuTexVerifierUtil.isMipmapFilter = function(mode) {
+ return tcuTexVerifierUtil.isNearestMipmapFilter(mode) || tcuTexVerifierUtil.isLinearMipmapFilter(mode);
+ };
+
+ /**
+ * @param {tcuTexture.FilterMode} mode
+ * @return {boolean}
+ */
+ tcuTexVerifierUtil.isLinearFilter = function(mode) {
+ return mode == tcuTexture.FilterMode.LINEAR || mode == tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST || mode == tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR;
+ };
+
+ /**
+ * @param {tcuTexture.FilterMode} mode
+ * @return {boolean}
+ */
+ tcuTexVerifierUtil.isNearestFilter = function(mode) {
+ return !tcuTexVerifierUtil.isLinearFilter(mode);
+ };
+
+ /**
+ * @param {tcuTexture.FilterMode} mode
+ * @return {tcuTexture.FilterMode}
+ */
+ tcuTexVerifierUtil.getLevelFilter = function(mode) {
+ return tcuTexVerifierUtil.isLinearFilter(mode) ? tcuTexture.FilterMode.LINEAR : tcuTexture.FilterMode.NEAREST;
+ };
+
+ /**
+ * @param {tcuTexture.WrapMode} mode
+ * @return {boolean}
+ */
+ tcuTexVerifierUtil.isWrapModeSupported = function(mode) {
+ return mode != tcuTexture.WrapMode.MIRRORED_REPEAT_CL && mode != tcuTexture.WrapMode.REPEAT_CL;
+ };
+
+ /**
+ *
+ * @param {boolean} normalizedCoords
+ * @param {number} dim
+ * @param {number} coord
+ * @param {number} coordBits
+ * @param {number} uvBits
+ * @return {Array<number>}
+ */
+ tcuTexVerifierUtil.computeNonNormalizedCoordBounds = function(normalizedCoords, dim, coord, coordBits, uvBits) {
+ /** @type {number} */ var coordErr = tcuTexVerifierUtil.computeFloatingPointError(coord, coordBits);
+ /** @type {number} */ var minN = coord - coordErr;
+ /** @type {number} */ var maxN = coord + coordErr;
+ /** @type {number} */ var minA = normalizedCoords ? minN * dim : minN;
+ /** @type {number} */ var maxA = normalizedCoords ? maxN * dim : maxN;
+ /** @type {number} */ var minC = minA - tcuTexVerifierUtil.computeFixedPointError(uvBits);
+ /** @type {number} */ var maxC = maxA + tcuTexVerifierUtil.computeFixedPointError(uvBits);
+ assertMsgOptions(minC <= maxC, '', false, true);
+ return [minC, maxC];
+ };
+
+ /**
+ * @param {Array<number>} coord
+ * @param {Array<number>} bits
+ * @return {?Array<tcuTexture.CubeFace>}
+ */
+ tcuTexVerifierUtil.getPossibleCubeFaces = function(coord, bits) {
+
+ /** @type {Array<tcuTexture.CubeFace>} */ var faces = [];
+
+ /** @type {number} */ var x = coord[0];
+ /** @type {number} */ var y = coord[1];
+ /** @type {number} */ var z = coord[2];
+ /** @type {number} */ var ax = Math.abs(x);
+ /** @type {number} */ var ay = Math.abs(y);
+ /** @type {number} */ var az = Math.abs(z);
+ /** @type {number} */ var ex = tcuTexVerifierUtil.computeFloatingPointError(x, bits[0]);
+ /** @type {number} */ var ey = tcuTexVerifierUtil.computeFloatingPointError(y, bits[1]);
+ /** @type {number} */ var ez = tcuTexVerifierUtil.computeFloatingPointError(z, bits[2]);
+ /** @type {number} */ var numFaces = 0;
+
+ if (ay + ey < ax - ex && az + ez < ax - ex) {
+ if (x >= ex) faces.push(tcuTexture.CubeFace.CUBEFACE_POSITIVE_X);
+ if (x <= ex) faces.push(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X);
+ } else if (ax + ex < ay - ey && az + ez < ay - ey) {
+ if (y >= ey) faces.push(tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y);
+ if (y <= ey) faces.push(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y);
+ } else if (ax + ex < az - ez && ay + ey < az - ez) {
+ if (z >= ez) faces.push(tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z);
+ if (z <= ez) faces.push(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z);
+ } else {
+ // One or more components are equal (or within error bounds). Allow all faces where major axis is not zero.
+ if (ax > ex) {
+ faces.push(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X);
+ faces.push(tcuTexture.CubeFace.CUBEFACE_POSITIVE_X);
+ }
+
+ if (ay > ey) {
+ faces.push(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y);
+ faces.push(tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y);
+ }
+
+ if (az > ez) {
+ faces.push(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z);
+ faces.push(tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z);
+ }
+ }
+
+ return faces.length == 0 ? null : faces;
+ };
+
+ /**
+ * @param {tcuTexture.Sampler} sampler
+ * @return {tcuTexture.Sampler}
+ */
+ tcuTexVerifierUtil.getUnnormalizedCoordSampler = function(sampler) {
+ var copy = /** @type {tcuTexture.Sampler} */ (deUtil.clone(sampler));
+ copy.normalizedCoords = false;
+ return copy;
+ };
+
+ /**
+ * @param {number} a
+ * @param {number} b
+ * @return {number}
+ */
+ tcuTexVerifierUtil.imod = function(a, b) {
+ return deMath.imod(a, b);
+ };
+
+ /**
+ * @param {number} a
+ * @return {number}
+ */
+ tcuTexVerifierUtil.mirror = function(a) {
+ return deMath.mirror(a);
+ };
+
+ /**
+ * @param {tcuTexture.WrapMode} mode
+ * @param {number} c
+ * @param {number} size
+ * @return {number}
+ */
+ tcuTexVerifierUtil.wrap = function(mode, c, size) {
+ switch (mode) {
+ // \note CL and GL modes are handled identically here, as verification process accounts for
+ // accuracy differences caused by different methods (wrapping vs. denormalizing first).
+ case tcuTexture.WrapMode.CLAMP_TO_EDGE:
+ return deMath.clamp(c, 0, size - 1);
+
+ case tcuTexture.WrapMode.REPEAT_GL:
+ case tcuTexture.WrapMode.REPEAT_CL:
+ return deMath.imod(c, size);
+
+ case tcuTexture.WrapMode.MIRRORED_REPEAT_GL:
+ case tcuTexture.WrapMode.MIRRORED_REPEAT_CL:
+ return (size - 1) - deMath.mirror(deMath.imod(c, 2 * size) - size);
+
+ default:
+ throw new Error('Wrap mode not supported.');
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexture.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexture.js
new file mode 100644
index 0000000000..8a3a2ed1d4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTexture.js
@@ -0,0 +1,3636 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.common.tcuTexture');
+goog.require('framework.common.tcuFloat');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.delibs.debase.deUtil');
+
+goog.scope(function() {
+
+var tcuTexture = framework.common.tcuTexture;
+var deMath = framework.delibs.debase.deMath;
+var tcuFloat = framework.common.tcuFloat;
+var deString = framework.delibs.debase.deString;
+var deUtil = framework.delibs.debase.deUtil;
+
+var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+};
+
+/**
+ * Texture tcuTexture.channel order
+ * @enum
+ */
+tcuTexture.ChannelOrder = {
+ R: 0,
+ A: 1,
+ I: 2,
+ L: 3,
+ LA: 4,
+ RG: 5,
+ RA: 6,
+ RGB: 7,
+ RGBA: 8,
+ ARGB: 9,
+ BGRA: 10,
+
+ sRGB: 11,
+ sRGBA: 12,
+
+ D: 13,
+ S: 14,
+ DS: 15
+};
+
+/**
+ * Texture tcuTexture.channel type
+ * @enum
+ */
+tcuTexture.ChannelType = {
+ SNORM_INT8: 0,
+ SNORM_INT16: 1,
+ SNORM_INT32: 2,
+ UNORM_INT8: 3,
+ UNORM_INT16: 4,
+ UNORM_INT32: 5,
+ UNORM_SHORT_565: 6,
+ UNORM_SHORT_555: 7,
+ UNORM_SHORT_4444: 8,
+ UNORM_SHORT_5551: 9,
+ UNORM_INT_101010: 10,
+ UNORM_INT_1010102_REV: 11,
+ UNSIGNED_INT_1010102_REV: 12,
+ UNSIGNED_INT_11F_11F_10F_REV: 13,
+ UNSIGNED_INT_999_E5_REV: 14,
+ UNSIGNED_INT_24_8: 15,
+ SIGNED_INT8: 16,
+ SIGNED_INT16: 17,
+ SIGNED_INT32: 18,
+ UNSIGNED_INT8: 19,
+ UNSIGNED_INT16: 20,
+ UNSIGNED_INT32: 21,
+ HALF_FLOAT: 22,
+ FLOAT: 23,
+ FLOAT_UNSIGNED_INT_24_8_REV: 24
+};
+
+/**
+ * Enums for tcuTexture.TextureChannelClass
+ * @enum {number}
+ */
+tcuTexture.TextureChannelClass = {
+
+ SIGNED_FIXED_POINT: 0,
+ UNSIGNED_FIXED_POINT: 1,
+ SIGNED_INTEGER: 2,
+ UNSIGNED_INTEGER: 3,
+ FLOATING_POINT: 4
+};
+
+/**
+ * @param {?tcuTexture.ChannelType} channelType
+ * @return {tcuTexture.TextureChannelClass}
+ */
+tcuTexture.getTextureChannelClass = function(channelType) {
+
+ switch (channelType) {
+ case tcuTexture.ChannelType.SNORM_INT8: return tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT;
+ case tcuTexture.ChannelType.SNORM_INT16: return tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT;
+ case tcuTexture.ChannelType.UNORM_INT8: return tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT;
+ case tcuTexture.ChannelType.UNORM_INT16: return tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT;
+ case tcuTexture.ChannelType.UNORM_SHORT_565: return tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT;
+ case tcuTexture.ChannelType.UNORM_SHORT_555: return tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT;
+ case tcuTexture.ChannelType.UNORM_SHORT_4444: return tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT;
+ case tcuTexture.ChannelType.UNORM_SHORT_5551: return tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT;
+ case tcuTexture.ChannelType.UNORM_INT_101010: return tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT;
+ case tcuTexture.ChannelType.UNORM_INT_1010102_REV: return tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT;
+ case tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV: return tcuTexture.TextureChannelClass.UNSIGNED_INTEGER;
+ case tcuTexture.ChannelType.UNSIGNED_INT_11F_11F_10F_REV: return tcuTexture.TextureChannelClass.FLOATING_POINT;
+ case tcuTexture.ChannelType.UNSIGNED_INT_999_E5_REV: return tcuTexture.TextureChannelClass.FLOATING_POINT;
+ case tcuTexture.ChannelType.SIGNED_INT8: return tcuTexture.TextureChannelClass.SIGNED_INTEGER;
+ case tcuTexture.ChannelType.SIGNED_INT16: return tcuTexture.TextureChannelClass.SIGNED_INTEGER;
+ case tcuTexture.ChannelType.SIGNED_INT32: return tcuTexture.TextureChannelClass.SIGNED_INTEGER;
+ case tcuTexture.ChannelType.UNSIGNED_INT8: return tcuTexture.TextureChannelClass.UNSIGNED_INTEGER;
+ case tcuTexture.ChannelType.UNSIGNED_INT16: return tcuTexture.TextureChannelClass.UNSIGNED_INTEGER;
+ case tcuTexture.ChannelType.UNSIGNED_INT32: return tcuTexture.TextureChannelClass.UNSIGNED_INTEGER;
+ case tcuTexture.ChannelType.HALF_FLOAT: return tcuTexture.TextureChannelClass.FLOATING_POINT;
+ case tcuTexture.ChannelType.FLOAT: return tcuTexture.TextureChannelClass.FLOATING_POINT;
+ default: return /** @type {tcuTexture.TextureChannelClass<number>} */ (Object.keys(tcuTexture.ChannelType).length);
+ }
+};
+
+/**
+ * @param {tcuTexture.TextureFormat} format
+ */
+tcuTexture.isFixedPointDepthTextureFormat = function(format) {
+ var channelClass = tcuTexture.getTextureChannelClass(format.type);
+
+ if (format.order == tcuTexture.ChannelOrder.D) {
+ // depth internal formats cannot be non-normalized integers
+ return channelClass != tcuTexture.TextureChannelClass.FLOATING_POINT;
+ } else if (format.order == tcuTexture.ChannelOrder.DS) {
+ // combined formats have no single channel class, detect format manually
+ switch (format.type) {
+ case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV: return false;
+ case tcuTexture.ChannelType.UNSIGNED_INT_24_8: return true;
+
+ default:
+ // unknown format
+ DE_ASSERT(false);
+ return true;
+ }
+ }
+ return false;
+};
+
+/**
+ * @param {Array<number>} color
+ * @param {tcuTexture.CompareMode} compare
+ * @param {number} chanNdx
+ * @param {number} ref_
+ * @param {boolean} isFixedPoint
+ */
+tcuTexture.execCompare = function(color, compare, chanNdx, ref_, isFixedPoint) {
+ var clampValues = isFixedPoint;
+ var cmp = clampValues ? deMath.clamp(color[chanNdx], 0.0, 1.0) : color[chanNdx];
+ var ref = clampValues ? deMath.clamp(ref_, 0.0, 1.0) : ref_;
+ var res = false;
+
+ switch (compare) {
+ case tcuTexture.CompareMode.COMPAREMODE_LESS: res = ref < cmp; break;
+ case tcuTexture.CompareMode.COMPAREMODE_LESS_OR_EQUAL: res = ref <= cmp; break;
+ case tcuTexture.CompareMode.COMPAREMODE_GREATER: res = ref > cmp; break;
+ case tcuTexture.CompareMode.COMPAREMODE_GREATER_OR_EQUAL: res = ref >= cmp; break;
+ case tcuTexture.CompareMode.COMPAREMODE_EQUAL: res = ref == cmp; break;
+ case tcuTexture.CompareMode.COMPAREMODE_NOT_EQUAL: res = ref != cmp; break;
+ case tcuTexture.CompareMode.COMPAREMODE_ALWAYS: res = true; break;
+ case tcuTexture.CompareMode.COMPAREMODE_NEVER: res = false; break;
+ default:
+ DE_ASSERT(false);
+ }
+
+ return res ? 1.0 : 0.0;
+};
+
+/**
+ * @param {Array<tcuTexture.ConstPixelBufferAccess>} levels
+ * @param {number} numLevels
+ * @param {tcuTexture.Sampler} sampler
+ * @param {number} ref
+ * @param {number} s
+ * @param {number} t
+ * @param {number} lod
+ * @param {Array<number>} offset
+ */
+tcuTexture.sampleLevelArray2DCompare = function(levels, numLevels, sampler, ref, s, t, lod, offset) {
+ var magnified = lod <= sampler.lodThreshold;
+ var filterMode = magnified ? sampler.magFilter : sampler.minFilter;
+
+ switch (filterMode) {
+ case tcuTexture.FilterMode.NEAREST: return levels[0].sample2DCompare(sampler, filterMode, ref, s, t, offset);
+ case tcuTexture.FilterMode.LINEAR: return levels[0].sample2DCompare(sampler, filterMode, ref, s, t, offset);
+
+ case tcuTexture.FilterMode.NEAREST_MIPMAP_NEAREST:
+ case tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST: {
+ var maxLevel = numLevels - 1;
+ var level = deMath.clamp(Math.ceil(lod + 0.5) - 1, 0, maxLevel);
+ var levelFilter = filterMode == tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST ? tcuTexture.FilterMode.LINEAR : tcuTexture.FilterMode.NEAREST;
+
+ return levels[level].sample2DCompare(sampler, levelFilter, ref, s, t, offset);
+ }
+
+ case tcuTexture.FilterMode.NEAREST_MIPMAP_LINEAR:
+ case tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR: {
+ var maxLevel = numLevels - 1;
+ var level0 = deMath.clamp(Math.floor(lod), 0, maxLevel);
+ var level1 = Math.min(maxLevel, level0 + 1);
+ var levelFilter = filterMode == tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR ? tcuTexture.FilterMode.LINEAR : tcuTexture.FilterMode.NEAREST;
+ var f = deMath.deFloatFrac(lod);
+ var t0 = levels[level0].sample2DCompare(sampler, levelFilter, ref, s, t, offset);
+ var t1 = levels[level1].sample2DCompare(sampler, levelFilter, ref, s, t, offset);
+
+ return t0 * (1.0 - f) + t1 * f;
+ }
+
+ default:
+ DE_ASSERT(false);
+ return 0.0;
+ }
+};
+
+/**
+ * @param {tcuTexture.ConstPixelBufferAccess} access
+ * @param {tcuTexture.Sampler} sampler
+ * @param {number} ref
+ * @param {number} u
+ * @param {number} v
+ * @param {Array<number>} offset
+ * @param {boolean} isFixedPointDepthFormat
+ * @return {number}
+ */
+tcuTexture.sampleLinear2DCompare = function(access, sampler, ref, u, v, offset, isFixedPointDepthFormat) {
+ var w = access.getWidth();
+ var h = access.getHeight();
+
+ var x0 = Math.floor(u - 0.5) + offset[0];
+ var x1 = x0 + 1;
+ var y0 = Math.floor(v - 0.5) + offset[1];
+ var y1 = y0 + 1;
+
+ var i0 = tcuTexture.wrap(sampler.wrapS, x0, w);
+ var i1 = tcuTexture.wrap(sampler.wrapS, x1, w);
+ var j0 = tcuTexture.wrap(sampler.wrapT, y0, h);
+ var j1 = tcuTexture.wrap(sampler.wrapT, y1, h);
+
+ var a = deMath.deFloatFrac(u - 0.5);
+ var b = deMath.deFloatFrac(v - 0.5);
+
+ var i0UseBorder = sampler.wrapS == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(i0, 0, w);
+ var i1UseBorder = sampler.wrapS == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(i1, 0, w);
+ var j0UseBorder = sampler.wrapT == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(j0, 0, h);
+ var j1UseBorder = sampler.wrapT == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(j1, 0, h);
+
+ // Border color for out-of-range coordinates if using CLAMP_TO_BORDER, otherwise execute lookups.
+ var p00Clr = (i0UseBorder || j0UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i0, j0, offset[2]);
+ var p10Clr = (i1UseBorder || j0UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i1, j0, offset[2]);
+ var p01Clr = (i0UseBorder || j1UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i0, j1, offset[2]);
+ var p11Clr = (i1UseBorder || j1UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i1, j1, offset[2]);
+
+ // Execute comparisons.
+ var p00 = tcuTexture.execCompare(p00Clr, sampler.compare, sampler.compareChannel, ref, isFixedPointDepthFormat);
+ var p10 = tcuTexture.execCompare(p10Clr, sampler.compare, sampler.compareChannel, ref, isFixedPointDepthFormat);
+ var p01 = tcuTexture.execCompare(p01Clr, sampler.compare, sampler.compareChannel, ref, isFixedPointDepthFormat);
+ var p11 = tcuTexture.execCompare(p11Clr, sampler.compare, sampler.compareChannel, ref, isFixedPointDepthFormat);
+
+ // Interpolate.
+ return (p00 * (1.0 - a) * (1.0 - b)) +
+ (p10 * (a) * (1.0 - b)) +
+ (p01 * (1.0 - a) * (b)) +
+ (p11 * (a) * (b));
+};
+
+/**
+ * Construct texture format
+ * @param {?tcuTexture.ChannelOrder} order
+ * @param {?tcuTexture.ChannelType} type
+ *
+ * @constructor
+ */
+tcuTexture.TextureFormat = function(order, type) {
+ this.order = order;
+ this.type = type;
+};
+
+/**
+ * Compare two formats
+ * @param {tcuTexture.TextureFormat} format Format to compare with
+ * @return {boolean}
+ */
+tcuTexture.TextureFormat.prototype.isEqual = function(format) {
+ return this.order === format.order && this.type === format.type;
+};
+
+tcuTexture.TextureFormat.prototype.toString = function() {
+ return 'TextureFormat(' + deString.enumToString(tcuTexture.ChannelOrder, this.order) + ', ' +
+ deString.enumToString(tcuTexture.ChannelType, this.type) + ')';
+};
+
+/**
+ * Is format sRGB?
+ * @return {boolean}
+ */
+tcuTexture.TextureFormat.prototype.isSRGB = function() {
+ return this.order === tcuTexture.ChannelOrder.sRGB || this.order === tcuTexture.ChannelOrder.sRGBA;
+};
+
+tcuTexture.TextureFormat.prototype.getNumStencilBits = function() {
+ switch (this.order) {
+ case tcuTexture.ChannelOrder.S:
+ switch (this.type) {
+ case tcuTexture.ChannelType.UNSIGNED_INT8: return 8;
+ case tcuTexture.ChannelType.UNSIGNED_INT16: return 16;
+ case tcuTexture.ChannelType.UNSIGNED_INT32: return 32;
+ default:
+ throw new Error('Wrong type: ' + this.type);
+ }
+
+ case tcuTexture.ChannelOrder.DS:
+ switch (this.type) {
+ case tcuTexture.ChannelType.UNSIGNED_INT_24_8: return 8;
+ case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV: return 8;
+ default:
+ throw new Error('Wrong type: ' + this.type);
+ }
+
+ default:
+ throw new Error('Wrong order: ' + this.order);
+ }
+};
+
+/**
+ * Get TypedArray type that can be used to access texture.
+ * @param {?tcuTexture.ChannelType} type
+ * @return TypedArray that supports the tcuTexture.channel type.
+ */
+tcuTexture.getTypedArray = function(type) {
+ switch (type) {
+ case tcuTexture.ChannelType.SNORM_INT8: return Int8Array;
+ case tcuTexture.ChannelType.SNORM_INT16: return Int16Array;
+ case tcuTexture.ChannelType.SNORM_INT32: return Int32Array;
+ case tcuTexture.ChannelType.UNORM_INT8: return Uint8Array;
+ case tcuTexture.ChannelType.UNORM_INT16: return Uint16Array;
+ case tcuTexture.ChannelType.UNORM_INT32: return Uint32Array;
+ case tcuTexture.ChannelType.UNORM_SHORT_565: return Uint16Array;
+ case tcuTexture.ChannelType.UNORM_SHORT_555: return Uint16Array;
+ case tcuTexture.ChannelType.UNORM_SHORT_4444: return Uint16Array;
+ case tcuTexture.ChannelType.UNORM_SHORT_5551: return Uint16Array;
+ case tcuTexture.ChannelType.UNORM_INT_101010: return Uint32Array;
+ case tcuTexture.ChannelType.UNORM_INT_1010102_REV: return Uint32Array;
+ case tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV: return Uint32Array;
+ case tcuTexture.ChannelType.UNSIGNED_INT_11F_11F_10F_REV: return Uint32Array;
+ case tcuTexture.ChannelType.UNSIGNED_INT_999_E5_REV: return Uint32Array;
+ case tcuTexture.ChannelType.UNSIGNED_INT_24_8: return Uint32Array;
+ case tcuTexture.ChannelType.FLOAT: return Float32Array;
+ case tcuTexture.ChannelType.SIGNED_INT8: return Int8Array;
+ case tcuTexture.ChannelType.SIGNED_INT16: return Int16Array;
+ case tcuTexture.ChannelType.SIGNED_INT32: return Int32Array;
+ case tcuTexture.ChannelType.UNSIGNED_INT8: return Uint8Array;
+ case tcuTexture.ChannelType.UNSIGNED_INT16: return Uint16Array;
+ case tcuTexture.ChannelType.UNSIGNED_INT32: return Uint32Array;
+ case tcuTexture.ChannelType.HALF_FLOAT: return Uint16Array;
+ case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV: return Float32Array; /* this type is a special case */
+ }
+
+ throw new Error('Unrecognized type ' + type);
+};
+
+/**
+ * @return {number} pixel size in bytes
+ */
+tcuTexture.TextureFormat.prototype.getPixelSize = function() {
+ if (this.type == null || this.order == null) {
+ // Invalid/empty format.
+ return 0;
+ } else if (this.type == tcuTexture.ChannelType.UNORM_SHORT_565 ||
+ this.type == tcuTexture.ChannelType.UNORM_SHORT_555 ||
+ this.type == tcuTexture.ChannelType.UNORM_SHORT_4444 ||
+ this.type == tcuTexture.ChannelType.UNORM_SHORT_5551) {
+ DE_ASSERT(this.order == tcuTexture.ChannelOrder.RGB || this.order == tcuTexture.ChannelOrder.RGBA);
+ return 2;
+ } else if (this.type == tcuTexture.ChannelType.UNORM_INT_101010 ||
+ this.type == tcuTexture.ChannelType.UNSIGNED_INT_999_E5_REV ||
+ this.type == tcuTexture.ChannelType.UNSIGNED_INT_11F_11F_10F_REV) {
+ DE_ASSERT(this.order == tcuTexture.ChannelOrder.RGB);
+ return 4;
+ } else if (this.type == tcuTexture.ChannelType.UNORM_INT_1010102_REV ||
+ this.type == tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV) {
+ DE_ASSERT(this.order == tcuTexture.ChannelOrder.RGBA);
+ return 4;
+ } else if (this.type == tcuTexture.ChannelType.UNSIGNED_INT_24_8) {
+ DE_ASSERT(this.order == tcuTexture.ChannelOrder.D || this.order == tcuTexture.ChannelOrder.DS);
+ return 4;
+ } else if (this.type == tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV) {
+ DE_ASSERT(this.order == tcuTexture.ChannelOrder.DS);
+ return 8;
+ } else {
+ var numChannels;
+ var channelSize;
+
+ switch (this.order) {
+ case tcuTexture.ChannelOrder.R: numChannels = 1; break;
+ case tcuTexture.ChannelOrder.A: numChannels = 1; break;
+ case tcuTexture.ChannelOrder.I: numChannels = 1; break;
+ case tcuTexture.ChannelOrder.L: numChannels = 1; break;
+ case tcuTexture.ChannelOrder.LA: numChannels = 2; break;
+ case tcuTexture.ChannelOrder.RG: numChannels = 2; break;
+ case tcuTexture.ChannelOrder.RA: numChannels = 2; break;
+ case tcuTexture.ChannelOrder.RGB: numChannels = 3; break;
+ case tcuTexture.ChannelOrder.RGBA: numChannels = 4; break;
+ case tcuTexture.ChannelOrder.ARGB: numChannels = 4; break;
+ case tcuTexture.ChannelOrder.BGRA: numChannels = 4; break;
+ case tcuTexture.ChannelOrder.sRGB: numChannels = 3; break;
+ case tcuTexture.ChannelOrder.sRGBA: numChannels = 4; break;
+ case tcuTexture.ChannelOrder.D: numChannels = 1; break;
+ case tcuTexture.ChannelOrder.S: numChannels = 1; break;
+ case tcuTexture.ChannelOrder.DS: numChannels = 2; break;
+ default: DE_ASSERT(false);
+ }
+
+ switch (this.type) {
+ case tcuTexture.ChannelType.SNORM_INT8: channelSize = 1; break;
+ case tcuTexture.ChannelType.SNORM_INT16: channelSize = 2; break;
+ case tcuTexture.ChannelType.SNORM_INT32: channelSize = 4; break;
+ case tcuTexture.ChannelType.UNORM_INT8: channelSize = 1; break;
+ case tcuTexture.ChannelType.UNORM_INT16: channelSize = 2; break;
+ case tcuTexture.ChannelType.UNORM_INT32: channelSize = 4; break;
+ case tcuTexture.ChannelType.SIGNED_INT8: channelSize = 1; break;
+ case tcuTexture.ChannelType.SIGNED_INT16: channelSize = 2; break;
+ case tcuTexture.ChannelType.SIGNED_INT32: channelSize = 4; break;
+ case tcuTexture.ChannelType.UNSIGNED_INT8: channelSize = 1; break;
+ case tcuTexture.ChannelType.UNSIGNED_INT16: channelSize = 2; break;
+ case tcuTexture.ChannelType.UNSIGNED_INT32: channelSize = 4; break;
+ case tcuTexture.ChannelType.HALF_FLOAT: channelSize = 2; break;
+ case tcuTexture.ChannelType.FLOAT: channelSize = 4; break;
+ default: DE_ASSERT(false);
+ }
+
+ return numChannels * channelSize;
+ }
+};
+
+/**
+ * @enum
+ */
+tcuTexture.CubeFace = {
+ CUBEFACE_NEGATIVE_X: 0,
+ CUBEFACE_POSITIVE_X: 1,
+ CUBEFACE_NEGATIVE_Y: 2,
+ CUBEFACE_POSITIVE_Y: 3,
+ CUBEFACE_NEGATIVE_Z: 4,
+ CUBEFACE_POSITIVE_Z: 5
+};
+
+/**
+ * Renamed from ArrayBuffer due to name clash
+ * Wraps ArrayBuffer.
+ * @constructor
+ * @param {number=} numElements
+ */
+tcuTexture.DeqpArrayBuffer = function(numElements) {
+ if (numElements)
+ this.m_ptr = new ArrayBuffer(numElements);
+};
+
+/**
+ * Set array size
+ * @param {number} numElements Size in bytes
+ */
+tcuTexture.DeqpArrayBuffer.prototype.setStorage = function(numElements) {
+ this.m_ptr = new ArrayBuffer(numElements);
+};
+
+/**
+ * @return {number} Buffer size
+ */
+tcuTexture.DeqpArrayBuffer.prototype.size = function() {
+ if (this.m_ptr)
+ return this.m_ptr.byteLength;
+
+ return 0;
+};
+
+/**
+ * Is the buffer empty (zero size)?
+ * @return {boolean}
+ */
+tcuTexture.DeqpArrayBuffer.prototype.empty = function() {
+ if (!this.m_ptr)
+ return true;
+ return this.size() == 0;
+};
+
+/**
+ * @enum
+ * The values are negative to avoid conflict with channels 0 - 3
+ */
+tcuTexture.channel = {
+ ZERO: -1,
+ ONE: -2
+};
+
+/**
+ * @param {tcuTexture.ChannelOrder} order
+ * @return {Array<Number|tcuTexture.channel>}
+ */
+tcuTexture.getChannelReadMap = function(order) {
+ switch (order) {
+ /*static const Channel INV[] = { tcuTexture.channel.ZERO, tcuTexture.channel.ZERO, tcuTexture.channel.ZERO, tcuTexture.channel.ONE }; */
+
+ case tcuTexture.ChannelOrder.R: return [0, tcuTexture.channel.ZERO, tcuTexture.channel.ZERO, tcuTexture.channel.ONE];
+ case tcuTexture.ChannelOrder.A: return [tcuTexture.channel.ZERO, tcuTexture.channel.ZERO, tcuTexture.channel.ZERO, 0];
+ case tcuTexture.ChannelOrder.I: return [0, 0, 0, 0];
+ case tcuTexture.ChannelOrder.L: return [0, 0, 0, tcuTexture.channel.ONE];
+ case tcuTexture.ChannelOrder.LA: return [0, 0, 0, 1];
+ case tcuTexture.ChannelOrder.RG: return [0, 1, tcuTexture.channel.ZERO, tcuTexture.channel.ONE];
+ case tcuTexture.ChannelOrder.RA: return [0, tcuTexture.channel.ZERO, tcuTexture.channel.ZERO, 1];
+ case tcuTexture.ChannelOrder.RGB: return [0, 1, 2, tcuTexture.channel.ONE];
+ case tcuTexture.ChannelOrder.RGBA: return [0, 1, 2, 3];
+ case tcuTexture.ChannelOrder.BGRA: return [2, 1, 0, 3];
+ case tcuTexture.ChannelOrder.ARGB: return [1, 2, 3, 0];
+ case tcuTexture.ChannelOrder.sRGB: return [0, 1, 2, tcuTexture.channel.ONE];
+ case tcuTexture.ChannelOrder.sRGBA: return [0, 1, 2, 3];
+ case tcuTexture.ChannelOrder.D: return [0, tcuTexture.channel.ZERO, tcuTexture.channel.ZERO, tcuTexture.channel.ONE];
+ case tcuTexture.ChannelOrder.S: return [tcuTexture.channel.ZERO, tcuTexture.channel.ZERO, tcuTexture.channel.ZERO, 0];
+ case tcuTexture.ChannelOrder.DS: return [0, tcuTexture.channel.ZERO, tcuTexture.channel.ZERO, 1];
+ }
+
+ throw new Error('Unrecognized order ' + order);
+};
+
+/**
+ * @param {tcuTexture.ChannelOrder} order
+ * @return {Array<number>}
+ */
+tcuTexture.getChannelWriteMap = function(order) {
+ switch (order) {
+ case tcuTexture.ChannelOrder.R: return [0];
+ case tcuTexture.ChannelOrder.A: return [3];
+ case tcuTexture.ChannelOrder.I: return [0];
+ case tcuTexture.ChannelOrder.L: return [0];
+ case tcuTexture.ChannelOrder.LA: return [0, 3];
+ case tcuTexture.ChannelOrder.RG: return [0, 1];
+ case tcuTexture.ChannelOrder.RA: return [0, 3];
+ case tcuTexture.ChannelOrder.RGB: return [0, 1, 2];
+ case tcuTexture.ChannelOrder.RGBA: return [0, 1, 2, 3];
+ case tcuTexture.ChannelOrder.ARGB: return [3, 0, 1, 2];
+ case tcuTexture.ChannelOrder.BGRA: return [2, 1, 0, 3];
+ case tcuTexture.ChannelOrder.sRGB: return [0, 1, 2];
+ case tcuTexture.ChannelOrder.sRGBA: return [0, 1, 2, 3];
+ case tcuTexture.ChannelOrder.D: return [0];
+ case tcuTexture.ChannelOrder.S: return [3];
+ case tcuTexture.ChannelOrder.DS: return [0, 3];
+ }
+ throw new Error('Unrecognized order ' + order);
+};
+
+/**
+ * @param {tcuTexture.ChannelType} type
+ * @return {number}
+ */
+tcuTexture.getChannelSize = function(type) {
+ switch (type) {
+ case tcuTexture.ChannelType.SNORM_INT8: return 1;
+ case tcuTexture.ChannelType.SNORM_INT16: return 2;
+ case tcuTexture.ChannelType.SNORM_INT32: return 4;
+ case tcuTexture.ChannelType.UNORM_INT8: return 1;
+ case tcuTexture.ChannelType.UNORM_INT16: return 2;
+ case tcuTexture.ChannelType.UNORM_INT32: return 4;
+ case tcuTexture.ChannelType.SIGNED_INT8: return 1;
+ case tcuTexture.ChannelType.SIGNED_INT16: return 2;
+ case tcuTexture.ChannelType.SIGNED_INT32: return 4;
+ case tcuTexture.ChannelType.UNSIGNED_INT8: return 1;
+ case tcuTexture.ChannelType.UNSIGNED_INT16: return 2;
+ case tcuTexture.ChannelType.UNSIGNED_INT32: return 4;
+ case tcuTexture.ChannelType.UNSIGNED_INT_11F_11F_10F_REV: return 4;
+ case tcuTexture.ChannelType.UNSIGNED_INT_999_E5_REV: return 4;
+ case tcuTexture.ChannelType.HALF_FLOAT: return 2;
+ case tcuTexture.ChannelType.FLOAT: return 4;
+
+ }
+ throw new Error('Unrecognized type ' + deString.enumToString(tcuTexture.ChannelType, type));
+};
+
+/**
+ * @param {number} src Source value
+ * @param {number} bits Source value size in bits
+ * @return {number} Normalized value
+ */
+tcuTexture.channelToNormFloat = function(src, bits) {
+ var maxVal = (1 << bits) - 1;
+ return src / maxVal;
+};
+
+/**
+ * @param {number} value Source value
+ * @param {tcuTexture.ChannelType} type
+ * @return {number} Source value converted to float
+ */
+tcuTexture.channelToFloat = function(value, type) {
+ switch (type) {
+ case tcuTexture.ChannelType.SNORM_INT8: return Math.max(-1, value / 127);
+ case tcuTexture.ChannelType.SNORM_INT16: return Math.max(-1, value / 32767);
+ case tcuTexture.ChannelType.SNORM_INT32: return Math.max(-1, value / 2147483647);
+ case tcuTexture.ChannelType.UNORM_INT8: return value / 255;
+ case tcuTexture.ChannelType.UNORM_INT16: return value / 65535;
+ case tcuTexture.ChannelType.UNORM_INT32: return value / 4294967295;
+ case tcuTexture.ChannelType.SIGNED_INT8: return value;
+ case tcuTexture.ChannelType.SIGNED_INT16: return value;
+ case tcuTexture.ChannelType.SIGNED_INT32: return value;
+ case tcuTexture.ChannelType.UNSIGNED_INT8: return value;
+ case tcuTexture.ChannelType.UNSIGNED_INT16: return value;
+ case tcuTexture.ChannelType.UNSIGNED_INT32: return value;
+ case tcuTexture.ChannelType.HALF_FLOAT: return tcuFloat.halfFloatToNumber(value);
+ case tcuTexture.ChannelType.FLOAT: return value;
+ }
+ throw new Error('Unrecognized tcuTexture.channel type ' + type);
+};
+
+/**
+ * @param {number} value Source value
+ * @param {tcuTexture.ChannelType} type
+ * @return {number} Source value converted to int
+ */
+tcuTexture.channelToInt = function(value, type) {
+ switch (type) {
+ case tcuTexture.ChannelType.HALF_FLOAT: return Math.round(tcuFloat.halfFloatToNumber(value));
+ case tcuTexture.ChannelType.FLOAT: return Math.round(value);
+ default:
+ return value;
+ }
+};
+
+/**
+ * @param {tcuTexture.ChannelOrder} order
+ * @return {number}
+ */
+tcuTexture.getNumUsedChannels = function(order) {
+ switch (order) {
+ case tcuTexture.ChannelOrder.R: return 1;
+ case tcuTexture.ChannelOrder.A: return 1;
+ case tcuTexture.ChannelOrder.I: return 1;
+ case tcuTexture.ChannelOrder.L: return 1;
+ case tcuTexture.ChannelOrder.LA: return 2;
+ case tcuTexture.ChannelOrder.RG: return 2;
+ case tcuTexture.ChannelOrder.RA: return 2;
+ case tcuTexture.ChannelOrder.RGB: return 3;
+ case tcuTexture.ChannelOrder.RGBA: return 4;
+ case tcuTexture.ChannelOrder.ARGB: return 4;
+ case tcuTexture.ChannelOrder.BGRA: return 4;
+ case tcuTexture.ChannelOrder.sRGB: return 3;
+ case tcuTexture.ChannelOrder.sRGBA: return 4;
+ case tcuTexture.ChannelOrder.D: return 1;
+ case tcuTexture.ChannelOrder.S: return 1;
+ case tcuTexture.ChannelOrder.DS: return 2;
+ }
+ throw new Error('Unrecognized tcuTexture.channel order ' + order);
+};
+
+/**
+ * @enum
+ */
+tcuTexture.WrapMode = {
+ CLAMP_TO_EDGE: 0, //! Clamp to edge
+ CLAMP_TO_BORDER: 1, //! Use border color at edge
+ REPEAT_GL: 2, //! Repeat with OpenGL semantics
+ REPEAT_CL: 3, //! Repeat with OpenCL semantics
+ MIRRORED_REPEAT_GL: 4, //! Mirrored repeat with OpenGL semantics
+ MIRRORED_REPEAT_CL: 5 //! Mirrored repeat with OpenCL semantics
+};
+
+/**
+ * @enum
+ */
+tcuTexture.FilterMode = {
+ NEAREST: 0,
+ LINEAR: 1,
+
+ NEAREST_MIPMAP_NEAREST: 2,
+ NEAREST_MIPMAP_LINEAR: 3,
+ LINEAR_MIPMAP_NEAREST: 4,
+ LINEAR_MIPMAP_LINEAR: 5
+};
+
+/**
+ * @enum
+ */
+tcuTexture.CompareMode = {
+ COMPAREMODE_NONE: 0,
+ COMPAREMODE_LESS: 1,
+ COMPAREMODE_LESS_OR_EQUAL: 2,
+ COMPAREMODE_GREATER: 3,
+ COMPAREMODE_GREATER_OR_EQUAL: 4,
+ COMPAREMODE_EQUAL: 5,
+ COMPAREMODE_NOT_EQUAL: 6,
+ COMPAREMODE_ALWAYS: 7,
+ COMPAREMODE_NEVER: 8
+};
+
+/**
+ * @constructor
+ * @param {!tcuTexture.WrapMode} wrapS
+ * @param {!tcuTexture.WrapMode} wrapT
+ * @param {!tcuTexture.WrapMode} wrapR
+ * @param {!tcuTexture.FilterMode} minFilter
+ * @param {!tcuTexture.FilterMode} magFilter
+ * @param {number=} lodThreshold
+ * @param {boolean=} normalizedCoords
+ * @param {tcuTexture.CompareMode=} compare
+ * @param {number=} compareChannel
+ * @param {Array<number>=} borderColor
+ * @param {boolean=} seamlessCubeMap
+ */
+tcuTexture.Sampler = function(wrapS, wrapT, wrapR, minFilter, magFilter, lodThreshold, normalizedCoords, compare, compareChannel, borderColor, seamlessCubeMap) {
+ /** @type {!tcuTexture.WrapMode} */ this.wrapS = wrapS;
+ /** @type {!tcuTexture.WrapMode} */ this.wrapT = wrapT;
+ /** @type {!tcuTexture.WrapMode} */ this.wrapR = wrapR;
+ /** @type {!tcuTexture.FilterMode} */ this.minFilter = minFilter;
+ /** @type {!tcuTexture.FilterMode} */ this.magFilter = magFilter;
+ this.lodThreshold = lodThreshold || 0;
+ this.normalizedCoords = normalizedCoords === undefined ? true : normalizedCoords;
+ /** @type {tcuTexture.CompareMode} */ this.compare = compare || tcuTexture.CompareMode.COMPAREMODE_NONE;
+ this.compareChannel = compareChannel || 0;
+ this.borderColor = borderColor || [0, 0, 0, 0];
+ this.seamlessCubeMap = seamlessCubeMap || false;
+};
+
+/**
+ * Special unnormalization for REPEAT_CL and MIRRORED_REPEAT_CL tcuTexture.wrap modes; otherwise ordinary unnormalization.
+ * @param {tcuTexture.WrapMode} mode
+ * @param {number} c Value to tcuTexture.unnormalize
+ * @param {number} size Unnormalized type size (integer)
+ * @return {number}
+ */
+tcuTexture.unnormalize = function(mode, c, size) {
+ switch (mode) {
+ case tcuTexture.WrapMode.CLAMP_TO_EDGE:
+ case tcuTexture.WrapMode.CLAMP_TO_BORDER:
+ case tcuTexture.WrapMode.REPEAT_GL:
+ case tcuTexture.WrapMode.MIRRORED_REPEAT_GL: // Fall-through (ordinary case).
+ return size * c;
+
+ case tcuTexture.WrapMode.REPEAT_CL:
+ return size * (c - Math.floor(c));
+
+ case tcuTexture.WrapMode.MIRRORED_REPEAT_CL:
+ return size * Math.abs(c - 2 * deMath.rint(0.5 * c));
+ }
+ throw new Error('Unrecognized tcuTexture.wrap mode ' + mode);
+};
+
+/**
+ * @param {tcuTexture.WrapMode} mode
+ * @param {number} c Source value (integer)
+ * @param {number} size Type size (integer)
+ * @return {number}
+ */
+tcuTexture.wrap = function(mode, c, size) {
+ switch (mode) {
+ case tcuTexture.WrapMode.CLAMP_TO_BORDER:
+ return deMath.clamp(c, -1, size);
+
+ case tcuTexture.WrapMode.CLAMP_TO_EDGE:
+ return deMath.clamp(c, 0, size - 1);
+
+ case tcuTexture.WrapMode.REPEAT_GL:
+ return deMath.imod(c, size);
+
+ case tcuTexture.WrapMode.REPEAT_CL:
+ return deMath.imod(c, size);
+
+ case tcuTexture.WrapMode.MIRRORED_REPEAT_GL:
+ return (size - 1) - deMath.mirror(deMath.imod(c, 2 * size) - size);
+
+ case tcuTexture.WrapMode.MIRRORED_REPEAT_CL:
+ return deMath.clamp(c, 0, size - 1); // \note Actual mirroring done already in unnormalization function.
+ }
+ throw new Error('Unrecognized tcuTexture.wrap mode ' + mode);
+};
+
+/**
+ * @param {number} cs
+ * @return {number}
+ */
+tcuTexture.sRGBChannelToLinear = function(cs) {
+ if (cs <= 0.04045)
+ return cs / 12.92;
+ else
+ return Math.pow((cs + 0.055) / 1.055, 2.4);
+};
+
+/**
+ * Convert sRGB to linear colorspace
+ * @param {Array<number>} cs Vec4
+ * @return {Array<number>} Vec4
+ */
+tcuTexture.sRGBToLinear = function(cs) {
+ return [
+ tcuTexture.sRGBChannelToLinear(cs[0]),
+ tcuTexture.sRGBChannelToLinear(cs[1]),
+ tcuTexture.sRGBChannelToLinear(cs[2]),
+ cs[3]
+ ];
+};
+
+/**
+ * Texel tcuTexture.lookup with color conversion.
+ * @param {tcuTexture.ConstPixelBufferAccess} access
+ * @param {number} i
+ * @param {number} j
+ * @param {number} k
+ * @return {Array<number>} Vec4 pixel color
+ */
+tcuTexture.lookup = function(access, i, j, k) {
+ var p = access.getPixel(i, j, k);
+ return access.getFormat().isSRGB() ? tcuTexture.sRGBToLinear(p) : p;
+};
+
+/**
+ * @param {tcuTexture.ConstPixelBufferAccess} access
+ * @param {tcuTexture.Sampler} sampler
+ * @param {number} u
+ * @param {number} v
+ * @param {(number|Array<number>)} depthOrOffset depth (int) or offset (ivec3)
+ * @return {Array<number>} Vec4 pixel color
+ */
+tcuTexture.sampleLinear2D = function(access, sampler, u, v, depthOrOffset) {
+ /** @type {number} */ var xOffset = 0;
+ /** @type {number} */ var yOffset = 0;
+ /** @type {number} */ var value;
+ if (Array.isArray(depthOrOffset)) {
+ xOffset = depthOrOffset[0];
+ yOffset = depthOrOffset[1];
+ value = depthOrOffset[2];
+ } else {
+ value = /** @type {number} */ (depthOrOffset);
+ }
+
+ /**
+ * @param {Array<number>} p00
+ * @param {Array<number>} p10
+ * @param {Array<number>} p01
+ * @param {Array<number>} p11
+ * @param {number} a
+ * @param {number} b
+ */
+ var interpolateQuad = function(p00, p10, p01, p11, a, b) {
+ var s00 = (1 - a) * (1 - b);
+ var s10 = a * (1 - b);
+ var s01 = (1 - a) * b;
+ var s11 = a * b;
+
+ return [
+ (p00[0] * s00) + (p10[0] * s10) + (p01[0] * s01) + (p11[0] * s11),
+ (p00[1] * s00) + (p10[1] * s10) + (p01[1] * s01) + (p11[1] * s11),
+ (p00[2] * s00) + (p10[2] * s10) + (p01[2] * s01) + (p11[2] * s11),
+ (p00[3] * s00) + (p10[3] * s10) + (p01[3] * s01) + (p11[3] * s11)
+ ];
+ };
+
+ var w = access.getWidth();
+ var h = access.getHeight();
+
+ var x0 = Math.floor(u - 0.5) + xOffset;
+ var x1 = x0 + 1;
+ var y0 = Math.floor(v - 0.5) + yOffset;
+ var y1 = y0 + 1;
+
+ var i0 = tcuTexture.wrap(sampler.wrapS, x0, w);
+ var i1 = tcuTexture.wrap(sampler.wrapS, x1, w);
+ var j0 = tcuTexture.wrap(sampler.wrapT, y0, h);
+ var j1 = tcuTexture.wrap(sampler.wrapT, y1, h);
+
+ var a = deMath.deFloatFrac(u - 0.5);
+ var b = deMath.deFloatFrac(v - 0.5);
+
+ var i0UseBorder = sampler.wrapS == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(i0, 0, w);
+ var i1UseBorder = sampler.wrapS == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(i1, 0, w);
+ var j0UseBorder = sampler.wrapT == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(j0, 0, h);
+ var j1UseBorder = sampler.wrapT == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(j1, 0, h);
+
+ // Border color for out-of-range coordinates if using CLAMP_TO_BORDER, otherwise execute lookups.
+ var p00 = (i0UseBorder || j0UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i0, j0, value);
+ var p10 = (i1UseBorder || j0UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i1, j0, value);
+ var p01 = (i0UseBorder || j1UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i0, j1, value);
+ var p11 = (i1UseBorder || j1UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i1, j1, value);
+
+ // Interpolate.
+ return interpolateQuad(p00, p10, p01, p11, a, b);
+};
+
+/**
+ * @param {tcuTexture.ConstPixelBufferAccess} access
+ * @param {tcuTexture.Sampler} sampler
+ * @param {number} u
+ * @param {number} v
+ * @param {number} w
+ * @param {Array<number>=} offset
+ * @return {Array<number>} Vec4 pixel color
+ */
+tcuTexture.sampleLinear3D = function(access, sampler, u, v, w, offset) {
+ /**
+ * @param {Array<number>} p000
+ * @param {Array<number>} p100
+ * @param {Array<number>} p010
+ * @param {Array<number>} p110
+ * @param {Array<number>} p001
+ * @param {Array<number>} p101
+ * @param {Array<number>} p011
+ * @param {Array<number>} p111
+ * @param {number} a
+ * @param {number} b
+ * @param {number} c
+ */
+ var interpolateCube = function(p000, p100, p010, p110, p001, p101, p011, p111, a, b, c) {
+ var s000 = (1 - a) * (1 - b) * (1 - c);
+ var s100 = a * (1 - b) * (1 - c);
+ var s010 = (1 - a) * b * (1 - c);
+ var s110 = a * b * (1 - c);
+ var s001 = (1 - a) * (1 - b) * c;
+ var s101 = a * (1 - b) * c;
+ var s011 = (1 - a) * b * c;
+ var s111 = a * b * c;
+
+ return [
+ (p000[0] * s000) + (p100[0] * s100) + (p010[0] * s010) + (p110[0] * s110) + (p001[0] * s001) + (p101[0] * s101) + (p011[0] * s011) + (p111[0] * s111),
+ (p000[1] * s000) + (p100[1] * s100) + (p010[1] * s010) + (p110[1] * s110) + (p001[1] * s001) + (p101[1] * s101) + (p011[1] * s011) + (p111[1] * s111),
+ (p000[2] * s000) + (p100[2] * s100) + (p010[2] * s010) + (p110[2] * s110) + (p001[2] * s001) + (p101[2] * s101) + (p011[2] * s011) + (p111[2] * s111),
+ (p000[3] * s000) + (p100[3] * s100) + (p010[3] * s010) + (p110[3] * s110) + (p001[3] * s001) + (p101[3] * s101) + (p011[3] * s011) + (p111[3] * s111)
+ ];
+ };
+
+ var width = access.getWidth();
+ var height = access.getHeight();
+ var depth = access.getDepth();
+
+ /** @type {number} */ var xOffset = 0;
+ /** @type {number} */ var yOffset = 0;
+ /** @type {number} */ var zOffset = 0;
+
+ if (offset !== undefined && offset.length === 3) {
+ xOffset = offset[0];
+ yOffset = offset[1];
+ zOffset = offset[2];
+ }
+
+ var x0 = Math.floor(u - 0.5) + xOffset;
+ var x1 = x0 + 1;
+ var y0 = Math.floor(v - 0.5) + yOffset;
+ var y1 = y0 + 1;
+ var z0 = Math.floor(w - 0.5) + zOffset;
+ var z1 = z0 + 1;
+
+ var i0 = tcuTexture.wrap(sampler.wrapS, x0, width);
+ var i1 = tcuTexture.wrap(sampler.wrapS, x1, width);
+ var j0 = tcuTexture.wrap(sampler.wrapT, y0, height);
+ var j1 = tcuTexture.wrap(sampler.wrapT, y1, height);
+ var k0 = tcuTexture.wrap(sampler.wrapR, z0, depth);
+ var k1 = tcuTexture.wrap(sampler.wrapR, z1, depth);
+
+ var a = deMath.deFloatFrac(u - 0.5);
+ var b = deMath.deFloatFrac(v - 0.5);
+ var c = deMath.deFloatFrac(w - 0.5);
+
+ var i0UseBorder = sampler.wrapS == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(i0, 0, width);
+ var i1UseBorder = sampler.wrapS == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(i1, 0, width);
+ var j0UseBorder = sampler.wrapT == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(j0, 0, height);
+ var j1UseBorder = sampler.wrapT == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(j1, 0, height);
+ var k0UseBorder = sampler.wrapR == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(k0, 0, depth);
+ var k1UseBorder = sampler.wrapR == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(k1, 0, depth);
+
+ // Border color for out-of-range coordinates if using CLAMP_TO_BORDER, otherwise execute lookups.
+ var p000 = (i0UseBorder || j0UseBorder || k0UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i0, j0, k0);
+ var p100 = (i1UseBorder || j0UseBorder || k0UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i1, j0, k0);
+ var p010 = (i0UseBorder || j1UseBorder || k0UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i0, j1, k0);
+ var p110 = (i1UseBorder || j1UseBorder || k0UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i1, j1, k0);
+ var p001 = (i0UseBorder || j0UseBorder || k1UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i0, j0, k1);
+ var p101 = (i1UseBorder || j0UseBorder || k1UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i1, j0, k1);
+ var p011 = (i0UseBorder || j1UseBorder || k1UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i0, j1, k1);
+ var p111 = (i1UseBorder || j1UseBorder || k1UseBorder) ? sampler.borderColor : tcuTexture.lookup(access, i1, j1, k1);
+
+ // Interpolate.
+ return interpolateCube(p000, p100, p010, p110, p001, p101, p011, p111, a, b, c);
+};
+
+/**
+ * @param {tcuTexture.ConstPixelBufferAccess} access
+ * @param {tcuTexture.Sampler} sampler
+ * @param {number} u
+ * @param {number} v
+ * @param {(number|Array<number>)} depthOrOffset depth (integer) or offset (ivec3)
+ * @return {Array<number>} Vec4 pixel color
+ */
+tcuTexture.sampleNearest2D = function(access, sampler, u, v, depthOrOffset) {
+ /** @type {number} */ var xOffset = 0;
+ /** @type {number} */ var yOffset = 0;
+ /** @type {number} */ var value;
+ if (Array.isArray(depthOrOffset)) {
+ xOffset = depthOrOffset[0];
+ yOffset = depthOrOffset[1];
+ value = depthOrOffset[2];
+ } else {
+ value = /** @type {number} */ (depthOrOffset);
+ }
+
+ var width = access.getWidth();
+ var height = access.getHeight();
+
+ var x = Math.floor(u) + xOffset;
+ var y = Math.floor(v) + yOffset;
+
+ // Check for CLAMP_TO_BORDER.
+ if ((sampler.wrapS == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(x, 0, width)) ||
+ (sampler.wrapT == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(y, 0, height)))
+ return sampler.borderColor;
+
+ var i = tcuTexture.wrap(sampler.wrapS, x, width);
+ var j = tcuTexture.wrap(sampler.wrapT, y, height);
+
+ return tcuTexture.lookup(access, i, j, value);
+};
+
+/**
+ * @param {tcuTexture.ConstPixelBufferAccess} access
+ * @param {tcuTexture.Sampler} sampler
+ * @param {number} u
+ * @param {number} v
+ * @param {number} w
+ * @param {Array<number>=} offset
+ * @return {Array<number>} Vec4 pixel color
+ */
+tcuTexture.sampleNearest3D = function(access, sampler, u, v, w, offset) {
+ var width = access.getWidth();
+ var height = access.getHeight();
+ var depth = access.getDepth();
+ /** @type {number} */ var xOffset = 0;
+ /** @type {number} */ var yOffset = 0;
+ /** @type {number} */ var zOffset = 0;
+
+ if (offset !== undefined && offset.length === 3) {
+ xOffset = offset[0];
+ yOffset = offset[1];
+ zOffset = offset[2];
+ }
+
+ var x = Math.floor(u) + xOffset;
+ var y = Math.floor(v) + yOffset;
+ var z = Math.floor(w) + zOffset;
+
+ // Check for CLAMP_TO_BORDER.
+ if ((sampler.wrapS == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(x, 0, width)) ||
+ (sampler.wrapT == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(y, 0, height)) ||
+ (sampler.wrapR == tcuTexture.WrapMode.CLAMP_TO_BORDER && !deMath.deInBounds32(z, 0, depth)))
+ return sampler.borderColor;
+
+ var i = tcuTexture.wrap(sampler.wrapS, x, width);
+ var j = tcuTexture.wrap(sampler.wrapT, y, height);
+ var k = tcuTexture.wrap(sampler.wrapR, z, depth);
+
+ return tcuTexture.lookup(access, i, j, k);
+};
+
+/**
+ * @param {Array<number>} color Vec4 color
+ * @return {number} The color in packed 32 bit format
+ */
+tcuTexture.packRGB999E5 = function(color) {
+ /** @const */ var mBits = 9;
+ /** @const */ var eBits = 5;
+ /** @const */ var eBias = 15;
+ /** @const */ var eMax = (1 << eBits) - 1;
+ /** @const */ var maxVal = (((1 << mBits) - 1) * (1 << (eMax - eBias))) / (1 << mBits);
+
+ var rc = deMath.clamp(color[0], 0, maxVal);
+ var gc = deMath.clamp(color[1], 0, maxVal);
+ var bc = deMath.clamp(color[2], 0, maxVal);
+ var maxc = Math.max(rc, gc, bc);
+ var expp = Math.max(-eBias - 1, Math.floor(Math.log2(maxc))) + 1 + eBias;
+ var e = Math.pow(2, expp - eBias - mBits);
+ var maxs = Math.floor(maxc / e + 0.5);
+
+ var exps = maxs == (1 << mBits) ? expp + 1 : expp;
+ var rs = deMath.clamp(Math.floor(rc / e + 0.5), 0, (1 << 9) - 1);
+ var gs = deMath.clamp(Math.floor(gc / e + 0.5), 0, (1 << 9) - 1);
+ var bs = deMath.clamp(Math.floor(bc / e + 0.5), 0, (1 << 9) - 1);
+
+ DE_ASSERT((exps & ~((1 << 5) - 1)) == 0);
+ DE_ASSERT((rs & ~((1 << 9) - 1)) == 0);
+ DE_ASSERT((gs & ~((1 << 9) - 1)) == 0);
+ DE_ASSERT((bs & ~((1 << 9) - 1)) == 0);
+
+ return rs | (gs << 9) | (bs << 18) | (exps << 27);
+};
+
+/**
+ * @param {number} color Color in packed 32 bit format
+ * @return {Array<number>} The color in unpacked format
+ */
+tcuTexture.unpackRGB999E5 = function(color) {
+ var mBits = 9;
+ var eBias = 15;
+
+ var exp = (color >> 27) & ((1 << 5) - 1);
+ var bs = (color >> 18) & ((1 << 9) - 1);
+ var gs = (color >> 9) & ((1 << 9) - 1);
+ var rs = color & ((1 << 9) - 1);
+
+ var e = Math.pow(2, (exp - eBias - mBits));
+ var r = rs * e;
+ var g = gs * e;
+ var b = bs * e;
+
+ return [r, g, b, 1];
+};
+
+/**
+ * \brief Read-only pixel data access
+ *
+ * tcuTexture.ConstPixelBufferAccess encapsulates pixel data pointer along with
+ * format and layout information. It can be used for read-only access
+ * to arbitrary pixel buffers.
+ *
+ * Access objects are like iterators or pointers. They can be passed around
+ * as values and are valid as long as the storage doesn't change.
+ * @constructor
+ */
+tcuTexture.ConstPixelBufferAccess = function(descriptor) {
+ if (descriptor) {
+ this.m_offset = descriptor.offset || 0;
+ this.m_format = descriptor.format || new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.FLOAT);
+ this.m_width = descriptor.width;
+ this.m_height = descriptor.height;
+ if (descriptor.depth)
+ this.m_depth = descriptor.depth;
+ else
+ this.m_depth = 1;
+ this.m_data = descriptor.data;
+ if (descriptor.rowPitch)
+ this.m_rowPitch = descriptor.rowPitch;
+ else
+ this.m_rowPitch = this.m_width * this.m_format.getPixelSize();
+
+ if (descriptor.slicePitch)
+ this.m_slicePitch = descriptor.slicePitch;
+ else
+ this.m_slicePitch = this.m_rowPitch * this.m_height;
+
+ if (this.m_format.isEqual(new tcuTexture.TextureFormat(
+ tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8)))
+ this.m_rgba8View = new tcuTexture.RGBA8View(this);
+ else if (this.m_format.isEqual(new tcuTexture.TextureFormat(
+ tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNORM_INT8)))
+ this.m_rgb8View = new tcuTexture.RGBA8View(this);
+
+ }
+
+ this.m_dataPtrType = null;
+ this.m_dataPtr = null;
+};
+
+tcuTexture.ConstPixelBufferAccess.prototype.toString = function() {
+ var str = 'BufferAccess(format: ' + this.m_format +
+ ', width: ' + this.m_width +
+ ', height: ' + this.m_height;
+ if (this.m_depth > 1)
+ str += ', depth: ' + this.m_depth;
+ if (this.m_rowPitch != this.m_width * this.m_format.getPixelSize())
+ str += ', row pitch: ' + this.m_rowPitch;
+ if (this.m_slicePitch != this.m_rowPitch * this.m_height)
+ str += ', slice pitch: ' + this.m_slicePitch;
+ if (this.m_offset > 0)
+ str += ', offset: ' + this.m_offset;
+ str += ')';
+ return str;
+};
+
+/** @return {number} */
+tcuTexture.ConstPixelBufferAccess.prototype.getDataSize = function() { return this.m_depth * this.m_slicePitch; };
+tcuTexture.ConstPixelBufferAccess.prototype.isEmpty = function() { return this.m_width == 0 || this.m_height == 0 || this.m_depth == 0; };
+/** @return {goog.TypedArray} */
+tcuTexture.ConstPixelBufferAccess.prototype.getDataPtr = function() {
+ if (this.m_dataPtrType != this.m_format.type) {
+ this.m_dataPtrType = this.m_format.type;
+ var arrayType = tcuTexture.getTypedArray(this.m_format.type);
+ this.m_dataPtr = new arrayType(this.m_data, this.m_offset);
+ }
+ return this.m_dataPtr;
+};
+/** @return {ArrayBuffer} */
+tcuTexture.ConstPixelBufferAccess.prototype.getBuffer = function() {
+ return this.m_data;
+};
+/** @return {number} */
+tcuTexture.ConstPixelBufferAccess.prototype.getRowPitch = function() { return this.m_rowPitch; };
+/** @return {number} */
+tcuTexture.ConstPixelBufferAccess.prototype.getWidth = function() { return this.m_width; };
+/** @return {number} */
+tcuTexture.ConstPixelBufferAccess.prototype.getHeight = function() { return this.m_height; };
+/** @return {number} */
+tcuTexture.ConstPixelBufferAccess.prototype.getDepth = function() { return this.m_depth; };
+/** @return {number} */
+tcuTexture.ConstPixelBufferAccess.prototype.getSlicePitch = function() { return this.m_slicePitch; };
+/** @return {tcuTexture.TextureFormat} */
+tcuTexture.ConstPixelBufferAccess.prototype.getFormat = function() { return this.m_format; };
+
+/**
+ * @param {number} x
+ * @param {number} y
+ * @param {number=} z
+ * @return {number} stencil value
+ */
+tcuTexture.ConstPixelBufferAccess.prototype.getPixStencil = function(x, y, z) {
+ z = z || 0;
+
+ DE_ASSERT(deMath.deInBounds32(x, 0, this.m_width));
+ DE_ASSERT(deMath.deInBounds32(y, 0, this.m_height));
+ DE_ASSERT(deMath.deInBounds32(z, 0, this.m_depth));
+
+ // Make sure that the position is 'integer'
+ x = Math.round(x);
+ y = Math.round(y);
+ z = Math.round(z);
+
+ var pixelSize = this.m_format.getPixelSize();
+ var offset = z * this.m_slicePitch + y * this.m_rowPitch + x * pixelSize;
+ var pixelPtr = this.getDataPtr();
+ var pixelPtrOffset = offset / pixelPtr.BYTES_PER_ELEMENT;
+
+ switch (this.m_format.type) {
+ case tcuTexture.ChannelType.UNSIGNED_INT_24_8:
+ switch (this.m_format.order) {
+ case tcuTexture.ChannelOrder.S: return (pixelPtr[pixelPtrOffset] >> 8) & 0xff;
+ case tcuTexture.ChannelOrder.DS: return pixelPtr[pixelPtrOffset] & 0xff;
+
+ default:
+ DE_ASSERT(false);
+ return 0;
+ }
+
+ case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV:
+ DE_ASSERT(this.m_format.order == tcuTexture.ChannelOrder.DS);
+ var u32array = new Uint32Array(this.m_data, offset + this.m_offset + 4, 1);
+ return u32array[0] & 0xff;
+
+ default: {
+ if (this.m_format.order == tcuTexture.ChannelOrder.S)
+ return tcuTexture.channelToInt(pixelPtr[pixelPtrOffset], this.m_format.type);
+ else {
+ DE_ASSERT(this.m_format.order == tcuTexture.ChannelOrder.DS);
+ var stencilChannelIndex = 3;
+ return tcuTexture.channelToInt(pixelPtr[stencilChannelIndex + pixelPtrOffset], this.m_format.type);
+ }
+ }
+ }
+};
+
+/**
+ * @param {number} x
+ * @param {number} y
+ * @param {number=} z
+ * @return {number}
+ */
+tcuTexture.ConstPixelBufferAccess.prototype.getPixDepth = function(x, y, z) {
+ if (z == null)
+ z = 0;
+ DE_ASSERT(deMath.deInBounds32(x, 0, this.m_width));
+ DE_ASSERT(deMath.deInBounds32(y, 0, this.m_height));
+ DE_ASSERT(deMath.deInBounds32(z, 0, this.m_depth));
+
+ // Make sure that the position is 'integer'
+ x = Math.round(x);
+ y = Math.round(y);
+ z = Math.round(z);
+
+ var pixelSize = this.m_format.getPixelSize();
+ var offset = z * this.m_slicePitch + y * this.m_rowPitch + x * pixelSize;
+ var pixelPtr = this.getDataPtr();
+ var pixelPtrOffset = offset / pixelPtr.BYTES_PER_ELEMENT;
+
+ var ub = function(pixel, offset, count) {
+ return (pixel >> offset) & ((1 << count) - 1);
+ };
+ var nb = function(pixel, offset, count) {
+ return tcuTexture.channelToNormFloat(ub(pixel, offset, count), count);
+ };
+
+ // Packed formats.
+ switch (this.m_format.type) {
+ case tcuTexture.ChannelType.UNSIGNED_INT_24_8:
+ switch (this.m_format.order) {
+ case tcuTexture.ChannelOrder.D: // fall-through
+ case tcuTexture.ChannelOrder.DS:
+ return nb(pixelPtr[pixelPtrOffset], 8, 24);
+ default:
+ throw new Error('Unsupported tcuTexture.channel order ' + this.m_format.order);
+ }
+ break;
+
+ case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV: {
+ DE_ASSERT(this.m_format.order == tcuTexture.ChannelOrder.DS);
+ return pixelPtr[pixelPtrOffset];
+ break;
+ }
+
+ default: {
+ DE_ASSERT(this.m_format.order == tcuTexture.ChannelOrder.D || this.m_format.order == tcuTexture.ChannelOrder.DS);
+ return tcuTexture.channelToFloat(pixelPtr[pixelPtrOffset], this.m_format.type);
+ }
+ }
+};
+
+/**
+ * @param {number} x
+ * @param {number} y
+ * @param {number=} z
+ * @return {Array<number>} Pixel value as Vec4
+ */
+tcuTexture.ConstPixelBufferAccess.prototype.getPixel = function(x, y, z) {
+ z = z || 0;
+
+ DE_ASSERT(deMath.deInBounds32(x, 0, this.m_width));
+ DE_ASSERT(deMath.deInBounds32(y, 0, this.m_height));
+ DE_ASSERT(deMath.deInBounds32(z, 0, this.m_depth));
+
+ // Make sure that the position is 'integer'
+ return this._getPixelInternal(Math.round(x), Math.round(y), Math.round(z));
+};
+
+// NOTE: getPixel has been broken into getPixel, _getPixelInternal, and _getPixelPacked
+// because having them combined previously was causing V8 depots
+tcuTexture.ConstPixelBufferAccess.prototype._getPixelInternal = function(x, y, z) {
+ // Quick paths
+ if (z == 0) {
+ if (this.m_rgba8View) {
+ var color = this.m_rgba8View.read(x, y, 4);
+ color[0] /= 255;
+ color[1] /= 255;
+ color[2] /= 255;
+ color[3] /= 255;
+ return color;
+ } else if (this.m_rgb8View) {
+ var color = this.m_rgb8View.read(x, y, 3);
+ color[0] /= 255;
+ color[1] /= 255;
+ color[2] /= 255;
+ color[3] = 1;
+ return color;
+ }
+ }
+
+ var pixelSize = this.m_format.getPixelSize();
+ var offset = z * this.m_slicePitch + y * this.m_rowPitch + x * pixelSize;
+
+ var pixelPtr = this.getDataPtr();
+ var pixelPtrOffset = offset / pixelPtr.BYTES_PER_ELEMENT;
+
+ return this._getPixelPacked(pixelPtr, pixelPtrOffset);
+};
+
+tcuTexture.ConstPixelBufferAccess.prototype._getPixelPacked = (function() {
+
+ var ub = function(pixel, offset, count) {
+ return (pixel >> offset) & ((1 << count) - 1);
+ };
+ var nb = function(pixel, offset, count) {
+ var maxVal = (1 << count) - 1;
+ return ((pixel >> offset) & ((1 << count) - 1)) / maxVal;
+ };
+ var f11 = tcuFloat.float11ToNumber;
+ var f10 = tcuFloat.float10ToNumber;
+
+ return function tcuTexture_ConstPixelBufferAccess_getPixelPacked(pixelPtr, pixelPtrOffset) {
+ var pixel = pixelPtr[pixelPtrOffset];
+
+ // Packed formats.
+ switch (this.m_format.type) {
+ case tcuTexture.ChannelType.UNORM_SHORT_565: return [nb(pixel, 11, 5), nb(pixel, 5, 6), nb(pixel, 0, 5), 1];
+ case tcuTexture.ChannelType.UNORM_SHORT_555: return [nb(pixel, 10, 5), nb(pixel, 5, 5), nb(pixel, 0, 5), 1];
+ case tcuTexture.ChannelType.UNORM_SHORT_4444: return [nb(pixel, 12, 4), nb(pixel, 8, 4), nb(pixel, 4, 4), nb(pixel, 0, 4)];
+ case tcuTexture.ChannelType.UNORM_SHORT_5551: return [nb(pixel, 11, 5), nb(pixel, 6, 5), nb(pixel, 1, 5), nb(pixel, 0, 1)];
+ case tcuTexture.ChannelType.UNORM_INT_101010: return [nb(pixel, 22, 10), nb(pixel, 12, 10), nb(pixel, 2, 10), 1];
+ case tcuTexture.ChannelType.UNORM_INT_1010102_REV: return [nb(pixel, 0, 10), nb(pixel, 10, 10), nb(pixel, 20, 10), nb(pixel, 30, 2)];
+ case tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV: return [ub(pixel, 0, 10), ub(pixel, 10, 10), ub(pixel, 20, 10), ub(pixel, 30, 2)];
+ case tcuTexture.ChannelType.UNSIGNED_INT_999_E5_REV: return tcuTexture.unpackRGB999E5(pixel);
+
+ case tcuTexture.ChannelType.UNSIGNED_INT_24_8:
+ switch (this.m_format.order) {
+ // \note Stencil is always ignored.
+ case tcuTexture.ChannelOrder.D: return [nb(pixel, 8, 24), 0, 0, 1];
+ case tcuTexture.ChannelOrder.DS: return [nb(pixel, 8, 24), 0, 0, 1 /* (float)ub(0, 8) */];
+ default:
+ DE_ASSERT(false);
+ }
+
+ case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV: {
+ DE_ASSERT(this.m_format.order == tcuTexture.ChannelOrder.DS);
+ // \note Stencil is ignored.
+ return [pixel, 0, 0, 1];
+ }
+
+ case tcuTexture.ChannelType.UNSIGNED_INT_11F_11F_10F_REV: {
+ return [f11(ub(pixel, 0, 11)), f11(ub(pixel, 11, 11)), f10(ub(pixel, 22, 10)), 1];
+ }
+
+ default:
+ break;
+ }
+
+ // Generic path.
+ var result = [0, 0, 0, 0];
+ var channelMap = tcuTexture.getChannelReadMap(this.m_format.order);
+ var channelSize = tcuTexture.getChannelSize(this.m_format.type);
+
+ for (var c = 0; c < 4; c++) {
+ var map = channelMap[c];
+ if (map == tcuTexture.channel.ZERO)
+ result[c] = 0;
+ else if (map == tcuTexture.channel.ONE)
+ result[c] = 1;
+ else
+ result[c] = tcuTexture.channelToFloat(pixelPtr[map + pixelPtrOffset], this.m_format.type);
+ }
+
+ return result;
+ };
+})();
+
+/**
+ * @param {number} x
+ * @param {number} y
+ * @param {number=} z
+ * @return {Array<number>} Pixel value as Vec4
+ */
+tcuTexture.ConstPixelBufferAccess.prototype.getPixelInt = function(x, y, z) {
+ z = z || 0;
+ DE_ASSERT(deMath.deInBounds32(x, 0, this.m_width));
+ DE_ASSERT(deMath.deInBounds32(y, 0, this.m_height));
+ DE_ASSERT(deMath.deInBounds32(z, 0, this.m_depth));
+
+ // Make sure that the position is 'integer'
+ x = Math.round(x);
+ y = Math.round(y);
+ z = Math.round(z);
+
+ // Quick paths
+ if (z == 0) {
+ if (this.m_rgba8View)
+ return this.m_rgba8View.read(x, y, 4);
+ else if (this.m_rgb8View)
+ return this.m_rgb8View.read(x, y, 3);
+ }
+
+ var pixelSize = this.m_format.getPixelSize();
+ var offset = z * this.m_slicePitch + y * this.m_rowPitch + x * pixelSize;
+
+ var pixelPtr = this.getDataPtr();
+ var pixelPtrOffset = offset / pixelPtr.BYTES_PER_ELEMENT;
+ var pixel = pixelPtr[pixelPtrOffset];
+
+ var ub = function(pixel, offset, count) {
+ return (pixel >> offset) & ((1 << count) - 1);
+ };
+
+ // Packed formats.
+ switch (this.m_format.type) {
+ case tcuTexture.ChannelType.UNORM_SHORT_565: return [ub(pixel, 11, 5), ub(pixel, 5, 6), ub(pixel, 0, 5), 1];
+ case tcuTexture.ChannelType.UNORM_SHORT_555: return [ub(pixel, 10, 5), ub(pixel, 5, 5), ub(pixel, 0, 5), 1];
+ case tcuTexture.ChannelType.UNORM_SHORT_4444: return [ub(pixel, 12, 4), ub(pixel, 8, 4), ub(pixel, 4, 4), ub(pixel, 0, 4)];
+ case tcuTexture.ChannelType.UNORM_SHORT_5551: return [ub(pixel, 11, 5), ub(pixel, 6, 5), ub(pixel, 1, 5), ub(pixel, 0, 1)];
+ case tcuTexture.ChannelType.UNORM_INT_101010: return [ub(pixel, 22, 10), ub(pixel, 12, 10), ub(pixel, 2, 10), 1];
+ case tcuTexture.ChannelType.UNORM_INT_1010102_REV: return [ub(pixel, 0, 10), ub(pixel, 10, 10), ub(pixel, 20, 10), ub(pixel, 30, 2)];
+ case tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV: return [ub(pixel, 0, 10), ub(pixel, 10, 10), ub(pixel, 20, 10), ub(pixel, 30, 2)];
+
+ case tcuTexture.ChannelType.UNSIGNED_INT_24_8:
+ switch (this.m_format.order) {
+ case tcuTexture.ChannelOrder.D: return [ub(pixel, 8, 24), 0, 0, 1];
+ case tcuTexture.ChannelOrder.S: return [0, 0, 0, ub(pixel, 8, 24)];
+ case tcuTexture.ChannelOrder.DS: return [ub(pixel, 8, 24), 0, 0, ub(pixel, 0, 8)];
+ default:
+ DE_ASSERT(false);
+ }
+
+ case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV: {
+ DE_ASSERT(this.m_format.order == tcuTexture.ChannelOrder.DS);
+ var u32array = new Uint32Array(this.m_data, this.m_offset + offset + 4, 1);
+ return [pixel, 0, 0, ub(u32array[0], 0, 8)];
+ }
+
+ default:
+ break;
+ }
+
+ // Generic path.
+ var result = [];
+ result.length = 4;
+ var channelMap = tcuTexture.getChannelReadMap(this.m_format.order);
+ var channelSize = tcuTexture.getChannelSize(this.m_format.type);
+
+ for (var c = 0; c < 4; c++) {
+ var map = channelMap[c];
+ if (map == tcuTexture.channel.ZERO)
+ result[c] = 0;
+ else if (map == tcuTexture.channel.ONE)
+ result[c] = 1;
+ else
+ result[c] = tcuTexture.channelToInt(pixelPtr[map + pixelPtrOffset], this.m_format.type);
+ }
+
+ return result;
+};
+
+/**
+ * @param {tcuTexture.Sampler} sampler
+ * @param {?tcuTexture.FilterMode} filter
+ * @param {number} s
+ * @param {number} t
+ * @param {number} depth (integer)
+ * @return {Array<number>} Sample color
+ */
+tcuTexture.ConstPixelBufferAccess.prototype.sample2D = function(sampler, filter, s, t, depth) {
+ DE_ASSERT(deMath.deInBounds32(depth, 0, this.m_depth));
+
+ // Non-normalized coordinates.
+ var u = s;
+ var v = t;
+
+ if (sampler.normalizedCoords) {
+ u = tcuTexture.unnormalize(sampler.wrapS, s, this.m_width);
+ v = tcuTexture.unnormalize(sampler.wrapT, t, this.m_height);
+ }
+
+ switch (filter) {
+ case tcuTexture.FilterMode.NEAREST: return tcuTexture.sampleNearest2D(this, sampler, u, v, depth);
+ case tcuTexture.FilterMode.LINEAR: return tcuTexture.sampleLinear2D(this, sampler, u, v, depth);
+ default:
+ throw new Error('Invalid filter:' + filter);
+ }
+ throw new Error('Unimplemented');
+};
+
+/**
+ * @param {tcuTexture.Sampler} sampler
+ * @param {?tcuTexture.FilterMode} filter
+ * @param {number} s
+ * @param {number} t
+ * @param {Array<number>} offset
+ * @return {Array<number>} Sample color
+ */
+tcuTexture.ConstPixelBufferAccess.prototype.sample2DOffset = function(sampler, filter, s, t, offset) {
+ DE_ASSERT(deMath.deInBounds32(offset[2], 0, this.m_depth));
+
+ // Non-normalized coordinates.
+ var u = s;
+ var v = t;
+
+ if (sampler.normalizedCoords) {
+ u = tcuTexture.unnormalize(sampler.wrapS, s, this.m_width);
+ v = tcuTexture.unnormalize(sampler.wrapT, t, this.m_height);
+ }
+
+ switch (filter) {
+ case tcuTexture.FilterMode.NEAREST: return tcuTexture.sampleNearest2D(this, sampler, u, v, offset);
+ case tcuTexture.FilterMode.LINEAR: return tcuTexture.sampleLinear2D(this, sampler, u, v, offset);
+ default:
+ throw new Error('Invalid filter:' + filter);
+ }
+};
+
+/**
+ * @param {tcuTexture.Sampler} sampler
+ * @param {?tcuTexture.FilterMode} filter
+ * @param {number} s
+ * @param {number} t
+ * @param {number} r
+ * @param {Array<number>} offset
+ * @return {Array<number>} Sample color
+ */
+tcuTexture.ConstPixelBufferAccess.prototype.sample3DOffset = function(sampler, filter, s, t, r, offset) {
+ // Non-normalized coordinates.
+ /** @type {number} */ var u = s;
+ /** @type {number} */ var v = t;
+ /** @type {number} */ var w = r;
+
+ if (sampler.normalizedCoords) {
+ u = tcuTexture.unnormalize(sampler.wrapS, s, this.m_width);
+ v = tcuTexture.unnormalize(sampler.wrapT, t, this.m_height);
+ w = tcuTexture.unnormalize(sampler.wrapR, r, this.m_depth);
+ }
+
+ switch (filter) {
+ case tcuTexture.FilterMode.NEAREST: return tcuTexture.sampleNearest3D(this, sampler, u, v, w, offset);
+ case tcuTexture.FilterMode.LINEAR: return tcuTexture.sampleLinear3D(this, sampler, u, v, w, offset);
+ default:
+ throw new Error('Invalid filter:' + filter);
+ }
+};
+
+/**
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexture.FilterMode} filter
+ * @param {number} ref
+ * @param {number} s
+ * @param {number} t
+ * @param {Array<number>} offset
+ * @return {number}
+ */
+tcuTexture.ConstPixelBufferAccess.prototype.sample2DCompare = function(sampler, filter, ref, s, t, offset) {
+ DE_ASSERT(deMath.deInBounds32(offset[2], 0, this.m_depth));
+
+ // Format information for comparison function
+ var isFixedPointDepth = tcuTexture.isFixedPointDepthTextureFormat(this.m_format);
+
+ // Non-normalized coordinates.
+ var u = s;
+ var v = t;
+
+ if (sampler.normalizedCoords) {
+ u = tcuTexture.unnormalize(sampler.wrapS, s, this.m_width);
+ v = tcuTexture.unnormalize(sampler.wrapT, t, this.m_height);
+ }
+
+ switch (filter) {
+ case tcuTexture.FilterMode.NEAREST: return tcuTexture.execCompare(tcuTexture.sampleNearest2D(this, sampler, u, v, offset), sampler.compare, sampler.compareChannel, ref, isFixedPointDepth);
+ case tcuTexture.FilterMode.LINEAR: return tcuTexture.sampleLinear2DCompare(this, sampler, ref, u, v, offset, isFixedPointDepth);
+ default:
+ DE_ASSERT(false);
+ return 0.0;
+ }
+};
+
+/**
+ * @param {tcuTexture.Sampler} sampler
+ * @param {tcuTexture.FilterMode} filter
+ * @param {number} s
+ * @param {number} t
+ * @param {number} r
+ * @return {Array<number>} Sample color
+ */
+tcuTexture.ConstPixelBufferAccess.prototype.sample3D = function(sampler, filter, s, t, r) {
+ // Non-normalized coordinates.
+ var u = s;
+ var v = t;
+ var w = r;
+
+ if (sampler.normalizedCoords) {
+ u = tcuTexture.unnormalize(sampler.wrapS, s, this.m_width);
+ v = tcuTexture.unnormalize(sampler.wrapT, t, this.m_height);
+ w = tcuTexture.unnormalize(sampler.wrapR, r, this.m_depth);
+ }
+
+ switch (filter) {
+ case tcuTexture.FilterMode.NEAREST: return tcuTexture.sampleNearest3D(this, sampler, u, v, w);
+ case tcuTexture.FilterMode.LINEAR: return tcuTexture.sampleLinear3D(this, sampler, u, v, w);
+ default:
+ throw new Error('Invalid filter:' + filter);
+ }
+ throw new Error('Unimplemented');
+};
+
+ /* TODO: do we need any of these? */ {
+ // template<typename T>
+ // Vector<T, 4> getPixelT (int x, int y, int z = 0) const;
+
+ // Vec4 sample3D (const tcuTexture.Sampler& sampler, tcuTexture.tcuTexture.Sampler.tcuTexture.FilterMode filter, float s, float t, float r) const;
+
+ // Vec4 sample2DOffset (const tcuTexture.Sampler& sampler, tcuTexture.Sampler::tcuTexture.FilterMode filter, float s, float t, const IVec3& offset) const;
+ // Vec4 sample3DOffset (const tcuTexture.Sampler& sampler, tcuTexture.Sampler::tcuTexture.FilterMode filter, float s, float t, float r, const IVec3& offset) const;
+
+ // float sample2DCompare (const tcuTexture.Sampler& sampler, tcuTexture.Sampler::tcuTexture.FilterMode filter, float ref, float s, float t, const IVec3& offset) const;
+ };
+
+/** Common type limits
+ *
+ */
+tcuTexture.deTypes = {
+ deInt8: {min: -(1 << 7), max: (1 << 7) - 1},
+ deInt16: {min: -(1 << 15), max: (1 << 15) - 1},
+ deInt32: {min: -2147483648, max: 2147483647},
+ deUint8: {min: 0, max: (1 << 8) - 1},
+ deUint16: {min: 0, max: (1 << 16) - 1},
+ deUint32: {min: 0, max: 4294967295}
+};
+
+/**
+ * Round to even and saturate
+ * @param {{max: number, min: number}} deType from tcuTexture.deTypes
+ * @param {number} value
+ * @return {number}
+ */
+tcuTexture.convertSatRte = function(deType, value) {
+ var minVal = deType.min;
+ var maxVal = deType.max;
+ var floor = Math.floor(value);
+ var frac = value - floor;
+ if (frac == 0.5) {
+ if (floor % 2 != 0)
+ floor += 1;
+ } else if (frac > 0.5) {
+ floor += 1;
+ }
+
+ return Math.max(minVal, Math.min(maxVal, floor));
+};
+
+/**
+ * Saturate value to type range
+ * @param { {max: number, min: number}} deType from tcuTexture.deTypes
+ * @param {number} src
+ * @return {number}
+ */
+tcuTexture.convertSat = function(deType, src) {
+ var minVal = deType.min;
+ var maxVal = deType.max;
+ if (src < minVal)
+ return minVal;
+ else if (src > maxVal)
+ return maxVal;
+ else
+ return src;
+};
+
+/**
+ * @param {number} src Input integer value
+ * @param {tcuTexture.ChannelType} type
+ * @return {number}
+ */
+tcuTexture.intToChannel = function(src, type) {
+ var dst;
+ switch (type) {
+ case tcuTexture.ChannelType.SNORM_INT8: dst = tcuTexture.convertSat(tcuTexture.deTypes.deInt8, src); break;
+ case tcuTexture.ChannelType.SNORM_INT16: dst = tcuTexture.convertSat(tcuTexture.deTypes.deInt16, src); break;
+ case tcuTexture.ChannelType.UNORM_INT8: dst = tcuTexture.convertSat(tcuTexture.deTypes.deUint8, src); break;
+ case tcuTexture.ChannelType.UNORM_INT16: dst = tcuTexture.convertSat(tcuTexture.deTypes.deUint16, src); break;
+ case tcuTexture.ChannelType.SIGNED_INT8: dst = tcuTexture.convertSat(tcuTexture.deTypes.deInt8, src); break;
+ case tcuTexture.ChannelType.SIGNED_INT16: dst = tcuTexture.convertSat(tcuTexture.deTypes.deInt16, src); break;
+ case tcuTexture.ChannelType.SIGNED_INT32: dst = tcuTexture.convertSat(tcuTexture.deTypes.deInt32, src); break;
+ case tcuTexture.ChannelType.UNSIGNED_INT8: dst = tcuTexture.convertSat(tcuTexture.deTypes.deUint8, src); break;
+ case tcuTexture.ChannelType.UNSIGNED_INT16: dst = tcuTexture.convertSat(tcuTexture.deTypes.deUint16, src); break;
+ case tcuTexture.ChannelType.UNSIGNED_INT32: dst = tcuTexture.convertSat(tcuTexture.deTypes.deUint32, src); break;
+ case tcuTexture.ChannelType.HALF_FLOAT: dst = tcuFloat.numberToHalfFloat(src); break;
+ case tcuTexture.ChannelType.FLOAT: dst = src; break;
+ default:
+ throw new Error('Unrecognized tcuTexture.channel type: ' + type);
+ }
+ return dst;
+};
+
+/**
+ * @param {number} src
+ * @param {number} bits
+ * @return {number}
+ */
+tcuTexture.normFloatToChannel = function(src, bits) {
+ var maxVal = (1 << bits) - 1;
+ var intVal = tcuTexture.convertSatRte(tcuTexture.deTypes.deUint32, src * maxVal);
+ return Math.min(maxVal, intVal);
+};
+
+/**
+ * @param {number} src
+ * @param {number} bits
+ * @return {number}
+ */
+tcuTexture.uintToChannel = function(src, bits) {
+ var maxVal = (1 << bits) - 1;
+ return Math.min(maxVal, src);
+};
+
+/**
+ * @param {number} src
+ * @param {tcuTexture.ChannelType} type
+ * @return {number} Converted src color value
+ */
+tcuTexture.floatToChannel = function(src, type) {
+ switch (type) {
+ case tcuTexture.ChannelType.SNORM_INT8: return tcuTexture.convertSatRte(tcuTexture.deTypes.deInt8, src * 127);
+ case tcuTexture.ChannelType.SNORM_INT16: return tcuTexture.convertSatRte(tcuTexture.deTypes.deInt16, src * 32767);
+ case tcuTexture.ChannelType.SNORM_INT32: return tcuTexture.convertSatRte(tcuTexture.deTypes.deInt32, src * 2147483647);
+ case tcuTexture.ChannelType.UNORM_INT8: return tcuTexture.convertSatRte(tcuTexture.deTypes.deUint8, src * 255);
+ case tcuTexture.ChannelType.UNORM_INT16: return tcuTexture.convertSatRte(tcuTexture.deTypes.deUint16, src * 65535);
+ case tcuTexture.ChannelType.UNORM_INT32: return tcuTexture.convertSatRte(tcuTexture.deTypes.deUint32, src * 4294967295);
+ case tcuTexture.ChannelType.SIGNED_INT8: return tcuTexture.convertSatRte(tcuTexture.deTypes.deInt8, src);
+ case tcuTexture.ChannelType.SIGNED_INT16: return tcuTexture.convertSatRte(tcuTexture.deTypes.deInt16, src);
+ case tcuTexture.ChannelType.SIGNED_INT32: return tcuTexture.convertSatRte(tcuTexture.deTypes.deInt32, src);
+ case tcuTexture.ChannelType.UNSIGNED_INT8: return tcuTexture.convertSatRte(tcuTexture.deTypes.deUint8, src);
+ case tcuTexture.ChannelType.UNSIGNED_INT16: return tcuTexture.convertSatRte(tcuTexture.deTypes.deUint16, src);
+ case tcuTexture.ChannelType.UNSIGNED_INT32: return tcuTexture.convertSatRte(tcuTexture.deTypes.deUint32, src);
+ case tcuTexture.ChannelType.HALF_FLOAT: return tcuFloat.numberToHalfFloat(src);
+ case tcuTexture.ChannelType.FLOAT: return src;
+ }
+ throw new Error('Unrecognized type ' + type);
+};
+
+/**
+ * \brief Read-write pixel data access
+ *
+ * This class extends read-only access object by providing write functionality.
+ *
+ * \note tcuTexture.PixelBufferAccess may not have any data members nor add any
+ * virtual functions. It must be possible to reinterpret_cast<>
+ * tcuTexture.PixelBufferAccess to tcuTexture.ConstPixelBufferAccess.
+ * @constructor
+ * @extends {tcuTexture.ConstPixelBufferAccess}
+ *
+ */
+tcuTexture.PixelBufferAccess = function(descriptor) {
+ tcuTexture.ConstPixelBufferAccess.call(this, descriptor);
+};
+
+tcuTexture.PixelBufferAccess.prototype = Object.create(tcuTexture.ConstPixelBufferAccess.prototype);
+tcuTexture.PixelBufferAccess.prototype.constructor = tcuTexture.PixelBufferAccess;
+
+/**
+ * @param {Array<number>} color Vec4 color to set
+ * @param {number} x
+ * @param {number} y
+ * @param {number=} z
+ */
+tcuTexture.PixelBufferAccess.prototype.setPixel = function(color, x, y, z) {
+ z = z || 0;
+ DE_ASSERT(deMath.deInBounds32(x, 0, this.m_width));
+ DE_ASSERT(deMath.deInBounds32(y, 0, this.m_height));
+ DE_ASSERT(deMath.deInBounds32(z, 0, this.m_depth));
+
+ // Make sure that the position is 'integer'
+ this._setPixelInternal(color, Math.round(x), Math.round(y), Math.round(z));
+};
+
+// NOTE: setPixel has been broken into setPixel, _setPixelInternal, and _setPixelPacked
+// because having them combined previously was causing V8 depots
+tcuTexture.PixelBufferAccess.prototype._setPixelInternal = function(color, x, y, z) {
+ // Quick paths
+ if (z == 0) {
+ if (this.m_rgba8View) {
+ color = deMath.toIVec(color);
+ this.m_rgba8View.write(x, y, color, 4);
+ return;
+ } else if (this.m_rgb8View) {
+ color = deMath.toIVec(color);
+ this.m_rgb8View.write(x, y, color, 3);
+ return;
+ }
+ }
+
+ var pixelSize = this.m_format.getPixelSize();
+ var offset = z * this.m_slicePitch + y * this.m_rowPitch + x * pixelSize;
+ var pixelPtr = this.getDataPtr();
+ var pixelPtrOffset = offset / pixelPtr.BYTES_PER_ELEMENT;
+
+ return this._setPixelPacked(color, pixelPtr, pixelPtrOffset);
+};
+
+tcuTexture.PixelBufferAccess.prototype._setPixelPacked = (function () {
+ var pn = function(val, offs, bits) {
+ return tcuTexture.normFloatToChannel(val, bits) << offs;
+ };
+
+ var pu = function(val, offs, bits) {
+ return tcuTexture.uintToChannel(val, bits) << offs;
+ };
+
+ return function tcuTexture_PixelBufferAccess_setPixelPacked(color, pixelPtr, pixelPtrOffset) {
+ // Packed formats.
+ switch (this.m_format.type) {
+ case tcuTexture.ChannelType.UNORM_SHORT_565: pixelPtr[pixelPtrOffset] = pn(color[0], 11, 5) | pn(color[1], 5, 6) | pn(color[2], 0, 5); break;
+ case tcuTexture.ChannelType.UNORM_SHORT_555: pixelPtr[pixelPtrOffset] = pn(color[0], 10, 5) | pn(color[1], 5, 5) | pn(color[2], 0, 5); break;
+ case tcuTexture.ChannelType.UNORM_SHORT_4444: pixelPtr[pixelPtrOffset] = pn(color[0], 12, 4) | pn(color[1], 8, 4) | pn(color[2], 4, 4) | pn(color[3], 0, 4); break;
+ case tcuTexture.ChannelType.UNORM_SHORT_5551: pixelPtr[pixelPtrOffset] = pn(color[0], 11, 5) | pn(color[1], 6, 5) | pn(color[2], 1, 5) | pn(color[3], 0, 1); break;
+ case tcuTexture.ChannelType.UNORM_INT_101010: pixelPtr[pixelPtrOffset] = pn(color[0], 22, 10) | pn(color[1], 12, 10) | pn(color[2], 2, 10); break;
+ case tcuTexture.ChannelType.UNORM_INT_1010102_REV: pixelPtr[pixelPtrOffset] = pn(color[0], 0, 10) | pn(color[1], 10, 10) | pn(color[2], 20, 10) | pn(color[3], 30, 2); break;
+ case tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV: pixelPtr[pixelPtrOffset] = pu(color[0], 0, 10) | pu(color[1], 10, 10) | pu(color[2], 20, 10) | pu(color[3], 30, 2); break;
+ case tcuTexture.ChannelType.UNSIGNED_INT_999_E5_REV: pixelPtr[pixelPtrOffset] = tcuTexture.packRGB999E5(color); break;
+
+ case tcuTexture.ChannelType.UNSIGNED_INT_24_8:
+ switch (this.m_format.order) {
+ // \note Stencil is always ignored.
+ case tcuTexture.ChannelOrder.D: pixelPtr[pixelPtrOffset] = pn(color[0], 8, 24); break;
+ case tcuTexture.ChannelOrder.S: pixelPtr[pixelPtrOffset] = pn(color[3], 8, 24); break;
+ case tcuTexture.ChannelOrder.DS: pixelPtr[pixelPtrOffset] = pn(color[0], 8, 24) | pu(color[3], 0, 8); break;
+ default:
+ throw new Error('Unsupported tcuTexture.channel order ' + this.m_format.order);
+ }
+ break;
+
+ case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV: {
+ pixelPtr[pixelPtrOffset] = color[0];
+ var u32array = new Uint32Array(this.m_data, (pixelPtrOffset * pixelPtr.BYTES_PER_ELEMENT) + this.m_offset + 4, 1);
+ u32array[0] = pu(color[3], 0, 8);
+ break;
+ }
+
+ case tcuTexture.ChannelType.UNSIGNED_INT_11F_11F_10F_REV: {
+ var f11 = function(value) {
+ return tcuFloat.numberToFloat11(value);
+ };
+ var f10 = function(value) {
+ return tcuFloat.numberToFloat10(value);
+ };
+
+ pixelPtr[pixelPtrOffset] = f11(color[0]) | (f11(color[1]) << 11) | (f10(color[2]) << 22);
+ break;
+ }
+ case tcuTexture.ChannelType.FLOAT:
+ if (this.m_format.order == tcuTexture.ChannelOrder.D) {
+ pixelPtr[pixelPtrOffset] = color[0];
+ break;
+ }
+ // else fall-through to default case!
+
+ default: {
+ // Generic path.
+ var numChannels = tcuTexture.getNumUsedChannels(this.m_format.order);
+ var map = tcuTexture.getChannelWriteMap(this.m_format.order);
+
+ for (var c = 0; c < numChannels; c++)
+ pixelPtr[c + pixelPtrOffset] = tcuTexture.floatToChannel(color[map[c]], this.m_format.type);
+ }
+ }
+ };
+})();
+
+/**
+ * @param {Array<number>} color Vec4 color to set (unnormalized)
+ * @param {number} x
+ * @param {number} y
+ * @param {number=} z
+ */
+tcuTexture.PixelBufferAccess.prototype.setPixelInt = function(color, x, y, z) {
+ z = z || 0;
+ DE_ASSERT(deMath.deInBounds32(x, 0, this.m_width));
+ DE_ASSERT(deMath.deInBounds32(y, 0, this.m_height));
+ DE_ASSERT(deMath.deInBounds32(z, 0, this.m_depth));
+
+ // Make sure that the position is 'integer'
+ x = Math.round(x);
+ y = Math.round(y);
+ z = Math.round(z);
+
+ // Quick paths
+ if (z == 0) {
+ if (this.m_rgba8View) {
+ this.m_rgba8View.write(x, y, color, 4);
+ return;
+ } else if (this.m_rgb8View) {
+ this.m_rgb8View.write(x, y, color, 3);
+ return;
+ }
+ }
+
+ var pixelSize = this.m_format.getPixelSize();
+ var offset = z * this.m_slicePitch + y * this.m_rowPitch + x * pixelSize;
+ var pixelPtr = this.getDataPtr();
+ var pixelPtrOffset = offset / pixelPtr.BYTES_PER_ELEMENT;
+
+ var pu = function(val, offs, bits) {
+ return tcuTexture.uintToChannel(val, bits) << offs;
+ };
+
+ // Packed formats.
+ switch (this.m_format.type) {
+ case tcuTexture.ChannelType.UNORM_SHORT_565: pixelPtr[pixelPtrOffset] = pu(color[0], 11, 5) | pu(color[1], 5, 6) | pu(color[2], 0, 5); break;
+ case tcuTexture.ChannelType.UNORM_SHORT_555: pixelPtr[pixelPtrOffset] = pu(color[0], 10, 5) | pu(color[1], 5, 5) | pu(color[2], 0, 5); break;
+ case tcuTexture.ChannelType.UNORM_SHORT_4444: pixelPtr[pixelPtrOffset] = pu(color[0], 12, 4) | pu(color[1], 8, 4) | pu(color[2], 4, 4) | pu(color[3], 0, 4); break;
+ case tcuTexture.ChannelType.UNORM_SHORT_5551: pixelPtr[pixelPtrOffset] = pu(color[0], 11, 5) | pu(color[1], 6, 5) | pu(color[2], 1, 5) | pu(color[3], 0, 1); break;
+ case tcuTexture.ChannelType.UNORM_INT_101010: pixelPtr[pixelPtrOffset] = pu(color[0], 22, 10) | pu(color[1], 12, 10) | pu(color[2], 2, 10); break;
+ case tcuTexture.ChannelType.UNORM_INT_1010102_REV: pixelPtr[pixelPtrOffset] = pu(color[0], 0, 10) | pu(color[1], 10, 10) | pu(color[2], 20, 10) | pu(color[3], 30, 2); break;
+ case tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV: pixelPtr[pixelPtrOffset] = pu(color[0], 0, 10) | pu(color[1], 10, 10) | pu(color[2], 20, 10) | pu(color[3], 30, 2); break;
+
+ case tcuTexture.ChannelType.UNSIGNED_INT_24_8:
+ switch (this.m_format.order) {
+ // \note Stencil is always ignored.
+ case tcuTexture.ChannelOrder.D: pixelPtr[pixelPtrOffset] = pu(color[0], 8, 24); break;
+ case tcuTexture.ChannelOrder.S: pixelPtr[pixelPtrOffset] = pu(color[3], 8, 24); break;
+ case tcuTexture.ChannelOrder.DS: pixelPtr[pixelPtrOffset] = pu(color[0], 8, 24) | pu(color[3], 0, 8); break;
+ default:
+ throw new Error('Unsupported tcuTexture.channel order ' + this.m_format.order);
+ }
+ break;
+
+ case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV: {
+ pixelPtr[pixelPtrOffset] = color[0];
+ var u32array = new Uint32Array(this.m_data, offset + this.m_offset + 4, 1);
+ u32array[pixelPtrOffset] = pu(color[3], 0, 8);
+ break;
+ }
+
+ default: {
+ // Generic path.
+ var numChannels = tcuTexture.getNumUsedChannels(this.m_format.order);
+ var map = tcuTexture.getChannelWriteMap(this.m_format.order);
+
+ for (var c = 0; c < numChannels; c++)
+ pixelPtr[c + pixelPtrOffset] = tcuTexture.intToChannel(color[map[c]], this.m_format.type);
+ }
+ }
+};
+
+/**
+ * @param {Array<number>=} color Vec4 color to set, optional.
+ * @param {Array<number>=} x Range in x axis, optional.
+ * @param {Array<number>=} y Range in y axis, optional.
+ * @param {Array<number>=} z Range in z axis, optional.
+ */
+tcuTexture.PixelBufferAccess.prototype.clear = function(color, x, y, z) {
+ var c = color || [0, 0, 0, 0];
+ var arrayType = tcuTexture.getTypedArray(this.m_format.type);
+ var range_x = x || [0, this.m_width];
+ var range_y = y || [0, this.m_height];
+ var range_z = z || [0, this.m_depth];
+ var pixelSize = this.m_format.getPixelSize();
+ var numElements = pixelSize / arrayType.BYTES_PER_ELEMENT;
+ var width = range_x[1] - range_x[0];
+ var height = range_y[1] - range_y[0];
+ var depth = range_z[1] - range_z[0];
+ if (x === undefined && y === undefined && z === undefined &&
+ c[0] == 0 && c[1] == 0 && c[2] == 0 && c[3] == 0) {
+ var pixelPtr = new arrayType(this.m_data, this.m_offset);
+ pixelPtr.fill(0);
+ return;
+ }
+
+ //copy first pixel over other pixels in the row
+ var fillRow = function(pixelPtr, numElements, width) {
+ for (var i = 1; i < width; i++)
+ for (var c = 0; c < numElements; c++)
+ pixelPtr[i * numElements + c] = pixelPtr[c];
+ };
+ // copy first row to other rows in all planes
+ var fillPlanes = function(buffer, arrayType, src, offset, rowStride, planeStride, width, height, depth) {
+ for (var j = 0; j < depth; j++)
+ for (var i = (j == 0 ? 1 : 0); i < height; i++) {
+ var dst = new arrayType(buffer, offset + i * rowStride + j * planeStride, width);
+ dst.set(src);
+ }
+ };
+
+ this.setPixel(c, range_x[0], range_y[0], range_z[0]);
+
+ var offset = range_z[0] * this.m_slicePitch + range_y[0] * this.m_rowPitch + range_x[0] * pixelSize;
+ var pixelPtr = new arrayType(this.m_data, offset + this.m_offset, width * numElements);
+
+ fillRow(pixelPtr, numElements, width);
+ fillPlanes(this.m_data, arrayType, pixelPtr, offset + this.m_offset, this.m_rowPitch, this.m_slicePitch, width * numElements, height, depth);
+};
+
+/**
+ * @param {number} depth to set
+ * @param {number} x
+ * @param {number} y
+ * @param {number=} z
+ */
+tcuTexture.PixelBufferAccess.prototype.setPixDepth = function(depth, x, y, z) {
+ if (z == null)
+ z = 0;
+ DE_ASSERT(deMath.deInBounds32(x, 0, this.m_width));
+ DE_ASSERT(deMath.deInBounds32(y, 0, this.m_height));
+ DE_ASSERT(deMath.deInBounds32(z, 0, this.m_depth));
+
+ // Make sure that the position is 'integer'
+ x = Math.round(x);
+ y = Math.round(y);
+ z = Math.round(z);
+
+ var pixelSize = this.m_format.getPixelSize();
+ var offset = z * this.m_slicePitch + y * this.m_rowPitch + x * pixelSize;
+ var pixelPtr = this.getDataPtr();
+ var pixelPtrOffset = offset / pixelPtr.BYTES_PER_ELEMENT;
+
+ var pn = function(val, offs, bits) {
+ return tcuTexture.normFloatToChannel(val, bits) << offs;
+ };
+
+ // Packed formats.
+ switch (this.m_format.type) {
+ case tcuTexture.ChannelType.UNSIGNED_INT_24_8:
+ switch (this.m_format.order) {
+ case tcuTexture.ChannelOrder.D: pixelPtr[pixelPtrOffset] = pn(depth, 8, 24); break;
+ case tcuTexture.ChannelOrder.DS: pixelPtr[pixelPtrOffset] = pn(depth, 8, 24) | (pixelPtr[pixelPtrOffset] & 0xFF); break;
+ default:
+ throw new Error('Unsupported tcuTexture.channel order ' + this.m_format.order);
+ }
+ break;
+
+ case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV: {
+ DE_ASSERT(this.m_format.order == tcuTexture.ChannelOrder.DS);
+ pixelPtr[pixelPtrOffset] = depth;
+ break;
+ }
+
+ default: {
+ DE_ASSERT(this.m_format.order == tcuTexture.ChannelOrder.D || this.m_format.order == tcuTexture.ChannelOrder.DS);
+ pixelPtr[pixelPtrOffset] = tcuTexture.floatToChannel(depth, this.m_format.type);
+ }
+ }
+};
+
+/**
+ * @param {number} stencil to set
+ * @param {number} x
+ * @param {number} y
+ * @param {number=} z
+ */
+tcuTexture.PixelBufferAccess.prototype.setPixStencil = function(stencil, x, y, z) {
+ if (z == null)
+ z = 0;
+ DE_ASSERT(deMath.deInBounds32(x, 0, this.m_width));
+ DE_ASSERT(deMath.deInBounds32(y, 0, this.m_height));
+ DE_ASSERT(deMath.deInBounds32(z, 0, this.m_depth));
+
+ // Make sure that the position is 'integer'
+ x = Math.round(x);
+ y = Math.round(y);
+ z = Math.round(z);
+
+ var pixelSize = this.m_format.getPixelSize();
+ var offset = z * this.m_slicePitch + y * this.m_rowPitch + x * pixelSize;
+ var pixelPtr = this.getDataPtr();
+ var pixelPtrOffset = offset / pixelPtr.BYTES_PER_ELEMENT;
+
+ var pu = function(val, offs, bits) {
+ return tcuTexture.uintToChannel(val, bits) << offs;
+ };
+
+ // Packed formats.
+ switch (this.m_format.type) {
+ case tcuTexture.ChannelType.UNSIGNED_INT_24_8:
+ switch (this.m_format.order) {
+ case tcuTexture.ChannelOrder.S: pixelPtr[pixelPtrOffset] = pu(stencil, 8, 24); break;
+ case tcuTexture.ChannelOrder.DS: pixelPtr[pixelPtrOffset] = pu(stencil, 0, 8) | (pixelPtr[pixelPtrOffset] & 0xFFFFFF00); break;
+ default:
+ throw new Error('Unsupported tcuTexture.channel order ' + this.m_format.order);
+ }
+ break;
+
+ case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV: {
+ var u32array = new Uint32Array(this.m_data, this.m_offset + offset + 4, 1);
+ u32array[0] = pu(stencil, 0, 8);
+ break;
+ }
+
+ default: {
+ if (this.m_format.order == tcuTexture.ChannelOrder.S)
+ pixelPtr[pixelPtrOffset] = tcuTexture.floatToChannel(stencil, this.m_format.type);
+ else {
+ DE_ASSERT(this.m_format.order == tcuTexture.ChannelOrder.DS);
+ pixelPtr[3 + pixelPtrOffset] = tcuTexture.floatToChannel(stencil, this.m_format.type);
+ }
+ }
+ }
+};
+
+/**
+ * newFromTextureLevel
+ * @param {tcuTexture.TextureLevel} level
+ * @return {tcuTexture.PixelBufferAccess}
+ */
+tcuTexture.PixelBufferAccess.newFromTextureLevel = function(level) {
+ var descriptor = new Object();
+ descriptor.format = level.getFormat();
+ descriptor.width = level.getWidth();
+ descriptor.height = level.getHeight();
+ descriptor.depth = level.m_depth;
+ descriptor.data = level.m_data.m_ptr;
+
+ return new tcuTexture.PixelBufferAccess(descriptor);
+};
+
+/**
+ * newFromTextureFormat
+ * @param {tcuTexture.TextureFormat} format
+ * @param {number} width
+ * @param {number} height
+ * @param {number} depth
+ * @param {number} rowPitch
+ * @param {number} slicePitch
+ * @param {ArrayBuffer} data
+ */
+tcuTexture.PixelBufferAccess.newFromTextureFormat = function(format, width, height, depth, rowPitch, slicePitch, data) {
+ var descriptor = new Object();
+ descriptor.format = format;
+ descriptor.width = width;
+ descriptor.height = height;
+ descriptor.depth = depth;
+ descriptor.rowPitch = rowPitch;
+ descriptor.slicePitch = slicePitch;
+ descriptor.data = data;
+
+ return new tcuTexture.PixelBufferAccess(descriptor);
+};
+
+/* TODO: Port */
+// {
+// public:
+// tcuTexture.PixelBufferAccess (void) {}
+// tcuTexture.PixelBufferAccess (const tcuTexture.TextureFormat& format, int width, int height, int depth, void* data);
+
+// void* getDataPtr (void) const { return m_data; }
+
+// void setPixels (const void* buf, int bufSize) const;
+// void setPixel (const tcu::Vec4& color, int x, int y, int z = 0) const;
+// void setPixel (const tcu::IVec4& color, int x, int y, int z = 0) const;
+// void setPixel (const tcu::UVec4& color, int x, int y, int z = 0) const { setPixel(color.cast<int>(), x, y, z); }
+
+// void setPixDepth (float depth, int x, int y, int z = 0) const;
+// void setPixStencil (int stencil, int x, int y, int z = 0) const;
+// };
+
+/**
+ * @constructor
+ * @param {tcuTexture.TextureFormat} format
+ * @param {number} numLevels
+ */
+tcuTexture.TextureLevelPyramid = function(format, numLevels) {
+ /* tcuTexture.TextureFormat */this.m_format = format;
+ /* LevelData */ this.m_data = [];
+ for (var i = 0; i < numLevels; i++)
+ this.m_data.push(new tcuTexture.DeqpArrayBuffer());
+ /* {Array<tcuTexture.PixelBufferAccess>} */ this.m_access = [];
+ this.m_access.length = numLevels;
+};
+
+/** @return {boolean} */
+tcuTexture.TextureLevelPyramid.prototype.isLevelEmpty = function(levelNdx) { return this.m_data[levelNdx].empty(); };
+/** @return {tcuTexture.TextureFormat} */
+tcuTexture.TextureLevelPyramid.prototype.getFormat = function() { return this.m_format; };
+/** @return {number} */
+tcuTexture.TextureLevelPyramid.prototype.getNumLevels = function() { return this.m_access.length; };
+/** @return {tcuTexture.PixelBufferAccess} */
+tcuTexture.TextureLevelPyramid.prototype.getLevel = function(ndx) { return this.m_access[ndx]; };
+/** @return {Array<tcuTexture.PixelBufferAccess>} */
+tcuTexture.TextureLevelPyramid.prototype.getLevels = function() { return this.m_access; };
+
+/**
+ * @param {number} levelNdx
+ * @param {number} width
+ * @param {number} height
+ * @param {number} depth
+ */
+tcuTexture.TextureLevelPyramid.prototype.allocLevel = function(levelNdx, width, height, depth) {
+ var size = this.m_format.getPixelSize() * width * height * depth;
+
+ DE_ASSERT(this.isLevelEmpty(levelNdx));
+
+ this.m_data[levelNdx].setStorage(size);
+ this.m_access[levelNdx] = new tcuTexture.PixelBufferAccess({
+ format: this.m_format,
+ width: width,
+ height: height,
+ depth: depth,
+ data: this.m_data[levelNdx].m_ptr
+ });
+};
+
+tcuTexture.TextureLevelPyramid.prototype.clearLevel = function(levelNdx) {
+ /* TODO: Implement */
+ throw new Error('Not implemented');
+};
+
+/**
+ * @param {Array<tcuTexture.ConstPixelBufferAccess>} levels
+ * @param {number} numLevels
+ * @param {tcuTexture.Sampler} sampler
+ * @param {number} s
+ * @param {number} t
+ * @param {number} depth (integer)
+ * @param {number=} lod
+ * @return {Array<number>} Vec4 pixel color
+ */
+tcuTexture.sampleLevelArray2D = function(levels, numLevels, sampler, s, t, depth, lod) {
+ // z-offset in 2D textures is layer selector
+ return tcuTexture.sampleLevelArray2DOffset(levels, numLevels, sampler, [s, t], lod, [0, 0, depth]);
+};
+
+/**
+ * @param {Array<tcuTexture.ConstPixelBufferAccess>} levels
+ * @param {number} numLevels
+ * @param {tcuTexture.Sampler} sampler
+ * @param {number} s
+ * @param {number} t
+ * @param {number} r
+ * @param {number} lod
+ * @return {Array<number>} Vec4 pixel color
+ */
+tcuTexture.sampleLevelArray3D = function(levels, numLevels, sampler, s, t, r, lod) {
+ return tcuTexture.sampleLevelArray3DOffset(levels, numLevels, sampler, s, t, r, lod, [0, 0, 0]);
+};
+
+/**
+ * @constructor
+ * @param {tcuTexture.CubeFace} face
+ * @param {Array<number>} coords
+ */
+tcuTexture.CubeFaceCoords = function(face, coords) {
+ this.face = face;
+ this.s = coords[0];
+ this.t = coords[1];
+};
+
+/**
+ * \brief 2D Texture View
+ * @constructor
+ * @param {number} numLevels
+ * @param {?Array<tcuTexture.ConstPixelBufferAccess>} levels
+ */
+tcuTexture.Texture2DView = function(numLevels, levels) {
+ this.m_numLevels = numLevels;
+ this.m_levels = levels;
+};
+
+/** @return {number} */
+tcuTexture.Texture2DView.prototype.getNumLevels = function() { return this.m_numLevels; };
+/** @return {number} */
+tcuTexture.Texture2DView.prototype.getWidth = function() { return this.m_numLevels > 0 ? this.m_levels[0].getWidth() : 0; };
+/** @return {number} */
+tcuTexture.Texture2DView.prototype.getHeight = function() { return this.m_numLevels > 0 ? this.m_levels[0].getHeight() : 0; };
+/**
+ * @param {number} ndx
+ * @return {tcuTexture.ConstPixelBufferAccess}
+ */
+tcuTexture.Texture2DView.prototype.getLevel = function(ndx) { DE_ASSERT(deMath.deInBounds32(ndx, 0, this.m_numLevels)); return this.m_levels[ndx]; };
+/** @return {Array<tcuTexture.ConstPixelBufferAccess>} */
+tcuTexture.Texture2DView.prototype.getLevels = function() { return this.m_levels; };
+
+/**
+ * @param {number} baseLevel
+ * @param {number} maxLevel
+ * return {tcuTexture.Texture2DView}
+ */
+tcuTexture.Texture2DView.prototype.getSubView = function(baseLevel, maxLevel) {
+ var clampedBase = deMath.clamp(baseLevel, 0, this.m_numLevels - 1);
+ var clampedMax = deMath.clamp(maxLevel, clampedBase, this.m_numLevels - 1);
+ var numLevels = clampedMax - clampedBase + 1;
+ return new tcuTexture.Texture2DView(numLevels, this.m_levels.slice(clampedBase, numLevels));
+};
+
+/**
+ * @param {tcuTexture.Sampler} sampler
+ * @param {Array<number>} texCoord
+ * @param {number=} lod
+ * @return {Array<number>} Pixel color
+ */
+tcuTexture.Texture2DView.prototype.sample = function(sampler, texCoord, lod) {
+ return tcuTexture.sampleLevelArray2D(this.m_levels, this.m_numLevels, sampler, texCoord[0], texCoord[1], 0 /* depth */, lod);
+};
+
+/**
+ * @param {tcuTexture.Sampler} sampler
+ * @param {Array<number>} texCoord
+ * @param {number} lod
+ * @param {Array<number>} offset
+ * @return {Array<number>} Pixel color
+ */
+tcuTexture.Texture2DView.prototype.sampleOffset = function(sampler, texCoord, lod, offset) {
+ return tcuTexture.sampleLevelArray2DOffset(this.m_levels, this.m_numLevels, sampler, texCoord, lod, [offset[0], offset[1], 0]);
+};
+
+/**
+ * @param {tcuTexture.Sampler} sampler
+ * @param {number} ref
+ * @param {Array<number>} texCoord
+ * @param {number} lod
+ * @return {number}
+ */
+tcuTexture.Texture2DView.prototype.sampleCompare = function(sampler, ref, texCoord, lod) {
+ return tcuTexture.sampleLevelArray2DCompare(this.m_levels, this.m_numLevels, sampler, ref, texCoord[0], texCoord[1], lod, [0, 0, 0]);
+};
+
+/**
+ * @param {tcuTexture.Sampler} sampler
+ * @param {number} ref
+ * @param {Array<number>} texCoord
+ * @param {number} lod
+ * @param {Array<number>} offset
+ * @return {number}
+ */
+tcuTexture.Texture2DView.prototype.sampleCompareOffset = function(sampler, ref, texCoord, lod, offset) {
+ return tcuTexture.sampleLevelArray2DCompare(this.m_levels, this.m_numLevels, sampler, ref, texCoord[0], texCoord[1], lod, [offset[0], offset[1], 0]);
+};
+
+ /* TODO: Port
+ Vec4 sample (const tcuTexture.Sampler& sampler, float s, float t, float lod) const;
+ Vec4 sampleOffset (const tcuTexture.Sampler& sampler, float s, float t, float lod, const IVec2& offset) const;
+ float sampleCompare (const tcuTexture.Sampler& sampler, float ref, float s, float t, float lod) const;
+ float sampleCompareOffset (const tcuTexture.Sampler& sampler, float ref, float s, float t, float lod, const IVec2& offset) const;
+
+ Vec4 gatherOffsets (const tcuTexture.Sampler& sampler, float s, float t, int componentNdx, const IVec2 (&offsets)[4]) const;
+ Vec4 gatherOffsetsCompare(const tcuTexture.Sampler& sampler, float ref, float s, float t, const IVec2 (&offsets)[4]) const;
+ */
+
+/**
+ * @constructor
+ * @param {number} numLevels
+ * @param {Array<tcuTexture.ConstPixelBufferAccess>} levels
+ */
+tcuTexture.Texture2DArrayView = function(numLevels, levels) {
+ this.m_numLevels = numLevels;
+ this.m_levels = levels;
+};
+
+/** @return {number} */
+tcuTexture.Texture2DArrayView.prototype.getNumLevels = function() { return this.m_numLevels; };
+/** @return {number} */
+tcuTexture.Texture2DArrayView.prototype.getWidth = function() { return this.m_numLevels > 0 ? this.m_levels[0].getWidth() : 0; };
+/** @return {number} */
+tcuTexture.Texture2DArrayView.prototype.getHeight = function() { return this.m_numLevels > 0 ? this.m_levels[0].getHeight() : 0; };
+/** @return {number} */
+tcuTexture.Texture2DArrayView.prototype.getNumLayers = function() { return this.m_numLevels > 0 ? this.m_levels[0].getDepth() : 0; };
+/**
+ * @param {number} ndx
+ * @return {tcuTexture.ConstPixelBufferAccess}
+ */
+tcuTexture.Texture2DArrayView.prototype.getLevel = function(ndx) { DE_ASSERT(deMath.deInBounds32(ndx, 0, this.m_numLevels)); return this.m_levels[ndx]; };
+/** @return {Array<tcuTexture.ConstPixelBufferAccess>} */
+tcuTexture.Texture2DArrayView.prototype.getLevels = function() { return this.m_levels; };
+
+/**
+ * @param {number} r
+ * @return {number} layer corresponding to requested sampling 'r' coordinate
+ */
+tcuTexture.Texture2DArrayView.prototype.selectLayer = function(r) {
+ DE_ASSERT(this.m_numLevels > 0 && this.m_levels);
+ return deMath.clamp(Math.round(r), 0, this.m_levels[0].getDepth() - 1);
+};
+
+/**
+ * @param {tcuTexture.Sampler} sampler
+ * @param {Array<number>} texCoord
+ * @param {number=} lod
+ * @return {Array<number>} Pixel color
+ */
+tcuTexture.Texture2DArrayView.prototype.sample = function(sampler, texCoord, lod) {
+ lod = lod || 0;
+ return tcuTexture.sampleLevelArray2D(this.m_levels, this.m_numLevels, sampler, texCoord[0], texCoord[1], this.selectLayer(texCoord[2]), lod);
+};
+
+/**
+ * @param {tcuTexture.Sampler} sampler
+ * @param {Array<number>} texCoord
+ * @param {number} lod
+ * @param {Array<number>} offset
+ * @return {Array<number>}
+ */
+tcuTexture.Texture2DArrayView.prototype.sampleOffset = function(sampler, texCoord, lod, offset) {
+ return tcuTexture.sampleLevelArray2DOffset(this.m_levels, this.m_numLevels, sampler, texCoord, lod, [offset[0], offset[1], this.selectLayer(texCoord[2])]);
+};
+
+/**
+ * @param {tcuTexture.Sampler} sampler
+ * @param {number} ref
+ * @param {Array<number>} texCoord
+ * @param {number} lod
+ * @param {Array<number>} offset
+ * @return {number}
+ */
+tcuTexture.Texture2DArrayView.prototype.sampleCompareOffset = function(sampler, ref, texCoord, lod, offset) {
+ return tcuTexture.sampleLevelArray2DCompare(this.m_levels, this.m_numLevels, sampler, ref, texCoord[0], texCoord[1], lod, [offset[0], offset[1], this.selectLayer(texCoord[2])]);
+};
+
+/**
+ * @param {tcuTexture.Sampler} sampler
+ * @param {number} ref
+ * @param {Array<number>} texCoord
+ * @param {number} lod
+ * @return {number}
+ */
+tcuTexture.Texture2DArrayView.prototype.sampleCompare = function(sampler, ref, texCoord, lod) {
+ return tcuTexture.sampleLevelArray2DCompare(this.m_levels, this.m_numLevels, sampler, ref, texCoord[0], texCoord[1], lod, [0, 0, this.selectLayer(texCoord[2])]);
+};
+
+/**
+ * @param {Array<tcuTexture.ConstPixelBufferAccess>} levels
+ * @param {number} numLevels
+ * @param {tcuTexture.Sampler} sampler
+ * @param {Array<number>} texCoord
+ * @param {number} lod
+ * @param {Array<number>} offset
+ * @return {Array<number>}
+ */
+tcuTexture.sampleLevelArray2DOffset = function(levels, numLevels, sampler, texCoord, lod, offset) {
+ /** @type {boolean} */ var magnified = lod <= sampler.lodThreshold;
+ /** @type {tcuTexture.FilterMode} */ var filterMode = magnified ? sampler.magFilter : sampler.minFilter;
+ /** @type {number} */ var maxLevel;
+ /** @type {tcuTexture.FilterMode} */ var levelFilter;
+ switch (filterMode) {
+ case tcuTexture.FilterMode.NEAREST: return levels[0].sample2DOffset(sampler, filterMode, texCoord[0], texCoord[1], offset);
+ case tcuTexture.FilterMode.LINEAR: return levels[0].sample2DOffset(sampler, filterMode, texCoord[0], texCoord[1], offset);
+
+ case tcuTexture.FilterMode.NEAREST_MIPMAP_NEAREST:
+ case tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST:
+ maxLevel = numLevels - 1;
+ /** @type {number} */ var level = deMath.clamp(Math.ceil(lod + 0.5) - 1, 0, maxLevel);
+ levelFilter = (filterMode === tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST) ? tcuTexture.FilterMode.LINEAR : tcuTexture.FilterMode.NEAREST;
+
+ return levels[level].sample2DOffset(sampler, levelFilter, texCoord[0], texCoord[1], offset);
+
+ case tcuTexture.FilterMode.NEAREST_MIPMAP_LINEAR:
+ case tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR:
+ maxLevel = numLevels - 1;
+ /** @type {number} */ var level0 = deMath.clamp(Math.floor(lod), 0, maxLevel);
+ /** @type {number} */ var level1 = Math.min(maxLevel, level0 + 1);
+ levelFilter = (filterMode === tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR) ? tcuTexture.FilterMode.LINEAR : tcuTexture.FilterMode.NEAREST;
+ /** @type {number} */ var f = deMath.deFloatFrac(lod);
+ /** @type {Array<number>} */ var t0 = levels[level0].sample2DOffset(sampler, levelFilter, texCoord[0], texCoord[1], offset);
+ /** @type {Array<number>} */ var t1 = levels[level1].sample2DOffset(sampler, levelFilter, texCoord[0], texCoord[1], offset);
+
+ return deMath.add(deMath.scale(t0, (1.0 - f)), deMath.scale(t1, f));
+
+ default:
+ return [0.0, 0.0, 0.0, 0.0];
+ }
+};
+
+/**
+ * @constructor
+ * @param {number} numLevels
+ * @param {Array<tcuTexture.ConstPixelBufferAccess>} levels
+ */
+tcuTexture.Texture3DView = function(numLevels, levels) {
+ this.m_numLevels = numLevels;
+ this.m_levels = levels;
+};
+
+/** @return {number} */
+tcuTexture.Texture3DView.prototype.getNumLevels = function() { return this.m_numLevels; };
+/** @return {number} */
+tcuTexture.Texture3DView.prototype.getWidth = function() { return this.m_numLevels > 0 ? this.m_levels[0].getWidth() : 0; };
+/** @return {number} */
+tcuTexture.Texture3DView.prototype.getHeight = function() { return this.m_numLevels > 0 ? this.m_levels[0].getHeight() : 0; };
+/** @return {number} */
+tcuTexture.Texture3DView.prototype.getDepth = function() { return this.m_numLevels > 0 ? this.m_levels[0].getDepth() : 0; };
+/**
+ * @param {number} ndx
+ * @return {tcuTexture.ConstPixelBufferAccess}
+ */
+tcuTexture.Texture3DView.prototype.getLevel = function(ndx) { DE_ASSERT(deMath.deInBounds32(ndx, 0, this.m_numLevels)); return this.m_levels[ndx]; };
+/** @return {Array<tcuTexture.ConstPixelBufferAccess>} */
+tcuTexture.Texture3DView.prototype.getLevels = function() { return this.m_levels; };
+
+/**
+ * @param {number} baseLevel
+ * @param {number} maxLevel
+ * return {tcuTexture.Texture3DView}
+ */
+tcuTexture.Texture3DView.prototype.getSubView = function(baseLevel, maxLevel) {
+ var clampedBase = deMath.clamp(baseLevel, 0, this.m_numLevels - 1);
+ var clampedMax = deMath.clamp(maxLevel, clampedBase, this.m_numLevels - 1);
+ var numLevels = clampedMax - clampedBase + 1;
+ return new tcuTexture.Texture3DView(numLevels, this.m_levels.slice(clampedBase, numLevels));
+};
+
+/**
+ * @param {tcuTexture.Sampler} sampler
+ * @param {Array<number>} texCoord
+ * @param {number=} lod
+ * @return {Array<number>} Pixel color
+ */
+tcuTexture.Texture3DView.prototype.sample = function(sampler, texCoord, lod) {
+ lod = lod || 0;
+ return tcuTexture.sampleLevelArray3D(this.m_levels, this.m_numLevels, sampler, texCoord[0], texCoord[1], texCoord[2], lod);
+};
+
+/**
+ * @param {tcuTexture.Sampler} sampler
+ * @param {number} ref
+ * @param {Array<number>} texCoord
+ * @param {number} lod
+ * @return {number}
+ */
+tcuTexture.Texture3DView.prototype.sampleCompare = function(sampler, ref, texCoord, lod) {
+ throw new Error('Unimplemented');
+};
+
+/**
+ * @param {tcuTexture.Sampler} sampler
+ * @param {Array<number>} texCoord
+ * @param {number} lod
+ * @param {Array<number>} offset
+ * @return {Array<number>}
+ */
+tcuTexture.Texture3DView.prototype.sampleOffset = function(sampler, texCoord, lod, offset) {
+ return tcuTexture.sampleLevelArray3DOffset(this.m_levels, this.m_numLevels, sampler, texCoord[0], texCoord[1], texCoord[2], lod, offset);
+};
+
+/* TODO: All view classes are very similar. They should have a common base class */
+
+/**
+ * @param {Array<tcuTexture.ConstPixelBufferAccess>} levels
+ * @param {number} numLevels
+ * @param {tcuTexture.Sampler} sampler
+ * @param {number} s
+ * @param {number} t
+ * @param {number} r
+ * @param {number} lod
+ * @param {Array<number>} offset
+ * @return {Array<number>}
+ */
+tcuTexture.sampleLevelArray3DOffset = function(levels, numLevels, sampler, s, t, r, lod, offset) {
+ /** @type {boolean} */ var magnified = lod <= sampler.lodThreshold;
+ /** @type {tcuTexture.FilterMode} */ var filterMode = magnified ? sampler.magFilter : sampler.minFilter;
+ /** @type {number} */ var maxLevel;
+ /** @type {tcuTexture.FilterMode} */ var levelFilter;
+ switch (filterMode) {
+ case tcuTexture.FilterMode.NEAREST: return levels[0].sample3DOffset(sampler, filterMode, s, t, r, offset);
+ case tcuTexture.FilterMode.LINEAR: return levels[0].sample3DOffset(sampler, filterMode, s, t, r, offset);
+
+ case tcuTexture.FilterMode.NEAREST_MIPMAP_NEAREST:
+ case tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST:
+ maxLevel = numLevels - 1;
+ /** @type {number} */ var level = deMath.clamp(Math.ceil(lod + 0.5) - 1, 0, maxLevel);
+ levelFilter = (filterMode === tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST) ? tcuTexture.FilterMode.LINEAR : tcuTexture.FilterMode.NEAREST;
+
+ return levels[level].sample3DOffset(sampler, levelFilter, s, t, r, offset);
+
+ case tcuTexture.FilterMode.NEAREST_MIPMAP_LINEAR:
+ case tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR:
+ maxLevel = numLevels - 1;
+ /** @type {number} */ var level0 = deMath.clamp(Math.floor(lod), 0, maxLevel);
+ /** @type {number} */ var level1 = Math.min(maxLevel, level0 + 1);
+ levelFilter = (filterMode === tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR) ? tcuTexture.FilterMode.LINEAR : tcuTexture.FilterMode.NEAREST;
+ /** @type {number} */ var f = deMath.deFloatFrac(lod);
+ /** @type {Array<number>} */ var t0 = levels[level0].sample3DOffset(sampler, levelFilter, s, t, r, offset);
+ /** @type {Array<number>} */ var t1 = levels[level1].sample3DOffset(sampler, levelFilter, s, t, r, offset);
+
+ return deMath.add(deMath.scale(t0, (1.0 - f)), deMath.scale(t1, f));
+
+ default:
+ throw new Error('Filter mode not supported');
+ }
+};
+
+/**
+ * @param {number} width
+ * @param {number=} height
+ * @param {number=} depth
+ * @return {number} Number of pyramid levels
+ */
+tcuTexture.computeMipPyramidLevels = function(width, height, depth) {
+ if (depth !== undefined)
+ return Math.floor(Math.log2(Math.max(width, Math.max(height, depth)))) + 1;
+ else if (height !== undefined)
+ return Math.floor(Math.log2(Math.max(width, height))) + 1;
+ else
+ return Math.floor(Math.log2(width)) + 1;
+};
+
+/**
+ * @param {number} baseLevelSize
+ * @param {number} levelNdx
+ */
+tcuTexture.getMipPyramidLevelSize = function(baseLevelSize, levelNdx) {
+ return Math.max(baseLevelSize >> levelNdx, 1);
+};
+
+/**
+ * @param {Array<tcuTexture.ConstPixelBufferAccess>} faceAccesses
+ * @param {tcuTexture.CubeFace} baseFace
+ * @param {number} u
+ * @param {number} v
+ * @param {number} depth
+ * @return {Array<Array<number>>}
+ */
+tcuTexture.getCubeLinearSamples = function(faceAccesses, baseFace, u, v, depth) {
+ DE_ASSERT(faceAccesses[0].getWidth() == faceAccesses[0].getHeight());
+ /** @type {Array<Array<number>>} */ var dst = [];
+ var size = faceAccesses[0].getWidth();
+ var x0 = Math.floor(u - 0.5);
+ var x1 = x0 + 1;
+ var y0 = Math.floor(v - 0.5);
+ var y1 = y0 + 1;
+ var baseSampleCoords =
+ [
+ [x0, y0],
+ [x1, y0],
+ [x0, y1],
+ [x1, y1]
+ ];
+ /** @type {Array<Array<number>>} */ var sampleColors = [];
+ /** @type {Array<boolean>} */ var hasBothCoordsOutOfBounds = []; //!< Whether correctCubeFace() returns CUBEFACE_LAST, i.e. both u and v are out of bounds.
+
+ // Find correct faces and coordinates for out-of-bounds sample coordinates.
+
+ for (var i = 0; i < 4; i++) {
+ /** @type {tcuTexture.CubeFaceCoords} */ var coords = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(baseFace, baseSampleCoords[i]), size);
+ hasBothCoordsOutOfBounds[i] = coords == null;
+ if (!hasBothCoordsOutOfBounds[i])
+ sampleColors[i] = tcuTexture.lookup(faceAccesses[coords.face], coords.s, coords.t, depth);
+ }
+
+ // If a sample was out of bounds in both u and v, we get its color from the average of the three other samples.
+ // \note This averaging behavior is not required by the GLES3 spec (though it is recommended). GLES3 spec only
+ // requires that if the three other samples all have the same color, then the doubly-out-of-bounds sample
+ // must have this color as well.
+
+ var bothOutOfBoundsNdx = -1;
+ for (var i = 0; i < 4; i++) {
+ if (hasBothCoordsOutOfBounds[i]) {
+ DE_ASSERT(bothOutOfBoundsNdx < 0); // Only one sample can be out of bounds in both u and v.
+ bothOutOfBoundsNdx = i;
+ }
+ }
+ if (bothOutOfBoundsNdx != -1) {
+ sampleColors[bothOutOfBoundsNdx] = [0, 0, 0, 0];
+ for (var i = 0; i < 4; i++)
+ if (i != bothOutOfBoundsNdx)
+ sampleColors[bothOutOfBoundsNdx] = deMath.add(sampleColors[bothOutOfBoundsNdx], sampleColors[i]);
+
+ sampleColors[bothOutOfBoundsNdx] = deMath.scale(sampleColors[bothOutOfBoundsNdx], (1.0 / 3.0));
+ }
+
+ for (var i = 0; i < sampleColors.length; i++)
+ dst[i] = sampleColors[i];
+
+ return dst;
+};
+
+// \todo [2014-02-19 pyry] Optimize faceAccesses
+/**
+ * @param {Array<tcuTexture.ConstPixelBufferAccess>} faceAccesses
+ * @param {tcuTexture.CubeFace} baseFace
+ * @param {tcuTexture.Sampler} sampler
+ * @param {number} s
+ * @param {number} t
+ * @param {number} depth
+ * @return {Array<number>}
+ */
+tcuTexture.sampleCubeSeamlessLinear = function(faceAccesses, baseFace, sampler, s, t, depth) {
+ DE_ASSERT(faceAccesses[0].getWidth() == faceAccesses[0].getHeight());
+
+ var size = faceAccesses[0].getWidth();
+ // Non-normalized coordinates.
+ var u = s;
+ var v = t;
+
+ if (sampler.normalizedCoords) {
+ u = tcuTexture.unnormalize(sampler.wrapS, s, size);
+ v = tcuTexture.unnormalize(sampler.wrapT, t, size);
+ }
+
+ // Get sample colors.
+
+ /** @type {Array<Array<number>>} */ var sampleColors = tcuTexture.getCubeLinearSamples(faceAccesses, baseFace, u, v, depth);
+
+ // Interpolate.
+
+ var a = deMath.deFloatFrac(u - 0.5);
+ var b = deMath.deFloatFrac(v - 0.5);
+
+ return deMath.add((deMath.scale(deMath.scale(sampleColors[0], (1.0 - a)), (1.0 - b))),
+ deMath.add((deMath.scale(deMath.scale(sampleColors[1], (a)), (1.0 - b))),
+ deMath.add((deMath.scale(deMath.scale(sampleColors[2], (1.0 - a)), (b))),
+ (deMath.scale(deMath.scale(sampleColors[3], (a)), (b))))));
+};
+
+/**
+ * @param {Array<Array<tcuTexture.ConstPixelBufferAccess>>} faces
+ * @param {number} numLevels
+ * @param {tcuTexture.CubeFace} face
+ * @param {tcuTexture.Sampler} sampler
+ * @param {number} s
+ * @param {number} t
+ * @param {number} depth
+ * @param {number=} lod
+ * @return {Array<number>}
+ */
+tcuTexture.sampleLevelArrayCubeSeamless = function(faces, numLevels, face, sampler, s, t, depth, lod) {
+ lod = lod || 0;
+ var magnified = lod <= sampler.lodThreshold;
+ /** @type {tcuTexture.FilterMode} */ var filterMode = magnified ? sampler.magFilter : sampler.minFilter;
+ /** @type {Array<tcuTexture.ConstPixelBufferAccess>} */ var faceAccesses = [];
+ /** @type {tcuTexture.FilterMode}*/ var levelFilter;
+
+ switch (filterMode) {
+ case tcuTexture.FilterMode.NEAREST:
+ return tcuTexture.sampleCubeSeamlessNearest(faces[face][0], sampler, s, t, depth);
+
+ case tcuTexture.FilterMode.LINEAR: {
+ faceAccesses = [];
+ for (var i = 0; i < Object.keys(tcuTexture.CubeFace).length; i++)
+ faceAccesses[i] = faces[i][0];
+
+ return tcuTexture.sampleCubeSeamlessLinear(faceAccesses, face, sampler, s, t, depth);
+ }
+
+ case tcuTexture.FilterMode.NEAREST_MIPMAP_NEAREST:
+ case tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST: {
+ var maxLevel = numLevels - 1;
+ var level = deMath.clamp(Math.ceil(lod + 0.5) - 1, 0, maxLevel);
+ levelFilter = (filterMode == tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST) ? tcuTexture.FilterMode.LINEAR : tcuTexture.FilterMode.NEAREST;
+
+ if (levelFilter == tcuTexture.FilterMode.NEAREST)
+ return tcuTexture.sampleCubeSeamlessNearest(faces[face][level], sampler, s, t, depth);
+ else {
+ DE_ASSERT(levelFilter == tcuTexture.FilterMode.LINEAR);
+
+ faceAccesses = [];
+ for (var i = 0; i < Object.keys(tcuTexture.CubeFace).length; i++)
+ faceAccesses[i] = faces[i][level];
+
+ return tcuTexture.sampleCubeSeamlessLinear(faceAccesses, face, sampler, s, t, depth);
+ }
+ }
+
+ case tcuTexture.FilterMode.NEAREST_MIPMAP_LINEAR:
+ case tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR: {
+ var maxLevel = numLevels - 1;
+ var level0 = deMath.clamp(Math.floor(lod), 0, maxLevel);
+ var level1 = Math.min(maxLevel, level0 + 1);
+ levelFilter = (filterMode == tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR) ? tcuTexture.FilterMode.LINEAR : tcuTexture.FilterMode.NEAREST;
+ var f = deMath.deFloatFrac(lod);
+ var t0 = [];
+ var t1 = [];
+
+ if (levelFilter == tcuTexture.FilterMode.NEAREST) {
+ t0 = tcuTexture.sampleCubeSeamlessNearest(faces[face][level0], sampler, s, t, depth);
+ t1 = tcuTexture.sampleCubeSeamlessNearest(faces[face][level1], sampler, s, t, depth);
+ } else {
+ DE_ASSERT(levelFilter == tcuTexture.FilterMode.LINEAR);
+
+ /** @type {Array<tcuTexture.ConstPixelBufferAccess>}*/ var faceAccesses0 = [];
+ /** @type {Array<tcuTexture.ConstPixelBufferAccess>}*/ var faceAccesses1 = [];
+ for (var i = 0; i < Object.keys(tcuTexture.CubeFace).length; i++) {
+ faceAccesses0[i] = faces[i][level0];
+ faceAccesses1[i] = faces[i][level1];
+ }
+
+ t0 = tcuTexture.sampleCubeSeamlessLinear(faceAccesses0, face, sampler, s, t, depth);
+ t1 = tcuTexture.sampleCubeSeamlessLinear(faceAccesses1, face, sampler, s, t, depth);
+ }
+
+ return deMath.add(deMath.scale(t0, (1.0 - f)), deMath.scale(t1, f));
+ }
+
+ default:
+ throw new Error('Unsupported filter mode');
+ }
+};
+
+/**
+ * @param {tcuTexture.ConstPixelBufferAccess} faceAccess
+ * @param {tcuTexture.Sampler} sampler
+ * @param {number} ref
+ * @param {number} s
+ * @param {number} t
+ * @param {number=} depth
+ * @return {number}
+ */
+tcuTexture.sampleCubeSeamlessNearestCompare = function(faceAccess, sampler, ref, s, t, depth) {
+ depth = depth ? depth : 0;
+ /** @type {tcuTexture.Sampler} */ var clampingSampler = deUtil.clone(sampler);
+ clampingSampler.wrapS = tcuTexture.WrapMode.CLAMP_TO_EDGE;
+ clampingSampler.wrapT = tcuTexture.WrapMode.CLAMP_TO_EDGE;
+ return faceAccess.sample2DCompare(clampingSampler, tcuTexture.FilterMode.NEAREST, ref, s, t, [0, 0, depth]);
+};
+
+/**
+ * @param {Array<tcuTexture.ConstPixelBufferAccess>} faceAccesses
+ * @param {tcuTexture.CubeFace} baseFace
+ * @param {tcuTexture.Sampler} sampler
+ * @param {number} ref
+ * @param {number} s
+ * @param {number} t
+ * @return {number}
+ */
+tcuTexture.sampleCubeSeamlessLinearCompare = function(faceAccesses, baseFace, sampler, ref, s, t) {
+ DE_ASSERT(faceAccesses[0].getWidth() == faceAccesses[0].getHeight());
+
+ var size = faceAccesses[0].getWidth();
+ // Non-normalized coordinates.
+ var u = s;
+ var v = t;
+
+ if (sampler.normalizedCoords) {
+ u = tcuTexture.unnormalize(sampler.wrapS, s, size);
+ v = tcuTexture.unnormalize(sampler.wrapT, t, size);
+ }
+
+ var x0 = Math.floor(u - 0.5);
+ var x1 = x0 + 1;
+ var y0 = Math.floor(v - 0.5);
+ var y1 = y0 + 1;
+ var baseSampleCoords = [
+ [x0, y0],
+ [x1, y0],
+ [x0, y1],
+ [x1, y1]
+ ];
+ var sampleRes = [];
+ var hasBothCoordsOutOfBounds = []; //!< Whether correctCubeFace() returns CUBEFACE_LAST, i.e. both u and v are out of bounds.
+
+ // Find correct faces and coordinates for out-of-bounds sample coordinates.
+
+ for (var i = 0; i < 4; i++) {
+ /** @type {tcuTexture.CubeFaceCoords} */ var coords = tcuTexture.remapCubeEdgeCoords(new tcuTexture.CubeFaceCoords(baseFace, baseSampleCoords[i]), size);
+ hasBothCoordsOutOfBounds[i] = coords == null;
+
+ if (!hasBothCoordsOutOfBounds[i]) {
+ var isFixedPointDepth = tcuTexture.isFixedPointDepthTextureFormat(faceAccesses[coords.face].getFormat());
+
+ sampleRes[i] = tcuTexture.execCompare(faceAccesses[coords.face].getPixel(coords.s, coords.t), sampler.compare, sampler.compareChannel, ref, isFixedPointDepth);
+ }
+ }
+
+ // If a sample was out of bounds in both u and v, we get its color from the average of the three other samples.
+ // \note This averaging behavior is not required by the GLES3 spec (though it is recommended). GLES3 spec only
+ // requires that if the three other samples all have the same color, then the doubly-out-of-bounds sample
+ // must have this color as well.
+
+ var bothOutOfBoundsNdx = -1;
+ for (var i = 0; i < 4; i++) {
+ if (hasBothCoordsOutOfBounds[i]) {
+ DE_ASSERT(bothOutOfBoundsNdx < 0); // Only one sample can be out of bounds in both u and v.
+ bothOutOfBoundsNdx = i;
+ }
+ }
+ if (bothOutOfBoundsNdx != -1) {
+ sampleRes[bothOutOfBoundsNdx] = 0.0;
+ for (var i = 0; i < 4; i++)
+ if (i != bothOutOfBoundsNdx)
+ sampleRes[bothOutOfBoundsNdx] += sampleRes[i];
+
+ sampleRes[bothOutOfBoundsNdx] = sampleRes[bothOutOfBoundsNdx] * (1.0 / 3.0);
+ }
+
+ // Interpolate.
+
+ var a = deMath.deFloatFrac(u - 0.5);
+ var b = deMath.deFloatFrac(v - 0.5);
+
+ return (sampleRes[0] * (1.0 - a) * (1.0 - b)) +
+ (sampleRes[1] * (a) * (1.0 - b)) +
+ (sampleRes[2] * (1.0 - a) * (b)) +
+ (sampleRes[3] * (a) * (b));
+};
+
+/**
+ * @param {tcuTexture.ConstPixelBufferAccess} faceAccess
+ * @param {tcuTexture.Sampler} sampler
+ * @param {number} s
+ * @param {number} t
+ * @param {number} depth
+ * @return {Array<number>}
+ */
+tcuTexture.sampleCubeSeamlessNearest = function(faceAccess, sampler, s, t, depth) {
+ /** @type {tcuTexture.Sampler} */ var clampingSampler = sampler;
+ clampingSampler.wrapS = tcuTexture.WrapMode.CLAMP_TO_EDGE;
+ clampingSampler.wrapT = tcuTexture.WrapMode.CLAMP_TO_EDGE;
+ return faceAccess.sample2D(clampingSampler, tcuTexture.FilterMode.NEAREST, s, t, depth);
+};
+
+/**
+ * @param {Array<number>} coords Vec3 cube coordinates
+ * @return {tcuTexture.CubeFaceCoords}
+ */
+tcuTexture.getCubeFaceCoords = function(coords) {
+ var face = tcuTexture.selectCubeFace(coords);
+ return new tcuTexture.CubeFaceCoords(face, tcuTexture.projectToFace(face, coords));
+};
+
+/**
+ * @param {Array<Array<tcuTexture.ConstPixelBufferAccess>>} faces
+ * @param {number} numLevels
+ * @param {tcuTexture.CubeFace} face
+ * @param {tcuTexture.Sampler} sampler
+ * @param {number} ref
+ * @param {number} s
+ * @param {number} t
+ * @param {number} lod
+ * @return {number}
+ */
+tcuTexture.sampleLevelArrayCubeSeamlessCompare = function(faces, numLevels, face, sampler, ref, s, t, lod) {
+ var magnified = lod <= sampler.lodThreshold;
+ /** @type {tcuTexture.FilterMode}*/ var filterMode = magnified ? sampler.magFilter : sampler.minFilter;
+ /** @type {Array<tcuTexture.ConstPixelBufferAccess>} */ var faceAccesses = [];
+ /** @type {tcuTexture.FilterMode} */ var levelFilter;
+
+ switch (filterMode) {
+ case tcuTexture.FilterMode.NEAREST:
+ return tcuTexture.sampleCubeSeamlessNearestCompare(faces[face][0], sampler, ref, s, t);
+
+ case tcuTexture.FilterMode.LINEAR: {
+ faceAccesses = [];
+ for (var i = 0; i < Object.keys(tcuTexture.CubeFace).length; i++)
+ faceAccesses[i] = faces[i][0];
+
+ return tcuTexture.sampleCubeSeamlessLinearCompare(faceAccesses, face, sampler, ref, s, t);
+ }
+
+ case tcuTexture.FilterMode.NEAREST_MIPMAP_NEAREST:
+ case tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST: {
+ var maxLevel = numLevels - 1;
+ var level = deMath.clamp(Math.ceil(lod + 0.5) - 1, 0, maxLevel);
+ levelFilter = filterMode == tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST ? tcuTexture.FilterMode.LINEAR : tcuTexture.FilterMode.NEAREST;
+
+ if (levelFilter == tcuTexture.FilterMode.NEAREST)
+ return tcuTexture.sampleCubeSeamlessNearestCompare(faces[face][level], sampler, ref, s, t);
+ else {
+ DE_ASSERT(levelFilter == tcuTexture.FilterMode.LINEAR);
+
+ faceAccesses = [];
+ for (var i = 0; i < Object.keys(tcuTexture.CubeFace).length; i++)
+ faceAccesses[i] = faces[i][level];
+
+ return tcuTexture.sampleCubeSeamlessLinearCompare(faceAccesses, face, sampler, ref, s, t);
+ }
+ }
+
+ case tcuTexture.FilterMode.NEAREST_MIPMAP_LINEAR:
+ case tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR: {
+ var maxLevel = numLevels - 1;
+ var level0 = deMath.clamp(Math.floor(lod), 0, maxLevel);
+ var level1 = Math.min(maxLevel, level0 + 1);
+ levelFilter = (filterMode == tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR) ? tcuTexture.FilterMode.LINEAR : tcuTexture.FilterMode.NEAREST;
+ var f = deMath.deFloatFrac(lod);
+ var t0;
+ var t1;
+
+ if (levelFilter == tcuTexture.FilterMode.NEAREST) {
+ t0 = tcuTexture.sampleCubeSeamlessNearestCompare(faces[face][level0], sampler, ref, s, t);
+ t1 = tcuTexture.sampleCubeSeamlessNearestCompare(faces[face][level1], sampler, ref, s, t);
+ } else {
+ DE_ASSERT(levelFilter == tcuTexture.FilterMode.LINEAR);
+
+ /** @type {Array<tcuTexture.ConstPixelBufferAccess>} */ var faceAccesses0 = [];
+ /** @type {Array<tcuTexture.ConstPixelBufferAccess>} */ var faceAccesses1 = [];
+ for (var i = 0; i < Object.keys(tcuTexture.CubeFace).length; i++) {
+ faceAccesses0[i] = faces[i][level0];
+ faceAccesses1[i] = faces[i][level1];
+ }
+
+ t0 = tcuTexture.sampleCubeSeamlessLinearCompare(faceAccesses0, face, sampler, ref, s, t);
+ t1 = tcuTexture.sampleCubeSeamlessLinearCompare(faceAccesses1, face, sampler, ref, s, t);
+ }
+
+ return t0 * (1.0 - f) + t1 * f;
+ }
+
+ default:
+ throw new Error('Unsupported filter mode');
+ }
+};
+
+/**
+ * @constructor
+ * @extends {tcuTexture.TextureLevelPyramid}
+ * @param {tcuTexture.TextureFormat} format
+ * @param {number} width
+ * @param {number} height
+ */
+tcuTexture.Texture2D = function(format, width, height) {
+ tcuTexture.TextureLevelPyramid.call(this, format, tcuTexture.computeMipPyramidLevels(width, height));
+ this.m_width = width;
+ this.m_height = height;
+ this.m_view = new tcuTexture.Texture2DView(this.getNumLevels(), this.getLevels());
+};
+
+tcuTexture.Texture2D.prototype = Object.create(tcuTexture.TextureLevelPyramid.prototype);
+tcuTexture.Texture2D.prototype.constructor = tcuTexture.Texture2D;
+
+tcuTexture.Texture2D.prototype.getWidth = function() { return this.m_width; };
+tcuTexture.Texture2D.prototype.getHeight = function() { return this.m_height; };
+/** @return {tcuTexture.Texture2DView} */
+tcuTexture.Texture2D.prototype.getView = function() { return this.m_view; };
+
+/**
+ * @param {number} baseLevel
+ * @param {number} maxLevel
+ * @return {tcuTexture.Texture2DView}
+ */
+tcuTexture.Texture2D.prototype.getSubView = function(baseLevel, maxLevel) { return this.m_view.getSubView(baseLevel, maxLevel); };
+
+/**
+ * @param {number} levelNdx
+ */
+tcuTexture.Texture2D.prototype.allocLevel = function(levelNdx) {
+ DE_ASSERT(deMath.deInBounds32(levelNdx, 0, this.getNumLevels()));
+
+ var width = tcuTexture.getMipPyramidLevelSize(this.m_width, levelNdx);
+ var height = tcuTexture.getMipPyramidLevelSize(this.m_height, levelNdx);
+
+ tcuTexture.TextureLevelPyramid.prototype.allocLevel.call(this, levelNdx, width, height, 1);
+};
+
+/**
+ * @constructor
+ * @extends {tcuTexture.TextureLevelPyramid}
+ * @param {tcuTexture.TextureFormat} format
+ * @param {number} width
+ * @param {number} height
+ * @param {number} numLayers
+ */
+tcuTexture.Texture2DArray = function(format, width, height, numLayers) {
+ tcuTexture.TextureLevelPyramid.call(this, format, tcuTexture.computeMipPyramidLevels(width, height));
+ this.m_width = width;
+ this.m_height = height;
+ this.m_numLayers = numLayers;
+ this.m_view = new tcuTexture.Texture2DArrayView(this.getNumLevels(), this.getLevels());
+};
+
+tcuTexture.Texture2DArray.prototype = Object.create(tcuTexture.TextureLevelPyramid.prototype);
+tcuTexture.Texture2DArray.prototype.constructor = tcuTexture.Texture2DArray;
+/** @return {tcuTexture.Texture2DArrayView} */
+tcuTexture.Texture2DArray.prototype.getView = function() { return this.m_view; };
+
+/** @return {number} */
+tcuTexture.Texture2DArray.prototype.getWidth = function() { return this.m_width; };
+
+/** @return {number} */
+tcuTexture.Texture2DArray.prototype.getHeight = function() { return this.m_height; };
+
+/**
+ * @param {number} levelNdx
+ */
+tcuTexture.Texture2DArray.prototype.allocLevel = function(levelNdx) {
+ DE_ASSERT(deMath.deInBounds32(levelNdx, 0, this.getNumLevels()));
+
+ var width = tcuTexture.getMipPyramidLevelSize(this.m_width, levelNdx);
+ var height = tcuTexture.getMipPyramidLevelSize(this.m_height, levelNdx);
+
+ tcuTexture.TextureLevelPyramid.prototype.allocLevel.call(this, levelNdx, width, height, this.m_numLayers);
+};
+
+/**
+ * @constructor
+ * @extends {tcuTexture.TextureLevelPyramid}
+ * @param {tcuTexture.TextureFormat} format
+ * @param {number} width
+ * @param {number} height
+ * @param {number} depth
+ */
+tcuTexture.Texture3D = function(format, width, height, depth) {
+ tcuTexture.TextureLevelPyramid.call(this, format, tcuTexture.computeMipPyramidLevels(width, height, depth));
+ this.m_width = width;
+ this.m_height = height;
+ this.m_depth = depth;
+ this.m_view = new tcuTexture.Texture3DView(this.getNumLevels(), this.getLevels());
+};
+
+tcuTexture.Texture3D.prototype = Object.create(tcuTexture.TextureLevelPyramid.prototype);
+tcuTexture.Texture3D.prototype.constructor = tcuTexture.Texture3D;
+
+tcuTexture.Texture3D.prototype.getWidth = function() { return this.m_width; };
+tcuTexture.Texture3D.prototype.getHeight = function() { return this.m_height; };
+tcuTexture.Texture3D.prototype.getDepth = function() { return this.m_depth; };
+tcuTexture.Texture3D.prototype.getView = function() { return this.m_view; };
+/**
+ * @param {number} baseLevel
+ * @param {number} maxLevel
+ * @return {tcuTexture.Texture3DView}
+ */
+tcuTexture.Texture3D.prototype.getSubView = function(baseLevel, maxLevel) { return this.m_view.getSubView(baseLevel, maxLevel); };
+
+/**
+ * @param {number} levelNdx
+ */
+tcuTexture.Texture3D.prototype.allocLevel = function(levelNdx) {
+ DE_ASSERT(deMath.deInBounds32(levelNdx, 0, this.getNumLevels()));
+
+ var width = tcuTexture.getMipPyramidLevelSize(this.m_width, levelNdx);
+ var height = tcuTexture.getMipPyramidLevelSize(this.m_height, levelNdx);
+ var depth = tcuTexture.getMipPyramidLevelSize(this.m_depth, levelNdx);
+
+ tcuTexture.TextureLevelPyramid.prototype.allocLevel.call(this, levelNdx, width, height, depth);
+};
+
+/**
+ * @constructor
+ * @param {number} numLevels
+ * @param {Array<Array<tcuTexture.ConstPixelBufferAccess>>} levels
+ */
+tcuTexture.TextureCubeView = function(numLevels, levels) {
+ this.m_numLevels = numLevels;
+ this.m_levels = levels;
+};
+
+/**
+ * @param {tcuTexture.Sampler} sampler
+ * @param {Array<number>} texCoord
+ * @param {number=} lod
+ * @return {Array<number>} Pixel color
+ */
+tcuTexture.TextureCubeView.prototype.sample = function(sampler, texCoord, lod) {
+ DE_ASSERT(sampler.compare == tcuTexture.CompareMode.COMPAREMODE_NONE);
+
+ // Computes (face, s, t).
+ var coords = tcuTexture.getCubeFaceCoords(texCoord);
+ if (sampler.seamlessCubeMap)
+ return tcuTexture.sampleLevelArrayCubeSeamless(this.m_levels, this.m_numLevels, coords.face, sampler, coords.s, coords.t, 0 /* depth */, lod);
+ else
+ return tcuTexture.sampleLevelArray2D(this.m_levels[coords.face], this.m_numLevels, sampler, coords.s, coords.t, 0 /* depth */, lod);
+};
+
+/**
+ * @param {tcuTexture.Sampler} sampler
+ * @param {number} ref
+ * @param {Array<number>} texCoord
+ * @param {number} lod
+ * @return {number}
+ */
+tcuTexture.TextureCubeView.prototype.sampleCompare = function(sampler, ref, texCoord, lod) {
+ DE_ASSERT(sampler.compare != tcuTexture.CompareMode.COMPAREMODE_NONE);
+
+ // Computes (face, s, t).
+ var coords = tcuTexture.getCubeFaceCoords(texCoord);
+ if (sampler.seamlessCubeMap)
+ return tcuTexture.sampleLevelArrayCubeSeamlessCompare(this.m_levels, this.m_numLevels, coords.face, sampler, ref, coords.s, coords.t, lod);
+ else
+ return tcuTexture.sampleLevelArray2DCompare(this.m_levels[coords.face], this.m_numLevels, sampler, ref, coords.s, coords.t, lod, [0, 0, 0]);
+};
+
+/**
+ * @param {tcuTexture.CubeFace} face
+ * @return {Array<tcuTexture.ConstPixelBufferAccess>}
+ */
+tcuTexture.TextureCubeView.prototype.getFaceLevels = function(face) { return this.m_levels[face]; };
+/** @return {number} */
+tcuTexture.TextureCubeView.prototype.getSize = function() { return this.m_numLevels > 0 ? this.m_levels[0][0].getWidth() : 0; };
+
+/** @return {number} */
+tcuTexture.TextureCubeView.prototype.getNumLevels = function() { return this.m_numLevels; };
+
+/**
+ * @param {number} ndx
+ * @param {tcuTexture.CubeFace} face
+ * @return {tcuTexture.ConstPixelBufferAccess}
+ */
+tcuTexture.TextureCubeView.prototype.getLevelFace = function(ndx, face) {
+ assertMsgOptions(0 <= ndx && ndx < this.m_numLevels, '', false, true);
+ return this.m_levels[face][ndx];
+};
+
+/**
+ * @param {number} baseLevel
+ * @param {number} maxLevel
+ * @return {tcuTexture.TextureCubeView}
+ */
+tcuTexture.TextureCubeView.prototype.getSubView = function(baseLevel, maxLevel) {
+ var clampedBase = deMath.clamp(baseLevel, 0, this.m_numLevels - 1);
+ var clampedMax = deMath.clamp(maxLevel, clampedBase, this.m_numLevels - 1);
+ var numLevels = clampedMax - clampedBase + 1;
+ var levels = [];
+ for (var face in tcuTexture.CubeFace)
+ levels.push(this.getFaceLevels(tcuTexture.CubeFace[face]).slice(clampedBase, numLevels));
+
+ return new tcuTexture.TextureCubeView(numLevels, levels);
+};
+
+/**
+ * @constructor
+ * @param {tcuTexture.TextureFormat} format
+ * @param {number} size
+ */
+tcuTexture.TextureCube = function(format, size) {
+ this.m_format = format;
+ this.m_size = size;
+ this.m_data = [];
+ this.m_data.length = Object.keys(tcuTexture.CubeFace).length;
+ this.m_access = [];
+ this.m_access.length = Object.keys(tcuTexture.CubeFace).length;
+
+ var numLevels = tcuTexture.computeMipPyramidLevels(this.m_size);
+ var levels = [];
+ levels.length = Object.keys(tcuTexture.CubeFace).length;
+
+ for (var face in tcuTexture.CubeFace) {
+ this.m_data[tcuTexture.CubeFace[face]] = [];
+ for (var i = 0; i < numLevels; i++)
+ this.m_data[tcuTexture.CubeFace[face]].push(new tcuTexture.DeqpArrayBuffer());
+ this.m_access[tcuTexture.CubeFace[face]] = [];
+ this.m_access[tcuTexture.CubeFace[face]].length = numLevels;
+ levels[tcuTexture.CubeFace[face]] = this.m_access[tcuTexture.CubeFace[face]];
+ }
+
+ this.m_view = new tcuTexture.TextureCubeView(numLevels, levels);
+};
+
+/** @return {tcuTexture.TextureFormat} */
+tcuTexture.TextureCube.prototype.getFormat = function() { return this.m_format; };
+/** @return {number} */
+tcuTexture.TextureCube.prototype.getSize = function() { return this.m_size; };
+/** @return {tcuTexture.TextureCubeView} */
+tcuTexture.TextureCube.prototype.getView = function() { return this.m_view; };
+/**
+ * @param {number} ndx Level index
+ * @param {tcuTexture.CubeFace} face
+ * @return {tcuTexture.PixelBufferAccess}
+ */
+tcuTexture.TextureCube.prototype.getLevelFace = function(ndx, face) { return this.m_access[face][ndx]; };
+/** @return {number} */
+tcuTexture.TextureCube.prototype.getNumLevels = function() { return this.m_access[0].length; };
+
+/**
+ * @param {tcuTexture.Sampler} sampler
+ * @param {Array<number>} texCoord
+ * @param {number} lod
+ * @return {Array<number>} Pixel color
+ */
+tcuTexture.TextureCube.prototype.sample = function(sampler, texCoord, lod) {
+ return this.m_view.sample(sampler, texCoord, lod);
+};
+
+/**
+ * @param {number} baseLevel
+ * @param {number} maxLevel
+ * @return {tcuTexture.TextureCubeView}
+ */
+tcuTexture.TextureCube.prototype.getSubView = function(baseLevel, maxLevel) { return this.m_view.getSubView(baseLevel, maxLevel); };
+
+/**
+ * @param {tcuTexture.CubeFace} face
+ * @param {number} levelNdx
+ * @return {boolean}
+ */
+tcuTexture.TextureCube.prototype.isLevelEmpty = function(face, levelNdx) {
+ return this.m_data[face][levelNdx].empty();
+};
+
+/**
+ * @param {tcuTexture.CubeFace} face
+ * @param {number} levelNdx
+ */
+tcuTexture.TextureCube.prototype.allocLevel = function(face, levelNdx) {
+ /** @const */ var size = tcuTexture.getMipPyramidLevelSize(this.m_size, levelNdx);
+ /** @const*/ var dataSize = this.m_format.getPixelSize() * size * size;
+ DE_ASSERT(this.isLevelEmpty(face, levelNdx));
+
+ this.m_data[face][levelNdx].setStorage(dataSize);
+ this.m_access[face][levelNdx] = new tcuTexture.PixelBufferAccess({
+ format: this.m_format,
+ width: size,
+ height: size,
+ depth: 1,
+ data: this.m_data[face][levelNdx].m_ptr
+ });
+};
+
+/**
+ * @param {Array<number>} coords Cube coordinates
+ * @return {tcuTexture.CubeFace}
+ */
+tcuTexture.selectCubeFace = function(coords) {
+ var x = coords[0];
+ var y = coords[1];
+ var z = coords[2];
+ var ax = Math.abs(x);
+ var ay = Math.abs(y);
+ var az = Math.abs(z);
+
+ if (ay < ax && az < ax)
+ return x >= 0 ? tcuTexture.CubeFace.CUBEFACE_POSITIVE_X : tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X;
+ else if (ax < ay && az < ay)
+ return y >= 0 ? tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y : tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y;
+ else if (ax < az && ay < az)
+ return z >= 0 ? tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z : tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z;
+ else {
+ // Some of the components are equal. Use tie-breaking rule.
+ if (ax == ay) {
+ if (ax < az)
+ return z >= 0 ? tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z : tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z;
+ else
+ return x >= 0 ? tcuTexture.CubeFace.CUBEFACE_POSITIVE_X : tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X;
+ } else if (ax == az) {
+ if (az < ay)
+ return y >= 0 ? tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y : tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y;
+ else
+ return z >= 0 ? tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z : tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z;
+ } else if (ay == az) {
+ if (ay < ax)
+ return x >= 0 ? tcuTexture.CubeFace.CUBEFACE_POSITIVE_X : tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X;
+ else
+ return y >= 0 ? tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y : tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y;
+ } else
+ return x >= 0 ? tcuTexture.CubeFace.CUBEFACE_POSITIVE_X : tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X;
+ }
+};
+
+/**
+ * @param {tcuTexture.CubeFace} face
+ * @param {Array<number>} coord Cube coordinates (Vec3)
+ * @return {Array<number>} face coordinates (Vec2)
+ */
+tcuTexture.projectToFace = function(face, coord) {
+ var rx = coord[0];
+ var ry = coord[1];
+ var rz = coord[2];
+ var sc = 0;
+ var tc = 0;
+ var ma = 0;
+
+ switch (face) {
+ case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X: sc = +rz; tc = -ry; ma = -rx; break;
+ case tcuTexture.CubeFace.CUBEFACE_POSITIVE_X: sc = -rz; tc = -ry; ma = +rx; break;
+ case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y: sc = +rx; tc = -rz; ma = -ry; break;
+ case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y: sc = +rx; tc = +rz; ma = +ry; break;
+ case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z: sc = -rx; tc = -ry; ma = -rz; break;
+ case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z: sc = +rx; tc = -ry; ma = +rz; break;
+ default:
+ throw new Error('Unrecognized face ' + face);
+ }
+
+ // Compute s, t
+ var s = ((sc / ma) + 1) / 2;
+ var t = ((tc / ma) + 1) / 2;
+
+ return [s, t];
+};
+
+/**
+ * @constructor
+ * @param {tcuTexture.TextureFormat} format
+ * @param {number=} width
+ * @param {number=} height
+ * @param {number=} depth
+ */
+tcuTexture.TextureLevel = function(format, width, height, depth) {
+ this.m_format = format;
+ this.m_width = width || 0;
+ this.m_height = height || 0;
+ this.m_depth = depth === undefined ? 1 : depth;
+ this.m_data = new tcuTexture.DeqpArrayBuffer();
+ this.setSize(this.m_width, this.m_height, this.m_depth);
+};
+
+tcuTexture.TextureLevel.prototype.constructor = tcuTexture.TextureLevel;
+
+/**
+ * @param {tcuTexture.TextureFormat} format
+ * @param {number=} width
+ * @param {number=} height
+ * @param {number=} depth
+ */
+tcuTexture.TextureLevel.prototype.setStorage = function(format, width, height, depth) {
+ this.m_format = format;
+ this.setSize(width, height, depth);
+};
+
+/**
+ * @param {number=} width
+ * @param {number=} height
+ * @param {number=} depth
+ */
+tcuTexture.TextureLevel.prototype.setSize = function(width, height, depth) {
+ var pixelSize = this.m_format.getPixelSize();
+
+ this.m_width = width || 0;
+ this.m_height = height || 0;
+ this.m_depth = depth === undefined ? 1 : depth;
+
+ this.m_data.setStorage(this.m_width * this.m_height * this.m_depth * pixelSize);
+};
+
+/**
+ * @return {tcuTexture.PixelBufferAccess}
+ */
+tcuTexture.TextureLevel.prototype.getAccess = function() {
+ return new tcuTexture.PixelBufferAccess({
+ format: this.m_format,
+ width: this.m_width,
+ height: this.m_height,
+ depth: this.m_depth,
+ data: this.m_data.m_ptr
+ });
+
+};
+
+/**
+ * @return {number}
+ */
+tcuTexture.TextureLevel.prototype.getWidth = function() {
+ return this.m_width;
+};
+
+/**
+ * @return {number}
+ */
+tcuTexture.TextureLevel.prototype.getHeight = function() {
+ return this.m_height;
+};
+
+/**
+ * @return {number}
+ */
+tcuTexture.TextureLevel.prototype.getDepth = function() {
+ return this.m_depth;
+};
+
+/**
+ * @return {?tcuTexture.TextureFormat}
+ */
+tcuTexture.TextureLevel.prototype.getFormat = function() {
+ return this.m_format;
+};
+
+/**
+ * Checks if origCoords.coords is in bounds defined by size; if not, return a CubeFaceCoords with face set to the appropriate neighboring face and coords transformed accordingly.
+ * \note If both x and y in origCoords.coords are out of bounds, this returns with face CUBEFACE_LAST, signifying that there is no unique neighboring face.
+ * @param {tcuTexture.CubeFaceCoords} origCoords
+ * @param {number} size
+ * @return {tcuTexture.CubeFaceCoords}
+ */
+tcuTexture.remapCubeEdgeCoords = function(origCoords, size) {
+ var uInBounds = deMath.deInBounds32(origCoords.s, 0, size);
+ var vInBounds = deMath.deInBounds32(origCoords.t, 0, size);
+
+ if (uInBounds && vInBounds)
+ return origCoords;
+
+ if (!uInBounds && !vInBounds)
+ return null;
+
+ var coords = [
+ tcuTexture.wrap(tcuTexture.WrapMode.CLAMP_TO_BORDER, origCoords.s, size),
+ tcuTexture.wrap(tcuTexture.WrapMode.CLAMP_TO_BORDER, origCoords.t, size)];
+ var canonizedCoords = [];
+
+ // Map the uv coordinates to canonized 3d coordinates.
+
+ switch (origCoords.face) {
+ case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X: canonizedCoords = [0, size - 1 - coords[1], coords[0]]; break;
+ case tcuTexture.CubeFace.CUBEFACE_POSITIVE_X: canonizedCoords = [size - 1, size - 1 - coords[1], size - 1 - coords[0]]; break;
+ case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y: canonizedCoords = [coords[0], 0, size - 1 - coords[1]]; break;
+ case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y: canonizedCoords = [coords[0], size - 1, coords[1]]; break;
+ case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z: canonizedCoords = [size - 1 - coords[0], size - 1 - coords[1], 0]; break;
+ case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z: canonizedCoords = [coords[0], size - 1 - coords[1], size - 1]; break;
+ default: throw new Error('Invalid cube face:' + origCoords.face);
+ }
+
+ // Find an appropriate face to re-map the coordinates to.
+
+ if (canonizedCoords[0] == -1)
+ return new tcuTexture.CubeFaceCoords(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X, [canonizedCoords[2], size - 1 - canonizedCoords[1]]);
+
+ if (canonizedCoords[0] == size)
+ return new tcuTexture.CubeFaceCoords(tcuTexture.CubeFace.CUBEFACE_POSITIVE_X, [size - 1 - canonizedCoords[2], size - 1 - canonizedCoords[1]]);
+
+ if (canonizedCoords[1] == -1)
+ return new tcuTexture.CubeFaceCoords(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y, [canonizedCoords[0], size - 1 - canonizedCoords[2]]);
+
+ if (canonizedCoords[1] == size)
+ return new tcuTexture.CubeFaceCoords(tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y, [canonizedCoords[0], canonizedCoords[2]]);
+
+ if (canonizedCoords[2] == -1)
+ return new tcuTexture.CubeFaceCoords(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z, [size - 1 - canonizedCoords[0], size - 1 - canonizedCoords[1]]);
+
+ if (canonizedCoords[2] == size)
+ return new tcuTexture.CubeFaceCoords(tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z, [canonizedCoords[0], size - 1 - canonizedCoords[1]]);
+
+ throw new Error('Cannot remap cube coordinates');
+};
+
+/**
+ * @constructor
+ * @param {tcuTexture.ConstPixelBufferAccess} src
+ */
+tcuTexture.RGBA8View = function(src) {
+ this.src = src;
+ this.data = new Uint8Array(src.getBuffer(), src.m_offset);
+ this.stride = src.getRowPitch();
+ this.width = src.getWidth();
+ this.height = src.getHeight();
+ this.pixelSize = src.getFormat().getPixelSize();
+};
+
+/**
+ * @return {tcuTexture.TextureFormat}
+ */
+tcuTexture.RGBA8View.prototype.getFormat = function() { return this.src.getFormat(); };
+
+/**
+ * Read a pixel
+ * @param {number} x
+ * @param {number} y
+ * @param {number=} numChannels
+ * @return {Array<number>}
+ */
+tcuTexture.RGBA8View.prototype.read = function(x, y, numChannels) {
+ numChannels = numChannels || 4;
+ var offset = y * this.stride + x * this.pixelSize;
+ /* Always return a vec4 */
+ var result = [0, 0, 0, 255];
+ for (var i = 0; i < numChannels; i++)
+ result[i] = this.data[offset + i];
+ return result;
+};
+
+/**
+ * Read a pixel into a Uint32
+ * @param {number} x
+ * @param {number} y
+ * @return {number}
+ */
+tcuTexture.RGBA8View.prototype.readUintRGBA8 = function(x, y) {
+ var offset = y * this.stride + x * this.pixelSize;
+ return ((this.data[offset] & 0xff) << 24) +
+ ((this.data[offset + 1] & 0xff) << 16) +
+ ((this.data[offset + 2] & 0xff) << 8) +
+ (this.data[offset + 3] & 0xff);
+};
+
+/**
+ * Write a pixel
+ * @param {number} x
+ * @param {number} y
+ * @param {Array<number>} value
+ * @param {number=} numChannels
+ */
+tcuTexture.RGBA8View.prototype.write = function(x, y, value, numChannels) {
+ numChannels = numChannels || 4;
+ var offset = y * this.stride + x * this.pixelSize;
+ for (var i = 0; i < numChannels; i++)
+ this.data[offset + i] = value[i];
+};
+
+tcuTexture.RGBA8View.prototype.getWidth = function() { return this.width; };
+
+tcuTexture.RGBA8View.prototype.getHeight = function() { return this.height; };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTextureUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTextureUtil.js
new file mode 100644
index 0000000000..40450ab380
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/common/tcuTextureUtil.js
@@ -0,0 +1,725 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a tcuTextureUtil.copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.common.tcuTextureUtil');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+
+goog.scope(function() {
+
+var tcuTextureUtil = framework.common.tcuTextureUtil;
+var tcuTexture = framework.common.tcuTexture;
+var deMath = framework.delibs.debase.deMath;
+var deRandom = framework.delibs.debase.deRandom;
+
+var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+};
+
+/**
+ * @param {number} t
+ * @param {number} minVal
+ * @param {number} maxVal
+ * @return {number}
+ */
+tcuTextureUtil.linearInterpolate = function(t, minVal, maxVal) {
+ return minVal + (maxVal - minVal) * t;
+};
+
+/** tcuTextureUtil.linearChannelToSRGB
+ * @param {number} cl
+ * @return {number}
+ */
+tcuTextureUtil.linearChannelToSRGB = function(cl) {
+ if (cl <= 0.0)
+ return 0.0;
+ else if (cl < 0.0031308)
+ return 12.92 * cl;
+ else if (cl < 1.0)
+ return 1.055 * Math.pow(cl, 0.41666) - 0.055;
+ else
+ return 1.0;
+};
+
+/**
+ * Convert sRGB to linear colorspace
+ * @param {Array<number>} cs
+ * @return {Array<number>}
+ */
+tcuTextureUtil.sRGBToLinear = function(cs) {
+ return [tcuTextureUtil.sRGBChannelToLinear(cs[0]),
+ tcuTextureUtil.sRGBChannelToLinear(cs[1]),
+ tcuTextureUtil.sRGBChannelToLinear(cs[2]),
+ cs[3]];
+};
+
+/**
+ * @param {number} cs
+ * @return {number}
+ */
+ tcuTextureUtil.sRGBChannelToLinear = function(cs) {
+ if (cs <= 0.04045)
+ return cs / 12.92;
+ else
+ return Math.pow((cs + 0.055) / 1.055, 2.4);
+};
+
+/** tcuTextureUtil.linearToSRGB
+ * @param {Array<number>} cl
+ * @return {Array<number>}
+ */
+tcuTextureUtil.linearToSRGB = function(cl) {
+ return [tcuTextureUtil.linearChannelToSRGB(cl[0]),
+ tcuTextureUtil.linearChannelToSRGB(cl[1]),
+ tcuTextureUtil.linearChannelToSRGB(cl[2]),
+ cl[3]
+ ];
+};
+
+/**
+ * tcuTextureUtil.getSubregion
+ * @param {tcuTexture.PixelBufferAccess} access
+ * @param {number} x
+ * @param {number} y
+ * @param {number} z
+ * @param {number} width
+ * @param {number} height
+ * @param {number} depth
+ * @return {tcuTexture.PixelBufferAccess}
+ */
+tcuTextureUtil.getSubregion = function(access, x, y, z, width, height, depth) {
+
+ DE_ASSERT(deMath.deInBounds32(x, 0, access.getWidth()) && deMath.deInRange32(x + width, x, access.getWidth()));
+ DE_ASSERT(deMath.deInBounds32(y, 0, access.getHeight()) && deMath.deInRange32(y + height, y, access.getHeight()));
+ DE_ASSERT(deMath.deInBounds32(z, 0, access.getDepth()) && deMath.deInRange32(z + depth, z, access.getDepth()));
+
+ return new tcuTexture.PixelBufferAccess({
+ format: access.getFormat(),
+ width: width,
+ height: height,
+ depth: depth,
+ rowPitch: access.getRowPitch(),
+ slicePitch: access.getSlicePitch(),
+ offset: access.m_offset + access.getFormat().getPixelSize() * x + access.getRowPitch() * y + access.getSlicePitch() * z,
+ data: access.getBuffer()
+ });
+};
+
+/**
+ * @param {tcuTexture.PixelBufferAccess} access
+ * @param {Array<number>} minVal
+ * @param {Array<number>} maxVal
+ */
+tcuTextureUtil.fillWithComponentGradients1D = function(access, minVal, maxVal) {
+ DE_ASSERT(access.getHeight() == 1);
+ for (var x = 0; x < access.getWidth(); x++) {
+ var s = (x + 0.5) / access.getWidth();
+
+ var r = tcuTextureUtil.linearInterpolate(s, minVal[0], maxVal[0]);
+ var g = tcuTextureUtil.linearInterpolate(s, minVal[1], maxVal[1]);
+ var b = tcuTextureUtil.linearInterpolate(s, minVal[2], maxVal[2]);
+ var a = tcuTextureUtil.linearInterpolate(s, minVal[3], maxVal[3]);
+
+ access.setPixel([r, g, b, a], x, 0);
+ }
+};
+
+/**
+ * @param {tcuTexture.PixelBufferAccess} access
+ * @param {Array<number>} minVal
+ * @param {Array<number>} maxVal
+ */
+tcuTextureUtil.fillWithComponentGradients2D = function(access, minVal, maxVal) {
+ for (var y = 0; y < access.getHeight(); y++) {
+ var t = (y + 0.5) / access.getHeight();
+ for (var x = 0; x < access.getWidth(); x++) {
+ var s = (x + 0.5) / access.getWidth();
+
+ var r = tcuTextureUtil.linearInterpolate((s + t) * 0.5, minVal[0], maxVal[0]);
+ var g = tcuTextureUtil.linearInterpolate((s + (1 - t)) * 0.5, minVal[1], maxVal[1]);
+ var b = tcuTextureUtil.linearInterpolate(((1 - s) + t) * 0.5, minVal[2], maxVal[2]);
+ var a = tcuTextureUtil.linearInterpolate(((1 - s) + (1 - t)) * 0.5, minVal[3], maxVal[3]);
+
+ access.setPixel([r, g, b, a], x, y);
+ }
+ }
+};
+
+/**
+ * @param {tcuTexture.PixelBufferAccess} dst
+ * @param {Array<number>} minVal
+ * @param {Array<number>} maxVal
+ */
+tcuTextureUtil.fillWithComponentGradients3D = function(dst, minVal, maxVal) {
+ for (var z = 0; z < dst.getDepth(); z++) {
+ var p = (z + 0.5) / dst.getDepth();
+ var b = tcuTextureUtil.linearInterpolate(p, minVal[2], maxVal[2]);
+ for (var y = 0; y < dst.getHeight(); y++) {
+ var t = (y + 0.5) / dst.getHeight();
+ var g = tcuTextureUtil.linearInterpolate(t, minVal[1], maxVal[1]);
+ for (var x = 0; x < dst.getWidth(); x++) {
+ var s = (x + 0.5) / dst.getWidth();
+ var r = tcuTextureUtil.linearInterpolate(s, minVal[0], maxVal[0]);
+ var a = tcuTextureUtil.linearInterpolate(1 - (s + t + p) / 3, minVal[3], maxVal[3]);
+ dst.setPixel([r, g, b, a], x, y, z);
+ }
+ }
+ }
+};
+
+/**
+ * @param {tcuTexture.PixelBufferAccess} access
+ * @param {Array<number>} minVal
+ * @param {Array<number>} maxVal
+ */
+tcuTextureUtil.fillWithComponentGradients = function(access, minVal, maxVal) {
+ if (access.getHeight() == 1 && access.getDepth() == 1)
+ tcuTextureUtil.fillWithComponentGradients1D(access, minVal, maxVal);
+ else if (access.getDepth() == 1)
+ tcuTextureUtil.fillWithComponentGradients2D(access, minVal, maxVal);
+ else
+ tcuTextureUtil.fillWithComponentGradients3D(access, minVal, maxVal);
+};
+
+/**
+ * @param {tcuTexture.PixelBufferAccess} dst
+ */
+tcuTextureUtil.fillWithRGBAQuads = function(dst) {
+ checkMessage(dst.getDepth() == 1, 'Depth must be 1');
+ var width = dst.getWidth();
+ var height = dst.getHeight();
+ var left = width / 2;
+ var top = height / 2;
+
+ tcuTextureUtil.getSubregion(dst, 0, 0, 0, left, top, 1).clear([1.0, 0.0, 0.0, 1.0]);
+ tcuTextureUtil.getSubregion(dst, left, 0, 0, width - left, top, 1).clear([0.0, 1.0, 0.0, 1.0]);
+ tcuTextureUtil.getSubregion(dst, 0, top, 0, left, height - top, 1).clear([0.0, 0.0, 1.0, 0.0]);
+ tcuTextureUtil.getSubregion(dst, left, top, 0, width - left, height - top, 1).clear([0.5, 0.5, 0.5, 1.0]);
+};
+
+// \todo [2012-11-13 pyry] There is much better metaballs code in CL SIR value generators.
+/**
+ * @param {tcuTexture.PixelBufferAccess} dst
+ * @param {number} numBalls
+ * @param {number} seed
+ */
+tcuTextureUtil.fillWithMetaballs = function(dst, numBalls, seed) {
+ checkMessage(dst.getDepth() == 1, 'Depth must be 1');
+ var points = [];
+ var rnd = new deRandom.Random(seed);
+
+ for (var i = 0; i < numBalls; i++) {
+ var x = rnd.getFloat();
+ var y = rnd.getFloat();
+ points[i] = [x, y];
+ }
+
+ for (var y = 0; y < dst.getHeight(); y++)
+ for (var x = 0; x < dst.getWidth(); x++) {
+ var p = [x / dst.getWidth(), y / dst.getHeight()];
+
+ var sum = 0.0;
+ for (var pointNdx = 0; pointNdx < points.length; pointNdx++) {
+ var d = deMath.subtract(p, points[pointNdx]);
+ var f = 0.01 / (d[0] * d[0] + d[1] * d[1]);
+
+ sum += f;
+ }
+
+ dst.setPixel([sum, sum, sum, sum], x, y);
+ }
+};
+
+/**
+ * Create tcuTextureUtil.TextureFormatInfo.
+ * @constructor
+ * @param {Array<number>} valueMin
+ * @param {Array<number>} valueMax
+ * @param {Array<number>} lookupScale
+ * @param {Array<number>} lookupBias
+ */
+tcuTextureUtil.TextureFormatInfo = function(valueMin, valueMax, lookupScale, lookupBias) {
+ /** @type {Array<number>} */ this.valueMin = valueMin;
+ /** @type {Array<number>} */ this.valueMax = valueMax;
+ /** @type {Array<number>} */ this.lookupScale = lookupScale;
+ /** @type {Array<number>} */ this.lookupBias = lookupBias;
+};
+
+/**
+ * @param {?tcuTexture.ChannelType} channelType
+ * @return {Array<number>}
+ */
+tcuTextureUtil.getChannelValueRange = function(channelType) {
+ var cMin = 0;
+ var cMax = 0;
+
+ switch (channelType) {
+ // Signed normalized formats.
+ case tcuTexture.ChannelType.SNORM_INT8:
+ case tcuTexture.ChannelType.SNORM_INT16: cMin = -1; cMax = 1; break;
+
+ // Unsigned normalized formats.
+ case tcuTexture.ChannelType.UNORM_INT8:
+ case tcuTexture.ChannelType.UNORM_INT16:
+ case tcuTexture.ChannelType.UNORM_SHORT_565:
+ case tcuTexture.ChannelType.UNORM_SHORT_4444:
+ case tcuTexture.ChannelType.UNORM_INT_101010:
+ case tcuTexture.ChannelType.UNORM_INT_1010102_REV: cMin = 0; cMax = 1; break;
+
+ // Misc formats.
+ case tcuTexture.ChannelType.SIGNED_INT8: cMin = -128; cMax = 127; break;
+ case tcuTexture.ChannelType.SIGNED_INT16: cMin = -32768; cMax = 32767; break;
+ case tcuTexture.ChannelType.SIGNED_INT32: cMin = -2147483648; cMax = 2147483647; break;
+ case tcuTexture.ChannelType.UNSIGNED_INT8: cMin = 0; cMax = 255; break;
+ case tcuTexture.ChannelType.UNSIGNED_INT16: cMin = 0; cMax = 65535; break;
+ case tcuTexture.ChannelType.UNSIGNED_INT32: cMin = 0; cMax = 4294967295; break;
+ case tcuTexture.ChannelType.HALF_FLOAT: cMin = -1e3; cMax = 1e3; break;
+ case tcuTexture.ChannelType.FLOAT: cMin = -1e5; cMax = 1e5; break;
+ case tcuTexture.ChannelType.UNSIGNED_INT_11F_11F_10F_REV: cMin = 0; cMax = 1e4; break;
+ case tcuTexture.ChannelType.UNSIGNED_INT_999_E5_REV: cMin = 0; cMax = 1e5; break;
+
+ default:
+ DE_ASSERT(false);
+ }
+
+ return [cMin, cMax];
+};
+
+/**
+ * Creates an array by choosing between 'a' and 'b' based on 'cond' array.
+ * @param {Array | number} a
+ * @param {Array | number} b
+ * @param {Array<boolean>} cond Condtions
+ * @return {Array}
+ */
+tcuTextureUtil.select = function(a, b, cond) {
+
+ /*DE_ASSERT(!(a.length && !b.length)
+ || !(!a.length && b.length)
+ || !((a.length && b.length) && ((a.length != b.length) || (b.length != cond.length) || (a.length != cond.length))));*/
+
+ if (a.length && !b.length) throw new Error('second input parameter is not a vector');
+ if (!a.length && b.length) throw new Error('first input parameter is not a vector');
+ if ((a.length && b.length) && ((a.length != b.length) || (b.length != cond.length) || (a.length != cond.length))) throw new Error('different size vectors');
+
+ var dst = [];
+ for (var i = 0; i < cond.length; i++)
+ if (cond[i]) {
+ if (a.length) dst.push(a[i]);
+ else dst.push(a);
+ } else {
+ if (b.length) dst.push(b[i]);
+ else dst.push(b);
+ }
+ return dst;
+};
+
+/**
+ * Get standard parameters for testing texture format
+ *
+ * Returns tcuTextureUtil.TextureFormatInfo that describes good parameters for exercising
+ * given TextureFormat. Parameters include value ranges per channel and
+ * suitable lookup scaling and bias in order to reduce result back to
+ * 0..1 range.
+ *
+ * @param {tcuTexture.TextureFormat} format
+ * @return {tcuTextureUtil.TextureFormatInfo}
+ */
+tcuTextureUtil.getTextureFormatInfo = function(format) {
+ // Special cases.
+ if (format.isEqual(new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV)))
+ return new tcuTextureUtil.TextureFormatInfo([0, 0, 0, 0],
+ [1023, 1023, 1023, 3],
+ [1 / 1023, 1 / 1023, 1 / 1023, 1 / 3],
+ [0, 0, 0, 0]);
+ else if (format.order == tcuTexture.ChannelOrder.D || format.order == tcuTexture.ChannelOrder.DS)
+ return new tcuTextureUtil.TextureFormatInfo([0, 0, 0, 0],
+ [1, 1, 1, 0],
+ [1, 1, 1, 1],
+ [0, 0, 0, 0]); // Depth / stencil formats.
+ else if (format.isEqual(new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_SHORT_5551)))
+ return new tcuTextureUtil.TextureFormatInfo([0, 0, 0, 0.5],
+ [1, 1, 1, 1.5],
+ [1, 1, 1, 1],
+ [0, 0, 0, 0]);
+
+ var cRange = tcuTextureUtil.getChannelValueRange(format.type);
+ var chnMask = null;
+
+ switch (format.order) {
+ case tcuTexture.ChannelOrder.R: chnMask = [true, false, false, false]; break;
+ case tcuTexture.ChannelOrder.A: chnMask = [false, false, false, true]; break;
+ case tcuTexture.ChannelOrder.L: chnMask = [true, true, true, false]; break;
+ case tcuTexture.ChannelOrder.LA: chnMask = [true, true, true, true]; break;
+ case tcuTexture.ChannelOrder.RG: chnMask = [true, true, false, false]; break;
+ case tcuTexture.ChannelOrder.RGB: chnMask = [true, true, true, false]; break;
+ case tcuTexture.ChannelOrder.RGBA: chnMask = [true, true, true, true]; break;
+ case tcuTexture.ChannelOrder.sRGB: chnMask = [true, true, true, false]; break;
+ case tcuTexture.ChannelOrder.sRGBA: chnMask = [true, true, true, true]; break;
+ case tcuTexture.ChannelOrder.D: chnMask = [true, true, true, false]; break;
+ case tcuTexture.ChannelOrder.DS: chnMask = [true, true, true, true]; break;
+ default:
+ DE_ASSERT(false);
+ }
+
+ var scale = 1 / (cRange[1] - cRange[0]);
+ var bias = -cRange[0] * scale;
+
+ return new tcuTextureUtil.TextureFormatInfo(tcuTextureUtil.select(cRange[0], 0, chnMask),
+ tcuTextureUtil.select(cRange[1], 0, chnMask),
+ tcuTextureUtil.select(scale, 1, chnMask),
+ tcuTextureUtil.select(bias, 0, chnMask));
+};
+
+/** tcuTextureUtil.getChannelBitDepth
+ * @param {?tcuTexture.ChannelType} channelType
+ * @return {Array<number>}
+ */
+tcuTextureUtil.getChannelBitDepth = function(channelType) {
+
+ switch (channelType) {
+ case tcuTexture.ChannelType.SNORM_INT8: return [8, 8, 8, 8];
+ case tcuTexture.ChannelType.SNORM_INT16: return [16, 16, 16, 16];
+ case tcuTexture.ChannelType.SNORM_INT32: return [32, 32, 32, 32];
+ case tcuTexture.ChannelType.UNORM_INT8: return [8, 8, 8, 8];
+ case tcuTexture.ChannelType.UNORM_INT16: return [16, 16, 16, 16];
+ case tcuTexture.ChannelType.UNORM_INT32: return [32, 32, 32, 32];
+ case tcuTexture.ChannelType.UNORM_SHORT_565: return [5, 6, 5, 0];
+ case tcuTexture.ChannelType.UNORM_SHORT_4444: return [4, 4, 4, 4];
+ case tcuTexture.ChannelType.UNORM_SHORT_555: return [5, 5, 5, 0];
+ case tcuTexture.ChannelType.UNORM_SHORT_5551: return [5, 5, 5, 1];
+ case tcuTexture.ChannelType.UNORM_INT_101010: return [10, 10, 10, 0];
+ case tcuTexture.ChannelType.UNORM_INT_1010102_REV: return [10, 10, 10, 2];
+ case tcuTexture.ChannelType.SIGNED_INT8: return [8, 8, 8, 8];
+ case tcuTexture.ChannelType.SIGNED_INT16: return [16, 16, 16, 16];
+ case tcuTexture.ChannelType.SIGNED_INT32: return [32, 32, 32, 32];
+ case tcuTexture.ChannelType.UNSIGNED_INT8: return [8, 8, 8, 8];
+ case tcuTexture.ChannelType.UNSIGNED_INT16: return [16, 16, 16, 16];
+ case tcuTexture.ChannelType.UNSIGNED_INT32: return [32, 32, 32, 32];
+ case tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV: return [10, 10, 10, 2];
+ case tcuTexture.ChannelType.UNSIGNED_INT_24_8: return [24, 0, 0, 8];
+ case tcuTexture.ChannelType.HALF_FLOAT: return [16, 16, 16, 16];
+ case tcuTexture.ChannelType.FLOAT: return [32, 32, 32, 32];
+ case tcuTexture.ChannelType.UNSIGNED_INT_11F_11F_10F_REV: return [11, 11, 10, 0];
+ case tcuTexture.ChannelType.UNSIGNED_INT_999_E5_REV: return [9, 9, 9, 0];
+ case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV: return [32, 0, 0, 8];
+ default:
+ DE_ASSERT(false);
+ return [0, 0, 0, 0];
+ }
+};
+
+/** tcuTextureUtil.getTextureFormatBitDepth
+ * @param {tcuTexture.TextureFormat} format
+ * @return {Array<number>}
+ */
+tcuTextureUtil.getTextureFormatBitDepth = function(format) {
+
+ /** @type {Array<number>} */ var chnBits = tcuTextureUtil.getChannelBitDepth(format.type); // IVec4
+ /** @type {Array<boolean>} */ var chnMask = [false, false, false, false]; // BVec4
+ /** @type {Array<number>} */ var chnSwz = [0, 1, 2, 3]; // IVec4
+
+ switch (format.order) {
+ case tcuTexture.ChannelOrder.R: chnMask = [true, false, false, false]; break;
+ case tcuTexture.ChannelOrder.A: chnMask = [false, false, false, true]; break;
+ case tcuTexture.ChannelOrder.RA: chnMask = [true, false, false, true]; break;
+ case tcuTexture.ChannelOrder.L: chnMask = [true, true, true, false]; break;
+ case tcuTexture.ChannelOrder.I: chnMask = [true, true, true, true]; break;
+ case tcuTexture.ChannelOrder.LA: chnMask = [true, true, true, true]; break;
+ case tcuTexture.ChannelOrder.RG: chnMask = [true, true, false, false]; break;
+ case tcuTexture.ChannelOrder.RGB: chnMask = [true, true, true, false]; break;
+ case tcuTexture.ChannelOrder.RGBA: chnMask = [true, true, true, true]; break;
+ case tcuTexture.ChannelOrder.BGRA: chnMask = [true, true, true, true]; chnSwz = [2, 1, 0, 3]; break;
+ case tcuTexture.ChannelOrder.ARGB: chnMask = [true, true, true, true]; chnSwz = [1, 2, 3, 0]; break;
+ case tcuTexture.ChannelOrder.sRGB: chnMask = [true, true, true, false]; break;
+ case tcuTexture.ChannelOrder.sRGBA: chnMask = [true, true, true, true]; break;
+ case tcuTexture.ChannelOrder.D: chnMask = [true, false, false, false]; break;
+ case tcuTexture.ChannelOrder.DS: chnMask = [true, false, false, true]; break;
+ case tcuTexture.ChannelOrder.S: chnMask = [false, false, false, true]; break;
+ default:
+ DE_ASSERT(false);
+ }
+
+ return tcuTextureUtil.select(deMath.swizzle(chnBits, [chnSwz[0], chnSwz[1], chnSwz[2], chnSwz[3]]), [0, 0, 0, 0], chnMask);
+
+};
+
+/** tcuTextureUtil.fillWithGrid
+ * @const @param {tcuTexture.PixelBufferAccess} access
+ * @param {number} cellSize
+ * @param {Array<number>} colorA
+ * @param {Array<number>} colorB
+ */
+tcuTextureUtil.fillWithGrid = function(access, cellSize, colorA, colorB) {
+ if (access.getHeight() == 1 && access.getDepth() == 1)
+ tcuTextureUtil.fillWithGrid1D(access, cellSize, colorA, colorB);
+ else if (access.getDepth() == 1)
+ tcuTextureUtil.fillWithGrid2D(access, cellSize, colorA, colorB);
+ else
+ tcuTextureUtil.fillWithGrid3D(access, cellSize, colorA, colorB);
+};
+
+/** tcuTextureUtil.fillWithGrid1D
+ * @const @param {tcuTexture.PixelBufferAccess} access
+ * @param {number} cellSize
+ * @param {Array<number>} colorA
+ * @param {Array<number>} colorB
+ */
+tcuTextureUtil.fillWithGrid1D = function(access, cellSize, colorA, colorB) {
+ for (var x = 0; x < access.getWidth(); x++) {
+ var mx = Math.floor(x / cellSize) % 2;
+
+ if (mx)
+ access.setPixel(colorB, x, 0);
+ else
+ access.setPixel(colorA, x, 0);
+ }
+};
+
+/** tcuTextureUtil.fillWithGrid2D
+ * @const @param {tcuTexture.PixelBufferAccess} access
+ * @param {number} cellSize
+ * @param {Array<number>} colorA
+ * @param {Array<number>} colorB
+ */
+tcuTextureUtil.fillWithGrid2D = function(access, cellSize, colorA, colorB) {
+ for (var y = 0; y < access.getHeight(); y++)
+ for (var x = 0; x < access.getWidth(); x++) {
+ var mx = Math.floor(x / cellSize) % 2;
+ var my = Math.floor(y / cellSize) % 2;
+
+ if (mx ^ my)
+ access.setPixel(colorB, x, y);
+ else
+ access.setPixel(colorA, x, y);
+ }
+};
+
+/** tcuTextureUtil.fillWithGrid3D
+ * @const @param {tcuTexture.PixelBufferAccess} access
+ * @param {number} cellSize
+ * @param {Array<number>} colorA
+ * @param {Array<number>} colorB
+ */
+tcuTextureUtil.fillWithGrid3D = function(access, cellSize, colorA, colorB) {
+ for (var z = 0; z < access.getDepth(); z++)
+ for (var y = 0; y < access.getHeight(); y++)
+ for (var x = 0; x < access.getWidth(); x++) {
+ var mx = Math.floor(x / cellSize) % 2;
+ var my = Math.floor(y / cellSize) % 2;
+ var mz = Math.floor(z / cellSize) % 2;
+
+ if (mx ^ my ^ mz)
+ access.setPixel(colorB, x, y, z);
+ else
+ access.setPixel(colorA, x, y, z);
+ }
+};
+
+/**
+ * @const @param {tcuTexture.TextureFormat} format
+ * @return {Array<number>}
+ */
+tcuTextureUtil.getTextureFormatMantissaBitDepth = function(format) {
+ /** @type {Array<number>} */ var chnBits = tcuTextureUtil.getChannelMantissaBitDepth(format.type);
+ /** @type {Array<boolean>} */ var chnMask = [false, false, false, false];
+ /** @type {Array<number>} */ var chnSwz = [0, 1, 2, 3];
+
+ switch (format.order) {
+ case tcuTexture.ChannelOrder.R: chnMask = [true, false, false, false]; break;
+ case tcuTexture.ChannelOrder.A: chnMask = [false, false, false, true]; break;
+ case tcuTexture.ChannelOrder.RA: chnMask = [true, false, false, true]; break;
+ case tcuTexture.ChannelOrder.L: chnMask = [true, true, true, false]; break;
+ case tcuTexture.ChannelOrder.I: chnMask = [true, true, true, true]; break;
+ case tcuTexture.ChannelOrder.LA: chnMask = [true, true, true, true]; break;
+ case tcuTexture.ChannelOrder.RG: chnMask = [true, true, false, false]; break;
+ case tcuTexture.ChannelOrder.RGB: chnMask = [true, true, true, false]; break;
+ case tcuTexture.ChannelOrder.RGBA: chnMask = [true, true, true, true]; break;
+ case tcuTexture.ChannelOrder.BGRA: chnMask = [true, true, true, true]; chnSwz = [2, 1, 0, 3]; break;
+ case tcuTexture.ChannelOrder.ARGB: chnMask = [true, true, true, true]; chnSwz = [1, 2, 3, 0]; break;
+ case tcuTexture.ChannelOrder.sRGB: chnMask = [true, true, true, false]; break;
+ case tcuTexture.ChannelOrder.sRGBA: chnMask = [true, true, true, true]; break;
+ case tcuTexture.ChannelOrder.D: chnMask = [true, false, false, false]; break;
+ case tcuTexture.ChannelOrder.DS: chnMask = [true, false, false, true]; break;
+ case tcuTexture.ChannelOrder.S: chnMask = [false, false, false, true]; break;
+ default:
+ DE_ASSERT(false);
+ }
+ return tcuTextureUtil.select(deMath.swizzle(chnBits, [chnSwz[0], chnSwz[1], chnSwz[2], chnSwz[3]]), [0, 0, 0, 0], chnMask);
+};
+
+/**
+ * @param {?tcuTexture.ChannelType} channelType
+ * @return {Array<number>}
+ */
+tcuTextureUtil.getChannelMantissaBitDepth = function(channelType) {
+ switch (channelType) {
+ case tcuTexture.ChannelType.SNORM_INT8:
+ case tcuTexture.ChannelType.SNORM_INT16:
+ case tcuTexture.ChannelType.SNORM_INT32:
+ case tcuTexture.ChannelType.UNORM_INT8:
+ case tcuTexture.ChannelType.UNORM_INT16:
+ case tcuTexture.ChannelType.UNORM_INT32:
+ case tcuTexture.ChannelType.UNORM_SHORT_565:
+ case tcuTexture.ChannelType.UNORM_SHORT_4444:
+ case tcuTexture.ChannelType.UNORM_SHORT_555:
+ case tcuTexture.ChannelType.UNORM_SHORT_5551:
+ case tcuTexture.ChannelType.UNORM_INT_101010:
+ case tcuTexture.ChannelType.UNORM_INT_1010102_REV:
+ case tcuTexture.ChannelType.SIGNED_INT8:
+ case tcuTexture.ChannelType.SIGNED_INT16:
+ case tcuTexture.ChannelType.SIGNED_INT32:
+ case tcuTexture.ChannelType.UNSIGNED_INT8:
+ case tcuTexture.ChannelType.UNSIGNED_INT16:
+ case tcuTexture.ChannelType.UNSIGNED_INT32:
+ case tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV:
+ case tcuTexture.ChannelType.UNSIGNED_INT_24_8:
+ case tcuTexture.ChannelType.UNSIGNED_INT_999_E5_REV:
+ return tcuTextureUtil.getChannelBitDepth(channelType);
+ case tcuTexture.ChannelType.HALF_FLOAT: return [10, 10, 10, 10];
+ case tcuTexture.ChannelType.FLOAT: return [23, 23, 23, 23];
+ case tcuTexture.ChannelType.UNSIGNED_INT_11F_11F_10F_REV: return [6, 6, 5, 0];
+ case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV: return [23, 0, 0, 8];
+ default:
+ throw new Error('Invalid channelType: ' + channelType);
+ }
+};
+
+/**
+ * @param {tcuTexture.PixelBufferAccess} dst
+ * @param {tcuTexture.ConstPixelBufferAccess} src
+ */
+tcuTextureUtil.copy = function(dst, src) {
+ var width = dst.getWidth();
+ var height = dst.getHeight();
+ var depth = dst.getDepth();
+
+ DE_ASSERT(src.getWidth() == width && src.getHeight() == height && src.getDepth() == depth);
+
+ if (src.getFormat().isEqual(dst.getFormat())) {
+ var srcData = src.getDataPtr();
+ var dstData = dst.getDataPtr();
+
+ if (srcData.length == dstData.length) {
+ dstData.set(srcData);
+ return;
+ }
+ }
+ var srcClass = tcuTexture.getTextureChannelClass(src.getFormat().type);
+ var dstClass = tcuTexture.getTextureChannelClass(dst.getFormat().type);
+ var srcIsInt = srcClass == tcuTexture.TextureChannelClass.SIGNED_INTEGER || srcClass == tcuTexture.TextureChannelClass.UNSIGNED_INTEGER;
+ var dstIsInt = dstClass == tcuTexture.TextureChannelClass.SIGNED_INTEGER || dstClass == tcuTexture.TextureChannelClass.UNSIGNED_INTEGER;
+
+ if (srcIsInt && dstIsInt) {
+ for (var z = 0; z < depth; z++)
+ for (var y = 0; y < height; y++)
+ for (var x = 0; x < width; x++)
+ dst.setPixelInt(src.getPixelInt(x, y, z), x, y, z);
+ } else {
+ for (var z = 0; z < depth; z++)
+ for (var y = 0; y < height; y++)
+ for (var x = 0; x < width; x++)
+ dst.setPixel(src.getPixel(x, y, z), x, y, z);
+ }
+};
+
+/**
+ * @param {tcuTexture.ConstPixelBufferAccess} access
+ */
+tcuTextureUtil.estimatePixelValueRange = function(access) {
+ var format = access.getFormat();
+
+ switch (format.type) {
+ case tcuTexture.ChannelType.UNORM_INT8:
+ case tcuTexture.ChannelType.UNORM_INT16:
+ // Normalized unsigned formats.
+ return [
+ [0, 0, 0, 0],
+ [1, 1, 1, 1]
+ ];
+
+ case tcuTexture.ChannelType.SNORM_INT8:
+ case tcuTexture.ChannelType.SNORM_INT16:
+ // Normalized signed formats.
+ return [
+ [-1, -1, -1, -1],
+ [1, 1, 1, 1]
+ ];
+
+ default:
+ // \note Samples every 4/8th pixel.
+ var minVal = [Infinity, Infinity, Infinity, Infinity];
+ var maxVal = [-Infinity, -Infinity, -Infinity, -Infinity];
+
+ for (var z = 0; z < access.getDepth(); z += 2) {
+ for (var y = 0; y < access.getHeight(); y += 2) {
+ for (var x = 0; x < access.getWidth(); x += 2) {
+ var p = access.getPixel(x, y, z);
+
+ minVal[0] = Math.min(minVal[0], p[0]);
+ minVal[1] = Math.min(minVal[1], p[1]);
+ minVal[2] = Math.min(minVal[2], p[2]);
+ minVal[3] = Math.min(minVal[3], p[3]);
+
+ maxVal[0] = Math.max(maxVal[0], p[0]);
+ maxVal[1] = Math.max(maxVal[1], p[1]);
+ maxVal[2] = Math.max(maxVal[2], p[2]);
+ maxVal[3] = Math.max(maxVal[3], p[3]);
+ }
+ }
+ }
+ return [minVal, maxVal];
+ }
+};
+
+/**
+ * @param {tcuTexture.ConstPixelBufferAccess} access
+ * @return {{scale: Array<number>, bias: Array<number>}}
+ */
+tcuTextureUtil.computePixelScaleBias = function(access) {
+ var limits = tcuTextureUtil.estimatePixelValueRange(access);
+ var minVal = limits[0];
+ var maxVal = limits[1];
+
+ var scale = [1, 1, 1, 1];
+ var bias = [0, 0, 0, 0];
+
+ var eps = 0.0001;
+
+ for (var c = 0; c < 4; c++) {
+ if (maxVal[c] - minVal[c] < eps) {
+ scale[c] = (maxVal[c] < eps) ? 1 : (1 / maxVal[c]);
+ bias[c] = (c == 3) ? (1 - maxVal[c] * scale[c]) : (0 - minVal[c] * scale[c]);
+ } else {
+ scale[c] = 1 / (maxVal[c] - minVal[c]);
+ bias[c] = 0 - minVal[c] * scale[c];
+ }
+ }
+
+ return {
+ scale: scale,
+ bias: bias
+ };
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deMath.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deMath.js
new file mode 100644
index 0000000000..fbb2a61fd7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deMath.js
@@ -0,0 +1,1143 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.delibs.debase.deMath');
+
+/** @typedef { (Int8Array|Uint8Array|Uint8ClampedArray|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array) } */
+goog.TypedArray;
+
+/** @typedef { (Array<number>|Array<boolean>|goog.TypedArray) } */
+goog.NumberArray;
+
+goog.scope(function() {
+
+var deMath = framework.delibs.debase.deMath;
+
+var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+};
+
+/** @const */ deMath.INT32_SIZE = 4;
+
+deMath.deInRange32 = function(a, mn, mx) {
+ return (a >= mn) && (a <= mx);
+};
+
+deMath.deInBounds32 = function(a, mn, mx) {
+ return (a >= mn) && (a < mx);
+};
+
+/**
+ * @param {number} a
+ * @return {number}
+ */
+deMath.deFloatFrac = function(a) { return a - Math.floor(a); };
+
+/**
+ * Transform a 64-bit float number into a 32-bit float number.
+ * Native dEQP uses 32-bit numbers, so sometimes 64-bit floating numbers in JS should be transformed into 32-bit ones to ensure the correctness of the result.
+ * @param {number} a
+ * @return {number}
+ */
+deMath.toFloat32 = (function() {
+ var FLOAT32ARRAY1 = new Float32Array(1);
+ return function(a) {
+ FLOAT32ARRAY1[0] = a;
+ return FLOAT32ARRAY1[0];
+ };
+})();
+
+/** @const */ deMath.INV_LOG_2_FLOAT32 = deMath.toFloat32(1.44269504089); /** 1.0 / log_e(2.0) */
+
+/**
+ * Check if a value is a power-of-two.
+ * @param {number} a Input value.
+ * @return {boolean} return True if input is a power-of-two value, false otherwise.
+ * (Also returns true for zero).
+ */
+deMath.deIsPowerOfTwo32 = function(a) {
+ return ((a & (a - 1)) == 0);
+};
+
+/**
+ * Align an integer to given power-of-two size.
+ * @param {number} val The number to align.
+ * @param {number} align The size to align to.
+ * @return {number} The aligned value
+ */
+deMath.deAlign32 = function(val, align) {
+ if (!deMath.deIsPowerOfTwo32(align))
+ throw new Error('Not a power of 2: ' + align);
+ return ((val + align - 1) & ~(align - 1)) & 0xFFFFFFFF; //0xFFFFFFFF make sure it returns a 32 bit calculation in 64 bit browsers.
+};
+
+/**
+ * Compute the bit population count of an integer.
+ * @param {number} a
+ * @return {number} The number of one bits in
+ */
+deMath.dePop32 = function(a) {
+ /** @type {number} */ var mask0 = 0x55555555; /* 1-bit values. */
+ /** @type {number} */ var mask1 = 0x33333333; /* 2-bit values. */
+ /** @type {number} */ var mask2 = 0x0f0f0f0f; /* 4-bit values. */
+ /** @type {number} */ var mask3 = 0x00ff00ff; /* 8-bit values. */
+ /** @type {number} */ var mask4 = 0x0000ffff; /* 16-bit values. */
+ /** @type {number} */ var t = a & 0xFFFFFFFF; /* Crop to 32-bit value */
+ t = (t & mask0) + ((t >> 1) & mask0);
+ t = (t & mask1) + ((t >> 2) & mask1);
+ t = (t & mask2) + ((t >> 4) & mask2);
+ t = (t & mask3) + ((t >> 8) & mask3);
+ t = (t & mask4) + (t >> 16);
+ return t;
+};
+
+deMath.clamp = function(val, minParm, maxParm) {
+ return Math.min(Math.max(val, minParm), maxParm);
+};
+
+/**
+ * @param {Array<number>} values
+ * @param {number} minParm
+ * @param {number} maxParm
+ * @return {Array<number>}
+ */
+deMath.clampVector = function(values, minParm, maxParm) {
+ var result = [];
+ for (var i = 0; i < values.length; i++)
+ result.push(deMath.clamp(values[i], minParm, maxParm));
+ return result;
+};
+
+deMath.imod = function(a, b) {
+ var m = a % b;
+ return m < 0 ? m + b : m;
+};
+
+deMath.mirror = function(a) {
+ return a >= 0 ? a : -(1 + a);
+};
+
+/**
+ * @param {goog.NumberArray} a Source array
+ * @param {goog.NumberArray} indices
+ * @return {Array<number>} Swizzled array
+ */
+deMath.swizzle = function(a, indices) {
+ if (!indices.length)
+ throw new Error('Argument must be an array');
+ var dst = [];
+ for (var i = 0; i < indices.length; i++)
+ dst.push(a[indices[i]]);
+ return dst;
+};
+
+/**
+ * Shift left elements of array a by elements of array b
+ * dst[n] a[n] << b[n]
+ * @param {goog.NumberArray} a
+ * @param {goog.NumberArray} b
+ * @return {Array<number>} Result array
+ */
+deMath.arrayShiftLeft = function(a, b) {
+ if (a.length != b.length)
+ throw new Error('Arrays must have the same size');
+ var dst = [];
+ for (var i = 0; i < a.length; i++)
+ dst.push(a[i] << b[i]);
+ return dst;
+};
+
+/**
+ * Multiply two vectors, element by element
+ * @param {goog.NumberArray} a
+ * @param {goog.NumberArray} b
+ * @return {Array<number>} Result array
+ */
+
+deMath.multiply = function(a, b) {
+ if (a.length != b.length)
+ throw new Error('Arrays must have the same size');
+ var dst = [];
+ for (var i = 0; i < a.length; i++)
+ dst.push(a[i] * b[i]);
+ return dst;
+};
+
+/**
+ * Divide two vectors, element by element
+ * @param {goog.NumberArray} a
+ * @param {goog.NumberArray} b
+ * @return {Array<number>} Result array
+ * @throws {Error}
+ */
+
+deMath.divide = function(a, b) {
+ if (a.length != b.length)
+ throw new Error('Arrays must have the same size');
+ var dst = [];
+ for (var i = 0; i < a.length; i++) {
+ if (b[i] === 0)
+ throw new Error('Division by 0');
+ dst.push(a[i] / b[i]);
+ }
+ return dst;
+};
+
+/**
+ * Divide vector by a scalar
+ * @param {goog.NumberArray} a
+ * @param {number} b
+ * @return {Array<number>} Result array
+ */
+deMath.divideScale = function(a, b) {
+ var dst = [];
+ for (var i = 0; i < a.length; i++)
+ dst.push(a[i] / b);
+ return dst;
+};
+
+/**
+ * @param {number} a
+ * @param {number} b
+ * @return {number}
+ */
+deMath.mod = function(a, b) {
+ return a - b * Math.floor(a / b);
+};
+
+/**
+ * Modulus vector by a scalar
+ * @param {goog.NumberArray} a
+ * @param {number} b
+ * @return {Array<number>} Result array
+ */
+deMath.modScale = function(a, b) {
+ var dst = [];
+ for (var i = 0; i < a.length; i++)
+ dst.push(deMath.mod(a[i], b));
+ return dst;
+};
+
+/**
+ * Multiply vector by a scalar
+ * @param {goog.NumberArray} a
+ * @param {number} b
+ * @return {Array<number>} Result array
+ */
+deMath.scale = function(a, b) {
+ var dst = [];
+ for (var i = 0; i < a.length; i++)
+ dst.push(a[i] * b);
+ return dst;
+};
+
+/**
+ * Add vector and scalar, element by element
+ * @param {goog.NumberArray} a
+ * @param {number} b
+ * @return {Array<number>} Result array
+ */
+deMath.addScalar = function(a, b) {
+ if (!Array.isArray(a))
+ throw new Error('First argument must be an array.');
+ if (typeof b !== 'number')
+ throw new Error('Second argument must be a number.');
+ var dst = [];
+ for (var i = 0; i < a.length; i++)
+ dst.push(a[i] + b);
+ return dst;
+};
+
+/**
+ * Add two vectors, element by element
+ * @param {goog.NumberArray} a
+ * @param {goog.NumberArray} b
+ * @return {Array<number>} Result array
+ */
+deMath.add = function(a, b) {
+ if (a.length != b.length)
+ throw new Error('Arrays must have the same size');
+ var dst = [];
+ for (var i = 0; i < a.length; i++)
+ dst.push(a[i] + b[i]);
+ return dst;
+};
+
+/**
+ * Subtract two vectors, element by element
+ * @param {goog.NumberArray} a
+ * @param {goog.NumberArray} b
+ * @return {Array<number>} Result array
+ */
+
+deMath.subtract = function(a, b) {
+ if (a.length != b.length)
+ throw new Error('Arrays must have the same size');
+ var dst = [];
+ for (var i = 0; i < a.length; i++)
+ dst.push(a[i] - b[i]);
+ return dst;
+};
+
+/**
+ * Subtract vector and scalar, element by element
+ * @param {goog.NumberArray} a
+ * @param {number} b
+ * @return {Array<number>} Result array
+ */
+deMath.subScalar = function(a, b) {
+ if (!Array.isArray(a))
+ throw new Error('First argument must be an array.');
+ if (typeof b !== 'number')
+ throw new Error('Second argument must be a number.');
+ var dst = [];
+ for (var i = 0; i < a.length; i++)
+ dst.push(a[i] - b);
+ return dst;
+};
+
+/**
+ * Calculate absolute difference between two vectors
+ * @param {goog.NumberArray} a
+ * @param {goog.NumberArray} b
+ * @return {Array<number>} abs(diff(a - b))
+ */
+deMath.absDiff = function(a, b) {
+ if (a.length != b.length)
+ throw new Error('Arrays must have the same size');
+ var dst = [];
+ for (var i = 0; i < a.length; i++)
+ dst.push(Math.abs(a[i] - b[i]));
+ return dst;
+};
+
+/**
+ * Calculate absolute value of a vector
+ * @param {goog.NumberArray} a
+ * @return {Array<number>} abs(a)
+ */
+deMath.abs = function(a) {
+ var dst = [];
+ for (var i = 0; i < a.length; i++)
+ dst.push(Math.abs(a[i]));
+ return dst;
+};
+
+/**
+ * Is a <= b (element by element)?
+ * @param {goog.NumberArray} a
+ * @param {goog.NumberArray} b
+ * @return {Array<boolean>} Result array of booleans
+ */
+deMath.lessThanEqual = function(a, b) {
+ if (a.length != b.length)
+ throw new Error('Arrays must have the same size');
+ var dst = [];
+ for (var i = 0; i < a.length; i++)
+ dst.push(a[i] <= b[i]);
+ return dst;
+};
+
+/**
+ * Is a === b (element by element)?
+ * @param {goog.NumberArray} a
+ * @param {goog.NumberArray} b
+ * @return {boolean} Result
+ */
+deMath.equal = function(a, b) {
+ if (a.length != b.length)
+ throw new Error('Arrays must have the same size');
+ for (var i = 0; i < a.length; i++) {
+ if (a[i] !== b[i])
+ return false;
+ }
+ return true;
+};
+
+/**
+ * Are all values in the array true?
+ * @param {Array<boolean>} a
+ * @return {boolean}
+ */
+deMath.boolAll = function(a) {
+ for (var i = 0; i < a.length; i++)
+ if (a[i] == false)
+ return false;
+ return true;
+};
+
+/**
+ * deMath.assign(a, b) element by element
+ * @param {goog.NumberArray} a
+ * @return {Array<number>}
+ */
+deMath.assign = function(a) {
+ var dst = [];
+ for (var i = 0; i < a.length; i++)
+ dst.push(a[i]);
+ return dst;
+};
+
+/**
+ * deMath.max(a, b) element by element
+ * @param {goog.NumberArray} a
+ * @param {goog.NumberArray} b
+ * @return {Array<number>}
+ */
+deMath.max = function(a, b) {
+ if (a.length != b.length)
+ throw new Error('Arrays must have the same size');
+ var dst = [];
+ for (var i = 0; i < a.length; i++)
+ dst.push(Math.max(a[i], b[i]));
+ return dst;
+};
+
+/**
+ * deMath.min(a, b) element by element
+ * @param {goog.NumberArray} a
+ * @param {goog.NumberArray} b
+ * @return {Array<number>}
+ */
+deMath.min = function(a, b) {
+ if (a.length != b.length)
+ throw new Error('Arrays must have the same size');
+ var dst = [];
+ for (var i = 0; i < a.length; i++)
+ dst.push(Math.min(a[i], b[i]));
+ return dst;
+};
+
+// Nearest-even rounding in case of tie (fractional part 0.5), otherwise ordinary rounding.
+deMath.rint = function(a) {
+ var floorVal = Math.floor(a);
+ var fracVal = a - floorVal;
+
+ if (fracVal != 0.5)
+ return Math.round(a); // Ordinary case.
+
+ var roundUp = (floorVal % 2) != 0;
+
+ return floorVal + (roundUp ? 1 : 0);
+};
+
+/**
+ * wrap the number, so that it fits in the range [minValue, maxValue]
+ * @param {number} v
+ * @param {number} minValue
+ * @param {number} maxValue
+ * @return {number}
+ */
+deMath.wrap = function(v, minValue, maxValue) {
+ var range = maxValue - minValue + 1;
+
+ if (v < minValue) {
+ v += range * (Math.floor((minValue - v) / range) + 1);
+ }
+ return minValue + Math.floor((v - minValue) % range);
+};
+
+/**
+ * Round number to int by dropping fractional part
+ * it is equivalent of GLSL int() constructor
+ * @param {number} a
+ * @return {number}
+ */
+deMath.intCast = function(a) {
+ var v;
+ if (a >= 0)
+ v = Math.floor(a);
+ else
+ v = Math.ceil(a);
+ return deMath.wrap(v, -0x80000000, 0x7FFFFFFF);
+};
+
+/**
+ * Round number to uint by dropping fractional part
+ * it is equivalent of GLSL uint() constructor
+ * @param {number} a
+ * @return {number}
+ */
+deMath.uintCast = function(a) {
+ var v;
+ if (a >= 0)
+ v = Math.floor(a);
+ else
+ v = Math.ceil(a);
+ return deMath.wrap(v, 0, 0xFFFFFFFF);
+};
+
+/**
+ * @param {number} a
+ * @return {number}
+ */
+deMath.logToFloor = function(a) {
+ assertMsgOptions(a > 0, 'Value is less or equal than zero', false, true);
+ return 31 - deMath.clz32(a);
+};
+
+/**
+ * Find intersection of two rectangles
+ * @param {goog.NumberArray} a Array [x, y, width, height]
+ * @param {goog.NumberArray} b Array [x, y, width, height]
+ * @return {Array<number>}
+ */
+deMath.intersect = function(a, b) {
+ if (a.length != 4)
+ throw new Error('Array "a" must have length 4 but has length: ' + a.length);
+ if (b.length != 4)
+ throw new Error('Array "b" must have length 4 but has length: ' + b.length);
+ var x0 = Math.max(a[0], b[0]);
+ var y0 = Math.max(a[1], b[1]);
+ var x1 = Math.min(a[0] + a[2], b[0] + b[2]);
+ var y1 = Math.min(a[1] + a[3], b[1] + b[3]);
+ var w = Math.max(0, x1 - x0);
+ var h = Math.max(0, y1 - y0);
+
+ return [x0, y0, w, h];
+};
+
+/** deMath.deMathHash
+ * @param {number} a
+ * @return {number}
+ */
+deMath.deMathHash = function(a) {
+ var key = a;
+ key = (key ^ 61) ^ (key >> 16);
+ key = key + (key << 3);
+ key = key ^ (key >> 4);
+ key = key * 0x27d4eb2d; /* prime/odd constant */
+ key = key ^ (key >> 15);
+ return key;
+};
+
+/**
+ * Converts a byte array to a number. Cannot convert numbers larger than 52 bits.
+ * @param {Uint8Array} array
+ * @return {number}
+ */
+deMath.arrayToNumber = function(array) {
+ DE_ASSERT(array.length <= 6 || (array.length == 6 && array[5] <= 127));
+ /** @type {number} */ var result = 0;
+
+ for (var ndx = 0; ndx < array.length; ndx++) {
+ result += array[ndx] * Math.pow(256, ndx);
+ }
+
+ return result;
+};
+
+/**
+ * Fills a byte array with a number
+ * @param {Uint8Array} array Output array (already resized)
+ * @param {number} number
+ */
+deMath.numberToArray = function(array, number) {
+ DE_ASSERT(Number.isInteger(number));
+ for (var byteNdx = 0; byteNdx < array.length; byteNdx++) {
+ /** @type {number} */ var acumzndx = !byteNdx ? number : Math.floor(number / Math.pow(256, byteNdx));
+ array[byteNdx] = acumzndx & 0xFF;
+ }
+};
+
+/**
+ * Obtains the bit fragment from a number
+ * @param {number} x
+ * @param {number} firstNdx
+ * @param {number} lastNdx
+ * @return {number}
+ */
+deMath.getBitRange = function(x, firstNdx, lastNdx) {
+ DE_ASSERT(lastNdx - firstNdx <= 52);
+ var shifted = deMath.shiftRight(x, firstNdx);
+ var bitSize = lastNdx - firstNdx;
+ var mask;
+ if (bitSize < 32)
+ mask = (1 << bitSize) - 1;
+ else
+ mask = Math.pow(2, bitSize) - 1;
+ var masked = deMath.binaryAnd(shifted, mask);
+ return masked;
+};
+
+/**
+ * Obtains the bit fragment from a Uint32Array representing a number.
+ * (ArrayBuffer representations are used in tcuFloat.)
+ *
+ * Cannot return more than 52 bits ((lastNdx - firstNdx) <= 52).
+ *
+ * @param {Uint32Array} array
+ * @param {number} firstNdx
+ * @param {number} lastNdx
+ * @return {number}
+ */
+deMath.getArray32BitRange = function(array, firstNdx, lastNdx) {
+ DE_ASSERT(0 <= firstNdx && firstNdx < (array.length * 32));
+ DE_ASSERT(0 < lastNdx && lastNdx <= (array.length * 32));
+ DE_ASSERT((lastNdx - firstNdx) <= 52);
+
+ // Example of how this works for a 64-bit number (Uint32Array of length 2).
+ //
+ // * Note that the shift operators in the code << and >>> are pointing in
+ // the opposite direction of this diagram, since LSB is shown on the left.
+ //
+ // [array[0], array[1] ]
+ // [00000011111111111111111111111111, 11111111111100000000000000000000]
+ // ^LSB MSB^ ^LSB MSB^
+ //
+ // [00000011111111111111111111111111, 11111111111100000000000000000000]
+ // \ \
+ // firstNdx = 6 (inclusive) lastNdx = 44 (exclusive)
+ // blockIndexA = 0 blockIndexB = 1
+ //
+ // [00000011111111111111111111111111, 11111111111100000000000000000000]
+ // \-----\ \-------------------\
+ // bitsToBeginningOfBlock = 6 bitsFromEndOfBlock = 20
+ //
+ // -------------blockA------------- -------------blockB-------------
+ // [00000011111111111111111111111111, 11111111111100000000000000000000]
+ // ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^
+ // blockATruncated blockBTruncated
+ // \--blockATruncatedLength--\
+ //
+ // 11111111111111111111111111 111111111111
+ // ^^^^^^^^^^^^^^^^^^^^^^^^^^--^^^^^^^^^^^^ return value (38 bits)
+
+ /** @type {number} */ var blockIndexA = Math.floor(firstNdx / 32);
+ /** @type {number} */ var bitsToBeginningOfBlock = firstNdx % 32;
+ /** @type {number} */ var blockIndexB = Math.floor((lastNdx - 1) / 32);
+ /** @type {number} */ var bitsFromEndOfBlock = 31 - ((lastNdx - 1) % 32);
+
+ /** @type {number} */ var blockB = array[blockIndexB];
+ // Chop off the most significant `bitsFromEndOfBlock` bits from blockB.
+ // Note: Initially this logic used a bitmask instead. But there are subtle
+ // corner cases in JS that caused results to sometimes come out negative.
+ // This truncation method is just used to avoid that complexity.
+ /** @type {number} */ var blockBTruncated = (blockB << bitsFromEndOfBlock) >>> bitsFromEndOfBlock;
+
+ if (blockIndexA == blockIndexB) {
+ // firstNdx and lastNdx are in the same block.
+ // Chop off the least significant `bitsToBeginningOfBlock` bits from blockBTruncated.
+ return blockBTruncated >>> bitsToBeginningOfBlock;
+ } else {
+ // firstNdx and lastNdx are in different blocks.
+ /** @type {number} */ var blockA = array[blockIndexA];
+ // Chop off the least significant `bitsToBeginningOfBlock` bits from blockA.
+ /** @type {number} */ var blockATruncated = blockA >>> bitsToBeginningOfBlock;
+ /** @type {number} */ var blockATruncatedLength = 32 - bitsToBeginningOfBlock;
+
+ // Concatenate blockATruncated and blockBTruncated.
+ // Conceptually equivalent to:
+ // blockATruncated | (blockBTruncated << blockATruncatedLength)
+ // except that wouldn't work for numbers larger than 32 bits.
+ return blockATruncated + (blockBTruncated * Math.pow(2, blockATruncatedLength));
+ }
+};
+
+/**
+ * Split a large signed number into low and high 32bit dwords.
+ * @param {number} x
+ * @return {Array<number>}
+ */
+deMath.split32 = function(x) {
+ var ret = [];
+ ret[1] = Math.floor(x / 0x100000000);
+ ret[0] = x - ret[1] * 0x100000000;
+ return ret;
+};
+
+/**
+ * Split a signed number's low 32bit dwords into low and high 16bit dwords.
+ * @param {number} x
+ * @return {Array<number>}
+ */
+deMath.split16 = function(x) {
+ var ret = [];
+ x = x & 0xffffffff;
+ ret[1] = Math.floor(x / 0x10000);
+ ret[0] = x - ret[1] * 0x10000;
+ return ret;
+};
+
+/**
+ * Recontruct a number from high and low 32 bit dwords
+ * @param {Array<number>} x
+ * @return {number}
+ */
+deMath.join32 = function(x) {
+ var v0 = x[0] >= 0 ? x[0] : 0x100000000 + x[0];
+ var v1 = x[1];
+ var val = v1 * 0x100000000 + v0;
+ return val;
+};
+
+//Bit operations with the help of arrays
+
+/**
+ * @enum
+ */
+deMath.BinaryOp = {
+ AND: 0,
+ OR: 1,
+ XOR: 2
+};
+
+/**
+ * Performs a normal (native) binary operation
+ * @param {number} valueA First operand
+ * @param {number} valueB Second operand
+ * @param {deMath.BinaryOp} operation The desired operation to perform
+ * @return {number}
+ */
+deMath.doNativeBinaryOp = function(valueA, valueB, operation) {
+ switch (operation) {
+ case deMath.BinaryOp.AND:
+ return valueA & valueB;
+ case deMath.BinaryOp.OR:
+ return valueA | valueB;
+ case deMath.BinaryOp.XOR:
+ return valueA ^ valueB;
+ default:
+ throw new Error('Unknown operation: ' + operation);
+ }
+};
+
+/**
+ * Performs a binary operation between two operands
+ * with the help of arrays to avoid losing the internal binary representation.
+ * @param {number} valueA First operand
+ * @param {number} valueB Second operand
+ * @param {deMath.BinaryOp} binaryOpParm The desired operation to perform
+ * @return {number}
+ */
+deMath.binaryOp = function(valueA, valueB, binaryOpParm) {
+ //quick path if values fit in signed 32 bit range
+ if (deMath.deInRange32(valueA, -0x80000000, 0x7FFFFFFF) && deMath.deInRange32(valueB, -0x80000000, 0x7FFFFFFF))
+ return deMath.doNativeBinaryOp(valueA, valueB, binaryOpParm);
+
+ var x = deMath.split32(valueA);
+ var y = deMath.split32(valueB);
+ var z = [];
+ for (var i = 0; i < 2; i++)
+ z[i] = deMath.doNativeBinaryOp(x[i], y[i], binaryOpParm);
+ var ret = deMath.join32(z);
+ return ret;
+};
+
+/**
+ * @param {number} a
+ * @param {number} b
+ * @return {number}
+ */
+deMath.binaryAnd = function(a, b) {
+ return deMath.binaryOp(a, b, deMath.BinaryOp.AND);
+};
+
+/**
+ * @param {goog.NumberArray} a
+ * @param {number} b
+ * @return {Array<number>}
+ */
+deMath.binaryAndVecScalar = function(a, b) {
+ if (!Array.isArray(a))
+ throw new Error('First argument must be an array.');
+ if (typeof b !== 'number')
+ throw new Error('Second argument must be a number.');
+ var dst = [];
+ for (var i = 0; i < a.length; i++)
+ dst.push(deMath.binaryOp(a[i], b, deMath.BinaryOp.AND));
+ return dst;
+};
+
+/**
+ * @param {number} a
+ * @param {number} b
+ * @return {number}
+ */
+deMath.binaryOr = function(a, b) {
+ return deMath.binaryOp(a, b, deMath.BinaryOp.OR);
+};
+
+/**
+ * @param {goog.NumberArray} a
+ * @param {number} b
+ * @return {Array<number>}
+ */
+deMath.binaryOrVecScalar = function(a, b) {
+ if (!Array.isArray(a))
+ throw new Error('First argument must be an array.');
+ if (typeof b !== 'number')
+ throw new Error('Second argument must be a number.');
+ var dst = [];
+ for (var i = 0; i < a.length; i++)
+ dst.push(deMath.binaryOp(a[i], b, deMath.BinaryOp.OR));
+ return dst;
+};
+
+/**
+ * @param {number} a
+ * @param {number} b
+ * @return {number}
+ */
+deMath.binaryXor = function(a, b) {
+ return deMath.binaryOp(a, b, deMath.BinaryOp.XOR);
+};
+
+/**
+ * @param {goog.NumberArray} a
+ * @param {number} b
+ * @return {Array<number>}
+ */
+deMath.binaryXorVecScalar = function(a, b) {
+ if (!Array.isArray(a))
+ throw new Error('First argument must be an array.');
+ if (typeof b !== 'number')
+ throw new Error('Second argument must be a number.');
+ var dst = [];
+ for (var i = 0; i < a.length; i++)
+ dst.push(deMath.binaryOp(a[i], b, deMath.BinaryOp.XOR));
+ return dst;
+};
+
+/**
+ * Performs a binary NOT operation on an operand
+ * @param {number} value Operand
+ * @return {number}
+ */
+deMath.binaryNot = function(value) {
+ //quick path if value fits in signed 32 bit range
+ if (deMath.deInRange32(value, -0x80000000, 0x7FFFFFFF))
+ return ~value;
+
+ var x = deMath.split32(value);
+ x[0] = ~x[0];
+ x[1] = ~x[1];
+ var ret = deMath.join32(x);
+ return ret;
+};
+
+/**
+ * Shifts the given value 'steps' bits to the left. Replaces << operator
+ * This function should be used if the expected value will be wider than 32-bits.
+ * @param {number} value
+ * @param {number} steps
+ * @return {number}
+ */
+deMath.shiftLeft = function(value, steps) {
+ //quick path
+ if (steps < 31) {
+ var v = value * (1 << steps);
+ if (deMath.deInRange32(v, -0x80000000, 0x7FFFFFFF))
+ return v;
+ }
+
+ if (steps == 0)
+ return value;
+ else if (steps < 32) {
+ var mask = (1 << 32 - steps) - 1;
+ var x = deMath.split32(value);
+ var highBits = x[0] & (~mask);
+ var y = highBits >> (32 - steps);
+ if (highBits < 0) {
+ var m = (1 << steps) - 1;
+ y &= m;
+ }
+ var result = [];
+ result[0] = x[0] << steps;
+ result[1] = x[1] << steps;
+ result[1] |= y;
+
+ return deMath.join32(result);
+ } else {
+ var x = deMath.split32(value);
+ var result = [];
+ result[0] = 0;
+ result[1] = x[0] << steps - 32;
+ return deMath.join32(result);
+ }
+};
+
+/**
+ * @param {Array<number>} a
+ * @param {number} b
+ */
+deMath.shiftLeftVecScalar = function(a, b) {
+ var dst = [];
+ for (var i = 0; i < a.length; i++)
+ dst.push(deMath.shiftLeft(a[i], b));
+ return dst;
+};
+
+/**
+ * Shifts the given value 'steps' bits to the right. Replaces >> operator
+ * This function should be used if the value is wider than 32-bits
+ * @param {number} value
+ * @param {number} steps
+ * @return {number}
+ */
+deMath.shiftRight = function(value, steps) {
+ //quick path
+ if (deMath.deInRange32(value, -0x80000000, 0x7FFFFFFF) && steps < 32)
+ return value >> steps;
+
+ if (steps == 0)
+ return value;
+ else if (steps < 32) {
+ if (steps == 0)
+ return value;
+ var mask = (1 << steps) - 1;
+ var x = deMath.split32(value);
+ var lowBits = x[1] & mask;
+ var result = [];
+ var m = (1 << 32 - steps) - 1;
+ result[0] = (x[0] >> steps) & m;
+ result[1] = x[1] >> steps;
+ result[0] |= lowBits << 32 - steps;
+ return deMath.join32(result);
+ } else {
+ var x = deMath.split32(value);
+ var result = [];
+ result[0] = x[1] >> steps - 32;
+ result[1] = value < 0 ? -1 : 0;
+ return deMath.join32(result);
+ }
+};
+
+/**
+ * @param {Array<number>} a
+ * @param {number} b
+ */
+deMath.shiftRightVecScalar = function(a, b) {
+ var dst = [];
+ for (var i = 0; i < a.length; i++)
+ dst.push(deMath.shiftRight(a[i], b));
+ return dst;
+};
+
+/** deMath.logicalAndBool over two arrays of booleans
+ * @param {Array<boolean>} a
+ * @param {Array<boolean>} b
+ * @return {Array<boolean>}
+ */
+deMath.logicalAndBool = function(a, b) {
+ if (!Array.isArray(a))
+ throw new Error('The first parameter is not an array: (' + typeof(a) + ')' + a);
+ if (!Array.isArray(b))
+ throw new Error('The second parameter is not an array: (' + typeof(b) + ')' + b);
+ if (a.length != b.length)
+ throw new Error('The lengths of the passed arrays are not equivalent. (' + a.length + ' != ' + b.length + ')');
+
+ /** @type {Array<boolean>} */ var result = [];
+ for (var i = 0; i < a.length; i++) {
+ if (a[i] & b[i])
+ result.push(true);
+ else
+ result.push(false);
+ }
+ return result;
+};
+
+/** deMath.logicalOrBool over two arrays of booleans
+ * @param {Array<boolean>} a
+ * @param {Array<boolean>} b
+ * @return {Array<boolean>}
+ */
+deMath.logicalOrBool = function(a, b) {
+ if (!Array.isArray(a))
+ throw new Error('The first parameter is not an array: (' + typeof(a) + ')' + a);
+ if (!Array.isArray(b))
+ throw new Error('The second parameter is not an array: (' + typeof(b) + ')' + b);
+ if (a.length != b.length)
+ throw new Error('The lengths of the passed arrays are not equivalent. (' + a.length + ' != ' + b.length + ')');
+
+ /** @type {Array<boolean>} */ var result = [];
+ for (var i = 0; i < a.length; i++) {
+ if (a[i] | b[i])
+ result.push(true);
+ else
+ result.push(false);
+ }
+ return result;
+};
+
+/** deMath.logicalNotBool over an array of booleans
+ * @param {Array<boolean>} a
+ * @return {Array<boolean>}
+ */
+deMath.logicalNotBool = function(a) {
+ if (!Array.isArray(a))
+ throw new Error('The passed value is not an array: (' + typeof(a) + ')' + a);
+
+ /** @type {Array<boolean>} */ var result = [];
+ for (var i = 0; i < a.length; i++)
+ result.push(!a[i]);
+ return result;
+};
+
+/** deMath.greaterThan over two arrays of booleans
+ * @param {Array<number>} a
+ * @param {Array<number>} b
+ * @return {Array<boolean>}
+ */
+deMath.greaterThan = function(a, b) {
+ if (!Array.isArray(a))
+ throw new Error('The first parameter is not an array: (' + typeof(a) + ')' + a);
+ if (!Array.isArray(b))
+ throw new Error('The second parameter is not an array: (' + typeof(b) + ')' + b);
+ if (a.length != b.length)
+ throw new Error('The lengths of the passed arrays are not equivalent. (' + a.length + ' != ' + b.length + ')');
+
+ /** @type {Array<boolean>} */ var result = [];
+ for (var i = 0; i < a.length; i++)
+ result.push(a[i] > b[i]);
+ return result;
+};
+
+/** deMath.greaterThan over two arrays of booleans
+ * @param {Array<number>} a
+ * @param {Array<number>} b
+ * @return {Array<boolean>}
+ */
+deMath.greaterThanEqual = function(a, b) {
+ if (!Array.isArray(a))
+ throw new Error('The first parameter is not an array: (' + typeof(a) + ')' + a);
+ if (!Array.isArray(b))
+ throw new Error('The second parameter is not an array: (' + typeof(b) + ')' + b);
+ if (a.length != b.length)
+ throw new Error('The lengths of the passed arrays are not equivalent. (' + a.length + ' != ' + b.length + ')');
+
+ /** @type {Array<boolean>} */ var result = [];
+ for (var i = 0; i < a.length; i++)
+ result.push(a[i] >= b[i]);
+ return result;
+};
+
+/**
+ * Array of float to array of int (0, 255)
+ * @param {Array<number>} a
+ * @return {Array<number>}
+ */
+
+deMath.toIVec = function(a) {
+ /** @type {Array<number>} */ var res = [];
+ for (var i = 0; i < a.length; i++)
+ res.push(deMath.clamp(Math.floor(a[i] * 255), 0, 255));
+ return res;
+};
+
+/**
+ * @param {number} a
+ * @return {number}
+ */
+ deMath.clz32 = function(a) {
+ /** @type {number} */ var maxValue = 2147483648; // max 32 bit number
+ /** @type {number} */ var leadingZeros = 0;
+ while (a < maxValue) {
+ maxValue = maxValue >>> 1;
+ leadingZeros++;
+ }
+ return leadingZeros;
+};
+
+/**
+ * @param {number} a
+ * @param {number} exponent
+ * @return {number}
+ */
+deMath.deLdExp = function(a, exponent) {
+ return deMath.ldexp(a, exponent);
+};
+
+/**
+ * @param {number} a
+ * @param {number} exponent
+ * @return {number}
+ */
+deMath.deFloatLdExp = function(a, exponent) {
+ return deMath.ldexp(a, exponent);
+};
+
+/**
+ * @param {number} value
+ * @return {Array<number>}
+ */
+deMath.frexp = (function() {
+ var data = new DataView(new ArrayBuffer(8));
+
+ return function(value) {
+ if (value === 0) return [value, 0];
+ data.setFloat64(0, value);
+ var bits = (data.getUint32(0) >>> 20) & 0x7FF;
+ if (bits === 0) {
+ data.setFloat64(0, value * Math.pow(2, 64));
+ bits = ((data.getUint32(0) >>> 20) & 0x7FF) - 64;
+ }
+ var exponent = bits - 1022,
+ mantissa = deMath.ldexp(value, -exponent);
+ return [mantissa, exponent];
+ }
+})();
+
+/**
+ * @param {number} mantissa
+ * @param {number} exponent
+ * @return {number}
+ */
+deMath.ldexp = function(mantissa, exponent) {
+ return exponent > 1023 ? // avoid multiplying by infinity
+ mantissa * Math.pow(2, 1023) * Math.pow(2, exponent - 1023) :
+ exponent < -1074 ? // avoid multiplying by zero
+ mantissa * Math.pow(2, -1074) * Math.pow(2, exponent + 1074) :
+ mantissa * Math.pow(2, exponent);
+};
+
+/**
+ * @param {number} a
+ * @return {number}
+ */
+deMath.deCbrt = function(a) {
+ return deMath.deSign(a) * Math.pow(Math.abs(a), 1.0 / 3.0);
+};
+
+/**
+ * @param {number} x
+ * @return {number}
+ */
+deMath.deSign = function(x) {
+ return isNaN(x) ? x : ((x > 0.0) - (x < 0.0));
+};
+
+deMath.deFractExp = function(x) {
+ var result = {
+ significand: x,
+ exponent: 0
+ };
+
+ if (isFinite(x)) {
+ var r = deMath.frexp(x);
+ result.exponent = r[1] - 1;
+ result.significand = r[0] * 2;
+ }
+ return result;
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deRandom.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deRandom.js
new file mode 100644
index 0000000000..2246a2e9d3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deRandom.js
@@ -0,0 +1,260 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/**
+ * This class allows one to create a random integer, floating point number or boolean (TODO, deRandom.choose random items from a list and deRandom.shuffle an array)
+ */
+'use strict';
+goog.provide('framework.delibs.debase.deRandom');
+
+goog.scope(function() {
+
+var deRandom = framework.delibs.debase.deRandom;
+
+/**
+ * Array of pseudo random numbers based on seed
+ * @constructor
+ * @struct
+ */
+deRandom.deRandom = function() {
+ /** @type {number} */ this.x = 0;
+ /** @type {number} */ this.y = 0;
+ /** @type {number} */ this.z = 0;
+ /** @type {number} */ this.w = 0;
+};
+
+/**
+ * deRandom.Random number generator init
+ * @param {deRandom.deRandom} rnd Array to store random numbers
+ * @param {number} seed Number for seed
+ */
+deRandom.deRandom_init = function(rnd, seed) {
+ rnd.x = (-seed ^ 123456789);
+ rnd.y = (362436069 * seed);
+ rnd.z = (521288629 ^ (seed >> 7));
+ rnd.w = (88675123 ^ (seed << 3));
+};
+
+/**
+ * Function to get random int
+ * @param {deRandom.deRandom} rnd Initialised array of random numbers
+ * @param {Array<number>=} opts Min and max for range
+ * @return {number} deRandom.Random int
+ */
+deRandom.deRandom_getInt = function(rnd, opts) {
+ if (opts != undefined && opts[0] != undefined && opts[1] != undefined) {
+ if (opts[0] == 0x80000000 && opts[1] == 0x7fffffff) {
+ return deRandom.deRandom_getInt(rnd);
+ } else {
+ return opts[0] + (deRandom.deRandom_getInt(rnd) % (opts[1] - opts[0] + 1));
+ }
+ }
+ var w = rnd.w;
+ var t;
+
+ t = rnd.x ^ (rnd.x << 11);
+ rnd.x = rnd.y;
+ rnd.y = rnd.z;
+ rnd.z = w;
+ rnd.w = w = (w ^ (w >> 19)) ^ (t ^ (t >> 8));
+ return w;
+};
+
+/**
+ * Function to get random float
+ * @param {deRandom.deRandom} rnd Initialised array of random numbers
+ * @param {Array<number>=} opts Min and max for range
+ * @return {number} deRandom.Random float
+ */
+deRandom.deRandom_getFloat = function(rnd, opts) {
+ if (opts != undefined && opts[0] != undefined && opts[1] != undefined) {
+ if (opts[0] <= opts[1]) {
+ return opts[0] + (opts[1] - opts[0]) * deRandom.deRandom_getFloat(rnd);
+ }
+ } else {
+ return (deRandom.deRandom_getInt(rnd) & 0xFFFFFFF) / (0xFFFFFFF + 1);
+ }
+ throw new Error('Invalid arguments');
+};
+
+/**
+ * Function to get random boolean
+ * @param {deRandom.deRandom} rnd Initialised array of random numbers
+ * @return {boolean} deRandom.Random boolean
+ */
+deRandom.deRandom_getBool = function(rnd) {
+ var val;
+ val = deRandom.deRandom_getInt(rnd);
+ return ((val & 0xFFFFFF) < 0x800000);
+};
+
+/**
+ * Function to get a common base seed
+ * @return {number} constant
+ */
+deRandom.getBaseSeed = function() {
+ return 42;
+};
+
+/**
+ * TODO Function to deRandom.choose random items from a list
+ * @template T
+ * @param {deRandom.deRandom} rnd Initialised array of random numbers
+ * @param {Array<T>} elements Array segment already defined
+ * @param {Array<T>=} resultOut Array where to store the elements in. If undefined, default to array of (num) elements.
+ * @param {number=} num Number of items to store in resultOut. If undefined, default to 1.
+ * @return {Array<T>} Even though result is stored in resultOut, return it here as well.
+ */
+deRandom.choose = function(rnd, elements, resultOut, num) {
+ var items = num || 1;
+ var temp = elements.slice();
+ if (!resultOut)
+ resultOut = [];
+
+ while (items-- > 0) {
+ var index = deRandom.deRandom_getInt(rnd, [0, temp.length - 1]);
+ resultOut.push(temp[index]);
+ temp.splice(index, 1);
+ }
+ return resultOut;
+};
+
+/**
+ * TODO Function to deRandom.choose weighted random items from a list
+ * @param {deRandom.deRandom} rnd Initialised randomizer
+ * @param {Array<number>} array Array to choose items from
+ * @param {Array<number>} weights Weights array
+ * @return {number} Result output
+ */
+deRandom.chooseWeighted = function(rnd, array, weights) {
+ // Compute weight sum
+ /** @type {number} */ var weightSum = 0.0;
+ /** @type {number} */ var ndx;
+ for (ndx = 0; ndx < array.length; ndx++)
+ weightSum += weights[ndx];
+
+ // Random point in 0..weightSum
+ /** @type {number} */ var p = deRandom.deRandom_getFloat(rnd, [0.0, weightSum]);
+
+ // Find item in range
+ /** @type {number} */ var lastNonZero = array.length;
+ /** @type {number} */ var curWeight = 0.0;
+ for (ndx = 0; ndx != array.length; ndx++) {
+ /** @type {number} */ var w = weights[ndx];
+
+ curWeight += w;
+
+ if (p < curWeight)
+ return array[ndx];
+ else if (w > 0.0)
+ lastNonZero = ndx;
+ }
+
+ assertMsgOptions(lastNonZero != array.length, 'Index went out of bounds', false, true);
+ return array[lastNonZero];
+};
+
+/**
+ * TODO Function to deRandom.shuffle an array
+ * @param {deRandom.deRandom} rnd Initialised array of random numbers
+ * @param {Array} elements Array to deRandom.shuffle
+ * @return {Array} Shuffled array
+ */
+deRandom.shuffle = function(rnd, elements) {
+ var index = elements.length;
+
+ while (index > 0) {
+ var random = deRandom.deRandom_getInt(rnd, [0, index - 1]);
+ index -= 1;
+ var elem = elements[index];
+ elements[index] = elements[random];
+ elements[random] = elem;
+ }
+ return elements;
+};
+
+/**
+ * This function is used to create the deRandom.Random object and
+ * initialise the random number with a seed.
+ * It contains functions for generating random numbers in a variety of formats
+ * @constructor
+ * @param {number} seed Number to use as a seed
+ */
+deRandom.Random = function(seed) {
+ /**
+ * Instance of array of pseudo random numbers based on seeds
+ */
+ this.m_rnd = new deRandom.deRandom();
+
+ //initialise the random numbers based on seed
+ deRandom.deRandom_init(this.m_rnd, seed);
+};
+
+/**
+ * Function to get random boolean
+ * @return {boolean} deRandom.Random boolean
+ */
+deRandom.Random.prototype.getBool = function() { return deRandom.deRandom_getBool(this.m_rnd) == true; };
+/**
+ * Function to get random float
+ * @param {number=} min Min for range
+ * @param {number=} max Max for range
+ * @return {number} deRandom.Random float
+ */
+deRandom.Random.prototype.getFloat = function(min, max) { return deRandom.deRandom_getFloat(this.m_rnd, [min, max]) };
+/**
+ * Function to get random int
+ * @param {number=} min Min for range
+ * @param {number=} max Max for range
+ * @return {number} deRandom.Random int
+ */
+deRandom.Random.prototype.getInt = function(min, max) {return deRandom.deRandom_getInt(this.m_rnd, [min, max])};
+/**
+ * TODO Function to deRandom.choose random items from a list
+ * @template T
+ * @param {Array<T>} elements Array segment already defined
+ * @param {Array<T>=} resultOut Array where to store the elements in. If undefined, default to array of (num) elements.
+ * @param {number=} num Number of items to store in resultOut. If undefined, default to 1.
+ * @return {Array<T>} Even though result is stored in resultOut, return it here as well.
+ */
+deRandom.Random.prototype.choose = function(elements, resultOut, num) {return deRandom.choose(this.m_rnd, elements, resultOut, num)};
+/**
+ * choose weighted random items from a list
+ * @param {Array<number>} array Array to choose items from
+ * @param {Array<number>} weights Weights array
+ * @return {number} Result output
+ */
+deRandom.Random.prototype.chooseWeighted = function(array, weights) {return deRandom.chooseWeighted(this.m_rnd, array, weights)};
+/**
+ * TODO Function to deRandom.shuffle an array
+ * @param {Array} elements Array to deRandom.shuffle
+ * @return {Array} Shuffled array
+ */
+deRandom.Random.prototype.shuffle = function(elements) {return deRandom.shuffle(this.m_rnd, elements)};
+
+/**
+ * Function to get a common base seed
+ * @return {number} constant
+ */
+deRandom.Random.prototype.getBaseSeed = function() {
+ return deRandom.getBaseSeed();
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deString.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deString.js
new file mode 100644
index 0000000000..fc84a72327
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deString.js
@@ -0,0 +1,111 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/**
+ * This class allows one to create a random integer, floating point number or boolean (TODO, choose random items from a list and shuffle an array)
+ */
+'use strict';
+goog.provide('framework.delibs.debase.deString');
+goog.require('framework.delibs.debase.deMath');
+
+goog.scope(function() {
+
+var deString = framework.delibs.debase.deString;
+var deMath = framework.delibs.debase.deMath;
+
+ var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+ };
+
+ /**
+ * Compute hash from string.
+ * @param {?string} str String to compute hash value for.
+ * @return {number} Computed hash value.
+ */
+ deString.deStringHash = function(str) {
+ /* \note [pyry] This hash is used in DT_GNU_HASH and is proven
+ to be robust for symbol hashing. */
+ /* \see http://sources.redhat.com/ml/binutils/2006-06/msg00418.html */
+ /** @type {number} */ var hash = 5381;
+ /** @type {number} */ var c;
+
+ DE_ASSERT(str != undefined);
+ if (str !== null) {
+ var i = 0;
+ while (i < str.length) { //(c = (unsigned int)*str++) != 0)
+ c = str.charCodeAt(i); //trunc to 8-bit
+ hash = (hash << 5) + hash + c;
+ i++;
+ }
+ }
+ return hash;
+ };
+
+ /**
+ * Checks if a JS string is either empty or undefined
+ * @param {string} str
+ * @return {boolean}
+ */
+ deString.deIsStringEmpty = function(str) {
+ if (str === undefined || str.length == 0)
+ return true;
+ return false;
+ };
+
+ /**
+ * @private
+ * @param {Object} enumType
+ * @param {?} value
+ * @return {string}
+ */
+ deString.getString = function(enumType, value) {
+ for (var p in enumType)
+ if (enumType[p] == value)
+ return p;
+
+ if (typeof value === 'undefined')
+ return 'undefined';
+
+ if (!value)
+ return 'null';
+
+ return value.toString(10);
+ };
+
+ /**
+ * @param {Object} enumType
+ * @param {?} value
+ * @return {string}
+ */
+ deString.enumToString = function(enumType, value) {
+ if (typeof deString.enumToString[enumType] === 'undefined')
+ deString.enumToString[enumType] = {};
+
+ var table = deString.enumToString[enumType];
+ if (typeof table[value] === 'undefined') {
+ var v = deString.getString(enumType, value);
+ table[value] = v;
+ }
+
+ return table[value];
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deUtil.js
new file mode 100644
index 0000000000..56a90b6ff6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/delibs/debase/deUtil.js
@@ -0,0 +1,90 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.delibs.debase.deUtil');
+goog.require('framework.delibs.debase.deMath');
+
+goog.scope(function() {
+
+ var deUtil = framework.delibs.debase.deUtil;
+ var deMath = framework.delibs.debase.deMath;
+
+ //! Get an element of an array with a specified size.
+ /**
+ * @param {Array} array
+ * @param {number} offset
+ * @return {*}
+ */
+ deUtil.getArrayElement = function(array, offset) {
+ assertMsgOptions(deMath.deInBounds32(offset, 0, array.length), 'Array element out of bounds', false, true);
+ return array[offset];
+ };
+
+ /**
+ * clone - If you need to pass/assign an object by value, call this
+ * @param {*} obj
+ * @return {*}
+ */
+ deUtil.clone = function(obj) {
+ if (obj == null || typeof(obj) != 'object')
+ return obj;
+
+ var temp = {};
+ if (ArrayBuffer.isView(obj)) {
+ temp = new obj.constructor(obj);
+ } else if (obj instanceof Array) {
+ temp = new Array(obj.length);
+ for (var akey in obj)
+ temp[akey] = deUtil.clone(obj[akey]);
+ } else if (obj instanceof ArrayBuffer) {
+ temp = new ArrayBuffer(obj.byteLength);
+ var dst = new Uint8Array(temp);
+ var src = new Uint8Array(obj);
+ dst.set(src);
+ } else {
+ temp = Object.create(obj.constructor.prototype);
+ temp.constructor = obj.constructor;
+ for (var key in obj)
+ temp[key] = deUtil.clone(obj[key]);
+ }
+ return temp;
+ };
+
+ /**
+ * Add a push_unique function to Array. Will insert only if there is no equal element.
+ * @template T
+ * @param {Array<T>} array Any array
+ * @param {T} object Any object
+ */
+ deUtil.dePushUniqueToArray = function(array, object) {
+ //Simplest implementation
+ for (var i = 0; i < array.length; i++) {
+ if (object.equals !== undefined)
+ if (object.equals(array[i]))
+ return undefined;
+ else if (object === array[i])
+ return undefined;
+ }
+
+ array.push(object);
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluDrawUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluDrawUtil.js
new file mode 100644
index 0000000000..baa05a9708
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluDrawUtil.js
@@ -0,0 +1,510 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.opengl.gluDrawUtil');
+goog.require('framework.opengl.gluShaderProgram');
+
+goog.scope(function() {
+
+var gluDrawUtil = framework.opengl.gluDrawUtil;
+var gluShaderProgram = framework.opengl.gluShaderProgram;
+
+/**
+ * Description of a vertex array binding
+ * @constructor
+ * @param {number} type GL gluDrawUtil.Type of data
+ * @param {(number|undefined)} location Binding location
+ * @param {number} components Number of components per vertex
+ * @param {number} elements Number of elements in the array
+ * @param {Array<number>} data Source data
+ * @param {number=} stride
+ * @param {number=} offset
+ */
+gluDrawUtil.VertexArrayBinding = function(type, location, components, elements, data, stride, offset) {
+ this.type = type;
+ this.location = location === undefined ? -1 : location;
+ this.components = components;
+ this.elements = elements;
+ this.data = data;
+ /** @type {?string} */ this.name = null;
+ this.stride = stride || 0;
+ this.offset = offset || 0;
+};
+
+/**
+ * Description of a vertex array binding
+ * @param {gluDrawUtil.BindingPoint} binding
+ * @param {gluDrawUtil.VertexArrayPointer} pointer
+ * @param {number=} dataType GL Data Type
+ * @return {gluDrawUtil.VertexArrayBinding}
+ */
+gluDrawUtil.vabFromBindingPointAndArrayPointer = function(binding, pointer, dataType) {
+ var type = dataType === undefined ? gl.FLOAT : dataType;
+ var location = binding.location;
+ var components = pointer.numComponents;
+ var elements = pointer.numElements;
+ var data = pointer.data;
+ var vaBinding = new gluDrawUtil.VertexArrayBinding(type, location, components, elements, data);
+ vaBinding.componentType = pointer.componentType;
+ vaBinding.name = binding.name;
+ vaBinding.convert = pointer.convert;
+ vaBinding.stride = pointer.stride;
+ return vaBinding;
+};
+
+/**
+ * ! Lower named bindings to locations and eliminate bindings that are not used by program.
+ * @param {WebGL2RenderingContext} gl WebGL context
+ * @param {WebGLProgram} program
+ * @param {Array} inputArray - Array with the named binding locations
+ * @param {Array=} outputArray - Array with the lowered locations
+ * @return {Array} outputArray
+ */
+gluDrawUtil.namedBindingsToProgramLocations = function(gl, program, inputArray, outputArray) {
+ outputArray = outputArray || [];
+
+ for (var i = 0; i < inputArray.length; i++) {
+ var cur = inputArray[i];
+ if (cur.name) {
+ //assert(binding.location >= 0);
+ var location = gl.getAttribLocation(program, cur.name);
+ if (location >= 0) {
+ if (cur.location >= 0)
+ location += cur.location;
+ // Add binding.location as an offset to accomodate matrices.
+ outputArray.push(new gluDrawUtil.VertexArrayBinding(cur.type, location, cur.components, cur.elements, cur.data, cur.stride, cur.offset));
+ }
+ } else {
+ outputArray.push(cur);
+ }
+ }
+
+ return outputArray;
+};
+
+/**
+ * Creates vertex buffer, binds it and draws elements
+ * @param {WebGL2RenderingContext} gl WebGL context
+ * @param {WebGLProgram} program ID, vertexProgramID
+ * @param {Array<gluDrawUtil.VertexArrayBinding>} vertexArrays
+ * @param {gluDrawUtil.PrimitiveList} primitives to gluDrawUtil.draw
+ * @param { {beforeDrawCall:function(), afterDrawCall:function()}=} callback
+ */
+gluDrawUtil.draw = function(gl, program, vertexArrays, primitives, callback) {
+ /** TODO: finish implementation */
+ /** @type {Array<WebGLBuffer>} */ var objects = [];
+
+ // Lower bindings to locations
+ vertexArrays = gluDrawUtil.namedBindingsToProgramLocations(gl, program, vertexArrays);
+
+ for (var i = 0; i < vertexArrays.length; i++) {
+ /** @type {WebGLBuffer} */ var buffer = gluDrawUtil.vertexBuffer(gl, vertexArrays[i]);
+ objects.push(buffer);
+ }
+
+ if (primitives.indices) {
+ /** @type {WebGLBuffer} */ var elemBuffer = gluDrawUtil.indexBuffer(gl, primitives);
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, elemBuffer);
+
+ if (callback)
+ callback.beforeDrawCall();
+
+ gluDrawUtil.drawIndexed(gl, primitives, 0);
+
+ if (callback)
+ callback.afterDrawCall();
+
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);
+ } else {
+ if (callback)
+ callback.beforeDrawCall();
+
+ gl.drawArrays(gluDrawUtil.getPrimitiveGLType(gl, primitives.type), 0, primitives.numElements);
+
+ if (callback)
+ callback.afterDrawCall();
+ }
+
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'drawArrays', false, true);
+ for (var i = 0; i < vertexArrays.length; i++) {
+ gl.disableVertexAttribArray(vertexArrays[i].location);
+ }
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+};
+
+/**
+ * Creates vertex buffer, binds it and draws elements
+ * @param {WebGL2RenderingContext} gl WebGL context
+ * @param {gluDrawUtil.PrimitiveList} primitives Primitives to gluDrawUtil.draw
+ * @param {number} offset
+ */
+gluDrawUtil.drawIndexed = function(gl, primitives, offset) {
+/** @type {number} */ var mode = gluDrawUtil.getPrimitiveGLType(gl, primitives.type);
+ /** TODO: C++ implementation supports different index types, we use only int16.
+ Could it cause any issues?
+
+ deUint32 indexGLType = getIndexGLType(primitives.indexType);
+ */
+
+ gl.drawElements(mode, primitives.indices.length, gl.UNSIGNED_SHORT, offset);
+};
+
+/**
+ * Enums for primitive types
+ * @enum
+ */
+gluDrawUtil.primitiveType = {
+ TRIANGLES: 0,
+ TRIANGLE_STRIP: 1,
+ TRIANGLE_FAN: 2,
+
+ LINES: 3,
+ LINE_STRIP: 4,
+ LINE_LOOP: 5,
+
+ POINTS: 6,
+
+ PATCHES: 7
+};
+
+/**
+ * get GL type from primitive type
+ * @param {WebGL2RenderingContext} gl WebGL context
+ * @param {gluDrawUtil.primitiveType} type gluDrawUtil.primitiveType
+ * @return {number} GL primitive type
+ */
+gluDrawUtil.getPrimitiveGLType = function(gl, type) {
+ switch (type) {
+ case gluDrawUtil.primitiveType.TRIANGLES: return gl.TRIANGLES;
+ case gluDrawUtil.primitiveType.TRIANGLE_STRIP: return gl.TRIANGLE_STRIP;
+ case gluDrawUtil.primitiveType.TRIANGLE_FAN: return gl.TRIANGLE_FAN;
+ case gluDrawUtil.primitiveType.LINES: return gl.LINES;
+ case gluDrawUtil.primitiveType.LINE_STRIP: return gl.LINE_STRIP;
+ case gluDrawUtil.primitiveType.LINE_LOOP: return gl.LINE_LOOP;
+ case gluDrawUtil.primitiveType.POINTS: return gl.POINTS;
+// case gluDrawUtil.primitiveType.PATCHES: return gl.PATCHES;
+ default:
+ throw new Error('Unknown primitive type ' + type);
+ }
+};
+
+/**
+ * Calls gluDrawUtil.newPrimitiveListFromIndices() to create primitive list for Points
+ * @param {number} numElements
+ */
+gluDrawUtil.pointsFromElements = function(numElements) {
+ return new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.POINTS, numElements);
+};
+
+/**
+ * Calls gluDrawUtil.newPrimitiveListFromIndices() to create primitive list for Triangles
+ * @param {Array<number>} indices
+ */
+gluDrawUtil.triangles = function(indices) {
+ return gluDrawUtil.newPrimitiveListFromIndices(gluDrawUtil.primitiveType.TRIANGLES, indices);
+};
+
+/**
+ * Calls gluDrawUtil.newPrimitiveListFromIndices() to create primitive list for Patches
+ * @param {Array<number>} indices
+ */
+gluDrawUtil.patches = function(indices) {
+ return gluDrawUtil.newPrimitiveListFromIndices(gluDrawUtil.primitiveType.PATCHES, indices);
+};
+
+/**
+ * Creates primitive list for Triangles or Patches, depending on type
+ * @param {gluDrawUtil.primitiveType} type gluDrawUtil.primitiveType
+ * @param {number} numElements
+ * @constructor
+ */
+gluDrawUtil.PrimitiveList = function(type, numElements) {
+ this.type = type;
+ this.indices = 0;
+ this.numElements = numElements;
+};
+
+/**
+ * @param {gluDrawUtil.primitiveType} type
+ * @param {Array<number>} indices
+ * @return {gluDrawUtil.PrimitiveList}
+ */
+gluDrawUtil.newPrimitiveListFromIndices = function(type, indices) {
+ /** @type {gluDrawUtil.PrimitiveList} */ var primitiveList = new gluDrawUtil.PrimitiveList(type, 0);
+ primitiveList.indices = indices;
+ return primitiveList;
+};
+
+/**
+ * Create Element Array Buffer
+ * @param {WebGL2RenderingContext} gl WebGL context
+ * @param {gluDrawUtil.PrimitiveList} primitives to construct the buffer from
+ * @return {WebGLBuffer} indexObject buffer with elements
+ */
+gluDrawUtil.indexBuffer = function(gl, primitives) {
+ /** @type {WebGLBuffer} */ var indexObject = gl.createBuffer();
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexObject);
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'bindBuffer', false, true);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(primitives.indices), gl.STATIC_DRAW);
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'bufferData', false, true);
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);
+ return indexObject;
+};
+
+/**
+ * Create Array Buffer
+ * @param {WebGL2RenderingContext} gl WebGL context
+ * @param {gluDrawUtil.VertexArrayBinding} vertexArray primitives, Array buffer descriptor
+ * @return {WebGLBuffer} buffer of vertices
+ */
+gluDrawUtil.vertexBuffer = function(gl, vertexArray) {
+ /** @type {goog.TypedArray} */ var typedArray;
+ switch (vertexArray.type) {
+ case gl.BYTE: typedArray = new Int8Array(vertexArray.data); break;
+ case gl.UNSIGNED_BYTE: typedArray = new Uint8Array(vertexArray.data); break;
+ case gl.SHORT: typedArray = new Int16Array(vertexArray.data); break;
+ case gl.UNSIGNED_SHORT: typedArray = new Uint16Array(vertexArray.data); break;
+ case gl.INT: typedArray = new Int32Array(vertexArray.data); break;
+ case gl.UNSIGNED_INT: typedArray = new Uint32Array(vertexArray.data); break;
+ default: typedArray = new Float32Array(vertexArray.data); break;
+ }
+
+ /** @type {WebGLBuffer} */ var buffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'bindBuffer', false, true);
+ gl.bufferData(gl.ARRAY_BUFFER, typedArray, gl.STATIC_DRAW);
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'bufferData', false, true);
+ gl.enableVertexAttribArray(vertexArray.location);
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'enableVertexAttribArray', false, true);
+ if (vertexArray.type === gl.FLOAT) {
+ gl.vertexAttribPointer(vertexArray.location, vertexArray.components, vertexArray.type, false, vertexArray.stride, vertexArray.offset);
+ } else {
+ gl.vertexAttribIPointer(vertexArray.location, vertexArray.components, vertexArray.type, vertexArray.stride, vertexArray.offset);
+ }
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'vertexAttribPointer', false, true);
+ return buffer;
+};
+
+/**
+ * @param {Array<number>} rgba
+ * @constructor
+ */
+gluDrawUtil.Pixel = function(rgba) {
+ this.rgba = rgba;
+};
+
+gluDrawUtil.Pixel.prototype.getRed = function() {
+ return this.rgba[0];
+};
+gluDrawUtil.Pixel.prototype.getGreen = function() {
+ return this.rgba[1];
+};
+gluDrawUtil.Pixel.prototype.getBlue = function() {
+ return this.rgba[2];
+};
+gluDrawUtil.Pixel.prototype.getAlpha = function() {
+ return this.rgba[3];
+};
+gluDrawUtil.Pixel.prototype.equals = function(otherPixel) {
+ return this.rgba[0] == otherPixel.rgba[0] &&
+ this.rgba[1] == otherPixel.rgba[1] &&
+ this.rgba[2] == otherPixel.rgba[2] &&
+ this.rgba[3] == otherPixel.rgba[3];
+};
+
+/**
+ * @constructor
+ */
+gluDrawUtil.Surface = function() {
+};
+
+gluDrawUtil.Surface.prototype.readSurface = function(gl, x, y, width, height) {
+ this.buffer = new Uint8Array(width * height * 4);
+ gl.readPixels(x, y, width, height, gl.RGBA, gl.UNSIGNED_BYTE, this.buffer);
+ this.x = x;
+ this.y = y;
+ this.width = width;
+ this.height = height;
+ return this.buffer;
+};
+
+gluDrawUtil.Surface.prototype.getPixel = function(x, y) {
+ /** @type {number} */ var base = (x + y * this.width) * 4;
+ /** @type {Array<number>} */
+ var rgba = [
+ this.buffer[base],
+ this.buffer[base + 1],
+ this.buffer[base + 2],
+ this.buffer[base + 3]
+ ];
+ return new gluDrawUtil.Pixel(rgba);
+};
+
+gluDrawUtil.Surface.prototype.getPixelUintRGB8 = function(x, y) {
+ /** @type {number} */ var base = (x + y * this.width) * 4;
+ /** @type {number} */
+ return (this.buffer[base] << 16) +
+ (this.buffer[base + 1] << 8) +
+ this.buffer[base + 2];
+};
+
+/**
+ * @enum
+ */
+gluDrawUtil.VertexComponentType = {
+ // Standard types: all conversion types apply.
+ VTX_COMP_UNSIGNED_INT8: 0,
+ VTX_COMP_UNSIGNED_INT16: 1,
+ VTX_COMP_UNSIGNED_INT32: 2,
+ VTX_COMP_SIGNED_INT8: 3,
+ VTX_COMP_SIGNED_INT16: 4,
+ VTX_COMP_SIGNED_INT32: 5,
+
+ // Special types: only CONVERT_NONE is allowed.
+ VTX_COMP_FIXED: 6,
+ VTX_COMP_HALF_FLOAT: 7,
+ VTX_COMP_FLOAT: 8
+};
+
+/**
+ * @enum
+ */
+gluDrawUtil.VertexComponentConversion = {
+ VTX_COMP_CONVERT_NONE: 0, //!< No conversion: integer types, or floating-point values.
+ VTX_COMP_CONVERT_NORMALIZE_TO_FLOAT: 1, //!< Normalize integers to range [0,1] or [-1,1] depending on type.
+ VTX_COMP_CONVERT_CAST_TO_FLOAT: 2 //!< Convert to floating-point directly.
+};
+
+/**
+ * gluDrawUtil.VertexArrayPointer
+ * @constructor
+ * @param {gluDrawUtil.VertexComponentType} componentType_
+ * @param {gluDrawUtil.VertexComponentConversion} convert_
+ * @param {number} numComponents_
+ * @param {number} numElements_
+ * @param {number} stride_
+ * @const @param {Array<number>} data_
+ */
+gluDrawUtil.VertexArrayPointer = function(componentType_, convert_, numComponents_, numElements_, stride_, data_) {
+ this.componentType = componentType_;
+ this.convert = convert_;
+ this.numComponents = numComponents_;
+ this.numElements = numElements_;
+ this.stride = stride_;
+ this.data = data_;
+};
+
+/**
+ * gluDrawUtil.BindingPoint
+ * @constructor
+ * @param {string} name
+ * @param {number} location
+ * @param {number=} offset
+ */
+gluDrawUtil.BindingPoint = function(name, location, offset) {
+ /** @type {string} */ this.name = name;
+ /** @type {number} */ this.location = location;
+ /** @type {number} */ this.offset = offset || 0;
+};
+
+/**
+ * bindingPointFromLocation
+ * @param {number} location
+ * return {gluDrawUtil.BindingPoint}
+ */
+gluDrawUtil.bindingPointFromLocation = function(location) {
+ return new gluDrawUtil.BindingPoint('', location);
+};
+
+/**
+ * bindingPointFromName
+ * @param {string} name
+ * @param {number=} location
+ * return {gluDrawUtil.BindingPoint}
+ */
+gluDrawUtil.bindingPointFromName = function(name, location) {
+ location = location === undefined ? -1 : location;
+ return new gluDrawUtil.BindingPoint(name, location);
+};
+
+/**
+ * @param {string} name
+ * @param {number} numComponents
+ * @param {number} numElements
+ * @param {number} stride
+ * @param {Array<number>} data
+ * @return {gluDrawUtil.VertexArrayBinding}
+ */
+gluDrawUtil.newInt32VertexArrayBinding = function(name, numComponents, numElements, stride, data) {
+ var bindingPoint = gluDrawUtil.bindingPointFromName(name);
+ var arrayPointer = new gluDrawUtil.VertexArrayPointer(gluDrawUtil.VertexComponentType.VTX_COMP_SIGNED_INT32,
+ gluDrawUtil.VertexComponentConversion.VTX_COMP_CONVERT_NONE, numComponents, numElements, stride, data);
+ return gluDrawUtil.vabFromBindingPointAndArrayPointer(bindingPoint, arrayPointer, gl.INT);
+};
+
+/**
+ * @param {string} name
+ * @param {number} numComponents
+ * @param {number} numElements
+ * @param {number} stride
+ * @param {Array<number>} data
+ * @return {gluDrawUtil.VertexArrayBinding}
+ */
+gluDrawUtil.newUint32VertexArrayBinding = function(name, numComponents, numElements, stride, data) {
+ var bindingPoint = gluDrawUtil.bindingPointFromName(name);
+ var arrayPointer = new gluDrawUtil.VertexArrayPointer(gluDrawUtil.VertexComponentType.VTX_COMP_UNSIGNED_INT32,
+ gluDrawUtil.VertexComponentConversion.VTX_COMP_CONVERT_NONE, numComponents, numElements, stride, data);
+ return gluDrawUtil.vabFromBindingPointAndArrayPointer(bindingPoint, arrayPointer, gl.UNSIGNED_INT);
+};
+
+/**
+ * @param {string} name
+ * @param {number} numComponents
+ * @param {number} numElements
+ * @param {number} stride
+ * @param {Array<number>} data
+ * @return {gluDrawUtil.VertexArrayBinding}
+ */
+gluDrawUtil.newFloatVertexArrayBinding = function(name, numComponents, numElements, stride, data) {
+ var bindingPoint = gluDrawUtil.bindingPointFromName(name);
+ var arrayPointer = new gluDrawUtil.VertexArrayPointer(gluDrawUtil.VertexComponentType.VTX_COMP_FLOAT,
+ gluDrawUtil.VertexComponentConversion.VTX_COMP_CONVERT_NONE, numComponents, numElements, stride, data);
+ return gluDrawUtil.vabFromBindingPointAndArrayPointer(bindingPoint, arrayPointer);
+};
+
+/**
+ * @param {string} name
+ * @param {number} column
+ * @param {number} rows
+ * @param {number} numElements
+ * @param {number} stride
+ * @param {Array<number>} data
+ * @return {gluDrawUtil.VertexArrayBinding}
+ */
+gluDrawUtil.newFloatColumnVertexArrayBinding = function(name, column, rows, numElements, stride, data) {
+ var bindingPoint = gluDrawUtil.bindingPointFromName(name);
+ bindingPoint.location = column;
+ var arrayPointer = new gluDrawUtil.VertexArrayPointer(gluDrawUtil.VertexComponentType.VTX_COMP_FLOAT,
+ gluDrawUtil.VertexComponentConversion.VTX_COMP_CONVERT_NONE, rows, numElements, stride, data);
+ return gluDrawUtil.vabFromBindingPointAndArrayPointer(bindingPoint, arrayPointer);
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluObjectWrapper.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluObjectWrapper.js
new file mode 100644
index 0000000000..38f8a28f9c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluObjectWrapper.js
@@ -0,0 +1,117 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+'use strict';
+
+goog.provide('framework.opengl.gluObjectWrapper');
+
+goog.scope(function() {
+ var gluObjectWrapper = framework.opengl.gluObjectWrapper;
+
+ /**
+ * @typedef {function(this:WebGLRenderingContextBase): WebGLObject}
+ */
+ gluObjectWrapper.funcGenT;
+
+ /**
+ * @typedef {function(this:WebGLRenderingContextBase, WebGLObject)}
+ */
+ gluObjectWrapper.funcDelT;
+
+ /**
+ * @typedef {{name: string, funcGen: !gluObjectWrapper.funcGenT, funcDel: !gluObjectWrapper.funcDelT}}
+ */
+ gluObjectWrapper.traitsT;
+
+ /**
+ * Returns an object containing a configuration for an ObjectWrapper
+ * @param {string} name
+ * @param {gluObjectWrapper.funcGenT} funcGen
+ * @param {gluObjectWrapper.funcDelT} funcDel
+ * @return {gluObjectWrapper.traitsT}
+ */
+ gluObjectWrapper.traits = function(name, funcGen, funcDel) {
+ return {
+ name: name,
+ funcGen: funcGen,
+ funcDel: funcDel
+ };
+ };
+
+ /**
+ * @constructor
+ * @param {WebGLRenderingContextBase} gl
+ * @param {gluObjectWrapper.traitsT} traits
+ */
+ gluObjectWrapper.ObjectWrapper = function(gl, traits) {
+ /**
+ * @protected
+ * @type {WebGLRenderingContextBase}
+ */
+ this.m_gl = gl;
+
+ /**
+ * @protected
+ * @type {gluObjectWrapper.traitsT}
+ */
+ this.m_traits = traits;
+
+ /**
+ * @protected
+ * @type {WebGLObject}
+ */
+ this.m_object = this.m_traits.funcGen.call(gl);
+
+ };
+
+ /**
+ * Destorys the WebGLObject associated with this object.
+ */
+ gluObjectWrapper.ObjectWrapper.prototype.clear = function() {
+ this.m_traits.funcDel.call(this.m_gl, this.m_object);
+ };
+
+ /**
+ * Returns the WebGLObject associated with this object.
+ * @return {WebGLObject}
+ */
+ gluObjectWrapper.ObjectWrapper.prototype.get = function() {
+ return this.m_object;
+ };
+
+ /**
+ * @constructor
+ * @extends {gluObjectWrapper.ObjectWrapper}
+ * @param {WebGLRenderingContextBase} gl
+ */
+ gluObjectWrapper.Framebuffer = function(gl) {
+ gluObjectWrapper.ObjectWrapper.call(this, gl, gluObjectWrapper.traits(
+ 'framebuffer',
+ /** @type {gluObjectWrapper.funcGenT} */(gl.createFramebuffer),
+ /** @type {gluObjectWrapper.funcDelT} */(gl.deleteFramebuffer)
+ ));
+ };
+ gluObjectWrapper.Framebuffer.prototype = Object.create(gluObjectWrapper.ObjectWrapper.prototype);
+ gluObjectWrapper.Framebuffer.prototype.constructor = gluObjectWrapper.Framebuffer;
+
+ /**
+ * @return {WebGLFramebuffer}
+ */
+ gluObjectWrapper.Framebuffer.prototype.get;
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluPixelTransfer.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluPixelTransfer.js
new file mode 100644
index 0000000000..04b81a2a1a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluPixelTransfer.js
@@ -0,0 +1,55 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.opengl.gluPixelTransfer');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.opengl.gluTextureUtil');
+
+goog.scope(function() {
+
+var gluPixelTransfer = framework.opengl.gluPixelTransfer;
+var tcuTexture = framework.common.tcuTexture;
+var deMath = framework.delibs.debase.deMath;
+var gluTextureUtil = framework.opengl.gluTextureUtil;
+
+gluPixelTransfer.getTransferAlignment = function(format) {
+ var pixelSize = format.getPixelSize();
+ if (deMath.deIsPowerOfTwo32(pixelSize))
+ return Math.min(pixelSize, 8);
+ else
+ return 1;
+};
+
+gluPixelTransfer.readPixels = function(ctx, x, y, format, dst) {
+ var width = dst.getWidth();
+ var height = dst.getHeight();
+ var arrayType = tcuTexture.getTypedArray(format.type);
+ var transferFormat = gluTextureUtil.getTransferFormat(format);
+ ctx.pixelStorei(ctx.PACK_ALIGNMENT, gluPixelTransfer.getTransferAlignment(format));
+ var resultPixel = dst.getAccess().getDataPtr();
+ resultPixel = new arrayType(dst.getAccess().getBuffer());
+ ctx.readPixels(x, y, width, height, transferFormat.format, transferFormat.dataType, resultPixel);
+};
+
+/* TODO: implement other functions in C++ file */
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluShaderProgram.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluShaderProgram.js
new file mode 100644
index 0000000000..0c340ee380
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluShaderProgram.js
@@ -0,0 +1,488 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality gluShaderProgram.Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.opengl.gluShaderProgram');
+
+goog.scope(function() {
+
+var gluShaderProgram = framework.opengl.gluShaderProgram;
+
+/**
+ * gluShaderProgram.Shader type enum
+ * @enum {number}
+ */
+gluShaderProgram.shaderType = {
+ VERTEX: 0,
+ FRAGMENT: 1
+};
+
+/**
+ * gluShaderProgram.Shader type enum name
+ * @param {gluShaderProgram.shaderType} shaderType
+ * @return {string}
+ */
+gluShaderProgram.getShaderTypeName = function(shaderType) {
+ var s_names =
+ [
+ 'vertex',
+ 'fragment'
+ ];
+
+ return s_names[shaderType];
+};
+
+/**
+ * Get GL shader type from gluShaderProgram.shaderType
+ * @param {WebGL2RenderingContext} gl WebGL context
+ * @param {gluShaderProgram.shaderType} type gluShaderProgram.Shader Type
+ * @return {number} GL shader type
+ */
+gluShaderProgram.getGLShaderType = function(gl, type) {
+ var _glShaderType;
+ switch (type) {
+ case gluShaderProgram.shaderType.VERTEX: _glShaderType = gl.VERTEX_SHADER; break;
+ case gluShaderProgram.shaderType.FRAGMENT: _glShaderType = gl.FRAGMENT_SHADER; break;
+ default:
+ throw new Error('Unknown shader type ' + type);
+ }
+ return _glShaderType;
+};
+
+/**
+ * Declares shader information
+ * @constructor
+ * @param {gluShaderProgram.shaderType} type
+ * @param {string=} source
+ */
+gluShaderProgram.ShaderInfo = function(type, source) {
+ this.type = type; /** gluShaderProgram.Shader type. */
+ this.source = source; /** gluShaderProgram.Shader source. */
+ this.infoLog; /** Compile info log. */
+ this.compileOk = false; /** Did compilation succeed? */
+ this.compileTimeUs = 0; /** Compile time in microseconds (us). */
+};
+
+/**
+ * Generates vertex shader info from source
+ * @param {string} source
+ * @return {gluShaderProgram.ShaderInfo} vertex shader info
+ */
+gluShaderProgram.genVertexSource = function(source) {
+/** @type {gluShaderProgram.ShaderInfo} */ var shader = new gluShaderProgram.ShaderInfo(gluShaderProgram.shaderType.VERTEX, source);
+ return shader;
+};
+
+/**
+ * Generates fragment shader info from source
+ * @param {string} source
+ * @return {gluShaderProgram.ShaderInfo} fragment shader info
+ */
+gluShaderProgram.genFragmentSource = function(source) {
+/** @type {gluShaderProgram.ShaderInfo} */ var shader = new gluShaderProgram.ShaderInfo(gluShaderProgram.shaderType.FRAGMENT, source);
+ return shader;
+};
+
+/**
+ * Generates shader from WebGL context and type
+ * @constructor
+ * @param {WebGL2RenderingContext} gl WebGL context
+ * @param {gluShaderProgram.shaderType} type gluShaderProgram.Shader Type
+ */
+gluShaderProgram.Shader = function(gl, type) {
+ this.gl = gl;
+ this.info = new gluShaderProgram.ShaderInfo(type); /** Client-side clone of state for debug / perf reasons. */
+ this.shader = gl.createShader(gluShaderProgram.getGLShaderType(gl, type));
+ assertMsgOptions(gl.getError() == gl.NO_ERROR, 'gl.createShader()', false, true);
+
+ this.setSources = function(source) {
+ this.gl.shaderSource(this.shader, source);
+ assertMsgOptions(this.gl.getError() == this.gl.NO_ERROR, 'glshaderSource()', false, true);
+ this.info.source = source;
+ };
+
+ this.getCompileStatus = function() {
+ return this.info.compileOk;
+ };
+
+ this.compile = function() {
+ this.info.compileOk = false;
+ this.info.compileTimeUs = 0;
+ this.info.infoLog = '';
+
+ /** @type {Date} */ var compileStart = new Date();
+ this.gl.compileShader(this.shader);
+ /** @type {Date} */ var compileEnd = new Date();
+ this.info.compileTimeUs = 1000 * (compileEnd.getTime() - compileStart.getTime());
+
+ assertMsgOptions(this.gl.getError() == this.gl.NO_ERROR, 'gl.compileShader()', false, true);
+
+ var compileStatus = this.gl.getShaderParameter(this.shader, this.gl.COMPILE_STATUS);
+ assertMsgOptions(this.gl.getError() == this.gl.NO_ERROR, 'glGetShaderParameter()', false, true);
+
+ this.info.compileOk = compileStatus;
+ this.info.infoLog = this.gl.getShaderInfoLog(this.shader);
+ };
+
+ this.getShader = function() {
+ return this.shader;
+ };
+
+ this.destroy = function() {
+ this.gl.deleteShader(this.shader);
+ };
+
+};
+/**
+ * Creates gluShaderProgram.ProgramInfo
+ * @constructor
+ */
+gluShaderProgram.ProgramInfo = function() {
+ /** @type {string} */ this.infoLog = ''; /** Link info log. */
+ /** @type {boolean} */ this.linkOk = false; /** Did link succeed? */
+ /** @type {number} */ this.linkTimeUs = 0; /** Link time in microseconds (us). */
+};
+
+/**
+ * Creates program.
+ * Inner methods: attach shaders, bind attributes location, link program and transform Feedback Varyings
+ * @constructor
+ * @param {WebGL2RenderingContext} gl WebGL context
+ * @param {WebGLProgram=} programID
+ */
+gluShaderProgram.Program = function(gl, programID) {
+ this.gl = gl;
+ this.program = programID || null;
+ this.info = new gluShaderProgram.ProgramInfo();
+
+ if (!programID) {
+ this.program = gl.createProgram();
+ assertMsgOptions(gl.getError() == gl.NO_ERROR, 'gl.createProgram()', false, true);
+ }
+};
+
+/**
+ * @return {WebGLProgram}
+ */
+gluShaderProgram.Program.prototype.getProgram = function() { return this.program; };
+
+/**
+ * @return {gluShaderProgram.ProgramInfo}
+ */
+gluShaderProgram.Program.prototype.getInfo = function() { return this.info; };
+
+/**
+ * @param {WebGLShader} shader
+ */
+gluShaderProgram.Program.prototype.attachShader = function(shader) {
+ this.gl.attachShader(this.program, shader);
+ assertMsgOptions(this.gl.getError() == this.gl.NO_ERROR, 'gl.attachShader()', false, true);
+};
+
+/**
+ * @param {WebGLShader} shader
+ */
+gluShaderProgram.Program.prototype.detachShader = function(shader) {
+ this.gl.detachShader(this.program, shader);
+ assertMsgOptions(this.gl.getError() == this.gl.NO_ERROR, 'gl.detachShader()', false, true);
+};
+
+/**
+ * @param {number} location
+ * @param {string} name
+ */
+gluShaderProgram.Program.prototype.bindAttribLocation = function(location, name) {
+ this.gl.bindAttribLocation(this.program, location, name);
+ assertMsgOptions(this.gl.getError() == this.gl.NO_ERROR, 'gl.bindAttribLocation()', false, true);
+};
+
+gluShaderProgram.Program.prototype.link = function() {
+ this.info.linkOk = false;
+ this.info.linkTimeUs = 0;
+ this.info.infoLog = '';
+
+ /** @type {Date} */ var linkStart = new Date();
+ this.gl.linkProgram(this.program);
+ /** @type {Date} */ var linkEnd = new Date();
+ this.info.linkTimeUs = 1000 * (linkEnd.getTime() - linkStart.getTime());
+
+ assertMsgOptions(this.gl.getError() == this.gl.NO_ERROR, 'gl.linkProgram()', false, true);
+
+ var linkStatus = this.gl.getProgramParameter(this.program, this.gl.LINK_STATUS);
+ assertMsgOptions(this.gl.getError() == this.gl.NO_ERROR, 'gl.getProgramParameter()', false, true);
+ this.info.linkOk = linkStatus;
+ this.info.infoLog = this.gl.getProgramInfoLog(this.program);
+ if (!this.info.linkOk)
+ bufferedLogToConsole("program linking: " + this.info.infoLog);
+};
+
+/**
+ * return {boolean}
+ */
+gluShaderProgram.Program.prototype.getLinkStatus = function() {
+ return this.info.linkOk;
+};
+
+/**
+ * @param {Array<string>} varyings
+ * @param {number} bufferMode
+ */
+gluShaderProgram.Program.prototype.transformFeedbackVaryings = function(varyings, bufferMode) {
+ this.gl.transformFeedbackVaryings(this.program, varyings, bufferMode);
+ assertMsgOptions(this.gl.getError() == this.gl.NO_ERROR, 'gl.transformFeedbackVaryings()', false, true);
+};
+
+/**
+ * Assigns gl WebGL context and programSources. Declares array of shaders and new program()
+ * @constructor
+ * @param {WebGL2RenderingContext} gl WebGL context
+ * @param {gluShaderProgram.ProgramSources} programSources
+ */
+gluShaderProgram.ShaderProgram = function(gl, programSources) {
+ this.gl = gl;
+ this.programSources = programSources;
+ this.shaders = [];
+ this.program = new gluShaderProgram.Program(gl);
+
+ /** @type {boolean} */ this.shadersOK = true;
+
+ for (var i = 0; i < programSources.sources.length; i++) {
+ /** @type {gluShaderProgram.Shader} */ var shader = new gluShaderProgram.Shader(gl, programSources.sources[i].type);
+ shader.setSources(programSources.sources[i].source);
+ shader.compile();
+ this.shaders.push(shader);
+ this.shadersOK = this.shadersOK && shader.getCompileStatus();
+ if (!shader.getCompileStatus()) {
+ bufferedLogToConsole('gluShaderProgram.Shader:\n' + programSources.sources[i].source);
+ bufferedLogToConsole('Compile status: ' + shader.getCompileStatus());
+ bufferedLogToConsole('Shader infoLog: ' + shader.info.infoLog);
+ }
+ }
+
+ if (this.shadersOK) {
+ for (var i = 0; i < this.shaders.length; i++)
+ this.program.attachShader(this.shaders[i].getShader());
+
+ for (var attrib in programSources.attribLocationBindings)
+ this.program.bindAttribLocation(programSources.attribLocationBindings[attrib], attrib);
+
+ if (programSources.transformFeedbackBufferMode)
+ if (programSources.transformFeedbackBufferMode === gl.NONE)
+ assertMsgOptions(programSources.transformFeedbackVaryings.length === 0, 'Transform feedback sanity check', false, true);
+ else
+ this.program.transformFeedbackVaryings(programSources.transformFeedbackVaryings, programSources.transformFeedbackBufferMode);
+
+ /* TODO: GLES 3.1: set separable flag */
+
+ this.program.link();
+
+ }
+};
+
+/**
+ * return {WebGLProgram}
+ */
+gluShaderProgram.ShaderProgram.prototype.getProgram = function() {
+ return this.program.program;
+ };
+
+/**
+ * @return {gluShaderProgram.ProgramInfo}
+ */
+gluShaderProgram.ShaderProgram.prototype.getProgramInfo = function() {
+ return this.program.info;
+};
+
+gluShaderProgram.ShaderProgram.prototype.isOk = function() {
+ return this.shadersOK && this.program.getLinkStatus();
+};
+
+gluShaderProgram.containerTypes = {
+ ATTRIB_LOCATION_BINDING: 0,
+ TRANSFORM_FEEDBACK_MODE: 1,
+ TRANSFORM_FEEDBACK_VARYING: 2,
+ TRANSFORM_FEEDBACK_VARYINGS: 3,
+ SHADER_SOURCE: 4,
+ PROGRAM_SEPARABLE: 5,
+ PROGRAM_SOURCES: 6,
+
+ CONTAINER_TYPE_LAST: 7,
+ ATTACHABLE_BEGIN: 0, // ATTRIB_LOCATION_BINDING
+ ATTACHABLE_END: 5 + 1 // PROGRAM_SEPARABLE + 1
+};
+
+/**
+ * @constructor
+ */
+gluShaderProgram.AttribLocationBinding = function(name, location) {
+ this.name = name;
+ this.location = location;
+
+ this.getContainerType = function() {
+ return gluShaderProgram.containerTypes.ATTRIB_LOCATION_BINDING;
+ };
+};
+
+/**
+ * @constructor
+ */
+gluShaderProgram.TransformFeedbackMode = function(mode) {
+ this.mode = mode;
+
+ this.getContainerType = function() {
+ return gluShaderProgram.containerTypes.TRANSFORM_FEEDBACK_MODE;
+ };
+};
+
+/**
+ * @constructor
+ * @param {string} name
+ */
+gluShaderProgram.TransformFeedbackVarying = function(name) {
+ /** @type {string} */ this.name = name;
+
+ this.getContainerType = function() {
+ return gluShaderProgram.containerTypes.TRANSFORM_FEEDBACK_VARYING;
+ };
+};
+
+/**
+ * @constructor
+ * @param {Array<string>} array
+ */
+gluShaderProgram.TransformFeedbackVaryings = function(array) {
+ /** @type {Array<string>} */ this.array = array;
+
+ this.getContainerType = function() {
+ return gluShaderProgram.containerTypes.TRANSFORM_FEEDBACK_VARYINGS;
+ };
+};
+
+/**
+ * @constructor
+ */
+gluShaderProgram.ProgramSeparable = function(separable) {
+ this.separable = separable;
+
+ this.getContainerType = function() {
+ return gluShaderProgram.containerTypes.PROGRAM_SEPARABLE;
+ };
+};
+
+/**
+ * @constructor
+ */
+gluShaderProgram.VertexSource = function(str) {
+ this.shaderType = gluShaderProgram.shaderType.VERTEX;
+ this.source = str;
+
+ this.getContainerType = function() {
+ return gluShaderProgram.containerTypes.SHADER_SOURCE;
+ };
+};
+
+/**
+ * @constructor
+ */
+gluShaderProgram.FragmentSource = function(str) {
+ this.shaderType = gluShaderProgram.shaderType.FRAGMENT;
+ this.source = str;
+
+ this.getContainerType = function() {
+ return gluShaderProgram.containerTypes.SHADER_SOURCE;
+ };
+};
+
+/**
+ * Create gluShaderProgram.ProgramSources.
+ * @constructor
+ */
+gluShaderProgram.ProgramSources = function() {
+ /** @type {Array<gluShaderProgram.ShaderInfo>} */ this.sources = [];
+ this.attribLocationBindings = [];
+ /** @type {Array<string>} */ this.transformFeedbackVaryings = [];
+ this.transformFeedbackBufferMode = 0;
+ this.separable = false;
+};
+
+gluShaderProgram.ProgramSources.prototype.getContainerType = function() {
+ return gluShaderProgram.containerTypes.PROGRAM_SOURCES;
+};
+
+gluShaderProgram.ProgramSources.prototype.add = function(item) {
+ var type = undefined;
+ if (typeof(item.getContainerType) == 'function') {
+ type = item.getContainerType();
+ if (
+ typeof(type) != 'number' ||
+ type < gluShaderProgram.containerTypes.ATTACHABLE_BEGIN ||
+ type >= gluShaderProgram.containerTypes.ATTACHABLE_END
+ ) {
+ type = undefined;
+ }
+ }
+
+ switch (type) {
+ case gluShaderProgram.containerTypes.ATTRIB_LOCATION_BINDING:
+ this.attribLocationBindings.push(item);
+ break;
+
+ case gluShaderProgram.containerTypes.TRANSFORM_FEEDBACK_MODE:
+ this.transformFeedbackBufferMode = item.mode;
+ break;
+
+ case gluShaderProgram.containerTypes.TRANSFORM_FEEDBACK_VARYING:
+ this.transformFeedbackVaryings.push(item.name);
+ break;
+
+ case gluShaderProgram.containerTypes.TRANSFORM_FEEDBACK_VARYINGS:
+ this.transformFeedbackVaryings = this.transformFeedbackVaryings.concat(item.array);
+ break;
+
+ case gluShaderProgram.containerTypes.SHADER_SOURCE:
+ this.sources.push(new gluShaderProgram.ShaderInfo(item.shaderType, item.source));
+ break;
+
+ case gluShaderProgram.containerTypes.PROGRAM_SEPARABLE:
+ this.separable = item.separable;
+ break;
+
+ default:
+ throw new Error('Type \"' + type + '\" cannot be added to gluShaderProgram.ProgramSources.');
+ break;
+ }
+
+ return this;
+};
+
+/**
+ * //! Helper for constructing vertex-fragment source pair.
+ * @param {string} vertexSrc
+ * @param {string} fragmentSrc
+ * @return {gluShaderProgram.ProgramSources}
+ */
+gluShaderProgram.makeVtxFragSources = function(vertexSrc, fragmentSrc) {
+ /** @type  {gluShaderProgram.ProgramSources} */ var sources = new gluShaderProgram.ProgramSources();
+ sources.sources.push(gluShaderProgram.genVertexSource(vertexSrc));
+ sources.sources.push(gluShaderProgram.genFragmentSource(fragmentSrc));
+ return sources;
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluShaderUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluShaderUtil.js
new file mode 100644
index 0000000000..1604dbc613
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluShaderUtil.js
@@ -0,0 +1,795 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.opengl.gluShaderUtil');
+goog.require('framework.delibs.debase.deMath');
+
+goog.scope(function() {
+
+var gluShaderUtil = framework.opengl.gluShaderUtil;
+var deMath = framework.delibs.debase.deMath;
+
+/**
+ * ShadingLanguageVersion
+ * @enum
+ */
+gluShaderUtil.GLSLVersion = {
+ V100_ES: 0, //!< GLSL ES 1.0
+ V300_ES: 1 //!< GLSL ES 3.0
+};
+
+/**
+ * gluShaderUtil.glslVersionUsesInOutQualifiers
+ * @param {gluShaderUtil.GLSLVersion} version
+ * @return {boolean}
+ */
+gluShaderUtil.glslVersionUsesInOutQualifiers = function(version) {
+ return version == gluShaderUtil.GLSLVersion.V300_ES;
+};
+
+/**
+ * gluShaderUtil.isGLSLVersionSupported
+ * @param {WebGL2RenderingContext|WebGLRenderingContextBase} ctx
+ * @param {gluShaderUtil.GLSLVersion} version
+ * @return {boolean}
+ */
+gluShaderUtil.isGLSLVersionSupported = function(ctx, version) {
+ return version <= gluShaderUtil.getGLSLVersion(ctx);
+};
+
+/**
+ * gluShaderUtil.getGLSLVersion - Returns a gluShaderUtil.GLSLVersion based on a given webgl context.
+ * @param {WebGL2RenderingContext|WebGLRenderingContextBase} gl
+ * @return {gluShaderUtil.GLSLVersion}
+ */
+gluShaderUtil.getGLSLVersion = function(gl) {
+ var glslversion = gl.getParameter(gl.SHADING_LANGUAGE_VERSION);
+
+ // TODO: Versions are not yet well implemented... Firefox returns GLSL ES 1.0 in some cases,
+ // and Chromium returns GLSL ES 2.0 in some cases. Returning the right version for
+ // testing.
+ // return gluShaderUtil.GLSLVersion.V300_ES;
+
+ if (glslversion.indexOf('WebGL GLSL ES 1.0') != -1) return gluShaderUtil.GLSLVersion.V100_ES;
+ if (glslversion.indexOf('WebGL GLSL ES 3.0') != -1) return gluShaderUtil.GLSLVersion.V300_ES;
+
+ throw new Error('Invalid WebGL version');
+};
+
+/**
+ * gluShaderUtil.getGLSLVersionDeclaration - Returns a string declaration for the glsl version in a shader.
+ * @param {gluShaderUtil.GLSLVersion} version
+ * @return {string}
+ */
+gluShaderUtil.getGLSLVersionDeclaration = function(version) {
+ /** @type {Array<string>} */ var s_decl =
+ [
+ '#version 100',
+ '#version 300 es'
+ ];
+
+ if (version > s_decl.length - 1)
+ throw new Error('Unsupported GLSL version.');
+
+ return s_decl[version];
+};
+
+/**
+ * gluShaderUtil.getGLSLVersionString - Returns the same thing as
+ * getGLSLVersionDeclaration() but without the substring '#version'
+ * @param {gluShaderUtil.GLSLVersion} version
+ * @return {string}
+ */
+gluShaderUtil.getGLSLVersionString = function(version) {
+ /** @type {Array<string>} */ var s_decl =
+ [
+ '100',
+ '300 es'
+ ];
+
+ if (version > s_decl.length - 1)
+ throw new Error('Unsupported GLSL version.');
+
+ return s_decl[version];
+};
+
+/**
+ * @enum
+ */
+gluShaderUtil.precision = {
+ PRECISION_LOWP: 0,
+ PRECISION_MEDIUMP: 1,
+ PRECISION_HIGHP: 2
+};
+
+gluShaderUtil.getPrecisionName = function(prec) {
+ var s_names = [
+ 'lowp',
+ 'mediump',
+ 'highp'
+ ];
+
+ return s_names[prec];
+};
+
+/**
+ * The Type constants
+ * @enum {number}
+ */
+gluShaderUtil.DataType = {
+ INVALID: 0,
+
+ FLOAT: 1,
+ FLOAT_VEC2: 2,
+ FLOAT_VEC3: 3,
+ FLOAT_VEC4: 4,
+ FLOAT_MAT2: 5,
+ FLOAT_MAT2X3: 6,
+ FLOAT_MAT2X4: 7,
+ FLOAT_MAT3X2: 8,
+ FLOAT_MAT3: 9,
+ FLOAT_MAT3X4: 10,
+ FLOAT_MAT4X2: 11,
+ FLOAT_MAT4X3: 12,
+ FLOAT_MAT4: 13,
+
+ INT: 14,
+ INT_VEC2: 15,
+ INT_VEC3: 16,
+ INT_VEC4: 17,
+
+ UINT: 18,
+ UINT_VEC2: 19,
+ UINT_VEC3: 20,
+ UINT_VEC4: 21,
+
+ BOOL: 22,
+ BOOL_VEC2: 23,
+ BOOL_VEC3: 24,
+ BOOL_VEC4: 25,
+
+ SAMPLER_2D: 26,
+ SAMPLER_CUBE: 27,
+ SAMPLER_2D_ARRAY: 28,
+ SAMPLER_3D: 29,
+
+ SAMPLER_2D_SHADOW: 30,
+ SAMPLER_CUBE_SHADOW: 31,
+ SAMPLER_2D_ARRAY_SHADOW: 32,
+
+ INT_SAMPLER_2D: 33,
+ INT_SAMPLER_CUBE: 34,
+ INT_SAMPLER_2D_ARRAY: 35,
+ INT_SAMPLER_3D: 36,
+
+ UINT_SAMPLER_2D: 37,
+ UINT_SAMPLER_CUBE: 38,
+ UINT_SAMPLER_2D_ARRAY: 39,
+ UINT_SAMPLER_3D: 40
+};
+
+/**
+ * Returns type of float scalars
+ * @param {gluShaderUtil.DataType} dataType
+ * @return {string} type of float scalar
+ */
+gluShaderUtil.getDataTypeFloatScalars = function(dataType) {
+
+ switch (dataType) {
+ case gluShaderUtil.DataType.FLOAT: return 'float';
+ case gluShaderUtil.DataType.FLOAT_VEC2: return 'vec2';
+ case gluShaderUtil.DataType.FLOAT_VEC3: return 'vec3';
+ case gluShaderUtil.DataType.FLOAT_VEC4: return 'vec4';
+ case gluShaderUtil.DataType.FLOAT_MAT2: return 'mat2';
+ case gluShaderUtil.DataType.FLOAT_MAT2X3: return 'mat2x3';
+ case gluShaderUtil.DataType.FLOAT_MAT2X4: return 'mat2x4';
+ case gluShaderUtil.DataType.FLOAT_MAT3X2: return 'mat3x2';
+ case gluShaderUtil.DataType.FLOAT_MAT3: return 'mat3';
+ case gluShaderUtil.DataType.FLOAT_MAT3X4: return 'mat3x4';
+ case gluShaderUtil.DataType.FLOAT_MAT4X2: return 'mat4x2';
+ case gluShaderUtil.DataType.FLOAT_MAT4X3: return 'mat4x3';
+ case gluShaderUtil.DataType.FLOAT_MAT4: return 'mat4';
+ case gluShaderUtil.DataType.INT: return 'float';
+ case gluShaderUtil.DataType.INT_VEC2: return 'vec2';
+ case gluShaderUtil.DataType.INT_VEC3: return 'vec3';
+ case gluShaderUtil.DataType.INT_VEC4: return 'vec4';
+ case gluShaderUtil.DataType.UINT: return 'float';
+ case gluShaderUtil.DataType.UINT_VEC2: return 'vec2';
+ case gluShaderUtil.DataType.UINT_VEC3: return 'vec3';
+ case gluShaderUtil.DataType.UINT_VEC4: return 'vec4';
+ case gluShaderUtil.DataType.BOOL: return 'float';
+ case gluShaderUtil.DataType.BOOL_VEC2: return 'vec2';
+ case gluShaderUtil.DataType.BOOL_VEC3: return 'vec3';
+ case gluShaderUtil.DataType.BOOL_VEC4: return 'vec4';
+ }
+ throw Error('Unrecognized dataType ' + dataType);
+};
+
+/**
+ * gluShaderUtil.getDataTypeVector
+ * @param {gluShaderUtil.DataType} scalarType
+ * @param {number} size
+ * @return {gluShaderUtil.DataType}
+ */
+gluShaderUtil.getDataTypeVector = function(scalarType, size) {
+ var floats = [gluShaderUtil.DataType.FLOAT,
+ gluShaderUtil.DataType.FLOAT_VEC2,
+ gluShaderUtil.DataType.FLOAT_VEC3,
+ gluShaderUtil.DataType.FLOAT_VEC4];
+ var ints = [gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT_VEC2,
+ gluShaderUtil.DataType.INT_VEC3,
+ gluShaderUtil.DataType.INT_VEC4];
+ var uints = [gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT_VEC2,
+ gluShaderUtil.DataType.UINT_VEC3,
+ gluShaderUtil.DataType.UINT_VEC4];
+ var bools = [gluShaderUtil.DataType.BOOL,
+ gluShaderUtil.DataType.BOOL_VEC2,
+ gluShaderUtil.DataType.BOOL_VEC3,
+ gluShaderUtil.DataType.BOOL_VEC4];
+
+ switch (scalarType) {
+ case gluShaderUtil.DataType.FLOAT: return floats[size - 1];
+ case gluShaderUtil.DataType.INT: return ints[size - 1];
+ case gluShaderUtil.DataType.UINT: return uints[size - 1];
+ case gluShaderUtil.DataType.BOOL: return bools[size - 1];
+ default:
+ throw new Error('Scalar type is not a vectoe:' + scalarType);
+ }
+};
+
+/**
+ * gluShaderUtil.getDataTypeFloatVec
+ * @param {number} vecSize
+ * @return {gluShaderUtil.DataType}
+ */
+gluShaderUtil.getDataTypeFloatVec = function(vecSize) {
+ return gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.FLOAT, vecSize);
+};
+
+/**
+ * gluShaderUtil.isDataTypeBoolOrBVec
+ * @param {gluShaderUtil.DataType} dataType
+ * @return {boolean}
+ */
+gluShaderUtil.isDataTypeBoolOrBVec = function(dataType) {
+ return (dataType >= gluShaderUtil.DataType.BOOL) && (dataType <= gluShaderUtil.DataType.BOOL_VEC4);
+};
+
+/**
+ * Returns type of scalar
+ * @param {gluShaderUtil.DataType} dataType shader
+ * @return {string} type of scalar type
+ */
+gluShaderUtil.getDataTypeScalarType = function(dataType) {
+ switch (dataType) {
+ case gluShaderUtil.DataType.FLOAT: return 'float';
+ case gluShaderUtil.DataType.FLOAT_VEC2: return 'float';
+ case gluShaderUtil.DataType.FLOAT_VEC3: return 'float';
+ case gluShaderUtil.DataType.FLOAT_VEC4: return 'float';
+ case gluShaderUtil.DataType.FLOAT_MAT2: return 'float';
+ case gluShaderUtil.DataType.FLOAT_MAT2X3: return 'float';
+ case gluShaderUtil.DataType.FLOAT_MAT2X4: return 'float';
+ case gluShaderUtil.DataType.FLOAT_MAT3X2: return 'float';
+ case gluShaderUtil.DataType.FLOAT_MAT3: return 'float';
+ case gluShaderUtil.DataType.FLOAT_MAT3X4: return 'float';
+ case gluShaderUtil.DataType.FLOAT_MAT4X2: return 'float';
+ case gluShaderUtil.DataType.FLOAT_MAT4X3: return 'float';
+ case gluShaderUtil.DataType.FLOAT_MAT4: return 'float';
+ case gluShaderUtil.DataType.INT: return 'int';
+ case gluShaderUtil.DataType.INT_VEC2: return 'int';
+ case gluShaderUtil.DataType.INT_VEC3: return 'int';
+ case gluShaderUtil.DataType.INT_VEC4: return 'int';
+ case gluShaderUtil.DataType.UINT: return 'uint';
+ case gluShaderUtil.DataType.UINT_VEC2: return 'uint';
+ case gluShaderUtil.DataType.UINT_VEC3: return 'uint';
+ case gluShaderUtil.DataType.UINT_VEC4: return 'uint';
+ case gluShaderUtil.DataType.BOOL: return 'bool';
+ case gluShaderUtil.DataType.BOOL_VEC2: return 'bool';
+ case gluShaderUtil.DataType.BOOL_VEC3: return 'bool';
+ case gluShaderUtil.DataType.BOOL_VEC4: return 'bool';
+ case gluShaderUtil.DataType.SAMPLER_2D: return 'sampler2D';
+ case gluShaderUtil.DataType.SAMPLER_CUBE: return 'samplerCube';
+ case gluShaderUtil.DataType.SAMPLER_2D_ARRAY: return 'sampler2DArray';
+ case gluShaderUtil.DataType.SAMPLER_3D: return 'sampler3D';
+ case gluShaderUtil.DataType.SAMPLER_2D_SHADOW: return 'sampler2DShadow';
+ case gluShaderUtil.DataType.SAMPLER_CUBE_SHADOW: return 'samplerCubeShadow';
+ case gluShaderUtil.DataType.SAMPLER_2D_ARRAY_SHADOW: return 'sampler2DArrayShadow';
+ case gluShaderUtil.DataType.INT_SAMPLER_2D: return 'isampler2D';
+ case gluShaderUtil.DataType.INT_SAMPLER_CUBE: return 'isamplerCube';
+ case gluShaderUtil.DataType.INT_SAMPLER_2D_ARRAY: return 'isampler2DArray';
+ case gluShaderUtil.DataType.INT_SAMPLER_3D: return 'isampler3D';
+ case gluShaderUtil.DataType.UINT_SAMPLER_2D: return 'usampler2D';
+ case gluShaderUtil.DataType.UINT_SAMPLER_CUBE: return 'usamplerCube';
+ case gluShaderUtil.DataType.UINT_SAMPLER_2D_ARRAY: return 'usampler2DArray';
+ case gluShaderUtil.DataType.UINT_SAMPLER_3D: return 'usampler3D';
+ }
+ throw new Error('Unrecognized datatype:' + dataType);
+};
+
+/**
+ * Returns type of scalar
+ * @param {?gluShaderUtil.DataType} dataType shader
+ * @return {gluShaderUtil.DataType} type of scalar type
+ */
+gluShaderUtil.getDataTypeScalarTypeAsDataType = function(dataType) {
+ switch (dataType) {
+ case gluShaderUtil.DataType.FLOAT: return gluShaderUtil.DataType.FLOAT;
+ case gluShaderUtil.DataType.FLOAT_VEC2: return gluShaderUtil.DataType.FLOAT;
+ case gluShaderUtil.DataType.FLOAT_VEC3: return gluShaderUtil.DataType.FLOAT;
+ case gluShaderUtil.DataType.FLOAT_VEC4: return gluShaderUtil.DataType.FLOAT;
+ case gluShaderUtil.DataType.FLOAT_MAT2: return gluShaderUtil.DataType.FLOAT;
+ case gluShaderUtil.DataType.FLOAT_MAT2X3: return gluShaderUtil.DataType.FLOAT;
+ case gluShaderUtil.DataType.FLOAT_MAT2X4: return gluShaderUtil.DataType.FLOAT;
+ case gluShaderUtil.DataType.FLOAT_MAT3X2: return gluShaderUtil.DataType.FLOAT;
+ case gluShaderUtil.DataType.FLOAT_MAT3: return gluShaderUtil.DataType.FLOAT;
+ case gluShaderUtil.DataType.FLOAT_MAT3X4: return gluShaderUtil.DataType.FLOAT;
+ case gluShaderUtil.DataType.FLOAT_MAT4X2: return gluShaderUtil.DataType.FLOAT;
+ case gluShaderUtil.DataType.FLOAT_MAT4X3: return gluShaderUtil.DataType.FLOAT;
+ case gluShaderUtil.DataType.FLOAT_MAT4: return gluShaderUtil.DataType.FLOAT;
+ case gluShaderUtil.DataType.INT: return gluShaderUtil.DataType.INT;
+ case gluShaderUtil.DataType.INT_VEC2: return gluShaderUtil.DataType.INT;
+ case gluShaderUtil.DataType.INT_VEC3: return gluShaderUtil.DataType.INT;
+ case gluShaderUtil.DataType.INT_VEC4: return gluShaderUtil.DataType.INT;
+ case gluShaderUtil.DataType.UINT: return gluShaderUtil.DataType.UINT;
+ case gluShaderUtil.DataType.UINT_VEC2: return gluShaderUtil.DataType.UINT;
+ case gluShaderUtil.DataType.UINT_VEC3: return gluShaderUtil.DataType.UINT;
+ case gluShaderUtil.DataType.UINT_VEC4: return gluShaderUtil.DataType.UINT;
+ case gluShaderUtil.DataType.BOOL: return gluShaderUtil.DataType.BOOL;
+ case gluShaderUtil.DataType.BOOL_VEC2: return gluShaderUtil.DataType.BOOL;
+ case gluShaderUtil.DataType.BOOL_VEC3: return gluShaderUtil.DataType.BOOL;
+ case gluShaderUtil.DataType.BOOL_VEC4: return gluShaderUtil.DataType.BOOL;
+ case gluShaderUtil.DataType.SAMPLER_2D:
+ case gluShaderUtil.DataType.SAMPLER_CUBE:
+ case gluShaderUtil.DataType.SAMPLER_2D_ARRAY:
+ case gluShaderUtil.DataType.SAMPLER_3D:
+ case gluShaderUtil.DataType.SAMPLER_2D_SHADOW:
+ case gluShaderUtil.DataType.SAMPLER_CUBE_SHADOW:
+ case gluShaderUtil.DataType.SAMPLER_2D_ARRAY_SHADOW:
+ case gluShaderUtil.DataType.INT_SAMPLER_2D:
+ case gluShaderUtil.DataType.INT_SAMPLER_CUBE:
+ case gluShaderUtil.DataType.INT_SAMPLER_2D_ARRAY:
+ case gluShaderUtil.DataType.INT_SAMPLER_3D:
+ case gluShaderUtil.DataType.UINT_SAMPLER_2D:
+ case gluShaderUtil.DataType.UINT_SAMPLER_CUBE:
+ case gluShaderUtil.DataType.UINT_SAMPLER_2D_ARRAY:
+ case gluShaderUtil.DataType.UINT_SAMPLER_3D:
+ return dataType;
+ }
+ throw Error('Unrecognized dataType ' + dataType);
+};
+
+/**
+ * Checks if dataType is integer or vectors of integers
+ * @param {gluShaderUtil.DataType} dataType shader
+ * @return {boolean} Is dataType integer or integer vector
+ */
+gluShaderUtil.isDataTypeIntOrIVec = function(dataType) {
+ /** @type {boolean} */ var retVal = false;
+ switch (dataType) {
+ case gluShaderUtil.DataType.INT:
+ case gluShaderUtil.DataType.INT_VEC2:
+ case gluShaderUtil.DataType.INT_VEC3:
+ case gluShaderUtil.DataType.INT_VEC4:
+ retVal = true;
+ }
+
+ return retVal;
+};
+
+/**
+ * Checks if dataType is unsigned integer or vectors of unsigned integers
+ * @param {gluShaderUtil.DataType} dataType shader
+ * @return {boolean} Is dataType unsigned integer or unsigned integer vector
+ */
+gluShaderUtil.isDataTypeUintOrUVec = function(dataType) {
+ /** @type {boolean} */ var retVal = false;
+ switch (dataType) {
+ case gluShaderUtil.DataType.UINT:
+ case gluShaderUtil.DataType.UINT_VEC2:
+ case gluShaderUtil.DataType.UINT_VEC3:
+ case gluShaderUtil.DataType.UINT_VEC4:
+ retVal = true;
+ }
+
+ return retVal;
+};
+
+/**
+* Returns type of scalar size
+* @param {gluShaderUtil.DataType} dataType shader
+* @return {number} with size of the type of scalar
+*/
+gluShaderUtil.getDataTypeScalarSize = function(dataType) {
+ switch (dataType) {
+ case gluShaderUtil.DataType.FLOAT: return 1;
+ case gluShaderUtil.DataType.FLOAT_VEC2: return 2;
+ case gluShaderUtil.DataType.FLOAT_VEC3: return 3;
+ case gluShaderUtil.DataType.FLOAT_VEC4: return 4;
+ case gluShaderUtil.DataType.FLOAT_MAT2: return 4;
+ case gluShaderUtil.DataType.FLOAT_MAT2X3: return 6;
+ case gluShaderUtil.DataType.FLOAT_MAT2X4: return 8;
+ case gluShaderUtil.DataType.FLOAT_MAT3X2: return 6;
+ case gluShaderUtil.DataType.FLOAT_MAT3: return 9;
+ case gluShaderUtil.DataType.FLOAT_MAT3X4: return 12;
+ case gluShaderUtil.DataType.FLOAT_MAT4X2: return 8;
+ case gluShaderUtil.DataType.FLOAT_MAT4X3: return 12;
+ case gluShaderUtil.DataType.FLOAT_MAT4: return 16;
+ case gluShaderUtil.DataType.INT: return 1;
+ case gluShaderUtil.DataType.INT_VEC2: return 2;
+ case gluShaderUtil.DataType.INT_VEC3: return 3;
+ case gluShaderUtil.DataType.INT_VEC4: return 4;
+ case gluShaderUtil.DataType.UINT: return 1;
+ case gluShaderUtil.DataType.UINT_VEC2: return 2;
+ case gluShaderUtil.DataType.UINT_VEC3: return 3;
+ case gluShaderUtil.DataType.UINT_VEC4: return 4;
+ case gluShaderUtil.DataType.BOOL: return 1;
+ case gluShaderUtil.DataType.BOOL_VEC2: return 2;
+ case gluShaderUtil.DataType.BOOL_VEC3: return 3;
+ case gluShaderUtil.DataType.BOOL_VEC4: return 4;
+ case gluShaderUtil.DataType.SAMPLER_2D: return 1;
+ case gluShaderUtil.DataType.SAMPLER_CUBE: return 1;
+ case gluShaderUtil.DataType.SAMPLER_2D_ARRAY: return 1;
+ case gluShaderUtil.DataType.SAMPLER_3D: return 1;
+ case gluShaderUtil.DataType.SAMPLER_2D_SHADOW: return 1;
+ case gluShaderUtil.DataType.SAMPLER_CUBE_SHADOW: return 1;
+ case gluShaderUtil.DataType.SAMPLER_2D_ARRAY_SHADOW: return 1;
+ case gluShaderUtil.DataType.INT_SAMPLER_2D: return 1;
+ case gluShaderUtil.DataType.INT_SAMPLER_CUBE: return 1;
+ case gluShaderUtil.DataType.INT_SAMPLER_2D_ARRAY: return 1;
+ case gluShaderUtil.DataType.INT_SAMPLER_3D: return 1;
+ case gluShaderUtil.DataType.UINT_SAMPLER_2D: return 1;
+ case gluShaderUtil.DataType.UINT_SAMPLER_CUBE: return 1;
+ case gluShaderUtil.DataType.UINT_SAMPLER_2D_ARRAY: return 1;
+ case gluShaderUtil.DataType.UINT_SAMPLER_3D: return 1;
+ }
+ throw Error('Unrecognized dataType ' + dataType);
+};
+
+/**
+ * Checks if dataType is float or vector
+ * @param {?gluShaderUtil.DataType} dataType shader
+ * @return {boolean} Is dataType float or vector
+ */
+gluShaderUtil.isDataTypeFloatOrVec = function(dataType) {
+ switch (dataType) {
+ case gluShaderUtil.DataType.FLOAT:
+ case gluShaderUtil.DataType.FLOAT_VEC2:
+ case gluShaderUtil.DataType.FLOAT_VEC3:
+ case gluShaderUtil.DataType.FLOAT_VEC4:
+ return true;
+ }
+ return false;
+};
+
+/**
+ * Checks if dataType is a matrix
+ * @param {gluShaderUtil.DataType} dataType shader
+ * @return {boolean} Is dataType matrix or not
+ */
+gluShaderUtil.isDataTypeMatrix = function(dataType) {
+ switch (dataType) {
+ case gluShaderUtil.DataType.FLOAT_MAT2:
+ case gluShaderUtil.DataType.FLOAT_MAT2X3:
+ case gluShaderUtil.DataType.FLOAT_MAT2X4:
+ case gluShaderUtil.DataType.FLOAT_MAT3X2:
+ case gluShaderUtil.DataType.FLOAT_MAT3:
+ case gluShaderUtil.DataType.FLOAT_MAT3X4:
+ case gluShaderUtil.DataType.FLOAT_MAT4X2:
+ case gluShaderUtil.DataType.FLOAT_MAT4X3:
+ case gluShaderUtil.DataType.FLOAT_MAT4:
+ return true;
+ }
+ return false;
+};
+
+/**
+ * Checks if dataType is a vector
+ * @param {gluShaderUtil.DataType} dataType shader
+ * @return {boolean} Is dataType vector or not
+ */
+gluShaderUtil.isDataTypeScalar = function(dataType) {
+ switch (dataType) {
+ case gluShaderUtil.DataType.FLOAT:
+ case gluShaderUtil.DataType.INT:
+ case gluShaderUtil.DataType.UINT:
+ case gluShaderUtil.DataType.BOOL:
+ return true;
+ }
+ return false;
+};
+
+/**
+ * Checks if dataType is a vector
+ * @param {gluShaderUtil.DataType} dataType shader
+ * @return {boolean} Is dataType vector or not
+ */
+gluShaderUtil.isDataTypeVector = function(dataType) {
+ switch (dataType) {
+ case gluShaderUtil.DataType.FLOAT_VEC2:
+ case gluShaderUtil.DataType.FLOAT_VEC3:
+ case gluShaderUtil.DataType.FLOAT_VEC4:
+ case gluShaderUtil.DataType.INT_VEC2:
+ case gluShaderUtil.DataType.INT_VEC3:
+ case gluShaderUtil.DataType.INT_VEC4:
+ case gluShaderUtil.DataType.UINT_VEC2:
+ case gluShaderUtil.DataType.UINT_VEC3:
+ case gluShaderUtil.DataType.UINT_VEC4:
+ case gluShaderUtil.DataType.BOOL_VEC2:
+ case gluShaderUtil.DataType.BOOL_VEC3:
+ case gluShaderUtil.DataType.BOOL_VEC4:
+ return true;
+ }
+ return false;
+};
+
+/**
+ * Checks if dataType is a vector or a scalar type
+ * @param {gluShaderUtil.DataType} dataType shader
+ * @return {boolean} Is dataType vector or scalar or not
+ */
+gluShaderUtil.isDataTypeScalarOrVector = function(dataType) {
+ switch (dataType) {
+ case gluShaderUtil.DataType.FLOAT:
+ case gluShaderUtil.DataType.FLOAT_VEC2:
+ case gluShaderUtil.DataType.FLOAT_VEC3:
+ case gluShaderUtil.DataType.FLOAT_VEC4:
+ case gluShaderUtil.DataType.INT:
+ case gluShaderUtil.DataType.INT_VEC2:
+ case gluShaderUtil.DataType.INT_VEC3:
+ case gluShaderUtil.DataType.INT_VEC4:
+ case gluShaderUtil.DataType.UINT:
+ case gluShaderUtil.DataType.UINT_VEC2:
+ case gluShaderUtil.DataType.UINT_VEC3:
+ case gluShaderUtil.DataType.UINT_VEC4:
+ case gluShaderUtil.DataType.BOOL:
+ case gluShaderUtil.DataType.BOOL_VEC2:
+ case gluShaderUtil.DataType.BOOL_VEC3:
+ case gluShaderUtil.DataType.BOOL_VEC4:
+ return true;
+ }
+ return false;
+};
+
+/**
+ * Checks if dataType is a sampler
+ * @param {gluShaderUtil.DataType} dataType shader
+ * @return {boolean} Is dataType vector or scalar or not
+ */
+gluShaderUtil.isDataTypeSampler = function(dataType) {
+ return (dataType >= gluShaderUtil.DataType.SAMPLER_2D) && (dataType <= gluShaderUtil.DataType.UINT_SAMPLER_3D);
+};
+
+/**
+ * Returns a gluShaderUtil.DataType based on given rows and columns
+ * @param {number} numCols
+ * @param {number} numRows
+ * @return {gluShaderUtil.DataType}
+ */
+gluShaderUtil.getDataTypeMatrix = function(numCols, numRows) {
+ if (!(deMath.deInRange32(numCols, 2, 4) && deMath.deInRange32(numRows, 2, 4)))
+ throw new Error('Out of bounds: (' + numCols + ',' + numRows + ')');
+
+ var size = numCols.toString() + 'x' + numRows.toString();
+ var datatypes = {
+ '2x2': gluShaderUtil.DataType.FLOAT_MAT2,
+ '2x3': gluShaderUtil.DataType.FLOAT_MAT2X3,
+ '2x4': gluShaderUtil.DataType.FLOAT_MAT2X4,
+ '3x2': gluShaderUtil.DataType.FLOAT_MAT3X2,
+ '3x3': gluShaderUtil.DataType.FLOAT_MAT3,
+ '3x4': gluShaderUtil.DataType.FLOAT_MAT3X4,
+ '4x2': gluShaderUtil.DataType.FLOAT_MAT4X2,
+ '4x3': gluShaderUtil.DataType.FLOAT_MAT4X3,
+ '4x4': gluShaderUtil.DataType.FLOAT_MAT4
+ };
+ return datatypes[size];
+};
+
+/**
+* Returns number of rows of a gluShaderUtil.DataType Matrix
+* @param {gluShaderUtil.DataType} dataType shader
+* @return {number} with number of rows depending on gluShaderUtil.DataType Matrix
+*/
+gluShaderUtil.getDataTypeMatrixNumRows = function(dataType) {
+ switch (dataType) {
+ case gluShaderUtil.DataType.FLOAT_MAT2: return 2;
+ case gluShaderUtil.DataType.FLOAT_MAT2X3: return 3;
+ case gluShaderUtil.DataType.FLOAT_MAT2X4: return 4;
+ case gluShaderUtil.DataType.FLOAT_MAT3X2: return 2;
+ case gluShaderUtil.DataType.FLOAT_MAT3: return 3;
+ case gluShaderUtil.DataType.FLOAT_MAT3X4: return 4;
+ case gluShaderUtil.DataType.FLOAT_MAT4X2: return 2;
+ case gluShaderUtil.DataType.FLOAT_MAT4X3: return 3;
+ case gluShaderUtil.DataType.FLOAT_MAT4: return 4;
+ }
+ throw Error('Unrecognized dataType ' + dataType);
+};
+
+/**
+* Returns number of columns of a gluShaderUtil.DataType Matrix
+* @param {gluShaderUtil.DataType} dataType shader
+* @return {number} with number of columns depending on gluShaderUtil.DataType Matrix
+*/
+gluShaderUtil.getDataTypeMatrixNumColumns = function(dataType) {
+ switch (dataType) {
+ case gluShaderUtil.DataType.FLOAT_MAT2: return 2;
+ case gluShaderUtil.DataType.FLOAT_MAT2X3: return 2;
+ case gluShaderUtil.DataType.FLOAT_MAT2X4: return 2;
+ case gluShaderUtil.DataType.FLOAT_MAT3X2: return 3;
+ case gluShaderUtil.DataType.FLOAT_MAT3: return 3;
+ case gluShaderUtil.DataType.FLOAT_MAT3X4: return 3;
+ case gluShaderUtil.DataType.FLOAT_MAT4X2: return 4;
+ case gluShaderUtil.DataType.FLOAT_MAT4X3: return 4;
+ case gluShaderUtil.DataType.FLOAT_MAT4: return 4;
+ }
+ throw Error('Unrecognized dataType ' + dataType);
+};
+
+/**
+ * @param {gluShaderUtil.DataType} dataType
+ * @return {number}
+ */
+gluShaderUtil.getDataTypeNumLocations = function(dataType) {
+ if (gluShaderUtil.isDataTypeScalarOrVector(dataType))
+ return 1;
+ else if (gluShaderUtil.isDataTypeMatrix(dataType))
+ return gluShaderUtil.getDataTypeMatrixNumColumns(dataType);
+ throw Error('Unrecognized dataType ' + dataType);
+};
+
+/**
+ * @param {gluShaderUtil.DataType} dataType
+ * @return {number}
+ */
+gluShaderUtil.getDataTypeNumComponents = function(dataType) {
+ if (gluShaderUtil.isDataTypeScalarOrVector(dataType))
+ return gluShaderUtil.getDataTypeScalarSize(dataType);
+ else if (gluShaderUtil.isDataTypeMatrix(dataType))
+ return gluShaderUtil.getDataTypeMatrixNumRows(dataType);
+
+ throw Error('Unrecognized dataType ' + dataType);
+};
+
+/**
+ * Returns name of the dataType
+ * @param {?gluShaderUtil.DataType} dataType shader
+ * @return {string} dataType name
+ */
+gluShaderUtil.getDataTypeName = function(dataType) {
+ switch (dataType) {
+ case gluShaderUtil.DataType.INVALID: return 'invalid';
+
+ case gluShaderUtil.DataType.FLOAT: return 'float';
+ case gluShaderUtil.DataType.FLOAT_VEC2: return 'vec2';
+ case gluShaderUtil.DataType.FLOAT_VEC3: return 'vec3';
+ case gluShaderUtil.DataType.FLOAT_VEC4: return 'vec4';
+ case gluShaderUtil.DataType.FLOAT_MAT2: return 'mat2';
+ case gluShaderUtil.DataType.FLOAT_MAT2X3: return 'mat2x3';
+ case gluShaderUtil.DataType.FLOAT_MAT2X4: return 'mat2x4';
+ case gluShaderUtil.DataType.FLOAT_MAT3X2: return 'mat3x2';
+ case gluShaderUtil.DataType.FLOAT_MAT3: return 'mat3';
+ case gluShaderUtil.DataType.FLOAT_MAT3X4: return 'mat3x4';
+ case gluShaderUtil.DataType.FLOAT_MAT4X2: return 'mat4x2';
+ case gluShaderUtil.DataType.FLOAT_MAT4X3: return 'mat4x3';
+ case gluShaderUtil.DataType.FLOAT_MAT4: return 'mat4';
+
+ case gluShaderUtil.DataType.INT: return 'int';
+ case gluShaderUtil.DataType.INT_VEC2: return 'ivec2';
+ case gluShaderUtil.DataType.INT_VEC3: return 'ivec3';
+ case gluShaderUtil.DataType.INT_VEC4: return 'ivec4';
+
+ case gluShaderUtil.DataType.UINT: return 'uint';
+ case gluShaderUtil.DataType.UINT_VEC2: return 'uvec2';
+ case gluShaderUtil.DataType.UINT_VEC3: return 'uvec3';
+ case gluShaderUtil.DataType.UINT_VEC4: return 'uvec4';
+
+ case gluShaderUtil.DataType.BOOL: return 'bool';
+ case gluShaderUtil.DataType.BOOL_VEC2: return 'bvec2';
+ case gluShaderUtil.DataType.BOOL_VEC3: return 'bvec3';
+ case gluShaderUtil.DataType.BOOL_VEC4: return 'bvec4';
+
+ case gluShaderUtil.DataType.SAMPLER_2D: return 'sampler2D';
+ case gluShaderUtil.DataType.SAMPLER_CUBE: return 'samplerCube';
+ case gluShaderUtil.DataType.SAMPLER_2D_ARRAY: return 'sampler2DArray';
+ case gluShaderUtil.DataType.SAMPLER_3D: return 'sampler3D';
+
+ case gluShaderUtil.DataType.SAMPLER_2D_SHADOW: return 'sampler2DShadow';
+ case gluShaderUtil.DataType.SAMPLER_CUBE_SHADOW: return 'samplerCubeShadow';
+ case gluShaderUtil.DataType.SAMPLER_2D_ARRAY_SHADOW: return 'sampler2DArrayShadow';
+
+ case gluShaderUtil.DataType.INT_SAMPLER_2D: return 'isampler2D';
+ case gluShaderUtil.DataType.INT_SAMPLER_CUBE: return 'isamplerCube';
+ case gluShaderUtil.DataType.INT_SAMPLER_2D_ARRAY: return 'isampler2DArray';
+ case gluShaderUtil.DataType.INT_SAMPLER_3D: return 'isampler3D';
+
+ case gluShaderUtil.DataType.UINT_SAMPLER_2D: return 'usampler2D';
+ case gluShaderUtil.DataType.UINT_SAMPLER_CUBE: return 'usamplerCube';
+ case gluShaderUtil.DataType.UINT_SAMPLER_2D_ARRAY: return 'usampler2DArray';
+ case gluShaderUtil.DataType.UINT_SAMPLER_3D: return 'usampler3D';
+ }
+ throw Error('Unrecognized dataType ' + dataType);
+};
+
+/**
+ * Returns the gluShaderUtil.DataType from the GL type
+ * @param {number} glType
+ * @return {gluShaderUtil.DataType}
+ */
+gluShaderUtil.getDataTypeFromGLType = function(glType) {
+ switch (glType) {
+ case gl.FLOAT: return gluShaderUtil.DataType.FLOAT;
+ case gl.FLOAT_VEC2: return gluShaderUtil.DataType.FLOAT_VEC2;
+ case gl.FLOAT_VEC3: return gluShaderUtil.DataType.FLOAT_VEC3;
+ case gl.FLOAT_VEC4: return gluShaderUtil.DataType.FLOAT_VEC4;
+
+ case gl.FLOAT_MAT2: return gluShaderUtil.DataType.FLOAT_MAT2;
+ case gl.FLOAT_MAT2x3: return gluShaderUtil.DataType.FLOAT_MAT2X3;
+ case gl.FLOAT_MAT2x4: return gluShaderUtil.DataType.FLOAT_MAT2X4;
+
+ case gl.FLOAT_MAT3x2: return gluShaderUtil.DataType.FLOAT_MAT3X2;
+ case gl.FLOAT_MAT3: return gluShaderUtil.DataType.FLOAT_MAT3;
+ case gl.FLOAT_MAT3x4: return gluShaderUtil.DataType.FLOAT_MAT3X4;
+
+ case gl.FLOAT_MAT4x2: return gluShaderUtil.DataType.FLOAT_MAT4X2;
+ case gl.FLOAT_MAT4x3: return gluShaderUtil.DataType.FLOAT_MAT4X3;
+ case gl.FLOAT_MAT4: return gluShaderUtil.DataType.FLOAT_MAT4;
+
+ case gl.INT: return gluShaderUtil.DataType.INT;
+ case gl.INT_VEC2: return gluShaderUtil.DataType.INT_VEC2;
+ case gl.INT_VEC3: return gluShaderUtil.DataType.INT_VEC3;
+ case gl.INT_VEC4: return gluShaderUtil.DataType.INT_VEC4;
+
+ case gl.UNSIGNED_INT: return gluShaderUtil.DataType.UINT;
+ case gl.UNSIGNED_INT_VEC2: return gluShaderUtil.DataType.UINT_VEC2;
+ case gl.UNSIGNED_INT_VEC3: return gluShaderUtil.DataType.UINT_VEC3;
+ case gl.UNSIGNED_INT_VEC4: return gluShaderUtil.DataType.UINT_VEC4;
+
+ case gl.BOOL: return gluShaderUtil.DataType.BOOL;
+ case gl.BOOL_VEC2: return gluShaderUtil.DataType.BOOL_VEC2;
+ case gl.BOOL_VEC3: return gluShaderUtil.DataType.BOOL_VEC3;
+ case gl.BOOL_VEC4: return gluShaderUtil.DataType.BOOL_VEC4;
+
+ case gl.SAMPLER_2D: return gluShaderUtil.DataType.SAMPLER_2D;
+ case gl.SAMPLER_CUBE: return gluShaderUtil.DataType.SAMPLER_CUBE;
+ case gl.SAMPLER_2D_ARRAY: return gluShaderUtil.DataType.SAMPLER_2D_ARRAY;
+ case gl.SAMPLER_3D: return gluShaderUtil.DataType.SAMPLER_3D;
+
+ case gl.SAMPLER_2D_SHADOW: return gluShaderUtil.DataType.SAMPLER_2D_SHADOW;
+ case gl.SAMPLER_CUBE_SHADOW: return gluShaderUtil.DataType.SAMPLER_CUBE_SHADOW;
+ case gl.SAMPLER_2D_ARRAY_SHADOW: return gluShaderUtil.DataType.SAMPLER_2D_ARRAY_SHADOW;
+
+ case gl.INT_SAMPLER_2D: return gluShaderUtil.DataType.INT_SAMPLER_2D;
+ case gl.INT_SAMPLER_CUBE: return gluShaderUtil.DataType.INT_SAMPLER_CUBE;
+ case gl.INT_SAMPLER_2D_ARRAY: return gluShaderUtil.DataType.INT_SAMPLER_2D_ARRAY;
+ case gl.INT_SAMPLER_3D: return gluShaderUtil.DataType.INT_SAMPLER_3D;
+
+ case gl.UNSIGNED_INT_SAMPLER_2D: return gluShaderUtil.DataType.UINT_SAMPLER_2D;
+ case gl.UNSIGNED_INT_SAMPLER_CUBE: return gluShaderUtil.DataType.UINT_SAMPLER_CUBE;
+ case gl.UNSIGNED_INT_SAMPLER_2D_ARRAY: return gluShaderUtil.DataType.UINT_SAMPLER_2D_ARRAY;
+ case gl.UNSIGNED_INT_SAMPLER_3D: return gluShaderUtil.DataType.UINT_SAMPLER_3D;
+
+ default:
+ throw new Error('Unrecognized GL type:' + glType);
+ }
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluStrUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluStrUtil.js
new file mode 100644
index 0000000000..b554db047a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluStrUtil.js
@@ -0,0 +1,166 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.opengl.gluStrUtil');
+
+goog.scope(function() {
+
+var gluStrUtil = framework.opengl.gluStrUtil;
+
+gluStrUtil.getPixelFormatName = function(value) {
+ switch (value) {
+ case gl.LUMINANCE: return 'gl.LUMINANCE';
+ case gl.LUMINANCE_ALPHA: return 'gl.LUMINANCE_ALPHA';
+ case gl.ALPHA: return 'gl.ALPHA';
+ case gl.RGB: return 'gl.RGB';
+ case gl.RGBA: return 'gl.RGBA';
+ case gl.RGBA4: return 'gl.RGBA4';
+ case gl.RGB5_A1: return 'gl.RGB5_A1';
+ case gl.RGB565: return 'gl.RGB565';
+ case gl.DEPTH_COMPONENT16: return 'gl.DEPTH_COMPONENT16';
+ case gl.STENCIL_INDEX8: return 'gl.STENCIL_INDEX8';
+ case gl.RG: return 'gl.RG';
+ case gl.RED: return 'gl.RED';
+ case gl.RGBA_INTEGER: return 'gl.RGBA_INTEGER';
+ case gl.RGB_INTEGER: return 'gl.RGB_INTEGER';
+ case gl.RG_INTEGER: return 'gl.RG_INTEGER';
+ case gl.RED_INTEGER: return 'gl.RED_INTEGER';
+ case gl.DEPTH_COMPONENT: return 'gl.DEPTH_COMPONENT';
+ case gl.DEPTH_STENCIL: return 'gl.DEPTH_STENCIL';
+ case gl.RGBA32F: return 'gl.RGBA32F';
+ case gl.RGBA32I: return 'gl.RGBA32I';
+ case gl.RGBA32UI: return 'gl.RGBA32UI';
+ // case gl.RGBA16: return 'gl.RGBA16';
+ // case gl.RGBA16_SNORM: return 'gl.RGBA16_SNORM';
+ case gl.RGBA16F: return 'gl.RGBA16F';
+ case gl.RGBA16I: return 'gl.RGBA16I';
+ case gl.RGBA16UI: return 'gl.RGBA16UI';
+ case gl.RGBA8: return 'gl.RGBA8';
+ case gl.RGBA8I: return 'gl.RGBA8I';
+ case gl.RGBA8UI: return 'gl.RGBA8UI';
+ case gl.SRGB8_ALPHA8: return 'gl.SRGB8_ALPHA8';
+ case gl.RGB10_A2: return 'gl.RGB10_A2';
+ case gl.RGB10_A2UI: return 'gl.RGB10_A2UI';
+ case gl.RGBA8_SNORM: return 'gl.RGBA8_SNORM';
+ case gl.RGB8: return 'gl.RGB8';
+ case gl.R11F_G11F_B10F: return 'gl.R11F_G11F_B10F';
+ case gl.RGB32F: return 'gl.RGB32F';
+ case gl.RGB32I: return 'gl.RGB32I';
+ case gl.RGB32UI: return 'gl.RGB32UI';
+ // case gl.RGB16: return 'gl.RGB16';
+ // case gl.RGB16_SNORM: return 'gl.RGB16_SNORM';
+ case gl.RGB16F: return 'gl.RGB16F';
+ case gl.RGB16I: return 'gl.RGB16I';
+ case gl.RGB16UI: return 'gl.RGB16UI';
+ case gl.RGB8_SNORM: return 'gl.RGB8_SNORM';
+ case gl.RGB8I: return 'gl.RGB8I';
+ case gl.RGB8UI: return 'gl.RGB8UI';
+ case gl.SRGB8: return 'gl.SRGB8';
+ case gl.RGB9_E5: return 'gl.RGB9_E5';
+ case gl.RG32F: return 'gl.RG32F';
+ case gl.RG32I: return 'gl.RG32I';
+ case gl.RG32UI: return 'gl.RG32UI';
+ // case gl.RG16: return 'gl.RG16';
+ // case gl.RG16_SNORM: return 'gl.RG16_SNORM';
+ case gl.RG16F: return 'gl.RG16F';
+ case gl.RG16I: return 'gl.RG16I';
+ case gl.RG16UI: return 'gl.RG16UI';
+ case gl.RG8: return 'gl.RG8';
+ case gl.RG8I: return 'gl.RG8I';
+ case gl.RG8UI: return 'gl.RG8UI';
+ case gl.RG8_SNORM: return 'gl.RG8_SNORM';
+ case gl.R32F: return 'gl.R32F';
+ case gl.R32I: return 'gl.R32I';
+ case gl.R32UI: return 'gl.R32UI';
+ // case gl.R16: return 'gl.R16';
+ // case gl.R16_SNORM: return 'gl.R16_SNORM';
+ case gl.R16F: return 'gl.R16F';
+ case gl.R16I: return 'gl.R16I';
+ case gl.R16UI: return 'gl.R16UI';
+ case gl.R8: return 'gl.R8';
+ case gl.R8I: return 'gl.R8I';
+ case gl.R8UI: return 'gl.R8UI';
+ case gl.R8_SNORM: return 'gl.R8_SNORM';
+ case gl.DEPTH_COMPONENT32F: return 'gl.DEPTH_COMPONENT32F';
+ case gl.DEPTH_COMPONENT24: return 'gl.DEPTH_COMPONENT24';
+ case gl.DEPTH32F_STENCIL8: return 'gl.DEPTH32F_STENCIL8';
+ case gl.DEPTH24_STENCIL8: return 'gl.DEPTH24_STENCIL8';
+ // case gl.RGB10: return 'gl.RGB10';
+ // case gl.DEPTH_COMPONENT32: return 'gl.DEPTH_COMPONENT32';
+ case gl.SRGB: return 'gl.SRGB';
+ // case gl.SRGB_ALPHA: return 'gl.SRGB_ALPHA';
+ default: return '';
+ }
+};
+
+gluStrUtil.getTypeName = function(value) {
+ switch (value) {
+ case gl.BYTE: return 'gl.BYTE';
+ case gl.UNSIGNED_BYTE: return 'gl.UNSIGNED_BYTE';
+ case gl.SHORT: return 'gl.SHORT';
+ case gl.UNSIGNED_SHORT: return 'gl.UNSIGNED_SHORT';
+ case gl.INT: return 'gl.INT';
+ case gl.UNSIGNED_INT: return 'gl.UNSIGNED_INT';
+ case gl.FLOAT: return 'gl.FLOAT';
+ // case gl.FIXED: return 'gl.FIXED';
+ case gl.UNSIGNED_SHORT_5_6_5: return 'gl.UNSIGNED_SHORT_5_6_5';
+ case gl.UNSIGNED_SHORT_4_4_4_4: return 'gl.UNSIGNED_SHORT_4_4_4_4';
+ case gl.UNSIGNED_SHORT_5_5_5_1: return 'gl.UNSIGNED_SHORT_5_5_5_1';
+ case gl.HALF_FLOAT: return 'gl.HALF_FLOAT';
+ case gl.INT_2_10_10_10_REV: return 'gl.INT_2_10_10_10_REV';
+ case gl.UNSIGNED_INT_2_10_10_10_REV: return 'gl.UNSIGNED_INT_2_10_10_10_REV';
+ case gl.UNSIGNED_INT_10F_11F_11F_REV: return 'gl.UNSIGNED_INT_10F_11F_11F_REV';
+ case gl.UNSIGNED_INT_5_9_9_9_REV: return 'gl.UNSIGNED_INT_5_9_9_9_REV';
+ case gl.UNSIGNED_INT_24_8: return 'gl.UNSIGNED_INT_24_8';
+ case gl.FLOAT_32_UNSIGNED_INT_24_8_REV: return 'gl.FLOAT_32_UNSIGNED_INT_24_8_REV';
+ case gl.SIGNED_NORMALIZED: return 'gl.SIGNED_NORMALIZED';
+ case gl.UNSIGNED_NORMALIZED: return 'gl.UNSIGNED_NORMALIZED';
+ // case gl.HALF_FLOAT_OES: return 'gl.HALF_FLOAT_OES';
+ default: return '';
+ }
+};
+
+gluStrUtil.getErrorName = function(value) {
+ switch (value) {
+ case gl.NO_ERROR: return 'gl.NO_ERROR';
+ case gl.INVALID_ENUM: return 'gl.INVALID_ENUM';
+ case gl.INVALID_VALUE: return 'gl.INVALID_VALUE';
+ case gl.INVALID_OPERATION: return 'gl.INVALID_OPERATION';
+ case gl.OUT_OF_MEMORY: return 'gl.OUT_OF_MEMORY';
+ // case gl.INVALID_FRAMEBUFFER_OPERATION: return 'gl.INVALID_FRAMEBUFFER_OPERATION';
+ default: return '';
+ }
+};
+
+gluStrUtil.getFramebufferStatusName = function(value) {
+ switch (value) {
+ case gl.FRAMEBUFFER_COMPLETE: return 'gl.FRAMEBUFFER_COMPLETE';
+ case gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT: return 'gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT';
+ case gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: return 'gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT';
+ case gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS: return 'gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS';
+ case gl.FRAMEBUFFER_UNSUPPORTED: return 'gl.FRAMEBUFFER_UNSUPPORTED';
+ case gl.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: return 'gl.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE';
+ // case: gl.FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS: return 'gl.FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS';
+ default: return '';
+ }
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluTexture.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluTexture.js
new file mode 100644
index 0000000000..fcc33588e1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluTexture.js
@@ -0,0 +1,380 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.opengl.gluTexture');
+goog.require('framework.common.tcuCompressedTexture');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.opengl.gluTextureUtil');
+
+goog.scope(function() {
+
+var gluTexture = framework.opengl.gluTexture;
+var gluTextureUtil = framework.opengl.gluTextureUtil;
+var tcuTexture = framework.common.tcuTexture;
+var tcuCompressedTexture = framework.common.tcuCompressedTexture;
+var deMath = framework.delibs.debase.deMath;
+
+var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+};
+
+/** @enum {number} */
+gluTexture.Type = {
+ TYPE_NONE: 0,
+ TYPE_2D: 1,
+ TYPE_CUBE_MAP: 2,
+ TYPE_2D_ARRAY: 3,
+ TYPE_3D: 4
+};
+
+/**
+ * @constructor
+ */
+gluTexture.Texture2D = function(gl, format, isCompressed, refTexture) {
+ this.gl = gl;
+ this.m_glTexture = gl.createTexture();
+ this.m_isCompressed = isCompressed;
+ this.m_format = format; // Internal format
+ this.m_refTexture = refTexture;
+ this.m_type = gluTexture.Type.TYPE_2D;
+};
+
+gluTexture.Texture2D.prototype.getType = function() {
+ return this.m_type;
+};
+
+gluTexture.Texture2D.prototype.getRefTexture = function() {
+ return this.m_refTexture;
+};
+
+gluTexture.Texture2D.prototype.getGLTexture = function() {
+ return this.m_glTexture;
+};
+
+gluTexture.texture2DFromFormat = function(gl, format, dataType, width, height) {
+ var tex = new gluTexture.Texture2D(gl, format, false, new tcuTexture.Texture2D(gluTextureUtil.mapGLTransferFormat(format, dataType), width, height));
+ return tex;
+};
+
+gluTexture.texture2DFromInternalFormat = function(gl, internalFormat, width, height) {
+ var tex = new gluTexture.Texture2D(gl, internalFormat, false, new tcuTexture.Texture2D(gluTextureUtil.mapGLInternalFormat(internalFormat), width, height));
+ return tex;
+};
+
+/**
+ * @param {number} numLevels
+ * @param {Array<tcuCompressedTexture.CompressedTexture>} levels
+ * @return {gluTexture.Texture2D}
+ */
+gluTexture.texture2DFromCompressedTexture = function(gl, numLevels, levels) {
+ var level = levels[0];
+ var format = gluTextureUtil.getGLFormat(level.getFormat());
+ var refTex = new tcuTexture.Texture2D(level.getUncompressedFormat(), level.getWidth(), level.getHeight());
+ /** @type {gluTexture.Texture2D} */ var tex2d = new gluTexture.Texture2D(gl, format, true, refTex);
+
+ tex2d.loadCompressed(numLevels, levels);
+
+ return tex2d;
+};
+/**
+ * @param {number} numLevels
+ * @param {Array<tcuCompressedTexture.CompressedTexture>} levels
+ */
+gluTexture.Texture2D.prototype.loadCompressed = function(numLevels, levels) {
+ /** @type {number} */ var compressedFormat = gluTextureUtil.getGLFormat(levels[0].getFormat());
+
+ assertMsgOptions(this.m_glTexture, 'm_glTexture not defined', false, true);
+ gl.bindTexture(gl.TEXTURE_2D, this.m_glTexture);
+
+ for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) {
+ /** @type {tcuCompressedTexture.CompressedTexture} */ var level = levels[levelNdx];
+
+ // Decompress to reference texture.
+ this.m_refTexture.allocLevel(levelNdx);
+ /** @type {tcuTexture.PixelBufferAccess} */ var refLevelAccess = this.m_refTexture.getLevel(levelNdx);
+ assertMsgOptions(level.getWidth() == refLevelAccess.getWidth() && level.getHeight() == refLevelAccess.getHeight(), 'level and reference sizes not equal', false, true);
+ level.decompress(refLevelAccess);
+
+ // Upload to GL texture in compressed form.
+ gl.compressedTexImage2D(gl.TEXTURE_2D, levelNdx, compressedFormat,
+ level.getWidth(), level.getHeight(), 0, level.getData());
+ }
+};
+
+gluTexture.computePixelStore = function(/*const tcu::TextureFormat&*/ format) {
+ var pixelSize = format.getPixelSize();
+ if (deMath.deIsPowerOfTwo32(pixelSize))
+ return Math.min(pixelSize, 8);
+ else
+ return 1;
+};
+
+gluTexture.cubeFaceToGLFace = function(/*tcu::CubeFace*/ face) {
+ switch (face) {
+ case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X: return gl.TEXTURE_CUBE_MAP_NEGATIVE_X;
+ case tcuTexture.CubeFace.CUBEFACE_POSITIVE_X: return gl.TEXTURE_CUBE_MAP_POSITIVE_X;
+ case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y: return gl.TEXTURE_CUBE_MAP_NEGATIVE_Y;
+ case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y: return gl.TEXTURE_CUBE_MAP_POSITIVE_Y;
+ case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z: return gl.TEXTURE_CUBE_MAP_NEGATIVE_Z;
+ case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z: return gl.TEXTURE_CUBE_MAP_POSITIVE_Z;
+ }
+ throw new Error('Unrecognized face: ' + face);
+};
+
+gluTexture.Texture2D.prototype.upload = function() {
+ DE_ASSERT(!this.m_isCompressed);
+
+ if (this.m_glTexture == null)
+ testFailedOptions('Failed to create GL texture', true);
+
+ gl.bindTexture(gl.TEXTURE_2D, this.m_glTexture);
+ gl.pixelStorei(gl.UNPACK_ALIGNMENT, gluTexture.computePixelStore(this.m_refTexture.getFormat()));
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'Setting pixel store failed', false, true);
+
+ var transferFormat = gluTextureUtil.getTransferFormat(this.m_refTexture.getFormat());
+
+ for (var levelNdx = 0; levelNdx < this.m_refTexture.getNumLevels(); levelNdx++) {
+ if (this.m_refTexture.isLevelEmpty(levelNdx))
+ continue; // Don't upload.
+
+ var access = this.m_refTexture.getLevel(levelNdx);
+ DE_ASSERT(access.getRowPitch() == access.getFormat().getPixelSize() * access.getWidth());
+ var data = access.getDataPtr();
+ gl.texImage2D(gl.TEXTURE_2D, levelNdx, this.m_format, access.getWidth(), access.getHeight(), 0 /* border */, transferFormat.format, transferFormat.dataType, access.getDataPtr());
+ }
+
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'Texture upload failed', false, true);
+};
+
+/**
+ * @constructor
+ * @extends {gluTexture.Texture2D}
+ */
+gluTexture.TextureCube = function(gl, format, isCompressed, refTexture) {
+ gluTexture.Texture2D.call(this, gl, format, isCompressed, refTexture);
+ this.m_type = gluTexture.Type.TYPE_CUBE_MAP;
+};
+
+gluTexture.TextureCube.prototype = Object.create(gluTexture.Texture2D.prototype);
+gluTexture.TextureCube.prototype.constructor = gluTexture.TextureCube;
+
+gluTexture.TextureCube.prototype.upload = function() {
+ DE_ASSERT(!this.m_isCompressed);
+
+ if (this.m_glTexture == null)
+ testFailedOptions('Failed to create GL texture', true);
+
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, this.m_glTexture);
+ gl.pixelStorei(gl.UNPACK_ALIGNMENT, gluTexture.computePixelStore(this.m_refTexture.getFormat()));
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'Setting pixel store failed', false, true);
+
+ var transferFormat = gluTextureUtil.getTransferFormat(this.m_refTexture.getFormat());
+
+ for (var face in tcuTexture.CubeFace) {
+ for (var levelNdx = 0; levelNdx < this.m_refTexture.getNumLevels(); levelNdx++) {
+ if (this.m_refTexture.isLevelEmpty(tcuTexture.CubeFace[face], levelNdx))
+ continue; // Don't upload.
+
+ /*tcu::ConstPixelBufferAccess*/ var access = this.m_refTexture.getLevelFace(levelNdx, tcuTexture.CubeFace[face]);
+ DE_ASSERT(access.getRowPitch() == access.getFormat().getPixelSize() * access.getWidth());
+ gl.texImage2D(gluTexture.cubeFaceToGLFace(tcuTexture.CubeFace[face]), levelNdx, this.m_format, access.getWidth(), access.getHeight(), 0 /* border */, transferFormat.format, transferFormat.dataType, access.getDataPtr());
+ }
+ }
+
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'Texture upload failed', false, true);
+};
+
+gluTexture.cubeFromFormat = function(gl, format, dataType, size) {
+ var tex = new gluTexture.TextureCube(gl, format, false, new tcuTexture.TextureCube(gluTextureUtil.mapGLTransferFormat(format, dataType), size));
+ return tex;
+};
+
+gluTexture.cubeFromInternalFormat = function(gl, internalFormat, size) {
+ var tex = new gluTexture.TextureCube(gl, internalFormat, false, new tcuTexture.TextureCube(gluTextureUtil.mapGLInternalFormat(internalFormat), size));
+ return tex;
+};
+
+/**
+ * @constructor
+ * @extends {gluTexture.Texture2D}
+ */
+gluTexture.Texture2DArray = function(gl, format, isCompressed, refTexture) {
+ gluTexture.Texture2D.call(this, gl, format, isCompressed, refTexture);
+ this.m_type = gluTexture.Type.TYPE_2D_ARRAY;
+};
+
+gluTexture.Texture2DArray.prototype = Object.create(gluTexture.Texture2D.prototype);
+gluTexture.Texture2DArray.prototype.constructor = gluTexture.Texture2DArray;
+
+gluTexture.Texture2DArray.prototype.upload = function() {
+ if (!gl.texImage3D)
+ throw new Error('gl.TexImage3D() is not supported');
+
+ gl.bindTexture(gl.TEXTURE_2D_ARRAY, this.m_glTexture);
+ gl.pixelStorei(gl.UNPACK_ALIGNMENT, gluTexture.computePixelStore(this.m_refTexture.getFormat()));
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'Texture upload failed', false, true);
+
+ var transferFormat = gluTextureUtil.getTransferFormat(this.m_refTexture.getFormat());
+
+ for (var levelNdx = 0; levelNdx < this.m_refTexture.getNumLevels(); levelNdx++) {
+ if (this.m_refTexture.isLevelEmpty(levelNdx))
+ continue; // Don't upload.
+
+ /*tcu::ConstPixelBufferAccess*/ var access = this.m_refTexture.getLevel(levelNdx);
+ DE_ASSERT(access.getRowPitch() == access.getFormat().getPixelSize() * access.getWidth());
+ DE_ASSERT(access.getSlicePitch() == access.getFormat().getPixelSize() * access.getWidth() * access.getHeight());
+ gl.texImage3D(gl.TEXTURE_2D_ARRAY, levelNdx, this.m_format, access.getWidth(), access.getHeight(), access.getDepth(), 0 /* border */, transferFormat.format, transferFormat.dataType, access.getDataPtr());
+ }
+
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'Texture upload failed', false, true);
+};
+
+gluTexture.texture2DArrayFromFormat = function(gl, format, dataType, width, height, numLayers) {
+ var tex = new gluTexture.Texture2DArray(gl, format, false, new tcuTexture.Texture2DArray(gluTextureUtil.mapGLTransferFormat(format, dataType), width, height, numLayers));
+ return tex;
+};
+
+gluTexture.texture2DArrayFromInternalFormat = function(gl, internalFormat, width, height, numLayers) {
+ var tex = new gluTexture.Texture2DArray(gl, internalFormat, false, new tcuTexture.Texture2DArray(gluTextureUtil.mapGLInternalFormat(internalFormat), width, height, numLayers));
+ return tex;
+};
+
+/**
+ * @constructor
+ * @extends {gluTexture.Texture2D}
+ */
+gluTexture.Texture3D = function(gl, format, isCompressed, refTexture) {
+ gluTexture.Texture2D.call(this, gl, format, isCompressed, refTexture);
+ this.m_type = gluTexture.Type.TYPE_3D;
+};
+
+gluTexture.Texture3D.prototype = Object.create(gluTexture.Texture2D.prototype);
+gluTexture.Texture3D.prototype.constructor = gluTexture.Texture3D;
+
+gluTexture.Texture3D.prototype.upload = function() {
+ if (!gl.texImage3D)
+ throw new Error('gl.TexImage3D() is not supported');
+
+ gl.bindTexture(gl.TEXTURE_3D, this.m_glTexture);
+ gl.pixelStorei(gl.UNPACK_ALIGNMENT, gluTexture.computePixelStore(this.m_refTexture.getFormat()));
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'Texture upload failed', false, true);
+
+ var transferFormat = gluTextureUtil.getTransferFormat(this.m_refTexture.getFormat());
+
+ for (var levelNdx = 0; levelNdx < this.m_refTexture.getNumLevels(); levelNdx++) {
+ if (this.m_refTexture.isLevelEmpty(levelNdx))
+ continue; // Don't upload.
+
+ /*tcu::ConstPixelBufferAccess*/ var access = this.m_refTexture.getLevel(levelNdx);
+ DE_ASSERT(access.getRowPitch() == access.getFormat().getPixelSize() * access.getWidth());
+ DE_ASSERT(access.getSlicePitch() == access.getFormat().getPixelSize() * access.getWidth() * access.getHeight());
+ gl.texImage3D(gl.TEXTURE_3D, levelNdx, this.m_format, access.getWidth(), access.getHeight(), access.getDepth(), 0 /* border */, transferFormat.format, transferFormat.dataType, access.getDataPtr());
+ }
+
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'Texture upload failed', false, true);
+};
+
+gluTexture.texture3DFromFormat = function(gl, format, dataType, width, height, depth) {
+ var tex = new gluTexture.Texture3D(gl, format, false, new tcuTexture.Texture3D(gluTextureUtil.mapGLTransferFormat(format, dataType), width, height, depth));
+ return tex;
+};
+
+gluTexture.texture3DFromInternalFormat = function(gl, internalFormat, width, height, depth) {
+ var tex = new gluTexture.Texture3D(gl, internalFormat, false, new tcuTexture.Texture3D(gluTextureUtil.mapGLInternalFormat(internalFormat), width, height, depth));
+ return tex;
+};
+
+/**
+ * @constructor
+ * @extends {gluTexture.Texture2D}
+ */
+gluTexture.Compressed2D = function(gl, format, isCompressed, refTexture) {
+ gluTexture.Texture2D.call(this, gl, format, isCompressed, refTexture);
+};
+
+gluTexture.Compressed2D.prototype = Object.create(gluTexture.Texture2D.prototype);
+gluTexture.Compressed2D.prototype.constructor = gluTexture.Compressed2D;
+
+gluTexture.Compressed2D.prototype.uploadLevel = function(level, source) {
+ DE_ASSERT(this.m_isCompressed);
+
+ if (this.m_glTexture == null)
+ testFailedOptions('Failed to create GL texture', true);
+
+ gl.bindTexture(gl.TEXTURE_2D, this.m_glTexture);
+
+ gl.compressedTexImage2D(gl.TEXTURE_2D, level, this.m_format, source.m_width, source.m_height, 0 /* border */, source.m_data);
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'Texture upload failed', false, true);
+};
+
+/**
+ * @constructor
+ * @extends {gluTexture.Texture2D}
+ */
+gluTexture.CompressedCube = function(gl, format, isCompressed, refTexture) {
+ gluTexture.Texture2D.call(this, gl, format, isCompressed, refTexture);
+};
+
+gluTexture.CompressedCube.prototype = Object.create(gluTexture.Texture2D.prototype);
+gluTexture.CompressedCube.prototype.constructor = gluTexture.CompressedCube;
+
+gluTexture.CompressedCube.prototype.uploadLevel = function(level, source) {
+ DE_ASSERT(this.m_isCompressed);
+
+ if (this.m_glTexture == null)
+ testFailedOptions('Failed to create GL texture', true);
+
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, this.m_glTexture);
+
+ for (var face in tcuTexture.CubeFace) {
+
+ // Upload to GL texture in compressed form.
+ gl.compressedTexImage2D(gluTexture.cubeFaceToGLFace(tcuTexture.CubeFace[face]), 0, this.m_format,
+ source.m_width, source.m_height, 0 /* border */, source.m_data);
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'Texture upload failed', false, true);
+ }
+
+};
+
+gluTexture.compressed2DFromInternalFormat = function(gl, format, width, height, compressed) {
+ var tex = new gluTexture.Compressed2D(gl, gluTextureUtil.getGLFormat(format), true, new tcuTexture.Texture2D(compressed.getUncompressedFormat(), width, height));
+ tex.m_refTexture.allocLevel(0);
+ compressed.decompress(tex.m_refTexture.getLevel(0));
+ tex.uploadLevel(0, compressed);
+ return tex;
+};
+
+gluTexture.compressedCubeFromInternalFormat = function(gl, format, size, compressed) {
+ var tex = new gluTexture.CompressedCube(gl, gluTextureUtil.getGLFormat(format), true, new tcuTexture.TextureCube(compressed.getUncompressedFormat(), size));
+ for (var face in tcuTexture.CubeFace) {
+ tex.m_refTexture.allocLevel(tcuTexture.CubeFace[face], 0);
+
+ /*tcu::ConstPixelBufferAccess*/ var access = tex.m_refTexture.getLevelFace(0, tcuTexture.CubeFace[face]);
+ DE_ASSERT(access.getRowPitch() == access.getFormat().getPixelSize() * access.getWidth());
+ compressed.decompress(access);
+ }
+ tex.uploadLevel(0, compressed);
+ return tex;
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluTextureUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluTextureUtil.js
new file mode 100644
index 0000000000..06f3f5289d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluTextureUtil.js
@@ -0,0 +1,1025 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/*--------------------------------------------------------------------*//*!
+ * \brief Map tcuTexture.TextureFormat to GL pixel transfer format.
+ *
+ * Maps generic texture format description to GL pixel transfer format.
+ * If no mapping is found, throws tcu::InternalError.
+ *
+ * \param texFormat Generic texture format.
+ * \return GL pixel transfer format.
+ *//*--------------------------------------------------------------------*/
+'use strict';
+goog.provide('framework.opengl.gluTextureUtil');
+goog.require('framework.common.tcuCompressedTexture');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.opengl.gluShaderUtil');
+
+goog.scope(function() {
+
+var gluTextureUtil = framework.opengl.gluTextureUtil;
+var deString = framework.delibs.debase.deString;
+var tcuTexture = framework.common.tcuTexture;
+var tcuTextureUtil = framework.common.tcuTextureUtil;
+var tcuCompressedTexture = framework.common.tcuCompressedTexture;
+var gluShaderUtil = framework.opengl.gluShaderUtil;
+
+/**
+ * @param {number} format
+ * @param {number} dataType
+ * @constructor
+ */
+gluTextureUtil.TransferFormat = function(format, dataType) {
+ this.format = format; //!< Pixel format.
+ this.dataType = dataType; //!< Data type.
+};
+
+/**
+ * Map tcuTexture.TextureFormat to GL pixel transfer format.
+ *
+ * Maps generic texture format description to GL pixel transfer format.
+ * If no mapping is found, throws tcu::InternalError.
+ *
+ * @param {tcuTexture.TextureFormat} texFormat Generic texture format.
+ * @return {gluTextureUtil.TransferFormat} GL pixel transfer format.
+ * @throws {Error}
+ */
+gluTextureUtil.getTransferFormat = function(/* tcuTexture.TextureFormat */ texFormat) {
+ var format = gl.NONE;
+ var type = gl.NONE;
+ /*boolean*/ var isInt = false;
+
+ switch (texFormat.type) {
+ case tcuTexture.ChannelType.SIGNED_INT8:
+ case tcuTexture.ChannelType.SIGNED_INT16:
+ case tcuTexture.ChannelType.SIGNED_INT32:
+ case tcuTexture.ChannelType.UNSIGNED_INT8:
+ case tcuTexture.ChannelType.UNSIGNED_INT16:
+ case tcuTexture.ChannelType.UNSIGNED_INT32:
+ case tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV:
+ isInt = true;
+ break;
+
+ default:
+ isInt = false;
+ break;
+ }
+
+ switch (texFormat.order) {
+ case tcuTexture.ChannelOrder.A: format = gl.ALPHA; break;
+ case tcuTexture.ChannelOrder.L: format = gl.LUMINANCE; break;
+ case tcuTexture.ChannelOrder.LA: format = gl.LUMINANCE_ALPHA; break;
+ case tcuTexture.ChannelOrder.R: format = isInt ? gl.RED_INTEGER : gl.RED; break;
+ case tcuTexture.ChannelOrder.RG: format = isInt ? gl.RG_INTEGER : gl.RG; break;
+ case tcuTexture.ChannelOrder.RGB: format = isInt ? gl.RGB_INTEGER : gl.RGB; break;
+ case tcuTexture.ChannelOrder.RGBA: format = isInt ? gl.RGBA_INTEGER : gl.RGBA; break;
+ case tcuTexture.ChannelOrder.sRGB: format = gl.RGB; break;
+ case tcuTexture.ChannelOrder.sRGBA: format = gl.RGBA; break;
+ case tcuTexture.ChannelOrder.D: format = gl.DEPTH_COMPONENT; break;
+ case tcuTexture.ChannelOrder.DS: format = gl.DEPTH_STENCIL; break;
+ case tcuTexture.ChannelOrder.S: format = gl.STENCIL_INDEX; break;
+
+ default:
+ throw new Error('Unknown ChannelOrder ' + texFormat.order);
+ }
+
+ switch (texFormat.type) {
+ case tcuTexture.ChannelType.SNORM_INT8: type = gl.BYTE; break;
+ case tcuTexture.ChannelType.SNORM_INT16: type = gl.SHORT; break;
+ case tcuTexture.ChannelType.UNORM_INT8: type = gl.UNSIGNED_BYTE; break;
+ case tcuTexture.ChannelType.UNORM_INT16: type = gl.UNSIGNED_SHORT; break;
+ case tcuTexture.ChannelType.UNORM_SHORT_565: type = gl.UNSIGNED_SHORT_5_6_5; break;
+ case tcuTexture.ChannelType.UNORM_SHORT_4444: type = gl.UNSIGNED_SHORT_4_4_4_4; break;
+ case tcuTexture.ChannelType.UNORM_SHORT_5551: type = gl.UNSIGNED_SHORT_5_5_5_1; break;
+ case tcuTexture.ChannelType.SIGNED_INT8: type = gl.BYTE; break;
+ case tcuTexture.ChannelType.SIGNED_INT16: type = gl.SHORT; break;
+ case tcuTexture.ChannelType.SIGNED_INT32: type = gl.INT; break;
+ case tcuTexture.ChannelType.UNSIGNED_INT8: type = gl.UNSIGNED_BYTE; break;
+ case tcuTexture.ChannelType.UNSIGNED_INT16: type = gl.UNSIGNED_SHORT; break;
+ case tcuTexture.ChannelType.UNSIGNED_INT32: type = gl.UNSIGNED_INT; break;
+ case tcuTexture.ChannelType.FLOAT: type = gl.FLOAT; break;
+ case tcuTexture.ChannelType.UNORM_INT_101010: type = gl.UNSIGNED_INT_2_10_10_10_REV; break;
+ case tcuTexture.ChannelType.UNORM_INT_1010102_REV: type = gl.UNSIGNED_INT_2_10_10_10_REV; break;
+ case tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV: type = gl.UNSIGNED_INT_2_10_10_10_REV; break;
+ case tcuTexture.ChannelType.UNSIGNED_INT_11F_11F_10F_REV: type = gl.UNSIGNED_INT_10F_11F_11F_REV; break;
+ case tcuTexture.ChannelType.UNSIGNED_INT_999_E5_REV: type = gl.UNSIGNED_INT_5_9_9_9_REV; break;
+ case tcuTexture.ChannelType.HALF_FLOAT: type = gl.HALF_FLOAT; break;
+ case tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV: type = gl.FLOAT_32_UNSIGNED_INT_24_8_REV; break;
+ case tcuTexture.ChannelType.UNSIGNED_INT_24_8: type = texFormat.order == tcuTexture.ChannelOrder.D ?
+ gl.UNSIGNED_INT : gl.UNSIGNED_INT_24_8; break;
+
+ default:
+ throw new Error("Can't map texture format to GL transfer format " + texFormat.type);
+ }
+
+ return new gluTextureUtil.TransferFormat(format, type);
+};
+
+/**
+ * Map tcuTexture.TextureFormat to GL internal sized format.
+ *
+ * Maps generic texture format description to GL internal format.
+ * If no mapping is found, throws Error.
+ *
+ * @param {tcuTexture.TextureFormat} texFormat Generic texture format.
+ * @return {number} GL texture format.
+ * @throws {Error}
+ */
+gluTextureUtil.getInternalFormat = function(texFormat) {
+
+ var stringify = function(order, type) {
+ return '' + order + ' ' + type;
+ };
+
+ switch (stringify(texFormat.order, texFormat.type)) {
+ case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_SHORT_5551): return gl.RGB5_A1;
+ case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_SHORT_4444): return gl.RGBA4;
+ case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNORM_SHORT_565): return gl.RGB565;
+ case stringify(tcuTexture.ChannelOrder.D, tcuTexture.ChannelType.UNORM_INT16): return gl.DEPTH_COMPONENT16;
+ case stringify(tcuTexture.ChannelOrder.S, tcuTexture.ChannelType.UNSIGNED_INT8): return gl.STENCIL_INDEX8;
+
+ case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.FLOAT): return gl.RGBA32F;
+ case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.SIGNED_INT32): return gl.RGBA32I;
+ case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNSIGNED_INT32): return gl.RGBA32UI;
+ // TODO: Check which ones are valid in WebGL 2 - case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT16): return gl.RGBA16;
+ //case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.SNORM_INT16): return gl.RGBA16_SNORM;
+ case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.HALF_FLOAT): return gl.RGBA16F;
+ case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.SIGNED_INT16): return gl.RGBA16I;
+ case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNSIGNED_INT16): return gl.RGBA16UI;
+ case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8): return gl.RGBA8;
+ case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.SIGNED_INT8): return gl.RGBA8I;
+ case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNSIGNED_INT8): return gl.RGBA8UI;
+ case stringify(tcuTexture.ChannelOrder.sRGBA, tcuTexture.ChannelType.UNORM_INT8): return gl.SRGB8_ALPHA8;
+ case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT_1010102_REV): return gl.RGB10_A2;
+ case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV): return gl.RGB10_A2UI;
+ case stringify(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.SNORM_INT8): return gl.RGBA8_SNORM;
+
+ case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNORM_INT8): return gl.RGB8;
+ case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNSIGNED_INT_11F_11F_10F_REV): return gl.R11F_G11F_B10F;
+ case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.FLOAT): return gl.RGB32F;
+ case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.SIGNED_INT32): return gl.RGB32I;
+ case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNSIGNED_INT32): return gl.RGB32UI;
+ //case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNORM_INT16): return gl.RGB16;
+ //case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.SNORM_INT16): return gl.RGB16_SNORM;
+ case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.HALF_FLOAT): return gl.RGB16F;
+ case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.SIGNED_INT16): return gl.RGB16I;
+ case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNSIGNED_INT16): return gl.RGB16UI;
+ case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.SNORM_INT8): return gl.RGB8_SNORM;
+ case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.SIGNED_INT8): return gl.RGB8I;
+ case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNSIGNED_INT8): return gl.RGB8UI;
+ case stringify(tcuTexture.ChannelOrder.sRGB, tcuTexture.ChannelType.UNORM_INT8): return gl.SRGB8;
+ case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNSIGNED_INT_999_E5_REV): return gl.RGB9_E5;
+ //case stringify(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNORM_INT_1010102_REV): return gl.RGB10;
+
+ case stringify(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.FLOAT): return gl.RG32F;
+ case stringify(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.SIGNED_INT32): return gl.RG32I;
+ case stringify(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.UNSIGNED_INT32): return gl.RG32UI;
+ //case stringify(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.UNORM_INT16): return gl.RG16;
+ //case stringify(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.SNORM_INT16): return gl.RG16_SNORM;
+ case stringify(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.HALF_FLOAT): return gl.RG16F;
+ case stringify(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.SIGNED_INT16): return gl.RG16I;
+ case stringify(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.UNSIGNED_INT16): return gl.RG16UI;
+ case stringify(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.UNORM_INT8): return gl.RG8;
+ case stringify(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.SIGNED_INT8): return gl.RG8I;
+ case stringify(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.UNSIGNED_INT8): return gl.RG8UI;
+ case stringify(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.SNORM_INT8): return gl.RG8_SNORM;
+
+ case stringify(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.FLOAT): return gl.R32F;
+ case stringify(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.SIGNED_INT32): return gl.R32I;
+ case stringify(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.UNSIGNED_INT32): return gl.R32UI;
+ //case stringify(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.UNORM_INT16): return gl.R16;
+ //case stringify(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.SNORM_INT16): return gl.R16_SNORM;
+ case stringify(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.HALF_FLOAT): return gl.R16F;
+ case stringify(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.SIGNED_INT16): return gl.R16I;
+ case stringify(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.UNSIGNED_INT16): return gl.R16UI;
+ case stringify(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.UNORM_INT8): return gl.R8;
+ case stringify(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.SIGNED_INT8): return gl.R8I;
+ case stringify(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.UNSIGNED_INT8): return gl.R8UI;
+ case stringify(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.SNORM_INT8): return gl.R8_SNORM;
+
+ case stringify(tcuTexture.ChannelOrder.D, tcuTexture.ChannelType.FLOAT): return gl.DEPTH_COMPONENT32F;
+ case stringify(tcuTexture.ChannelOrder.D, tcuTexture.ChannelType.UNSIGNED_INT_24_8): return gl.DEPTH_COMPONENT24;
+ //case stringify(tcuTexture.ChannelOrder.D, tcuTexture.ChannelType.UNSIGNED_INT32): return gl.DEPTH_COMPONENT32;
+ case stringify(tcuTexture.ChannelOrder.DS, tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV): return gl.DEPTH32F_STENCIL8;
+ case stringify(tcuTexture.ChannelOrder.DS, tcuTexture.ChannelType.UNSIGNED_INT_24_8): return gl.DEPTH24_STENCIL8;
+
+ default:
+ throw new Error("Can't map texture format to GL internal format");
+ }
+};
+
+/**
+ * Enable WEBGL_compressed_texture_etc support if available, by merging it
+ * into the WebGL2RenderingContext.
+ *
+ * This function may be called many times.
+ *
+ * @return {boolean} True if enabled.
+ */
+gluTextureUtil.enableCompressedTextureETC = (function() {
+ var enabled = undefined;
+ return function() {
+ if (enabled === undefined) {
+ enabled = false;
+
+ var WEBGL_compressed_texture_etc = gl.getExtension("WEBGL_compressed_texture_etc");
+ if (WEBGL_compressed_texture_etc) {
+ // Extend gl with enums from WEBGL_compressed_texture_etc
+ // (if it doesn't already have the etc texture formats).
+ var proto = Object.getPrototypeOf(WEBGL_compressed_texture_etc);
+ for (var prop in proto) {
+ if (proto.hasOwnProperty(prop)) {
+ gl[prop] = proto[prop];
+ }
+ }
+ enabled = true;
+ }
+ }
+ return enabled;
+ };
+})();
+
+/**
+ * Map generic compressed format to GL compressed format enum.
+ *
+ * Maps generic compressed format to GL compressed format enum value.
+ * If no mapping is found, throws Error.
+
+ * @param {tcuCompressedTexture.Format} format Generic compressed format.
+ * @return {number} GL compressed texture format.
+ * @throws {Error}
+ */
+gluTextureUtil.getGLFormat = function(/* tcuCompressedTexture.Format */ format) {
+ switch (format) {
+ // TODO: check which are available in WebGL 2 - case tcuCompressedTexture.Format.ETC1_RGB8: return gl.ETC1_RGB8_OES;
+ case tcuCompressedTexture.Format.EAC_R11: return gl.COMPRESSED_R11_EAC;
+ case tcuCompressedTexture.Format.EAC_SIGNED_R11: return gl.COMPRESSED_SIGNED_R11_EAC;
+ case tcuCompressedTexture.Format.EAC_RG11: return gl.COMPRESSED_RG11_EAC;
+ case tcuCompressedTexture.Format.EAC_SIGNED_RG11: return gl.COMPRESSED_SIGNED_RG11_EAC;
+ case tcuCompressedTexture.Format.ETC2_RGB8: return gl.COMPRESSED_RGB8_ETC2;
+ case tcuCompressedTexture.Format.ETC2_SRGB8: return gl.COMPRESSED_SRGB8_ETC2;
+ case tcuCompressedTexture.Format.ETC2_RGB8_PUNCHTHROUGH_ALPHA1: return gl.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2;
+ case tcuCompressedTexture.Format.ETC2_SRGB8_PUNCHTHROUGH_ALPHA1: return gl.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2;
+ case tcuCompressedTexture.Format.ETC2_EAC_RGBA8: return gl.COMPRESSED_RGBA8_ETC2_EAC;
+ case tcuCompressedTexture.Format.ETC2_EAC_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC;
+
+ /*case tcuCompressedTexture.Format.ASTC_4x4_RGBA: return gl.COMPRESSED_RGBA_ASTC_4x4_KHR;
+ case tcuCompressedTexture.Format.ASTC_5x4_RGBA: return gl.COMPRESSED_RGBA_ASTC_5x4_KHR;
+ case tcuCompressedTexture.Format.ASTC_5x5_RGBA: return gl.COMPRESSED_RGBA_ASTC_5x5_KHR;
+ case tcuCompressedTexture.Format.ASTC_6x5_RGBA: return gl.COMPRESSED_RGBA_ASTC_6x5_KHR;
+ case tcuCompressedTexture.Format.ASTC_6x6_RGBA: return gl.COMPRESSED_RGBA_ASTC_6x6_KHR;
+ case tcuCompressedTexture.Format.ASTC_8x5_RGBA: return gl.COMPRESSED_RGBA_ASTC_8x5_KHR;
+ case tcuCompressedTexture.Format.ASTC_8x6_RGBA: return gl.COMPRESSED_RGBA_ASTC_8x6_KHR;
+ case tcuCompressedTexture.Format.ASTC_8x8_RGBA: return gl.COMPRESSED_RGBA_ASTC_8x8_KHR;
+ case tcuCompressedTexture.Format.ASTC_10x5_RGBA: return gl.COMPRESSED_RGBA_ASTC_10x5_KHR;
+ case tcuCompressedTexture.Format.ASTC_10x6_RGBA: return gl.COMPRESSED_RGBA_ASTC_10x6_KHR;
+ case tcuCompressedTexture.Format.ASTC_10x8_RGBA: return gl.COMPRESSED_RGBA_ASTC_10x8_KHR;
+ case tcuCompressedTexture.Format.ASTC_10x10_RGBA: return gl.COMPRESSED_RGBA_ASTC_10x10_KHR;
+ case tcuCompressedTexture.Format.ASTC_12x10_RGBA: return gl.COMPRESSED_RGBA_ASTC_12x10_KHR;
+ case tcuCompressedTexture.Format.ASTC_12x12_RGBA: return gl.COMPRESSED_RGBA_ASTC_12x12_KHR;
+ case tcuCompressedTexture.Format.ASTC_4x4_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;
+ case tcuCompressedTexture.Format.ASTC_5x4_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR;
+ case tcuCompressedTexture.Format.ASTC_5x5_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR;
+ case tcuCompressedTexture.Format.ASTC_6x5_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR;
+ case tcuCompressedTexture.Format.ASTC_6x6_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR;
+ case tcuCompressedTexture.Format.ASTC_8x5_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR;
+ case tcuCompressedTexture.Format.ASTC_8x6_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR;
+ case tcuCompressedTexture.Format.ASTC_8x8_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR;
+ case tcuCompressedTexture.Format.ASTC_10x5_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR;
+ case tcuCompressedTexture.Format.ASTC_10x6_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR;
+ case tcuCompressedTexture.Format.ASTC_10x8_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR;
+ case tcuCompressedTexture.Format.ASTC_10x10_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR;
+ case tcuCompressedTexture.Format.ASTC_12x10_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR;
+ case tcuCompressedTexture.Format.ASTC_12x12_SRGB8_ALPHA8: return gl.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR;*/
+
+ default:
+ throw new Error("Can't map compressed format to GL format");
+ }
+};
+
+/**
+ * @param {number} dataType
+ * @param {boolean} normalized
+ * @return {tcuTexture.ChannelType}
+ * @throws {Error}
+ */
+gluTextureUtil.mapGLChannelType = function(/* deMath.deUint32 */ dataType, /*boolean*/ normalized) {
+ // \note Normalized bit is ignored where it doesn't apply.
+
+ switch (dataType) {
+ case gl.UNSIGNED_BYTE: return normalized ? tcuTexture.ChannelType.UNORM_INT8 : tcuTexture.ChannelType.UNSIGNED_INT8;
+ case gl.BYTE: return normalized ? tcuTexture.ChannelType.SNORM_INT8 : tcuTexture.ChannelType.SIGNED_INT8;
+ case gl.UNSIGNED_SHORT: return normalized ? tcuTexture.ChannelType.UNORM_INT16 : tcuTexture.ChannelType.UNSIGNED_INT16;
+ case gl.SHORT: return normalized ? tcuTexture.ChannelType.SNORM_INT16 : tcuTexture.ChannelType.SIGNED_INT16;
+ case gl.UNSIGNED_INT: return normalized ? tcuTexture.ChannelType.UNORM_INT32 : tcuTexture.ChannelType.UNSIGNED_INT32;
+ case gl.INT: return normalized ? tcuTexture.ChannelType.SNORM_INT32 : tcuTexture.ChannelType.SIGNED_INT32;
+ case gl.FLOAT: return tcuTexture.ChannelType.FLOAT;
+ case gl.UNSIGNED_SHORT_4_4_4_4: return tcuTexture.ChannelType.UNORM_SHORT_4444;
+ case gl.UNSIGNED_SHORT_5_5_5_1: return tcuTexture.ChannelType.UNORM_SHORT_5551;
+ case gl.UNSIGNED_SHORT_5_6_5: return tcuTexture.ChannelType.UNORM_SHORT_565;
+ case gl.HALF_FLOAT: return tcuTexture.ChannelType.HALF_FLOAT;
+ case gl.UNSIGNED_INT_2_10_10_10_REV: return normalized ? tcuTexture.ChannelType.UNORM_INT_1010102_REV : tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV;
+ case gl.UNSIGNED_INT_10F_11F_11F_REV: return tcuTexture.ChannelType.UNSIGNED_INT_11F_11F_10F_REV;
+ case gl.UNSIGNED_INT_24_8: return tcuTexture.ChannelType.UNSIGNED_INT_24_8;
+ case gl.FLOAT_32_UNSIGNED_INT_24_8_REV: return tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV;
+ case gl.UNSIGNED_INT_5_9_9_9_REV: return tcuTexture.ChannelType.UNSIGNED_INT_999_E5_REV;
+
+ default:
+ throw new Error('Unsupported dataType ' + dataType);
+ }
+};
+
+/**
+ * @param {number} format Generic compressed format.
+ * @param {number} dataType
+ * @return {tcuTexture.TextureFormat} GL texture format.
+ * @throws {Error}
+ */
+gluTextureUtil.mapGLTransferFormat = function(format, dataType) {
+ switch (format) {
+ case gl.ALPHA: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.A, gluTextureUtil.mapGLChannelType(dataType, true));
+ case gl.LUMINANCE: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.L, gluTextureUtil.mapGLChannelType(dataType, true));
+ case gl.LUMINANCE_ALPHA: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.LA, gluTextureUtil.mapGLChannelType(dataType, true));
+ case gl.RGB: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, gluTextureUtil.mapGLChannelType(dataType, true));
+ case gl.RGBA: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, gluTextureUtil.mapGLChannelType(dataType, true));
+ //case gl.BGRA: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.BGRA, gluTextureUtil.mapGLChannelType(dataType, true));
+ case gl.RG: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, gluTextureUtil.mapGLChannelType(dataType, true));
+ case gl.RED: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, gluTextureUtil.mapGLChannelType(dataType, true));
+ case gl.RGBA_INTEGER: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, gluTextureUtil.mapGLChannelType(dataType, false));
+ case gl.RGB_INTEGER: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, gluTextureUtil.mapGLChannelType(dataType, false));
+ case gl.RG_INTEGER: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, gluTextureUtil.mapGLChannelType(dataType, false));
+ case gl.RED_INTEGER: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, gluTextureUtil.mapGLChannelType(dataType, false));
+
+ case gl.DEPTH_COMPONENT: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.D, gluTextureUtil.mapGLChannelType(dataType, true));
+ case gl.DEPTH_STENCIL: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.DS, gluTextureUtil.mapGLChannelType(dataType, true));
+
+ default:
+ throw new Error("Can't map GL pixel format (" + deString.enumToString(gl, format) + ', ' + deString.enumToString(gl, dataType) + ') to texture format');
+ }
+};
+
+ /**
+ * Map GL internal texture format to tcuTexture.TextureFormat.
+ *
+ * If no mapping is found, throws Error.
+ * @param {number} internalFormat
+ * @return {tcuTexture.TextureFormat} GL texture format.
+ * @throws {Error}
+ */
+gluTextureUtil.mapGLInternalFormat = function(/*deMath.deUint32*/ internalFormat) {
+ if (internalFormat === undefined)
+ throw new Error('internalformat is undefined');
+
+ switch (internalFormat) {
+ case gl.RGB5_A1: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_SHORT_5551);
+ case gl.RGBA4: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_SHORT_4444);
+ case gl.RGB565: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNORM_SHORT_565);
+ case gl.DEPTH_COMPONENT16: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.D, tcuTexture.ChannelType.UNORM_INT16);
+ case gl.STENCIL_INDEX8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.S, tcuTexture.ChannelType.UNSIGNED_INT8);
+
+ case gl.RGBA32F: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.FLOAT);
+ case gl.RGBA32I: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.SIGNED_INT32);
+ case gl.RGBA32UI: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNSIGNED_INT32);
+ //TODO: Check which are available in WebGL 2 case gl.RGBA16: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT16);
+ //case gl.RGBA16_SNORM: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.SNORM_INT16);
+ case gl.RGBA16F: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.HALF_FLOAT);
+ case gl.RGBA16I: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.SIGNED_INT16);
+ case gl.RGBA16UI: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNSIGNED_INT16);
+ case gl.RGBA8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8);
+ case gl.RGBA8I: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.SIGNED_INT8);
+ case gl.RGBA8UI: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNSIGNED_INT8);
+ case gl.SRGB8_ALPHA8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.sRGBA, tcuTexture.ChannelType.UNORM_INT8);
+ case gl.RGB10_A2: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT_1010102_REV);
+ case gl.RGB10_A2UI: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV);
+ case gl.RGBA8_SNORM: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.SNORM_INT8);
+
+ case gl.RGB8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNORM_INT8);
+ case gl.R11F_G11F_B10F: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNSIGNED_INT_11F_11F_10F_REV);
+ case gl.RGB32F: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.FLOAT);
+ case gl.RGB32I: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.SIGNED_INT32);
+ case gl.RGB32UI: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNSIGNED_INT32);
+ //case gl.RGB16: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNORM_INT16);
+ //case gl.RGB16_SNORM: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.SNORM_INT16);
+ case gl.RGB16F: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.HALF_FLOAT);
+ case gl.RGB16I: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.SIGNED_INT16);
+ case gl.RGB16UI: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNSIGNED_INT16);
+ case gl.RGB8_SNORM: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.SNORM_INT8);
+ case gl.RGB8I: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.SIGNED_INT8);
+ case gl.RGB8UI: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNSIGNED_INT8);
+ case gl.SRGB8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.sRGB, tcuTexture.ChannelType.UNORM_INT8);
+ case gl.RGB9_E5: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNSIGNED_INT_999_E5_REV);
+ //case gl.RGB10: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNORM_INT_1010102_REV);
+
+ case gl.RG32F: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.FLOAT);
+ case gl.RG32I: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.SIGNED_INT32);
+ case gl.RG32UI: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.UNSIGNED_INT32);
+ //case gl.RG16: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.UNORM_INT16);
+ //case gl.RG16_SNORM: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.SNORM_INT16);
+ case gl.RG16F: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.HALF_FLOAT);
+ case gl.RG16I: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.SIGNED_INT16);
+ case gl.RG16UI: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.UNSIGNED_INT16);
+ case gl.RG8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.UNORM_INT8);
+ case gl.RG8I: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.SIGNED_INT8);
+ case gl.RG8UI: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.UNSIGNED_INT8);
+ case gl.RG8_SNORM: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RG, tcuTexture.ChannelType.SNORM_INT8);
+
+ case gl.R32F: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.FLOAT);
+ case gl.R32I: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.SIGNED_INT32);
+ case gl.R32UI: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.UNSIGNED_INT32);
+ //case gl.R16: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.UNORM_INT16);
+ //case gl.R16_SNORM: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.SNORM_INT16);
+ case gl.R16F: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.HALF_FLOAT);
+ case gl.R16I: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.SIGNED_INT16);
+ case gl.R16UI: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.UNSIGNED_INT16);
+ case gl.R8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.UNORM_INT8);
+ case gl.R8I: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.SIGNED_INT8);
+ case gl.R8UI: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.UNSIGNED_INT8);
+ case gl.R8_SNORM: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.R, tcuTexture.ChannelType.SNORM_INT8);
+
+ case gl.DEPTH_COMPONENT32F: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.D, tcuTexture.ChannelType.FLOAT);
+ case gl.DEPTH_COMPONENT24: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.D, tcuTexture.ChannelType.UNSIGNED_INT_24_8);
+ //case gl.DEPTH_COMPONENT32: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.D, tcuTexture.ChannelType.UNSIGNED_INT32);
+ case gl.DEPTH32F_STENCIL8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.DS, tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV);
+ case gl.DEPTH24_STENCIL8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.DS, tcuTexture.ChannelType.UNSIGNED_INT_24_8);
+
+ default:
+ throw new Error("Can't map GL sized internal format (" + internalFormat.toString(16) + ') to texture format');
+ }
+};
+
+/**
+ * @param {number} format
+ * @return {boolean}
+ */
+gluTextureUtil.isGLInternalColorFormatFilterable = function(format) {
+ switch (format) {
+ case gl.R8:
+ case gl.R8_SNORM:
+ case gl.RG8:
+ case gl.RG8_SNORM:
+ case gl.RGB8:
+ case gl.RGB8_SNORM:
+ case gl.RGB565:
+ case gl.RGBA4:
+ case gl.RGB5_A1:
+ case gl.RGBA8:
+ case gl.RGBA8_SNORM:
+ case gl.RGB10_A2:
+ case gl.SRGB8:
+ case gl.SRGB8_ALPHA8:
+ case gl.R16F:
+ case gl.RG16F:
+ case gl.RGB16F:
+ case gl.RGBA16F:
+ case gl.R11F_G11F_B10F:
+ case gl.RGB9_E5:
+ return true;
+
+ case gl.RGB10_A2UI:
+ case gl.R32F:
+ case gl.RG32F:
+ case gl.RGB32F:
+ case gl.RGBA32F:
+ case gl.R8I:
+ case gl.R8UI:
+ case gl.R16I:
+ case gl.R16UI:
+ case gl.R32I:
+ case gl.R32UI:
+ case gl.RG8I:
+ case gl.RG8UI:
+ case gl.RG16I:
+ case gl.RG16UI:
+ case gl.RG32I:
+ case gl.RG32UI:
+ case gl.RGB8I:
+ case gl.RGB8UI:
+ case gl.RGB16I:
+ case gl.RGB16UI:
+ case gl.RGB32I:
+ case gl.RGB32UI:
+ case gl.RGBA8I:
+ case gl.RGBA8UI:
+ case gl.RGBA16I:
+ case gl.RGBA16UI:
+ case gl.RGBA32I:
+ case gl.RGBA32UI:
+ return false;
+
+ default:
+ throw new Error('Unrecognized format ' + format);
+ }
+};
+
+/**
+ * @param {number} wrapMode
+ * @return {tcuTexture.WrapMode}
+ */
+gluTextureUtil.mapGLWrapMode = function(wrapMode) {
+ switch (wrapMode) {
+ case gl.CLAMP_TO_EDGE: return tcuTexture.WrapMode.CLAMP_TO_EDGE;
+ case gl.REPEAT: return tcuTexture.WrapMode.REPEAT_GL;
+ case gl.MIRRORED_REPEAT: return tcuTexture.WrapMode.MIRRORED_REPEAT_GL;
+ default:
+ throw new Error("Can't map GL wrap mode " + deString.enumToString(gl, wrapMode));
+ }
+};
+
+/**
+ * @param {number} filterMode
+ * @return {tcuTexture.FilterMode}
+ * @throws {Error}
+ */
+gluTextureUtil.mapGLFilterMode = function(filterMode) {
+ switch (filterMode) {
+ case gl.NEAREST: return tcuTexture.FilterMode.NEAREST;
+ case gl.LINEAR: return tcuTexture.FilterMode.LINEAR;
+ case gl.NEAREST_MIPMAP_NEAREST: return tcuTexture.FilterMode.NEAREST_MIPMAP_NEAREST;
+ case gl.NEAREST_MIPMAP_LINEAR: return tcuTexture.FilterMode.NEAREST_MIPMAP_LINEAR;
+ case gl.LINEAR_MIPMAP_NEAREST: return tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST;
+ case gl.LINEAR_MIPMAP_LINEAR: return tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR;
+ default:
+ throw new Error("Can't map GL filter mode" + filterMode);
+ }
+};
+
+/* TODO: Port the code below */
+// /*--------------------------------------------------------------------*//*!
+// * \brief Map GL sampler parameters to tcu::Sampler.
+// *
+// * If no mapping is found, throws tcu::InternalError.
+// *
+// * \param wrapS S-component wrap mode
+// * \param minFilter Minification filter mode
+// * \param magFilter Magnification filter mode
+// * \return Sampler description.
+// *//*--------------------------------------------------------------------*/
+// /*tcu::Sampler mapGLSamplerWrapS (deUint32 wrapS, deUint32 minFilter, deUint32 magFilter)
+// {
+// return mapGLSampler(wrapS, wrapS, wrapS, minFilter, magFilter);
+// }
+// */
+
+/**
+ * Map GL sampler parameters to tcu::Sampler.
+ *
+ * If no mapping is found, throws tcu::InternalError.
+ *
+ * @param {number} wrapS S-component wrap mode
+ * @param {number} wrapT T-component wrap mode
+ * @param {number} minFilter Minification filter mode
+ * @param {number} magFilter Magnification filter mode
+ * @return {tcuTexture.Sampler}
+ */
+gluTextureUtil.mapGLSamplerWrapST = function(wrapS, wrapT, minFilter, magFilter) {
+ return gluTextureUtil.mapGLSampler(wrapS, wrapT, wrapS, minFilter, magFilter);
+};
+
+/**
+ * Map GL sampler parameters to tcu::Sampler.
+ *
+ * If no mapping is found, throws tcu::InternalError.
+ * @param {number} wrapS S-component wrap mode
+ * @param {number} wrapT T-component wrap mode
+ * @param {number} wrapR R-component wrap mode
+ * @param {number} minFilter Minification filter mode
+ * @param {number} magFilter Magnification filter mode
+ * @return {tcuTexture.Sampler}
+ */
+gluTextureUtil.mapGLSampler = function(wrapS, wrapT, wrapR, minFilter, magFilter) {
+ return new tcuTexture.Sampler(
+ gluTextureUtil.mapGLWrapMode(wrapS),
+ gluTextureUtil.mapGLWrapMode(wrapT),
+ gluTextureUtil.mapGLWrapMode(wrapR),
+ gluTextureUtil.mapGLFilterMode(minFilter),
+ gluTextureUtil.mapGLFilterMode(magFilter),
+ 0.0,
+ true,
+ tcuTexture.CompareMode.COMPAREMODE_NONE,
+ 0,
+ [0.0, 0.0, 0.0, 0.0]);
+};
+
+// /*--------------------------------------------------------------------*//*!
+// * \brief Map GL compare function to tcu::Sampler::CompareMode.
+// *
+// * If no mapping is found, throws tcu::InternalError.
+// *
+// * \param mode GL compare mode
+// * \return Compare mode
+// *//*--------------------------------------------------------------------*/
+/**
+ * @param {number} mode
+ */
+gluTextureUtil.mapGLCompareFunc = function(mode) {
+ switch (mode) {
+ case gl.LESS: return tcuTexture.CompareMode.COMPAREMODE_LESS;
+ case gl.LEQUAL: return tcuTexture.CompareMode.COMPAREMODE_LESS_OR_EQUAL;
+ case gl.GREATER: return tcuTexture.CompareMode.COMPAREMODE_GREATER;
+ case gl.GEQUAL: return tcuTexture.CompareMode.COMPAREMODE_GREATER_OR_EQUAL;
+ case gl.EQUAL: return tcuTexture.CompareMode.COMPAREMODE_EQUAL;
+ case gl.NOTEQUAL: return tcuTexture.CompareMode.COMPAREMODE_NOT_EQUAL;
+ case gl.ALWAYS: return tcuTexture.CompareMode.COMPAREMODE_ALWAYS;
+ case gl.NEVER: return tcuTexture.CompareMode.COMPAREMODE_NEVER;
+ default:
+ throw new Error("Can't map GL compare mode " + mode);
+ }
+};
+
+/**
+ * Get GL wrap mode.
+ *
+ * If no mapping is found, throws tcu::InternalError.
+ *
+ * @param {tcuTexture.WrapMode} wrapMode
+ * @return {number} GL wrap mode
+ */
+gluTextureUtil.getGLWrapMode = function(wrapMode) {
+ switch (wrapMode) {
+ case tcuTexture.WrapMode.CLAMP_TO_EDGE: return gl.CLAMP_TO_EDGE;
+ case tcuTexture.WrapMode.REPEAT_GL: return gl.REPEAT;
+ case tcuTexture.WrapMode.MIRRORED_REPEAT_GL: return gl.MIRRORED_REPEAT;
+ default:
+ throw new Error("Can't map wrap mode");
+ }
+};
+
+/**
+ * Get GL filter mode.
+ *
+ * If no mapping is found, throws tcu::InternalError.
+ *
+ * @param {tcuTexture.FilterMode} filterMode Filter mode
+ * @return {number} GL filter mode
+ */
+gluTextureUtil.getGLFilterMode = function(filterMode) {
+ switch (filterMode) {
+ case tcuTexture.FilterMode.NEAREST: return gl.NEAREST;
+ case tcuTexture.FilterMode.LINEAR: return gl.LINEAR;
+ case tcuTexture.FilterMode.NEAREST_MIPMAP_NEAREST: return gl.NEAREST_MIPMAP_NEAREST;
+ case tcuTexture.FilterMode.NEAREST_MIPMAP_LINEAR: return gl.NEAREST_MIPMAP_LINEAR;
+ case tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST: return gl.LINEAR_MIPMAP_NEAREST;
+ case tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR: return gl.LINEAR_MIPMAP_LINEAR;
+ default:
+ throw new Error("Can't map filter mode");
+ }
+};
+
+/**
+ * Get GL compare mode.
+ *
+ * If no mapping is found, throws tcu::InternalError.
+ *
+ * @param {tcuTexture.CompareMode} compareMode Compare mode
+ * @return {number} GL compare mode
+ */
+gluTextureUtil.getGLCompareFunc = function(compareMode) {
+ switch (compareMode) {
+ case tcuTexture.CompareMode.COMPAREMODE_NONE: return gl.NONE;
+ case tcuTexture.CompareMode.COMPAREMODE_LESS: return gl.LESS;
+ case tcuTexture.CompareMode.COMPAREMODE_LESS_OR_EQUAL: return gl.LEQUAL;
+ case tcuTexture.CompareMode.COMPAREMODE_GREATER: return gl.GREATER;
+ case tcuTexture.CompareMode.COMPAREMODE_GREATER_OR_EQUAL: return gl.GEQUAL;
+ case tcuTexture.CompareMode.COMPAREMODE_EQUAL: return gl.EQUAL;
+ case tcuTexture.CompareMode.COMPAREMODE_NOT_EQUAL: return gl.NOTEQUAL;
+ case tcuTexture.CompareMode.COMPAREMODE_ALWAYS: return gl.ALWAYS;
+ case tcuTexture.CompareMode.COMPAREMODE_NEVER: return gl.NEVER;
+ default:
+ throw new Error("Can't map compare mode");
+ }
+};
+
+/**
+ * Get GL cube face.
+ *
+ * If no mapping is found, throws tcu::InternalError.
+ *
+ * @param {tcuTexture.CubeFace} face Cube face
+ * @return {number} GL cube face
+ */
+gluTextureUtil.getGLCubeFace = function(face) {
+ switch (face) {
+ case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X:
+ return gl.TEXTURE_CUBE_MAP_NEGATIVE_X;
+ case tcuTexture.CubeFace.CUBEFACE_POSITIVE_X:
+ return gl.TEXTURE_CUBE_MAP_POSITIVE_X;
+ case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y:
+ return gl.TEXTURE_CUBE_MAP_NEGATIVE_Y;
+ case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y:
+ return gl.TEXTURE_CUBE_MAP_POSITIVE_Y;
+ case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z:
+ return gl.TEXTURE_CUBE_MAP_NEGATIVE_Z;
+ case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z:
+ return gl.TEXTURE_CUBE_MAP_POSITIVE_Z;
+ default:
+ throw Error("Can't map cube face");
+ }
+};
+
+// /*--------------------------------------------------------------------*//*!
+// * \brief Get GLSL sampler type for texture format.
+// *
+// * If no mapping is found, glu::TYPE_LAST is returned.
+// *
+// * \param format Texture format
+// * \return GLSL 1D sampler type for format
+// *//*--------------------------------------------------------------------*/
+// DataType getSampler1DType (tcu::TextureFormat format)
+// {
+// using tcu::TextureFormat;
+
+// if (format.order == tcuTexture.ChannelOrder.D || format.order == tcuTexture.ChannelOrder.DS)
+// return TYPE_SAMPLER_1D;
+
+// if (format.order == tcuTexture.ChannelOrder.S)
+// return TYPE_LAST;
+
+// switch (tcu::getTextureChannelClass(format.type))
+// {
+// case tcu::TEXTURECHANNELCLASS_FLOATING_POINT:
+// case tcu::TEXTURECHANNELCLASS_SIGNED_FIXED_POINT:
+// case tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT:
+// return glu::TYPE_SAMPLER_1D;
+
+// case tcu::TEXTURECHANNELCLASS_SIGNED_INTEGER:
+// return glu::TYPE_INT_SAMPLER_1D;
+
+// case tcu::TEXTURECHANNELCLASS_UNSIGNED_INTEGER:
+// return glu::TYPE_UINT_SAMPLER_1D;
+
+// default:
+// return glu::TYPE_LAST;
+// }
+// }
+
+/**
+ * Get GLSL sampler type for texture format.
+ * If no mapping is found, glu::TYPE_LAST is returned.
+ *
+ * @param {tcuTexture.TextureFormat} format
+ * @return {gluShaderUtil.DataType} GLSL 2D sampler type for format
+ */
+gluTextureUtil.getSampler2DType = function(format) {
+ if (format.order == tcuTexture.ChannelOrder.D || format.order == tcuTexture.ChannelOrder.DS)
+ return gluShaderUtil.DataType.SAMPLER_2D;
+
+ if (format.order == tcuTexture.ChannelOrder.S)
+ return /** @type {gluShaderUtil.DataType} */ (Object.keys(gluShaderUtil.DataType).length);
+
+ switch (tcuTexture.getTextureChannelClass(format.type)) {
+ case tcuTexture.TextureChannelClass.FLOATING_POINT:
+ case tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT:
+ case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT:
+ return gluShaderUtil.DataType.SAMPLER_2D;
+
+ case tcuTexture.TextureChannelClass.SIGNED_INTEGER:
+ return gluShaderUtil.DataType.INT_SAMPLER_2D;
+
+ case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER:
+ return gluShaderUtil.DataType.UINT_SAMPLER_2D;
+
+ default:
+ return /** @type {gluShaderUtil.DataType} */ (Object.keys(gluShaderUtil.DataType).length);
+ }
+};
+
+/**
+ *
+ * @param {tcuTexture.TextureFormat} format
+ * @return {gluShaderUtil.DataType} GLSL 2D sampler type for format
+ */
+gluTextureUtil.getSampler3DType = function(format) {
+ if (format.order === tcuTexture.ChannelOrder.D || format.order === tcuTexture.ChannelOrder.DS)
+ return gluShaderUtil.DataType.SAMPLER_3D;
+
+ if (format.order === tcuTexture.ChannelOrder.S)
+ return /** @type {gluShaderUtil.DataType} */ (Object.keys(gluShaderUtil.DataType).length); // shouldn't we throw an error instead?
+
+ switch (tcuTexture.getTextureChannelClass(format.type)) {
+ case tcuTexture.TextureChannelClass.FLOATING_POINT:
+ case tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT:
+ case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT:
+ return gluShaderUtil.DataType.SAMPLER_3D;
+
+ case tcuTexture.TextureChannelClass.SIGNED_INTEGER:
+ return gluShaderUtil.DataType.INT_SAMPLER_3D;
+
+ case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER:
+ return gluShaderUtil.DataType.UINT_SAMPLER_3D;
+
+ default:
+ return /** @type {gluShaderUtil.DataType} */ (Object.keys(gluShaderUtil.DataType).length);
+ }
+};
+
+/**
+ * \brief Get GLSL sampler type for texture format.
+ *
+ * @param {tcuTexture.TextureFormat} format
+ * @return {gluShaderUtil.DataType} GLSL 2D sampler type for format
+ */
+gluTextureUtil.getSamplerCubeType = function(format) {
+ if (format.order == tcuTexture.ChannelOrder.D || format.order == tcuTexture.ChannelOrder.DS)
+ return gluShaderUtil.DataType.SAMPLER_CUBE;
+
+ if (format.order == tcuTexture.ChannelOrder.S)
+ throw new Error('No cube sampler');
+
+ switch (tcuTexture.getTextureChannelClass(format.type)) {
+ case tcuTexture.TextureChannelClass.FLOATING_POINT:
+ case tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT:
+ case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT:
+ return gluShaderUtil.DataType.SAMPLER_CUBE;
+
+ case tcuTexture.TextureChannelClass.SIGNED_INTEGER:
+ return gluShaderUtil.DataType.INT_SAMPLER_CUBE;
+
+ case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER:
+ return gluShaderUtil.DataType.UINT_SAMPLER_CUBE;
+
+ default:
+ throw new Error('No cube sampler');
+ }
+};
+
+/**
+ * \brief Get GLSL sampler type for texture format.
+ *
+ * If no mapping is found, glu::TYPE_LAST is returned.
+ *
+ * @param {tcuTexture.TextureFormat} format
+ * @return {gluShaderUtil.DataType} GLSL 2D sampler type for format
+ */
+gluTextureUtil.getSampler2DArrayType = function(format) {
+
+ if (format.order == tcuTexture.ChannelOrder.D || format.order == tcuTexture.ChannelOrder.DS)
+ return gluShaderUtil.DataType.SAMPLER_2D_ARRAY;
+
+ if (format.order == tcuTexture.ChannelOrder.S)
+ throw new Error('No 2d array sampler');
+
+ switch (tcuTexture.getTextureChannelClass(format.type)) {
+ case tcuTexture.TextureChannelClass.FLOATING_POINT:
+ case tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT:
+ case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT:
+ return gluShaderUtil.DataType.SAMPLER_2D_ARRAY;
+
+ case tcuTexture.TextureChannelClass.SIGNED_INTEGER:
+ return gluShaderUtil.DataType.INT_SAMPLER_2D_ARRAY;
+
+ case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER:
+ return gluShaderUtil.DataType.UINT_SAMPLER_2D_ARRAY;
+
+ default:
+ throw new Error('No 2d array sampler');
+ }
+};
+
+/**
+ * \brief Get GLSL sampler type for texture format.
+ *
+ * If no mapping is found, glu::TYPE_LAST is returned.
+ *
+ * @param {tcuTexture.TextureFormat} format
+ * @return {gluShaderUtil.DataType} GLSL 2D sampler type for format
+ */
+gluTextureUtil.getSampler3D = function(format) {
+ if (format.order == tcuTexture.ChannelOrder.D || format.order == tcuTexture.ChannelOrder.DS)
+ return gluShaderUtil.DataType.SAMPLER_3D;
+
+ if (format.order == tcuTexture.ChannelOrder.S)
+ throw new Error('No 3d sampler');
+
+ switch (tcuTexture.getTextureChannelClass(format.type)) {
+ case tcuTexture.TextureChannelClass.FLOATING_POINT:
+ case tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT:
+ case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT:
+ return gluShaderUtil.DataType.SAMPLER_3D;
+
+ case tcuTexture.TextureChannelClass.SIGNED_INTEGER:
+ return gluShaderUtil.DataType.INT_SAMPLER_3D;
+
+ case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER:
+ return gluShaderUtil.DataType.UINT_SAMPLER_3D;
+
+ default:
+ throw new Error('No 3d sampler');
+ }
+};
+
+gluTextureUtil.RenderableType = {
+ RENDERABLE_COLOR: (1<<0),
+ RENDERABLE_DEPTH: (1<<1),
+ RENDERABLE_STENCIL: (1<<2)
+};
+
+/**
+ * \brief Get renderable bits.
+ * \note Works currently only on ES3 context.
+ *
+ * @param {number} internalFormat
+ * @return {gluTextureUtil.RenderableType}
+ */
+gluTextureUtil.getRenderableBitsES3 = function(internalFormat)
+{
+ switch (internalFormat)
+ {
+ // Color-renderable formats
+ case gl.RGBA32I:
+ case gl.RGBA32UI:
+ case gl.RGBA16I:
+ case gl.RGBA16UI:
+ case gl.RGBA8:
+ case gl.RGBA8I:
+ case gl.RGBA8UI:
+ case gl.SRGB8_ALPHA8:
+ case gl.RGB10_A2:
+ case gl.RGB10_A2UI:
+ case gl.RGBA4:
+ case gl.RGB5_A1:
+ case gl.RGB8:
+ case gl.RGB565:
+ case gl.RG32I:
+ case gl.RG32UI:
+ case gl.RG16I:
+ case gl.RG16UI:
+ case gl.RG8:
+ case gl.RG8I:
+ case gl.RG8UI:
+ case gl.R32I:
+ case gl.R32UI:
+ case gl.R16I:
+ case gl.R16UI:
+ case gl.R8:
+ case gl.R8I:
+ case gl.R8UI:
+ return gluTextureUtil.RenderableType.RENDERABLE_COLOR;
+
+ // EXT_color_buffer_float
+ case gl.RGBA32F:
+ case gl.R11F_G11F_B10F:
+ case gl.RG32F:
+ case gl.R32F:
+ case gl.RGBA16F:
+ case gl.RG16F:
+ case gl.R16F:
+ if (gl.getExtension("EXT_color_buffer_float"))
+ return gluTextureUtil.RenderableType.RENDERABLE_COLOR;
+ else
+ return 0;
+
+ // Depth formats
+ case gl.DEPTH_COMPONENT32F:
+ case gl.DEPTH_COMPONENT24:
+ case gl.DEPTH_COMPONENT16:
+ return gluTextureUtil.RenderableType.RENDERABLE_DEPTH;
+
+ // Depth+stencil formats
+ case gl.DEPTH32F_STENCIL8:
+ case gl.DEPTH24_STENCIL8:
+ return gluTextureUtil.RenderableType.RENDERABLE_DEPTH | gluTextureUtil.RenderableType.RENDERABLE_STENCIL;
+
+ // Stencil formats
+ case gl.STENCIL_INDEX8:
+ return gluTextureUtil.RenderableType.RENDERABLE_STENCIL;
+
+ default:
+ return 0;
+ }
+}
+
+/**
+ * \brief Check if sized internal format is color-renderable.
+ * \note Works currently only on ES3 context.
+ *
+ * @param {number} sizedFormat
+ * @return {boolean}
+ */
+gluTextureUtil.isSizedFormatColorRenderable = function(sizedFormat)
+{
+ var renderable = 0;
+ renderable = gluTextureUtil.getRenderableBitsES3(sizedFormat);
+ return (renderable & gluTextureUtil.RenderableType.RENDERABLE_COLOR) != 0;
+}
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluVarType.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluVarType.js
new file mode 100644
index 0000000000..a05f1c1e5c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluVarType.js
@@ -0,0 +1,814 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.opengl.gluVarType');
+goog.require('framework.opengl.gluShaderUtil');
+
+goog.scope(function() {
+
+ var gluVarType = framework.opengl.gluVarType;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+
+ /**
+ * gluVarType.VarType types enum
+ * @enum {number}
+ */
+ gluVarType.Type = {
+ TYPE_BASIC: 0,
+ TYPE_ARRAY: 1,
+ TYPE_STRUCT: 2
+ };
+
+ /**
+ * gluVarType.TypeArray struct
+ * @param {gluVarType.VarType} elementType
+ * @param {number} arraySize
+ * @constructor
+ */
+ gluVarType.TypeArray = function(elementType, arraySize) {
+ /** @type {gluVarType.VarType} */ this.elementType = gluVarType.newClone(elementType);
+ /** @type {number} */ this.size = arraySize;
+ };
+
+ /**
+ * gluVarType.VarType class
+ * @constructor
+ */
+ gluVarType.VarType = function() {
+ /**
+ * @type {gluShaderUtil.precision}
+ * @private
+ */
+ this.m_flags;
+
+ /**
+ * @type {number}
+ * @private
+ */
+ this.m_type = -1;
+
+ /**
+ * m_data used to be a 'Data' union in C++. Using a var is enough here.
+ * it will contain any necessary value.
+ * case TYPE_BASIC: number
+ * case TYPE_ARRAY: gluVarType.TypeArray
+ * case TYPE_STRUCT: gluVarType.StructType
+ * @private
+ * @type {(number|gluVarType.TypeArray|gluVarType.StructType)}
+ */
+ this.m_data = null;
+ };
+
+ gluVarType.VarType.UNSIZED_ARRAY = -1;
+
+ /**
+ * Creates a basic type gluVarType.VarType. Use this after the constructor call.
+ * @param {number} basicType
+ * @param {gluShaderUtil.precision} flags
+ * @return {gluVarType.VarType} The currently modified object
+ */
+ gluVarType.VarType.prototype.VarTypeBasic = function(basicType, flags) {
+ this.m_type = gluVarType.Type.TYPE_BASIC;
+ this.m_flags = flags;
+ this.m_data = basicType;
+
+ return this;
+ };
+
+ /**
+ * Creates a basic type gluVarType.VarType with type boolean and undefined precision.
+ * @param {number} basicType
+ * @return {gluVarType.VarType} The currently modified object
+ */
+ gluVarType.VarType.prototype.VarTypeBoolean = function(basicType) {
+ this.m_type = gluVarType.Type.TYPE_BASIC;
+ this.m_data = basicType;
+
+ return this;
+ };
+
+ /**
+ * Creates an array type gluVarType.VarType. Use this after the constructor call.
+ * @param {gluVarType.VarType} elementType
+ * @param {number} arraySize
+ * @return {gluVarType.VarType} The currently modified object
+ */
+ gluVarType.VarType.prototype.VarTypeArray = function(elementType, arraySize) {
+ this.m_type = gluVarType.Type.TYPE_ARRAY;
+ if (!(arraySize >= 0 || arraySize == gluVarType.VarType.UNSIZED_ARRAY))
+ throw new Error('Illegal array size: ' + arraySize);
+ this.m_data = new gluVarType.TypeArray(elementType, arraySize);
+
+ return this;
+ };
+
+ /**
+ * Creates a struct type gluVarType.VarType. Use this after the constructor call.
+ * @param {gluVarType.StructType} structPtr
+ * @return {gluVarType.VarType} The currently modified object
+ */
+ gluVarType.VarType.prototype.VarTypeStruct = function(structPtr) {
+ this.m_type = gluVarType.Type.TYPE_STRUCT;
+ this.m_data = structPtr;
+
+ return this;
+ };
+
+ /**
+ * Creates a gluVarType.VarType, the same type as the passed in object.
+ * Use this after the constructor call.
+ * @param {gluVarType.VarType} object
+ * @return {gluVarType.VarType} The currently modified object
+ */
+ gluVarType.VarType.prototype.VarTypeClone = function(object) {
+
+ this.m_type = object.m_type;
+
+ switch (this.m_type) {
+ case gluVarType.Type.TYPE_BASIC:
+ this.m_flags = object.m_flags;
+ this.m_data = object.m_data;
+ break;
+ case gluVarType.Type.TYPE_BASIC:
+ this.m_data = new gluVarType.TypeArray(object.m_data.elementType, object.m_data.size);
+ break;
+ case gluVarType.Type.TYPE_STRUCT:
+ this.m_data = object.m_data;
+ break;
+ default:
+ throw new Error('unknown type: ' + this.m_type);
+ }
+
+ return this;
+ };
+
+ /** isBasicType
+ * @return {boolean} true if the gluVarType.VarType represents a basic type.
+ */
+ gluVarType.VarType.prototype.isBasicType = function() {
+ return this.m_type == gluVarType.Type.TYPE_BASIC;
+ };
+
+ /** isArrayType
+ * @return {boolean} true if the gluVarType.VarType represents an array.
+ */
+ gluVarType.VarType.prototype.isArrayType = function() {
+ return this.m_type == gluVarType.Type.TYPE_ARRAY;
+ };
+
+ /** isStructType
+ * @return {boolean} true if the gluVarType.VarType represents a struct.
+ */
+ gluVarType.VarType.prototype.isStructType = function() {
+ return this.m_type == gluVarType.Type.TYPE_STRUCT;
+ };
+
+ /** getFlags
+ * @return {number} returns the flags of the gluVarType.VarType.
+ */
+ gluVarType.VarType.prototype.getFlags = function() {
+ return this.m_flags;
+ };
+
+ /** getBasicType
+ * @return {gluShaderUtil.DataType<number>} returns the basic data type of the gluVarType.VarType.
+ */
+ gluVarType.VarType.prototype.getBasicType = function() {
+ if (!this.isBasicType())
+ throw new Error('VarType is not a basic type.');
+ return /** @type {gluShaderUtil.DataType<number>} */ (this.m_data);
+ };
+
+ /** getPrecision
+ * @return {gluShaderUtil.precision} returns the precision flag.
+ */
+ gluVarType.VarType.prototype.getPrecision = function() {
+ if (!this.isBasicType())
+ throw new Error('VarType is not a basic type.');
+ return this.m_flags;
+ };
+
+ /** getElementType
+ * @return {gluVarType.VarType} returns the gluVarType.VarType of the element in case of an Array.
+ */
+ gluVarType.VarType.prototype.getElementType = function() {
+ if (!this.isArrayType())
+ throw new Error('VarType is not an array type.');
+ return this.m_data.elementType;
+ };
+
+ /** getArraySize
+ * (not to be confused with a javascript array)
+ * @return {number} returns the size of the array in case it is an array.
+ */
+ gluVarType.VarType.prototype.getArraySize = function() {
+ if (!this.isArrayType())
+ throw new Error('VarType is not an array type.');
+ return this.m_data.size;
+ };
+
+ /** getStruct
+ * @return {gluVarType.StructType} returns the structure when it is a gluVarType.StructType.
+ */
+ gluVarType.VarType.prototype.getStruct = function() {
+ if (!this.isStructType())
+ throw new Error('VarType is not a struct type.');
+ return /** @type {gluVarType.StructType} */ (this.m_data);
+ };
+
+ /**
+ * getScalarSize
+ * @return {number} size of the scalar
+ */
+ gluVarType.VarType.prototype.getScalarSize = function() {
+ switch (this.m_type) {
+ case gluVarType.Type.TYPE_BASIC: {
+ return gluShaderUtil.getDataTypeScalarSize(/** @type {gluShaderUtil.DataType} */(this.getBasicType()));
+ }
+
+ // TODO: check implementation below: return m_data.array.elementType->getScalarSize()*m_data.array.size;
+ case gluVarType.Type.TYPE_ARRAY: {
+ var m_data = /** @type {gluVarType.TypeArray} */(this.m_data);
+ return m_data.elementType.getScalarSize() * m_data.size;
+ }
+
+ case gluVarType.Type.TYPE_STRUCT: {
+ var size = 0;
+
+ var struct = /** @type {gluVarType.StructType} */ (this.m_data);
+
+ // TODO: check loop conditions below
+ // for (gluVarType.StructType::ConstIterator iter = m_data.structPtr->begin(); iter != m_data.structPtr->end(); iter++)
+ for (var iter = 0; struct.m_members[iter] < struct.getSize(); iter++)
+ size += struct.getMember(iter).m_type.getScalarSize();
+ return size;
+ }
+
+ default:
+ // throw new Error('Unexpected type.');
+ return 0;
+ }
+ };
+
+ /**
+ * is
+ * @return {boolean} returns true if the current object is equivalent to other.
+ */
+ gluVarType.VarType.prototype.is = function(other) {
+ if (this.m_type != other.m_type)
+ return false;
+
+ switch (this.m_type) {
+ case gluVarType.Type.TYPE_BASIC:
+ return this.m_data == other.m_data &&
+ this.m_flags == other.m_flags;
+
+ case gluVarType.Type.TYPE_ARRAY:
+ return this.m_data.elementType == other.m_data.elementType &&
+ this.m_data.size == other.m_data.size;
+
+ case gluVarType.Type.TYPE_STRUCT:
+ return this.m_data === other.m_data;
+
+ default:
+ // throw new Error('Unexpected type.');
+ return false;
+ }
+ };
+
+ /**
+ * isnt
+ * @return {boolean} returns true if the current object is not equivalent to other.
+ */
+ gluVarType.VarType.prototype.isnt = function(other) {
+ return !(this.is(other));
+ };
+
+ /**
+ * Creates a basic type gluVarType.VarType.
+ * @param {gluShaderUtil.DataType} basicType
+ * @param {framework.opengl.gluShaderUtil.precision=} flags
+ * @return {gluVarType.VarType}
+ */
+ gluVarType.newTypeBasic = function(basicType, flags) {
+ if (!gluShaderUtil.isDataTypeBoolOrBVec(basicType))
+ return new gluVarType.VarType().VarTypeBasic(basicType, /** @type {framework.opengl.gluShaderUtil.precision}*/ (flags));
+ else
+ return new gluVarType.VarType().VarTypeBoolean(basicType);
+ };
+
+ /**
+ * Creates an array type gluVarType.VarType.
+ * @param {gluVarType.VarType} elementType
+ * @param {number} arraySize
+ * @return {gluVarType.VarType}
+ */
+ gluVarType.newTypeArray = function(elementType, arraySize) {
+ return new gluVarType.VarType().VarTypeArray(elementType, arraySize);
+ };
+
+ /**
+ * Creates a struct type gluVarType.VarType.
+ * @param {gluVarType.StructType} structPtr
+ * @return {gluVarType.VarType}
+ */
+ gluVarType.newTypeStruct = function(structPtr) {
+ return new gluVarType.VarType().VarTypeStruct(structPtr);
+ };
+
+ /**
+ * Creates a struct type gluVarType.VarType.
+ * @param {gluVarType.VarType} object
+ * @return {gluVarType.VarType}
+ */
+ gluVarType.newClone = function(object) {
+ return new gluVarType.VarType().VarTypeClone(object);
+ };
+
+ /**
+ * gluVarType.StructMember class
+ * @constructor
+ */
+ gluVarType.StructMember = function() {
+ /** @type {string} */ this.m_name;
+ /** @type {gluVarType.VarType} */ this.m_type;
+ /** @type {number} */ // this.m_flags = 0; // only in glsUniformBlockCase
+ };
+
+ /**
+ * Creates a gluVarType.StructMember. Use this after the constructor call.
+ * @param {string} name
+ * @param {gluVarType.VarType} type
+ * @return {gluVarType.StructMember} The currently modified object
+ */
+ gluVarType.StructMember.prototype.Constructor = function(name, type) {
+ this.m_type = type;
+ this.m_name = name;
+
+ return this;
+ };
+
+ /** getName
+ * @return {string} name of the gluVarType.StructMember object.
+ */
+ gluVarType.StructMember.prototype.getName = function() {
+ return this.m_name;
+ };
+
+ /** getType
+ * @return {gluVarType.VarType} type of the gluVarType.StructMember object.
+ */
+ gluVarType.StructMember.prototype.getType = function() {
+ return this.m_type;
+ };
+
+ /**
+ * Creates a gluVarType.StructMember.
+ * @param {string} name
+ * @param {gluVarType.VarType} type
+ * @return {gluVarType.StructMember}
+ */
+ gluVarType.newStructMember = function(name, type) {
+ return new gluVarType.StructMember().Constructor(name, type);
+ };
+
+ /**
+ * gluVarType.StructType class
+ * @constructor
+ */
+ gluVarType.StructType = function() {
+ /** @type {string} */ this.m_typeName = '';
+ /** @type {Array<gluVarType.StructMember>} */ this.m_members = [];
+ };
+
+ /**
+ * Creates a gluVarType.StructType. Use this after the constructor call.
+ * @param {string} name
+ * @return {gluVarType.StructType} The currently modified object
+ */
+ gluVarType.StructType.prototype.Constructor = function(name) {
+ /** @type {string}*/ this.m_typeName = this.setTypeName(name);
+ return this;
+ };
+
+ /** hasTypeName
+ * Checks if the gluVarType.StructType m_typeName is defined
+ * @return {boolean}
+ */
+ gluVarType.StructType.prototype.hasTypeName = function() {
+ return (this.m_typeName !== 'undefined');
+ };
+
+ /** setTypeName
+ * @param {string} name
+ * @return {string} returns gluVarType.StructType.m_typeName
+ */
+ gluVarType.StructType.prototype.setTypeName = function(name) {
+ return this.m_typeName = name;
+ };
+
+ /** getTypeName
+ * @return {string}
+ */
+ gluVarType.StructType.prototype.getTypeName = function() {
+ return this.m_typeName;
+ };
+
+ /** getNumMembers
+ * @return {number}
+ */
+ gluVarType.StructType.prototype.getNumMembers = function() {
+ return this.m_members.length;
+ };
+
+ /** getMember
+ * @param {number} memberNdx The index of the member to retrieve.
+ * @return {gluVarType.StructMember}
+ */
+ gluVarType.StructType.prototype.getMember = function(memberNdx) {
+ if (memberNdx >= 0 && memberNdx < this.m_members.length)
+ return this.m_members[memberNdx];
+ else {
+ throw new Error('Invalid member index for StructTypes members');
+ }
+ };
+
+ /** getSize
+ * @return {number} The size of the m_members array.
+ */
+ gluVarType.StructType.prototype.getSize = function() {
+ return this.m_members.length;
+ };
+
+ /** addMember
+ * @param {string} name
+ * @param {gluVarType.VarType} type
+ */
+ gluVarType.StructType.prototype.addMember = function(name, type) {
+ var member = gluVarType.newStructMember(name, type);
+ this.m_members.push(member);
+ };
+
+ /**
+ * Creates a gluVarType.StructType.
+ * @param {string} name
+ * @return {gluVarType.StructType}
+ */
+ gluVarType.newStructType = function(name) {
+ return new gluVarType.StructType().Constructor(name);
+ };
+
+ /**
+ * @param {number} level
+ * @return {string}
+ */
+ gluVarType.indent = function(level) {
+ /** @type {string} */ var str = '';
+ for (var i = 0; i < level; i++)
+ str += '\t';
+ return str;
+ };
+
+ /**
+ * @param {gluVarType.VarType} varType
+ * @param {string} name
+ * @param {number=} level
+ * @return {string}
+ */
+ gluVarType.declareVariable = function(varType, name, level) {
+ /** @type {string} */ var str = '';
+ /** @type {gluVarType.VarType} */ var type = varType;
+ /** @type {gluVarType.VarType} */ var curType = type;
+ /** @type {Array<number>} */ var arraySizes = [];
+
+ // Handle arrays.
+ while (curType.isArrayType()) {
+ arraySizes.push(curType.getArraySize());
+ curType = curType.getElementType();
+ }
+
+ if (curType.isBasicType()) {
+ if (curType.getPrecision() !== undefined)
+ str += gluShaderUtil.getPrecisionName(curType.getPrecision()) + ' ';
+ str += gluShaderUtil.getDataTypeName(/** @type {gluShaderUtil.DataType} */(curType.getBasicType()));
+ } else if (curType.isStructType()) {
+ /** @type {gluVarType.StructType} */ var structPtr = curType.getStruct();
+
+ if (structPtr.hasTypeName())
+ str += structPtr.getTypeName();
+ else
+ str += gluVarType.declareStructType(structPtr, level); // Generate inline declaration.
+ } else
+ throw new Error('Unexpected Array typed VarType.');
+
+ str += ' ' + name;
+
+ // Print array sizes.
+ for (var size = 0; size < arraySizes.length; size++) { //std::vector<int>::const_iterator sizeIter = arraySizes.begin(); sizeIter != arraySizes.end(); sizeIter++) {
+ /** @type {number} */ var arrSize = arraySizes[size];
+ if (arrSize == gluVarType.VarType.UNSIZED_ARRAY)
+ str += '[]';
+ else
+ str += '[' + arrSize + ']';
+ }
+
+ return str;
+ };
+
+ /**
+ * @param {gluVarType.StructType} structType
+ * @param {number=} level
+ * @return {string}
+ */
+ gluVarType.declareStructType = function(structType, level) {
+ /** @type {string} */ var str = 'struct';
+ level = level || 0;
+
+ // gluVarType.Type name is optional.
+ if (structType.hasTypeName())
+ str += ' ' + structType.getTypeName();
+
+ str += '\n' + gluVarType.indent(level) + ' {\n';
+
+ for (var memberNdx = 0; memberNdx < structType.getSize(); memberNdx++) { //gluVarType.StructType::ConstIterator memberIter = decl.structPtr->begin(); memberIter != decl.structPtr->end(); memberIter++) {
+ /** @type {gluVarType.StructMember} */ var memberIter = structType.getMember(memberNdx);
+ str += gluVarType.indent(level + 1);
+ str += gluVarType.declareVariable(memberIter.getType(), memberIter.getName(), level + 1) + ';\n';
+ }
+
+ str += gluVarType.indent(level) + '}';
+
+ return str;
+ };
+
+ /**
+ * @param {*} T
+ * @param {number=} size
+ * @param {gluShaderUtil.precision=} precision
+ * @return {gluVarType.VarType}
+ */
+ gluVarType.getVarTypeOf = function(T, size, precision) {
+ size = size || 1;
+ precision = precision || gluShaderUtil.precision.PRECISION_LOWP;
+ switch (size) {
+ case 4: return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_VEC4, precision);
+ case 3: return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_VEC3, precision);
+ case 2: return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_VEC2, precision);
+ }
+ switch (T) {
+ case 'float' : return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT, precision);
+ case 'vec4': return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_VEC4, precision);
+ case 'vec3': return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_VEC3, precision);
+ case 'vec2': return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_VEC2, precision);
+ case 'mat2': return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_MAT2, precision);
+ case 'mat2x3': return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_MAT2X3, precision);
+ case 'mat2x4': return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_MAT2X4, precision);
+ case 'mat3x2': return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_MAT3X2, precision);
+ case 'mat3': return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_MAT3, precision);
+ case 'mat3x4': return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_MAT3X4, precision);
+ case 'mat4x2': return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_MAT4X2, precision);
+ case 'mat4x3': return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_MAT4X3, precision);
+ case 'mat4': return gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_MAT4, precision);
+ }
+ throw new Error('Invalid input type ' + T + ' or size ' + size);
+ };
+
+ /**
+ * @enum
+ */
+ gluVarType.Storage = {
+ STORAGE_IN: 0,
+ STORAGE_OUT: 1,
+ STORAGE_CONST: 2,
+ STORAGE_UNIFORM: 3,
+ STORAGE_BUFFER: 4
+ };
+
+ /**
+ * @param {gluVarType.Storage} storage
+ * @return {string}
+ */
+ gluVarType.getStorageName = function(storage) {
+ switch (storage) {
+ case gluVarType.Storage.STORAGE_IN: return 'in';
+ case gluVarType.Storage.STORAGE_OUT: return 'out';
+ case gluVarType.Storage.STORAGE_CONST: return 'const';
+ case gluVarType.Storage.STORAGE_UNIFORM: return 'uniform';
+ case gluVarType.Storage.STORAGE_BUFFER: return 'buffer';
+ default:
+ throw new Error('Unknown storage: ' + storage);
+ }
+ };
+
+ /**
+ * @enum
+ */
+ gluVarType.Interpolation = {
+ INTERPOLATION_SMOOTH: 0,
+ INTERPOLATION_FLAT: 1,
+ INTERPOLATION_CENTROID: 2
+ };
+
+ /**
+ * @param {gluVarType.Interpolation} interpolation
+ * @return {string}
+ */
+ gluVarType.getInterpolationName = function(interpolation) {
+ switch (interpolation) {
+ case gluVarType.Interpolation.INTERPOLATION_SMOOTH: return 'smooth';
+ case gluVarType.Interpolation.INTERPOLATION_FLAT: return 'flat';
+ case gluVarType.Interpolation.INTERPOLATION_CENTROID: return 'centrod';
+ default:
+ throw new Error('Unknown interpolation: ' + interpolation);
+ }
+ };
+
+ /**
+ * @enum
+ */
+ gluVarType.FormatLayout = {
+ FORMATLAYOUT_RGBA32F: 0,
+ FORMATLAYOUT_RGBA16F: 1,
+ FORMATLAYOUT_R32F: 2,
+ FORMATLAYOUT_RGBA8: 3,
+ FORMATLAYOUT_RGBA8_SNORM: 4,
+
+ FORMATLAYOUT_RGBA32I: 5,
+ FORMATLAYOUT_RGBA16I: 6,
+ FORMATLAYOUT_RGBA8I: 7,
+ FORMATLAYOUT_R32I: 8,
+
+ FORMATLAYOUT_RGBA32UI: 9,
+ FORMATLAYOUT_RGBA16UI: 10,
+ FORMATLAYOUT_RGBA8UI: 11,
+ FORMATLAYOUT_R32UI: 12
+ };
+
+ /**
+ * @param {gluVarType.FormatLayout} layout
+ * @return {string}
+ */
+ gluVarType.getFormatLayoutName = function(layout) {
+ switch (layout) {
+ case gluVarType.FormatLayout.FORMATLAYOUT_RGBA32F: return 'rgba32f';
+ case gluVarType.FormatLayout.FORMATLAYOUT_RGBA16F: return 'rgba16f';
+ case gluVarType.FormatLayout.FORMATLAYOUT_R32F: return 'r32f';
+ case gluVarType.FormatLayout.FORMATLAYOUT_RGBA8: return 'rgba8';
+ case gluVarType.FormatLayout.FORMATLAYOUT_RGBA8_SNORM: return 'rgba8_snorm';
+ case gluVarType.FormatLayout.FORMATLAYOUT_RGBA32I: return 'rgba32i';
+ case gluVarType.FormatLayout.FORMATLAYOUT_RGBA16I: return 'rgba16i';
+ case gluVarType.FormatLayout.FORMATLAYOUT_RGBA8I: return 'rgba8i';
+ case gluVarType.FormatLayout.FORMATLAYOUT_R32I: return 'r32i';
+ case gluVarType.FormatLayout.FORMATLAYOUT_RGBA32UI: return 'rgba32ui';
+ case gluVarType.FormatLayout.FORMATLAYOUT_RGBA16UI: return 'rgba16ui';
+ case gluVarType.FormatLayout.FORMATLAYOUT_RGBA8UI: return 'rgba8ui';
+ case gluVarType.FormatLayout.FORMATLAYOUT_R32UI: return 'r32ui';
+ default:
+ throw new Error('Unknown layout: ' + layout);
+ }
+ };
+
+ /**
+ * @enum
+ */
+ gluVarType.MatrixOrder = {
+ MATRIXORDER_COLUMN_MAJOR: 0,
+ MATRIXORDER_ROW_MAJOR: 1
+ };
+
+ /**
+ * @param {gluVarType.MatrixOrder} qualifier
+ * @return {string}
+ */
+ gluVarType.getMatrixOrderName = function(qualifier) {
+ switch (qualifier) {
+ case gluVarType.MatrixOrder.MATRIXORDER_COLUMN_MAJOR: return 'column_major';
+ case gluVarType.MatrixOrder.MATRIXORDER_ROW_MAJOR: return 'row_major';
+ default:
+ throw new Error('Unknown qualifier: ' + qualifier);
+ }
+ };
+
+ gluVarType.MemoryAccessQualifier = {
+ MEMORYACCESSQUALIFIER_COHERENT_BIT: 0x01,
+ MEMORYACCESSQUALIFIER_VOLATILE_BIT: 0x02,
+ MEMORYACCESSQUALIFIER_RESTRICT_BIT: 0x04,
+ MEMORYACCESSQUALIFIER_READONLY_BIT: 0x08,
+ MEMORYACCESSQUALIFIER_WRITEONLY_BIT: 0x10
+ };
+ gluVarType.MemoryAccessQualifier.MEMORYACCESSQUALIFIER_MASK = (gluVarType.MemoryAccessQualifier.MEMORYACCESSQUALIFIER_WRITEONLY_BIT << 1) - 1;
+
+ /**
+ * @param {number} qualifier
+ * @return {string}
+ */
+ gluVarType.getMemoryAccessQualifierName = function(qualifier) {
+ switch (qualifier) {
+ case gluVarType.MemoryAccessQualifier.MEMORYACCESSQUALIFIER_COHERENT_BIT: return 'coherent';
+ case gluVarType.MemoryAccessQualifier.MEMORYACCESSQUALIFIER_VOLATILE_BIT: return 'volatile';
+ case gluVarType.MemoryAccessQualifier.MEMORYACCESSQUALIFIER_RESTRICT_BIT: return 'restrict';
+ case gluVarType.MemoryAccessQualifier.MEMORYACCESSQUALIFIER_READONLY_BIT: return 'readonly';
+ case gluVarType.MemoryAccessQualifier.MEMORYACCESSQUALIFIER_WRITEONLY_BIT: return 'writeonly';
+ default:
+ throw new Error('Unknown qualifier: ' + qualifier);
+ }
+ };
+
+ /**
+ * @constructor
+ * @param {number=} location
+ * @param {number=} binding
+ * @param {number=} offset
+ * @param {gluVarType.FormatLayout=} format
+ * @param {gluVarType.MatrixOrder=} matrixOrder
+ */
+ gluVarType.Layout = function(location, binding, offset, format, matrixOrder) {
+ this.location = location;
+ this.binding = binding;
+ this.offset = offset;
+ this.format = format;
+ this.matrixOrder = matrixOrder;
+ };
+
+ gluVarType.Layout.prototype.toString = function() {
+ var strings = [];
+ var str = '';
+ if (typeof this.location !== 'undefined')
+ strings.push('location=' + this.location);
+ if (typeof this.binding !== 'undefined')
+ strings.push('binding=' + this.binding);
+ if (typeof this.offset !== 'undefined')
+ strings.push('offset=' + this.offset);
+ if (typeof this.format !== 'undefined')
+ strings.push(gluVarType.getFormatLayoutName(this.format));
+ if (typeof this.matrixOrder !== 'undefined')
+ strings.push(gluVarType.getMatrixOrderName(this.matrixOrder));
+
+ if (strings.length > 0) {
+ str += 'layout(' + strings[0];
+
+ for (var i = 1; i < strings.length; i++)
+ str += ', ' + strings[i];
+ str += ')';
+ }
+
+ return str;
+ };
+
+ /**
+ * @constructor
+ * @param {gluVarType.VarType} varType
+ * @param {string} name
+ * @param {gluVarType.Storage=} storage
+ * @param {gluVarType.Interpolation=} interpolation
+ * @param {gluVarType.Layout=} layout
+ * @param {number=} memoryAccessQualifierBits
+ */
+ gluVarType.VariableDeclaration = function(varType, name, storage, interpolation, layout, memoryAccessQualifierBits) {
+ this.varType = varType;
+ this.name = name;
+ this.storage = storage;
+ this.interpolation = interpolation;
+ this.layout = layout;
+ this.memoryAccessQualifierBits = memoryAccessQualifierBits || 0;
+ };
+
+ gluVarType.VariableDeclaration.prototype.toString = function() {
+ var str = '';
+ if (typeof this.layout !== 'undefined')
+ str += this.layout.toString() + ' ';
+
+ for (var bitNdx = 0; (1 << bitNdx) & gluVarType.MemoryAccessQualifier.MEMORYACCESSQUALIFIER_MASK; ++bitNdx)
+ if (this.memoryAccessQualifierBits & (1 << bitNdx))
+ str += gluVarType.getMemoryAccessQualifierName((1 << bitNdx)) + ' ';
+
+ if (typeof this.interpolation !== 'undefined')
+ str += gluVarType.getInterpolationName(this.interpolation) + ' ';
+
+ if (typeof this.storage !== 'undefined')
+ str += gluVarType.getStorageName(this.storage) + ' ';
+
+ str += gluVarType.declareVariable(this.varType, this.name);
+
+ return str;
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluVarTypeUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluVarTypeUtil.js
new file mode 100644
index 0000000000..30e198a606
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/gluVarTypeUtil.js
@@ -0,0 +1,693 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.opengl.gluVarTypeUtil');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluVarType');
+
+goog.scope(function() {
+
+ var gluVarTypeUtil = framework.opengl.gluVarTypeUtil;
+ var gluVarType = framework.opengl.gluVarType;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+
+ gluVarTypeUtil.isNum = function(c) { return /^[0-9]$/.test(c); };
+ gluVarTypeUtil.isAlpha = function(c) { return /^[a-zA-Z]$/.test(c); };
+ gluVarTypeUtil.isIdentifierChar = function(c) { return /^[a-zA-Z0-9_]$/.test(c); };
+ gluVarTypeUtil.array_op_equivalent = function(arr1, arr2) {
+ if (arr1.length != arr2.length) return false;
+ for (var i = 0; i < arr1.length; ++i) {
+ if (arr1[i].isnt(arr2[1])) return false;
+ }
+ return true;
+ };
+
+ /**
+ * gluVarTypeUtil.VarTokenizer class.
+ * @param {string} str
+ * @constructor
+ */
+ gluVarTypeUtil.VarTokenizer = function(str) {
+
+ /** @private */
+ this.m_str = str;
+ /** @private */
+ this.m_token = gluVarTypeUtil.VarTokenizer.s_Token.length;
+ /** @private */
+ this.m_tokenStart = 0;
+ /** @private */
+ this.m_tokenLen = 0;
+
+ this.advance();
+
+ };
+ gluVarTypeUtil.VarTokenizer.s_Token = {
+ IDENTIFIER: 0,
+ LEFT_BRACKET: 1,
+ RIGHT_BRACKET: 2,
+ PERIOD: 3,
+ NUMBER: 4,
+ END: 5
+ };
+ gluVarTypeUtil.VarTokenizer.s_Token.length = Object.keys(gluVarTypeUtil.VarTokenizer.s_Token).length;
+
+ gluVarTypeUtil.VarTokenizer.prototype.getToken = function() {
+ return this.m_token;
+ };
+ gluVarTypeUtil.VarTokenizer.prototype.getIdentifier = function() {
+ return this.m_str.substr(this.m_tokenStart, this.m_tokenLen);
+ };
+ gluVarTypeUtil.VarTokenizer.prototype.getNumber = function() {
+ return parseInt(this.getIdentifier(), 10);
+ };
+ gluVarTypeUtil.VarTokenizer.prototype.getCurrentTokenStartLocation = function() {
+ return this.m_tokenStart;
+ };
+ gluVarTypeUtil.VarTokenizer.prototype.getCurrentTokenEndLocation = function() {
+ return this.m_tokenStart + this.m_tokenLen;
+ };
+
+ gluVarTypeUtil.VarTokenizer.prototype.advance = function() {
+
+ if (this.m_token == gluVarTypeUtil.VarTokenizer.s_Token.END) {
+ throw new Error('No more tokens.');
+ }
+
+ this.m_tokenStart += this.m_tokenLen;
+ this.m_token = gluVarTypeUtil.VarTokenizer.s_Token.length;
+ this.m_tokenLen = 1;
+
+ if (this.m_tokenStart >= this.m_str.length) {
+ this.m_token = gluVarTypeUtil.VarTokenizer.s_Token.END;
+
+ } else if (this.m_str[this.m_tokenStart] == '[') {
+ this.m_token = gluVarTypeUtil.VarTokenizer.s_Token.LEFT_BRACKET;
+
+ } else if (this.m_str[this.m_tokenStart] == ']') {
+ this.m_token = gluVarTypeUtil.VarTokenizer.s_Token.RIGHT_BRACKET;
+
+ } else if (this.m_str[this.m_tokenStart] == '.') {
+ this.m_token = gluVarTypeUtil.VarTokenizer.s_Token.PERIOD;
+
+ } else if (gluVarTypeUtil.isNum(this.m_str[this.m_tokenStart])) {
+ this.m_token = gluVarTypeUtil.VarTokenizer.s_Token.NUMBER;
+ while (gluVarTypeUtil.isNum(this.m_str[this.m_tokenStart + this.m_tokenLen])) {
+ this.m_tokenLen += 1;
+ }
+
+ } else if (gluVarTypeUtil.isIdentifierChar(this.m_str[this.m_tokenStart])) {
+ this.m_token = gluVarTypeUtil.VarTokenizer.s_Token.IDENTIFIER;
+ while (gluVarTypeUtil.isIdentifierChar(this.m_str[this.m_tokenStart + this.m_tokenLen])) {
+ this.m_tokenLen += 1;
+ }
+
+ } else {
+ throw new Error('Unexpected character');
+ }
+
+ };
+
+ /**
+ * VarType subtype path utilities class.
+ * @param {gluVarTypeUtil.VarTypeComponent.s_Type} type
+ * @param {number} index
+ * @constructor
+ */
+ gluVarTypeUtil.VarTypeComponent = function(type, index) {
+ /** @type {gluVarTypeUtil.VarTypeComponent.s_Type} */ this.type = type;
+ this.index = index || 0;
+ };
+
+ gluVarTypeUtil.VarTypeComponent.prototype.is = function(other) {
+ return this.type == other.type && this.index == other.index;
+ };
+ gluVarTypeUtil.VarTypeComponent.prototype.isnt = function(other) {
+ return this.type != other.type || this.index != other.index;
+ };
+
+ /**
+ * @enum
+ */
+ gluVarTypeUtil.VarTypeComponent.s_Type = {
+ STRUCT_MEMBER: 0,
+ ARRAY_ELEMENT: 1,
+ MATRIX_COLUMN: 2,
+ VECTOR_COMPONENT: 3
+ };
+
+ /**
+ * Type path formatter.
+ * @param {gluVarType.VarType} type_
+ * @param {Array<gluVarTypeUtil.VarTypeComponent>} path_
+ * @constructor
+ */
+ gluVarTypeUtil.TypeAccessFormat = function(type_, path_) {
+ this.type = type_;
+ this.path = path_;
+ };
+
+ gluVarTypeUtil.TypeAccessFormat.prototype.toString = function() {
+ var curType = this.type;
+ var str = '';
+
+ for (var i = 0; i < this.path.length; i++) {
+ var iter = this.path[i];
+ switch (iter.type) {
+ case gluVarTypeUtil.VarTypeComponent.s_Type.ARRAY_ELEMENT:
+ curType = curType.getElementType(); // Update current type.
+ // Fall-through.
+
+ case gluVarTypeUtil.VarTypeComponent.s_Type.MATRIX_COLUMN:
+ case gluVarTypeUtil.VarTypeComponent.s_Type.VECTOR_COMPONENT:
+ str += '[' + iter.index + ']';
+ break;
+
+ case gluVarTypeUtil.VarTypeComponent.s_Type.STRUCT_MEMBER: {
+ var member = curType.getStruct().getMember(i);
+ str += '.' + member.getName();
+ curType = member.getType();
+ break;
+ }
+
+ default:
+ throw new Error('Unrecognized type:' + iter.type);
+ }
+ }
+
+ return str;
+ };
+
+ /** gluVarTypeUtil.SubTypeAccess
+ * @param {gluVarType.VarType} type
+ * @constructor
+ */
+ gluVarTypeUtil.SubTypeAccess = function(type) {
+
+ this.m_type = null; // VarType
+ this.m_path = []; // TypeComponentVector
+
+ };
+
+ /** @private */
+ gluVarTypeUtil.SubTypeAccess.prototype.helper = function(type, ndx) {
+ this.m_path.push(new gluVarTypeUtil.VarTypeComponent(type, ndx));
+ if (!this.isValid()) {
+ throw new Error;
+ }
+ return this;
+ };
+
+ gluVarTypeUtil.SubTypeAccess.prototype.member = function(ndx) {
+ return this.helper(gluVarTypeUtil.VarTypeComponent.s_Type.STRUCT_MEMBER, ndx);
+ };
+ gluVarTypeUtil.SubTypeAccess.prototype.element = function(ndx) {
+ return this.helper(gluVarTypeUtil.VarTypeComponent.s_Type.ARRAY_ELEMENT, ndx);
+ };
+ gluVarTypeUtil.SubTypeAccess.prototype.column = function(ndx) {
+ return this.helper(gluVarTypeUtil.VarTypeComponent.s_Type.MATRIX_COLUMN, ndx);
+ };
+ gluVarTypeUtil.SubTypeAccess.prototype.component = function(ndx) {
+ return this.helper(gluVarTypeUtil.VarTypeComponent.s_Type.VECTOR_COMPONENT, ndx);
+ };
+ gluVarTypeUtil.SubTypeAccess.prototype.parent = function() {
+ if (!this.m_path.length) {
+ throw new Error;
+ }
+ this.m_path.pop();
+ return this;
+ };
+
+ gluVarTypeUtil.SubTypeAccess.prototype.isValid = function() {
+ return gluVarTypeUtil.isValidTypePath(this.m_type, this.m_path);
+ };
+ gluVarTypeUtil.SubTypeAccess.prototype.getType = function() {
+ return gluVarTypeUtil.getVarType(this.m_type, this.m_path);
+ };
+ gluVarTypeUtil.SubTypeAccess.prototype.getPath = function() {
+ return this.m_path;
+ };
+ gluVarTypeUtil.SubTypeAccess.prototype.empty = function() {
+ return !this.m_path.length;
+ };
+ gluVarTypeUtil.SubTypeAccess.prototype.is = function(other) {
+ return (
+ gluVarTypeUtil.array_op_equivalent(this.m_path, other.m_path) &&
+ this.m_type.is(other.m_type)
+ );
+ };
+ gluVarTypeUtil.SubTypeAccess.prototype.isnt = function(other) {
+ return (
+ !gluVarTypeUtil.array_op_equivalent(this.m_path, other.m_path) ||
+ this.m_type.isnt(other.m_type)
+ );
+ };
+
+ /**
+ * Subtype iterator parent class.
+ * basic usage for all child classes:
+ * for (var i = new gluVarTypeUtil.BasicTypeIterator(type) ; !i.end() ; i.next()) {
+ * var j = i.getType();
+ * }
+ * @constructor
+ */
+ gluVarTypeUtil.SubTypeIterator = function(type) {
+
+ /** @private */
+ this.m_type = null; // const VarType*
+ /** @private */
+ this.m_path = []; // TypeComponentVector
+
+ if (type) {
+ this.m_type = type;
+ this.findNext();
+ }
+
+ };
+
+ gluVarTypeUtil.SubTypeIterator.prototype.isExpanded = function(type) {
+ throw new Error('This function must be overriden in child class');
+ };
+
+ /** removeTraversed
+ * @private
+ */
+ gluVarTypeUtil.SubTypeIterator.prototype.removeTraversed = function() {
+
+ while (this.m_path.length) {
+ var curComp = this.m_path[this.m_path.length - 1]; // gluVarTypeUtil.VarTypeComponent&
+ var parentType = gluVarTypeUtil.getVarType(this.m_type, this.m_path, 0, this.m_path.length - 1); // VarType
+
+ if (curComp.type == gluVarTypeUtil.VarTypeComponent.s_Type.MATRIX_COLUMN) {
+ if (!gluShaderUtil.isDataTypeMatrix(parentType.getBasicType())) {
+ throw new Error('Isn\'t a matrix.');
+ }
+ if (curComp.index + 1 < gluShaderUtil.getDataTypeMatrixNumColumns(parentType.getBasicType())) {
+ break;
+ }
+
+ } else if (curComp.type == gluVarTypeUtil.VarTypeComponent.s_Type.VECTOR_COMPONENT) {
+ if (!gluShaderUtil.isDataTypeVector(parentType.getBasicType())) {
+ throw new Error('Isn\'t a vector.');
+ }
+ if (curComp.index + 1 < gluShaderUtil.getDataTypeScalarSize(parentType.getBasicType())) {
+ break;
+ }
+
+ } else if (curComp.type == gluVarTypeUtil.VarTypeComponent.s_Type.ARRAY_ELEMENT) {
+ if (!parentType.isArrayType()) {
+ throw new Error('Isn\'t an array.');
+ }
+ if (curComp.index + 1 < parentType.getArraySize()) {
+ break;
+ }
+
+ } else if (curComp.type == gluVarTypeUtil.VarTypeComponent.s_Type.STRUCT_MEMBER) {
+ if (!parentType.isStructType()) {
+ throw new Error('Isn\'t a struct.');
+ }
+ if (curComp.index + 1 < parentType.getStruct().getNumMembers()) {
+ break;
+ }
+
+ }
+
+ this.m_path.pop();
+ }
+ };
+ gluVarTypeUtil.SubTypeIterator.prototype.findNext = function() {
+
+ if (this.m_path.length > 0) {
+ // Increment child counter in current level.
+ var curComp = this.m_path[this.m_path.length - 1]; // gluVarTypeUtil.VarTypeComponent&
+ curComp.index += 1;
+ }
+
+ for (;;) {
+
+ var curType = gluVarTypeUtil.getVarType(this.m_type, this.m_path); // VarType
+
+ if (this.isExpanded(curType))
+ break;
+
+ // Recurse into child type.
+ if (curType.isBasicType()) {
+ var basicType = curType.getBasicType(); // DataType
+
+ if (gluShaderUtil.isDataTypeMatrix(basicType)) {
+ this.m_path.push(new gluVarTypeUtil.VarTypeComponent(gluVarTypeUtil.VarTypeComponent.s_Type.MATRIX_COLUMN, 0));
+
+ } else if (gluShaderUtil.isDataTypeVector(basicType)) {
+ this.m_path.push(new gluVarTypeUtil.VarTypeComponent(gluVarTypeUtil.VarTypeComponent.s_Type.VECTOR_COMPONENT, 0));
+
+ } else {
+ throw new Error('Cant expand scalars - isExpanded() is buggy.');
+ }
+
+ } else if (curType.isArrayType()) {
+ this.m_path.push(new gluVarTypeUtil.VarTypeComponent(gluVarTypeUtil.VarTypeComponent.s_Type.ARRAY_ELEMENT, 0));
+
+ } else if (curType.isStructType()) {
+ this.m_path.push(new gluVarTypeUtil.VarTypeComponent(gluVarTypeUtil.VarTypeComponent.s_Type.STRUCT_MEMBER, 0));
+
+ } else {
+ throw new Error();
+ }
+ }
+
+ };
+ gluVarTypeUtil.SubTypeIterator.prototype.end = function() {
+ return (this.m_type == null);
+ };
+ /** next
+ * equivelant to operator++(), doesnt return.
+ */
+ gluVarTypeUtil.SubTypeIterator.prototype.next = function() {
+ if (this.m_path.length > 0) {
+ // Remove traversed nodes.
+ this.removeTraversed();
+
+ if (this.m_path.length > 0)
+ this.findNext();
+ else
+ this.m_type = null; // Unset type to signal end.
+ } else {
+ if (!this.isExpanded(gluVarTypeUtil.getVarType(this.m_type, this.m_path))) {
+ throw new Error('First type was already expanded.');
+ }
+ this.m_type = null;
+ }
+ };
+ gluVarTypeUtil.SubTypeIterator.prototype.getType = function() {
+ return gluVarTypeUtil.getVarType(this.m_type, this.m_path);
+ };
+ gluVarTypeUtil.SubTypeIterator.prototype.getPath = function() {
+ return this.m_path;
+ };
+
+ gluVarTypeUtil.SubTypeIterator.prototype.toString = function() {
+ var x = new gluVarTypeUtil.TypeAccessFormat(this.m_type, this.m_path);
+ return x.toString();
+ };
+
+ /** gluVarTypeUtil.BasicTypeIterator
+ * @param {gluVarType.VarType} type
+ * @constructor
+ * @extends {gluVarTypeUtil.SubTypeIterator}
+ */
+ gluVarTypeUtil.BasicTypeIterator = function(type) {
+ gluVarTypeUtil.SubTypeIterator.call(this, type);
+ };
+ gluVarTypeUtil.BasicTypeIterator.prototype = Object.create(gluVarTypeUtil.SubTypeIterator.prototype);
+ gluVarTypeUtil.BasicTypeIterator.prototype.constructor = gluVarTypeUtil.BasicTypeIterator;
+
+ gluVarTypeUtil.BasicTypeIterator.prototype.isExpanded = function(type) {
+ return type.isBasicType();
+ };
+
+ /** gluVarTypeUtil.VectorTypeIterator
+ * @param {gluVarType.VarType} type
+ * @constructor
+ * @extends {gluVarTypeUtil.SubTypeIterator}
+ */
+ gluVarTypeUtil.VectorTypeIterator = function(type) {
+ gluVarTypeUtil.SubTypeIterator.call(this, type);
+ };
+ gluVarTypeUtil.VectorTypeIterator.prototype = Object.create(gluVarTypeUtil.SubTypeIterator.prototype);
+ gluVarTypeUtil.VectorTypeIterator.prototype.constructor = gluVarTypeUtil.VectorTypeIterator;
+
+ gluVarTypeUtil.VectorTypeIterator.prototype.isExpanded = function(type) {
+ return type.isBasicType() && gluShaderUtil.isDataTypeScalarOrVector(type.getBasicType());
+ };
+
+ /** gluVarTypeUtil.ScalarTypeIterator
+ * @param {gluVarType.VarType} type
+ * @constructor
+ * @extends {gluVarTypeUtil.SubTypeIterator}
+ */
+ gluVarTypeUtil.ScalarTypeIterator = function(type) {
+ gluVarTypeUtil.SubTypeIterator.call(this, type);
+ };
+ gluVarTypeUtil.ScalarTypeIterator.prototype = Object.create(gluVarTypeUtil.SubTypeIterator.prototype);
+ gluVarTypeUtil.ScalarTypeIterator.prototype.constructor = gluVarTypeUtil.ScalarTypeIterator;
+
+ gluVarTypeUtil.ScalarTypeIterator.prototype.isExpanded = function(type) {
+ return type.isBasicType() && gluShaderUtil.isDataTypeScalar(type.getBasicType());
+ };
+
+ gluVarTypeUtil.inBounds = (function(x, a, b) { return a <= x && x < b; });
+
+ /** gluVarTypeUtil.isValidTypePath
+ * @param {gluVarType.VarType} type
+ * @param {Array<gluVarTypeUtil.VarTypeComponent>} array
+ * @param {number=} begin
+ * @param {number=} end
+ * @return {boolean}
+ */
+ gluVarTypeUtil.isValidTypePath = function(type, array, begin, end) {
+
+ if (typeof(begin) == 'undefined') {begin = 0;}
+ if (typeof(end) == 'undefined') {begin = array.length;}
+
+ var curType = type; // const VarType*
+ var pathIter = begin; // Iterator
+
+ // Process struct member and array element parts of path.
+ while (pathIter != end) {
+ var element = array[pathIter];
+
+ if (element.type == gluVarTypeUtil.VarTypeComponent.s_Type.STRUCT_MEMBER) {
+
+ if (!curType.isStructType() || !gluVarTypeUtil.inBounds(element.index, 0, curType.getStruct().getNumMembers())) {
+ return false;
+ }
+
+ curType = curType.getStruct().getMember(element.index).getType();
+
+ } else if (element.type == gluVarTypeUtil.VarTypeComponent.s_Type.ARRAY_ELEMENT) {
+ if (
+ !curType.isArrayType() ||
+ (
+ curType.getArraySize() != gluVarType.VarType.UNSIZED_ARRAY &&
+ !gluVarTypeUtil.inBounds(element.index, 0, curType.getArraySize())
+ )
+ ) {
+ return false;
+ }
+
+ curType = curType.getElementType();
+ } else {
+ break;
+ }
+
+ ++pathIter;
+ }
+
+ if (pathIter != end) {
+ if (!(
+ array[pathIter].type == gluVarTypeUtil.VarTypeComponent.s_Type.MATRIX_COLUMN ||
+ array[pathIter].type == gluVarTypeUtil.VarTypeComponent.s_Type.VECTOR_COMPONENT
+ )) {
+ throw new Error('Not a matrix or a vector');
+ }
+
+ // Current type should be basic type.
+ if (!curType.isBasicType()) {
+ return false;
+ }
+
+ var basicType = curType.getBasicType(); // DataType
+
+ if (array[pathIter].type == gluVarTypeUtil.VarTypeComponent.s_Type.MATRIX_COLUMN) {
+ if (!gluShaderUtil.isDataTypeMatrix(basicType)) {
+ return false;
+ }
+
+ basicType = gluShaderUtil.getDataTypeFloatVec(gluShaderUtil.getDataTypeMatrixNumRows(basicType));
+ ++pathIter;
+ }
+
+ if (pathIter != end && array[pathIter].type == gluVarTypeUtil.VarTypeComponent.s_Type.VECTOR_COMPONENT) {
+ if (!gluShaderUtil.isDataTypeVector(basicType))
+ return false;
+
+ basicType = gluShaderUtil.getDataTypeScalarType(basicType);
+ ++pathIter;
+ }
+ }
+
+ return pathIter == end;
+ };
+
+ /** gluVarTypeUtil.getVarType
+ * @param {gluVarType.VarType} type
+ * @param {Array<gluVarTypeUtil.VarTypeComponent>} array
+ * @param {number=} start
+ * @param {number=} end
+ * @return {gluVarType.VarType}
+ */
+ gluVarTypeUtil.getVarType = function(type, array, start, end) {
+
+ if (typeof(start) == 'undefined') start = 0;
+ if (typeof(end) == 'undefined') end = array.length;
+
+ if (!gluVarTypeUtil.isValidTypePath(type, array, start, end)) {
+ throw new Error('Type is invalid');
+ }
+
+ var curType = type; // const VarType*
+ var element = null; // Iterator
+ var pathIter = 0;
+
+ // Process struct member and array element parts of path.
+ for (pathIter = start; pathIter != end; ++pathIter) {
+ element = array[pathIter];
+
+ if (element.type == gluVarTypeUtil.VarTypeComponent.s_Type.STRUCT_MEMBER) {
+ curType = curType.getStruct().getMember(element.index).getType();
+
+ } else if (element.type == gluVarTypeUtil.VarTypeComponent.s_Type.ARRAY_ELEMENT) {
+ curType = curType.getElementType();
+
+ } else {
+ break;
+
+ }
+ }
+
+ if (pathIter != end) {
+
+ var basicType = curType.getBasicType(); // DataType
+ var precision = curType.getPrecision(); // Precision
+
+ if (element.type == gluVarTypeUtil.VarTypeComponent.s_Type.MATRIX_COLUMN) {
+ basicType = gluShaderUtil.getDataTypeFloatVec(gluShaderUtil.getDataTypeMatrixNumRows(basicType));
+ element = array[++pathIter];
+ }
+
+ if (pathIter != end && element.type == gluVarTypeUtil.VarTypeComponent.s_Type.VECTOR_COMPONENT) {
+ basicType = gluShaderUtil.getDataTypeScalarTypeAsDataType(basicType);
+ element = array[++pathIter];
+ }
+
+ if (pathIter != end) {
+ throw new Error();
+ }
+ return gluVarType.newTypeBasic(basicType, precision);
+ } else {
+ /* TODO: Original code created an object copy. We are returning reference to the same object */
+ return curType;
+ }
+ };
+
+ gluVarTypeUtil.parseVariableName = function(nameWithPath) {
+ var tokenizer = new gluVarTypeUtil.VarTokenizer(nameWithPath);
+ if (tokenizer.getToken() != gluVarTypeUtil.VarTokenizer.s_Token.IDENTIFIER) {
+ throw new Error('Not an identifier.');
+ }
+ return tokenizer.getIdentifier();
+ };
+
+ // returns an array (TypeComponentVector& path)
+ // params: const char*, const VarType&
+ gluVarTypeUtil.parseTypePath = function(nameWithPath, type) {
+
+ var tokenizer = new gluVarTypeUtil.VarTokenizer(nameWithPath);
+
+ if (tokenizer.getToken() == gluVarTypeUtil.VarTokenizer.s_Token.IDENTIFIER) {
+ tokenizer.advance();
+ }
+
+ var path = [];
+
+ while (tokenizer.getToken() != gluVarTypeUtil.VarTokenizer.s_Token.END) {
+
+ var curType = gluVarTypeUtil.getVarType(type, path);
+
+ if (tokenizer.getToken() == gluVarTypeUtil.VarTokenizer.s_Token.PERIOD) {
+
+ tokenizer.advance();
+ if (tokenizer.getToken() != gluVarTypeUtil.VarTokenizer.s_Token.IDENTIFIER) {
+ throw new Error();
+ }
+ if (!curType.isStructType()) {
+ throw new Error('Invalid field selector');
+ }
+
+ // Find member.
+ var memberName = tokenizer.getIdentifier();
+ var ndx = 0;
+ for (; ndx < curType.getStruct().getSize(); ++ndx) {
+
+ if (memberName == curType.getStruct().getMember(ndx).getName()) {
+ break;
+ }
+
+ }
+ if (ndx >= curType.getStruct().getSize()) {
+ throw new Error('Member not found in type: ' + memberName);
+ }
+
+ path.push(new gluVarTypeUtil.VarTypeComponent(gluVarTypeUtil.VarTypeComponent.s_Type.STRUCT_MEMBER, ndx));
+ tokenizer.advance();
+
+ } else if (tokenizer.getToken() == gluVarTypeUtil.VarTokenizer.s_Token.LEFT_BRACKET) {
+
+ tokenizer.advance();
+ if (tokenizer.getToken() != gluVarTypeUtil.VarTokenizer.s_Token.NUMBER) {
+ throw new Error();
+ }
+
+ var ndx = tokenizer.getNumber();
+
+ if (curType.isArrayType()) {
+ if (!gluVarTypeUtil.inBounds(ndx, 0, curType.getArraySize())) throw new Error;
+ path.push(new gluVarTypeUtil.VarTypeComponent(gluVarTypeUtil.VarTypeComponent.s_Type.ARRAY_ELEMENT, ndx));
+
+ } else if (curType.isBasicType() && gluShaderUtil.isDataTypeMatrix(curType.getBasicType())) {
+ if (!gluVarTypeUtil.inBounds(ndx, 0, gluShaderUtil.getDataTypeMatrixNumColumns(curType.getBasicType()))) throw new Error;
+ path.push(new gluVarTypeUtil.VarTypeComponent(gluVarTypeUtil.VarTypeComponent.s_Type.MATRIX_COLUMN, ndx));
+
+ } else if (curType.isBasicType() && gluShaderUtil.isDataTypeVector(curType.getBasicType())) {
+ if (!gluVarTypeUtil.inBounds(ndx, 0, gluShaderUtil.getDataTypeScalarSize(curType.getBasicType()))) throw new Error;
+ path.push(new gluVarTypeUtil.VarTypeComponent(gluVarTypeUtil.VarTypeComponent.s_Type.VECTOR_COMPONENT, ndx));
+
+ } else {
+ //TCU_FAIL
+ throw new Error('Invalid subscript');
+ }
+
+ tokenizer.advance();
+ if (tokenizer.getToken() != gluVarTypeUtil.VarTokenizer.s_Token.RIGHT_BRACKET) {
+ throw new Error('Expected token RIGHT_BRACKET');
+ }
+ tokenizer.advance();
+
+ } else {
+ // TCU_FAIL
+ throw new Error('Unexpected token');
+ }
+ }
+
+ return path;
+
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/00_test_list.txt
new file mode 100644
index 0000000000..7db3d9d5c7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/00_test_list.txt
@@ -0,0 +1 @@
+referencecontext.html \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/referencecontext.html b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/referencecontext.html
new file mode 100644
index 0000000000..f3ba0ed262
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/referencecontext.html
@@ -0,0 +1,32 @@
+<html>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Reference context test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('framework.opengl.simplereference.sglrReferenceContextTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+ try {
+ framework.opengl.simplereference.sglrReferenceContextTest.run(gl);
+ }
+ catch(err)
+ {
+ bufferedLogToConsole(err);
+ }
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrGLContext.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrGLContext.js
new file mode 100644
index 0000000000..13f75e8f5e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrGLContext.js
@@ -0,0 +1,231 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.opengl.simplereference.sglrGLContext');
+goog.require('framework.common.tcuPixelFormat');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deUtil');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluTextureUtil');
+goog.require('framework.opengl.simplereference.sglrShaderProgram');
+goog.require('framework.referencerenderer.rrDefs');
+goog.require('framework.referencerenderer.rrMultisamplePixelBufferAccess');
+goog.require('framework.referencerenderer.rrRenderState');
+goog.require('framework.referencerenderer.rrRenderer');
+goog.require('framework.referencerenderer.rrVertexAttrib');
+
+goog.scope(function() {
+
+ var sglrGLContext = framework.opengl.simplereference.sglrGLContext;
+ var tcuTexture = framework.common.tcuTexture;
+ var deUtil = framework.delibs.debase.deUtil;
+ var deMath = framework.delibs.debase.deMath;
+ var tcuTextureUtil = framework.common.tcuTextureUtil;
+ var tcuPixelFormat = framework.common.tcuPixelFormat;
+ var gluShaderProgram = framework.opengl.gluShaderProgram;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var gluTextureUtil = framework.opengl.gluTextureUtil;
+ var sglrShaderProgram = framework.opengl.simplereference.sglrShaderProgram;
+ var rrDefs = framework.referencerenderer.rrDefs;
+ var rrMultisamplePixelBufferAccess = framework.referencerenderer.rrMultisamplePixelBufferAccess;
+ var rrRenderer = framework.referencerenderer.rrRenderer;
+ var rrRenderState = framework.referencerenderer.rrRenderState;
+ var rrVertexAttrib = framework.referencerenderer.rrVertexAttrib;
+
+ var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+ };
+
+ /**
+ * sglrGLContext.GLContext wraps the standard WebGL context to be able to be used interchangeably with the ReferenceContext
+ * @constructor
+ * @extends {WebGL2RenderingContext}
+ * @param {?WebGL2RenderingContext} context
+ * @param {Array<number>=} viewport
+ */
+ sglrGLContext.GLContext = function(context, viewport) {
+ DE_ASSERT(context);
+
+ var functionwrapper = function(context, fname) {
+ return function() {
+ return context[fname].apply(context, arguments);
+ };
+ };
+
+ var wrap = {};
+ for (var i in context) {
+ try {
+ if (typeof context[i] == 'function') {
+ wrap[i] = functionwrapper(context, i);
+ } else {
+ wrap[i] = context[i];
+ }
+ } catch (e) {
+ throw new Error('GLContext: Error accessing ' + i);
+ }
+ }
+ if (viewport)
+ context.viewport(viewport[0], viewport[1], viewport[2], viewport[3]);
+
+ /**
+ * createProgram
+ * @override
+ * @param {sglrShaderProgram.ShaderProgram=} shader
+ * @return {!WebGLProgram}
+ */
+ this.createProgram = function(shader) {
+ var program = new gluShaderProgram.ShaderProgram(
+ context,
+ gluShaderProgram.makeVtxFragSources(
+ shader.m_vertSrc,
+ shader.m_fragSrc
+ )
+ );
+
+ if (!program.isOk()) {
+ bufferedLogToConsole(program.toString());
+ testFailedOptions('Compile failed', true);
+ }
+ return program.getProgram();
+ };
+ wrap['createProgram'] = this.createProgram;
+
+ /**
+ * Draws quads from vertex arrays
+ * @param {number} primitive Primitive type
+ * @param {number} first First vertex to begin drawing with
+ * @param {number} count Number of vertices
+ */
+ var drawQuads = function(primitive, first, count) {
+ context.drawArrays(primitive, first, count);
+ };
+ wrap['drawQuads'] = drawQuads;
+
+ /**
+ * @return {number}
+ */
+ var getWidth = function() {
+ if(viewport)
+ return viewport[2];
+ else
+ return context.drawingBufferWidth;
+ };
+ wrap['getWidth'] = getWidth;
+
+ /**
+ * @return {number}
+ */
+ var getHeight = function() {
+ if(viewport)
+ return viewport[3];
+ else
+ return context.drawingBufferHeight;
+ };
+ wrap['getHeight'] = getHeight;
+
+ /**
+ * @param {number} x
+ * @param {number} y
+ * @param {number} width
+ * @param {number} height
+ * @param {number} format
+ * @param {number} dataType
+ * @param {ArrayBuffer|ArrayBufferView} data
+ */
+ var readPixels = function(x, y, width, height, format, dataType, data) {
+ /** @type {?ArrayBufferView} */ var dataArr;
+ if (!ArrayBuffer.isView(data)) {
+ var type = gluTextureUtil.mapGLChannelType(dataType, true);
+ var dataArrType = tcuTexture.getTypedArray(type);
+ dataArr = new dataArrType(data);
+ } else {
+ dataArr = /** @type {?ArrayBufferView} */ (data);
+ }
+
+ context.readPixels(x, y, width, height, format, dataType, dataArr);
+ };
+ wrap['readPixels'] = readPixels;
+
+ /**
+ * @param {number} target
+ * @param {number} level
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ */
+ var texImage2DDelegate = function(target, level, internalFormat, width, height) {
+ var format;
+ var dataType;
+
+ switch(internalFormat)
+ {
+ case gl.ALPHA:
+ case gl.LUMINANCE:
+ case gl.LUMINANCE_ALPHA:
+ case gl.RGB:
+ case gl.RGBA:
+ format = internalFormat;
+ dataType = gl.UNSIGNED_BYTE;
+ break;
+ default:
+ {
+ var transferFmt = gluTextureUtil.getTransferFormat(gluTextureUtil.mapGLInternalFormat(internalFormat));
+ format = transferFmt.format;
+ dataType = transferFmt.dataType;
+ break;
+ }
+ }
+ context.texImage2D(target, level, internalFormat, width, height, 0, format, dataType, null);
+ };
+ wrap['texImage2DDelegate'] = texImage2DDelegate;
+
+ return wrap;
+ };
+
+ /**
+ * createProgram - This had to be added here as dummy to remove a warning when the only context used is GLContext (no reference context)
+ * @override
+ * @param {sglrShaderProgram.ShaderProgram=} shader
+ * @return {!WebGLProgram}
+ */
+ sglrGLContext.GLContext.prototype.createProgram = function(shader) {return this.createProgram();};
+
+ /**
+ * @param ctx GL-like context
+ * @param {string} name
+ * @return {boolean}
+ */
+ sglrGLContext.isExtensionSupported = function(ctx, name) {
+ var extns = ctx.getSupportedExtensions();
+ var found = false;
+ if (extns) {
+ var index = extns.indexOf(name);
+ if (index != -1)
+ found = true;
+ }
+ return found;
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrReferenceContext.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrReferenceContext.js
new file mode 100644
index 0000000000..523dbe607f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrReferenceContext.js
@@ -0,0 +1,4986 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.opengl.simplereference.sglrReferenceContext');
+goog.require('framework.common.tcuMatrix');
+goog.require('framework.common.tcuMatrixUtil');
+goog.require('framework.common.tcuPixelFormat');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluTextureUtil');
+goog.require('framework.opengl.simplereference.sglrReferenceUtils');
+goog.require('framework.opengl.simplereference.sglrShaderProgram');
+goog.require('framework.referencerenderer.rrDefs');
+goog.require('framework.referencerenderer.rrGenericVector');
+goog.require('framework.referencerenderer.rrMultisamplePixelBufferAccess');
+goog.require('framework.referencerenderer.rrRenderState');
+goog.require('framework.referencerenderer.rrRenderer');
+goog.require('framework.referencerenderer.rrVertexAttrib');
+
+goog.scope(function() {
+
+ var sglrReferenceContext = framework.opengl.simplereference.sglrReferenceContext;
+ var rrMultisamplePixelBufferAccess = framework.referencerenderer.rrMultisamplePixelBufferAccess;
+ var tcuTexture = framework.common.tcuTexture;
+ var deMath = framework.delibs.debase.deMath;
+ var gluTextureUtil = framework.opengl.gluTextureUtil;
+ var tcuTextureUtil = framework.common.tcuTextureUtil;
+ var tcuPixelFormat = framework.common.tcuPixelFormat;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var rrRenderer = framework.referencerenderer.rrRenderer;
+ var rrDefs = framework.referencerenderer.rrDefs;
+ var rrGenericVector = framework.referencerenderer.rrGenericVector;
+ var rrVertexAttrib = framework.referencerenderer.rrVertexAttrib;
+ var rrRenderState = framework.referencerenderer.rrRenderState;
+ var sglrReferenceUtils = framework.opengl.simplereference.sglrReferenceUtils;
+ var sglrShaderProgram = framework.opengl.simplereference.sglrShaderProgram;
+ var tcuMatrix = framework.common.tcuMatrix;
+ var tcuMatrixUtil = framework.common.tcuMatrixUtil;
+
+ sglrReferenceContext.rrMPBA = rrMultisamplePixelBufferAccess;
+
+ //TODO: Implement automatic error checking in sglrReferenceContext, optional on creation.
+
+ /** @typedef {WebGLRenderbuffer|WebGLTexture|sglrReferenceContext.Renderbuffer|sglrReferenceContext.TextureContainer} */ sglrReferenceContext.AnyRenderbuffer;
+
+ /** @typedef {WebGLFramebuffer|sglrReferenceContext.Framebuffer} */ sglrReferenceContext.AnyFramebuffer;
+
+ /**
+ * @param {number} error
+ * @param {number} message
+ * @throws {Error}
+ */
+ sglrReferenceContext.GLU_EXPECT_NO_ERROR = function(error, message) {
+ if (error !== gl.NONE) {
+ bufferedLogToConsole('Assertion failed message:' + message);
+ }
+ };
+
+ var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+ };
+
+ // /* TODO: remove */
+ // /** @type {WebGL2RenderingContext} */ var gl;
+
+ sglrReferenceContext.MAX_TEXTURE_SIZE_LOG2 = 14;
+ sglrReferenceContext.MAX_TEXTURE_SIZE = 1 << sglrReferenceContext.MAX_TEXTURE_SIZE_LOG2;
+
+ /**
+ * @param {number} width
+ * @param {number} height
+ * @return {number}
+ */
+ sglrReferenceContext.getNumMipLevels2D = function(width, height) {
+ return Math.floor(Math.log2(Math.max(width, height)) + 1);
+ };
+
+ /**
+ * @param {number} width
+ * @param {number} height
+ * @param {number} depth
+ * @return {number}
+ */
+ sglrReferenceContext.getNumMipLevels3D = function(width, height, depth) {
+ return Math.floor(Math.log2(Math.max(width, height, depth)) + 1);
+ };
+
+ /**
+ * @param {number} baseLevelSize
+ * @param {number} levelNdx
+ * @return {number}
+ */
+ sglrReferenceContext.getMipLevelSize = function(baseLevelSize, levelNdx) {
+ return Math.max(baseLevelSize >> levelNdx, 1);
+ };
+
+ sglrReferenceContext.mapGLCubeFace = function(face) {
+ switch (face) {
+ case gl.TEXTURE_CUBE_MAP_NEGATIVE_X: return tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X;
+ case gl.TEXTURE_CUBE_MAP_POSITIVE_X: return tcuTexture.CubeFace.CUBEFACE_POSITIVE_X;
+ case gl.TEXTURE_CUBE_MAP_NEGATIVE_Y: return tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y;
+ case gl.TEXTURE_CUBE_MAP_POSITIVE_Y: return tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y;
+ case gl.TEXTURE_CUBE_MAP_NEGATIVE_Z: return tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z;
+ case gl.TEXTURE_CUBE_MAP_POSITIVE_Z: return tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z;
+ default: throw new Error('Invalid cube face: ' + face);
+ }
+ };
+
+ /**
+ * @param {tcuTexture.FilterMode} mode
+ * @return {boolean}
+ */
+ sglrReferenceContext.isMipmapFilter = function(/*const tcu::Sampler::FilterMode*/ mode) {
+ return mode != tcuTexture.FilterMode.NEAREST && mode != tcuTexture.FilterMode.LINEAR;
+ };
+
+ sglrReferenceContext.getNumMipLevels1D = function(size) {
+ return Math.floor(Math.log2(size)) + 1;
+ };
+
+ /**
+ * @param {?sglrReferenceContext.TextureType} type
+ * @return {sglrReferenceContext.TexTarget}
+ */
+ sglrReferenceContext.texLayeredTypeToTarget = function(type) {
+ switch (type) {
+ case sglrReferenceContext.TextureType.TYPE_2D_ARRAY: return sglrReferenceContext.TexTarget.TEXTARGET_2D_ARRAY;
+ case sglrReferenceContext.TextureType.TYPE_3D: return sglrReferenceContext.TexTarget.TEXTARGET_3D;
+ case sglrReferenceContext.TextureType.TYPE_CUBE_MAP_ARRAY: return sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_ARRAY;
+ default: throw new Error('Invalid texture type: ' + type);
+ }
+ };
+
+ /**
+ * @param {rrDefs.IndexType} indexType
+ * @return {number}
+ * @throws {Error}
+ */
+ sglrReferenceContext.getFixedRestartIndex = function(indexType) {
+ switch (indexType) {
+ case rrDefs.IndexType.INDEXTYPE_UINT8: return 0xFF;
+ case rrDefs.IndexType.INDEXTYPE_UINT16: return 0xFFFF;
+ case rrDefs.IndexType.INDEXTYPE_UINT32: return 0xFFFFFFFF;
+ default:
+ throw new Error('Unrecognized index type: ' + indexType);
+ }
+ };
+
+ /**
+ * @constructor
+ * @param {sglrShaderProgram.ShaderProgram} program
+ */
+ sglrReferenceContext.ShaderProgramObjectContainer = function(program) {
+ this.m_program = program;
+ /** @type {boolean} */ this.m_deleteFlag = false;
+ };
+
+ /**
+ * @param {WebGL2RenderingContext} gl
+ * @constructor
+ */
+ sglrReferenceContext.ReferenceContextLimits = function(gl) {
+ /** @type {number} */ this.maxTextureImageUnits = 16;
+ /** @type {number} */ this.maxTexture2DSize = 2048;
+ /** @type {number} */ this.maxTextureCubeSize = 2048;
+ /** @type {number} */ this.maxTexture2DArrayLayers = 256;
+ /** @type {number} */ this.maxTexture3DSize = 256;
+ /** @type {number} */ this.maxRenderbufferSize = 2048;
+ /** @type {number} */ this.maxVertexAttribs = 16;
+
+ if (gl) {
+ this.maxTextureImageUnits = /** @type {number} */ (gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS));
+ this.maxTexture2DSize = /** @type {number} */ (gl.getParameter(gl.MAX_TEXTURE_SIZE));
+ this.maxTextureCubeSize = /** @type {number} */ (gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE));
+ this.maxRenderbufferSize = /** @type {number} */ (gl.getParameter(gl.MAX_RENDERBUFFER_SIZE));
+ this.maxVertexAttribs = /** @type {number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS));
+ this.maxTexture2DArrayLayers = /** @type {number} */ (gl.getParameter(gl.MAX_ARRAY_TEXTURE_LAYERS));
+ this.maxTexture3DSize = /** @type {number} */ (gl.getParameter(gl.MAX_3D_TEXTURE_SIZE));
+
+ // Limit texture sizes to supported values
+ this.maxTexture2DSize = Math.min(this.maxTexture2DSize, sglrReferenceContext.MAX_TEXTURE_SIZE);
+ this.maxTextureCubeSize = Math.min(this.maxTextureCubeSize, sglrReferenceContext.MAX_TEXTURE_SIZE);
+ this.maxTexture3DSize = Math.min(this.maxTexture3DSize, sglrReferenceContext.MAX_TEXTURE_SIZE);
+
+ sglrReferenceContext.GLU_EXPECT_NO_ERROR(gl.getError(), gl.NO_ERROR);
+ }
+
+ /* TODO: Port
+ // \todo [pyry] Figure out following things:
+ // + supported fbo configurations
+ // ...
+
+ // \todo [2013-08-01 pyry] Do we want to make these conditional based on renderCtx?
+ addExtension("gl.EXT_color_buffer_half_float");
+ addExtension("gl.WEBGL_color_buffer_float");
+ */
+ };
+
+ /**
+ * @enum
+ */
+ sglrReferenceContext.TextureType = {
+ TYPE_2D: 0,
+ TYPE_CUBE_MAP: 1,
+ TYPE_2D_ARRAY: 2,
+ TYPE_3D: 3,
+ TYPE_CUBE_MAP_ARRAY: 4
+ };
+
+ /**
+ * @constructor
+ * @implements {rrDefs.Sampler}
+ * @param {sglrReferenceContext.TextureType} type
+ */
+ sglrReferenceContext.Texture = function(type) {
+ // NamedObject.call(this, name);
+ /** @type {sglrReferenceContext.TextureType} */ this.m_type = type;
+ /** @type {boolean} */ this.m_immutable = false;
+ /** @type {number} */ this.m_baseLevel = 0;
+ /** @type {number} */ this.m_maxLevel = 1000;
+ /** @type {tcuTexture.Sampler} */ this.m_sampler = new tcuTexture.Sampler(
+ tcuTexture.WrapMode.REPEAT_GL,
+ tcuTexture.WrapMode.REPEAT_GL,
+ tcuTexture.WrapMode.REPEAT_GL,
+ tcuTexture.FilterMode.NEAREST_MIPMAP_LINEAR,
+ tcuTexture.FilterMode.LINEAR,
+ 0,
+ true,
+ tcuTexture.CompareMode.COMPAREMODE_NONE,
+ 0,
+ [0, 0, 0, 0],
+ true);
+ };
+
+ /**
+ * @param {Array<number>} pos
+ * @param {number=} lod
+ * @throws {Error}
+ */
+ sglrReferenceContext.Texture.prototype.sample = function(pos, lod) {throw new Error('Intentionally empty. Call method from child class instead'); };
+
+ /**
+ * @param {Array<Array<number>>} packetTexcoords
+ * @param {number} lodBias
+ * @throws {Error}
+ */
+ sglrReferenceContext.Texture.prototype.sample4 = function(packetTexcoords, lodBias) {throw new Error('Intentionally empty. Call method from child class instead'); };
+
+ // sglrReferenceContext.Texture.prototype = Object.create(NamedObject.prototype);
+ // sglrReferenceContext.Texture.prototype.constructor = sglrReferenceContext.Texture;
+
+ /**
+ * @return {number}
+ */
+ sglrReferenceContext.Texture.prototype.getType = function() { return this.m_type; };
+
+ /**
+ * @return {number}
+ */
+ sglrReferenceContext.Texture.prototype.getBaseLevel = function() { return this.m_baseLevel; };
+
+ /**
+ * @return {number}
+ */
+ sglrReferenceContext.Texture.prototype.getMaxLevel = function() { return this.m_maxLevel; };
+
+ /**
+ * @return {boolean}
+ */
+ sglrReferenceContext.Texture.prototype.isImmutable = function() { return this.m_immutable; };
+
+ /**
+ * @param {number} baseLevel
+ */
+ sglrReferenceContext.Texture.prototype.setBaseLevel = function(baseLevel) { this.m_baseLevel = baseLevel; };
+
+ /**
+ * @param {number} maxLevel
+ */
+ sglrReferenceContext.Texture.prototype.setMaxLevel = function(maxLevel) { this.m_maxLevel = maxLevel; };
+
+ /**
+ */
+ sglrReferenceContext.Texture.prototype.setImmutable = function() { this.m_immutable = true; };
+
+ /**
+ * @return {tcuTexture.Sampler}
+ */
+ sglrReferenceContext.Texture.prototype.getSampler = function() { return this.m_sampler; };
+
+ /**
+ * @constructor
+ */
+ sglrReferenceContext.TextureLevelArray = function() {
+ /** @type {Array<ArrayBuffer>} */ this.m_data = [];
+ /** @type {Array<tcuTexture.PixelBufferAccess>} */ this.m_access = [];
+ };
+
+ /**
+ * @param {number} level
+ * @return {boolean}
+ */
+ sglrReferenceContext.TextureLevelArray.prototype.hasLevel = function(level) { return this.m_data[level] != null; };
+
+ /**
+ * @param {number} level
+ * @return {tcuTexture.PixelBufferAccess}
+ * @throws {Error}
+ */
+ sglrReferenceContext.TextureLevelArray.prototype.getLevel = function(level) {
+ if (!this.hasLevel(level))
+ throw new Error('Level: ' + level + ' is not defined.');
+
+ return this.m_access[level];
+ };
+
+ /**
+ * @return {Array<tcuTexture.PixelBufferAccess>}
+ */
+ sglrReferenceContext.TextureLevelArray.prototype.getLevels = function() { return this.m_access; };
+
+ /**
+ * @param {number} level
+ * @param {tcuTexture.TextureFormat} format
+ * @param {number} width
+ * @param {number} height
+ * @param {number} depth
+ */
+ sglrReferenceContext.TextureLevelArray.prototype.allocLevel = function(level, format, width, height, depth) {
+ /** @type {number} */ var dataSize = format.getPixelSize() * width * height * depth;
+ if (this.hasLevel(level))
+ this.clearLevel(level);
+
+ this.m_data[level] = new ArrayBuffer(dataSize);
+ this.m_access[level] = new tcuTexture.PixelBufferAccess({
+ format: format,
+ width: width,
+ height: height,
+ depth: depth,
+ data: this.m_data[level]});
+ };
+
+ /**
+ * @param {number} level
+ */
+ sglrReferenceContext.TextureLevelArray.prototype.clearLevel = function(level) {
+ delete this.m_data[level];
+ delete this.m_access[level];
+ };
+
+ /**
+ */
+ sglrReferenceContext.TextureLevelArray.prototype.clear = function() {
+ for (var key in this.m_data)
+ delete this.m_data[key];
+
+ for (var key in this.m_access)
+ delete this.m_access[key];
+ };
+
+ /**
+ * @constructor
+ * @extends {sglrReferenceContext.Texture}
+ */
+ sglrReferenceContext.Texture2D = function() {
+ sglrReferenceContext.Texture.call(this, sglrReferenceContext.TextureType.TYPE_2D);
+ /** @type {tcuTexture.Texture2DView} */ this.m_view = new tcuTexture.Texture2DView(0, null);
+ /** @type {sglrReferenceContext.TextureLevelArray} */ this.m_levels = new sglrReferenceContext.TextureLevelArray();
+ };
+
+ /**
+ */
+ sglrReferenceContext.Texture2D.prototype = Object.create(sglrReferenceContext.Texture.prototype);
+ sglrReferenceContext.Texture2D.prototype.constructor = sglrReferenceContext.Texture2D;
+
+ sglrReferenceContext.Texture2D.prototype.clearLevels = function() { this.m_levels.clear(); };
+
+ /**
+ * @param {number} level
+ * @return {boolean}
+ */
+ sglrReferenceContext.Texture2D.prototype.hasLevel = function(level) { return this.m_levels.hasLevel(level); };
+
+ /**
+ * @param {number} level
+ * @return {tcuTexture.PixelBufferAccess}
+ */
+ sglrReferenceContext.Texture2D.prototype.getLevel = function(level) { return this.m_levels.getLevel(level); };
+
+ /**
+ * @param {number} level
+ * @param {?tcuTexture.TextureFormat} format
+ * @param {number} width
+ * @param {number} height
+ */
+ sglrReferenceContext.Texture2D.prototype.allocLevel = function(level, format, width, height) { this.m_levels.allocLevel(level, format, width, height, 1); };
+
+ /**
+ * @return {boolean}
+ */
+ sglrReferenceContext.Texture2D.prototype.isComplete = function() {
+ /** @type {number} */ var baseLevel = this.getBaseLevel();
+
+ if (this.hasLevel(baseLevel)) {
+ /** @type {tcuTexture.PixelBufferAccess} */ var level0 = this.getLevel(baseLevel);
+ /** @type {boolean} */ var mipmap = sglrReferenceContext.isMipmapFilter(this.getSampler().minFilter);
+
+ if (mipmap) {
+ /** @type {tcuTexture.TextureFormat} */ var format = level0.getFormat();
+ /** @type {number} */ var w = level0.getWidth();
+ /** @type {number} */ var h = level0.getHeight();
+ /** @type {number} */ var numLevels = Math.min(this.getMaxLevel() - baseLevel + 1, sglrReferenceContext.getNumMipLevels2D(w, h));
+
+ for (var levelNdx = 1; levelNdx < numLevels; levelNdx++) {
+ if (this.hasLevel(baseLevel + levelNdx)) {
+ /** @type {tcuTexture.PixelBufferAccess} */ var level = this.getLevel(baseLevel + levelNdx);
+ /** @type {number} */ var expectedW = sglrReferenceContext.getMipLevelSize(w, levelNdx);
+ /** @type {number} */ var expectedH = sglrReferenceContext.getMipLevelSize(h, levelNdx);
+
+ if (level.getWidth() != expectedW ||
+ level.getHeight() != expectedH ||
+ !level.getFormat().isEqual(format))
+ return false;
+ } else
+ return false;
+ }
+ }
+
+ return true;
+ } else
+ return false;
+ };
+
+ /**
+ */
+ sglrReferenceContext.Texture2D.prototype.updateView = function() {
+ /** @type {number} */ var baseLevel = this.getBaseLevel();
+
+ if (this.hasLevel(baseLevel) && !this.getLevel(baseLevel).isEmpty()) {
+ // Update number of levels in mipmap pyramid.
+ /** @type {number} */ var width = this.getLevel(baseLevel).getWidth();
+ /** @type {number} */ var height = this.getLevel(baseLevel).getHeight();
+ /** @type {boolean} */ var isMipmap = sglrReferenceContext.isMipmapFilter(this.getSampler().minFilter);
+ /** @type {number} */ var numLevels = isMipmap ? Math.min(this.getMaxLevel() - baseLevel + 1, sglrReferenceContext.getNumMipLevels2D(width, height)) : 1;
+
+ this.m_view = new tcuTexture.Texture2DView(numLevels, this.m_levels.getLevels().slice(baseLevel));
+ } else
+ this.m_view = new tcuTexture.Texture2DView(0, null);
+ };
+
+ /**
+ * @param {Array<number>} pos
+ * @param {number=} lod
+ * @return {Array<number>}
+ */
+ sglrReferenceContext.Texture2D.prototype.sample = function(pos, lod) {
+ return this.m_view.sample(this.getSampler(), pos, lod);
+ };
+
+ /**
+ * @param {Array<Array<number>>} packetTexcoords 4 vec2 coordinates
+ * @param {number} lodBias_
+ * @return {Array<Array<number>>} 4 vec4 samples
+ */
+ sglrReferenceContext.Texture2D.prototype.sample4 = function(packetTexcoords, lodBias_) {
+ /** @type {number} */ var lodBias = lodBias_ || 0;
+ /** @type {number} */ var texWidth = this.m_view.getWidth();
+ /** @type {number} */ var texHeight = this.m_view.getHeight();
+ /** @type {Array<Array<number>>}*/ var output = [];
+
+ /** @type {Array<number>}*/ var dFdx0 = deMath.subtract(packetTexcoords[1], packetTexcoords[0]);
+ /** @type {Array<number>}*/ var dFdx1 = deMath.subtract(packetTexcoords[3], packetTexcoords[2]);
+ /** @type {Array<number>}*/ var dFdy0 = deMath.subtract(packetTexcoords[2], packetTexcoords[0]);
+ /** @type {Array<number>}*/ var dFdy1 = deMath.subtract(packetTexcoords[3], packetTexcoords[1]);
+
+ for (var fragNdx = 0; fragNdx < 4; ++fragNdx) {
+ /** @type {Array<number>}*/var dFdx = (fragNdx & 2) ? dFdx1 : dFdx0;
+ /** @type {Array<number>}*/var dFdy = (fragNdx & 1) ? dFdy1 : dFdy0;
+
+ /** @type {number} */ var mu = Math.max(Math.abs(dFdx[0]), Math.abs(dFdy[0]));
+ /** @type {number} */ var mv = Math.max(Math.abs(dFdx[1]), Math.abs(dFdy[1]));
+ /** @type {number} */ var p = Math.max(mu * texWidth, mv * texHeight);
+
+ /** @type {number} */ var lod = Math.log2(p) + lodBias;
+
+ output.push(this.sample([packetTexcoords[fragNdx][0], packetTexcoords[fragNdx][1]], lod));
+ }
+
+ return output;
+ };
+
+ /**
+ * @constructor
+ * @extends {sglrReferenceContext.Texture}
+ */
+ sglrReferenceContext.TextureCube = function() {
+ sglrReferenceContext.Texture.call(this, sglrReferenceContext.TextureType.TYPE_CUBE_MAP);
+ /** @type {tcuTexture.TextureCubeView} */ this.m_view = new tcuTexture.TextureCubeView(0, null);
+ /** @type {Array<sglrReferenceContext.TextureLevelArray>} */ this.m_levels = [];
+ for (var face in tcuTexture.CubeFace)
+ this.m_levels[tcuTexture.CubeFace[face]] = new sglrReferenceContext.TextureLevelArray();
+ };
+
+ /**
+ */
+ sglrReferenceContext.TextureCube.prototype = Object.create(sglrReferenceContext.Texture.prototype);
+ sglrReferenceContext.TextureCube.prototype.constructor = sglrReferenceContext.Texture2D;
+
+ sglrReferenceContext.TextureCube.prototype.clearLevels = function() {
+ for (var face in tcuTexture.CubeFace)
+ this.m_levels[tcuTexture.CubeFace[face]].clear();
+ };
+
+ /**
+ * @param {number} level
+ * @param {tcuTexture.CubeFace} face
+ * @return {boolean}
+ */
+ sglrReferenceContext.TextureCube.prototype.hasFace = function(level, face) { return this.m_levels[face].hasLevel(level); };
+
+ /**
+ * @param {number} level
+ * @param {tcuTexture.CubeFace} face
+ * @return {tcuTexture.PixelBufferAccess}
+ */
+ sglrReferenceContext.TextureCube.prototype.getFace = function(level, face) { return this.m_levels[face].getLevel(level); };
+
+ /**
+ * @param {number} level
+ * @param {tcuTexture.CubeFace} face
+ * @param {?tcuTexture.TextureFormat} format
+ * @param {number} width
+ * @param {number} height
+ */
+ sglrReferenceContext.TextureCube.prototype.allocLevel = function(level, face, format, width, height) {
+ this.m_levels[face].allocLevel(level, format, width, height, 1);
+ };
+
+ sglrReferenceContext.TextureCube.prototype.isComplete = function() {
+ var baseLevel = this.getBaseLevel();
+
+ if (this.hasFace(baseLevel, tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X)) {
+ var level = this.getFace(baseLevel, tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X);
+ var width = level.getWidth();
+ var height = level.getHeight();
+ var format = level.getFormat();
+ var mipmap = sglrReferenceContext.isMipmapFilter(this.getSampler().minFilter);
+ var numLevels = mipmap ? Math.min(this.getMaxLevel() - baseLevel + 1, sglrReferenceContext.getNumMipLevels2D(width, height)) : 1;
+
+ if (width != height)
+ return false; // Non-square is not supported.
+
+ // \note Level 0 is always checked for consistency
+ for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) {
+ var levelW = sglrReferenceContext.getMipLevelSize(width, levelNdx);
+ var levelH = sglrReferenceContext.getMipLevelSize(height, levelNdx);
+
+ for (var face in tcuTexture.CubeFace) {
+ if (this.hasFace(baseLevel + levelNdx, tcuTexture.CubeFace[face])) {
+ level = this.getFace(baseLevel + levelNdx, tcuTexture.CubeFace[face]);
+
+ if (level.getWidth() != levelW ||
+ level.getHeight() != levelH ||
+ !level.getFormat().isEqual(format))
+ return false;
+ } else
+ return false;
+ }
+ }
+
+ return true;
+ } else
+ return false;
+ };
+
+ sglrReferenceContext.TextureCube.prototype.updateView = function() {
+
+ var baseLevel = this.getBaseLevel();
+ var faces = [];
+
+ if (this.isComplete()) {
+ var size = this.getFace(baseLevel, tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X).getWidth();
+ var isMipmap = sglrReferenceContext.isMipmapFilter(this.getSampler().minFilter);
+ var numLevels = isMipmap ? Math.min(this.getMaxLevel() - baseLevel + 1, sglrReferenceContext.getNumMipLevels1D(size)) : 1;
+
+ for (var face in tcuTexture.CubeFace)
+ faces[tcuTexture.CubeFace[face]] = this.m_levels[tcuTexture.CubeFace[face]].getLevels().slice(baseLevel);
+
+ this.m_view = new tcuTexture.TextureCubeView(numLevels, faces);
+ } else
+ this.m_view = new tcuTexture.TextureCubeView(0, null);
+ };
+
+ /**
+ * @param {Array<number>} pos
+ * @param {number=} lod
+ * @return {Array<number>}
+ */
+ sglrReferenceContext.TextureCube.prototype.sample = function(pos, lod) { return this.m_view.sample(this.getSampler(), pos, lod) };
+
+ /**
+ * @constructor
+ * @extends {sglrReferenceContext.Texture}
+ */
+ sglrReferenceContext.Texture2DArray = function() {
+ sglrReferenceContext.Texture.call(this, sglrReferenceContext.TextureType.TYPE_2D_ARRAY);
+ /** @type {tcuTexture.Texture2DArrayView} */ this.m_view = new tcuTexture.Texture2DArrayView(0, null);
+ /** @type {sglrReferenceContext.TextureLevelArray} */ this.m_levels = new sglrReferenceContext.TextureLevelArray();
+ };
+
+ /**
+ */
+ sglrReferenceContext.Texture2DArray.prototype = Object.create(sglrReferenceContext.Texture.prototype);
+ sglrReferenceContext.Texture2DArray.prototype.constructor = sglrReferenceContext.Texture2DArray;
+
+ sglrReferenceContext.Texture2DArray.prototype.clearLevels = function() { this.m_levels.clear(); };
+
+ /**
+ * @param {number} level
+ * @return {boolean}
+ */
+ sglrReferenceContext.Texture2DArray.prototype.hasLevel = function(level) { return this.m_levels.hasLevel(level); };
+
+ /**
+ * @param {number} level
+ * @return {tcuTexture.PixelBufferAccess}
+ */
+ sglrReferenceContext.Texture2DArray.prototype.getLevel = function(level) { return this.m_levels.getLevel(level); };
+
+ /**
+ * @param {number} level
+ * @param {?tcuTexture.TextureFormat} format
+ * @param {number} width
+ * @param {number} height
+ * @param {number} numLayers
+ */
+ sglrReferenceContext.Texture2DArray.prototype.allocLevel = function(level, format, width, height, numLayers) {
+ this.m_levels.allocLevel(level, format, width, height, numLayers);
+ };
+
+ /**
+ * @return {boolean}
+ */
+ sglrReferenceContext.Texture2DArray.prototype.isComplete = function() {
+ /** @type {number} */ var baseLevel = this.getBaseLevel();
+
+ if (this.hasLevel(baseLevel)) {
+ /** @type {tcuTexture.PixelBufferAccess} */ var level0 = this.getLevel(baseLevel);
+ /** @type {boolean} */ var mipmap = sglrReferenceContext.isMipmapFilter(this.getSampler().minFilter);
+
+ if (mipmap) {
+ /** @type {tcuTexture.TextureFormat} */ var format = level0.getFormat();
+ /** @type {number} */ var w = level0.getWidth();
+ /** @type {number} */ var h = level0.getHeight();
+ /** @type {number} */ var numLayers = level0.getDepth();
+ /** @type {number} */ var numLevels = Math.min(this.getMaxLevel() - baseLevel + 1, sglrReferenceContext.getNumMipLevels2D(w, h));
+
+ for (var levelNdx = 1; levelNdx < numLevels; levelNdx++) {
+ if (this.hasLevel(baseLevel + levelNdx)) {
+ /** @type {tcuTexture.PixelBufferAccess} */ var level = this.getLevel(baseLevel + levelNdx);
+ /** @type {number} */ var expectedW = sglrReferenceContext.getMipLevelSize(w, levelNdx);
+ /** @type {number} */ var expectedH = sglrReferenceContext.getMipLevelSize(h, levelNdx);
+
+ if (level.getWidth() != expectedW ||
+ level.getHeight() != expectedH ||
+ level.getDepth() != numLayers ||
+ !level.getFormat().isEqual(format))
+ return false;
+ } else
+ return false;
+ }
+ }
+
+ return true;
+ } else
+ return false;
+ };
+
+ /**
+ */
+ sglrReferenceContext.Texture2DArray.prototype.updateView = function() {
+ /** @type {number} */ var baseLevel = this.getBaseLevel();
+
+ if (this.hasLevel(baseLevel) && !this.getLevel(baseLevel).isEmpty()) {
+ // Update number of levels in mipmap pyramid.
+ /** @type {number} */ var width = this.getLevel(baseLevel).getWidth();
+ /** @type {number} */ var height = this.getLevel(baseLevel).getHeight();
+ /** @type {boolean} */ var isMipmap = sglrReferenceContext.isMipmapFilter(this.getSampler().minFilter);
+ /** @type {number} */ var numLevels = isMipmap ? Math.min(this.getMaxLevel() - baseLevel + 1, sglrReferenceContext.getNumMipLevels2D(width, height)) : 1;
+
+ this.m_view = new tcuTexture.Texture2DArrayView(numLevels, this.m_levels.getLevels().slice(baseLevel));
+ } else
+ this.m_view = new tcuTexture.Texture2DArrayView(0, null);
+ };
+
+ /**
+ * @param {Array<number>} pos
+ * @param {number=} lod
+ * @return {Array<number>}
+ */
+ sglrReferenceContext.Texture2DArray.prototype.sample = function(pos, lod) {
+ return this.m_view.sample(this.getSampler(), pos, lod);
+ };
+
+ /**
+ * @constructor
+ * @extends {sglrReferenceContext.Texture}
+ */
+ sglrReferenceContext.Texture3D = function() {
+ sglrReferenceContext.Texture.call(this, sglrReferenceContext.TextureType.TYPE_2D_ARRAY);
+ /** @type {tcuTexture.Texture3DView} */ this.m_view = new tcuTexture.Texture3DView(0, null);
+ /** @type {sglrReferenceContext.TextureLevelArray} */ this.m_levels = new sglrReferenceContext.TextureLevelArray();
+ };
+
+ /**
+ */
+ sglrReferenceContext.Texture3D.prototype = Object.create(sglrReferenceContext.Texture.prototype);
+ sglrReferenceContext.Texture3D.prototype.constructor = sglrReferenceContext.Texture3D;
+
+ sglrReferenceContext.Texture3D.prototype.clearLevels = function() { this.m_levels.clear(); };
+
+ /**
+ * @param {number} level
+ * @return {boolean}
+ */
+ sglrReferenceContext.Texture3D.prototype.hasLevel = function(level) { return this.m_levels.hasLevel(level); };
+
+ /**
+ * @param {number} level
+ * @return {tcuTexture.PixelBufferAccess}
+ */
+ sglrReferenceContext.Texture3D.prototype.getLevel = function(level) { return this.m_levels.getLevel(level); };
+
+ /**
+ * @param {number} level
+ * @param {?tcuTexture.TextureFormat} format
+ * @param {number} width
+ * @param {number} height
+ * @param {number} depth
+ */
+ sglrReferenceContext.Texture3D.prototype.allocLevel = function(level, format, width, height, depth) {
+ this.m_levels.allocLevel(level, format, width, height, depth);
+ };
+
+ /**
+ * @return {boolean}
+ */
+ sglrReferenceContext.Texture3D.prototype.isComplete = function() {
+ /** @type {number} */ var baseLevel = this.getBaseLevel();
+
+ if (this.hasLevel(baseLevel)) {
+ /** @type {tcuTexture.PixelBufferAccess} */ var level0 = this.getLevel(baseLevel);
+ /** @type {boolean} */ var mipmap = sglrReferenceContext.isMipmapFilter(this.getSampler().minFilter);
+
+ if (mipmap) {
+ /** @type {tcuTexture.TextureFormat} */ var format = level0.getFormat();
+ /** @type {number} */ var w = level0.getWidth();
+ /** @type {number} */ var h = level0.getHeight();
+ /** @type {number} */ var d = level0.getDepth();
+ /** @type {number} */ var numLevels = Math.min(this.getMaxLevel() - baseLevel + 1, sglrReferenceContext.getNumMipLevels3D(w, h, d));
+
+ for (var levelNdx = 1; levelNdx < numLevels; levelNdx++) {
+ if (this.hasLevel(baseLevel + levelNdx)) {
+ /** @type {tcuTexture.PixelBufferAccess} */ var level = this.getLevel(baseLevel + levelNdx);
+ /** @type {number} */ var expectedW = sglrReferenceContext.getMipLevelSize(w, levelNdx);
+ /** @type {number} */ var expectedH = sglrReferenceContext.getMipLevelSize(h, levelNdx);
+ /** @type {number} */ var expectedD = sglrReferenceContext.getMipLevelSize(d, levelNdx);
+
+ if (level.getWidth() != expectedW ||
+ level.getHeight() != expectedH ||
+ level.getDepth() != expectedD ||
+ !level.getFormat().isEqual(format))
+ return false;
+ } else
+ return false;
+ }
+ }
+
+ return true;
+ } else
+ return false;
+ };
+
+ /**
+ */
+ sglrReferenceContext.Texture3D.prototype.updateView = function() {
+ /** @type {number} */ var baseLevel = this.getBaseLevel();
+
+ if (this.hasLevel(baseLevel) && !this.getLevel(baseLevel).isEmpty()) {
+ // Update number of levels in mipmap pyramid.
+ /** @type {number} */ var width = this.getLevel(baseLevel).getWidth();
+ /** @type {number} */ var height = this.getLevel(baseLevel).getHeight();
+ /** @type {boolean} */ var isMipmap = sglrReferenceContext.isMipmapFilter(this.getSampler().minFilter);
+ /** @type {number} */ var numLevels = isMipmap ? Math.min(this.getMaxLevel() - baseLevel + 1, sglrReferenceContext.getNumMipLevels2D(width, height)) : 1;
+
+ this.m_view = new tcuTexture.Texture3DView(numLevels, this.m_levels.getLevels().slice(baseLevel));
+ } else
+ this.m_view = new tcuTexture.Texture3DView(0, null);
+ };
+
+ /**
+ * @param {Array<number>} pos
+ * @param {number=} lod
+ * @return {Array<number>}
+ */
+ sglrReferenceContext.Texture3D.prototype.sample = function(pos, lod) { return this.m_view.sample(this.getSampler(), pos, lod) };
+
+ /**
+ * A container object for storing one of texture types;
+ * @constructor
+ */
+ sglrReferenceContext.TextureContainer = function() {
+ /** @type {sglrReferenceContext.Texture2D | sglrReferenceContext.TextureCube|sglrReferenceContext.Texture2DArray|sglrReferenceContext.Texture3D} */
+ this.texture = null;
+ /** @type {?sglrReferenceContext.TextureType} */ this.textureType = null;
+ };
+
+ /**
+ * @return {?sglrReferenceContext.TextureType}
+ */
+ sglrReferenceContext.TextureContainer.prototype.getType = function() { return this.textureType; };
+
+ /**
+ * @param {number} target
+ * @throws {Error}
+ */
+ sglrReferenceContext.TextureContainer.prototype.init = function(target) {
+ switch (target) {
+ case gl.TEXTURE_2D:
+ this.texture = new sglrReferenceContext.Texture2D();
+ this.textureType = sglrReferenceContext.TextureType.TYPE_2D;
+ break;
+ case gl.TEXTURE_CUBE_MAP:
+ this.texture = new sglrReferenceContext.TextureCube();
+ this.textureType = sglrReferenceContext.TextureType.TYPE_CUBE_MAP;
+ break;
+ case gl.TEXTURE_2D_ARRAY:
+ this.texture = new sglrReferenceContext.Texture2DArray();
+ this.textureType = sglrReferenceContext.TextureType.TYPE_2D_ARRAY;
+ break;
+ case gl.TEXTURE_3D:
+ this.texture = new sglrReferenceContext.Texture3D();
+ this.textureType = sglrReferenceContext.TextureType.TYPE_3D;
+ break;
+ /* TODO: Implement other types */
+ // case gl.TEXTURE_CUBE_MAP_ARRAY:
+ // this.textureType = sglrReferenceContext.TextureType.TYPE_CUBE_MAP_ARRAY;
+ // break;
+ default: throw new Error('Unrecognized target: ' + target);
+ }
+ };
+
+ /**
+ * @enum
+ */
+ sglrReferenceContext.AttachmentPoint = {
+ ATTACHMENTPOINT_COLOR0: 0,
+ ATTACHMENTPOINT_DEPTH: 1,
+ ATTACHMENTPOINT_STENCIL: 2
+ };
+
+ /**
+ * @param {number} attachment
+ * @return {sglrReferenceContext.AttachmentPoint}
+ * @throws {Error}
+ */
+ sglrReferenceContext.mapGLAttachmentPoint = function(attachment) {
+ switch (attachment) {
+ case gl.COLOR_ATTACHMENT0: return sglrReferenceContext.AttachmentPoint.ATTACHMENTPOINT_COLOR0;
+ case gl.DEPTH_ATTACHMENT: return sglrReferenceContext.AttachmentPoint.ATTACHMENTPOINT_DEPTH;
+ case gl.STENCIL_ATTACHMENT: return sglrReferenceContext.AttachmentPoint.ATTACHMENTPOINT_STENCIL;
+ default: throw new Error('Wrong attachment point:' + attachment);
+ }
+ };
+
+ /**
+ * @enum
+ */
+ sglrReferenceContext.AttachmentType = {
+ ATTACHMENTTYPE_RENDERBUFFER: 0,
+ ATTACHMENTTYPE_TEXTURE: 1
+ };
+
+ /**
+ * @enum
+ */
+ sglrReferenceContext.TexTarget = {
+ TEXTARGET_2D: 0,
+ TEXTARGET_CUBE_MAP_POSITIVE_X: 1,
+ TEXTARGET_CUBE_MAP_POSITIVE_Y: 2,
+ TEXTARGET_CUBE_MAP_POSITIVE_Z: 3,
+ TEXTARGET_CUBE_MAP_NEGATIVE_X: 4,
+ TEXTARGET_CUBE_MAP_NEGATIVE_Y: 5,
+ TEXTARGET_CUBE_MAP_NEGATIVE_Z: 6,
+ TEXTARGET_2D_ARRAY: 7,
+ TEXTARGET_3D: 8,
+ TEXTARGET_CUBE_MAP_ARRAY: 9
+ };
+
+ /**
+ * @param {?sglrReferenceContext.TexTarget} target
+ * @return {tcuTexture.CubeFace}
+ */
+ sglrReferenceContext.texTargetToFace = function(target) {
+ switch (target) {
+ case sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_NEGATIVE_X: return tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X;
+ case sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_POSITIVE_X: return tcuTexture.CubeFace.CUBEFACE_POSITIVE_X;
+ case sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_NEGATIVE_Y: return tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y;
+ case sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_POSITIVE_Y: return tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y;
+ case sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_NEGATIVE_Z: return tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z;
+ case sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_POSITIVE_Z: return tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z;
+ default: throw new Error('Invalid target ' + target);
+ }
+ };
+
+ /**
+ * @param {sglrReferenceContext.TexTarget} target
+ * @return {sglrReferenceContext.TexTarget}
+ * @throws {Error}
+ */
+ sglrReferenceContext.mapGLFboTexTarget = function(target) {
+ switch (target) {
+ case gl.TEXTURE_2D: return sglrReferenceContext.TexTarget.TEXTARGET_2D;
+ case gl.TEXTURE_CUBE_MAP_POSITIVE_X: return sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_POSITIVE_X;
+ case gl.TEXTURE_CUBE_MAP_POSITIVE_Y: return sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_POSITIVE_Y;
+ case gl.TEXTURE_CUBE_MAP_POSITIVE_Z: return sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_POSITIVE_Z;
+ case gl.TEXTURE_CUBE_MAP_NEGATIVE_X: return sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_NEGATIVE_X;
+ case gl.TEXTURE_CUBE_MAP_NEGATIVE_Y: return sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_NEGATIVE_Y;
+ case gl.TEXTURE_CUBE_MAP_NEGATIVE_Z: return sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_NEGATIVE_Z;
+ default: throw new Error('Wrong texture target:' + target);
+ }
+ };
+
+ /**
+ * @constructor
+ */
+ sglrReferenceContext.Attachment = function() {
+ /** @type {?sglrReferenceContext.AttachmentType} */ this.type = null;
+ /** @type {sglrReferenceContext.TextureContainer|sglrReferenceContext.Renderbuffer} */ this.object = null; // TODO: fix reserved word
+ /** @type {?sglrReferenceContext.TexTarget} */ this.texTarget = null;
+ /** @type {number} */ this.level = 0;
+ /** @type {number} */ this.layer = 0;
+ };
+
+ /**
+ * @constructor
+ */
+ sglrReferenceContext.Framebuffer = function() {
+ /** @type {Array<sglrReferenceContext.Attachment>} */ this.m_attachments = [];
+ for (var key in sglrReferenceContext.AttachmentPoint)
+ this.m_attachments[sglrReferenceContext.AttachmentPoint[key]] = new sglrReferenceContext.Attachment();
+ };
+
+ /**
+ * @param {sglrReferenceContext.AttachmentPoint} point
+ * @return {sglrReferenceContext.Attachment}
+ */
+ sglrReferenceContext.Framebuffer.prototype.getAttachment = function(point) { return this.m_attachments[point]; };
+
+ /**
+ * @param {sglrReferenceContext.AttachmentPoint} point
+ * @param {sglrReferenceContext.Attachment} attachment
+ */
+ sglrReferenceContext.Framebuffer.prototype.setAttachment = function(point, attachment) { this.m_attachments[point] = attachment; };
+
+ // /**
+ // * @enum
+ // */
+ // var Format = {
+ // FORMAT_DEPTH_COMPONENT16: 0,
+ // FORMAT_RGBA4: 1,
+ // FORMAT_RGB5_A1: 2,
+ // FORMAT_RGB565: 3,
+ // FORMAT_STENCIL_INDEX8: 4
+ // };
+
+ /**
+ * @constructor
+ */
+ sglrReferenceContext.Renderbuffer = function() {
+ /** @type {tcuTexture.TextureLevel} */ this.m_data;
+ };
+
+ /**
+ * @param {tcuTexture.TextureFormat} format
+ * @param {number} width
+ * @param {number} height
+ */
+ sglrReferenceContext.Renderbuffer.prototype.setStorage = function(format, width, height) {
+ this.m_data = new tcuTexture.TextureLevel(format, width, height);
+ };
+
+ /**
+ * @return {number}
+ */
+ sglrReferenceContext.Renderbuffer.prototype.getWidth = function() { return this.m_data.getWidth(); };
+
+ /**
+ * @return {number}
+ */
+ sglrReferenceContext.Renderbuffer.prototype.getHeight = function() { return this.m_data.getHeight(); };
+
+ /**
+ * @return {?tcuTexture.TextureFormat}
+ */
+ sglrReferenceContext.Renderbuffer.prototype.getFormat = function() { return this.m_data.getFormat(); };
+
+ /**
+ * @return {tcuTexture.PixelBufferAccess}
+ */
+ sglrReferenceContext.Renderbuffer.prototype.getAccess = function() { return this.m_data.getAccess(); };
+
+ /**
+ * @constructor
+ * @param {number} maxVertexAttribs
+ */
+ sglrReferenceContext.VertexArray = function(maxVertexAttribs) {
+ /** @type {sglrReferenceContext.DataBuffer} */ this.m_elementArrayBufferBinding = null;
+
+ /** @type {Array<sglrReferenceContext.VertexArray.VertexAttribArray>} */this.m_arrays = [];
+ for (var i = 0; i < maxVertexAttribs; i++)
+ this.m_arrays.push(new sglrReferenceContext.VertexArray.VertexAttribArray());
+ };
+
+ /** @constructor */
+ sglrReferenceContext.VertexArray.VertexAttribArray = function() {
+ this.enabled = false;
+ this.size = 4;
+ this.stride = 0;
+ this.type = gl.FLOAT;
+
+ this.normalized = false;
+ this.integer = false;
+ this.divisor = 0;
+ this.offset = 0;
+ this.bufferBinding = null;
+ };
+
+ /**
+ * @constructor
+ */
+ sglrReferenceContext.DataBuffer = function() {
+ /** @type {?ArrayBuffer} */ this.m_data = null;
+ };
+
+ /**
+ * @param {number} size
+ */
+ sglrReferenceContext.DataBuffer.prototype.setStorage = function(size) {this.m_data = new ArrayBuffer(size); };
+
+ /**
+ * @return {number}
+ */
+ sglrReferenceContext.DataBuffer.prototype.getSize = function() {
+ /** @type {number} */ var size = 0;
+ if (this.m_data)
+ size = this.m_data.byteLength;
+ return size;
+ };
+
+ /**
+ * @return {?ArrayBuffer}
+ */
+ sglrReferenceContext.DataBuffer.prototype.getData = function() { return this.m_data; };
+
+ /**
+ * @param {ArrayBuffer|goog.NumberArray} data
+ */
+ sglrReferenceContext.DataBuffer.prototype.setData = function(data) {
+ /** @type {ArrayBuffer} */ var buffer;
+ /** @type {number} */ var offset = 0;
+ /** @type {number} */ var byteLength = data.byteLength;
+ if (data instanceof ArrayBuffer)
+ buffer = data;
+ else {
+ buffer = data.buffer;
+ offset = data.byteOffset;
+ }
+
+ if (!buffer)
+ throw new Error('Invalid buffer');
+
+ this.m_data = buffer.slice(offset, offset + byteLength);
+ };
+
+ /**
+ * @param {number} offset
+ * @param {goog.NumberArray} data
+ */
+ sglrReferenceContext.DataBuffer.prototype.setSubData = function(offset, data) {
+ /** @type {ArrayBuffer} */ var buffer;
+ /** @type {number} */ var srcOffset = 0;
+ /** @type {number} */ var byteLength = data.byteLength;
+ if (data instanceof ArrayBuffer)
+ buffer = data;
+ else {
+ buffer = data.buffer;
+ srcOffset = data.byteOffset;
+ }
+
+ if (!buffer)
+ throw new Error('Invalid buffer');
+
+ /** @type {goog.NumberArray} */ var src = new Uint8Array(buffer, srcOffset, byteLength);
+ /** @type {goog.NumberArray} */ var dst = new Uint8Array(this.m_data, offset, byteLength);
+ dst.set(src);
+ };
+
+ // /**
+ // * @constructor
+ // */
+ // var ObjectManager = function() {
+ // this.m_objects = {};
+ // };
+
+ // ObjectManager.prototype.insert = function(obj) {
+ // var name = obj.getName();
+ // if (!name)
+ // throw new Error("Cannot insert unnamed object");
+ // this.m_objects[name] = obj;
+ // };
+
+ // ObjectManager.prototype.find = function(name) { return this.m_objects[name]; };
+
+ // ObjectManager.prototype.acquireReference = function(obj) {
+ // if (this.find(obj.getName()) !== obj)
+ // throw new Error("Object is not in the object manager");
+ // obj.incRefCount();
+ // };
+
+ // ObjectManager.prototype.releaseReference = function(obj) {
+ // if (this.find(obj.getName()) !== obj)
+ // throw new Error("Object is not in the object manager");
+
+ // obj.decRefCount();
+
+ // if (obj.getRefCount() == 0)
+ // delete this.m_objects[obj.getName()];
+ // };
+
+ // ObjectManager.prototype.getAll = function() { return this.m_objects; };
+
+ /**
+ * @constructor
+ */
+ sglrReferenceContext.TextureUnit = function() {
+ /** @type {?sglrReferenceContext.TextureContainer} */ this.tex2DBinding = null;
+ /** @type {?sglrReferenceContext.TextureContainer} */ this.texCubeBinding = null;
+ /** @type {?sglrReferenceContext.TextureContainer} */ this.tex2DArrayBinding = null;
+ /** @type {?sglrReferenceContext.TextureContainer} */ this.tex3DBinding = null;
+ /** @type {?sglrReferenceContext.TextureContainer} */ this.texCubeArrayBinding = null;
+ };
+
+ /**
+ * @constructor
+ */
+ sglrReferenceContext.StencilState = function() {
+ /** @type {number} */ this.func = gl.ALWAYS;
+ /** @type {number} */ this.ref = 0;
+ /** @type {number} */ this.opMask = ~0;
+ /** @type {number} */ this.opStencilFail = gl.KEEP;
+ /** @type {number} */ this.opDepthFail = gl.KEEP;
+ /** @type {number} */ this.opDepthPass = gl.KEEP;
+ /** @type {number} */ this.writeMask = ~0;
+ };
+
+ /**
+ * @param {tcuPixelFormat.PixelFormat} pixelFmt
+ * @return {tcuTexture.TextureFormat}
+ * @throws {Error}
+ */
+ sglrReferenceContext.toTextureFormat = function(pixelFmt) {
+ if (pixelFmt.equals(8, 8, 8, 8))
+ return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8);
+ else if (pixelFmt.equals(8, 8, 8, 0))
+ return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNORM_INT8);
+ else if (pixelFmt.equals(4, 4, 4, 4))
+ return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_SHORT_4444);
+ else if (pixelFmt.equals(5, 5, 5, 1))
+ return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_SHORT_5551);
+ else if (pixelFmt.equals(5, 6, 5, 0))
+ return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNORM_SHORT_565);
+
+ throw new Error('Could not map pixel format:' + pixelFmt);
+ };
+
+ /**
+ * @param {number} depthBits
+ * @return {tcuTexture.TextureFormat}
+ * @throws {Error}
+ */
+ sglrReferenceContext.getDepthFormat = function(depthBits) {
+ switch (depthBits) {
+ case 8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.D, tcuTexture.ChannelType.UNORM_INT8);
+ case 16: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.D, tcuTexture.ChannelType.UNORM_INT16);
+ case 24: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.D, tcuTexture.ChannelType.UNSIGNED_INT_24_8);
+ case 32: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.D, tcuTexture.ChannelType.FLOAT);
+ default:
+ throw new Error("Can't map depth buffer format, bits: " + depthBits);
+ }
+ };
+
+ /**
+ * @param {number} stencilBits
+ * @return {tcuTexture.TextureFormat}
+ * @throws {Error}
+ */
+ sglrReferenceContext.getStencilFormat = function(stencilBits) {
+ switch (stencilBits) {
+ case 8: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.S, tcuTexture.ChannelType.UNSIGNED_INT8);
+ case 16: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.S, tcuTexture.ChannelType.UNSIGNED_INT16);
+ case 24: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.S, tcuTexture.ChannelType.UNSIGNED_INT_24_8);
+ case 32: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.S, tcuTexture.ChannelType.UNSIGNED_INT32);
+ default:
+ throw new Error("Can't map stencil buffer format, bits: " + stencilBits);
+ }
+ };
+
+ /**
+ * @constructor
+ * @param {tcuPixelFormat.PixelFormat} colorBits
+ * @param {number} depthBits
+ * @param {number} stencilBits
+ * @param {number} width
+ * @param {number} height
+ * @param {number=} samples_
+ */
+ sglrReferenceContext.ReferenceContextBuffers = function(colorBits, depthBits, stencilBits, width, height, samples_) {
+ if (samples_ === undefined)
+ samples_ = 1;
+
+ /** @type {number} */ var samples = samples_;
+ /** @type {tcuTexture.TextureLevel} */ this.m_colorbuffer = new tcuTexture.TextureLevel(sglrReferenceContext.toTextureFormat(colorBits), samples, width, height);
+
+ if (depthBits > 0)
+ /** @type {tcuTexture.TextureLevel} */ this.m_depthbuffer = new tcuTexture.TextureLevel(sglrReferenceContext.getDepthFormat(depthBits), samples, width, height);
+
+ if (stencilBits > 0)
+ /** @type {tcuTexture.TextureLevel} */ this.m_stencilbuffer = new tcuTexture.TextureLevel(sglrReferenceContext.getStencilFormat(stencilBits), samples, width, height);
+ };
+
+ /**
+ * @return {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess}
+ */
+ sglrReferenceContext.ReferenceContextBuffers.prototype.getColorbuffer = function() { return rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.fromMultisampleAccess(this.m_colorbuffer.getAccess()); };
+
+ /**
+ * @return {?rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess}
+ */
+ sglrReferenceContext.ReferenceContextBuffers.prototype.getDepthbuffer = function() { return this.m_depthbuffer !== undefined ? rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.fromMultisampleAccess(this.m_depthbuffer.getAccess()) : null; };
+
+ /**
+ * @return {?rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess}
+ */
+ sglrReferenceContext.ReferenceContextBuffers.prototype.getStencilbuffer = function() { return this.m_stencilbuffer !== undefined ? rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.fromMultisampleAccess(this.m_stencilbuffer.getAccess()) : null; };
+
+ /**
+ * @param {sglrReferenceContext.ReferenceContextLimits} limits
+ * @param {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} colorbuffer
+ * @param {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} depthbuffer
+ * @param {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} stencilbuffer
+ * @constructor
+ */
+ sglrReferenceContext.ReferenceContext = function(limits, colorbuffer, depthbuffer, stencilbuffer) {
+ /** @type {sglrReferenceContext.ReferenceContextLimits} */ this.m_limits = limits;
+ /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ this.m_defaultColorbuffer = colorbuffer;
+ /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ this.m_defaultDepthbuffer = depthbuffer;
+ /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ this.m_defaultStencilbuffer = stencilbuffer;
+ /** @type {Array<number>} */ this.m_viewport = [0, 0, colorbuffer.raw().getHeight(), colorbuffer.raw().getDepth()];
+ /** @type {Array<sglrReferenceContext.TextureUnit>} */ this.m_textureUnits = [];
+ for (var i = 0; i < this.m_limits.maxTextureImageUnits; i++)
+ this.m_textureUnits.push(new sglrReferenceContext.TextureUnit());
+ /** @type {number} */ this.m_activeTexture = 0;
+ /** @type {number} */ this.m_lastError = gl.NO_ERROR;
+ // this.m_textures = new ObjectManager();
+ /** @type {number} */ this.m_pixelUnpackRowLength = 0;
+ /** @type {number} */ this.m_pixelUnpackSkipRows = 0;
+ /** @type {number} */ this.m_pixelUnpackSkipPixels = 0;
+ /** @type {number} */ this.m_pixelUnpackImageHeight = 0;
+ /** @type {number} */ this.m_pixelUnpackSkipImages = 0;
+ /** @type {number} */ this.m_pixelUnpackAlignment = 4;
+ /** @type {number} */ this.m_pixelPackAlignment = 4;
+ /** @type {Array<number>} */ this.m_clearColor = [0, 0, 0, 0];
+ /** @type {number} */ this.m_clearDepth = 1;
+ /** @type {number} */ this.m_clearStencil = 0;
+ /** @type {Array<number>} */ this.m_scissorBox = this.m_viewport;
+ /** @type {boolean} */ this.m_blendEnabled = false;
+ /** @type {boolean} */ this.m_scissorEnabled = false;
+ /** @type {boolean} */ this.m_depthTestEnabled = false;
+ /** @type {boolean} */ this.m_stencilTestEnabled = false;
+ /** @type {boolean} */ this.m_polygonOffsetFillEnabled = false;
+ /** @type {boolean} */ this.m_primitiveRestartFixedIndex = true; //always on
+ /** @type {boolean} */ this.m_primitiveRestartSettableIndex = true; //always on
+ /** @type {Array<sglrReferenceContext.StencilState>} */ this.m_stencil = [];
+ for (var type in rrDefs.FaceType)
+ this.m_stencil[rrDefs.FaceType[type]] = new sglrReferenceContext.StencilState();
+ /** @type {number} */ this.m_depthFunc = gl.LESS;
+ /** @type {number} */ this.m_depthRangeNear = 0;
+ /** @type {number} */ this.m_depthRangeFar = 1;
+ /** @type {number} */ this.m_polygonOffsetFactor = 0;
+ /** @type {number} */ this.m_polygonOffsetUnits = 0;
+ /** @type {number} */ this.m_blendModeRGB = gl.FUNC_ADD;
+ /** @type {number} */ this.m_blendModeAlpha = gl.FUNC_ADD;
+ /** @type {number} */ this.m_blendFactorSrcRGB = gl.ONE;
+ /** @type {number} */ this.m_blendFactorDstRGB = gl.ZERO;
+ /** @type {number} */ this.m_blendFactorSrcAlpha = gl.ONE;
+ /** @type {number} */ this.m_blendFactorDstAlpha = gl.ZERO;
+ /** @type {Array<number>} */ this.m_blendColor = [0, 0, 0, 0];
+ /** @type {boolean} */ this.m_sRGBUpdateEnabled = true;
+ /** @type {Array<boolean>} */ this.m_colorMask = [true, true, true, true];
+ /** @type {boolean} */ this.m_depthMask = true;
+ /** @type {sglrReferenceContext.VertexArray} */ this.m_defaultVAO = new sglrReferenceContext.VertexArray(this.m_limits.maxVertexAttribs);
+ /** @type {sglrReferenceContext.VertexArray} */ this.m_vertexArrayBinding = this.m_defaultVAO;
+ /** @type {sglrReferenceContext.DataBuffer} */ this.m_arrayBufferBinding = null;
+ /** @type {sglrReferenceContext.DataBuffer} */ this.m_copyReadBufferBinding = null;
+ /** @type {sglrReferenceContext.DataBuffer} */ this.m_copyWriteBufferBinding = null;
+ /** @type {sglrReferenceContext.DataBuffer} */ this.m_drawIndirectBufferBinding = null;
+ /** @type {sglrReferenceContext.DataBuffer} */ this.m_pixelPackBufferBinding = null;
+ /** @type {sglrReferenceContext.DataBuffer} */ this.m_pixelUnpackBufferBinding = null;
+ /** @type {sglrReferenceContext.DataBuffer} */ this.m_transformFeedbackBufferBinding = null;
+ /** @type {sglrReferenceContext.DataBuffer} */ this.m_uniformBufferBinding = null;
+ /** @type {sglrReferenceContext.Framebuffer} */ this.m_readFramebufferBinding = null;
+ /** @type {sglrReferenceContext.Framebuffer} */ this.m_drawFramebufferBinding = null;
+ /** @type {sglrReferenceContext.Renderbuffer} */ this.m_renderbufferBinding = null;
+ /** @type {sglrShaderProgram.ShaderProgram} */ this.m_currentProgram = null;
+ /** @type {Array<rrGenericVector.GenericVec4>} */ this.m_currentAttribs = [];
+ for (var i = 0; i < this.m_limits.maxVertexAttribs; i++)
+ this.m_currentAttribs.push(new rrGenericVector.GenericVec4());
+ /** @type {number} */ this.m_lineWidth = 1;
+
+ /** @type {sglrReferenceContext.TextureContainer} */ this.m_emptyTex2D = new sglrReferenceContext.TextureContainer();
+ this.m_emptyTex2D.init(gl.TEXTURE_2D);
+ this.m_emptyTex2D.texture.getSampler().wrapS = tcuTexture.WrapMode.CLAMP_TO_EDGE;
+ this.m_emptyTex2D.texture.getSampler().wrapT = tcuTexture.WrapMode.CLAMP_TO_EDGE;
+ this.m_emptyTex2D.texture.getSampler().minFilter = tcuTexture.FilterMode.NEAREST;
+ this.m_emptyTex2D.texture.getSampler().magFilter = tcuTexture.FilterMode.NEAREST;
+ this.m_emptyTex2D.texture.allocLevel(0, new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8), 1, 1);
+ this.m_emptyTex2D.texture.getLevel(0).setPixel([0, 0, 0, 1], 0, 0);
+ this.m_emptyTex2D.texture.updateView();
+
+ /** @type {sglrReferenceContext.TextureContainer} */ this.m_emptyTexCube = new sglrReferenceContext.TextureContainer();
+ this.m_emptyTexCube.init(gl.TEXTURE_CUBE_MAP);
+ this.m_emptyTexCube.texture.getSampler().wrapS = tcuTexture.WrapMode.CLAMP_TO_EDGE;
+ this.m_emptyTexCube.texture.getSampler().wrapT = tcuTexture.WrapMode.CLAMP_TO_EDGE;
+ this.m_emptyTexCube.texture.getSampler().minFilter = tcuTexture.FilterMode.NEAREST;
+ this.m_emptyTexCube.texture.getSampler().magFilter = tcuTexture.FilterMode.NEAREST;
+
+ for (var face in tcuTexture.CubeFace) {
+ this.m_emptyTexCube.texture.allocLevel(0, tcuTexture.CubeFace[face],
+ new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8), 1, 1);
+ this.m_emptyTexCube.texture.getFace(0, tcuTexture.CubeFace[face]).setPixel([0, 0, 0, 1], 0, 0);
+ }
+ this.m_emptyTexCube.texture.updateView();
+
+ /** @type {sglrReferenceContext.TextureContainer} */ this.m_emptyTex2DArray = new sglrReferenceContext.TextureContainer();
+ this.m_emptyTex2DArray.init(gl.TEXTURE_2D_ARRAY);
+ this.m_emptyTex2DArray.texture.getSampler().wrapS = tcuTexture.WrapMode.CLAMP_TO_EDGE;
+ this.m_emptyTex2DArray.texture.getSampler().wrapT = tcuTexture.WrapMode.CLAMP_TO_EDGE;
+ this.m_emptyTex2DArray.texture.getSampler().wrapR = tcuTexture.WrapMode.CLAMP_TO_EDGE;
+ this.m_emptyTex2DArray.texture.getSampler().minFilter = tcuTexture.FilterMode.NEAREST;
+ this.m_emptyTex2DArray.texture.getSampler().magFilter = tcuTexture.FilterMode.NEAREST;
+ this.m_emptyTex2DArray.texture.allocLevel(0, new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8), 1, 1);
+ this.m_emptyTex2DArray.texture.getLevel(0).setPixel([0, 0, 0, 1], 0, 0);
+ this.m_emptyTex2DArray.texture.updateView();
+
+ /** @type {sglrReferenceContext.TextureContainer} */ this.m_emptyTex3D = new sglrReferenceContext.TextureContainer();
+ this.m_emptyTex3D.init(gl.TEXTURE_3D);
+ this.m_emptyTex3D.texture.getSampler().wrapS = tcuTexture.WrapMode.CLAMP_TO_EDGE;
+ this.m_emptyTex3D.texture.getSampler().wrapT = tcuTexture.WrapMode.CLAMP_TO_EDGE;
+ this.m_emptyTex3D.texture.getSampler().wrapR = tcuTexture.WrapMode.CLAMP_TO_EDGE;
+ this.m_emptyTex3D.texture.getSampler().minFilter = tcuTexture.FilterMode.NEAREST;
+ this.m_emptyTex3D.texture.getSampler().magFilter = tcuTexture.FilterMode.NEAREST;
+ this.m_emptyTex3D.texture.allocLevel(0, new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8), 1, 1);
+ this.m_emptyTex3D.texture.getLevel(0).setPixel([0, 0, 0, 1], 0, 0);
+ this.m_emptyTex3D.texture.updateView();
+
+ /** @type {sglrReferenceContext.TextureType} */ this.m_type;
+
+ /** @type {boolean} */ this.m_immutable;
+
+ /** @type {tcuTexture.Sampler} */ this.m_sampler;
+ /** @type {number} */ this.m_baseLevel;
+ /** @type {number} */ this.m_maxLevel;
+ };
+
+ /**
+ * @return {number}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.getWidth = function() { return this.m_defaultColorbuffer.raw().getHeight(); };
+
+ /**
+ * @return {number}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.getHeight = function() { return this.m_defaultColorbuffer.raw().getDepth(); };
+
+ /**
+ * @param {number} x
+ * @param {number} y
+ * @param {number} width
+ * @param {number} height
+ */
+ sglrReferenceContext.ReferenceContext.prototype.viewport = function(x, y, width, height) { this.m_viewport = [x, y, width, height]; };
+
+ /**
+ * @param {number} texture
+ */
+ sglrReferenceContext.ReferenceContext.prototype.activeTexture = function(texture) {
+ if (deMath.deInBounds32(texture, gl.TEXTURE0, gl.TEXTURE0 + this.m_textureUnits.length))
+ this.m_activeTexture = texture - gl.TEXTURE0;
+ else
+ this.setError(gl.INVALID_ENUM);
+ };
+
+ /**
+ * @param {number} error
+ */
+ sglrReferenceContext.ReferenceContext.prototype.setError = function(error) {
+ if (this.m_lastError == gl.NO_ERROR)
+ this.m_lastError = error;
+ };
+
+ /**
+ * @return {number} error
+ */
+ sglrReferenceContext.ReferenceContext.prototype.getError = function() {
+ /** @type {number} */ var err = this.m_lastError;
+ this.m_lastError = gl.NO_ERROR;
+ return err;
+ };
+
+ /**
+ * @param {boolean} condition
+ * @param {number} error
+ */
+ sglrReferenceContext.ReferenceContext.prototype.conditionalSetError = function(condition, error) {
+ if (condition)
+ this.setError(error);
+ return condition;
+ };
+
+ /**
+ * @param {number} target
+ * @param {sglrReferenceContext.TextureContainer} texture
+ * @throws {Error}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.bindTexture = function(target, texture) {
+ /** @type {number} */ var unitNdx = this.m_activeTexture;
+
+ if (this.conditionalSetError((target != gl.TEXTURE_2D &&
+ target != gl.TEXTURE_CUBE_MAP &&
+ target != gl.TEXTURE_2D_ARRAY &&
+ target != gl.TEXTURE_3D), // &&
+ // target != gl.TEXTURE_CUBE_MAP_ARRAY),
+ gl.INVALID_ENUM))
+ return;
+
+ if (!texture) {
+ // Clear binding.
+ switch (target) {
+ case gl.TEXTURE_2D: this.setTex2DBinding(unitNdx, null); break;
+ case gl.TEXTURE_CUBE_MAP: this.setTexCubeBinding(unitNdx, null); break;
+ case gl.TEXTURE_2D_ARRAY: this.setTex2DArrayBinding(unitNdx, null); break;
+ case gl.TEXTURE_3D: this.setTex3DBinding(unitNdx, null); break;
+ default:
+ throw new Error('Unrecognized target: ' + target);
+ }
+ } else {
+ if (texture.textureType == null) {
+ texture.init(target);
+ } else {
+ // Validate type.
+ /** @type {sglrReferenceContext.TextureType} */ var expectedType;
+ switch (target) {
+ case gl.TEXTURE_2D: expectedType = sglrReferenceContext.TextureType.TYPE_2D; break;
+ case gl.TEXTURE_CUBE_MAP: expectedType = sglrReferenceContext.TextureType.TYPE_CUBE_MAP; break;
+ case gl.TEXTURE_2D_ARRAY: expectedType = sglrReferenceContext.TextureType.TYPE_2D_ARRAY; break;
+ case gl.TEXTURE_3D: expectedType = sglrReferenceContext.TextureType.TYPE_3D; break;
+ default: throw new Error('Unrecognized target: ' + target);
+ }
+ if (this.conditionalSetError((texture.textureType != expectedType), gl.INVALID_OPERATION))
+ return;
+ }
+ switch (target) {
+ case gl.TEXTURE_2D: this.setTex2DBinding(unitNdx, texture); break;
+ case gl.TEXTURE_CUBE_MAP: this.setTexCubeBinding(unitNdx, texture); break;
+ case gl.TEXTURE_2D_ARRAY: this.setTex2DArrayBinding(unitNdx, texture); break;
+ case gl.TEXTURE_3D: this.setTex3DBinding(unitNdx, texture); break;
+ default:
+ throw new Error('Unrecognized target: ' + target);
+ }
+ }
+ };
+
+ /**
+ * @param {number} unitNdx
+ * @param {?sglrReferenceContext.TextureContainer} texture
+ */
+ sglrReferenceContext.ReferenceContext.prototype.setTexCubeBinding = function(unitNdx, texture) {
+ if (this.m_textureUnits[unitNdx].texCubeBinding) {
+ this.m_textureUnits[unitNdx].texCubeBinding = null;
+ }
+
+ if (texture) {
+ this.m_textureUnits[unitNdx].texCubeBinding = texture;
+ }
+ };
+
+ /**
+ * @param {number} unitNdx
+ * @param {?sglrReferenceContext.TextureContainer} texture
+ */
+ sglrReferenceContext.ReferenceContext.prototype.setTex2DBinding = function(unitNdx, texture) {
+ if (this.m_textureUnits[unitNdx].tex2DBinding) {
+ // this.m_textures.releaseReference(this.m_textureUnits[unitNdx].tex2DBinding);
+ this.m_textureUnits[unitNdx].tex2DBinding = null;
+ }
+
+ if (texture) {
+ // this.m_textures.acquireReference(texture);
+ this.m_textureUnits[unitNdx].tex2DBinding = texture;
+ }
+ };
+
+ /**
+ * @param {number} unitNdx
+ * @param {?sglrReferenceContext.TextureContainer} texture
+ */
+ sglrReferenceContext.ReferenceContext.prototype.setTex2DArrayBinding = function(unitNdx, texture) {
+ if (this.m_textureUnits[unitNdx].tex2DArrayBinding) {
+ // this.m_textures.releaseReference(this.m_textureUnits[unitNdx].tex2DArrayBinding);
+ this.m_textureUnits[unitNdx].tex2DArrayBinding = null;
+ }
+
+ if (texture) {
+ // this.m_textures.acquireReference(texture);
+ this.m_textureUnits[unitNdx].tex2DArrayBinding = texture;
+ }
+ };
+
+ /**
+ * @param {number} unitNdx
+ * @param {?sglrReferenceContext.TextureContainer} texture
+ */
+ sglrReferenceContext.ReferenceContext.prototype.setTex3DBinding = function(unitNdx, texture) {
+ if (this.m_textureUnits[unitNdx].tex3DBinding) {
+ // this.m_textures.releaseReference(this.m_textureUnits[unitNdx].tex3DBinding);
+ this.m_textureUnits[unitNdx].tex3DBinding = null;
+ }
+
+ if (texture) {
+ // this.m_textures.acquireReference(texture);
+ this.m_textureUnits[unitNdx].tex3DBinding = texture;
+ }
+ };
+
+ /**
+ * @return {sglrReferenceContext.TextureContainer}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.createTexture = function() { return new sglrReferenceContext.TextureContainer(); };
+
+ /**
+ * @param {sglrReferenceContext.Texture} texture
+ */
+ sglrReferenceContext.ReferenceContext.prototype.deleteTexture = function(texture) { /*empty*/ };
+
+ /**
+ * @param {number} target
+ * @param {framework.opengl.simplereference.sglrReferenceContext.Framebuffer} fbo
+ */
+ sglrReferenceContext.ReferenceContext.prototype.bindFramebuffer = function(target, fbo) {
+ if (this.conditionalSetError((target != gl.FRAMEBUFFER &&
+ target != gl.DRAW_FRAMEBUFFER &&
+ target != gl.READ_FRAMEBUFFER), gl.INVALID_ENUM))
+ return;
+ for (var ndx = 0; ndx < 2; ndx++) {
+ /** @type {number} */ var bindingTarget = ndx ? gl.DRAW_FRAMEBUFFER : gl.READ_FRAMEBUFFER;
+
+ if (target != gl.FRAMEBUFFER && target != bindingTarget)
+ continue; // Doesn't match this target.
+
+ if (ndx)
+ this.m_drawFramebufferBinding = fbo;
+ else
+ this.m_readFramebufferBinding = fbo;
+ }
+ };
+
+ /**
+ * @return {sglrReferenceContext.Framebuffer}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.createFramebuffer = function() { return new sglrReferenceContext.Framebuffer(); };
+
+ /**
+ * @param {sglrReferenceContext.Framebuffer} fbo
+ */
+ sglrReferenceContext.ReferenceContext.prototype.deleteFramebuffer = function(fbo) { /*empty*/ };
+
+ /**
+ * @param {number} target
+ * @param {sglrReferenceContext.Renderbuffer} rbo
+ */
+ sglrReferenceContext.ReferenceContext.prototype.bindRenderbuffer = function(target, rbo) {
+ if (this.conditionalSetError(target != gl.RENDERBUFFER, gl.INVALID_ENUM))
+ return;
+
+ this.m_renderbufferBinding = rbo;
+ };
+
+ /**
+ * @return {sglrReferenceContext.Renderbuffer}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.createRenderbuffer = function() { return new sglrReferenceContext.Renderbuffer(); };
+
+ /**
+ * @param {sglrReferenceContext.Renderbuffer} rbo
+ */
+ sglrReferenceContext.ReferenceContext.prototype.deleteRenderbuffer = function(rbo) { /*empty*/ };
+
+ /**
+ * @param {number} pname
+ * @param {number} param
+ */
+ sglrReferenceContext.ReferenceContext.prototype.pixelStorei = function(pname, param) {
+ switch (pname) {
+ case gl.UNPACK_ALIGNMENT:
+ if (this.conditionalSetError((param != 1 && param != 2 && param != 4 && param != 8), gl.INVALID_VALUE)) return;
+ this.m_pixelUnpackAlignment = param;
+ break;
+
+ case gl.PACK_ALIGNMENT:
+ if (this.conditionalSetError((param != 1 && param != 2 && param != 4 && param != 8), gl.INVALID_VALUE)) return;
+ this.m_pixelPackAlignment = param;
+ break;
+
+ case gl.UNPACK_ROW_LENGTH:
+ if (this.conditionalSetError(param < 0, gl.INVALID_VALUE)) return;
+ this.m_pixelUnpackRowLength = param;
+ break;
+
+ case gl.UNPACK_SKIP_ROWS:
+ if (this.conditionalSetError(param < 0, gl.INVALID_VALUE)) return;
+ this.m_pixelUnpackSkipRows = param;
+ break;
+
+ case gl.UNPACK_SKIP_PIXELS:
+ if (this.conditionalSetError(param < 0, gl.INVALID_VALUE)) return;
+ this.m_pixelUnpackSkipPixels = param;
+ break;
+
+ case gl.UNPACK_IMAGE_HEIGHT:
+ if (this.conditionalSetError(param < 0, gl.INVALID_VALUE)) return;
+ this.m_pixelUnpackImageHeight = param;
+ break;
+
+ case gl.UNPACK_SKIP_IMAGES:
+ if (this.conditionalSetError(param < 0, gl.INVALID_VALUE)) return;
+ this.m_pixelUnpackSkipImages = param;
+ break;
+
+ default:
+ this.setError(gl.INVALID_ENUM);
+ }
+ };
+
+ /**
+ * @param {number} red
+ * @param {number} green
+ * @param {number} blue
+ * @param {number} alpha
+ */
+ sglrReferenceContext.ReferenceContext.prototype.clearColor = function(red, green, blue, alpha) {
+ this.m_clearColor = [deMath.clamp(red, 0, 1),
+ deMath.clamp(green, 0, 1),
+ deMath.clamp(blue, 0, 1),
+ deMath.clamp(alpha, 0, 1)];
+ };
+
+ /**
+ * @param {number} depth
+ */
+ sglrReferenceContext.ReferenceContext.prototype.clearDepthf = function(depth) {
+ this.m_clearDepth = deMath.clamp(depth, 0, 1);
+ };
+
+ /**
+ * @param {number} stencil
+ */
+ sglrReferenceContext.ReferenceContext.prototype.clearStencil = function(stencil) {
+ this.m_clearStencil = stencil;
+ };
+
+ /**
+ * @param {number} x
+ * @param {number} y
+ * @param {number} width
+ * @param {number} height
+ */
+ sglrReferenceContext.ReferenceContext.prototype.scissor = function(x, y, width, height) {
+ if (this.conditionalSetError(width < 0 || height < 0, gl.INVALID_VALUE))
+ return;
+ this.m_scissorBox = [x, y, width, height];
+ };
+
+ /**
+ * @param {number} cap
+ */
+ sglrReferenceContext.ReferenceContext.prototype.enable = function(cap) {
+ switch (cap) {
+ case gl.BLEND: this.m_blendEnabled = true; break;
+ case gl.SCISSOR_TEST: this.m_scissorEnabled = true; break;
+ case gl.DEPTH_TEST: this.m_depthTestEnabled = true; break;
+ case gl.STENCIL_TEST: this.m_stencilTestEnabled = true; break;
+ case gl.POLYGON_OFFSET_FILL: this.m_polygonOffsetFillEnabled = true; break;
+
+ case gl.DITHER:
+ // Not implemented - just ignored.
+ break;
+
+ default:
+ this.setError(gl.INVALID_ENUM);
+ break;
+ }
+ };
+
+ /**
+ * @param {number} cap
+ */
+ sglrReferenceContext.ReferenceContext.prototype.disable = function(cap) {
+ switch (cap) {
+ case gl.BLEND: this.m_blendEnabled = false; break;
+ case gl.SCISSOR_TEST: this.m_scissorEnabled = false; break;
+ case gl.DEPTH_TEST: this.m_depthTestEnabled = false; break;
+ case gl.STENCIL_TEST: this.m_stencilTestEnabled = false; break;
+ case gl.POLYGON_OFFSET_FILL: this.m_polygonOffsetFillEnabled = false; break;
+
+ case gl.DITHER:
+ // Not implemented - just ignored.
+ break;
+
+ default:
+ this.setError(gl.INVALID_ENUM);
+ break;
+ }
+ };
+
+ /**
+ * @param {number} func
+ * @param {number} ref
+ * @param {number} mask
+ */
+ sglrReferenceContext.ReferenceContext.prototype.stencilFunc = function(func, ref, mask) {
+ this.stencilFuncSeparate(gl.FRONT_AND_BACK, func, ref, mask);
+ };
+
+ /**
+ * @param {number} face
+ * @param {number} func
+ * @param {number} ref
+ * @param {number} mask
+ */
+ sglrReferenceContext.ReferenceContext.prototype.stencilFuncSeparate = function(face, func, ref, mask) {
+ /** @type {boolean} */ var setFront = face == gl.FRONT || face == gl.FRONT_AND_BACK;
+ /** @type {boolean} */ var setBack = face == gl.BACK || face == gl.FRONT_AND_BACK;
+
+ if (this.conditionalSetError(!sglrReferenceContext.isValidCompareFunc(func), gl.INVALID_ENUM))
+ return;
+ if (this.conditionalSetError(!setFront && !setBack, gl.INVALID_ENUM))
+ return;
+
+ for (var key in rrDefs.FaceType) {
+ /** @type {number} */ var type = rrDefs.FaceType[key];
+ if ((type == rrDefs.FaceType.FACETYPE_FRONT && setFront) ||
+ (type == rrDefs.FaceType.FACETYPE_BACK && setBack)) {
+ this.m_stencil[type].func = func;
+ this.m_stencil[type].ref = ref;
+ this.m_stencil[type].opMask = mask;
+ }
+ }
+ };
+
+ /**
+ * @param {number} func
+ * @return {boolean}
+ */
+ sglrReferenceContext.isValidCompareFunc = function(func) {
+ switch (func) {
+ case gl.NEVER:
+ case gl.LESS:
+ case gl.LEQUAL:
+ case gl.GREATER:
+ case gl.GEQUAL:
+ case gl.EQUAL:
+ case gl.NOTEQUAL:
+ case gl.ALWAYS:
+ return true;
+
+ default:
+ return false;
+ }
+ };
+
+ /**
+ * @param {number} op
+ * @return {boolean}
+ */
+ sglrReferenceContext.isValidStencilOp = function(op) {
+ switch (op) {
+ case gl.KEEP:
+ case gl.ZERO:
+ case gl.REPLACE:
+ case gl.INCR:
+ case gl.INCR_WRAP:
+ case gl.DECR:
+ case gl.DECR_WRAP:
+ case gl.INVERT:
+ return true;
+
+ default:
+ return false;
+ }
+ };
+
+ /**
+ * @param {number} sfail
+ * @param {number} dpfail
+ * @param {number} dppass
+ */
+ sglrReferenceContext.ReferenceContext.prototype.stencilOp = function(sfail, dpfail, dppass) {
+ this.stencilOpSeparate(gl.FRONT_AND_BACK, sfail, dpfail, dppass);
+ };
+
+ /**
+ * @param {number} face
+ * @param {number} sfail
+ * @param {number} dpfail
+ * @param {number} dppass
+ */
+ sglrReferenceContext.ReferenceContext.prototype.stencilOpSeparate = function(face, sfail, dpfail, dppass) {
+ /** @type {boolean} */ var setFront = face == gl.FRONT || face == gl.FRONT_AND_BACK;
+ /** @type {boolean} */ var setBack = face == gl.BACK || face == gl.FRONT_AND_BACK;
+
+ if (this.conditionalSetError((!sglrReferenceContext.isValidStencilOp(sfail) ||
+ !sglrReferenceContext.isValidStencilOp(dpfail) ||
+ !sglrReferenceContext.isValidStencilOp(dppass)),
+ gl.INVALID_ENUM))
+ return;
+
+ if (this.conditionalSetError(!setFront && !setBack, gl.INVALID_ENUM))
+ return;
+
+ for (var key in rrDefs.FaceType) {
+ /** @type {number} */ var type = rrDefs.FaceType[key];
+ if ((type == rrDefs.FaceType.FACETYPE_FRONT && setFront) ||
+ (type == rrDefs.FaceType.FACETYPE_BACK && setBack)) {
+ this.m_stencil[type].opStencilFail = sfail;
+ this.m_stencil[type].opDepthFail = dpfail;
+ this.m_stencil[type].opDepthPass = dppass;
+ }
+ }
+ };
+
+ /**
+ * @param {number} func
+ */
+ sglrReferenceContext.ReferenceContext.prototype.depthFunc = function(func) {
+ if (this.conditionalSetError(!sglrReferenceContext.isValidCompareFunc(func), gl.INVALID_ENUM))
+ return;
+ this.m_depthFunc = func;
+ };
+
+ /**
+ * @param {number} n
+ * @param {number} f
+ */
+ sglrReferenceContext.ReferenceContext.prototype.depthRange = function(n, f) {
+ this.m_depthRangeNear = deMath.clamp(n, 0, 1);
+ this.m_depthRangeFar = deMath.clamp(f, 0, 1);
+ };
+
+ /**
+ * @param {number} factor
+ * @param {number} units
+ */
+ sglrReferenceContext.ReferenceContext.prototype.polygonOffset = function(factor, units) {
+ this.m_polygonOffsetFactor = factor;
+ this.m_polygonOffsetUnits = units;
+ };
+
+ /**
+ * @param {number} mode
+ * @return {boolean}
+ */
+ sglrReferenceContext.isValidBlendEquation = function(mode) {
+ return mode == gl.FUNC_ADD ||
+ mode == gl.FUNC_SUBTRACT ||
+ mode == gl.FUNC_REVERSE_SUBTRACT ||
+ mode == gl.MIN ||
+ mode == gl.MAX;
+ };
+
+ /**
+ * @param {number} factor
+ * @return {boolean}
+ */
+ sglrReferenceContext.isValidBlendFactor = function(factor) {
+ switch (factor) {
+ case gl.ZERO:
+ case gl.ONE:
+ case gl.SRC_COLOR:
+ case gl.ONE_MINUS_SRC_COLOR:
+ case gl.DST_COLOR:
+ case gl.ONE_MINUS_DST_COLOR:
+ case gl.SRC_ALPHA:
+ case gl.ONE_MINUS_SRC_ALPHA:
+ case gl.DST_ALPHA:
+ case gl.ONE_MINUS_DST_ALPHA:
+ case gl.CONSTANT_COLOR:
+ case gl.ONE_MINUS_CONSTANT_COLOR:
+ case gl.CONSTANT_ALPHA:
+ case gl.ONE_MINUS_CONSTANT_ALPHA:
+ case gl.SRC_ALPHA_SATURATE:
+ return true;
+
+ default:
+ return false;
+ }
+ };
+
+ /**
+ * @param {number} mode
+ */
+ sglrReferenceContext.ReferenceContext.prototype.blendEquation = function(mode) {
+ if (this.conditionalSetError(!sglrReferenceContext.isValidBlendEquation(mode), gl.INVALID_ENUM))
+ return;
+ this.m_blendModeRGB = mode;
+ this.m_blendModeAlpha = mode;
+ };
+
+ /**
+ * @param {number} modeRGB
+ * @param {number} modeAlpha
+ */
+ sglrReferenceContext.ReferenceContext.prototype.blendEquationSeparate = function(modeRGB, modeAlpha) {
+ if (this.conditionalSetError(!sglrReferenceContext.isValidBlendEquation(modeRGB) ||
+ !sglrReferenceContext.isValidBlendEquation(modeAlpha),
+ gl.INVALID_ENUM))
+ return;
+
+ this.m_blendModeRGB = modeRGB;
+ this.m_blendModeAlpha = modeAlpha;
+ };
+
+ /**
+ * @param {number} src
+ * @param {number} dst
+ */
+ sglrReferenceContext.ReferenceContext.prototype.blendFunc = function(src, dst) {
+ if (this.conditionalSetError(!sglrReferenceContext.isValidBlendFactor(src) ||
+ !sglrReferenceContext.isValidBlendFactor(dst),
+ gl.INVALID_ENUM))
+ return;
+
+ this.m_blendFactorSrcRGB = src;
+ this.m_blendFactorSrcAlpha = src;
+ this.m_blendFactorDstRGB = dst;
+ this.m_blendFactorDstAlpha = dst;
+ };
+
+ /**
+ * @param {number} srcRGB
+ * @param {number} dstRGB
+ * @param {number} srcAlpha
+ * @param {number} dstAlpha
+ */
+ sglrReferenceContext.ReferenceContext.prototype.blendFuncSeparate = function(srcRGB, dstRGB, srcAlpha, dstAlpha) {
+ if (this.conditionalSetError(!sglrReferenceContext.isValidBlendFactor(srcRGB) ||
+ !sglrReferenceContext.isValidBlendFactor(dstRGB) ||
+ !sglrReferenceContext.isValidBlendFactor(srcAlpha) ||
+ !sglrReferenceContext.isValidBlendFactor(dstAlpha),
+ gl.INVALID_ENUM))
+ return;
+
+ this.m_blendFactorSrcRGB = srcRGB;
+ this.m_blendFactorSrcAlpha = srcAlpha;
+ this.m_blendFactorDstRGB = dstRGB;
+ this.m_blendFactorDstAlpha = dstAlpha;
+ };
+
+ /**
+ * @param {number} red
+ * @param {number} green
+ * @param {number} blue
+ * @param {number} alpha
+ */
+ sglrReferenceContext.ReferenceContext.prototype.blendColor = function(red, green, blue, alpha) {
+ this.m_blendColor = [deMath.clamp(red, 0, 1),
+ deMath.clamp(green, 0, 1),
+ deMath.clamp(blue, 0, 1),
+ deMath.clamp(alpha, 0, 1)];
+ };
+
+ /**
+ * @param {boolean} r
+ * @param {boolean} g
+ * @param {boolean} b
+ * @param {boolean} a
+ */
+ sglrReferenceContext.ReferenceContext.prototype.colorMask = function(r, g, b, a) {
+ this.m_colorMask = [r, g, b, a];
+ };
+
+ /**
+ * @param {boolean} mask
+ */
+ sglrReferenceContext.ReferenceContext.prototype.depthMask = function(mask) {
+ this.m_depthMask = mask;
+ };
+
+ /**
+ * @param {number} mask
+ */
+ sglrReferenceContext.ReferenceContext.prototype.stencilMask = function(mask) {
+ this.stencilMaskSeparate(gl.FRONT_AND_BACK, mask);
+ };
+
+ /**
+ * @param {number} face
+ * @param {number} mask
+ */
+ sglrReferenceContext.ReferenceContext.prototype.stencilMaskSeparate = function(face, mask) {
+ /** @type {boolean} */ var setFront = face == gl.FRONT || face == gl.FRONT_AND_BACK;
+ /** @type {boolean} */ var setBack = face == gl.BACK || face == gl.FRONT_AND_BACK;
+
+ if (this.conditionalSetError(!setFront && !setBack, gl.INVALID_ENUM))
+ return;
+
+ if (setFront) this.m_stencil[rrDefs.FaceType.FACETYPE_FRONT].writeMask = mask;
+ if (setBack) this.m_stencil[rrDefs.FaceType.FACETYPE_BACK].writeMask = mask;
+ };
+
+ /**
+ * @param {sglrReferenceContext.VertexArray} array
+ */
+ sglrReferenceContext.ReferenceContext.prototype.bindVertexArray = function(array) {
+ if (array)
+ this.m_vertexArrayBinding = array;
+ else
+ this.m_vertexArrayBinding = this.m_defaultVAO;
+ };
+
+ /**
+ * @return {sglrReferenceContext.VertexArray}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.createVertexArray = function() { return new sglrReferenceContext.VertexArray(this.m_limits.maxVertexAttribs); };
+
+ /**
+ * @param {number} array
+ */
+ sglrReferenceContext.ReferenceContext.prototype.deleteVertexArray = function(array) {};
+
+ /**
+ * @param {number} index
+ * @param {number} rawSize
+ * @param {number} type
+ * @param {boolean} normalized
+ * @param {number} stride
+ * @param {number} offset
+ */
+ sglrReferenceContext.ReferenceContext.prototype.vertexAttribPointer = function(index, rawSize, type, normalized, stride, offset) {
+ /** @type {boolean} */ var allowBGRA = false;
+ /** @type {number} */ var effectiveSize = rawSize;
+
+ if (this.conditionalSetError(index >= this.m_limits.maxVertexAttribs, gl.INVALID_VALUE))
+ return;
+ if (this.conditionalSetError(effectiveSize <= 0 || effectiveSize > 4, gl.INVALID_VALUE))
+ return;
+ if (this.conditionalSetError(type != gl.BYTE && type != gl.UNSIGNED_BYTE &&
+ type != gl.SHORT && type != gl.UNSIGNED_SHORT &&
+ type != gl.INT && type != gl.UNSIGNED_INT &&
+ type != gl.FLOAT && type != gl.HALF_FLOAT &&
+ type != gl.INT_2_10_10_10_REV && type != gl.UNSIGNED_INT_2_10_10_10_REV, gl.INVALID_ENUM))
+ return;
+ if (this.conditionalSetError(normalized != true && normalized != false, gl.INVALID_ENUM))
+ return;
+ if (this.conditionalSetError(stride < 0, gl.INVALID_VALUE))
+ return;
+ if (this.conditionalSetError((type == gl.INT_2_10_10_10_REV || type == gl.UNSIGNED_INT_2_10_10_10_REV) && effectiveSize != 4, gl.INVALID_OPERATION))
+ return;
+ if (this.conditionalSetError(this.m_vertexArrayBinding != null && this.m_arrayBufferBinding == null && offset != 0, gl.INVALID_OPERATION))
+ return;
+
+ /** @type {?(sglrReferenceContext.VertexArray.VertexAttribArray)} */ var array_ = this.m_vertexArrayBinding.m_arrays[index]; // TODO: fix type
+
+ array_.size = rawSize;
+ array_.stride = stride;
+ array_.type = type;
+ array_.normalized = normalized;
+ array_.integer = false;
+ array_.offset = offset;
+
+ array_.bufferBinding = this.m_arrayBufferBinding;
+ };
+
+ /**
+ * @param {number} index
+ * @param {number} size
+ * @param {number} type
+ * @param {number} stride
+ * @param {number} offset
+ */
+ sglrReferenceContext.ReferenceContext.prototype.vertexAttribIPointer = function(index, size, type, stride, offset) {
+ if (this.conditionalSetError(index >= this.m_limits.maxVertexAttribs, gl.INVALID_VALUE))
+ return;
+ if (this.conditionalSetError(size <= 0 || size > 4, gl.INVALID_VALUE))
+ return;
+ if (this.conditionalSetError(type != gl.BYTE && type != gl.UNSIGNED_BYTE &&
+ type != gl.SHORT && type != gl.UNSIGNED_SHORT &&
+ type != gl.INT && type != gl.UNSIGNED_INT, gl.INVALID_ENUM))
+ return;
+ if (this.conditionalSetError(stride < 0, gl.INVALID_VALUE))
+ return;
+ if (this.conditionalSetError(this.m_vertexArrayBinding != null && this.m_arrayBufferBinding == null && offset != 0, gl.INVALID_OPERATION))
+ return;
+
+ /** @type {?(sglrReferenceContext.VertexArray.VertexAttribArray)} */ var array_ = this.m_vertexArrayBinding.m_arrays[index]; // TODO: fix type
+
+ array_.size = size;
+ array_.stride = stride;
+ array_.type = type;
+ array_.normalized = false;
+ array_.integer = true;
+ array_.offset = offset;
+
+ array_.bufferBinding = this.m_arrayBufferBinding;
+ };
+
+ /**
+ * @param {number} index
+ */
+ sglrReferenceContext.ReferenceContext.prototype.enableVertexAttribArray = function(index) {
+ if (this.conditionalSetError(index >= this.m_limits.maxVertexAttribs, gl.INVALID_VALUE))
+ return;
+
+ this.m_vertexArrayBinding.m_arrays[index].enabled = true;
+ };
+
+ /**
+ * @param {number} index
+ */
+ sglrReferenceContext.ReferenceContext.prototype.disableVertexAttribArray = function(index) {
+ if (this.conditionalSetError(index >= this.m_limits.maxVertexAttribs, gl.INVALID_VALUE))
+ return;
+
+ this.m_vertexArrayBinding.m_arrays[index].enabled = false;
+ };
+
+ /**
+ * @param {number} index
+ * @param {number} divisor
+ */
+ sglrReferenceContext.ReferenceContext.prototype.vertexAttribDivisor = function(index, divisor) {
+ if (this.conditionalSetError(index >= this.m_limits.maxVertexAttribs, gl.INVALID_VALUE))
+ return;
+
+ this.m_vertexArrayBinding.m_arrays[index].divisor = divisor;
+ };
+
+ /**
+ * @param {number} index
+ * @param {number} x
+ */
+ sglrReferenceContext.ReferenceContext.prototype.vertexAttrib1f = function(index, x) {
+ if (this.conditionalSetError(index >= this.m_limits.maxVertexAttribs, gl.INVALID_VALUE))
+ return;
+
+ this.m_currentAttribs[index] = new rrGenericVector.GenericVec4(x, 0, 0, 1);
+ };
+
+ /**
+ * @param {number} index
+ * @param {number} x
+ * @param {number} y
+ */
+ sglrReferenceContext.ReferenceContext.prototype.vertexAttrib2f = function(index, x, y) {
+ if (this.conditionalSetError(index >= this.m_limits.maxVertexAttribs, gl.INVALID_VALUE))
+ return;
+
+ this.m_currentAttribs[index] = new rrGenericVector.GenericVec4(x, y, 0, 1);
+ };
+
+ /**
+ * @param {number} index
+ * @param {number} x
+ * @param {number} y
+ * @param {number} z
+ */
+ sglrReferenceContext.ReferenceContext.prototype.vertexAttrib3f = function(index, x, y, z) {
+ if (this.conditionalSetError(index >= this.m_limits.maxVertexAttribs, gl.INVALID_VALUE))
+ return;
+
+ this.m_currentAttribs[index] = new rrGenericVector.GenericVec4(x, y, z, 1);
+ };
+
+ /**
+ * @param {number} index
+ * @param {number} x
+ * @param {number} y
+ * @param {number} z
+ * @param {number} w
+ */
+ sglrReferenceContext.ReferenceContext.prototype.vertexAttrib4f = function(index, x, y, z, w) {
+ if (this.conditionalSetError(index >= this.m_limits.maxVertexAttribs, gl.INVALID_VALUE))
+ return;
+
+ this.m_currentAttribs[index] = new rrGenericVector.GenericVec4(x, y, z, w);
+ };
+
+ /**
+ * @param {number} index
+ * @param {number} x
+ * @param {number} y
+ * @param {number} z
+ * @param {number} w
+ */
+ sglrReferenceContext.ReferenceContext.prototype.vertexAttribI4i = function(index, x, y, z, w) {
+ if (this.conditionalSetError(index >= this.m_limits.maxVertexAttribs, gl.INVALID_VALUE))
+ return;
+
+ this.m_currentAttribs[index] = new rrGenericVector.GenericVec4(x, y, z, w);
+ };
+
+ /**
+ * @param {number} index
+ * @param {number} x
+ * @param {number} y
+ * @param {number} z
+ * @param {number} w
+ */
+ sglrReferenceContext.ReferenceContext.prototype.vertexAttribI4ui = function(index, x, y, z, w) {
+ if (this.conditionalSetError(index >= this.m_limits.maxVertexAttribs, gl.INVALID_VALUE))
+ return;
+
+ this.m_currentAttribs[index] = new rrGenericVector.GenericVec4(x, y, z, w);
+ };
+
+ /**
+ * @param {sglrShaderProgram.ShaderProgram} program
+ * @param {string} name
+ * @return {number}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.getAttribLocation = function(program, name) {
+ if (this.conditionalSetError(!(program), gl.INVALID_OPERATION))
+ return -1;
+
+ for (var i = 0; i < program.m_attributeNames.length; i++)
+ if (program.m_attributeNames[i] === name)
+ return i;
+
+ return -1;
+ };
+
+ /**
+ * @param {number} pname
+ */
+ sglrReferenceContext.ReferenceContext.prototype.getParameter = function(pname) {
+ switch (pname) {
+ case (gl.VIEWPORT): return new Int32Array(this.m_viewport);
+ case (gl.SCISSOR_BOX): return new Int32Array(this.m_scissorBox);
+ default:
+ throw new Error('Unimplemented');
+ }
+ };
+
+ /**
+ * @param {number} location
+ * @param {gluShaderUtil.DataType} type
+ * @param {Array<number>} value
+ */
+ sglrReferenceContext.ReferenceContext.prototype.uniformValue = function(location, type, value) {
+ if (this.conditionalSetError(!this.m_currentProgram, gl.INVALID_OPERATION))
+ return;
+
+ if (location === null)
+ return;
+
+ /** @type {sglrShaderProgram.Uniform} */ var uniform = this.m_currentProgram.m_uniforms[location];
+
+ if (this.conditionalSetError(!uniform, gl.INVALID_OPERATION))
+ return;
+
+ if (gluShaderUtil.isDataTypeSampler(uniform.type)) {
+ if (this.conditionalSetError(type != gluShaderUtil.DataType.INT, gl.INVALID_OPERATION))
+ return;
+ } else if (this.conditionalSetError(uniform.type != type, gl.INVALID_OPERATION))
+ return;
+ /* TODO: Do we need to copy objects? */
+ uniform.value = value;
+ };
+
+ /**
+ * @param {number} location
+ * @param {number} x
+ */
+ sglrReferenceContext.ReferenceContext.prototype.uniform1f = function(location, x) {
+ return this.uniformValue(location, gluShaderUtil.DataType.FLOAT, [x]);
+ };
+
+ /**
+ * @param {number} location
+ * @param {Array<number>} x
+ */
+ sglrReferenceContext.ReferenceContext.prototype.uniform1fv = function(location, x) {
+ return this.uniformValue(location, gluShaderUtil.DataType.FLOAT, x);
+ };
+
+ /**
+ * @param {number} location
+ * @param {number} x
+ */
+ sglrReferenceContext.ReferenceContext.prototype.uniform1i = function(location, x) {
+ return this.uniformValue(location, gluShaderUtil.DataType.INT, [x]);
+ };
+
+ /**
+ * @param {number} location
+ * @param {Array<number>} x
+ */
+ sglrReferenceContext.ReferenceContext.prototype.uniform1iv = function(location, x) {
+ return this.uniformValue(location, gluShaderUtil.DataType.INT, x);
+ };
+
+ /**
+ * @param {number} location
+ * @param {number} x
+ * @param {number} y
+ */
+ sglrReferenceContext.ReferenceContext.prototype.uniform2f = function(location, x, y) {
+ return this.uniformValue(location, gluShaderUtil.DataType.FLOAT_VEC2, [x, y]);
+ };
+
+ /**
+ * @param {number} location
+ * @param {Array<number>} x
+ */
+ sglrReferenceContext.ReferenceContext.prototype.uniform2fv = function(location, x) {
+ return this.uniformValue(location, gluShaderUtil.DataType.FLOAT_VEC2, x);
+ };
+
+ /**
+ * @param {number} location
+ * @param {number} x
+ * @param {number} y
+ */
+ sglrReferenceContext.ReferenceContext.prototype.uniform2i = function(location, x, y) {
+ return this.uniformValue(location, gluShaderUtil.DataType.INT_VEC2, [x, y]);
+ };
+
+ /**
+ * @param {number} location
+ * @param {Array<number>} x
+ */
+ sglrReferenceContext.ReferenceContext.prototype.uniform2iv = function(location, x) {
+ return this.uniformValue(location, gluShaderUtil.DataType.INT_VEC2, x);
+ };
+
+ /**
+ * @param {number} location
+ * @param {number} x
+ * @param {number} y
+ * @param {number} z
+ */
+ sglrReferenceContext.ReferenceContext.prototype.uniform3f = function(location, x, y, z) {
+ return this.uniformValue(location, gluShaderUtil.DataType.FLOAT_VEC3, [x, y, z]);
+ };
+
+ /**
+ * @param {number} location
+ * @param {Array<number>} x
+ */
+ sglrReferenceContext.ReferenceContext.prototype.uniform3fv = function(location, x) {
+ return this.uniformValue(location, gluShaderUtil.DataType.FLOAT_VEC3, x);
+ };
+
+ /**
+ * @param {number} location
+ * @param {number} x
+ * @param {number} y
+ * @param {number} z
+ */
+ sglrReferenceContext.ReferenceContext.prototype.uniform3i = function(location, x, y, z) {
+ return this.uniformValue(location, gluShaderUtil.DataType.INT_VEC3, [x, y, z]);
+ };
+
+ /**
+ * @param {number} location
+ * @param {Array<number>} x
+ */
+ sglrReferenceContext.ReferenceContext.prototype.uniform3iv = function(location, x) {
+ return this.uniformValue(location, gluShaderUtil.DataType.INT_VEC3, x);
+ };
+
+ /**
+ * @param {number} location
+ * @param {number} x
+ * @param {number} y
+ * @param {number} z
+ * @param {number} w
+ */
+ sglrReferenceContext.ReferenceContext.prototype.uniform4f = function(location, x, y, z, w) {
+ return this.uniformValue(location, gluShaderUtil.DataType.FLOAT_VEC4, [x, y, z, w]);
+ };
+
+ /**
+ * @param {number} location
+ * @param {Array<number>} x
+ */
+ sglrReferenceContext.ReferenceContext.prototype.uniform4fv = function(location, x) {
+ return this.uniformValue(location, gluShaderUtil.DataType.FLOAT_VEC4, x);
+ };
+
+ /**
+ * @param {number} location
+ * @param {number} x
+ * @param {number} y
+ * @param {number} z
+ * @param {number} w
+ */
+ sglrReferenceContext.ReferenceContext.prototype.uniform4i = function(location, x, y, z, w) {
+ return this.uniformValue(location, gluShaderUtil.DataType.INT_VEC4, [x, y, z, w]);
+ };
+
+ /**
+ * @param {number} location
+ * @param {Array<number>} x
+ */
+ sglrReferenceContext.ReferenceContext.prototype.uniform4iv = function(location, x) {
+ return this.uniformValue(location, gluShaderUtil.DataType.INT_VEC4, x);
+ };
+
+ /**
+ * @return {Array<string>}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.getSupportedExtensions = function() {
+ var extensions = gl.getSupportedExtensions(); //TODO: Let's just return gl's supported extensions for now
+ return extensions;
+ };
+
+ /**
+ * @param {string} name
+ * @return {*}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.getExtension = function(name) {
+ return gl.getExtension(name); //TODO: Let's just return gl's supported extensions for now
+ };
+
+ /** transpose matrix 'x' of 'size' columns and rows
+ * @param {number} size
+ * @param {Array<number>} x
+ * @return {Array<number>}
+ */
+ sglrReferenceContext.trans = function(size, x) {
+ /** @type {Array<number>} */ var result = [];
+ for (var row = 0; row < size; ++row)
+ for (var col = 0; col < size; ++col)
+ result[row * size + col] = x[col * size + row];
+
+ return result;
+ };
+
+ /**
+ * @param {number} location
+ * @param {Array<number>} x
+ */
+ sglrReferenceContext.ReferenceContext.prototype.uniformMatrix2fv = function(location, transpose, x) {
+ /* change from column-major to internal row-major if transpose if FALSE */
+ return this.uniformValue(location, gluShaderUtil.DataType.FLOAT_MAT2, !transpose ? sglrReferenceContext.trans(2, x) : x);
+ };
+
+ /**
+ * @param {number} location
+ * @param {Array<number>} x
+ */
+ sglrReferenceContext.ReferenceContext.prototype.uniformMatrix3fv = function(location, transpose, x) {
+ /* change from column-major to internal row-major if transpose if FALSE */
+ return this.uniformValue(location, gluShaderUtil.DataType.FLOAT_MAT3, !transpose ? sglrReferenceContext.trans(3, x) : x);
+ };
+
+ /**
+ * @param {number} location
+ * @param {Array<number>} x
+ */
+ sglrReferenceContext.ReferenceContext.prototype.uniformMatrix4fv = function(location, transpose, x) {
+ /* change from column-major to internal row-major if transpose if FALSE */
+ return this.uniformValue(location, gluShaderUtil.DataType.FLOAT_MAT4, !transpose ? sglrReferenceContext.trans(4, x) : x);
+ };
+
+ /**
+ * @param {sglrShaderProgram.ShaderProgram} program
+ * @param {string} name
+ * @return {number}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.getUniformLocation = function(program, name) {
+ if (this.conditionalSetError(!program, gl.INVALID_OPERATION))
+ return -1;
+
+ for (var i = 0; i < program.m_uniforms.length; i++)
+ if (program.m_uniforms[i].name === name)
+ return i;
+
+ return -1;
+ };
+
+ /**
+ * @param {number} w
+ */
+ sglrReferenceContext.ReferenceContext.prototype.lineWidth = function(w) {
+ if (this.conditionalSetError(w < 0, gl.INVALID_VALUE))
+ return;
+ this.m_lineWidth = w;
+ };
+
+ /**
+ * @param {number} target
+ * @return {boolean}
+ */
+ sglrReferenceContext.isValidBufferTarget = function(target) {
+ switch (target) {
+ case gl.ARRAY_BUFFER:
+ case gl.COPY_READ_BUFFER:
+ case gl.COPY_WRITE_BUFFER:
+ case gl.ELEMENT_ARRAY_BUFFER:
+ case gl.PIXEL_PACK_BUFFER:
+ case gl.PIXEL_UNPACK_BUFFER:
+ case gl.TRANSFORM_FEEDBACK_BUFFER:
+ case gl.UNIFORM_BUFFER:
+ return true;
+
+ default:
+ return false;
+ }
+ };
+
+ /**
+ * @param {number} target
+ * @param {sglrReferenceContext.DataBuffer} buffer
+ * @throws {Error}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.setBufferBinding = function(target, buffer) {
+ switch (target) {
+ case gl.ARRAY_BUFFER: this.m_arrayBufferBinding = buffer; break;
+ case gl.COPY_READ_BUFFER: this.m_copyReadBufferBinding = buffer; break;
+ case gl.COPY_WRITE_BUFFER: this.m_copyWriteBufferBinding = buffer; break;
+ case gl.ELEMENT_ARRAY_BUFFER: this.m_vertexArrayBinding.m_elementArrayBufferBinding = buffer; break;
+ case gl.PIXEL_PACK_BUFFER: this.m_pixelPackBufferBinding = buffer; break;
+ case gl.PIXEL_UNPACK_BUFFER: this.m_pixelUnpackBufferBinding = buffer; break;
+ case gl.TRANSFORM_FEEDBACK_BUFFER: this.m_transformFeedbackBufferBinding = buffer; break;
+ case gl.UNIFORM_BUFFER: this.m_uniformBufferBinding = buffer; break;
+ default:
+ throw new Error('Unrecognized target: ' + target);
+ }
+ };
+
+ /**
+ * @param {number} target
+ * @return {sglrReferenceContext.DataBuffer}
+ * @throws {Error}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.getBufferBinding = function(target) {
+ switch (target) {
+ case gl.ARRAY_BUFFER: return this.m_arrayBufferBinding;
+ case gl.COPY_READ_BUFFER: return this.m_copyReadBufferBinding;
+ case gl.COPY_WRITE_BUFFER: return this.m_copyWriteBufferBinding;
+ case gl.ELEMENT_ARRAY_BUFFER: return this.m_vertexArrayBinding.m_elementArrayBufferBinding;
+ case gl.PIXEL_PACK_BUFFER: return this.m_pixelPackBufferBinding;
+ case gl.PIXEL_UNPACK_BUFFER: return this.m_pixelUnpackBufferBinding;
+ case gl.TRANSFORM_FEEDBACK_BUFFER: return this.m_transformFeedbackBufferBinding;
+ case gl.UNIFORM_BUFFER: return this.m_uniformBufferBinding;
+ default:
+ throw new Error('Unrecognized target: ' + target);
+ }
+ };
+
+ /**
+ * @param {number} target
+ * @param {sglrReferenceContext.DataBuffer} buffer
+ */
+ sglrReferenceContext.ReferenceContext.prototype.bindBuffer = function(target, buffer) {
+ if (this.conditionalSetError(!sglrReferenceContext.isValidBufferTarget(target), gl.INVALID_ENUM))
+ return;
+
+ this.setBufferBinding(target, buffer);
+ };
+
+ /**
+ * @return {sglrReferenceContext.DataBuffer}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.createBuffer = function() { return new sglrReferenceContext.DataBuffer(); };
+
+ /**
+ * @param {number} buffer
+ */
+ sglrReferenceContext.ReferenceContext.prototype.deleteBuffer = function(buffer) {};
+
+ /**
+ * @param {number} target
+ * @param {number|goog.NumberArray} input
+ * @param {number} usage
+ */
+ sglrReferenceContext.ReferenceContext.prototype.bufferData = function(target, input, usage) {
+ if (this.conditionalSetError(!sglrReferenceContext.isValidBufferTarget(target), gl.INVALID_ENUM))
+ return;
+ /** @type {sglrReferenceContext.DataBuffer} */ var buffer = this.getBufferBinding(target);
+ if (this.conditionalSetError(!buffer, gl.INVALID_OPERATION))
+ return;
+
+ if (typeof input == 'number') {
+ if (this.conditionalSetError(input < 0, gl.INVALID_VALUE))
+ return;
+ buffer.setStorage(input);
+ } else {
+ buffer.setData(input);
+ }
+ };
+
+ /**
+ * @param {number} target
+ * @param {number} offset
+ * @param {goog.NumberArray} data
+ */
+ sglrReferenceContext.ReferenceContext.prototype.bufferSubData = function(target, offset, data) {
+ if (this.conditionalSetError(!sglrReferenceContext.isValidBufferTarget(target), gl.INVALID_ENUM))
+ return;
+ if (this.conditionalSetError(offset < 0, gl.INVALID_VALUE))
+ return;
+ /** @type {sglrReferenceContext.DataBuffer} */ var buffer = this.getBufferBinding(target);
+ if (this.conditionalSetError(!buffer, gl.INVALID_OPERATION))
+ return;
+
+ if (this.conditionalSetError(offset + data.byteLength > buffer.getSize(), gl.INVALID_VALUE))
+ return;
+ buffer.setSubData(offset, data);
+ };
+
+ /**
+ * @param {number} x
+ * @param {number} y
+ * @param {number} width
+ * @param {number} height
+ * @param {number} format
+ * @param {number} type
+ * @param {goog.NumberArray} pixels
+ */
+ sglrReferenceContext.ReferenceContext.prototype.readPixels = function(x, y, width, height, format, type, pixels) {
+ /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var src = this.getReadColorbuffer();
+
+ // Map transfer format.
+ /** @type {tcuTexture.TextureFormat} */ var transferFmt = gluTextureUtil.mapGLTransferFormat(format, type);
+
+ // Clamp input values
+ /** @type {number} */ var copyX = deMath.clamp(x, 0, src.raw().getHeight());
+ /** @type {number} */ var copyY = deMath.clamp(y, 0, src.raw().getDepth());
+ /** @type {number} */ var copyWidth = deMath.clamp(width, 0, src.raw().getHeight() - x);
+ /** @type {number} */ var copyHeight = deMath.clamp(height, 0, src.raw().getDepth() - y);
+
+ /** @type {?ArrayBuffer} */ var data;
+ /** @type {number} */ var offset;
+ if (this.m_pixelPackBufferBinding) {
+ if (this.conditionalSetError(typeof pixels !== 'number', gl.INVALID_VALUE))
+ return;
+ data = this.m_pixelPackBufferBinding.getData();
+ offset = pixels.byteOffset;
+ } else {
+ if (pixels instanceof ArrayBuffer) {
+ data = pixels;
+ offset = 0;
+ } else {
+ data = pixels.buffer;
+ offset = pixels.byteOffset;
+ }
+ }
+
+ /** @type {tcuTexture.PixelBufferAccess} */
+ var dst = new tcuTexture.PixelBufferAccess({
+ format: transferFmt,
+ width: width,
+ height: height,
+ depth: 1,
+ rowPitch: deMath.deAlign32(width * transferFmt.getPixelSize(), this.m_pixelPackAlignment),
+ slicePitch: 0,
+ data: data,
+ offset: offset});
+
+ src = src.getSubregion([copyX, copyY, copyWidth, copyHeight]);
+ src.resolveMultisampleColorBuffer(tcuTextureUtil.getSubregion(dst, 0, 0, 0, copyWidth, copyHeight, 1));
+ };
+
+ /**
+ * @return {number}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.getType = function() {
+ return this.m_type;
+ };
+
+ /**
+ * @return {tcuTexture.PixelBufferAccess}
+ */
+ sglrReferenceContext.nullAccess = function() {
+ return new tcuTexture.PixelBufferAccess({
+ width: 0,
+ height: 0});
+ };
+
+ /**
+ * @param {sglrReferenceContext.Framebuffer} framebuffer
+ * @param {sglrReferenceContext.AttachmentPoint} point
+ * @return {tcuTexture.PixelBufferAccess}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.getFboAttachment = function(framebuffer, point) {
+ /** @type {sglrReferenceContext.Attachment} */ var attachment = framebuffer.getAttachment(point);
+
+ switch (attachment.type) {
+ case sglrReferenceContext.AttachmentType.ATTACHMENTTYPE_TEXTURE: {
+ var container = /** @type {sglrReferenceContext.TextureContainer} */ (attachment.object);
+ /** @type {?sglrReferenceContext.TextureType} */ var type = container.getType();
+ var texture = container.texture;
+
+ if (type == sglrReferenceContext.TextureType.TYPE_2D)
+ return texture.getLevel(attachment.level);
+ else if (type == sglrReferenceContext.TextureType.TYPE_CUBE_MAP)
+ return texture.getFace(attachment.level, sglrReferenceContext.texTargetToFace(attachment.texTarget));
+ else if (type == sglrReferenceContext.TextureType.TYPE_2D_ARRAY ||
+ type == sglrReferenceContext.TextureType.TYPE_3D ||
+ type == sglrReferenceContext.TextureType.TYPE_CUBE_MAP_ARRAY) {
+ /** @type {tcuTexture.PixelBufferAccess} */ var level = texture.getLevel(attachment.level);
+
+ return new tcuTexture.PixelBufferAccess({
+ format: level.getFormat(),
+ width: level.getWidth(),
+ height: level.getHeight(),
+ depth: 1,
+ rowPitch: level.getRowPitch(),
+ slicePitch: 0,
+ data: level.getBuffer(),
+ offset: level.getSlicePitch() * attachment.layer});
+ } else
+ return sglrReferenceContext.nullAccess();
+ }
+
+ case sglrReferenceContext.AttachmentType.ATTACHMENTTYPE_RENDERBUFFER: {
+ var rbo = /** @type {sglrReferenceContext.Renderbuffer} */ (attachment.object);
+ return rbo.getAccess();
+ }
+
+ default:
+ return sglrReferenceContext.nullAccess();
+ }
+ };
+
+ /**
+ * @return {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.getReadColorbuffer = function() {
+ if (this.m_readFramebufferBinding)
+ return rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.fromSinglesampleAccess(this.getFboAttachment(this.m_readFramebufferBinding, sglrReferenceContext.AttachmentPoint.ATTACHMENTPOINT_COLOR0));
+ else
+ return this.m_defaultColorbuffer;
+ };
+
+ // sglrReferenceContext.ReferenceContext.prototype.drawArrays = function(mode, first, count) {
+ // this.drawArraysInstanced(mode, first, count, 1);
+ // };
+
+ /**
+ * @param {number} target
+ * @return {number}
+ * @throws {Error}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.checkFramebufferStatus = function(target) {
+ if (this.conditionalSetError(target != gl.FRAMEBUFFER &&
+ target != gl.DRAW_FRAMEBUFFER &&
+ target != gl.READ_FRAMEBUFFER, gl.INVALID_ENUM))
+ return 0;
+
+ // Select binding point.
+ /** @type {sglrReferenceContext.Framebuffer} */ var framebufferBinding = (target == gl.FRAMEBUFFER || target == gl.DRAW_FRAMEBUFFER) ? this.m_drawFramebufferBinding : this.m_readFramebufferBinding;
+
+ // Default framebuffer is always complete.
+ if (!framebufferBinding)
+ return gl.FRAMEBUFFER_COMPLETE;
+
+ /** @type {number} */ var width = -1;
+ /** @type {number} */ var height = -1;
+ /** @type {boolean} */ var hasAttachment = false;
+ /** @type {boolean} */ var attachmentComplete = true;
+ /** @type {boolean} */ var dimensionsOk = true;
+
+ for (var key in sglrReferenceContext.AttachmentPoint) {
+ /** @type {sglrReferenceContext.AttachmentPoint} */ var point = sglrReferenceContext.AttachmentPoint[key];
+ /** @type {sglrReferenceContext.Attachment} */ var attachment = framebufferBinding.getAttachment(point);
+ /** @type {number} */ var attachmentWidth = 0;
+ /** @type {number} */ var attachmentHeight = 0;
+ /** @type {tcuTexture.TextureFormat} */ var attachmentFormat;
+
+ if (attachment.type == sglrReferenceContext.AttachmentType.ATTACHMENTTYPE_TEXTURE) {
+ var container = /** @type {sglrReferenceContext.TextureContainer} */ (attachment.object);
+ /** @type {tcuTexture.ConstPixelBufferAccess} */ var level;
+
+ if (attachment.texTarget == sglrReferenceContext.TexTarget.TEXTARGET_2D) {
+ DE_ASSERT(container.textureType == sglrReferenceContext.TextureType.TYPE_2D);
+ /** @type {sglrReferenceContext.Texture2D} */ var tex2D = /** @type {sglrReferenceContext.Texture2D} */ (container.texture);
+
+ if (tex2D.hasLevel(attachment.level))
+ level = tex2D.getLevel(attachment.level);
+ // TODO: implement CUBE_MAP, 2D_ARRAY, 3D, CUBE_MAP_ARRAY
+ } else if (deMath.deInRange32(attachment.texTarget, sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_POSITIVE_X,
+ sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_NEGATIVE_Z)) {
+ DE_ASSERT(container.textureType == sglrReferenceContext.TextureType.TYPE_CUBE_MAP);
+
+ var texCube = /** @type {sglrReferenceContext.TextureCube} */ (container.texture);
+ var face = sglrReferenceContext.texTargetToFace(attachment.texTarget);
+
+ if (texCube.hasFace(attachment.level, face))
+ level = texCube.getFace(attachment.level, face);
+ } else if (attachment.texTarget == sglrReferenceContext.TexTarget.TEXTARGET_2D_ARRAY) {
+ DE_ASSERT(container.textureType == sglrReferenceContext.TextureType.TYPE_2D_ARRAY);
+ var tex2DArr = /** @type {sglrReferenceContext.Texture2DArray} */ (container.texture);
+
+ if (tex2DArr.hasLevel(attachment.level))
+ level = tex2DArr.getLevel(attachment.level); // \note Slice doesn't matter here.
+ } else if (attachment.texTarget == sglrReferenceContext.TexTarget.TEXTARGET_3D) {
+ DE_ASSERT(container.textureType == sglrReferenceContext.TextureType.TYPE_3D);
+ var tex3D = /** @type {sglrReferenceContext.Texture3D} */ (container.texture);
+
+ if (tex3D.hasLevel(attachment.level))
+ level = tex3D.getLevel(attachment.level); // \note Slice doesn't matter here.
+ // } else if (attachment.texTarget == sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_ARRAY) {
+ // DE_ASSERT(container.textureType == sglrReferenceContext.TextureType.TYPE_CUBE_MAP_ARRAY);
+ // var texCubeArr = container.texture;
+ //
+ // if (texCubeArr.hasLevel(attachment.level))
+ // level = texCubeArr.getLevel(attachment.level); // \note Slice doesn't matter here.
+ } else
+ throw new Error('sglrReferenceContext.Framebuffer attached to a texture but no valid target specified.');
+
+ attachmentWidth = level.getWidth();
+ attachmentHeight = level.getHeight();
+ attachmentFormat = level.getFormat();
+ } else if (attachment.type == sglrReferenceContext.AttachmentType.ATTACHMENTTYPE_RENDERBUFFER) {
+ var renderbuffer = attachment.object;
+
+ attachmentWidth = renderbuffer.getWidth();
+ attachmentHeight = renderbuffer.getHeight();
+ attachmentFormat = renderbuffer.getFormat();
+ } else
+ continue; // Skip rest of checks.
+
+ if (!hasAttachment && attachmentWidth > 0 && attachmentHeight > 0) {
+ width = attachmentWidth;
+ height = attachmentHeight;
+ hasAttachment = true;
+ } else if (attachmentWidth != width || attachmentHeight != height)
+ dimensionsOk = false;
+
+ // Validate attachment point compatibility.
+ switch (attachmentFormat.order) {
+ case tcuTexture.ChannelOrder.R:
+ case tcuTexture.ChannelOrder.RG:
+ case tcuTexture.ChannelOrder.RGB:
+ case tcuTexture.ChannelOrder.RGBA:
+ case tcuTexture.ChannelOrder.sRGB:
+ case tcuTexture.ChannelOrder.sRGBA:
+ if (point != sglrReferenceContext.AttachmentPoint.ATTACHMENTPOINT_COLOR0)
+ attachmentComplete = false;
+ break;
+
+ case tcuTexture.ChannelOrder.D:
+ if (point != sglrReferenceContext.AttachmentPoint.ATTACHMENTPOINT_DEPTH)
+ attachmentComplete = false;
+ break;
+
+ case tcuTexture.ChannelOrder.S:
+ if (point != sglrReferenceContext.AttachmentPoint.ATTACHMENTPOINT_STENCIL)
+ attachmentComplete = false;
+ break;
+
+ case tcuTexture.ChannelOrder.DS:
+ if (point != sglrReferenceContext.AttachmentPoint.ATTACHMENTPOINT_DEPTH &&
+ point != sglrReferenceContext.AttachmentPoint.ATTACHMENTPOINT_STENCIL)
+ attachmentComplete = false;
+ break;
+
+ default:
+ throw new Error('Unsupported attachment channel order:' + attachmentFormat.order);
+ }
+ }
+
+ if (!attachmentComplete)
+ return gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
+ else if (!hasAttachment)
+ return gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT;
+ else if (!dimensionsOk)
+ return gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS;
+ else
+ return gl.FRAMEBUFFER_COMPLETE;
+ };
+
+ /**
+ * @param {number} mode
+ * @return {boolean}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.predrawErrorChecks = function(mode) {
+ if (this.conditionalSetError(mode != gl.POINTS &&
+ mode != gl.LINE_STRIP && mode != gl.LINE_LOOP && mode != gl.LINES &&
+ mode != gl.TRIANGLE_STRIP && mode != gl.TRIANGLE_FAN && mode != gl.TRIANGLES,
+ gl.INVALID_ENUM))
+ return false;
+
+ // \todo [jarkko] Uncomment following code when the buffer mapping support is added
+ //for (size_t ndx = 0; ndx < vao.m_arrays.length; ++ndx)
+ // if (vao.m_arrays[ndx].enabled && vao.m_arrays[ndx].bufferBinding && vao.m_arrays[ndx].bufferBinding->isMapped)
+ // RC_ERROR_RET(gl.INVALID_OPERATION, RC_RET_VOID);
+
+ if (this.conditionalSetError(this.checkFramebufferStatus(gl.DRAW_FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE, gl.INVALID_FRAMEBUFFER_OPERATION))
+ return false;
+
+ return true;
+ };
+
+ /**
+ * Draws quads from vertex arrays
+ * @param {number} mode GL primitive type to draw with.
+ * @param {number} first First vertex to begin drawing with
+ * @param {number} count How many vertices to draw (not counting vertices before first)
+ * @param {number} instanceCount
+ */
+ sglrReferenceContext.ReferenceContext.prototype.drawArraysInstanced = function(mode, first, count, instanceCount) {
+ if (this.conditionalSetError(first < 0 || count < 0 || instanceCount < 0, gl.INVALID_VALUE))
+ return;
+
+ if (!this.predrawErrorChecks(mode))
+ return;
+
+ // All is ok
+ this.drawQuads(mode, first, count, instanceCount);
+ };
+
+ /**
+ * @param {number} mode GL primitive type to draw with.
+ * @param {number} start
+ * @param {number} end
+ * @param {number} count How many vertices to draw (not counting vertices before first)
+ * @param {number} type Data type
+ * @param {number} offset
+ */
+ sglrReferenceContext.ReferenceContext.prototype.drawRangeElements = function(mode, start, end, count, type, offset) {
+ if (this.conditionalSetError(end < start, gl.INVALID_VALUE))
+ return;
+
+ this.drawElements(mode, count, type, offset);
+ };
+
+ /**
+ * @param {number} mode GL primitive type to draw with.
+ * @param {number} count How many vertices to draw (not counting vertices before first)
+ * @param {number} type Data type
+ * @param {number} offset
+ */
+ sglrReferenceContext.ReferenceContext.prototype.drawElements = function(mode, count, type, offset) {
+ this.drawElementsInstanced(mode, count, type, offset, 1);
+ };
+
+ /**
+ * @param {number} mode GL primitive type to draw with.
+ * @param {number} count How many vertices to draw (not counting vertices before first)
+ * @param {number} type Data type
+ * @param {number} offset
+ * @param {number} instanceCount
+ */
+ sglrReferenceContext.ReferenceContext.prototype.drawElementsInstanced = function(mode, count, type, offset, instanceCount) {
+ this.drawElementsInstancedBaseVertex(mode, count, type, offset, instanceCount, 0);
+ };
+
+ /**
+ * @param {number} mode GL primitive type to draw with.
+ * @param {number} count How many vertices to draw (not counting vertices before first)
+ * @param {number} type Data type
+ * @param {number} offset
+ * @param {number} instanceCount
+ * @param {number} baseVertex
+ */
+ sglrReferenceContext.ReferenceContext.prototype.drawElementsInstancedBaseVertex = function(mode, count, type, offset, instanceCount, baseVertex) {
+ var vao = this.m_vertexArrayBinding;
+
+ if (this.conditionalSetError(type != gl.UNSIGNED_BYTE &&
+ type != gl.UNSIGNED_SHORT &&
+ type != gl.UNSIGNED_INT, gl.INVALID_ENUM))
+ return;
+ if (this.conditionalSetError(count < 0 || instanceCount < 0, gl.INVALID_VALUE))
+ return;
+
+ if (!this.predrawErrorChecks(mode))
+ return;
+
+ if (this.conditionalSetError(count > 0 && !vao.m_elementArrayBufferBinding, gl.INVALID_OPERATION))
+ return;
+ // All is ok
+ var data = vao.m_elementArrayBufferBinding.getData();
+ var indices = new rrRenderer.DrawIndices(data, sglrReferenceUtils.mapGLIndexType(type), offset, baseVertex);
+
+ this.drawQuads(mode, indices, count, instanceCount);
+ };
+
+ /**
+ * @param {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} access
+ * @return {Array<number>}
+ */
+ sglrReferenceContext.getBufferRect = function(access) { return [0, 0, access.raw().getHeight(), access.raw().getDepth()]; };
+
+ /**
+ * @return {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.getDrawColorbuffer = function() {
+ if (this.m_drawFramebufferBinding)
+ return rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.fromSinglesampleAccess(this.getFboAttachment(this.m_drawFramebufferBinding, sglrReferenceContext.AttachmentPoint.ATTACHMENTPOINT_COLOR0));
+ return this.m_defaultColorbuffer;
+ };
+
+ /**
+ * @return {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.getDrawDepthbuffer = function() {
+ if (this.m_drawFramebufferBinding)
+ return rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.fromSinglesampleAccess(this.getFboAttachment(this.m_drawFramebufferBinding, sglrReferenceContext.AttachmentPoint.ATTACHMENTPOINT_DEPTH));
+ return this.m_defaultDepthbuffer;
+ };
+
+ /**
+ * @return {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.getDrawStencilbuffer = function() {
+ if (this.m_drawFramebufferBinding)
+ return rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.fromSinglesampleAccess(this.getFboAttachment(this.m_drawFramebufferBinding, sglrReferenceContext.AttachmentPoint.ATTACHMENTPOINT_STENCIL));
+ return this.m_defaultStencilbuffer;
+ };
+
+ /**
+ * @return {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.getReadDepthbuffer = function() {
+ if (this.m_readFramebufferBinding)
+ return rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.fromSinglesampleAccess(this.getFboAttachment(this.m_readFramebufferBinding, sglrReferenceContext.AttachmentPoint.ATTACHMENTPOINT_DEPTH));
+ return this.m_defaultDepthbuffer;
+ };
+
+ /**
+ * @return {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.getReadStencilbuffer = function() {
+ if (this.m_readFramebufferBinding)
+ return rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.fromSinglesampleAccess(this.getFboAttachment(this.m_readFramebufferBinding, sglrReferenceContext.AttachmentPoint.ATTACHMENTPOINT_STENCIL));
+ return this.m_defaultStencilbuffer;
+ };
+
+ /**
+ * @param {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} access
+ * @param {number} s
+ * @param {number} x
+ * @param {number} y
+ * @param {number} depth
+ */
+ sglrReferenceContext.writeDepthOnly = function(access, s, x, y, depth) { access.raw().setPixDepth(depth, s, x, y); };
+
+ /**
+ * @param {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} access
+ * @param {number} s
+ * @param {number} x
+ * @param {number} y
+ * @param {number} stencil
+ * @param {number} writeMask
+ */
+ sglrReferenceContext.writeStencilOnly = function(access, s, x, y, stencil, writeMask) {
+ /** @type {number} */ var oldVal = access.raw().getPixelInt(s, x, y)[3];
+ access.raw().setPixStencil((oldVal & ~writeMask) | (stencil & writeMask), s, x, y);
+ };
+
+ /**
+ * @param {number} bits
+ * @param {number} s
+ * @return {number}
+ */
+ sglrReferenceContext.maskStencil = function(bits, s) { return s & ((1 << bits) - 1); };
+
+ /**
+ * @param {number} buffers
+ */
+ sglrReferenceContext.ReferenceContext.prototype.clear = function(buffers) {
+ if (this.conditionalSetError((buffers & ~(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)) != 0, gl.INVALID_VALUE))
+ return;
+
+ /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var colorBuf0 = this.getDrawColorbuffer();
+ /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var depthBuf = this.getDrawDepthbuffer();
+ /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var stencilBuf = this.getDrawStencilbuffer();
+ /** @type {boolean} */ var hasColor0 = /** @type {!boolean} */ (colorBuf0 && !colorBuf0.isEmpty());
+ /** @type {boolean} */ var hasDepth = /** @type {!boolean} */ (depthBuf && !depthBuf.isEmpty());
+ /** @type {boolean} */ var hasStencil = /** @type {!boolean} */ (stencilBuf && !stencilBuf.isEmpty());
+ /** @type {Array<number>} */ var baseArea = this.m_scissorEnabled ? this.m_scissorBox : [0, 0, 0x7fffffff, 0x7fffffff];
+
+ /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var access;
+ /** @type {boolean} */ var isSharedDepthStencil;
+
+ if (hasColor0 && (buffers & gl.COLOR_BUFFER_BIT) != 0) {
+ /** @type {Array<number>} */ var colorArea = deMath.intersect(baseArea, sglrReferenceContext.getBufferRect(colorBuf0));
+ access = colorBuf0.getSubregion(colorArea);
+ /** @type {boolean} */ var isSRGB = colorBuf0.raw().getFormat().isSRGB();
+ /** @type {Array<number>} */ var c = (isSRGB && this.m_sRGBUpdateEnabled) ? tcuTextureUtil.linearToSRGB(this.m_clearColor) : this.m_clearColor;
+ /** @type {boolean} */ var maskUsed = !this.m_colorMask[0] || !this.m_colorMask[1] || !this.m_colorMask[2] || !this.m_colorMask[3];
+ /** @type {boolean} */ var maskZero = !this.m_colorMask[0] && !this.m_colorMask[1] && !this.m_colorMask[2] && !this.m_colorMask[3];
+
+ if (!maskUsed)
+ access.clear(c);
+ else if (!maskZero) {
+ for (var y = 0; y < access.raw().getDepth(); y++)
+ for (var x = 0; x < access.raw().getHeight(); x++)
+ for (var s = 0; s < access.getNumSamples(); s++)
+ access.raw().setPixel(tcuTextureUtil.select(c, access.raw().getPixel(s, x, y), this.m_colorMask), s, x, y);
+ }
+ // else all channels masked out
+ }
+
+ if (hasDepth && (buffers & gl.DEPTH_BUFFER_BIT) != 0 && this.m_depthMask) {
+ /** @type {Array<number>} */ var depthArea = deMath.intersect(baseArea, sglrReferenceContext.getBufferRect(depthBuf));
+ access = depthBuf.getSubregion(depthArea);
+ isSharedDepthStencil = depthBuf.raw().getFormat().order != tcuTexture.ChannelOrder.D;
+
+ if (isSharedDepthStencil) {
+ // Slow path where stencil is masked out in write.
+ for (var y = 0; y < access.raw().getDepth(); y++)
+ for (var x = 0; x < access.raw().getHeight(); x++)
+ for (var s = 0; s < access.getNumSamples(); s++)
+ sglrReferenceContext.writeDepthOnly(access, s, x, y, this.m_clearDepth);
+ } else
+ access.clear([this.m_clearDepth, 0, 0, 0]);
+ }
+
+ if (hasStencil && (buffers & gl.STENCIL_BUFFER_BIT) != 0) {
+ /** @type {Array<number>} */ var stencilArea = deMath.intersect(baseArea, sglrReferenceContext.getBufferRect(stencilBuf));
+ access = stencilBuf.getSubregion(stencilArea);
+ /** @type {number} */ var stencilBits = stencilBuf.raw().getFormat().getNumStencilBits();
+ /** @type {number} */ var stencil = sglrReferenceContext.maskStencil(stencilBits, this.m_clearStencil);
+ isSharedDepthStencil = stencilBuf.raw().getFormat().order != tcuTexture.ChannelOrder.S;
+
+ if (isSharedDepthStencil || ((this.m_stencil[rrDefs.FaceType.FACETYPE_FRONT].writeMask & ((1 << stencilBits) - 1)) != ((1 << stencilBits) - 1))) {
+ // Slow path where depth or stencil is masked out in write.
+ for (var y = 0; y < access.raw().getDepth(); y++)
+ for (var x = 0; x < access.raw().getHeight(); x++)
+ for (var s = 0; s < access.getNumSamples(); s++)
+ sglrReferenceContext.writeStencilOnly(access, s, x, y, stencil, this.m_stencil[rrDefs.FaceType.FACETYPE_FRONT].writeMask);
+ } else
+ access.clear([0, 0, 0, stencil]);
+ }
+ };
+
+ /**
+ * @param {number} buffer
+ * @param {number} drawbuffer
+ * @param {Array<number>} value
+ * @throws {Error}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.clearBufferiv = function(buffer, drawbuffer, value) {
+ if (this.conditionalSetError(buffer != gl.COLOR && buffer != gl.STENCIL, gl.INVALID_ENUM))
+ return;
+ if (this.conditionalSetError(drawbuffer != 0, gl.INVALID_VALUE))
+ return;
+
+ /** @type {Array<number>} */ var baseArea = this.m_scissorEnabled ? this.m_scissorBox : [0, 0, 0x7fffffff, 0x7fffffff];
+
+ /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var access;
+
+ if (buffer == gl.COLOR) {
+ /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var colorBuf = this.getDrawColorbuffer();
+ /** @type {boolean} */ var maskUsed = !this.m_colorMask[0] || !this.m_colorMask[1] || !this.m_colorMask[2] || !this.m_colorMask[3];
+ /** @type {boolean} */ var maskZero = !this.m_colorMask[0] && !this.m_colorMask[1] && !this.m_colorMask[2] && !this.m_colorMask[3];
+
+ if (!colorBuf.isEmpty() && !maskZero) {
+ /** @type {Array<number>} */ var colorArea = deMath.intersect(baseArea, sglrReferenceContext.getBufferRect(colorBuf));
+ access = colorBuf.getSubregion(colorArea);
+
+ if (!maskUsed)
+ access.clear(value);
+ else {
+ for (var y = 0; y < access.raw().getDepth(); y++)
+ for (var x = 0; x < access.raw().getHeight(); x++)
+ for (var s = 0; s < access.getNumSamples(); s++)
+ access.raw().setPixel(tcuTextureUtil.select(value, access.raw().getPixel(s, x, y), this.m_colorMask), s, x, y);
+ }
+ }
+ } else {
+ if (buffer !== gl.STENCIL)
+ throw new Error('Unexpected buffer type: ' + buffer);
+
+ /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var stencilBuf = this.getDrawStencilbuffer();
+
+ if (!stencilBuf.isEmpty() && this.m_stencil[rrDefs.FaceType.FACETYPE_FRONT].writeMask != 0) {
+ /** @type {Array<number>} */ var area = deMath.intersect(baseArea, sglrReferenceContext.getBufferRect(stencilBuf));
+ access = stencilBuf.getSubregion(area);
+ /** @type {number} */ var stencil = value[0];
+
+ for (var y = 0; y < access.raw().getDepth(); y++)
+ for (var x = 0; x < access.raw().getHeight(); x++)
+ for (var s = 0; s < access.getNumSamples(); s++)
+ sglrReferenceContext.writeStencilOnly(access, s, x, y, stencil, this.m_stencil[rrDefs.FaceType.FACETYPE_FRONT].writeMask);
+ }
+ }
+ };
+
+ /**
+ * @param {number} buffer
+ * @param {number} drawbuffer
+ * @param {Array<number>} value
+ * @throws {Error}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.clearBufferfv = function(buffer, drawbuffer, value) {
+ if (this.conditionalSetError(buffer != gl.COLOR && buffer != gl.DEPTH, gl.INVALID_ENUM))
+ return;
+ if (this.conditionalSetError(drawbuffer != 0, gl.INVALID_VALUE))
+ return;
+
+ /** @type {Array<number>} */ var baseArea = this.m_scissorEnabled ? this.m_scissorBox : [0, 0, 0x7fffffff, 0x7fffffff];
+ /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var access;
+ if (buffer == gl.COLOR) {
+ /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var colorBuf = this.getDrawColorbuffer();
+ /** @type {boolean} */ var maskUsed = !this.m_colorMask[0] || !this.m_colorMask[1] || !this.m_colorMask[2] || !this.m_colorMask[3];
+ /** @type {boolean} */ var maskZero = !this.m_colorMask[0] && !this.m_colorMask[1] && !this.m_colorMask[2] && !this.m_colorMask[3];
+
+ if (!colorBuf.isEmpty() && !maskZero) {
+ /** @type {Array<number>} */ var colorArea = deMath.intersect(baseArea, sglrReferenceContext.getBufferRect(colorBuf));
+ access = colorBuf.getSubregion(colorArea);
+ var color = value;
+
+ if (this.m_sRGBUpdateEnabled && access.raw().getFormat().isSRGB())
+ color = tcuTextureUtil.linearToSRGB(color);
+
+ if (!maskUsed)
+ access.clear(color);
+ else {
+ for (var y = 0; y < access.raw().getDepth(); y++)
+ for (var x = 0; x < access.raw().getHeight(); x++)
+ for (var s = 0; s < access.getNumSamples(); s++)
+ access.raw().setPixel(tcuTextureUtil.select(color, access.raw().getPixel(s, x, y), this.m_colorMask), s, x, y);
+ }
+ }
+ } else {
+ if (buffer !== gl.DEPTH)
+ throw new Error('Unexpected buffer type: ' + buffer);
+
+ /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var depthBuf = this.getDrawDepthbuffer();
+
+ if (!depthBuf.isEmpty() && this.m_depthMask) {
+ /** @type {Array<number>} */ var area = deMath.intersect(baseArea, sglrReferenceContext.getBufferRect(depthBuf));
+ access = depthBuf.getSubregion(area);
+ /** @type {number} */ var depth = value[0];
+
+ for (var y = 0; y < access.raw().getDepth(); y++)
+ for (var x = 0; x < access.raw().getHeight(); x++)
+ for (var s = 0; s < access.getNumSamples(); s++)
+ sglrReferenceContext.writeDepthOnly(access, s, x, y, depth);
+ }
+ }
+ };
+
+ /**
+ * @param {number} buffer
+ * @param {number} drawbuffer
+ * @param {Array<number>} value
+ */
+ sglrReferenceContext.ReferenceContext.prototype.clearBufferuiv = function(buffer, drawbuffer, value) {
+ if (this.conditionalSetError(buffer != gl.COLOR, gl.INVALID_ENUM))
+ return;
+ if (this.conditionalSetError(drawbuffer != 0, gl.INVALID_VALUE))
+ return;
+
+ /** @type {Array<number>} */ var baseArea = this.m_scissorEnabled ? this.m_scissorBox : [0, 0, 0x7fffffff, 0x7fffffff];
+
+ /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var colorBuf = this.getDrawColorbuffer();
+ /** @type {boolean} */ var maskUsed = !this.m_colorMask[0] || !this.m_colorMask[1] || !this.m_colorMask[2] || !this.m_colorMask[3];
+ /** @type {boolean} */ var maskZero = !this.m_colorMask[0] && !this.m_colorMask[1] && !this.m_colorMask[2] && !this.m_colorMask[3];
+
+ if (!colorBuf.isEmpty() && !maskZero) {
+ /** @type {Array<number>} */ var colorArea = deMath.intersect(baseArea, sglrReferenceContext.getBufferRect(colorBuf));
+ /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var access = colorBuf.getSubregion(colorArea);
+
+ if (!maskUsed)
+ access.clear(value);
+ else {
+ for (var y = 0; y < access.raw().getDepth(); y++)
+ for (var x = 0; x < access.raw().getHeight(); x++)
+ for (var s = 0; s < access.getNumSamples(); s++)
+ access.raw().setPixel(tcuTextureUtil.select(value, access.raw().getPixel(s, x, y), this.m_colorMask), s, x, y);
+ }
+ }
+ };
+
+ /**
+ * @param {number} buffer
+ * @param {number} drawbuffer
+ * @param {number} depth
+ * @param {number} stencil
+ */
+ sglrReferenceContext.ReferenceContext.prototype.clearBufferfi = function(buffer, drawbuffer, depth, stencil) {
+ if (this.conditionalSetError(buffer != gl.DEPTH_STENCIL, gl.INVALID_ENUM))
+ return;
+ this.clearBufferfv(gl.DEPTH, drawbuffer, [depth]);
+ this.clearBufferiv(gl.STENCIL, drawbuffer, [stencil]);
+ };
+
+ /**
+ * @param {number} target
+ * @param {number} attachment
+ * @param {sglrReferenceContext.TexTarget} textarget
+ * @param {sglrReferenceContext.TextureContainer} texture
+ * @param {number} level
+ * @throws {Error}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.framebufferTexture2D = function(target, attachment, textarget, texture, level) {
+ if (attachment == gl.DEPTH_STENCIL_ATTACHMENT) {
+ // Attach to both depth and stencil.
+ this.framebufferTexture2D(target, gl.DEPTH_ATTACHMENT, textarget, texture, level);
+ this.framebufferTexture2D(target, gl.STENCIL_ATTACHMENT, textarget, texture, level);
+ } else {
+ /** @type {sglrReferenceContext.AttachmentPoint} */ var point = sglrReferenceContext.mapGLAttachmentPoint(attachment);
+ /** @type {sglrReferenceContext.TexTarget} */ var fboTexTarget = sglrReferenceContext.mapGLFboTexTarget(textarget);
+
+ if (this.conditionalSetError(target != gl.FRAMEBUFFER &&
+ target != gl.DRAW_FRAMEBUFFER &&
+ target != gl.READ_FRAMEBUFFER, gl.INVALID_ENUM))
+ return;
+ if (this.conditionalSetError(point == undefined, gl.INVALID_ENUM))
+ return;
+
+ // Select binding point.
+ /** @type {sglrReferenceContext.Framebuffer} */ var framebufferBinding = (target == gl.FRAMEBUFFER || target == gl.DRAW_FRAMEBUFFER) ? this.m_drawFramebufferBinding : this.m_readFramebufferBinding;
+ if (this.conditionalSetError(!framebufferBinding, gl.INVALID_OPERATION))
+ return;
+
+ if (texture) {
+ if (this.conditionalSetError(level != 0, gl.INVALID_VALUE))
+ return;
+
+ if (texture.getType() == sglrReferenceContext.TextureType.TYPE_2D) {
+ if (this.conditionalSetError(fboTexTarget != sglrReferenceContext.TexTarget.TEXTARGET_2D, gl.INVALID_OPERATION))
+ return;
+ } else {
+ if (!texture.getType() == sglrReferenceContext.TextureType.TYPE_CUBE_MAP)
+ throw new Error('Unsupported texture type');
+ if (this.conditionalSetError(!deMath.deInRange32(fboTexTarget, sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_POSITIVE_X, sglrReferenceContext.TexTarget.TEXTARGET_CUBE_MAP_NEGATIVE_Z), gl.INVALID_OPERATION))
+ return;
+ }
+ }
+
+ /** @type {sglrReferenceContext.Attachment} */ var fboAttachment = new sglrReferenceContext.Attachment();
+
+ if (texture) {
+ fboAttachment.type = sglrReferenceContext.AttachmentType.ATTACHMENTTYPE_TEXTURE;
+ fboAttachment.object = texture;
+ fboAttachment.texTarget = fboTexTarget;
+ fboAttachment.level = level;
+ }
+ framebufferBinding.setAttachment(point, fboAttachment);
+ }
+ };
+
+ /**
+ * @param {number} target
+ * @param {number} attachment
+ * @param {sglrReferenceContext.TextureContainer} texture
+ * @param {number} level
+ * @param {number} layer
+ * @throws {Error}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.framebufferTextureLayer = function(target, attachment, texture, level, layer) {
+ if (attachment == gl.DEPTH_STENCIL_ATTACHMENT) {
+ // Attach to both depth and stencil.
+ this.framebufferTextureLayer(target, gl.DEPTH_ATTACHMENT, texture, level, layer);
+ this.framebufferTextureLayer(target, gl.STENCIL_ATTACHMENT, texture, level, layer);
+ } else {
+ /** @type {sglrReferenceContext.AttachmentPoint} */ var point = sglrReferenceContext.mapGLAttachmentPoint(attachment);
+
+ if (this.conditionalSetError(target != gl.FRAMEBUFFER &&
+ target != gl.DRAW_FRAMEBUFFER &&
+ target != gl.READ_FRAMEBUFFER, gl.INVALID_ENUM))
+ return;
+ if (this.conditionalSetError(point === undefined, gl.INVALID_ENUM))
+ return;
+
+ // Select binding point.
+ /** @type {sglrReferenceContext.Framebuffer} */ var framebufferBinding = (target == gl.FRAMEBUFFER || target == gl.DRAW_FRAMEBUFFER) ? this.m_drawFramebufferBinding : this.m_readFramebufferBinding;
+ if (this.conditionalSetError(!framebufferBinding, gl.INVALID_OPERATION))
+ return;
+
+ if (texture) {
+ if (this.conditionalSetError(level != 0, gl.INVALID_VALUE))
+ return;
+
+ if (this.conditionalSetError(texture.getType() != sglrReferenceContext.TextureType.TYPE_2D_ARRAY &&
+ texture.getType() != sglrReferenceContext.TextureType.TYPE_3D &&
+ texture.getType() != sglrReferenceContext.TextureType.TYPE_CUBE_MAP_ARRAY, gl.INVALID_OPERATION))
+ return;
+
+ if (texture.getType() == sglrReferenceContext.TextureType.TYPE_2D_ARRAY || texture.getType() == sglrReferenceContext.TextureType.TYPE_CUBE_MAP_ARRAY) {
+ if (this.conditionalSetError((layer < 0) || (layer >= gl.MAX_ARRAY_TEXTURE_LAYERS), gl.INVALID_VALUE))
+ return;
+ if (this.conditionalSetError((level < 0) || (level > Math.floor(Math.log2(gl.MAX_TEXTURE_SIZE))), gl.INVALID_VALUE))
+ return;
+ } else if (texture.getType() == sglrReferenceContext.TextureType.TYPE_3D) {
+ if (this.conditionalSetError((layer < 0) || (layer >= gl.MAX_3D_TEXTURE_SIZE), gl.INVALID_VALUE))
+ return;
+ if (this.conditionalSetError((level < 0) || (level > Math.floor(Math.log2(gl.MAX_3D_TEXTURE_SIZE))), gl.INVALID_VALUE))
+ return;
+ }
+ }
+
+ /** @type {sglrReferenceContext.Attachment} */ var fboAttachment = new sglrReferenceContext.Attachment();
+
+ if (texture) {
+ fboAttachment.type = sglrReferenceContext.AttachmentType.ATTACHMENTTYPE_TEXTURE;
+ fboAttachment.object = texture;
+ fboAttachment.texTarget = sglrReferenceContext.texLayeredTypeToTarget(texture.getType());
+ fboAttachment.level = level;
+ fboAttachment.layer = layer;
+ }
+ framebufferBinding.setAttachment(point, fboAttachment);
+
+ }
+ };
+
+ /**
+ * @param {number} target
+ * @param {number} attachment
+ * @param {number} renderbuffertarget
+ * @param {sglrReferenceContext.Renderbuffer} renderbuffer
+ */
+ sglrReferenceContext.ReferenceContext.prototype.framebufferRenderbuffer = function(target, attachment, renderbuffertarget, renderbuffer) {
+ if (attachment == gl.DEPTH_STENCIL_ATTACHMENT) {
+ // Attach both to depth and stencil.
+ this.framebufferRenderbuffer(target, gl.DEPTH_ATTACHMENT, renderbuffertarget, renderbuffer);
+ this.framebufferRenderbuffer(target, gl.STENCIL_ATTACHMENT, renderbuffertarget, renderbuffer);
+ } else {
+ /** @type {sglrReferenceContext.AttachmentPoint} */ var point = sglrReferenceContext.mapGLAttachmentPoint(attachment);
+
+ if (this.conditionalSetError(target != gl.FRAMEBUFFER &&
+ target != gl.DRAW_FRAMEBUFFER &&
+ target != gl.READ_FRAMEBUFFER, gl.INVALID_ENUM))
+ return;
+ if (this.conditionalSetError(point == undefined, gl.INVALID_ENUM))
+ return;
+
+ // Select binding point.
+ /** @type {sglrReferenceContext.Framebuffer} */ var framebufferBinding = (target == gl.FRAMEBUFFER || target == gl.DRAW_FRAMEBUFFER) ? this.m_drawFramebufferBinding : this.m_readFramebufferBinding;
+ if (this.conditionalSetError(!framebufferBinding, gl.INVALID_OPERATION))
+ return;
+
+ if (renderbuffer) {
+ if (this.conditionalSetError(renderbuffertarget != gl.RENDERBUFFER, gl.INVALID_ENUM))
+ return;
+ }
+
+ /** @type {sglrReferenceContext.Attachment} */ var fboAttachment = new sglrReferenceContext.Attachment();
+
+ if (renderbuffer) {
+ fboAttachment.type = sglrReferenceContext.AttachmentType.ATTACHMENTTYPE_RENDERBUFFER;
+ fboAttachment.object = renderbuffer;
+ }
+ framebufferBinding.setAttachment(point, fboAttachment);
+ }
+ };
+
+ /**
+ * @param {number} target
+ * @param {number} internalformat
+ * @param {number} width
+ * @param {number} height
+ */
+ sglrReferenceContext.ReferenceContext.prototype.renderbufferStorage = function(target, internalformat, width, height) {
+ /** @type {tcuTexture.TextureFormat} */ var format = gluTextureUtil.mapGLInternalFormat(internalformat);
+
+ if (this.conditionalSetError(target != gl.RENDERBUFFER, gl.INVALID_ENUM))
+ return;
+ if (this.conditionalSetError(!this.m_renderbufferBinding, gl.INVALID_OPERATION))
+ return;
+ if (this.conditionalSetError(!deMath.deInRange32(width, 0, this.m_limits.maxRenderbufferSize) ||
+ !deMath.deInRange32(height, 0, this.m_limits.maxRenderbufferSize),
+ gl.INVALID_OPERATION))
+ return;
+ if (this.conditionalSetError(!format, gl.INVALID_ENUM))
+ return;
+
+ this.m_renderbufferBinding.setStorage(format, width, height);
+ };
+
+ /**
+ * @param {number} target
+ * @param {number} samples
+ * @param {number} internalformat
+ * @param {number} width
+ * @param {number} height
+ */
+ sglrReferenceContext.ReferenceContext.prototype.renderbufferStorageMultisample = function(target, samples, internalformat, width, height) {
+ this.renderbufferStorage(target, internalformat, width, height);
+ };
+
+ /**
+ * @param {rrRenderer.PrimitiveType} derivedType
+ * @return {rrRenderer.PrimitiveType}
+ * @throws {Error}
+ */
+ sglrReferenceContext.getPrimitiveBaseType = function(derivedType) {
+ switch (derivedType) {
+ case rrRenderer.PrimitiveType.TRIANGLES:
+ case rrRenderer.PrimitiveType.TRIANGLE_STRIP:
+ case rrRenderer.PrimitiveType.TRIANGLE_FAN:
+ return rrRenderer.PrimitiveType.TRIANGLES;
+
+ case rrRenderer.PrimitiveType.LINES:
+ case rrRenderer.PrimitiveType.LINE_STRIP:
+ case rrRenderer.PrimitiveType.LINE_LOOP:
+ return rrRenderer.PrimitiveType.LINES;
+
+ case rrRenderer.PrimitiveType.POINTS:
+ return rrRenderer.PrimitiveType.POINTS;
+
+ default:
+ throw new Error('Unrecognized primitive type:' + derivedType);
+ }
+ };
+
+ /**
+ * createProgram
+ * @param {sglrShaderProgram.ShaderProgram} program
+ * @return {sglrShaderProgram.ShaderProgram}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.createProgram = function(program) {
+ return program;
+ };
+
+ /**
+ * deleteProgram
+ * @param {sglrShaderProgram.ShaderProgram} program
+ */
+ sglrReferenceContext.ReferenceContext.prototype.deleteProgram = function(program) {};
+
+ /**
+ * @param {sglrShaderProgram.ShaderProgram} program
+ */
+ sglrReferenceContext.ReferenceContext.prototype.useProgram = function(program) {
+ this.m_currentProgram = program;
+ };
+
+ /**
+ * Draws quads from vertex arrays
+ * @param {number} primitive GL primitive type to draw with.
+ * @param {number} first First vertex to begin drawing with
+ * @param {number} count How many vertices to draw (not counting vertices before first)
+ */
+ sglrReferenceContext.ReferenceContext.prototype.drawArrays = function(primitive, first, count) {
+ this.drawQuads(primitive, first, count, 1);
+ };
+
+ /**
+ * Draws quads from vertex arrays
+ * @param {number} primitive GL primitive type to draw with.
+ * @param {(number|rrRenderer.DrawIndices)} first First vertex to begin drawing with
+ * @param {number} count Number of vertices
+ * @param {number=} instances Number of instances
+ */
+ sglrReferenceContext.ReferenceContext.prototype.drawQuads = function(primitive, first, count, instances) {
+ // undefined results
+ if (!this.m_currentProgram)
+ return;
+
+ if (typeof instances === 'undefined')
+ instances = 1;
+
+ /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var colorBuf0 = this.getDrawColorbuffer();
+ /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var depthBuf = this.getDrawDepthbuffer();
+ /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var stencilBuf = this.getDrawStencilbuffer();
+ /** @type {boolean} */ var hasStencil = /** @type {!boolean} */ (stencilBuf && !stencilBuf.isEmpty());
+ /** @type {number} */ var stencilBits = (hasStencil) ? stencilBuf.raw().getFormat().getNumStencilBits() : 0;
+
+ /** @type {rrRenderer.RenderTarget} */ var renderTarget = new rrRenderer.RenderTarget(colorBuf0,
+ depthBuf,
+ stencilBuf);
+ /** @type {sglrShaderProgram.ShaderProgram} */ var program = this.m_currentProgram;
+
+ /*new rrRenderer.Program(
+ * this.m_currentProgram.getVertexShader(),
+ * this.m_currentProgram.getFragmentShader());*/
+
+ /** @type {rrRenderState.ViewportState} */ var viewportState = new rrRenderState.ViewportState(colorBuf0);
+ /** @type {rrRenderState.RenderState} */ var state = new rrRenderState.RenderState(viewportState);
+
+ /** @type {Array<rrVertexAttrib.VertexAttrib>} */ var vertexAttribs = [];
+
+ // Gen state
+ /** @type {rrRenderer.PrimitiveType} */ var baseType = rrRenderer.PrimitiveType.TRIANGLES;
+ /** @type {boolean} */ var polygonOffsetEnabled =
+ (baseType == rrRenderer.PrimitiveType.TRIANGLES) ?
+ (this.m_polygonOffsetFillEnabled) :
+ (false);
+
+ //state.cullMode = m_cullMode
+
+ state.fragOps.scissorTestEnabled = this.m_scissorEnabled;
+ state.fragOps.scissorRectangle = new rrRenderState.WindowRectangle(this.m_scissorBox);
+
+ state.fragOps.numStencilBits = stencilBits;
+ state.fragOps.stencilTestEnabled = this.m_stencilTestEnabled;
+
+ for (var key in rrDefs.FaceType) {
+ /** @type {number} */ var faceType = rrDefs.FaceType[key];
+ state.fragOps.stencilStates[faceType].compMask = this.m_stencil[faceType].opMask;
+ state.fragOps.stencilStates[faceType].writeMask = this.m_stencil[faceType].writeMask;
+ state.fragOps.stencilStates[faceType].ref = this.m_stencil[faceType].ref;
+ state.fragOps.stencilStates[faceType].func = sglrReferenceUtils.mapGLTestFunc(this.m_stencil[faceType].func);
+ state.fragOps.stencilStates[faceType].sFail = sglrReferenceUtils.mapGLStencilOp(this.m_stencil[faceType].opStencilFail);
+ state.fragOps.stencilStates[faceType].dpFail = sglrReferenceUtils.mapGLStencilOp(this.m_stencil[faceType].opDepthFail);
+ state.fragOps.stencilStates[faceType].dpPass = sglrReferenceUtils.mapGLStencilOp(this.m_stencil[faceType].opDepthPass);
+ }
+
+ state.fragOps.depthTestEnabled = this.m_depthTestEnabled;
+ state.fragOps.depthFunc = sglrReferenceUtils.mapGLTestFunc(this.m_depthFunc);
+ state.fragOps.depthMask = this.m_depthMask;
+
+ state.fragOps.blendMode = this.m_blendEnabled ? rrRenderState.BlendMode.STANDARD : rrRenderState.BlendMode.NONE;
+ state.fragOps.blendRGBState.equation = sglrReferenceUtils.mapGLBlendEquation(this.m_blendModeRGB);
+ state.fragOps.blendRGBState.srcFunc = sglrReferenceUtils.mapGLBlendFunc(this.m_blendFactorSrcRGB);
+ state.fragOps.blendRGBState.dstFunc = sglrReferenceUtils.mapGLBlendFunc(this.m_blendFactorDstRGB);
+ state.fragOps.blendAState.equation = sglrReferenceUtils.mapGLBlendEquation(this.m_blendModeAlpha);
+ state.fragOps.blendAState.srcFunc = sglrReferenceUtils.mapGLBlendFunc(this.m_blendFactorSrcAlpha);
+ state.fragOps.blendAState.dstFunc = sglrReferenceUtils.mapGLBlendFunc(this.m_blendFactorDstAlpha);
+ state.fragOps.blendColor = this.m_blendColor;
+
+ state.fragOps.colorMask = this.m_colorMask;
+
+ state.viewport.rect = new rrRenderState.WindowRectangle(this.m_viewport);
+ state.viewport.zn = this.m_depthRangeNear;
+ state.viewport.zf = this.m_depthRangeFar;
+
+ //state.point.pointSize = this.m_pointSize;
+ state.line.lineWidth = this.m_lineWidth;
+
+ state.fragOps.polygonOffsetEnabled = polygonOffsetEnabled;
+ state.fragOps.polygonOffsetFactor = this.m_polygonOffsetFactor;
+ state.fragOps.polygonOffsetUnits = this.m_polygonOffsetUnits;
+
+ state.provokingVertexConvention = (this.m_provokingFirstVertexConvention) ? (rrDefs.ProvokingVertex.PROVOKINGVERTEX_FIRST) : (rrDefs.ProvokingVertex.PROVOKINGVERTEX_LAST);
+
+ // gen attributes
+ /** @type {sglrReferenceContext.VertexArray} */ var vao = this.m_vertexArrayBinding;
+ for (var ndx = 0; ndx < vao.m_arrays.length; ++ndx) {
+ vertexAttribs[ndx] = new rrVertexAttrib.VertexAttrib();
+ if (!vao.m_arrays[ndx].enabled) {
+ vertexAttribs[ndx].type = rrVertexAttrib.VertexAttribType.DONT_CARE; // reading with wrong type is allowed, but results are undefined
+ vertexAttribs[ndx].generic = this.m_currentAttribs[ndx];
+ } else {
+ vertexAttribs[ndx].type = (vao.m_arrays[ndx].integer) ?
+ (sglrReferenceUtils.mapGLPureIntegerVertexAttributeType(vao.m_arrays[ndx].type)) :
+ (sglrReferenceUtils.mapGLFloatVertexAttributeType(vao.m_arrays[ndx].type, vao.m_arrays[ndx].normalized, vao.m_arrays[ndx].size));
+ vertexAttribs[ndx].size = sglrReferenceUtils.mapGLSize(vao.m_arrays[ndx].size);
+ vertexAttribs[ndx].stride = vao.m_arrays[ndx].stride;
+ vertexAttribs[ndx].instanceDivisor = vao.m_arrays[ndx].divisor;
+ vertexAttribs[ndx].pointer = vao.m_arrays[ndx].bufferBinding.getData();
+ vertexAttribs[ndx].offset = vao.m_arrays[ndx].offset;
+ vertexAttribs[ndx].componentCount = vao.m_arrays[ndx].size;
+ }
+ }
+
+ // Set shader samplers
+ for (var uniformNdx = 0; uniformNdx < this.m_currentProgram.m_uniforms.length; ++uniformNdx) {
+ /** @type {number} */ var texNdx = this.m_currentProgram.m_uniforms[uniformNdx].value[0];
+
+ switch (this.m_currentProgram.m_uniforms[uniformNdx].type) {
+ case gluShaderUtil.DataType.SAMPLER_2D:
+ case gluShaderUtil.DataType.UINT_SAMPLER_2D:
+ case gluShaderUtil.DataType.INT_SAMPLER_2D: {
+ /** @type {sglrReferenceContext.Texture2D} */ var tex;
+
+ if (texNdx >= 0 && texNdx < this.m_textureUnits.length)
+ tex = /** @type {sglrReferenceContext.Texture2D} */ (this.m_textureUnits[texNdx].tex2DBinding.texture);
+
+ if (tex && tex.isComplete()) {
+ tex.updateView();
+ this.m_currentProgram.m_uniforms[uniformNdx].sampler = tex;
+ } else
+ this.m_currentProgram.m_uniforms[uniformNdx].sampler = this.m_emptyTex2D.texture;
+
+ break;
+ }
+ case gluShaderUtil.DataType.SAMPLER_CUBE:
+ case gluShaderUtil.DataType.UINT_SAMPLER_CUBE:
+ case gluShaderUtil.DataType.INT_SAMPLER_CUBE: {
+ /** @type {sglrReferenceContext.TextureCube} */ var texCube;
+
+ if (texNdx >= 0 && texNdx < this.m_textureUnits.length)
+ texCube = /** @type {sglrReferenceContext.TextureCube} */ (this.m_textureUnits[texNdx].texCubeBinding.texture);
+
+ if (texCube && texCube.isComplete()) {
+ texCube.updateView();
+ this.m_currentProgram.m_uniforms[uniformNdx].sampler = texCube;
+ } else
+ this.m_currentProgram.m_uniforms[uniformNdx].sampler = this.m_emptyTexCube.texture;
+
+ break;
+ }
+ case gluShaderUtil.DataType.SAMPLER_2D_ARRAY:
+ case gluShaderUtil.DataType.UINT_SAMPLER_2D_ARRAY:
+ case gluShaderUtil.DataType.INT_SAMPLER_2D_ARRAY: {
+ /** @type {sglrReferenceContext.Texture2DArray} */ var tex2DArray;
+
+ if (texNdx >= 0 && texNdx < this.m_textureUnits.length)
+ tex2DArray = /** @type {sglrReferenceContext.Texture2DArray} */ (this.m_textureUnits[texNdx].tex2DArrayBinding.texture);
+
+ if (tex2DArray && tex2DArray.isComplete()) {
+ tex2DArray.updateView();
+ this.m_currentProgram.m_uniforms[uniformNdx].sampler = tex2DArray;
+ } else
+ this.m_currentProgram.m_uniforms[uniformNdx].sampler = this.m_emptyTex2DArray.texture;
+
+ break;
+ }
+ case gluShaderUtil.DataType.SAMPLER_3D:
+ case gluShaderUtil.DataType.UINT_SAMPLER_3D:
+ case gluShaderUtil.DataType.INT_SAMPLER_3D: {
+ /** @type {sglrReferenceContext.Texture3D} */ var tex3D;
+
+ if (texNdx >= 0 && texNdx < this.m_textureUnits.length)
+ tex3D = /** @type {sglrReferenceContext.Texture3D} */ (this.m_textureUnits[texNdx].tex3DBinding.texture);
+
+ if (tex3D && tex3D.isComplete()) {
+ tex3D.updateView();
+ this.m_currentProgram.m_uniforms[uniformNdx].sampler = tex3D;
+ } else
+ this.m_currentProgram.m_uniforms[uniformNdx].sampler = this.m_emptyTex3D.texture;
+
+ break;
+ }
+ /* TODO: Port
+ case gluShaderUtil.DataType.SAMPLER_CUBE_ARRAY:
+ case gluShaderUtil.DataType.UINT_SAMPLER_CUBE_ARRAY:
+ case gluShaderUtil.DataType.INT_SAMPLER_CUBE_ARRAY:{
+ rc::TextureCubeArray* tex = DE_NULL;
+
+ if (texNdx >= 0 && (size_t)texNdx < m_textureUnits.length)
+ tex = (this.m_textureUnits[texNdx].texCubeArrayBinding) ? (this.m_textureUnits[texNdx].texCubeArrayBinding) : (&this.m_textureUnits[texNdx].defaultCubeArrayTex);
+
+ if (tex && tex.isComplete()) {
+ tex.updateView();
+ this.m_currentProgram.m_uniforms[uniformNdx].sampler.texCubeArray = tex;
+ } else
+ this.m_currentProgram.m_uniforms[uniformNdx].sampler.texCubeArray = &this.m_emptyTexCubeArray;
+
+ break;
+ }
+ */
+ default:
+ // nothing
+ break;
+ }
+ }
+
+ var primitiveType = sglrReferenceUtils.mapGLPrimitiveType(primitive);
+
+ var renderFunction = rrRenderer.drawTriangles;
+ if (primitiveType == rrRenderer.PrimitiveType.LINES ||
+ primitiveType == rrRenderer.PrimitiveType.LINE_STRIP ||
+ primitiveType == rrRenderer.PrimitiveType.LINE_LOOP)
+ renderFunction = rrRenderer.drawLines;
+ else if (primitiveType == rrRenderer.PrimitiveType.POINTS)
+ renderFunction = rrRenderer.drawPoints;
+
+ for (var instanceID = 0; instanceID < instances; instanceID++)
+ renderFunction(state, renderTarget, program, vertexAttribs, primitiveType, first, count, instanceID);
+ };
+
+ /**
+ * @param {Array<number>} rect
+ * @return {boolean}
+ */
+ sglrReferenceContext.isEmpty = function(rect) { return rect[2] == 0 || rect[3] == 0; };
+
+ /**
+ * @param {number} mask
+ * @param {Array<number>} srcRect
+ * @param {Array<number>} dstRect
+ * @param {boolean} flipX
+ * @param {boolean} flipY
+ * @throws {Error}
+ */
+ sglrReferenceContext.ReferenceContext.prototype.blitResolveMultisampleFramebuffer = function(mask, srcRect, dstRect, flipX, flipY) {
+ throw new Error('Unimplemented');
+ };
+
+ /**
+ * @param {number} srcX0
+ * @param {number} srcY0
+ * @param {number} srcX1
+ * @param {number} srcY1
+ * @param {number} dstX0
+ * @param {number} dstY0
+ * @param {number} dstX1
+ * @param {number} dstY1
+ * @param {number} mask
+ * @param {number} filter
+ */
+ sglrReferenceContext.ReferenceContext.prototype.blitFramebuffer = function(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter) {
+ // p0 in inclusive, p1 exclusive.
+ // Negative width/height means swap.
+ /** @type {boolean} */ var swapSrcX = srcX1 < srcX0;
+ /** @type {boolean} */ var swapSrcY = srcY1 < srcY0;
+ /** @type {boolean} */ var swapDstX = dstX1 < dstX0;
+ /** @type {boolean} */ var swapDstY = dstY1 < dstY0;
+ /** @type {number} */ var srcW = Math.abs(srcX1 - srcX0);
+ /** @type {number} */ var srcH = Math.abs(srcY1 - srcY0);
+ /** @type {number} */ var dstW = Math.abs(dstX1 - dstX0);
+ /** @type {number} */ var dstH = Math.abs(dstY1 - dstY0);
+ /** @type {boolean} */ var scale = srcW != dstW || srcH != dstH;
+ /** @type {number} */ var srcOriginX = swapSrcX ? srcX1 : srcX0;
+ /** @type {number} */ var srcOriginY = swapSrcY ? srcY1 : srcY0;
+ /** @type {number} */ var dstOriginX = swapDstX ? dstX1 : dstX0;
+ /** @type {number} */ var dstOriginY = swapDstY ? dstY1 : dstY0;
+ /** @type {Array<number>} */ var srcRect = [srcOriginX, srcOriginY, srcW, srcH];
+ /** @type {Array<number>} */ var dstRect = [dstOriginX, dstOriginY, dstW, dstH];
+
+ if (this.conditionalSetError(filter != gl.NEAREST && filter != gl.LINEAR, gl.INVALID_ENUM))
+ return;
+ if (this.conditionalSetError((mask & (gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)) != 0 && filter != gl.NEAREST, gl.INVALID_OPERATION))
+ return;
+
+ // Validate that both targets are complete.
+ if (this.conditionalSetError(this.checkFramebufferStatus(gl.DRAW_FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE ||
+ this.checkFramebufferStatus(gl.READ_FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE, gl.INVALID_OPERATION))
+ return;
+
+ // Check samples count is valid
+ if (this.conditionalSetError(this.getDrawColorbuffer().getNumSamples() != 1, gl.INVALID_OPERATION))
+ return;
+
+ // Check size restrictions of multisampled case
+ if (this.getReadColorbuffer().getNumSamples() != 1) {
+ // Src and Dst rect dimensions must be the same
+ if (this.conditionalSetError(srcW != dstW || srcH != dstH, gl.INVALID_OPERATION))
+ return;
+
+ // sglrReferenceContext.Framebuffer formats must match
+ if (mask & gl.COLOR_BUFFER_BIT)
+ if (this.conditionalSetError(this.getReadColorbuffer().raw().getFormat() != this.getDrawColorbuffer().raw().getFormat(), gl.INVALID_OPERATION))
+ return;
+ if (mask & gl.DEPTH_BUFFER_BIT)
+ if (this.conditionalSetError(this.getReadDepthbuffer().raw().getFormat() != this.getDrawDepthbuffer().raw().getFormat(), gl.INVALID_OPERATION))
+ return;
+ if (mask & gl.STENCIL_BUFFER_BIT)
+ if (this.conditionalSetError(this.getReadStencilbuffer().raw().getFormat() != this.getDrawStencilbuffer().raw().getFormat(), gl.INVALID_OPERATION))
+ return;
+ }
+
+ // Compute actual source rect.
+ srcRect = (mask & gl.COLOR_BUFFER_BIT) ? deMath.intersect(srcRect, sglrReferenceContext.getBufferRect(this.getReadColorbuffer())) : srcRect;
+ srcRect = (mask & gl.DEPTH_BUFFER_BIT) ? deMath.intersect(srcRect, sglrReferenceContext.getBufferRect(this.getReadDepthbuffer())) : srcRect;
+ srcRect = (mask & gl.STENCIL_BUFFER_BIT) ? deMath.intersect(srcRect, sglrReferenceContext.getBufferRect(this.getReadStencilbuffer())) : srcRect;
+
+ // Compute destination rect.
+ dstRect = (mask & gl.COLOR_BUFFER_BIT) ? deMath.intersect(dstRect, sglrReferenceContext.getBufferRect(this.getDrawColorbuffer())) : dstRect;
+ dstRect = (mask & gl.DEPTH_BUFFER_BIT) ? deMath.intersect(dstRect, sglrReferenceContext.getBufferRect(this.getDrawDepthbuffer())) : dstRect;
+ dstRect = (mask & gl.STENCIL_BUFFER_BIT) ? deMath.intersect(dstRect, sglrReferenceContext.getBufferRect(this.getDrawStencilbuffer())) : dstRect;
+ dstRect = this.m_scissorEnabled ? deMath.intersect(dstRect, this.m_scissorBox) : dstRect;
+
+ if (sglrReferenceContext.isEmpty(srcRect) || sglrReferenceContext.isEmpty(dstRect))
+ return; // Don't attempt copy.
+
+ // Multisampled read buffer is a special case
+ if (this.getReadColorbuffer().getNumSamples() != 1) {
+ /** @type {boolean} */ var swapX = swapSrcX ^ swapDstX ? true : false;
+ /** @type {boolean} */ var swapY = swapSrcY ^ swapDstY ? true : false;
+ var error = this.blitResolveMultisampleFramebuffer(mask, srcRect, dstRect, swapX, swapY);
+
+ if (error != gl.NO_ERROR)
+ this.setError(error);
+
+ return;
+ }
+
+ // \note Multisample pixel buffers can now be accessed like non-multisampled because multisample read buffer case is already handled. => sample count must be 1
+
+ // Coordinate transformation:
+ // Dst offset space -> dst rectangle space -> src rectangle space -> src offset space.
+ /** @type {tcuMatrix.Matrix} */ var matrix = tcuMatrixUtil.translationMatrix([srcX0 - srcRect[0], srcY0 - srcRect[1]]);
+ matrix = tcuMatrix.multiply(matrix, tcuMatrix.matrixFromVector(3, 3, [(srcX1 - srcX0) / (dstX1 - dstX0), (srcY1 - srcY0) / (dstY1 - dstY0), 1]));
+ matrix = tcuMatrix.multiply(matrix, tcuMatrixUtil.translationMatrix([dstRect[0] - dstX0, dstRect[1] - dstY0]));
+
+ /**
+ * @param {number} x
+ * @param {number} y
+ * @return {number}
+ */
+ var transform = function(x, y) { return matrix.get(x, y); };
+
+ /** @type {number} */ var dX;
+ /** @type {number} */ var dY;
+ /** @type {number} */ var sX;
+ /** @type {number} */ var sY;
+ /** @type {tcuTexture.PixelBufferAccess|rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var src;
+ /** @type {tcuTexture.PixelBufferAccess|rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var dst;
+
+ if (mask & gl.COLOR_BUFFER_BIT) {
+ src = tcuTextureUtil.getSubregion(this.getReadColorbuffer().toSinglesampleAccess(), srcRect[0], srcRect[1], 0, srcRect[2], srcRect[3], 1);
+ dst = tcuTextureUtil.getSubregion(this.getDrawColorbuffer().toSinglesampleAccess(), dstRect[0], dstRect[1], 0, dstRect[2], dstRect[3], 1);
+ /** @type {tcuTexture.TextureChannelClass} */ var dstClass = tcuTexture.getTextureChannelClass(dst.getFormat().type);
+ /** @type {boolean} */ var dstIsFloat = dstClass == tcuTexture.TextureChannelClass.FLOATING_POINT ||
+ dstClass == tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT ||
+ dstClass == tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT;
+ /** @type {tcuTexture.FilterMode} */ var sFilter = (scale && filter == gl.LINEAR) ? tcuTexture.FilterMode.LINEAR : tcuTexture.FilterMode.NEAREST;
+ /** @type {tcuTexture.Sampler} */ var sampler = new tcuTexture.Sampler(tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE,
+ sFilter, sFilter, 0.0 /* lod threshold */, false /* non-normalized coords */);
+ /** @type {boolean} */ var srcIsSRGB = src.getFormat().order == tcuTexture.ChannelOrder.sRGB || src.getFormat().order == tcuTexture.ChannelOrder.sRGBA;
+ /** @type {boolean} */ var dstIsSRGB = dst.getFormat().order == tcuTexture.ChannelOrder.sRGB || dst.getFormat().order == tcuTexture.ChannelOrder.sRGBA;
+ /** @type {boolean} */ var convertSRGB = this.m_sRGBUpdateEnabled;
+
+ // \note We don't check for unsupported conversions, unlike spec requires.
+
+ for (var yo = 0; yo < dstRect[3]; yo++) {
+ for (var xo = 0; xo < dstRect[2]; xo++) {
+ dX = xo + 0.5;
+ dY = yo + 0.5;
+
+ // \note Only affine part is used.
+ sX = transform(0, 0) * dX + transform(0, 1) * dY + transform(0, 2);
+ sY = transform(1, 0) * dX + transform(1, 1) * dY + transform(1, 2);
+
+ // do not copy pixels outside the modified source region (modified by buffer intersection)
+ if (sX < 0.0 || sX >= srcRect[2] ||
+ sY < 0.0 || sY >= srcRect[3])
+ continue;
+
+ if (dstIsFloat || srcIsSRGB || filter == tcuTexture.FilterMode.LINEAR) {
+ /** @type {Array<number>} */ var p = src.sample2D(sampler, sampler.minFilter, sX, sY, 0);
+ dst.setPixel((dstIsSRGB && convertSRGB) ? tcuTextureUtil.linearToSRGB(p) : p, xo, yo);
+ } else
+ dst.setPixelInt(src.getPixelInt(Math.floor(sX), Math.floor(sY)), xo, yo);
+ }
+ }
+ }
+
+ if ((mask & gl.DEPTH_BUFFER_BIT) && this.m_depthMask) {
+ src = this.getReadDepthbuffer().getSubregion(srcRect);
+ dst = this.getDrawDepthbuffer().getSubregion(dstRect);
+
+ for (var yo = 0; yo < dstRect[3]; yo++) {
+ for (var xo = 0; xo < dstRect[2]; xo++) {
+ var sampleNdx = 0; // multisample read buffer case is already handled
+
+ dX = xo + 0.5;
+ dY = yo + 0.5;
+ sX = transform(0, 0) * dX + transform(0, 1) * dY + transform(0, 2);
+ sY = transform(1, 0) * dX + transform(1, 1) * dY + transform(1, 2);
+
+ sglrReferenceContext.writeDepthOnly(dst, sampleNdx, xo, yo, src.raw().getPixel(sampleNdx, Math.floor(sX), Math.floor(sY))[0]);
+ }
+ }
+ }
+
+ if (mask & gl.STENCIL_BUFFER_BIT) {
+ src = this.getReadStencilbuffer().getSubregion(srcRect);
+ dst = this.getDrawStencilbuffer().getSubregion(dstRect);
+
+ for (var yo = 0; yo < dstRect[3]; yo++) {
+ for (var xo = 0; xo < dstRect[2]; xo++) {
+ var sampleNdx = 0; // multisample read buffer case is already handled
+
+ dX = xo + 0.5;
+ dY = yo + 0.5;
+ sX = transform(0, 0) * dX + transform(0, 1) * dY + transform(0, 2);
+ sY = transform(1, 0) * dX + transform(1, 1) * dY + transform(1, 2);
+
+ sglrReferenceContext.writeStencilOnly(dst, sampleNdx, xo, yo, src.raw().getPixelInt(sampleNdx, Math.floor(sX), Math.floor(sY))[3], this.m_stencil[rrDefs.FaceType.FACETYPE_FRONT].writeMask);
+ }
+ }
+ }
+ };
+
+ /**
+ * @param {number} internalFormat
+ * @return {tcuTexture.TextureFormat}
+ */
+ sglrReferenceContext.mapInternalFormat = function(internalFormat) {
+ switch (internalFormat) {
+ case gl.ALPHA: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.A, tcuTexture.ChannelType.UNORM_INT8);
+ case gl.LUMINANCE: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.L, tcuTexture.ChannelType.UNORM_INT8);
+ case gl.LUMINANCE_ALPHA: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.LA, tcuTexture.ChannelType.UNORM_INT8);
+ case gl.RGB: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGB, tcuTexture.ChannelType.UNORM_INT8);
+ case gl.RGBA: return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8);
+
+ default:
+ return gluTextureUtil.mapGLInternalFormat(internalFormat);
+ }
+ };
+
+ /**
+ * @param {tcuTexture.PixelBufferAccess} dst
+ * @param {tcuTexture.ConstPixelBufferAccess} src
+ */
+ sglrReferenceContext.depthValueFloatClampCopy = function(dst, src) {
+ /** @type {number} */ var width = dst.getWidth();
+ /** @type {number} */ var height = dst.getHeight();
+ /** @type {number} */ var depth = dst.getDepth();
+
+ DE_ASSERT(src.getWidth() == width && src.getHeight() == height && src.getDepth() == depth);
+
+ // clamping copy
+ for (var z = 0; z < depth; z++)
+ for (var y = 0; y < height; y++)
+ for (var x = 0; x < width; x++) {
+ /** @type {Array<number>} */ var data = src.getPixel(x, y, z);
+ dst.setPixel([deMath.clamp(data[0], 0.0, 1.0), data[1], data[2], data[3]], x, y, z);
+ }
+ };
+
+ /**
+ * @param {number} target
+ * @param {number} level
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ */
+ sglrReferenceContext.ReferenceContext.prototype.texImage2DDelegate = function (target, level, internalFormat, width, height) {
+ var format;
+ var dataType;
+
+ switch (internalFormat)
+ {
+ case gl.ALPHA:
+ case gl.LUMINANCE:
+ case gl.LUMINANCE_ALPHA:
+ case gl.RGB:
+ case gl.RGBA:
+ format = internalFormat;
+ dataType = GL.UNSIGNED_BYTE;
+ break;
+ default:
+ {
+ var transferFmt = gluTextureUtil.getTransferFormat(gluTextureUtil.mapGLInternalFormat(internalFormat));
+ format = transferFmt.format;
+ dataType = transferFmt.dataType;
+ break;
+ }
+ }
+ this.texImage2D(target, level, internalFormat, width, height, 0, format, dataType, null);
+ };
+
+ /**
+ * @param {number} target
+ * @param {number} level
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ * @param {number} border
+ * @param {number} format
+ * @param {number} type
+ * @param {number} pixels
+ */
+ sglrReferenceContext.ReferenceContext.prototype.texImage2D = function(target, level, internalFormat, width, height, border, format, type, pixels) {
+ this.texImage3D(target, level, internalFormat, width, height, 1, border, format, type, pixels);
+ };
+
+ sglrReferenceContext.ReferenceContext.prototype.texImage3D = function(target, level, internalFormat, width, height, depth, border, format, type, pixels) {
+ /** @type {sglrReferenceContext.TextureUnit} */var unit = this.m_textureUnits[this.m_activeTexture];
+ /** @type {ArrayBuffer} */ var data = null;
+ /** @type {number} */ var offset = 0;
+ /** @type {tcuTexture.PixelBufferAccess} */ var dst;
+ /** @type {tcuTexture.ConstPixelBufferAccess} */ var src;
+ if (this.m_pixelUnpackBufferBinding) {
+ if (this.conditionalSetError(typeof pixels !== 'number', gl.INVALID_VALUE))
+ return;
+ data = this.m_pixelUnpackBufferBinding.getData();
+ offset = pixels;
+ } else if (pixels) {
+ if (pixels instanceof ArrayBuffer) {
+ data = pixels;
+ offset = 0;
+ } else {
+ data = pixels.buffer;
+ offset = pixels.byteOffset;
+ }
+ }
+ /** @type {boolean} */ var isDstFloatDepthFormat = (internalFormat == gl.DEPTH_COMPONENT32F || internalFormat == gl.DEPTH32F_STENCIL8); // depth components are limited to [0,1] range
+
+ if (this.conditionalSetError(border != 0, gl.INVALID_VALUE))
+ return;
+ if (this.conditionalSetError(width < 0 || height < 0 || depth < 0 || level < 0, gl.INVALID_VALUE))
+ return;
+
+ // Map storage format.
+ /** @type {tcuTexture.TextureFormat} */ var storageFmt = sglrReferenceContext.mapInternalFormat(internalFormat);
+ if (this.conditionalSetError(!storageFmt, gl.INVALID_ENUM))
+ return;
+
+ // Map transfer format.
+ /** @type {tcuTexture.TextureFormat} */ var transferFmt = gluTextureUtil.mapGLTransferFormat(format, type);
+ if (this.conditionalSetError(!transferFmt, gl.INVALID_ENUM))
+ return;
+
+ if (target == gl.TEXTURE_2D) {
+ // Validate size and level.
+ if (this.conditionalSetError(width > this.m_limits.maxTexture2DSize || height > this.m_limits.maxTexture2DSize || depth != 1, gl.INVALID_VALUE))
+ return;
+ if (this.conditionalSetError(level > Math.log2(this.m_limits.maxTexture2DSize), gl.INVALID_VALUE))
+ return;
+
+ /** @type {sglrReferenceContext.Texture2D} */
+ var texture = /** @type {sglrReferenceContext.Texture2D} */ (unit.tex2DBinding.texture);
+
+ if (texture.isImmutable()) {
+ if (this.conditionalSetError(!texture.hasLevel(level), gl.INVALID_OPERATION))
+ return;
+
+ //NOTE: replaces this: var dst = tcuTexture.PixelBufferAccess.newFromTextureLevel(texture.getLevel(level));
+ dst = texture.getLevel(level);
+
+ if (this.conditionalSetError(!storageFmt.isEqual(dst.getFormat()) ||
+ width != dst.getWidth() ||
+ height != dst.getHeight(), gl.INVALID_OPERATION))
+ return;
+ } else
+ texture.allocLevel(level, storageFmt, width, height);
+
+ if (data) {
+ var rowLen = this.m_pixelUnpackRowLength > 0 ? this.m_pixelUnpackRowLength : width;
+ var rowPitch = deMath.deAlign32(rowLen * transferFmt.getPixelSize(), this.m_pixelUnpackAlignment);
+ var skip = this.m_pixelUnpackSkipRows * rowPitch + this.m_pixelUnpackSkipPixels * transferFmt.getPixelSize();
+ src = new tcuTexture.ConstPixelBufferAccess({
+ format: transferFmt,
+ width: width,
+ height: height,
+ rowPitch: rowPitch,
+ data: data,
+ offset: offset + skip});
+
+ //NOTE: replaces this: var dst = tcuTexture.PixelBufferAccess.newFromTextureLevel(texture.getLevel(level));
+ dst = texture.getLevel(level);
+
+ if (isDstFloatDepthFormat)
+ sglrReferenceContext.depthValueFloatClampCopy(dst, src);
+ else
+ tcuTextureUtil.copy(dst, src);
+ } else {
+ // No data supplied, clear to black.
+
+ //NOTE: replaces this: var dst = tcuTexture.PixelBufferAccess.newFromTextureLevel(texture.getLevel(level));
+ dst = texture.getLevel(level);
+ dst.clear([0.0, 0.0, 0.0, 1.0]);
+ }
+ } else if (target == gl.TEXTURE_CUBE_MAP_NEGATIVE_X ||
+ target == gl.TEXTURE_CUBE_MAP_POSITIVE_X ||
+ target == gl.TEXTURE_CUBE_MAP_NEGATIVE_Y ||
+ target == gl.TEXTURE_CUBE_MAP_POSITIVE_Y ||
+ target == gl.TEXTURE_CUBE_MAP_NEGATIVE_Z ||
+ target == gl.TEXTURE_CUBE_MAP_POSITIVE_Z) {
+ // Validate size and level.
+ if (this.conditionalSetError(width != height || width > this.m_limits.maxTextureCubeSize || depth != 1, gl.INVALID_VALUE))
+ return;
+ if (this.conditionalSetError(level > Math.floor(Math.log2(this.m_limits.maxTextureCubeSize)), gl.INVALID_VALUE))
+ return;
+
+ var textureCube = /** @type {sglrReferenceContext.TextureCube} */ (unit.texCubeBinding.texture);
+
+ var face = sglrReferenceContext.mapGLCubeFace(target);
+
+ if (textureCube.isImmutable()) {
+ if (this.conditionalSetError(!textureCube.hasFace(level, face), gl.INVALID_OPERATION))
+ return;
+
+ dst = textureCube.getFace(level, face);
+
+ if (this.conditionalSetError(!storageFmt.isEqual(dst.getFormat()) ||
+ width != dst.getWidth() ||
+ height != dst.getHeight(), gl.INVALID_OPERATION))
+ return;
+ } else
+ textureCube.allocLevel(level, face, storageFmt, width, height);
+
+ if (data) {
+ var rowLen = this.m_pixelUnpackRowLength > 0 ? this.m_pixelUnpackRowLength : width;
+ var rowPitch = deMath.deAlign32(rowLen * transferFmt.getPixelSize(), this.m_pixelUnpackAlignment);
+ var skip = this.m_pixelUnpackSkipRows * rowPitch + this.m_pixelUnpackSkipPixels * transferFmt.getPixelSize();
+ src = new tcuTexture.ConstPixelBufferAccess({
+ format: transferFmt,
+ width: width,
+ height: height,
+ rowPitch: rowPitch,
+ data: data,
+ offset: offset + skip});
+
+ dst = textureCube.getFace(level, face);
+
+ if (isDstFloatDepthFormat)
+ sglrReferenceContext.depthValueFloatClampCopy(dst, src);
+ else
+ tcuTextureUtil.copy(dst, src);
+ } else {
+ // No data supplied, clear to black.
+ dst = textureCube.getFace(level, face);
+ dst.clear([0.0, 0.0, 0.0, 1.0]);
+ }
+ } else if (target == gl.TEXTURE_2D_ARRAY) {
+ // Validate size and level.
+ if (this.conditionalSetError(width > this.m_limits.maxTexture2DSize ||
+ height > this.m_limits.maxTexture2DSize ||
+ depth > this.m_limits.maxTexture2DArrayLayers, gl.INVALID_VALUE))
+ return;
+ if (this.conditionalSetError(level > Math.floor(Math.log2(this.m_limits.maxTexture2DSize)), gl.INVALID_VALUE))
+ return;
+
+ /** @type {sglrReferenceContext.Texture2DArray} */
+ var texture2DArray = /** @type {sglrReferenceContext.Texture2DArray} */ (unit.tex2DArrayBinding.texture);
+
+ if (texture2DArray.isImmutable()) {
+ if (this.conditionalSetError(!texture2DArray.hasLevel(level), gl.INVALID_OPERATION))
+ return;
+
+ dst = texture2DArray.getLevel(level);
+ if (this.conditionalSetError(!storageFmt.isEqual(dst.getFormat()) ||
+ width != dst.getWidth() ||
+ height != dst.getHeight() ||
+ depth != dst.getDepth(), gl.INVALID_OPERATION))
+ return;
+ } else
+ texture2DArray.allocLevel(level, storageFmt, width, height, depth);
+
+ if (data) {
+ var rowLen = this.m_pixelUnpackRowLength > 0 ? this.m_pixelUnpackRowLength : width;
+ var imageHeight = this.m_pixelUnpackImageHeight > 0 ? this.m_pixelUnpackImageHeight : height;
+ var rowPitch = deMath.deAlign32(rowLen * transferFmt.getPixelSize(), this.m_pixelUnpackAlignment);
+ var slicePitch = imageHeight * rowPitch;
+ var skip = this.m_pixelUnpackSkipImages * slicePitch + this.m_pixelUnpackSkipRows * rowPitch +
+ this.m_pixelUnpackSkipPixels * transferFmt.getPixelSize();
+ src = new tcuTexture.ConstPixelBufferAccess({
+ format: transferFmt,
+ width: width,
+ height: height,
+ depth: depth,
+ rowPitch: rowPitch,
+ slicePitch: slicePitch,
+ data: data,
+ offset: offset + skip});
+
+ dst = texture2DArray.getLevel(level);
+
+ if (isDstFloatDepthFormat)
+ sglrReferenceContext.depthValueFloatClampCopy(dst, src);
+ else
+ tcuTextureUtil.copy(dst, src);
+ } else {
+ // No data supplied, clear to black.
+ dst = texture2DArray.getLevel(level);
+ dst.clear([0.0, 0.0, 0.0, 1.0]);
+ }
+ } else if (target == gl.TEXTURE_3D) {
+ // Validate size and level.
+ if (this.conditionalSetError(width > this.m_limits.maxTexture3DSize ||
+ height > this.m_limits.maxTexture3DSize ||
+ depth > this.m_limits.maxTexture3DSize, gl.INVALID_VALUE))
+ return;
+ if (this.conditionalSetError(level > Math.floor(Math.log2(this.m_limits.maxTexture3DSize)), gl.INVALID_VALUE))
+ return;
+
+ var texture3D = /** @type {sglrReferenceContext.Texture3D} */ (unit.tex3DBinding.texture);
+
+ if (texture3D.isImmutable()) {
+ if (this.conditionalSetError(!texture3D.hasLevel(level), gl.INVALID_OPERATION))
+ return;
+
+ dst = texture3D.getLevel(level);
+ if (this.conditionalSetError(!storageFmt.isEqual(dst.getFormat()) ||
+ width != dst.getWidth() ||
+ height != dst.getHeight() ||
+ depth != dst.getDepth(), gl.INVALID_OPERATION))
+ return;
+ } else
+ texture3D.allocLevel(level, storageFmt, width, height, depth);
+
+ if (data) {
+ var rowLen = this.m_pixelUnpackRowLength > 0 ? this.m_pixelUnpackRowLength : width;
+ var imageHeight = this.m_pixelUnpackImageHeight > 0 ? this.m_pixelUnpackImageHeight : height;
+ var rowPitch = deMath.deAlign32(rowLen * transferFmt.getPixelSize(), this.m_pixelUnpackAlignment);
+ var slicePitch = imageHeight * rowPitch;
+ var skip = this.m_pixelUnpackSkipImages * slicePitch + this.m_pixelUnpackSkipRows * rowPitch +
+ this.m_pixelUnpackSkipPixels * transferFmt.getPixelSize();
+ src = new tcuTexture.ConstPixelBufferAccess({
+ format: transferFmt,
+ width: width,
+ height: height,
+ depth: depth,
+ rowPitch: rowPitch,
+ slicePitch: slicePitch,
+ data: data,
+ offset: offset + skip});
+
+ dst = texture3D.getLevel(level);
+
+ if (isDstFloatDepthFormat)
+ sglrReferenceContext.depthValueFloatClampCopy(dst, src);
+ else
+ tcuTextureUtil.copy(dst, src);
+
+ } else {
+ // No data supplied, clear to black.
+ dst = texture3D.getLevel(level);
+ dst.clear([0.0, 0.0, 0.0, 1.0]);
+ }
+ }
+ // else if (target == gl.TEXTURE_CUBE_MAP_ARRAY)
+ // {
+ // // Validate size and level.
+ // RC_IF_ERROR(width != height ||
+ // width > m_limits.maxTexture2DSize ||
+ // depth % 6 != 0 ||
+ // depth > m_limits.maxTexture2DArrayLayers, gl.INVALID_VALUE, RC_RET_VOID);
+ // RC_IF_ERROR(level > deLog2Floor32(m_limits.maxTexture2DSize), gl.INVALID_VALUE, RC_RET_VOID);
+
+ // TextureCubeArray* texture = unit.texCubeArrayBinding ? unit.texCubeArrayBinding : &unit.defaultCubeArrayTex;
+
+ // if (texture->isImmutable())
+ // {
+ // RC_IF_ERROR(!texture->hasLevel(level), gl.INVALID_OPERATION, RC_RET_VOID);
+
+ // ConstPixelBufferAccess dst(texture->getLevel(level));
+ // RC_IF_ERROR(storageFmt != dst.getFormat() ||
+ // width != dst.getWidth() ||
+ // height != dst.getHeight() ||
+ // depth != dst.getDepth(), gl.INVALID_OPERATION, RC_RET_VOID);
+ // }
+ // else
+ // texture->allocLevel(level, storageFmt, width, height, depth);
+
+ // if (unpackPtr)
+ // {
+ // ConstPixelBufferAccess src = getUnpack3DAccess(transferFmt, width, height, depth, unpackPtr);
+ // PixelBufferAccess dst (texture->getLevel(level));
+
+ // if (isDstFloatDepthFormat)
+ // sglrReferenceContext.depthValueFloatClampCopy(dst, src);
+ // else
+ // tcu::copy(dst, src);
+ // }
+ // else
+ // {
+ // // No data supplied, clear to black.
+ // PixelBufferAccess dst = texture->getLevel(level);
+ // tcu::clear(dst, Vec4(0.0f, 0.0f, 0.0f, 1.0f));
+ // }
+ // } /**/
+ else
+ this.setError(gl.INVALID_ENUM);
+ };
+
+ sglrReferenceContext.ReferenceContext.prototype.texSubImage2D = function(target, level, xoffset, yoffset, width, height, format, type, pixels) {
+ this.texSubImage3D(target, level, xoffset, yoffset, 0, width, height, 1, format, type, pixels);
+ };
+
+ sglrReferenceContext.ReferenceContext.prototype.texSubImage3D = function(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels) {
+ /** @type {sglrReferenceContext.TextureUnit} */var unit = this.m_textureUnits[this.m_activeTexture];
+ /** @type {ArrayBuffer} */ var data = null;
+ /** @type {number} */ var offset = 0;
+ /** @type {tcuTexture.PixelBufferAccess} */ var dst;
+ /** @type {tcuTexture.PixelBufferAccess} */ var sub;
+ /** @type {tcuTexture.ConstPixelBufferAccess} */ var src;
+ /** @type {boolean} */ var isDstFloatDepthFormat;
+ if (this.m_pixelUnpackBufferBinding) {
+ if (this.conditionalSetError(typeof pixels !== 'number', gl.INVALID_VALUE))
+ return;
+ data = this.m_pixelUnpackBufferBinding.getData();
+ offset = pixels;
+ } else if (pixels) {
+ if (pixels instanceof ArrayBuffer) {
+ data = pixels;
+ offset = 0;
+ } else {
+ data = pixels.buffer;
+ offset = pixels.byteOffset;
+ }
+ }
+
+ if (this.conditionalSetError(xoffset < 0 || yoffset < 0 || zoffset < 0, gl.INVALID_VALUE))
+ return;
+ if (this.conditionalSetError(width < 0 || height < 0 || depth < 0 || level < 0, gl.INVALID_VALUE))
+ return;
+
+ // Map transfer format.
+ /** @type {tcuTexture.TextureFormat} */ var transferFmt = gluTextureUtil.mapGLTransferFormat(format, type);
+ if (this.conditionalSetError(!transferFmt, gl.INVALID_ENUM))
+ return;
+
+ if (target == gl.TEXTURE_2D) {
+ // Validate size and level.
+ if (this.conditionalSetError(width > this.m_limits.maxTexture2DSize || height > this.m_limits.maxTexture2DSize || depth != 1, gl.INVALID_VALUE))
+ return;
+ if (this.conditionalSetError(level > Math.log2(this.m_limits.maxTexture2DSize), gl.INVALID_VALUE))
+ return;
+
+ /** @type {sglrReferenceContext.Texture2D} */
+ var texture = /** @type {sglrReferenceContext.Texture2D} */ (unit.tex2DBinding.texture);
+
+ if (this.conditionalSetError(!texture.hasLevel(level), gl.INVALID_OPERATION))
+ return;
+
+ //NOTE: replaces this: var dst = tcuTexture.PixelBufferAccess.newFromTextureLevel(texture.getLevel(level));
+ dst = texture.getLevel(level);
+
+ if (this.conditionalSetError(xoffset + width > dst.getWidth() ||
+ yoffset + height > dst.getHeight() ||
+ zoffset + depth > dst.getDepth(),
+ gl.INVALID_VALUE))
+ return;
+
+ var rowLen = this.m_pixelUnpackRowLength > 0 ? this.m_pixelUnpackRowLength : width;
+ var rowPitch = deMath.deAlign32(rowLen * transferFmt.getPixelSize(), this.m_pixelUnpackAlignment);
+ var skip = this.m_pixelUnpackSkipRows * rowPitch + this.m_pixelUnpackSkipPixels * transferFmt.getPixelSize();
+ src = new tcuTexture.ConstPixelBufferAccess({
+ format: transferFmt,
+ width: width,
+ height: height,
+ rowPitch: rowPitch,
+ data: data,
+ offset: offset + skip});
+
+ sub = tcuTextureUtil.getSubregion(dst, xoffset, yoffset, zoffset, width, height, depth);
+ isDstFloatDepthFormat = (dst.getFormat().order == tcuTexture.ChannelOrder.D || dst.getFormat().order == tcuTexture.ChannelOrder.DS); // depth components are limited to [0,1] range
+
+ if (isDstFloatDepthFormat)
+ sglrReferenceContext.depthValueFloatClampCopy(sub, src);
+ else
+ tcuTextureUtil.copy(sub, src);
+ } else if (target == gl.TEXTURE_CUBE_MAP_NEGATIVE_X ||
+ target == gl.TEXTURE_CUBE_MAP_POSITIVE_X ||
+ target == gl.TEXTURE_CUBE_MAP_NEGATIVE_Y ||
+ target == gl.TEXTURE_CUBE_MAP_POSITIVE_Y ||
+ target == gl.TEXTURE_CUBE_MAP_NEGATIVE_Z ||
+ target == gl.TEXTURE_CUBE_MAP_POSITIVE_Z) {
+ var textureCube = /** @type {sglrReferenceContext.TextureCube} */ (unit.texCubeBinding.texture);
+
+ var face = sglrReferenceContext.mapGLCubeFace(target);
+
+ if (this.conditionalSetError(!textureCube.hasFace(level, face), gl.INVALID_OPERATION))
+ return;
+
+ dst = textureCube.getFace(level, face);
+
+ if (this.conditionalSetError(xoffset + width > dst.getWidth() ||
+ yoffset + height > dst.getHeight() ||
+ zoffset + depth > dst.getDepth(),
+ gl.INVALID_VALUE))
+ return;
+
+ var rowLen = this.m_pixelUnpackRowLength > 0 ? this.m_pixelUnpackRowLength : width;
+ var rowPitch = deMath.deAlign32(rowLen * transferFmt.getPixelSize(), this.m_pixelUnpackAlignment);
+ var skip = this.m_pixelUnpackSkipRows * rowPitch + this.m_pixelUnpackSkipPixels * transferFmt.getPixelSize();
+ src = new tcuTexture.ConstPixelBufferAccess({
+ format: transferFmt,
+ width: width,
+ height: height,
+ rowPitch: rowPitch,
+ slicePitach: slicePitch,
+ data: data,
+ offset: offset + skip});
+
+ sub = tcuTextureUtil.getSubregion(dst, xoffset, yoffset, zoffset, width, height, depth);
+ isDstFloatDepthFormat = (dst.getFormat().order == tcuTexture.ChannelOrder.D || dst.getFormat().order == tcuTexture.ChannelOrder.DS); // depth components are limited to [0,1] range
+
+ if (isDstFloatDepthFormat)
+ sglrReferenceContext.depthValueFloatClampCopy(sub, src);
+ else
+ tcuTextureUtil.copy(sub, src);
+ } else if (target == gl.TEXTURE_2D_ARRAY) {
+ // Validate size and level.
+ if (this.conditionalSetError(width > this.m_limits.maxTexture2DSize ||
+ height > this.m_limits.maxTexture2DSize ||
+ depth > this.m_limits.maxTexture2DArrayLayers, gl.INVALID_VALUE))
+ return;
+ if (this.conditionalSetError(level > Math.floor(Math.log2(this.m_limits.maxTexture2DSize)), gl.INVALID_VALUE))
+ return;
+
+ /** @type {sglrReferenceContext.Texture2DArray} */
+ var texture2DArray = /** @type {sglrReferenceContext.Texture2DArray} */ (unit.tex2DArrayBinding.texture);
+
+ if (this.conditionalSetError(!texture2DArray.hasLevel(level), gl.INVALID_OPERATION))
+ return;
+
+ dst = texture2DArray.getLevel(level);
+ if (this.conditionalSetError(xoffset + width > dst.getWidth() ||
+ yoffset + height > dst.getHeight() ||
+ zoffset + depth > dst.getDepth(),
+ gl.INVALID_VALUE))
+ return;
+
+ var rowLen = this.m_pixelUnpackRowLength > 0 ? this.m_pixelUnpackRowLength : width;
+ var imageHeight = this.m_pixelUnpackImageHeight > 0 ? this.m_pixelUnpackImageHeight : height;
+ var rowPitch = deMath.deAlign32(rowLen * transferFmt.getPixelSize(), this.m_pixelUnpackAlignment);
+ var slicePitch = imageHeight * rowPitch;
+ var skip = this.m_pixelUnpackSkipImages * slicePitch + this.m_pixelUnpackSkipRows * rowPitch +
+ this.m_pixelUnpackSkipPixels * transferFmt.getPixelSize();
+ src = new tcuTexture.ConstPixelBufferAccess({
+ format: transferFmt,
+ width: width,
+ height: height,
+ depth: depth,
+ rowPitch: rowPitch,
+ slicePitch: slicePitch,
+ data: data,
+ offset: offset + skip});
+
+ sub = tcuTextureUtil.getSubregion(dst, xoffset, yoffset, zoffset, width, height, depth);
+ isDstFloatDepthFormat = (dst.getFormat().order == tcuTexture.ChannelOrder.D || dst.getFormat().order == tcuTexture.ChannelOrder.DS); // depth components are limited to [0,1] range
+
+ if (isDstFloatDepthFormat)
+ sglrReferenceContext.depthValueFloatClampCopy(sub, src);
+ else
+ tcuTextureUtil.copy(sub, src);
+ } else if (target == gl.TEXTURE_3D) {
+ // Validate size and level.
+ if (this.conditionalSetError(width > this.m_limits.maxTexture3DSize ||
+ height > this.m_limits.maxTexture3DSize ||
+ depth > this.m_limits.maxTexture3DSize, gl.INVALID_VALUE))
+ return;
+ if (this.conditionalSetError(level > Math.floor(Math.log2(this.m_limits.maxTexture3DSize)), gl.INVALID_VALUE))
+ return;
+
+ var texture3D = /** @type {sglrReferenceContext.Texture3D} */ (unit.tex3DBinding.texture);
+
+ if (this.conditionalSetError(!texture3D.hasLevel(level), gl.INVALID_OPERATION))
+ return;
+
+ dst = texture3D.getLevel(level);
+ if (this.conditionalSetError(xoffset + width > dst.getWidth() ||
+ yoffset + height > dst.getHeight() ||
+ zoffset + depth > dst.getDepth(),
+ gl.INVALID_VALUE))
+ return;
+
+ var rowLen = this.m_pixelUnpackRowLength > 0 ? this.m_pixelUnpackRowLength : width;
+ var imageHeight = this.m_pixelUnpackImageHeight > 0 ? this.m_pixelUnpackImageHeight : height;
+ var rowPitch = deMath.deAlign32(rowLen * transferFmt.getPixelSize(), this.m_pixelUnpackAlignment);
+ var slicePitch = imageHeight * rowPitch;
+ var skip = this.m_pixelUnpackSkipImages * slicePitch + this.m_pixelUnpackSkipRows * rowPitch +
+ this.m_pixelUnpackSkipPixels * transferFmt.getPixelSize();
+ src = new tcuTexture.ConstPixelBufferAccess({
+ format: transferFmt,
+ width: width,
+ height: height,
+ depth: depth,
+ rowPitch: rowPitch,
+ slicePitch: slicePitch,
+ data: data,
+ offset: offset + skip});
+
+ sub = tcuTextureUtil.getSubregion(dst, xoffset, yoffset, zoffset, width, height, depth);
+
+ isDstFloatDepthFormat = (dst.getFormat().order == tcuTexture.ChannelOrder.D || dst.getFormat().order == tcuTexture.ChannelOrder.DS); // depth components are limited to [0,1] range
+ if (isDstFloatDepthFormat)
+ sglrReferenceContext.depthValueFloatClampCopy(sub, src);
+ else
+ tcuTextureUtil.copy(sub, src);
+ } else
+ this.setError(gl.INVALID_ENUM);
+ };
+
+ /**
+ * @param {number} target
+ * @param {number} level
+ * @param {number} internalFormat
+ * @param {number} x
+ * @param {number} y
+ * @param {number} width
+ * @param {number} height
+ * @param {number} border
+ */
+ sglrReferenceContext.ReferenceContext.prototype.copyTexImage2D = function(target, level, internalFormat, x, y, width, height, border) {
+ /** @type {sglrReferenceContext.TextureUnit} */var unit = this.m_textureUnits[this.m_activeTexture];
+ /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var src = this.getReadColorbuffer();
+
+ if (this.conditionalSetError(border != 0, gl.INVALID_VALUE))
+ return;
+ if (this.conditionalSetError(width < 0 || height < 0 || level < 0, gl.INVALID_VALUE))
+ return;
+ if (this.conditionalSetError(src.isEmpty(), gl.INVALID_OPERATION))
+ return;
+
+ // Map storage format.
+ /** @type {tcuTexture.TextureFormat} */ var storageFmt = sglrReferenceContext.mapInternalFormat(internalFormat);
+ if (this.conditionalSetError(!storageFmt, gl.INVALID_ENUM))
+ return;
+
+ if (target == gl.TEXTURE_2D) {
+ // Validate size and level.
+ if (this.conditionalSetError(width > this.m_limits.maxTexture2DSize || height > this.m_limits.maxTexture2DSize, gl.INVALID_VALUE))
+ return;
+ if (this.conditionalSetError(level > Math.floor(Math.log2(this.m_limits.maxTexture2DSize)), gl.INVALID_VALUE))
+ return;
+
+ /** @type {sglrReferenceContext.Texture2D} */
+ var texture = /** @type {sglrReferenceContext.Texture2D} */ (unit.tex2DBinding.texture);
+
+ if (texture.isImmutable()) {
+ if (this.conditionalSetError(!texture.hasLevel(level), gl.INVALID_OPERATION))
+ return;
+
+ /** @type {tcuTexture.PixelBufferAccess} */ var dst = texture.getLevel(level);
+ if (this.conditionalSetError(storageFmt != dst.getFormat() || width != dst.getWidth() || height != dst.getHeight(), gl.INVALID_OPERATION))
+ return;
+ } else {
+ texture.allocLevel(level, storageFmt, width, height);
+ }
+
+ // Copy from current framebuffer.
+ /** @type {tcuTexture.PixelBufferAccess} */ var dst = texture.getLevel(level);
+ for (var yo = 0; yo < height; yo++) {
+ for (var xo = 0; xo < width; xo++) {
+ if (!deMath.deInBounds32(x+xo, 0, src.raw().getHeight()) || !deMath.deInBounds32(y+yo, 0, src.raw().getDepth()))
+ continue; // Undefined pixel.
+
+ dst.setPixel(src.resolveMultisamplePixel(x+xo, y+yo), xo, yo);
+ }
+ }
+ } else if (target == gl.TEXTURE_CUBE_MAP_NEGATIVE_X ||
+ target == gl.TEXTURE_CUBE_MAP_POSITIVE_X ||
+ target == gl.TEXTURE_CUBE_MAP_NEGATIVE_Y ||
+ target == gl.TEXTURE_CUBE_MAP_POSITIVE_Y ||
+ target == gl.TEXTURE_CUBE_MAP_NEGATIVE_Z ||
+ target == gl.TEXTURE_CUBE_MAP_POSITIVE_Z) {
+ // Validate size and level.
+ if (this.conditionalSetError(width != height || width > this.m_limits.maxTextureCubeSize, gl.INVALID_VALUE))
+ return;
+ if (this.conditionalSetError(level > Math.floor(Math.log2(this.m_limits.maxTextureCubeSize)), gl.INVALID_VALUE))
+ return;
+
+ /** @type {sglrReferenceContext.TextureCube} */
+ var texture = /** @type {sglrReferenceContext.TextureCube} */ (unit.texCubeBinding.texture);
+ var face = sglrReferenceContext.mapGLCubeFace(target);
+
+ if (texture.isImmutable()) {
+ if (this.conditionalSetError(!texture.hasFace(level, face), gl.INVALID_OPERATION))
+ return;
+
+ /** @type {tcuTexture.PixelBufferAccess} */ var dst = texture.getFace(level, face);
+ if (this.conditionalSetError(storageFmt != dst.getFormat() || width != dst.getWidth() || height != dst.getHeight(), gl.INVALID_OPERATION))
+ return;
+ } else {
+ texture.allocLevel(level, face, storageFmt, width, height);
+ }
+
+ // Copy from current framebuffer.
+ /** @type {tcuTexture.PixelBufferAccess} */ var dst = texture.getFace(level, face);
+ for (var yo = 0; yo < height; yo++) {
+ for (var xo = 0; xo < width; xo++) {
+ if (!deMath.deInBounds32(x+xo, 0, src.raw().getHeight()) || !deMath.deInBounds32(y+yo, 0, src.raw().getDepth()))
+ continue; // Undefined pixel.
+
+ dst.setPixel(src.resolveMultisamplePixel(x+xo, y+yo), xo, yo);
+ }
+ }
+ } else {
+ this.setError(gl.INVALID_ENUM);
+ }
+ }
+
+ /**
+ * @param {number} target
+ * @param {number} level
+ * @param {number} xoffset
+ * @param {number} yoffset
+ * @param {number} x
+ * @param {number} y
+ * @param {number} width
+ * @param {number} height
+ */
+ sglrReferenceContext.ReferenceContext.prototype.copyTexSubImage2D = function(target, level, xoffset, yoffset, x, y, width, height) {
+ /** @type {sglrReferenceContext.TextureUnit} */var unit = this.m_textureUnits[this.m_activeTexture];
+ /** @type {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} */ var src = this.getReadColorbuffer();
+
+ if (this.conditionalSetError(xoffset < 0 || yoffset < 0, gl.INVALID_VALUE))
+ return;
+ if (this.conditionalSetError(width < 0 || height < 0 || level < 0, gl.INVALID_VALUE))
+ return;
+ if (this.conditionalSetError(src.isEmpty(), gl.INVALID_OPERATION))
+ return;
+
+ if (target == gl.TEXTURE_2D) {
+ /** @type {sglrReferenceContext.Texture2D} */
+ var texture = /** @type {sglrReferenceContext.Texture2D} */ (unit.tex2DBinding.texture);
+
+ if (this.conditionalSetError(!texture.hasLevel(level), gl.INVALID_VALUE))
+ return;
+
+ /** @type {tcuTexture.PixelBufferAccess} */ var dst = texture.getLevel(level);
+
+ if (this.conditionalSetError(xoffset + width > dst.getWidth() || yoffset + height > dst.getHeight(), gl.INVALID_VALUE))
+ return;
+
+ for (var yo = 0; yo < height; yo++) {
+ for (var xo = 0; xo < width; xo++) {
+ if (!deMath.deInBounds32(x+xo, 0, src.raw().getHeight()) || !deMath.deInBounds32(y+yo, 0, src.raw().getDepth()))
+ continue;
+
+ dst.setPixel(src.resolveMultisamplePixel(x+xo, y+yo), xo+xoffset, yo+yoffset);
+ }
+ }
+ } else if (target == gl.TEXTURE_CUBE_MAP_NEGATIVE_X ||
+ target == gl.TEXTURE_CUBE_MAP_POSITIVE_X ||
+ target == gl.TEXTURE_CUBE_MAP_NEGATIVE_Y ||
+ target == gl.TEXTURE_CUBE_MAP_POSITIVE_Y ||
+ target == gl.TEXTURE_CUBE_MAP_NEGATIVE_Z ||
+ target == gl.TEXTURE_CUBE_MAP_POSITIVE_Z) {
+ /** @type {sglrReferenceContext.TextureCube} */
+ var texture = /** @type {sglrReferenceContext.TextureCube} */ (unit.texCubeBinding.texture);
+ var face = sglrReferenceContext.mapGLCubeFace(target);
+
+ if (this.conditionalSetError(!texture.hasFace(level, face), gl.INVALID_VALUE))
+ return;
+
+ /** @type {tcuTexture.PixelBufferAccess} */ var dst = texture.getFace(level, face);
+
+ if (this.conditionalSetError(xoffset + width > dst.getWidth() || yoffset + height > dst.getHeight(), gl.INVALID_VALUE))
+ return;
+
+ for (var yo = 0; yo < height; yo++) {
+ for (var xo = 0; xo < width; xo++) {
+ if (!deMath.deInBounds32(x+xo, 0, src.raw().getHeight()) || !deMath.deInBounds32(y+yo, 0, src.raw().getDepth()))
+ continue;
+
+ dst.setPixel(src.resolveMultisamplePixel(x+xo, y+yo), xo+xoffset, yo+yoffset);
+ }
+ }
+ } else {
+ this.setError(gl.INVALID_ENUM);
+ }
+ }
+
+ sglrReferenceContext.ReferenceContext.prototype.texStorage3D = function(target, levels, internalFormat, width, height, depth) {
+ /** @type {sglrReferenceContext.TextureUnit} */var unit = this.m_textureUnits[this.m_activeTexture];
+
+ if (this.conditionalSetError(width <= 0 || height <= 0, gl.INVALID_VALUE))
+ return;
+ if (this.conditionalSetError(levels < 1 || levels > Math.floor(Math.log2(Math.max(width, height))) + 1, gl.INVALID_VALUE))
+ return;
+
+ // Map storage format.
+ /** @type {tcuTexture.TextureFormat} */ var storageFmt = sglrReferenceContext.mapInternalFormat(internalFormat);
+ if (this.conditionalSetError(!storageFmt, gl.INVALID_ENUM))
+ return;
+
+ if (target == gl.TEXTURE_2D_ARRAY) {
+ if (this.conditionalSetError(width > this.m_limits.maxTexture2DSize ||
+ height > this.m_limits.maxTexture2DSize ||
+ depth >= this.m_limits.maxTexture2DArrayLayers, gl.INVALID_VALUE))
+ return;
+
+ /** @type {sglrReferenceContext.Texture2DArray} */
+ var textureArray = /** @type {sglrReferenceContext.Texture2DArray} */ (unit.tex2DArrayBinding.texture);
+ if (this.conditionalSetError(textureArray.isImmutable(), gl.INVALID_OPERATION))
+ return;
+
+ textureArray.clearLevels();
+ textureArray.setImmutable();
+
+ for (var level = 0; level < levels; level++) {
+ var levelW = Math.max(1, width >> level);
+ var levelH = Math.max(1, height >> level);
+
+ textureArray.allocLevel(level, storageFmt, levelW, levelH, depth);
+ }
+ } else if (target == gl.TEXTURE_3D) {
+ if (this.conditionalSetError(width > this.m_limits.maxTexture2DSize ||
+ height > this.m_limits.maxTexture2DSize ||
+ depth >= this.m_limits.maxTexture3DSize, gl.INVALID_VALUE))
+ return;
+
+ /** @type {sglrReferenceContext.Texture3D} */
+ var texture3D = /** @type {sglrReferenceContext.Texture3D} */ (unit.tex3DBinding.texture);
+ if (this.conditionalSetError(texture3D.isImmutable(), gl.INVALID_OPERATION))
+ return;
+
+ texture3D.clearLevels();
+ texture3D.setImmutable();
+
+ for (var level = 0; level < levels; level++) {
+ var levelW = Math.max(1, width >> level);
+ var levelH = Math.max(1, height >> level);
+ var levelD = Math.max(1, depth >> level);
+
+ texture3D.allocLevel(level, storageFmt, levelW, levelH, levelD);
+ }
+ } else
+ this.setError(gl.INVALID_ENUM);
+ };
+
+ sglrReferenceContext.ReferenceContext.prototype.texStorage2D = function(target, levels, internalFormat, width, height) {
+ /** @type {sglrReferenceContext.TextureUnit} */var unit = this.m_textureUnits[this.m_activeTexture];
+
+ if (this.conditionalSetError(width <= 0 || height <= 0, gl.INVALID_VALUE))
+ return;
+ if (this.conditionalSetError(levels < 1 || levels > Math.floor(Math.log2(Math.max(width, height))) + 1, gl.INVALID_VALUE))
+ return;
+
+ // Map storage format.
+ /** @type {tcuTexture.TextureFormat} */ var storageFmt = sglrReferenceContext.mapInternalFormat(internalFormat);
+ if (this.conditionalSetError(!storageFmt, gl.INVALID_ENUM))
+ return;
+
+ if (target == gl.TEXTURE_2D) {
+ if (this.conditionalSetError(width > this.m_limits.maxTexture2DSize || height > this.m_limits.maxTexture2DSize, gl.INVALID_VALUE))
+ return;
+
+ /** @type {sglrReferenceContext.Texture2D} */
+ var texture = /** @type {sglrReferenceContext.Texture2D} */ (unit.tex2DBinding.texture);
+ if (this.conditionalSetError(texture.isImmutable(), gl.INVALID_OPERATION))
+ return;
+
+ texture.clearLevels();
+ texture.setImmutable();
+
+ for (var level = 0; level < levels; level++) {
+ var levelW = Math.max(1, width >> level);
+ var levelH = Math.max(1, height >> level);
+
+ texture.allocLevel(level, storageFmt, levelW, levelH);
+ }
+ } else if (target == gl.TEXTURE_CUBE_MAP) {
+ if (this.conditionalSetError(width != height || width > this.m_limits.maxTextureCubeSize, gl.INVALID_VALUE))
+ return;
+ var textureCube = /** @type {sglrReferenceContext.TextureCube} */ (unit.texCubeBinding.texture);
+ if (this.conditionalSetError(textureCube.isImmutable(), gl.INVALID_OPERATION))
+ return;
+
+ textureCube.clearLevels();
+ textureCube.setImmutable();
+
+ for (var level = 0; level < levels; level++) {
+ var levelW = Math.max(1, width >> level);
+ var levelH = Math.max(1, height >> level);
+
+ for (var face in tcuTexture.CubeFace)
+ textureCube.allocLevel(level, tcuTexture.CubeFace[face], storageFmt, levelW, levelH);
+ }
+ } else
+ this.setError(gl.INVALID_ENUM);
+ };
+
+ /**
+ * @param {number} value
+ * @return {?tcuTexture.WrapMode}
+ */
+ sglrReferenceContext.mapGLWrapMode = function(value) {
+ switch (value) {
+ case gl.CLAMP_TO_EDGE: return tcuTexture.WrapMode.CLAMP_TO_EDGE;
+ case gl.REPEAT: return tcuTexture.WrapMode.REPEAT_GL;
+ case gl.MIRRORED_REPEAT: return tcuTexture.WrapMode.MIRRORED_REPEAT_GL;
+ }
+ return null;
+ };
+
+ /**
+ * @param {number} value
+ * @return {?tcuTexture.FilterMode}
+ */
+ sglrReferenceContext.mapGLFilterMode = function(value) {
+ switch (value) {
+ case gl.NEAREST: return tcuTexture.FilterMode.NEAREST;
+ case gl.LINEAR: return tcuTexture.FilterMode.LINEAR;
+ case gl.NEAREST_MIPMAP_NEAREST: return tcuTexture.FilterMode.NEAREST_MIPMAP_NEAREST;
+ case gl.NEAREST_MIPMAP_LINEAR: return tcuTexture.FilterMode.NEAREST_MIPMAP_LINEAR;
+ case gl.LINEAR_MIPMAP_NEAREST: return tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST;
+ case gl.LINEAR_MIPMAP_LINEAR: return tcuTexture.FilterMode.LINEAR_MIPMAP_LINEAR;
+ }
+ return null;
+ };
+
+ /**
+ * @param {number} target
+ * @param {number} pname
+ * @param {number} value
+ */
+ sglrReferenceContext.ReferenceContext.prototype.texParameteri = function(target, pname, value) {
+ /** @type {sglrReferenceContext.TextureUnit} */ var unit = this.m_textureUnits[this.m_activeTexture];
+ /** @type {sglrReferenceContext.TextureContainer} */ var container = null;
+
+ switch (target) {
+ case gl.TEXTURE_2D: container = unit.tex2DBinding; break;
+ case gl.TEXTURE_CUBE_MAP: container = unit.texCubeBinding; break;
+ case gl.TEXTURE_2D_ARRAY: container = unit.tex2DArrayBinding; break;
+ case gl.TEXTURE_3D: container = unit.tex3DBinding; break;
+
+ default: this.setError(gl.INVALID_ENUM);
+ }
+
+ if (!container)
+ return;
+
+ /** @type {sglrReferenceContext.Texture} */
+ var texture = container.texture;
+
+ switch (pname) {
+ case gl.TEXTURE_WRAP_S: {
+ /** @type {?tcuTexture.WrapMode} */ var wrapS = sglrReferenceContext.mapGLWrapMode(value);
+ if (this.conditionalSetError(null == wrapS, gl.INVALID_VALUE))
+ return;
+ texture.getSampler().wrapS = /** @type {tcuTexture.WrapMode} */ (wrapS);
+ break;
+ }
+
+ case gl.TEXTURE_WRAP_T: {
+ /** @type {?tcuTexture.WrapMode} */ var wrapT = sglrReferenceContext.mapGLWrapMode(value);
+ if (this.conditionalSetError(null == wrapT, gl.INVALID_VALUE))
+ return;
+ texture.getSampler().wrapT = /** @type {tcuTexture.WrapMode} */ (wrapT);
+ break;
+ }
+
+ case gl.TEXTURE_WRAP_R: {
+ /** @type {?tcuTexture.WrapMode} */ var wrapR = sglrReferenceContext.mapGLWrapMode(value);
+ if (this.conditionalSetError(null == wrapR, gl.INVALID_VALUE))
+ return;
+ texture.getSampler().wrapR = /** @type {tcuTexture.WrapMode} */ (wrapR);
+ break;
+ }
+
+ case gl.TEXTURE_MIN_FILTER: {
+ /** @type {?tcuTexture.FilterMode} */ var minMode = sglrReferenceContext.mapGLFilterMode(value);
+ if (this.conditionalSetError(null == minMode, gl.INVALID_VALUE))
+ return;
+ texture.getSampler().minFilter = /** @type {tcuTexture.FilterMode} */ (minMode);
+ break;
+ }
+
+ case gl.TEXTURE_MAG_FILTER: {
+ /** @type {?tcuTexture.FilterMode} */ var magMode = sglrReferenceContext.mapGLFilterMode(value);
+ if (this.conditionalSetError(null == magMode, gl.INVALID_VALUE))
+ return;
+ texture.getSampler().magFilter = /** @type {tcuTexture.FilterMode} */ (magMode);
+ break;
+ }
+
+ case gl.TEXTURE_MAX_LEVEL: {
+ if (this.conditionalSetError(value < 0, gl.INVALID_VALUE))
+ return;
+ texture.setMaxLevel(value);
+ break;
+ }
+
+ default:
+ this.setError(gl.INVALID_ENUM);
+ return;
+ }
+ };
+
+ sglrReferenceContext.ReferenceContext.prototype.invalidateFramebuffer = function(target, attachments) {};
+ sglrReferenceContext.ReferenceContext.prototype.invalidateSubFramebuffer = function(target, attachments, x, y, width, height) {};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrReferenceContextTest.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrReferenceContextTest.js
new file mode 100644
index 0000000000..cc8abf5969
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrReferenceContextTest.js
@@ -0,0 +1,834 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+'use strict';
+goog.provide('framework.opengl.simplereference.sglrReferenceContextTest');
+goog.require('framework.common.tcuLogImage');
+goog.require('framework.common.tcuPixelFormat');
+goog.require('framework.common.tcuRGBA');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.opengl.gluDrawUtil');
+goog.require('framework.opengl.simplereference.sglrReferenceContext');
+goog.require('framework.opengl.simplereference.sglrShaderProgram');
+goog.require('framework.referencerenderer.rrFragmentOperations');
+goog.require('framework.referencerenderer.rrGenericVector');
+goog.require('framework.referencerenderer.rrShadingContext');
+goog.require('framework.referencerenderer.rrVertexAttrib');
+goog.require('framework.referencerenderer.rrVertexPacket');
+
+goog.scope(function() {
+ var sglrReferenceContextTest = framework.opengl.simplereference.sglrReferenceContextTest;
+ var sglrReferenceContext = framework.opengl.simplereference.sglrReferenceContext;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var tcuPixelFormat = framework.common.tcuPixelFormat;
+ var gluDrawUtil = framework.opengl.gluDrawUtil;
+ var tcuSurface = framework.common.tcuSurface;
+ var tcuLogImage = framework.common.tcuLogImage;
+ var sglrShaderProgram = framework.opengl.simplereference.sglrShaderProgram;
+ var rrGenericVector = framework.referencerenderer.rrGenericVector;
+ var rrVertexAttrib = framework.referencerenderer.rrVertexAttrib;
+ var rrShadingContext = framework.referencerenderer.rrShadingContext;
+ var rrVertexPacket = framework.referencerenderer.rrVertexPacket;
+ var rrFragmentOperations = framework.referencerenderer.rrFragmentOperations;
+ var tcuRGBA = framework.common.tcuRGBA;
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} description
+ */
+ sglrReferenceContextTest.ClearContext = function(name, description) {
+ tcuTestCase.DeqpTest.call(this, name, description);
+ };
+
+ sglrReferenceContextTest.ClearContext.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ sglrReferenceContextTest.ClearContext.prototype.constructor = sglrReferenceContextTest.ClearContext;
+
+ sglrReferenceContextTest.ClearContext.prototype.init = function() {};
+
+ sglrReferenceContextTest.ClearContext.prototype.iterate = function() {
+
+ var width = 200;
+ var height = 188;
+ var samples = 1;
+ var limits = new sglrReferenceContext.ReferenceContextLimits(gl);
+ var format = new tcuPixelFormat.PixelFormat(8, 8, 8, 8);
+ var buffers = new sglrReferenceContext.ReferenceContextBuffers(format, 24, 8, width, height, samples);
+ var ctx = new sglrReferenceContext.ReferenceContext(limits, buffers.getColorbuffer(), buffers.getDepthbuffer(), buffers.getStencilbuffer());
+ ctx.clearColor(1, 0, 0, 1);
+ ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+ var pixels = new tcuSurface.Surface(width, height);
+ ctx.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels.getAccess().getDataPtr());
+
+ var numFailedPixels = 0;
+ var redPixel = new gluDrawUtil.Pixel([255, 0, 0, 255]);
+ for (var x = 0; x < width; x++)
+ for (var y = 0; y < height; y++) {
+ var pixel = new gluDrawUtil.Pixel(pixels.getPixel(x, y));
+ if (!pixel.equals(redPixel))
+ numFailedPixels += 1;
+ }
+
+ var access = pixels.getAccess();
+
+ tcuLogImage.logImage('Result', '', access);
+
+ if (numFailedPixels > 0)
+ testFailedOptions('Image comparison failed, got ' + numFailedPixels + ' non-equal pixels.', false);
+ else
+ testPassedOptions('Image comparison succeed', true);
+
+ ctx.scissor(width / 4, height / 4, width / 2, height / 2);
+ ctx.enable(gl.SCISSOR_TEST);
+ ctx.clearColor(0, 1, 1, 1);
+ ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+ ctx.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels.getAccess().getDataPtr());
+
+ numFailedPixels = 0;
+ var greenBluePixel = new gluDrawUtil.Pixel([0, 255, 255, 255]);
+ for (var x = 0; x < width; x++)
+ for (var y = 0; y < height; y++) {
+ var pixel = new gluDrawUtil.Pixel(pixels.getPixel(x, y));
+ if ((x >= width / 4 && x < width - width / 4) && (y >= height / 4 && y < height - height / 4)) {
+ if (!pixel.equals(greenBluePixel))
+ numFailedPixels += 1;
+ } else
+ if (!pixel.equals(redPixel))
+ numFailedPixels += 1;
+ }
+
+ access = pixels.getAccess();
+
+ tcuLogImage.logImage('Result', '', access);
+
+ if (numFailedPixels > 0)
+ testFailedOptions('Image comparison failed, got ' + numFailedPixels + ' non-equal pixels.', false);
+ else
+ testPassedOptions('Image comparison succeed', true);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} description
+ */
+ sglrReferenceContextTest.Framebuffer = function(name, description) {
+ tcuTestCase.DeqpTest.call(this, name, description);
+ };
+
+ sglrReferenceContextTest.Framebuffer.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ sglrReferenceContextTest.Framebuffer.prototype.constructor = sglrReferenceContextTest.Framebuffer;
+
+ sglrReferenceContextTest.Framebuffer.prototype.init = function() {};
+
+ sglrReferenceContextTest.Framebuffer.prototype.iterate = function() {
+ var limits = new sglrReferenceContext.ReferenceContextLimits(gl);
+ var format = new tcuPixelFormat.PixelFormat(8, 8, 8, 8);
+ var width = 200;
+ var height = 188;
+ var samples = 1;
+ var buffers = new sglrReferenceContext.ReferenceContextBuffers(format, 24, 8, width, height, samples);
+ var ctx = new sglrReferenceContext.ReferenceContext(limits, buffers.getColorbuffer(), buffers.getDepthbuffer(), buffers.getStencilbuffer());
+ ctx.clearColor(0, 0, 1, 1);
+ ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+ var fbo = ctx.createFramebuffer();
+ var rbo = ctx.createRenderbuffer();
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, rbo);
+ ctx.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA8, width, height);
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo);
+ bufferedLogToConsole('Framebuffer status: ' + (ctx.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_COMPLETE));
+ ctx.clearColor(1, 0, 0, 1);
+ ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+ var pixels = new tcuSurface.Surface(width, height);
+ ctx.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels.getAccess().getDataPtr());
+ var numFailedPixels = 0;
+ var redPixel = new gluDrawUtil.Pixel([255, 0, 0, 255]);
+ for (var x = 0; x < width; x++)
+ for (var y = 0; y < height; y++) {
+ var pixel = new gluDrawUtil.Pixel(pixels.getPixel(x, y));
+ if (!pixel.equals(redPixel))
+ numFailedPixels += 1;
+ }
+ var access = pixels.getAccess();
+ tcuLogImage.logImage('Result', '', access);
+
+ if (numFailedPixels > 0)
+ testFailedOptions('Image comparison failed, got ' + numFailedPixels + ' non-equal pixels.', false);
+ else
+ testPassedOptions('Image comparison succeed', true);
+
+ ctx.scissor(width / 4, height / 4, width / 2, height / 2);
+ ctx.enable(gl.SCISSOR_TEST);
+ ctx.clearColor(0, 1, 1, 1);
+ ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+ ctx.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels.getAccess().getDataPtr());
+
+ numFailedPixels = 0;
+ var greenBluePixel = new gluDrawUtil.Pixel([0, 255, 255, 255]);
+ for (var x = 0; x < width; x++)
+ for (var y = 0; y < height; y++) {
+ var pixel = new gluDrawUtil.Pixel(pixels.getPixel(x, y));
+ if ((x >= width / 4 && x < width - width / 4) && (y >= height / 4 && y < height - height / 4)) {
+ if (!pixel.equals(greenBluePixel))
+ numFailedPixels += 1;
+ } else
+ if (!pixel.equals(redPixel))
+ numFailedPixels += 1;
+ }
+
+ access = pixels.getAccess();
+
+ tcuLogImage.logImage('Result', '', access);
+
+ if (numFailedPixels > 0)
+ testFailedOptions('Image comparison failed, got ' + numFailedPixels + ' non-equal pixels.', false);
+ else
+ testPassedOptions('Image comparison succeed', true);
+
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, null);
+ ctx.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels.getAccess().getDataPtr());
+
+ var bluePixel = new gluDrawUtil.Pixel([0, 0, 255, 255]);
+ for (var x = 0; x < width; x++)
+ for (var y = 0; y < height; y++) {
+ var pixel = new gluDrawUtil.Pixel(pixels.getPixel(x, y));
+ if (!pixel.equals(bluePixel))
+ numFailedPixels += 1;
+ }
+ access = pixels.getAccess();
+ tcuLogImage.logImage('Result', '', access);
+
+ if (numFailedPixels > 0)
+ testFailedOptions('Image comparison failed, got ' + numFailedPixels + ' non-equal pixels.', false);
+ else
+ testPassedOptions('Image comparison succeed', true);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} description
+ */
+ sglrReferenceContextTest.Shader = function(name, description) {
+ tcuTestCase.DeqpTest.call(this, name, description);
+ };
+
+ sglrReferenceContextTest.Shader.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ sglrReferenceContextTest.Shader.prototype.constructor = sglrReferenceContextTest.Shader;
+
+ sglrReferenceContextTest.Shader.prototype.init = function() {};
+
+ sglrReferenceContextTest.Shader.prototype.iterate = function() {
+ var limits = new sglrReferenceContext.ReferenceContextLimits(gl);
+ var format = new tcuPixelFormat.PixelFormat(8, 8, 8, 8);
+ var width = 200;
+ var height = 188;
+ var samples = 1;
+ var buffers = new sglrReferenceContext.ReferenceContextBuffers(format, 24, 8, width, height, samples);
+ var ctx = new sglrReferenceContext.ReferenceContext(limits, buffers.getColorbuffer(), buffers.getDepthbuffer(), buffers.getStencilbuffer());
+ ctx.clearColor(0, 0, 1, 1);
+ ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+
+ var vertices = [
+ -0.5, 0.5,
+ 0.5, 0.5,
+ -0.5, -0.5,
+ 0.5, 0.5,
+ 0.5, -0.5,
+ -0.5, -0.5
+ ];
+
+ var vertices32 = new Float32Array(vertices);
+
+ var squareVerticesBuffer = ctx.createBuffer();
+ ctx.bindBuffer(gl.ARRAY_BUFFER, squareVerticesBuffer);
+ ctx.bufferData(gl.ARRAY_BUFFER, vertices32, gl.STATIC_DRAW);
+
+ var colors = [
+ 1, 0, 0, 1,
+ 1, 0, 0, 1,
+ 1, 0, 0, 1,
+ 1, 0, 0, 1,
+ 1, 0, 0, 1,
+ 1, 0, 0, 1
+ ];
+
+ var colors32 = new Float32Array(colors);
+
+ var squareColorsBuffer = ctx.createBuffer();
+ ctx.bindBuffer(gl.ARRAY_BUFFER, squareColorsBuffer);
+ ctx.bufferData(gl.ARRAY_BUFFER, colors32, gl.STATIC_DRAW);
+
+ /** @type {sglrShaderProgram.ShaderProgramDeclaration} */ var progDecl = new sglrShaderProgram.ShaderProgramDeclaration();
+
+ progDecl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('aVertexPosition', rrGenericVector.GenericVecType.FLOAT));
+
+ progDecl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('aVertexColor', rrGenericVector.GenericVecType.FLOAT));
+
+ progDecl.pushVertexSource(new sglrShaderProgram.VertexSource(''));
+
+ progDecl.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(rrGenericVector.GenericVecType.FLOAT));
+
+ progDecl.pushFragmentSource(new sglrShaderProgram.FragmentSource(''));
+
+ /** @type {sglrReferenceContextTest.ContextShaderProgram} */ var program = new sglrReferenceContextTest.ContextShaderProgram(progDecl);
+
+ //Create program
+ ctx.createProgram(program);
+
+ //Use program
+ ctx.useProgram(program);
+
+ var vertexPositionAttribute = ctx.getAttribLocation(program, 'aVertexPosition');
+ var vertexColorAttribute = ctx.getAttribLocation(program, 'aVertexColor');
+ ctx.enableVertexAttribArray(vertexPositionAttribute);
+ ctx.enableVertexAttribArray(vertexColorAttribute);
+
+ ctx.bindBuffer(gl.ARRAY_BUFFER, squareVerticesBuffer);
+ ctx.vertexAttribPointer(vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
+
+ ctx.bindBuffer(gl.ARRAY_BUFFER, squareColorsBuffer);
+ ctx.vertexAttribPointer(vertexColorAttribute, 4, gl.FLOAT, false, 0, 0);
+
+ ctx.drawQuads(gl.TRIANGLES, 0, 6);
+
+ var pixels = new tcuSurface.Surface(width, height);
+ ctx.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels.getAccess().getDataPtr());
+
+ var numFailedPixels = 0;
+
+ var redPixel = new gluDrawUtil.Pixel([255, 0, 0, 255]);
+ var bluePixel = new gluDrawUtil.Pixel([0, 0, 255, 255]);
+
+ var pixel = new gluDrawUtil.Pixel(pixels.getPixel(0, 0));
+ if (!pixel.equals(bluePixel))
+ numFailedPixels += 1;
+
+ pixel = new gluDrawUtil.Pixel(pixels.getPixel(100, 94));
+ if (!pixel.equals(redPixel))
+ numFailedPixels += 1;
+
+ var access = pixels.getAccess();
+
+ tcuLogImage.logImage('Result', '', access);
+
+ if (numFailedPixels > 0)
+ testFailedOptions('Image comparison failed, got ' + numFailedPixels + ' non-equal pixels.', false);
+ else
+ testPassedOptions('Image comparison succeed', true);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} description
+ */
+ sglrReferenceContextTest.TriangleStrip = function(name, description) {
+ tcuTestCase.DeqpTest.call(this, name, description);
+ };
+
+ sglrReferenceContextTest.TriangleStrip.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ sglrReferenceContextTest.TriangleStrip.prototype.constructor = sglrReferenceContextTest.TriangleStrip;
+
+ sglrReferenceContextTest.TriangleStrip.prototype.init = function() {};
+
+ sglrReferenceContextTest.TriangleStrip.prototype.iterate = function() {
+ var limits = new sglrReferenceContext.ReferenceContextLimits(gl);
+ var format = new tcuPixelFormat.PixelFormat(8, 8, 8, 8);
+ var width = 200;
+ var height = 188;
+ var samples = 1;
+ var buffers = new sglrReferenceContext.ReferenceContextBuffers(format, 24, 8, width, height, samples);
+ var ctx = new sglrReferenceContext.ReferenceContext(limits, buffers.getColorbuffer(), buffers.getDepthbuffer(), buffers.getStencilbuffer());
+ ctx.clearColor(0, 0, 1, 1);
+ ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+
+ var vertices = [
+ -0.5, 0.5,
+ 0.5, 0.5,
+ -0.5, 0,
+ 0.5, 0,
+ -0.5, -0.5,
+ 0.5, -0.5
+ ];
+
+ var vertices32 = new Float32Array(vertices);
+
+ var squareVerticesBuffer = ctx.createBuffer();
+ ctx.bindBuffer(gl.ARRAY_BUFFER, squareVerticesBuffer);
+ ctx.bufferData(gl.ARRAY_BUFFER, vertices32, gl.STATIC_DRAW);
+
+ var colors = [
+ 1, 0, 0, 1,
+ 1, 0, 0, 1,
+ 1, 0, 0, 1,
+ 1, 0, 0, 1,
+ 1, 0, 0, 1,
+ 1, 0, 0, 1
+ ];
+
+ var colors32 = new Float32Array(colors);
+
+ var squareColorsBuffer = ctx.createBuffer();
+ ctx.bindBuffer(gl.ARRAY_BUFFER, squareColorsBuffer);
+ ctx.bufferData(gl.ARRAY_BUFFER, colors32, gl.STATIC_DRAW);
+
+ /** @type {sglrShaderProgram.ShaderProgramDeclaration} */ var progDecl = new sglrShaderProgram.ShaderProgramDeclaration();
+
+ progDecl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('aVertexPosition', rrGenericVector.GenericVecType.FLOAT));
+
+ progDecl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('aVertexColor', rrGenericVector.GenericVecType.FLOAT));
+
+ progDecl.pushVertexSource(new sglrShaderProgram.VertexSource(''));
+
+ progDecl.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(rrGenericVector.GenericVecType.FLOAT));
+
+ progDecl.pushFragmentSource(new sglrShaderProgram.FragmentSource(''));
+
+ /** @type {sglrReferenceContextTest.ContextShaderProgram} */ var program = new sglrReferenceContextTest.ContextShaderProgram(progDecl);
+
+ //Create program
+ ctx.createProgram(program);
+
+ //Use program
+ ctx.useProgram(program);
+
+ var vertexPositionAttribute = ctx.getAttribLocation(program, 'aVertexPosition');
+ var vertexColorAttribute = ctx.getAttribLocation(program, 'aVertexColor');
+ ctx.enableVertexAttribArray(vertexPositionAttribute);
+ ctx.enableVertexAttribArray(vertexColorAttribute);
+
+ ctx.bindBuffer(gl.ARRAY_BUFFER, squareVerticesBuffer);
+ ctx.vertexAttribPointer(vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
+
+ ctx.bindBuffer(gl.ARRAY_BUFFER, squareColorsBuffer);
+ ctx.vertexAttribPointer(vertexColorAttribute, 4, gl.FLOAT, false, 0, 0);
+
+ ctx.drawQuads(gl.TRIANGLE_STRIP, 0, 6);
+
+ var pixels = new tcuSurface.Surface(width, height);
+ ctx.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels.getAccess().getDataPtr());
+
+ var numFailedPixels = 0;
+
+ var redPixel = new gluDrawUtil.Pixel([255, 0, 0, 255]);
+ var bluePixel = new gluDrawUtil.Pixel([0, 0, 255, 255]);
+
+ var pixel = new gluDrawUtil.Pixel(pixels.getPixel(0, 0));
+ if (!pixel.equals(bluePixel))
+ numFailedPixels += 1;
+
+ pixel = new gluDrawUtil.Pixel(pixels.getPixel(100, 94));
+ if (!pixel.equals(redPixel))
+ numFailedPixels += 1;
+
+ var access = pixels.getAccess();
+
+ tcuLogImage.logImage('Result', '', access);
+
+ if (numFailedPixels > 0)
+ testFailedOptions('Image comparison failed, got ' + numFailedPixels + ' non-equal pixels.', false);
+ else
+ testPassedOptions('Image comparison succeed', true);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} description
+ */
+ sglrReferenceContextTest.TriangleFan = function(name, description) {
+ tcuTestCase.DeqpTest.call(this, name, description);
+ };
+
+ sglrReferenceContextTest.TriangleFan.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ sglrReferenceContextTest.TriangleFan.prototype.constructor = sglrReferenceContextTest.TriangleFan;
+
+ sglrReferenceContextTest.TriangleFan.prototype.init = function() {};
+
+ sglrReferenceContextTest.TriangleFan.prototype.iterate = function() {
+ var limits = new sglrReferenceContext.ReferenceContextLimits(gl);
+ var format = new tcuPixelFormat.PixelFormat(8, 8, 8, 8);
+ var width = 200;
+ var height = 188;
+ var samples = 1;
+ var buffers = new sglrReferenceContext.ReferenceContextBuffers(format, 24, 8, width, height, samples);
+ var ctx = new sglrReferenceContext.ReferenceContext(limits, buffers.getColorbuffer(), buffers.getDepthbuffer(), buffers.getStencilbuffer());
+ ctx.clearColor(0, 0, 1, 1);
+ ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+
+ var vertices = [
+ -0.5, 0,
+ -0.5, 0.5,
+ 0.5, 0.5,
+ 0.5, 0,
+ 0.5, -0.5,
+ -0.5, -0.5
+ ];
+
+ var vertices32 = new Float32Array(vertices);
+
+ var squareVerticesBuffer = ctx.createBuffer();
+ ctx.bindBuffer(gl.ARRAY_BUFFER, squareVerticesBuffer);
+ ctx.bufferData(gl.ARRAY_BUFFER, vertices32, gl.STATIC_DRAW);
+
+ var colors = [
+ 1, 0, 0, 1,
+ 1, 0, 0, 1,
+ 1, 0, 0, 1,
+ 1, 0, 0, 1,
+ 1, 0, 0, 1,
+ 1, 0, 0, 1
+ ];
+
+ var colors32 = new Float32Array(colors);
+
+ var squareColorsBuffer = ctx.createBuffer();
+ ctx.bindBuffer(gl.ARRAY_BUFFER, squareColorsBuffer);
+ ctx.bufferData(gl.ARRAY_BUFFER, colors32, gl.STATIC_DRAW);
+
+ /** @type {sglrShaderProgram.ShaderProgramDeclaration} */ var progDecl = new sglrShaderProgram.ShaderProgramDeclaration();
+
+ progDecl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('aVertexPosition', rrGenericVector.GenericVecType.FLOAT));
+
+ progDecl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('aVertexColor', rrGenericVector.GenericVecType.FLOAT));
+
+ progDecl.pushVertexSource(new sglrShaderProgram.VertexSource(''));
+
+ progDecl.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(rrGenericVector.GenericVecType.FLOAT));
+
+ progDecl.pushFragmentSource(new sglrShaderProgram.FragmentSource(''));
+
+ /** @type {sglrReferenceContextTest.ContextShaderProgram} */ var program = new sglrReferenceContextTest.ContextShaderProgram(progDecl);
+
+ //Create program
+ ctx.createProgram(program);
+
+ //Use program
+ ctx.useProgram(program);
+
+ var vertexPositionAttribute = ctx.getAttribLocation(program, 'aVertexPosition');
+ var vertexColorAttribute = ctx.getAttribLocation(program, 'aVertexColor');
+ ctx.enableVertexAttribArray(vertexPositionAttribute);
+ ctx.enableVertexAttribArray(vertexColorAttribute);
+
+ ctx.bindBuffer(gl.ARRAY_BUFFER, squareVerticesBuffer);
+ ctx.vertexAttribPointer(vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
+
+ ctx.bindBuffer(gl.ARRAY_BUFFER, squareColorsBuffer);
+ ctx.vertexAttribPointer(vertexColorAttribute, 4, gl.FLOAT, false, 0, 0);
+
+ ctx.drawQuads(gl.TRIANGLE_FAN, 0, 6);
+
+ var pixels = new tcuSurface.Surface(width, height);
+ ctx.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels.getAccess().getDataPtr());
+
+ var numFailedPixels = 0;
+
+ var redPixel = new gluDrawUtil.Pixel([255, 0, 0, 255]);
+ var bluePixel = new gluDrawUtil.Pixel([0, 0, 255, 255]);
+
+ var pixel = new gluDrawUtil.Pixel(pixels.getPixel(0, 0));
+ if (!pixel.equals(bluePixel))
+ numFailedPixels += 1;
+
+ pixel = new gluDrawUtil.Pixel(pixels.getPixel(100, 94));
+ if (!pixel.equals(redPixel))
+ numFailedPixels += 1;
+
+ var access = pixels.getAccess();
+
+ tcuLogImage.logImage('Result', '', access);
+
+ if (numFailedPixels > 0)
+ testFailedOptions('Image comparison failed, got ' + numFailedPixels + ' non-equal pixels.', false);
+ else
+ testPassedOptions('Image comparison succeed', true);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} description
+ */
+ sglrReferenceContextTest.DrawElements = function(name, description) {
+ tcuTestCase.DeqpTest.call(this, name, description);
+ };
+
+ sglrReferenceContextTest.DrawElements.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ sglrReferenceContextTest.DrawElements.prototype.constructor = sglrReferenceContextTest.DrawElements;
+
+ sglrReferenceContextTest.DrawElements.prototype.init = function() {};
+
+ sglrReferenceContextTest.DrawElements.prototype.iterate = function() {
+ var limits = new sglrReferenceContext.ReferenceContextLimits(gl);
+ var format = new tcuPixelFormat.PixelFormat(8, 8, 8, 8);
+ var width = 200;
+ var height = 188;
+ var samples = 1;
+ var buffers = new sglrReferenceContext.ReferenceContextBuffers(format, 24, 8, width, height, samples);
+ var ctx = new sglrReferenceContext.ReferenceContext(limits, buffers.getColorbuffer(), buffers.getDepthbuffer(), buffers.getStencilbuffer());
+ ctx.clearColor(0, 0, 1, 1);
+ ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+
+ var vertices = [
+ -0.5, 0.5,
+ 0, 0.5,
+ 0.4, 0.5,
+
+ -0.5, 0.1,
+ 0, 0.1,
+ 0.4, 0.1,
+
+ -0.5, -0.7,
+ 0, -0.7,
+ 0.4, -0.7
+ ];
+
+ var vertices32 = new Float32Array(vertices);
+
+ var squareVerticesBuffer = ctx.createBuffer();
+ ctx.bindBuffer(gl.ARRAY_BUFFER, squareVerticesBuffer);
+ ctx.bufferData(gl.ARRAY_BUFFER, vertices32, gl.STATIC_DRAW);
+
+ var indices = [
+ 0, 1, 3, 1, 3, 4,
+ 1, 2, 4, 2, 4, 5,
+ 3, 4, 6, 4, 6, 7,
+ 4, 5, 7, 5, 7, 8
+ ];
+ var indicesBuffer = ctx.createBuffer();
+ ctx.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indicesBuffer);
+ ctx.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(indices), gl.STATIC_DRAW);
+
+ var colors = [
+ 1, 0, 0, 1,
+ 0, 1, 0, 1,
+ 0, 0, 1, 1,
+ 1, 1, 1, 1,
+ 1, 1, 0, 1,
+ 0, 1, 1, 1,
+ 1, 0, 1, 1,
+ 0.5, 0.5, 0.5, 1,
+ 0, 0, 0, 0
+ ];
+
+ var colors32 = new Float32Array(colors);
+
+ var squareColorsBuffer = ctx.createBuffer();
+ ctx.bindBuffer(gl.ARRAY_BUFFER, squareColorsBuffer);
+ ctx.bufferData(gl.ARRAY_BUFFER, colors32, gl.STATIC_DRAW);
+
+ /** @type {sglrShaderProgram.ShaderProgramDeclaration} */ var progDecl = new sglrShaderProgram.ShaderProgramDeclaration();
+
+ progDecl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('aVertexPosition', rrGenericVector.GenericVecType.FLOAT));
+
+ progDecl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('aVertexColor', rrGenericVector.GenericVecType.FLOAT));
+
+ progDecl.pushVertexSource(new sglrShaderProgram.VertexSource(''));
+
+ progDecl.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(rrGenericVector.GenericVecType.FLOAT));
+
+ progDecl.pushFragmentSource(new sglrShaderProgram.FragmentSource(''));
+
+ /** @type {sglrReferenceContextTest.ContextShaderProgram} */ var program = new sglrReferenceContextTest.ContextShaderProgram(progDecl);
+
+ //Create program
+ ctx.createProgram(program);
+
+ //Use program
+ ctx.useProgram(program);
+
+ var vertexPositionAttribute = ctx.getAttribLocation(program, 'aVertexPosition');
+ var vertexColorAttribute = ctx.getAttribLocation(program, 'aVertexColor');
+ ctx.enableVertexAttribArray(vertexPositionAttribute);
+ ctx.enableVertexAttribArray(vertexColorAttribute);
+
+ ctx.bindBuffer(gl.ARRAY_BUFFER, squareVerticesBuffer);
+ ctx.vertexAttribPointer(vertexPositionAttribute, 2, gl.FLOAT, false, 0, 0);
+
+ ctx.bindBuffer(gl.ARRAY_BUFFER, squareColorsBuffer);
+ ctx.vertexAttribPointer(vertexColorAttribute, 4, gl.FLOAT, false, 0, 0);
+
+ ctx.drawElements(gl.TRIANGLES, indices.length, gl.UNSIGNED_SHORT, 0);
+
+ var pixels = new tcuSurface.Surface(width, height);
+ ctx.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels.getAccess().getDataPtr());
+
+ var numFailedPixels = 0;
+
+ var access = pixels.getAccess();
+
+ var pixelsTotest = [
+ // location, color
+ [2, 1], [0, 0, 255, 255],
+ // The red vertex is between 140 and 141 so account for some blending with the white vertex
+ [50, 140], [255, 5, 5, 255],
+ [50, 28], [255, 0, 255, 255],
+ [139, 28], [0, 0, 0, 255],
+ [50, 102], [255, 255, 255, 255],
+ [139, 102], [0, 255, 255, 255]
+ ];
+
+ var threshold = new tcuRGBA.RGBA([5, 5, 5, 5]);
+
+ for (var i = 0; i < pixelsTotest.length; i += 2) {
+ var location = pixelsTotest[i];
+ var reference = new tcuRGBA.RGBA(pixelsTotest[i + 1]);
+ var color = access.getPixelInt(location[0], location[1]);
+ var pixel = new tcuRGBA.RGBA(color);
+ if (!tcuRGBA.compareThreshold(pixel, reference, threshold))
+ numFailedPixels++;
+ }
+
+ tcuLogImage.logImage('Result', '', access);
+
+ if (numFailedPixels > 0)
+ testFailedOptions('Image comparison failed, got ' + numFailedPixels + ' non-equal pixels.', false);
+ else
+ testPassedOptions('Image comparison succeed', true);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {sglrShaderProgram.ShaderProgram}
+ * @param {sglrShaderProgram.ShaderProgramDeclaration} progDecl
+ */
+ sglrReferenceContextTest.ContextShaderProgram = function(progDecl) {
+ sglrShaderProgram.ShaderProgram.call(this, progDecl);
+ };
+
+ sglrReferenceContextTest.ContextShaderProgram.prototype = Object.create(sglrShaderProgram.ShaderProgram.prototype);
+ sglrReferenceContextTest.ContextShaderProgram.prototype.constructor = sglrReferenceContextTest.ContextShaderProgram;
+
+ /**
+ * @param {Array<rrVertexAttrib.VertexAttrib>} inputs
+ * @param {Array<rrVertexPacket.VertexPacket>} packets
+ * @param {number} numPackets
+ */
+ sglrReferenceContextTest.ContextShaderProgram.prototype.shadeVertices = function(inputs, packets, numPackets) {
+ for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) {
+ /** @type {number} */ var varyingLocColor = 0;
+
+ /** @type {rrVertexPacket.VertexPacket} */ var packet = packets[packetNdx];
+
+ // Calc output color
+ /** @type {Array<number>} */ var coord = [1.0, 1.0];
+ /** @type {Array<number>} */ var color = [1.0, 1.0, 1.0];
+
+ for (var attribNdx = 0; attribNdx < this.getVertexShader().getInputs().length; attribNdx++) {
+ /** @type {number} */ var numComponents = inputs[attribNdx].componentCount;
+
+ var attribValue = rrVertexAttrib.readVertexAttrib(inputs[attribNdx], packet.instanceNdx, packet.vertexNdx, this.getVertexShader().getInputs()[attribNdx].type);
+
+ if (attribNdx == 0) {
+ coord[0] = attribValue[0];
+ coord[1] = attribValue[1];
+ } else {
+ color[0] = attribValue[0] * attribValue[3];
+ color[1] = attribValue[1] * attribValue[3];
+ color[2] = attribValue[2] * attribValue[3];
+ }
+ }
+
+ // Transform position
+ packet.position = [coord[0], coord[1], 1.0, 1.0];
+
+ // Pass color to FS
+ packet.outputs[varyingLocColor] = [color[0], color[1], color[2], 1.0];
+ }
+ };
+
+ /**
+ * @param {Array<rrFragmentOperations.Fragment>} packets
+ * @param {rrShadingContext.FragmentShadingContext} context
+ */
+ sglrReferenceContextTest.ContextShaderProgram.prototype.shadeFragments = function(packets, context) {
+ var varyingLocColor = 0;
+
+ // Normal shading
+ for (var packetNdx = 0; packetNdx < packets.length; ++packetNdx)
+ packets[packetNdx].value = rrShadingContext.readTriangleVarying(packets[packetNdx], context, varyingLocColor);
+ };
+
+ sglrReferenceContextTest.init = function() {
+ var state = tcuTestCase.runner;
+ /** @type {tcuTestCase.DeqpTest} */ var testGroup = state.testCases;
+
+ /** @type {tcuTestCase.DeqpTest} */ var referenceContextGroup = tcuTestCase.newTest('reference_context', 'Test reference context');
+
+ referenceContextGroup.addChild(new sglrReferenceContextTest.ClearContext('clear_context', 'Clear Context Test'));
+ referenceContextGroup.addChild(new sglrReferenceContextTest.Framebuffer('Framebuffer', 'Framebuffer Test'));
+ referenceContextGroup.addChild(new sglrReferenceContextTest.Shader('Shaders', 'Drawing using TRIANGLES'));
+ referenceContextGroup.addChild(new sglrReferenceContextTest.TriangleStrip('TriangleStrip', 'Drawing using TRIANGLE_STRIP'));
+ referenceContextGroup.addChild(new sglrReferenceContextTest.TriangleFan('TriangleFan', 'Drawing using TRIANGLE_FAN'));
+ referenceContextGroup.addChild(new sglrReferenceContextTest.DrawElements('DrawElements', 'Drawing using DrawElements and TRIANGLES'));
+
+ testGroup.addChild(referenceContextGroup);
+
+ };
+
+ sglrReferenceContextTest.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var testName = 'single_reference_context';
+ var testDescription = 'Single Reference Context Tests';
+ var state = tcuTestCase.runner;
+
+ state.testName = testName;
+ state.testCases = tcuTestCase.newTest(testName, testDescription, null);
+
+ //Set up name and description of this test series.
+ setCurrentTestName(testName);
+ description(testDescription);
+
+ try {
+ //Create test cases
+ sglrReferenceContextTest.init();
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ bufferedLogToConsole(err);
+ tcuTestCase.runner.terminate();
+ }
+
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrReferenceUtils.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrReferenceUtils.js
new file mode 100644
index 0000000000..3b93dd8f9f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrReferenceUtils.js
@@ -0,0 +1,317 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief Reference context utils
+ *//*--------------------------------------------------------------------*/
+
+'use strict';
+goog.provide('framework.opengl.simplereference.sglrReferenceUtils');
+goog.require('framework.common.tcuFloat');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.referencerenderer.rrDefs');
+goog.require('framework.referencerenderer.rrGenericVector');
+goog.require('framework.referencerenderer.rrRenderState');
+goog.require('framework.referencerenderer.rrRenderer');
+goog.require('framework.referencerenderer.rrShaders');
+goog.require('framework.referencerenderer.rrVertexAttrib');
+
+goog.scope(function() {
+
+ var sglrReferenceUtils = framework.opengl.simplereference.sglrReferenceUtils;
+ var deMath = framework.delibs.debase.deMath;
+ var tcuFloat = framework.common.tcuFloat;
+ var rrGenericVector = framework.referencerenderer.rrGenericVector;
+ var rrVertexAttrib = framework.referencerenderer.rrVertexAttrib;
+ var rrRenderer = framework.referencerenderer.rrRenderer;
+ var rrDefs = framework.referencerenderer.rrDefs;
+ var rrShaders = framework.referencerenderer.rrShaders;
+ var rrRenderState = framework.referencerenderer.rrRenderState;
+
+ /**
+ * @param {number} type (32-bit, unsigend)
+ * @return {rrVertexAttrib.VertexAttribType}
+ * @throws {Error}
+ */
+ sglrReferenceUtils.mapGLPureIntegerVertexAttributeType = function(type) {
+ switch (type) {
+ case gl.UNSIGNED_BYTE: return rrVertexAttrib.VertexAttribType.PURE_UINT8;
+ case gl.UNSIGNED_SHORT: return rrVertexAttrib.VertexAttribType.PURE_UINT16;
+ case gl.UNSIGNED_INT: return rrVertexAttrib.VertexAttribType.PURE_UINT32;
+ case gl.BYTE: return rrVertexAttrib.VertexAttribType.PURE_INT8;
+ case gl.SHORT: return rrVertexAttrib.VertexAttribType.PURE_INT16;
+ case gl.INT: return rrVertexAttrib.VertexAttribType.PURE_INT32;
+ default:
+ throw new Error('Value to do mapping not compatible');
+ }
+ };
+
+ /**
+ * @param {number} type (32-bit, unsigend)
+ * @param {boolean} normalizedInteger
+ * @param {number} size
+ * @return {rrVertexAttrib.VertexAttribType} converted value from type to VertexAttribType
+ * @throws {Error}
+ */
+ sglrReferenceUtils.mapGLFloatVertexAttributeType = function(type, normalizedInteger, size) {
+
+ /** @type {boolean} */ var useClampingNormalization = true;
+
+ switch (type) {
+ case gl.FLOAT:
+ return rrVertexAttrib.VertexAttribType.FLOAT;
+ case gl.HALF_FLOAT:
+ return rrVertexAttrib.VertexAttribType.HALF;
+ /* Not supported in WebGL 1/2 case gl.FIXED:
+ return rrVertexAttrib.VertexAttribType.FIXED;
+ case gl.DOUBLE:
+ return rrVertexAttrib.VertexAttribType.DOUBLE; */
+ case gl.UNSIGNED_BYTE:
+ if (!normalizedInteger)
+ return rrVertexAttrib.VertexAttribType.NONPURE_UINT8;
+ else
+ return rrVertexAttrib.VertexAttribType.NONPURE_UNORM8;
+
+ case gl.UNSIGNED_SHORT:
+ if (!normalizedInteger)
+ return rrVertexAttrib.VertexAttribType.NONPURE_UINT16;
+ else
+ return rrVertexAttrib.VertexAttribType.NONPURE_UNORM16;
+
+ case gl.UNSIGNED_INT:
+ if (!normalizedInteger)
+ return rrVertexAttrib.VertexAttribType.NONPURE_UINT32;
+ else
+ return rrVertexAttrib.VertexAttribType.NONPURE_UNORM32;
+
+ case gl.UNSIGNED_INT_2_10_10_10_REV:
+ if (!normalizedInteger)
+ return rrVertexAttrib.VertexAttribType.NONPURE_UINT_2_10_10_10_REV;
+ else
+ return rrVertexAttrib.VertexAttribType.NONPURE_UNORM_2_10_10_10_REV;
+
+ case gl.BYTE:
+ if (!normalizedInteger)
+ return rrVertexAttrib.VertexAttribType.NONPURE_INT8;
+ else if (useClampingNormalization)
+ return rrVertexAttrib.VertexAttribType.NONPURE_SNORM8_CLAMP;
+ else
+ return rrVertexAttrib.VertexAttribType.NONPURE_SNORM8_SCALE;
+
+ case gl.SHORT:
+ if (!normalizedInteger)
+ return rrVertexAttrib.VertexAttribType.NONPURE_INT16;
+ else if (useClampingNormalization)
+ return rrVertexAttrib.VertexAttribType.NONPURE_SNORM16_CLAMP;
+ else
+ return rrVertexAttrib.VertexAttribType.NONPURE_SNORM16_SCALE;
+
+ case gl.INT:
+ if (!normalizedInteger)
+ return rrVertexAttrib.VertexAttribType.NONPURE_INT32;
+ else if (useClampingNormalization)
+ return rrVertexAttrib.VertexAttribType.NONPURE_SNORM32_CLAMP;
+ else
+ return rrVertexAttrib.VertexAttribType.NONPURE_SNORM32_SCALE;
+
+ case gl.INT_2_10_10_10_REV:
+ if (!normalizedInteger)
+ return rrVertexAttrib.VertexAttribType.NONPURE_INT_2_10_10_10_REV;
+ else if (useClampingNormalization)
+ return rrVertexAttrib.VertexAttribType.NONPURE_SNORM_2_10_10_10_REV_CLAMP;
+ else
+ return rrVertexAttrib.VertexAttribType.NONPURE_SNORM_2_10_10_10_REV_SCALE;
+
+ default:
+ throw new Error('Value to do mapping not compatible');
+
+ }
+
+ };
+
+ /**
+ * @param {number} size
+ * @return {number}
+ * @throws {Error}
+ */
+ sglrReferenceUtils.mapGLSize = function(size) {
+ switch (size) {
+ case 1: return 1;
+ case 2: return 2;
+ case 3: return 3;
+ case 4: return 4;
+ /* NOT in GL
+ case gl.BGRA: return 4;
+ */
+
+ default:
+ throw new Error('Value to do mapping not compatible');
+ }
+ };
+
+ /**
+ * @param {number} type (32-bit, unsigned)
+ * @return {rrRenderer.PrimitiveType}
+ * @throws {Error}
+ */
+ sglrReferenceUtils.mapGLPrimitiveType = function(type) {
+ switch (type) {
+ case gl.TRIANGLES: return rrRenderer.PrimitiveType.TRIANGLES;
+ case gl.TRIANGLE_STRIP: return rrRenderer.PrimitiveType.TRIANGLE_STRIP;
+ case gl.TRIANGLE_FAN: return rrRenderer.PrimitiveType.TRIANGLE_FAN;
+ case gl.LINES: return rrRenderer.PrimitiveType.LINES;
+ case gl.LINE_STRIP: return rrRenderer.PrimitiveType.LINE_STRIP;
+ case gl.LINE_LOOP: return rrRenderer.PrimitiveType.LINE_LOOP;
+ case gl.POINTS: return rrRenderer.PrimitiveType.POINTS;
+
+ default:
+ throw new Error('Value to do mapping not compatible');
+ }
+ };
+
+ /**
+ * @param {number} type (32-bit, unsigned)
+ * @return {rrDefs.IndexType}
+ * @throws {Error}
+ */
+ sglrReferenceUtils.mapGLIndexType = function(type) {
+ switch (type) {
+ case gl.UNSIGNED_BYTE: return rrDefs.IndexType.INDEXTYPE_UINT8;
+ case gl.UNSIGNED_SHORT: return rrDefs.IndexType.INDEXTYPE_UINT16;
+ case gl.UNSIGNED_INT: return rrDefs.IndexType.INDEXTYPE_UINT32;
+ default:
+ throw new Error('Value to do mapping not compatible');
+ }
+ };
+
+ /**
+ * @param {number} func (deUint32)
+ * @return {rrRenderState.TestFunc}
+ * @throws {Error}
+ */
+ sglrReferenceUtils.mapGLTestFunc = function(func) {
+ switch (func) {
+ case gl.ALWAYS: return rrRenderState.TestFunc.ALWAYS;
+ case gl.EQUAL: return rrRenderState.TestFunc.EQUAL;
+ case gl.GEQUAL: return rrRenderState.TestFunc.GEQUAL;
+ case gl.GREATER: return rrRenderState.TestFunc.GREATER;
+ case gl.LEQUAL: return rrRenderState.TestFunc.LEQUAL;
+ case gl.LESS: return rrRenderState.TestFunc.LESS;
+ case gl.NEVER: return rrRenderState.TestFunc.NEVER;
+ case gl.NOTEQUAL: return rrRenderState.TestFunc.NOTEQUAL;
+ default:
+ throw new Error('Value to do mapping not compatible');
+ }
+ };
+
+ /**
+ * @param {number} op (deUint32)
+ * @return {rrRenderState.StencilOp}
+ * @throws {Error}
+ */
+ sglrReferenceUtils.mapGLStencilOp = function(op) {
+ switch (op) {
+ case gl.KEEP: return rrRenderState.StencilOp.KEEP;
+ case gl.ZERO: return rrRenderState.StencilOp.ZERO;
+ case gl.REPLACE: return rrRenderState.StencilOp.REPLACE;
+ case gl.INCR: return rrRenderState.StencilOp.INCR;
+ case gl.DECR: return rrRenderState.StencilOp.DECR;
+ case gl.INCR_WRAP: return rrRenderState.StencilOp.INCR_WRAP;
+ case gl.DECR_WRAP: return rrRenderState.StencilOp.DECR_WRAP;
+ case gl.INVERT: return rrRenderState.StencilOp.INVERT;
+ default:
+ throw new Error('Value to do mapping not compatible');
+ }
+ };
+
+ /**
+ * @param {number} equation (deUint32)
+ * @return {rrRenderState.BlendEquation}
+ * @throws {Error}
+ */
+ sglrReferenceUtils.mapGLBlendEquation = function(equation) {
+ switch (equation) {
+ case gl.FUNC_ADD: return rrRenderState.BlendEquation.ADD;
+ case gl.FUNC_SUBTRACT: return rrRenderState.BlendEquation.SUBTRACT;
+ case gl.FUNC_REVERSE_SUBTRACT: return rrRenderState.BlendEquation.REVERSE_SUBTRACT;
+ case gl.MIN: return rrRenderState.BlendEquation.MIN;
+ case gl.MAX: return rrRenderState.BlendEquation.MAX;
+ default:
+ throw new Error('Value to do mapping not compatible');
+ }
+ };
+
+ /**
+ * @param {number} equation (deUint32)
+ * @return {rrRenderState.BlendEquationAdvanced}
+ * @throws {Error}
+ */
+ /*sglrReferenceUtils.mapGLBlendEquationAdvanced = function(equation) {
+ switch (equation) {
+ case gl.MULTIPLY_KHR: return rrRenderState.BlendEquationAdvanced.MULTIPLY;
+ case gl.SCREEN_KHR: return rrRenderState.BlendEquationAdvanced.SCREEN;
+ case gl.OVERLAY_KHR: return rrRenderState.BlendEquationAdvanced.OVERLAY;
+ case gl.DARKEN_KHR: return rrRenderState.BlendEquationAdvanced.DARKEN;
+ case gl.LIGHTEN_KHR: return rrRenderState.BlendEquationAdvanced.LIGHTEN;
+ case gl.COLORDODGE_KHR: return rrRenderState.BlendEquationAdvanced.COLORDODGE;
+ case gl.COLORBURN_KHR: return rrRenderState.BlendEquationAdvanced.COLORBURN;
+ case gl.HARDLIGHT_KHR: return rrRenderState.BlendEquationAdvanced.HARDLIGHT;
+ case gl.SOFTLIGHT_KHR: return rrRenderState.BlendEquationAdvanced.SOFTLIGHT;
+ case gl.DIFFERENCE_KHR: return rrRenderState.BlendEquationAdvanced.DIFFERENCE;
+ case gl.EXCLUSION_KHR: return rrRenderState.BlendEquationAdvanced.EXCLUSION;
+ case gl.HSL_HUE_KHR: return rrRenderState.BlendEquationAdvanced.HSL_HUE;
+ case gl.HSL_SATURATION_KHR: return rrRenderState.BlendEquationAdvanced.HSL_SATURATION;
+ case gl.HSL_COLOR_KHR: return rrRenderState.BlendEquationAdvanced.HSL_COLOR;
+ case gl.HSL_LUMINOSITY_KHR: return rrRenderState.BlendEquationAdvanced.HSL_LUMINOSITY;
+ default:
+ throw new Error("Value to do mapping not compatible");
+ }
+ };*/
+
+ /**
+ * @param {number} func (deUint32)
+ * @return {rrRenderState.BlendFunc}
+ * @throws {Error}
+ */
+ sglrReferenceUtils.mapGLBlendFunc = function(func) {
+ switch (func) {
+ case gl.ZERO: return rrRenderState.BlendFunc.ZERO;
+ case gl.ONE: return rrRenderState.BlendFunc.ONE;
+ case gl.SRC_COLOR: return rrRenderState.BlendFunc.SRC_COLOR;
+ case gl.ONE_MINUS_SRC_COLOR: return rrRenderState.BlendFunc.ONE_MINUS_SRC_COLOR;
+ case gl.DST_COLOR: return rrRenderState.BlendFunc.DST_COLOR;
+ case gl.ONE_MINUS_DST_COLOR: return rrRenderState.BlendFunc.ONE_MINUS_DST_COLOR;
+ case gl.SRC_ALPHA: return rrRenderState.BlendFunc.SRC_ALPHA;
+ case gl.ONE_MINUS_SRC_ALPHA: return rrRenderState.BlendFunc.ONE_MINUS_SRC_ALPHA;
+ case gl.DST_ALPHA: return rrRenderState.BlendFunc.DST_ALPHA;
+ case gl.ONE_MINUS_DST_ALPHA: return rrRenderState.BlendFunc.ONE_MINUS_DST_ALPHA;
+ case gl.CONSTANT_COLOR: return rrRenderState.BlendFunc.CONSTANT_COLOR;
+ case gl.ONE_MINUS_CONSTANT_COLOR: return rrRenderState.BlendFunc.ONE_MINUS_CONSTANT_COLOR;
+ case gl.CONSTANT_ALPHA: return rrRenderState.BlendFunc.CONSTANT_ALPHA;
+ case gl.ONE_MINUS_CONSTANT_ALPHA: return rrRenderState.BlendFunc.ONE_MINUS_CONSTANT_ALPHA;
+ case gl.SRC_ALPHA_SATURATE: return rrRenderState.BlendFunc.SRC_ALPHA_SATURATE;
+ // case gl.SRC1_COLOR: return rrRenderState.BlendFunc.SRC1_COLOR;
+ // case gl.ONE_MINUS_SRC1_COLOR: return rrRenderState.BlendFunc.ONE_MINUS_SRC1_COLOR;
+ // case gl.SRC1_ALPHA: return rrRenderState.BlendFunc.SRC1_ALPHA;
+ // case gl.ONE_MINUS_SRC1_ALPHA: return rrRenderState.BlendFunc.ONE_MINUS_SRC1_ALPHA;
+ default:
+ throw new Error('Value to do mapping not compatible');
+ }
+ };
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrShaderProgram.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrShaderProgram.js
new file mode 100644
index 0000000000..f5201a5315
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/opengl/simplereference/sglrShaderProgram.js
@@ -0,0 +1,336 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.opengl.simplereference.sglrShaderProgram');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluTextureUtil');
+goog.require('framework.referencerenderer.rrDefs');
+goog.require('framework.referencerenderer.rrFragmentOperations');
+goog.require('framework.referencerenderer.rrGenericVector');
+goog.require('framework.referencerenderer.rrShaders');
+goog.require('framework.referencerenderer.rrShadingContext');
+goog.require('framework.referencerenderer.rrVertexAttrib');
+goog.require('framework.referencerenderer.rrVertexPacket');
+
+goog.scope(function() {
+
+ var sglrShaderProgram = framework.opengl.simplereference.sglrShaderProgram;
+ var rrShaders = framework.referencerenderer.rrShaders;
+ var rrGenericVector = framework.referencerenderer.rrGenericVector;
+ var tcuTexture = framework.common.tcuTexture;
+ var deMath = framework.delibs.debase.deMath;
+ var gluTextureUtil = framework.opengl.gluTextureUtil;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var tcuTextureUtil = framework.common.tcuTextureUtil;
+ var rrDefs = framework.referencerenderer.rrDefs;
+ var rrFragmentOperations = framework.referencerenderer.rrFragmentOperations;
+ var rrVertexAttrib = framework.referencerenderer.rrVertexAttrib;
+ var rrVertexPacket = framework.referencerenderer.rrVertexPacket;
+ var rrShadingContext = framework.referencerenderer.rrShadingContext;
+
+ var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+ };
+
+ /**
+ * sglrShaderProgram.VaryingFlags
+ * @constructor
+ * @struct
+ */
+ sglrShaderProgram.VaryingFlags = function() {
+ this.NONE = true; //TODO: is NONE necessary?
+ this.FLATSHADE = false;
+ };
+
+ /**
+ * sglrShaderProgram.VertexAttribute
+ * @constructor
+ * @param {string} name_
+ * @param {rrGenericVector.GenericVecType} type_
+ */
+ sglrShaderProgram.VertexAttribute = function(name_, type_) {
+ this.name = name_;
+ this.type = type_;
+ };
+
+ /**
+ * sglrShaderProgram.VertexToFragmentVarying
+ * @constructor
+ * @param {rrGenericVector.GenericVecType} type_
+ * @param {sglrShaderProgram.VaryingFlags=} flags
+ */
+ sglrShaderProgram.VertexToFragmentVarying = function(type_, flags) {
+ this.type = type_;
+ this.flatshade = flags === undefined ? new sglrShaderProgram.VaryingFlags().FLATSHADE : flags.FLATSHADE;
+ };
+
+ /**
+ * sglrShaderProgram.FragmentOutput
+ * @constructor
+ * @param {rrGenericVector.GenericVecType} type_
+ */
+ sglrShaderProgram.FragmentOutput = function(type_) {
+ /** @type {rrGenericVector.GenericVecType} */ this.type = type_;
+ };
+
+ /**
+ * sglrShaderProgram.Uniform
+ * @constructor
+ * @param {string} name_
+ * @param {gluShaderUtil.DataType} type_
+ */
+ sglrShaderProgram.Uniform = function(name_, type_) {
+ /** @type {string} */ this.name = name_;
+ /** @type {gluShaderUtil.DataType} */ this.type = type_;
+ /** @type {Array<number>} */ this.value;
+ /** @type {?rrDefs.Sampler} */ this.sampler = null;
+ };
+
+ /**
+ * sglrShaderProgram.VertexSource
+ * @constructor
+ * @param {string} str
+ */
+ sglrShaderProgram.VertexSource = function(str) {
+ /** @type {string} */ this.source = str;
+ };
+
+ /**
+ * sglrShaderProgram.FragmentSource
+ * @constructor
+ * @param {string} str
+ */
+ sglrShaderProgram.FragmentSource = function(str) {
+ /** @type {string} */ this.source = str;
+ };
+
+ /**
+ * sglrShaderProgram.ShaderProgramDeclaration
+ * @constructor
+ */
+ sglrShaderProgram.ShaderProgramDeclaration = function() {
+ /** @type {Array<sglrShaderProgram.VertexAttribute>} */ this.m_vertexAttributes = [];
+ /** @type {Array<sglrShaderProgram.VertexToFragmentVarying>} */ this.m_vertexToFragmentVaryings = [];
+ /** @type {Array<sglrShaderProgram.FragmentOutput>} */ this.m_fragmentOutputs = [];
+ /** @type {Array<sglrShaderProgram.Uniform>} */ this.m_uniforms = [];
+ /** @type {string} */ this.m_vertexSource;
+ /** @type {string} */ this.m_fragmentSource;
+
+ /** @type {boolean} */ this.m_vertexShaderSet = false;
+ /** @type {boolean} */ this.m_fragmentShaderSet = false;
+ };
+
+ /**
+ * Add a vertex attribute to the shader program declaration.
+ * @param {sglrShaderProgram.VertexAttribute} v
+ * @return {sglrShaderProgram.ShaderProgramDeclaration}
+ */
+ sglrShaderProgram.ShaderProgramDeclaration.prototype.pushVertexAttribute = function(v) {
+ this.m_vertexAttributes.push(v);
+ return this;
+ };
+
+ /**
+ * Add a vertex to fragment varying to the shader program declaration.
+ * @param {sglrShaderProgram.VertexToFragmentVarying} v
+ * @return {sglrShaderProgram.ShaderProgramDeclaration}
+ */
+ sglrShaderProgram.ShaderProgramDeclaration.prototype.pushVertexToFragmentVarying = function(v) {
+ this.m_vertexToFragmentVaryings.push(v);
+ return this;
+ };
+
+ /**
+ * Add a fragment output to the shader program declaration.
+ * @param {sglrShaderProgram.FragmentOutput} v
+ * @return {sglrShaderProgram.ShaderProgramDeclaration}
+ */
+ sglrShaderProgram.ShaderProgramDeclaration.prototype.pushFragmentOutput = function(v) {
+ this.m_fragmentOutputs.push(v);
+ return this;
+ };
+
+ /**
+ * Add a uniform to the shader program declaration.
+ * @param {sglrShaderProgram.Uniform} v
+ * @return {sglrShaderProgram.ShaderProgramDeclaration}
+ */
+ sglrShaderProgram.ShaderProgramDeclaration.prototype.pushUniform = function(v) {
+ this.m_uniforms.push(v);
+ return this;
+ };
+
+ /**
+ * @param {sglrShaderProgram.VertexSource} c
+ * @return {sglrShaderProgram.ShaderProgramDeclaration}
+ */
+ sglrShaderProgram.ShaderProgramDeclaration.prototype.pushVertexSource = function(c) {
+ DE_ASSERT(!this.m_vertexShaderSet);
+ this.m_vertexSource = c.source;
+ this.m_vertexShaderSet = true;
+ return this;
+ };
+
+ /**
+ * @param {sglrShaderProgram.FragmentSource} c
+ * @return {sglrShaderProgram.ShaderProgramDeclaration}
+ */
+ sglrShaderProgram.ShaderProgramDeclaration.prototype.pushFragmentSource = function(c) {
+ DE_ASSERT(!this.m_fragmentSource);
+ /** @type {sglrShaderProgram.FragmentSource} */ this.m_fragmentSource = c.source;
+ /** @type {boolean} */ this.m_fragmentShaderSet = true;
+ return this;
+ };
+
+ /**
+ * @return {boolean}
+ */
+ sglrShaderProgram.ShaderProgramDeclaration.prototype.valid = function() {
+ if (!this.m_vertexShaderSet || !this.m_fragmentShaderSet)
+ return false;
+
+ if (this.m_fragmentOutputs.length == 0)
+ return false;
+
+ return true;
+ };
+
+ /**
+ * @return {number}
+ */
+ sglrShaderProgram.ShaderProgramDeclaration.prototype.getVertexInputCount = function() {
+ return this.m_vertexAttributes.length;
+ };
+
+ /**
+ * @return {number}
+ */
+ sglrShaderProgram.ShaderProgramDeclaration.prototype.getVertexOutputCount = function() {
+ return this.m_vertexToFragmentVaryings.length;
+ };
+
+ /**
+ * @return {number}
+ */
+ sglrShaderProgram.ShaderProgramDeclaration.prototype.getFragmentInputCount = function() {
+ return this.m_vertexToFragmentVaryings.length;
+ };
+
+ /**
+ * @return {number}
+ */
+ sglrShaderProgram.ShaderProgramDeclaration.prototype.getFragmentOutputCount = function() {
+ return this.m_fragmentOutputs.length;
+ };
+
+ /**
+ * @constructor
+ * @param {sglrShaderProgram.ShaderProgramDeclaration} decl
+ */
+ sglrShaderProgram.ShaderProgram = function(decl) {
+ /** @type {rrShaders.VertexShader} */ this.vertexShader = new rrShaders.VertexShader(decl.getVertexInputCount(), decl.getVertexOutputCount());
+ /** @type {rrShaders.FragmentShader} */ this.fragmentShader = new rrShaders.FragmentShader(decl.getFragmentInputCount(), decl.getFragmentOutputCount());
+
+ /** @type {Array<string>} */ this.m_attributeNames = [];
+ /** @type {Array<sglrShaderProgram.Uniform>} */ this.m_uniforms = [];
+ /** @type {string} */ this.m_vertSrc = decl.m_vertexSource;
+ /** @type {string} */ this.m_fragSrc = decl.m_fragmentSource;
+
+ DE_ASSERT(decl.valid());
+
+ // Set up shader IO
+
+ for (var ndx = 0; ndx < decl.m_vertexAttributes.length; ++ndx) {
+ this.vertexShader.m_inputs[ndx].type = decl.m_vertexAttributes[ndx].type;
+ this.m_attributeNames[ndx] = decl.m_vertexAttributes[ndx].name;
+ }
+
+ for (var ndx = 0; ndx < decl.m_vertexToFragmentVaryings.length; ++ndx) {
+ this.vertexShader.m_outputs[ndx].type = decl.m_vertexToFragmentVaryings[ndx].type;
+ this.vertexShader.m_outputs[ndx].flatshade = decl.m_vertexToFragmentVaryings[ndx].flatshade;
+
+ this.fragmentShader.m_inputs[ndx] = this.vertexShader.m_outputs[ndx];
+ }
+
+ for (var ndx = 0; ndx < decl.m_fragmentOutputs.length; ++ndx)
+ this.fragmentShader.m_outputs[ndx].type = decl.m_fragmentOutputs[ndx].type;
+
+ // Set up uniforms
+
+ for (var ndx = 0; ndx < decl.m_uniforms.length; ++ndx)
+ this.m_uniforms[ndx] = new sglrShaderProgram.Uniform(decl.m_uniforms[ndx].name, decl.m_uniforms[ndx].type);
+ };
+
+ /**
+ * @return {rrShaders.VertexShader}
+ */
+ sglrShaderProgram.ShaderProgram.prototype.getVertexShader = function() {
+ return this.vertexShader;
+ };
+
+ /**
+ * @return {rrShaders.FragmentShader}
+ */
+ sglrShaderProgram.ShaderProgram.prototype.getFragmentShader = function() {
+ return this.fragmentShader;
+ };
+
+ /**
+ * @param {string} name
+ * @return {sglrShaderProgram.Uniform}
+ * @throws {Error}
+ */
+ sglrShaderProgram.ShaderProgram.prototype.getUniformByName = function(name) {
+ DE_ASSERT(name);
+
+ for (var ndx = 0; ndx < this.m_uniforms.length; ++ndx)
+ if (this.m_uniforms[ndx].name == name)
+ return this.m_uniforms[ndx];
+
+ throw new Error('Invalid uniform name, uniform not found.');
+ };
+
+ /**
+ * shadeFragments - abstract function, to be implemented by children classes
+ * @param {Array<rrFragmentOperations.Fragment>} packets
+ * @param {rrShadingContext.FragmentShadingContext} context
+ * @throws {Error}
+ */
+ sglrShaderProgram.ShaderProgram.prototype.shadeFragments = function(packets, context) {
+ throw new Error('This function needs to be overwritten in a child class.');
+ };
+
+ /**
+ * shadeVertices - abstract function, to be implemented by children classes
+ * @param {Array<rrVertexAttrib.VertexAttrib>} inputs
+ * @param {Array<rrVertexPacket.VertexPacket>} packets
+ * @param {number} numPackets
+ * @throws {Error}
+ */
+ sglrShaderProgram.ShaderProgram.prototype.shadeVertices = function(inputs, packets, numPackets) {
+ throw new Error('This function needs to be overwritten in a child class.');
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrDefs.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrDefs.js
new file mode 100644
index 0000000000..c0400465e4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrDefs.js
@@ -0,0 +1,72 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.referencerenderer.rrDefs');
+
+goog.scope(function() {
+
+var rrDefs = framework.referencerenderer.rrDefs;
+
+/**
+ * @enum
+ */
+rrDefs.FaceType = {
+ FACETYPE_FRONT: 0,
+ FACETYPE_BACK: 1
+};
+
+/**
+ * @enum
+ */
+rrDefs.IndexType = {
+ INDEXTYPE_UINT8: 0,
+ INDEXTYPE_UINT16: 1,
+ INDEXTYPE_UINT32: 2
+};
+
+/**
+ * @enum
+ */
+rrDefs.ProvokingVertex = {
+ PROVOKINGVERTEX_FIRST: 1,
+ PROVOKINGVERTEX_LAST: 2 // \note valid value, "last vertex", not last of enum
+};
+
+/**
+ * @interface
+ */
+rrDefs.Sampler = function() {};
+
+/**
+ * @param {Array<number>} pos
+ * @param {number=} lod
+ * @return {Array<number>}
+ */
+rrDefs.Sampler.prototype.sample = function(pos, lod) {};
+
+/**
+ * @param {Array<Array<number>>} packetTexcoords 4 coordinates
+ * @param {number} lodBias
+ * @return {Array<Array<number>>} 4 vec4 samples
+ */
+rrDefs.Sampler.prototype.sample4 = function(packetTexcoords, lodBias) {};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrFragmentOperations.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrFragmentOperations.js
new file mode 100644
index 0000000000..a9c2a1f464
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrFragmentOperations.js
@@ -0,0 +1,583 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.referencerenderer.rrFragmentOperations');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.referencerenderer.rrRenderState');
+
+goog.scope(function() {
+
+var rrFragmentOperations = framework.referencerenderer.rrFragmentOperations;
+var deMath = framework.delibs.debase.deMath;
+var rrRenderState = framework.referencerenderer.rrRenderState;
+var tcuTexture = framework.common.tcuTexture;
+var tcuTextureUtil = framework.common.tcuTextureUtil;
+
+/** Return oldValue with the bits indicated by mask replaced by corresponding bits of newValue.
+ * @param {number} oldValue
+ * @param {number} newValue
+ * @param {number} mask
+ * @return {number}
+ */
+rrFragmentOperations.maskedBitReplace = function(oldValue, newValue, mask) {
+ return (oldValue & ~mask) | (newValue & mask);
+};
+
+/**
+ * @param {Array<number>} point
+ * @param {?} rect
+ * @return {boolean}
+ */
+rrFragmentOperations.isInsideRect = function(point, rect) {
+ return deMath.deInBounds32(point[0], rect.left, rect.left + rect.width) &&
+ deMath.deInBounds32(point[1], rect.bottom, rect.bottom + rect.height);
+};
+
+/**
+ * @constructor
+ * @param {Array<number>} coefficents
+ * @param {Array<number>} coords
+ * @param {number} depth
+ */
+rrFragmentOperations.Fragment = function(coefficents, coords, depth) {
+ /** @type {Array<number>} */ this.barycentric = coefficents;
+ /** @type {Array<number>} */ this.pixelCoord = coords;
+ /** @type {boolean} */ this.isAlive = true;
+ /** @type {boolean} */ this.stencilPassed = true;
+ /** @type {boolean} */ this.depthPassed = true;
+ /** @type {Array<number>} */ this.sampleDepths = [depth];
+ /** @type {Array<number>} */ this.clampedBlendSrcColor = [];
+ /** @type {Array<number>} */ this.clampedBlendSrc1Color = [];
+ /** @type {Array<number>} */ this.clampedBlendDstColor = [];
+ /** @type {Array<number>} */ this.blendSrcFactorRGB = [];
+ /** @type {number} */ this.blendSrcFactorA = NaN;
+ /** @type {Array<number>} */ this.blendDstFactorRGB = [];
+ /** @type {number} */ this.blendDstFactorA = NaN;
+ /** @type {Array<number>} */ this.blendedRGB = [];
+ /** @type {number} */ this.blendedA = NaN;
+ /** @type {Array<number>} */ this.signedValue = []; //!< integer targets
+ /** @type {Array<number>} */ this.unsignedValue = []; //!< unsigned integer targets
+ /** @type {Array<number>} */ this.value = []; /*TODO: what type should it be? */
+ /** @type {Array<number>} */ this.value1 = []; /*TODO: what type should it be? */
+};
+
+/**
+ * @param {Array<rrFragmentOperations.Fragment>} inputFragments Fragments to write
+ * @param {rrRenderState.WindowRectangle} scissorRect
+ */
+rrFragmentOperations.executeScissorTest = function(inputFragments, scissorRect) {
+ for (var i = 0; i < inputFragments.length; i++) {
+ var frag = inputFragments[i];
+ if (frag.isAlive) {
+ if (!rrFragmentOperations.isInsideRect(frag.pixelCoord, scissorRect))
+ frag.isAlive = false;
+ }
+ }
+};
+
+/**
+ * @param {Array<rrFragmentOperations.Fragment>} inputFragments Fragments to write
+ * @param {rrRenderState.StencilState} stencilState
+ * @param {number} numStencilBits
+ * @param {tcuTexture.PixelBufferAccess} stencilBuffer
+ */
+rrFragmentOperations.executeStencilCompare = function(inputFragments, stencilState, numStencilBits, stencilBuffer) {
+ var clampedStencilRef = deMath.clamp(stencilState.ref, 0, (1 << numStencilBits) - 1);
+
+ /**
+ * @param {function(number=,number=):boolean} expression
+ */
+ var sample_register_stencil_compare = function(expression) {
+ for (var i = 0; i < inputFragments.length; i++) {
+ var frag = inputFragments[i];
+ if (frag.isAlive) {
+ var fragSampleNdx = 0;
+ var stencilBufferValue = stencilBuffer.getPixStencil(fragSampleNdx, frag.pixelCoord[0], frag.pixelCoord[1]);
+ var maskedRef = stencilState.compMask & clampedStencilRef;
+ var maskedBuf = stencilState.compMask & stencilBufferValue;
+ frag.stencilPassed = expression(maskedRef, maskedBuf);
+ }
+ }
+ };
+
+ switch (stencilState.func) {
+ case rrRenderState.TestFunc.NEVER: sample_register_stencil_compare(function(maskedRef, maskedBuf) { return false;}); break;
+ case rrRenderState.TestFunc.ALWAYS: sample_register_stencil_compare(function(maskedRef, maskedBuf) { return true;}); break;
+ case rrRenderState.TestFunc.LESS: sample_register_stencil_compare(function(maskedRef, maskedBuf) { return maskedRef < maskedBuf;}); break;
+ case rrRenderState.TestFunc.LEQUAL: sample_register_stencil_compare(function(maskedRef, maskedBuf) { return maskedRef <= maskedBuf;}); break;
+ case rrRenderState.TestFunc.GREATER: sample_register_stencil_compare(function(maskedRef, maskedBuf) { return maskedRef > maskedBuf;}); break;
+ case rrRenderState.TestFunc.GEQUAL: sample_register_stencil_compare(function(maskedRef, maskedBuf) { return maskedRef >= maskedBuf;}); break;
+ case rrRenderState.TestFunc.EQUAL: sample_register_stencil_compare(function(maskedRef, maskedBuf) { return maskedRef == maskedBuf;}); break;
+ case rrRenderState.TestFunc.NOTEQUAL: sample_register_stencil_compare(function(maskedRef, maskedBuf) { return maskedRef != maskedBuf;}); break;
+ default:
+ throw new Error('Unrecognized stencil test function:' + stencilState.func);
+ }
+};
+
+/**
+ * @param {Array<rrFragmentOperations.Fragment>} inputFragments Fragments to write
+ * @param {rrRenderState.StencilState} stencilState
+ * @param {number} numStencilBits
+ * @param {tcuTexture.PixelBufferAccess} stencilBuffer
+ */
+rrFragmentOperations.executeStencilSFail = function(inputFragments, stencilState, numStencilBits, stencilBuffer) {
+ var clampedStencilRef = deMath.clamp(stencilState.ref, 0, (1 << numStencilBits) - 1);
+ /**
+ * @param {function(number,number):number} expression
+ */
+ var sample_register_sfail = function(expression) {
+ for (var i = 0; i < inputFragments.length; i++) {
+ var frag = inputFragments[i];
+ if (frag.isAlive && !frag.stencilPassed) {
+ var fragSampleNdx = 0;
+ var stencilBufferValue = stencilBuffer.getPixStencil(fragSampleNdx, frag.pixelCoord[0], frag.pixelCoord[1]);
+ stencilBuffer.setPixStencil(rrFragmentOperations.maskedBitReplace(stencilBufferValue, expression(stencilBufferValue, numStencilBits), stencilState.writeMask), fragSampleNdx, frag.pixelCoord[0], frag.pixelCoord[1]);
+ frag.isAlive = false;
+ }
+ }
+ };
+
+ switch (stencilState.sFail) {
+ case rrRenderState.StencilOp.KEEP:
+ sample_register_sfail(function(stencilBufferValue, numStencilBits) { return stencilBufferValue;}); break;
+ case rrRenderState.StencilOp.ZERO:
+ sample_register_sfail(function(stencilBufferValue, numStencilBits) { return 0;}); break;
+ case rrRenderState.StencilOp.REPLACE:
+ sample_register_sfail(function(stencilBufferValue, numStencilBits) { return clampedStencilRef;}); break;
+ case rrRenderState.StencilOp.INCR:
+ sample_register_sfail(function(stencilBufferValue, numStencilBits) { return deMath.clamp(stencilBufferValue + 1, 0, (1 << numStencilBits) - 1);}); break;
+ case rrRenderState.StencilOp.DECR:
+ sample_register_sfail(function(stencilBufferValue, numStencilBits) { return deMath.clamp(stencilBufferValue - 1, 0, (1 << numStencilBits) - 1);}); break;
+ case rrRenderState.StencilOp.INCR_WRAP:
+ sample_register_sfail(function(stencilBufferValue, numStencilBits) { return (stencilBufferValue + 1) & ((1 << numStencilBits) - 1);}); break;
+ case rrRenderState.StencilOp.DECR_WRAP:
+ sample_register_sfail(function(stencilBufferValue, numStencilBits) { return (stencilBufferValue - 1) & ((1 << numStencilBits) - 1);}); break;
+ case rrRenderState.StencilOp.INVERT:
+ sample_register_sfail(function(stencilBufferValue, numStencilBits) { return (~stencilBufferValue) & ((1 << numStencilBits) - 1);}); break;
+ default:
+ throw new Error('Unrecognized stencil op:' + stencilState.sFail);
+ }
+
+};
+
+/**
+ * @param {Array<rrFragmentOperations.Fragment>} inputFragments Fragments to write
+ * @param {rrRenderState.TestFunc} depthFunc
+ * @param {tcuTexture.PixelBufferAccess} depthBuffer
+ */
+rrFragmentOperations.executeDepthCompare = function(inputFragments, depthFunc, depthBuffer) {
+ /**
+ * @param {function(number=,number=):boolean} expression
+ */
+ var convertToDepthBuffer = false;
+
+ var access;
+ if (depthBuffer.getFormat().type != tcuTexture.ChannelType.FLOAT &&
+ depthBuffer.getFormat().type != tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV) {
+ access = new tcuTexture.PixelBufferAccess({
+ format: depthBuffer.getFormat(),
+ width: 1,
+ height: 1,
+ depth: 1,
+ data: new ArrayBuffer(8)
+ });
+ convertToDepthBuffer = true;
+ }
+
+ var sample_register_depth_compare = function(expression) {
+ for (var i = 0; i < inputFragments.length; i++) {
+ var frag = inputFragments[i];
+ if (frag.isAlive) {
+ var fragSampleNdx = 0;
+ var depthBufferValue = depthBuffer.getPixDepth(fragSampleNdx, frag.pixelCoord[0], frag.pixelCoord[1]);
+ var sampleDepthFloat = frag.sampleDepths[fragSampleNdx];
+
+ var sampleDepth;
+ if (convertToDepthBuffer) {
+ /* convert input float to target buffer format for comparison */
+ access.setPixDepth(sampleDepthFloat, 0, 0, 0);
+ sampleDepth = access.getPixDepth(0, 0, 0);
+ } else {
+ sampleDepth = deMath.clamp(sampleDepthFloat, 0.0, 1.0);
+ }
+
+ frag.depthPassed = expression(sampleDepth, depthBufferValue);
+ }
+ }
+ };
+
+ switch (depthFunc) {
+ case rrRenderState.TestFunc.NEVER: sample_register_depth_compare(function(sampleDepth, depthBufferValue) { return false;}); break;
+ case rrRenderState.TestFunc.ALWAYS: sample_register_depth_compare(function(sampleDepth, depthBufferValue) { return true;}); break;
+ case rrRenderState.TestFunc.LESS: sample_register_depth_compare(function(sampleDepth, depthBufferValue) { return sampleDepth < depthBufferValue;}); break;
+ case rrRenderState.TestFunc.LEQUAL: sample_register_depth_compare(function(sampleDepth, depthBufferValue) { return sampleDepth <= depthBufferValue;}); break;
+ case rrRenderState.TestFunc.GREATER: sample_register_depth_compare(function(sampleDepth, depthBufferValue) { return sampleDepth > depthBufferValue;}); break;
+ case rrRenderState.TestFunc.GEQUAL: sample_register_depth_compare(function(sampleDepth, depthBufferValue) { return sampleDepth >= depthBufferValue;}); break;
+ case rrRenderState.TestFunc.EQUAL: sample_register_depth_compare(function(sampleDepth, depthBufferValue) { return sampleDepth == depthBufferValue;}); break;
+ case rrRenderState.TestFunc.NOTEQUAL: sample_register_depth_compare(function(sampleDepth, depthBufferValue) { return sampleDepth != depthBufferValue;}); break;
+ default:
+ throw new Error('Unrecognized depth function:' + depthFunc);
+ }
+};
+
+/**
+ * @param {Array<rrFragmentOperations.Fragment>} inputFragments Fragments to write
+ * @param {tcuTexture.PixelBufferAccess} depthBuffer
+ */
+rrFragmentOperations.executeDepthWrite = function(inputFragments, depthBuffer) {
+ for (var i = 0; i < inputFragments.length; i++) {
+ var frag = inputFragments[i];
+ if (frag.isAlive && frag.depthPassed) {
+ var fragSampleNdx = 0;
+ var clampedDepth = deMath.clamp(frag.sampleDepths[fragSampleNdx], 0.0, 1.0);
+ depthBuffer.setPixDepth(clampedDepth, fragSampleNdx, frag.pixelCoord[0], frag.pixelCoord[1]);
+ }
+ }
+};
+
+/**
+ * @param {Array<rrFragmentOperations.Fragment>} inputFragments Fragments to write
+ * @param {rrRenderState.StencilState} stencilState
+ * @param {number} numStencilBits
+ * @param {tcuTexture.PixelBufferAccess} stencilBuffer
+ */
+rrFragmentOperations.executeStencilDpFailAndPass = function(inputFragments, stencilState, numStencilBits, stencilBuffer) {
+ var clampedStencilRef = deMath.clamp(stencilState.ref, 0, (1 << numStencilBits) - 1);
+
+ /**
+ * @param {function(boolean):boolean} condition
+ * @param {function(number,number):number} expression
+ */
+ var sample_register_dpfail_or_dppass = function(condition, expression) {
+ for (var i = 0; i < inputFragments.length; i++) {
+ var frag = inputFragments[i];
+ if (frag.isAlive && condition(frag.depthPassed)) {
+ var fragSampleNdx = 0;
+ var stencilBufferValue = stencilBuffer.getPixStencil(fragSampleNdx, frag.pixelCoord[0], frag.pixelCoord[1]);
+ stencilBuffer.setPixStencil(rrFragmentOperations.maskedBitReplace(stencilBufferValue, expression(stencilBufferValue, numStencilBits), stencilState.writeMask), fragSampleNdx, frag.pixelCoord[0], frag.pixelCoord[1]);
+ }
+ }
+ };
+
+ var switch_dpfail_or_dppass = function(op_name, condition) {
+ switch (stencilState[op_name]) {
+ case rrRenderState.StencilOp.KEEP: sample_register_dpfail_or_dppass(condition, function(stencilBufferValue, numStencilBits) { return stencilBufferValue;}); break;
+ case rrRenderState.StencilOp.ZERO: sample_register_dpfail_or_dppass(condition, function(stencilBufferValue, numStencilBits) { return 0;}); break;
+ case rrRenderState.StencilOp.REPLACE: sample_register_dpfail_or_dppass(condition, function(stencilBufferValue, numStencilBits) { return clampedStencilRef;}); break;
+ case rrRenderState.StencilOp.INCR: sample_register_dpfail_or_dppass(condition, function(stencilBufferValue, numStencilBits) { return deMath.clamp(stencilBufferValue + 1, 0, (1 << numStencilBits) - 1);}); break;
+ case rrRenderState.StencilOp.DECR: sample_register_dpfail_or_dppass(condition, function(stencilBufferValue, numStencilBits) { return deMath.clamp(stencilBufferValue - 1, 0, (1 << numStencilBits) - 1);}); break;
+ case rrRenderState.StencilOp.INCR_WRAP: sample_register_dpfail_or_dppass(condition, function(stencilBufferValue, numStencilBits) { return (stencilBufferValue + 1) & ((1 << numStencilBits) - 1);}); break;
+ case rrRenderState.StencilOp.DECR_WRAP: sample_register_dpfail_or_dppass(condition, function(stencilBufferValue, numStencilBits) { return (stencilBufferValue - 1) & ((1 << numStencilBits) - 1);}); break;
+ case rrRenderState.StencilOp.INVERT: sample_register_dpfail_or_dppass(condition, function(stencilBufferValue, numStencilBits) { return (~stencilBufferValue) & ((1 << numStencilBits) - 1);}); break;
+ default:
+ throw new Error('Unrecognized stencil operation:' + op_name);
+ }
+ };
+
+ var passed = function(depthPassed) { return depthPassed;};
+ var failed = function(depthPassed) { return !depthPassed;};
+
+ switch_dpfail_or_dppass('dpFail', failed);
+ switch_dpfail_or_dppass('dpPass', passed);
+};
+
+/**
+ * @param {Array<rrFragmentOperations.Fragment>} inputFragments Fragments to write
+ * @param {Array<number>} blendColor
+ * @param {rrRenderState.BlendState} blendRGBState
+ */
+rrFragmentOperations.executeBlendFactorComputeRGB = function(inputFragments, blendColor, blendRGBState) {
+ /**
+ * @param {string} factor_name
+ * @param {function(Array<number>, Array<number>, Array<number>):Array<number>} expression
+ */
+ var sample_register_blend_factor = function(factor_name, expression) {
+ for (var i = 0; i < inputFragments.length; i++) {
+ var frag = inputFragments[i];
+ if (frag.isAlive) {
+ var src = frag.clampedBlendSrcColor;
+ var src1 = frag.clampedBlendSrc1Color;
+ var dst = frag.clampedBlendDstColor;
+ frag[factor_name] = deMath.clampVector(expression(src, src1, dst), 0, 1);
+ }
+ }
+ };
+
+ var switch_src_or_dst_factor_rgb = function(func_name, factor_name) {
+ switch (blendRGBState[func_name]) {
+ case rrRenderState.BlendFunc.ZERO:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return [0, 0, 0];}); break;
+ case rrRenderState.BlendFunc.ONE:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return [1, 1, 1];}); break;
+ case rrRenderState.BlendFunc.SRC_COLOR:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return deMath.swizzle(src, [0, 1, 2]);}); break;
+ case rrRenderState.BlendFunc.ONE_MINUS_SRC_COLOR:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return deMath.subtract([1, 1, 1], deMath.swizzle(src, [0, 1, 2]));}); break;
+ case rrRenderState.BlendFunc.DST_COLOR:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return deMath.swizzle(dst, [0, 1, 2]);}); break;
+ case rrRenderState.BlendFunc.ONE_MINUS_DST_COLOR:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return deMath.subtract([1, 1, 1], deMath.swizzle(dst, [0, 1, 2]));}); break;
+ case rrRenderState.BlendFunc.SRC_ALPHA:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return [src[3], src[3], src[3]];}); break;
+ case rrRenderState.BlendFunc.ONE_MINUS_SRC_ALPHA:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return [1.0 - src[3], 1.0 - src[3], 1.0 - src[3]];}); break;
+ case rrRenderState.BlendFunc.DST_ALPHA:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return [dst[3], dst[3], dst[3]];}); break;
+ case rrRenderState.BlendFunc.ONE_MINUS_DST_ALPHA:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return [1.0 - dst[3], 1.0 - dst[3], 1.0 - dst[3]];}); break;
+ case rrRenderState.BlendFunc.CONSTANT_COLOR:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return deMath.swizzle(blendColor, [0, 1, 2]);}); break;
+ case rrRenderState.BlendFunc.ONE_MINUS_CONSTANT_COLOR:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return deMath.subtract([1, 1, 1], deMath.swizzle(blendColor, [0, 1, 2]));}); break;
+ case rrRenderState.BlendFunc.CONSTANT_ALPHA:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return [blendColor[3], blendColor[3], blendColor[3]];}); break;
+ case rrRenderState.BlendFunc.ONE_MINUS_CONSTANT_ALPHA:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return [1.0 - blendColor[3], 1.0 - blendColor[3], 1.0 - blendColor[3]];}); break;
+ case rrRenderState.BlendFunc.SRC_ALPHA_SATURATE:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return [Math.min(src[3], 1.0 - dst[3]), Math.min(src[3], 1.0 - dst[3]), Math.min(src[3], 1.0 - dst[3])];}); break;
+ case rrRenderState.BlendFunc.SRC1_COLOR:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return deMath.swizzle(src1, [0, 1, 2]);}); break;
+ case rrRenderState.BlendFunc.ONE_MINUS_SRC1_COLOR:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return deMath.subtract([1, 1, 1], deMath.swizzle(src1, [0, 1, 2]));}); break;
+ case rrRenderState.BlendFunc.SRC1_ALPHA:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return [src1[3], src1[3], src1[3]];}); break;
+ case rrRenderState.BlendFunc.ONE_MINUS_SRC1_ALPHA:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return [1.0 - src1[3], 1.0 - src1[3], 1.0 - src1[3]];}); break;
+ default:
+ throw new Error('Unrecognized blend function:' + func_name);
+ }
+ };
+
+ switch_src_or_dst_factor_rgb('srcFunc', 'blendSrcFactorRGB');
+ switch_src_or_dst_factor_rgb('dstFunc', 'blendDstFactorRGB');
+
+};
+
+/**
+ * @param {Array<rrFragmentOperations.Fragment>} inputFragments Fragments to write
+ * @param {Array<number>} blendColor
+ * @param {rrRenderState.BlendState} blendAState
+ */
+rrFragmentOperations.executeBlendFactorComputeA = function(inputFragments, blendColor, blendAState) {
+ /**
+ * @param {string} factor_name
+ * @param {function(Array<number>, Array<number>, Array<number>):number} expression
+ */
+ var sample_register_blend_factor = function(factor_name, expression) {
+ for (var i = 0; i < inputFragments.length; i++) {
+ var frag = inputFragments[i];
+ if (frag.isAlive) {
+ var src = frag.clampedBlendSrcColor;
+ var src1 = frag.clampedBlendSrc1Color;
+ var dst = frag.clampedBlendDstColor;
+ frag[factor_name] = deMath.clamp(expression(src, src1, dst), 0, 1);
+ }
+ }
+ };
+
+ var swictch_src_or_dst_factor_a = function(func_name, factor_name) {
+ switch (blendAState[func_name]) {
+ case rrRenderState.BlendFunc.ZERO:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return 0.0;}); break;
+ case rrRenderState.BlendFunc.ONE:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return 1.0;}); break;
+ case rrRenderState.BlendFunc.SRC_COLOR:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return src[3];}); break;
+ case rrRenderState.BlendFunc.ONE_MINUS_SRC_COLOR:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return 1.0 - src[3];}); break;
+ case rrRenderState.BlendFunc.DST_COLOR:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return dst[3];}); break;
+ case rrRenderState.BlendFunc.ONE_MINUS_DST_COLOR:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return 1.0 - dst[3];}); break;
+ case rrRenderState.BlendFunc.SRC_ALPHA:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return src[3];}); break;
+ case rrRenderState.BlendFunc.ONE_MINUS_SRC_ALPHA:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return 1.0 - src[3];}); break;
+ case rrRenderState.BlendFunc.DST_ALPHA:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return dst[3];}); break;
+ case rrRenderState.BlendFunc.ONE_MINUS_DST_ALPHA:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return 1.0 - dst[3];}); break;
+ case rrRenderState.BlendFunc.CONSTANT_COLOR:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return blendColor[3];}); break;
+ case rrRenderState.BlendFunc.ONE_MINUS_CONSTANT_COLOR:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return 1.0 - blendColor[3];}); break;
+ case rrRenderState.BlendFunc.CONSTANT_ALPHA:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return blendColor[3];}); break;
+ case rrRenderState.BlendFunc.ONE_MINUS_CONSTANT_ALPHA:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return 1.0 - blendColor[3];}); break;
+ case rrRenderState.BlendFunc.SRC_ALPHA_SATURATE:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return 1.0;}); break;
+ case rrRenderState.BlendFunc.SRC1_COLOR:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return src1[3];}); break;
+ case rrRenderState.BlendFunc.ONE_MINUS_SRC1_COLOR:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return 1.0 - src1[3];}); break;
+ case rrRenderState.BlendFunc.SRC1_ALPHA:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return src1[3];}); break;
+ case rrRenderState.BlendFunc.ONE_MINUS_SRC1_ALPHA:
+ sample_register_blend_factor(factor_name, function(src, src1, dst) { return 1.0 - src1[3];}); break;
+ default:
+ throw new Error('Unrecognized blend function:' + func_name);
+ }
+ };
+
+ swictch_src_or_dst_factor_a('srcFunc', 'blendSrcFactorA');
+ swictch_src_or_dst_factor_a('dstFunc', 'blendDstFactorA');
+};
+
+/**
+ * @param {Array<rrFragmentOperations.Fragment>} inputFragments Fragments to write
+ * @param {rrRenderState.BlendState} blendRGBState
+ * @param {rrRenderState.BlendState} blendAState
+ */
+rrFragmentOperations.executeBlend = function(inputFragments, blendRGBState, blendAState) {
+ var sample_register_blended_color = function(color_name, expression) {
+ for (var i = 0; i < inputFragments.length; i++) {
+ var frag = inputFragments[i];
+ if (frag.isAlive) {
+ var src = frag.clampedBlendSrcColor;
+ var dst = frag.clampedBlendDstColor;
+ frag[color_name] = expression(src, dst, frag);
+ }
+ }
+ };
+
+ switch (blendRGBState.equation) {
+ case rrRenderState.BlendEquation.ADD:
+ sample_register_blended_color('blendedRGB', function(src, dst, frag) { return deMath.add(deMath.multiply(deMath.swizzle(src, [0, 1, 2]), frag.blendSrcFactorRGB), deMath.multiply(deMath.swizzle(dst, [0, 1, 2]), frag.blendDstFactorRGB));}); break;
+ case rrRenderState.BlendEquation.SUBTRACT:
+ sample_register_blended_color('blendedRGB', function(src, dst, frag) { return deMath.subtract(deMath.multiply(deMath.swizzle(src, [0, 1, 2]), frag.blendSrcFactorRGB), deMath.multiply(deMath.swizzle(dst, [0, 1, 2]), frag.blendDstFactorRGB));}); break;
+ case rrRenderState.BlendEquation.REVERSE_SUBTRACT:
+ sample_register_blended_color('blendedRGB', function(src, dst, frag) { return deMath.subtract(deMath.multiply(deMath.swizzle(dst, [0, 1, 2]), frag.blendDstFactorRGB), deMath.multiply(deMath.swizzle(src, [0, 1, 2]), frag.blendSrcFactorRGB));}); break;
+ case rrRenderState.BlendEquation.MIN:
+ sample_register_blended_color('blendedRGB', function(src, dst, frag) { return deMath.min(deMath.swizzle(src, [0, 1, 2]), deMath.swizzle(dst, [0, 1, 2]));}); break;
+ case rrRenderState.BlendEquation.MAX:
+ sample_register_blended_color('blendedRGB', function(src, dst, frag) { return deMath.max(deMath.swizzle(src, [0, 1, 2]), deMath.swizzle(dst, [0, 1, 2]));}); break;
+ default:
+ throw new Error('Unrecognized blend equation:' + blendRGBState.equation);
+ }
+
+ switch (blendAState.equation) {
+ case rrRenderState.BlendEquation.ADD:
+ sample_register_blended_color('blendedA', function(src, dst, frag) { return src[3] * frag.blendSrcFactorA + dst[3] * frag.blendDstFactorA;}); break;
+ case rrRenderState.BlendEquation.SUBTRACT:
+ sample_register_blended_color('blendedA', function(src, dst, frag) { return src[3] * frag.blendSrcFactorA - dst[3] * frag.blendDstFactorA;}); break;
+ case rrRenderState.BlendEquation.REVERSE_SUBTRACT:
+ sample_register_blended_color('blendedA', function(src, dst, frag) { return dst[3] * frag.blendDstFactorA - src[3] * frag.blendSrcFactorA;}); break;
+ case rrRenderState.BlendEquation.MIN:
+ sample_register_blended_color('blendedA', function(src, dst, frag) { return Math.min(src[3], dst[3]);}); break;
+ case rrRenderState.BlendEquation.MAX:
+ sample_register_blended_color('blendedA', function(src, dst, frag) { return Math.max(src[3], dst[3]);}); break;
+ default:
+ throw new Error('Unrecognized blend equation:' + blendAState.equation);
+ }
+};
+
+/**
+ * @param {Array<rrFragmentOperations.Fragment>} inputFragments
+ * @param {boolean} isSRGB
+ * @param {tcuTexture.PixelBufferAccess} colorBuffer
+ */
+rrFragmentOperations.executeColorWrite = function(inputFragments, isSRGB, colorBuffer) {
+ for (var i = 0; i < inputFragments.length; i++) {
+ var frag = inputFragments[i];
+ if (frag.isAlive) {
+ var combinedColor = frag.blendedRGB.slice();
+ combinedColor[3] = frag.blendedA;
+ if (isSRGB)
+ combinedColor = tcuTextureUtil.linearToSRGB(combinedColor);
+
+ colorBuffer.setPixel(combinedColor, 0, frag.pixelCoord[0], frag.pixelCoord[1]);
+ }
+ }
+};
+
+/**
+ * @param {Array<rrFragmentOperations.Fragment>} inputFragments
+ * @param {Array<boolean>} colorMaskFactor
+ * @param {Array<boolean>} colorMaskNegationFactor
+ * @param {boolean} isSRGB
+ * @param {tcuTexture.PixelBufferAccess} colorBuffer
+ */
+rrFragmentOperations.executeMaskedColorWrite = function(inputFragments, colorMaskFactor, colorMaskNegationFactor, isSRGB, colorBuffer) {
+ for (var i = 0; i < inputFragments.length; i++) {
+ var frag = inputFragments[i];
+ if (frag.isAlive) {
+ var fragSampleNdx = 0;
+ var originalColor = colorBuffer.getPixel(fragSampleNdx, frag.pixelCoord[0], frag.pixelCoord[1]);
+ var newColor = frag.blendedRGB.slice();
+ newColor[3] = frag.blendedA;
+
+ if (isSRGB)
+ newColor = tcuTextureUtil.linearToSRGB(newColor);
+
+ newColor = deMath.add(deMath.multiply(colorMaskFactor, newColor), deMath.multiply(colorMaskNegationFactor, originalColor));
+
+ colorBuffer.setPixel(newColor, fragSampleNdx, frag.pixelCoord[0], frag.pixelCoord[1]);
+ }
+ }
+};
+
+/**
+ * @param {Array<rrFragmentOperations.Fragment>} inputFragments
+ * @param {Array<boolean>} colorMask
+ * @param {tcuTexture.PixelBufferAccess} colorBuffer
+ */
+rrFragmentOperations.executeSignedValueWrite = function(inputFragments, colorMask, colorBuffer) {
+ for (var i = 0; i < inputFragments.length; i++) {
+ var frag = inputFragments[i];
+ if (frag.isAlive) {
+ var fragSampleNdx = 0;
+ var originalValue = colorBuffer.getPixelInt(fragSampleNdx, frag.pixelCoord[0], frag.pixelCoord[1]);
+ var newValue = tcuTextureUtil.select(frag.signedValue, originalValue, colorMask);
+
+ colorBuffer.setPixelInt(newValue, fragSampleNdx, frag.pixelCoord[0], frag.pixelCoord[1]);
+ }
+ }
+};
+
+/**
+ * @param {Array<rrFragmentOperations.Fragment>} inputFragments
+ * @param {Array<boolean>} colorMask
+ * @param {tcuTexture.PixelBufferAccess} colorBuffer
+ */
+rrFragmentOperations.executeUnsignedValueWrite = function(inputFragments, colorMask, colorBuffer) {
+ for (var i = 0; i < inputFragments.length; i++) {
+ var frag = inputFragments[i];
+ if (frag.isAlive) {
+ var fragSampleNdx = 0;
+ var originalValue = colorBuffer.getPixelInt(fragSampleNdx, frag.pixelCoord[0], frag.pixelCoord[1]);
+ var newValue = tcuTextureUtil.select(frag.unsignedValue, originalValue, colorMask);
+
+ colorBuffer.setPixelInt(newValue, fragSampleNdx, frag.pixelCoord[0], frag.pixelCoord[1]);
+ }
+ }
+};
+
+/**
+ * @constructor
+ */
+rrFragmentOperations.FragmentProcessor = function() {
+ /* TODO: implement */
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrGenericVector.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrGenericVector.js
new file mode 100644
index 0000000000..62a92a4227
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrGenericVector.js
@@ -0,0 +1,54 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.referencerenderer.rrGenericVector');
+
+goog.scope(function() {
+
+var rrGenericVector = framework.referencerenderer.rrGenericVector;
+
+ var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+ };
+
+ /**
+ * rrGenericVector.GenericVecType
+ * @enum
+ */
+ rrGenericVector.GenericVecType = {
+ FLOAT: 0,
+ UINT32: 1,
+ INT32: 2
+ };
+
+ /**
+ * @constructor
+ * @param {number=} a
+ * @param {number=} b
+ * @param {number=} c
+ * @param {number=} d
+ */
+ rrGenericVector.GenericVec4 = function(a, b, c, d) {
+ this.data = [a || 0, b || 0, c || 0, d || 0];
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrMultisamplePixelBufferAccess.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrMultisamplePixelBufferAccess.js
new file mode 100644
index 0000000000..6de1ca2701
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrMultisamplePixelBufferAccess.js
@@ -0,0 +1,190 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.referencerenderer.rrMultisamplePixelBufferAccess');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.delibs.debase.deMath');
+
+goog.scope(function() {
+
+var rrMultisamplePixelBufferAccess = framework.referencerenderer.rrMultisamplePixelBufferAccess;
+var tcuTexture = framework.common.tcuTexture;
+var deMath = framework.delibs.debase.deMath;
+var tcuTextureUtil = framework.common.tcuTextureUtil;
+
+var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+};
+
+/**
+ * \brief Read-write pixel data access to multisampled buffers.
+ *
+ * Multisampled data access follows the multisampled indexing convention.
+ *
+ * Prevents accidental usage of non-multisampled buffer as multisampled
+ * with PixelBufferAccess.
+ * @constructor
+ * @param {tcuTexture.PixelBufferAccess=} rawAccess
+ */
+rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess = function(rawAccess) {
+ this.m_access = rawAccess || new tcuTexture.PixelBufferAccess({
+ width: 0,
+ height: 0});
+};
+
+/**
+ * @return {tcuTexture.PixelBufferAccess}
+ */
+rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.prototype.raw = function() { return this.m_access; };
+
+/**
+ * @return {boolean}
+ */
+rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.prototype.isEmpty = function() { return this.m_access.isEmpty(); };
+
+/**
+ * @return {number}
+ */
+rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.prototype.getNumSamples = function() { return this.raw().getWidth(); };
+
+/**
+ * @return {tcuTexture.PixelBufferAccess}
+ */
+rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.prototype.toSinglesampleAccess = function() {
+ DE_ASSERT(this.getNumSamples() == 1);
+
+ return new tcuTexture.PixelBufferAccess({
+ format: this.m_access.getFormat(),
+ width: this.m_access.getHeight(),
+ height: this.m_access.getDepth(),
+ depth: 1,
+ rowPitch: this.m_access.getSlicePitch(),
+ slicePitch: this.m_access.getSlicePitch() * this.m_access.getDepth(),
+ data: this.m_access.m_data,
+ offset: this.m_access.m_offset});
+};
+
+/**
+ * @param {tcuTexture.PixelBufferAccess} original
+ * @return {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess}
+ */
+rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.fromSinglesampleAccess = function(original) {
+ return new rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess(
+ new tcuTexture.PixelBufferAccess({
+ format: original.getFormat(),
+ width: 1,
+ height: original.getWidth(),
+ depth: original.getHeight(),
+ rowPitch: original.getFormat().getPixelSize(),
+ slicePitch: original.getRowPitch(),
+ data: original.m_data,
+ offset: original.m_offset}));
+};
+
+/**
+ * @param {tcuTexture.PixelBufferAccess} multisampledAccess
+ * @return {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess}
+ */
+rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.fromMultisampleAccess = function(multisampledAccess) {
+ return new rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess(multisampledAccess);
+};
+
+/**
+ * @param {Array<number>} region
+ * @return {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess}
+ */
+rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.prototype.getSubregion = function(region) {
+ var x = region[0];
+ var y = region[1];
+ var width = region[2];
+ var height = region[3];
+
+ return rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.fromMultisampleAccess(tcuTextureUtil.getSubregion(this.raw(), 0, x, y, this.getNumSamples(), width, height));
+};
+
+/**
+ * @return {Array<number>} [x, y, width, height]
+ */
+rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.prototype.getBufferSize = function() {
+ return [0, 0, this.raw().getHeight(), this.raw().getDepth()];
+};
+
+/**
+ * @param {tcuTexture.PixelBufferAccess} dst
+ */
+rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.prototype.resolveMultisampleColorBuffer = function(dst) {
+ var src = this;
+ DE_ASSERT(dst.getWidth() == src.raw().getHeight());
+ DE_ASSERT(dst.getHeight() == src.raw().getDepth());
+
+ var numSamples = src.getNumSamples();
+ var sum = [0, 0, 0, 0];
+ for (var y = 0; y < dst.getHeight(); y++) {
+ for (var x = 0; x < dst.getWidth(); x++) {
+ sum[0] = 0;
+ sum[1] = 0;
+ sum[2] = 0;
+ sum[3] = 0;
+
+ for (var s = 0; s < src.raw().getWidth(); s++) {
+ var pixel = src.raw().getPixel(s, x, y);
+ sum[0] += pixel[0];
+ sum[1] += pixel[1];
+ sum[2] += pixel[2];
+ sum[3] += pixel[3];
+ }
+
+ sum[0] /= numSamples;
+ sum[1] /= numSamples;
+ sum[2] /= numSamples;
+ sum[3] /= numSamples;
+
+ dst.setPixel(sum, x, y);
+ }
+ }
+};
+
+/**
+ * @param {number} x
+ * @param {number} y
+ * @return {Array<number>}
+ */
+rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.prototype.resolveMultisamplePixel = function(x, y) {
+ var sum = [0, 0, 0, 0];
+ for (var s = 0; s < this.getNumSamples(); s++)
+ sum = deMath.add(sum, this.raw().getPixel(s, x, y));
+
+ for (var i = 0; i < sum.length; i++)
+ sum[i] = sum[i] / this.getNumSamples();
+
+ return sum;
+};
+
+/**
+ * @param {Array<number>} color
+ */
+rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.prototype.clear = function(color) {
+ this.raw().clear(color);
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrRenderState.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrRenderState.js
new file mode 100644
index 0000000000..cac4dc56a3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrRenderState.js
@@ -0,0 +1,323 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program Reference Renderer
+ * -----------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief Reference renderer render state.
+ *//*--------------------------------------------------------------------*/
+'use strict';
+goog.provide('framework.referencerenderer.rrRenderState');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.referencerenderer.rrDefs');
+goog.require('framework.referencerenderer.rrMultisamplePixelBufferAccess');
+
+goog.scope(function() {
+
+var rrRenderState = framework.referencerenderer.rrRenderState;
+var tcuTexture = framework.common.tcuTexture;
+var deMath = framework.delibs.debase.deMath;
+var rrMultisamplePixelBufferAccess = framework.referencerenderer.rrMultisamplePixelBufferAccess;
+var rrDefs = framework.referencerenderer.rrDefs;
+
+/**
+ * Enum for rrRenderState.HorizontalFill values.
+ * @enum {number}
+ */
+rrRenderState.HorizontalFill = {
+ LEFT: 0,
+ RIGHT: 1
+};
+
+/**
+ * Enum for rrRenderState.VerticalFill values.
+ * @enum {number}
+ */
+rrRenderState.VerticalFill = {
+ TOP: 0,
+ BOTTOM: 1
+};
+
+/**
+ * Enum for rrRenderState.Winding values.
+ * @enum {number}
+ */
+rrRenderState.Winding = {
+ CCW: 0,
+ CC: 1
+};
+
+/**
+ * Enum for rrRenderState.CullMode values.
+ * @enum {number}
+ */
+rrRenderState.CullMode = {
+ NONE: 0,
+ BACK: 1,
+ FRONT: 2
+};
+
+/**rrRenderState.Winding : rrRenderState.Winding,
+
+ * @constructor
+ */
+rrRenderState.RasterizationState = function() {
+ /** @type {number} */ this.winding = rrRenderState.Winding.CCW;
+ /** @type {number} */ this.horizontalFill = rrRenderState.HorizontalFill.LEFT;
+ /** @type {number} */ this.verticalFill = rrRenderState.VerticalFill.BOTTOM;
+};
+
+/**
+ * Enum for rrRenderState.TestFunc values.
+ * @enum {number}
+ */
+rrRenderState.TestFunc = {
+ NEVER: 0,
+ ALWAYS: 1,
+ LESS: 2,
+ LEQUAL: 3,
+ GREATER: 4,
+ GEQUAL: 5,
+ EQUAL: 6,
+ NOTEQUAL: 7
+};
+
+/**
+ * Enum for rrRenderState.StencilOp values.
+ * @enum {number}
+ */
+rrRenderState.StencilOp = {
+ KEEP: 0,
+ ZERO: 1,
+ REPLACE: 2,
+ INCR: 3, //!< Increment with saturation.
+ DECR: 4, //!< Decrement with saturation.
+ INCR_WRAP: 5,
+ DECR_WRAP: 6,
+ INVERT: 7
+};
+
+/**
+ * Enum for rrRenderState.BlendMode values.
+ * @enum {number}
+ */
+rrRenderState.BlendMode = {
+ NONE: 0, //!< No blending.
+ STANDARD: 1 //!< Standard blending.
+// Advanced blending is not supported
+// ADVANCED : 2 //!< Advanced blending mode, as defined in gl.KHR_blend_equation_advanced.
+};
+
+/**
+ * Enum for rrRenderState.BlendEquation values.
+ * @enum {number}
+ */
+rrRenderState.BlendEquation = {
+ ADD: 0,
+ SUBTRACT: 1,
+ REVERSE_SUBTRACT: 2,
+ MIN: 3,
+ MAX: 4
+};
+
+// /**
+// * Enum for rrRenderState.BlendEquationAdvanced values.
+// * @enum {number}
+// */
+// rrRenderState.BlendEquationAdvanced = {
+// MULTIPLY : 0,
+// SCREEN : 1,
+// OVERLAY : 2,
+// DARKEN : 3,
+// LIGHTEN : 4,
+// COLORDODGE : 5,
+// COLORBURN : 6,
+// HARDLIGHT : 7,
+// SOFTLIGHT : 8,
+// DIFFERENCE : 9,
+// EXCLUSION : 10,
+// HSL_HUE : 11,
+// HSL_SATURATION : 12,
+// HSL_COLOR : 13,
+// HSL_LUMINOSITY : 14
+// };
+
+/**
+ * Enum for rrRenderState.BlendFunc values.
+ * @enum {number}
+ */
+rrRenderState.BlendFunc = {
+ ZERO: 0,
+ ONE: 1,
+ SRC_COLOR: 2,
+ ONE_MINUS_SRC_COLOR: 3,
+ DST_COLOR: 4,
+ ONE_MINUS_DST_COLOR: 5,
+ SRC_ALPHA: 6,
+ ONE_MINUS_SRC_ALPHA: 7,
+ DST_ALPHA: 8,
+ ONE_MINUS_DST_ALPHA: 9,
+ CONSTANT_COLOR: 10,
+ ONE_MINUS_CONSTANT_COLOR: 11,
+ CONSTANT_ALPHA: 12,
+ ONE_MINUS_CONSTANT_ALPHA: 13,
+ SRC_ALPHA_SATURATE: 14,
+ SRC1_COLOR: 15,
+ ONE_MINUS_SRC1_COLOR: 16,
+ SRC1_ALPHA: 17,
+ ONE_MINUS_SRC1_ALPHA: 18
+};
+
+/**
+ * @constructor
+ */
+rrRenderState.StencilState = function() {
+ /** @type {number} */ this.func = rrRenderState.TestFunc.ALWAYS;
+ /** @type {number} */ this.ref = 0;
+ /** @type {number} */ this.compMask = ~0;
+ /** @type {number} */ this.sFail = rrRenderState.StencilOp.KEEP;
+ /** @type {number} */ this.dpFail = rrRenderState.StencilOp.KEEP;
+ /** @type {number} */ this.dpPass = rrRenderState.StencilOp.KEEP;
+ /** @type {number} */ this.writeMask = ~0;
+};
+
+/**
+ * @constructor
+ */
+rrRenderState.BlendState = function() {
+ /** @type {number} */ this.equation = rrRenderState.BlendEquation.ADD;
+ /** @type {number} */ this.srcFunc = rrRenderState.BlendFunc.ONE;
+ /** @type {number} */ this.dstFunc = rrRenderState.BlendFunc.ZERO;
+};
+
+/**
+ * @param {(Array<number>|number)} left_
+ * @param {number=} bottom_
+ * @param {number=} width_
+ * @param {number=} height_
+ * @constructor
+ */
+rrRenderState.WindowRectangle = function(left_, bottom_, width_, height_) {
+ // Is first parameter an array? Use it
+ if (left_.length && left_.length == 4) {
+ this.left = left_[0];
+ this.bottom = left_[1];
+ this.width = left_[2];
+ this.height = left_[3];
+ } else {
+ this.left = left_;
+ this.bottom = bottom_;
+ this.width = width_;
+ this.height = height_;
+ }
+};
+
+/**
+ * @constructor
+ */
+rrRenderState.FragmentOperationState = function() {
+ /** @type {boolean} */ this.scissorTestEnabled = false;
+ /** @type {rrRenderState.WindowRectangle} */ this.scissorRectangle = new rrRenderState.WindowRectangle(0, 0, 1, 1);
+
+ /** @type {boolean} */ this.stencilTestEnabled = false;
+
+ /** @type {Array<rrRenderState.StencilState>} */ this.stencilStates = [];
+ for (var type in rrDefs.FaceType)
+ this.stencilStates[rrDefs.FaceType[type]] = new rrRenderState.StencilState();
+
+ /** @type {boolean} */ this.depthTestEnabled = false;
+ /** @type {rrRenderState.TestFunc} */ this.depthFunc = rrRenderState.TestFunc.LESS;
+ /** @type {boolean} */ this.depthMask = true;
+
+ /** @type {rrRenderState.BlendMode} */ this.blendMode = rrRenderState.BlendMode.NONE;
+ /** @type {rrRenderState.BlendState} */ this.blendRGBState = new rrRenderState.BlendState();
+ /** @type {rrRenderState.BlendState} */ this.blendAState = new rrRenderState.BlendState();
+ /** @type {Array<number>} */ this.blendColor = [0.0, 0.0, 0.0, 0.0];
+// /** @type {rrRenderState.BlendEquationAdvanced} */ this.blendEquationAdvanced = null;
+
+ /** @type {boolean} */ this.sRGBEnabled = true;
+
+ /** @type {boolean} */ this.depthClampEnabled = false;
+
+ /** @type {boolean} */ this.polygonOffsetEnabled = false;
+ /** @type {number} */ this.polygonOffsetFactor = 0.0;
+ /** @type {number} */ this.polygonOffsetUnits = 0.0;
+
+ /** @type {Array<boolean>} */ this.colorMask = [true, true, true, true];
+
+ /** @type {number} */ this.numStencilBits = 8;
+};
+
+/**
+ * @constructor
+ */
+rrRenderState.PointState = function() {
+ /** @type {number} */ this.pointSize = 1.0;
+};
+
+/**
+ * @constructor
+ */
+rrRenderState.LineState = function() {
+ /** @type {number} */ this.lineWidth = 1.0;
+};
+
+/**
+ * Constructor checks if the parameter has a "raw" member to detect if the instance is
+ * of type rrRenderState.WindowRectangle or MultisamplePixelBufferAccess.
+ * @param {rrRenderState.WindowRectangle|rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} rect_
+ * @constructor
+ */
+rrRenderState.ViewportState = function(rect_) {
+ /** @type {number} */ this.zn = 0.0;
+ /** @type {number} */ this.zf = 1.0;
+ /** @type {rrRenderState.WindowRectangle} */ this.rect;
+
+ if (rect_.raw) {
+ this.rect = new rrRenderState.WindowRectangle(0, 0, rect_.raw().getHeight(),
+ rect_.raw().getDepth());
+ } else {
+ this.rect = /** @type {rrRenderState.WindowRectangle} */ (rect_);
+ }
+};
+
+/**
+ * @constructor
+ */
+rrRenderState.RestartState = function() {
+ /** @type {boolean} */ this.enabled = false;
+ /** @type {number} */ this.restartIndex = 0xFFFFFFFF;
+};
+
+/**
+ * @constructor
+ * @param {rrRenderState.ViewportState} viewport_
+ */
+rrRenderState.RenderState = function(viewport_) {
+ /** @type {rrRenderState.CullMode} */ this.cullMode = rrRenderState.CullMode.NONE;
+ /** @type {number} */ this.provokingVertexConvention;
+ /** @type {rrRenderState.ViewportState} */ this.viewport = viewport_;
+
+ /** @type {rrRenderState.RasterizationState} */ this.rasterization = new rrRenderState.RasterizationState();
+ /** @type {rrRenderState.FragmentOperationState} */ this.fragOps = new rrRenderState.FragmentOperationState();
+ /** @type {rrRenderState.PointState} */ this.point = new rrRenderState.PointState();
+ /** @type {rrRenderState.LineState} */ this.line = new rrRenderState.LineState();
+ /** @type {rrRenderState.RestartState} */ this.restart = new rrRenderState.RestartState();
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrRenderer.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrRenderer.js
new file mode 100644
index 0000000000..4d5752b2c4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrRenderer.js
@@ -0,0 +1,1274 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.referencerenderer.rrRenderer');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.delibs.debase.deUtil');
+goog.require('framework.opengl.simplereference.sglrShaderProgram');
+goog.require('framework.referencerenderer.rrDefs');
+goog.require('framework.referencerenderer.rrFragmentOperations');
+goog.require('framework.referencerenderer.rrGenericVector');
+goog.require('framework.referencerenderer.rrMultisamplePixelBufferAccess');
+goog.require('framework.referencerenderer.rrRenderState');
+goog.require('framework.referencerenderer.rrShadingContext');
+goog.require('framework.referencerenderer.rrVertexAttrib');
+goog.require('framework.referencerenderer.rrVertexPacket');
+
+goog.scope(function() {
+
+var rrRenderer = framework.referencerenderer.rrRenderer;
+var rrVertexPacket = framework.referencerenderer.rrVertexPacket;
+var rrDefs = framework.referencerenderer.rrDefs;
+var rrFragmentOperations = framework.referencerenderer.rrFragmentOperations;
+var deMath = framework.delibs.debase.deMath;
+var tcuTextureUtil = framework.common.tcuTextureUtil;
+var tcuTexture = framework.common.tcuTexture;
+var rrRenderState = framework.referencerenderer.rrRenderState;
+var rrMultisamplePixelBufferAccess = framework.referencerenderer.rrMultisamplePixelBufferAccess;
+var rrShadingContext = framework.referencerenderer.rrShadingContext;
+var rrGenericVector = framework.referencerenderer.rrGenericVector;
+var sglrShaderProgram = framework.opengl.simplereference.sglrShaderProgram;
+var rrVertexAttrib = framework.referencerenderer.rrVertexAttrib;
+var deString = framework.delibs.debase.deString;
+var deUtil = framework.delibs.debase.deUtil;
+
+/**
+ * @enum
+ */
+rrRenderer.PrimitiveType = {
+ TRIANGLES: 0, //!< Separate rrRenderer.triangles
+ TRIANGLE_STRIP: 1, //!< rrRenderer.Triangle strip
+ TRIANGLE_FAN: 2, //!< rrRenderer.Triangle fan
+
+ LINES: 3, //!< Separate lines
+ LINE_STRIP: 4, //!< Line strip
+ LINE_LOOP: 5, //!< Line loop
+
+ POINTS: 6 //!< Points
+};
+
+// /**
+// * @constructor
+// * @param {boolean} depthEnabled Is depth buffer enabled
+// */
+// rrRenderer.RasterizationInternalBuffers = function(depthEnabled) {
+// /*std::vector<rrFragmentOperations.Fragment>*/ this.fragmentPackets = [];
+// /*std::vector<GenericVec4>*/ this.shaderOutputs = [];
+// /*std::vector<Fragment>*/ this.shadedFragments = [];
+// /*float**/ this.fragmentDepthBuffer = depthEnabled ? [] : null;
+// };
+
+/**
+ * @constructor
+ * @param {number=} id
+ */
+rrRenderer.DrawContext = function(id) {
+ this.primitiveID = id || 0;
+
+};
+
+/**
+ * Transform [x, y] to window (pixel) coordinates.
+ * z and w are unchanged
+ * @param {rrRenderState.RenderState} state
+ * @param {rrVertexPacket.VertexPacket} packet
+ * Wreturn {Array<number>}
+ */
+rrRenderer.transformGLToWindowCoords = function(state, packet) {
+ var transformed = [packet.position[0] / packet.position[3],
+ packet.position[1] / packet.position[3],
+ packet.position[2],
+ packet.position[3]];
+ var viewport = state.viewport.rect;
+ var halfW = viewport.width / 2;
+ var halfH = viewport.height / 2;
+ var oX = viewport.left + halfW;
+ var oY = viewport.bottom + halfH;
+
+ return [
+ transformed[0] * halfW + oX,
+ transformed[1] * halfH + oY,
+ transformed[2],
+ transformed[3]
+ ];
+};
+
+/**
+ * @constructor
+ * @param {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess} colorMultisampleBuffer
+ * @param {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess=} depthMultisampleBuffer
+ * @param {rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess=} stencilMultisampleBuffer
+ */
+rrRenderer.RenderTarget = function(colorMultisampleBuffer, depthMultisampleBuffer, stencilMultisampleBuffer) {
+ this.MAX_COLOR_BUFFERS = 4;
+ this.colorBuffers = [];
+ this.colorBuffers[0] = colorMultisampleBuffer;
+ this.depthBuffer = depthMultisampleBuffer || new rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess();
+ this.stencilBuffer = stencilMultisampleBuffer || new rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess();
+ this.numColorBuffers = 1;
+};
+
+// NOTE: Program object is useless. Let's just use the sglrShaderProgram
+// /**
+// * @constructor
+// * @param {rrShaders.VertexShader} vertexShader_
+// * @param {rrShaders.FragmentShader} fragmentShader_
+// */
+// var Program = function(vertexShader_, fragmentShader_) {
+// this.vertexShader = vertexShader_;
+// this.fragmentShader = fragmentShader_;
+// };
+
+/**
+ * @constructor
+ * @param {ArrayBuffer} data
+ * @param {rrDefs.IndexType} type
+ * @param {number} offset
+ * @param {number=} baseVertex_
+ */
+rrRenderer.DrawIndices = function(data, type, offset, baseVertex_) {
+ /** @type {ArrayBuffer} */ this.data = data;
+ /** @type {number} */ this.baseVertex = baseVertex_ || 0;
+ /** @type {rrDefs.IndexType} */ this.indexType = type;
+ /** @type {goog.NumberArray} */ this.access = null;
+ switch (type) {
+ case rrDefs.IndexType.INDEXTYPE_UINT8: this.access = new Uint8Array(data).subarray(offset); break;
+ case rrDefs.IndexType.INDEXTYPE_UINT16: this.access = new Uint16Array(data).subarray(offset / 2); break;
+ case rrDefs.IndexType.INDEXTYPE_UINT32: this.access = new Uint32Array(data).subarray(offset / 4); break;
+ default: throw new Error('Invalid type: ' + type);
+ }
+};
+
+/**
+ * @return {number}
+ */
+rrRenderer.DrawIndices.prototype.readIndexArray = function(index) { return this.access[index]; };
+
+/**
+ * @constructor
+ * @param {rrRenderer.PrimitiveType} primitiveType
+ * @param {number} numElements
+ * @param {(number|rrRenderer.DrawIndices)} indices
+ */
+rrRenderer.PrimitiveList = function(primitiveType, numElements, indices) {
+ /** @type {rrRenderer.PrimitiveType} */ this.m_primitiveType = primitiveType;
+ /** @type {number} */ this.m_numElements = numElements;
+ if (typeof indices == 'number') {
+ // !< primitive list for drawArrays-like call
+ this.m_indices = null;
+ this.m_indexType = null;
+ this.m_baseVertex = indices;
+ } else {
+ // !< primitive list for drawElements-like call
+ this.m_indices = indices;
+ this.m_indexType = indices.indexType;
+ this.m_baseVertex = indices.baseVertex;
+ }
+ this.m_iterator = 0;
+};
+
+/**
+ * @param {number} elementNdx
+ * @return {number}
+ */
+rrRenderer.PrimitiveList.prototype.getIndex = function(elementNdx) {
+ if (this.m_indices) {
+ var index = this.m_baseVertex + this.m_indices.readIndexArray(elementNdx);
+ if (index < 0)
+ throw new Error('Index must not be negative');
+
+ return index;
+ } else
+ return this.m_baseVertex + elementNdx;
+};
+
+/**
+ * @param {number} elementNdx
+ * @param {number} restartIndex
+ * @return {boolean}
+ */
+rrRenderer.PrimitiveList.prototype.isRestartIndex = function(elementNdx, restartIndex) {
+ // implicit index or explicit index (without base vertex) equals restart
+ if (this.m_indices)
+ return this.m_indices.readIndexArray(elementNdx) == restartIndex;
+ else
+ return elementNdx == restartIndex;
+};
+
+/**
+ * @return {number}
+ */
+rrRenderer.PrimitiveList.prototype.getNumElements = function() {return this.m_numElements;};
+
+/**
+ * @return {rrRenderer.PrimitiveType}
+ */
+rrRenderer.PrimitiveList.prototype.getPrimitiveType = function() {return this.m_primitiveType;};
+
+/**
+ * @return {?rrDefs.IndexType}
+ */
+rrRenderer.PrimitiveList.prototype.getIndexType = function() {return this.m_indexType;};
+
+/**
+ * Generate a primitive from indices
+ * @param {boolean=} reset Restart generating primitives. Default false
+ * @return {Array<number>}
+ */
+rrRenderer.PrimitiveList.prototype.getNextPrimitive = function(reset) {
+ if (reset)
+ this.m_iterator = 0;
+ var result = [];
+ var i = this.m_iterator;
+ switch (this.m_primitiveType) {
+ case rrRenderer.PrimitiveType.TRIANGLES:
+ if (this.m_iterator + 3 <= this.m_numElements) {
+ result = [i, i + 1, i + 2];
+ this.m_iterator += 3;
+ }
+ break;
+ case rrRenderer.PrimitiveType.TRIANGLE_STRIP:
+ if (this.m_iterator + 3 <= this.m_numElements) {
+ result = [i, i + 1, i + 2];
+ this.m_iterator += 1;
+ }
+ break;
+ case rrRenderer.PrimitiveType.TRIANGLE_FAN:
+ if (this.m_iterator + 3 <= this.m_numElements) {
+ result = [0, i + 1, i + 2];
+ this.m_iterator += 1;
+ }
+ break;
+ case rrRenderer.PrimitiveType.LINES:
+ if (this.m_iterator + 2 <= this.m_numElements) {
+ result = [i, i + 1];
+ this.m_iterator += 2;
+ }
+ break;
+ case rrRenderer.PrimitiveType.LINE_STRIP:
+ if (this.m_iterator + 2 <= this.m_numElements) {
+ result = [i, i + 1];
+ this.m_iterator += 1;
+ }
+ break;
+ case rrRenderer.PrimitiveType.LINE_LOOP:
+ if (this.m_iterator == this.m_numElements)
+ break;
+ if (this.m_iterator + 2 <= this.m_numElements)
+ result = [i, i + 1];
+ else
+ result = [i, 0];
+ this.m_iterator += 1;
+ break;
+ case rrRenderer.PrimitiveType.POINTS:
+ if (this.m_iterator == this.m_numElements)
+ break;
+ else
+ result = [i];
+ this.m_iterator += 1;
+ break;
+ default:
+ throw new Error('Unsupported primitive type: ' + deString.enumToString(rrRenderer.PrimitiveType, this.m_primitiveType));
+ }
+
+ return result;
+};
+
+/**
+ * @param {rrRenderState.RenderState} state
+ * @param {rrRenderer.RenderTarget} renderTarget
+ * @param {Array<rrFragmentOperations.Fragment>} fragments Fragments to write
+*/
+rrRenderer.writeFragments = function(state, renderTarget, fragments) {
+ /* TODO: Add blending, depth, stencil ... */
+ var colorbuffer = renderTarget.colorBuffers[0].raw();
+ for (var i = 0; i < fragments.length; i++) {
+ var fragment = fragments[i];
+ colorbuffer.setPixel(fragment.value, 0, fragment.pixelCoord[0], fragment.pixelCoord[1]);
+ }
+
+};
+
+/**
+ * @param {rrRenderState.RenderState} renderState
+ * @param {rrRenderer.RenderTarget} renderTarget
+ * @param {Array<rrFragmentOperations.Fragment>} fragments Fragments to write
+*/
+rrRenderer.writeFragments2 = function(renderState, renderTarget, fragments) {
+ /*
+void FragmentProcessor::render (const rr::MultisamplePixelBufferAccess& msColorBuffer,
+ const rr::MultisamplePixelBufferAccess& msDepthBuffer,
+ const rr::MultisamplePixelBufferAccess& msStencilBuffer,
+ const Fragment* fragments,
+ int numFragments,
+ FaceType fragmentFacing,
+ const FragmentOperationState& state)
+*/
+
+ /** @const */ var fragmentFacing = rrDefs.FaceType.FACETYPE_FRONT;
+ var colorBuffer = renderTarget.colorBuffers[0].raw();
+ var depthBuffer = renderTarget.depthBuffer.raw();
+ var stencilBuffer = renderTarget.stencilBuffer.raw();
+ var state = renderState.fragOps;
+
+ var hasDepth = depthBuffer.getWidth() > 0 && depthBuffer.getHeight() > 0 && depthBuffer.getDepth() > 0;
+ var hasStencil = stencilBuffer.getWidth() > 0 && stencilBuffer.getHeight() > 0 && stencilBuffer.getDepth() > 0;
+ var doDepthTest = hasDepth && state.depthTestEnabled;
+ var doStencilTest = hasStencil && state.stencilTestEnabled;
+
+ var colorbufferClass = tcuTexture.getTextureChannelClass(colorBuffer.getFormat().type);
+ var fragmentDataType = rrGenericVector.GenericVecType.FLOAT;
+ switch (colorbufferClass) {
+ case tcuTexture.TextureChannelClass.SIGNED_INTEGER:
+ fragmentDataType = rrGenericVector.GenericVecType.INT32;
+ break;
+ case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER:
+ fragmentDataType = rrGenericVector.GenericVecType.UINT32;
+ break;
+ }
+
+ if (!((!hasDepth || colorBuffer.getWidth() == depthBuffer.getWidth()) && (!hasStencil || colorBuffer.getWidth() == stencilBuffer.getWidth())))
+ throw new Error('Attachment must have the same width');
+ if (!((!hasDepth || colorBuffer.getHeight() == depthBuffer.getHeight()) && (!hasStencil || colorBuffer.getHeight() == stencilBuffer.getHeight())))
+ throw new Error('Attachment must have the same height');
+ if (!((!hasDepth || colorBuffer.getDepth() == depthBuffer.getDepth()) && (!hasStencil || colorBuffer.getDepth() == stencilBuffer.getDepth())))
+ throw new Error('Attachment must have the same depth');
+
+ var stencilState = state.stencilStates[fragmentFacing];
+ var colorMaskFactor = [state.colorMask[0] ? 1 : 0, state.colorMask[1] ? 1 : 0, state.colorMask[2] ? 1 : 0, state.colorMask[3] ? 1 : 0];
+ var colorMaskNegationFactor = [state.colorMask[0] ? false : true, state.colorMask[1] ? false : true, state.colorMask[2] ? false : true, state.colorMask[3] ? false : true];
+ var sRGBTarget = state.sRGBEnabled && colorBuffer.getFormat().isSRGB();
+
+ // Scissor test.
+
+ if (state.scissorTestEnabled)
+ rrFragmentOperations.executeScissorTest(fragments, state.scissorRectangle);
+
+ // Stencil test.
+
+ if (doStencilTest) {
+ rrFragmentOperations.executeStencilCompare(fragments, stencilState, state.numStencilBits, stencilBuffer);
+ rrFragmentOperations.executeStencilSFail(fragments, stencilState, state.numStencilBits, stencilBuffer);
+ }
+
+ // Depth test.
+ // \note Current value of isAlive is needed for dpPass and dpFail, so it's only updated after them and not right after depth test.
+
+ if (doDepthTest) {
+ rrFragmentOperations.executeDepthCompare(fragments, state.depthFunc, depthBuffer);
+
+ if (state.depthMask)
+ rrFragmentOperations.executeDepthWrite(fragments, depthBuffer);
+ }
+
+ // Do dpFail and dpPass stencil writes.
+
+ if (doStencilTest)
+ rrFragmentOperations.executeStencilDpFailAndPass(fragments, stencilState, state.numStencilBits, stencilBuffer);
+
+ // Kill the samples that failed depth test.
+
+ if (doDepthTest) {
+ for (var i = 0; i < fragments.length; i++)
+ fragments[i].isAlive = fragments[i].isAlive && fragments[i].depthPassed;
+ }
+
+ // Paint fragments to target
+
+ switch (fragmentDataType) {
+ case rrGenericVector.GenericVecType.FLOAT:
+ // Blend calculation - only if using blend.
+ if (state.blendMode == rrRenderState.BlendMode.STANDARD) {
+ // Put dst color to register, doing srgb-to-linear conversion if needed.
+ for (var i = 0; i < fragments.length; i++) {
+ var frag = fragments[i];
+ if (frag.isAlive) {
+ var dstColor = colorBuffer.getPixel(0, frag.pixelCoord[0], frag.pixelCoord[1]);
+
+ /* TODO: Check frag.value and frag.value1 types */
+ frag.clampedBlendSrcColor = deMath.clampVector(frag.value, 0, 1);
+ frag.clampedBlendSrc1Color = deMath.clampVector(frag.value1, 0, 1);
+ frag.clampedBlendDstColor = deMath.clampVector(sRGBTarget ? tcuTexture.sRGBToLinear(dstColor) : dstColor, 0, 1);
+ }
+ }
+
+ // Calculate blend factors to register.
+ rrFragmentOperations.executeBlendFactorComputeRGB(fragments, state.blendColor, state.blendRGBState);
+ rrFragmentOperations.executeBlendFactorComputeA(fragments, state.blendColor, state.blendAState);
+
+ // Compute blended color.
+ rrFragmentOperations.executeBlend(fragments, state.blendRGBState, state.blendAState);
+ } else {
+ // Not using blend - just put values to register as-is.
+
+ for (var i = 0; i < fragments.length; i++) {
+ var frag = fragments[i];
+ if (frag.isAlive) {
+ frag.blendedRGB = deMath.swizzle(frag.value, [0, 1, 2]);
+ frag.blendedA = frag.value[3];
+ }
+ }
+ }
+
+ // Finally, write the colors to the color buffer.
+
+ if (state.colorMask[0] && state.colorMask[1] && state.colorMask[2] && state.colorMask[3]) {
+ /* TODO: Add quick path */
+ // if (colorBuffer.getFormat().isEqual(new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8)))
+ // executeRGBA8ColorWrite(fragments, colorBuffer);
+ // else
+ rrFragmentOperations.executeColorWrite(fragments, sRGBTarget, colorBuffer);
+ } else if (state.colorMask[0] || state.colorMask[1] || state.colorMask[2] || state.colorMask[3])
+ rrFragmentOperations.executeMaskedColorWrite(fragments, colorMaskFactor, colorMaskNegationFactor, sRGBTarget, colorBuffer);
+ break;
+
+ case rrGenericVector.GenericVecType.INT32:
+ // Write fragments
+ for (var i = 0; i < fragments.length; i++) {
+ var frag = fragments[i];
+ if (frag.isAlive) {
+ frag.signedValue = frag.value;
+ }
+ }
+
+ if (state.colorMask[0] || state.colorMask[1] || state.colorMask[2] || state.colorMask[3])
+ rrFragmentOperations.executeSignedValueWrite(fragments, state.colorMask, colorBuffer);
+ break;
+
+ case rrGenericVector.GenericVecType.UINT32:
+ // Write fragments
+ for (var i = 0; i < fragments.length; i++) {
+ var frag = fragments[i];
+ if (frag.isAlive) {
+ frag.unsignedValue = frag.value;
+ }
+ }
+
+ if (state.colorMask[0] || state.colorMask[1] || state.colorMask[2] || state.colorMask[3])
+ rrFragmentOperations.executeUnsignedValueWrite(fragments, state.colorMask, colorBuffer);
+ break;
+
+ default:
+ throw new Error('Unrecognized fragment data type:' + fragmentDataType);
+ }
+};
+
+/**
+ * Determines the index of the corresponding vertex according to top/right conditions.
+ * @param {boolean} isTop
+ * @param {boolean} isRight
+ * @return {number}
+ */
+rrRenderer.getIndexOfCorner = function(isTop, isRight, vertexPackets) {
+ var x = null;
+ var y = null;
+
+ var xcriteria = isRight ? Math.max : Math.min;
+ var ycriteria = isTop ? Math.max : Math.min;
+
+ // Determine corner values
+ for (var i = 0; i < vertexPackets.length; i++) {
+ x = x != null ? xcriteria(vertexPackets[i].position[0], x) : vertexPackets[i].position[0];
+ y = y != null ? ycriteria(vertexPackets[i].position[1], y) : vertexPackets[i].position[1];
+ }
+
+ // Search for matching vertex
+ for (var v = 0; v < vertexPackets.length; v++)
+ if (vertexPackets[v].position[0] == x &&
+ vertexPackets[v].position[1] == y)
+ return v;
+
+ throw new Error('Corner not found');
+};
+
+/**
+ * Check that point is in the clipping volume
+ * @param {number} x
+ * @param {number} y
+ * @param {number} z
+ * @param {rrRenderState.WindowRectangle} rect
+ * @return {boolean}
+ */
+rrRenderer.clipTest = function(x, y, z, rect) {
+ x = Math.round(x);
+ y = Math.round(y);
+ if (!deMath.deInBounds32(x, rect.left, rect.left + rect.width))
+ return false;
+ if (!deMath.deInBounds32(y, rect.bottom, rect.bottom + rect.height))
+ return false;
+ if (z < 0 || z > 1)
+ return false;
+ return true;
+};
+
+// Rasterizer configuration
+rrRenderer.RASTERIZER_SUBPIXEL_BITS = 8;
+rrRenderer.RASTERIZER_MAX_SAMPLES_PER_FRAGMENT = 16;
+
+// Referenced from rrRasterizer.hpp
+
+/**
+ * Get coverage bit value
+ * @param {number} numSamples
+ * @param {number} x
+ * @param {number} y
+ * @param {number} sampleNdx
+ * @return {number}
+ */
+rrRenderer.getCoverageBit = function(numSamples, x, y, sampleNdx) {
+ var maxSamples = 16;
+ assertMsgOptions(maxSamples >= rrRenderer.RASTERIZER_MAX_SAMPLES_PER_FRAGMENT, 'maxSamples should not greater than ' + rrRenderer.RASTERIZER_MAX_SAMPLES_PER_FRAGMENT, false, true);
+ assertMsgOptions(deMath.deInRange32(numSamples, 1, maxSamples) && deMath.deInBounds32(x, 0, 2) && deMath.deInBounds32(y, 0, 2), 'numSamples, x or y not in bound', false, true);
+ return 1 << ((x * 2 + y) * numSamples + sampleNdx);
+};
+
+/**
+ * Get all sample bits for fragment
+ * @param {number} numSamples
+ * @param {number} x
+ * @param {number} y
+ * @return {number}
+ */
+rrRenderer.getCoverageFragmentSampleBits = function(numSamples, x, y) {
+ assertMsgOptions(deMath.deInBounds32(x, 0, 2) && deMath.deInBounds32(y, 0, 2), 'x or y is not in bound 0 to 2', false, true);
+ var fragMask = (1 << numSamples) - 1;
+ return fragMask << (x * 2 + y) * numSamples;
+};
+
+/**
+ * Set coverage bit in coverage mask
+ * @param {number} mask
+ * @param {number} numSamples
+ * @param {number} x
+ * @param {number} y
+ * @param {number} sampleNdx
+ * @param {number} val
+ * @return {number}
+ */
+rrRenderer.setCoverageValue = function(mask, numSamples, x, y, sampleNdx, val) {
+ var bit = rrRenderer.getCoverageBit(numSamples, x, y, sampleNdx);
+ return val ? (mask | bit) : (mask & ~bit);
+};
+
+/**
+ * Test if any sample for fragment is live
+ * @param {number} mask
+ * @param {number} numSamples
+ * @param {number} x
+ * @param {number} y
+ * @return {number}
+ */
+rrRenderer.getCoverageAnyFragmentSampleLive = function(mask, numSamples, x, y) {
+ return (mask & rrRenderer.getCoverageFragmentSampleBits(numSamples, x, y)) != 0;
+};
+
+// Referenced from rrRasterizer.cpp
+
+/**
+ * Pixel coord to sub pixel coord
+ * @param {number} v
+ * @return {number}
+ */
+rrRenderer.toSubpixelCoord = function(v) {
+ return Math.trunc(v * (1 << rrRenderer.RASTERIZER_SUBPIXEL_BITS) + (v < 0 ? -0.5 : 0.5));
+};
+
+/**
+ * Floor sub pixel coord to pixel coord
+ * @param {number} coord
+ * @param {boolean} fillEdge
+ * @return {number}
+ */
+rrRenderer.floorSubpixelToPixelCoord = function(coord, fillEdge) {
+ if (coord >= 0)
+ return Math.trunc((coord - (fillEdge ? 1 : 0)) >> rrRenderer.RASTERIZER_SUBPIXEL_BITS);
+ else
+ return Math.trunc((coord - ((1 << rrRenderer.RASTERIZER_SUBPIXEL_BITS) - (fillEdge ? 0 : 1))) >> rrRenderer.RASTERIZER_SUBPIXEL_BITS);
+};
+
+/**
+ * Ceil sub pixel coord to pixel coord
+ * @param {number} coord
+ * @param {boolean} fillEdge
+ * @return {number}
+ */
+rrRenderer.ceilSubpixelToPixelCoord = function(coord, fillEdge) {
+ if (coord >= 0)
+ return Math.trunc((coord + (1 << rrRenderer.RASTERIZER_SUBPIXEL_BITS) - (fillEdge ? 0 : 1)) >> rrRenderer.RASTERIZER_SUBPIXEL_BITS);
+ else
+ return Math.trunc((coord + (fillEdge ? 1 : 0)) >> rrRenderer.RASTERIZER_SUBPIXEL_BITS);
+};
+
+/**
+ * \brief Edge function - referenced from struct EdgeFunction in rrRasterizer.hpp
+ *
+ * Edge function can be evaluated for point P (in a fixed-point coordinates
+ * with RASTERIZER_SUBPIXEL_BITS fractional part) by computing
+ * D = a * Px + b * Py + c
+ *
+ * D will be fixed-point value where lower (RASTERIZER_SUBPIXEL_BITS * 2) bits
+ * will be fractional part.
+ *
+ * Member function evaluateEdge, reverseEdge and isInsideCCW are referenced from rrRasterizer.cpp.
+ *
+ * @param {number} a
+ * @param {number} b
+ * @param {number} c
+ * @param {boolean} inclusive
+ */
+rrRenderer.edgeFunction = function(a, b, c, inclusive) {
+ this.a = a;
+ this.b = b;
+ this.c = c;
+ this.inclusive = inclusive; // True if edge is inclusive according to fill rules
+};
+
+/**
+ * Evaluate point (x,y)
+ * @param {number} x
+ * @param {number} y
+ * @return {number}
+ */
+rrRenderer.edgeFunction.prototype.evaluateEdge = function(x, y) {
+ return this.a * x + this.b * y + this.c;
+};
+
+/**
+ * Reverse edge (e.g. from CCW to CW)
+ */
+rrRenderer.edgeFunction.prototype.reverseEdge = function () {
+ this.a = -this.a;
+ this.b = -this.b;
+ this.c = -this.c;
+ this.inclusive = !this.inclusive;
+};
+
+/**
+ * Determine if a point with value edgeVal is inside the CCW region of the edge
+ * @param {number} edgeVal
+ * @return {boolean}
+ */
+rrRenderer.edgeFunction.prototype.isInsideCCW = function(edgeVal) {
+ return this.inclusive ? edgeVal >= 0 : edgeVal > 0;
+};
+
+/**
+ * Init an edge function in counter-clockwise (CCW) orientation
+ * @param {number} horizontalFill
+ * @param {number} verticalFill
+ * @param {number} x0
+ * @param {number} y0
+ * @param {number} x1
+ * @param {number} y1
+ * @return {rrRenderer.edgeFunction}
+ */
+rrRenderer.initEdgeCCW = function(horizontalFill, verticalFill, x0, y0, x1, y1) {
+ var xd = x1 - x0;
+ var yd = y1 - y0;
+ var inclusive = false;
+
+ if (yd == 0)
+ inclusive = verticalFill == rrRenderState.VerticalFill.BOTTOM ? xd >= 0 : xd <= 0;
+ else
+ inclusive = horizontalFill == rrRenderState.HorizontalFill.LEFT ? yd <= 0 : yd >=0;
+
+ return new rrRenderer.edgeFunction(y0 - y1, x1 - x0, x0 * y1 - y0 * x1, inclusive);
+};
+
+/**
+ * \brief Triangle rasterizer - referenced from class TriangleRasterizer in rrRasterizer.hpp
+ *
+ * Triangle rasterizer implements following features:
+ * - Rasterization using fixed-point coordinates
+ * - 1-sample rasterization (the value of numSamples always equals 1 in sglrReferenceContext)
+ * - Depth interpolation
+ * - Perspective-correct barycentric computation for interpolation
+ * - Visible face determination
+ * - Clipping - native dEQP does clipping before rasterization; see function drawBasicPrimitives
+ * in rrRenderer.cpp for more details
+ *
+ * It does not (and will not) implement following:
+ * - Triangle setup
+ * - Degenerate elimination
+ * - Coordinate transformation (inputs are in screen-space)
+ * - Culling - logic can be implemented outside by querying visible face
+ * - Scissoring - (this can be done by controlling viewport rectangle)
+ * - Any per-fragment operations
+ *
+ * @param {rrRenderState.RenderState} state
+ */
+rrRenderer.triangleRasterizer = function(state) {
+ this.m_viewport = state.viewport;
+ this.m_winding = state.rasterization.winding;
+ this.m_horizontalFill = state.rasterization.horizontalFill;
+ this.m_verticalFill = state.rasterization.verticalFill;
+};
+
+/**
+ * Initialize triangle rasterization
+ * @param {vec} v0 Screen-space coordinates (x, y, z) and 1/w for vertex 0
+ * @param {vec} v1 Screen-space coordinates (x, y, z) and 1/w for vertex 1
+ * @param {vec} v2 Screen-space coordinates (x, y, z) and 1/w for vertex 2
+ */
+rrRenderer.triangleRasterizer.prototype.init = function(v0, v1, v2) {
+ this.m_v0 = v0;
+ this.m_v1 = v1;
+ this.m_v2 = v2;
+
+ // Positions in fixed-point coordinates
+ var x0 = rrRenderer.toSubpixelCoord(v0[0]);
+ var y0 = rrRenderer.toSubpixelCoord(v0[1]);
+ var x1 = rrRenderer.toSubpixelCoord(v1[0]);
+ var y1 = rrRenderer.toSubpixelCoord(v1[1]);
+ var x2 = rrRenderer.toSubpixelCoord(v2[0]);
+ var y2 = rrRenderer.toSubpixelCoord(v2[1]);
+
+ // Initialize edge functions
+ if (this.m_winding == rrRenderState.Winding.CCW) {
+ this.m_edge01 = rrRenderer.initEdgeCCW(this.m_horizontalFill, this.m_verticalFill, x0, y0, x1, y1);
+ this.m_edge12 = rrRenderer.initEdgeCCW(this.m_horizontalFill, this.m_verticalFill, x1, y1, x2, y2);
+ this.m_edge20 = rrRenderer.initEdgeCCW(this.m_horizontalFill, this.m_verticalFill, x2, y2, x0, y0);
+ } else {
+ // Reverse edges
+ this.m_edge01 = rrRenderer.initEdgeCCW(this.m_horizontalFill, this.m_verticalFill, x1, y1, x0, y0);
+ this.m_edge12 = rrRenderer.initEdgeCCW(this.m_horizontalFill, this.m_verticalFill, x2, y2, x1, y1);
+ this.m_edge20 = rrRenderer.initEdgeCCW(this.m_horizontalFill, this.m_verticalFill, x0, y0, x2, y2);
+ }
+
+ // Determine face
+ var s = this.m_edge01.evaluateEdge(x2, y2);
+ var positiveArea = (this.m_winding == rrRenderState.Winding.CCW ) ? s > 0 : s < 0;
+ this.m_face = positiveArea ? rrDefs.FaceType.FACETYPE_FRONT : rrDefs.FaceType.FACETYPE_BACK;
+ if (!positiveArea) {
+ // Reverse edges so that we can use CCW area tests & interpolation
+ this.m_edge01.reverseEdge();
+ this.m_edge12.reverseEdge();
+ this.m_edge20.reverseEdge();
+ }
+
+ // Bounding box
+ var minX = Math.min(x0, x1, x2);
+ var maxX = Math.max(x0, x1, x2);
+ var minY = Math.min(y0, y1, y2);
+ var maxY = Math.max(y0, y1, y2);
+
+ this.m_bboxMin = [];
+ this.m_bboxMax = [];
+ this.m_bboxMin[0] = rrRenderer.floorSubpixelToPixelCoord(minX, this.m_horizontalFill == rrRenderState.HorizontalFill.LEFT);
+ this.m_bboxMin[1] = rrRenderer.floorSubpixelToPixelCoord(minY, this.m_verticalFill == rrRenderState.VerticalFill.BOTTOM);
+ this.m_bboxMax[0] = rrRenderer.ceilSubpixelToPixelCoord(maxX, this.m_horizontalFill == rrRenderState.HorizontalFill.RIGHT);
+ this.m_bboxMax[1] = rrRenderer.ceilSubpixelToPixelCoord(maxY, this.m_verticalFill == rrRenderState.VerticalFill.TOP);
+
+ // Clamp to viewport
+ var wX0 = this.m_viewport.rect.left;
+ var wY0 = this.m_viewport.rect.bottom;
+ var wX1 = wX0 + this.m_viewport.rect.width - 1;
+ var wY1 = wY0 + this.m_viewport.rect.height - 1;
+
+ this.m_bboxMin[0] = deMath.clamp(this.m_bboxMin[0], wX0, wX1);
+ this.m_bboxMin[1] = deMath.clamp(this.m_bboxMin[1], wY0, wY1);
+ this.m_bboxMax[0] = deMath.clamp(this.m_bboxMax[0], wX0, wX1);
+ this.m_bboxMax[1] = deMath.clamp(this.m_bboxMax[1], wY0, wY1);
+
+ this.m_curPos = [this.m_bboxMin[0], this.m_bboxMin[1]];
+};
+
+rrRenderer.triangleRasterizer.prototype.rasterize = function() {
+ var fragmentPackets = [];
+ var halfPixel = 1 << (rrRenderer.RASTERIZER_SUBPIXEL_BITS - 1);
+
+ // For depth interpolation; given barycentrics A, B, C = (1 - A -B)
+ // We can reformulate the usual z = z0 * A + z1 * B + z2 * C into more
+ // stable equation z = A * (z0 - z2) + B * (z1 - z2) + z2
+ var za = this.m_v0[2] - this.m_v2[2];
+ var zb = this.m_v1[2] - this.m_v2[2];
+ var zc = this.m_v2[2];
+
+ var zn = this.m_viewport.zn;
+ var zf = this.m_viewport.zf;
+ var depthScale = (zf - zn) / 2;
+ var depthBias = (zf + zn) / 2;
+
+ while (this.m_curPos[1] <= this.m_bboxMax[1]) {
+ var x0 = this.m_curPos[0];
+ var y0 = this.m_curPos[1];
+
+ // Subpixel coords of (x0, y0), (x0 + 1, y0), (x0, y0 + 1), (x0 + 1, y0 + 1)
+ var sx0 = rrRenderer.toSubpixelCoord(x0) + halfPixel;
+ var sx1 = rrRenderer.toSubpixelCoord(x0 + 1) + halfPixel;
+ var sy0 = rrRenderer.toSubpixelCoord(y0) + halfPixel;
+ var sy1 = rrRenderer.toSubpixelCoord(y0 + 1) + halfPixel;
+
+ var sx = [sx0, sx1, sx0, sx1];
+ var sy = [sy0, sy0, sy1, sy1];
+
+ // Viewport test
+ var outX1 = x0 + 1 == this.m_viewport.rect.left + this.m_viewport.rect.width;
+ var outY1 = y0 + 1 == this.m_viewport.rect.bottom + this.m_viewport.rect.height;
+
+ // Coverage
+ var coverage = 0;
+
+ // Evaluate edge values
+ var e01 = [];
+ var e12 = [];
+ var e20 = [];
+ for (var i = 0; i < 4; i++) {
+ e01.push(this.m_edge01.evaluateEdge(sx[i], sy[i]));
+ e12.push(this.m_edge12.evaluateEdge(sx[i], sy[i]));
+ e20.push(this.m_edge20.evaluateEdge(sx[i], sy[i]));
+ }
+
+ // Compute coverage mask
+ coverage = rrRenderer.setCoverageValue(coverage, 1, 0, 0, 0, this.m_edge01.isInsideCCW(e01[0]) && this.m_edge12.isInsideCCW(e12[0]) && this.m_edge20.isInsideCCW(e20[0]));
+ coverage = rrRenderer.setCoverageValue(coverage, 1, 1, 0, 0, !outX1 && this.m_edge01.isInsideCCW(e01[1]) && this.m_edge12.isInsideCCW(e12[1]) && this.m_edge20.isInsideCCW(e20[1]));
+ coverage = rrRenderer.setCoverageValue(coverage, 1, 0, 1, 0, !outY1 && this.m_edge01.isInsideCCW(e01[2]) && this.m_edge12.isInsideCCW(e12[2]) && this.m_edge20.isInsideCCW(e20[2]));
+ coverage = rrRenderer.setCoverageValue(coverage, 1, 1, 1, 0, !outX1 && !outY1 && this.m_edge01.isInsideCCW(e01[3]) && this.m_edge12.isInsideCCW(e12[3]) && this.m_edge20.isInsideCCW(e20[3]));
+
+ // Advance to next location
+ this.m_curPos[0] += 2;
+ if (this.m_curPos[0] > this.m_bboxMax[0]) {
+ this.m_curPos[0] = this.m_bboxMin[0];
+ this.m_curPos[1] += 2;
+ }
+
+ if (coverage == 0)
+ continue; // Discard
+
+ // Compute depth and barycentric coordinates
+ var edgeSum = deMath.add(deMath.add(e01, e12), e20);
+ var z0 = deMath.divide(e12, edgeSum);
+ var z1 = deMath.divide(e20, edgeSum);
+
+ var b0 = deMath.multiply(e12, [this.m_v0[3], this.m_v0[3], this.m_v0[3], this.m_v0[3]]);
+ var b1 = deMath.multiply(e20, [this.m_v1[3], this.m_v1[3], this.m_v1[3], this.m_v1[3]]);
+ var b2 = deMath.multiply(e01, [this.m_v2[3], this.m_v2[3], this.m_v2[3], this.m_v2[3]]);
+ var bSum = deMath.add(deMath.add(b0, b1), b2);
+ var barycentric0 = deMath.divide(b0, bSum);
+ var barycentric1 = deMath.divide(b1, bSum);
+ var barycentric2 = deMath.subtract(deMath.subtract([1, 1, 1, 1], barycentric0), barycentric1);
+
+ // In native dEQP, after rasterization, the pixel (x0, y0) actually represents four pixels:
+ // (x0, y0), (x0 + 1, y0), (x0, y0 + 1) and (x0 + 1, y0 + 1).
+ // The barycentrics and depths of these four pixels are to be computed after rasterization:
+ // barycentrics are computed in function shadeFragments in es3fFboTestUtil.cpp;
+ // depths are computed in function writeFragmentPackets in rrRenderer.cpp.
+
+ // In js, pixels are processed one after another, so their depths and barycentrics should be computed immediately.
+
+ // Determine if (x0, y0), (x0 + 1, y0), (x0, y0 + 1), (x0 + 1, y0 + 1) can be rendered
+ for (var fragNdx = 0; fragNdx < 4; fragNdx++) {
+ var xo = fragNdx % 2;
+ var yo = Math.trunc(fragNdx / 2);
+ var x = x0 + xo;
+ var y = y0 + yo;
+
+ // The value of numSamples always equals 1 in sglrReferenceContext.
+ if(rrRenderer.getCoverageAnyFragmentSampleLive(coverage, 1, xo, yo)) {
+ // Barycentric coordinates - referenced from function readTriangleVarying in rrShadingContext.hpp
+ var b = [barycentric0[fragNdx], barycentric1[fragNdx], barycentric2[fragNdx]];
+
+ // Depth - referenced from writeFragmentPackets in rrRenderer.cpp
+ var depth = z0[fragNdx] * za + z1[fragNdx] * zb + zc;
+ depth = depth * depthScale + depthBias;
+
+ // Clip test
+ // Native dEQP does clipping test before rasterization.
+ if (!rrRenderer.clipTest(x, y, depth, this.m_viewport.rect))
+ continue;
+
+ fragmentPackets.push(new rrFragmentOperations.Fragment(b, [x, y], depth));
+ }
+ }
+ }
+ return fragmentPackets;
+};
+
+/**
+ * @param {rrRenderState.RenderState} state
+ * @param {rrRenderer.RenderTarget} renderTarget
+ * @param {sglrShaderProgram.ShaderProgram} program
+ * @param {Array<rrVertexAttrib.VertexAttrib>} vertexAttribs
+ * @param {rrRenderer.PrimitiveType} primitive
+ * @param {(number|rrRenderer.DrawIndices)} first Index of first quad vertex
+ * @param {number} count Number of indices
+ * @param {number} instanceID
+ */
+rrRenderer.drawTriangles = function(state, renderTarget, program, vertexAttribs, primitive, first, count, instanceID) {
+
+ /**
+ * @param {Array<rrVertexPacket.VertexPacket>} vertices
+ * @param {Array<number>} indices
+ * @return {Array<rrVertexPacket.VertexPacket>}
+ */
+ var selectVertices = function(vertices, indices) {
+ var result = [];
+ for (var i = 0; i < indices.length; i++)
+ result.push(vertices[indices[i]]);
+ return result;
+ };
+
+ // Referenced from native dEQP Renderer::drawInstanced() in rrRenderer.cpp
+
+ var primitives = new rrRenderer.PrimitiveList(primitive, count, first);
+ // Do not draw if nothing to draw
+ if (primitives.getNumElements() == 0)
+ return;
+
+ // Prepare transformation
+ var numVaryings = program.vertexShader.getOutputs().length;
+ var vpalloc = new rrVertexPacket.VertexPacketAllocator(numVaryings);
+ var vertexPackets = vpalloc.allocArray(primitives.getNumElements());
+ var drawContext = new rrRenderer.DrawContext();
+ drawContext.primitiveID = 0;
+
+ var numberOfVertices = primitives.getNumElements();
+ var numVertexPackets = 0;
+ for (var elementNdx = 0; elementNdx < numberOfVertices; ++elementNdx) {
+
+ // input
+ vertexPackets[numVertexPackets].instanceNdx = instanceID;
+ vertexPackets[numVertexPackets].vertexNdx = primitives.getIndex(elementNdx);
+
+ // output
+ vertexPackets[numVertexPackets].pointSize = state.point.pointSize; // default value from the current state
+ vertexPackets[numVertexPackets].position = [0, 0, 0, 0]; // no undefined values
+
+ ++numVertexPackets;
+
+ }
+ program.shadeVertices(vertexAttribs, vertexPackets, numVertexPackets);
+
+ // Referenced from native dEQP Renderer::rasterizePrimitive() for triangle rasterization in rrRenderer.cpp
+
+ // In native dEQP, only maxFragmentPackets packets are processed per rasterize-shade-write loop;
+ // in js all packets are processed in one loop.
+
+ var rasterizer = new rrRenderer.triangleRasterizer(state);
+
+ for (var prim = primitives.getNextPrimitive(true); prim.length > 0; prim = primitives.getNextPrimitive()) {
+ var vertices = selectVertices(vertexPackets, prim);
+
+ var v0 = rrRenderer.transformGLToWindowCoords(state, vertices[0]);
+ var v1 = rrRenderer.transformGLToWindowCoords(state, vertices[1]);
+ var v2 = rrRenderer.transformGLToWindowCoords(state, vertices[2]);
+
+ rasterizer.init(v0, v1, v2);
+
+ // Culling
+ if ((state.cullMode == rrRenderState.CullMode.FRONT && rasterizer.m_face == rrDefs.FaceType.FACETYPE_FRONT) ||
+ (state.cullMode == rrRenderState.CullMode.BACK && rasterizer.m_face == rrDefs.FaceType.FACETYPE_BACK))
+ return;
+
+ /* TODO: Add Polygon Offset and Depth Clamp */
+
+ // Compute a conservative integer bounding box for the triangle
+ var minX = Math.floor(Math.min(v0[0], v1[0], v2[0]));
+ var maxX = Math.ceil(Math.max(v0[0], v1[0], v2[0]));
+ var minY = Math.floor(Math.min(v0[1], v1[1], v2[1]));
+ var maxY = Math.ceil(Math.max(v0[1], v1[1], v2[1]));
+
+ // Shading context
+ var shadingContext = new rrShadingContext.FragmentShadingContext(
+ vertices[0].outputs,
+ vertices[1].outputs,
+ vertices[2].outputs
+ );
+ shadingContext.setSize(maxX - minX, maxY - minY);
+
+ // Rasterize
+ var fragmentPackets = rasterizer.rasterize();
+
+ // Shade
+ program.shadeFragments(fragmentPackets, shadingContext);
+
+ // Handle fragment shader outputs
+ rrRenderer.writeFragments2(state, renderTarget, fragmentPackets);
+ }
+};
+
+/**
+ * @param {rrRenderState.RenderState} state
+ * @param {rrRenderer.RenderTarget} renderTarget
+ * @param {sglrShaderProgram.ShaderProgram} program
+ * @param {Array<rrVertexAttrib.VertexAttrib>} vertexAttribs
+ * @param {rrRenderer.PrimitiveType} primitive
+ * @param {(number|rrRenderer.DrawIndices)} first Index of first quad vertex
+ * @param {number} count Number of indices
+ * @param {number} instanceID
+ */
+rrRenderer.drawLines = function(state, renderTarget, program, vertexAttribs, primitive, first, count, instanceID) {
+
+ /**
+ * @param {Array<rrVertexPacket.VertexPacket>} vertices
+ * @param {Array<number>} indices
+ * @return {Array<rrVertexPacket.VertexPacket>}
+ */
+ var selectVertices = function(vertices, indices) {
+ var result = [];
+ for (var i = 0; i < indices.length; i++)
+ result.push(vertices[indices[i]]);
+ return result;
+ };
+
+ var lengthSquared = function(a) {
+ var sqSum = 0;
+ for (var i = 0; i < a.length; i++)
+ sqSum += a[i] * a[i];
+ return sqSum;
+ };
+
+ var dot = function(a, b) {
+ var res = 0;
+ for (var i = 0; i < a.length; i++)
+ res += a[i] * b[i];
+ return res;
+ };
+
+ var rasterizeLine = function(v0, v1) {
+ var d = [
+ Math.abs(v1[0] - v0[0]),
+ Math.abs(v1[1] - v0[1])];
+ var xstep = v0[0] < v1[0] ? 1 : -1;
+ var ystep = v0[1] < v1[1] ? 1 : -1;
+ var x = v0[0];
+ var y = v0[1];
+ var offset = d[0] - d[1];
+ var lenV = [v1[0] - v0[0], v1[1] - v0[1]];
+ var lenSq = lengthSquared(lenV);
+
+ var packets = [];
+
+ while (true) {
+ var t = dot([x - v0[0], y - v0[1]], lenV) / lenSq;
+ var depth = (1 - t) * v0[2] + t * v1[2];
+ var b = [0, 0, 0];
+ b[0] = 1 - t;
+ b[1] = t;
+
+ if (x == v1[0] && y == v1[1])
+ break;
+
+ depth = depth * depthScale + depthBias;
+ packets.push(new rrFragmentOperations.Fragment(b, [x, y], depth));
+
+ var offset2 = 2 * offset;
+ if (offset2 > -1 * d[1]) {
+ x += xstep;
+ offset -= d[1];
+ }
+
+ if (offset2 < d[0]) {
+ y += ystep;
+ offset += d[0];
+ }
+ }
+ return packets;
+ };
+
+ var primitives = new rrRenderer.PrimitiveList(primitive, count, first);
+ // Do not draw if nothing to draw
+ if (primitives.getNumElements() == 0)
+ return;
+
+ // Prepare transformation
+ var numVaryings = program.vertexShader.getOutputs().length;
+ var vpalloc = new rrVertexPacket.VertexPacketAllocator(numVaryings);
+ var vertexPackets = vpalloc.allocArray(primitives.getNumElements());
+ var drawContext = new rrRenderer.DrawContext();
+ drawContext.primitiveID = 0;
+
+ var numberOfVertices = primitives.getNumElements();
+ var numVertexPackets = 0;
+ for (var elementNdx = 0; elementNdx < numberOfVertices; ++elementNdx) {
+
+ // input
+ vertexPackets[numVertexPackets].instanceNdx = instanceID;
+ vertexPackets[numVertexPackets].vertexNdx = primitives.getIndex(elementNdx);
+
+ // output
+ vertexPackets[numVertexPackets].pointSize = state.point.pointSize; // default value from the current state
+ vertexPackets[numVertexPackets].position = [0, 0, 0, 0]; // no undefined values
+
+ ++numVertexPackets;
+
+ }
+ program.shadeVertices(vertexAttribs, vertexPackets, numVertexPackets);
+
+ var zn = state.viewport.zn;
+ var zf = state.viewport.zf;
+ var depthScale = (zf - zn) / 2;
+ var depthBias = (zf + zn) / 2;
+
+ // For each quad, we get a group of six vertex packets
+ for (var prim = primitives.getNextPrimitive(true); prim.length > 0; prim = primitives.getNextPrimitive()) {
+ var linePackets = selectVertices(vertexPackets, prim);
+
+ var v0 = rrRenderer.transformGLToWindowCoords(state, linePackets[0]);
+ var v1 = rrRenderer.transformGLToWindowCoords(state, linePackets[1]);
+ v0[2] = linePackets[0].position[2];
+ v1[2] = linePackets[1].position[2];
+
+ v0[0] = Math.floor(v0[0]);
+ v0[1] = Math.floor(v0[1]);
+ v1[0] = Math.floor(v1[0]);
+ v1[1] = Math.floor(v1[1]);
+
+ var lineWidth = state.line.lineWidth;
+
+ var shadingContext = new rrShadingContext.FragmentShadingContext(
+ linePackets[0].outputs,
+ linePackets[1].outputs,
+ null
+ );
+ var isXmajor = Math.abs(v1[0] - v0[0]) >= Math.abs(v1[1] - v0[1]);
+ var packets = [];
+ if (isXmajor)
+ packets = rasterizeLine([v0[0], v0[1] - (lineWidth - 1) / 2, v0[2]],
+ [v1[0], v1[1] - (lineWidth - 1) / 2, v1[2]]);
+ else
+ packets = rasterizeLine([v0[0] - (lineWidth - 1) / 2, v0[1], v0[2]],
+ [v1[0] - (lineWidth - 1) / 2, v1[1], v1[2]]);
+ var numPackets = packets.length;
+ if (lineWidth > 1)
+ for (var i = 0; i < numPackets; i++) {
+ var p = packets[i];
+ for (var j = 1; j < lineWidth; j++) {
+ var p2 = deUtil.clone(p);
+ if (isXmajor)
+ p2.pixelCoord[1] += j;
+ else
+ p2.pixelCoord[0] += j;
+ packets.push(p2);
+ }
+ }
+
+ var clipped = [];
+ for (var i = 0; i < packets.length; i++) {
+ var p = packets[i];
+ if (rrRenderer.clipTest(p.pixelCoord[0], p.pixelCoord[1], p.sampleDepths[0], state.viewport.rect))
+ clipped.push(p);
+ }
+ program.shadeFragments(clipped, shadingContext);
+
+ rrRenderer.writeFragments2(state, renderTarget, clipped);
+ }
+};
+
+/**
+ * @param {rrRenderState.RenderState} state
+ * @param {rrRenderer.RenderTarget} renderTarget
+ * @param {sglrShaderProgram.ShaderProgram} program
+ * @param {Array<rrVertexAttrib.VertexAttrib>} vertexAttribs
+ * @param {rrRenderer.PrimitiveType} primitive
+ * @param {(number|rrRenderer.DrawIndices)} first Index of first quad vertex
+ * @param {number} count Number of indices
+ * @param {number} instanceID
+ */
+rrRenderer.drawPoints = function(state, renderTarget, program, vertexAttribs, primitive, first, count, instanceID) {
+ /**
+ * @param {Array<rrVertexPacket.VertexPacket>} vertices
+ * @param {Array<number>} indices
+ * @return {Array<rrVertexPacket.VertexPacket>}
+ */
+ var selectVertices = function(vertices, indices) {
+ var result = [];
+ for (var i = 0; i < indices.length; i++)
+ result.push(vertices[indices[i]]);
+ return result;
+ };
+
+ var primitives = new rrRenderer.PrimitiveList(primitive, count, first);
+ // Do not draw if nothing to draw
+ if (primitives.getNumElements() == 0)
+ return;
+
+ // Prepare transformation
+ var numVaryings = program.vertexShader.getOutputs().length;
+ var vpalloc = new rrVertexPacket.VertexPacketAllocator(numVaryings);
+ var vertexPackets = vpalloc.allocArray(primitives.getNumElements());
+ var drawContext = new rrRenderer.DrawContext();
+ drawContext.primitiveID = 0;
+
+ var numberOfVertices = primitives.getNumElements();
+ var numVertexPackets = 0;
+ for (var elementNdx = 0; elementNdx < numberOfVertices; ++elementNdx) {
+
+ // input
+ vertexPackets[numVertexPackets].instanceNdx = instanceID;
+ vertexPackets[numVertexPackets].vertexNdx = primitives.getIndex(elementNdx);
+
+ // output
+ vertexPackets[numVertexPackets].pointSize = state.point.pointSize; // default value from the current state
+ vertexPackets[numVertexPackets].position = [0, 0, 0, 0]; // no undefined values
+
+ ++numVertexPackets;
+
+ }
+ program.shadeVertices(vertexAttribs, vertexPackets, numVertexPackets);
+
+ var zn = state.viewport.zn;
+ var zf = state.viewport.zf;
+ var depthScale = (zf - zn) / 2;
+ var depthBias = (zf + zn) / 2;
+
+ // For each primitive, we draw a point.
+ for (var prim = primitives.getNextPrimitive(true); prim.length > 0; prim = primitives.getNextPrimitive()) {
+ var pointPackets = selectVertices(vertexPackets, prim);
+
+ var v0 = rrRenderer.transformGLToWindowCoords(state, pointPackets[0]);
+ v0[2] = pointPackets[0].position[2];
+ var pointSize = pointPackets[0].pointSize;
+
+ var shadingContext = new rrShadingContext.FragmentShadingContext(
+ pointPackets[0].outputs,
+ null,
+ null
+ );
+ var packets = [];
+
+ var x = v0[0];
+ var y = v0[1];
+ var depth = v0[2];
+ var b = [1, 0, 0];
+ depth = depth * depthScale + depthBias;
+
+ for (var i = Math.floor(x - pointSize / 2); i < x + pointSize / 2; i++) {
+ for (var j = Math.floor(y - pointSize / 2); j < y + pointSize / 2; j++) {
+ var centerX = i + 0.5;
+ var centerY = j + 0.5;
+ if (Math.abs(centerX - x) <= pointSize / 2 &&
+ Math.abs(centerY - y) <= pointSize / 2 &&
+ rrRenderer.clipTest(i, j, depth, state.viewport.rect))
+ packets.push(new rrFragmentOperations.Fragment(b, [i, j], depth));
+ }
+ }
+
+ program.shadeFragments(packets, shadingContext);
+
+ rrRenderer.writeFragments2(state, renderTarget, packets);
+ }
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrShaders.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrShaders.js
new file mode 100644
index 0000000000..143d9b7289
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrShaders.js
@@ -0,0 +1,123 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.referencerenderer.rrShaders');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.referencerenderer.rrGenericVector');
+goog.require('framework.referencerenderer.rrShadingContext');
+goog.require('framework.referencerenderer.rrVertexAttrib');
+goog.require('framework.referencerenderer.rrVertexPacket');
+
+goog.scope(function() {
+
+var rrShaders = framework.referencerenderer.rrShaders;
+var tcuTexture = framework.common.tcuTexture;
+var deMath = framework.delibs.debase.deMath;
+var rrGenericVector = framework.referencerenderer.rrGenericVector;
+var rrShadingContext = framework.referencerenderer.rrShadingContext;
+var rrVertexAttrib = framework.referencerenderer.rrVertexAttrib;
+var rrVertexPacket = framework.referencerenderer.rrVertexPacket;
+
+ /**
+ * Vertex shader input information
+ * @constructor
+ */
+ rrShaders.VertexInputInfo = function() {
+ /** @type {rrGenericVector.GenericVecType} */ this.type;
+ };
+
+ /**
+ * Shader varying information
+ * @constructor
+ */
+ rrShaders.VertexVaryingInfo = function() {
+ /** @type {rrGenericVector.GenericVecType} */ this.type;
+ /** @type {boolean} */ var flatshade = false;
+ };
+
+ /**
+ * Fragment shader output information
+ * @constructor
+ */
+ rrShaders.FragmentOutputInfo = function() {
+ //Sensible defaults
+ /** @type {rrGenericVector.GenericVecType} */ this.type;
+ };
+
+ /**
+ * Vertex shader interface
+ *
+ * Vertex shaders execute shading for set of vertex packets. See VertexPacket
+ * documentation for more details on shading API.
+ * @constructor
+ * @param {number} numInputs
+ * @param {number} numOutputs
+ */
+ rrShaders.VertexShader = function(numInputs, numOutputs) {
+ /** @type {Array<rrShaders.VertexInputInfo>} */ this.m_inputs = [];
+ for (var ndx = 0; ndx < numInputs; ndx++) this.m_inputs[ndx] = new rrShaders.VertexInputInfo();
+ /** @type {Array<rrShaders.VertexVaryingInfo>} */ this.m_outputs = [];
+ for (var ndx = 0; ndx < numOutputs; ndx++) this.m_outputs[ndx] = new rrShaders.VertexVaryingInfo();
+ };
+
+ /**
+ * getInputs
+ * @return {Array<rrShaders.VertexInputInfo>}
+ */
+ rrShaders.VertexShader.prototype.getInputs = function() {return this.m_inputs;};
+
+ /**
+ * getOutputs
+ * @return {Array<rrShaders.VertexVaryingInfo>}
+ */
+ rrShaders.VertexShader.prototype.getOutputs = function() {return this.m_outputs;};
+
+ /**
+ * Fragment shader interface
+ *
+ * Fragment shader executes shading for list of fragment packets. See
+ * FragmentPacket documentation for more details on shading API.
+ * @constructor
+ * @param {number} numInputs
+ * @param {number} numOutputs
+ */
+ rrShaders.FragmentShader = function(numInputs, numOutputs) {
+ /** @type {Array<rrShaders.VertexVaryingInfo>} */ this.m_inputs = [];
+ for (var ndx = 0; ndx < numInputs; ndx++) this.m_inputs[ndx] = new rrShaders.VertexVaryingInfo();
+ /** @type {Array<rrShaders.FragmentOutputInfo>} */ this.m_outputs = [];
+ for (var ndx = 0; ndx < numOutputs; ndx++) this.m_outputs[ndx] = new rrShaders.FragmentOutputInfo();
+ /** @type {*} */ this.m_container; // owner object
+ };
+
+ /**
+ * getInputs
+ * @return {Array<rrShaders.VertexVaryingInfo>}
+ */
+ rrShaders.FragmentShader.prototype.getInputs = function() {return this.m_inputs;};
+
+ /**
+ * getOutputs
+ * @return {Array<rrShaders.FragmentOutputInfo>}
+ */
+ rrShaders.FragmentShader.prototype.getOutputs = function() {return this.m_outputs;};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrShadingContext.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrShadingContext.js
new file mode 100644
index 0000000000..38b9d201f9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrShadingContext.js
@@ -0,0 +1,113 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.referencerenderer.rrShadingContext');
+goog.require('framework.referencerenderer.rrFragmentOperations');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.referencerenderer.rrDefs');
+goog.require('framework.referencerenderer.rrFragmentOperations');
+goog.require('framework.referencerenderer.rrGenericVector');
+
+goog.scope(function() {
+
+ var rrShadingContext = framework.referencerenderer.rrShadingContext;
+ var deMath = framework.delibs.debase.deMath;
+ var rrDefs = framework.referencerenderer.rrDefs;
+ var rrFragmentOperations = framework.referencerenderer.rrFragmentOperations;
+ var rrGenericVector = framework.referencerenderer.rrGenericVector;
+
+ var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+ };
+
+ /**
+ * Fragment shading context
+ *
+ * Contains per-primitive information used in fragment shading
+ * @constructor
+ * @param {Array<Array<number>>} varying0 (GenericVec4*)
+ * @param {Array<Array<number>>} varying1 (GenericVec4*)
+ * @param {Array<Array<number>>} varying2 (GenericVec4*)
+ */
+ rrShadingContext.FragmentShadingContext = function(varying0, varying1, varying2) {
+ /** @type {Array<Array<Array<number>>>} */ this.varyings = [varying0, varying1, varying2]; //!< Vertex shader outputs. Pointer will be NULL if there is no such vertex.
+ this.m_width = 0xFFFFFFFF;
+ this.m_height = 0xFFFFFFFF;
+ };
+
+ /**
+ * @param {number} width
+ * @param {number} height
+ */
+ rrShadingContext.FragmentShadingContext.prototype.setSize = function(width, height) {
+ this.m_width = width;
+ this.m_height = height;
+ };
+
+ rrShadingContext.FragmentShadingContext.prototype.getWidth = function() {
+ return this.m_width;
+ };
+
+ rrShadingContext.FragmentShadingContext.prototype.getHeight = function() {
+ return this.m_height;
+ };
+
+ // Read Varying
+
+ /**
+ * @param {rrFragmentOperations.Fragment} packet
+ * @param {rrShadingContext.FragmentShadingContext} context
+ * @param {number} varyingLoc
+ * @return {Array<number>} (Vector<T, 4>)
+ */
+ rrShadingContext.readTriangleVarying = function(packet, context, varyingLoc) {
+ var result = deMath.scale(
+ context.varyings[0][varyingLoc],
+ packet.barycentric[0]
+ );
+
+ if (context.varyings[1])
+ result = deMath.add(result, deMath.scale(
+ context.varyings[1][varyingLoc],
+ packet.barycentric[1]
+ ));
+
+ if (context.varyings[2])
+ result = deMath.add(result, deMath.scale(
+ context.varyings[2][varyingLoc],
+ packet.barycentric[2]
+ ));
+
+ return result;
+ };
+
+ /**
+ * @param {rrFragmentOperations.Fragment} packet
+ * @param {rrShadingContext.FragmentShadingContext} context
+ * @param {number} varyingLoc
+ * @return {Array<number>} (Vector<T, 4>)
+ */
+ rrShadingContext.readVarying = function(packet, context, varyingLoc) {
+ return rrShadingContext.readTriangleVarying(packet, context, varyingLoc);
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrUtil.js
new file mode 100644
index 0000000000..03a58168fc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrUtil.js
@@ -0,0 +1,115 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.referencerenderer.rrUtil');
+goog.require('framework.opengl.simplereference.sglrGLContext');
+goog.require('framework.opengl.simplereference.sglrReferenceContext');
+
+goog.scope(function() {
+
+ var rrUtil = framework.referencerenderer.rrUtil;
+ var sglrGLContext = framework.opengl.simplereference.sglrGLContext;
+ var sglrReferenceContext = framework.opengl.simplereference.sglrReferenceContext;
+
+ /**
+ * @param {sglrGLContext.GLContext | WebGL2RenderingContext | sglrReferenceContext.ReferenceContext} ctx
+ * @param {number|Object} program
+ * @param {Array<number>} p0
+ * @param {Array<number>} p1
+ */
+ rrUtil.drawQuad = function(ctx, program, p0, p1) {
+ // Vertex data.
+ var hz = (p0[2] + p1[2]) * 0.5;
+ /** @type {Array<number>} */ var position = [
+ p0[0], p0[1], p0[2], 1.0,
+ p0[0], p1[1], hz, 1.0,
+ p1[0], p0[1], hz, 1.0,
+ p1[0], p1[1], p1[2], 1.0
+ ];
+ /** @type {Array<number>} */ var coord = [
+ 0.0, 0.0,
+ 0.0, 1.0,
+ 1.0, 0.0,
+ 1.0, 1.0
+ ];
+ /** @type {Array<number>} */ var indices = [0, 1, 2, 2, 1, 3];
+
+ var posLoc = ctx.getAttribLocation(program, 'a_position');
+ if (posLoc == -1)
+ throw new Error('a_position attribute is not defined.');
+
+ var coordLoc = ctx.getAttribLocation(program, 'a_coord');
+ var vaoID;
+ var bufIDs = [];
+
+ vaoID = ctx.createVertexArray();
+ ctx.bindVertexArray(vaoID);
+
+ bufIDs[0] = ctx.createBuffer();
+ bufIDs[1] = ctx.createBuffer();
+
+ ctx.useProgram(program);
+
+ if (posLoc >= 0) {
+ ctx.bindBuffer(gl.ARRAY_BUFFER, bufIDs[0]);
+ ctx.bufferData(gl.ARRAY_BUFFER, new Float32Array(position), gl.STATIC_DRAW);
+
+ ctx.enableVertexAttribArray(posLoc);
+ ctx.vertexAttribPointer(posLoc, 4, gl.FLOAT, false, 0, 0);
+
+ ctx.bindBuffer(gl.ARRAY_BUFFER, null);
+ }
+
+ if (coordLoc >= 0) {
+ ctx.bindBuffer(gl.ARRAY_BUFFER, bufIDs[1]);
+ ctx.bufferData(gl.ARRAY_BUFFER, new Float32Array(coord), gl.STATIC_DRAW);
+
+ ctx.enableVertexAttribArray(coordLoc);
+ ctx.vertexAttribPointer(coordLoc, 2, gl.FLOAT, false, 0, 0);
+
+ ctx.bindBuffer(gl.ARRAY_BUFFER, null);
+ }
+
+ {
+ var ndxID = ctx.createBuffer();
+
+ ctx.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, ndxID);
+ ctx.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(indices), gl.STATIC_DRAW);
+
+ ctx.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0);
+
+ ctx.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);
+ ctx.deleteBuffer(ndxID);
+ }
+
+ ctx.bindVertexArray(null);
+ ctx.deleteBuffer(bufIDs[0]);
+ ctx.deleteBuffer(bufIDs[1]);
+ ctx.deleteVertexArray(vaoID);
+
+ if (posLoc >= 0)
+ ctx.disableVertexAttribArray(posLoc);
+
+ if (coordLoc >= 0)
+ ctx.disableVertexAttribArray(coordLoc);
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrVertexAttrib.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrVertexAttrib.js
new file mode 100644
index 0000000000..f6095e2cc9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrVertexAttrib.js
@@ -0,0 +1,641 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.referencerenderer.rrVertexAttrib');
+goog.require('framework.common.tcuFloat');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.referencerenderer.rrGenericVector');
+
+goog.scope(function() {
+
+var rrVertexAttrib = framework.referencerenderer.rrVertexAttrib;
+var deMath = framework.delibs.debase.deMath;
+var tcuFloat = framework.common.tcuFloat;
+var rrGenericVector = framework.referencerenderer.rrGenericVector;
+
+ var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+ };
+
+ /**
+ * rrVertexAttrib.NormalOrder
+ * @enum
+ */
+ rrVertexAttrib.NormalOrder = {
+ T0: 0,
+ T1: 1,
+ T2: 2,
+ T3: 3
+ };
+
+ /**
+ * rrVertexAttrib.BGRAOrder
+ * @enum
+ */
+ rrVertexAttrib.BGRAOrder = {
+ T0: 2,
+ T1: 1,
+ T2: 0,
+ T3: 3
+ };
+
+ /**
+ * rrVertexAttrib.VertexAttribType enum
+ * @enum
+ */
+ rrVertexAttrib.VertexAttribType = {
+ // Can only be rrVertexAttrib.read as floats
+ FLOAT: 0,
+ HALF: 1,
+ FIXED: 2,
+ DOUBLE: 3,
+
+ // Can only be rrVertexAttrib.read as floats, will be normalized
+ NONPURE_UNORM8: 4,
+ NONPURE_UNORM16: 5,
+ NONPURE_UNORM32: 6,
+ NONPURE_UNORM_2_10_10_10_REV: 7, //!< Packed format, only size = 4 is allowed
+
+ // Clamped formats, GLES3-style conversion: max{c / (2^(b-1) - 1), -1 }
+ NONPURE_SNORM8_CLAMP: 8,
+ NONPURE_SNORM16_CLAMP: 9,
+ NONPURE_SNORM32_CLAMP: 10,
+ NONPURE_SNORM_2_10_10_10_REV_CLAMP: 11, //!< Packed format, only size = 4 is allowed
+
+ // Scaled formats, GLES2-style conversion: (2c + 1) / (2^b - 1)
+ NONPURE_SNORM8_SCALE: 12,
+ NONPURE_SNORM16_SCALE: 13,
+ NONPURE_SNORM32_SCALE: 14,
+ NONPURE_SNORM_2_10_10_10_REV_SCALE: 15, //!< Packed format, only size = 4 is allowed
+
+ // can only be rrVertexAttrib.read as float, will not be normalized
+ NONPURE_UINT8: 16,
+ NONPURE_UINT16: 17,
+ NONPURE_UINT32: 18,
+
+ NONPURE_INT8: 19,
+ NONPURE_INT16: 20,
+ NONPURE_INT32: 21,
+
+ NONPURE_UINT_2_10_10_10_REV: 22, //!< Packed format, only size = 4 is allowed
+ NONPURE_INT_2_10_10_10_REV: 23, //!< Packed format, only size = 4 is allowed
+
+ // can only be rrVertexAttrib.read as integers
+ PURE_UINT8: 24,
+ PURE_UINT16: 25,
+ PURE_UINT32: 26,
+
+ PURE_INT8: 27,
+ PURE_INT16: 28,
+ PURE_INT32: 29,
+
+ // reordered formats of gl.ARB_vertex_array_bgra
+ NONPURE_UNORM8_BGRA: 30,
+ NONPURE_UNORM_2_10_10_10_REV_BGRA: 31,
+ NONPURE_SNORM_2_10_10_10_REV_CLAMP_BGRA: 32,
+ NONPURE_SNORM_2_10_10_10_REV_SCALE_BGRA: 33,
+
+ // can be rrVertexAttrib.read as anything
+ DONT_CARE: 34 //!< Do not enforce type checking when reading GENERIC attribute. Used for current client side attributes.
+ };
+
+ /**
+ * rrVertexAttrib.VertexAttrib class
+ * @constructor
+ */
+ rrVertexAttrib.VertexAttrib = function() {
+ /** @type {rrVertexAttrib.VertexAttribType} */ this.type = rrVertexAttrib.VertexAttribType.FLOAT;
+ /** @type {number} */ this.size = 0;
+ /** @type {number} */ this.stride = 0;
+ /** @type {number} */ this.instanceDivisor = 0;
+ /** @type {number} */ this.offset = 0; //Added this property to compensate functionality (not in original dEQP).
+ /** @type {ArrayBuffer} */ this.pointer = null;
+ /** @type {Array<number>|rrGenericVector.GenericVec4} */ this.generic; //!< Generic attribute, used if pointer is null.
+ };
+
+ /**
+ * @param {rrVertexAttrib.VertexAttribType} type
+ * @return {number}
+ */
+ rrVertexAttrib.getComponentSize = function(type) {
+ switch (type) {
+ case rrVertexAttrib.VertexAttribType.FLOAT: return 4;
+ case rrVertexAttrib.VertexAttribType.HALF: return 2;
+ case rrVertexAttrib.VertexAttribType.FIXED: return 4;
+ case rrVertexAttrib.VertexAttribType.DOUBLE: return 8; //sizeof(double);
+ case rrVertexAttrib.VertexAttribType.NONPURE_UNORM8: return 1;
+ case rrVertexAttrib.VertexAttribType.NONPURE_UNORM16: return 2;
+ case rrVertexAttrib.VertexAttribType.NONPURE_UNORM32: return 4;
+ case rrVertexAttrib.VertexAttribType.NONPURE_UNORM_2_10_10_10_REV: return 1; //sizeof(deUint32)/4;
+ case rrVertexAttrib.VertexAttribType.NONPURE_SNORM8_CLAMP: return 1;
+ case rrVertexAttrib.VertexAttribType.NONPURE_SNORM16_CLAMP: return 2;
+ case rrVertexAttrib.VertexAttribType.NONPURE_SNORM32_CLAMP: return 4;
+ case rrVertexAttrib.VertexAttribType.NONPURE_SNORM_2_10_10_10_REV_CLAMP: return 1; //sizeof(deUint32)/4;
+ case rrVertexAttrib.VertexAttribType.NONPURE_SNORM8_SCALE: return 1;
+ case rrVertexAttrib.VertexAttribType.NONPURE_SNORM16_SCALE: return 2;
+ case rrVertexAttrib.VertexAttribType.NONPURE_SNORM32_SCALE: return 4;
+ case rrVertexAttrib.VertexAttribType.NONPURE_SNORM_2_10_10_10_REV_SCALE: return 1; //sizeof(deUint32)/4;
+ case rrVertexAttrib.VertexAttribType.NONPURE_UINT8: return 1;
+ case rrVertexAttrib.VertexAttribType.NONPURE_UINT16: return 2;
+ case rrVertexAttrib.VertexAttribType.NONPURE_UINT32: return 4;
+ case rrVertexAttrib.VertexAttribType.NONPURE_INT8: return 1;
+ case rrVertexAttrib.VertexAttribType.NONPURE_INT16: return 2;
+ case rrVertexAttrib.VertexAttribType.NONPURE_INT32: return 4;
+ case rrVertexAttrib.VertexAttribType.NONPURE_UINT_2_10_10_10_REV: return 1; //sizeof(deUint32)/4;
+ case rrVertexAttrib.VertexAttribType.NONPURE_INT_2_10_10_10_REV: return 1; //sizeof(deUint32)/4;
+ case rrVertexAttrib.VertexAttribType.PURE_UINT8: return 1;
+ case rrVertexAttrib.VertexAttribType.PURE_UINT16: return 2;
+ case rrVertexAttrib.VertexAttribType.PURE_UINT32: return 4;
+ case rrVertexAttrib.VertexAttribType.PURE_INT8: return 1;
+ case rrVertexAttrib.VertexAttribType.PURE_INT16: return 2;
+ case rrVertexAttrib.VertexAttribType.PURE_INT32: return 4;
+ case rrVertexAttrib.VertexAttribType.NONPURE_UNORM8_BGRA: return 1;
+ case rrVertexAttrib.VertexAttribType.NONPURE_UNORM_2_10_10_10_REV_BGRA: return 1; //sizeof(deUint32)/4;
+ case rrVertexAttrib.VertexAttribType.NONPURE_SNORM_2_10_10_10_REV_CLAMP_BGRA: return 1; //sizeof(deUint32)/4;
+ case rrVertexAttrib.VertexAttribType.NONPURE_SNORM_2_10_10_10_REV_SCALE_BGRA: return 1; //sizeof(deUint32)/4;
+ default:
+ throw new Error('rrVertexAttrib.getComponentSize - Invalid type');
+ }
+ };
+
+ /**
+ * rrVertexAttrib.isValidVertexAttrib function
+ * @param {rrVertexAttrib.VertexAttrib} vertexAttrib
+ * @return {boolean}
+ */
+ rrVertexAttrib.isValidVertexAttrib = function(vertexAttrib) {
+ // Trivial range checks.
+ if (!deMath.deInBounds32(vertexAttrib.type, 0, Object.keys(rrVertexAttrib.VertexAttribType).length) ||
+ !deMath.deInRange32(vertexAttrib.size, 0, 4) ||
+ vertexAttrib.instanceDivisor < 0)
+ return false;
+
+ // Generic attributes
+ if (!vertexAttrib.pointer && vertexAttrib.type != rrVertexAttrib.VertexAttribType.DONT_CARE)
+ return false;
+
+ // Packed formats
+ if ((vertexAttrib.type == rrVertexAttrib.VertexAttribType.NONPURE_INT_2_10_10_10_REV ||
+ vertexAttrib.type == rrVertexAttrib.VertexAttribType.NONPURE_UINT_2_10_10_10_REV ||
+ vertexAttrib.type == rrVertexAttrib.VertexAttribType.NONPURE_UNORM_2_10_10_10_REV ||
+ vertexAttrib.type == rrVertexAttrib.VertexAttribType.NONPURE_SNORM_2_10_10_10_REV_CLAMP ||
+ vertexAttrib.type == rrVertexAttrib.VertexAttribType.NONPURE_SNORM_2_10_10_10_REV_SCALE ||
+ vertexAttrib.type == rrVertexAttrib.VertexAttribType.NONPURE_UNORM_2_10_10_10_REV_BGRA ||
+ vertexAttrib.type == rrVertexAttrib.VertexAttribType.NONPURE_SNORM_2_10_10_10_REV_CLAMP_BGRA ||
+ vertexAttrib.type == rrVertexAttrib.VertexAttribType.NONPURE_SNORM_2_10_10_10_REV_SCALE_BGRA) &&
+ vertexAttrib.size != 4)
+ return false;
+
+ return true;
+ };
+
+ /**
+ * rrVertexAttrib.readVertexAttrib function
+ * @param {rrVertexAttrib.VertexAttrib} vertexAttrib
+ * @param {number} instanceNdx
+ * @param {number} vertexNdx
+ * @param {rrGenericVector.GenericVecType} genericType
+ * @return {goog.NumberArray}
+ */
+ rrVertexAttrib.readVertexAttrib = function(vertexAttrib, instanceNdx, vertexNdx, genericType) {
+ DE_ASSERT(rrVertexAttrib.isValidVertexAttrib(vertexAttrib));
+ /** @type {goog.NumberArray} */ var dst;
+
+ var arrayType = null;
+ switch (genericType) {
+ case rrGenericVector.GenericVecType.INT32:
+ arrayType = Int32Array;
+ break;
+ case rrGenericVector.GenericVecType.UINT32:
+ arrayType = Uint32Array;
+ break;
+ case rrGenericVector.GenericVecType.FLOAT:
+ arrayType = Float32Array;
+ break;
+ }
+
+ if (vertexAttrib.pointer) {
+ /** @type {number} */ var elementNdx = (vertexAttrib.instanceDivisor != 0) ? (instanceNdx / vertexAttrib.instanceDivisor) : vertexNdx;
+ /** @type {number} */ var compSize = rrVertexAttrib.getComponentSize(vertexAttrib.type);
+ /** @type {number} */ var stride = (vertexAttrib.stride != 0) ? (vertexAttrib.stride) : (vertexAttrib.size * compSize);
+ /** @type {number} */ var byteOffset = vertexAttrib.offset + (elementNdx * stride);
+
+ dst = [0, 0, 0, 1]; // defaults
+
+ if (arrayType != null) {
+ dst = new arrayType(dst);
+ }
+
+ rrVertexAttrib.read(dst, vertexAttrib.type, vertexAttrib.size, new Uint8Array(vertexAttrib.pointer, byteOffset));
+ } else {
+ dst = new arrayType(/** @type {Array<number>} */ vertexAttrib.generic.data);
+ }
+
+ return dst;
+ };
+
+ /**
+ * rrVertexAttrib.readHalf
+ * @param {goog.NumberArray} dst
+ * @param {number} size
+ * @param {Uint8Array} ptr
+ */
+ rrVertexAttrib.readHalf = function(dst, size, ptr) {
+ var arraysize16 = 2; //2 bytes
+
+ var ptrclone = new Uint8Array(ptr.subarray(0, size * arraysize16)); //Small buffer copy (max. 8 bytes)
+ var aligned = new Uint16Array(ptrclone.buffer);
+
+ //Reinterpret aligned's values into the dst vector.
+ dst[0] = tcuFloat.newFloat32From16(aligned[0]).getValue();
+ if (size >= 2) dst[1] = tcuFloat.newFloat32From16(aligned[1]).getValue();
+ if (size >= 3) dst[2] = tcuFloat.newFloat32From16(aligned[2]).getValue();
+ if (size >= 4) dst[3] = tcuFloat.newFloat32From16(aligned[3]).getValue();
+ };
+
+ /**
+ * rrVertexAttrib.readFixed
+ * @param {goog.NumberArray} dst
+ * @param {number} size
+ * @param {Uint8Array} ptr
+ */
+ /*rrVertexAttrib.readFixed = function(dst, size, ptr) {
+ var arraysize32 = 4; //4 bytes
+
+ //Reinterpret ptr as a uint16 array,
+ //assuming original ptr is 8-bits per element
+ var aligned = new Int32Array(ptr.buffer).subarray(
+ ptr.byteOffset / arraysize32,
+ (ptr.byteOffset + ptr.byteLength) / arraysize32);
+
+ //Reinterpret aligned's values into the dst vector.
+ dst[0] = aligned[0] / (1 << 16);
+ if (size >= 2) dst[1] = aligned[1] / (1 << 16);
+ if (size >= 3) dst[2] = aligned[2] / (1 << 16);
+ if (size >= 4) dst[3] = aligned[3] / (1 << 16);
+ };*/
+
+ /**
+ * TODO: Check 64 bit numbers are handled ok
+ * rrVertexAttrib.readDouble
+ * @param {goog.NumberArray} dst
+ * @param {number} size
+ * @param {Uint8Array} ptr
+ */
+ /*rrVertexAttrib.readDouble = function(dst, size, ptr) {
+ var arraysize64 = 8; //8 bytes
+
+ //Reinterpret 'ptr' into 'aligned' as a float64 array,
+ //assuming original ptr is 8-bits per element.
+ var aligned = new Float64Array(ptr.buffer).subarray(
+ ptr.byteOffset / arraysize64,
+ (ptr.byteOffset + ptr.byteLength) / arraysize64);
+
+ //Reinterpret aligned's values into the dst vector.
+ dst[0] = aligned[0];
+ if (size >= 2) dst[1] = aligned[1];
+ if (size >= 3) dst[2] = aligned[2];
+ if (size >= 4) dst[3] = aligned[3];
+ };*/
+
+ /**
+ * extendSign
+ * @param {number} integerLen
+ * @param {number} integer_ (deUint32)
+ * @return {number} (deInt32)
+ */
+ rrVertexAttrib.extendSign = function(integerLen, integer_) {
+ return new Int32Array([
+ deMath.binaryOp(
+ 0 -
+ deMath.shiftLeft(
+ deMath.binaryOp(
+ integer_,
+ deMath.shiftLeft(
+ 1,
+ (integerLen - 1)
+ ),
+ deMath.BinaryOp.AND
+ ),
+ 1
+ ) ,
+
+integer_,
+ deMath.BinaryOp.OR
+ )
+ ])[0];
+ };
+
+ /**
+ * rrVertexAttrib.readUint2101010Rev
+ * @param {goog.NumberArray} dst
+ * @param {number} size
+ * @param {Uint8Array} ptr
+ */
+ rrVertexAttrib.readUint2101010Rev = function(dst, size, ptr) {
+ var arraysize32 = 4; //4 bytes
+
+ var ptrclone = new Uint8Array(ptr.subarray(0, size * arraysize32)); //Small buffer copy (max. 16 bytes)
+ var aligned = new Uint32Array(ptrclone.buffer)[0];
+
+ dst[0] = deMath.binaryOp(deMath.shiftRight(aligned, 0), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND);
+ if (size >= 2) dst[1] = deMath.binaryOp(deMath.shiftRight(aligned, 10), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND);
+ if (size >= 3) dst[2] = deMath.binaryOp(deMath.shiftRight(aligned, 20), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND);
+ if (size >= 4) dst[3] = deMath.binaryOp(deMath.shiftRight(aligned, 30), deMath.shiftLeft(1, 2) - 1, deMath.BinaryOp.AND);
+ };
+
+ /**
+ * rrVertexAttrib.readInt2101010Rev
+ * @param {goog.NumberArray} dst
+ * @param {number} size
+ * @param {Uint8Array} ptr
+ */
+ rrVertexAttrib.readInt2101010Rev = function(dst, size, ptr) {
+ var arraysize32 = 4; //4 bytes
+
+ var ptrclone = new Uint8Array(ptr.subarray(0, size * arraysize32)); //Small buffer copy (max. 16 bytes)
+ var aligned = new Uint32Array(ptrclone.buffer)[0];
+
+ dst[0] = rrVertexAttrib.extendSign(10, deMath.binaryOp(deMath.shiftRight(aligned, 0), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND));
+ if (size >= 2) dst[1] = rrVertexAttrib.extendSign(10, deMath.binaryOp(deMath.shiftRight(aligned, 10), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND));
+ if (size >= 3) dst[2] = rrVertexAttrib.extendSign(10, deMath.binaryOp(deMath.shiftRight(aligned, 20), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND));
+ if (size >= 4) dst[3] = rrVertexAttrib.extendSign(2, deMath.binaryOp(deMath.shiftRight(aligned, 30), deMath.shiftLeft(1, 2) - 1, deMath.BinaryOp.AND));
+ };
+
+ /**
+ * rrVertexAttrib.readUnorm2101010RevOrder
+ * @param {goog.NumberArray} dst
+ * @param {number} size
+ * @param {Uint8Array} ptr
+ * @param {Object<rrVertexAttrib.NormalOrder|rrVertexAttrib.BGRAOrder>} order
+ */
+ rrVertexAttrib.readUnorm2101010RevOrder = function(dst, size, ptr, order) {
+ var arraysize32 = 4; //4 bytes
+
+ //Left shift within 32-bit range as 32-bit int.
+ var range10 = new Uint32Array([deMath.shiftLeft(1, 10) - 1])[0];
+ var range2 = new Uint32Array([deMath.shiftLeft(1, 2) - 1])[0];
+
+ var ptrclone = new Uint8Array(ptr.subarray(0, size * arraysize32)); //Small buffer copy (max. 16 bytes)
+ var aligned = new Uint32Array(ptrclone.buffer)[0];
+
+ dst[order.T0] = deMath.binaryOp(deMath.shiftRight(aligned, 0), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND) / range10;
+ if (size >= 2) dst[order.T1] = deMath.binaryOp(deMath.shiftRight(aligned, 10), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND) / range10;
+ if (size >= 3) dst[order.T2] = deMath.binaryOp(deMath.shiftRight(aligned, 20), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND) / range10;
+ if (size >= 4) dst[order.T3] = deMath.binaryOp(deMath.shiftRight(aligned, 30), deMath.shiftLeft(1, 2) - 1, deMath.BinaryOp.AND) / range2;
+ };
+
+ /**
+ * rrVertexAttrib.readSnorm2101010RevClampOrder
+ * @param {goog.NumberArray} dst
+ * @param {number} size
+ * @param {Uint8Array} ptr
+ * @param {Object<rrVertexAttrib.NormalOrder|rrVertexAttrib.BGRAOrder>} order
+ */
+ rrVertexAttrib.readSnorm2101010RevClampOrder = function(dst, size, ptr, order) {
+ var arraysize32 = 4; //4 bytes
+
+ //Left shift within 32-bit range as 32-bit int.
+ var range10 = new Uint32Array([deMath.shiftLeft(1, 10 - 1) - 1])[0];
+ var range2 = new Uint32Array([deMath.shiftLeft(1, 2 - 1) - 1])[0];
+
+ var ptrclone = new Uint8Array(ptr.subarray(0, size * arraysize32)); //Small buffer copy (max. 16 bytes)
+ var aligned = new Uint32Array(ptrclone.buffer)[0];
+
+ dst[order.T0] = Math.max(-1.0, new Float32Array([rrVertexAttrib.extendSign(10, deMath.binaryOp(deMath.shiftRight(aligned, 0), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND))])[0] / range10);
+ if (size >= 2) dst[order.T1] = Math.max(-1.0, new Float32Array([rrVertexAttrib.extendSign(10, deMath.binaryOp(deMath.shiftRight(aligned, 10), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND))])[0] / range10);
+ if (size >= 3) dst[order.T2] = Math.max(-1.0, new Float32Array([rrVertexAttrib.extendSign(10, deMath.binaryOp(deMath.shiftRight(aligned, 20), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND))])[0] / range10);
+ if (size >= 4) dst[order.T3] = Math.max(-1.0, new Float32Array([rrVertexAttrib.extendSign(2, deMath.binaryOp(deMath.shiftRight(aligned, 30), deMath.shiftLeft(1, 2) - 1, deMath.BinaryOp.AND))])[0] / range2);
+ };
+
+ /**
+ * rrVertexAttrib.readSnorm2101010RevScaleOrder
+ * @param {goog.NumberArray} dst
+ * @param {number} size
+ * @param {Uint8Array} ptr
+ * @param {Object<rrVertexAttrib.NormalOrder|rrVertexAttrib.BGRAOrder>} order
+ */
+ rrVertexAttrib.readSnorm2101010RevScaleOrder = function(dst, size, ptr, order) {
+ var arraysize32 = 4; //4 bytes
+
+ //Left shift within 32-bit range as 32-bit int.
+ var range10 = new Uint32Array([deMath.shiftLeft(1, 10) - 1])[0];
+ var range2 = new Uint32Array([deMath.shiftLeft(1, 2) - 1])[0];
+
+ var ptrclone = new Uint8Array(ptr.subarray(0, size * arraysize32)); //Small buffer copy (max. 16 bytes)
+ var aligned = new Uint32Array(ptrclone.buffer)[0];
+
+ dst[order.T0] = new Float32Array([rrVertexAttrib.extendSign(10, deMath.binaryOp(deMath.shiftRight(aligned, 0), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND)) * 2.0 + 1.0])[0] / range10;
+ if (size >= 2) dst[order.T1] = new Float32Array([rrVertexAttrib.extendSign(10, deMath.binaryOp(deMath.shiftRight(aligned, 10), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND)) * 2.0 + 1.0])[0] / range10;
+ if (size >= 3) dst[order.T2] = new Float32Array([rrVertexAttrib.extendSign(10, deMath.binaryOp(deMath.shiftRight(aligned, 20), deMath.shiftLeft(1, 10) - 1, deMath.BinaryOp.AND)) * 2.0 + 1.0])[0] / range10;
+ if (size >= 4) dst[order.T3] = new Float32Array([rrVertexAttrib.extendSign(2, deMath.binaryOp(deMath.shiftRight(aligned, 30), deMath.shiftLeft(1, 2) - 1, deMath.BinaryOp.AND)) * 2.0 + 1.0])[0] / range2;
+ };
+
+ /**
+ * rrVertexAttrib.readUnormOrder
+ * @param {goog.NumberArray} dst
+ * @param {number} size
+ * @param {Uint8Array} ptr
+ * @param {Object<rrVertexAttrib.NormalOrder|rrVertexAttrib.BGRAOrder>} order
+ * @param readAsTypeArray
+ */
+ rrVertexAttrib.readUnormOrder = function(dst, size, ptr, order, readAsTypeArray) {
+ var arrayelementsize = readAsTypeArray.BYTES_PER_ELEMENT;
+
+ //Left shift within 32-bit range as 32-bit float.
+ var range = new Float32Array([deMath.shiftLeft(1, arrayelementsize * 8) - 1])[0];
+
+ var ptrclone = new Uint8Array(ptr.subarray(0, size * arrayelementsize)); //Small buffer copy (max. 16 bytes)
+ var aligned = new readAsTypeArray(ptrclone.buffer);
+
+ //Reinterpret aligned's values into the dst vector.
+ dst[order.T0] = aligned[0] / range;
+ if (size >= 2) dst[order.T1] = aligned[1] / range;
+ if (size >= 3) dst[order.T2] = aligned[2] / range;
+ if (size >= 4) dst[order.T3] = aligned[3] / range;
+ };
+
+ /**
+ * rrVertexAttrib.readSnormClamp
+ * @param {goog.NumberArray} dst
+ * @param {number} size
+ * @param {Uint8Array} ptr
+ * @param {function(new:ArrayBufferView,(Array<number>|ArrayBuffer|ArrayBufferView|null|number), number=, number=)} readAsTypeArray
+ */
+ rrVertexAttrib.readSnormClamp = function(dst, size, ptr, readAsTypeArray) {
+ var arrayelementsize = readAsTypeArray.BYTES_PER_ELEMENT;
+
+ //Left shift within 32-bit range as 32-bit float.
+ var range = new Float32Array([deMath.shiftLeft(1, arrayelementsize * 8 - 1) - 1])[0];
+
+ var ptrclone = new Uint8Array(ptr.subarray(0, size * arrayelementsize)); //Small buffer copy (max. 16 bytes)
+ var aligned = new readAsTypeArray(ptrclone.buffer);
+
+ //Reinterpret aligned's values into the dst vector.
+ dst[0] = Math.max(-1, aligned[0] / range);
+ if (size >= 2) dst[1] = Math.max(-1, aligned[1] / range);
+ if (size >= 3) dst[2] = Math.max(-1, aligned[2] / range);
+ if (size >= 4) dst[3] = Math.max(-1, aligned[3] / range);
+ };
+
+ /**
+ * rrVertexAttrib.readOrder
+ * @param {goog.NumberArray} dst
+ * @param {number} size
+ * @param {Uint8Array} ptr
+ * @param {Object<rrVertexAttrib.NormalOrder|rrVertexAttrib.BGRAOrder>} order NormalOrder or BGRAOrder
+ * @param readAsTypeArray Typed Array type
+ */
+ rrVertexAttrib.readOrder = function(dst, size, ptr, order, readAsTypeArray) {
+ var arrayelementsize = readAsTypeArray.BYTES_PER_ELEMENT;
+
+ var ptrclone = new Uint8Array(ptr.subarray(0, size * arrayelementsize)); //Small buffer copy (max. 16 bytes)
+ var aligned = new readAsTypeArray(ptrclone.buffer);
+
+ //Reinterpret aligned's values into the dst vector.
+ //(automatic in JS typed arrays).
+ dst[order.T0] = aligned[0];
+ if (size >= 2) dst[order.T1] = aligned[1];
+ if (size >= 3) dst[order.T2] = aligned[2];
+ if (size >= 4) dst[order.T3] = aligned[3];
+ };
+
+ /**
+ * TODO: Implement readSNormScale.
+ * @param {goog.NumberArray} dst
+ * @param {rrVertexAttrib.VertexAttribType} type
+ * @param {number} size
+ * @param {Uint8Array} ptr
+ */
+ rrVertexAttrib.read = function(dst, type, size, ptr) {
+ var order;
+
+ switch (type) {
+ case rrVertexAttrib.VertexAttribType.FLOAT:
+ rrVertexAttrib.readOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Float32Array);
+ break;
+ case rrVertexAttrib.VertexAttribType.HALF:
+ rrVertexAttrib.readHalf(dst, size, ptr);
+ break;
+ /*case rrVertexAttrib.VertexAttribType.FIXED:
+ rrVertexAttrib.readFixed(dst, size, ptr);
+ break;
+ case rrVertexAttrib.VertexAttribType.DOUBLE:
+ rrVertexAttrib.readDouble(dst, size, ptr);
+ break;*/
+ case rrVertexAttrib.VertexAttribType.NONPURE_UNORM8:
+ rrVertexAttrib.readUnormOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Uint8Array);
+ break;
+ case rrVertexAttrib.VertexAttribType.NONPURE_UNORM16:
+ rrVertexAttrib.readUnormOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Uint16Array);
+ break;
+ case rrVertexAttrib.VertexAttribType.NONPURE_UNORM32:
+ rrVertexAttrib.readUnormOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Uint32Array);
+ break;
+ case rrVertexAttrib.VertexAttribType.NONPURE_UNORM_2_10_10_10_REV:
+ rrVertexAttrib.readUnorm2101010RevOrder(dst, size, ptr, rrVertexAttrib.NormalOrder);
+ break;
+ case rrVertexAttrib.VertexAttribType.NONPURE_SNORM8_CLAMP: //Int8
+ rrVertexAttrib.readSnormClamp(dst, size, ptr, Int8Array);
+ break;
+ case rrVertexAttrib.VertexAttribType.NONPURE_SNORM16_CLAMP: //Int16
+ rrVertexAttrib.readSnormClamp(dst, size, ptr, Int16Array);
+ break;
+ case rrVertexAttrib.VertexAttribType.NONPURE_SNORM32_CLAMP: //Int32
+ rrVertexAttrib.readSnormClamp(dst, size, ptr, Int32Array);
+ break;
+ case rrVertexAttrib.VertexAttribType.NONPURE_SNORM_2_10_10_10_REV_CLAMP:
+ rrVertexAttrib.readSnorm2101010RevClampOrder(dst, size, ptr, rrVertexAttrib.NormalOrder);
+ break;
+ /*case rrVertexAttrib.VertexAttribType.NONPURE_SNORM8_SCALE: //Int8
+ rrVertexAttrib.readSnormScale(dst, size, ptr, Int8Array);
+ break;
+ case rrVertexAttrib.VertexAttribType.NONPURE_SNORM16_SCALE: //Int16
+ rrVertexAttrib.readSnormScale(dst, size, ptr, Int16Array);
+ break;
+ case rrVertexAttrib.VertexAttribType.NONPURE_SNORM32_SCALE: //Int32
+ rrVertexAttrib.readSnormScale(dst, size, ptr, Int32Array);
+ break;*/
+ case rrVertexAttrib.VertexAttribType.NONPURE_SNORM_2_10_10_10_REV_SCALE:
+ rrVertexAttrib.readSnorm2101010RevScaleOrder(dst, size, ptr, rrVertexAttrib.NormalOrder);
+ break;
+ case rrVertexAttrib.VertexAttribType.NONPURE_UINT_2_10_10_10_REV:
+ rrVertexAttrib.readUint2101010Rev(dst, size, ptr);
+ break;
+ case rrVertexAttrib.VertexAttribType.NONPURE_INT_2_10_10_10_REV:
+ rrVertexAttrib.readInt2101010Rev(dst, size, ptr);
+ break;
+ case rrVertexAttrib.VertexAttribType.NONPURE_UNORM8_BGRA:
+ rrVertexAttrib.readUnormOrder(dst, size, ptr, rrVertexAttrib.BGRAOrder, Uint8Array);
+ break;
+ case rrVertexAttrib.VertexAttribType.NONPURE_UNORM_2_10_10_10_REV_BGRA:
+ rrVertexAttrib.readUnorm2101010RevOrder(dst, size, ptr, rrVertexAttrib.BGRAOrder);
+ break;
+ case rrVertexAttrib.VertexAttribType.NONPURE_SNORM_2_10_10_10_REV_CLAMP_BGRA:
+ rrVertexAttrib.readSnorm2101010RevClampOrder(dst, size, ptr, rrVertexAttrib.BGRAOrder);
+ break;
+ case rrVertexAttrib.VertexAttribType.NONPURE_SNORM_2_10_10_10_REV_SCALE_BGRA:
+ rrVertexAttrib.readSnorm2101010RevScaleOrder(dst, size, ptr, rrVertexAttrib.BGRAOrder);
+ break;
+ case rrVertexAttrib.VertexAttribType.NONPURE_UINT8:
+ rrVertexAttrib.readOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Uint8Array);
+ break;
+ case rrVertexAttrib.VertexAttribType.NONPURE_UINT16:
+ rrVertexAttrib.readOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Uint16Array);
+ break;
+ case rrVertexAttrib.VertexAttribType.NONPURE_UINT32:
+ rrVertexAttrib.readOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Uint32Array);
+ break;
+ case rrVertexAttrib.VertexAttribType.NONPURE_INT8:
+ rrVertexAttrib.readOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Int8Array);
+ break;
+ case rrVertexAttrib.VertexAttribType.NONPURE_INT16:
+ rrVertexAttrib.readOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Int16Array);
+ break;
+ case rrVertexAttrib.VertexAttribType.NONPURE_INT32:
+ rrVertexAttrib.readOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Int32Array);
+ break;
+ case rrVertexAttrib.VertexAttribType.PURE_UINT8:
+ rrVertexAttrib.readOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Uint8Array);
+ break;
+ case rrVertexAttrib.VertexAttribType.PURE_UINT16:
+ rrVertexAttrib.readOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Uint16Array);
+ break;
+ case rrVertexAttrib.VertexAttribType.PURE_UINT32:
+ rrVertexAttrib.readOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Uint32Array);
+ break;
+ case rrVertexAttrib.VertexAttribType.PURE_INT8:
+ rrVertexAttrib.readOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Int8Array);
+ break;
+ case rrVertexAttrib.VertexAttribType.PURE_INT16:
+ rrVertexAttrib.readOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Int16Array);
+ break;
+ case rrVertexAttrib.VertexAttribType.PURE_INT32:
+ rrVertexAttrib.readOrder(dst, size, ptr, rrVertexAttrib.NormalOrder, Int32Array);
+ break;
+
+ default:
+ throw new Error('rrVertexAttrib.read - Invalid type');
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrVertexPacket.js b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrVertexPacket.js
new file mode 100644
index 0000000000..ec00e17d19
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/framework/referencerenderer/rrVertexPacket.js
@@ -0,0 +1,101 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('framework.referencerenderer.rrVertexPacket');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.delibs.debase.deMath');
+
+goog.scope(function() {
+
+var rrVertexPacket = framework.referencerenderer.rrVertexPacket;
+var tcuTexture = framework.common.tcuTexture;
+var deMath = framework.delibs.debase.deMath;
+
+ /**
+ * rrVertexPacket.VertexPacket class. (Should only be created by rrVertexPacket.VertexPacketAllocator)
+ * @constructor
+ */
+ rrVertexPacket.VertexPacket = function() {
+ /** @type {number} */ this.instanceNdx;
+ /** @type {number} */ this.vertexNdx;
+ /** @type {goog.NumberArray} */ this.position; //!< Transformed position - must be written always.
+ /** @type {number} */ this.pointSize; //!< Point size, required when rendering points.
+ // /** @type {number} */ this.primitiveID; //!< Geometry shader output (Not used in webGL)
+ /** @type {Array<goog.NumberArray>} */ this.outputs = [[0, 0, 0, 0]];
+ };
+
+ /**
+ * rrVertexPacket.VertexPacketAllocator class
+ * @constructor
+ * @param {number} numberOfVertexOutputs
+ */
+ rrVertexPacket.VertexPacketAllocator = function(numberOfVertexOutputs) {
+ /** @type {number} */ this.m_numberOfVertexOutputs = numberOfVertexOutputs;
+ /** @type {Uint8Array} */ this.m_allocations;
+ /** @type {Array<rrVertexPacket.VertexPacket>} */ this.m_singleAllocPool = [];
+ };
+
+ /**
+ * @return {number}
+ */
+ rrVertexPacket.VertexPacketAllocator.prototype.getNumVertexOutputs = function() {
+ return this.m_numberOfVertexOutputs;
+ };
+
+ /**
+ * allocArray
+ * @param {number} count
+ * @return {Array<rrVertexPacket.VertexPacket>}
+ */
+ rrVertexPacket.VertexPacketAllocator.prototype.allocArray = function(count) {
+ if (!count)
+ return [];
+
+ /** @type {number} */ var extraVaryings = (this.m_numberOfVertexOutputs == 0) ? (0) : (this.m_numberOfVertexOutputs - 1);
+ // /** @type {number} TODO: Check what this size is used for */ var packetSize = sizeof(rrVertexPacket.VertexPacket) + extraVaryings * sizeof(GenericVec4);
+
+ /** @type {Array<rrVertexPacket.VertexPacket>} */ var retVal = [];
+ // /** @type {Uint8Array} TODO: same as above */ var ptr = new deInt8[packetSize * count]; // throws bad_alloc => ok
+
+ //run ctors
+ for (var i = 0; i < count; ++i)
+ retVal.push(new rrVertexPacket.VertexPacket());
+
+ /** TODO: same as previous - this.m_allocations.push_back(ptr); */
+
+ return retVal;
+ };
+
+ /**
+ * @return {rrVertexPacket.VertexPacket}
+ */
+ rrVertexPacket.VertexPacketAllocator.prototype.alloc = function() {
+ /** @type {number} */ var poolSize = 8;
+
+ if (this.m_singleAllocPool.length == 0)
+ this.m_singleAllocPool = this.allocArray(poolSize);
+
+ /** @type {rrVertexPacket.VertexPacket} */ var packet = this.m_singleAllocPool.pop();
+
+ return packet;
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/00_test_list.txt
new file mode 100644
index 0000000000..5a6d768f62
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/00_test_list.txt
@@ -0,0 +1,80 @@
+# The builtinprecision tests are not correct. Errors were introduced when
+# porting the tests from C++ to JavaScript. Tests that fail here pass in
+# the C++ version of dEQP ported to WASM. The tests are disabled here until
+# they can be fixed.
+# --min-version 2.0.1 builtinprecision/00_test_list.txt
+draw/00_test_list.txt
+fbocolorbuffer/00_test_list.txt
+fboinvalidate/00_test_list.txt
+fborender/00_test_list.txt
+fragmentoutput/00_test_list.txt
+framebufferblit/00_test_list.txt
+multisample/00_test_list.txt
+primitiverestart/00_test_list.txt
+shaderindexing/00_test_list.txt
+shadermatrix/00_test_list.txt
+shaderoperator/00_test_list.txt
+shadertexturefunction/00_test_list.txt
+texturefiltering/00_test_list.txt
+textureformat/00_test_list.txt
+textureshadow/00_test_list.txt
+texturespecification/00_test_list.txt
+texturewrap/00_test_list.txt
+transformfeedback/00_test_list.txt
+uniformapi/00_test_list.txt
+uniformbuffers/00_test_list.txt
+vertexarrays/00_test_list.txt
+attriblocation.html
+booleanstatequery.html
+buffercopy.html
+bufferobjectquery.html
+clipping.html
+defaultvertexattribute.html
+fbocompleteness.html
+fbodepthbuffer.html
+fbomultisample.2_samples.html
+fbomultisample.4_samples.html
+fbomultisample.8_samples.html
+fbostatequery.html
+fbostencilbuffer.html
+floatstatequery.html
+fragdepth.html
+indexedstatequery.html
+instancedrendering.html
+integerstatequery.html
+internalformatquery.html
+lifetime.html
+negativebufferapi.html
+negativefragmentapi.html
+negativeshaderapi.html
+negativestateapi.html
+negativetextureapi.html
+negativevertexarrayapi.html
+occlusionquery_strict.html
+occlusionquery_conservative.html
+pixelbufferobject.html
+rasterizerdiscard.html
+rbostatequery.html
+readpixel.html
+samplerobject.html
+samplerstatequery.html
+shaderapi.html
+shaderbuiltinvar.html
+shadercommonfunction.html
+shaderderivate_dfdx.html
+shaderderivate_dfdy.html
+shaderderivate_fwidth.html
+shaderloop_for.html
+shaderloop_while.html
+shaderloop_do_while.html
+shaderpackingfunction.html
+shaderprecision_float.html
+shaderprecision_int.html
+shaderprecision_uint.html
+shaderstatequery.html
+shaderstruct.html
+shaderswitch.html
+stringquery.html
+sync.html
+texturestatequery.html
+vertexarrayobject.html
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/attriblocation.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/attriblocation.html
new file mode 100644
index 0000000000..5eb12e7782
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/attriblocation.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Attribute Location Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fAttribLocationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fAttribLocationTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/booleanstatequery.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/booleanstatequery.html
new file mode 100644
index 0000000000..0423dd44f8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/booleanstatequery.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Boolean State Query Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBooleanStateQuery');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {stencil: true}, 2);
+
+functional.gles3.es3fBooleanStateQuery.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/buffercopy.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/buffercopy.html
new file mode 100644
index 0000000000..04c1d11bfa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/buffercopy.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Buffer Copy Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBufferCopyTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBufferCopyTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/bufferobjectquery.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/bufferobjectquery.html
new file mode 100644
index 0000000000..b0fa2f358c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/bufferobjectquery.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Buffer Object Query Tests Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBufferObjectQueryTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBufferObjectQueryTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/00_test_list.txt
new file mode 100644
index 0000000000..6ac29a3862
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/00_test_list.txt
@@ -0,0 +1,55 @@
+add.html
+sub.html
+mul.html
+div.html
+radians.html
+degrees.html
+sin.html
+cos.html
+tan.html
+asin.html
+acos.html
+atan.html
+atan2.html
+sinh.html
+cosh.html
+tanh.html
+asinh.html
+acosh.html
+atanh.html
+pow.html
+exp.html
+exp2.html
+log.html
+log2.html
+sqrt.html
+inversesqrt.html
+abs.html
+sign.html
+floor.html
+trunc.html
+round.html
+roundeven.html
+ceil.html
+fract.html
+mod.html
+modf.html
+min.html
+max.html
+mix.html
+step.html
+smoothstep.html
+clamp.html
+length.html
+distance.html
+dot.html
+cross.html
+normalize.html
+faceforward.html
+reflect.html
+refract.html
+matrixcompmult.html
+outerproduct.html
+transpose.html
+determinant.html
+inverse.html \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/abs.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/abs.html
new file mode 100644
index 0000000000..1c395e94de
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/abs.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 26);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/acos.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/acos.html
new file mode 100644
index 0000000000..3c27d4a350
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/acos.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 10);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/acosh.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/acosh.html
new file mode 100644
index 0000000000..6931a60260
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/acosh.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 17);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/add.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/add.html
new file mode 100644
index 0000000000..5817299349
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/add.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 0);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/asin.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/asin.html
new file mode 100644
index 0000000000..7b8bd1a838
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/asin.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 9);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/asinh.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/asinh.html
new file mode 100644
index 0000000000..ee84df94a8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/asinh.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 16);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/atan.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/atan.html
new file mode 100644
index 0000000000..00f50c03cb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/atan.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 11);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/atan2.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/atan2.html
new file mode 100644
index 0000000000..196de0060f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/atan2.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 12);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/atanh.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/atanh.html
new file mode 100644
index 0000000000..d117666e8e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/atanh.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 18);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/builtinprecision_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/builtinprecision_test_generator.py
new file mode 100644
index 0000000000..ba44b2fc48
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/builtinprecision_test_generator.py
@@ -0,0 +1,143 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2019 The Khronos Group Inc.
+# Use of this source code is governed by an MIT-style license that can be
+# found in the LICENSE.txt file.
+
+"""
+ Generator for builtinprecision* tests.
+ This file needs to be run in its folder.
+"""
+
+import sys
+
+_DO_NOT_EDIT_WARNING = """<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+"""
+
+_HTML_TEMPLATE = """<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, %(index)s);
+</script>
+</body>
+</html>
+"""
+
+_GROUPS = [
+ 'add',
+ 'sub',
+ 'mul',
+ 'div',
+ 'radians',
+ 'degrees',
+ 'sin',
+ 'cos',
+ 'tan',
+ 'asin',
+ 'acos',
+ 'atan',
+ 'atan2',
+ 'sinh',
+ 'cosh',
+ 'tanh',
+ 'asinh',
+ 'acosh',
+ 'atanh',
+ 'pow',
+ 'exp',
+ 'exp2',
+ 'log',
+ 'log2',
+ 'sqrt',
+ 'inversesqrt',
+ 'abs',
+ 'sign',
+ 'floor',
+ 'trunc',
+ 'round',
+ 'roundeven',
+ 'ceil',
+ 'fract',
+ 'mod',
+ 'modf',
+ 'min',
+ 'max',
+ 'mix',
+ 'step',
+ 'smoothstep',
+ 'clamp',
+ 'length',
+ 'distance',
+ 'dot',
+ 'cross',
+ 'normalize',
+ 'faceforward',
+ 'reflect',
+ 'refract',
+ 'matrixcompmult',
+ 'outerproduct',
+ 'transpose',
+ 'determinant',
+ 'inverse'
+]
+
+def GenerateFilename(group):
+ """Generate test filename."""
+ filename = group
+ filename += ".html"
+ return filename
+
+def WriteTest(filename, index):
+ """Write one test."""
+ file = open(filename, "wb")
+ file.write(_DO_NOT_EDIT_WARNING)
+ file.write(_HTML_TEMPLATE % {
+ 'index': index
+ })
+ file.close
+
+def GenerateTests():
+ """Generate all tests."""
+ filelist = []
+ for ii in range(len(_GROUPS)):
+ filename = GenerateFilename(_GROUPS[ii])
+ filelist.append(filename)
+ WriteTest(filename, ii)
+ return filelist
+
+def GenerateTestList(filelist):
+ file = open("00_test_list.txt", "wb")
+ file.write('\n'.join(filelist))
+ file.close
+
+def main(argv):
+ """This is the main function."""
+ filelist = GenerateTests()
+ GenerateTestList(filelist)
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/ceil.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/ceil.html
new file mode 100644
index 0000000000..e0d5924407
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/ceil.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 32);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/clamp.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/clamp.html
new file mode 100644
index 0000000000..1a820652a1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/clamp.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 41);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/cos.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/cos.html
new file mode 100644
index 0000000000..281419e897
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/cos.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 7);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/cosh.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/cosh.html
new file mode 100644
index 0000000000..ec9c26b637
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/cosh.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 14);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/cross.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/cross.html
new file mode 100644
index 0000000000..1cb96eada4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/cross.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 45);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/degrees.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/degrees.html
new file mode 100644
index 0000000000..a9ed0f80e6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/degrees.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 5);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/determinant.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/determinant.html
new file mode 100644
index 0000000000..56ad04eb41
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/determinant.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 53);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/distance.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/distance.html
new file mode 100644
index 0000000000..1f9cfebaf6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/distance.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 43);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/div.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/div.html
new file mode 100644
index 0000000000..bc2c5ce723
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/div.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 3);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/dot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/dot.html
new file mode 100644
index 0000000000..e06fd395da
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/dot.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 44);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/exp.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/exp.html
new file mode 100644
index 0000000000..11cb6a826f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/exp.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 20);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/exp2.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/exp2.html
new file mode 100644
index 0000000000..3f8755cd24
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/exp2.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 21);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/faceforward.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/faceforward.html
new file mode 100644
index 0000000000..ecabe9cdf9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/faceforward.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 47);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/floor.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/floor.html
new file mode 100644
index 0000000000..1c060f13bb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/floor.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 28);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/fract.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/fract.html
new file mode 100644
index 0000000000..de778f3ab6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/fract.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 33);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/inverse.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/inverse.html
new file mode 100644
index 0000000000..c0b2e5876b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/inverse.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 54);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/inversesqrt.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/inversesqrt.html
new file mode 100644
index 0000000000..f34ec5569c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/inversesqrt.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 25);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/length.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/length.html
new file mode 100644
index 0000000000..949f716c79
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/length.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 42);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/log.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/log.html
new file mode 100644
index 0000000000..0528ceef25
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/log.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 22);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/log2.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/log2.html
new file mode 100644
index 0000000000..6defd59a32
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/log2.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 23);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/matrixcompmult.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/matrixcompmult.html
new file mode 100644
index 0000000000..28c81e75f6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/matrixcompmult.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 50);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/max.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/max.html
new file mode 100644
index 0000000000..95420abe1d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/max.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 37);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/min.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/min.html
new file mode 100644
index 0000000000..0230351426
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/min.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 36);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/mix.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/mix.html
new file mode 100644
index 0000000000..183704370e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/mix.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 38);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/mod.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/mod.html
new file mode 100644
index 0000000000..cbe10773d1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/mod.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 34);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/modf.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/modf.html
new file mode 100644
index 0000000000..a6e3df51a0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/modf.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 35);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/mul.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/mul.html
new file mode 100644
index 0000000000..0473fd8c06
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/mul.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 2);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/normalize.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/normalize.html
new file mode 100644
index 0000000000..82787d7a30
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/normalize.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 46);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/outerproduct.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/outerproduct.html
new file mode 100644
index 0000000000..83e2b6d810
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/outerproduct.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 51);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/pow.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/pow.html
new file mode 100644
index 0000000000..7793d740d5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/pow.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 19);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/radians.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/radians.html
new file mode 100644
index 0000000000..d808acba17
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/radians.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 4);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/reflect.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/reflect.html
new file mode 100644
index 0000000000..87ba13d5e1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/reflect.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 48);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/refract.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/refract.html
new file mode 100644
index 0000000000..68d967d557
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/refract.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 49);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/round.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/round.html
new file mode 100644
index 0000000000..0186d6795c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/round.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 30);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/roundeven.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/roundeven.html
new file mode 100644
index 0000000000..6e1f91eda7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/roundeven.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 31);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sign.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sign.html
new file mode 100644
index 0000000000..6c4cf28ac4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sign.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 27);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sin.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sin.html
new file mode 100644
index 0000000000..ee95d80af4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sin.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 6);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sinh.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sinh.html
new file mode 100644
index 0000000000..e805a703a1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sinh.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 13);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/smoothstep.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/smoothstep.html
new file mode 100644
index 0000000000..4dd4d7c9b2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/smoothstep.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 40);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sqrt.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sqrt.html
new file mode 100644
index 0000000000..707519237b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sqrt.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 24);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/step.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/step.html
new file mode 100644
index 0000000000..7dd143bb49
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/step.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 39);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sub.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sub.html
new file mode 100644
index 0000000000..8e22e94db0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/sub.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 1);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/tan.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/tan.html
new file mode 100644
index 0000000000..a442f83bfc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/tan.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 8);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/tanh.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/tanh.html
new file mode 100644
index 0000000000..04013ed6d6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/tanh.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 15);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/transpose.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/transpose.html
new file mode 100644
index 0000000000..48d55febf8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/transpose.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 52);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/trunc.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/trunc.html
new file mode 100644
index 0000000000..209656d9ac
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/trunc.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from builtinprecision_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Builtin Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fBuiltinPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fBuiltinPrecisionTests.run(gl, 29);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/clipping.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/clipping.html
new file mode 100644
index 0000000000..ab2b2bd77f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/clipping.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Clipping tests Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fClippingTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="128" height="128"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fClippingTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/defaultvertexattribute.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/defaultvertexattribute.html
new file mode 100644
index 0000000000..8bca99ad70
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/defaultvertexattribute.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Default Vertex Attributes Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fDefaultVertexAttributeTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fDefaultVertexAttributeTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/00_test_list.txt
new file mode 100644
index 0000000000..ba28d1bb85
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/00_test_list.txt
@@ -0,0 +1,7 @@
+draw_arrays.html
+draw_elements.html
+draw_arrays_instanced.html
+draw_elements_instanced.html
+draw_range_elements.html
+instancing.html
+random.html \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_arrays.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_arrays.html
new file mode 100644
index 0000000000..ae9655df14
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_arrays.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from draw_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Draw Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fDrawTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fDrawTests.run(gl, [0, 1]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_arrays_instanced.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_arrays_instanced.html
new file mode 100644
index 0000000000..f8219ee073
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_arrays_instanced.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from draw_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Draw Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fDrawTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fDrawTests.run(gl, [2, 3]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_elements.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_elements.html
new file mode 100644
index 0000000000..1fb1a5c160
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_elements.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from draw_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Draw Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fDrawTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fDrawTests.run(gl, [1, 2]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_elements_instanced.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_elements_instanced.html
new file mode 100644
index 0000000000..e4c4b3b980
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_elements_instanced.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from draw_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Draw Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fDrawTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fDrawTests.run(gl, [3, 4]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_range_elements.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_range_elements.html
new file mode 100644
index 0000000000..df2f7a92bb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_range_elements.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from draw_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Draw Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fDrawTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fDrawTests.run(gl, [4, 5]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_test_generator.py
new file mode 100644
index 0000000000..d96c767b4d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_test_generator.py
@@ -0,0 +1,89 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2019 The Khronos Group Inc.
+# Use of this source code is governed by an MIT-style license that can be
+# found in the LICENSE.txt file.
+
+"""
+ Generator for draw* tests.
+ This file needs to be run in its folder.
+"""
+
+import sys
+
+_DO_NOT_EDIT_WARNING = """<!--
+
+This file is auto-generated from draw_test_generator.py
+DO NOT EDIT!
+
+-->
+
+"""
+
+_HTML_TEMPLATE = """<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Draw Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fDrawTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fDrawTests.run(gl, [%(start)s, %(end)s]);
+</script>
+</body>
+</html>
+"""
+
+_GROUPS = [
+ 'draw_arrays',
+ 'draw_elements',
+ 'draw_arrays_instanced',
+ 'draw_elements_instanced',
+ 'draw_range_elements',
+ 'instancing',
+ 'random',
+]
+
+def WriteTest(filename, start, end):
+ """Write one test."""
+ file = open(filename, "wb")
+ file.write(_DO_NOT_EDIT_WARNING)
+ file.write(_HTML_TEMPLATE % {
+ 'start': start,
+ 'end': end
+ })
+ file.close
+
+def GenerateTests():
+ """Generate all tests."""
+ filelist = []
+ for ii in range(len(_GROUPS)):
+ filename = _GROUPS[ii] + '.html'
+ filelist.append(filename)
+ WriteTest(filename, ii, ii + 1)
+ return filelist
+
+def GenerateTestList(filelist):
+ file = open("00_test_list.txt", "wb")
+ file.write('\n'.join(filelist))
+ file.close
+
+def main(argv):
+ """This is the main function."""
+ filelist = GenerateTests()
+ GenerateTestList(filelist)
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/instancing.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/instancing.html
new file mode 100644
index 0000000000..df8d7910be
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/instancing.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from draw_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Draw Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fDrawTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fDrawTests.run(gl, [5, 6]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/random.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/random.html
new file mode 100644
index 0000000000..1c6f02f9c2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/random.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from draw_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Draw Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fDrawTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fDrawTests.run(gl, [6, 7]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fApiCase.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fApiCase.js
new file mode 100644
index 0000000000..3238e6c2ef
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fApiCase.js
@@ -0,0 +1,161 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+'use strict';
+goog.provide('functional.gles3.es3fApiCase');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.opengl.gluStrUtil');
+
+goog.scope(function() {
+
+ var es3fApiCase = functional.gles3.es3fApiCase;
+ var gluStrUtil = framework.opengl.gluStrUtil;
+ var tcuTestCase = framework.common.tcuTestCase;
+
+ // format numbers as they appear in gl.h
+ var getHexStr = function(num) {
+ var numstr = num.toString(16);
+ var prefix = '0x';
+ for (
+ var padding = (num < 0x10000 ? 4 : 8) - numstr.length;
+ padding-- > 0;
+ ) prefix += '0';
+ return prefix + numstr;
+ };
+
+ /**
+ * Base class for all the API tests.
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} desc
+ */
+ es3fApiCase.ApiCase = function(name, desc, gl) {
+ gl = gl || window.gl;
+ if (this.test === undefined) {
+ throw new Error('Unimplemented virtual function: es3fApiCase.ApiCase.test');
+ }
+ tcuTestCase.DeqpTest.call(this, name, desc);
+
+ this.m_gl = gl;
+ this.m_pass = true;
+ this.m_comment = '';
+
+ };
+
+ es3fApiCase.ApiCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fApiCase.ApiCase.prototype.constructor = es3fApiCase.ApiCase;
+
+ /**
+ * @param {boolean} condition
+ * @param {string=} message
+ */
+ es3fApiCase.ApiCase.prototype.check = function(condition, message) {
+ if (this.m_pass && !condition) {
+ bufferedLogToConsole('Condition is false. Test failed.');
+ if (message)
+ this.m_comment += ' ' + message;
+ this.m_pass = condition;
+ }
+ return condition;
+ };
+
+ es3fApiCase.ApiCase.prototype.iterate = function() {
+
+ this.test();
+
+ if (this.m_pass)
+ testPassed(this.m_comment);
+ else
+ testFailedOptions(this.m_comment, true);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @param {Array<number>|number} expected
+ * @return {boolean} returns true if gl.getError returns an expected error code and false otherwise.
+ */
+ es3fApiCase.ApiCase.prototype.expectError = function(expected) {
+ if (expected.constructor === Number)
+ expected = [expected];
+
+ var err = this.m_gl.getError();
+ var conformant = expected.indexOf(err) >= 0;
+
+ if (!conformant) {
+
+ var l = expected.length;
+ var msg = 'Expected ';
+
+ if (l > 1)
+ msg += (l == 2 ? 'either ' : 'one of ');
+
+ for (var i = 0; i < l; ++i) msg += (
+ (gluStrUtil.getErrorName(expected[i]) || getHexStr(expected[i])) +
+ (l - i == 2 ? ' or ' : ', ')
+ );
+
+ msg += 'but got ' + (gluStrUtil.getErrorName(err) || getHexStr(err)) + '.';
+
+ this.testFailed(msg);
+
+ }
+
+ return conformant;
+ };
+
+ es3fApiCase.ApiCase.prototype.testFailed = function(comment) {
+ bufferedLogToConsole(comment);
+ if (this.m_pass) {
+ this.m_comment = comment;
+ this.m_pass = false;
+ }
+ };
+
+ es3fApiCase.ApiCase.prototype.expectThrowNoError = function(f) {
+ try {
+ f();
+ this.testFailed("should have thrown exception");
+ } catch (e) {
+ this.expectError(this.m_gl.NO_ERROR);
+ }
+ }
+
+ /**
+ * Base class for all the API tests.
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {function(this:es3fApiCase.ApiCaseCallback)} callback
+ */
+ es3fApiCase.ApiCaseCallback = function(name, desc, gl, callback) {
+ this.test = callback;
+ es3fApiCase.ApiCase.call(this, name, desc, gl);
+ };
+ es3fApiCase.ApiCaseCallback.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fApiCase.ApiCaseCallback.prototype.constructor = es3fApiCase.ApiCaseCallback;
+
+/*
+ es3fApiCase.ApiCase.prototype.expectError // (error) or (error0, error1)
+ es3fApiCase.ApiCase.prototype.getSupportedExtensions // (number numSupportedValues, number extension, [number] values )
+ es3fApiCase.ApiCase.prototype.checkBooleans // (char value, char expected);
+//*/
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fAttribLocationTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fAttribLocationTests.js
new file mode 100644
index 0000000000..93f91eca1d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fAttribLocationTests.js
@@ -0,0 +1,267 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES 3.0 Module
+ * -------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief Attribute location test
+ *//*--------------------------------------------------------------------*/
+'use strict';
+goog.provide('functional.gles3.es3fAttribLocationTests');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('modules.shared.glsAttributeLocationTests');
+
+goog.scope(function() {
+
+ var es3fAttribLocationTests = functional.gles3.es3fAttribLocationTests;
+ var glsAttributeLocationTests = modules.shared.glsAttributeLocationTests;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+
+ es3fAttribLocationTests.createAttributeLocationTests = function() {
+
+ /** @type {Array<glsAttributeLocationTests.AttribType>} */
+ var types = [
+ new glsAttributeLocationTests.AttribType('float', 1, gl.FLOAT),
+ new glsAttributeLocationTests.AttribType('vec2', 1, gl.FLOAT_VEC2),
+ new glsAttributeLocationTests.AttribType('vec3', 1, gl.FLOAT_VEC3),
+ new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4),
+
+ new glsAttributeLocationTests.AttribType('mat2', 2, gl.FLOAT_MAT2),
+ new glsAttributeLocationTests.AttribType('mat3', 3, gl.FLOAT_MAT3),
+ new glsAttributeLocationTests.AttribType('mat4', 4, gl.FLOAT_MAT4),
+
+ new glsAttributeLocationTests.AttribType('int', 1, gl.INT),
+ new glsAttributeLocationTests.AttribType('ivec2', 1, gl.INT_VEC2),
+ new glsAttributeLocationTests.AttribType('ivec3', 1, gl.INT_VEC3),
+ new glsAttributeLocationTests.AttribType('ivec4', 1, gl.INT_VEC4),
+
+ new glsAttributeLocationTests.AttribType('uint', 1, gl.UNSIGNED_INT),
+ new glsAttributeLocationTests.AttribType('uvec2', 1, gl.UNSIGNED_INT_VEC2),
+ new glsAttributeLocationTests.AttribType('uvec3', 1, gl.UNSIGNED_INT_VEC3),
+ new glsAttributeLocationTests.AttribType('uvec4', 1, gl.UNSIGNED_INT_VEC4),
+
+ new glsAttributeLocationTests.AttribType('mat2x2', 2, gl.FLOAT_MAT2),
+ new glsAttributeLocationTests.AttribType('mat2x3', 2, gl.FLOAT_MAT2x3),
+ new glsAttributeLocationTests.AttribType('mat2x4', 2, gl.FLOAT_MAT2x4),
+
+ new glsAttributeLocationTests.AttribType('mat3x2', 3, gl.FLOAT_MAT3x2),
+ new glsAttributeLocationTests.AttribType('mat3x3', 3, gl.FLOAT_MAT3),
+ new glsAttributeLocationTests.AttribType('mat3x4', 3, gl.FLOAT_MAT3x4),
+
+ new glsAttributeLocationTests.AttribType('mat4x2', 4, gl.FLOAT_MAT4x2),
+ new glsAttributeLocationTests.AttribType('mat4x3', 4, gl.FLOAT_MAT4x3),
+ new glsAttributeLocationTests.AttribType('mat4x4', 4, gl.FLOAT_MAT4)
+ ];
+
+ /** @type {Array<glsAttributeLocationTests.AttribType>} */
+ var es2Types = [
+ new glsAttributeLocationTests.AttribType('float', 1, gl.FLOAT),
+ new glsAttributeLocationTests.AttribType('vec2', 1, gl.FLOAT_VEC2),
+ new glsAttributeLocationTests.AttribType('vec3', 1, gl.FLOAT_VEC3),
+ new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4),
+
+ new glsAttributeLocationTests.AttribType('mat2', 2, gl.FLOAT_MAT2),
+ new glsAttributeLocationTests.AttribType('mat3', 3, gl.FLOAT_MAT3),
+ new glsAttributeLocationTests.AttribType('mat4', 4, gl.FLOAT_MAT4)
+ ];
+
+ /** @type {tcuTestCase.DeqpTest} */
+ var root = tcuTestCase.newTest('attribute_location', 'Attribute location tests');
+
+ /** @type {number} */ var typeNdx;
+ /** @type {glsAttributeLocationTests.AttribType} */ var type;
+
+ // Basic bind attribute tests
+ /** @type {tcuTestCase.DeqpTest} */
+ var bindAttributeGroup = tcuTestCase.newTest('bind', 'Basic bind attribute location tests.');
+
+ root.addChild(bindAttributeGroup);
+
+ for (typeNdx = 0; typeNdx < types.length; typeNdx++) {
+ type = types[typeNdx];
+ bindAttributeGroup.addChild(new glsAttributeLocationTests.BindAttributeTest(type));
+ }
+
+ // Bind max number of attributes
+ /** @type {tcuTestCase.DeqpTest} */
+ var bindMaxAttributeGroup = tcuTestCase.newTest('bind_max_attributes', 'Use bind with maximum number of attributes.');
+
+ root.addChild(bindMaxAttributeGroup);
+
+ for (typeNdx = 0; typeNdx < types.length; typeNdx++) {
+ type = types[typeNdx];
+ bindMaxAttributeGroup.addChild(new glsAttributeLocationTests.BindMaxAttributesTest(type));
+ }
+
+ // Test filling holes in attribute location
+ /** @type {tcuTestCase.DeqpTest} */
+ var holeGroup = tcuTestCase.newTest('bind_hole', 'Bind all, but one attribute and leave hole in location space for it.');
+
+ root.addChild(holeGroup);
+
+ for (typeNdx = 0; typeNdx < types.length; typeNdx++) {
+ type = types[typeNdx];
+
+ // Bind first location, leave hole size of type and fill rest of locations
+ holeGroup.addChild(new glsAttributeLocationTests.BindHoleAttributeTest(type));
+ }
+
+ // Test binding at different times
+ /** @type {tcuTestCase.DeqpTest} */
+ var bindTimeGroup = tcuTestCase.newTest('bind_time', 'Bind time tests. Test binding at different stages.');
+
+ root.addChild(bindTimeGroup);
+
+ bindTimeGroup.addChild(new glsAttributeLocationTests.PreAttachBindAttributeTest());
+ bindTimeGroup.addChild(new glsAttributeLocationTests.PreLinkBindAttributeTest());
+ bindTimeGroup.addChild(new glsAttributeLocationTests.PostLinkBindAttributeTest());
+ bindTimeGroup.addChild(new glsAttributeLocationTests.BindRelinkAttributeTest());
+ bindTimeGroup.addChild(new glsAttributeLocationTests.BindReattachAttributeTest());
+
+ // Basic layout location attribute tests
+ /** @type {tcuTestCase.DeqpTest} */
+ var layoutAttributeGroup = tcuTestCase.newTest('layout', 'Basic layout location tests.');
+
+ root.addChild(layoutAttributeGroup);
+
+ for (typeNdx = 0; typeNdx < types.length; typeNdx++) {
+ type = types[typeNdx];
+ layoutAttributeGroup.addChild(new glsAttributeLocationTests.LocationAttributeTest(type));
+ }
+
+ // Test max attributes with layout locations
+ /** @type {tcuTestCase.DeqpTest} */
+ var layoutMaxAttributeGroup = tcuTestCase.newTest('layout_max_attributes', 'Maximum attributes used with layout location qualifiers.');
+
+ root.addChild(layoutMaxAttributeGroup);
+
+ for (typeNdx = 0; typeNdx < types.length; typeNdx++) {
+ type = types[typeNdx];
+ layoutMaxAttributeGroup.addChild(new glsAttributeLocationTests.LocationMaxAttributesTest(type));
+ }
+
+ // Test filling holes in attribute location
+ holeGroup = tcuTestCase.newTest('layout_hole', 'Define layout location for all, but one attribute consuming max attribute locations.');
+
+ root.addChild(holeGroup);
+
+ for (typeNdx = 0; typeNdx < types.length; typeNdx++) {
+ type = types[typeNdx];
+
+ // Location first location, leave hole size of type and fill rest of locations
+ holeGroup.addChild(new glsAttributeLocationTests.LocationHoleAttributeTest(type));
+ }
+
+ // Basic mixed mixed attribute tests
+ /** @type {tcuTestCase.DeqpTest} */
+ var mixedAttributeGroup = tcuTestCase.newTest('mixed', 'Basic mixed location tests.');
+
+ root.addChild(mixedAttributeGroup);
+
+ for (typeNdx = 0; typeNdx < types.length; typeNdx++) {
+ type = types[typeNdx];
+ mixedAttributeGroup.addChild(new glsAttributeLocationTests.MixedAttributeTest(type));
+ }
+
+ /** @type {tcuTestCase.DeqpTest} */
+ var mixedMaxAttributeGroup = tcuTestCase.newTest('mixed_max_attributes', 'Maximum attributes used with mixed binding and layout qualifiers.');
+
+ root.addChild(mixedMaxAttributeGroup);
+
+ for (typeNdx = 0; typeNdx < types.length; typeNdx++) {
+ type = types[typeNdx];
+ mixedMaxAttributeGroup.addChild(new glsAttributeLocationTests.MixedMaxAttributesTest(type));
+ }
+
+ // Test mixed binding at different times
+ /** @type {tcuTestCase.DeqpTest} */
+ var mixedTimeGroup = tcuTestCase.newTest('mixed_time', 'Bind time tests. Test binding at different stages.');
+
+ root.addChild(mixedTimeGroup);
+
+ mixedTimeGroup.addChild(new glsAttributeLocationTests.PreAttachMixedAttributeTest());
+ mixedTimeGroup.addChild(new glsAttributeLocationTests.PreLinkMixedAttributeTest());
+ mixedTimeGroup.addChild(new glsAttributeLocationTests.PostLinkMixedAttributeTest());
+ mixedTimeGroup.addChild(new glsAttributeLocationTests.MixedRelinkAttributeTest());
+ mixedTimeGroup.addChild(new glsAttributeLocationTests.MixedReattachAttributeTest());
+
+ holeGroup = tcuTestCase.newTest('mixed_hole', 'Use layout location qualifiers and binding. Leave hole in location space for only free attribute.');
+
+ root.addChild(holeGroup);
+
+ for (typeNdx = 0; typeNdx < types.length; typeNdx++) {
+ type = types[typeNdx];
+
+ holeGroup.addChild(new glsAttributeLocationTests.MixedHoleAttributeTest(type));
+ }
+
+ // Test hole in location space that moves when relinking
+ /** @type {tcuTestCase.DeqpTest} */
+ var relinkBindHoleGroup = tcuTestCase.newTest('bind_relink_hole', 'Test relinking with moving hole in attribute location space.');
+
+ root.addChild(relinkBindHoleGroup);
+
+ for (typeNdx = 0; typeNdx < types.length; typeNdx++) {
+ type = types[typeNdx];
+
+ relinkBindHoleGroup.addChild(new glsAttributeLocationTests.BindRelinkHoleAttributeTest(type));
+ }
+
+ // Test hole in location space that moves when relinking
+ /** @type {tcuTestCase.DeqpTest} */
+ var relinkMixedHoleGroup = tcuTestCase.newTest('mixed_relink_hole', 'Test relinking with moving hole in attribute location space.');
+
+ root.addChild(relinkMixedHoleGroup);
+
+ for (typeNdx = 0; typeNdx < types.length; typeNdx++) {
+ type = types[typeNdx];
+
+ relinkMixedHoleGroup.addChild(new glsAttributeLocationTests.MixedRelinkHoleAttributeTest(type));
+ }
+
+ return root;
+ };
+
+ es3fAttribLocationTests.run = function(context) {
+ gl = context;
+ //Set up root Test
+ var state = tcuTestCase.runner;
+
+ var test = es3fAttribLocationTests.createAttributeLocationTests();
+ var testName = test.fullName();
+ var testDescription = test.getDescription() === undefined ? '' : test.getDescription();
+
+ state.testName = testName;
+ state.setRoot(test);
+ //Set up name and description of this test series.
+ setCurrentTestName(testName);
+ description(testDescription);
+
+ try {
+ //Create test cases
+ test.init();
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ bufferedLogToConsole('Exception: ' + err);
+ testFailedOptions('Failed to es3fAttribLocationTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBooleanStateQuery.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBooleanStateQuery.js
new file mode 100644
index 0000000000..173dea0946
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBooleanStateQuery.js
@@ -0,0 +1,372 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fBooleanStateQuery');
+goog.require('framework.common.tcuTestCase');
+goog.require('functional.gles3.es3fApiCase');
+goog.require('modules.shared.glsStateQuery');
+
+goog.scope(function() {
+var es3fBooleanStateQuery = functional.gles3.es3fBooleanStateQuery;
+var tcuTestCase = framework.common.tcuTestCase;
+var glsStateQuery = modules.shared.glsStateQuery;
+var es3fApiCase = functional.gles3.es3fApiCase;
+
+var setParentClass = function(child, parent) {
+ child.prototype = Object.create(parent.prototype);
+ child.prototype.constructor = child;
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} targetName
+ * @param {boolean} value
+ */
+es3fBooleanStateQuery.IsEnabledStateTestCase = function(name, description, targetName, value) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ this.m_targetName = targetName;
+ this.m_initial = value;
+};
+
+setParentClass(es3fBooleanStateQuery.IsEnabledStateTestCase, es3fApiCase.ApiCase);
+
+es3fBooleanStateQuery.IsEnabledStateTestCase.prototype.test = function() {
+ // check inital value
+ this.m_pass &= glsStateQuery.verify(this.m_targetName, this.m_initial);
+
+ // check toggle
+
+ gl.enable(this.m_targetName);
+
+ this.m_pass &= glsStateQuery.verify(this.m_targetName, true);
+
+ gl.disable(this.m_targetName);
+
+ this.m_pass &= glsStateQuery.verify(this.m_targetName, false);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fBooleanStateQuery.DepthWriteMaskTestCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fBooleanStateQuery.DepthWriteMaskTestCase, es3fApiCase.ApiCase);
+
+es3fBooleanStateQuery.DepthWriteMaskTestCase.prototype.test = function() {
+ this.m_pass &= glsStateQuery.verify(gl.DEPTH_WRITEMASK, true);
+
+ gl.depthMask(false);
+ this.m_pass &= glsStateQuery.verify(gl.DEPTH_WRITEMASK, false);
+
+ gl.depthMask(true);
+ this.m_pass &= glsStateQuery.verify(gl.DEPTH_WRITEMASK, true);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fBooleanStateQuery.SampleCoverageInvertTestCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fBooleanStateQuery.SampleCoverageInvertTestCase, es3fApiCase.ApiCase);
+
+es3fBooleanStateQuery.SampleCoverageInvertTestCase.prototype.test = function() {
+ this.m_pass &= glsStateQuery.verify(gl.SAMPLE_COVERAGE_INVERT, false);
+
+ gl.sampleCoverage(1, true);
+ this.m_pass &= glsStateQuery.verify(gl.SAMPLE_COVERAGE_INVERT, true);
+
+ gl.sampleCoverage(1, false);
+ this.m_pass &= glsStateQuery.verify(gl.SAMPLE_COVERAGE_INVERT, false);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} targetName
+ * @param {boolean} value
+ */
+es3fBooleanStateQuery.InitialBooleanTestCase = function(name, description, targetName, value) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ this.m_targetName = targetName;
+ this.m_initial = value;
+};
+
+setParentClass(es3fBooleanStateQuery.InitialBooleanTestCase, es3fApiCase.ApiCase);
+
+es3fBooleanStateQuery.InitialBooleanTestCase.prototype.test = function() {
+ // check inital value
+ this.m_pass &= glsStateQuery.verify(this.m_targetName, this.m_initial);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fBooleanStateQuery.ColorMaskTestCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fBooleanStateQuery.ColorMaskTestCase, es3fApiCase.ApiCase);
+
+es3fBooleanStateQuery.ColorMaskTestCase.prototype.test = function() {
+ this.m_pass &= glsStateQuery.verify(gl.COLOR_WRITEMASK, [true, true, true, true]);
+
+ var testMasks = [
+ [true, true, true, true],
+ [true, true, true, false],
+ [true, true, false, true],
+ [true, true, false, false],
+ [true, false, true, true],
+ [true, false, true, false],
+ [true, false, false, true],
+ [true, false, false, false],
+ [false, true, true, true],
+ [false, true, true, false],
+ [false, true, false, true],
+ [false, true, false, false],
+ [false, false, true, true],
+ [false, false, true, false],
+ [false, false, false, true],
+ [false, false, false, false]
+ ];
+
+ for (var ndx = 0; ndx < testMasks.length; ndx++) {
+ var mask = testMasks[ndx];
+ gl.colorMask(mask[0], mask[1], mask[2], mask[3]);
+ this.m_pass &= glsStateQuery.verify(gl.COLOR_WRITEMASK, mask);
+ }
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fBooleanStateQuery.TransformFeedbackTestCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ /** @type {WebGLTransformFeedback} */ this.m_transformfeedback = null;
+};
+
+setParentClass(es3fBooleanStateQuery.TransformFeedbackTestCase, es3fApiCase.ApiCase);
+
+es3fBooleanStateQuery.TransformFeedbackTestCase.prototype.testTransformFeedback = function() {
+ throw new Error('Virtual function.');
+};
+
+es3fBooleanStateQuery.TransformFeedbackTestCase.prototype.test = function() {
+ var transformFeedbackTestVertSource = '#version 300 es\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = vec4(0.0);\n' +
+ '}\n';
+ var transformFeedbackTestFragSource = '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 fragColor;' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' fragColor = vec4(0.0);\n' +
+ '}\n';
+
+ this.m_transformfeedback = gl.createTransformFeedback();
+
+ var shaderVert = gl.createShader(gl.VERTEX_SHADER);
+ gl.shaderSource(shaderVert, transformFeedbackTestVertSource);
+ gl.compileShader(shaderVert);
+ this.m_pass &= glsStateQuery.verifyShader(shaderVert, gl.COMPILE_STATUS, true);
+
+ var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER);
+ gl.shaderSource(shaderFrag, transformFeedbackTestFragSource);
+ gl.compileShader(shaderFrag);
+ this.m_pass &= glsStateQuery.verifyShader(shaderFrag, gl.COMPILE_STATUS, true);
+
+ var shaderProg = gl.createProgram();
+ gl.attachShader(shaderProg, shaderVert);
+ gl.attachShader(shaderProg, shaderFrag);
+ var transform_feedback_outputs = ['gl_Position'];
+ gl.transformFeedbackVaryings(shaderProg, transform_feedback_outputs, gl.INTERLEAVED_ATTRIBS);
+ gl.linkProgram(shaderProg);
+ this.m_pass &= glsStateQuery.verifyProgram(shaderProg, gl.LINK_STATUS, true);
+
+ gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, this.m_transformfeedback);
+
+ var buffer = gl.createBuffer();
+ gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, buffer);
+ gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, 16, gl.DYNAMIC_READ);
+ gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, buffer);
+
+ gl.useProgram(shaderProg);
+
+ this.testTransformFeedback();
+
+ gl.useProgram(null);
+ gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, null);
+ gl.deleteTransformFeedback(this.m_transformfeedback);
+ gl.deleteBuffer(buffer);
+ gl.deleteShader(shaderVert);
+ gl.deleteShader(shaderFrag);
+ gl.deleteProgram(shaderProg);
+};
+
+/**
+ * @constructor
+ * @extends {es3fBooleanStateQuery.TransformFeedbackTestCase}
+ * @param {string} name
+ */
+es3fBooleanStateQuery.TransformFeedbackBasicTestCase = function(name) {
+ es3fBooleanStateQuery.TransformFeedbackTestCase.call(this, name, 'Test TRANSFORM_FEEDBACK_ACTIVE and TRANSFORM_FEEDBACK_PAUSED');
+};
+
+setParentClass(es3fBooleanStateQuery.TransformFeedbackBasicTestCase, es3fBooleanStateQuery.TransformFeedbackTestCase);
+
+es3fBooleanStateQuery.TransformFeedbackBasicTestCase.prototype.testTransformFeedback = function() {
+ gl.beginTransformFeedback(gl.POINTS);
+
+ this.m_pass &= glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_ACTIVE, true);
+ this.m_pass &= glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_PAUSED, false);
+
+ gl.pauseTransformFeedback();
+
+ this.m_pass &= glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_ACTIVE, true);
+ this.m_pass &= glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_PAUSED, true);
+
+ gl.resumeTransformFeedback();
+
+ this.m_pass &= glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_ACTIVE, true);
+ this.m_pass &= glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_PAUSED, false);
+
+ gl.endTransformFeedback();
+
+ this.m_pass &= glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_ACTIVE, false);
+ this.m_pass &= glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_PAUSED, false);
+};
+
+/**
+ * @constructor
+ * @extends {es3fBooleanStateQuery.TransformFeedbackTestCase}
+ * @param {string} name
+ */
+es3fBooleanStateQuery.TransformFeedbackImplicitResumeTestCase = function(name) {
+ es3fBooleanStateQuery.TransformFeedbackTestCase.call(this, name, 'EndTransformFeedback performs an implicit ResumeTransformFeedback.');
+};
+
+setParentClass(es3fBooleanStateQuery.TransformFeedbackImplicitResumeTestCase, es3fBooleanStateQuery.TransformFeedbackTestCase);
+
+es3fBooleanStateQuery.TransformFeedbackImplicitResumeTestCase.prototype.testTransformFeedback = function() {
+ gl.beginTransformFeedback(gl.POINTS);
+
+ this.m_pass &= glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_ACTIVE, true);
+ this.m_pass &= glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_PAUSED, false);
+
+ gl.pauseTransformFeedback();
+
+ this.m_pass &= glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_ACTIVE, true);
+ this.m_pass &= glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_PAUSED, true);
+
+ gl.endTransformFeedback();
+
+ this.m_pass &= glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_ACTIVE, false);
+ this.m_pass &= glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_PAUSED, false);
+};
+
+/**
+* @constructor
+* @extends {tcuTestCase.DeqpTest}
+*/
+es3fBooleanStateQuery.BooleanStateQuery = function() {
+ tcuTestCase.DeqpTest.call(this, 'boolean', 'Boolean State Query tests');
+};
+
+es3fBooleanStateQuery.BooleanStateQuery.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+es3fBooleanStateQuery.BooleanStateQuery.prototype.constructor = es3fBooleanStateQuery.BooleanStateQuery;
+
+es3fBooleanStateQuery.BooleanStateQuery.prototype.init = function() {
+ var testRoot = this;
+ var isEnableds = [
+ ['rasterizer_discard', 'RASTERIZER_DISCARD', gl.RASTERIZER_DISCARD, false],
+ ['cull_face', 'CULL_FACE', gl.CULL_FACE, false],
+ ['polygon_offset_fill', 'POLYGON_OFFSET_FILL', gl.POLYGON_OFFSET_FILL, false],
+ ['sample_alpha_to_coverage', 'SAMPLE_ALPHA_TO_COVERAGE', gl.SAMPLE_ALPHA_TO_COVERAGE, false],
+ ['sample_coverage', 'SAMPLE_COVERAGE', gl.SAMPLE_COVERAGE, false],
+ ['scissor_test', 'SCISSOR_TEST', gl.SCISSOR_TEST, false],
+ ['stencil_test', 'STENCIL_TEST', gl.STENCIL_TEST, false],
+ ['depth_test', 'DEPTH_TEST', gl.DEPTH_TEST, false],
+ ['blend', 'BLEND', gl.BLEND, false],
+ ['dither', 'DITHER', gl.DITHER, true]
+ ];
+ isEnableds.forEach(function(elem) {
+ var name = elem[0];
+ var description = elem[1];
+ var targetName = elem[2];
+ var value = elem[3];
+ testRoot.addChild(new es3fBooleanStateQuery.IsEnabledStateTestCase(name, description, targetName, value));
+ });
+
+ testRoot.addChild(new es3fBooleanStateQuery.ColorMaskTestCase('color_writemask', 'COLOR_WRITEMASK'));
+ testRoot.addChild(new es3fBooleanStateQuery.DepthWriteMaskTestCase('depth_writemask', 'DEPTH_WRITEMASK'));
+ testRoot.addChild(new es3fBooleanStateQuery.SampleCoverageInvertTestCase('sample_coverage_invert', 'SAMPLE_COVERAGE_INVERT'));
+ testRoot.addChild(new es3fBooleanStateQuery.InitialBooleanTestCase('transform_feedback_active_initial', 'initial TRANSFORM_FEEDBACK_ACTIVE', gl.TRANSFORM_FEEDBACK_ACTIVE, false));
+ testRoot.addChild(new es3fBooleanStateQuery.InitialBooleanTestCase('transform_feedback_paused_initial', 'initial TRANSFORM_FEEDBACK_PAUSED', gl.TRANSFORM_FEEDBACK_PAUSED, false));
+ testRoot.addChild(new es3fBooleanStateQuery.TransformFeedbackBasicTestCase('transform_feedback'));
+ testRoot.addChild(new es3fBooleanStateQuery.TransformFeedbackImplicitResumeTestCase('transform_feedback_implicit_resume'));
+};
+
+/**
+* Run test
+* @param {WebGL2RenderingContext} context
+*/
+es3fBooleanStateQuery.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fBooleanStateQuery.BooleanStateQuery());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fBooleanStateQuery.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBufferCopyTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBufferCopyTests.js
new file mode 100644
index 0000000000..51186231a6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBufferCopyTests.js
@@ -0,0 +1,355 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fBufferCopyTests');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deString');
+goog.require('modules.shared.glsBufferTestUtil');
+
+goog.scope(function() {
+
+ var es3fBufferCopyTests = functional.gles3.es3fBufferCopyTests;
+ var glsBufferTestUtil = modules.shared.glsBufferTestUtil;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var deMath = framework.delibs.debase.deMath;
+ var deString = framework.delibs.debase.deString;
+ var deRandom = framework.delibs.debase.deRandom;
+
+ /** @type {WebGL2RenderingContext} */ var gl;
+
+ /**
+ * @constructor
+ * @extends {glsBufferTestUtil.BufferCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} srcTarget
+ * @param {number} srcSize
+ * @param {number} srcHint
+ * @param {number} dstTarget
+ * @param {number} dstSize
+ * @param {number} dstHint
+ * @param {number} copySrcOffset
+ * @param {number} copyDstOffset
+ * @param {number} copySize
+ * @param {glsBufferTestUtil.VerifyType} verifyType
+ */
+ es3fBufferCopyTests.BasicBufferCopyCase = function(name, desc, srcTarget, srcSize, srcHint, dstTarget, dstSize, dstHint, copySrcOffset, copyDstOffset, copySize, verifyType) {
+ glsBufferTestUtil.BufferCase.call(this, name, desc);
+
+ this.m_srcTarget = srcTarget;
+ this.m_srcSize = srcSize;
+ this.m_srcHint = srcHint;
+ this.m_dstTarget = dstTarget;
+ this.m_dstSize = dstSize;
+ this.m_dstHint = dstHint;
+ this.m_copySrcOffset = copySrcOffset;
+ this.m_copyDstOffset = copyDstOffset;
+ this.m_copySize = copySize;
+ this.m_verifyType = verifyType;
+
+ assertMsgOptions(deMath.deInBounds32(this.m_copySrcOffset, 0, this.m_srcSize) && deMath.deInRange32(this.m_copySrcOffset + this.m_copySize, this.m_copySrcOffset, this.m_srcSize), 'Copy parameters are out of buffer\'s range', false, true);
+ assertMsgOptions(deMath.deInBounds32(this.m_copyDstOffset, 0, this.m_dstSize) && deMath.deInRange32(this.m_copyDstOffset + this.m_copySize, this.m_copyDstOffset, this.m_dstSize), 'Copy parameters are out of buffer\'s range', false, true);
+ };
+
+ es3fBufferCopyTests.BasicBufferCopyCase.prototype = Object.create(glsBufferTestUtil.BufferCase.prototype);
+ es3fBufferCopyTests.BasicBufferCopyCase.prototype.constructor = es3fBufferCopyTests.BasicBufferCopyCase;
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fBufferCopyTests.BasicBufferCopyCase.prototype.iterate = function() {
+ /** @type {glsBufferTestUtil.BufferVerifier} */ var verifier = new glsBufferTestUtil.BufferVerifier(this.m_verifyType);
+ var srcRef = new glsBufferTestUtil.ReferenceBuffer();
+ var dstRef = new glsBufferTestUtil.ReferenceBuffer();
+ var srcBuf = 0;
+ var dstBuf = 0;
+ var srcSeed = deMath.binaryOp(deString.deStringHash(this.fullName()), 0xabcd, deMath.BinaryOp.XOR);
+ var dstSeed = deMath.binaryOp(deString.deStringHash(this.fullName()), 0xef01, deMath.BinaryOp.XOR);
+ var isOk = true;
+
+ srcRef.setSize(this.m_srcSize);
+ glsBufferTestUtil.fillWithRandomBytes(srcRef.getPtr(), this.m_srcSize, srcSeed);
+
+ dstRef.setSize(this.m_dstSize);
+ glsBufferTestUtil.fillWithRandomBytes(dstRef.getPtr(), this.m_dstSize, dstSeed);
+
+ // Create source buffer and fill with data.
+ srcBuf = this.genBuffer();
+ gl.bindBuffer(this.m_srcTarget, srcBuf);
+ gl.bufferData(this.m_srcTarget, srcRef.getPtr(), this.m_srcHint);
+
+ // Create destination buffer and fill with data.
+ dstBuf = this.genBuffer();
+ gl.bindBuffer(this.m_dstTarget, dstBuf);
+ gl.bufferData(this.m_dstTarget, dstRef.getPtr(), this.m_dstHint);
+
+ // Verify both buffers before executing copy.
+ isOk = verifier.verify(srcBuf, srcRef.getPtr(), 0, this.m_srcSize, this.m_srcTarget) && isOk;
+ isOk = verifier.verify(dstBuf, dstRef.getPtr(), 0, this.m_dstSize, this.m_dstTarget) && isOk;
+
+ // Execute copy.
+ dstRef.getPtr().set(srcRef.getPtr().subarray(this.m_copySrcOffset, this.m_copySrcOffset + this.m_copySize), this.m_copyDstOffset);
+
+ gl.bindBuffer(this.m_srcTarget, srcBuf);
+ gl.bindBuffer(this.m_dstTarget, dstBuf);
+ gl.copyBufferSubData(this.m_srcTarget, this.m_dstTarget, this.m_copySrcOffset, this.m_copyDstOffset, this.m_copySize);
+
+ // Verify both buffers after copy.
+ isOk = verifier.verify(srcBuf, srcRef.getPtr(), 0, this.m_srcSize, this.m_srcTarget) && isOk;
+ isOk = verifier.verify(dstBuf, dstRef.getPtr(), 0, this.m_dstSize, this.m_dstTarget) && isOk;
+
+ if (isOk)
+ testPassed('');
+ else
+ testFailed('Buffer verification failed');
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ // Case B: same buffer, take range as parameter
+
+ /**
+ * @constructor
+ * @extends {glsBufferTestUtil.BufferCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} srcTarget
+ * @param {number} dstTarget
+ * @param {number} hint
+ * @param {glsBufferTestUtil.VerifyType} verifyType
+ */
+ es3fBufferCopyTests.SingleBufferCopyCase = function(name, desc, srcTarget, dstTarget, hint, verifyType) {
+ glsBufferTestUtil.BufferCase.call(this, name, desc);
+ this.m_srcTarget = srcTarget;
+ this.m_dstTarget = dstTarget;
+ this.m_hint = hint;
+ this.m_verifyType = verifyType;
+ };
+
+ es3fBufferCopyTests.SingleBufferCopyCase.prototype = Object.create(glsBufferTestUtil.BufferCase.prototype);
+ es3fBufferCopyTests.SingleBufferCopyCase.prototype.constructor = es3fBufferCopyTests.SingleBufferCopyCase;
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fBufferCopyTests.SingleBufferCopyCase.prototype.iterate = function() {
+ var size = 1000;
+ /** @type {glsBufferTestUtil.BufferVerifier} */ var verifier = new glsBufferTestUtil.BufferVerifier(this.m_verifyType);
+ var ref = new glsBufferTestUtil.ReferenceBuffer();
+ var baseSeed = deString.deStringHash(this.fullName());
+ var isOk = true;
+
+ ref.setSize(size);
+
+ // Create buffer.
+ var buf = this.genBuffer();
+ gl.bindBuffer(this.m_srcTarget, buf);
+
+ /** @type {Array<{srcOffset: number, dstOffset: number, copySize: number}>} */
+ var copyRanges = [{
+ srcOffset: 57, dstOffset: 701, copySize: 101 // Non-adjecent, from low to high.
+ },{
+ srcOffset: 640, dstOffset: 101, copySize: 101 // Non-adjecent, from high to low.
+ },{
+ srcOffset: 0, dstOffset: 500, copySize: 500 // Lower half to upper half.
+ },{
+ srcOffset: 500, dstOffset: 0, copySize: 500 // Upper half to lower half.
+ }];
+
+ for (var ndx = 0; ndx < copyRanges.length && isOk; ndx++) {
+ var srcOffset = copyRanges[ndx].srcOffset;
+ var dstOffset = copyRanges[ndx].dstOffset;
+ var copySize = copyRanges[ndx].copySize;
+
+ glsBufferTestUtil.fillWithRandomBytes(ref.getPtr(), size, deMath.binaryOp(baseSeed, deMath.deMathHash(ndx), deMath.BinaryOp.XOR));
+
+ // Fill with data.
+ gl.bindBuffer(this.m_srcTarget, buf);
+ gl.bufferData(this.m_srcTarget, ref.getPtr(), this.m_hint);
+
+ // Execute copy.
+ ref.getPtr().set(ref.getPtr().subarray(srcOffset, srcOffset + copySize), dstOffset);
+
+ gl.bindBuffer(this.m_dstTarget, buf);
+ gl.copyBufferSubData(this.m_srcTarget, this.m_dstTarget, srcOffset, dstOffset, copySize);
+
+ // Verify buffer after copy.
+ isOk = verifier.verify(buf, ref.getPtr(), 0, size, this.m_dstTarget) && isOk;
+ }
+
+ if (isOk)
+ testPassed('');
+ else
+ testFailed('Buffer verification failed');
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fBufferCopyTests.BufferCopyTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'copy', 'Buffer copy tests');
+ this.makeExecutable();
+ };
+
+ es3fBufferCopyTests.BufferCopyTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fBufferCopyTests.BufferCopyTests.prototype.constructor = es3fBufferCopyTests.BufferCopyTests;
+
+ es3fBufferCopyTests.BufferCopyTests.prototype.init = function() {
+ /** @type {glsBufferTestUtil.VerifyType} */ var verify;
+
+ var bufferTargets = [
+ gl.ARRAY_BUFFER,
+ gl.COPY_READ_BUFFER,
+ gl.COPY_WRITE_BUFFER,
+ gl.ELEMENT_ARRAY_BUFFER,
+ gl.PIXEL_PACK_BUFFER,
+ gl.PIXEL_UNPACK_BUFFER,
+ gl.TRANSFORM_FEEDBACK_BUFFER,
+ gl.UNIFORM_BUFFER
+ ];
+
+ // .basic
+
+ var basicGroup = new tcuTestCase.DeqpTest('basic', 'Basic buffer copy cases');
+ this.addChild(basicGroup);
+
+ for (var srcTargetNdx = 0; srcTargetNdx < bufferTargets.length; srcTargetNdx++) {
+ for (var dstTargetNdx = 0; dstTargetNdx < bufferTargets.length; dstTargetNdx++) {
+ if (srcTargetNdx == dstTargetNdx)
+ continue;
+
+ // In WebGL 2, a copy between an ELEMENT_ARRAY_BUFFER and other data buffer
+ // (not COPY_WRITE_BUFFER nor COPY_READ_BUFFER nor ELEMENT_ARRAY_BUFFER)
+ // cannot be made, so let's skip those cases.
+ if (bufferTargets[srcTargetNdx] == gl.ELEMENT_ARRAY_BUFFER ||
+ bufferTargets[dstTargetNdx] == gl.ELEMENT_ARRAY_BUFFER)
+ continue;
+
+ var srcTarget = bufferTargets[srcTargetNdx];
+ var dstTarget = bufferTargets[dstTargetNdx];
+ var size = 1017;
+ var hint = gl.STATIC_DRAW;
+ verify = glsBufferTestUtil.VerifyType.AS_VERTEX_ARRAY;
+ var name = glsBufferTestUtil.getBufferTargetName(srcTarget) + '_' + glsBufferTestUtil.getBufferTargetName(dstTarget);
+
+ basicGroup.addChild(new es3fBufferCopyTests.BasicBufferCopyCase(name, '', srcTarget, size, hint, dstTarget, size, hint, 0, 0, size, verify));
+ }
+ }
+
+ // .subrange
+
+ var subrangeGroup = new tcuTestCase.DeqpTest('subrange', 'Buffer subrange copy tests');
+ this.addChild(subrangeGroup);
+
+ /**
+ * @type {Array<{name: string, srcSize: number, dstSize: number, srcOffset: number, dstOffset: number, copySize: number}>}
+ */
+ var cases = [{
+ name: 'middle', srcSize: 1000, dstSize: 1000, srcOffset: 250, dstOffset: 250, copySize: 500
+ },{
+ name: 'small_to_large', srcSize: 100, dstSize: 1000, srcOffset: 0, dstOffset: 409, copySize: 100
+ },{
+ name: 'large_to_small', srcSize: 1000, dstSize: 100, srcOffset: 409, dstOffset: 0, copySize: 100
+ },{
+ name: 'low_to_high_1', srcSize: 1000, dstSize: 1000, srcOffset: 0, dstOffset: 500, copySize: 500
+ },{
+ name: 'low_to_high_2', srcSize: 997, dstSize: 1027, srcOffset: 0, dstOffset: 701, copySize: 111
+ },{
+ name: 'high_to_low_1', srcSize: 1000, dstSize: 1000, srcOffset: 500, dstOffset: 0, copySize: 500
+ },{
+ name: 'high_to_low_2', srcSize: 1027, dstSize: 997, srcOffset: 701, dstOffset: 17, copySize: 111
+ }];
+
+ for (var ndx = 0; ndx < cases.length; ndx++) {
+ var srcTarget = gl.COPY_READ_BUFFER;
+ var dstTarget = gl.COPY_WRITE_BUFFER;
+ var hint = gl.STATIC_DRAW;
+ verify = glsBufferTestUtil.VerifyType.AS_VERTEX_ARRAY;
+
+ subrangeGroup.addChild(
+ new es3fBufferCopyTests.BasicBufferCopyCase(
+ cases[ndx].name, '',
+ srcTarget, cases[ndx].srcSize, hint,
+ dstTarget, cases[ndx].dstSize, hint,
+ cases[ndx].srcOffset, cases[ndx].dstOffset, cases[ndx].copySize,
+ verify
+ )
+ );
+ }
+
+ // .single_buffer
+
+ var singleBufGroup = new tcuTestCase.DeqpTest('single_buffer', 'Copies within single buffer');
+ this.addChild(singleBufGroup);
+
+ for (var srcTargetNdx = 0; srcTargetNdx < bufferTargets.length; srcTargetNdx++) {
+ for (var dstTargetNdx = 0; dstTargetNdx < bufferTargets.length; dstTargetNdx++) {
+ if (srcTargetNdx == dstTargetNdx)
+ continue;
+
+ // In WebGL 2, we can't rebind an ELEMENT_ARRAY_BUFFER or TRANSFORM_FEEDBACK_BUFFER as a
+ // different type of buffer, so we skip those cases.
+ if (bufferTargets[srcTargetNdx] == gl.ELEMENT_ARRAY_BUFFER || bufferTargets[srcTargetNdx] == gl.TRANSFORM_FEEDBACK_BUFFER ||
+ bufferTargets[dstTargetNdx] == gl.ELEMENT_ARRAY_BUFFER || bufferTargets[dstTargetNdx] == gl.TRANSFORM_FEEDBACK_BUFFER)
+ continue;
+
+ var srcTarget = bufferTargets[srcTargetNdx];
+ var dstTarget = bufferTargets[dstTargetNdx];
+ var hint = gl.STATIC_DRAW;
+ verify = glsBufferTestUtil.VerifyType.AS_VERTEX_ARRAY;
+ var name = glsBufferTestUtil.getBufferTargetName(srcTarget) + '_' + glsBufferTestUtil.getBufferTargetName(dstTarget);
+
+ singleBufGroup.addChild(new es3fBufferCopyTests.SingleBufferCopyCase(name, '', srcTarget, dstTarget, hint, verify));
+ }
+ }
+ };
+
+ /**
+ * Create and execute the test cases
+ * @param {WebGL2RenderingContext} context
+ */
+ es3fBufferCopyTests.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+
+ state.setRoot(new es3fBufferCopyTests.BufferCopyTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBufferObjectQueryTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBufferObjectQueryTests.js
new file mode 100644
index 0000000000..a4384d3ae7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBufferObjectQueryTests.js
@@ -0,0 +1,177 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fBufferObjectQueryTests');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('functional.gles3.es3fApiCase');
+
+goog.scope(function() {
+var es3fBufferObjectQueryTests = functional.gles3.es3fBufferObjectQueryTests;
+var tcuTestCase = framework.common.tcuTestCase;
+var es3fApiCase = functional.gles3.es3fApiCase;
+var deRandom = framework.delibs.debase.deRandom;
+
+var setParentClass = function(child, parent) {
+ child.prototype = Object.create(parent.prototype);
+ child.prototype.constructor = child;
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fBufferObjectQueryTests.BufferCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fBufferObjectQueryTests.BufferCase, es3fApiCase.ApiCase);
+
+es3fBufferObjectQueryTests.BufferCase.prototype.test = function() {
+ var bufferTargets = [
+ gl.ARRAY_BUFFER, gl.COPY_READ_BUFFER,
+ gl.TRANSFORM_FEEDBACK_BUFFER, gl.UNIFORM_BUFFER,
+
+ gl.COPY_WRITE_BUFFER, gl.ELEMENT_ARRAY_BUFFER,
+ gl.PIXEL_PACK_BUFFER, gl.PIXEL_UNPACK_BUFFER
+ ];
+
+ // most test need only to be run with a subset of targets
+ var targets = this.m_testAllTargets ? bufferTargets.length : 4;
+
+ for (var ndx = 0; ndx < targets; ++ndx) {
+ this.m_bufferTarget = bufferTargets[ndx];
+
+ var bufferId = gl.createBuffer();
+ gl.bindBuffer(this.m_bufferTarget, bufferId);
+
+ this.testBuffer();
+
+ gl.bindBuffer(this.m_bufferTarget, null);
+ gl.deleteBuffer(bufferId);
+ }
+};
+
+/**
+ * @constructor
+ * @extends {es3fBufferObjectQueryTests.BufferCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fBufferObjectQueryTests.BufferSizeCase = function(name, description) {
+ es3fBufferObjectQueryTests.BufferCase.call(this, name, description);
+ this.m_testAllTargets = true;
+};
+
+setParentClass(es3fBufferObjectQueryTests.BufferSizeCase, es3fBufferObjectQueryTests.BufferCase);
+
+es3fBufferObjectQueryTests.BufferSizeCase.prototype.testBuffer = function() {
+ var rnd = new deRandom.Random(0xabcdef);
+
+ var size = /** type {number} */ (gl.getBufferParameter(this.m_bufferTarget, gl.BUFFER_SIZE));
+ this.check(size == 0, 'Initial size should be 0; got ' + size);
+
+ var numIterations = 16;
+ for (var i = 0; i < numIterations; ++i) {
+ var len = rnd.getInt(0, 1024);
+ gl.bufferData(this.m_bufferTarget, len, gl.STREAM_DRAW);
+
+ size = /** type {number} */ (gl.getBufferParameter(this.m_bufferTarget, gl.BUFFER_SIZE));
+ this.check(size == len, 'Buffer size should be ' + len + ' ; got ' + size);
+ }
+};
+
+/**
+ * @constructor
+ * @extends {es3fBufferObjectQueryTests.BufferCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fBufferObjectQueryTests.BufferUsageCase = function(name, description) {
+ es3fBufferObjectQueryTests.BufferCase.call(this, name, description);
+ this.m_testAllTargets = false;
+};
+
+setParentClass(es3fBufferObjectQueryTests.BufferUsageCase, es3fBufferObjectQueryTests.BufferCase);
+
+es3fBufferObjectQueryTests.BufferUsageCase.prototype.testBuffer = function() {
+ var usage = /** type {number} */ (gl.getBufferParameter(this.m_bufferTarget, gl.BUFFER_USAGE));
+ this.check(usage == gl.STATIC_DRAW, 'Initial usage should be STATIC_DRAW; got ' + wtu.glEnumToString(gl, usage));
+
+ var usages = [
+ gl.STREAM_DRAW, gl.STREAM_READ,
+ gl.STREAM_COPY, gl.STATIC_DRAW,
+ gl.STATIC_READ, gl.STATIC_COPY,
+ gl.DYNAMIC_DRAW, gl.DYNAMIC_READ,
+ gl.DYNAMIC_COPY
+ ];
+
+ for (var ndx = 0; ndx < usages.length; ++ndx) {
+ gl.bufferData(this.m_bufferTarget, 16, usages[ndx]);
+
+ usage = /** type {number} */ (gl.getBufferParameter(this.m_bufferTarget, gl.BUFFER_USAGE));
+ this.check(usage == usages[ndx], 'Buffer usage should be ' + wtu.glEnumToString(gl, usages[ndx]) + ' ; got ' + wtu.glEnumToString(gl, usage));
+ }
+};
+
+/**
+* @constructor
+* @extends {tcuTestCase.DeqpTest}
+*/
+es3fBufferObjectQueryTests.BufferObjectQueryTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'buffer_object', 'Buffer Object Query tests');
+};
+
+es3fBufferObjectQueryTests.BufferObjectQueryTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+es3fBufferObjectQueryTests.BufferObjectQueryTests.prototype.constructor = es3fBufferObjectQueryTests.BufferObjectQueryTests;
+
+es3fBufferObjectQueryTests.BufferObjectQueryTests.prototype.init = function() {
+ this.addChild(new es3fBufferObjectQueryTests.BufferSizeCase('buffer_size' , 'BUFFER_SIZE'));
+ this.addChild(new es3fBufferObjectQueryTests.BufferUsageCase('buffer_usage' , 'BUFFER_USAGE'));
+};
+
+/**
+* Run test
+* @param {WebGL2RenderingContext} context
+*/
+es3fBufferObjectQueryTests.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fBufferObjectQueryTests.BufferObjectQueryTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fBufferObjectQueryTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBuiltinPrecisionTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBuiltinPrecisionTests.js
new file mode 100644
index 0000000000..d5786180b3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fBuiltinPrecisionTests.js
@@ -0,0 +1,87 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES 3.0 Module
+ * -------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief Tests for precision and range of GLSL builtins and types.
+ *//*--------------------------------------------------------------------*/
+'use strict';
+goog.provide('functional.gles3.es3fBuiltinPrecisionTests');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('modules.shared.glsBuiltinPrecisionTests');
+
+goog.scope(function() {
+
+ var es3fBuiltinPrecisionTests = functional.gles3.es3fBuiltinPrecisionTests;
+ var glsBuiltinPrecisionTests = modules.shared.glsBuiltinPrecisionTests;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var gluShaderProgram = framework.opengl.gluShaderProgram;
+
+ /**
+ * @param {*} context
+ * @param {number} caseId test case Id
+ * @return {tcuTestCase.DeqpTest}
+ */
+ es3fBuiltinPrecisionTests.createBuiltinPrecisionTests = function(context, caseId) {
+ /** @type {tcuTestCase.DeqpTest} */
+ var group = tcuTestCase.newTest('precision', 'Builtin precision tests');
+
+ /** @type {Array<gluShaderProgram.shaderType>} */ var shaderTypes = [];
+ var es3Cases = glsBuiltinPrecisionTests.createES3BuiltinCases(caseId);
+
+ shaderTypes.push(gluShaderProgram.shaderType.VERTEX);
+ shaderTypes.push(gluShaderProgram.shaderType.FRAGMENT);
+
+ glsBuiltinPrecisionTests.addBuiltinPrecisionTests(es3Cases, shaderTypes, group);
+ return group;
+ };
+
+ /**
+ * Create and execute the test cases
+ * @param {WebGL2RenderingContext} context
+ * @param {number} caseId test case Id
+ */
+ es3fBuiltinPrecisionTests.run = function(context, caseId) {
+ gl = context;
+ // Set up root Test
+ var state = tcuTestCase.runner;
+
+ var test = es3fBuiltinPrecisionTests.createBuiltinPrecisionTests(context, caseId);
+ var testName = test.fullName();
+ var testDescription = test.getDescription() === undefined ? '' : test.getDescription();
+
+ state.testName = testName;
+ state.setRoot(test);
+ //Set up name and description of this test series.
+ setCurrentTestName(testName);
+ description(testDescription);
+
+ try {
+ //Create test cases
+ test.init();
+ //Run test cases
+ tcuTestCase.runTestCases();
+ } catch (err) {
+ bufferedLogToConsole('Exception: ' + err);
+ testFailedOptions('Failed to es3fAttribLocationTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fClippingTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fClippingTests.js
new file mode 100644
index 0000000000..e261cdea63
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fClippingTests.js
@@ -0,0 +1,406 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fClippingTests');
+goog.require('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuRGBA');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.referencerenderer.rrUtil');
+goog.require('functional.gles3.es3fFboTestCase');
+goog.require('functional.gles3.es3fFboTestUtil');
+
+goog.scope(function() {
+var es3fClippingTests = functional.gles3.es3fClippingTests;
+var tcuImageCompare = framework.common.tcuImageCompare;
+var tcuTestCase = framework.common.tcuTestCase;
+var es3fFboTestCase = functional.gles3.es3fFboTestCase;
+var es3fFboTestUtil = functional.gles3.es3fFboTestUtil;
+var rrUtil = framework.referencerenderer.rrUtil;
+var gluShaderUtil = framework.opengl.gluShaderUtil;
+var deRandom = framework.delibs.debase.deRandom;
+var deMath = framework.delibs.debase.deMath;
+var tcuRGBA = framework.common.tcuRGBA;
+
+/** @type {WebGL2RenderingContext} */ var gl;
+
+var setParentClass = function(child, parent) {
+ child.prototype = Object.create(parent.prototype);
+ child.prototype.constructor = child;
+};
+
+/**
+ * @constructor
+ * @extends {es3fFboTestCase.FboTestCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {Array<number>} viewport
+ * @param {Array<number>} rangeX
+ * @param {Array<number>} rangeY
+ * @param {Array<number>} rangeZ
+ */
+es3fClippingTests.TriangleCase = function(name, desc, viewport, rangeX, rangeY, rangeZ) {
+ es3fFboTestCase.FboTestCase.call(this, name, desc);
+ this.m_viewport = viewport;
+ this.m_rangeX = rangeX;
+ this.m_rangeY = rangeY;
+ this.m_rangeZ = rangeZ;
+};
+
+setParentClass(es3fClippingTests.TriangleCase, es3fFboTestCase.FboTestCase);
+
+es3fClippingTests.TriangleCase.prototype.render = function(dst) {
+ var ctx = this.getCurrentContext();
+ var x = this.m_viewport[0];
+ var y = this.m_viewport[1];
+ var width = this.m_viewport[2];
+ var height = this.m_viewport[3];
+ ctx.viewport(x, y, width, height);
+ ctx.clearColor(0, 0, 0, 1);
+ ctx.clear(gl.COLOR_BUFFER_BIT);
+
+ var shader = new es3fFboTestUtil.GradientShader(gluShaderUtil.DataType.FLOAT_VEC4);
+ var program = ctx.createProgram(shader);
+ shader.setGradient(ctx, program, [0, 0, 0, 0], [1, 1, 1, 1]);
+
+ rrUtil.drawQuad(ctx, program,
+ [this.m_rangeX[0], this.m_rangeY[0], this.m_rangeZ[0]],
+ [this.m_rangeX[1], this.m_rangeY[1], this.m_rangeZ[1]]);
+ dst.readViewport(ctx, this.m_viewport);
+};
+
+/**
+ * Move the vertex coordinate to pixel center
+ */
+var center = function(x, width) {
+ var half = width / 2;
+ var pos = half + x * half;
+ // almost to the center to avoid problems when rounding
+ // the position the pixel edge
+ pos = Math.round(pos) + 0.49;
+ return (pos - half) / half;
+};
+
+/**
+ * @constructor
+ * @extends {es3fFboTestCase.FboTestCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {Array<number>} viewport
+ * @param {number} lineWidth
+ */
+es3fClippingTests.LinesCase = function(name, desc, viewport, lineWidth) {
+ es3fFboTestCase.FboTestCase.call(this, name, desc);
+ this.m_viewport = viewport;
+ this.m_lineWidth = lineWidth;
+};
+
+setParentClass(es3fClippingTests.LinesCase, es3fFboTestCase.FboTestCase);
+
+es3fClippingTests.LinesCase.prototype.compare = function(reference, result) {
+ return tcuImageCompare.bilinearCompare('Result', 'Image comparison result',
+ reference.getAccess(),
+ result.getAccess(),
+ tcuRGBA.newRGBAComponents(3, 3, 3, 3));
+};
+
+es3fClippingTests.LinesCase.prototype.render = function(dst) {
+ var ctx = this.getCurrentContext();
+ var x = this.m_viewport[0];
+ var y = this.m_viewport[1];
+ var width = this.m_viewport[2];
+ var height = this.m_viewport[3];
+ ctx.viewport(x, y, width, height);
+ ctx.clearColor(0, 0, 0, 1);
+ ctx.clear(gl.COLOR_BUFFER_BIT);
+
+ var shader = new es3fFboTestUtil.GradientShader(gluShaderUtil.DataType.FLOAT_VEC4);
+ var program = ctx.createProgram(shader);
+ shader.setGradient(ctx, program, [0, 0, 0, 0], [1, 1, 1, 1]);
+
+ // positions
+ var posLoc = ctx.getAttribLocation(program, 'a_position');
+ if (posLoc == -1)
+ throw new Error('a_position attribute is not defined.');
+
+ var buffer = ctx.createBuffer();
+ ctx.bindBuffer(gl.ARRAY_BUFFER, buffer);
+
+ ctx.lineWidth(this.m_lineWidth);
+
+ var y1 = center(-0.5, height);
+ var y2 = center(-0.2, height);
+ var y3 = center(0.2, height);
+ var y4 = center(0.5, height);
+ var y5 = center(0, height);
+ var x1 = center(-0.5, width);
+ var x2 = center(-0.2, width);
+ var x3 = center(0.2, width);
+ var x4 = center(0.5, width);
+ var positions = [
+ // horizontal check
+ // both ends outside viewport
+ -1 - 1 / width, y1, 0, 1,
+ 1 + 1 / width, y1, 0, 1,
+ // one end inside viewport
+ -1 + 1 / width, y2, 0, 1,
+ 1 + 1 / width, y2, 0, 1,
+
+ -1 - 1 / width, y3, 0, 1,
+ 1 - 1 / width, y3, 0, 1,
+ // both ends inside viewport
+
+ -1 + 1 / width, y4, 0, 1,
+ 1 - 1 / width, y4, 0, 1,
+
+ //vertical check
+ // both ends outside viewport
+ x1, -1 - 1 / height, 0, 1,
+ x1, 1 + 1 / height, 0, 1,
+
+ // one end inside viewport
+ x2, -1 + 1 / height, 0, 1,
+ x2, 1 + 1 / height, 0, 1,
+
+ x3, -1 - 1 / height, 0, 1,
+ x3, 1 - 1 / height, 0, 1,
+ //both ends inside viewport
+ x4, -1 + 1 / height, 0, 1,
+ x4, 1 - 1 / height, 0, 1,
+
+ //depth check
+ -1, y5, -1.5, 1,
+ 1, y5, 1.1, 1
+ ];
+ var numVertices = positions.length / 4;
+
+ ctx.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW);
+
+ ctx.enableVertexAttribArray(posLoc);
+ ctx.vertexAttribPointer(posLoc, 4, gl.FLOAT, false, 0, 0);
+
+ //colors
+ var coordLoc = ctx.getAttribLocation(program, 'a_coord');
+ if (coordLoc == -1)
+ throw new Error('a_coord attribute is not defined.');
+
+ var buffer2 = ctx.createBuffer();
+ ctx.bindBuffer(gl.ARRAY_BUFFER, buffer2);
+
+ var coords = [];
+ for (var i = 0; i < numVertices / 2; i++) {
+ coords.push(0, 0, 1, 1);
+ }
+ ctx.bufferData(gl.ARRAY_BUFFER, new Float32Array(coords), gl.STATIC_DRAW);
+
+ ctx.enableVertexAttribArray(coordLoc);
+ ctx.vertexAttribPointer(coordLoc, 2, gl.FLOAT, false, 0, 0);
+
+ ctx.drawArrays(gl.LINES, 0, numVertices);
+ ctx.disableVertexAttribArray(posLoc);
+ ctx.disableVertexAttribArray(coordLoc);
+ ctx.bindBuffer(gl.ARRAY_BUFFER, null);
+ ctx.deleteBuffer(buffer);
+ ctx.deleteBuffer(buffer2);
+ dst.readViewport(ctx, this.m_viewport);
+};
+
+/**
+ * @constructor
+ * @extends {es3fFboTestCase.FboTestCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {Array<number>} viewport
+ * @param {number} pointSize
+ */
+es3fClippingTests.PointsCase = function(name, desc, viewport, pointSize) {
+ es3fFboTestCase.FboTestCase.call(this, name, desc);
+ this.m_viewport = viewport;
+ this.m_pointSize = pointSize;
+};
+
+setParentClass(es3fClippingTests.PointsCase, es3fFboTestCase.FboTestCase);
+
+es3fClippingTests.PointsCase.prototype.compare = function(reference, result) {
+ return tcuImageCompare.bilinearCompare('Result', 'Image comparison result',
+ reference.getAccess(),
+ result.getAccess(),
+ tcuRGBA.newRGBAComponents(3, 3, 3, 3));
+};
+
+es3fClippingTests.PointsCase.prototype.render = function(dst) {
+ var ctx = this.getCurrentContext();
+ var x = this.m_viewport[0];
+ var y = this.m_viewport[1];
+ var width = this.m_viewport[2];
+ var height = this.m_viewport[3];
+ ctx.viewport(x, y, width, height);
+ ctx.clearColor(0, 0, 0, 1);
+ ctx.clear(gl.COLOR_BUFFER_BIT);
+
+ var shader = new es3fFboTestUtil.FlatColorShader(gluShaderUtil.DataType.FLOAT_VEC4, this.m_pointSize);
+ var program = ctx.createProgram(shader);
+ shader.setColor(ctx, program, [0, 1, 0, 1]);
+
+ // positions
+ var posLoc = ctx.getAttribLocation(program, 'a_position');
+ if (posLoc == -1)
+ throw new Error('a_position attribute is not defined.');
+
+ var buffer = ctx.createBuffer();
+ ctx.bindBuffer(gl.ARRAY_BUFFER, buffer);
+
+ var positions = [
+ // clipping in X axis
+ -1 - 1 / width, -0.5, 0, 1,
+ -1, 0, 0, 1,
+ -1 + 1 / width, 0.5, 0, 1,
+ 1 + 1 / width, -0.5, 0, 1,
+ 1, 0, 0, 1,
+ 1 - 1 / width, 0.5, 0, 1,
+ // clipping in Y axis
+ -0.5, -1 - 1 / height, 0, 1,
+ 0, -1, 0, 1,
+ 0.5, -1 + 1 / height, 0, 1,
+ -0.5, 1 - 1 / height, 0, 1,
+ 0, 1, 0, 1,
+ 0.5, 1 + 1 / height, 0, 1,
+ // clipping in Z axis
+ -0.5, -0.5, -1.5, 1,
+ 0, 0, 0, 1,
+ 0.5, 0.5, 1.5, 1
+ ];
+ // move the vertices to pixel centers to avoid off-by-1 differences
+ for (var i = 0; i < positions.length; i += 4) {
+ positions[i + 0] = center(positions[i + 0], width);
+ positions[i + 1] = center(positions[i + 1], height);
+ }
+ // positions = [-1 + 3/width + 0.001, 1 + 1/height + 0.001, 0, 1];
+ // positions = [-1, -1, 0, 1];
+
+ var numVertices = positions.length / 4;
+
+ ctx.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW);
+
+ ctx.enableVertexAttribArray(posLoc);
+ ctx.vertexAttribPointer(posLoc, 4, gl.FLOAT, false, 0, 0);
+
+ ctx.drawArrays(gl.POINTS, 0, numVertices);
+ ctx.disableVertexAttribArray(posLoc);
+ ctx.bindBuffer(gl.ARRAY_BUFFER, null);
+ ctx.deleteBuffer(buffer);
+ dst.readViewport(ctx, this.m_viewport);
+};
+
+/**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+es3fClippingTests.ClippingTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'clipping', 'Clipping tests');
+};
+
+es3fClippingTests.ClippingTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+es3fClippingTests.ClippingTests.prototype.constructor = es3fClippingTests.ClippingTests;
+
+es3fClippingTests.ClippingTests.prototype.init = function() {
+ var width = gl.drawingBufferWidth;
+ var height = gl.drawingBufferHeight;
+ /** @const */ var WIDE_POINT = 5;
+ /** @const */ var WIDE_LINE = 5;
+ var viewports = [{ name: 'full_viewport', v: [0, 0, width, height] }, {
+ name: 'partial_viewport', v: [width * 0.3 , height * 0.2 , width * 0.6, height * 0.5] }
+ ];
+ var pointSizeRange = gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE);
+ var lineWidthRange = gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE);
+
+ for (var i = 0; i < viewports.length; i++) {
+ var v = viewports[i].v.map(Math.floor);
+ var vName = viewports[i].name;
+ this.addChild(new es3fClippingTests.LinesCase('narrow_lines_' + vName, 'lines', v, 1));
+ if (lineWidthRange[1] >= WIDE_LINE)
+ this.addChild(new es3fClippingTests.LinesCase('wide_lines_' + vName, 'lines', v, WIDE_LINE));
+ this.addChild(new es3fClippingTests.PointsCase('small_points_' + vName, 'points', v, 1));
+ if (pointSizeRange[1] >= WIDE_POINT)
+ this.addChild(new es3fClippingTests.PointsCase('wide_points_' + vName, 'points', v, WIDE_POINT));
+ }
+
+ var rangesX = [
+ [-1.2, 1.2],
+ [-1.2, 0.8],
+ [-0.8, 1.2]
+ ];
+ var rangesY = [
+ [-1.2, 1.2],
+ [-1.2, 0.8],
+ [-0.8, 1.2]
+ ];
+ var rangesZ = [
+ [-1.2, 1.2],
+ [1.2, -1.2]
+ ];
+ for (var i = 0; i < viewports.length; i++) {
+ var v = viewports[i].v.map(Math.floor);
+ var vName = viewports[i].name;
+ for (var x = 0; x < rangesX.length; x++)
+ for (var y = 0; y < rangesY.length; y++)
+ for (var z = 0; z < rangesZ.length; z++) {
+ var rangeX = rangesX[x];
+ var rangeY = rangesY[y];
+ var rangeZ = rangesZ[z];
+ var name = 'triangles_' + viewports[i].name + '_' +
+ '(' + rangeX[0] + ',' + rangeY[0] + ',' + rangeZ[0] + ')-' +
+ '(' + rangeX[1] + ',' + rangeY[1] + ',' + rangeZ[1] + ')';
+ this.addChild(new es3fClippingTests.TriangleCase(name, 'triangles', v,
+ rangeX,
+ rangeY,
+ rangeZ));
+ }
+ }
+};
+
+/**
+ * Run test
+ * @param {WebGL2RenderingContext} context
+ */
+es3fClippingTests.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fClippingTests.ClippingTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fClippingTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fDefaultVertexAttributeTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fDefaultVertexAttributeTests.js
new file mode 100644
index 0000000000..863bc4deda
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fDefaultVertexAttributeTests.js
@@ -0,0 +1,546 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fDefaultVertexAttributeTests');
+goog.require('framework.common.tcuLogImage');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('framework.opengl.gluShaderUtil');
+
+goog.scope(function() {
+var es3fDefaultVertexAttributeTests = functional.gles3.es3fDefaultVertexAttributeTests;
+var tcuTestCase = framework.common.tcuTestCase;
+var tcuSurface = framework.common.tcuSurface;
+var deMath = framework.delibs.debase.deMath;
+var gluShaderProgram = framework.opengl.gluShaderProgram;
+var gluShaderUtil = framework.opengl.gluShaderUtil;
+var tcuLogImage = framework.common.tcuLogImage;
+
+var setParentClass = function(child, parent) {
+ child.prototype = Object.create(parent.prototype);
+ child.prototype.constructor = child;
+};
+
+/**
+ * @constructor
+ */
+es3fDefaultVertexAttributeTests.LoaderVertexAttrib1f = function() {
+ this.caseName = 'vertex_attrib_1f';
+ this.name = 'VertexAttrib1f';
+ this.signed = true;
+ this.load = function(index, value) {
+ gl.vertexAttrib1f(index, value[0]);
+ return [value[0], 0, 0, 1];
+ };
+};
+
+/**
+ * @constructor
+ */
+es3fDefaultVertexAttributeTests.LoaderVertexAttrib2f = function() {
+ this.caseName = 'vertex_attrib_2f';
+ this.name = 'VertexAttrib2f';
+ this.signed = true;
+ this.load = function(index, value) {
+ gl.vertexAttrib2f(index, value[0], value[1]);
+ return [value[0], value[1], 0, 1];
+ };
+};
+
+/**
+ * @constructor
+ */
+es3fDefaultVertexAttributeTests.LoaderVertexAttrib3f = function() {
+ this.caseName = 'vertex_attrib_3f';
+ this.name = 'VertexAttrib3f';
+ this.signed = true;
+ this.load = function(index, value) {
+ gl.vertexAttrib3f(index, value[0], value[1], value[2]);
+ return [value[0], value[1], value[2], 1];
+ };
+};
+
+/**
+ * @constructor
+ */
+es3fDefaultVertexAttributeTests.LoaderVertexAttrib4f = function() {
+ this.caseName = 'vertex_attrib_4f';
+ this.name = 'VertexAttrib4f';
+ this.signed = true;
+ this.load = function(index, value) {
+ gl.vertexAttrib4f(index, value[0], value[1], value[2], value[3]);
+ return [value[0], value[1], value[2], value[3]];
+ };
+};
+
+/**
+ * @constructor
+ */
+es3fDefaultVertexAttributeTests.LoaderVertexAttrib1fv = function() {
+ this.caseName = 'vertex_attrib_1fv';
+ this.name = 'VertexAttrib1fv';
+ this.signed = true;
+ this.load = function(index, value) {
+ gl.vertexAttrib1fv(index, value.slice(0, 1));
+ return [value[0], 0, 0, 1];
+ };
+};
+
+/**
+ * @constructor
+ */
+es3fDefaultVertexAttributeTests.LoaderVertexAttrib2fv = function() {
+ this.caseName = 'vertex_attrib_2fv';
+ this.name = 'VertexAttrib2fv';
+ this.signed = true;
+ this.load = function(index, value) {
+ gl.vertexAttrib2fv(index, value.slice(0, 2));
+ return [value[0], value[1], 0, 1];
+ };
+};
+
+/**
+ * @constructor
+ */
+es3fDefaultVertexAttributeTests.LoaderVertexAttrib3fv = function() {
+ this.caseName = 'vertex_attrib_3fv';
+ this.name = 'VertexAttrib3fv';
+ this.signed = true;
+ this.load = function(index, value) {
+ gl.vertexAttrib3fv(index, value.slice(0, 3));
+ return [value[0], value[1], value[2], 1];
+ };
+};
+
+/**
+ * @constructor
+ */
+es3fDefaultVertexAttributeTests.LoaderVertexAttrib4fv = function() {
+ this.caseName = 'vertex_attrib_4fv';
+ this.name = 'VertexAttrib4fv';
+ this.signed = true;
+ this.load = function(index, value) {
+ gl.vertexAttrib4fv(index, value.slice(0, 4));
+ return [value[0], value[1], value[2], value[3]];
+ };
+};
+
+/**
+ * @constructor
+ */
+es3fDefaultVertexAttributeTests.LoaderVertexAttribI4i = function() {
+ this.caseName = 'vertex_attrib_4i';
+ this.name = 'VertexAttribI4i';
+ this.signed = true;
+ this.load = function(index, value) {
+ var v = new Int32Array(value);
+ gl.vertexAttribI4i(index, v[0], v[1], v[2], v[3]);
+ return [v[0], v[1], v[2], v[3]];
+ };
+};
+
+/**
+ * @constructor
+ */
+es3fDefaultVertexAttributeTests.LoaderVertexAttribI4iv = function() {
+ this.caseName = 'vertex_attrib_4iv';
+ this.name = 'VertexAttribI4iv';
+ this.signed = true;
+ this.load = function(index, value) {
+ var v = new Int32Array(value);
+ gl.vertexAttribI4iv(index, v);
+ return [v[0], v[1], v[2], v[3]];
+ };
+};
+
+/**
+ * @constructor
+ */
+es3fDefaultVertexAttributeTests.LoaderVertexAttribI4ui = function() {
+ this.caseName = 'vertex_attrib_4ui';
+ this.name = 'VertexAttribI4ui';
+ this.signed = false;
+ this.load = function(index, value) {
+ var v = new Uint32Array(value);
+ gl.vertexAttribI4ui(index, v[0], v[1], v[2], v[3]);
+ return [v[0], v[1], v[2], v[3]];
+ };
+};
+
+/**
+ * @constructor
+ */
+es3fDefaultVertexAttributeTests.LoaderVertexAttribI4uiv = function() {
+ this.caseName = 'vertex_attrib_4uiv';
+ this.name = 'VertexAttribI4uiv';
+ this.signed = false;
+ this.load = function(index, value) {
+ var v = new Uint32Array(value);
+ gl.vertexAttribI4uiv(index, v);
+ return [v[0], v[1], v[2], v[3]];
+ };
+};
+
+/** @const */ var RENDER_SIZE = 32;
+/** @const */ var s_valueRange = 10;
+/** @const */ var s_passThroughFragmentShaderSource = '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 fragColor;\n' +
+ 'in mediump vec4 v_color;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' fragColor = v_color;\n' +
+ '}\n';
+
+/**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+es3fDefaultVertexAttributeTests.AttributeCase = function(loaderType, dataType) {
+ var loader = new loaderType();
+ var name = loader.caseName;
+ var description = 'Test ' + loader.name;
+ tcuTestCase.DeqpTest.call(this, name, description);
+ this.m_funcName = loader.name;
+ this.m_useNegativeValues = loader.signed;
+ this.m_dataType = dataType;
+ this.m_allIterationsPassed = true;
+ this.m_loader = loader;
+ this.m_iteration = 0;
+};
+
+setParentClass(es3fDefaultVertexAttributeTests.AttributeCase, tcuTestCase.DeqpTest);
+
+es3fDefaultVertexAttributeTests.AttributeCase.prototype.init = function() {
+ // log test info
+
+ var maxRange = s_valueRange;
+ var minRange = (this.m_useNegativeValues) ? (-maxRange) : (0.0);
+
+ bufferedLogToConsole(
+ 'Loading attribute values using ' + this.m_funcName + '\n' +
+ 'Attribute type: ' + gluShaderUtil.getDataTypeName(this.m_dataType) + '\n' +
+ 'Attribute value range: [' + minRange + ', ' + maxRange + ']');
+
+ // gen shader and base quad
+
+ this.m_program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(this.genVertexSource(), s_passThroughFragmentShaderSource));
+ if (!this.m_program.isOk())
+ testFailedOptions('could not build program', true);
+
+ var fullscreenQuad = [
+ 1.0, 1.0, 0.0, 1.0,
+ 1.0, -1.0, 0.0, 1.0,
+ -1.0, 1.0, 0.0, 1.0,
+ -1.0, -1.0, 0.0, 1.0
+ ];
+
+ this.m_bufID = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, this.m_bufID);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(fullscreenQuad), gl.STATIC_DRAW);
+};
+
+es3fDefaultVertexAttributeTests.AttributeCase.prototype.deinit = function() {
+ this.m_loader = null;
+
+ gl.useProgram(null);
+ this.m_program = null;
+
+ if (this.m_bufID) {
+ gl.deleteBuffer(this.m_bufID);
+ this.m_bufID = null;
+ }
+};
+
+es3fDefaultVertexAttributeTests.AttributeCase.prototype.iterate = function() {
+ var testValues = [
+ [0.0, 0.5, 0.2, 1.0],
+ [0.1, 0.7, 1.0, 0.6],
+ [0.4, 0.2, 0.0, 0.5],
+ [0.5, 0.0, 0.9, 0.1],
+ [0.6, 0.2, 0.2, 0.9],
+ [0.9, 1.0, 0.0, 0.0],
+ [1.0, 0.5, 0.3, 0.8]
+ ];
+
+ bufferedLogToConsole('Iteration ' + (this.m_iteration + 1) + '/' + testValues.length);
+
+ var testValue = this.m_useNegativeValues ?
+ deMath.subScalar(deMath.scale(testValues[this.m_iteration], 2), 1) :
+ deMath.scale(testValues[this.m_iteration], s_valueRange);
+
+ if (!this.renderWithValue(testValue))
+ this.m_allIterationsPassed = false;
+
+ // continue
+
+ if (++this.m_iteration < testValues.length)
+ return tcuTestCase.IterateResult.CONTINUE;
+
+ if (this.m_allIterationsPassed)
+ testPassed();
+ else
+ testFailed('Got unexpected values');
+
+ return tcuTestCase.IterateResult.STOP;
+};
+
+es3fDefaultVertexAttributeTests.AttributeCase.prototype.genVertexSource = function() {
+ var vectorSize = (gluShaderUtil.isDataTypeMatrix(this.m_dataType)) ? (gluShaderUtil.getDataTypeMatrixNumRows(this.m_dataType)) : (gluShaderUtil.isDataTypeVector(this.m_dataType)) ? (gluShaderUtil.getDataTypeScalarSize(this.m_dataType)) : (-1);
+ var vectorType = gluShaderUtil.getDataTypeName((gluShaderUtil.isDataTypeMatrix(this.m_dataType)) ? (gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.FLOAT, vectorSize)) : (gluShaderUtil.isDataTypeVector(this.m_dataType)) ? (gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.FLOAT, vectorSize)) : (gluShaderUtil.DataType.FLOAT));
+ var components = (gluShaderUtil.isDataTypeMatrix(this.m_dataType)) ? (gluShaderUtil.getDataTypeMatrixNumRows(this.m_dataType)) : (gluShaderUtil.getDataTypeScalarSize(this.m_dataType));
+
+ var buf = '#version 300 es\n' +
+ 'in highp vec4 a_position;\n' +
+ 'in highp ' + gluShaderUtil.getDataTypeName(this.m_dataType) + ' a_value;\n' +
+ 'out highp vec4 v_color;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = a_position;\n' +
+ '\n';
+
+ buf += ' highp ' + vectorType + ' normalizedValue = ' + ((gluShaderUtil.getDataTypeScalarType(this.m_dataType) == gluShaderUtil.DataType.FLOAT) ? ('') : (vectorType)) + '(a_value' + ((gluShaderUtil.isDataTypeMatrix(this.m_dataType)) ? ('[1]') : ('')) + ') / float(' + s_valueRange + ');\n';
+
+ if (this.m_useNegativeValues)
+ buf += ' highp ' + vectorType + ' positiveNormalizedValue = (normalizedValue + ' + vectorType + '(1.0)) / 2.0;\n';
+ else
+ buf += ' highp ' + vectorType + ' positiveNormalizedValue = normalizedValue;\n';
+
+ if (components == 1)
+ buf += ' v_color = vec4(positiveNormalizedValue, 0.0, 0.0, 1.0);\n';
+ else if (components == 2)
+ buf += ' v_color = vec4(positiveNormalizedValue.xy, 0.0, 1.0);\n';
+ else if (components == 3)
+ buf += ' v_color = vec4(positiveNormalizedValue.xyz, 1.0);\n';
+ else if (components == 4)
+ buf += ' v_color = vec4((positiveNormalizedValue.xy + positiveNormalizedValue.zz) / 2.0, positiveNormalizedValue.w, 1.0);\n';
+ else
+ throw new Error('Wrong component size: ' + components);
+
+ buf += '}\n';
+
+ return buf;
+};
+
+es3fDefaultVertexAttributeTests.AttributeCase.prototype.renderWithValue = function(v) {
+ var positionIndex = gl.getAttribLocation(this.m_program.getProgram(), 'a_position');
+ var valueIndex = gl.getAttribLocation(this.m_program.getProgram(), 'a_value');
+ var dest = new tcuSurface.Surface(RENDER_SIZE, RENDER_SIZE);
+
+ gl.clearColor(0.0, 0.0, 0.0, 0.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.viewport(0, 0, RENDER_SIZE, RENDER_SIZE);
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, this.m_bufID);
+ gl.vertexAttribPointer(positionIndex, 4, gl.FLOAT, false, 0, 0);
+ gl.enableVertexAttribArray(positionIndex);
+
+ // transfer test value. Load to the second column in the matrix case
+ var loadedValue = this.m_loader.load((gluShaderUtil.isDataTypeMatrix(this.m_dataType)) ? (valueIndex + 1) : (valueIndex), v);
+
+ gl.useProgram(this.m_program.getProgram());
+ gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
+ gl.useProgram(null);
+ // The original c++ test does not disable vertex attrib array, which is wrong.
+ // On most drivers all tests pass because a_position is assigned location 0.
+ // On MacOSX some tests fail because a_value is assigned location 0 and vertex
+ // attrib array is left enabled and affects later tests.
+ gl.disableVertexAttribArray(positionIndex);
+ dest.readViewport(gl);
+
+ // check whole result is colored correctly
+ return this.verifyUnicoloredBuffer(dest, this.computeColor(loadedValue));
+};
+
+es3fDefaultVertexAttributeTests.AttributeCase.prototype.computeColor = function(value) {
+ var normalizedValue = deMath.scale(value, 1 / s_valueRange);
+ var positiveNormalizedValue = this.m_useNegativeValues ?
+ deMath.scale(deMath.addScalar(normalizedValue, 1), 0.5) :
+ normalizedValue;
+ var components = (gluShaderUtil.isDataTypeMatrix(this.m_dataType)) ? (gluShaderUtil.getDataTypeMatrixNumRows(this.m_dataType)) : (gluShaderUtil.getDataTypeScalarSize(this.m_dataType));
+
+ if (components == 1)
+ return [positiveNormalizedValue[0], 0.0, 0.0, 1.0];
+ else if (components == 2)
+ return [positiveNormalizedValue[0], positiveNormalizedValue[1], 0.0, 1.0];
+ else if (components == 3)
+ return [positiveNormalizedValue[0], positiveNormalizedValue[1], positiveNormalizedValue[2], 1.0];
+ else if (components == 4)
+ return [(positiveNormalizedValue[0] + positiveNormalizedValue[2]) / 2.0, (positiveNormalizedValue[1] + positiveNormalizedValue[2]) / 2.0, positiveNormalizedValue[3], 1.0];
+ else
+ throw new Error('Wrong component size: ' + components);
+};
+
+/**
+ * @param {tcuSurface.Surface} scene
+ * @param {Array<number>} refColor
+ * @return {boolean}
+ */
+es3fDefaultVertexAttributeTests.AttributeCase.prototype.verifyUnicoloredBuffer = function(scene, refColor) {
+ var access = scene.getAccess();
+ var errorMask = new tcuSurface.Surface(RENDER_SIZE, RENDER_SIZE);
+ var colorThreshold = [6, 6, 6, 6];
+ var error = false;
+
+ errorMask.getAccess().clear([0, 1, 0, 1]);
+
+ bufferedLogToConsole('Verifying rendered image. Expecting color ' + refColor + ', threshold ' + colorThreshold);
+
+ for (var y = 0; y < RENDER_SIZE; ++y)
+ for (var x = 0; x < RENDER_SIZE; ++x) {
+ var color = access.getPixel(x, y);
+
+ if (Math.abs(color[0] - refColor[0]) > colorThreshold[0] ||
+ Math.abs(color[1] - refColor[1]) > colorThreshold[1] ||
+ Math.abs(color[2] - refColor[2]) > colorThreshold[2]) {
+
+ // first error
+ if (!error)
+ debug('Found invalid pixel(s). Pixel at (' + x + ', ' + y + ') color: ' + color);
+
+ error = true;
+ errorMask.setPixel(x, y, [1, 0, 0, 1]);
+ }
+ }
+
+ if (!error)
+ bufferedLogToConsole('Rendered image is valid.');
+ else {
+ tcuLogImage.logImage('Result', '', access);
+ tcuLogImage.logImage('Error mask', '', errorMask.getAccess());
+ }
+
+ return !error;
+};
+
+/**
+* @constructor
+* @extends {tcuTestCase.DeqpTest}
+*/
+es3fDefaultVertexAttributeTests.DefaultVertexAttributeTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'default_vertex_attrib', 'Test default vertex attributes');
+};
+
+es3fDefaultVertexAttributeTests.DefaultVertexAttributeTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+es3fDefaultVertexAttributeTests.DefaultVertexAttributeTests.prototype.constructor = es3fDefaultVertexAttributeTests.DefaultVertexAttributeTests;
+
+es3fDefaultVertexAttributeTests.DefaultVertexAttributeTests.prototype.init = function() {
+ var tests = this;
+ var floatTargets = [
+ ['float', gluShaderUtil.DataType.FLOAT, false],
+ ['vec2', gluShaderUtil.DataType.FLOAT_VEC2, true],
+ ['vec3', gluShaderUtil.DataType.FLOAT_VEC3, true],
+ ['vec4', gluShaderUtil.DataType.FLOAT_VEC4, false],
+ ['mat2', gluShaderUtil.DataType.FLOAT_MAT2, true],
+ ['mat2x3', gluShaderUtil.DataType.FLOAT_MAT2X3, true],
+ ['mat2x4', gluShaderUtil.DataType.FLOAT_MAT2X4, true],
+ ['mat3', gluShaderUtil.DataType.FLOAT_MAT3, true],
+ ['mat3x2', gluShaderUtil.DataType.FLOAT_MAT3X2, true],
+ ['mat3x4', gluShaderUtil.DataType.FLOAT_MAT3X4, true],
+ ['mat4', gluShaderUtil.DataType.FLOAT_MAT4, false],
+ ['mat4x2', gluShaderUtil.DataType.FLOAT_MAT4X2, true],
+ ['mat4x3', gluShaderUtil.DataType.FLOAT_MAT4X3, true]
+ ];
+
+ floatTargets.forEach(function(elem) {
+ var name = elem[0];
+ var dataType = elem[1];
+ var reduced = elem[2];
+ var group = new tcuTestCase.DeqpTest(name, 'test with ' + name);
+ tests.addChild(group);
+ group.addChild(new es3fDefaultVertexAttributeTests.AttributeCase(es3fDefaultVertexAttributeTests.LoaderVertexAttrib1f, dataType));
+ if (!reduced) {
+ group.addChild(new es3fDefaultVertexAttributeTests.AttributeCase(es3fDefaultVertexAttributeTests.LoaderVertexAttrib2f, dataType));
+ group.addChild(new es3fDefaultVertexAttributeTests.AttributeCase(es3fDefaultVertexAttributeTests.LoaderVertexAttrib3f, dataType));
+ }
+ group.addChild(new es3fDefaultVertexAttributeTests.AttributeCase(es3fDefaultVertexAttributeTests.LoaderVertexAttrib4f, dataType));
+
+ group.addChild(new es3fDefaultVertexAttributeTests.AttributeCase(es3fDefaultVertexAttributeTests.LoaderVertexAttrib1fv, dataType));
+ if (!reduced) {
+ group.addChild(new es3fDefaultVertexAttributeTests.AttributeCase(es3fDefaultVertexAttributeTests.LoaderVertexAttrib2fv, dataType));
+ group.addChild(new es3fDefaultVertexAttributeTests.AttributeCase(es3fDefaultVertexAttributeTests.LoaderVertexAttrib3fv, dataType));
+ }
+ group.addChild(new es3fDefaultVertexAttributeTests.AttributeCase(es3fDefaultVertexAttributeTests.LoaderVertexAttrib4fv, dataType));
+
+ });
+
+ var intTargets = [
+ ['int', gluShaderUtil.DataType.INT, false],
+ ['ivec2', gluShaderUtil.DataType.INT_VEC2, true],
+ ['ivec3', gluShaderUtil.DataType.INT_VEC3, true],
+ ['ivec4', gluShaderUtil.DataType.INT_VEC4, false]
+ ];
+
+ intTargets.forEach(function(elem) {
+ var name = elem[0];
+ var dataType = elem[1];
+ var reduced = elem[2];
+ var group = new tcuTestCase.DeqpTest(name, 'test with ' + name);
+ tests.addChild(group);
+ group.addChild(new es3fDefaultVertexAttributeTests.AttributeCase(es3fDefaultVertexAttributeTests.LoaderVertexAttribI4i, dataType));
+ group.addChild(new es3fDefaultVertexAttributeTests.AttributeCase(es3fDefaultVertexAttributeTests.LoaderVertexAttribI4iv, dataType));
+ });
+
+ var uintTargets = [
+ ['uint', gluShaderUtil.DataType.UINT, false],
+ ['uvec2', gluShaderUtil.DataType.UINT_VEC2, true],
+ ['uvec3', gluShaderUtil.DataType.UINT_VEC3, true],
+ ['uvec4', gluShaderUtil.DataType.UINT_VEC4, false]
+ ];
+
+ uintTargets.forEach(function(elem) {
+ var name = elem[0];
+ var dataType = elem[1];
+ var reduced = elem[2];
+ var group = new tcuTestCase.DeqpTest(name, 'test with ' + name);
+ tests.addChild(group);
+ group.addChild(new es3fDefaultVertexAttributeTests.AttributeCase(es3fDefaultVertexAttributeTests.LoaderVertexAttribI4ui, dataType));
+ group.addChild(new es3fDefaultVertexAttributeTests.AttributeCase(es3fDefaultVertexAttributeTests.LoaderVertexAttribI4uiv, dataType));
+ });
+
+};
+
+/**
+* Run test
+* @param {WebGL2RenderingContext} context
+*/
+es3fDefaultVertexAttributeTests.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fDefaultVertexAttributeTests.DefaultVertexAttributeTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fDefaultVertexAttributeTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fDrawTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fDrawTests.js
new file mode 100644
index 0000000000..df42ac8193
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fDrawTests.js
@@ -0,0 +1,1155 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fDrawTests');
+goog.require('framework.common.tcuLogImage');
+goog.require('framework.common.tcuRGBA');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.delibs.debase.deUtil');
+goog.require('framework.opengl.gluDrawUtil');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluTexture');
+goog.require('framework.opengl.gluVarType');
+goog.require('framework.opengl.simplereference.sglrGLContext');
+goog.require('framework.opengl.simplereference.sglrShaderProgram');
+goog.require('framework.referencerenderer.rrFragmentOperations');
+goog.require('framework.referencerenderer.rrGenericVector');
+goog.require('framework.referencerenderer.rrShadingContext');
+goog.require('framework.referencerenderer.rrVertexAttrib');
+goog.require('framework.referencerenderer.rrVertexPacket');
+goog.require('modules.shared.glsDrawTests');
+
+goog.scope(function() {
+
+ var es3fDrawTests = functional.gles3.es3fDrawTests;
+ var gluDrawUtil = framework.opengl.gluDrawUtil;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var gluShaderProgram = framework.opengl.gluShaderProgram;
+ var gluTexture = framework.opengl.gluTexture;
+ var gluVarType = framework.opengl.gluVarType;
+ var tcuLogImage = framework.common.tcuLogImage;
+ var tcuRGBA = framework.common.tcuRGBA;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var tcuSurface = framework.common.tcuSurface;
+ var tcuTexture = framework.common.tcuTexture;
+ var deMath = framework.delibs.debase.deMath;
+ var deString = framework.delibs.debase.deString;
+ var deRandom = framework.delibs.debase.deRandom;
+ var deUtil = framework.delibs.debase.deUtil;
+ var glsDrawTests = modules.shared.glsDrawTests;
+ var sglrShaderProgram = framework.opengl.simplereference.sglrShaderProgram;
+ var sglrGLContext = framework.opengl.simplereference.sglrGLContext;
+ var rrFragmentOperations = framework.referencerenderer.rrFragmentOperations;
+ var rrGenericVector = framework.referencerenderer.rrGenericVector;
+ var rrShadingContext = framework.referencerenderer.rrShadingContext;
+ var rrVertexAttrib = framework.referencerenderer.rrVertexAttrib;
+ var rrVertexPacket = framework.referencerenderer.rrVertexPacket;
+
+ /** @type {WebGL2RenderingContext}*/ var gl;
+
+ /**
+ * @enum
+ */
+ es3fDrawTests.TestIterationType = {
+ DRAW_COUNT: 0, // !< test with 2, 6, and 26 primitives
+ INSTANCE_COUNT: 1, // !< test with 2, 4, and 12 instances
+ INDEX_RANGE: 2
+ };
+
+ /**
+ * @param {glsDrawTests.DrawTest} test
+ * @param {glsDrawTests.DrawTestSpec} baseSpec
+ * @param {?es3fDrawTests.TestIterationType} type
+ */
+ es3fDrawTests.addTestIterations = function(test, baseSpec, type) {
+ var spec = /** @type {glsDrawTests.DrawTestSpec} */ (deUtil.clone(baseSpec));
+
+ if (type == es3fDrawTests.TestIterationType.DRAW_COUNT) {
+ spec.primitiveCount = 1;
+ test.addIteration(spec, 'draw count = ' + spec.primitiveCount);
+
+ spec.primitiveCount = 5;
+ test.addIteration(spec, 'draw count = ' + spec.primitiveCount);
+
+ spec.primitiveCount = 25;
+ test.addIteration(spec, 'draw count = ' + spec.primitiveCount);
+ } else if (type == es3fDrawTests.TestIterationType.INSTANCE_COUNT) {
+ spec.instanceCount = 1;
+ test.addIteration(spec, 'instance count = ' + spec.instanceCount);
+
+ spec.instanceCount = 4;
+ test.addIteration(spec, 'instance count = ' + spec.instanceCount);
+
+ spec.instanceCount = 11;
+ test.addIteration(spec, 'instance count = ' + spec.instanceCount);
+ } else if (type == es3fDrawTests.TestIterationType.INDEX_RANGE) {
+ spec.indexMin = 0;
+ spec.indexMax = 23;
+ test.addIteration(spec, 'index range = [' + spec.indexMin + ', ' + spec.indexMax + ']');
+
+ spec.indexMin = 23;
+ spec.indexMax = 40;
+ test.addIteration(spec, 'index range = [' + spec.indexMin + ', ' + spec.indexMax + ']');
+
+ // Only makes sense with points
+ if (spec.primitive == glsDrawTests.DrawTestSpec.Primitive.POINTS) {
+ spec.indexMin = 5;
+ spec.indexMax = 5;
+ test.addIteration(spec, 'index range = [' + spec.indexMin + ', ' + spec.indexMax + ']');
+ }
+ } else
+ throw new Error('Invalid test iteration type');
+ };
+
+ /**
+ * @param {glsDrawTests.DrawTestSpec} spec
+ * @param {?glsDrawTests.DrawTestSpec.DrawMethod} method
+ */
+ es3fDrawTests.genBasicSpec = function(spec, method) {
+ //spec.apiType = glu::ApiType::es(3,0);
+ spec.primitive = glsDrawTests.DrawTestSpec.Primitive.TRIANGLES;
+ spec.primitiveCount = 6;
+ spec.drawMethod = method;
+ spec.indexType = null;
+ spec.indexPointerOffset = 0;
+ spec.indexStorage = null;
+ spec.first = 0;
+ spec.indexMin = 0;
+ spec.indexMax = 0;
+ spec.instanceCount = 1;
+
+ spec.attribs.push(new glsDrawTests.DrawTestSpec.AttributeSpec());
+
+ spec.attribs[0].inputType = glsDrawTests.DrawTestSpec.InputType.FLOAT;
+ spec.attribs[0].outputType = glsDrawTests.DrawTestSpec.OutputType.VEC2;
+ spec.attribs[0].storage = glsDrawTests.DrawTestSpec.Storage.BUFFER;
+ spec.attribs[0].usage = glsDrawTests.DrawTestSpec.Usage.STATIC_DRAW;
+ spec.attribs[0].componentCount = 4;
+ spec.attribs[0].offset = 0;
+ spec.attribs[0].stride = 0;
+ spec.attribs[0].normalize = false;
+ spec.attribs[0].instanceDivisor = 0;
+ spec.attribs[0].useDefaultAttribute = false;
+
+ spec.attribs.push(new glsDrawTests.DrawTestSpec.AttributeSpec());
+
+ spec.attribs[1].inputType = glsDrawTests.DrawTestSpec.InputType.FLOAT;
+ spec.attribs[1].outputType = glsDrawTests.DrawTestSpec.OutputType.VEC2;
+ spec.attribs[1].storage = glsDrawTests.DrawTestSpec.Storage.BUFFER;
+ spec.attribs[1].usage = glsDrawTests.DrawTestSpec.Usage.STATIC_DRAW;
+ spec.attribs[1].componentCount = 2;
+ spec.attribs[1].offset = 0;
+ spec.attribs[1].stride = 0;
+ spec.attribs[1].normalize = false;
+ spec.attribs[1].instanceDivisor = 0;
+ spec.attribs[1].useDefaultAttribute = false;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} descr
+ * @param {?glsDrawTests.DrawTestSpec.DrawMethod} drawMethod
+ * @param {?glsDrawTests.DrawTestSpec.Primitive} primitive
+ * @param {?glsDrawTests.DrawTestSpec.IndexType} indexType
+ * @param {?glsDrawTests.DrawTestSpec.Storage} indexStorage
+ */
+ es3fDrawTests.AttributeGroup = function(name, descr, drawMethod, primitive, indexType, indexStorage) {
+ tcuTestCase.DeqpTest.call(this, name, descr);
+ this.m_method = drawMethod;
+ this.m_primitive = primitive;
+ this.m_indexType = indexType;
+ this.m_indexStorage = indexStorage;
+ this.makeExecutable();
+ };
+
+ es3fDrawTests.AttributeGroup.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fDrawTests.AttributeGroup.prototype.constructor = es3fDrawTests.AttributeGroup;
+
+ es3fDrawTests.AttributeGroup.prototype.init = function() {
+ // select test type
+ /** @type {boolean} */ var instanced = this.m_method == glsDrawTests.DrawTestSpec.DrawMethod.DRAWARRAYS_INSTANCED ||
+ this.m_method == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_INSTANCED;
+ /** @type {boolean} */ var ranged = this.m_method == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_RANGED;
+ /** @type {es3fDrawTests.TestIterationType} */ var testType = instanced ? es3fDrawTests.TestIterationType.INSTANCE_COUNT :
+ (ranged ? es3fDrawTests.TestIterationType.INDEX_RANGE : es3fDrawTests.TestIterationType.DRAW_COUNT);
+
+ // Single attribute
+ /** @type {glsDrawTests.DrawTest} */ var test = new glsDrawTests.DrawTest(null, 'single_attribute', 'Single attribute array.');
+ /** @type {glsDrawTests.DrawTestSpec} */ var spec = new glsDrawTests.DrawTestSpec();
+
+ //spec.apiType = glu::ApiType::es(3,0);
+ spec.primitive = this.m_primitive;
+ spec.primitiveCount = 5;
+ spec.drawMethod = this.m_method;
+ spec.indexType = this.m_indexType;
+ spec.indexPointerOffset = 0;
+ spec.indexStorage = this.m_indexStorage;
+ spec.first = 0;
+ spec.indexMin = 0;
+ spec.indexMax = 0;
+ spec.instanceCount = 1;
+
+ spec.attribs.length = 0;
+
+ spec.attribs.push(new glsDrawTests.DrawTestSpec.AttributeSpec());
+ spec.attribs[0].inputType = glsDrawTests.DrawTestSpec.InputType.FLOAT;
+ spec.attribs[0].outputType = glsDrawTests.DrawTestSpec.OutputType.VEC2;
+ spec.attribs[0].storage = glsDrawTests.DrawTestSpec.Storage.BUFFER;
+ spec.attribs[0].usage = glsDrawTests.DrawTestSpec.Usage.STATIC_DRAW;
+ spec.attribs[0].componentCount = 2;
+ spec.attribs[0].offset = 0;
+ spec.attribs[0].stride = 0;
+ spec.attribs[0].normalize = false;
+ spec.attribs[0].instanceDivisor = 0;
+ spec.attribs[0].useDefaultAttribute = false;
+
+ es3fDrawTests.addTestIterations(test, spec, testType);
+
+ this.addChild(test);
+
+ // Multiple attribute
+
+ test = new glsDrawTests.DrawTest(null, 'multiple_attributes', 'Multiple attribute arrays.');
+ spec.primitive = this.m_primitive;
+ spec.primitiveCount = 5;
+ spec.drawMethod = this.m_method;
+ spec.indexType = this.m_indexType;
+ spec.indexPointerOffset = 0;
+ spec.indexStorage = this.m_indexStorage;
+ spec.first = 0;
+ spec.indexMin = 0;
+ spec.indexMax = 0;
+ spec.instanceCount = 1;
+
+ spec.attribs.length = 0;
+
+ spec.attribs.push(new glsDrawTests.DrawTestSpec.AttributeSpec());
+ spec.attribs[0].inputType = glsDrawTests.DrawTestSpec.InputType.FLOAT;
+ spec.attribs[0].outputType = glsDrawTests.DrawTestSpec.OutputType.VEC2;
+ spec.attribs[0].storage = glsDrawTests.DrawTestSpec.Storage.BUFFER;
+ spec.attribs[0].usage = glsDrawTests.DrawTestSpec.Usage.STATIC_DRAW;
+ spec.attribs[0].componentCount = 4;
+ spec.attribs[0].offset = 0;
+ spec.attribs[0].stride = 0;
+ spec.attribs[0].normalize = false;
+ spec.attribs[0].instanceDivisor = 0;
+ spec.attribs[0].useDefaultAttribute = false;
+
+ spec.attribs.push(new glsDrawTests.DrawTestSpec.AttributeSpec());
+ spec.attribs[1].inputType = glsDrawTests.DrawTestSpec.InputType.FLOAT;
+ spec.attribs[1].outputType = glsDrawTests.DrawTestSpec.OutputType.VEC2;
+ spec.attribs[1].storage = glsDrawTests.DrawTestSpec.Storage.BUFFER;
+ spec.attribs[1].usage = glsDrawTests.DrawTestSpec.Usage.STATIC_DRAW;
+ spec.attribs[1].componentCount = 2;
+ spec.attribs[1].offset = 0;
+ spec.attribs[1].stride = 0;
+ spec.attribs[1].normalize = false;
+ spec.attribs[1].instanceDivisor = 0;
+ spec.attribs[1].useDefaultAttribute = false;
+
+ es3fDrawTests.addTestIterations(test, spec, testType);
+
+ this.addChild(test);
+
+ // Multiple attribute, second one divided
+
+ test = new glsDrawTests.DrawTest(null, 'instanced_attributes', 'Instanced attribute array.');
+
+ //spec.apiType = glu::ApiType::es(3,0);
+ spec.primitive = this.m_primitive;
+ spec.primitiveCount = 5;
+ spec.drawMethod = this.m_method;
+ spec.indexType = this.m_indexType;
+ spec.indexPointerOffset = 0;
+ spec.indexStorage = this.m_indexStorage;
+ spec.first = 0;
+ spec.indexMin = 0;
+ spec.indexMax = 0;
+ spec.instanceCount = 1;
+
+ spec.attribs.length = 0;
+
+ spec.attribs.push(new glsDrawTests.DrawTestSpec.AttributeSpec());
+ spec.attribs[0].inputType = glsDrawTests.DrawTestSpec.InputType.FLOAT;
+ spec.attribs[0].outputType = glsDrawTests.DrawTestSpec.OutputType.VEC2;
+ spec.attribs[0].storage = glsDrawTests.DrawTestSpec.Storage.BUFFER;
+ spec.attribs[0].usage = glsDrawTests.DrawTestSpec.Usage.STATIC_DRAW;
+ spec.attribs[0].componentCount = 4;
+ spec.attribs[0].offset = 0;
+ spec.attribs[0].stride = 0;
+ spec.attribs[0].normalize = false;
+ spec.attribs[0].instanceDivisor = 0;
+ spec.attribs[0].useDefaultAttribute = false;
+
+ // Add another position component so the instances wont be drawn on each other
+ spec.attribs.push(new glsDrawTests.DrawTestSpec.AttributeSpec());
+ spec.attribs[1].inputType = glsDrawTests.DrawTestSpec.InputType.FLOAT;
+ spec.attribs[1].outputType = glsDrawTests.DrawTestSpec.OutputType.VEC2;
+ spec.attribs[1].storage = glsDrawTests.DrawTestSpec.Storage.BUFFER;
+ spec.attribs[1].usage = glsDrawTests.DrawTestSpec.Usage.STATIC_DRAW;
+ spec.attribs[1].componentCount = 2;
+ spec.attribs[1].offset = 0;
+ spec.attribs[1].stride = 0;
+ spec.attribs[1].normalize = false;
+ spec.attribs[1].instanceDivisor = 1;
+ spec.attribs[1].useDefaultAttribute = false;
+ spec.attribs[1].additionalPositionAttribute = true;
+
+ // Instanced color
+ spec.attribs.push(new glsDrawTests.DrawTestSpec.AttributeSpec());
+ spec.attribs[2].inputType = glsDrawTests.DrawTestSpec.InputType.FLOAT;
+ spec.attribs[2].outputType = glsDrawTests.DrawTestSpec.OutputType.VEC2;
+ spec.attribs[2].storage = glsDrawTests.DrawTestSpec.Storage.BUFFER;
+ spec.attribs[2].usage = glsDrawTests.DrawTestSpec.Usage.STATIC_DRAW;
+ spec.attribs[2].componentCount = 3;
+ spec.attribs[2].offset = 0;
+ spec.attribs[2].stride = 0;
+ spec.attribs[2].normalize = false;
+ spec.attribs[2].instanceDivisor = 1;
+ spec.attribs[2].useDefaultAttribute = false;
+
+ es3fDrawTests.addTestIterations(test, spec, testType);
+
+ this.addChild(test);
+
+ // Multiple attribute, second one default
+ test = new glsDrawTests.DrawTest(null, 'default_attribute', 'Attribute specified with glVertexAttrib*.');
+
+ //spec.apiType = glu::ApiType::es(3,0);
+ spec.primitive = this.m_primitive;
+ spec.primitiveCount = 5;
+ spec.drawMethod = this.m_method;
+ spec.indexType = this.m_indexType;
+ spec.indexPointerOffset = 0;
+ spec.indexStorage = this.m_indexStorage;
+ spec.first = 0;
+ spec.indexMin = 0;
+ spec.indexMax = 17; // \note addTestIterations is not called for the spec, so we must ensure [indexMin, indexMax] is a good range
+ spec.instanceCount = 1;
+
+ spec.attribs.length = 0;
+
+ spec.attribs.push(new glsDrawTests.DrawTestSpec.AttributeSpec());
+ spec.attribs[0].inputType = glsDrawTests.DrawTestSpec.InputType.FLOAT;
+ spec.attribs[0].outputType = glsDrawTests.DrawTestSpec.OutputType.VEC2;
+ spec.attribs[0].storage = glsDrawTests.DrawTestSpec.Storage.BUFFER;
+ spec.attribs[0].usage = glsDrawTests.DrawTestSpec.Usage.STATIC_DRAW;
+ spec.attribs[0].componentCount = 2;
+ spec.attribs[0].offset = 0;
+ spec.attribs[0].stride = 0;
+ spec.attribs[0].normalize = false;
+ spec.attribs[0].instanceDivisor = 0;
+ spec.attribs[0].useDefaultAttribute = false;
+
+ /** @type {Array<{input:?glsDrawTests.DrawTestSpec.InputType, output:?glsDrawTests.DrawTestSpec.OutputType, componentCount:number}>} */ var iopairs = [
+ {input: glsDrawTests.DrawTestSpec.InputType.FLOAT, output: glsDrawTests.DrawTestSpec.OutputType.VEC2, componentCount: 4},
+ {input: glsDrawTests.DrawTestSpec.InputType.FLOAT, output: glsDrawTests.DrawTestSpec.OutputType.VEC4, componentCount: 2},
+ {input: glsDrawTests.DrawTestSpec.InputType.INT, output: glsDrawTests.DrawTestSpec.OutputType.IVEC3, componentCount: 4},
+ {input: glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT, output: glsDrawTests.DrawTestSpec.OutputType.UVEC2, componentCount: 4}
+ ];
+
+ spec.attribs.push(new glsDrawTests.DrawTestSpec.AttributeSpec());
+ for (var ioNdx = 0; ioNdx < iopairs.length; ++ioNdx) {
+ /** @type {string} */ var desc = glsDrawTests.DrawTestSpec.inputTypeToString(iopairs[ioNdx].input) + iopairs[ioNdx].componentCount + ' to ' + glsDrawTests.DrawTestSpec.outputTypeToString(iopairs[ioNdx].output);
+
+ spec.attribs[1].inputType = iopairs[ioNdx].input;
+ spec.attribs[1].outputType = iopairs[ioNdx].output;
+ spec.attribs[1].storage = glsDrawTests.DrawTestSpec.Storage.BUFFER;
+ spec.attribs[1].usage = glsDrawTests.DrawTestSpec.Usage.STATIC_DRAW;
+ spec.attribs[1].componentCount = iopairs[ioNdx].componentCount;
+ spec.attribs[1].offset = 0;
+ spec.attribs[1].stride = 0;
+ spec.attribs[1].normalize = false;
+ spec.attribs[1].instanceDivisor = 0;
+ spec.attribs[1].useDefaultAttribute = true;
+
+ test.addIteration(spec, desc);
+ }
+
+ this.addChild(test);
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} descr
+ * @param {?glsDrawTests.DrawTestSpec.DrawMethod} drawMethod
+ */
+ es3fDrawTests.IndexGroup = function(name, descr, drawMethod) {
+ tcuTestCase.DeqpTest.call(this, name, descr);
+ /** @type {?glsDrawTests.DrawTestSpec.DrawMethod} */ this.m_method = drawMethod;
+ this.makeExecutable();
+ };
+
+ es3fDrawTests.IndexGroup.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fDrawTests.IndexGroup.prototype.constructor = es3fDrawTests.IndexGroup;
+
+ es3fDrawTests.IndexGroup.prototype.init = function() {
+ /** @type {Array<{storage: ?glsDrawTests.DrawTestSpec.Storage, type: ?glsDrawTests.DrawTestSpec.IndexType, aligned: boolean, offsets: Array<number>}>} */ var tests = [
+ {storage: glsDrawTests.DrawTestSpec.Storage.BUFFER, type: glsDrawTests.DrawTestSpec.IndexType.BYTE, aligned: true, offsets: [0, 1, -1]},
+ {storage: glsDrawTests.DrawTestSpec.Storage.BUFFER, type: glsDrawTests.DrawTestSpec.IndexType.SHORT, aligned: true, offsets: [0, 2, -1]},
+ {storage: glsDrawTests.DrawTestSpec.Storage.BUFFER, type: glsDrawTests.DrawTestSpec.IndexType.INT, aligned: true, offsets: [0, 4, -1]},
+
+ {storage: glsDrawTests.DrawTestSpec.Storage.BUFFER, type: glsDrawTests.DrawTestSpec.IndexType.SHORT, aligned: false, offsets: [1, 3, -1]},
+ {storage: glsDrawTests.DrawTestSpec.Storage.BUFFER, type: glsDrawTests.DrawTestSpec.IndexType.INT, aligned: false, offsets: [2, 3, -1]}
+ ];
+
+ /** @type {glsDrawTests.DrawTestSpec} */ var spec = new glsDrawTests.DrawTestSpec();
+ es3fDrawTests.genBasicSpec(spec, this.m_method);
+
+ /** @type {tcuTestCase.DeqpTest} */ var bufferGroup = new tcuTestCase.DeqpTest('buffer', 'buffer');
+ /** @type {tcuTestCase.DeqpTest} */ var unalignedBufferGroup = new tcuTestCase.DeqpTest('unaligned_buffer', 'unaligned buffer');
+
+ this.addChild(bufferGroup);
+ this.addChild(unalignedBufferGroup);
+
+ for (var testNdx = 0; testNdx < tests.length; ++testNdx) {
+ /** @type {{storage: ?glsDrawTests.DrawTestSpec.Storage, type: ?glsDrawTests.DrawTestSpec.IndexType, aligned: boolean, offsets: Array<number>}} */
+ var indexTest = tests[testNdx];
+ /** @type {tcuTestCase.DeqpTest} */ var group = indexTest.aligned ? bufferGroup : unalignedBufferGroup;
+
+ /** @type {string} */ var name = 'index_' + glsDrawTests.DrawTestSpec.indexTypeToString(indexTest.type);
+ /** @type {string} */ var desc = 'index ' + glsDrawTests.DrawTestSpec.indexTypeToString(indexTest.type) + ' in ' + glsDrawTests.DrawTestSpec.storageToString(indexTest.storage);
+ /** @type {glsDrawTests.DrawTest} */ var test = new glsDrawTests.DrawTest(null, name, desc);
+
+ spec.indexType = indexTest.type;
+ spec.indexStorage = indexTest.storage;
+
+ for (var iterationNdx = 0; iterationNdx < indexTest.offsets.length && indexTest.offsets[iterationNdx] != -1; ++iterationNdx) {
+ /** @type {string} */ var iterationDesc = 'offset ' + indexTest.offsets[iterationNdx];
+ spec.indexPointerOffset = indexTest.offsets[iterationNdx];
+ test.addIteration(spec, iterationDesc);
+ }
+
+ if (spec.isCompatibilityTest() != glsDrawTests.DrawTestSpec.CompatibilityTestType.UNALIGNED_OFFSET &&
+ spec.isCompatibilityTest() != glsDrawTests.DrawTestSpec.CompatibilityTestType.UNALIGNED_STRIDE)
+ group.addChild(test);
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} descr
+ * @param {?glsDrawTests.DrawTestSpec.DrawMethod} drawMethod
+ */
+ es3fDrawTests.FirstGroup = function(name, descr, drawMethod) {
+ tcuTestCase.DeqpTest.call(this, name, descr);
+ /** @type {?glsDrawTests.DrawTestSpec.DrawMethod} */ this.m_method = drawMethod;
+ this.makeExecutable();
+ };
+
+ es3fDrawTests.FirstGroup.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fDrawTests.FirstGroup.prototype.constructor = es3fDrawTests.FirstGroup;
+
+ /**
+ * init
+ */
+ es3fDrawTests.FirstGroup.prototype.init = function() {
+ var firsts =
+ [
+ 1, 3, 17
+ ];
+
+ /** @type {glsDrawTests.DrawTestSpec} */ var spec = new glsDrawTests.DrawTestSpec();
+ es3fDrawTests.genBasicSpec(spec, this.m_method);
+
+ for (var firstNdx = 0; firstNdx < firsts.length; ++firstNdx) {
+ var name = 'first_' + firsts[firstNdx];
+ var desc = 'first ' + firsts[firstNdx];
+ /** @type {glsDrawTests.DrawTest} */ var test = new glsDrawTests.DrawTest(null, name, desc);
+
+ spec.first = firsts[firstNdx];
+
+ es3fDrawTests.addTestIterations(test, spec, es3fDrawTests.TestIterationType.DRAW_COUNT);
+
+ this.addChild(test);
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} descr
+ * @param {?glsDrawTests.DrawTestSpec.DrawMethod} drawMethod
+ */
+ es3fDrawTests.MethodGroup = function(name, descr, drawMethod) {
+ tcuTestCase.DeqpTest.call(this, name, descr);
+ /** @type {?glsDrawTests.DrawTestSpec.DrawMethod} */ this.m_method = drawMethod;
+ this.makeExecutable();
+ };
+
+ es3fDrawTests.MethodGroup.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fDrawTests.MethodGroup.prototype.constructor = es3fDrawTests.MethodGroup;
+
+ /**
+ * init
+ */
+ es3fDrawTests.MethodGroup.prototype.init = function() {
+ var indexed = (this.m_method == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS) || (this.m_method == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_INSTANCED) || (this.m_method == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_RANGED);
+ var hasFirst = (this.m_method == glsDrawTests.DrawTestSpec.DrawMethod.DRAWARRAYS) || (this.m_method == glsDrawTests.DrawTestSpec.DrawMethod.DRAWARRAYS_INSTANCED);
+
+ var primitive =
+ [
+ glsDrawTests.DrawTestSpec.Primitive.POINTS,
+ glsDrawTests.DrawTestSpec.Primitive.TRIANGLES,
+ glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_FAN,
+ glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_STRIP,
+ glsDrawTests.DrawTestSpec.Primitive.LINES,
+ glsDrawTests.DrawTestSpec.Primitive.LINE_STRIP,
+ glsDrawTests.DrawTestSpec.Primitive.LINE_LOOP
+ ];
+
+ if (hasFirst) {
+ // First-tests
+ this.addChild(new es3fDrawTests.FirstGroup('first', 'First tests', this.m_method));
+ }
+
+ if (indexed) {
+ // Index-tests
+ if (this.m_method != glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_RANGED)
+ this.addChild(new es3fDrawTests.IndexGroup('indices', 'Index tests', this.m_method));
+ }
+
+ for (var ndx = 0; ndx < primitive.length; ++ndx) {
+ var name = glsDrawTests.DrawTestSpec.primitiveToString(primitive[ndx]);
+ var desc = glsDrawTests.DrawTestSpec.primitiveToString(primitive[ndx]);
+
+ this.addChild(new es3fDrawTests.AttributeGroup(name, desc, this.m_method, primitive[ndx], glsDrawTests.DrawTestSpec.IndexType.SHORT, glsDrawTests.DrawTestSpec.Storage.BUFFER));
+ }
+ };
+
+ /**
+ * es3fDrawTests.GridProgram
+ * @constructor
+ * @extends {sglrShaderProgram.ShaderProgram}
+ */
+ es3fDrawTests.GridProgram = function() {
+ /** @type {sglrShaderProgram.ShaderProgramDeclaration} */ var decl = new sglrShaderProgram.ShaderProgramDeclaration();
+
+ decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_position', rrGenericVector.GenericVecType.FLOAT));
+ decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_offset', rrGenericVector.GenericVecType.FLOAT));
+ decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_color', rrGenericVector.GenericVecType.FLOAT));
+
+ decl.pushVertexToFragmentVarying(new sglrShaderProgram.VertexToFragmentVarying(rrGenericVector.GenericVecType.FLOAT));
+ decl.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(rrGenericVector.GenericVecType.FLOAT));
+
+ decl.pushVertexSource(new sglrShaderProgram.VertexSource(
+ '#version 300 es\n' +
+ 'in highp vec4 a_position;\n' +
+ 'in highp vec4 a_offset;\n' +
+ 'in highp vec4 a_color;\n' +
+ 'out mediump vec4 v_color;\n' +
+ 'void main(void)\n' +
+ '{\n' +
+ ' gl_Position = a_position + a_offset;\n' +
+ ' v_color = a_color;\n' +
+ '}\n'
+ ));
+ decl.pushFragmentSource(new sglrShaderProgram.FragmentSource(
+ '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 dEQP_FragColor;\n' +
+ 'in mediump vec4 v_color;\n' +
+ 'void main(void)\n' +
+ '{\n' +
+ ' dEQP_FragColor = v_color;\n' +
+ '}\n'
+ ));
+
+ sglrShaderProgram.ShaderProgram.call(this, decl);
+ };
+
+ es3fDrawTests.GridProgram.prototype = Object.create(sglrShaderProgram.ShaderProgram.prototype);
+ es3fDrawTests.GridProgram.prototype.constructor = es3fDrawTests.GridProgram;
+
+ /**
+ * @param {Array<rrVertexAttrib.VertexAttrib>} inputs
+ * @param {Array<rrVertexPacket.VertexPacket>} packets
+ * @param {number} numPackets
+ */
+ es3fDrawTests.GridProgram.prototype.shadeVertices = function(inputs, packets, numPackets) {
+ for (var ndx = 0; ndx < numPackets; ++ndx) {
+ packets[ndx].position = deMath.add(
+ rrVertexAttrib.readVertexAttrib(inputs[0], packets[ndx].instanceNdx, packets[ndx].vertexNdx, rrGenericVector.GenericVecType.FLOAT),
+ rrVertexAttrib.readVertexAttrib(inputs[1], packets[ndx].instanceNdx, packets[ndx].vertexNdx, rrGenericVector.GenericVecType.FLOAT)
+ );
+ packets[ndx].outputs[0] = rrVertexAttrib.readVertexAttrib(inputs[2], packets[ndx].instanceNdx, packets[ndx].vertexNdx, rrGenericVector.GenericVecType.FLOAT);
+ }
+ };
+
+ /**
+ * @param {Array<rrFragmentOperations.Fragment>} packets
+ * @param {rrShadingContext.FragmentShadingContext} context
+ */
+ es3fDrawTests.GridProgram.prototype.shadeFragments = function(packets, context) {
+ for (var packetNdx = 0; packetNdx < packets.length; ++packetNdx)
+ for (var fragNdx = 0; fragNdx < 4; ++fragNdx)
+ packets[packetNdx].value = rrShadingContext.readTriangleVarying(packets[packetNdx], context, fragNdx);
+ };
+
+ /**
+ * InstancedGridRenderTest
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} gridSide
+ * @param {boolean} useIndices
+ */
+ es3fDrawTests.InstancedGridRenderTest = function(name, desc, gridSide, useIndices) {
+ tcuTestCase.DeqpTest.call(this, name, desc);
+ this.m_gridSide = gridSide;
+ this.m_useIndices = useIndices;
+ };
+
+ es3fDrawTests.InstancedGridRenderTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fDrawTests.InstancedGridRenderTest.prototype.constructor = es3fDrawTests.InstancedGridRenderTest;
+
+ /**
+ * iterate
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fDrawTests.InstancedGridRenderTest.prototype.iterate = function() {
+ var renderTargetWidth = Math.min(1024, gl.canvas.width);
+ var renderTargetHeight = Math.min(1024, gl.canvas.height);
+
+ /** @type {sglrGLContext.GLContext} */ var ctx = new sglrGLContext.GLContext(gl);
+ /** @type {tcuSurface.Surface} */ var surface = new tcuSurface.Surface(renderTargetWidth, renderTargetHeight);
+ /** @type {es3fDrawTests.GridProgram} */ var program = new es3fDrawTests.GridProgram();
+
+ // render
+
+ this.renderTo(ctx, program, surface);
+
+ // verify image
+
+ if (this.verifyImage(surface))
+ testPassed('');
+ else
+ testFailed('Incorrect rendering result');
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @param {sglrGLContext.GLContext} ctx
+ * @param {sglrShaderProgram.ShaderProgram} program
+ * @param {tcuSurface.Surface} dst
+ */
+ es3fDrawTests.InstancedGridRenderTest.prototype.renderTo = function(ctx, program, dst) {
+ var green = [0, 1, 0, 1];
+ var yellow = [1, 1, 0, 1];
+
+ /** @type {WebGLBuffer} */ var positionBuf = null;
+ /** @type {WebGLBuffer} */ var offsetBuf = null;
+ /** @type {WebGLBuffer} */ var colorBuf = null;
+ /** @type {WebGLBuffer} */ var indexBuf = null;
+ /** @type {WebGLProgram} */ var programID = ctx.createProgram(program);
+ /** @type {number} */ var posLocation = ctx.getAttribLocation(/** @type {WebGLProgram} */ (programID), 'a_position');
+ /** @type {number} */ var offsetLocation = ctx.getAttribLocation(/** @type {WebGLProgram} */ (programID), 'a_offset');
+ /** @type {number} */ var colorLocation = ctx.getAttribLocation(/** @type {WebGLProgram} */ (programID), 'a_color');
+
+ var cellW = 2.0 / this.m_gridSide;
+ var cellH = 2.0 / this.m_gridSide;
+ var vertexPositions = new Float32Array([
+ 0, 0, 0, 1,
+ cellW, 0, 0, 1,
+ 0, cellH, 0, 1,
+
+ 0, cellH, 0, 1,
+ cellW, 0, 0, 1,
+ cellW, cellH, 0, 1
+ ]);
+
+ var indices = new Uint16Array([
+ 0, 4, 3,
+ 2, 1, 5
+ ]);
+
+ var offsets = [];
+ for (var x = 0; x < this.m_gridSide; ++x)
+ for (var y = 0; y < this.m_gridSide; ++y) {
+ offsets.push(x * cellW - 1.0);
+ offsets.push(y * cellW - 1.0);
+ offsets.push(0, 0);
+ }
+ offsets = new Float32Array(offsets);
+
+ var colors = [];
+ for (var x = 0; x < this.m_gridSide; ++x)
+ for (var y = 0; y < this.m_gridSide; ++y) {
+ var colorToPush = ((x + y) % 2 == 0) ? (green) : (yellow);
+ colors.push(colorToPush[0]);
+ colors.push(colorToPush[1]);
+ colors.push(colorToPush[2]);
+ colors.push(colorToPush[3]);
+ }
+ colors = new Float32Array(colors);
+
+ positionBuf = ctx.createBuffer();
+ ctx.bindBuffer(gl.ARRAY_BUFFER, positionBuf);
+ ctx.bufferData(gl.ARRAY_BUFFER, vertexPositions, gl.STATIC_DRAW);
+ ctx.vertexAttribPointer(posLocation, 4, gl.FLOAT, false, 0, 0);
+ ctx.vertexAttribDivisor(posLocation, 0);
+ ctx.enableVertexAttribArray(posLocation);
+
+ offsetBuf = ctx.createBuffer();
+ ctx.bindBuffer(gl.ARRAY_BUFFER, offsetBuf);
+ ctx.bufferData(gl.ARRAY_BUFFER, offsets, gl.STATIC_DRAW);
+ ctx.vertexAttribPointer(offsetLocation, 4, gl.FLOAT, false, 0, 0);
+ ctx.vertexAttribDivisor(offsetLocation, 1);
+ ctx.enableVertexAttribArray(offsetLocation);
+
+ colorBuf = ctx.createBuffer();
+ ctx.bindBuffer(gl.ARRAY_BUFFER, colorBuf);
+ ctx.bufferData(gl.ARRAY_BUFFER, colors, gl.STATIC_DRAW);
+ ctx.vertexAttribPointer(colorLocation, 4, gl.FLOAT, false, 0, 0);
+ ctx.vertexAttribDivisor(colorLocation, 1);
+ ctx.enableVertexAttribArray(colorLocation);
+
+ if (this.m_useIndices) {
+ indexBuf = ctx.createBuffer();
+ ctx.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuf);
+ ctx.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW);
+ }
+
+ ctx.clearColor(0, 0, 0, 1);
+ ctx.clear(gl.COLOR_BUFFER_BIT);
+
+ ctx.viewport(0, 0, dst.getWidth(), dst.getHeight());
+
+ ctx.useProgram(programID);
+ if (this.m_useIndices)
+ ctx.drawElementsInstanced(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0, this.m_gridSide * this.m_gridSide);
+ else
+ ctx.drawArraysInstanced(gl.TRIANGLES, 0, 6, this.m_gridSide * this.m_gridSide);
+ ctx.useProgram(null);
+
+ if (this.m_useIndices)
+ ctx.deleteBuffer(indexBuf);
+ ctx.deleteBuffer(colorBuf);
+ ctx.deleteBuffer(offsetBuf);
+ ctx.deleteBuffer(positionBuf);
+ ctx.deleteProgram(programID);
+
+ ctx.finish();
+ dst.readViewport(ctx, [0 , 0, dst.getWidth(), dst.getHeight()]);
+ };
+
+ /**
+ * @param {tcuSurface.Surface} image
+ * @return {boolean}
+ */
+ es3fDrawTests.InstancedGridRenderTest.prototype.verifyImage = function(image) {
+ // \note the green/yellow pattern is only for clarity. The test will only verify that all instances were drawn by looking for anything non-green/yellow.
+
+ var green = [0, 255, 0, 255];
+ var yellow = [255, 255, 0, 255];
+ var colorThreshold = 20;
+
+ /** @type {tcuSurface.Surface} */ var error = new tcuSurface.Surface(image.getWidth(), image.getHeight());
+ var isOk = true;
+
+ for (var y = 1; y < image.getHeight() - 1; y++)
+ for (var x = 1; x < image.getWidth() - 1; x++) {
+ /** @type {tcuRGBA.RGBA} */ var pixel = new tcuRGBA.RGBA(image.getPixel(x, y));
+ var pixelOk = true;
+
+ // Any pixel with !(G ~= 255) is faulty (not a linear combinations of green and yellow)
+ if (Math.abs(pixel.getGreen() - 255) > colorThreshold)
+ pixelOk = false;
+
+ // Any pixel with !(B ~= 0) is faulty (not a linear combinations of green and yellow)
+ if (Math.abs(pixel.getBlue() - 0) > colorThreshold)
+ pixelOk = false;
+
+ error.setPixel(x, y, pixelOk ? [0, 255, 0, 255] : [255, 0, 0, 255]);
+ isOk = isOk && pixelOk;
+ }
+
+ if (!isOk) {
+ bufferedLogToConsole('Image verification failed.');
+ debug('Verfication result');
+ tcuLogImage.logImageWithInfo(image.getAccess(), 'Result');
+ tcuLogImage.logImageWithInfo(error.getAccess(), 'Error mask');
+ } else {
+ debug('Verfication result');
+ }
+
+ return isOk;
+ };
+
+ /**
+ * InstancingGroup
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fDrawTests.InstancingGroup = function(name, descr) {
+ tcuTestCase.DeqpTest.call(this, name, descr);
+ this.makeExecutable();
+ };
+
+ es3fDrawTests.InstancingGroup.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fDrawTests.InstancingGroup.prototype.constructor = es3fDrawTests.InstancingGroup;
+
+ /**
+ * init
+ */
+ es3fDrawTests.InstancingGroup.prototype.init = function() {
+ var gridWidths = [
+ 2,
+ 5,
+ 10,
+ 32,
+ 100
+ ];
+
+ // drawArrays
+ for (var ndx = 0; ndx < gridWidths.length; ++ndx) {
+ var name = 'draw_arrays_instanced_grid_' + gridWidths[ndx] + 'x' + gridWidths[ndx];
+ var desc = 'DrawArraysInstanced, Grid size ' + gridWidths[ndx] + 'x' + gridWidths[ndx];
+
+ this.addChild(new es3fDrawTests.InstancedGridRenderTest(name, desc, gridWidths[ndx], false));
+ }
+
+ // drawElements
+ for (var ndx = 0; ndx < gridWidths.length; ++ndx) {
+ var name = 'draw_elements_instanced_grid_' + gridWidths[ndx] + 'x' + gridWidths[ndx];
+ var desc = 'DrawElementsInstanced, Grid size ' + gridWidths[ndx] + 'x' + gridWidths[ndx];
+
+ this.addChild(new es3fDrawTests.InstancedGridRenderTest(name, desc, gridWidths[ndx], true));
+ }
+ };
+
+ /**
+ * @constructor
+ * @param {number} size
+ */
+ es3fDrawTests.UniformWeightArray = function(size) {
+ this.weights = [];
+
+ for (var i = 0; i < size; ++i)
+ this.weights[i] = 1.0;
+ };
+
+ /**
+ * RandomGroup
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} descr
+ */
+ es3fDrawTests.RandomGroup = function(name, descr) {
+ tcuTestCase.DeqpTest.call(this, name, descr);
+ this.makeExecutable();
+ };
+
+ es3fDrawTests.RandomGroup.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fDrawTests.RandomGroup.prototype.constructor = es3fDrawTests.RandomGroup;
+
+ /**
+ * init
+ */
+ es3fDrawTests.RandomGroup.prototype.init = function() {
+ /** @type {number} */ var numAttempts = 300;
+
+ /** @type {Array<number>} */ var attribCounts = [1, 2, 5];
+ /** @type {Array<number>} */ var attribWeights = [30, 10, 1];
+ /** @type {Array<number>} */ var primitiveCounts = [2, 6, 64];
+ /** @type {Array<number>} */ var primitiveCountWeights = [20, 10, 1];
+ /** @type {Array<number>} */ var indexOffsets = [0, 7, 13];
+ /** @type {Array<number>} */ var indexOffsetWeights = [20, 20, 1];
+ /** @type {Array<number>} */ var firsts = [0, 6, 12];
+ /** @type {Array<number>} */ var firstWeights = [20, 20, 1];
+ /** @type {Array<number>} */ var instanceCounts = [1, 2, 16, 17];
+ /** @type {Array<number>} */ var instanceWeights = [20, 10, 5, 1];
+ /** @type {Array<number>} */ var indexMins = [0, 1, 3, 9];
+ /** @type {Array<number>} */ var indexMaxs = [5, 9, 129, 257];
+ /** @type {Array<number>} */ var indexWeights = [50, 50, 50, 50];
+ /** @type {Array<number>} */ var offsets = [0, 1, 5, 12];
+ /** @type {Array<number>} */ var offsetWeights = [50, 10, 10, 10];
+ /** @type {Array<number>} */ var strides = [0, 7, 16, 17];
+ /** @type {Array<number>} */ var strideWeights = [50, 10, 10, 10];
+ /** @type {Array<number>} */ var instanceDivisors = [0, 1, 3, 129];
+ /** @type {Array<number>} */ var instanceDivisorWeights = [70, 30, 10, 10];
+
+ /** @type {Array<glsDrawTests.DrawTestSpec.Primitive>} */ var primitives = [
+ glsDrawTests.DrawTestSpec.Primitive.POINTS,
+ glsDrawTests.DrawTestSpec.Primitive.TRIANGLES,
+ glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_FAN,
+ glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_STRIP,
+ glsDrawTests.DrawTestSpec.Primitive.LINES,
+ glsDrawTests.DrawTestSpec.Primitive.LINE_STRIP,
+ glsDrawTests.DrawTestSpec.Primitive.LINE_LOOP
+ ];
+ /** @type {es3fDrawTests.UniformWeightArray} */ var primitiveWeights = new es3fDrawTests.UniformWeightArray(primitives.length);
+
+ /** @type {Array<glsDrawTests.DrawTestSpec.DrawMethod>} */ var drawMethods = [
+ glsDrawTests.DrawTestSpec.DrawMethod.DRAWARRAYS,
+ glsDrawTests.DrawTestSpec.DrawMethod.DRAWARRAYS_INSTANCED,
+ glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS,
+ glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_RANGED,
+ glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_INSTANCED
+ ];
+ /** @type {es3fDrawTests.UniformWeightArray} */ var drawMethodWeights = new es3fDrawTests.UniformWeightArray(drawMethods.length);
+
+ /** @type {Array<glsDrawTests.DrawTestSpec.IndexType>} */ var indexTypes = [
+ glsDrawTests.DrawTestSpec.IndexType.BYTE,
+ glsDrawTests.DrawTestSpec.IndexType.SHORT,
+ glsDrawTests.DrawTestSpec.IndexType.INT
+ ];
+ /** @type {es3fDrawTests.UniformWeightArray} */ var indexTypeWeights = new es3fDrawTests.UniformWeightArray(indexTypes.length);
+
+ /** @type {Array<glsDrawTests.DrawTestSpec.Storage>} */ var storages = [
+ //glsDrawTests.DrawTestSpec.Storage.USER,
+ glsDrawTests.DrawTestSpec.Storage.BUFFER
+ ];
+ /** @type {es3fDrawTests.UniformWeightArray} */ var storageWeights = new es3fDrawTests.UniformWeightArray(storages.length);
+
+ /** @type {Array<glsDrawTests.DrawTestSpec.InputType>} */ var inputTypes = [
+ glsDrawTests.DrawTestSpec.InputType.FLOAT,
+ //glsDrawTests.DrawTestSpec.InputType.FIXED,
+ glsDrawTests.DrawTestSpec.InputType.BYTE,
+ glsDrawTests.DrawTestSpec.InputType.SHORT,
+ glsDrawTests.DrawTestSpec.InputType.UNSIGNED_BYTE,
+ glsDrawTests.DrawTestSpec.InputType.UNSIGNED_SHORT,
+ glsDrawTests.DrawTestSpec.InputType.INT,
+ glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT,
+ glsDrawTests.DrawTestSpec.InputType.HALF,
+ glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT_2_10_10_10,
+ glsDrawTests.DrawTestSpec.InputType.INT_2_10_10_10
+ ];
+ /** @type {es3fDrawTests.UniformWeightArray} */ var inputTypeWeights = new es3fDrawTests.UniformWeightArray(inputTypes.length);
+
+ /** @type {Array<glsDrawTests.DrawTestSpec.OutputType>} */ var outputTypes = [
+ glsDrawTests.DrawTestSpec.OutputType.FLOAT,
+ glsDrawTests.DrawTestSpec.OutputType.VEC2,
+ glsDrawTests.DrawTestSpec.OutputType.VEC3,
+ glsDrawTests.DrawTestSpec.OutputType.VEC4,
+ glsDrawTests.DrawTestSpec.OutputType.INT,
+ glsDrawTests.DrawTestSpec.OutputType.UINT,
+ glsDrawTests.DrawTestSpec.OutputType.IVEC2,
+ glsDrawTests.DrawTestSpec.OutputType.IVEC3,
+ glsDrawTests.DrawTestSpec.OutputType.IVEC4,
+ glsDrawTests.DrawTestSpec.OutputType.UVEC2,
+ glsDrawTests.DrawTestSpec.OutputType.UVEC3,
+ glsDrawTests.DrawTestSpec.OutputType.UVEC4
+ ];
+ /** @type {es3fDrawTests.UniformWeightArray} */ var outputTypeWeights = new es3fDrawTests.UniformWeightArray(outputTypes.length);
+
+ /** @type {Array<glsDrawTests.DrawTestSpec.Usage>} */ var usages = [
+ glsDrawTests.DrawTestSpec.Usage.DYNAMIC_DRAW,
+ glsDrawTests.DrawTestSpec.Usage.STATIC_DRAW,
+ glsDrawTests.DrawTestSpec.Usage.STREAM_DRAW,
+ glsDrawTests.DrawTestSpec.Usage.STREAM_READ,
+ glsDrawTests.DrawTestSpec.Usage.STREAM_COPY,
+ glsDrawTests.DrawTestSpec.Usage.STATIC_READ,
+ glsDrawTests.DrawTestSpec.Usage.STATIC_COPY,
+ glsDrawTests.DrawTestSpec.Usage.DYNAMIC_READ,
+ glsDrawTests.DrawTestSpec.Usage.DYNAMIC_COPY
+ ];
+ /** @type {es3fDrawTests.UniformWeightArray} */ var usageWeights = new es3fDrawTests.UniformWeightArray(usages.length);
+
+ /** @type {Array<number>} */ var insertedHashes = []; //'set' structure
+ /** @type {number} */ var insertedCount = 0;
+
+ for (var ndx = 0; ndx < numAttempts; ++ndx) {
+ /** @type {deRandom.Random} */ var random = new deRandom.Random(0xc551393 + ndx); // random does not depend on previous cases
+
+ /** @type {number} */ var attributeCount = random.chooseWeighted(attribCounts, attribWeights);
+ /** @type {glsDrawTests.DrawTestSpec} */ var spec = new glsDrawTests.DrawTestSpec();
+
+ //spec.apiType = glu::ApiType::es(3,0);
+ spec.primitive = /** @type {glsDrawTests.DrawTestSpec.Primitive} */ (random.chooseWeighted(primitives, primitiveWeights.weights));
+ spec.primitiveCount = random.chooseWeighted(primitiveCounts, primitiveCountWeights);
+ spec.drawMethod = /** @type {glsDrawTests.DrawTestSpec.DrawMethod} */ (random.chooseWeighted(drawMethods, drawMethodWeights.weights));
+ spec.indexType = /** @type {glsDrawTests.DrawTestSpec.IndexType} */ (random.chooseWeighted(indexTypes, indexTypeWeights.weights));
+ spec.indexPointerOffset = random.chooseWeighted(indexOffsets, indexOffsetWeights);
+ spec.indexStorage = /** @type {glsDrawTests.DrawTestSpec.Storage} */ (random.chooseWeighted(storages, storageWeights.weights));
+ spec.first = random.chooseWeighted(firsts, firstWeights);
+ spec.indexMin = random.chooseWeighted(indexMins, indexWeights);
+ spec.indexMax = random.chooseWeighted(indexMaxs, indexWeights);
+ spec.instanceCount = random.chooseWeighted(instanceCounts, instanceWeights);
+
+ // check spec is legal
+ if (!spec.valid())
+ continue;
+
+ var hasZeroDivisor = false;
+ for (var attrNdx = 0; attrNdx < attributeCount;) {
+ /** @type {boolean} */ var valid;
+ /** @type {glsDrawTests.DrawTestSpec.AttributeSpec} */ var attribSpec = new glsDrawTests.DrawTestSpec.AttributeSpec();
+
+ attribSpec.inputType = /** @type {glsDrawTests.DrawTestSpec.InputType} */ (random.chooseWeighted(inputTypes, inputTypeWeights.weights));
+ attribSpec.outputType = /** @type {glsDrawTests.DrawTestSpec.OutputType} */ (random.chooseWeighted(outputTypes, outputTypeWeights.weights));
+ attribSpec.storage = /** @type {glsDrawTests.DrawTestSpec.Storage} */ (random.chooseWeighted(storages, storageWeights.weights));
+ attribSpec.usage = /** @type {glsDrawTests.DrawTestSpec.Usage} */ (random.chooseWeighted(usages, usageWeights.weights));
+ attribSpec.componentCount = random.getInt(1, 4);
+ attribSpec.offset = random.chooseWeighted(offsets, offsetWeights);
+ attribSpec.stride = random.chooseWeighted(strides, strideWeights);
+ attribSpec.normalize = random.getBool();
+ attribSpec.instanceDivisor = random.chooseWeighted(instanceDivisors, instanceDivisorWeights);
+ attribSpec.useDefaultAttribute = random.getBool();
+
+ // check spec is legal
+ valid = attribSpec.valid(/*spec.apiType*/);
+
+ // we do not want interleaved elements. (Might result in some weird floating point values)
+ if (attribSpec.stride && attribSpec.componentCount * glsDrawTests.DrawTestSpec.inputTypeSize(attribSpec.inputType) > attribSpec.stride)
+ valid = false;
+
+ // try again if not valid
+ if (valid) {
+ spec.attribs.push(attribSpec);
+ ++attrNdx;
+ if (attribSpec.instanceDivisor == 0)
+ hasZeroDivisor = true;
+ }
+ }
+
+ // Do not collapse all vertex positions to a single positions
+ if (spec.primitive != glsDrawTests.DrawTestSpec.Primitive.POINTS) {
+ spec.attribs[0].instanceDivisor = 0;
+ hasZeroDivisor = true;
+ }
+
+ // There should be at least one enabled vertex attribute array that has a divisor of zero in WebGL.
+ // This limitation is added to keep compatible with D3D. It differs from the feature in gles.
+ // See the section <Enabled Attribute> in WebGL spec: https://www.khronos.org/registry/webgl/specs/latest/2.0/#5.6
+ if (hasZeroDivisor == false)
+ continue;
+
+ // Is render result meaningful?
+ // Only one vertex
+ if (spec.drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_RANGED && spec.indexMin == spec.indexMax && spec.primitive != glsDrawTests.DrawTestSpec.Primitive.POINTS)
+ continue;
+ if (spec.attribs[0].useDefaultAttribute && spec.primitive != glsDrawTests.DrawTestSpec.Primitive.POINTS)
+ continue;
+
+ // Triangle only on one axis
+ if (spec.primitive == glsDrawTests.DrawTestSpec.Primitive.TRIANGLES || spec.primitive == glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_FAN || spec.primitive == glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_STRIP) {
+ if (spec.attribs[0].componentCount == 1)
+ continue;
+ if (spec.attribs[0].outputType == glsDrawTests.DrawTestSpec.OutputType.FLOAT || spec.attribs[0].outputType == glsDrawTests.DrawTestSpec.OutputType.INT || spec.attribs[0].outputType == glsDrawTests.DrawTestSpec.OutputType.UINT)
+ continue;
+ if (spec.drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_RANGED && (spec.indexMax - spec.indexMin) < 2)
+ continue;
+ }
+
+ // Add case
+ /** @type {number} */ var hash = spec.hash();
+ for (var attrNdx = 0; attrNdx < attributeCount; ++attrNdx)
+ hash = deMath.binaryOp(deMath.shiftLeft(hash, 2), spec.attribs[attrNdx].hash(), deMath.BinaryOp.XOR);
+
+ if (insertedHashes.indexOf(hash) == -1) {
+ // Only properly aligned
+ if (spec.isCompatibilityTest() != glsDrawTests.DrawTestSpec.CompatibilityTestType.UNALIGNED_OFFSET &&
+ spec.isCompatibilityTest() != glsDrawTests.DrawTestSpec.CompatibilityTestType.UNALIGNED_STRIDE) {
+ this.addChild(new glsDrawTests.DrawTest(spec, insertedCount + '', spec.getDesc()));
+ }
+ deUtil.dePushUniqueToArray(insertedHashes, hash);
+
+ ++insertedCount;
+ }
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fDrawTests.DrawTest = function() {
+ tcuTestCase.DeqpTest.call(this, 'draw', 'Drawing tests');
+ this.makeExecutable();
+ };
+
+ es3fDrawTests.DrawTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fDrawTests.DrawTest.prototype.constructor = es3fDrawTests.DrawTest;
+
+ /**
+ * init
+ */
+ es3fDrawTests.DrawTest.prototype.init = function() {
+ // Basic
+ /** @type {Array<glsDrawTests.DrawTestSpec.DrawMethod>} */ var basicMethods = [
+ glsDrawTests.DrawTestSpec.DrawMethod.DRAWARRAYS,
+ glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS,
+ glsDrawTests.DrawTestSpec.DrawMethod.DRAWARRAYS_INSTANCED,
+ glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_INSTANCED,
+ glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_RANGED
+ ];
+
+ for (var ndx = 0; ndx < basicMethods.length; ++ndx) {
+ var name = glsDrawTests.DrawTestSpec.drawMethodToString(basicMethods[ndx]);
+ var desc = glsDrawTests.DrawTestSpec.drawMethodToString(basicMethods[ndx]);
+
+ this.addChild(new es3fDrawTests.MethodGroup(name, desc, basicMethods[ndx]));
+ }
+
+ // extreme instancing
+
+ this.addChild(new es3fDrawTests.InstancingGroup('instancing', 'draw tests with a large instance count.'));
+
+ // Random
+
+ this.addChild(new es3fDrawTests.RandomGroup('random', 'random draw commands.'));
+ };
+
+ /**
+ * Create and execute the test cases
+ * @param {WebGL2RenderingContext} context
+ */
+ es3fDrawTests.run = function(context, range) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+
+ var rootTest = new es3fDrawTests.DrawTest();
+ state.setRoot(rootTest);
+
+ //Set up name and description of this test series.
+ setCurrentTestName(rootTest.fullName());
+ description(rootTest.getDescription());
+
+ try {
+ if (range) {
+ state.setRange(range);
+ }
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to run draw tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboColorbufferTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboColorbufferTests.js
new file mode 100644
index 0000000000..deb692a7b6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboColorbufferTests.js
@@ -0,0 +1,1049 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fFboColorbufferTests');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.opengl.gluTextureUtil');
+goog.require('functional.gles3.es3fFboTestCase');
+goog.require('functional.gles3.es3fFboTestUtil');
+goog.require('framework.common.tcuRGBA');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.referencerenderer.rrUtil');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.opengl.gluShaderUtil');
+
+goog.scope(function() {
+var es3fFboColorbufferTests = functional.gles3.es3fFboColorbufferTests;
+var es3fFboTestCase = functional.gles3.es3fFboTestCase;
+var es3fFboTestUtil = functional.gles3.es3fFboTestUtil;
+var tcuTestCase = framework.common.tcuTestCase;
+var tcuSurface = framework.common.tcuSurface;
+var tcuTexture = framework.common.tcuTexture;
+var gluTextureUtil = framework.opengl.gluTextureUtil;
+var tcuRGBA = framework.common.tcuRGBA;
+var deRandom = framework.delibs.debase.deRandom;
+var tcuImageCompare = framework.common.tcuImageCompare;
+var tcuTextureUtil = framework.common.tcuTextureUtil;
+var rrUtil = framework.referencerenderer.rrUtil;
+var deMath = framework.delibs.debase.deMath;
+var gluShaderUtil = framework.opengl.gluShaderUtil;
+
+/** @type {WebGL2RenderingContext} */ var gl;
+
+/** @const*/ var MIN_THRESHOLD = new tcuRGBA.RGBA([12, 12, 12, 12]);
+
+let canvasWH = 256;
+let texPotSize = [128, 128, 5];
+let texNpotSizeA = [129, 117];
+let texNpotSizeB = [99, 128];
+if (tcuTestCase.isQuickMode()) {
+ canvasWH = 32;
+ texPotSize = [16, 16, 5];
+ texNpotSizeA = [12, 11];
+ texNpotSizeB = [9, 16];
+}
+const texW = texPotSize[0];
+const texH = texPotSize[1];
+
+var setParentClass = function(child, parent) {
+ child.prototype = Object.create(parent.prototype);
+ child.prototype.constructor = child;
+};
+
+/**
+ * @param {deRandom.Random} rnd
+ * @param {Array<number>} minVal
+ * @param {Array<number>} maxVal
+ * @return {Array<number>}
+ */
+es3fFboColorbufferTests.randomVector = function(rnd, minVal, maxVal) {
+ var res = [];
+ for (var ndx = 0; ndx < minVal.length; ndx++)
+ res[ndx] = rnd.getFloat(minVal[ndx], maxVal[ndx]);
+ return res;
+};
+
+/**
+ * @param {deRandom.Random} rnd
+ * @return {Array<number>}
+ */
+es3fFboColorbufferTests.generateRandomColor = function(rnd) {
+ var retVal = [];
+
+ for (var i = 0; i < 3; ++i)
+ retVal[i] = rnd.getFloat();
+ retVal[3] = 1;
+
+ return retVal;
+};
+
+/**
+ * @constructor
+ * @extends {es3fFboTestCase.FboTestCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} format
+ */
+es3fFboColorbufferTests.FboColorbufferCase = function(name, desc, format) {
+ es3fFboTestCase.FboTestCase.call(this, name, desc);
+ this.m_format = format;
+};
+
+setParentClass(es3fFboColorbufferTests.FboColorbufferCase, es3fFboTestCase.FboTestCase);
+
+/**
+ * @param {tcuSurface.Surface} reference
+ * @param {tcuSurface.Surface} result
+ * @return {boolean}
+ */
+es3fFboColorbufferTests.FboColorbufferCase.prototype.compare = function(reference, result) {
+ /** @type {tcuRGBA.RGBA} */ var threshold = tcuRGBA.max(es3fFboTestUtil.getFormatThreshold(this.m_format), MIN_THRESHOLD);
+
+ bufferedLogToConsole('Comparing images, threshold: ' + threshold);
+
+ return tcuImageCompare.bilinearCompare('Result', 'Image comparison result', reference.getAccess(), result.getAccess(), threshold);
+ };
+
+/**
+ * Deinit. Clear some GL state variables
+ */
+es3fFboColorbufferTests.FboColorbufferCase.prototype.deinit = function() {
+ // Texture state
+ {
+ // Only TEXTURE0 and TEXTURE1 are used in this test
+ var numTexUnits = 2;
+
+ for (var ndx = 0; ndx < numTexUnits; ndx++) {
+ gl.activeTexture(gl.TEXTURE0 + ndx);
+
+ // Reset 2D texture
+ gl.bindTexture(gl.TEXTURE_2D, null);
+
+ // Reset cube map texture
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, null);
+
+ // Reset 2D array texture
+ gl.bindTexture(gl.TEXTURE_2D_ARRAY, null);
+
+ // Reset 3D texture
+ gl.bindTexture(gl.TEXTURE_3D, null);
+ }
+
+ gl.activeTexture(gl.TEXTURE0);
+ }
+
+ // Pixel operations
+ {
+ gl.disable(gl.SCISSOR_TEST);
+ gl.disable(gl.BLEND);
+ }
+
+ // Framebuffer control
+ {
+ gl.clearColor(0.0, 0.0, 0.0, 0.0);
+ }
+ };
+
+/**
+ * @constructor
+ * @extends {es3fFboColorbufferTests.FboColorbufferCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} format
+ * @param {number} width
+ * @param {number} height
+ */
+es3fFboColorbufferTests.FboColorClearCase = function(name, desc, format, width, height) {
+ es3fFboColorbufferTests.FboColorbufferCase.call(this, name, desc, format);
+ this.m_width = width;
+ this.m_height = height;
+};
+
+setParentClass(es3fFboColorbufferTests.FboColorClearCase, es3fFboColorbufferTests.FboColorbufferCase);
+
+es3fFboColorbufferTests.FboColorClearCase.prototype.preCheck = function() {
+ this.checkFormatSupport(this.m_format);
+ return true; // No exception thrown
+ };
+
+es3fFboColorbufferTests.FboColorClearCase.prototype.render = function(dst) {
+ var ctx = this.getCurrentContext();
+ var fboFormat = gluTextureUtil.mapGLInternalFormat(this.m_format);
+ var fmtClass = tcuTexture.getTextureChannelClass(fboFormat.type);
+ var fmtInfo = tcuTextureUtil.getTextureFormatInfo(fboFormat);
+ var rnd = new deRandom.Random(17);
+ var numClears = 16;
+
+ var fbo = ctx.createFramebuffer();
+ var rbo = ctx.createRenderbuffer();
+
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, rbo);
+ ctx.renderbufferStorage(gl.RENDERBUFFER, this.m_format, this.m_width, this.m_height);
+ this.checkError();
+
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo);
+ this.checkError();
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ ctx.viewport(0, 0, this.m_width, this.m_height);
+
+ // Initialize to transparent black.
+ switch (fmtClass) {
+ case tcuTexture.TextureChannelClass.FLOATING_POINT:
+ case tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT:
+ case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT:
+ ctx.clearBufferfv(gl.COLOR, 0, new Float32Array(4));
+ break;
+
+ case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER:
+ ctx.clearBufferuiv(gl.COLOR, 0, new Uint32Array(4));
+ break;
+
+ case tcuTexture.TextureChannelClass.SIGNED_INTEGER:
+ ctx.clearBufferiv(gl.COLOR, 0, new Int32Array(4));
+ break;
+
+ default:
+ throw new Error('Invalid channelclass ' + fmtClass);
+ }
+
+ // Do random scissored clears.
+ ctx.enable(gl.SCISSOR_TEST);
+ for (var ndx = 0; ndx < numClears; ndx++) {
+ var x = rnd.getInt(0, this.m_width - 1);
+ var y = rnd.getInt(0, this.m_height - 1);
+ var w = rnd.getInt(1, this.m_width - x);
+ var h = rnd.getInt(1, this.m_height - y);
+ var color = es3fFboColorbufferTests.randomVector(rnd, fmtInfo.valueMin, fmtInfo.valueMax);
+
+ ctx.scissor(x, y, w, h);
+
+ switch (fmtClass) {
+ case tcuTexture.TextureChannelClass.FLOATING_POINT:
+ case tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT:
+ case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT:
+ ctx.clearBufferfv(gl.COLOR, 0, color);
+ break;
+
+ case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER:
+ ctx.clearBufferuiv(gl.COLOR, 0, color);
+ break;
+
+ case tcuTexture.TextureChannelClass.SIGNED_INTEGER:
+ ctx.clearBufferiv(gl.COLOR, 0, color);
+ break;
+
+ default:
+ throw new Error('Invalid channelclass ' + fmtClass);
+ }
+ }
+
+ // Read results from renderbuffer.
+ this.readPixelsUsingFormat(dst, 0, 0, this.m_width, this.m_height, fboFormat, fmtInfo.lookupScale, fmtInfo.lookupBias);
+ this.checkError();
+ };
+
+/**
+ * @constructor
+ * @extends {es3fFboColorbufferTests.FboColorbufferCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} tex0Fmt
+ * @param {Array<number>} tex0Size
+ * @param {number} tex1Fmt
+ * @param {Array<number>} tex1Size
+ */
+es3fFboColorbufferTests.FboColorMultiTex2DCase = function(name, desc, tex0Fmt, tex0Size, tex1Fmt, tex1Size) {
+ es3fFboColorbufferTests.FboColorbufferCase.call(this, name, desc, tex0Fmt);
+ this.m_tex0Fmt = tex0Fmt;
+ this.m_tex0Size = tex0Size;
+ this.m_tex1Fmt = tex1Fmt;
+ this.m_tex1Size = tex1Size;
+};
+
+setParentClass(es3fFboColorbufferTests.FboColorMultiTex2DCase, es3fFboColorbufferTests.FboColorbufferCase);
+
+es3fFboColorbufferTests.FboColorMultiTex2DCase.prototype.preCheck = function() {
+ this.checkFormatSupport(this.m_tex0Fmt);
+ this.checkFormatSupport(this.m_tex1Fmt);
+ return true; // No exception thrown
+ };
+
+es3fFboColorbufferTests.FboColorMultiTex2DCase.prototype.render = function(dst) {
+ var ctx = this.getCurrentContext();
+ var texFmt0 = gluTextureUtil.mapGLInternalFormat(this.m_tex0Fmt);
+ var texFmt1 = gluTextureUtil.mapGLInternalFormat(this.m_tex1Fmt);
+ var fmtInfo0 = tcuTextureUtil.getTextureFormatInfo(texFmt0);
+ var fmtInfo1 = tcuTextureUtil.getTextureFormatInfo(texFmt1);
+
+ /** @type {es3fFboTestUtil.Texture2DShader} */
+ var texToFbo0Shader = new es3fFboTestUtil.Texture2DShader(
+ [gluShaderUtil.DataType.SAMPLER_2D], es3fFboTestUtil.getFragmentOutputType(texFmt0),
+ deMath.subtract(fmtInfo0.valueMax, fmtInfo0.valueMin),
+ fmtInfo0.valueMin);
+
+ /** @type {es3fFboTestUtil.Texture2DShader} */
+ var texToFbo1Shader = new es3fFboTestUtil.Texture2DShader(
+ [gluShaderUtil.DataType.SAMPLER_2D], es3fFboTestUtil.getFragmentOutputType(texFmt1),
+ deMath.subtract(fmtInfo1.valueMax, fmtInfo1.valueMin),
+ fmtInfo1.valueMin);
+
+ /** @type {es3fFboTestUtil.Texture2DShader} */
+ var multiTexShader = new es3fFboTestUtil.Texture2DShader(
+ [gluTextureUtil.getSampler2DType(texFmt0), gluTextureUtil.getSampler2DType(texFmt1)],
+ gluShaderUtil.DataType.FLOAT_VEC4);
+
+ var texToFbo0ShaderID = ctx.createProgram(texToFbo0Shader);
+ var texToFbo1ShaderID = ctx.createProgram(texToFbo1Shader);
+ var multiTexShaderID = ctx.createProgram(multiTexShader);
+
+ // Setup shaders
+ multiTexShader.setTexScaleBias(0, deMath.scale(fmtInfo0.lookupScale, 0.5), deMath.scale(fmtInfo0.lookupBias, 0.5));
+ multiTexShader.setTexScaleBias(1, deMath.scale(fmtInfo1.lookupScale, 0.5), deMath.scale(fmtInfo1.lookupBias, 0.5));
+ texToFbo0Shader.setUniforms(ctx, texToFbo0ShaderID);
+ texToFbo1Shader.setUniforms(ctx, texToFbo1ShaderID);
+ multiTexShader.setUniforms(ctx, multiTexShaderID);
+
+ var fbo0 = ctx.createFramebuffer();
+ var fbo1 = ctx.createFramebuffer();
+ var tex0 = ctx.createTexture();
+ var tex1 = ctx.createTexture();
+
+ for (var ndx = 0; ndx < 2; ndx++) {
+ var transferFmt = gluTextureUtil.getTransferFormat(ndx ? texFmt1 : texFmt0);
+ var format = ndx ? this.m_tex1Fmt : this.m_tex0Fmt;
+ var isFilterable = gluTextureUtil.isGLInternalColorFormatFilterable(format);
+ var size = ndx ? this.m_tex1Size : this.m_tex0Size;
+ var fbo = ndx ? fbo1 : fbo0;
+ var tex = ndx ? tex1 : tex0;
+
+ ctx.bindTexture(gl.TEXTURE_2D, tex);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, isFilterable ? gl.LINEAR : gl.NEAREST);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, isFilterable ? gl.LINEAR : gl.NEAREST);
+ ctx.texImage2D(gl.TEXTURE_2D, 0, format, size[0], size[1], 0, transferFmt.format, transferFmt.dataType, null);
+
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ ctx.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);
+ this.checkError();
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+ }
+
+ // Render textures to both framebuffers.
+ for (var ndx = 0; ndx < 2; ndx++) {
+ var format = gl.RGBA;
+ var dataType = gl.UNSIGNED_BYTE;
+ var tmpTex;
+ var fbo = ndx ? fbo1 : fbo0;
+ var viewport = ndx ? this.m_tex1Size : this.m_tex0Size;
+ var data = new tcuTexture.TextureLevel(gluTextureUtil.mapGLTransferFormat(format, dataType), texW, texH, 1);
+
+ if (ndx == 0)
+ tcuTextureUtil.fillWithComponentGradients(data.getAccess(), [0, 0, 0, 0], [1, 1, 1, 1]);
+ else
+ tcuTextureUtil.fillWithGrid(data.getAccess(), 8, [0.2, 0.7, 0.1, 1.0], [0.7, 0.1, 0.5, 0.8]);
+
+ tmpTex = ctx.createTexture();
+ ctx.bindTexture(gl.TEXTURE_2D, tmpTex);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ ctx.texImage2D(gl.TEXTURE_2D, 0, format, texW, texH, 0, format, dataType, data.getAccess().getDataPtr());
+
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ ctx.viewport(0, 0, viewport[0], viewport[1]);
+ rrUtil.drawQuad(ctx, ndx ? texToFbo1ShaderID : texToFbo0ShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]);
+ }
+
+ // Render to framebuffer.
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, null);
+ ctx.viewport(0, 0, ctx.getWidth(), ctx.getHeight());
+ ctx.activeTexture(gl.TEXTURE0);
+ ctx.bindTexture(gl.TEXTURE_2D, tex0);
+ ctx.activeTexture(gl.TEXTURE1);
+ ctx.bindTexture(gl.TEXTURE_2D, tex1);
+ rrUtil.drawQuad(ctx, multiTexShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]);
+
+ this.readPixels(dst, 0, 0, ctx.getWidth(), ctx.getHeight());
+ };
+
+/**
+ * @constructor
+ * @extends {es3fFboColorbufferTests.FboColorbufferCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} texFmt
+ * @param {Array<number>} texSize
+ */
+es3fFboColorbufferTests.FboColorTexCubeCase = function(name, desc, texFmt, texSize) {
+ es3fFboColorbufferTests.FboColorbufferCase.call(this, name, desc, texFmt);
+ this.m_texSize = texSize;
+};
+
+setParentClass(es3fFboColorbufferTests.FboColorTexCubeCase, es3fFboColorbufferTests.FboColorbufferCase);
+
+es3fFboColorbufferTests.FboColorTexCubeCase.prototype.preCheck = function() {
+ this.checkFormatSupport(this.m_format);
+ return true; // No exception thrown
+ };
+
+es3fFboColorbufferTests.FboColorTexCubeCase.prototype.render = function(dst) {
+ var ctx = this.getCurrentContext();
+ var texFmt = gluTextureUtil.mapGLInternalFormat(this.m_format);
+ var fmtInfo = tcuTextureUtil.getTextureFormatInfo(texFmt);
+
+ var cubeGLFaces = [
+ gl.TEXTURE_CUBE_MAP_POSITIVE_X,
+ gl.TEXTURE_CUBE_MAP_POSITIVE_Y,
+ gl.TEXTURE_CUBE_MAP_POSITIVE_Z,
+ gl.TEXTURE_CUBE_MAP_NEGATIVE_X,
+ gl.TEXTURE_CUBE_MAP_NEGATIVE_Y,
+ gl.TEXTURE_CUBE_MAP_NEGATIVE_Z
+ ];
+
+ var cubeTexFaces = [
+ tcuTexture.CubeFace.CUBEFACE_POSITIVE_X,
+ tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y,
+ tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z,
+ tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X,
+ tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y,
+ tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z
+ ];
+
+ var rnd = new deRandom.Random(21);
+
+ /** @type {es3fFboTestUtil.Texture2DShader} */
+ var texToFboShader = new es3fFboTestUtil.Texture2DShader(
+ [gluShaderUtil.DataType.SAMPLER_2D], es3fFboTestUtil.getFragmentOutputType(texFmt),
+ deMath.subtract(fmtInfo.valueMax, fmtInfo.valueMin),
+ fmtInfo.valueMin);
+
+ /** @type {es3fFboTestUtil.TextureCubeShader} */
+ var cubeTexShader = new es3fFboTestUtil.TextureCubeShader(
+ gluTextureUtil.getSamplerCubeType(texFmt),
+ gluShaderUtil.DataType.FLOAT_VEC4);
+
+ var texToFboShaderID = ctx.createProgram(texToFboShader);
+ var cubeTexShaderID = ctx.createProgram(cubeTexShader);
+
+ // Setup shaders
+ texToFboShader.setUniforms(ctx, texToFboShaderID);
+ cubeTexShader.setTexScaleBias(fmtInfo.lookupScale, fmtInfo.lookupBias);
+
+ // Framebuffers.
+ var fbos = [];
+ var tex;
+
+ var transferFmt = gluTextureUtil.getTransferFormat(texFmt);
+ var isFilterable = gluTextureUtil.isGLInternalColorFormatFilterable(this.m_format);
+ var size = this.m_texSize;
+
+ tex = ctx.createTexture();
+
+ ctx.bindTexture(gl.TEXTURE_CUBE_MAP, tex);
+ ctx.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, isFilterable ? gl.LINEAR : gl.NEAREST);
+ ctx.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, isFilterable ? gl.LINEAR : gl.NEAREST);
+
+ // Generate an image and FBO for each cube face
+ for (var ndx = 0; ndx < cubeGLFaces.length; ndx++)
+ ctx.texImage2D(cubeGLFaces[ndx], 0, this.m_format, size[0], size[1], 0, transferFmt.format, transferFmt.dataType, null);
+ this.checkError();
+
+ for (var ndx = 0; ndx < cubeGLFaces.length; ndx++) {
+ var layerFbo = ctx.createFramebuffer();
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, layerFbo);
+ ctx.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, cubeGLFaces[ndx], tex, 0);
+ this.checkError();
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ fbos.push(layerFbo);
+ }
+
+ // Render test images to random cube faces
+ var order = [];
+
+ for (var n = 0; n < fbos.length; n++)
+ order.push(n);
+ rnd.shuffle(order);
+
+ for (var ndx = 0; ndx < 4; ndx++) {
+ var face = order[ndx];
+ var format = gl.RGBA;
+ var dataType = gl.UNSIGNED_BYTE;
+ var tmpTex;
+ var fbo = fbos[face];
+ var viewport = this.m_texSize;
+ var data = new tcuTexture.TextureLevel(gluTextureUtil.mapGLTransferFormat(format, dataType), texW, texH, 1);
+
+ tcuTextureUtil.fillWithGrid(data.getAccess(), 8, es3fFboColorbufferTests.generateRandomColor(rnd), [0, 0, 0, 0]);
+
+ tmpTex = ctx.createTexture();
+ ctx.bindTexture(gl.TEXTURE_2D, tmpTex);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ ctx.texImage2D(gl.TEXTURE_2D, 0, format, texW, texH, 0, format, dataType, data.getAccess().getDataPtr());
+
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ ctx.viewport(0, 0, viewport[0], viewport[1]);
+ rrUtil.drawQuad(ctx, texToFboShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]);
+ this.checkError();
+
+ // Render to framebuffer
+ var p0 = [(ndx % 2) - 1.0, Math.floor(ndx / 2) - 1.0, 0.0];
+ var p1 = deMath.add(p0, [1.0, 1.0, 0.0]);
+
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, null);
+ ctx.viewport(0, 0, ctx.getWidth(), ctx.getHeight());
+
+ ctx.activeTexture(gl.TEXTURE0);
+ ctx.bindTexture(gl.TEXTURE_CUBE_MAP, tex);
+
+ cubeTexShader.setFace(cubeTexFaces[face]);
+ cubeTexShader.setUniforms(ctx, cubeTexShaderID);
+
+ rrUtil.drawQuad(ctx, cubeTexShaderID, p0, p1);
+ this.checkError();
+ }
+
+ this.readPixels(dst, 0, 0, ctx.getWidth(), ctx.getHeight());
+ };
+
+/**
+ * @constructor
+ * @extends {es3fFboColorbufferTests.FboColorbufferCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} texFmt
+ * @param {Array<number>} texSize
+ */
+es3fFboColorbufferTests.FboColorTex2DArrayCase = function(name, desc, texFmt, texSize) {
+ es3fFboColorbufferTests.FboColorbufferCase.call(this, name, desc, texFmt);
+ this.m_texSize = texSize;
+};
+
+setParentClass(es3fFboColorbufferTests.FboColorTex2DArrayCase, es3fFboColorbufferTests.FboColorbufferCase);
+
+es3fFboColorbufferTests.FboColorTex2DArrayCase.prototype.preCheck = function() {
+ this.checkFormatSupport(this.m_format);
+ return true; // No exception thrown
+ };
+
+ es3fFboColorbufferTests.FboColorTex2DArrayCase.prototype.render = function(dst) {
+ var ctx = this.getCurrentContext();
+ var texFmt = gluTextureUtil.mapGLInternalFormat(this.m_format);
+ var fmtInfo = tcuTextureUtil.getTextureFormatInfo(texFmt);
+ var rnd = new deRandom.Random(100);
+
+ /** @type {es3fFboTestUtil.Texture2DShader} */
+ var texToFboShader = new es3fFboTestUtil.Texture2DShader(
+ [gluShaderUtil.DataType.SAMPLER_2D], es3fFboTestUtil.getFragmentOutputType(texFmt),
+ deMath.subtract(fmtInfo.valueMax, fmtInfo.valueMin),
+ fmtInfo.valueMin);
+
+ /** @type {es3fFboTestUtil.Texture2DArrayShader} */
+ var arrayTexShader = new es3fFboTestUtil.Texture2DArrayShader(
+ gluTextureUtil.getSampler2DArrayType(texFmt),
+ gluShaderUtil.DataType.FLOAT_VEC4);
+
+ var texToFboShaderID = ctx.createProgram(texToFboShader);
+ var arrayTexShaderID = ctx.createProgram(arrayTexShader);
+
+ // Setup textures
+ texToFboShader.setUniforms(ctx, texToFboShaderID);
+ arrayTexShader.setTexScaleBias(fmtInfo.lookupScale, fmtInfo.lookupBias);
+
+ // Framebuffers.
+ var fbos = [];
+ var tex;
+
+ var transferFmt = gluTextureUtil.getTransferFormat(texFmt);
+ var isFilterable = gluTextureUtil.isGLInternalColorFormatFilterable(this.m_format);
+ var size = this.m_texSize;
+
+ tex = ctx.createTexture();
+
+ ctx.bindTexture(gl.TEXTURE_2D_ARRAY, tex);
+ ctx.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_WRAP_R, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_MIN_FILTER, isFilterable ? gl.LINEAR : gl.NEAREST);
+ ctx.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_MAG_FILTER, isFilterable ? gl.LINEAR : gl.NEAREST);
+ ctx.texImage3D(gl.TEXTURE_2D_ARRAY, 0, this.m_format, size[0], size[1], size[2], 0, transferFmt.format, transferFmt.dataType, null);
+
+ // Generate an FBO for each layer
+ for (var ndx = 0; ndx < this.m_texSize[2]; ndx++) {
+ var layerFbo = ctx.createFramebuffer();
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, layerFbo);
+ ctx.framebufferTextureLayer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, tex, 0, ndx);
+ this.checkError();
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ fbos.push(layerFbo);
+ }
+
+ // Render test images to random texture layers
+ var order = [];
+
+ for (var n = 0; n < fbos.length; n++)
+ order.push(n);
+ rnd.shuffle(order);
+
+ for (var ndx = 0; ndx < 4; ndx++) {
+ var layer = order[ndx];
+ var format = gl.RGBA;
+ var dataType = gl.UNSIGNED_BYTE;
+ var fbo = fbos[layer];
+ var viewport = this.m_texSize;
+ var data = new tcuTexture.TextureLevel(gluTextureUtil.mapGLTransferFormat(format, dataType), texW, texH, 1);
+
+ tcuTextureUtil.fillWithGrid(data.getAccess(), 8, es3fFboColorbufferTests.generateRandomColor(rnd), [0, 0, 0, 0]);
+
+ var tmpTex = ctx.createTexture();
+ ctx.bindTexture(gl.TEXTURE_2D, tmpTex);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ ctx.texImage2D(gl.TEXTURE_2D, 0, format, texW, texH, 0, format, dataType, data.getAccess().getDataPtr());
+
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ ctx.viewport(0, 0, viewport[0], viewport[1]);
+ rrUtil.drawQuad(ctx, texToFboShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]);
+ this.checkError();
+
+ // Render to framebuffer
+ var p0 = [(ndx % 2) - 1.0, Math.floor(ndx / 2) - 1.0, 0.0];
+ var p1 = deMath.add(p0, [1.0, 1.0, 0.0]);
+ debug('Layer:' + layer + ' rectangle: ' + p0 + ' ' + p1);
+
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, null);
+ ctx.viewport(0, 0, ctx.getWidth(), ctx.getHeight());
+
+ ctx.activeTexture(gl.TEXTURE0);
+ ctx.bindTexture(gl.TEXTURE_2D_ARRAY, tex);
+
+ arrayTexShader.setLayer(layer);
+ arrayTexShader.setUniforms(ctx, arrayTexShaderID);
+
+ rrUtil.drawQuad(ctx, arrayTexShaderID, p0, p1);
+ this.checkError();
+ }
+
+ this.readPixels(dst, 0, 0, ctx.getWidth(), ctx.getHeight());
+ };
+
+/**
+ * @constructor
+ * @extends {es3fFboColorbufferTests.FboColorbufferCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} texFmt
+ * @param {Array<number>} texSize
+ */
+es3fFboColorbufferTests.FboColorTex3DCase = function(name, desc, texFmt, texSize) {
+ es3fFboColorbufferTests.FboColorbufferCase.call(this, name, desc, texFmt);
+ this.m_texSize = texSize;
+};
+
+setParentClass(es3fFboColorbufferTests.FboColorTex3DCase, es3fFboColorbufferTests.FboColorbufferCase);
+
+es3fFboColorbufferTests.FboColorTex3DCase.prototype.preCheck = function() {
+ this.checkFormatSupport(this.m_format);
+ return true; // No exception thrown
+ };
+
+ es3fFboColorbufferTests.FboColorTex3DCase.prototype.render = function(dst) {
+ var ctx = this.getCurrentContext();
+ var texFmt = gluTextureUtil.mapGLInternalFormat(this.m_format);
+ var fmtInfo = tcuTextureUtil.getTextureFormatInfo(texFmt);
+ var rnd = new deRandom.Random(100);
+
+ /** @type {es3fFboTestUtil.Texture2DShader} */
+ var texToFboShader = new es3fFboTestUtil.Texture2DShader(
+ [gluShaderUtil.DataType.SAMPLER_2D], es3fFboTestUtil.getFragmentOutputType(texFmt),
+ deMath.subtract(fmtInfo.valueMax, fmtInfo.valueMin),
+ fmtInfo.valueMin);
+
+ /** @type {es3fFboTestUtil.Texture3DShader} */
+ var tdTexShader = new es3fFboTestUtil.Texture3DShader(
+ gluTextureUtil.getSampler3D(texFmt),
+ gluShaderUtil.DataType.FLOAT_VEC4);
+
+ var texToFboShaderID = ctx.createProgram(texToFboShader);
+ var tdTexShaderID = ctx.createProgram(tdTexShader);
+
+ // Setup textures
+ texToFboShader.setUniforms(ctx, texToFboShaderID);
+ tdTexShader.setTexScaleBias(fmtInfo.lookupScale, fmtInfo.lookupBias);
+
+ // Framebuffers.
+ var fbos = [];
+ var tex;{
+ var transferFmt = gluTextureUtil.getTransferFormat(texFmt);
+ var size = this.m_texSize;
+
+ tex = ctx.createTexture();
+
+ ctx.bindTexture(gl.TEXTURE_3D, tex);
+ ctx.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_WRAP_R, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ ctx.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+ ctx.texImage3D(gl.TEXTURE_3D, 0, this.m_format, size[0], size[1], size[2], 0, transferFmt.format, transferFmt.dataType, null);
+
+ // Generate an FBO for each layer
+ for (var ndx = 0; ndx < this.m_texSize[2]; ndx++) {
+ var layerFbo = ctx.createFramebuffer();
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, layerFbo);
+ ctx.framebufferTextureLayer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, tex, 0, ndx);
+ this.checkError();
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ fbos.push(layerFbo);
+ }
+ }
+
+ // Render test images to random texture layers
+ var order = [];
+
+ for (var n = 0; n < fbos.length; n++)
+ order.push(n);
+ rnd.shuffle(order);
+
+ for (var ndx = 0; ndx < 4; ndx++) {
+ var layer = order[ndx];
+ var format = gl.RGBA;
+ var dataType = gl.UNSIGNED_BYTE;
+ var fbo = fbos[layer];
+ var viewport = this.m_texSize;
+ var data = new tcuTexture.TextureLevel(gluTextureUtil.mapGLTransferFormat(format, dataType), texW, texH, 1);
+
+ tcuTextureUtil.fillWithGrid(data.getAccess(), 8, es3fFboColorbufferTests.generateRandomColor(rnd), [0, 0, 0, 0]);
+
+ var tmpTex = ctx.createTexture();
+ ctx.bindTexture(gl.TEXTURE_2D, tmpTex);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ ctx.texImage2D(gl.TEXTURE_2D, 0, format, texW, texH, 0, format, dataType, data.getAccess().getDataPtr());
+
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ ctx.viewport(0, 0, viewport[0], viewport[1]);
+ rrUtil.drawQuad(ctx, texToFboShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]);
+ this.checkError();
+
+ // Render to framebuffer
+ var p0 = [(ndx % 2) - 1.0, Math.floor(ndx / 2) - 1.0, 0.0];
+ var p1 = deMath.add(p0, [1.0, 1.0, 0.0]);
+ debug('Layer:' + layer + ' rectangle: ' + p0 + ' ' + p1);
+
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, null);
+ ctx.viewport(0, 0, ctx.getWidth(), ctx.getHeight());
+
+ ctx.activeTexture(gl.TEXTURE0);
+ ctx.bindTexture(gl.TEXTURE_3D, tex);
+
+ tdTexShader.setDepth(layer / (this.m_texSize[2] - 1));
+ tdTexShader.setUniforms(ctx, tdTexShaderID);
+
+ rrUtil.drawQuad(ctx, tdTexShaderID, p0, p1);
+ this.checkError();
+ }
+
+ this.readPixels(dst, 0, 0, ctx.getWidth(), ctx.getHeight());
+};
+
+/**
+ * @constructor
+ * @extends {es3fFboColorbufferTests.FboColorbufferCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} format
+ * @param {Array<number>} size
+ * @param {number} funcRGB
+ * @param {number} funcAlpha
+ * @param {number} srcRGB
+ * @param {number} dstRGB
+ * @param {number} srcAlpha
+ * @param {number} dstAlpha
+ */
+es3fFboColorbufferTests.FboBlendCase = function(name, desc, format, size, funcRGB, funcAlpha, srcRGB, dstRGB, srcAlpha, dstAlpha) {
+ es3fFboColorbufferTests.FboColorbufferCase.call(this, name, desc, format);
+ this.m_size = size;
+ this.m_funcRGB = funcRGB;
+ this.m_funcAlpha = funcAlpha;
+ this.m_srcRGB = srcRGB;
+ this.m_dstRGB = dstRGB;
+ this.m_srcAlpha = srcAlpha;
+ this.m_dstAlpha = dstAlpha
+};
+
+setParentClass(es3fFboColorbufferTests.FboBlendCase, es3fFboColorbufferTests.FboColorbufferCase);
+
+es3fFboColorbufferTests.FboBlendCase.prototype.preCheck = function() {
+ this.checkFormatSupport(this.m_format);
+ return true; // No exception thrown
+ }
+
+ es3fFboColorbufferTests.FboBlendCase.prototype.render = function(dst) {
+ // \note Assumes floating-point or fixed-point format.
+ var ctx = this.getCurrentContext();
+ var fboFmt = gluTextureUtil.mapGLInternalFormat(this.m_format);
+ var fmtInfo = tcuTextureUtil.getTextureFormatInfo(fboFmt);
+
+ /** @type {es3fFboTestUtil.Texture2DShader} */
+ var texShader = new es3fFboTestUtil.Texture2DShader(
+ [gluShaderUtil.DataType.SAMPLER_2D], gluShaderUtil.DataType.FLOAT_VEC4);
+
+ /** @type {es3fFboTestUtil.GradientShader} */
+ var gradShader = new es3fFboTestUtil.GradientShader(gluShaderUtil.DataType.FLOAT_VEC4);
+
+ var texShaderID = ctx.createProgram(texShader);
+ var gradShaderID = ctx.createProgram(gradShader);
+
+ // Setup shaders
+ texShader.setUniforms (ctx, texShaderID);
+ gradShader.setGradient(ctx, gradShaderID, [0, 0, 0, 0], [1, 1, 1, 1]);
+
+ var fbo = ctx.createFramebuffer();
+ var rbo = ctx.createRenderbuffer();
+
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, rbo);
+ ctx.renderbufferStorage(gl.RENDERBUFFER, this.m_format, this.m_size[0], this.m_size[1]);
+ this.checkError();
+
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo);
+ this.checkError();
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ ctx.viewport(0, 0, this.m_size[0], this.m_size[1]);
+
+ // Fill framebuffer with grid pattern.
+ var format = gl.RGBA;
+ var dataType = gl.UNSIGNED_BYTE;
+ var data = new tcuTexture.TextureLevel(gluTextureUtil.mapGLTransferFormat(format, dataType), texW, texH, 1);
+
+ tcuTextureUtil.fillWithGrid(data.getAccess(), 8, [0.2, 0.7, 0.1, 1.0], [0.7, 0.1, 0.5, 0.8]);
+
+ var gridTex = ctx.createTexture();
+ ctx.bindTexture(gl.TEXTURE_2D, gridTex);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ ctx.texImage2D(gl.TEXTURE_2D, 0, format, texW, texH, 0, format, dataType, data.getAccess().getDataPtr());
+
+ rrUtil.drawQuad(ctx, texShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]);
+ this.checkError();
+
+ // Setup blend.
+ ctx.enable(gl.BLEND);
+ ctx.blendEquationSeparate(this.m_funcRGB, this.m_funcAlpha);
+ ctx.blendFuncSeparate(this.m_srcRGB, this.m_dstRGB, this.m_srcAlpha, this.m_dstAlpha);
+
+ // Render gradient with blend.
+ rrUtil.drawQuad(ctx, gradShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]);
+
+ es3fFboTestUtil.readPixels(ctx, dst, 0, 0, this.m_size[0], this.m_size[1], fboFmt, [1, 1, 1, 1], [0, 0, 0, 0]);
+ };
+
+/**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+es3fFboColorbufferTests.FboColorbufferTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'color', 'Colorbuffer tests');
+};
+
+setParentClass(es3fFboColorbufferTests.FboColorbufferTests, tcuTestCase.DeqpTest);
+
+es3fFboColorbufferTests.FboColorbufferTests.prototype.init = function() {
+ var colorFormats = [
+ // RGBA formats
+ gl.RGBA32I,
+ gl.RGBA32UI,
+ gl.RGBA16I,
+ gl.RGBA16UI,
+ gl.RGBA8,
+ gl.RGBA8I,
+ gl.RGBA8UI,
+ gl.SRGB8_ALPHA8,
+ gl.RGB10_A2,
+ gl.RGB10_A2UI,
+ gl.RGBA4,
+ gl.RGB5_A1,
+
+ // RGB formats
+ gl.RGB8,
+ gl.RGB565,
+
+ // RG formats
+ gl.RG32I,
+ gl.RG32UI,
+ gl.RG16I,
+ gl.RG16UI,
+ gl.RG8,
+ gl.RG8I,
+ gl.RG8UI,
+
+ // R formats
+ gl.R32I,
+ gl.R32UI,
+ gl.R16I,
+ gl.R16UI,
+ gl.R8,
+ gl.R8I,
+ gl.R8UI,
+
+ // gl.EXT_color_buffer_float
+ gl.RGBA32F,
+ gl.RGBA16F,
+ gl.R11F_G11F_B10F,
+ gl.RG32F,
+ gl.RG16F,
+ gl.R32F,
+ gl.R16F,
+
+ // gl.EXT_color_buffer_half_float is not exposed in WebGL 2.0.
+ // gl.RGB16F
+ ];
+
+ // .clear
+ var clearGroup = tcuTestCase.newTest("clear", "Color clears");
+ this.addChild(clearGroup);
+
+ for (var ndx = 0; ndx < colorFormats.length; ndx++) {
+ clearGroup.addChild(new es3fFboColorbufferTests.FboColorClearCase(
+ es3fFboTestUtil.getFormatName(colorFormats[ndx]), "", colorFormats[ndx], texNpotSizeA[0], texNpotSizeA[1]));
+ }
+
+ var numGroups = 6;
+
+ // .tex2d
+ var tex2DGroup = [];
+ for (var ii = 0; ii < numGroups; ++ii) {
+ tex2DGroup[ii] = tcuTestCase.newTest("tex2d", "Texture 2D tests");
+ this.addChild(tex2DGroup[ii]);
+ }
+ for (var ndx = 0; ndx < colorFormats.length; ndx++) {
+ tex2DGroup[ndx % numGroups].addChild(new es3fFboColorbufferTests.FboColorMultiTex2DCase(
+ es3fFboTestUtil.getFormatName(colorFormats[ndx]), "", colorFormats[ndx], texNpotSizeA, colorFormats[ndx], texNpotSizeB));
+ }
+
+ // .texcube
+ var texCubeGroup = [];
+ for (var ii = 0; ii < numGroups; ++ii) {
+ texCubeGroup[ii] = tcuTestCase.newTest("texcube", "Texture cube map tests");
+ this.addChild(texCubeGroup[ii]);
+ }
+ for (var ndx = 0; ndx < colorFormats.length; ndx++) {
+ texCubeGroup[ndx % numGroups].addChild(new es3fFboColorbufferTests.FboColorTexCubeCase(
+ es3fFboTestUtil.getFormatName(colorFormats[ndx]), "", colorFormats[ndx], texPotSize));
+ }
+
+ // .tex2darray
+ var tex2DArrayGroup = [];
+ for (var ii = 0; ii < numGroups; ++ii) {
+ tex2DArrayGroup[ii] = tcuTestCase.newTest("tex2darray", "Texture 2D array tests");
+ this.addChild(tex2DArrayGroup[ii]);
+ }
+ for (var ndx = 0; ndx < colorFormats.length; ndx++) {
+ tex2DArrayGroup[ndx % numGroups].addChild(new es3fFboColorbufferTests.FboColorTex2DArrayCase(
+ es3fFboTestUtil.getFormatName(colorFormats[ndx]), "", colorFormats[ndx], texPotSize));
+ }
+
+ // .tex3d
+ var tex3DGroup = [];
+ for (var ii = 0; ii < numGroups; ++ii) {
+ tex3DGroup[ii] = tcuTestCase.newTest("tex3d", "Texture 3D tests");
+ this.addChild(tex3DGroup[ii]);
+ }
+ for (var ndx = 0; ndx < colorFormats.length; ndx++) {
+ tex3DGroup[ndx % numGroups].addChild(new es3fFboColorbufferTests.FboColorTex3DCase(
+ es3fFboTestUtil.getFormatName(colorFormats[ndx]), "", colorFormats[ndx], texPotSize));
+ }
+
+ // .blend
+ var blendGroup = tcuTestCase.newTest("blend", "Blending tests");
+ this.addChild(blendGroup);
+
+ for (var ndx = 0; ndx < colorFormats.length; ndx++) {
+ var format = colorFormats[ndx];
+ var texFmt = gluTextureUtil.mapGLInternalFormat(format);
+ var fmtClass = tcuTexture.getTextureChannelClass(texFmt.type);
+ var fmtName = es3fFboTestUtil.getFormatName(format);
+
+ if (texFmt.type == tcuTexture.ChannelType.FLOAT ||
+ fmtClass == tcuTexture.TextureChannelClass.SIGNED_INTEGER ||
+ fmtClass == tcuTexture.TextureChannelClass.UNSIGNED_INTEGER)
+ continue; // Blending is not supported.
+
+ blendGroup.addChild(new es3fFboColorbufferTests.FboBlendCase(fmtName + "_src_over", "", format,
+ texNpotSizeA, gl.FUNC_ADD, gl.FUNC_ADD, gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ZERO, gl.ONE));
+ }
+};
+
+/**
+* Run test
+* @param {WebGL2RenderingContext} context
+*/
+es3fFboColorbufferTests.run = function(context, range) {
+ gl = context;
+
+ const canvas = gl.canvas;
+ canvas.width = canvasWH;
+ canvas.height = canvasWH;
+
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fFboColorbufferTests.FboColorbufferTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ if (range)
+ state.setRange(range);
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fFboColorbufferTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboCompletenessTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboCompletenessTests.js
new file mode 100644
index 0000000000..1ae68fc8c7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboCompletenessTests.js
@@ -0,0 +1,567 @@
+
+// FboCompletenessTests
+'use strict';
+goog.provide('functional.gles3.es3fFboCompletenessTests');
+goog.require('framework.common.tcuTestCase');
+goog.require('modules.shared.glsFboCompletenessTests');
+goog.require('modules.shared.glsFboUtil');
+
+goog.scope(function() {
+
+ var es3fFboCompletenessTests = functional.gles3.es3fFboCompletenessTests;
+ var glsFboUtil = modules.shared.glsFboUtil;
+ var glsFboCompletenessTests = modules.shared.glsFboCompletenessTests;
+ var tcuTestCase = framework.common.tcuTestCase;
+
+ es3fFboCompletenessTests.initGlDependents = function(gl) {
+ if (!(gl = gl || window.gl)) throw new Error('Invalid gl object');
+
+ /**
+ * @type {Array<number>}
+ */
+ es3fFboCompletenessTests.s_es3ColorRenderables = [
+ // GLES3, 4.4.4: "An internal format is color-renderable if it is one of
+ // the formats from table 3.12 noted as color-renderable..."
+ gl.R8, gl.RG8, gl.RGB8, gl.RGB565, gl.RGBA4, gl.RGB5_A1, gl.RGBA8,
+ gl.RGB10_A2, gl.RGB10_A2UI, gl.SRGB8_ALPHA8,
+ gl.R8I, gl.R8UI, gl.R16I, gl.R16UI, gl.R32I, gl.R32UI,
+ gl.RG8I, gl.RG8UI, gl.RG16I, gl.RG16UI, gl.RG32I, gl.RG32UI,
+ gl.RGBA81, gl.RGBA8UI, gl.RGB16I, gl.RGBA16UI, gl.RGBA32I, gl.RGBA32UI
+ ];
+
+ /**
+ * @type {Array<number>}
+ */
+ es3fFboCompletenessTests.s_es3UnsizedColorRenderables = [
+ // "...or if it is unsized format RGBA or RGB."
+ // See Table 3.3 in GLES3.
+ glsFboUtil.formatkey(gl.RGBA, gl.UNSIGNED_BYTE),
+ glsFboUtil.formatkey(gl.RGBA, gl.UNSIGNED_SHORT_4_4_4_4),
+ glsFboUtil.formatkey(gl.RGBA, gl.UNSIGNED_SHORT_5_5_5_1),
+ glsFboUtil.formatkey(gl.RGB, gl.UNSIGNED_BYTE),
+ glsFboUtil.formatkey(gl.RGB, gl.UNSIGNED_SHORT_5_6_5)
+ ];
+
+ /**
+ * @type {Array<number>}
+ */
+ es3fFboCompletenessTests.s_es3DepthRenderables = [
+ // GLES3, 4.4.4: "An internal format is depth-renderable if it is one of
+ // the formats from table 3.13."
+ gl.DEPTH_COMPONENT16, gl.DEPTH_COMPONENT24, gl.DEPTH_COMPONENT32F,
+ gl.DEPTH24_STENCIL8, gl.DEPTH32F_STENCIL8
+ ];
+
+ /**
+ * @type {Array<number>}
+ */
+ es3fFboCompletenessTests.s_es3StencilRboRenderables = [
+ // GLES3, 4.4.4: "An internal format is stencil-renderable if it is
+ // STENCIL_INDEX8..."
+ gl.STENCIL_INDEX8
+ ];
+
+ /**
+ * @type {Array<number>}
+ */
+ es3fFboCompletenessTests.s_es3StencilRenderables = [
+ // "...or one of the formats from table 3.13 whose base internal format is
+ // DEPTH_STENCIL."
+ gl.DEPTH24_STENCIL8, gl.DEPTH32F_STENCIL8
+ ];
+
+ /**
+ * @type {Array<number>}
+ */
+ es3fFboCompletenessTests.s_es3TextureFloatFormats = [
+ gl.RGBA32F, gl.RGBA16F, gl.R11F_G11F_B10F,
+ gl.RG32F, gl.RG16F, gl.R32F, gl.R16F,
+ gl.RGBA16F, gl.RGB16F, gl.RG16F, gl.R16F
+ ];
+
+ /**
+ * @type {Array<glsFboUtil.formatT>}
+ */
+ es3fFboCompletenessTests.s_es3Formats = [
+ [
+ (
+ glsFboUtil.FormatFlags.REQUIRED_RENDERABLE |
+ glsFboUtil.FormatFlags.COLOR_RENDERABLE |
+ glsFboUtil.FormatFlags.TEXTURE_VALID
+ ),
+ glsFboUtil.rangeArray(es3fFboCompletenessTests.s_es3UnsizedColorRenderables)
+ ],
+ [
+ (
+ glsFboUtil.FormatFlags.REQUIRED_RENDERABLE |
+ glsFboUtil.FormatFlags.COLOR_RENDERABLE |
+ glsFboUtil.FormatFlags.RENDERBUFFER_VALID |
+ glsFboUtil.FormatFlags.TEXTURE_VALID
+ ),
+ glsFboUtil.rangeArray(es3fFboCompletenessTests.s_es3ColorRenderables)
+ ], [
+ (
+ glsFboUtil.FormatFlags.REQUIRED_RENDERABLE |
+ glsFboUtil.FormatFlags.DEPTH_RENDERABLE |
+ glsFboUtil.FormatFlags.RENDERBUFFER_VALID |
+ glsFboUtil.FormatFlags.TEXTURE_VALID
+ ),
+ glsFboUtil.rangeArray(es3fFboCompletenessTests.s_es3DepthRenderables)
+ ], [
+ (
+ glsFboUtil.FormatFlags.REQUIRED_RENDERABLE |
+ glsFboUtil.FormatFlags.STENCIL_RENDERABLE |
+ glsFboUtil.FormatFlags.RENDERBUFFER_VALID
+ ),
+ glsFboUtil.rangeArray(es3fFboCompletenessTests.s_es3StencilRboRenderables)
+ ], [
+ (
+ glsFboUtil.FormatFlags.REQUIRED_RENDERABLE |
+ glsFboUtil.FormatFlags.STENCIL_RENDERABLE |
+ glsFboUtil.FormatFlags.RENDERBUFFER_VALID |
+ glsFboUtil.FormatFlags.TEXTURE_VALID
+ ),
+ glsFboUtil.rangeArray(es3fFboCompletenessTests.s_es3StencilRenderables)
+ ],
+
+ // These are not color-renderable in vanilla ES3, but we need to mark them
+ // as valid for textures, since EXT_color_buffer_(half_)float brings in
+ // color-renderability and only renderbuffer-validity.
+ [
+ glsFboUtil.FormatFlags.TEXTURE_VALID,
+ glsFboUtil.rangeArray(es3fFboCompletenessTests.s_es3TextureFloatFormats)
+ ]
+ ];
+
+ // gl.EXT_color_buffer_float
+ es3fFboCompletenessTests.s_extColorBufferFloatFormats = [
+ gl.RGBA32F, gl.RGBA16F, gl.R11F_G11F_B10F, gl.RG32F, gl.RG16F, gl.R32F, gl.R16F
+ ];
+
+ // gl.OES_texture_stencil8
+ es3fFboCompletenessTests.s_extOESTextureStencil8 = [
+ gl.STENCIL_INDEX8
+ ];
+
+ es3fFboCompletenessTests.s_es3ExtFormats = [{
+ extensions: 'gl.EXT_color_buffer_float',
+ flags: glsFboUtil.FormatFlags.REQUIRED_RENDERABLE |
+ glsFboUtil.FormatFlags.COLOR_RENDERABLE |
+ glsFboUtil.FormatFlags.RENDERBUFFER_VALID,
+ formats: new glsFboUtil.Range(es3fFboCompletenessTests.s_extColorBufferFloatFormats)
+ }, {
+ extensions: 'gl.OES_texture_stencil8',
+ flags: glsFboUtil.FormatFlags.REQUIRED_RENDERABLE |
+ glsFboUtil.FormatFlags.STENCIL_RENDERABLE |
+ glsFboUtil.FormatFlags.TEXTURE_VALID,
+ formats: new glsFboUtil.Range(es3fFboCompletenessTests.s_extOESTextureStencil8)
+ }
+ ];
+
+ glsFboCompletenessTests.initGlDependents(gl);
+ };
+
+ /**
+ * @constructor
+ * @extends {glsFboUtil.Checker}
+ */
+ es3fFboCompletenessTests.ES3Checker = function() {
+ glsFboUtil.Checker.call(this, gl);
+ /** @type {number} */ this.m_numSamples = -1; // GLsizei
+ /** @type {number} */ this.m_depthStencilImage = 0; // GLuint
+ /** @type {number} */ this.m_depthStencilType = gl.NONE;
+ };
+ es3fFboCompletenessTests.ES3Checker.prototype = Object.create(glsFboUtil.Checker.prototype);
+ es3fFboCompletenessTests.ES3Checker.prototype.constructor = es3fFboCompletenessTests.ES3Checker;
+
+ es3fFboCompletenessTests.ES3Checker.prototype.check = function(attPoint, att, image) {
+
+ var imgSamples = glsFboUtil.imageNumSamples(image);
+
+ if (this.m_numSamples == -1) {
+ this.m_numSamples = imgSamples;
+ } else {
+ // GLES3: "The value of RENDERBUFFER_SAMPLES is the same for all attached
+ // renderbuffers and, if the attached images are a mix of renderbuffers
+ // and textures, the value of RENDERBUFFER_SAMPLES is zero."
+ //
+ // On creating a renderbuffer: "If _samples_ is zero, then
+ // RENDERBUFFER_SAMPLES is set to zero. Otherwise [...] the resulting
+ // value for RENDERBUFFER_SAMPLES is guaranteed to be greater than or
+ // equal to _samples_ and no more than the next larger sample count
+ // supported by the implementation."
+
+ // Either all attachments are zero-sample renderbuffers and/or
+ // textures, or none of them are.
+ this.addFBOStatus(
+ (this.m_numSamples == 0) == (imgSamples == 0),
+ gl.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE
+ );
+
+ // If the attachments requested a different number of samples, the
+ // implementation is allowed to report this as incomplete. However, it
+ // is also possible that despite the different requests, the
+ // implementation allocated the same number of samples to both. Hence
+ // reporting the framebuffer as complete is also legal.
+ this.addPotentialFBOStatus(
+ this.m_numSamples == imgSamples,
+ gl.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE
+ );
+ }
+
+ // "Depth and stencil attachments, if present, are the same image."
+ if (attPoint == gl.DEPTH_ATTACHMENT || attPoint == gl.STENCIL_ATTACHMENT) {
+ if (this.m_depthStencilImage == 0) {
+ this.m_depthStencilImage = att.imageName;
+ this.m_depthStencilType = glsFboUtil.attachmentType(att);
+
+ } else {
+ this.addFBOStatus(
+ this.m_depthStencilImage == att.imageName && this.m_depthStencilType == glsFboUtil.attachmentType(att),
+ gl.FRAMEBUFFER_UNSUPPORTED
+ );
+ }
+ }
+
+ };
+
+ /**
+ * @typedef {{textureKind: number, numLayers: number, attachmentLayer: number}}
+ */
+ es3fFboCompletenessTests.numLayersParamsT;
+
+ /**
+ * @param {number} textureKind
+ * @param {number} numLayers
+ * @param {number} attachmentLayer
+ * @return {es3fFboCompletenessTests.numLayersParamsT}
+ */
+ es3fFboCompletenessTests.numLayersParams = function(textureKind, numLayers, attachmentLayer) {
+ if (typeof(attachmentLayer) == 'undefined') {
+ textureKind = 0;
+ numLayers = 0;
+ attachmentLayer = 0;
+ }
+ return {
+ textureKind: textureKind, //< gl.TEXTURE_3D or gl.TEXTURE_2D_ARRAY
+ numLayers: numLayers, //< Number of layers in texture
+ attachmentLayer: attachmentLayer //< Layer referenced by attachment
+ };
+ };
+
+ /**
+ * es3fFboCompletenessTests.numLayersParams.getName
+ * @param {es3fFboCompletenessTests.numLayersParamsT} params
+ * @return {string}
+ */
+ es3fFboCompletenessTests.numLayersParams.getName = function(params) {
+ return (
+ (params.textureKind == gl.TEXTURE_3D ? '3d' : '2darr') + '_' +
+ params.numLayers + '_' +
+ params.attachmentLayer
+ );
+ };
+ /**
+ * es3fFboCompletenessTests.numLayersParams.getDescription
+ * @param {es3fFboCompletenessTests.numLayersParamsT} params
+ * @return {string}
+ */
+ es3fFboCompletenessTests.numLayersParams.getDescription = function(params) {
+ return (
+ (params.textureKind == gl.TEXTURE_3D ? '3D Texture' : '2D Array Texture') + ', ' +
+ params.numLayers + ' layers, ' +
+ 'attached layer ' + params.attachmentLayer + '.'
+ );
+ };
+
+ // string, string, glsFboCompleteness::context, params.
+ /**
+ * @constructor
+ * @extends {glsFboCompletenessTests.TestBase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {glsFboCompletenessTests.Context} ctx
+ * @param {es3fFboCompletenessTests.numLayersParamsT} params
+ */
+ es3fFboCompletenessTests.NumLayersTest = function(name, desc, ctx, params) {
+ glsFboCompletenessTests.TestBase.call(this, name, desc, params);
+ this.m_ctx = ctx;
+ };
+
+ es3fFboCompletenessTests.NumLayersTest.prototype = Object.create(glsFboCompletenessTests.TestBase.prototype);
+ es3fFboCompletenessTests.NumLayersTest.prototype.constructor = es3fFboCompletenessTests.NumLayersTest;
+
+ es3fFboCompletenessTests.NumLayersTest.prototype.build = function(builder, gl) {
+
+ if (!(gl = gl || window.gl)) throw new Error('Invalid gl object');
+
+ var target = gl.COLOR_ATTACHMENT0;
+ var texCfg = builder.makeConfig(
+ function(kind) {
+ switch (kind) {
+ case gl.TEXTURE_3D: return glsFboUtil.Texture3D;
+ case gl.TEXTURE_2D_ARRAY: return glsFboUtil.Texture2DArray;
+ default: throw new Error('Impossible case');
+ }
+ }(this.m_params.textureKind)
+ );
+
+ texCfg.internalFormat = this.getDefaultFormat(target, gl.TEXTURE, gl);
+ texCfg.width = 64;
+ texCfg.height = 64;
+ texCfg.numLayers = this.m_params.numLayers;
+ var tex = builder.glCreateTexture(texCfg);
+
+ var att = builder.makeConfig(glsFboUtil.TextureLayerAttachment);
+ att.layer = this.m_params.attachmentLayer;
+ att.imageName = tex;
+
+ builder.glAttach(target, att);
+
+ // return tcuTestCase.IterateResult.STOP;
+ };
+//es3fFboCompletenessTests.NumLayersTest.prototype.isExecutable = function() {
+// return false;
+//};
+
+ /**
+ * @enum
+ */
+ es3fFboCompletenessTests.e_samples = {
+ NONE: -2,
+ TEXTURE: -1
+ };
+
+ /**
+ * @typedef {{numSamples: Array<number>}}
+ */
+ es3fFboCompletenessTests.numSamplesParamsT;
+
+ /**
+ * @param {number} colour
+ * @param {number} depth
+ * @param {number} stencil
+ * @return {es3fFboCompletenessTests.numSamplesParamsT}
+ */
+ es3fFboCompletenessTests.numSamplesParams = function(colour, depth, stencil) {
+ var ret = {
+ numSamples: new Array(3)
+ };
+ if (colour !== undefined) {
+ ret.numSamples[0] = colour;
+ if (depth !== undefined) {
+ ret.numSamples[1] = depth;
+ if (stencil !== undefined) {
+ ret.numSamples[2] = stencil;
+ }
+ }
+ }
+ return ret;
+ };
+
+ /**
+ * @param {es3fFboCompletenessTests.numSamplesParamsT} params
+ * @return {string}
+ */
+ es3fFboCompletenessTests.numSamplesParams.getName = function(params) {
+ var out = '';
+
+ var first = true;
+ for (var i = 0; i < 3; ++i) {
+ if (first)
+ first = false;
+ else
+ out += '_';
+
+ switch (params.numSamples[i]) {
+ case es3fFboCompletenessTests.e_samples.NONE: out += 'none'; break;
+ case es3fFboCompletenessTests.e_samples.TEXTURE: out += 'tex'; break;
+ default: out += 'rbo'; break;
+ }
+ }
+ return out;
+ };
+ /**
+ * @param {es3fFboCompletenessTests.numSamplesParamsT} params
+ * @return {string}
+ */
+ es3fFboCompletenessTests.numSamplesParams.getDescription = function(params) {
+ var out = '';
+ var names = ['color', 'depth', 'stencil'];
+ var first = true;
+
+ for (var i = 0; i < 3; ++i) {
+ if (first)
+ first = false;
+ else
+ out += ', ';
+
+ if (params.numSamples[i] == es3fFboCompletenessTests.e_samples.TEXTURE) {
+ out += 'texture ' + names[i] + ' attachment';
+ } else {
+ out += params.numSamples[i] + '-sample renderbuffer ' + names[i] + ' attachment';
+ }
+ }
+ return out;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsFboCompletenessTests.TestBase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {glsFboCompletenessTests.Context} ctx
+ * @param {es3fFboCompletenessTests.numSamplesParamsT} params
+ */
+ es3fFboCompletenessTests.NumSamplesTest = function(name, desc, ctx, params) {
+ glsFboCompletenessTests.TestBase.call(this, name, desc, params);
+ this.m_ctx = ctx;
+ };
+ es3fFboCompletenessTests.NumSamplesTest.prototype = Object.create(glsFboCompletenessTests.TestBase.prototype);
+ es3fFboCompletenessTests.NumSamplesTest.prototype.constructor = es3fFboCompletenessTests.NumSamplesTest;
+
+ es3fFboCompletenessTests.NumSamplesTest.prototype.build = function(builder, gl) {
+ if (!(gl = gl || window.gl)) throw new Error('Invalid gl object');
+
+ var s_targets = [
+ gl.COLOR_ATTACHMENT0, gl.COLOR_ATTACHMENT1, gl.DEPTH_ATTACHMENT
+ ];
+ // Non-integer formats for each attachment type.
+ // \todo [2013-12-17 lauri] Add fixed/floating/integer metadata for formats so
+ // we can pick one smartly or maybe try several.
+ var s_formats = [
+ gl.RGBA8, gl.RGB565, gl.DEPTH_COMPONENT24
+ ];
+
+ var l = s_targets.length;
+ if (this.m_params.numSamples.length != l)
+ throw new Error('Wrong number of params.');
+
+ for (var i = 0; i < l; ++i) {
+ var target = s_targets[i];
+ var fmt = new glsFboUtil.ImageFormat(s_formats[i], gl.NONE);
+
+ var ns = this.m_params.numSamples[i];
+ if (ns == es3fFboCompletenessTests.e_samples.NONE)
+ continue;
+ if (ns == es3fFboCompletenessTests.e_samples.TEXTURE) {
+ this.attachTargetToNew(target, gl.TEXTURE, fmt, 64, 64, builder, gl);
+ } else {
+ var rboCfg = builder.makeConfig(glsFboUtil.Renderbuffer);
+ rboCfg.internalFormat = fmt;
+ rboCfg.width = rboCfg.height = 64;
+ rboCfg.numSamples = ns;
+
+ var rbo = builder.glCreateRbo(rboCfg);
+ // Implementations do not necessarily support sample sizes greater than 1.
+ if (builder.getError() == gl.INVALID_OPERATION) {
+ throw new Error('Unsupported number of samples.');
+ }
+ var att = builder.makeConfig(glsFboUtil.RenderbufferAttachment);
+ att.imageName = rbo;
+ builder.glAttach(target, att);
+ }
+ }
+
+ return true;
+ };
+
+ es3fFboCompletenessTests.init = function() {
+
+ //(testCtx, renderCtx, factory) {
+ var fboCtx = new glsFboCompletenessTests.Context(null, gl, function() {
+ return new es3fFboCompletenessTests.ES3Checker();
+ });
+
+ fboCtx.addFormats(glsFboUtil.rangeArray(es3fFboCompletenessTests.s_es3Formats));
+
+ /** @const @type {tcuTestCase.DeqpTest} */
+ var testGroup = tcuTestCase.runner.testCases;
+
+ testGroup.addChild(fboCtx.createRenderableTests(gl));
+ testGroup.addChild(fboCtx.createAttachmentTests(gl));
+ testGroup.addChild(fboCtx.createSizeTests(gl));
+
+ /** @type {tcuTestCase.DeqpTest} */
+ var layerTests = tcuTestCase.newTest('layer', 'Tests for layer attachments');
+
+ /** @static */
+ var s_layersParams = [
+ es3fFboCompletenessTests.numLayersParams(gl.TEXTURE_2D_ARRAY, 1, 0),
+ es3fFboCompletenessTests.numLayersParams(gl.TEXTURE_2D_ARRAY, 1, 3),
+ es3fFboCompletenessTests.numLayersParams(gl.TEXTURE_2D_ARRAY, 4, 3),
+ es3fFboCompletenessTests.numLayersParams(gl.TEXTURE_2D_ARRAY, 4, 15),
+ es3fFboCompletenessTests.numLayersParams(gl.TEXTURE_3D, 1, 0),
+ es3fFboCompletenessTests.numLayersParams(gl.TEXTURE_3D, 1, 15),
+ es3fFboCompletenessTests.numLayersParams(gl.TEXTURE_3D, 4, 15),
+ es3fFboCompletenessTests.numLayersParams(gl.TEXTURE_3D, 64, 15)
+ ];
+
+ for (var i = 0; i < s_layersParams.length; ++i) {
+ var name = 'name';
+ var desc = 'desc';
+ layerTests.addChild(new es3fFboCompletenessTests.NumLayersTest(
+ es3fFboCompletenessTests.numLayersParams.getName(s_layersParams[i]),
+ es3fFboCompletenessTests.numLayersParams.getDescription(s_layersParams[i]),
+ fboCtx, s_layersParams[i]
+ ));
+ }
+ testGroup.addChild(layerTests);
+
+ /** @type {tcuTestCase.DeqpTest} */
+ var sampleTests = tcuTestCase.newTest('sample', 'Tests for multisample attachments');
+ // some short hand
+ var samples = es3fFboCompletenessTests.e_samples;
+ // sample tests
+ /** @static */
+ var s_samplesParams = [
+ es3fFboCompletenessTests.numSamplesParams(0, samples.NONE, samples.NONE),
+ es3fFboCompletenessTests.numSamplesParams(1, samples.NONE, samples.NONE),
+ es3fFboCompletenessTests.numSamplesParams(2, samples.NONE, samples.NONE),
+ es3fFboCompletenessTests.numSamplesParams(0, samples.TEXTURE, samples.NONE),
+ es3fFboCompletenessTests.numSamplesParams(1, samples.TEXTURE, samples.NONE),
+ es3fFboCompletenessTests.numSamplesParams(2, samples.TEXTURE, samples.NONE),
+ es3fFboCompletenessTests.numSamplesParams(2, 1, samples.NONE),
+ es3fFboCompletenessTests.numSamplesParams(2, 2, samples.NONE),
+ es3fFboCompletenessTests.numSamplesParams(0, 0, samples.TEXTURE),
+ es3fFboCompletenessTests.numSamplesParams(1, 2, 0),
+ es3fFboCompletenessTests.numSamplesParams(2, 2, 0),
+ es3fFboCompletenessTests.numSamplesParams(1, 1, 1),
+ es3fFboCompletenessTests.numSamplesParams(1, 2, 4)
+ ];
+
+ for (var i = 0; i < s_samplesParams.length; ++i) {
+ var name = 'name';
+ var desc = 'desc';
+ sampleTests.addChild(new es3fFboCompletenessTests.NumSamplesTest(
+ es3fFboCompletenessTests.numSamplesParams.getName(s_samplesParams[i]),
+ es3fFboCompletenessTests.numSamplesParams.getDescription(s_samplesParams[i]),
+ fboCtx, s_samplesParams[i]
+ ));
+ }
+ testGroup.addChild(sampleTests);
+
+ };
+
+ es3fFboCompletenessTests.run = function() {
+ var testName = 'completeness';
+ var testDescription = 'Completeness tests';
+ var state = tcuTestCase.runner;
+
+ state.testName = testName;
+ state.testCases = tcuTestCase.newTest(testName, testDescription, null);
+
+ //Set up name and description of this test series.
+ setCurrentTestName(testName);
+ description(testDescription);
+ try {
+ es3fFboCompletenessTests.init();
+ tcuTestCase.runner.runCallback(tcuTestCase.runTestCases);
+ } catch (err) {
+ bufferedLogToConsole(err);
+ tcuTestCase.runner.terminate();
+ }
+
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboDepthbufferTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboDepthbufferTests.js
new file mode 100644
index 0000000000..c662a3764e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboDepthbufferTests.js
@@ -0,0 +1,385 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fFboDepthbufferTests');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.opengl.gluTextureUtil');
+goog.require('functional.gles3.es3fFboTestCase');
+goog.require('functional.gles3.es3fFboTestUtil');
+goog.require('framework.common.tcuRGBA');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.referencerenderer.rrUtil');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.opengl.gluShaderUtil');
+
+goog.scope(function() {
+var es3fFboDepthbufferTests = functional.gles3.es3fFboDepthbufferTests;
+var es3fFboTestCase = functional.gles3.es3fFboTestCase;
+var es3fFboTestUtil = functional.gles3.es3fFboTestUtil;
+var tcuTestCase = framework.common.tcuTestCase;
+var tcuSurface = framework.common.tcuSurface;
+var tcuTexture = framework.common.tcuTexture;
+var gluTextureUtil = framework.opengl.gluTextureUtil;
+var tcuRGBA = framework.common.tcuRGBA;
+var deRandom = framework.delibs.debase.deRandom;
+var tcuImageCompare = framework.common.tcuImageCompare;
+var tcuTextureUtil = framework.common.tcuTextureUtil;
+var rrUtil = framework.referencerenderer.rrUtil;
+var deMath = framework.delibs.debase.deMath;
+var gluShaderUtil = framework.opengl.gluShaderUtil;
+
+/** @type {WebGL2RenderingContext} */ var gl;
+
+var setParentClass = function(child, parent) {
+ child.prototype = Object.create(parent.prototype);
+ child.prototype.constructor = child;
+};
+
+/**
+ * @constructor
+ * @extends {es3fFboTestCase.FboTestCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} format
+ * @param {number} width
+ * @param {number} height
+ */
+es3fFboDepthbufferTests.BasicFboDepthCase = function(name, desc, format, width, height) {
+ es3fFboTestCase.FboTestCase.call(this, name, desc);
+ this.m_format = format;
+ this.m_width = width;
+ this.m_height = height;
+};
+
+setParentClass(es3fFboDepthbufferTests.BasicFboDepthCase, es3fFboTestCase.FboTestCase);
+
+es3fFboDepthbufferTests.BasicFboDepthCase.prototype.preCheck = function() {
+ this.checkFormatSupport(this.m_format);
+ return true; // No exception thrown
+ };
+
+es3fFboDepthbufferTests.BasicFboDepthCase.prototype.render = function(dst) {
+ var ctx = this.getCurrentContext();
+ var colorFormat = gl.RGBA8;
+ /** @type {es3fFboTestUtil.GradientShader} */
+ var gradShader = new es3fFboTestUtil.GradientShader(gluShaderUtil.DataType.FLOAT_VEC4);
+
+ /** @type {es3fFboTestUtil.Texture2DShader} */
+ var texShader = new es3fFboTestUtil.Texture2DShader(
+ [gluShaderUtil.DataType.SAMPLER_2D], gluShaderUtil.DataType.FLOAT_VEC4);
+ var texShaderID = ctx.createProgram(texShader);
+ var gradShaderID = ctx.createProgram(gradShader);
+ var clearDepth = 1;
+
+ // Setup shaders
+ gradShader.setGradient(ctx, gradShaderID, [0, 0, 0, 0], [1, 1, 1, 1]);
+ texShader.setUniforms(ctx, texShaderID);
+
+ // Setup FBO
+
+ var fbo = ctx.createFramebuffer();
+ var colorRbo = ctx.createRenderbuffer();
+ var depthRbo = ctx.createRenderbuffer();
+
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, colorRbo);
+ ctx.renderbufferStorage(gl.RENDERBUFFER, colorFormat, this.m_width, this.m_height);
+
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, depthRbo);
+ ctx.renderbufferStorage(gl.RENDERBUFFER, this.m_format, this.m_width, this.m_height);
+
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorRbo);
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthRbo);
+ this.checkError();
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ ctx.viewport(0, 0, this.m_width, this.m_height);
+
+ // Clear depth to 1
+ ctx.clearBufferfv(gl.DEPTH, 0, [clearDepth]);
+
+ // Render gradient with depth = [-1..1]
+ ctx.enable(gl.DEPTH_TEST);
+ rrUtil.drawQuad(ctx, gradShaderID, [-1.0, -1.0, -1.0], [1.0, 1.0, 1.0]);
+
+ // Render grid pattern with depth = 0
+ var format = gl.RGBA;
+ var dataType = gl.UNSIGNED_BYTE;
+ var texW = 128;
+ var texH = 128;
+ var data = new tcuTexture.TextureLevel(gluTextureUtil.mapGLTransferFormat(format, dataType), texW, texH, 1);
+
+ tcuTextureUtil.fillWithGrid(data.getAccess(), 8, [0.2, 0.7, 0.1, 1.0], [0.7, 0.1, 0.5, 0.8]);
+
+ var gridTex = ctx.createTexture();
+ ctx.bindTexture(gl.TEXTURE_2D, gridTex);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ ctx.texImage2D(gl.TEXTURE_2D, 0, format, texW, texH, 0, format, dataType, data.getAccess().getDataPtr());
+
+ rrUtil.drawQuad(ctx, texShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]);
+ this.checkError();
+
+ // Read results.
+ this.readPixelsUsingFormat(dst, 0, 0, this.m_width, this.m_height,
+ gluTextureUtil.mapGLInternalFormat(colorFormat),
+ [1, 1, 1, 1], [0, 0, 0, 0]);
+};
+
+/**
+ * @constructor
+ * @extends {es3fFboTestCase.FboTestCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} format
+ * @param {number} width
+ * @param {number} height
+ */
+es3fFboDepthbufferTests.DepthWriteClampCase = function(name, desc, format, width, height) {
+ es3fFboTestCase.FboTestCase.call(this, name, desc);
+ this.m_format = format;
+ this.m_width = width;
+ this.m_height = height;
+};
+
+setParentClass(es3fFboDepthbufferTests.DepthWriteClampCase, es3fFboTestCase.FboTestCase);
+
+es3fFboDepthbufferTests.DepthWriteClampCase.prototype.preCheck = function() {
+ this.checkFormatSupport(this.m_format);
+ return true; // No exception thrown
+ };
+
+es3fFboDepthbufferTests.DepthWriteClampCase.prototype.render = function(dst) {
+ var ctx = this.getCurrentContext();
+ var colorFormat = gl.RGBA8;
+ var transferFmt = gluTextureUtil.getTransferFormat(gluTextureUtil.mapGLInternalFormat(this.m_format));
+ /** @type {es3fFboTestUtil.DepthGradientShader} */
+ var gradShader = new es3fFboTestUtil.DepthGradientShader(gluShaderUtil.DataType.FLOAT_VEC4);
+
+ var gradShaderID = ctx.createProgram(gradShader);
+ var clearDepth = 1;
+ var red = [1, 0, 0, 1];
+ var green = [0, 1, 0, 1];
+
+ // Setup FBO
+
+ var fbo = ctx.createFramebuffer();
+ var colorRbo = ctx.createRenderbuffer();
+ var depthTexture = ctx.createTexture();
+
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, colorRbo);
+ ctx.renderbufferStorage(gl.RENDERBUFFER, colorFormat, this.m_width, this.m_height);
+
+ ctx.bindTexture(gl.TEXTURE_2D, depthTexture);
+ ctx.texImage2D(gl.TEXTURE_2D, 0, this.m_format, this.m_width, this.m_height, 0, transferFmt.format, transferFmt.dataType, null);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorRbo);
+ ctx.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, depthTexture, 0);
+ this.checkError();
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ ctx.viewport(0, 0, this.m_width, this.m_height);
+
+ // Clear depth to 1
+ ctx.clearBufferfv(gl.DEPTH, 0, [clearDepth]);
+
+ // Render gradient with depth = [-1..1]
+ ctx.enable(gl.DEPTH_TEST);
+ ctx.depthFunc(gl.ALWAYS);
+ gradShader.setUniforms(ctx, gradShaderID, -1, 2, green);
+ rrUtil.drawQuad(ctx, gradShaderID, [-1.0, -1.0, -1.0], [1.0, 1.0, 1.0]);
+ ctx.depthMask(false);
+
+ // Test if any fragment has greater depth than 1; there should be none
+ ctx.depthFunc(gl.LESS); // (1 < depth) ?
+ gradShader.setUniforms(ctx, gradShaderID, 1, 1, red);
+ rrUtil.drawQuad(ctx, gradShaderID, [-1.0, -1.0, -1.0], [1.0, 1.0, 1.0]);
+
+ // Test if any fragment has smaller depth than 0; there should be none
+ ctx.depthFunc(gl.GREATER); // (0 > depth) ?
+ gradShader.setUniforms(ctx, gradShaderID, 0, 0, red);
+ rrUtil.drawQuad(ctx, gradShaderID, [-1.0, -1.0, -1.0], [1.0, 1.0, 1.0]);
+
+ // Read results.
+ this.readPixelsUsingFormat(dst, 0, 0, this.m_width, this.m_height,
+ gluTextureUtil.mapGLInternalFormat(colorFormat),
+ [1, 1, 1, 1], [0, 0, 0, 0]);
+
+ ctx.depthMask(true);
+};
+
+/**
+ * @constructor
+ * @extends {es3fFboTestCase.FboTestCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} format
+ * @param {number} width
+ * @param {number} height
+ */
+es3fFboDepthbufferTests.DepthTestClampCase = function(name, desc, format, width, height) {
+ es3fFboTestCase.FboTestCase.call(this, name, desc);
+ this.m_format = format;
+ this.m_width = width;
+ this.m_height = height;
+};
+
+setParentClass(es3fFboDepthbufferTests.DepthTestClampCase, es3fFboTestCase.FboTestCase);
+
+es3fFboDepthbufferTests.DepthTestClampCase.prototype.preCheck = function() {
+ this.checkFormatSupport(this.m_format);
+ return true; // No exception thrown
+ };
+
+es3fFboDepthbufferTests.DepthTestClampCase.prototype.render = function(dst) {
+ var ctx = this.getCurrentContext();
+ var colorFormat = gl.RGBA8;
+ var transferFmt = gluTextureUtil.getTransferFormat(gluTextureUtil.mapGLInternalFormat(this.m_format));
+ /** @type {es3fFboTestUtil.DepthGradientShader} */
+ var gradShader = new es3fFboTestUtil.DepthGradientShader(gluShaderUtil.DataType.FLOAT_VEC4);
+
+ var gradShaderID = ctx.createProgram(gradShader);
+ var clearDepth = 1;
+ var yellow = [1, 1, 0, 1];
+ var green = [0, 1, 0, 1];
+
+ // Setup FBO
+
+ var fbo = ctx.createFramebuffer();
+ var colorRbo = ctx.createRenderbuffer();
+ var depthTexture = ctx.createTexture();
+
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, colorRbo);
+ ctx.renderbufferStorage(gl.RENDERBUFFER, colorFormat, this.m_width, this.m_height);
+
+ ctx.bindTexture(gl.TEXTURE_2D, depthTexture);
+ ctx.texImage2D(gl.TEXTURE_2D, 0, this.m_format, this.m_width, this.m_height, 0, transferFmt.format, transferFmt.dataType, null);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorRbo);
+ ctx.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, depthTexture, 0);
+ this.checkError();
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ ctx.viewport(0, 0, this.m_width, this.m_height);
+
+ // Clear depth to 1
+ ctx.clearBufferfv(gl.DEPTH, 0, [clearDepth]);
+
+ // Test values used in depth test are clamped
+
+ // Render green quad, depth gradient = [-1..2]
+ ctx.enable(gl.DEPTH_TEST);
+ ctx.depthFunc(gl.ALWAYS);
+
+ gradShader.setUniforms(ctx, gradShaderID, -1, 2, green);
+ rrUtil.drawQuad(ctx, gradShaderID, [-1.0, -1.0, -1.0], [1.0, 1.0, 1.0]);
+
+ // Render yellow quad, depth gradient = [-0.5..3]. Gradients have equal values only outside [0, 1] range due to clamping
+ ctx.depthFunc(gl.EQUAL);
+
+ gradShader.setUniforms(ctx, gradShaderID, -0.5, 3, yellow);
+ rrUtil.drawQuad(ctx, gradShaderID, [-1.0, -1.0, -1.0], [1.0, 1.0, 1.0]);
+
+ // Read results.
+ this.readPixelsUsingFormat(dst, 0, 0, this.m_width, this.m_height,
+ gluTextureUtil.mapGLInternalFormat(colorFormat),
+ [1, 1, 1, 1], [0, 0, 0, 0]);
+};
+
+/**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+es3fFboDepthbufferTests.FboDepthbufferTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'depth', 'depth tests');
+};
+
+setParentClass(es3fFboDepthbufferTests.FboDepthbufferTests, tcuTestCase.DeqpTest);
+
+es3fFboDepthbufferTests.FboDepthbufferTests.prototype.init = function() {
+ var depthFormats = [
+ gl.DEPTH_COMPONENT32F,
+ gl.DEPTH_COMPONENT24,
+ gl.DEPTH_COMPONENT16,
+ gl.DEPTH32F_STENCIL8,
+ gl.DEPTH24_STENCIL8
+ ];
+
+ // .basic
+ var basicGroup = tcuTestCase.newTest('basic', 'Basic depth tests');
+ this.addChild(basicGroup);
+
+ for (var ndx = 0; ndx < depthFormats.length; ndx++)
+ basicGroup.addChild(new es3fFboDepthbufferTests.BasicFboDepthCase(es3fFboTestUtil.getFormatName(depthFormats[ndx]), '', depthFormats[ndx], 119, 127));
+
+ // .depth_write_clamp
+ var depthClampGroup = tcuTestCase.newTest('depth_write_clamp', 'Depth write clamping tests');
+ this.addChild(depthClampGroup);
+
+ for (var ndx = 0; ndx < depthFormats.length; ndx++)
+ depthClampGroup.addChild(new es3fFboDepthbufferTests.DepthWriteClampCase(es3fFboTestUtil.getFormatName(depthFormats[ndx]), '', depthFormats[ndx], 119, 127));
+
+ // .depth_test_clamp
+ var depthTestGroup = tcuTestCase.newTest('depth_test_clamp', 'Depth test value clamping tests');
+ this.addChild(depthTestGroup);
+
+ for (var ndx = 0; ndx < depthFormats.length; ndx++)
+ depthTestGroup.addChild(new es3fFboDepthbufferTests.DepthTestClampCase(es3fFboTestUtil.getFormatName(depthFormats[ndx]), '', depthFormats[ndx], 119, 127));
+
+};
+
+/**
+* Run test
+* @param {WebGL2RenderingContext} context
+*/
+es3fFboDepthbufferTests.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fFboDepthbufferTests.FboDepthbufferTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fFboDepthbufferTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboInvalidateTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboInvalidateTests.js
new file mode 100644
index 0000000000..3a90cceccd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboInvalidateTests.js
@@ -0,0 +1,1471 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fFboInvalidateTests');
+goog.require('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuRGBA');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluTextureUtil');
+goog.require('framework.referencerenderer.rrUtil');
+goog.require('functional.gles3.es3fFboTestCase');
+goog.require('functional.gles3.es3fFboTestUtil');
+
+goog.scope(function() {
+var es3fFboInvalidateTests = functional.gles3.es3fFboInvalidateTests;
+var tcuTestCase = framework.common.tcuTestCase;
+var es3fFboTestCase = functional.gles3.es3fFboTestCase;
+var es3fFboTestUtil = functional.gles3.es3fFboTestUtil;
+var rrUtil = framework.referencerenderer.rrUtil;
+var gluShaderUtil = framework.opengl.gluShaderUtil;
+var gluTextureUtil = framework.opengl.gluTextureUtil;
+var tcuTexture = framework.common.tcuTexture;
+var tcuTextureUtil = framework.common.tcuTextureUtil;
+var deMath = framework.delibs.debase.deMath;
+var tcuRGBA = framework.common.tcuRGBA;
+var tcuImageCompare = framework.common.tcuImageCompare;
+
+/** @type {WebGL2RenderingContext} */ var gl;
+
+var setParentClass = function(child, parent) {
+ child.prototype = Object.create(parent.prototype);
+ child.prototype.constructor = child;
+};
+
+var getDefaultFBDiscardAttachments = function(discardBufferBits) {
+ var attachments = [];
+
+ if (discardBufferBits & gl.COLOR_BUFFER_BIT)
+ attachments.push(gl.COLOR);
+
+ if (discardBufferBits & gl.DEPTH_BUFFER_BIT)
+ attachments.push(gl.DEPTH);
+
+ if (discardBufferBits & gl.STENCIL_BUFFER_BIT)
+ attachments.push(gl.STENCIL);
+
+ return attachments;
+};
+
+var getFBODiscardAttachments = function(discardBufferBits) {
+ var attachments = [];
+
+ if (discardBufferBits & gl.COLOR_BUFFER_BIT)
+ attachments.push(gl.COLOR_ATTACHMENT0);
+
+ // \note DEPTH_STENCIL_ATTACHMENT is allowed when discarding FBO, but not with default FB
+ if ((discardBufferBits & (gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)) == (gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT))
+ attachments.push(gl.DEPTH_STENCIL_ATTACHMENT);
+ else if (discardBufferBits & gl.DEPTH_BUFFER_BIT)
+ attachments.push(gl.DEPTH_ATTACHMENT);
+ else if (discardBufferBits & gl.STENCIL_BUFFER_BIT)
+ attachments.push(gl.STENCIL_ATTACHMENT);
+
+ return attachments;
+};
+
+var getCompatibleColorFormat = function() {
+ var redBits = gl.getParameter(gl.RED_BITS);
+ var greenBits = gl.getParameter(gl.GREEN_BITS);
+ var blueBits = gl.getParameter(gl.BLUE_BITS);
+ var alphaBits = gl.getParameter(gl.ALPHA_BITS);
+ switch ('' + redBits + greenBits + blueBits + alphaBits) {
+ case '8888' : return gl.RGBA8;
+ case '8880' : return gl.RGB8;
+ default:
+ throw new Error('Unexpected bit depth');
+ }
+};
+
+var getCompatibleDepthStencilFormat = function() {
+ var depthBits = /** @type {number} */ (gl.getParameter(gl.DEPTH_BITS));
+ var stencilBits = /** @type {number} */ (gl.getParameter(gl.STENCIL_BITS));
+ var hasDepth = depthBits > 0;
+ var hasStencil = stencilBits > 0;
+
+ if (!hasDepth || !hasStencil || (stencilBits != 8))
+ return gl.NONE;
+
+ if (depthBits == 32)
+ return gl.DEPTH32F_STENCIL8;
+ else if (depthBits == 24)
+ return gl.DEPTH24_STENCIL8;
+ else
+ return gl.NONE;
+};
+
+var hasAttachment = function(attachments, attachment) {
+ return attachments.indexOf(attachment) >= 0;
+};
+
+/**
+ * @constructor
+ * @extends {es3fFboTestCase.FboTestCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} buffers
+ * @param {number=} target
+ */
+es3fFboInvalidateTests.InvalidateDefaultFramebufferRenderCase = function(name, desc, buffers, target) {
+ es3fFboTestCase.FboTestCase.call(this, name, desc);
+ this.m_buffers = buffers;
+ this.m_fboTarget = target || gl.FRAMEBUFFER;
+};
+
+setParentClass(es3fFboInvalidateTests.InvalidateDefaultFramebufferRenderCase, es3fFboTestCase.FboTestCase);
+
+es3fFboInvalidateTests.InvalidateDefaultFramebufferRenderCase.prototype.render = function(dst) {
+ var ctx = this.getCurrentContext();
+ var attachments = getDefaultFBDiscardAttachments(this.m_buffers);
+
+ var shader = new es3fFboTestUtil.FlatColorShader(gluShaderUtil.DataType.FLOAT_VEC4);
+ var program = ctx.createProgram(shader);
+ shader.setColor(ctx, program, [1, 0, 0, 1]);
+ ctx.clearColor(0, 0, 0, 1);
+ ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+
+ ctx.enable(gl.DEPTH_TEST);
+ ctx.enable(gl.STENCIL_TEST);
+ ctx.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE);
+ ctx.stencilFunc(gl.ALWAYS, 1, 0xff);
+
+ rrUtil.drawQuad(ctx, program, [-1, -1, -1], [1, 1, 1]);
+ ctx.invalidateFramebuffer(this.m_fboTarget, attachments);
+
+ if ((this.m_buffers & gl.COLOR_BUFFER_BIT) != 0) {
+ // Color was not preserved - fill with green.
+ ctx.disable(gl.DEPTH_TEST);
+ ctx.disable(gl.STENCIL_TEST);
+
+ shader.setColor(ctx, program, [0, 1, 0, 1]);
+ rrUtil.drawQuad(ctx, program, [-1, -1, 0], [1, 1, 0]);
+
+ ctx.enable(gl.DEPTH_TEST);
+ ctx.enable(gl.STENCIL_TEST);
+ }
+
+ if ((this.m_buffers & gl.DEPTH_BUFFER_BIT) != 0) {
+ // Depth was not preserved.
+ ctx.depthFunc(gl.ALWAYS);
+ }
+
+ if ((this.m_buffers & gl.STENCIL_BUFFER_BIT) == 0) {
+ // Stencil was preserved.
+ ctx.stencilFunc(gl.EQUAL, 1, 0xff);
+ }
+
+ ctx.enable(gl.BLEND);
+ ctx.blendFunc(gl.ONE, gl.ONE);
+ ctx.blendEquation(gl.FUNC_ADD);
+
+ shader.setColor(ctx, program, [0, 0, 1, 1]);
+ rrUtil.drawQuad(ctx, program, [-1, -1, 0], [1, 1, 0]);
+ dst.readViewport(ctx);
+};
+
+/**
+ * @constructor
+ * @extends {es3fFboTestCase.FboTestCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} buffers
+ */
+es3fFboInvalidateTests.InvalidateDefaultFramebufferBindCase = function(name, desc, buffers) {
+ es3fFboTestCase.FboTestCase.call(this, name, desc);
+ this.m_buffers = buffers;
+};
+
+setParentClass(es3fFboInvalidateTests.InvalidateDefaultFramebufferBindCase, es3fFboTestCase.FboTestCase);
+
+es3fFboInvalidateTests.InvalidateDefaultFramebufferBindCase.prototype.render = function(dst) {
+ var ctx = this.getCurrentContext();
+ var attachments = getDefaultFBDiscardAttachments(this.m_buffers);
+
+ var shader = new es3fFboTestUtil.FlatColorShader(gluShaderUtil.DataType.FLOAT_VEC4);
+ var program = ctx.createProgram(shader);
+
+ /** @type {es3fFboTestUtil.Texture2DShader} */
+ var texShader = new es3fFboTestUtil.Texture2DShader(
+ [gluShaderUtil.DataType.SAMPLER_2D], gluShaderUtil.DataType.FLOAT_VEC4);
+
+ /** @type {es3fFboTestUtil.GradientShader} */
+ var gradShader = new es3fFboTestUtil.GradientShader(gluShaderUtil.DataType.FLOAT_VEC4);
+
+ var texShaderID = ctx.createProgram(texShader);
+ var gradShaderID = ctx.createProgram(gradShader);
+ ctx.clearColor(0, 0, 0, 1);
+ ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+ // Create fbo.
+ var fbo = ctx.createFramebuffer();
+ var tex = ctx.createTexture();
+ ctx.bindTexture(gl.TEXTURE_2D, tex);
+ ctx.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, this.getWidth(), this.getHeight(), 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ ctx.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);
+ ctx.bindTexture(gl.TEXTURE_2D, null);
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, null);
+
+ ctx.enable(gl.DEPTH_TEST);
+ ctx.enable(gl.STENCIL_TEST);
+ ctx.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE);
+ ctx.stencilFunc(gl.ALWAYS, 1, 0xff);
+
+ shader.setColor(ctx, program, [1, 0, 0, 1]);
+ rrUtil.drawQuad(ctx, program, [-1, -1, -1], [1, 1, 1]);
+
+ ctx.invalidateFramebuffer(gl.FRAMEBUFFER, attachments);
+
+ // Switch to fbo and render gradient into it.
+ ctx.disable(gl.DEPTH_TEST);
+ ctx.disable(gl.STENCIL_TEST);
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+
+ gradShader.setGradient(ctx, gradShaderID, [0, 0, 0, 0], [1, 1, 1, 1]);
+ rrUtil.drawQuad(ctx, gradShaderID, [-1, -1, 0], [1, 1, 0]);
+ // Restore default fbo.
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, null);
+
+ if ((this.m_buffers & gl.COLOR_BUFFER_BIT) != 0) {
+ // Color was not preserved - fill with green.
+ shader.setColor(ctx, program, [0, 1, 0, 1]);
+ rrUtil.drawQuad(ctx, program, [-1, -1, 0], [1, 1, 0]);
+ }
+
+ if ((this.m_buffers & gl.DEPTH_BUFFER_BIT) != 0) {
+ // Depth was not preserved.
+ ctx.depthFunc(gl.ALWAYS);
+ }
+
+ if ((this.m_buffers & gl.STENCIL_BUFFER_BIT) == 0) {
+ // Stencil was preserved.
+ ctx.stencilFunc(gl.EQUAL, 1, 0xff);
+ }
+
+ ctx.enable(gl.DEPTH_TEST);
+ ctx.enable(gl.STENCIL_TEST);
+ ctx.enable(gl.BLEND);
+ ctx.blendFunc(gl.ONE, gl.ONE);
+ ctx.blendEquation(gl.FUNC_ADD);
+ ctx.bindTexture(gl.TEXTURE_2D, tex);
+
+ texShader.setUniforms(ctx, texShaderID);
+ rrUtil.drawQuad(ctx, texShaderID, [-1, -1, 0], [1, 1, 0]);
+
+ dst.readViewport(ctx);
+};
+
+/**
+ * @constructor
+ * @extends {es3fFboTestCase.FboTestCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} buffers
+ * @param {number=} target
+ */
+es3fFboInvalidateTests.InvalidateDefaultSubFramebufferRenderCase = function(name, desc, buffers, target) {
+ es3fFboTestCase.FboTestCase.call(this, name, desc);
+ this.m_buffers = buffers;
+ this.m_fboTarget = target || gl.FRAMEBUFFER;
+};
+
+setParentClass(es3fFboInvalidateTests.InvalidateDefaultSubFramebufferRenderCase, es3fFboTestCase.FboTestCase);
+
+es3fFboInvalidateTests.InvalidateDefaultSubFramebufferRenderCase.prototype.render = function(dst) {
+ var ctx = this.getCurrentContext();
+ var invalidateX = this.getWidth() / 4;
+ var invalidateY = this.getHeight() / 4;
+ var invalidateW = this.getWidth() / 2;
+ var invalidateH = this.getHeight() / 2;
+ var attachments = getDefaultFBDiscardAttachments(this.m_buffers);
+
+ var shader = new es3fFboTestUtil.FlatColorShader(gluShaderUtil.DataType.FLOAT_VEC4);
+ var program = ctx.createProgram(shader);
+ shader.setColor(ctx, program, [1, 0, 0, 1]);
+ ctx.clearColor(0, 0, 0, 1);
+ ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+
+ ctx.enable(gl.DEPTH_TEST);
+ ctx.enable(gl.STENCIL_TEST);
+ ctx.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE);
+ ctx.stencilFunc(gl.ALWAYS, 1, 0xff);
+
+ rrUtil.drawQuad(ctx, program, [-1, -1, -1], [1, 1, 1]);
+ ctx.invalidateSubFramebuffer(this.m_fboTarget, attachments, invalidateX, invalidateY, invalidateW, invalidateH);
+
+ // Clear invalidated buffers.
+ ctx.clearColor(0, 1, 0, 1);
+ ctx.clearStencil(1);
+ ctx.scissor(invalidateX, invalidateY, invalidateW, invalidateH);
+ ctx.enable(gl.SCISSOR_TEST);
+ ctx.clear(this.m_buffers);
+ ctx.disable(gl.SCISSOR_TEST);
+
+ ctx.enable(gl.BLEND);
+ ctx.blendFunc(gl.ONE, gl.ONE);
+ ctx.blendEquation(gl.FUNC_ADD);
+
+ shader.setColor(ctx, program, [0, 0, 1, 1]);
+ rrUtil.drawQuad(ctx, program, [-1, -1, 0], [1, 1, 0]);
+ dst.readViewport(ctx);
+};
+
+/**
+ * @constructor
+ * @extends {es3fFboTestCase.FboTestCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} buffers
+ */
+es3fFboInvalidateTests.InvalidateDefaultSubFramebufferBindCase = function(name, desc, buffers) {
+ es3fFboTestCase.FboTestCase.call(this, name, desc);
+ this.m_buffers = buffers;
+};
+
+setParentClass(es3fFboInvalidateTests.InvalidateDefaultSubFramebufferBindCase, es3fFboTestCase.FboTestCase);
+
+es3fFboInvalidateTests.InvalidateDefaultSubFramebufferBindCase.prototype.render = function(dst) {
+ var ctx = this.getCurrentContext();
+ var attachments = getDefaultFBDiscardAttachments(this.m_buffers);
+ var invalidateX = this.getWidth() / 4;
+ var invalidateY = this.getHeight() / 4;
+ var invalidateW = this.getWidth() / 2;
+ var invalidateH = this.getHeight() / 2;
+
+ var shader = new es3fFboTestUtil.FlatColorShader(gluShaderUtil.DataType.FLOAT_VEC4);
+ var program = ctx.createProgram(shader);
+
+ /** @type {es3fFboTestUtil.Texture2DShader} */
+ var texShader = new es3fFboTestUtil.Texture2DShader(
+ [gluShaderUtil.DataType.SAMPLER_2D], gluShaderUtil.DataType.FLOAT_VEC4);
+
+ /** @type {es3fFboTestUtil.GradientShader} */
+ var gradShader = new es3fFboTestUtil.GradientShader(gluShaderUtil.DataType.FLOAT_VEC4);
+
+ var texShaderID = ctx.createProgram(texShader);
+ var gradShaderID = ctx.createProgram(gradShader);
+ ctx.clearColor(0, 0, 0, 1);
+ ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+ // Create fbo.
+ var fbo = ctx.createFramebuffer();
+ var tex = ctx.createTexture();
+ ctx.bindTexture(gl.TEXTURE_2D, tex);
+ ctx.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, this.getWidth(), this.getHeight(), 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ ctx.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);
+ ctx.bindTexture(gl.TEXTURE_2D, null);
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, null);
+
+ ctx.enable(gl.DEPTH_TEST);
+ ctx.enable(gl.STENCIL_TEST);
+ ctx.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE);
+ ctx.stencilFunc(gl.ALWAYS, 1, 0xff);
+
+ shader.setColor(ctx, program, [1, 0, 0, 1]);
+ rrUtil.drawQuad(ctx, program, [-1, -1, -1], [1, 1, 1]);
+
+ ctx.invalidateSubFramebuffer(gl.FRAMEBUFFER, attachments, invalidateX, invalidateY, invalidateW, invalidateH);
+
+ // Switch to fbo and render gradient into it.
+ ctx.disable(gl.DEPTH_TEST);
+ ctx.disable(gl.STENCIL_TEST);
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+
+ gradShader.setGradient(ctx, gradShaderID, [0, 0, 0, 0], [1, 1, 1, 1]);
+ rrUtil.drawQuad(ctx, gradShaderID, [-1, -1, 0], [1, 1, 0]);
+ // Restore default fbo.
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, null);
+
+ if ((this.m_buffers & gl.COLOR_BUFFER_BIT) != 0) {
+ // Color was not preserved - fill with green.
+ shader.setColor(ctx, program, [0, 1, 0, 1]);
+ rrUtil.drawQuad(ctx, program, [-1, -1, 0], [1, 1, 0]);
+ }
+
+ // Clear invalidated buffers.
+ ctx.clearColor(0, 1, 0, 1);
+ ctx.clearStencil(1);
+ ctx.scissor(invalidateX, invalidateY, invalidateW, invalidateH);
+ ctx.enable(gl.SCISSOR_TEST);
+ ctx.clear(this.m_buffers);
+ ctx.disable(gl.SCISSOR_TEST);
+
+ ctx.enable(gl.DEPTH_TEST);
+ ctx.enable(gl.STENCIL_TEST);
+ ctx.enable(gl.BLEND);
+ ctx.blendFunc(gl.ONE, gl.ONE);
+ ctx.blendEquation(gl.FUNC_ADD);
+ ctx.bindTexture(gl.TEXTURE_2D, tex);
+
+ texShader.setUniforms(ctx, texShaderID);
+ rrUtil.drawQuad(ctx, texShaderID, [-1, -1, 0], [1, 1, 0]);
+
+ dst.readViewport(ctx);
+ ctx.disable(gl.DEPTH_TEST);
+ ctx.disable(gl.STENCIL_TEST);
+ ctx.disable(gl.BLEND);
+};
+
+/**
+ * @constructor
+ * @extends {es3fFboTestCase.FboTestCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} colorFmt
+ * @param {number} depthStencilFmt
+ * @param {number} invalidateBuffers
+ */
+es3fFboInvalidateTests.InvalidateFboRenderCase = function(name, desc, colorFmt, depthStencilFmt, invalidateBuffers) {
+ es3fFboTestCase.FboTestCase.call(this, name, desc);
+ this.m_colorFmt = colorFmt;
+ this.m_depthStencilFmt = depthStencilFmt;
+ this.m_invalidateBuffers = invalidateBuffers;
+};
+
+setParentClass(es3fFboInvalidateTests.InvalidateFboRenderCase, es3fFboTestCase.FboTestCase);
+
+es3fFboInvalidateTests.InvalidateFboRenderCase.prototype.preCheck = function() {
+ if (this.m_colorFmt != gl.NONE) this.checkFormatSupport(this.m_colorFmt);
+ if (this.m_depthStencilFmt != gl.NONE) this.checkFormatSupport(this.m_depthStencilFmt);
+ return true; // No exception thrown
+};
+
+es3fFboInvalidateTests.InvalidateFboRenderCase.prototype.render = function(dst) {
+ var ctx = this.getCurrentContext();
+ var colorFmt = gluTextureUtil.mapGLInternalFormat(this.m_colorFmt);
+ var depthStencilFmt = this.m_depthStencilFmt != gl.NONE ? gluTextureUtil.mapGLInternalFormat(this.m_depthStencilFmt) : new tcuTexture.TextureFormat(null, null);
+ var colorFmtInfo = tcuTextureUtil.getTextureFormatInfo(colorFmt);
+ var depth = depthStencilFmt.order == tcuTexture.ChannelOrder.D || depthStencilFmt.order == tcuTexture.ChannelOrder.DS;
+ var stencil = depthStencilFmt.order == tcuTexture.ChannelOrder.S || depthStencilFmt.order == tcuTexture.ChannelOrder.DS;
+ var cBias = colorFmtInfo.valueMin;
+ var cScale = deMath.subtract(colorFmtInfo.valueMax, colorFmtInfo.valueMin);
+ var flatShader = new es3fFboTestUtil.FlatColorShader(gluShaderUtil.DataType.FLOAT_VEC4);
+ var attachments = getFBODiscardAttachments(this.m_invalidateBuffers);
+ var flatShaderID = ctx.createProgram(flatShader);
+
+ // Create fbo.
+ var colorRbo = ctx.createRenderbuffer();
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, colorRbo);
+ ctx.renderbufferStorage(gl.RENDERBUFFER, this.m_colorFmt, this.getWidth(), this.getHeight());
+
+ if (this.m_depthStencilFmt != gl.NONE) {
+ var depthStencilRbo = ctx.createRenderbuffer();
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, depthStencilRbo);
+ ctx.renderbufferStorage(gl.RENDERBUFFER, this.m_depthStencilFmt, this.getWidth(), this.getHeight());
+ }
+
+ var fbo = ctx.createFramebuffer();
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorRbo);
+
+ if (depth)
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthStencilRbo);
+
+ if (stencil)
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, depthStencilRbo);
+
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ ctx.clearColor(0, 0, 0, 1);
+ ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+
+ ctx.enable(gl.DEPTH_TEST);
+ ctx.enable(gl.STENCIL_TEST);
+ ctx.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE);
+ ctx.stencilFunc(gl.ALWAYS, 1, 0xff);
+
+ flatShader.setColor(ctx, flatShaderID, deMath.add(deMath.multiply([1, 0, 0, 1], cScale), cBias));
+ rrUtil.drawQuad(ctx, flatShaderID, [-1, -1, -1], [1, 1, 1]);
+
+ ctx.invalidateFramebuffer(gl.FRAMEBUFFER, attachments);
+
+ if ((this.m_invalidateBuffers & gl.COLOR_BUFFER_BIT) != 0) {
+ // Color was not preserved - fill with green.
+ ctx.disable(gl.DEPTH_TEST);
+ ctx.disable(gl.STENCIL_TEST);
+
+ flatShader.setColor(ctx, flatShaderID, deMath.add(deMath.multiply([0, 1, 0, 1], cScale), cBias));
+ rrUtil.drawQuad(ctx, flatShaderID, [-1, -1, 0], [1, 1, 0]);
+
+ ctx.enable(gl.DEPTH_TEST);
+ ctx.enable(gl.STENCIL_TEST);
+ }
+
+ if ((this.m_invalidateBuffers & gl.DEPTH_BUFFER_BIT) != 0) {
+ // Depth was not preserved.
+ ctx.depthFunc(gl.ALWAYS);
+ }
+
+ if ((this.m_invalidateBuffers & gl.STENCIL_BUFFER_BIT) == 0) {
+ // Stencil was preserved.
+ ctx.stencilFunc(gl.EQUAL, 1, 0xff);
+ }
+
+ ctx.enable(gl.BLEND);
+ ctx.blendFunc(gl.ONE, gl.ONE);
+ ctx.blendEquation(gl.FUNC_ADD);
+
+ flatShader.setColor(ctx, flatShaderID, deMath.add(deMath.multiply([0, 0, 1, 1], cScale), cBias));
+ rrUtil.drawQuad(ctx, flatShaderID, [-1, -1, 0], [1, 1, 0]);
+
+ es3fFboTestUtil.readPixels(ctx, dst, 0, 0, this.getWidth(), this.getHeight(), colorFmt, colorFmtInfo.lookupScale, colorFmtInfo.lookupBias);
+};
+
+/**
+ * @constructor
+ * @extends {es3fFboTestCase.FboTestCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} colorFmt
+ * @param {number} depthStencilFmt
+ * @param {number} invalidateBuffers
+ */
+es3fFboInvalidateTests.InvalidateFboUnbindReadCase = function(name, desc, colorFmt, depthStencilFmt, invalidateBuffers) {
+ es3fFboTestCase.FboTestCase.call(this, name, desc);
+ this.m_colorFmt = colorFmt;
+ this.m_depthStencilFmt = depthStencilFmt;
+ this.m_invalidateBuffers = invalidateBuffers;
+};
+
+setParentClass(es3fFboInvalidateTests.InvalidateFboUnbindReadCase, es3fFboTestCase.FboTestCase);
+
+es3fFboInvalidateTests.InvalidateFboUnbindReadCase.prototype.preCheck = function() {
+ if (this.m_colorFmt != gl.NONE) this.checkFormatSupport(this.m_colorFmt);
+ if (this.m_depthStencilFmt != gl.NONE) this.checkFormatSupport(this.m_depthStencilFmt);
+ return true; // No exception thrown
+};
+
+es3fFboInvalidateTests.InvalidateFboUnbindReadCase.prototype.render = function(dst) {
+ var ctx = this.getCurrentContext();
+ var colorFmt = gluTextureUtil.mapGLInternalFormat(this.m_colorFmt);
+ var depthStencilFmt = this.m_depthStencilFmt != gl.NONE ? gluTextureUtil.mapGLInternalFormat(this.m_depthStencilFmt) : new tcuTexture.TextureFormat(null, null);
+ var colorFmtInfo = tcuTextureUtil.getTextureFormatInfo(colorFmt);
+ var depth = depthStencilFmt.order == tcuTexture.ChannelOrder.D || depthStencilFmt.order == tcuTexture.ChannelOrder.DS;
+ var stencil = depthStencilFmt.order == tcuTexture.ChannelOrder.S || depthStencilFmt.order == tcuTexture.ChannelOrder.DS;
+ var attachments = getFBODiscardAttachments(this.m_invalidateBuffers);
+ // Create fbo.
+ var transferFmt = gluTextureUtil.getTransferFormat(colorFmt);
+ var gradShader = new es3fFboTestUtil.GradientShader(gluShaderUtil.DataType.FLOAT_VEC4);
+ var gradShaderID = ctx.createProgram(gradShader);
+
+ var colorTex = ctx.createTexture();
+ ctx.bindTexture(gl.TEXTURE_2D, colorTex);
+ ctx.texImage2D(gl.TEXTURE_2D, 0, this.m_colorFmt, this.getWidth(), this.getHeight(), 0, transferFmt.format, transferFmt.dataType, null);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+
+ if (this.m_depthStencilFmt != gl.NONE) {
+ transferFmt = gluTextureUtil.getTransferFormat(depthStencilFmt);
+
+ var depthStencilTex = ctx.createTexture();
+ ctx.bindTexture(gl.TEXTURE_2D, depthStencilTex);
+ ctx.texImage2D(gl.TEXTURE_2D, 0, this.m_depthStencilFmt, this.getWidth(), this.getHeight(), 0, transferFmt.format, transferFmt.dataType, null);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+ }
+
+ var fbo = ctx.createFramebuffer();
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ ctx.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, colorTex, 0);
+
+ if (depth)
+ ctx.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, depthStencilTex, 0);
+
+ if (stencil)
+ ctx.framebufferTexture2D(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.TEXTURE_2D, depthStencilTex, 0);
+
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ ctx.clearColor(0, 0, 0, 1);
+ ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+
+ ctx.enable(gl.DEPTH_TEST);
+ ctx.enable(gl.STENCIL_TEST);
+ ctx.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE);
+ ctx.stencilFunc(gl.ALWAYS, 1, 0xff);
+
+ gradShader.setGradient(ctx, gradShaderID, colorFmtInfo.valueMin, colorFmtInfo.valueMax);
+ rrUtil.drawQuad(ctx, gradShaderID, [-1, -1, -1], [1, 1, 1]);
+
+ ctx.invalidateFramebuffer(gl.FRAMEBUFFER, attachments);
+
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, null);
+ ctx.disable(gl.DEPTH_TEST);
+ ctx.disable(gl.STENCIL_TEST);
+
+ if ((this.m_invalidateBuffers & gl.DEPTH_BUFFER_BIT) != 0) {
+ // Render color.
+ /** @type {es3fFboTestUtil.Texture2DShader} */
+ var texShader = new es3fFboTestUtil.Texture2DShader(
+ [gluTextureUtil.getSampler2DType(colorFmt)], gluShaderUtil.DataType.FLOAT_VEC4);
+ var texShaderID = ctx.createProgram(texShader);
+
+ texShader.setTexScaleBias(0, colorFmtInfo.lookupScale, colorFmtInfo.lookupBias);
+ texShader.setUniforms(ctx, texShaderID);
+
+ ctx.bindTexture(gl.TEXTURE_2D, colorTex);
+ rrUtil.drawQuad(ctx, texShaderID, [-1, -1, 0], [1, 1, 0]);
+ } else {
+ // Render depth.
+ texShader = new es3fFboTestUtil.Texture2DShader(
+ [gluTextureUtil.getSampler2DType(depthStencilFmt)], gluShaderUtil.DataType.FLOAT_VEC4);
+ texShaderID = ctx.createProgram(texShader);
+
+ texShader.setUniforms(ctx, texShaderID);
+
+ ctx.bindTexture(gl.TEXTURE_2D, depthStencilTex);
+ rrUtil.drawQuad(ctx, texShaderID, [-1, -1, 0], [1, 1, 0]);
+ }
+
+ dst.readViewport(ctx);
+};
+
+/**
+ * @constructor
+ * @extends {es3fFboTestCase.FboTestCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} numSamples
+ * @param {number} invalidateBuffers
+ */
+es3fFboInvalidateTests.InvalidateFboUnbindBlitCase = function(name, desc, numSamples, invalidateBuffers) {
+// \note Use fullscreen viewport when multisampling - we can't allow GLES3Context do its
+// behing-the-scenes viewport position randomization, because with glBlitFramebuffer,
+// source and destination rectangles must match when multisampling.
+ es3fFboTestCase.FboTestCase.call(this, name, desc, numSamples > 0);
+ this.m_numSamples = numSamples;
+ this.m_colorFmt = getCompatibleColorFormat();
+ this.m_depthStencilFmt = getCompatibleDepthStencilFormat();
+ this.m_invalidateBuffers = invalidateBuffers;
+};
+
+setParentClass(es3fFboInvalidateTests.InvalidateFboUnbindBlitCase, es3fFboTestCase.FboTestCase);
+
+es3fFboInvalidateTests.InvalidateFboUnbindBlitCase.prototype.preCheck = function() {
+ if (this.m_colorFmt != gl.NONE) this.checkFormatSupport(this.m_colorFmt);
+ if (this.m_depthStencilFmt != gl.NONE) this.checkFormatSupport(this.m_depthStencilFmt);
+ return true; // No exception thrown
+};
+
+es3fFboInvalidateTests.InvalidateFboUnbindBlitCase.prototype.render = function(dst) {
+ var ctx = this.getCurrentContext();
+ var quadSizePixels = [this.m_numSamples == 0 ? this.getWidth() : Math.min(128, this.getWidth()),
+ this.m_numSamples == 0 ? this.getHeight() : Math.min(128, this.getHeight())];
+ var quadNDCLeftBottomXY = [-1, -1];
+ var quadNDCSize = [2 * quadSizePixels[0] / this.getWidth(), 2 * quadSizePixels[1] / this.getHeight()];
+ var quadNDCRightTopXY = deMath.add(quadNDCLeftBottomXY, quadNDCSize);
+ var depthStencilFmt = this.m_depthStencilFmt != gl.NONE ? gluTextureUtil.mapGLInternalFormat(this.m_depthStencilFmt) : new tcuTexture.TextureFormat(null, null);
+ var depth = depthStencilFmt.order == tcuTexture.ChannelOrder.D || depthStencilFmt.order == tcuTexture.ChannelOrder.DS;
+ var stencil = depthStencilFmt.order == tcuTexture.ChannelOrder.S || depthStencilFmt.order == tcuTexture.ChannelOrder.DS;
+ var flatShader = new es3fFboTestUtil.FlatColorShader(gluShaderUtil.DataType.FLOAT_VEC4);
+ var attachments = getFBODiscardAttachments(this.m_invalidateBuffers);
+ var flatShaderID = ctx.createProgram(flatShader);
+
+ ctx.clearColor(0, 0, 0, 1);
+ ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+
+ // Create fbo.
+ var colorRbo = ctx.createRenderbuffer();
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, colorRbo);
+ ctx.renderbufferStorageMultisample(gl.RENDERBUFFER, this.m_numSamples, this.m_colorFmt, quadSizePixels[0], quadSizePixels[1]);
+
+ if (this.m_depthStencilFmt != gl.NONE) {
+ var depthStencilRbo = ctx.createRenderbuffer();
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, depthStencilRbo);
+ ctx.renderbufferStorageMultisample(gl.RENDERBUFFER, this.m_numSamples, this.m_depthStencilFmt, quadSizePixels[0], quadSizePixels[1]);
+ }
+
+ var fbo = ctx.createFramebuffer();
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorRbo);
+
+ if (depth)
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthStencilRbo);
+
+ if (stencil)
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, depthStencilRbo);
+
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+
+ ctx.enable(gl.DEPTH_TEST);
+ ctx.enable(gl.STENCIL_TEST);
+ ctx.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE);
+ ctx.stencilFunc(gl.ALWAYS, 1, 0xff);
+
+ flatShader.setColor(ctx, flatShaderID, [1, 0, 0, 1]);
+ rrUtil.drawQuad(ctx, flatShaderID,
+ [quadNDCLeftBottomXY[0], quadNDCLeftBottomXY[1], -1],
+ [quadNDCRightTopXY[0], quadNDCRightTopXY[1], 1]);
+
+ ctx.invalidateFramebuffer(gl.FRAMEBUFFER, attachments);
+
+ // Set default framebuffer as draw framebuffer and blit preserved buffers.
+ ctx.bindFramebuffer(gl.DRAW_FRAMEBUFFER, null);
+ ctx.blitFramebuffer(0, 0, quadSizePixels[0], quadSizePixels[1],
+ 0, 0, quadSizePixels[0], quadSizePixels[1],
+ (gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT) & ~this.m_invalidateBuffers, gl.NEAREST);
+ ctx.bindFramebuffer(gl.READ_FRAMEBUFFER, null);
+
+ if ((this.m_invalidateBuffers & gl.COLOR_BUFFER_BIT) != 0) {
+ // Color was not preserved - fill with green.
+ ctx.disable(gl.DEPTH_TEST);
+ ctx.disable(gl.STENCIL_TEST);
+
+ flatShader.setColor(ctx, flatShaderID, [0, 1, 0, 1]);
+ rrUtil.drawQuad(ctx, flatShaderID,
+ [quadNDCLeftBottomXY[0], quadNDCLeftBottomXY[1], 0],
+ [quadNDCRightTopXY[0], quadNDCRightTopXY[1], 0]);
+
+ ctx.enable(gl.DEPTH_TEST);
+ ctx.enable(gl.STENCIL_TEST);
+ }
+
+ if ((this.m_invalidateBuffers & gl.DEPTH_BUFFER_BIT) != 0) {
+ // Depth was not preserved.
+ ctx.depthFunc(gl.ALWAYS);
+ }
+
+ if ((this.m_invalidateBuffers & gl.STENCIL_BUFFER_BIT) == 0) {
+ // Stencil was preserved.
+ ctx.stencilFunc(gl.EQUAL, 1, 0xff);
+ }
+
+ ctx.enable(gl.BLEND);
+ ctx.blendFunc(gl.ONE, gl.ONE);
+ ctx.blendEquation(gl.FUNC_ADD);
+
+ flatShader.setColor(ctx, flatShaderID, [0, 0, 1, 1]);
+ rrUtil.drawQuad(ctx, flatShaderID,
+ [quadNDCLeftBottomXY[0], quadNDCLeftBottomXY[1], 0],
+ [quadNDCRightTopXY[0], quadNDCRightTopXY[1], 0]);
+
+ dst.readViewport(ctx, [0, 0, quadSizePixels[0], quadSizePixels[1]]);
+};
+
+/**
+ * @constructor
+ * @extends {es3fFboTestCase.FboTestCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} colorFmt
+ * @param {number} depthStencilFmt
+ * @param {number} invalidateBuffers
+ */
+es3fFboInvalidateTests.InvalidateSubFboUnbindReadCase = function(name, desc, colorFmt, depthStencilFmt, invalidateBuffers) {
+ es3fFboTestCase.FboTestCase.call(this, name, desc);
+ this.m_colorFmt = colorFmt;
+ this.m_depthStencilFmt = depthStencilFmt;
+ this.m_invalidateBuffers = invalidateBuffers;
+};
+
+setParentClass(es3fFboInvalidateTests.InvalidateSubFboUnbindReadCase, es3fFboTestCase.FboTestCase);
+
+es3fFboInvalidateTests.InvalidateSubFboUnbindReadCase.prototype.preCheck = function() {
+ if (this.m_colorFmt != gl.NONE) this.checkFormatSupport(this.m_colorFmt);
+ if (this.m_depthStencilFmt != gl.NONE) this.checkFormatSupport(this.m_depthStencilFmt);
+ return true; // No exception thrown
+};
+
+es3fFboInvalidateTests.InvalidateSubFboUnbindReadCase.prototype.compare = function(reference, result) {
+ var threshold = tcuRGBA.max(es3fFboTestUtil.getFormatThreshold(this.m_colorFmt), new tcuRGBA.RGBA([12, 12, 12, 12]));
+ return tcuImageCompare.bilinearCompare('Result', 'Image comparison result', reference.getAccess(), result.getAccess(), threshold);
+};
+
+es3fFboInvalidateTests.InvalidateSubFboUnbindReadCase.prototype.render = function(dst) {
+ var ctx = this.getCurrentContext();
+ var colorFmt = gluTextureUtil.mapGLInternalFormat(this.m_colorFmt);
+ var depthStencilFmt = this.m_depthStencilFmt != gl.NONE ? gluTextureUtil.mapGLInternalFormat(this.m_depthStencilFmt) : new tcuTexture.TextureFormat(null, null);
+ var colorFmtInfo = tcuTextureUtil.getTextureFormatInfo(colorFmt);
+ var depth = depthStencilFmt.order == tcuTexture.ChannelOrder.D || depthStencilFmt.order == tcuTexture.ChannelOrder.DS;
+ var stencil = depthStencilFmt.order == tcuTexture.ChannelOrder.S || depthStencilFmt.order == tcuTexture.ChannelOrder.DS;
+ var attachments = getFBODiscardAttachments(this.m_invalidateBuffers);
+ // Create fbo.
+ var transferFmt = gluTextureUtil.getTransferFormat(colorFmt);
+ var gradShader = new es3fFboTestUtil.GradientShader(es3fFboTestUtil.getFragmentOutputType(colorFmt));
+ var gradShaderID = ctx.createProgram(gradShader);
+ var invalidateX = 0;
+ var invalidateY = 0;
+ var invalidateW = this.getWidth() / 2;
+ var invalidateH = this.getHeight();
+ var readX = invalidateW;
+ var readY = 0;
+ var readW = this.getWidth() / 2;
+ var readH = this.getHeight();
+
+ var colorTex = ctx.createTexture();
+ ctx.bindTexture(gl.TEXTURE_2D, colorTex);
+ ctx.texImage2D(gl.TEXTURE_2D, 0, this.m_colorFmt, this.getWidth(), this.getHeight(), 0, transferFmt.format, transferFmt.dataType, null);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+
+ if (this.m_depthStencilFmt != gl.NONE) {
+ transferFmt = gluTextureUtil.getTransferFormat(depthStencilFmt);
+
+ var depthStencilTex = ctx.createTexture();
+ ctx.bindTexture(gl.TEXTURE_2D, depthStencilTex);
+ ctx.texImage2D(gl.TEXTURE_2D, 0, this.m_depthStencilFmt, this.getWidth(), this.getHeight(), 0, transferFmt.format, transferFmt.dataType, null);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+ }
+
+ var fbo = ctx.createFramebuffer();
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ ctx.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, colorTex, 0);
+
+ if (depth)
+ ctx.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, depthStencilTex, 0);
+
+ if (stencil)
+ ctx.framebufferTexture2D(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.TEXTURE_2D, depthStencilTex, 0);
+
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ this.clearColorBuffer(colorFmt, [0.0, 0.0, 0.0, 1.0]);
+ ctx.clear(gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+
+ ctx.enable(gl.DEPTH_TEST);
+ ctx.enable(gl.STENCIL_TEST);
+ ctx.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE);
+ ctx.stencilFunc(gl.ALWAYS, 1, 0xff);
+
+ gradShader.setGradient(ctx, gradShaderID, colorFmtInfo.valueMin, colorFmtInfo.valueMax);
+ rrUtil.drawQuad(ctx, gradShaderID, [-1, -1, -1], [1, 1, 1]);
+
+ ctx.invalidateSubFramebuffer(gl.FRAMEBUFFER, attachments, invalidateX, invalidateY, invalidateW, invalidateH);
+
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, null);
+ ctx.disable(gl.DEPTH_TEST);
+ ctx.disable(gl.STENCIL_TEST);
+
+ ctx.clearColor(0.25, 0.5, 0.75, 1);
+ ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+
+ // Limit read area using scissor.
+ ctx.scissor(readX, readY, readW, readH);
+ ctx.enable(gl.SCISSOR_TEST);
+
+ if ((this.m_invalidateBuffers & gl.COLOR_BUFFER_BIT) != 0) {
+ // Render color.
+ /** @type {es3fFboTestUtil.Texture2DShader} */
+ var texShader = new es3fFboTestUtil.Texture2DShader(
+ [gluTextureUtil.getSampler2DType(colorFmt)], gluShaderUtil.DataType.FLOAT_VEC4);
+ var texShaderID = ctx.createProgram(texShader);
+
+ texShader.setTexScaleBias(0, colorFmtInfo.lookupScale, colorFmtInfo.lookupBias);
+ texShader.setUniforms(ctx, texShaderID);
+
+ ctx.bindTexture(gl.TEXTURE_2D, colorTex);
+ rrUtil.drawQuad(ctx, texShaderID, [-1, -1, 0], [1, 1, 0]);
+ } else {
+ // Render depth.
+ texShader = new es3fFboTestUtil.Texture2DShader(
+ [gluTextureUtil.getSampler2DType(depthStencilFmt)], gluShaderUtil.DataType.FLOAT_VEC4);
+ texShaderID = ctx.createProgram(texShader);
+
+ texShader.setUniforms(ctx, texShaderID);
+
+ ctx.bindTexture(gl.TEXTURE_2D, depthStencilTex);
+ rrUtil.drawQuad(ctx, texShaderID, [-1, -1, 0], [1, 1, 0]);
+ }
+
+ dst.readViewport(ctx);
+};
+
+/**
+ * @constructor
+ * @extends {es3fFboTestCase.FboTestCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} colorFmt
+ * @param {number} depthStencilFmt
+ * @param {number} invalidateBuffers
+ */
+es3fFboInvalidateTests.InvalidateSubFboRenderCase = function(name, desc, colorFmt, depthStencilFmt, invalidateBuffers) {
+ es3fFboTestCase.FboTestCase.call(this, name, desc);
+ this.m_colorFmt = colorFmt;
+ this.m_depthStencilFmt = depthStencilFmt;
+ this.m_invalidateBuffers = invalidateBuffers;
+};
+
+setParentClass(es3fFboInvalidateTests.InvalidateSubFboRenderCase, es3fFboTestCase.FboTestCase);
+
+es3fFboInvalidateTests.InvalidateSubFboRenderCase.prototype.preCheck = function() {
+ if (this.m_colorFmt != gl.NONE) this.checkFormatSupport(this.m_colorFmt);
+ if (this.m_depthStencilFmt != gl.NONE) this.checkFormatSupport(this.m_depthStencilFmt);
+ return true; // No exception thrown
+};
+
+es3fFboInvalidateTests.InvalidateSubFboRenderCase.prototype.render = function(dst) {
+ var ctx = this.getCurrentContext();
+ var colorFmt = gluTextureUtil.mapGLInternalFormat(this.m_colorFmt);
+ var depthStencilFmt = this.m_depthStencilFmt != gl.NONE ? gluTextureUtil.mapGLInternalFormat(this.m_depthStencilFmt) : new tcuTexture.TextureFormat(null, null);
+ var colorFmtInfo = tcuTextureUtil.getTextureFormatInfo(colorFmt);
+ var depth = depthStencilFmt.order == tcuTexture.ChannelOrder.D || depthStencilFmt.order == tcuTexture.ChannelOrder.DS;
+ var stencil = depthStencilFmt.order == tcuTexture.ChannelOrder.S || depthStencilFmt.order == tcuTexture.ChannelOrder.DS;
+ var cBias = colorFmtInfo.valueMin;
+ var cScale = deMath.subtract(colorFmtInfo.valueMax, colorFmtInfo.valueMin);
+ var flatShader = new es3fFboTestUtil.FlatColorShader(gluShaderUtil.DataType.FLOAT_VEC4);
+ var attachments = getFBODiscardAttachments(this.m_invalidateBuffers);
+ var flatShaderID = ctx.createProgram(flatShader);
+ var invalidateX = this.getWidth() / 4;
+ var invalidateY = this.getHeight() / 4;
+ var invalidateW = this.getWidth() / 2;
+ var invalidateH = this.getHeight() / 2;
+
+ // Create fbo.
+ var colorRbo = ctx.createRenderbuffer();
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, colorRbo);
+ ctx.renderbufferStorage(gl.RENDERBUFFER, this.m_colorFmt, this.getWidth(), this.getHeight());
+
+ if (this.m_depthStencilFmt != gl.NONE) {
+ var depthStencilRbo = ctx.createRenderbuffer();
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, depthStencilRbo);
+ ctx.renderbufferStorage(gl.RENDERBUFFER, this.m_depthStencilFmt, this.getWidth(), this.getHeight());
+ }
+
+ var fbo = ctx.createFramebuffer();
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorRbo);
+
+ if (depth)
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthStencilRbo);
+
+ if (stencil)
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, depthStencilRbo);
+
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ ctx.clearBufferfv(gl.COLOR, 0, deMath.add(deMath.multiply([0, 0, 0, 1], cScale), cBias));
+ ctx.clearBufferfi(gl.DEPTH_STENCIL, 0, 1, 0);
+
+ ctx.enable(gl.DEPTH_TEST);
+ ctx.enable(gl.STENCIL_TEST);
+ ctx.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE);
+ ctx.stencilFunc(gl.ALWAYS, 1, 0xff);
+
+ flatShader.setColor(ctx, flatShaderID, deMath.add(deMath.multiply([1, 0, 0, 1], cScale), cBias));
+ rrUtil.drawQuad(ctx, flatShaderID, [-1, -1, -1], [1, 1, 1]);
+
+ ctx.invalidateSubFramebuffer(gl.FRAMEBUFFER, attachments, invalidateX, invalidateY, invalidateW, invalidateH);
+
+ // Clear invalidated buffers.
+ ctx.scissor(invalidateX, invalidateY, invalidateW, invalidateH);
+ ctx.enable(gl.SCISSOR_TEST);
+
+ if (this.m_invalidateBuffers & gl.COLOR_BUFFER_BIT)
+ ctx.clearBufferfv(gl.COLOR, 0, deMath.add(deMath.multiply([0, 1, 0, 1], cScale), cBias));
+
+ ctx.clear(this.m_invalidateBuffers & ~gl.COLOR_BUFFER_BIT);
+ ctx.disable(gl.SCISSOR_TEST);
+
+ ctx.enable(gl.BLEND);
+ ctx.blendFunc(gl.ONE, gl.ONE);
+ ctx.blendEquation(gl.FUNC_ADD);
+
+ flatShader.setColor(ctx, flatShaderID, deMath.add(deMath.multiply([0, 0, 1, 1], cScale), cBias));
+ rrUtil.drawQuad(ctx, flatShaderID, [-1, -1, 0], [1, 1, 0]);
+
+ es3fFboTestUtil.readPixels(ctx, dst, 0, 0, this.getWidth(), this.getHeight(), colorFmt, colorFmtInfo.lookupScale, colorFmtInfo.lookupBias);
+};
+
+/**
+ * @constructor
+ * @extends {es3fFboTestCase.FboTestCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} numSamples
+ * @param {number} invalidateBuffers
+ */
+es3fFboInvalidateTests.InvalidateSubFboUnbindBlitCase = function(name, desc, numSamples, invalidateBuffers) {
+// \note Use fullscreen viewport when multisampling - we can't allow GLES3Context do its
+// behing-the-scenes viewport position randomization, because with glBlitFramebuffer,
+// source and destination rectangles must match when multisampling.
+ es3fFboTestCase.FboTestCase.call(this, name, desc, numSamples > 0);
+ this.m_numSamples = numSamples;
+ this.m_colorFmt = getCompatibleColorFormat();
+ this.m_depthStencilFmt = getCompatibleDepthStencilFormat();
+ this.m_invalidateBuffers = invalidateBuffers;
+};
+
+setParentClass(es3fFboInvalidateTests.InvalidateSubFboUnbindBlitCase, es3fFboTestCase.FboTestCase);
+
+es3fFboInvalidateTests.InvalidateSubFboUnbindBlitCase.prototype.preCheck = function() {
+ if (this.m_colorFmt != gl.NONE) this.checkFormatSupport(this.m_colorFmt);
+ if (this.m_depthStencilFmt != gl.NONE) this.checkFormatSupport(this.m_depthStencilFmt);
+ return true; // No exception thrown
+};
+
+es3fFboInvalidateTests.InvalidateSubFboUnbindBlitCase.prototype.render = function(dst) {
+ var ctx = this.getCurrentContext();
+ var quadSizePixels = [this.m_numSamples == 0 ? this.getWidth() : Math.min(128, this.getWidth()),
+ this.m_numSamples == 0 ? this.getHeight() : Math.min(128, this.getHeight())];
+ var quadNDCLeftBottomXY = [-1, -1];
+ var quadNDCSize = [2 * quadSizePixels[0] / this.getWidth(), 2 * quadSizePixels[1] / this.getHeight()];
+ var quadNDCRightTopXY = deMath.add(quadNDCLeftBottomXY, quadNDCSize);
+ var depthStencilFmt = this.m_depthStencilFmt != gl.NONE ? gluTextureUtil.mapGLInternalFormat(this.m_depthStencilFmt) : new tcuTexture.TextureFormat(null, null);
+ var depth = depthStencilFmt.order == tcuTexture.ChannelOrder.D || depthStencilFmt.order == tcuTexture.ChannelOrder.DS;
+ var stencil = depthStencilFmt.order == tcuTexture.ChannelOrder.S || depthStencilFmt.order == tcuTexture.ChannelOrder.DS;
+ var flatShader = new es3fFboTestUtil.FlatColorShader(gluShaderUtil.DataType.FLOAT_VEC4);
+ var attachments = getFBODiscardAttachments(this.m_invalidateBuffers);
+ var flatShaderID = ctx.createProgram(flatShader);
+ var invalidateX = 0;
+ var invalidateY = 0;
+ var invalidateW = quadSizePixels[0] / 2;
+ var invalidateH = quadSizePixels[1];
+ var blitX0 = invalidateW;
+ var blitY0 = 0;
+ var blitX1 = blitX0 + quadSizePixels[0] / 2;
+ var blitY1 = blitY0 + quadSizePixels[1];
+
+ ctx.clearColor(0, 0, 0, 1);
+ ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+
+ // Create fbo.
+ var colorRbo = ctx.createRenderbuffer();
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, colorRbo);
+ ctx.renderbufferStorageMultisample(gl.RENDERBUFFER, this.m_numSamples, this.m_colorFmt, quadSizePixels[0], quadSizePixels[1]);
+
+ if (this.m_depthStencilFmt != gl.NONE) {
+ var depthStencilRbo = ctx.createRenderbuffer();
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, depthStencilRbo);
+ ctx.renderbufferStorageMultisample(gl.RENDERBUFFER, this.m_numSamples, this.m_depthStencilFmt, quadSizePixels[0], quadSizePixels[1]);
+ }
+
+ var fbo = ctx.createFramebuffer();
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorRbo);
+
+ if (depth)
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthStencilRbo);
+
+ if (stencil)
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, depthStencilRbo);
+
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+
+ ctx.enable(gl.DEPTH_TEST);
+ ctx.enable(gl.STENCIL_TEST);
+ ctx.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE);
+ ctx.stencilFunc(gl.ALWAYS, 1, 0xff);
+
+ flatShader.setColor(ctx, flatShaderID, [1, 0, 0, 1]);
+ rrUtil.drawQuad(ctx, flatShaderID,
+ [quadNDCLeftBottomXY[0], quadNDCLeftBottomXY[1], -1],
+ [quadNDCRightTopXY[0], quadNDCRightTopXY[1], 1]);
+
+ ctx.invalidateSubFramebuffer(gl.FRAMEBUFFER, attachments, invalidateX, invalidateY, invalidateW, invalidateH);
+
+ // Set default framebuffer as draw framebuffer and blit preserved buffers.
+ ctx.bindFramebuffer(gl.DRAW_FRAMEBUFFER, null);
+ ctx.blitFramebuffer(blitX0, blitY0, blitX1, blitY1, blitX0, blitY0, blitX1, blitY1,
+ (gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT) & ~this.m_invalidateBuffers, gl.NEAREST);
+ ctx.bindFramebuffer(gl.READ_FRAMEBUFFER, null);
+
+ if ((this.m_invalidateBuffers & gl.COLOR_BUFFER_BIT) != 0) {
+ // Color was not preserved - fill with green.
+ ctx.disable(gl.DEPTH_TEST);
+ ctx.disable(gl.STENCIL_TEST);
+
+ flatShader.setColor(ctx, flatShaderID, [0, 1, 0, 1]);
+ rrUtil.drawQuad(ctx, flatShaderID,
+ [quadNDCLeftBottomXY[0], quadNDCLeftBottomXY[1], 0],
+ [quadNDCRightTopXY[0], quadNDCRightTopXY[1], 0]);
+
+ ctx.enable(gl.DEPTH_TEST);
+ ctx.enable(gl.STENCIL_TEST);
+ }
+
+ if ((this.m_invalidateBuffers & gl.DEPTH_BUFFER_BIT) != 0) {
+ // Depth was not preserved.
+ ctx.depthFunc(gl.ALWAYS);
+ }
+
+ if ((this.m_invalidateBuffers & gl.STENCIL_BUFFER_BIT) == 0) {
+ // Stencil was preserved.
+ ctx.stencilFunc(gl.EQUAL, 1, 0xff);
+ }
+
+ ctx.enable(gl.BLEND);
+ ctx.blendFunc(gl.ONE, gl.ONE);
+ ctx.blendEquation(gl.FUNC_ADD);
+
+ flatShader.setColor(ctx, flatShaderID, [0, 0, 1, 1]);
+ rrUtil.drawQuad(ctx, flatShaderID,
+ [quadNDCLeftBottomXY[0], quadNDCLeftBottomXY[1], 0],
+ [quadNDCRightTopXY[0], quadNDCRightTopXY[1], 0]);
+
+ dst.readViewport(ctx, [0, 0, quadSizePixels[0], quadSizePixels[1]]);
+};
+
+/**
+ * @constructor
+ * @extends {es3fFboTestCase.FboTestCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} boundTarget
+ * @param {number} invalidateTarget
+ * @param {Array<number>} invalidateAttachments
+ */
+es3fFboInvalidateTests.InvalidateFboTargetCase = function(name, desc, boundTarget, invalidateTarget, invalidateAttachments) {
+ es3fFboTestCase.FboTestCase.call(this, name, desc);
+ this.m_boundTarget = boundTarget;
+ this.m_invalidateTarget = invalidateTarget;
+ this.m_invalidateAttachments = invalidateAttachments;
+};
+
+setParentClass(es3fFboInvalidateTests.InvalidateFboTargetCase, es3fFboTestCase.FboTestCase);
+
+es3fFboInvalidateTests.InvalidateFboTargetCase.prototype.render = function(dst) {
+ var ctx = this.getCurrentContext();
+ var colorFormat = gl.RGBA8;
+ var depthStencilFormat = gl.DEPTH24_STENCIL8;
+ var colorFmt = gluTextureUtil.mapGLInternalFormat(colorFormat);
+ var colorFmtInfo = tcuTextureUtil.getTextureFormatInfo(colorFmt);
+ var cBias = colorFmtInfo.valueMin;
+ var cScale = deMath.subtract(colorFmtInfo.valueMax, colorFmtInfo.valueMin);
+ var isDiscarded = (this.m_boundTarget == gl.FRAMEBUFFER) ||
+ (this.m_invalidateTarget == gl.FRAMEBUFFER && this.m_boundTarget == gl.DRAW_FRAMEBUFFER) ||
+ (this.m_invalidateTarget == this.m_boundTarget);
+ var isColorDiscarded = isDiscarded && hasAttachment(this.m_invalidateAttachments, gl.COLOR_ATTACHMENT0);
+ var isDepthDiscarded = isDiscarded && (hasAttachment(this.m_invalidateAttachments, gl.DEPTH_ATTACHMENT) || hasAttachment(this.m_invalidateAttachments, gl.DEPTH_STENCIL_ATTACHMENT));
+ var isStencilDiscarded = isDiscarded && (hasAttachment(this.m_invalidateAttachments, gl.STENCIL_ATTACHMENT) || hasAttachment(this.m_invalidateAttachments, gl.DEPTH_STENCIL_ATTACHMENT));
+
+ var flatShader = new es3fFboTestUtil.FlatColorShader(gluShaderUtil.DataType.FLOAT_VEC4);
+ var flatShaderID = ctx.createProgram(flatShader);
+
+ // Create fbo.
+ var colorRbo = ctx.createRenderbuffer();
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, colorRbo);
+ ctx.renderbufferStorage(gl.RENDERBUFFER, colorFormat, this.getWidth(), this.getHeight());
+
+ var depthStencilRbo = ctx.createRenderbuffer();
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, depthStencilRbo);
+ ctx.renderbufferStorage(gl.RENDERBUFFER, depthStencilFormat, this.getWidth(), this.getHeight());
+
+ var fbo = ctx.createFramebuffer();
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorRbo);
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthStencilRbo);
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, depthStencilRbo);
+
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ ctx.clearColor(0, 0, 0, 1);
+ ctx.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+
+ ctx.enable(gl.DEPTH_TEST);
+ ctx.enable(gl.STENCIL_TEST);
+ ctx.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);
+ ctx.stencilFunc(gl.ALWAYS, 1, 0xff);
+
+ flatShader.setColor(ctx, flatShaderID, deMath.add(deMath.multiply([1, 0, 0, 1], cScale), cBias));
+ rrUtil.drawQuad(ctx, flatShaderID, [-1, -1, -1], [1, 1, 1]);
+
+ // Bound FBO to test target and default to other
+ if (this.m_boundTarget != gl.FRAMEBUFFER) {
+ // Dummy fbo is used as complemeting target (read when discarding draw for example).
+ // \note Framework takes care of deleting objects at the end of test case.
+ var dummyTarget = this.m_boundTarget == gl.DRAW_FRAMEBUFFER ? gl.READ_FRAMEBUFFER : gl.DRAW_FRAMEBUFFER;
+
+ var dummyColorRbo = ctx.createRenderbuffer();
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, dummyColorRbo);
+ ctx.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA8, 64, 64);
+ var dummyFbo = ctx.createFramebuffer();
+ ctx.bindFramebuffer(dummyTarget, dummyFbo);
+ ctx.framebufferRenderbuffer(dummyTarget, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, dummyColorRbo);
+
+ ctx.bindFramebuffer(this.m_boundTarget, fbo);
+ }
+
+ ctx.invalidateFramebuffer(this.m_invalidateTarget, this.m_invalidateAttachments);
+
+ if (this.m_boundTarget != gl.FRAMEBUFFER)
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+
+ if (isColorDiscarded) {
+ // Color was not preserved - fill with green.
+ ctx.disable(gl.DEPTH_TEST);
+ ctx.disable(gl.STENCIL_TEST);
+
+ flatShader.setColor(ctx, flatShaderID, deMath.add(deMath.multiply([0, 1, 0, 1], cScale), cBias));
+ rrUtil.drawQuad(ctx, flatShaderID, [-1, -1, 0], [1, 1, 0]);
+
+ ctx.enable(gl.DEPTH_TEST);
+ ctx.enable(gl.STENCIL_TEST);
+ }
+
+ if (isDepthDiscarded) {
+ // Depth was not preserved.
+ ctx.depthFunc(gl.ALWAYS);
+ }
+
+ if (!isStencilDiscarded) {
+ // Stencil was preserved.
+ ctx.stencilFunc(gl.EQUAL, 1, 0xff);
+ }
+
+ ctx.enable(gl.BLEND);
+ ctx.blendFunc(gl.ONE, gl.ONE);
+ ctx.blendEquation(gl.FUNC_ADD);
+
+ flatShader.setColor(ctx, flatShaderID, deMath.add(deMath.multiply([0, 0, 1, 1], cScale), cBias));
+ rrUtil.drawQuad(ctx, flatShaderID, [-1, -1, 0], [1, 1, 0]);
+
+ es3fFboTestUtil.readPixels(ctx, dst, 0, 0, this.getWidth(), this.getHeight(), colorFmt, colorFmtInfo.lookupScale, colorFmtInfo.lookupBias);
+};
+
+/**
+* @constructor
+* @extends {tcuTestCase.DeqpTest}
+*/
+es3fFboInvalidateTests.FboInvalidateTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'invalidate', 'Framebuffer invalidate tests');
+};
+
+es3fFboInvalidateTests.FboInvalidateTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+es3fFboInvalidateTests.FboInvalidateTests.prototype.constructor = es3fFboInvalidateTests.FboInvalidateTests;
+
+es3fFboInvalidateTests.FboInvalidateTests.prototype.init = function() {
+ var defaultFbGroup = new tcuTestCase.DeqpTest('default', 'Default framebuffer invalidate tests');
+ this.addChild(defaultFbGroup);
+
+ defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferRenderCase('render_none', 'Invalidating no framebuffers (ref)', 0));
+ defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferRenderCase('render_color', 'Rendering after invalidating colorbuffer', gl.COLOR_BUFFER_BIT));
+ defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferRenderCase('render_depth', 'Rendering after invalidating depthbuffer', gl.DEPTH_BUFFER_BIT));
+ defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferRenderCase('render_stencil', 'Rendering after invalidating stencilbuffer', gl.STENCIL_BUFFER_BIT));
+ defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferRenderCase('render_depth_stencil', 'Rendering after invalidating depth- and stencilbuffers', gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT));
+ defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferRenderCase('render_all', 'Rendering after invalidating all buffers', gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT));
+ defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferBindCase('bind_color', 'Binding fbo after invalidating colorbuffer', gl.COLOR_BUFFER_BIT));
+ defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferBindCase('bind_depth', 'Binding fbo after invalidating depthbuffer', gl.DEPTH_BUFFER_BIT));
+ defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferBindCase('bind_stencil', 'Binding fbo after invalidating stencilbuffer', gl.STENCIL_BUFFER_BIT));
+ defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferBindCase('bind_depth_stencil', 'Binding fbo after invalidating depth- and stencilbuffers', gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT));
+ defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferBindCase('bind_all', 'Binding fbo after invalidating all buffers', gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT));
+ defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultSubFramebufferRenderCase('sub_render_color', 'Rendering after invalidating colorbuffer', gl.COLOR_BUFFER_BIT));
+ defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultSubFramebufferRenderCase('sub_render_depth', 'Rendering after invalidating depthbuffer', gl.DEPTH_BUFFER_BIT));
+ defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultSubFramebufferRenderCase('sub_render_stencil', 'Rendering after invalidating stencilbuffer', gl.STENCIL_BUFFER_BIT));
+ defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultSubFramebufferRenderCase('sub_render_depth_stencil', 'Rendering after invalidating depth- and stencilbuffers', gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT));
+ defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultSubFramebufferRenderCase('sub_render_all', 'Rendering after invalidating all buffers', gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT));
+ defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultSubFramebufferBindCase('sub_bind_color', 'Binding fbo after invalidating colorbuffer', gl.COLOR_BUFFER_BIT));
+ defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultSubFramebufferBindCase('sub_bind_depth', 'Binding fbo after invalidating depthbuffer', gl.DEPTH_BUFFER_BIT));
+ defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultSubFramebufferBindCase('sub_bind_stencil', 'Binding fbo after invalidating stencilbuffer', gl.STENCIL_BUFFER_BIT));
+ defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultSubFramebufferBindCase('sub_bind_depth_stencil', 'Binding fbo after invalidating depth- and stencilbuffers', gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT));
+ defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultSubFramebufferBindCase('sub_bind_all', 'Binding fbo after invalidating all buffers', gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT));
+ defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferRenderCase('draw_framebuffer_color', 'Invalidating gl.COLOR in gl.DRAW_FRAMEBUFFER', gl.COLOR_BUFFER_BIT, gl.DRAW_FRAMEBUFFER));
+ defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferRenderCase('draw_framebuffer_all', 'Invalidating all in gl.DRAW_FRAMEBUFFER', gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT, gl.DRAW_FRAMEBUFFER));
+ defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferRenderCase('read_framebuffer_color', 'Invalidating gl.COLOR in gl.READ_FRAMEBUFFER', gl.COLOR_BUFFER_BIT, gl.READ_FRAMEBUFFER));
+ defaultFbGroup.addChild(new es3fFboInvalidateTests.InvalidateDefaultFramebufferRenderCase('read_framebuffer_all', 'Invalidating all in gl.READ_FRAMEBUFFER', gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT, gl.READ_FRAMEBUFFER));
+
+ // invalidate.whole.
+ var wholeFboGroup = new tcuTestCase.DeqpTest('whole', 'Invalidating whole framebuffer object');
+ this.addChild(wholeFboGroup);
+ wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboRenderCase('render_none', '', gl.RGBA8, gl.DEPTH24_STENCIL8, 0));
+ wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboRenderCase('render_color', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.COLOR_BUFFER_BIT));
+ wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboRenderCase('render_depth', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.DEPTH_BUFFER_BIT));
+ wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboRenderCase('render_stencil', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.STENCIL_BUFFER_BIT));
+ wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboRenderCase('render_depth_stencil', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT));
+ wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboRenderCase('render_all', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT));
+
+ wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboUnbindReadCase('unbind_read_color', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.COLOR_BUFFER_BIT));
+ wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboUnbindReadCase('unbind_read_depth', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.DEPTH_BUFFER_BIT));
+ wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboUnbindReadCase('unbind_read_stencil', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.STENCIL_BUFFER_BIT));
+ wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboUnbindReadCase('unbind_read_depth_stencil', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT));
+ wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboUnbindReadCase('unbind_read_color_stencil', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.COLOR_BUFFER_BIT | gl.STENCIL_BUFFER_BIT));
+
+ if (getCompatibleDepthStencilFormat() !== gl.NONE) {
+ wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboUnbindBlitCase('unbind_blit_color', '', 0, gl.COLOR_BUFFER_BIT));
+ wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboUnbindBlitCase('unbind_blit_depth', '', 0, gl.DEPTH_BUFFER_BIT));
+ wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboUnbindBlitCase('unbind_blit_stencil', '', 0, gl.STENCIL_BUFFER_BIT));
+ wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboUnbindBlitCase('unbind_blit_depth_stencil', '', 0, gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT));
+ wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboUnbindBlitCase('unbind_blit_msaa_color', '', 4, gl.COLOR_BUFFER_BIT));
+ wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboUnbindBlitCase('unbind_blit_msaa_depth', '', 4, gl.DEPTH_BUFFER_BIT));
+ wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboUnbindBlitCase('unbind_blit_msaa_stencil', '', 4, gl.STENCIL_BUFFER_BIT));
+ wholeFboGroup.addChild(new es3fFboInvalidateTests.InvalidateFboUnbindBlitCase('unbind_blit_msaa_depth_stencil', '', 4, gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT));
+ }
+
+ // invalidate.sub.
+ var subFboGroup = new tcuTestCase.DeqpTest('sub', 'Invalidating subsection of framebuffer object');
+ this.addChild(subFboGroup);
+ subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboRenderCase('render_none', '', gl.RGBA8, gl.DEPTH24_STENCIL8, 0));
+ subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboRenderCase('render_color', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.COLOR_BUFFER_BIT));
+ subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboRenderCase('render_depth', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.DEPTH_BUFFER_BIT));
+ subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboRenderCase('render_stencil', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.STENCIL_BUFFER_BIT));
+ subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboRenderCase('render_depth_stencil', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT));
+ subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboRenderCase('render_all', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT));
+
+ subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboUnbindReadCase('unbind_read_color', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.COLOR_BUFFER_BIT));
+ subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboUnbindReadCase('unbind_read_depth', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.DEPTH_BUFFER_BIT));
+ subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboUnbindReadCase('unbind_read_stencil', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.STENCIL_BUFFER_BIT));
+ subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboUnbindReadCase('unbind_read_depth_stencil', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT));
+ subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboUnbindReadCase('unbind_read_color_stencil', '', gl.RGBA8, gl.DEPTH24_STENCIL8, gl.COLOR_BUFFER_BIT | gl.STENCIL_BUFFER_BIT));
+
+ if (getCompatibleDepthStencilFormat() !== gl.NONE) {
+ subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboUnbindBlitCase('unbind_blit_color', '', 0, gl.COLOR_BUFFER_BIT));
+ subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboUnbindBlitCase('unbind_blit_depth', '', 0, gl.DEPTH_BUFFER_BIT));
+ subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboUnbindBlitCase('unbind_blit_stencil', '', 0, gl.STENCIL_BUFFER_BIT));
+ subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboUnbindBlitCase('unbind_blit_depth_stencil', '', 0, gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT));
+ subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboUnbindBlitCase('unbind_blit_msaa_color', '', 4, gl.COLOR_BUFFER_BIT));
+ subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboUnbindBlitCase('unbind_blit_msaa_depth', '', 4, gl.DEPTH_BUFFER_BIT));
+ subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboUnbindBlitCase('unbind_blit_msaa_stencil', '', 4, gl.STENCIL_BUFFER_BIT));
+ subFboGroup.addChild(new es3fFboInvalidateTests.InvalidateSubFboUnbindBlitCase('unbind_blit_msaa_depth_stencil', '', 4, gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT));
+ }
+ // invalidate.format.
+ var numFormatSubGroups = 3;
+ var formatGroup = [];
+ for (var ii = 0; ii < numFormatSubGroups; ++ii) {
+ formatGroup[ii] = new tcuTestCase.DeqpTest('format', 'Invalidating framebuffers with selected formats');
+ this.addChild(formatGroup[ii]);
+ }
+ // Color buffer formats.
+ var colorFormats = [
+ // RGBA formats
+ gl.RGBA32I,
+ gl.RGBA32UI,
+ gl.RGBA16I,
+ gl.RGBA16UI,
+ gl.RGBA8,
+ gl.RGBA8I,
+ gl.RGBA8UI,
+ gl.SRGB8_ALPHA8,
+ gl.RGB10_A2,
+ gl.RGB10_A2UI,
+ gl.RGBA4,
+ gl.RGB5_A1,
+
+ // RGB formats
+ gl.RGB8,
+ gl.RGB565,
+
+ // RG formats
+ gl.RG32I,
+ gl.RG32UI,
+ gl.RG16I,
+ gl.RG16UI,
+ gl.RG8,
+ gl.RG8I,
+ gl.RG8UI,
+
+ // R formats
+ gl.R32I,
+ gl.R32UI,
+ gl.R16I,
+ gl.R16UI,
+ gl.R8,
+ gl.R8I,
+ gl.R8UI,
+
+ // gl.EXT_color_buffer_float
+ gl.RGBA32F,
+ gl.RGBA16F,
+ gl.R11F_G11F_B10F,
+ gl.RG32F,
+ gl.RG16F,
+ gl.R32F,
+ gl.R16F
+ ];
+
+ // Depth/stencilbuffer formats.
+ var depthStencilFormats = [
+ gl.DEPTH_COMPONENT32F,
+ gl.DEPTH_COMPONENT24,
+ gl.DEPTH_COMPONENT16,
+ gl.DEPTH32F_STENCIL8,
+ gl.DEPTH24_STENCIL8,
+ gl.STENCIL_INDEX8
+ ];
+
+ // Colorbuffer tests use invalidate, unbind, read test.
+ for (var ndx = 0; ndx < colorFormats.length; ndx++)
+ formatGroup[ndx % numFormatSubGroups].addChild(new es3fFboInvalidateTests.InvalidateSubFboUnbindReadCase(es3fFboTestUtil.getFormatName(colorFormats[ndx]), '', colorFormats[ndx], gl.NONE, gl.COLOR_BUFFER_BIT));
+
+ // Depth/stencilbuffer tests use invalidate, render test.
+ for (var ndx = 0; ndx < depthStencilFormats.length; ndx++)
+ formatGroup[ndx % numFormatSubGroups].addChild(new es3fFboInvalidateTests.InvalidateSubFboRenderCase(es3fFboTestUtil.getFormatName(depthStencilFormats[ndx]), '', gl.RGBA8, depthStencilFormats[ndx], gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT));
+
+ // invalidate.target
+ var targetGroup = new tcuTestCase.DeqpTest('target', 'Invalidate target');
+ this.addChild(targetGroup);
+
+ var s_targetCases = [
+ ['framebuffer_framebuffer', gl.FRAMEBUFFER, gl.FRAMEBUFFER],
+ ['framebuffer_read_framebuffer', gl.FRAMEBUFFER, gl.READ_FRAMEBUFFER],
+ ['framebuffer_draw_framebuffer', gl.FRAMEBUFFER, gl.DRAW_FRAMEBUFFER],
+ ['read_framebuffer_framebuffer', gl.READ_FRAMEBUFFER, gl.FRAMEBUFFER],
+ ['read_framebuffer_read_framebuffer', gl.READ_FRAMEBUFFER, gl.READ_FRAMEBUFFER],
+ ['read_framebuffer_draw_framebuffer', gl.READ_FRAMEBUFFER, gl.DRAW_FRAMEBUFFER],
+ ['draw_framebuffer_framebuffer', gl.DRAW_FRAMEBUFFER, gl.FRAMEBUFFER],
+ ['draw_framebuffer_read_framebuffer', gl.DRAW_FRAMEBUFFER, gl.READ_FRAMEBUFFER],
+ ['draw_framebuffer_draw_framebuffer', gl.DRAW_FRAMEBUFFER, gl.DRAW_FRAMEBUFFER]
+ ];
+
+ var colorAttachment = [gl.COLOR_ATTACHMENT0];
+ var depthStencilAttachment = [gl.DEPTH_STENCIL_ATTACHMENT];
+ var allAttachments = [gl.COLOR_ATTACHMENT0, gl.DEPTH_ATTACHMENT, gl.STENCIL_ATTACHMENT];
+
+ for (var caseNdx = 0; caseNdx < s_targetCases.length; caseNdx++) {
+ var baseName = s_targetCases[caseNdx][0];
+ var invalidateT = s_targetCases[caseNdx][1];
+ var boundT = s_targetCases[caseNdx][1];
+
+ targetGroup.addChild(new es3fFboInvalidateTests.InvalidateFboTargetCase(baseName + '_color', '', boundT, invalidateT, colorAttachment));
+ targetGroup.addChild(new es3fFboInvalidateTests.InvalidateFboTargetCase(baseName + '_depth_stencil', '', boundT, invalidateT, depthStencilAttachment));
+ targetGroup.addChild(new es3fFboInvalidateTests.InvalidateFboTargetCase(baseName + '_all', '', boundT, invalidateT, allAttachments));
+ }
+
+};
+
+/**
+* Run test
+* @param {WebGL2RenderingContext} context
+*/
+es3fFboInvalidateTests.run = function(context, range) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fFboInvalidateTests.FboInvalidateTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ if (range)
+ state.setRange(range);
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fFboInvalidateTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboMultisampleTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboMultisampleTests.js
new file mode 100644
index 0000000000..261da00734
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboMultisampleTests.js
@@ -0,0 +1,377 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fFboMultisampleTests');
+goog.require('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuRGBA');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.opengl.gluTextureUtil');
+goog.require('framework.referencerenderer.rrUtil');
+goog.require('functional.gles3.es3fFboTestCase');
+goog.require('functional.gles3.es3fFboTestUtil');
+
+goog.scope(function() {
+
+var es3fFboMultisampleTests = functional.gles3.es3fFboMultisampleTests;
+var es3fFboTestCase = functional.gles3.es3fFboTestCase;
+var es3fFboTestUtil = functional.gles3.es3fFboTestUtil;
+var tcuTestCase = framework.common.tcuTestCase;
+var tcuSurface = framework.common.tcuSurface;
+var tcuRGBA = framework.common.tcuRGBA;
+var tcuImageCompare = framework.common.tcuImageCompare;
+var tcuTexture = framework.common.tcuTexture;
+var tcuTextureUtil = framework.common.tcuTextureUtil;
+var deRandom = framework.delibs.debase.deRandom;
+var deMath = framework.delibs.debase.deMath;
+var gluTextureUtil = framework.opengl.gluTextureUtil;
+var rrUtil = framework.referencerenderer.rrUtil;
+
+/** @type {WebGL2RenderingContext} */ var gl;
+
+var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+};
+
+ /**
+ * @constructor
+ * @extends {es3fFboTestCase.FboTestCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} colorFormat
+ * @param {number} depthStencilFormat
+ * @param {Array<number>} size
+ * @param {number} numSamples
+ */
+ es3fFboMultisampleTests.BasicFboMultisampleCase = function(name, desc, colorFormat, depthStencilFormat, size, numSamples) {
+ es3fFboTestCase.FboTestCase.call(this, name, desc);
+ /** @type {number} */ this.m_colorFormat = colorFormat;
+ /** @type {number} */ this.m_depthStencilFormat = depthStencilFormat;
+ /** @type {Array<number>} */ this.m_size = size;
+ /** @type {number} */ this.m_numSamples = numSamples;
+ };
+
+ es3fFboMultisampleTests.BasicFboMultisampleCase.prototype = Object.create(es3fFboTestCase.FboTestCase.prototype);
+ es3fFboMultisampleTests.BasicFboMultisampleCase.prototype.constructor = es3fFboMultisampleTests.BasicFboMultisampleCase;
+
+ es3fFboMultisampleTests.BasicFboMultisampleCase.prototype.preCheck = function() {
+ this.checkFormatSupport(this.m_colorFormat);
+ if (!this.checkSampleCount(this.m_colorFormat, this.m_numSamples))
+ return false;
+
+ if (this.m_depthStencilFormat != gl.NONE) {
+ this.checkFormatSupport(this.m_depthStencilFormat);
+ if (!this.checkSampleCount(this.m_depthStencilFormat, this.m_numSamples))
+ return false;
+ }
+ return true; // No exception thrown
+ };
+
+ /**
+ * @param {tcuSurface.Surface} dst
+ */
+ es3fFboMultisampleTests.BasicFboMultisampleCase.prototype.render = function(dst) {
+ var ctx = this.getCurrentContext();
+ /** @type {tcuTexture.TextureFormat} */ var colorFmt = gluTextureUtil.mapGLInternalFormat(this.m_colorFormat);
+ /** @type {tcuTexture.TextureFormat} */ var depthStencilFmt = this.m_depthStencilFormat != gl.NONE ? gluTextureUtil.mapGLInternalFormat(this.m_depthStencilFormat) : new tcuTexture.TextureFormat(null, null);
+ /** @type {tcuTextureUtil.TextureFormatInfo} */ var colorFmtInfo = tcuTextureUtil.getTextureFormatInfo(colorFmt);
+ /** @type {boolean} */ var depth = depthStencilFmt.order == tcuTexture.ChannelOrder.D || depthStencilFmt.order == tcuTexture.ChannelOrder.DS;
+ /** @type {boolean} */ var stencil = depthStencilFmt.order == tcuTexture.ChannelOrder.S || depthStencilFmt.order == tcuTexture.ChannelOrder.DS;
+ /** @type {es3fFboTestUtil.GradientShader} */ var gradShader = new es3fFboTestUtil.GradientShader(es3fFboTestUtil.getFragmentOutputType(colorFmt));
+ /** @type {es3fFboTestUtil.FlatColorShader} */ var flatShader = new es3fFboTestUtil.FlatColorShader(es3fFboTestUtil.getFragmentOutputType(colorFmt));
+ var gradShaderID = this.getCurrentContext().createProgram(gradShader);
+ var flatShaderID = this.getCurrentContext().createProgram(flatShader);
+ var msaaFbo = null;
+ var resolveFbo = null;
+ var msaaColorRbo = null;
+ var resolveColorRbo = null;
+ var msaaDepthStencilRbo = null;
+ var resolveDepthStencilRbo = null;
+
+ // Create framebuffers.
+ msaaColorRbo = ctx.createRenderbuffer();
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, msaaColorRbo);
+ ctx.renderbufferStorageMultisample(gl.RENDERBUFFER, this.m_numSamples, this.m_colorFormat, this.m_size[0], this.m_size[1]);
+
+ if (depth || stencil) {
+ msaaDepthStencilRbo = ctx.createRenderbuffer();
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, msaaDepthStencilRbo);
+ ctx.renderbufferStorageMultisample(gl.RENDERBUFFER, this.m_numSamples, this.m_depthStencilFormat, this.m_size[0], this.m_size[1]);
+ }
+
+ msaaFbo = ctx.createFramebuffer();
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, msaaFbo);
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, msaaColorRbo);
+ if (depth)
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, msaaDepthStencilRbo);
+ if (stencil)
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, msaaDepthStencilRbo);
+
+ this.checkError();
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ resolveColorRbo = ctx.createRenderbuffer();
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, resolveColorRbo);
+ ctx.renderbufferStorageMultisample(gl.RENDERBUFFER, 0, this.m_colorFormat, this.m_size[0], this.m_size[1]);
+
+ if (depth || stencil) {
+ resolveDepthStencilRbo = ctx.createRenderbuffer();
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, resolveDepthStencilRbo);
+ ctx.renderbufferStorageMultisample(gl.RENDERBUFFER, 0, this.m_depthStencilFormat, this.m_size[0], this.m_size[1]);
+ }
+
+ resolveFbo = ctx.createFramebuffer();
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, resolveFbo);
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, resolveColorRbo);
+ if (depth)
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, resolveDepthStencilRbo);
+ if (stencil)
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, resolveDepthStencilRbo);
+
+ this.checkError();
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, msaaFbo);
+ ctx.viewport(0, 0, this.m_size[0], this.m_size[1]);
+
+ // Clear depth and stencil buffers.
+ ctx.clearBufferfi(gl.DEPTH_STENCIL, 0, 1.0, 0);
+
+ // Fill MSAA fbo with gradient, depth = [-1..1]
+ ctx.enable(gl.DEPTH_TEST);
+ gradShader.setGradient(this.getCurrentContext(), gradShaderID, colorFmtInfo.valueMin, colorFmtInfo.valueMax);
+
+ rrUtil.drawQuad(this.getCurrentContext(), gradShaderID, [-1.0, -1.0, -1.0], [1.0, 1.0, 1.0]);
+
+ // Render random-colored quads.
+ /** @const {number} */ var numQuads = 8;
+
+ // The choice of random seed affects the correctness of the tests,
+ // because there are some boundary conditions which aren't handled
+ // correctly even in the C++ dEQP tests.
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(7);
+
+ ctx.depthFunc(gl.ALWAYS);
+ ctx.enable(gl.STENCIL_TEST);
+ ctx.stencilFunc(gl.ALWAYS, 0, 0xff);
+ ctx.stencilOp(gl.KEEP, gl.KEEP, gl.INCR);
+
+ for (var ndx = 0; ndx < numQuads; ndx++) {
+ /** @type {number} */ var r = rnd.getFloat();
+ /** @type {number} */ var g = rnd.getFloat();
+ /** @type {number} */ var b = rnd.getFloat();
+ /** @type {number} */ var a = rnd.getFloat();
+ /** @type {number} */ var x0 = rnd.getFloat(-1.0, 1.0);
+ /** @type {number} */ var y0 = rnd.getFloat(-1.0, 1.0);
+ /** @type {number} */ var z0 = rnd.getFloat(-1.0, 1.0);
+ /** @type {number} */ var x1 = rnd.getFloat(-1.0, 1.0);
+ /** @type {number} */ var y1 = rnd.getFloat(-1.0, 1.0);
+ /** @type {number} */ var z1 = rnd.getFloat(-1.0, 1.0);
+
+ flatShader.setColor(this.getCurrentContext(), flatShaderID, deMath.add(deMath.multiply([r, g, b, a], deMath.subtract(colorFmtInfo.valueMax, colorFmtInfo.valueMin)), colorFmtInfo.valueMin));
+ rrUtil.drawQuad(this.getCurrentContext(), flatShaderID, [x0, y0, z0], [x1, y1, z1]);
+ }
+
+ ctx.disable(gl.DEPTH_TEST);
+ ctx.disable(gl.STENCIL_TEST);
+ this.checkError();
+
+ // Resolve using glBlitFramebuffer().
+ ctx.bindFramebuffer(gl.DRAW_FRAMEBUFFER, resolveFbo);
+ ctx.blitFramebuffer(0, 0, this.m_size[0], this.m_size[1], 0, 0, this.m_size[0], this.m_size[1], gl.COLOR_BUFFER_BIT | (depth ? gl.DEPTH_BUFFER_BIT : 0) | (stencil ? gl.STENCIL_BUFFER_BIT : 0), gl.NEAREST);
+
+ ctx.bindFramebuffer(gl.READ_FRAMEBUFFER, resolveFbo);
+
+ /** @type {number} */ var numSteps;
+ /** @type {number} */ var step;
+ /** @type {number} */ var d;
+ /** @type {number} */ var c;
+ /** @type {number} */ var s;
+ if (depth) {
+ // Visualize depth.
+ numSteps = 8;
+ step = 2.0 / numSteps;
+ ctx.enable(gl.DEPTH_TEST);
+ ctx.depthFunc(gl.LESS);
+ ctx.depthMask(false);
+ ctx.colorMask(false, false, true, false);
+
+ for (var ndx = 0; ndx < numSteps; ndx++) {
+ d = -1.0 + step * ndx;
+ c = ndx / (numSteps - 1);
+
+ flatShader.setColor(this.getCurrentContext(), flatShaderID, deMath.add(deMath.multiply([0.0, 0.0, c, 1.0], deMath.subtract(colorFmtInfo.valueMax, colorFmtInfo.valueMin)), colorFmtInfo.valueMin));
+ rrUtil.drawQuad(this.getCurrentContext(), flatShaderID, [-1.0, -1.0, d], [1.0, 1.0, d]);
+ }
+
+ ctx.disable(gl.DEPTH_TEST);
+ }
+
+ if (stencil) {
+ // Visualize stencil.
+ numSteps = 4;
+ step = 1;
+
+ ctx.enable(gl.STENCIL_TEST);
+ ctx.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);
+ ctx.colorMask(false, true, false, false);
+
+ for (var ndx = 0; ndx < numSteps; ndx++) {
+ s = step * ndx;
+ c = ndx / (numSteps - 1);
+
+ ctx.stencilFunc(gl.EQUAL, s, 0xff);
+
+ flatShader.setColor(this.getCurrentContext(), flatShaderID, deMath.add(deMath.multiply([0.0, c, 0.0, 1.0], deMath.subtract(colorFmtInfo.valueMax, colorFmtInfo.valueMin)), colorFmtInfo.valueMin));
+ rrUtil.drawQuad(this.getCurrentContext(), flatShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]);
+ }
+
+ ctx.disable(gl.STENCIL_TEST);
+ }
+
+ this.readPixelsUsingFormat(dst, 0, 0, this.m_size[0], this.m_size[1], colorFmt, colorFmtInfo.lookupScale, colorFmtInfo.lookupBias);
+ };
+
+ /**
+ * @param {tcuSurface.Surface} reference
+ * @param {tcuSurface.Surface} result
+ * @return {boolean}
+ */
+ es3fFboMultisampleTests.BasicFboMultisampleCase.prototype.colorCompare = function(reference, result) {
+ /** @const {tcuRGBA.RGBA} */ var threshold = tcuRGBA.max(es3fFboTestUtil.getFormatThreshold(this.m_colorFormat), tcuRGBA.newRGBAComponents(12, 12, 12, 12));
+ return tcuImageCompare.bilinearCompare('Result', 'Image comparison result', reference.getAccess(), result.getAccess(), threshold, tcuImageCompare.CompareLogMode.RESULT);
+ };
+
+ /**
+ * @param {tcuSurface.Surface} reference
+ * @param {tcuSurface.Surface} result
+ * @return {boolean}
+ */
+ es3fFboMultisampleTests.BasicFboMultisampleCase.prototype.compare = function(reference, result) {
+ if (this.m_depthStencilFormat != gl.NONE)
+ return es3fFboTestCase.FboTestCase.prototype.compare(reference, result); // FboTestCase.compare
+ else
+ return this.colorCompare(reference, result);
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fFboMultisampleTests.FboMultisampleTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'msaa', 'Multisample FBO tests');
+ };
+
+ es3fFboMultisampleTests.FboMultisampleTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fFboMultisampleTests.FboMultisampleTests.prototype.constructor = es3fFboMultisampleTests.FboMultisampleTests;
+
+ es3fFboMultisampleTests.FboMultisampleTests.prototype.init = function() {
+ /** @const {Array<number>} */ var colorFormats = [
+ // RGBA formats
+ gl.RGBA8,
+ gl.SRGB8_ALPHA8,
+ gl.RGB10_A2,
+ gl.RGBA4,
+ gl.RGB5_A1,
+
+ // RGB formats
+ gl.RGB8,
+ gl.RGB565,
+
+ // RG formats
+ gl.RG8,
+
+ // R formats
+ gl.R8,
+
+ // gl.EXT_color_buffer_float
+ // Multi-sample floating-point color buffers can be optional supported, see https://www.khronos.org/registry/webgl/extensions/EXT_color_buffer_float/
+ gl.RGBA32F,
+ gl.RGBA16F,
+ gl.R11F_G11F_B10F,
+ gl.RG32F,
+ gl.RG16F,
+ gl.R32F,
+ gl.R16F
+ ];
+
+ /** @const {Array<number>} */ var depthStencilFormats = [
+ gl.DEPTH_COMPONENT32F,
+ gl.DEPTH_COMPONENT24,
+ gl.DEPTH_COMPONENT16,
+ gl.DEPTH32F_STENCIL8,
+ gl.DEPTH24_STENCIL8,
+ gl.STENCIL_INDEX8
+ ];
+
+ /** @const {Array<number>} */ var sampleCounts = [2, 4, 8];
+
+ for (var sampleCntNdx in sampleCounts) {
+ /** @type {number} */ var samples = sampleCounts[sampleCntNdx];
+ /** @type {tcuTestCase.DeqpTest} */
+ var sampleCountGroup = tcuTestCase.newTest(samples + '_samples', '');
+ this.addChild(sampleCountGroup);
+
+ // Color formats.
+ for (var fmtNdx in colorFormats)
+ sampleCountGroup.addChild(new es3fFboMultisampleTests.BasicFboMultisampleCase(es3fFboTestUtil.getFormatName(colorFormats[fmtNdx]), '', colorFormats[fmtNdx], gl.NONE, [119, 131], samples));
+
+ // Depth/stencil formats.
+ for (var fmtNdx in depthStencilFormats)
+ sampleCountGroup.addChild(new es3fFboMultisampleTests.BasicFboMultisampleCase(es3fFboTestUtil.getFormatName(depthStencilFormats[fmtNdx]), '', gl.RGBA8, depthStencilFormats[fmtNdx], [119, 131], samples));
+ }
+ };
+
+ es3fFboMultisampleTests.run = function(context, range) {
+ gl = context;
+ //Set up root Test
+ var state = tcuTestCase.runner;
+
+ var test = new es3fFboMultisampleTests.FboMultisampleTests();
+ var testName = test.fullName();
+ var testDescription = test.getDescription();
+
+ state.testName = testName;
+ state.setRoot(test);
+ //Set up name and description of this test series.
+ setCurrentTestName(testName);
+ description(testDescription);
+
+ try {
+ //Create test cases
+ test.init();
+ if (range)
+ state.setRange(range);
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fFboMultisampleTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboRenderTest.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboRenderTest.js
new file mode 100644
index 0000000000..78229de447
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboRenderTest.js
@@ -0,0 +1,2389 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fFboRenderTest');
+goog.require('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuLogImage');
+goog.require('framework.common.tcuPixelFormat');
+goog.require('framework.common.tcuRGBA');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.delibs.debase.deUtil');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluTextureUtil');
+goog.require('framework.opengl.simplereference.sglrGLContext');
+goog.require('framework.opengl.simplereference.sglrReferenceContext');
+goog.require('framework.referencerenderer.rrUtil');
+goog.require('functional.gles3.es3fFboTestUtil');
+
+goog.scope(function() {
+
+ var es3fFboRenderTest = functional.gles3.es3fFboRenderTest;
+ var es3fFboTestUtil = functional.gles3.es3fFboTestUtil;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var gluTextureUtil = framework.opengl.gluTextureUtil;
+ var tcuImageCompare = framework.common.tcuImageCompare;
+ var tcuLogImage = framework.common.tcuLogImage;
+ var tcuPixelFormat = framework.common.tcuPixelFormat;
+ var tcuRGBA = framework.common.tcuRGBA;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var tcuSurface = framework.common.tcuSurface;
+ var tcuTexture = framework.common.tcuTexture;
+ var tcuTextureUtil = framework.common.tcuTextureUtil;
+ var deMath = framework.delibs.debase.deMath;
+ var deRandom = framework.delibs.debase.deRandom;
+ var deString = framework.delibs.debase.deString;
+ var deUtil = framework.delibs.debase.deUtil;
+ var sglrGLContext = framework.opengl.simplereference.sglrGLContext;
+ var sglrReferenceContext =
+ framework.opengl.simplereference.sglrReferenceContext;
+ var rrUtil = framework.referencerenderer.rrUtil;
+
+ /** @type {WebGL2RenderingContext} */ var gl;
+
+ /**
+ * @constructor
+ * @param {number=} buffers_
+ * @param {number=} colorType_
+ * @param {number=} colorFormat_
+ * @param {number=} depthStencilType_
+ * @param {number=} depthStencilFormat_
+ * @param {number=} width_
+ * @param {number=} height_
+ * @param {number=} samples_
+ */
+ es3fFboRenderTest.FboConfig = function(
+ buffers_, colorType_, colorFormat_, depthStencilType_,
+ depthStencilFormat_, width_, height_, samples_
+ ) {
+ // Buffer bit mask (gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT|...)
+ this.buffers = buffers_ ? buffers_ : 0;
+ // gl.TEXTURE_2D, gl.TEXTURE_CUBE_MAP, gl.RENDERBUFFER
+ this.colorType = colorType_ ? colorType_ : gl.NONE;
+ // Internal format for color buffer texture or renderbuffer
+ this.colorFormat = colorFormat_ ? colorFormat_ : gl.NONE;
+ this.depthStencilType = depthStencilType_?
+ depthStencilType_ : gl.NONE;
+ this.depthStencilFormat = depthStencilFormat_ ?
+ depthStencilFormat_ : gl.NONE;
+ this.width = width_ ? width_ : 0;
+ this.height = height_ ? height_ : 0;
+ this.samples = samples_? samples_ : 0;
+ };
+
+ /**
+ * @param {number} type
+ * @return {string}
+ */
+ es3fFboRenderTest.getTypeName = function(type) {
+ switch (type) {
+ case gl.TEXTURE_2D: return 'tex2d';
+ case gl.RENDERBUFFER: return 'rbo';
+ default:
+ testFailed('Unknown type');
+ }
+ return 'Should not get to this point';
+ };
+
+ /**
+ * @return {string}
+ */
+ es3fFboRenderTest.FboConfig.prototype.getName = function() {
+ var name = '';
+
+ assertMsgOptions((this.buffers & gl.COLOR_BUFFER_BIT) != 0,
+ 'Color buffer is not specified', false, true);
+
+ name += es3fFboRenderTest.getTypeName(this.colorType) + '_' +
+ es3fFboTestUtil.getFormatName(this.colorFormat);
+
+ if (this.buffers & gl.DEPTH_BUFFER_BIT)
+ name += '_depth';
+ if (this.buffers & gl.STENCIL_BUFFER_BIT)
+ name += '_stencil';
+
+ if (this.buffers & (gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT))
+ name += '_' + es3fFboRenderTest.getTypeName(this.depthStencilType) +
+ '_' + es3fFboTestUtil.getFormatName(this.depthStencilFormat);
+
+ return name;
+ };
+
+ /**
+ * @param {number} format
+ * @return {Array<string>}
+ */
+ es3fFboRenderTest.getEnablingExtensions = function(format) {
+ /** @type {Array<string>} */ var out = [];
+
+ switch (format) {
+ case gl.RGB16F:
+ assertMsgOptions(false, "Not part of the tested formats", false, true);
+ break;
+
+ case gl.RGBA16F:
+ case gl.RG16F:
+ case gl.R16F:
+ case gl.RGBA32F:
+ case gl.RGB32F:
+ case gl.R11F_G11F_B10F:
+ case gl.RG32F:
+ case gl.R32F:
+ out.push('EXT_color_buffer_float');
+
+ default:
+ break;
+ }
+
+ return out;
+ };
+
+ /**
+ * @param {?sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext}
+ * context
+ * @param {string} name
+ * @return {*}
+ */
+ es3fFboRenderTest.isExtensionSupported = function(context, name) {
+ return context.getExtension(name);
+ };
+
+ /**
+ * @param {?sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext}
+ * context
+ * @param {Array<string>} requiredExts
+ * @return {boolean}
+ */
+ es3fFboRenderTest.isAnyExtensionSupported = function(
+ context, requiredExts) {
+
+ if (!requiredExts || requiredExts.length == 0)
+ return true;
+
+ for (var extNdx = 0; extNdx < requiredExts.length; extNdx++) {
+ var extension = requiredExts[extNdx];
+
+ if (es3fFboRenderTest.isExtensionSupported(context, extension))
+ return true;
+ }
+
+ return false;
+ };
+
+ /**
+ * @param {Array} list
+ * @param {string} sep
+ * @return {string}
+ */
+ es3fFboRenderTest.join = function(list, sep) {
+ var out = '';
+
+ for (var elemNdx = 0; elemNdx < list.length; elemNdx++) {
+ if (elemNdx != 0)
+ out += sep;
+ out += list[elemNdx];
+ }
+
+ return out;
+ };
+
+ /**
+ * @param {?sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext}
+ * context
+ * @param {number} sizedFormat
+ */
+ es3fFboRenderTest.checkColorFormatSupport = function(context, sizedFormat) {
+ /** @type {Array<string>} */ var requiredExts =
+ es3fFboRenderTest.getEnablingExtensions(sizedFormat);
+
+ if (!es3fFboRenderTest.isAnyExtensionSupported(context, requiredExts)) {
+ var errMsg = 'Format not supported, requires ' + (
+ (requiredExts.length == 1) ? requiredExts[0] :
+ ' one of the following: ' +
+ requiredExts.join(', ')
+ );
+ checkMessage(false, errMsg);
+
+ throw new TestFailedException(errMsg);
+ }
+ };
+
+ /**
+ * @constructor
+ * @param {?sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext}
+ * context
+ * @param {es3fFboRenderTest.FboConfig} config
+ * @param {number} width
+ * @param {number} height
+ * @param {sglrReferenceContext.AnyFramebuffer=} fbo
+ * @param {sglrReferenceContext.AnyRenderbuffer=} colorBufferName
+ * @param {sglrReferenceContext.AnyRenderbuffer=} depthStencilBufferName
+ */
+ es3fFboRenderTest.Framebuffer = function(
+ context, config, width, height, fbo,
+ colorBufferName, depthStencilBufferName) {
+
+ this.m_config = config;
+ this.m_context = context;
+ this.m_framebuffer = fbo ? fbo : null;
+ this.m_colorBuffer = colorBufferName ? colorBufferName : null;
+ this.m_depthStencilBuffer = depthStencilBufferName ?
+ depthStencilBufferName : null;
+
+ // Verify that color format is supported
+ es3fFboRenderTest.checkColorFormatSupport(context, config.colorFormat);
+
+ if (!this.m_framebuffer)
+ this.m_framebuffer = context.createFramebuffer();
+ context.bindFramebuffer(gl.FRAMEBUFFER, this.m_framebuffer);
+
+ if (this.m_config.buffers & (gl.COLOR_BUFFER_BIT)) {
+ switch (this.m_config.colorType) {
+ case gl.TEXTURE_2D:
+ this.m_colorBuffer = this.createTex2D(
+ /** @type {WebGLTexture} */ (colorBufferName),
+ this.m_config.colorFormat, width, height
+ );
+
+ context.framebufferTexture2D(
+ gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0,
+ gl.TEXTURE_2D, this.m_colorBuffer, 0
+ );
+
+ break;
+
+ case gl.RENDERBUFFER:
+ this.m_colorBuffer = this.createRbo(
+ /** @type {WebGLRenderbuffer} */ (colorBufferName),
+ this.m_config.colorFormat, width, height
+ );
+
+ context.framebufferRenderbuffer(
+ gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0,
+ gl.RENDERBUFFER, this.m_colorBuffer
+ );
+
+ break;
+
+ default:
+ testFailed('Unsupported type');
+ }
+ }
+
+ if (this.m_config.buffers &
+ (gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT)) {
+
+ switch (this.m_config.depthStencilType) {
+ case gl.TEXTURE_2D:
+ this.m_depthStencilBuffer = this.createTex2D(
+ /** @type {WebGLTexture} */
+ (depthStencilBufferName),
+ this.m_config.depthStencilFormat, width, height
+ );
+ break;
+ case gl.RENDERBUFFER:
+ this.m_depthStencilBuffer = this.createRbo(
+ /** @type {WebGLRenderbuffer} */
+ (depthStencilBufferName),
+ this.m_config.depthStencilFormat, width, height
+ );
+ break;
+
+ default:
+ testFailed('Unsupported type');
+ }
+ }
+
+ for (var ndx = 0; ndx < 2; ndx++) {
+ var bit = ndx ? gl.STENCIL_BUFFER_BIT : gl.DEPTH_BUFFER_BIT;
+ var point = ndx ? gl.STENCIL_ATTACHMENT : gl.DEPTH_ATTACHMENT;
+
+ if ((this.m_config.buffers & bit) == 0)
+ continue; /* Not used. */
+
+ switch (this.m_config.depthStencilType) {
+ case gl.TEXTURE_2D:
+ context.framebufferTexture2D(
+ gl.FRAMEBUFFER, point, gl.TEXTURE_2D,
+ this.m_depthStencilBuffer, 0
+ );
+ break;
+ case gl.RENDERBUFFER:
+ context.framebufferRenderbuffer(
+ gl.FRAMEBUFFER, point,
+ gl.RENDERBUFFER, this.m_depthStencilBuffer
+ );
+ break;
+ default:
+ throw new Error('Invalid depth stencil type');
+ }
+ }
+
+ context.bindFramebuffer(gl.FRAMEBUFFER, null);
+ };
+
+ /**
+ * @return {es3fFboRenderTest.FboConfig}
+ */
+ es3fFboRenderTest.Framebuffer.prototype.getConfig = function() {
+ return this.m_config;
+ };
+
+ /**
+ * @return {?sglrReferenceContext.AnyFramebuffer}
+ */
+ es3fFboRenderTest.Framebuffer.prototype.getFramebuffer = function() {
+ return this.m_framebuffer;
+ };
+
+ /**
+ * @return {?sglrReferenceContext.AnyRenderbuffer}
+ */
+ es3fFboRenderTest.Framebuffer.prototype.getColorBuffer = function() {
+ return this.m_colorBuffer;
+ };
+
+ /**
+ * @return {?sglrReferenceContext.AnyRenderbuffer}
+ */
+ es3fFboRenderTest.Framebuffer.prototype.getDepthStencilBuffer = function() {
+ return this.m_depthStencilBuffer;
+ };
+
+ /**
+ * deinit
+ */
+ es3fFboRenderTest.Framebuffer.prototype.deinit = function() {
+ this.m_context.deleteFramebuffer(
+ /** @type {WebGLFramebuffer} */ (this.m_framebuffer)
+ );
+ this.destroyBuffer(this.m_colorBuffer, this.m_config.colorType);
+ this.destroyBuffer(
+ this.m_depthStencilBuffer, this.m_config.depthStencilType
+ );
+ };
+
+ /**
+ * checkCompleteness
+ */
+ es3fFboRenderTest.Framebuffer.prototype.checkCompleteness = function() {
+ this.m_context.bindFramebuffer(gl.FRAMEBUFFER, this.m_framebuffer);
+ var status = this.m_context.checkFramebufferStatus(gl.FRAMEBUFFER);
+ this.m_context.bindFramebuffer(gl.FRAMEBUFFER, null);
+ if (status != gl.FRAMEBUFFER_COMPLETE)
+ throw new es3fFboTestUtil.FboIncompleteException(status);
+ };
+
+ /**
+ * @param {?WebGLTexture|sglrReferenceContext.TextureContainer} name
+ * @param {number} format
+ * @param {number} width
+ * @param {number} height
+ * @return {?WebGLTexture|sglrReferenceContext.TextureContainer}
+ */
+ es3fFboRenderTest.Framebuffer.prototype.createTex2D = function(
+ name, format, width, height) {
+
+ if (!name)
+ name = this.m_context.createTexture();
+
+ this.m_context.bindTexture(gl.TEXTURE_2D, name);
+ this.m_context.texImage2DDelegate(
+ gl.TEXTURE_2D, 0, format, width, height
+ );
+
+ if (!deMath.deIsPowerOfTwo32(width) ||
+ !deMath.deIsPowerOfTwo32(height)) {
+
+ // Set wrap mode to clamp for NPOT FBOs
+ this.m_context.texParameteri(
+ gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE
+ );
+ this.m_context.texParameteri(
+ gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE
+ );
+ }
+
+ this.m_context.texParameteri(
+ gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST
+ );
+ this.m_context.texParameteri(
+ gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST
+ );
+
+ return name;
+ };
+
+ /**
+ * @param {?WebGLRenderbuffer|sglrReferenceContext.Renderbuffer} name
+ * @param {number} format
+ * @param {number} width
+ * @param {number} height
+ * @return {?WebGLRenderbuffer|sglrReferenceContext.Renderbuffer}
+ */
+ es3fFboRenderTest.Framebuffer.prototype.createRbo = function(
+ name, format, width, height) {
+
+ if (!name)
+ name = this.m_context.createRenderbuffer();
+
+ this.m_context.bindRenderbuffer(gl.RENDERBUFFER, name);
+ this.m_context.renderbufferStorage(
+ gl.RENDERBUFFER, format, width, height
+ );
+
+ return name;
+ };
+
+ /**
+ * @param {?sglrReferenceContext.AnyRenderbuffer} name
+ * @param {number} type
+ */
+ es3fFboRenderTest.Framebuffer.prototype.destroyBuffer = function(
+ name, type) {
+
+ if (type == gl.TEXTURE_2D || type == gl.TEXTURE_CUBE_MAP)
+ this.m_context.deleteTexture(/** @type {?WebGLTexture} */ (name));
+ else if (type == gl.RENDERBUFFER)
+ this.m_context.deleteRenderbuffer(
+ /** @type {?WebGLRenderbuffer} */ (name)
+ );
+ else
+ assertMsgOptions(
+ type == gl.NONE, 'Invalid buffer type', false, true
+ );
+ };
+
+ /**
+ * @param {?sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext}
+ * context
+ * @param {WebGLTexture|sglrReferenceContext.TextureContainer} name
+ * @param {number} format
+ * @param {number} dataType
+ * @param {number} width
+ * @param {number} height
+ */
+ es3fFboRenderTest.createMetaballsTex2D = function(
+ context, name, format, dataType, width, height) {
+
+ /** @type {tcuTexture.TextureFormat} */ var texFormat =
+ gluTextureUtil.mapGLTransferFormat(format, dataType);
+ /** @type {tcuTexture.TextureLevel} */ var level =
+ new tcuTexture.TextureLevel(texFormat, width, height);
+
+ tcuTextureUtil.fillWithMetaballs(
+ level.getAccess(), 5, /*name ^*/ width ^ height
+ );
+
+ context.bindTexture(gl.TEXTURE_2D, name);
+ context.texImage2D(
+ gl.TEXTURE_2D, 0, format, width, height, 0, format,
+ dataType, level.getAccess().getDataPtr()
+ );
+ context.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ };
+
+ /**
+ * @param {?sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext}
+ * context
+ * @param {WebGLTexture|sglrReferenceContext.TextureContainer} name
+ * @param {number} format
+ * @param {number} dataType
+ * @param {number} width
+ * @param {number} height
+ */
+ es3fFboRenderTest.createQuadsTex2D = function(
+ context, name, format, dataType, width, height) {
+
+ /** @type {tcuTexture.TextureFormat} */
+ var texFormat = gluTextureUtil.mapGLTransferFormat(format, dataType);
+ /** @type {tcuTexture.TextureLevel} */
+ var level = new tcuTexture.TextureLevel(texFormat, width, height);
+
+ tcuTextureUtil.fillWithRGBAQuads(level.getAccess());
+
+ context.bindTexture(gl.TEXTURE_2D, name);
+ context.texImage2D(
+ gl.TEXTURE_2D, 0, format, width, height, 0,
+ format, dataType, level.getAccess().getDataPtr()
+ );
+ context.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} description
+ * @param {es3fFboRenderTest.FboConfig} config
+ */
+ es3fFboRenderTest.FboRenderCase = function(name, description, config) {
+ tcuTestCase.DeqpTest.call(this, name, description);
+ this.m_config = config;
+ };
+
+ es3fFboRenderTest.FboRenderCase.prototype =
+ Object.create(tcuTestCase.DeqpTest.prototype);
+
+ es3fFboRenderTest.FboRenderCase.prototype.constructor =
+ es3fFboRenderTest.FboRenderCase;
+
+ /**
+ * Must be overridden
+ * @param {?sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext}
+ * fboContext
+ * @param {tcuSurface.Surface} dst
+ */
+ es3fFboRenderTest.FboRenderCase.prototype.render = function(
+ fboContext, dst) {
+ throw new Error('Must override');
+ };
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fFboRenderTest.FboRenderCase.prototype.iterate = function() {
+ var clearColor = [0.125, 0.25, 0.5, 1.0];
+ /** @type {?string} */ var failReason = "";
+
+ // Position & size for context
+ var rnd = new deRandom.deRandom();
+ deRandom.deRandom_init(rnd, deString.deStringHash(this.fullName()));
+
+ var width = Math.min(gl.canvas.width, 128);
+ var height = Math.min(gl.canvas.height, 128);
+ var xMax = gl.canvas.width - width + 1;
+ var yMax = gl.canvas.height - height + 1;
+ var x = Math.abs(deRandom.deRandom_getInt(rnd)) % xMax;
+ var y = Math.abs(deRandom.deRandom_getInt(rnd)) % yMax;
+
+ /** @type {tcuSurface.Surface} */
+ var gles3Frame = new tcuSurface.Surface(width, height);
+ /** @type {tcuSurface.Surface} */
+ var refFrame = new tcuSurface.Surface(width, height);
+
+ /** @type {number} */ var gles3Error = 0;
+ /** @type {number} */ var refError = 0;
+
+ // Render using GLES3
+ /**
+ * @type {sglrGLContext.GLContext|
+ * sglrReferenceContext.ReferenceContext}
+ */
+ var context;
+
+ try {
+ context = new sglrGLContext.GLContext(gl, [x, y, width, height]);
+
+ context.clearColor(
+ clearColor[0], clearColor[1], clearColor[2], clearColor[3]
+ );
+
+ context.clear(
+ gl.COLOR_BUFFER_BIT |
+ gl.DEPTH_BUFFER_BIT |
+ gl.STENCIL_BUFFER_BIT
+ );
+
+ this.render(context, gles3Frame); // Call actual render func
+ gles3Error = context.getError();
+ }
+ catch (e) {
+ if (e instanceof es3fFboTestUtil.FboIncompleteException) {
+ e.message = WebGLTestUtils.glEnumToString(gl, e.getReason());
+ if(e.getReason() == gl.FRAMEBUFFER_UNSUPPORTED) {
+ // Mark test case as unsupported
+ bufferedLogToConsole(e + ': ' + e.message);
+ testFailed('Not supported');
+ return tcuTestCase.IterateResult.STOP;
+ }
+ }
+
+ // Propagate error
+ throw e;
+ }
+
+ // Render reference image
+
+ /** @type {sglrReferenceContext.ReferenceContextBuffers} */
+ var buffers = new sglrReferenceContext.ReferenceContextBuffers(
+ new tcuPixelFormat.PixelFormat(
+ 8, 8, 8,
+ gl.getParameter(gl.ALPHA_BITS) ? 8 : 0
+ ),
+ /** @type {number} */ (gl.getParameter(gl.DEPTH_BITS)),
+ /** @type {number} */ (gl.getParameter(gl.STENCIL_BITS)),
+ width,
+ height
+ );
+ context = new sglrReferenceContext.ReferenceContext(
+ new sglrReferenceContext.ReferenceContextLimits(gl),
+ buffers.getColorbuffer(),
+ buffers.getDepthbuffer(),
+ buffers.getStencilbuffer()
+ );
+
+ context.clearColor(
+ clearColor[0], clearColor[1], clearColor[2], clearColor[3]
+ );
+
+ context.clear(
+ gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT
+ );
+
+ this.render(context, refFrame);
+ refError = context.getError();
+
+ // Compare error codes
+ var errorCodesOk = (gles3Error == refError);
+
+ if (!errorCodesOk) {
+ bufferedLogToConsole (
+ 'Error code mismatch: got ' +
+ WebGLTestUtils.glEnumToString(gl, gles3Error) + ', expected ' +
+ WebGLTestUtils.glEnumToString(gl, refError)
+ );
+ failReason = 'Got unexpected error';
+ }
+
+ // Compare images
+ var imagesOk = this.compare(refFrame, gles3Frame);
+
+ if (!imagesOk && !failReason)
+ failReason = 'Image comparison failed';
+
+ // Store test result
+ var isOk = errorCodesOk && imagesOk;
+ assertMsgOptions(isOk, failReason, true, true);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @param {tcuSurface.Surface} reference
+ * @param {tcuSurface.Surface} result
+ * @return {boolean}
+ */
+ es3fFboRenderTest.FboRenderCase.prototype.compare = function(
+ reference, result) {
+
+ var threshold = new tcuRGBA.RGBA(
+ /* TODO: tcu::max(getFormatThreshold(this.m_config.colorFormat),*/
+ [12, 12, 12, 12]
+ );
+
+ return tcuImageCompare.bilinearCompare(
+ 'ComparisonResult', 'Image comparison result',
+ reference.getAccess(), result.getAccess(),
+ threshold, tcuImageCompare.CompareLogMode.RESULT
+ );
+ };
+
+ /**
+ * deinit
+ */
+ es3fFboRenderTest.FboRenderCase.prototype.deinit = function() {
+ gl.clearColor(0.0, 0.0, 0.0, 0.0);
+ gl.clearDepth(1.0);
+ gl.clearStencil(0);
+
+ gl.disable(gl.STENCIL_TEST);
+ gl.disable(gl.DEPTH_TEST);
+ gl.disable(gl.BLEND);
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.bindRenderbuffer(gl.RENDERBUFFER, null);
+ };
+
+ // FboCases
+
+ /**
+ * @constructor
+ * @extends {es3fFboRenderTest.FboRenderCase}
+ * @param {es3fFboRenderTest.FboConfig} config
+ */
+ es3fFboRenderTest.StencilClearsTest = function(config) {
+ es3fFboRenderTest.FboRenderCase.call(
+ this, config.getName(), 'Stencil clears', config
+ );
+ };
+
+ es3fFboRenderTest.StencilClearsTest.prototype =
+ Object.create(es3fFboRenderTest.FboRenderCase.prototype);
+
+ es3fFboRenderTest.StencilClearsTest.prototype.constructor =
+ es3fFboRenderTest.StencilClearsTest;
+
+ /**
+ * @param {?sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext}
+ * context
+ * @param {tcuSurface.Surface} dst
+ */
+ es3fFboRenderTest.StencilClearsTest.prototype.render = function(
+ context, dst) {
+
+ /** @type {tcuTexture.TextureFormat} */
+ var colorFormat = gluTextureUtil.mapGLInternalFormat(
+ this.m_config.colorFormat
+ );
+
+ /** @type {gluShaderUtil.DataType} */
+ var fboSamplerType = /** @type {gluShaderUtil.DataType} */ (
+ gluTextureUtil.getSampler2DType(colorFormat)
+ );
+
+ /** @type {gluShaderUtil.DataType} */
+ var fboOutputType = es3fFboTestUtil.getFragmentOutputType(colorFormat);
+
+ /** @type {tcuTextureUtil.TextureFormatInfo} */
+ var fboRangeInfo = tcuTextureUtil.getTextureFormatInfo(colorFormat);
+
+ var fboOutScale = deMath.subtract(
+ fboRangeInfo.valueMax, fboRangeInfo.valueMin
+ );
+
+ var fboOutBias = fboRangeInfo.valueMin;
+
+ /** @type {es3fFboTestUtil.Texture2DShader} */
+ var texToFboShader = new es3fFboTestUtil.Texture2DShader(
+ [gluShaderUtil.DataType.SAMPLER_2D], fboOutputType
+ );
+
+ /** @type {es3fFboTestUtil.Texture2DShader} */
+ var texFromFboShader = new es3fFboTestUtil.Texture2DShader(
+ [fboSamplerType], gluShaderUtil.DataType.FLOAT_VEC4);
+
+ /** @type {number} */ var texToFboShaderID =
+ context.createProgram(texToFboShader);
+
+ /** @type {number} */ var texFromFboShaderID =
+ context.createProgram(texFromFboShader);
+
+ /** @type {?WebGLTexture|sglrReferenceContext.TextureContainer} */
+ var metaballsTex = context.createTexture();
+
+ /** @type {?WebGLTexture|sglrReferenceContext.TextureContainer} */
+ var quadsTex = context.createTexture();
+
+ /** @type {number} */ var width = 128;
+ /** @type {number} */ var height = 128;
+
+ texToFboShader.setOutScaleBias(fboOutScale, fboOutBias);
+ texFromFboShader.setTexScaleBias(
+ 0, fboRangeInfo.lookupScale, fboRangeInfo.lookupBias
+ );
+
+ es3fFboRenderTest.createQuadsTex2D(
+ context, quadsTex, gl.RGBA, gl.UNSIGNED_BYTE, width, height
+ );
+
+ es3fFboRenderTest.createMetaballsTex2D(
+ context, metaballsTex, gl.RGBA, gl.UNSIGNED_BYTE, width, height
+ );
+
+ /** @type {es3fFboRenderTest.Framebuffer} */
+ var fbo = new es3fFboRenderTest.Framebuffer(
+ context, this.m_config, width, height
+ );
+ fbo.checkCompleteness();
+
+ // Bind framebuffer and clear
+ context.bindFramebuffer(gl.FRAMEBUFFER, fbo.getFramebuffer());
+ context.viewport(0, 0, width, height);
+ context.clearColor(0.0, 0.0, 0.0, 1.0);
+ context.clear(
+ gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT
+ );
+
+ // Do stencil clears
+ context.enable(gl.SCISSOR_TEST);
+ context.scissor(10, 16, 32, 120);
+ context.clearStencil(1);
+ context.clear(gl.STENCIL_BUFFER_BIT);
+ context.scissor(16, 32, 100, 64);
+ context.clearStencil(2);
+ context.clear(gl.STENCIL_BUFFER_BIT);
+ context.disable(gl.SCISSOR_TEST);
+
+ // Draw 2 textures with stecil tests
+ context.enable(gl.STENCIL_TEST);
+
+ context.bindTexture(gl.TEXTURE_2D, quadsTex);
+ context.stencilFunc(gl.EQUAL, 1, 0xff);
+
+ texToFboShader.setUniforms(context, texToFboShaderID);
+ rrUtil.drawQuad(
+ context, texToFboShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]
+ );
+
+ context.bindTexture(gl.TEXTURE_2D, metaballsTex);
+ context.stencilFunc(gl.EQUAL, 2, 0xff);
+
+ texToFboShader.setUniforms(context, texToFboShaderID);
+ rrUtil.drawQuad(
+ context, texToFboShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]
+ );
+
+ context.disable(gl.STENCIL_TEST);
+
+ if (fbo.getConfig().colorType == gl.TEXTURE_2D) {
+ context.bindFramebuffer(gl.FRAMEBUFFER, null);
+ context.bindTexture(gl.TEXTURE_2D, fbo.getColorBuffer());
+ context.viewport(0, 0, context.getWidth(), context.getHeight());
+
+ texFromFboShader.setUniforms(context, texFromFboShaderID);
+ rrUtil.drawQuad(
+ context, texFromFboShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]
+ );
+
+ dst.readViewport(
+ context, [0, 0, context.getWidth(), context.getHeight()]
+ );
+ } else
+ es3fFboTestUtil.readPixels(
+ context, dst, 0, 0, width, height, colorFormat,
+ fboRangeInfo.lookupScale, fboRangeInfo.lookupBias
+ );
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fFboRenderTest.FboRenderCase}
+ * @param {es3fFboRenderTest.FboConfig} config
+ */
+ es3fFboRenderTest.SharedColorbufferTest = function(config) {
+ es3fFboRenderTest.FboRenderCase.call(
+ this, config.getName(), 'Shared colorbuffer', config
+ );
+ };
+
+ es3fFboRenderTest.SharedColorbufferTest.prototype =
+ Object.create(es3fFboRenderTest.FboRenderCase.prototype);
+
+ es3fFboRenderTest.SharedColorbufferTest.prototype.constructor =
+ es3fFboRenderTest.SharedColorbufferTest;
+
+ /**
+ * @param {?sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext}
+ * context
+ * @param {tcuSurface.Surface} dst
+ */
+ es3fFboRenderTest.SharedColorbufferTest.prototype.render = function(
+ context, dst) {
+
+ /** @type {es3fFboTestUtil.Texture2DShader} */
+ var texShader = new es3fFboTestUtil.Texture2DShader(
+ [gluShaderUtil.DataType.SAMPLER_2D],
+ gluShaderUtil.DataType.FLOAT_VEC4
+ );
+
+ /** @type {es3fFboTestUtil.FlatColorShader} */
+ var flatShader = new es3fFboTestUtil.FlatColorShader(
+ gluShaderUtil.DataType.FLOAT_VEC4
+ );
+
+ /** @type {number} */
+ var texShaderID = context.createProgram(texShader);
+ /** @type {number} */
+ var flatShaderID = context.createProgram(flatShader);
+
+ /** @type {number} */ var width = 128;
+ /** @type {number} */ var height = 128;
+
+ /** @type {?WebGLTexture|sglrReferenceContext.TextureContainer} */
+ var quadsTex = context.createTexture();
+
+ /** @type {?WebGLTexture|sglrReferenceContext.TextureContainer} */
+ var metaballsTex = context.createTexture();
+
+ /** @type {boolean} */ var stencil =
+ (this.m_config.buffers & gl.STENCIL_BUFFER_BIT) != 0;
+
+ context.disable(gl.DITHER);
+
+ // Textures
+ es3fFboRenderTest.createQuadsTex2D(
+ context, quadsTex, gl.RGB, gl.UNSIGNED_BYTE, 64, 64
+ );
+ es3fFboRenderTest.createMetaballsTex2D(
+ context, metaballsTex, gl.RGBA, gl.UNSIGNED_BYTE, 64, 64
+ );
+
+ context.viewport(0, 0, width, height);
+
+ // Fbo A
+ /** @type {es3fFboRenderTest.Framebuffer} */
+ var fboA = new es3fFboRenderTest.Framebuffer(
+ context, this.m_config, width, height
+ );
+ fboA.checkCompleteness();
+
+ // Fbo B - don't create colorbuffer
+
+ /** @type {es3fFboRenderTest.FboConfig} */
+ var cfg = /** @type {es3fFboRenderTest.FboConfig} */
+ (deUtil.clone(this.m_config));
+
+ cfg.buffers = deMath.binaryOp(
+ cfg.buffers,
+ deMath.binaryNot(gl.COLOR_BUFFER_BIT),
+ deMath.BinaryOp.AND
+ );
+ cfg.colorType = gl.NONE;
+ cfg.colorFormat = gl.NONE;
+
+ /** @type {es3fFboRenderTest.Framebuffer} */
+ var fboB = new es3fFboRenderTest.Framebuffer(
+ context, cfg, width, height
+ );
+
+ // Attach color buffer from fbo A
+ context.bindFramebuffer(gl.FRAMEBUFFER, fboB.getFramebuffer());
+ switch (this.m_config.colorType) {
+ case gl.TEXTURE_2D:
+ context.framebufferTexture2D(
+ gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0,
+ gl.TEXTURE_2D, fboA.getColorBuffer(), 0
+ );
+ break;
+
+ case gl.RENDERBUFFER:
+ context.framebufferRenderbuffer(
+ gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0,
+ gl.RENDERBUFFER, fboA.getColorBuffer()
+ );
+ break;
+
+ default:
+ throw new Error('Invalid color type');
+ }
+
+ // Clear depth and stencil in fbo B
+ context.clear(gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+
+ // Render quads to fbo 1, with depth 0.0
+ context.bindFramebuffer(gl.FRAMEBUFFER, fboA.getFramebuffer());
+ context.bindTexture(gl.TEXTURE_2D, quadsTex);
+ context.clearColor(0.0, 0.0, 0.0, 1.0);
+ context.clear(
+ gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT
+ );
+
+ if (stencil) {
+ // Stencil to 1 in fbo A
+ context.clearStencil(1);
+ context.clear(gl.STENCIL_BUFFER_BIT);
+ }
+
+ texShader.setUniforms(context, texShaderID);
+
+ context.enable(gl.DEPTH_TEST);
+ rrUtil.drawQuad(
+ context, texShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]
+ );
+ context.disable(gl.DEPTH_TEST);
+
+ // Blend metaballs to fbo 2
+ context.bindFramebuffer(gl.FRAMEBUFFER, fboB.getFramebuffer());
+ context.bindTexture(gl.TEXTURE_2D, metaballsTex);
+ context.enable(gl.BLEND);
+ context.blendFuncSeparate(
+ gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ZERO, gl.ONE
+ );
+ rrUtil.drawQuad(
+ context, texShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]
+ );
+
+ // Render small quad that is only visible if depth buffer
+ // is not shared with fbo A - or there is no depth bits
+ context.bindTexture(gl.TEXTURE_2D, quadsTex);
+ context.enable(gl.DEPTH_TEST);
+ rrUtil.drawQuad(context, texShaderID, [0.5, 0.5, 0.5], [1.0, 1.0, 0.5]);
+ context.disable(gl.DEPTH_TEST);
+
+ if (stencil) {
+ flatShader.setColor(context, flatShaderID, [0.0, 1.0, 0.0, 1.0]);
+
+ // Clear subset of stencil buffer to 1
+ context.enable(gl.SCISSOR_TEST);
+ context.scissor(10, 10, 12, 25);
+ context.clearStencil(1);
+ context.clear(gl.STENCIL_BUFFER_BIT);
+ context.disable(gl.SCISSOR_TEST);
+
+ // Render quad with stencil mask == 1
+ context.enable(gl.STENCIL_TEST);
+ context.stencilFunc(gl.EQUAL, 1, 0xff);
+ rrUtil.drawQuad(
+ context, flatShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]
+ );
+ context.disable(gl.STENCIL_TEST);
+ }
+
+ // Get results
+ if (fboA.getConfig().colorType == gl.TEXTURE_2D) {
+ texShader.setUniforms(context, texShaderID);
+
+ context.bindFramebuffer(gl.FRAMEBUFFER, null);
+ context.bindTexture(gl.TEXTURE_2D, fboA.getColorBuffer());
+ context.viewport(0, 0, context.getWidth(), context.getHeight());
+ rrUtil.drawQuad(
+ context, texShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]
+ );
+ dst.readViewport(
+ context, [0, 0, context.getWidth(), context.getHeight()]
+ );
+ } else
+ es3fFboTestUtil.readPixels(
+ context, dst, 0, 0, width, height,
+ gluTextureUtil.mapGLInternalFormat(
+ fboA.getConfig().colorFormat
+ ), [1.0, 1.0, 1.0, 1.0], [0.0, 0.0, 0.0, 0.0]
+ );
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fFboRenderTest.FboRenderCase}
+ * @param {es3fFboRenderTest.FboConfig} config
+ */
+ es3fFboRenderTest.SharedColorbufferClearsTest = function(config) {
+ es3fFboRenderTest.FboRenderCase.call(
+ this, config.getName(), 'Shared colorbuffer clears', config
+ );
+ };
+
+ es3fFboRenderTest.SharedColorbufferClearsTest.prototype =
+ Object.create(es3fFboRenderTest.FboRenderCase.prototype);
+
+ es3fFboRenderTest.SharedColorbufferClearsTest.prototype.constructor =
+ es3fFboRenderTest.SharedColorbufferClearsTest;
+
+ /**
+ * @param {?sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext}
+ * context
+ * @param {tcuSurface.Surface} dst
+ */
+ es3fFboRenderTest.SharedColorbufferClearsTest.prototype.render = function(
+ context, dst) {
+
+ /** @type {tcuTexture.TextureFormat} */
+ var colorFormat = gluTextureUtil.mapGLInternalFormat(
+ this.m_config.colorFormat
+ );
+
+ /** @type {gluShaderUtil.DataType} */
+ var fboSamplerType = gluTextureUtil.getSampler2DType(colorFormat);
+
+ var width = 128;
+ var height = 128;
+ var colorbuffer = this.m_config.colorType == gl.TEXTURE_2D?
+ context.createTexture() :
+ context.createRenderbuffer();
+
+ // Check for format support.
+ es3fFboRenderTest.checkColorFormatSupport(
+ context, this.m_config.colorFormat
+ );
+
+ // Single colorbuffer
+ if (this.m_config.colorType == gl.TEXTURE_2D) {
+ context.bindTexture(gl.TEXTURE_2D, colorbuffer);
+ context.texImage2DDelegate(
+ gl.TEXTURE_2D, 0, this.m_config.colorFormat, width, height
+ );
+ context.texParameteri(
+ gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST
+ );
+ context.texParameteri(
+ gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST
+ );
+ } else {
+ assertMsgOptions(
+ this.m_config.colorType == gl.RENDERBUFFER,
+ 'Not a render buffer type', false, true
+ );
+ context.bindRenderbuffer(gl.RENDERBUFFER, colorbuffer);
+ context.renderbufferStorage(
+ gl.RENDERBUFFER, this.m_config.colorFormat, width, height
+ );
+ }
+
+ // Multiple framebuffers sharing the colorbuffer
+ var fbo = [
+ context.createFramebuffer(),
+ context.createFramebuffer(),
+ context.createFramebuffer()
+ ];
+
+ for (var fboi = 0; fboi < fbo.length; fboi++) {
+ context.bindFramebuffer(gl.FRAMEBUFFER, fbo[fboi]);
+
+ if (this.m_config.colorType == gl.TEXTURE_2D)
+ context.framebufferTexture2D(
+ gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0,
+ gl.TEXTURE_2D, colorbuffer, 0
+ );
+ else
+ context.framebufferRenderbuffer(
+ gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0,
+ gl.RENDERBUFFER, colorbuffer
+ );
+ }
+
+ context.bindFramebuffer(gl.FRAMEBUFFER, fbo[0]);
+
+ // Check completeness
+
+ var status = context.checkFramebufferStatus(gl.FRAMEBUFFER);
+ if (status != gl.FRAMEBUFFER_COMPLETE)
+ throw new es3fFboTestUtil.FboIncompleteException(status);
+
+ // Render to them
+ context.viewport(0, 0, width, height);
+ context.clearColor(0.0, 0.0, 1.0, 1.0);
+ context.clear(gl.COLOR_BUFFER_BIT);
+
+ context.enable(gl.SCISSOR_TEST);
+
+ context.bindFramebuffer(gl.FRAMEBUFFER, fbo[1]);
+ context.clearColor(0.6, 0.0, 0.0, 1.0);
+ context.scissor(10, 10, 64, 64);
+ context.clear(gl.COLOR_BUFFER_BIT);
+ context.clearColor(0.0, 0.6, 0.0, 1.0);
+ context.scissor(60, 60, 40, 20);
+ context.clear(gl.COLOR_BUFFER_BIT);
+
+ context.bindFramebuffer(gl.FRAMEBUFFER, fbo[2]);
+ context.clearColor(0.0, 0.0, 0.6, 1.0);
+ context.scissor(20, 20, 100, 10);
+ context.clear(gl.COLOR_BUFFER_BIT);
+
+ context.bindFramebuffer(gl.FRAMEBUFFER, fbo[0]);
+ context.clearColor(0.6, 0.0, 0.6, 1.0);
+ context.scissor(20, 20, 5, 100);
+ context.clear(gl.COLOR_BUFFER_BIT);
+
+ context.disable(gl.SCISSOR_TEST);
+
+ if (this.m_config.colorType == gl.TEXTURE_2D) {
+ /** @type {es3fFboTestUtil.Texture2DShader} */
+ var shader = new es3fFboTestUtil.Texture2DShader(
+ [fboSamplerType], gluShaderUtil.DataType.FLOAT_VEC4
+ );
+ var shaderID = context.createProgram(shader);
+
+ shader.setUniforms(context, shaderID);
+
+ context.bindFramebuffer(gl.FRAMEBUFFER, null);
+ context.viewport(0, 0, context.getWidth(), context.getHeight());
+ rrUtil.drawQuad(
+ context, shaderID, [-0.9, -0.9, 0.0], [0.9, 0.9, 0.0]
+ );
+ dst.readViewport(
+ context, [0, 0, context.getWidth(), context.getHeight()]
+ );
+ } else
+ es3fFboTestUtil.readPixels(
+ context, dst, 0, 0, width, height, colorFormat,
+ [1.0, 1.0, 1.0, 1.0], [0.0, 0.0, 0.0, 0.0]
+ );
+
+ //delete FBOs
+ for (fboi = 0; fboi < fbo.length; fboi++)
+ context.deleteFramebuffer(fbo[fboi]);
+
+ //delete Texture/Renderbuffer
+ if (this.m_config.colorType == gl.TEXTURE_2D)
+ context.deleteTexture(colorbuffer);
+ else
+ context.deleteRenderbuffer(colorbuffer);
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fFboRenderTest.FboRenderCase}
+ * @param {es3fFboRenderTest.FboConfig} config
+ */
+ es3fFboRenderTest.SharedDepthStencilTest = function(config) {
+ es3fFboRenderTest.FboRenderCase.call(
+ this, config.getName(), 'Shared depth/stencilbuffer', config
+ );
+ };
+
+ es3fFboRenderTest.SharedDepthStencilTest.prototype =
+ Object.create(es3fFboRenderTest.FboRenderCase.prototype);
+
+ es3fFboRenderTest.SharedDepthStencilTest.prototype.constructor =
+ es3fFboRenderTest.SharedDepthStencilTest;
+
+ /**
+ * @param {es3fFboRenderTest.FboConfig} config
+ * @return {boolean}
+ */
+ es3fFboRenderTest.SharedDepthStencilTest.prototype.isConfigSupported =
+ function(config) {
+ return deMath.binaryOp(
+ config.buffers,
+ deMath.binaryOp(
+ gl.DEPTH_BUFFER_BIT, gl.STENCIL_BUFFER_BIT, deMath.BinaryOp.OR
+ ), deMath.BinaryOp.AND
+ ) != 0;
+ };
+
+ /**
+ * @param {?sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext}
+ * context
+ * @param {tcuSurface.Surface} dst
+ */
+ es3fFboRenderTest.SharedDepthStencilTest.prototype.render = function(
+ context, dst) {
+
+ /** @type {es3fFboTestUtil.Texture2DShader} */
+ var texShader = new es3fFboTestUtil.Texture2DShader(
+ [gluShaderUtil.DataType.SAMPLER_2D],
+ gluShaderUtil.DataType.FLOAT_VEC4
+ );
+
+ /** @type {es3fFboTestUtil.FlatColorShader} */
+ var flatShader = new es3fFboTestUtil.FlatColorShader(
+ gluShaderUtil.DataType.FLOAT_VEC4
+ );
+
+ var texShaderID = context.createProgram(texShader);
+ var flatShaderID = context.createProgram(flatShader);
+ var width = 128;
+ var height = 128;
+ // bool depth = (this.m_config.buffers & gl.DEPTH_BUFFER_BIT) != 0;
+ /**@type {boolean} */ var stencil =
+ (this.m_config.buffers & gl.STENCIL_BUFFER_BIT) != 0;
+
+ // Textures
+ var metaballsTex = context.createTexture();
+ var quadsTex = context.createTexture();
+ es3fFboRenderTest.createMetaballsTex2D(
+ context, metaballsTex, gl.RGB, gl.UNSIGNED_BYTE, 64, 64
+ );
+ es3fFboRenderTest.createQuadsTex2D(
+ context, quadsTex, gl.RGB, gl.UNSIGNED_BYTE, 64, 64
+ );
+
+ context.viewport(0, 0, width, height);
+
+ // Fbo A
+ /** @type {es3fFboRenderTest.Framebuffer} */
+ var fboA = new es3fFboRenderTest.Framebuffer(
+ context, this.m_config, width, height
+ );
+
+ fboA.checkCompleteness();
+
+ // Fbo B
+ /** @type {es3fFboRenderTest.FboConfig} */
+ var cfg = /** @type {es3fFboRenderTest.FboConfig} */
+ (deUtil.clone(this.m_config));
+
+ cfg.buffers = deMath.binaryOp(
+ cfg.buffers,
+ deMath.binaryNot(gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT),
+ deMath.BinaryOp.AND
+ );
+ cfg.depthStencilType = gl.NONE;
+ cfg.depthStencilFormat = gl.NONE;
+
+ /** @type {es3fFboRenderTest.Framebuffer} */
+ var fboB = new es3fFboRenderTest.Framebuffer(
+ context, cfg, width, height
+ );
+
+ // Bind depth/stencil buffers from fbo A to fbo B
+ context.bindFramebuffer(gl.FRAMEBUFFER, fboB.getFramebuffer());
+ for (var ndx = 0; ndx < 2; ndx++) {
+ var bit = ndx ? gl.STENCIL_BUFFER_BIT : gl.DEPTH_BUFFER_BIT;
+ var point = ndx ? gl.STENCIL_ATTACHMENT : gl.DEPTH_ATTACHMENT;
+
+ if (
+ deMath.binaryOp(
+ this.m_config.buffers, bit, deMath.BinaryOp.AND
+ ) == 0
+ )
+ continue;
+
+ switch (this.m_config.depthStencilType) {
+ case gl.TEXTURE_2D:
+ context.framebufferTexture2D(
+ gl.FRAMEBUFFER, point, gl.TEXTURE_2D,
+ fboA.getDepthStencilBuffer(), 0
+ );
+ break;
+ case gl.RENDERBUFFER:
+ context.framebufferRenderbuffer(
+ gl.FRAMEBUFFER, point, gl.RENDERBUFFER,
+ fboA.getDepthStencilBuffer()
+ );
+ break;
+ default:
+ testFailed('Not implemented');
+ }
+ }
+
+ // Setup uniforms
+ texShader.setUniforms(context, texShaderID);
+
+ // Clear color to red and stencil to 1 in fbo B.
+ context.clearColor(1.0, 0.0, 0.0, 1.0);
+ context.clearStencil(1);
+ context.clear(
+ gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT
+ );
+
+ context.enable(gl.DEPTH_TEST);
+
+ // Render quad to fbo A
+ context.bindFramebuffer(gl.FRAMEBUFFER, fboA.getFramebuffer());
+ context.bindTexture(gl.TEXTURE_2D, quadsTex);
+ rrUtil.drawQuad(
+ context, texShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]
+ );
+
+ if (stencil) {
+ // Clear subset of stencil buffer to 0 in fbo A
+ context.enable(gl.SCISSOR_TEST);
+ context.scissor(10, 10, 12, 25);
+ context.clearStencil(0);
+ context.clear(gl.STENCIL_BUFFER_BIT);
+ context.disable(gl.SCISSOR_TEST);
+ }
+
+ // Render metaballs to fbo B
+ context.bindFramebuffer(gl.FRAMEBUFFER, fboB.getFramebuffer());
+ context.bindTexture(gl.TEXTURE_2D, metaballsTex);
+ rrUtil.drawQuad(
+ context, texShaderID, [-1.0, -1.0, -1.0], [1.0, 1.0, 1.0]
+ );
+
+ context.disable(gl.DEPTH_TEST);
+
+ if (stencil) {
+ // Render quad with stencil mask == 0
+ context.enable(gl.STENCIL_TEST);
+ context.stencilFunc(gl.EQUAL, 0, 0xff);
+ context.useProgram(flatShaderID);
+ flatShader.setColor(context, flatShaderID, [0.0, 1.0, 0.0, 1.0]);
+ rrUtil.drawQuad(
+ context, flatShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]
+ );
+ context.disable(gl.STENCIL_TEST);
+ }
+
+ if (this.m_config.colorType == gl.TEXTURE_2D) {
+ // Render both to screen
+ context.bindFramebuffer(gl.FRAMEBUFFER, null);
+ context.viewport(0, 0, context.getWidth(), context.getHeight());
+ context.bindTexture(gl.TEXTURE_2D, fboA.getColorBuffer());
+ rrUtil.drawQuad(
+ context, texShaderID, [-1.0, -1.0, 0.0], [0.0, 1.0, 0.0]
+ );
+ context.bindTexture(gl.TEXTURE_2D, fboB.getColorBuffer());
+ rrUtil.drawQuad(
+ context, texShaderID, [0.0, -1.0, 0.0], [1.0, 1.0, 0.0]
+ );
+
+ dst.readViewport(
+ context, [0, 0, context.getWidth(), context.getHeight()]
+ );
+ } else {
+ // Read results from fbo B
+ es3fFboTestUtil.readPixels(
+ context, dst, 0, 0, width, height,
+ gluTextureUtil.mapGLInternalFormat(this.m_config.colorFormat),
+ [1.0, 1.0, 1.0, 1.0], [0.0, 0.0, 0.0, 0.0]
+ );
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fFboRenderTest.FboRenderCase}
+ * @param {es3fFboRenderTest.FboConfig} config
+ */
+ es3fFboRenderTest.ResizeTest = function(config) {
+ es3fFboRenderTest.FboRenderCase.call(
+ this, config.getName(), 'Resize framebuffer', config
+ );
+ };
+
+ es3fFboRenderTest.ResizeTest.prototype =
+ Object.create(es3fFboRenderTest.FboRenderCase.prototype);
+
+ es3fFboRenderTest.ResizeTest.prototype.constructor =
+ es3fFboRenderTest.ResizeTest;
+
+ /**
+ * @param {?sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext}
+ * context
+ * @param {tcuSurface.Surface} dst
+ */
+ es3fFboRenderTest.ResizeTest.prototype.render = function(context, dst) {
+ /** @type {tcuTexture.TextureFormat} */
+ var colorFormat = gluTextureUtil.mapGLInternalFormat(
+ this.m_config.colorFormat
+ );
+ /** @type {gluShaderUtil.DataType} */
+ var fboSamplerType = gluTextureUtil.getSampler2DType(colorFormat);
+ /** @type {gluShaderUtil.DataType} */
+ var fboOutputType = es3fFboTestUtil.getFragmentOutputType(colorFormat);
+ /** @type {tcuTextureUtil.TextureFormatInfo} */
+ var fboRangeInfo = tcuTextureUtil.getTextureFormatInfo(colorFormat);
+ var fboOutScale = deMath.subtract(
+ fboRangeInfo.valueMax, fboRangeInfo.valueMin
+ );
+ var fboOutBias = fboRangeInfo.valueMin;
+
+ /** @type {es3fFboTestUtil.Texture2DShader} */
+ var texToFboShader = new es3fFboTestUtil.Texture2DShader(
+ [gluShaderUtil.DataType.SAMPLER_2D], fboOutputType
+ );
+
+ /** @type {es3fFboTestUtil.Texture2DShader} */
+ var texFromFboShader = new es3fFboTestUtil.Texture2DShader(
+ [fboSamplerType], gluShaderUtil.DataType.FLOAT_VEC4
+ );
+
+ /** @type {es3fFboTestUtil.FlatColorShader} */
+ var flatShader = new es3fFboTestUtil.FlatColorShader(fboOutputType);
+ /** @type {WebGLProgram} */
+ var texToFboShaderID = context.createProgram(texToFboShader);
+ /** @type {WebGLProgram} */
+ var texFromFboShaderID = context.createProgram(texFromFboShader);
+ /** @type {WebGLProgram} */
+ var flatShaderID = context.createProgram(flatShader);
+
+ var quadsTex = context.createTexture();
+ var metaballsTex = context.createTexture();
+
+ var depth = deMath.binaryOp(
+ this.m_config.buffers, gl.DEPTH_BUFFER_BIT, deMath.BinaryOp.AND
+ ) != 0;
+ var stencil = deMath.binaryOp(
+ this.m_config.buffers, gl.STENCIL_BUFFER_BIT, deMath.BinaryOp.AND
+ ) != 0;
+
+ var initialWidth = 128;
+ var initialHeight = 128;
+ var newWidth = 64;
+ var newHeight = 32;
+
+ texToFboShader.setOutScaleBias(fboOutScale, fboOutBias);
+ texFromFboShader.setTexScaleBias(
+ 0, fboRangeInfo.lookupScale, fboRangeInfo.lookupBias
+ );
+
+ es3fFboRenderTest.createQuadsTex2D(
+ context, quadsTex, gl.RGB, gl.UNSIGNED_BYTE, 64, 64
+ );
+ es3fFboRenderTest.createMetaballsTex2D(
+ context, metaballsTex, gl.RGB, gl.UNSIGNED_BYTE, 32, 32
+ );
+
+ /** @type {es3fFboRenderTest.Framebuffer} */
+ var fbo = new es3fFboRenderTest.Framebuffer(
+ context, this.m_config, initialWidth, initialHeight
+ );
+ fbo.checkCompleteness();
+
+ // Setup shaders
+ texToFboShader.setUniforms(context, texToFboShaderID);
+ texFromFboShader.setUniforms(context, texFromFboShaderID);
+ flatShader.setColor(
+ context, flatShaderID, deMath.add(
+ deMath.multiply([0.0, 1.0, 0.0, 1.0], fboOutScale), fboOutBias
+ )
+ );
+
+ // Render quads
+ context.bindFramebuffer(gl.FRAMEBUFFER, fbo.getFramebuffer());
+ context.viewport(0, 0, initialWidth, initialHeight);
+ es3fFboTestUtil.clearColorBuffer(
+ context, colorFormat, [0.0, 0.0, 0.0, 1.0]
+ );
+ context.clear(gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+ context.bindTexture(gl.TEXTURE_2D, quadsTex);
+ rrUtil.drawQuad(
+ context, texToFboShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]
+ );
+
+ if (fbo.getConfig().colorType == gl.TEXTURE_2D) {
+ // Render fbo to screen
+ context.bindFramebuffer(gl.FRAMEBUFFER, null);
+ context.viewport(0, 0, context.getWidth(), context.getHeight());
+ context.bindTexture(gl.TEXTURE_2D, fbo.getColorBuffer());
+ rrUtil.drawQuad(
+ context, texFromFboShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]
+ );
+ // Restore binding
+ context.bindFramebuffer(gl.FRAMEBUFFER, fbo.getFramebuffer());
+ }
+
+ // Resize buffers
+ switch (fbo.getConfig().colorType) {
+ case gl.TEXTURE_2D:
+ context.bindTexture(gl.TEXTURE_2D, fbo.getColorBuffer());
+ context.texImage2DDelegate(
+ gl.TEXTURE_2D, 0, fbo.getConfig().colorFormat,
+ newWidth, newHeight
+ );
+ break;
+
+ case gl.RENDERBUFFER:
+ context.bindRenderbuffer(gl.RENDERBUFFER, fbo.getColorBuffer());
+ context.renderbufferStorage(
+ gl.RENDERBUFFER, fbo.getConfig().colorFormat,
+ newWidth, newHeight
+ );
+ break;
+
+ default:
+ throw new Error('Color type unsupported');
+ }
+
+ if (depth || stencil) {
+ switch (fbo.getConfig().depthStencilType) {
+ case gl.TEXTURE_2D:
+ context.bindTexture(
+ gl.TEXTURE_2D, fbo.getDepthStencilBuffer()
+ );
+ context.texImage2DDelegate(
+ gl.TEXTURE_2D, 0, fbo.getConfig().depthStencilFormat,
+ newWidth, newHeight
+ );
+ break;
+
+ case gl.RENDERBUFFER:
+ context.bindRenderbuffer(
+ gl.RENDERBUFFER, fbo.getDepthStencilBuffer()
+ );
+ context.renderbufferStorage(
+ gl.RENDERBUFFER, fbo.getConfig().depthStencilFormat,
+ newWidth, newHeight
+ );
+ break;
+
+ default:
+ throw new Error('Depth / stencil type unsupported');
+ }
+ }
+
+ // Render to resized fbo
+ context.viewport(0, 0, newWidth, newHeight);
+ es3fFboTestUtil.clearColorBuffer(
+ context, colorFormat, [1.0, 0.0, 0.0, 1.0]
+ );
+ context.clear(gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+
+ context.enable(gl.DEPTH_TEST);
+
+ context.bindTexture(gl.TEXTURE_2D, metaballsTex);
+ rrUtil.drawQuad(
+ context, texToFboShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]
+ );
+
+ context.bindTexture(gl.TEXTURE_2D, quadsTex);
+ rrUtil.drawQuad(
+ context, texToFboShaderID, [0.0, 0.0, -1.0], [1.0, 1.0, 1.0]
+ );
+
+ context.disable(gl.DEPTH_TEST);
+
+ if (stencil) {
+ context.enable(gl.SCISSOR_TEST);
+ context.clearStencil(1);
+ context.scissor(10, 10, 5, 15);
+ context.clear(gl.STENCIL_BUFFER_BIT);
+ context.disable(gl.SCISSOR_TEST);
+
+ context.enable(gl.STENCIL_TEST);
+ context.stencilFunc(gl.EQUAL, 1, 0xff);
+ rrUtil.drawQuad(
+ context, flatShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]
+ );
+ context.disable(gl.STENCIL_TEST);
+ }
+
+ if (this.m_config.colorType == gl.TEXTURE_2D) {
+ context.bindFramebuffer(gl.FRAMEBUFFER, null);
+ context.viewport(0, 0, context.getWidth(), context.getHeight());
+ context.bindTexture(gl.TEXTURE_2D, fbo.getColorBuffer());
+ rrUtil.drawQuad(
+ context, texFromFboShaderID, [-0.5, -0.5, 0.0], [0.5, 0.5, 0.0]
+ );
+ dst.readViewport(
+ context, [0, 0, context.getWidth(), context.getHeight()]
+ );
+ } else
+ es3fFboTestUtil.readPixels(
+ context, dst, 0, 0, newWidth, newHeight, colorFormat,
+ fboRangeInfo.lookupScale, fboRangeInfo.lookupBias
+ );
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fFboRenderTest.FboRenderCase}
+ * @param {es3fFboRenderTest.FboConfig} config
+ * @param {number} buffers
+ * @param {boolean} rebind
+ */
+ es3fFboRenderTest.RecreateBuffersTest = function(config, buffers, rebind) {
+ es3fFboRenderTest.FboRenderCase.call(
+ this, config.getName() +
+ (rebind ? '' : '_no_rebind'),
+ 'Recreate buffers', config
+ );
+ this.m_buffers = buffers;
+ this.m_rebind = rebind;
+ };
+
+ es3fFboRenderTest.RecreateBuffersTest.prototype =
+ Object.create(es3fFboRenderTest.FboRenderCase.prototype);
+
+ es3fFboRenderTest.RecreateBuffersTest.prototype.construtor =
+ es3fFboRenderTest.RecreateBuffersTest;
+
+ /**
+ * @param {?sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext}
+ * ctx
+ * @param {tcuSurface.Surface} dst
+ */
+ es3fFboRenderTest.RecreateBuffersTest.prototype.render = function(
+ ctx, dst) {
+
+ /** @type {tcuTexture.TextureFormat} */
+ var colorFormat = gluTextureUtil.mapGLInternalFormat(
+ this.m_config.colorFormat
+ );
+ /** @type {gluShaderUtil.DataType} */
+ var fboSamplerType = gluTextureUtil.getSampler2DType(colorFormat);
+ /** @type {gluShaderUtil.DataType} */
+ var fboOutputType = es3fFboTestUtil.getFragmentOutputType(colorFormat);
+ /** @type {tcuTextureUtil.TextureFormatInfo} */
+ var fboRangeInfo = tcuTextureUtil.getTextureFormatInfo(colorFormat);
+ var fboOutScale = deMath.subtract(
+ fboRangeInfo.valueMax, fboRangeInfo.valueMin
+ );
+ var fboOutBias = fboRangeInfo.valueMin;
+
+ /** @type {es3fFboTestUtil.Texture2DShader} */
+ var texToFboShader = new es3fFboTestUtil.Texture2DShader(
+ [gluShaderUtil.DataType.SAMPLER_2D], fboOutputType
+ );
+ /** @type {es3fFboTestUtil.Texture2DShader} */
+ var texFromFboShader = new es3fFboTestUtil.Texture2DShader(
+ [fboSamplerType], gluShaderUtil.DataType.FLOAT_VEC4
+ );
+
+ /** @type {es3fFboTestUtil.FlatColorShader} */
+ var flatShader = new es3fFboTestUtil.FlatColorShader(fboOutputType);
+ /** @type {number} */
+ var texToFboShaderID = ctx.createProgram(texToFboShader);
+ /** @type {number} */
+ var texFromFboShaderID = ctx.createProgram(texFromFboShader);
+ /** @type {number} */
+ var flatShaderID = ctx.createProgram(flatShader);
+
+ var width = 128;
+ var height = 128;
+ var metaballsTex = ctx.createTexture();
+ var quadsTex = ctx.createTexture();
+ var stencil = deMath.binaryOp(
+ this.m_config.buffers, gl.STENCIL_BUFFER_BIT, deMath.BinaryOp.AND
+ ) != 0;
+
+ es3fFboRenderTest.createQuadsTex2D(
+ ctx, quadsTex, gl.RGB, gl.UNSIGNED_BYTE, 64, 64
+ );
+ es3fFboRenderTest.createMetaballsTex2D(
+ ctx, metaballsTex, gl.RGB, gl.UNSIGNED_BYTE, 64, 64
+ );
+
+ /** @type {es3fFboRenderTest.Framebuffer} */
+ var fbo = new es3fFboRenderTest.Framebuffer(
+ ctx, this.m_config, width, height
+ );
+ fbo.checkCompleteness();
+
+ // Setup shaders
+ texToFboShader.setOutScaleBias(fboOutScale, fboOutBias);
+ texFromFboShader.setTexScaleBias(
+ 0, fboRangeInfo.lookupScale, fboRangeInfo.lookupBias
+ );
+ texToFboShader.setUniforms(ctx, texToFboShaderID);
+ texFromFboShader.setUniforms(ctx, texFromFboShaderID);
+ flatShader.setColor(
+ ctx, flatShaderID, deMath.add(
+ deMath.multiply([0.0, 0.0, 1.0, 1.0], fboOutScale
+ ), fboOutBias)
+ );
+
+ // Draw scene
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo.getFramebuffer());
+ ctx.viewport(0, 0, width, height);
+ es3fFboTestUtil.clearColorBuffer(
+ ctx, colorFormat, [1.0, 0.0, 0.0, 1.0]
+ );
+ ctx.clear(gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+
+ ctx.enable(gl.DEPTH_TEST);
+
+ ctx.bindTexture(gl.TEXTURE_2D, quadsTex);
+ rrUtil.drawQuad(
+ ctx, texToFboShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]
+ );
+
+ ctx.disable(gl.DEPTH_TEST);
+
+ if (stencil) {
+ ctx.enable(gl.SCISSOR_TEST);
+ ctx.scissor(
+ Math.floor(width / 4), Math.floor(height / 4),
+ Math.floor(width / 2), Math.floor(height / 2)
+ );
+ ctx.clearStencil(1);
+ ctx.clear(gl.STENCIL_BUFFER_BIT);
+ ctx.disable(gl.SCISSOR_TEST);
+ }
+
+ // Recreate buffers
+ if (!this.m_rebind)
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, null);
+
+ assertMsgOptions(
+ deMath.binaryOp(
+ this.m_buffers, deMath.binaryOp(
+ gl.DEPTH_BUFFER_BIT,
+ gl.STENCIL_BUFFER_BIT,
+ deMath.BinaryOp.OR
+ ), deMath.BinaryOp.AND
+ ) == 0 || deMath.binaryOp(
+ this.m_buffers, deMath.binaryOp(
+ gl.DEPTH_BUFFER_BIT,
+ gl.STENCIL_BUFFER_BIT,
+ deMath.BinaryOp.OR
+ ), deMath.BinaryOp.AND
+ ) == deMath.binaryOp(
+ this.m_config.buffers, deMath.binaryOp(
+ gl.DEPTH_BUFFER_BIT,
+ gl.STENCIL_BUFFER_BIT,
+ deMath.BinaryOp.OR
+ ), deMath.BinaryOp.AND
+ ), 'Depth/stencil buffers are not disabled or not ' +
+ 'equal to the config\'s depth/stencil buffer state',
+ false, true
+ );
+
+ // Recreate.
+ for (var ndx = 0; ndx < 2; ndx++) {
+ var bit = ndx == 0 ? gl.COLOR_BUFFER_BIT :
+ (gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+ var type = ndx == 0 ? fbo.getConfig().colorType :
+ fbo.getConfig().depthStencilType;
+ var format = ndx == 0 ? fbo.getConfig().colorFormat :
+ fbo.getConfig().depthStencilFormat;
+ var buf = ndx == 0 ? fbo.getColorBuffer() :
+ fbo.getDepthStencilBuffer();
+
+ if (deMath.binaryOp(this.m_buffers, bit, deMath.BinaryOp.AND) == 0)
+ continue;
+
+ switch (type) {
+ case gl.TEXTURE_2D:
+ ctx.deleteTexture(/** @type {WebGLTexture} */ (buf));
+ buf = ctx.createTexture();
+ ctx.bindTexture(gl.TEXTURE_2D, buf);
+ ctx.texImage2DDelegate(
+ gl.TEXTURE_2D, 0, format, width, height
+ );
+ ctx.texParameteri(
+ gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST
+ );
+ ctx.texParameteri(
+ gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST
+ );
+ break;
+
+ case gl.RENDERBUFFER:
+ ctx.deleteRenderbuffer(
+ /** @type {WebGLRenderbuffer} */ (buf)
+ );
+ buf = ctx.createRenderbuffer();
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, buf);
+ ctx.renderbufferStorage(
+ gl.RENDERBUFFER, format, width, height
+ );
+ break;
+
+ default:
+ throw new Error('Unsupported buffer type');
+ }
+
+ if (ndx == 0) {
+ fbo.m_colorBuffer = buf;
+ } else {
+ fbo.m_depthStencilBuffer = buf;
+ }
+ }
+
+ // Rebind.
+ if (this.m_rebind) {
+ for (var ndx = 0; ndx < 3; ndx++) {
+ var bit = ndx == 0 ? gl.COLOR_BUFFER_BIT :
+ ndx == 1 ? gl.DEPTH_BUFFER_BIT :
+ ndx == 2 ? gl.STENCIL_BUFFER_BIT : 0;
+ var point = ndx == 0 ? gl.COLOR_ATTACHMENT0 :
+ ndx == 1 ? gl.DEPTH_ATTACHMENT :
+ ndx == 2 ? gl.STENCIL_ATTACHMENT : 0;
+ var type = ndx == 0 ? fbo.getConfig().colorType :
+ fbo.getConfig().depthStencilType;
+ var buf = ndx == 0 ? fbo.getColorBuffer() :
+ fbo.getDepthStencilBuffer();
+
+ if (deMath.binaryOp(
+ this.m_buffers, bit, deMath.BinaryOp.AND) == 0)
+ continue;
+
+ switch (type) {
+ case gl.TEXTURE_2D:
+ ctx.framebufferTexture2D(
+ gl.FRAMEBUFFER, point, gl.TEXTURE_2D, buf, 0
+ );
+ break;
+
+ case gl.RENDERBUFFER:
+ ctx.framebufferRenderbuffer(
+ gl.FRAMEBUFFER, point, gl.RENDERBUFFER, buf
+ );
+ break;
+
+ default:
+ throw new Error('Invalid buffer type');
+ }
+ }
+ }
+
+ if (!this.m_rebind)
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo.getFramebuffer());
+
+ ctx.clearStencil(0);
+
+ // \note Clear only buffers that were re-created
+ ctx.clear(
+ deMath.binaryOp(
+ this.m_buffers,
+ deMath.binaryOp(
+ gl.DEPTH_BUFFER_BIT,
+ gl.STENCIL_BUFFER_BIT,
+ deMath.BinaryOp.OR
+ ), deMath.BinaryOp.AND
+ )
+ );
+
+ if (deMath.binaryOp(
+ this.m_buffers, gl.COLOR_BUFFER_BIT, deMath.BinaryOp.AND)) {
+ // Clearing of integer buffers is undefined
+ // so do clearing by rendering flat color.
+ rrUtil.drawQuad(
+ ctx, flatShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]
+ );
+ }
+
+ ctx.enable(gl.DEPTH_TEST);
+
+ if (stencil) {
+ // \note Stencil test enabled only if we have stencil buffer
+ ctx.enable(gl.STENCIL_TEST);
+ ctx.stencilFunc(gl.EQUAL, 0, 0xff);
+ }
+ ctx.bindTexture(gl.TEXTURE_2D, metaballsTex);
+ rrUtil.drawQuad(
+ ctx, texToFboShaderID, [-1.0, -1.0, 1.0], [1.0, 1.0, -1.0]
+ );
+ if (stencil)
+ ctx.disable(gl.STENCIL_TEST);
+
+ ctx.disable(gl.DEPTH_TEST);
+
+ if (fbo.getConfig().colorType == gl.TEXTURE_2D) {
+ // Unbind fbo
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, null);
+
+ // Draw to screen
+ ctx.bindTexture(gl.TEXTURE_2D, fbo.getColorBuffer());
+ ctx.viewport(0, 0, ctx.getWidth(), ctx.getHeight());
+ rrUtil.drawQuad(
+ ctx, texFromFboShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]
+ );
+
+ // Read from screen
+ dst.readViewport(ctx, [0, 0, ctx.getWidth(), ctx.getHeight()]);
+ } else {
+ // Read from fbo
+ es3fFboTestUtil.readPixels(
+ ctx, dst, 0, 0, width, height, colorFormat,
+ fboRangeInfo.lookupScale, fboRangeInfo.lookupBias
+ );
+ }
+ };
+
+ // FboGroups
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fFboRenderTest.FboRenderTestGroup = function() {
+ tcuTestCase.DeqpTest.call(this, 'render', 'Rendering Tests');
+ };
+
+ es3fFboRenderTest.FboRenderTestGroup.prototype =
+ Object.create(tcuTestCase.DeqpTest.prototype);
+
+ es3fFboRenderTest.FboRenderTestGroup.prototype.constructor =
+ es3fFboRenderTest.FboRenderTestGroup;
+
+ /**
+ * @enum {number}
+ */
+ var FormatType = {
+ FLOAT: 0,
+ INT: 1,
+ UINT: 2
+ };
+
+ // Required by specification.
+ /**
+ * @typedef {{format: number, type: FormatType}}
+ */
+ var ColorFormatStruct;
+
+ /**
+ * @typedef {{format: number, depth: boolean, stencil: boolean}}
+ */
+ var DepthStencilFormatStruct;
+
+ /**
+ * init
+ */
+ es3fFboRenderTest.FboRenderTestGroup.prototype.init = function() {
+ var objectTypes = [
+ gl.TEXTURE_2D,
+ gl.RENDERBUFFER
+ ];
+
+ /** @type {Array<ColorFormatStruct>} */ var colorFormats = [{
+ format: gl.RGBA32F, type: FormatType.FLOAT
+ },{
+ format: gl.RGBA32I, type: FormatType.INT
+ },{
+ format: gl.RGBA32UI, type: FormatType.UINT
+ },{
+ format: gl.RGBA16F, type: FormatType.FLOAT
+ },{
+ format: gl.RGBA16I, type: FormatType.INT
+ },{
+ format: gl.RGBA16UI, type: FormatType.UINT
+ },/*{
+ // RGB16F isn't made color-renderable through WebGL's EXT_color_buffer_float
+ format: gl.RGB16F, type: FormatType.FLOAT
+ },*/{
+ format: gl.RGBA8I, type: FormatType.INT
+ },{
+ format: gl.RGBA8UI, type: FormatType.UINT
+ },{
+ format: gl.RGB10_A2UI, type: FormatType.UINT
+ },{
+ format: gl.R11F_G11F_B10F, type: FormatType.FLOAT
+ },{
+ format: gl.RG32F, type: FormatType.FLOAT
+ },{
+ format: gl.RG32I, type: FormatType.INT
+ },{
+ format: gl.RG32UI, type: FormatType.UINT
+ },{
+ format: gl.RG16F, type: FormatType.FLOAT
+ },{
+ format: gl.RG16I, type: FormatType.INT
+ },{
+ format: gl.RG16UI, type: FormatType.UINT
+ },{
+ format: gl.RG8, type: FormatType.FLOAT
+ },{
+ format: gl.RG8I, type: FormatType.INT
+ },{
+ format: gl.RG8UI, type: FormatType.UINT
+ },{
+ format: gl.R32F, type: FormatType.FLOAT
+ },{
+ format: gl.R32I, type: FormatType.INT
+ },{
+ format: gl.R32UI, type: FormatType.UINT
+ },{
+ format: gl.R16F, type: FormatType.FLOAT
+ },{
+ format: gl.R16I, type: FormatType.INT
+ },{
+ format: gl.R16UI, type: FormatType.UINT
+ },{
+ format: gl.R8, type: FormatType.FLOAT
+ },{
+ format: gl.R8I, type: FormatType.INT
+ },{
+ format: gl.R8UI, type: FormatType.UINT
+ }];
+
+ /** @type {Array<DepthStencilFormatStruct>} */
+ var depthStencilFormats = [{
+ format: gl.DEPTH_COMPONENT32F, depth: true, stencil: false
+ },{
+ format: gl.DEPTH_COMPONENT24, depth: true, stencil: false
+ },{
+ format: gl.DEPTH_COMPONENT16, depth: true, stencil: false
+ },{
+ format: gl.DEPTH32F_STENCIL8, depth: true, stencil: true
+ },{
+ format: gl.DEPTH24_STENCIL8, depth: true, stencil: true
+ },{
+ format: gl.STENCIL_INDEX8, depth: false, stencil: true
+ }];
+
+ /** @type {es3fFboRenderTest.FboConfig} */ var config;
+ var colorType;
+ var stencilType;
+ var colorFmt;
+ var depth;
+ var stencil;
+ var depthStencilType;
+ var depthStencilFormat;
+
+ // .stencil_clear
+ /** @type {tcuTestCase.DeqpTest} */
+ var stencilClearGroup = new tcuTestCase.DeqpTest(
+ 'stencil_clear', 'Stencil buffer clears'
+ );
+
+ this.addChild(stencilClearGroup);
+
+ for (var fmtNdx = 0; fmtNdx < depthStencilFormats.length; fmtNdx++) {
+ colorType = gl.TEXTURE_2D;
+ stencilType = gl.RENDERBUFFER;
+ colorFmt = gl.RGBA8;
+
+ if (!depthStencilFormats[fmtNdx].stencil)
+ continue;
+
+ config = new es3fFboRenderTest.FboConfig(
+ gl.COLOR_BUFFER_BIT | gl.STENCIL_BUFFER_BIT,
+ colorType, colorFmt, stencilType,
+ depthStencilFormats[fmtNdx].format
+ );
+ stencilClearGroup.addChild(
+ new es3fFboRenderTest.StencilClearsTest(config)
+ );
+ }
+
+ // .shared_colorbuffer_clear
+ /** @type {tcuTestCase.DeqpTest} */
+ var sharedColorbufferClearGroup = new tcuTestCase.DeqpTest(
+ 'shared_colorbuffer_clear', 'Shader colorbuffer clears'
+ );
+
+ this.addChild(sharedColorbufferClearGroup);
+
+ for (var colorFmtNdx = 0;
+ colorFmtNdx < colorFormats.length;
+ colorFmtNdx++) {
+
+ // Clearing of integer buffers is undefined.
+ if (colorFormats[colorFmtNdx].type == FormatType.INT ||
+ colorFormats[colorFmtNdx].type == FormatType.UINT)
+ continue;
+
+ for (var typeNdx = 0; typeNdx < objectTypes.length; typeNdx++) {
+ config = new es3fFboRenderTest.FboConfig(
+ gl.COLOR_BUFFER_BIT, objectTypes[typeNdx],
+ colorFormats[colorFmtNdx].format, gl.NONE, gl.NONE
+ );
+ sharedColorbufferClearGroup.addChild(
+ new es3fFboRenderTest.SharedColorbufferClearsTest(config)
+ );
+ }
+ }
+
+ // .shared_colorbuffer
+ /** @type {Array<tcuTestCase.DeqpTest>} */ var sharedColorbufferGroup = [];
+ var numSharedColorbufferGroups = 3;
+ for (var ii = 0; ii < numSharedColorbufferGroups; ++ii) {
+ sharedColorbufferGroup[ii] = new tcuTestCase.DeqpTest(
+ 'shared_colorbuffer', 'Shared colorbuffer tests'
+ );
+ this.addChild(sharedColorbufferGroup[ii]);
+ }
+
+ for (var colorFmtNdx = 0; colorFmtNdx < colorFormats.length; colorFmtNdx++) {
+
+ depthStencilType = gl.RENDERBUFFER;
+ depthStencilFormat = gl.DEPTH24_STENCIL8;
+
+ // Blending with integer buffers and fp32 targets is not supported.
+ if (colorFormats[colorFmtNdx].type == FormatType.INT ||
+ colorFormats[colorFmtNdx].type == FormatType.UINT ||
+ colorFormats[colorFmtNdx].format == gl.RGBA32F ||
+ colorFormats[colorFmtNdx].format == gl.RGB32F ||
+ colorFormats[colorFmtNdx].format == gl.RG32F ||
+ colorFormats[colorFmtNdx].format == gl.R32F)
+ continue;
+
+ for (var typeNdx = 0; typeNdx < objectTypes.length; typeNdx++) {
+ /** @type {es3fFboRenderTest.FboConfig} */
+ var colorOnlyConfig = new es3fFboRenderTest.FboConfig(
+ gl.COLOR_BUFFER_BIT, objectTypes[typeNdx],
+ colorFormats[colorFmtNdx].format, gl.NONE, gl.NONE
+ );
+ /** @type {es3fFboRenderTest.FboConfig} */
+ var colorDepthConfig = new es3fFboRenderTest.FboConfig(
+ gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT,
+ objectTypes[typeNdx], colorFormats[colorFmtNdx].format,
+ depthStencilType, depthStencilFormat
+ );
+ /** @type {es3fFboRenderTest.FboConfig} */
+ var colorDepthStencilConfig =
+ new es3fFboRenderTest.FboConfig(
+ gl.COLOR_BUFFER_BIT |
+ gl.DEPTH_BUFFER_BIT |
+ gl.STENCIL_BUFFER_BIT,
+ objectTypes[typeNdx], colorFormats[colorFmtNdx].format,
+ depthStencilType, depthStencilFormat
+ );
+
+ sharedColorbufferGroup[0].addChild(
+ new es3fFboRenderTest.SharedColorbufferTest(colorOnlyConfig)
+ );
+
+ sharedColorbufferGroup[1].addChild(
+ new es3fFboRenderTest.SharedColorbufferTest(
+ colorDepthConfig
+ )
+ );
+
+ sharedColorbufferGroup[2].addChild(
+ new es3fFboRenderTest.SharedColorbufferTest(
+ colorDepthStencilConfig
+ )
+ );
+ }
+ }
+
+ // .shared_depth_stencil
+ /** @type {tcuTestCase.DeqpTest} */
+ var sharedDepthStencilGroup = new tcuTestCase.DeqpTest(
+ 'shared_depth_stencil', 'Shared depth and stencil buffers'
+ );
+
+ this.addChild(sharedDepthStencilGroup);
+
+ for (var fmtNdx = 0; fmtNdx < depthStencilFormats.length; fmtNdx++) {
+ colorType = gl.TEXTURE_2D;
+ colorFmt = gl.RGBA8;
+ depth = depthStencilFormats[fmtNdx].depth;
+ stencil = depthStencilFormats[fmtNdx].stencil;
+
+ if (!depth)
+ continue; // Not verified.
+
+ // Depth and stencil: both rbo and textures
+ for (var typeNdx = 0; typeNdx < objectTypes.length; typeNdx++) {
+ config = new es3fFboRenderTest.FboConfig(
+ gl.COLOR_BUFFER_BIT |
+ (depth ? gl.DEPTH_BUFFER_BIT : 0) |
+ (stencil ? gl.STENCIL_BUFFER_BIT : 0),
+ colorType, colorFmt, objectTypes[typeNdx],
+ depthStencilFormats[fmtNdx].format
+ );
+
+ sharedDepthStencilGroup.addChild(
+ new es3fFboRenderTest.SharedDepthStencilTest(config)
+ );
+ }
+ }
+
+ // .resize
+ /** @type {Array<tcuTestCase.DeqpTest>} */ var resizeGroup = [];
+ var numResizeGroups = 4;
+ for (var ii = 0; ii < numResizeGroups; ++ii) {
+ resizeGroup[ii] = new tcuTestCase.DeqpTest('resize', 'FBO resize tests');
+ this.addChild(resizeGroup[ii]);
+ }
+
+ for (var colorFmtNdx = 0; colorFmtNdx < colorFormats.length; colorFmtNdx++) {
+
+ var colorFormat = colorFormats[colorFmtNdx].format;
+
+ // Color-only.
+ for (var typeNdx = 0; typeNdx < objectTypes.length; typeNdx++) {
+ config = new es3fFboRenderTest.FboConfig(
+ gl.COLOR_BUFFER_BIT, objectTypes[typeNdx],
+ colorFormat, gl.NONE, gl.NONE
+ );
+ resizeGroup[colorFmtNdx % numResizeGroups].addChild(new es3fFboRenderTest.ResizeTest(config));
+ }
+
+ // For selected color formats tests depth & stencil variants.
+ if (colorFormat == gl.RGBA8 || colorFormat == gl.RGBA16F) {
+ for (var depthStencilFmtNdx = 0; depthStencilFmtNdx < depthStencilFormats.length; depthStencilFmtNdx++) {
+
+ colorType = gl.TEXTURE_2D;
+ depth = depthStencilFormats[depthStencilFmtNdx].depth;
+ stencil = depthStencilFormats[depthStencilFmtNdx].stencil;
+
+ // Depth and stencil: both rbo and textures
+ for (var typeNdx = 0; typeNdx < objectTypes.length; typeNdx++) {
+
+ if (!depth && objectTypes[typeNdx] != gl.RENDERBUFFER)
+ continue; // Not supported.
+
+ config = new es3fFboRenderTest.FboConfig(
+ gl.COLOR_BUFFER_BIT |
+ (depth ? gl.DEPTH_BUFFER_BIT : 0) |
+ (stencil ? gl.STENCIL_BUFFER_BIT : 0),
+ colorType, colorFormat, objectTypes[typeNdx],
+ depthStencilFormats[depthStencilFmtNdx].format
+ );
+
+ resizeGroup[colorFmtNdx % numResizeGroups].addChild(
+ new es3fFboRenderTest.ResizeTest(config)
+ );
+ }
+ }
+ }
+ }
+
+ // .recreate_color
+ /** @type {Array<tcuTestCase.DeqpTest>} */ var recreateColorGroup = [];
+ var numRecreateColorGroups = 7;
+ for (var ii = 0; ii < numRecreateColorGroups; ++ii) {
+ recreateColorGroup[ii] = new tcuTestCase.DeqpTest('recreate_color', 'Recreate colorbuffer tests');
+ this.addChild(recreateColorGroup[ii]);
+ }
+
+ for (var colorFmtNdx = 0; colorFmtNdx < colorFormats.length; colorFmtNdx++) {
+
+ colorFormat = colorFormats[colorFmtNdx].format;
+ depthStencilFormat = gl.DEPTH24_STENCIL8;
+ depthStencilType = gl.RENDERBUFFER;
+
+ // Color-only.
+ for (var typeNdx = 0; typeNdx < objectTypes.length; typeNdx++) {
+ config = new es3fFboRenderTest.FboConfig(
+ gl.COLOR_BUFFER_BIT |
+ gl.DEPTH_BUFFER_BIT |
+ gl.STENCIL_BUFFER_BIT,
+ objectTypes[typeNdx], colorFormat,
+ depthStencilType, depthStencilFormat
+ );
+
+ recreateColorGroup[colorFmtNdx % numRecreateColorGroups].addChild(
+ new es3fFboRenderTest.RecreateBuffersTest(
+ config, gl.COLOR_BUFFER_BIT, true /* rebind */
+ )
+ );
+ }
+ }
+
+ // .recreate_depth_stencil
+ /** @type {tcuTestCase.DeqpTest} */
+ var recreateDepthStencilGroup = new tcuTestCase.DeqpTest(
+ 'recreate_depth_stencil', 'Recreate depth and stencil buffers'
+ );
+
+ this.addChild(recreateDepthStencilGroup);
+
+ for (var fmtNdx = 0; fmtNdx < depthStencilFormats.length; fmtNdx++) {
+ colorType = gl.TEXTURE_2D;
+ colorFmt = gl.RGBA8;
+ depth = depthStencilFormats[fmtNdx].depth;
+ stencil = depthStencilFormats[fmtNdx].stencil;
+
+ // Depth and stencil: both rbo and textures
+ for (var typeNdx = 0; typeNdx < objectTypes.length; typeNdx++) {
+ if (!depth && objectTypes[typeNdx] != gl.RENDERBUFFER)
+ continue;
+
+ config = new es3fFboRenderTest.FboConfig(
+ gl.COLOR_BUFFER_BIT |
+ (depth ? gl.DEPTH_BUFFER_BIT : 0) |
+ (stencil ? gl.STENCIL_BUFFER_BIT : 0),
+ colorType, colorFmt, objectTypes[typeNdx],
+ depthStencilFormats[fmtNdx].format
+ );
+
+ recreateDepthStencilGroup.addChild(
+ new es3fFboRenderTest.RecreateBuffersTest(
+ config,
+ (depth ? gl.DEPTH_BUFFER_BIT : 0) |
+ (stencil ? gl.STENCIL_BUFFER_BIT : 0),
+ true /* rebind */
+ )
+ );
+ }
+ }
+ };
+
+ /**
+ * Create and execute the test cases
+ * @param {WebGL2RenderingContext} context
+ */
+ es3fFboRenderTest.run = function(context, range) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+
+ state.setRoot(new es3fFboRenderTest.FboRenderTestGroup());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ if (range)
+ state.setRange(range);
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboStateQueryTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboStateQueryTests.js
new file mode 100644
index 0000000000..4795790ef4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboStateQueryTests.js
@@ -0,0 +1,796 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fFboStateQueryTests');
+goog.require('framework.common.tcuTestCase');
+goog.require('functional.gles3.es3fApiCase');
+goog.require('modules.shared.glsStateQuery');
+
+goog.scope(function() {
+var es3fFboStateQueryTests = functional.gles3.es3fFboStateQueryTests;
+var tcuTestCase = framework.common.tcuTestCase;
+var glsStateQuery = modules.shared.glsStateQuery;
+var es3fApiCase = functional.gles3.es3fApiCase;
+
+var setParentClass = function(child, parent) {
+ child.prototype = Object.create(parent.prototype);
+ child.prototype.constructor = child;
+};
+
+// WebGL bit depths
+es3fFboStateQueryTests.colorBits = [8, 8, 8, 8];
+es3fFboStateQueryTests.depthBits = 0;
+es3fFboStateQueryTests.stencilBits = 0;
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} framebufferTarget
+ */
+es3fFboStateQueryTests.DefaultFramebufferCase = function(name, description, framebufferTarget) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ this.m_framebufferTarget = framebufferTarget;
+};
+
+setParentClass(es3fFboStateQueryTests.DefaultFramebufferCase, es3fApiCase.ApiCase);
+
+es3fFboStateQueryTests.DefaultFramebufferCase.prototype.test = function() {
+ var hasColorBuffer = es3fFboStateQueryTests.colorBits[0] > 0 ||
+ es3fFboStateQueryTests.colorBits[1] > 0 ||
+ es3fFboStateQueryTests.colorBits[2] > 0 ||
+ es3fFboStateQueryTests.colorBits[3] > 0;
+ var attachments = [
+ gl.BACK,
+ gl.DEPTH,
+ gl.STENCIL
+ ];
+ var attachmentExists = [
+ hasColorBuffer,
+ es3fFboStateQueryTests.depthBits > 0,
+ es3fFboStateQueryTests.stencilBits > 0
+ ];
+
+ for (var ndx = 0; ndx < attachments.length; ++ndx) {
+ var objType = gl.getFramebufferAttachmentParameter(this.m_framebufferTarget, attachments[ndx], gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE);
+ if (attachmentExists[ndx]) {
+ this.check(objType === gl.FRAMEBUFFER_DEFAULT);
+ } else {
+ // \note [jarkko] FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE "identifes the type of object which contains the attached image". However, it
+ // is unclear if an object of type FRAMEBUFFER_DEFAULT can contain a null image (or a 0-bits-per-pixel image). Accept both
+ // FRAMEBUFFER_DEFAULT and NONE as valid results in these cases.
+ this.check(objType === gl.FRAMEBUFFER_DEFAULT || objType === gl.NONE);
+ }
+ }
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fFboStateQueryTests.AttachmentObjectCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fFboStateQueryTests.AttachmentObjectCase, es3fApiCase.ApiCase);
+
+es3fFboStateQueryTests.AttachmentObjectCase.prototype.test = function() {
+ var framebufferID = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, framebufferID);
+
+ // initial
+ this.check(glsStateQuery.verifyAttachment(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, gl.NONE));
+ this.check(glsStateQuery.verifyAttachment(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, null));
+
+ // texture
+ var textureID = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, textureID);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, 128, 128, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, textureID, 0);
+
+ this.check(glsStateQuery.verifyColorAttachment(gl.FRAMEBUFFER, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, gl.TEXTURE));
+ this.check(glsStateQuery.verifyColorAttachment(gl.FRAMEBUFFER, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, textureID));
+
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, null, 0);
+
+ // rb
+ var renderbufferID = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGB8, 128, 128);
+
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, renderbufferID);
+
+ this.check(glsStateQuery.verifyColorAttachment(gl.FRAMEBUFFER, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, gl.RENDERBUFFER));
+ this.check(glsStateQuery.verifyColorAttachment(gl.FRAMEBUFFER, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, renderbufferID));
+
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, null);
+ gl.deleteRenderbuffer(renderbufferID);
+
+ gl.deleteFramebuffer(framebufferID);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fFboStateQueryTests.AttachmentTextureLevelCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fFboStateQueryTests.AttachmentTextureLevelCase, es3fApiCase.ApiCase);
+
+es3fFboStateQueryTests.AttachmentTextureLevelCase.prototype.test = function() {
+ var framebufferID = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, framebufferID);
+ for (var mipmapLevel = 0; mipmapLevel < 7; ++mipmapLevel) {
+ var textureID = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, textureID);
+ gl.texStorage2D(gl.TEXTURE_2D, 7, gl.RGB8, 128, 128);
+
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, textureID, mipmapLevel);
+
+ this.check(glsStateQuery.verifyColorAttachment(gl.FRAMEBUFFER, gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, mipmapLevel));
+
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, null, 0);
+ gl.deleteTexture(textureID);
+ }
+ gl.deleteFramebuffer(framebufferID);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fFboStateQueryTests.AttachmentTextureCubeMapFaceCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fFboStateQueryTests.AttachmentTextureCubeMapFaceCase, es3fApiCase.ApiCase);
+
+es3fFboStateQueryTests.AttachmentTextureCubeMapFaceCase.prototype.test = function() {
+ var framebufferID = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, framebufferID);
+ var textureID = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, textureID);
+
+ gl.texStorage2D(gl.TEXTURE_CUBE_MAP, 1, gl.RGB8, 128, 128);
+
+ var faces = [
+ gl.TEXTURE_CUBE_MAP_POSITIVE_X, gl.TEXTURE_CUBE_MAP_NEGATIVE_X,
+ gl.TEXTURE_CUBE_MAP_POSITIVE_Y, gl.TEXTURE_CUBE_MAP_NEGATIVE_Y,
+ gl.TEXTURE_CUBE_MAP_POSITIVE_Z, gl.TEXTURE_CUBE_MAP_NEGATIVE_Z
+ ];
+
+ for (var ndx = 0; ndx < faces.length; ++ndx) {
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, faces[ndx], textureID, 0);
+ this.check(glsStateQuery.verifyColorAttachment(gl.FRAMEBUFFER, gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE, faces[ndx]));
+ }
+
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, null, 0);
+ gl.deleteTexture(textureID);
+ gl.deleteFramebuffer(framebufferID);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fFboStateQueryTests.AttachmentTextureLayerCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fFboStateQueryTests.AttachmentTextureLayerCase, es3fApiCase.ApiCase);
+
+es3fFboStateQueryTests.AttachmentTextureLayerCase.prototype.test = function() {
+ var framebufferID = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, framebufferID);
+ // tex3d
+ var textureID = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_3D, textureID);
+ gl.texStorage3D(gl.TEXTURE_3D, 1, gl.RGBA8, 16, 16, 16);
+
+ for (var layer = 0; layer < 16; ++layer) {
+ gl.framebufferTextureLayer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, textureID, 0, layer);
+ this.check(glsStateQuery.verifyColorAttachment(gl.FRAMEBUFFER, gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER, layer));
+ }
+
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, null, 0);
+ gl.deleteTexture(textureID);
+ // tex2d array
+ textureID = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D_ARRAY, textureID);
+ gl.texStorage3D(gl.TEXTURE_2D_ARRAY, 1, gl.RGBA8, 16, 16, 16);
+
+ for (var layer = 0; layer < 16; ++layer) {
+ gl.framebufferTextureLayer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, textureID, 0, layer);
+ this.check(glsStateQuery.verifyColorAttachment(gl.FRAMEBUFFER, gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER, layer));
+ }
+
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, null, 0);
+ gl.deleteTexture(textureID);
+ gl.deleteFramebuffer(framebufferID);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fFboStateQueryTests.AttachmentTextureColorCodingCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fFboStateQueryTests.AttachmentTextureColorCodingCase, es3fApiCase.ApiCase);
+
+es3fFboStateQueryTests.AttachmentTextureColorCodingCase.prototype.test = function() {
+ var framebufferID = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, framebufferID);
+ // rgb8 color
+ var renderbufferID = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGB8, 128, 128);
+
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, renderbufferID);
+
+ this.check(glsStateQuery.verifyColorAttachment(gl.FRAMEBUFFER, gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, gl.LINEAR));
+
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, null);
+ gl.deleteRenderbuffer(renderbufferID);
+
+ // srgb8_alpha8 color
+ renderbufferID = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.SRGB8_ALPHA8, 128, 128);
+
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, renderbufferID);
+
+ this.check(glsStateQuery.verifyColorAttachment(gl.FRAMEBUFFER, gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, gl.SRGB));
+
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, null);
+ gl.deleteRenderbuffer(renderbufferID);
+
+ // depth
+ renderbufferID = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, 128, 128);
+
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, renderbufferID);
+
+ this.check(glsStateQuery.verifyAttachment(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, gl.LINEAR));
+
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, null);
+ gl.deleteRenderbuffer(renderbufferID);
+ gl.deleteFramebuffer(framebufferID);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fFboStateQueryTests.AttachmentTextureComponentTypeCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fFboStateQueryTests.AttachmentTextureComponentTypeCase, es3fApiCase.ApiCase);
+
+es3fFboStateQueryTests.AttachmentTextureComponentTypeCase.prototype.test = function() {
+ var framebufferID = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, framebufferID);
+ // color-renderable required texture formats
+ var requiredColorformats = [
+ [gl.R8, gl.UNSIGNED_NORMALIZED],
+ [gl.RG8, gl.UNSIGNED_NORMALIZED],
+ [gl.RGB8, gl.UNSIGNED_NORMALIZED],
+ [gl.RGB565, gl.UNSIGNED_NORMALIZED],
+ [gl.RGBA4, gl.UNSIGNED_NORMALIZED],
+ [gl.RGB5_A1, gl.UNSIGNED_NORMALIZED],
+ [gl.RGBA8, gl.UNSIGNED_NORMALIZED],
+ [gl.RGB10_A2, gl.UNSIGNED_NORMALIZED],
+ [gl.RGB10_A2UI, gl.UNSIGNED_INT],
+ [gl.SRGB8_ALPHA8, gl.UNSIGNED_NORMALIZED],
+ [gl.R8I, gl.INT],
+ [gl.R8UI, gl.UNSIGNED_INT],
+ [gl.R16I, gl.INT],
+ [gl.R16UI, gl.UNSIGNED_INT],
+ [gl.R32I, gl.INT],
+ [gl.R32UI, gl.UNSIGNED_INT],
+ [gl.RG8I, gl.INT],
+ [gl.RG8UI, gl.UNSIGNED_INT],
+ [gl.RG16I, gl.INT],
+ [gl.RG16UI, gl.UNSIGNED_INT],
+ [gl.RG32I, gl.INT],
+ [gl.RG32UI, gl.UNSIGNED_INT],
+ [gl.RGBA8I, gl.INT],
+ [gl.RGBA8UI, gl.UNSIGNED_INT],
+ [gl.RGBA16I, gl.INT],
+ [gl.RGBA16UI, gl.UNSIGNED_INT],
+ [gl.RGBA32I, gl.INT],
+ [gl.RGBA32UI, gl.UNSIGNED_INT]
+ ];
+
+ for (var ndx = 0; ndx < requiredColorformats.length; ++ndx) {
+ var colorFormat = requiredColorformats[ndx][0];
+ var componentType = requiredColorformats[ndx][1];
+
+ var textureID = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, textureID);
+ gl.texStorage2D(gl.TEXTURE_2D, 1, colorFormat, 128, 128);
+
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, textureID, 0);
+
+ this.check(glsStateQuery.verifyColorAttachment(gl.FRAMEBUFFER, gl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE, componentType));
+
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, null, 0);
+ gl.deleteTexture(textureID);
+ }
+ gl.deleteFramebuffer(framebufferID);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fFboStateQueryTests.AttachmentSizeInitialCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fFboStateQueryTests.AttachmentSizeInitialCase, es3fApiCase.ApiCase);
+
+es3fFboStateQueryTests.AttachmentSizeInitialCase.prototype.attachmentExists = function(attachment) {
+ var objType = gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, attachment, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE);
+ return objType !== gl.NONE;
+};
+
+/**
+ * @this {es3fApiCase.ApiCase}
+ */
+var checkAttachmentComponentSizeAtLeast = function(target, attachment, r, g, b, a, d, s) {
+ var referenceSizes = [r, g, b, a, d, s];
+ var paramNames = [
+ gl.FRAMEBUFFER_ATTACHMENT_RED_SIZE, gl.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE,
+ gl.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE, gl.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE,
+ gl.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE, gl.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE
+ ];
+
+ for (var ndx = 0; ndx < referenceSizes.length; ++ndx) {
+ if (referenceSizes[ndx] == -1)
+ continue;
+
+ var value = /** @type {number} */ (gl.getFramebufferAttachmentParameter(target, attachment, paramNames[ndx]));
+
+ this.check(value >= referenceSizes[ndx], 'Expected greater or equal to ' + referenceSizes[ndx] + ' got ' + value);
+ }
+};
+
+/**
+ * @this {es3fApiCase.ApiCase}
+ */
+var checkAttachmentComponentSizeExactly = function(target, attachment, r, g, b, a, d, s) {
+ var referenceSizes = [r, g, b, a, d, s];
+ var paramNames = [
+ gl.FRAMEBUFFER_ATTACHMENT_RED_SIZE, gl.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE,
+ gl.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE, gl.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE,
+ gl.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE, gl.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE
+ ];
+
+ for (var ndx = 0; ndx < referenceSizes.length; ++ndx) {
+ if (referenceSizes[ndx] == -1)
+ continue;
+
+ var value = gl.getFramebufferAttachmentParameter(target, attachment, paramNames[ndx]);
+
+ this.check(value == referenceSizes[ndx], 'Expected equal to ' + referenceSizes[ndx] + ' got ' + value);
+ }
+};
+
+es3fFboStateQueryTests.AttachmentSizeInitialCase.prototype.test = function() {
+ // check default
+ if (this.attachmentExists(gl.BACK)) {
+ checkAttachmentComponentSizeAtLeast.bind(this,
+ gl.FRAMEBUFFER,
+ gl.BACK,
+ es3fFboStateQueryTests.colorBits[0],
+ es3fFboStateQueryTests.colorBits[1],
+ es3fFboStateQueryTests.colorBits[2],
+ es3fFboStateQueryTests.colorBits[3],
+ -1,
+ -1);
+ }
+
+ if (this.attachmentExists(gl.DEPTH)) {
+ checkAttachmentComponentSizeAtLeast.bind(this,
+ gl.FRAMEBUFFER,
+ gl.DEPTH,
+ -1,
+ -1,
+ -1,
+ -1,
+ es3fFboStateQueryTests.depthBits,
+ -1);
+ }
+
+ if (this.attachmentExists(gl.STENCIL)) {
+ checkAttachmentComponentSizeAtLeast.bind(this,
+ gl.FRAMEBUFFER,
+ gl.STENCIL,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ es3fFboStateQueryTests.stencilBits);
+ }
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fFboStateQueryTests.AttachmentSizeCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fFboStateQueryTests.AttachmentSizeCase, es3fApiCase.ApiCase);
+
+es3fFboStateQueryTests.AttachmentSizeCase.prototype.test = function() {
+ var framebufferID = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, framebufferID);
+ // check some color targets
+
+ var colorAttachments = [
+ //format, red, green, blue, alpha
+ [gl.RGBA8, 8, 8, 8, 8],
+ [gl.RGB565, 5, 6, 5, 0],
+ [gl.RGBA4, 4, 4, 4, 4],
+ [gl.RGB5_A1, 5, 5, 5, 1],
+ [gl.RGBA8I, 8, 8, 8, 8],
+ [gl.RG32UI, 32, 32, 0, 0]
+ ];
+ for (var ndx = 0; ndx < colorAttachments.length; ++ndx)
+ this.testColorAttachment(colorAttachments[ndx][0], gl.COLOR_ATTACHMENT0, colorAttachments[ndx][1], colorAttachments[ndx][2], colorAttachments[ndx][3], colorAttachments[ndx][4]);
+
+ // check some depth targets
+
+ var depthAttachments = [
+ // format, attachment, depth, stencil
+ [gl.DEPTH_COMPONENT16, gl.DEPTH_ATTACHMENT, 16, 0],
+ [gl.DEPTH_COMPONENT24, gl.DEPTH_ATTACHMENT, 24, 0],
+ [gl.DEPTH_COMPONENT32F, gl.DEPTH_ATTACHMENT, 32, 0],
+ [gl.DEPTH24_STENCIL8, gl.DEPTH_STENCIL_ATTACHMENT, 24, 8],
+ [gl.DEPTH32F_STENCIL8, gl.DEPTH_STENCIL_ATTACHMENT, 32, 8]
+ ];
+ for (var ndx = 0; ndx < depthAttachments.length; ++ndx)
+ this.testDepthAttachment(depthAttachments[ndx][0], depthAttachments[ndx][1], depthAttachments[ndx][2], depthAttachments[ndx][3]);
+ gl.deleteFramebuffer(framebufferID);
+};
+
+/**
+ * @constructor
+ * @extends {es3fFboStateQueryTests.AttachmentSizeCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fFboStateQueryTests.AttachmentSizeRboCase = function(name, description) {
+ es3fFboStateQueryTests.AttachmentSizeCase.call(this, name, description);
+};
+
+setParentClass(es3fFboStateQueryTests.AttachmentSizeRboCase, es3fFboStateQueryTests.AttachmentSizeCase);
+
+es3fFboStateQueryTests.AttachmentSizeRboCase.prototype.testColorAttachment = function(internalFormat, attachment, r, g, b, a) {
+ var renderbufferID = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID);
+ gl.renderbufferStorage(gl.RENDERBUFFER, internalFormat, 128, 128);
+
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment, gl.RENDERBUFFER, renderbufferID);
+
+ checkAttachmentComponentSizeAtLeast.bind(this, gl.FRAMEBUFFER, attachment, r, g, b, a, -1, -1);
+ checkAttachmentComponentSizeExactly.bind(this, gl.FRAMEBUFFER, attachment, -1, -1, -1, -1, 0, 0);
+
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment, gl.RENDERBUFFER, null);
+ gl.deleteRenderbuffer(renderbufferID);
+};
+
+es3fFboStateQueryTests.AttachmentSizeRboCase.prototype.testDepthAttachment = function(internalFormat, attachment, depth, stencil) {
+ var renderbufferID = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID);
+ gl.renderbufferStorage(gl.RENDERBUFFER, internalFormat, 128, 128);
+
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment, gl.RENDERBUFFER, renderbufferID);
+
+ checkAttachmentComponentSizeAtLeast.bind(this, gl.FRAMEBUFFER, attachment, -1, -1, -1, -1, depth, stencil);
+ checkAttachmentComponentSizeExactly.bind(this, gl.FRAMEBUFFER, attachment, 0, 0, 0, 0, -1, -1);
+
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment, gl.RENDERBUFFER, null);
+ gl.deleteRenderbuffer(renderbufferID);
+};
+
+/**
+ * @constructor
+ * @extends {es3fFboStateQueryTests.AttachmentSizeCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fFboStateQueryTests.AttachmentSizeTextureCase = function(name, description) {
+ es3fFboStateQueryTests.AttachmentSizeCase.call(this, name, description);
+};
+
+setParentClass(es3fFboStateQueryTests.AttachmentSizeTextureCase, es3fFboStateQueryTests.AttachmentSizeCase);
+
+es3fFboStateQueryTests.AttachmentSizeTextureCase.prototype.testColorAttachment = function(internalFormat, attachment, r, g, b, a) {
+ var textureID = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, textureID);
+ gl.texStorage2D(gl.TEXTURE_2D, 1, internalFormat, 128, 128);
+
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, attachment, gl.TEXTURE_2D, textureID, 0);
+
+ checkAttachmentComponentSizeAtLeast.bind(this, gl.FRAMEBUFFER, attachment, r, g, b, a, -1, -1);
+ checkAttachmentComponentSizeExactly.bind(this, gl.FRAMEBUFFER, attachment, -1, -1, -1, -1, 0, 0);
+
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, attachment, gl.TEXTURE_2D, null, 0);
+ gl.deleteTexture(textureID);
+};
+
+es3fFboStateQueryTests.AttachmentSizeTextureCase.prototype.testDepthAttachment = function(internalFormat, attachment, depth, stencil) {
+ // don't test stencil formats with textures
+ if (attachment == gl.DEPTH_STENCIL_ATTACHMENT)
+ return;
+
+ var textureID = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, textureID);
+ gl.texStorage2D(gl.TEXTURE_2D, 1, internalFormat, 128, 128);
+
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, attachment, gl.TEXTURE_2D, textureID, 0);
+
+ checkAttachmentComponentSizeAtLeast.bind(this, gl.FRAMEBUFFER, attachment, -1, -1, -1, -1, depth, stencil);
+ checkAttachmentComponentSizeExactly.bind(this, gl.FRAMEBUFFER, attachment, 0, 0, 0, 0, -1, -1);
+
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, attachment, gl.TEXTURE_2D, null, 0);
+ gl.deleteTexture(textureID);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fFboStateQueryTests.UnspecifiedAttachmentTextureColorCodingCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fFboStateQueryTests.UnspecifiedAttachmentTextureColorCodingCase, es3fApiCase.ApiCase);
+
+es3fFboStateQueryTests.UnspecifiedAttachmentTextureColorCodingCase.prototype.test = function() {
+ var framebufferID = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, framebufferID);
+ // color
+ var renderbufferID = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID);
+
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, renderbufferID);
+
+ this.check(glsStateQuery.verifyColorAttachment(gl.FRAMEBUFFER, gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, gl.LINEAR));
+
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, null);
+ gl.deleteRenderbuffer(renderbufferID);
+
+ // depth
+ renderbufferID = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID);
+
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, renderbufferID);
+
+ this.check(glsStateQuery.verifyAttachment(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, gl.LINEAR));
+
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, null);
+ gl.deleteRenderbuffer(renderbufferID);
+ gl.deleteFramebuffer(framebufferID);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fFboStateQueryTests.UnspecifiedAttachmentSizeCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fFboStateQueryTests.UnspecifiedAttachmentSizeCase, es3fApiCase.ApiCase);
+
+es3fFboStateQueryTests.UnspecifiedAttachmentSizeCase.prototype.test = function() {
+ var framebufferID = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, framebufferID);
+ // check color target
+ this.testColorAttachment();
+
+ // check depth target
+ this.testDepthAttachment();
+ gl.deleteFramebuffer(framebufferID);
+};
+
+/**
+ * @constructor
+ * @extends {es3fFboStateQueryTests.UnspecifiedAttachmentSizeCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fFboStateQueryTests.UnspecifiedAttachmentSizeRboCase = function(name, description) {
+ es3fFboStateQueryTests.UnspecifiedAttachmentSizeCase.call(this, name, description);
+};
+
+setParentClass(es3fFboStateQueryTests.UnspecifiedAttachmentSizeRboCase, es3fFboStateQueryTests.UnspecifiedAttachmentSizeCase);
+
+es3fFboStateQueryTests.UnspecifiedAttachmentSizeRboCase.prototype.testColorAttachment = function() {
+ var renderbufferID = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID);
+
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, renderbufferID);
+
+ checkAttachmentComponentSizeExactly.bind(this, gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, 0, 0, 0, 0, 0, 0);
+
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, null);
+ gl.deleteRenderbuffer(renderbufferID);
+};
+
+es3fFboStateQueryTests.UnspecifiedAttachmentSizeRboCase.prototype.testDepthAttachment = function() {
+ var renderbufferID = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID);
+
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, renderbufferID);
+
+ checkAttachmentComponentSizeExactly.bind(this, gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, 0, 0, 0, 0, 0, 0);
+
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, null);
+ gl.deleteRenderbuffer(renderbufferID);
+};
+
+/**
+ * @constructor
+ * @extends {es3fFboStateQueryTests.UnspecifiedAttachmentSizeCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fFboStateQueryTests.UnspecifiedAttachmentSizeTextureCase = function(name, description) {
+ es3fFboStateQueryTests.UnspecifiedAttachmentSizeCase.call(this, name, description);
+};
+
+setParentClass(es3fFboStateQueryTests.UnspecifiedAttachmentSizeTextureCase, es3fFboStateQueryTests.UnspecifiedAttachmentSizeCase);
+
+es3fFboStateQueryTests.UnspecifiedAttachmentSizeTextureCase.prototype.testColorAttachment = function() {
+ var textureID = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, textureID);
+
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, textureID, 0);
+
+ checkAttachmentComponentSizeExactly.bind(this, gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, 0, 0, 0, 0, 0, 0);
+
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, null, 0);
+ gl.deleteTexture(textureID);
+};
+
+es3fFboStateQueryTests.UnspecifiedAttachmentSizeTextureCase.prototype.testDepthAttachment = function() {
+ var textureID = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, textureID);
+
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, textureID, 0);
+
+ checkAttachmentComponentSizeExactly.bind(this, gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, 0, 0, 0, 0, 0, 0);
+
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, null, 0);
+ gl.deleteTexture(textureID);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fFboStateQueryTests.UnspecifiedAttachmentTextureComponentTypeCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fFboStateQueryTests.UnspecifiedAttachmentTextureComponentTypeCase, es3fApiCase.ApiCase);
+
+es3fFboStateQueryTests.UnspecifiedAttachmentTextureComponentTypeCase.prototype.test = function() {
+};
+
+/**
+* @constructor
+* @extends {tcuTestCase.DeqpTest}
+*/
+es3fFboStateQueryTests.FboStateQueryTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'fbo', 'Fbo State Query tests');
+};
+
+es3fFboStateQueryTests.FboStateQueryTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+es3fFboStateQueryTests.FboStateQueryTests.prototype.constructor = es3fFboStateQueryTests.FboStateQueryTests;
+
+es3fFboStateQueryTests.FboStateQueryTests.prototype.init = function() {
+ var red = /** @type {number} */ (gl.getParameter(gl.RED_BITS));
+ var green = /** @type {number} */ (gl.getParameter(gl.GREEN_BITS));
+ var blue = /** @type {number} */ (gl.getParameter(gl.BLUE_BITS));
+ var alpha = /** @type {number} */ (gl.getParameter(gl.ALPHA_BITS));
+ es3fFboStateQueryTests.colorBits = [red, green, blue, alpha];
+ es3fFboStateQueryTests.depthBits = /** @type {number} */ (gl.getParameter(gl.DEPTH_BITS));
+ es3fFboStateQueryTests.stencilBits = /** @type {number} */ (gl.getParameter(gl.STENCIL_BITS));
+
+ this.addChild(new es3fFboStateQueryTests.DefaultFramebufferCase('draw_framebuffer_default_framebuffer', 'default framebuffer', gl.DRAW_FRAMEBUFFER));
+ this.addChild(new es3fFboStateQueryTests.DefaultFramebufferCase('read_framebuffer_default_framebuffer', 'default framebuffer', gl.READ_FRAMEBUFFER));
+ this.addChild(new es3fFboStateQueryTests.AttachmentObjectCase('framebuffer_attachment_object', 'FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE and FRAMEBUFFER_ATTACHMENT_OBJECT_NAME'));
+ this.addChild(new es3fFboStateQueryTests.AttachmentTextureLevelCase('framebuffer_attachment_texture_level', 'FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL'));
+ this.addChild(new es3fFboStateQueryTests.AttachmentTextureCubeMapFaceCase('framebuffer_attachment_texture_cube_map_face', 'FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE'));
+ this.addChild(new es3fFboStateQueryTests.AttachmentTextureLayerCase('framebuffer_attachment_texture_layer', 'FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER'));
+ this.addChild(new es3fFboStateQueryTests.AttachmentTextureColorCodingCase('framebuffer_attachment_color_encoding', 'FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING'));
+ this.addChild(new es3fFboStateQueryTests.AttachmentTextureComponentTypeCase('framebuffer_attachment_component_type', 'FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE'));
+ this.addChild(new es3fFboStateQueryTests.AttachmentSizeInitialCase('framebuffer_attachment_x_size_initial', 'FRAMEBUFFER_ATTACHMENT_x_SIZE'));
+ this.addChild(new es3fFboStateQueryTests.AttachmentSizeRboCase('framebuffer_attachment_x_size_rbo', 'FRAMEBUFFER_ATTACHMENT_x_SIZE'));
+ this.addChild(new es3fFboStateQueryTests.AttachmentSizeTextureCase('framebuffer_attachment_x_size_texture', 'FRAMEBUFFER_ATTACHMENT_x_SIZE'));
+ this.addChild(new es3fFboStateQueryTests.UnspecifiedAttachmentTextureColorCodingCase('framebuffer_unspecified_attachment_color_encoding', 'FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING'));
+ this.addChild(new es3fFboStateQueryTests.UnspecifiedAttachmentTextureComponentTypeCase('framebuffer_unspecified_attachment_component_type', 'FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE'));
+ this.addChild(new es3fFboStateQueryTests.UnspecifiedAttachmentSizeRboCase('framebuffer_unspecified_attachment_x_size_rbo', 'FRAMEBUFFER_ATTACHMENT_x_SIZE'));
+ this.addChild(new es3fFboStateQueryTests.UnspecifiedAttachmentSizeTextureCase('framebuffer_unspecified_attachment_x_size_texture', 'FRAMEBUFFER_ATTACHMENT_x_SIZE'));
+};
+
+/**
+* Run test
+* @param {WebGL2RenderingContext} context
+*/
+es3fFboStateQueryTests.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fFboStateQueryTests.FboStateQueryTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fFboStateQueryTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboStencilbufferTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboStencilbufferTests.js
new file mode 100644
index 0000000000..4cebe7e4a9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboStencilbufferTests.js
@@ -0,0 +1,325 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+'use strict';
+goog.provide('functional.gles3.es3fFboStencilbufferTests');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluTextureUtil');
+goog.require('framework.referencerenderer.rrUtil');
+goog.require('functional.gles3.es3fFboTestCase');
+goog.require('functional.gles3.es3fFboTestUtil');
+
+goog.scope(function() {
+
+ var es3fFboStencilbufferTests = functional.gles3.es3fFboStencilbufferTests;
+ var es3fFboTestCase = functional.gles3.es3fFboTestCase;
+ var es3fFboTestUtil = functional.gles3.es3fFboTestUtil;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var tcuSurface = framework.common.tcuSurface;
+ var tcuTexture = framework.common.tcuTexture;
+ var rrUtil = framework.referencerenderer.rrUtil;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var gluTextureUtil = framework.opengl.gluTextureUtil;
+
+ /** @type {WebGL2RenderingContext} */ var gl;
+
+ var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fFboTestCase.FboTestCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} format
+ * @param {Array<number>} size
+ * @param {boolean} useDepth
+ */
+ es3fFboStencilbufferTests.BasicFboStencilCase = function(name, desc, format, size, useDepth) {
+ es3fFboTestCase.FboTestCase.call(this, name, desc);
+ /** @type {number} */ this.m_format = format;
+ /** @type {Array<number>} */ this.m_size = size;
+ /** @type {boolean} */ this.m_useDepth = useDepth;
+ };
+
+ es3fFboStencilbufferTests.BasicFboStencilCase.prototype = Object.create(es3fFboTestCase.FboTestCase.prototype);
+ es3fFboStencilbufferTests.BasicFboStencilCase.prototype.constructor = es3fFboStencilbufferTests.BasicFboStencilCase;
+
+ es3fFboStencilbufferTests.BasicFboStencilCase.prototype.preCheck = function() {
+ this.checkFormatSupport(this.m_format);
+ return true; // No exception thrown
+ };
+
+ /**
+ * @param {tcuSurface.Surface} dst
+ */
+ es3fFboStencilbufferTests.BasicFboStencilCase.prototype.render = function(dst) {
+ var ctx = this.getCurrentContext();
+ /** @const {number} */ var colorFormat = gl.RGBA8;
+
+ /** @type {es3fFboTestUtil.GradientShader} */ var gradShader = new es3fFboTestUtil.GradientShader(gluShaderUtil.DataType.FLOAT_VEC4);
+ /** @type {es3fFboTestUtil.FlatColorShader} */ var flatShader = new es3fFboTestUtil.FlatColorShader(gluShaderUtil.DataType.FLOAT_VEC4);
+ var flatShaderID = this.getCurrentContext().createProgram(flatShader);
+ var gradShaderID = this.getCurrentContext().createProgram(gradShader);
+
+ var fbo = 0;
+ var colorRbo = 0;
+ var depthStencilRbo = 0;
+
+ // Colorbuffer.
+ colorRbo = ctx.createRenderbuffer();
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, colorRbo);
+ ctx.renderbufferStorage(gl.RENDERBUFFER, colorFormat, this.m_size[0], this.m_size[1]);
+
+ // Stencil (and depth) buffer.
+ depthStencilRbo = ctx.createRenderbuffer();
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, depthStencilRbo);
+ ctx.renderbufferStorage(gl.RENDERBUFFER, this.m_format, this.m_size[0], this.m_size[1]);
+
+ // Framebuffer.
+ fbo = ctx.createFramebuffer();
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorRbo);
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, depthStencilRbo);
+ if (this.m_useDepth)
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthStencilRbo);
+ this.checkError();
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ ctx.viewport(0, 0, this.m_size[0], this.m_size[1]);
+
+ // Clear framebuffer.
+ ctx.clearBufferfv(gl.COLOR, 0, [0.0, 0.0, 0.0, 0.0]);
+ ctx.clearBufferfi(gl.DEPTH_STENCIL, 0, 1.0, 0);
+
+ // Render intersecting quads - increment stencil on depth pass
+ ctx.enable(gl.DEPTH_TEST);
+ ctx.enable(gl.STENCIL_TEST);
+ ctx.stencilFunc(gl.ALWAYS, 0, 0xff);
+ ctx.stencilOp(gl.KEEP, gl.KEEP, gl.INCR);
+
+ flatShader.setColor(this.getCurrentContext(), flatShaderID, [1.0, 0.0, 0.0, 1.0]);
+
+ rrUtil.drawQuad(this.getCurrentContext(), flatShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]);
+
+ gradShader.setGradient(this.getCurrentContext(), gradShaderID, [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]);
+
+ rrUtil.drawQuad(this.getCurrentContext(), gradShaderID, [-1.0, -1.0, -1.0], [1.0, 1.0, 1.0]);
+
+ ctx.disable(gl.DEPTH_TEST);
+
+ // Draw quad with stencil test (stencil == 1 or 2 depending on depth) - decrement on stencil failure
+ ctx.stencilFunc(gl.EQUAL, this.m_useDepth ? 2 : 1, 0xff);
+ ctx.stencilOp(gl.DECR, gl.KEEP, gl.KEEP);
+
+ flatShader.setColor(this.getCurrentContext(), flatShaderID, [0.0, 1.0, 0.0, 1.0]);
+
+ rrUtil.drawQuad(this.getCurrentContext(), flatShaderID, [-0.5, -0.5, 0.0], [0.5, 0.5, 0.0]);
+
+ // Draw quad with stencil test where stencil > 1 or 2 depending on depth buffer
+ ctx.stencilFunc(gl.GREATER, this.m_useDepth ? 1 : 2, 0xff);
+
+ flatShader.setColor(this.getCurrentContext(), flatShaderID, [0.0, 0.0, 1.0, 1.0]);
+
+ rrUtil.drawQuad(this.getCurrentContext(), flatShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]);
+
+ this.readPixelsUsingFormat(dst, 0, 0, this.m_size[0], this.m_size[1], gluTextureUtil.mapGLInternalFormat(colorFormat), [1.0, 1.0, 1.0, 1.0], [0.0, 0.0, 0.0, 0.0]);
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fFboTestCase.FboTestCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} attachDepth
+ */
+ es3fFboStencilbufferTests.DepthStencilAttachCase = function(name, desc, attachDepth, attachStencil) {
+ es3fFboTestCase.FboTestCase.call(this, name, desc);
+ /** @type {number} */ this.m_attachDepth = attachDepth;
+ /** @type {number} */ this.m_attachStencil = attachStencil;
+ DE_ASSERT(this.m_attachDepth == gl.DEPTH_ATTACHMENT || this.m_attachDepth == gl.DEPTH_STENCIL_ATTACHMENT || this.m_attachDepth == gl.NONE);
+ DE_ASSERT(this.m_attachStencil == gl.STENCIL_ATTACHMENT || this.m_attachStencil == gl.NONE);
+ DE_ASSERT(this.m_attachDepth != gl.DEPTH_STENCIL || this.m_attachStencil == gl.NONE);
+ };
+
+ es3fFboStencilbufferTests.DepthStencilAttachCase.prototype = Object.create(es3fFboTestCase.FboTestCase.prototype);
+ es3fFboStencilbufferTests.DepthStencilAttachCase.prototype.constructor = es3fFboStencilbufferTests.DepthStencilAttachCase;
+
+ /**
+ * @param {tcuSurface.Surface} dst
+ */
+ es3fFboStencilbufferTests.DepthStencilAttachCase.prototype.render = function(dst) {
+
+ var ctx = this.getCurrentContext();
+ /** @const {number} */ var colorFormat = gl.RGBA8;
+ /** @const {number} */ var depthStencilFormat = gl.DEPTH24_STENCIL8;
+ /** @const {number} */ var width = 128;
+ /** @const {number} */ var height = 128;
+ /** @const {boolean} */ var hasDepth = this.m_attachDepth == gl.DEPTH_STENCIL || this.m_attachDepth == gl.DEPTH_ATTACHMENT;
+ // /** @const {boolean} */ var hasStencil = this.m_attachDepth == gl.DEPTH_STENCIL || this.m_attachStencil == gl.DEPTH_STENCIL_ATTACHMENT); // commented out in original code
+
+ /** @type {es3fFboTestUtil.GradientShader} */ var gradShader = new es3fFboTestUtil.GradientShader(gluShaderUtil.DataType.FLOAT_VEC4);
+ /** @type {es3fFboTestUtil.FlatColorShader} */ var flatShader = new es3fFboTestUtil.FlatColorShader(gluShaderUtil.DataType.FLOAT_VEC4);
+ var flatShaderID = this.getCurrentContext().createProgram(flatShader);
+ var gradShaderID = this.getCurrentContext().createProgram(gradShader);
+
+ var fbo = 0;
+ var colorRbo = 0;
+ var depthStencilRbo = 0;
+
+ // Colorbuffer.
+ colorRbo = ctx.createRenderbuffer();
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, colorRbo);
+ ctx.renderbufferStorage(gl.RENDERBUFFER, colorFormat, width, height);
+
+ // Depth-stencil buffer.
+ depthStencilRbo = ctx.createRenderbuffer();
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, depthStencilRbo);
+ ctx.renderbufferStorage(gl.RENDERBUFFER, depthStencilFormat, width, height);
+
+ // Framebuffer.
+ fbo = ctx.createFramebuffer();
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorRbo);
+
+ if (this.m_attachDepth != gl.NONE)
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, this.m_attachDepth, gl.RENDERBUFFER, depthStencilRbo);
+ if (this.m_attachStencil != gl.NONE)
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, this.m_attachStencil, gl.RENDERBUFFER, depthStencilRbo);
+
+ this.checkError();
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ ctx.viewport(0, 0, width, height);
+
+ // Clear framebuffer.
+ ctx.clearBufferfv(gl.COLOR, 0, [0.0, 0.0, 0.0, 0.0]);
+ ctx.clearBufferfi(gl.DEPTH_STENCIL, 0, 1.0, 0);
+
+ // Render intersecting quads - increment stencil on depth pass
+ ctx.enable(gl.DEPTH_TEST);
+ ctx.enable(gl.STENCIL_TEST);
+ ctx.stencilFunc(gl.ALWAYS, 0, 0xff);
+ ctx.stencilOp(gl.KEEP, gl.KEEP, gl.INCR);
+
+ flatShader.setColor(this.getCurrentContext(), flatShaderID, [1.0, 0.0, 0.0, 1.0]);
+
+ rrUtil.drawQuad(this.getCurrentContext(), flatShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]);
+
+ gradShader.setGradient(this.getCurrentContext(), gradShaderID, [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]);
+
+ rrUtil.drawQuad(this.getCurrentContext(), gradShaderID, [-1.0, -1.0, -1.0], [1.0, 1.0, 1.0]);
+
+ ctx.disable(gl.DEPTH_TEST);
+
+ // Draw quad with stencil test (stencil == 1 or 2 depending on depth) - decrement on stencil failure
+ ctx.stencilFunc(gl.EQUAL, hasDepth ? 2 : 1, 0xff);
+ ctx.stencilOp(gl.DECR, gl.KEEP, gl.KEEP);
+
+ flatShader.setColor(this.getCurrentContext(), flatShaderID, [0.0, 1.0, 0.0, 1.0]);
+
+ rrUtil.drawQuad(this.getCurrentContext(), flatShaderID, [-0.5, -0.5, 0.0], [0.5, 0.5, 0.0]);
+
+ // Draw quad with stencil test where stencil > 1 or 2 depending on depth buffer
+ ctx.stencilFunc(gl.GREATER, hasDepth ? 1 : 2, 0xff);
+
+ flatShader.setColor(this.getCurrentContext(), flatShaderID, [0.0, 0.0, 1.0, 1.0]);
+
+ rrUtil.drawQuad(this.getCurrentContext(), flatShaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]);
+
+ this.readPixelsUsingFormat(dst, 0, 0, width, height, gluTextureUtil.mapGLInternalFormat(colorFormat), [1.0, 1.0, 1.0, 1.0], [0.0, 0.0, 0.0, 0.0]);
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fFboStencilbufferTests.FboStencilTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'stencil', 'FBO Stencilbuffer tests');
+ };
+
+ es3fFboStencilbufferTests.FboStencilTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fFboStencilbufferTests.FboStencilTests.prototype.constructor = es3fFboStencilbufferTests.FboStencilTests;
+
+ es3fFboStencilbufferTests.FboStencilTests.prototype.init = function() {
+ /** @const {Array<number>} */ var stencilFormats = [
+ gl.DEPTH32F_STENCIL8,
+ gl.DEPTH24_STENCIL8,
+ gl.STENCIL_INDEX8
+ ];
+
+ // .basic
+ /** @type {tcuTestCase.DeqpTest} */
+ var basicGroup = tcuTestCase.newTest('basic', 'Basic stencil tests');
+ this.addChild(basicGroup);
+
+ for (var fmtNdx = 0; fmtNdx < stencilFormats.length; fmtNdx++) {
+ /** @type {number} */ var format = stencilFormats[fmtNdx];
+ /** @type {tcuTexture.TextureFormat} */ var texFmt = gluTextureUtil.mapGLInternalFormat(format);
+
+ basicGroup.addChild(new es3fFboStencilbufferTests.BasicFboStencilCase(es3fFboTestUtil.getFormatName(format), '', format, [111, 132], false));
+
+ if (texFmt.order == tcuTexture.ChannelOrder.DS)
+ basicGroup.addChild(new es3fFboStencilbufferTests.BasicFboStencilCase(es3fFboTestUtil.getFormatName(format) + '_depth', '', format, [111, 132], true));
+ }
+
+ // .attach
+ /** @type {tcuTestCase.DeqpTest} */
+ var attachGroup = tcuTestCase.newTest('attach', 'Attaching depth stencil');
+ this.addChild(attachGroup);
+
+ attachGroup.addChild(new es3fFboStencilbufferTests.DepthStencilAttachCase('depth_only', 'Only depth part of depth-stencil RBO attached', gl.DEPTH_ATTACHMENT, gl.NONE));
+ attachGroup.addChild(new es3fFboStencilbufferTests.DepthStencilAttachCase('stencil_only', 'Only stencil part of depth-stencil RBO attached', gl.NONE, gl.STENCIL_ATTACHMENT));
+ attachGroup.addChild(new es3fFboStencilbufferTests.DepthStencilAttachCase('depth_stencil_separate', 'Depth and stencil attached separately', gl.DEPTH_ATTACHMENT, gl.STENCIL_ATTACHMENT));
+ attachGroup.addChild(new es3fFboStencilbufferTests.DepthStencilAttachCase('depth_stencil_attachment', 'Depth and stencil attached with DEPTH_STENCIL_ATTACHMENT', gl.DEPTH_STENCIL_ATTACHMENT, gl.NONE));
+ };
+
+ es3fFboStencilbufferTests.run = function(context) {
+ gl = context;
+ //Set up root Test
+ var state = tcuTestCase.runner;
+
+ var test = new es3fFboStencilbufferTests.FboStencilTests();
+ var testName = test.fullName();
+ var testDescription = test.getDescription();
+
+ state.testName = testName;
+ state.setRoot(test);
+ //Set up name and description of this test series.
+ setCurrentTestName(testName);
+ description(testDescription);
+
+ try {
+ //Create test cases
+ test.init();
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fFboStencilbufferTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboTestCase.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboTestCase.js
new file mode 100644
index 0000000000..cdaa7d352f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboTestCase.js
@@ -0,0 +1,483 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fFboTestCase');
+goog.require('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuPixelFormat');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.opengl.simplereference.sglrGLContext');
+goog.require('framework.opengl.simplereference.sglrReferenceContext');
+goog.require('framework.referencerenderer.rrRenderer');
+goog.require('functional.gles3.es3fFboTestUtil');
+
+goog.scope(function() {
+
+var es3fFboTestCase = functional.gles3.es3fFboTestCase;
+var tcuTestCase = framework.common.tcuTestCase;
+var deMath = framework.delibs.debase.deMath;
+var tcuSurface = framework.common.tcuSurface;
+var tcuTexture = framework.common.tcuTexture;
+var rrRenderer = framework.referencerenderer.rrRenderer;
+var sglrReferenceContext = framework.opengl.simplereference.sglrReferenceContext;
+var tcuPixelFormat = framework.common.tcuPixelFormat;
+var tcuImageCompare = framework.common.tcuImageCompare;
+var deString = framework.delibs.debase.deString;
+var sglrGLContext = framework.opengl.simplereference.sglrGLContext;
+var es3fFboTestUtil = functional.gles3.es3fFboTestUtil;
+var deRandom = framework.delibs.debase.deRandom;
+
+/** @typedef {(sglrGLContext.GLContext | WebGL2RenderingContext | sglrReferenceContext.ReferenceContext)} */
+es3fFboTestCase.Context;
+
+var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+};
+
+ /**
+ * es3fFboTestCase.FboTestCase class, inherits from TestCase and sglrContextWrapper
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} description
+ * @param {boolean=} useScreenSizedViewport
+ */
+ es3fFboTestCase.FboTestCase = function(name, description, useScreenSizedViewport /*= false */) {
+ tcuTestCase.DeqpTest.call(this, name, description);
+ /** @type {number} */ this.m_viewportWidth = useScreenSizedViewport === undefined ? gl.drawingBufferWidth : 128;
+ /** @type {number} */ this.m_viewportHeight = useScreenSizedViewport === undefined ? gl.drawingBufferHeight : 128;
+ /** @type {es3fFboTestCase.Context} */ this.m_curCtx = null;
+ };
+
+ es3fFboTestCase.FboTestCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fFboTestCase.FboTestCase.prototype.constructor = es3fFboTestCase.FboTestCase;
+
+ es3fFboTestCase.FboTestCase.prototype.getWidth = function() {
+ return Math.min(gl.drawingBufferWidth, this.m_viewportWidth);
+ };
+
+ es3fFboTestCase.FboTestCase.prototype.getHeight = function() {
+ return Math.min(gl.drawingBufferHeight, this.m_viewportHeight);
+ };
+
+ /**
+ * Sets the current context (inherited from sglrContextWrapper)
+ * @param {es3fFboTestCase.Context} context
+ */
+ es3fFboTestCase.FboTestCase.prototype.setContext = function(context) {
+ this.m_curCtx = context;
+ };
+
+ /**
+ * Gets the current context (inherited from sglrContextWrapper)
+ * @return {es3fFboTestCase.Context}
+ */
+ es3fFboTestCase.FboTestCase.prototype.getCurrentContext = function() {
+ return this.m_curCtx;
+ };
+
+ /**
+ * @param {tcuSurface.Surface} reference
+ * @param {tcuSurface.Surface} result
+ */
+ es3fFboTestCase.FboTestCase.prototype.compare = function(reference, result) {
+ return tcuImageCompare.fuzzyCompare('Result', 'Image comparison result', reference.getAccess(), result.getAccess(), 0.05, tcuImageCompare.CompareLogMode.RESULT);
+ };
+
+ /**
+ * @param {number} sizedFormat
+ */
+ es3fFboTestCase.FboTestCase.prototype.checkFormatSupport = function(sizedFormat) {
+ /** @const @type {boolean} */ var isCoreFormat = es3fFboTestCase.isRequiredFormat(sizedFormat);
+ /** @const @type {Array<string>} */ var requiredExts = (!isCoreFormat) ? es3fFboTestCase.getEnablingExtensions(sizedFormat) : [];
+
+ // Check that we don't try to use invalid formats.
+ DE_ASSERT(isCoreFormat || requiredExts);
+ if (requiredExts.length > 0 && !es3fFboTestCase.isAnyExtensionSupported(gl, requiredExts)) {
+ var msg = 'SKIP: Format ' + WebGLTestUtils.glEnumToString(gl, sizedFormat) + ' not supported';
+ debug(msg);
+ throw new TestFailedException(msg);
+ }
+ };
+
+ /**
+ * @param {number} sizedFormat deUint32
+ * @param {number} numSamples
+ */
+ es3fFboTestCase.FboTestCase.prototype.checkSampleCount = function(sizedFormat, numSamples) {
+ /** @const @type {number} */ var minSampleCount = es3fFboTestCase.getMinimumSampleCount(sizedFormat);
+
+ if (numSamples > minSampleCount) {
+ // Exceeds spec-mandated minimum - need to check.
+ /** @const @type {goog.NumberArray} */ var supportedSampleCounts = es3fFboTestCase.querySampleCounts(sizedFormat);
+ var supported = Array.prototype.slice.call(supportedSampleCounts);
+ if (supported.indexOf(numSamples) == -1) {
+ if (minSampleCount == 0 || numSamples > gl.getParameter(gl.MAX_SAMPLES)) {
+ checkMessage(false, "Sample count not supported, but it is allowed.");
+ return false;
+ } else {
+ throw new Error('Sample count not supported');
+ }
+ }
+ return true;
+ }
+ return true;
+ };
+
+ /**
+ * @param {tcuSurface.Surface} dst
+ * @param {number} x
+ * @param {number} y
+ * @param {number} width
+ * @param {number} height
+ * @param {tcuTexture.TextureFormat} format
+ * @param {Array<number>} scale Vec4
+ * @param {Array<number>} bias Vec4
+ */
+ es3fFboTestCase.FboTestCase.prototype.readPixelsUsingFormat = function(dst, x, y, width, height, format, scale, bias) {
+ dst.setSize(width, height);
+ es3fFboTestUtil.readPixels(this.getCurrentContext(), dst, x, y, width, height, format, scale, bias);
+ };
+
+ /**
+ * @param {tcuSurface.Surface} dst
+ * @param {number} x
+ * @param {number} y
+ * @param {number} width
+ * @param {number} height
+ */
+ es3fFboTestCase.FboTestCase.prototype.readPixels = function(dst, x, y, width, height) {
+ dst.readViewport(this.getCurrentContext(), [x, y, width, height]);
+ };
+
+ /**
+ * @param {number} target
+ */
+ es3fFboTestCase.FboTestCase.prototype.checkFramebufferStatus = function(target) {
+ /** @type {number} */ var status = this.getCurrentContext().checkFramebufferStatus(target);
+ if (status != gl.FRAMEBUFFER_COMPLETE)
+ throw new Error('Framebuffer Status: ' + WebGLTestUtils.glEnumToString(gl, status));
+ };
+
+ es3fFboTestCase.FboTestCase.prototype.checkError = function() {
+ /** @type {number} */ var err = this.getCurrentContext().getError();
+ if (err != gl.NO_ERROR)
+ throw new Error('glError: ' + WebGLTestUtils.glEnumToString(gl, err));
+ };
+
+ /**
+ * @param {tcuTexture.TextureFormat} format
+ * @param {Array<number>=} value Vec4
+ */
+ es3fFboTestCase.FboTestCase.prototype.clearColorBuffer = function(format, value) {
+ if (value === undefined) value = [0.0, 0.0, 0.0, 0.0];
+ es3fFboTestUtil.clearColorBuffer(this.getCurrentContext(), format, value);
+ };
+
+ es3fFboTestCase.FboTestCase.prototype.iterate = function() {
+ // Viewport.
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name));
+ /** @type {number} */ var width = Math.min(gl.drawingBufferWidth, this.m_viewportWidth);
+ /** @type {number} */ var height = Math.min(gl.drawingBufferHeight, this.m_viewportHeight);
+ /** @type {number} */ var x = rnd.getInt(0, gl.drawingBufferWidth - width);
+ /** @type {number} */ var y = rnd.getInt(0, gl.drawingBufferHeight - height);
+
+ // Surface format and storage is choosen by render().
+ /** @type {tcuSurface.Surface} */ var reference = new tcuSurface.Surface(width, height);
+ /** @type {tcuSurface.Surface} */ var result = new tcuSurface.Surface(width, height);
+
+ // Call preCheck() that can throw exception if some requirement is not met.
+ if (this.preCheck && !this.preCheck())
+ return tcuTestCase.IterateResult.STOP;
+
+ // Render using GLES3.
+ try {
+ /** @type {sglrGLContext.GLContext} */ var context = new sglrGLContext.GLContext(
+ gl,
+ [x, y, width, height]);
+
+ this.setContext(context);
+ this.render(result);
+
+ // Check error.
+ /** @type {number} */ var err = context.getError();
+ if (err != gl.NO_ERROR)
+ throw new Error('glError: ' + context);
+
+ this.setContext(null);
+ } catch (e) {
+ if (e instanceof es3fFboTestUtil.FboIncompleteException)
+ if (e.getReason() == gl.FRAMEBUFFER_UNSUPPORTED) {
+ // log << e;
+ // m_testCtx.setTestResult(QP_TEST_RESULT_NOT_SUPPORTED, 'Not supported');
+ assertMsgOptions(false, 'Not supported', true, false);
+ return tcuTestCase.IterateResult.STOP;
+ }
+ throw e;
+ }
+
+ // Render reference.
+ var alphaBits = /** @type {number} */ (gl.getParameter(gl.ALPHA_BITS));
+ /** @type {sglrReferenceContext.ReferenceContextBuffers} */
+ var buffers = new sglrReferenceContext.ReferenceContextBuffers(new tcuPixelFormat.PixelFormat(
+ 8,
+ 8,
+ 8,
+ alphaBits > 0 ? 8 : 0),
+ /** @type {number} */ (gl.getParameter(gl.DEPTH_BITS)),
+ /** @type {number} */ (gl.getParameter(gl.STENCIL_BITS)),
+ width,
+ height);
+ /** @type {sglrReferenceContext.ReferenceContext} */
+ var refContext = new sglrReferenceContext.ReferenceContext(new sglrReferenceContext.ReferenceContextLimits(gl),
+ buffers.getColorbuffer(),
+ buffers.getDepthbuffer(),
+ buffers.getStencilbuffer());
+ refContext.getError();
+ this.setContext(refContext);
+ this.render(reference);
+ this.setContext(null);
+
+ /** @type {boolean} */ var isOk = this.compare(reference, result);
+
+ assertMsgOptions(isOk, '', true, false);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * Deinit. Clear some GL state variables
+ */
+ es3fFboTestCase.FboTestCase.prototype.deinit = function () {
+ // Pixel operations
+ {
+ gl.disable(gl.SCISSOR_TEST);
+
+ gl.disable(gl.STENCIL_TEST);
+ gl.stencilFunc(gl.ALWAYS, 0, 0xffff);
+ gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);
+
+ gl.disable(gl.DEPTH_TEST);
+ gl.depthFunc(gl.LESS);
+
+ gl.disable(gl.BLEND);
+ gl.blendFunc(gl.ONE, gl.ZERO);
+ gl.blendEquation(gl.FUNC_ADD);
+ gl.blendColor(0.0, 0.0, 0.0, 0.0);
+
+ gl.enable(gl.DITHER);
+ }
+
+ // Framebuffer control
+ {
+ gl.colorMask(true, true, true, true);
+ gl.depthMask(true);
+ gl.stencilMask(0xffff);
+
+ gl.clearColor(0.0, 0.0, 0.0, 0.0);
+ gl.clearDepth(1.0);
+ gl.clearStencil(0.0);
+ // Do not call clear() here because it might generate an INVALID_OPERATION if
+ // some color buffers are of integer formats due to WebGL2 specific constraint.
+ // The tests do not rely on clear() here.
+ }
+ };
+
+ /**
+ * @param {number} format
+ * @return {boolean}
+ */
+ es3fFboTestCase.isRequiredFormat = function(format) {
+ switch (format) {
+ // Color-renderable formats
+ case gl.RGBA32I:
+ case gl.RGBA32UI:
+ case gl.RGBA16I:
+ case gl.RGBA16UI:
+ case gl.RGBA8:
+ case gl.RGBA8I:
+ case gl.RGBA8UI:
+ case gl.SRGB8_ALPHA8:
+ case gl.RGB10_A2:
+ case gl.RGB10_A2UI:
+ case gl.RGBA4:
+ case gl.RGB5_A1:
+ case gl.RGB8:
+ case gl.RGB565:
+ case gl.RG32I:
+ case gl.RG32UI:
+ case gl.RG16I:
+ case gl.RG16UI:
+ case gl.RG8:
+ case gl.RG8I:
+ case gl.RG8UI:
+ case gl.R32I:
+ case gl.R32UI:
+ case gl.R16I:
+ case gl.R16UI:
+ case gl.R8:
+ case gl.R8I:
+ case gl.R8UI:
+ return true;
+
+ // Depth formats
+ case gl.DEPTH_COMPONENT32F:
+ case gl.DEPTH_COMPONENT24:
+ case gl.DEPTH_COMPONENT16:
+ return true;
+
+ // Depth+stencil formats
+ case gl.DEPTH32F_STENCIL8:
+ case gl.DEPTH24_STENCIL8:
+ return true;
+
+ // Stencil formats
+ case gl.STENCIL_INDEX8:
+ return true;
+
+ default:
+ return false;
+ }
+ };
+
+ /**
+ * @param {number} format deUint32
+ * @return {Array<string>}
+ */
+ es3fFboTestCase.getEnablingExtensions = function(format) {
+ /** @return {Array<string>} */ var out = [];
+
+ DE_ASSERT(!es3fFboTestCase.isRequiredFormat(format));
+
+ switch (format) {
+ case gl.RGBA16F:
+ case gl.RG16F:
+ case gl.R16F:
+ case gl.RGBA32F:
+ case gl.RGB32F:
+ case gl.R11F_G11F_B10F:
+ case gl.RG32F:
+ case gl.R32F:
+ out.push('EXT_color_buffer_float');
+ break;
+ case gl.RGB16F:
+ // EXT_color_buffer_half_float is not exposed in WebGL 2.0.
+ break;
+ default:
+ break;
+ }
+
+ return out;
+ };
+
+ /**
+ * @param {es3fFboTestCase.Context} context
+ * @param {Array<string>} requiredExts
+ * @return {boolean}
+ */
+ es3fFboTestCase.isAnyExtensionSupported = function(context, requiredExts) {
+ for (var iter in requiredExts) {
+ /** @const @type {string} */ var extension = requiredExts[iter];
+
+ if (sglrGLContext.isExtensionSupported(gl, extension)) {
+ // enable the extension
+ gl.getExtension(extension);
+ return true;
+ }
+ }
+
+ return false;
+ };
+
+/**
+ * @param {number} format GL format
+ * @return {number}
+ */
+es3fFboTestCase.getMinimumSampleCount = function(format) {
+ switch (format) {
+ // Core formats
+ case gl.RGBA32I:
+ case gl.RGBA32UI:
+ case gl.RGBA16I:
+ case gl.RGBA16UI:
+ case gl.RGBA8:
+ case gl.RGBA8I:
+ case gl.RGBA8UI:
+ case gl.SRGB8_ALPHA8:
+ case gl.RGB10_A2:
+ case gl.RGB10_A2UI:
+ case gl.RGBA4:
+ case gl.RGB5_A1:
+ case gl.RGB8:
+ case gl.RGB565:
+ case gl.RG32I:
+ case gl.RG32UI:
+ case gl.RG16I:
+ case gl.RG16UI:
+ case gl.RG8:
+ case gl.RG8I:
+ case gl.RG8UI:
+ case gl.R32I:
+ case gl.R32UI:
+ case gl.R16I:
+ case gl.R16UI:
+ case gl.R8:
+ case gl.R8I:
+ case gl.R8UI:
+ case gl.DEPTH_COMPONENT32F:
+ case gl.DEPTH_COMPONENT24:
+ case gl.DEPTH_COMPONENT16:
+ case gl.DEPTH32F_STENCIL8:
+ case gl.DEPTH24_STENCIL8:
+ case gl.STENCIL_INDEX8:
+ return 4;
+
+ // gl.EXT_color_buffer_float
+ case gl.R11F_G11F_B10F:
+ case gl.RG16F:
+ case gl.R16F:
+ return 4;
+
+ case gl.RGBA32F:
+ case gl.RGBA16F:
+ case gl.RG32F:
+ case gl.R32F:
+ return 0;
+
+ // gl.EXT_color_buffer_half_float
+ case gl.RGB16F:
+ return 0;
+
+ default:
+ throw new Error('Unknown format:' + format);
+ }
+};
+
+es3fFboTestCase.querySampleCounts = function(format) {
+ return gl.getInternalformatParameter(gl.RENDERBUFFER, format, gl.SAMPLES);
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboTestUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboTestUtil.js
new file mode 100644
index 0000000000..ed152a43e4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFboTestUtil.js
@@ -0,0 +1,1324 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fFboTestUtil');
+goog.require('framework.common.tcuMatrix');
+goog.require('framework.common.tcuRGBA');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluTextureUtil');
+goog.require('framework.opengl.simplereference.sglrGLContext');
+goog.require('framework.opengl.simplereference.sglrReferenceContext');
+goog.require('framework.opengl.simplereference.sglrShaderProgram');
+goog.require('framework.referencerenderer.rrFragmentOperations');
+goog.require('framework.referencerenderer.rrGenericVector');
+goog.require('framework.referencerenderer.rrShadingContext');
+goog.require('framework.referencerenderer.rrVertexAttrib');
+goog.require('framework.referencerenderer.rrVertexPacket');
+
+goog.scope(function() {
+
+var es3fFboTestUtil = functional.gles3.es3fFboTestUtil;
+var tcuTexture = framework.common.tcuTexture;
+var tcuTextureUtil = framework.common.tcuTextureUtil;
+var tcuRGBA = framework.common.tcuRGBA;
+var gluTextureUtil = framework.opengl.gluTextureUtil;
+var deMath = framework.delibs.debase.deMath;
+var rrShadingContext = framework.referencerenderer.rrShadingContext;
+var rrVertexPacket = framework.referencerenderer.rrVertexPacket;
+var rrVertexAttrib = framework.referencerenderer.rrVertexAttrib;
+var gluShaderUtil = framework.opengl.gluShaderUtil;
+var sglrGLContext = framework.opengl.simplereference.sglrGLContext;
+var sglrReferenceContext = framework.opengl.simplereference.sglrReferenceContext;
+var sglrShaderProgram = framework.opengl.simplereference.sglrShaderProgram;
+var rrGenericVector = framework.referencerenderer.rrGenericVector;
+var tcuMatrix = framework.common.tcuMatrix;
+var rrFragmentOperations = framework.referencerenderer.rrFragmentOperations;
+var tcuSurface = framework.common.tcuSurface;
+
+var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+};
+
+/**
+ * Defines the exception type for a test failure.
+ * @constructor
+ * @param {number} reason The error code.
+ */
+es3fFboTestUtil.FboIncompleteException = function(reason) {
+ this.reason = reason;
+ this.name = 'es3fFboTestUtil.FboIncompleteException';
+};
+
+/** @typedef { (WebGL2RenderingContext|sglrReferenceContext.ReferenceContext)} */
+es3fFboTestUtil.Context;
+
+es3fFboTestUtil.FboIncompleteException.prototype.getReason = function() {return this.reason; };
+
+ /**
+ * @param {gluShaderUtil.DataType} type
+ * @return {rrGenericVector.GenericVecType}
+ */
+ es3fFboTestUtil.mapDataTypeToGenericVecType = function(type) {
+ switch (type) {
+ case gluShaderUtil.DataType.FLOAT_VEC4: return rrGenericVector.GenericVecType.FLOAT;
+ case gluShaderUtil.DataType.INT_VEC4: return rrGenericVector.GenericVecType.INT32;
+ case gluShaderUtil.DataType.UINT_VEC4: return rrGenericVector.GenericVecType.UINT32;
+ default:
+ throw new Error('Unrecognized type: ' + type);
+ }
+ };
+
+ /**
+ * @param {Array<number>} input
+ * @param {{max: number, min: number}} type min, max information
+ * @return {Array<number>}
+ */
+ es3fFboTestUtil.castVectorSaturate = function(input, type) {
+ return [
+ (input[0] + 0.5 >= type.max) ? (type.max) : ((input[0] - 0.5 <= type.min) ? (type.min) : Math.round(input[0])),
+ (input[1] + 0.5 >= type.max) ? (type.max) : ((input[1] - 0.5 <= type.min) ? (type.min) : Math.round(input[1])),
+ (input[2] + 0.5 >= type.max) ? (type.max) : ((input[2] - 0.5 <= type.min) ? (type.min) : Math.round(input[2])),
+ (input[3] + 0.5 >= type.max) ? (type.max) : ((input[3] - 0.5 <= type.min) ? (type.min) : Math.round(input[3]))
+ ];
+ };
+
+ /**
+ * es3fFboTestUtil.FlatColorShader inherits from sglrShaderProgram
+ * @constructor
+ * @extends {sglrShaderProgram.ShaderProgram}
+ * @param {gluShaderUtil.DataType} outputType
+ * @param {number=} pointSize
+ */
+ es3fFboTestUtil.FlatColorShader = function(outputType, pointSize) {
+ pointSize = pointSize || 1;
+ /** @type {sglrShaderProgram.ShaderProgramDeclaration} */
+ var decl = new sglrShaderProgram.ShaderProgramDeclaration();
+ /** @type {gluShaderUtil.DataType} */ this.m_outputType = outputType;
+
+ decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_position', rrGenericVector.GenericVecType.FLOAT));
+ decl.pushVertexToFragmentVarying(new sglrShaderProgram.VertexToFragmentVarying(rrGenericVector.GenericVecType.FLOAT));
+ decl.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(es3fFboTestUtil.mapDataTypeToGenericVecType(outputType)));
+ decl.pushUniform(new sglrShaderProgram.Uniform('u_color', gluShaderUtil.DataType.FLOAT_VEC4));
+ decl.pushVertexSource(new sglrShaderProgram.VertexSource(
+ '#version 300 es\n' +
+ 'in highp vec4 a_position;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = a_position;\n' +
+ ' gl_PointSize = ' + pointSize + '.0;\n' +
+ '}\n'));
+ decl.pushFragmentSource(new sglrShaderProgram.FragmentSource(
+ '#version 300 es\n' +
+ 'uniform highp vec4 u_color;\n' +
+ 'layout(location = 0) out highp ' + gluShaderUtil.getDataTypeName(outputType) + ' o_color;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' o_color = ' + gluShaderUtil.getDataTypeName(outputType) + '(u_color);\n' +
+ '}\n'));
+ sglrShaderProgram.ShaderProgram.call(this, decl);
+ this.m_pointSize = pointSize;
+ };
+
+ es3fFboTestUtil.FlatColorShader.prototype = Object.create(sglrShaderProgram.ShaderProgram.prototype);
+ es3fFboTestUtil.FlatColorShader.prototype.constructor = es3fFboTestUtil.FlatColorShader;
+
+ /**
+ * @param {(WebGL2RenderingContext|sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext)} context
+ * @param program GL program object
+ * @param {Array<number>} color
+ */
+ es3fFboTestUtil.FlatColorShader.prototype.setColor = function(context, program, color) {
+ /** @type {number} */ var location = context.getUniformLocation(program, 'u_color');
+
+ context.useProgram(program);
+ context.uniform4fv(location, color);
+ };
+
+ /**
+ * @param {Array<rrVertexAttrib.VertexAttrib>} inputs
+ * @param {Array<rrVertexPacket.VertexPacket>} packets
+ * @param {number} numPackets
+ */
+ es3fFboTestUtil.FlatColorShader.prototype.shadeVertices = function(inputs, packets, numPackets) {
+ for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) {
+ /** @type {rrVertexPacket.VertexPacket} */ var packet = packets[packetNdx];
+ packet.position = rrVertexAttrib.readVertexAttrib(inputs[0], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT);
+ packet.pointSize = this.m_pointSize;
+ }
+ };
+
+ /**
+ * @param {Array<rrFragmentOperations.Fragment>} packet
+ * @param {rrShadingContext.FragmentShadingContext} context
+ */
+ es3fFboTestUtil.FlatColorShader.prototype.shadeFragments = function(packet, context) {
+ var numPackets = packet.length;
+ /** @const {Array<number>} */ var color = this.m_uniforms[0].value;
+ /** @const {Array<number>} */ var icolor = es3fFboTestUtil.castVectorSaturate(color, tcuTexture.deTypes.deInt32);
+ /** @const {Array<number>} */ var uicolor = es3fFboTestUtil.castVectorSaturate(color, tcuTexture.deTypes.deUint32);
+
+ if (this.m_outputType == gluShaderUtil.DataType.FLOAT_VEC4) {
+ for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx)
+ packet[packetNdx].value = color;
+ } else if (this.m_outputType == gluShaderUtil.DataType.INT_VEC4) {
+ for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx)
+ packet[packetNdx].value = icolor;
+ } else if (this.m_outputType == gluShaderUtil.DataType.UINT_VEC4) {
+ for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx)
+ packet[packetNdx].value = uicolor;
+ } else
+ throw new Error('Invalid output type: ' + this.m_outputType);
+ };
+
+ /**
+ * es3fFboTestUtil.GradientShader inherits from sglrShaderProgram
+ * @constructor
+ * @extends {sglrShaderProgram.ShaderProgram}
+ * @param {gluShaderUtil.DataType} outputType
+ */
+ es3fFboTestUtil.GradientShader = function(outputType) {
+ /** @type {sglrShaderProgram.ShaderProgramDeclaration} */
+ var decl = new sglrShaderProgram.ShaderProgramDeclaration();
+ /** @type {gluShaderUtil.DataType} */ this.m_outputType = outputType;
+ decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_position', rrGenericVector.GenericVecType.FLOAT));
+ decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_coord', rrGenericVector.GenericVecType.FLOAT));
+ decl.pushVertexToFragmentVarying(new sglrShaderProgram.VertexToFragmentVarying(rrGenericVector.GenericVecType.FLOAT));
+ decl.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(es3fFboTestUtil.mapDataTypeToGenericVecType(outputType)));
+ decl.pushUniform(new sglrShaderProgram.Uniform('u_gradientMin', gluShaderUtil.DataType.FLOAT_VEC4));
+ decl.pushUniform(new sglrShaderProgram.Uniform('u_gradientMax', gluShaderUtil.DataType.FLOAT_VEC4));
+ decl.pushVertexSource(new sglrShaderProgram.VertexSource(
+ '#version 300 es\n' +
+ 'in highp vec4 a_position;\n' +
+ 'in highp vec4 a_coord;\n' +
+ 'out highp vec4 v_coord;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = a_position;\n' +
+ ' v_coord = a_coord;\n' +
+ '}\n'));
+ decl.pushFragmentSource(new sglrShaderProgram.FragmentSource(
+ '#version 300 es\n' +
+ 'in highp vec4 v_coord;\n' +
+ 'uniform highp vec4 u_gradientMin;\n' +
+ 'uniform highp vec4 u_gradientMax;\n' +
+ 'layout(location = 0) out highp ' + gluShaderUtil.getDataTypeName(outputType) + ' o_color;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' highp float x = v_coord.x;\n' +
+ ' highp float y = v_coord.y;\n' +
+ ' highp float f0 = (x + y) * 0.5;\n' +
+ ' highp float f1 = 0.5 + (x - y) * 0.5;\n' +
+ ' highp vec4 fv = vec4(f0, f1, 1.0f-f0, 1.0f-f1);\n' +
+ ' o_color = ' + gluShaderUtil.getDataTypeName(outputType) + '(u_gradientMin + (u_gradientMax-u_gradientMin)*fv);\n' +
+ '}\n'));
+ sglrShaderProgram.ShaderProgram.call(this, decl);
+ };
+
+ es3fFboTestUtil.GradientShader.prototype = Object.create(sglrShaderProgram.ShaderProgram.prototype);
+ es3fFboTestUtil.GradientShader.prototype.constructor = es3fFboTestUtil.GradientShader;
+
+ /**
+ * @param {es3fFboTestUtil.Context} ctx GL-like context
+ * @param program GL program
+ * @param {Array<number>} gradientMin
+ * @param {Array<number>} gradientMax
+ */
+ es3fFboTestUtil.GradientShader.prototype.setGradient = function(ctx, program, gradientMin, gradientMax) {
+ ctx.useProgram(program);
+ ctx.uniform4fv(ctx.getUniformLocation(program, 'u_gradientMin'), gradientMin);
+ ctx.uniform4fv(ctx.getUniformLocation(program, 'u_gradientMax'), gradientMax);
+ };
+
+ /**
+ * @param {Array<rrVertexAttrib.VertexAttrib>} inputs
+ * @param {Array<rrVertexPacket.VertexPacket>} packets
+ * @param {number} numPackets
+ */
+ es3fFboTestUtil.GradientShader.prototype.shadeVertices = function(inputs, packets, numPackets) {
+ for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) {
+ /** @type {rrVertexPacket.VertexPacket} */ var packet = packets[packetNdx];
+
+ packet.position = rrVertexAttrib.readVertexAttrib(inputs[0], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT);
+ packet.outputs[0] = rrVertexAttrib.readVertexAttrib(inputs[1], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT);
+ }
+ };
+
+ /**
+ * @param {Array<rrFragmentOperations.Fragment>} packet
+ * @param {rrShadingContext.FragmentShadingContext} context
+ */
+ es3fFboTestUtil.GradientShader.prototype.shadeFragments = function(packet, context) {
+ var numPackets = packet.length;
+ /** @const {Array<number>} */ var gradientMin = this.m_uniforms[0].value;
+ /** @const {Array<number>} */ var gradientMax = this.m_uniforms[1].value;
+
+ for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) {
+ /** @const {Array<number>} */ var coord = rrShadingContext.readTriangleVarying(packet[packetNdx], context, 0);
+ /** @const {number} */ var x = coord[0];
+ /** @const {number} */ var y = coord[1];
+ /** @const {number} */ var f0 = (x + y) * 0.5;
+ /** @const {number} */ var f1 = 0.5 + (x - y) * 0.5;
+ /** @const {Array<number>} */ var fv = [f0, f1, 1.0 - f0, 1.0 - f1];
+
+ /** @const {Array<number>} */ var color = deMath.add(gradientMin, deMath.multiply(deMath.subtract(gradientMax, gradientMin), fv));
+ /** @const {Array<number>} */ var icolor = es3fFboTestUtil.castVectorSaturate(color, tcuTexture.deTypes.deInt32);
+ /** @const {Array<number>} */ var uicolor = es3fFboTestUtil.castVectorSaturate(color, tcuTexture.deTypes.deUint32);
+
+ if (this.m_outputType == gluShaderUtil.DataType.FLOAT_VEC4)
+ packet[packetNdx].value = color;
+ else if (this.m_outputType == gluShaderUtil.DataType.INT_VEC4)
+ packet[packetNdx].value = icolor;
+ else if (this.m_outputType == gluShaderUtil.DataType.UINT_VEC4)
+ packet[packetNdx].value = uicolor;
+ else
+ throw new Error('Invalid output type: ' + this.m_outputType);
+ }
+ };
+
+ /**
+ * @param {Array<gluShaderUtil.DataType>} samplerTypes
+ * @param {gluShaderUtil.DataType} outputType
+ * @return {string}
+ */
+ es3fFboTestUtil.genTexFragmentShader = function(samplerTypes, outputType) {
+ /** @type {string} */ var precision = 'highp';
+ /** @type {string} */ var src = '';
+
+ src = '#version 300 es\n' +
+ 'layout(location = 0) out highp ' + gluShaderUtil.getDataTypeName(outputType) + ' o_color0;\n' +
+ 'in highp vec2 v_coord;\n';
+
+ for (var samplerNdx = 0; samplerNdx < samplerTypes.length; samplerNdx++) {
+ src += 'uniform ' + precision + ' ' + gluShaderUtil.getDataTypeName(samplerTypes[samplerNdx]) + ' u_sampler' + samplerNdx + ';\n' +
+ 'uniform ' + precision + ' vec4 u_texScale' + samplerNdx + ';\n' +
+ 'uniform ' + precision + ' vec4 u_texBias' + samplerNdx + ';\n';
+ }
+
+ // Output scale & bias
+ src += 'uniform ' + precision + ' vec4 u_outScale0;\n' +
+ 'uniform ' + precision + ' vec4 u_outBias0;\n';
+
+ src += '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' ' + precision + ' vec4 out0 = vec4(0.0);\n';
+
+ // Texture input fetch and combine.
+ for (var inNdx = 0; inNdx < samplerTypes.length; inNdx++)
+ src += '\tout0 += vec4(' +
+ 'texture(u_sampler' + inNdx + ', v_coord)) * u_texScale' + inNdx + ' + u_texBias' + inNdx + ';\n';
+
+ // Write output.
+ src += ' o_color0 = ' + gluShaderUtil.getDataTypeName(outputType) + '(out0 * u_outScale0 + u_outBias0);\n' +
+ '}\n';
+
+ return src;
+ };
+
+ /**
+ * @param {Array<gluShaderUtil.DataType>} samplerTypes
+ * @param {gluShaderUtil.DataType} outputType
+ * @return {sglrShaderProgram.ShaderProgramDeclaration}
+ */
+ es3fFboTestUtil.genTexture2DShaderDecl = function(samplerTypes, outputType) {
+ /** @type {sglrShaderProgram.ShaderProgramDeclaration} */
+ var decl = new sglrShaderProgram.ShaderProgramDeclaration();
+
+ decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_position', rrGenericVector.GenericVecType.FLOAT));
+ decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_coord', rrGenericVector.GenericVecType.FLOAT));
+ decl.pushVertexToFragmentVarying(new sglrShaderProgram.VertexToFragmentVarying(rrGenericVector.GenericVecType.FLOAT));
+ decl.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(es3fFboTestUtil.mapDataTypeToGenericVecType(outputType)));
+
+ decl.pushVertexSource(new sglrShaderProgram.VertexSource(
+ '#version 300 es\n' +
+ 'in highp vec4 a_position;\n' +
+ 'in highp vec2 a_coord;\n' +
+ 'out highp vec2 v_coord;\n' +
+ 'void main(void)\n' +
+ '{\n' +
+ ' gl_Position = a_position;\n' +
+ ' v_coord = a_coord;\n' +
+ '}\n'));
+
+ decl.pushFragmentSource(new sglrShaderProgram.FragmentSource(es3fFboTestUtil.genTexFragmentShader(samplerTypes, outputType)));
+
+ decl.pushUniform(new sglrShaderProgram.Uniform('u_outScale0', gluShaderUtil.DataType.FLOAT_VEC4));
+ decl.pushUniform(new sglrShaderProgram.Uniform('u_outBias0', gluShaderUtil.DataType.FLOAT_VEC4));
+
+ for (var ndx = 0; ndx < samplerTypes.length; ++ndx) {
+ decl.pushUniform(new sglrShaderProgram.Uniform('u_sampler' + ndx, samplerTypes[ndx]));
+ decl.pushUniform(new sglrShaderProgram.Uniform('u_texScale' + ndx, gluShaderUtil.DataType.FLOAT_VEC4));
+ decl.pushUniform(new sglrShaderProgram.Uniform('u_texBias' + ndx, gluShaderUtil.DataType.FLOAT_VEC4));
+ }
+
+ return decl;
+ };
+
+ /**
+ * For use in es3fFboTestUtil.Texture2DShader
+ * @constructor
+ */
+ es3fFboTestUtil.Input = function() {
+ /** @type {number} */ this.unitNdx;
+ /** @type {Array<number>} */ this.scale;
+ /** @type {Array<number>} */ this.bias;
+ };
+
+ /**
+ * es3fFboTestUtil.Texture2DShader inherits from sglrShaderProgram
+ * @constructor
+ * @extends {sglrShaderProgram.ShaderProgram}
+ * @param {Array<gluShaderUtil.DataType>} samplerTypes
+ * @param {gluShaderUtil.DataType} outputType
+ * @param {Array<number>=} outScale - default [1.0, 1.0, 1.0, 1.0]
+ * @param {Array<number>=} outBias - default [0.0, 0.0, 0.0, 0.0]
+ */
+ es3fFboTestUtil.Texture2DShader = function(samplerTypes, outputType, outScale, outBias) {
+ if (outScale === undefined) outScale = [1.0, 1.0, 1.0, 1.0];
+ if (outBias === undefined) outBias = [0.0, 0.0, 0.0, 0.0];
+ sglrShaderProgram.ShaderProgram.call(this, es3fFboTestUtil.genTexture2DShaderDecl(samplerTypes, outputType));
+ /** @type {Array<es3fFboTestUtil.Input>} */ this.m_inputs = [];
+ /** @type {Array<number>} */ this.m_outScale = outScale;
+ /** @type {Array<number>} */ this.m_outBias = outBias;
+ /** @const {gluShaderUtil.DataType} */ this.m_outputType = outputType;
+ for (var ndx = 0; ndx < samplerTypes.length; ndx++) {
+ var input = new es3fFboTestUtil.Input();
+ input.unitNdx = ndx;
+ input.scale = [1.0, 1.0, 1.0, 1.0];
+ input.bias = [0.0, 0.0, 0.0, 0.0];
+ this.m_inputs[ndx] = input;
+ }
+ };
+
+ es3fFboTestUtil.Texture2DShader.prototype = Object.create(sglrShaderProgram.ShaderProgram.prototype);
+ es3fFboTestUtil.Texture2DShader.prototype.constructor = es3fFboTestUtil.Texture2DShader;
+
+ /**
+ * @param {number} inputNdx
+ * @param {number} unitNdx
+ */
+ es3fFboTestUtil.Texture2DShader.prototype.setUnit = function(inputNdx, unitNdx) {
+ this.m_inputs[inputNdx].unitNdx = unitNdx;
+ };
+
+ /**
+ * @param {number} inputNdx
+ * @param {Array<number>} scale
+ * @param {Array<number>} bias
+ */
+ es3fFboTestUtil.Texture2DShader.prototype.setTexScaleBias = function(inputNdx, scale, bias) {
+ this.m_inputs[inputNdx].scale = scale;
+ this.m_inputs[inputNdx].bias = bias;
+ };
+
+ /**
+ * @param {Array<number>} scale
+ * @param {Array<number>} bias
+ */
+ es3fFboTestUtil.Texture2DShader.prototype.setOutScaleBias = function(scale, bias) {
+ this.m_outScale = scale;
+ this.m_outBias = bias;
+ };
+
+ /**
+ * @param context GL-like context
+ * @param program
+ */
+ es3fFboTestUtil.Texture2DShader.prototype.setUniforms = function(context, program) {
+ context.useProgram(program);
+
+ for (var texNdx = 0; texNdx < this.m_inputs.length; texNdx++) {
+ /** @type {string} */ var samplerName = 'u_sampler' + texNdx;
+ /** @type {string} */ var scaleName = 'u_texScale' + texNdx;
+ /** @type {string} */ var biasName = 'u_texBias' + texNdx;
+
+ context.uniform1i(context.getUniformLocation(program, samplerName), this.m_inputs[texNdx].unitNdx);
+ context.uniform4fv(context.getUniformLocation(program, scaleName), this.m_inputs[texNdx].scale);
+ context.uniform4fv(context.getUniformLocation(program, biasName), this.m_inputs[texNdx].bias);
+ }
+
+ context.uniform4fv(context.getUniformLocation(program, 'u_outScale0'), this.m_outScale);
+ context.uniform4fv(context.getUniformLocation(program, 'u_outBias0'), this.m_outBias);
+ };
+
+ /**
+ * @param {Array<rrVertexAttrib.VertexAttrib>} inputs
+ * @param {Array<rrVertexPacket.VertexPacket>} packets
+ * @param {number} numPackets
+ */
+ es3fFboTestUtil.Texture2DShader.prototype.shadeVertices = function(inputs, packets, numPackets) {
+ // TODO: implement rrVertexAttrib.readVertexAttribFloat
+ for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) {
+ /** @type {rrVertexPacket.VertexPacket} */ var packet = packets[packetNdx];
+ packet.position = rrVertexAttrib.readVertexAttrib(inputs[0], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT);
+ packet.outputs[0] = rrVertexAttrib.readVertexAttrib(inputs[1], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT);
+ }
+ };
+
+ /**
+ * @param {Array<rrFragmentOperations.Fragment>} packet
+ * @param {rrShadingContext.FragmentShadingContext} context
+ */
+ es3fFboTestUtil.Texture2DShader.prototype.shadeFragments = function(packet, context) {
+ var numPackets = packet.length;
+ /** @type {Array<number>} */ var outScale = this.m_uniforms[0].value;
+ /** @type {Array<number>} */ var outBias = this.m_uniforms[1].value;
+ var texCoords = [];
+ var colors = [];
+
+ for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) {
+ // setup tex coords
+ /** @const {Array<number>} */ var coord = rrShadingContext.readTriangleVarying(packet[packetNdx], context, 0);
+ texCoords = [coord[0], coord[1]];
+
+ // clear result
+ colors = [0.0, 0.0, 0.0, 0.0];
+
+ // sample each texture
+ for (var ndx = 0; ndx < this.m_inputs.length; ndx++) {
+ var tex = this.m_uniforms[2 + ndx * 3].sampler;
+ var ratioX = tex.m_view.getWidth() / context.getWidth();
+ var ratioY = tex.m_view.getHeight() / context.getHeight();
+ var lod = Math.floor(Math.log2(Math.max(ratioX, ratioY)));
+
+ /** @const {Array<number>} */ var scale = this.m_uniforms[2 + ndx * 3 + 1].value;
+ /** @const {Array<number>} */ var bias = this.m_uniforms[2 + ndx * 3 + 2].value;
+
+ var tmpColors = tex.sample(texCoords, lod);
+
+ colors = deMath.add(colors, deMath.add(deMath.multiply(tmpColors, scale), bias));
+ }
+
+ // write out
+ /** @const {Array<number>} */ var color = deMath.add(deMath.multiply(colors, outScale), outBias);
+ /** @const {Array<number>} */ var icolor = es3fFboTestUtil.castVectorSaturate(color, tcuTexture.deTypes.deInt32);
+ /** @const {Array<number>} */ var uicolor = es3fFboTestUtil.castVectorSaturate(color, tcuTexture.deTypes.deUint32);
+
+ if (this.m_outputType == gluShaderUtil.DataType.FLOAT_VEC4)
+ packet[packetNdx].value = color;
+ else if (this.m_outputType == gluShaderUtil.DataType.INT_VEC4)
+ packet[packetNdx].value = icolor;
+ else if (this.m_outputType == gluShaderUtil.DataType.UINT_VEC4)
+ packet[packetNdx].value = uicolor;
+ }
+ };
+
+ /**
+ * es3fFboTestUtil.TextureCubeShader inherits from sglrShaderProgram
+ * @constructor
+ * @extends {sglrShaderProgram.ShaderProgram}
+ * @param {gluShaderUtil.DataType} samplerType
+ * @param {gluShaderUtil.DataType} outputType
+ */
+ es3fFboTestUtil.TextureCubeShader = function(samplerType, outputType) {
+ /** @type {sglrShaderProgram.ShaderProgramDeclaration} */
+ var decl = new sglrShaderProgram.ShaderProgramDeclaration();
+ decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_position', rrGenericVector.GenericVecType.FLOAT));
+ decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_coord', rrGenericVector.GenericVecType.FLOAT));
+ decl.pushVertexToFragmentVarying(new sglrShaderProgram.VertexToFragmentVarying(rrGenericVector.GenericVecType.FLOAT));
+ decl.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(es3fFboTestUtil.mapDataTypeToGenericVecType(outputType)));
+ decl.pushUniform(new sglrShaderProgram.Uniform('u_coordMat', gluShaderUtil.DataType.FLOAT_MAT3));
+ decl.pushUniform(new sglrShaderProgram.Uniform('u_sampler0', samplerType));
+ decl.pushUniform(new sglrShaderProgram.Uniform('u_scale', gluShaderUtil.DataType.FLOAT_VEC4));
+ decl.pushUniform(new sglrShaderProgram.Uniform('u_bias', gluShaderUtil.DataType.FLOAT_VEC4));
+ decl.pushVertexSource(new sglrShaderProgram.VertexSource(
+ '#version 300 es\n' +
+ 'in highp vec4 a_position;\n' +
+ 'in mediump vec2 a_coord;\n' +
+ 'uniform mat3 u_coordMat;\n' +
+ 'out mediump vec3 v_coord;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = a_position;\n' +
+ ' v_coord = u_coordMat * vec3(a_coord, 1.0);\n' +
+ '}\n'));
+ decl.pushFragmentSource(new sglrShaderProgram.FragmentSource(
+ '#version 300 es\n' +
+ 'uniform highp ' + gluShaderUtil.getDataTypeName(samplerType) + ' u_sampler0;\n' +
+ 'uniform highp vec4 u_scale;\n' +
+ 'uniform highp vec4 u_bias;\n' +
+ 'in mediump vec3 v_coord;\n' +
+ 'layout(location = 0) out highp ' + gluShaderUtil.getDataTypeName(outputType) + ' o_color;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' o_color = ' + gluShaderUtil.getDataTypeName(outputType) + '(vec4(texture(u_sampler0, v_coord)) * u_scale + u_bias);\n' +
+ '}\n'));
+ sglrShaderProgram.ShaderProgram.call(this, decl);
+ /** @type {Array<number>} */ this.m_texScale = [1.0, 1.0, 1.0, 1.0];
+ /** @type {Array<number>} */ this.m_texBias = [0.0, 0.0, 0.0, 0.0];
+ /** @type {tcuMatrix.Mat3} */ this.m_coordMat;
+ /** @type {gluShaderUtil.DataType} */ this.m_outputType = outputType;
+ };
+
+ es3fFboTestUtil.TextureCubeShader.prototype = Object.create(sglrShaderProgram.ShaderProgram.prototype);
+ es3fFboTestUtil.TextureCubeShader.prototype.constructor = es3fFboTestUtil.TextureCubeShader;
+
+ /**
+ * @param {tcuTexture.CubeFace} face
+ */
+ es3fFboTestUtil.TextureCubeShader.prototype.setFace = function(face) {
+ /** @const {Array<Array<number>>} */ var s_cubeTransforms = [
+ // Face -X: (x, y, 1) -> (-1, -(2*y-1), +(2*x-1))
+ [0, 0, -1,
+ 0, -2, 1,
+ 2, 0, -1],
+ // Face +X: (x, y, 1) -> (+1, -(2*y-1), -(2*x-1))
+ [0, 0, 1,
+ 0, -2, 1,
+ -2, 0, 1],
+ // Face -Y: (x, y, 1) -> (+(2*x-1), -1, -(2*y-1))
+ [2, 0, -1,
+ 0, 0, -1,
+ 0, -2, 1],
+ // Face +Y: (x, y, 1) -> (+(2*x-1), +1, +(2*y-1))
+ [2, 0, -1,
+ 0, 0, 1,
+ 0, 2, -1],
+ // Face -Z: (x, y, 1) -> (-(2*x-1), -(2*y-1), -1)
+ [-2, 0, 1,
+ 0, -2, 1,
+ 0, 0, -1],
+ // Face +Z: (x, y, 1) -> (+(2*x-1), -(2*y-1), +1)
+ [2, 0, -1,
+ 0, -2, 1,
+ 0, 0, 1]];
+ this.m_coordMat = /** @type {tcuMatrix.Mat3} */ (tcuMatrix.matrixFromArray(3, 3, s_cubeTransforms[face]));
+ };
+
+ /**
+ * @param {Array<number>} scale
+ * @param {Array<number>} bias
+ */
+ es3fFboTestUtil.TextureCubeShader.prototype.setTexScaleBias = function(scale, bias) {
+ this.m_texScale = scale;
+ this.m_texBias = bias;
+ };
+
+ /**
+ * @param ctx GL-like context
+ * @param program
+ */
+ es3fFboTestUtil.TextureCubeShader.prototype.setUniforms = function(ctx, program) {
+ ctx.useProgram(program);
+
+ ctx.uniform1i(ctx.getUniformLocation(program, 'u_sampler0'), 0);
+ ctx.uniformMatrix3fv(ctx.getUniformLocation(program, 'u_coordMat'), false, this.m_coordMat.getColumnMajorData());
+ ctx.uniform4fv(ctx.getUniformLocation(program, 'u_scale'), this.m_texScale);
+ ctx.uniform4fv(ctx.getUniformLocation(program, 'u_bias'), this.m_texBias);
+ };
+
+ /**
+ * @param {Array<rrVertexAttrib.VertexAttrib>} inputs
+ * @param {Array<rrVertexPacket.VertexPacket>} packets
+ * @param {number} numPackets
+ */
+ es3fFboTestUtil.TextureCubeShader.prototype.shadeVertices = function(inputs, packets, numPackets) {
+ /** @type {tcuMatrix.Matrix} */ var texCoordMat = tcuMatrix.matrixFromArray(3, 3, this.m_uniforms[0].value);
+
+ for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) {
+ /** @type {rrVertexPacket.VertexPacket} */ var packet = packets[packetNdx];
+ var x = rrVertexAttrib.readVertexAttrib(inputs[1], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT)[0];
+ var y = rrVertexAttrib.readVertexAttrib(inputs[1], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT)[1];
+ /** @type {Array<number>} */ var a_coord = [x, y];
+ /** @type {Array<number>} */ var v_coord = tcuMatrix.multiplyMatVec(texCoordMat, [a_coord[0], a_coord[1], 1.0]);
+
+ packet.position = rrVertexAttrib.readVertexAttrib(inputs[0], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT);
+ packet.outputs[0] = [v_coord[0], v_coord[1], v_coord[2], 0.0];
+ }
+ };
+
+ /**
+ * @param {Array<rrFragmentOperations.Fragment>} packet
+ * @param {rrShadingContext.FragmentShadingContext} context
+ */
+ es3fFboTestUtil.TextureCubeShader.prototype.shadeFragments = function(packet, context) {
+ var numPackets = packet.length;
+ /** @const {Array<number>} */ var texScale = this.m_uniforms[2].value;
+ /** @const {Array<number>} */ var texBias = this.m_uniforms[3].value;
+
+ var texCoords = [];
+ var colors = [];
+
+ for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) {
+ var tex = this.m_uniforms[1].sampler;
+ var ratioX = tex.m_view.getSize() / context.getWidth();
+ var ratioY = tex.m_view.getSize() / context.getHeight();
+ var lod = Math.floor(Math.log2(Math.max(ratioX, ratioY)));
+
+ var coord = rrShadingContext.readTriangleVarying(packet[packetNdx], context, 0);
+ texCoords = [coord[0], coord[1], coord[2]];
+
+ colors = tex.sample(texCoords, lod);
+
+ var color = deMath.add(deMath.multiply(colors, texScale), texBias);
+ var icolor = es3fFboTestUtil.castVectorSaturate(color, tcuTexture.deTypes.deInt32);
+ var uicolor = es3fFboTestUtil.castVectorSaturate(color, tcuTexture.deTypes.deUint32);
+
+ if (this.m_outputType == gluShaderUtil.DataType.FLOAT_VEC4)
+ packet[packetNdx].value = color;
+ else if (this.m_outputType == gluShaderUtil.DataType.INT_VEC4)
+ packet[packetNdx].value = icolor;
+ else if (this.m_outputType == gluShaderUtil.DataType.UINT_VEC4)
+ packet[packetNdx].value = uicolor;
+ }
+ };
+
+ /**
+ * es3fFboTestUtil.Texture2DArrayShader inherits from sglrShaderProgram
+ * @constructor
+ * @extends {sglrShaderProgram.ShaderProgram}
+ * @param {gluShaderUtil.DataType} samplerType
+ * @param {gluShaderUtil.DataType} outputType
+ */
+ es3fFboTestUtil.Texture2DArrayShader = function(samplerType, outputType) {
+ /** @type {sglrShaderProgram.ShaderProgramDeclaration} */
+ var decl = new sglrShaderProgram.ShaderProgramDeclaration();
+ decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_position', rrGenericVector.GenericVecType.FLOAT));
+ decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_coord', rrGenericVector.GenericVecType.FLOAT));
+ decl.pushVertexToFragmentVarying(new sglrShaderProgram.VertexToFragmentVarying(rrGenericVector.GenericVecType.FLOAT));
+ decl.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(es3fFboTestUtil.mapDataTypeToGenericVecType(outputType)));
+ decl.pushUniform(new sglrShaderProgram.Uniform('u_sampler0', samplerType));
+ decl.pushUniform(new sglrShaderProgram.Uniform('u_scale', gluShaderUtil.DataType.FLOAT_VEC4));
+ decl.pushUniform(new sglrShaderProgram.Uniform('u_bias', gluShaderUtil.DataType.FLOAT_VEC4));
+ decl.pushUniform(new sglrShaderProgram.Uniform('u_layer', gluShaderUtil.DataType.INT));
+ decl.pushVertexSource(new sglrShaderProgram.VertexSource(
+ '#version 300 es\n' +
+ 'in highp vec4 a_position;\n' +
+ 'in highp vec2 a_coord;\n' +
+ 'out highp vec2 v_coord;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = a_position;\n' +
+ ' v_coord = a_coord;\n' +
+ '}\n'));
+ decl.pushFragmentSource(new sglrShaderProgram.FragmentSource(
+ '#version 300 es\n' +
+ 'uniform highp ' + gluShaderUtil.getDataTypeName(samplerType) + ' u_sampler0;\n' +
+ 'uniform highp vec4 u_scale;\n' +
+ 'uniform highp vec4 u_bias;\n' +
+ 'uniform highp int u_layer;\n' +
+ 'in highp vec2 v_coord;\n' +
+ 'layout(location = 0) out highp ' + gluShaderUtil.getDataTypeName(outputType) + ' o_color;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' o_color = ' + gluShaderUtil.getDataTypeName(outputType) + '(vec4(texture(u_sampler0, vec3(v_coord, u_layer))) * u_scale + u_bias);\n' +
+ '}\n'));
+ sglrShaderProgram.ShaderProgram.call(this, decl);
+ /** @type {Array<number>} */ this.m_texScale = [1.0, 1.0, 1.0, 1.0];
+ /** @type {Array<number>} */ this.m_texBias = [0.0, 0.0, 0.0, 0.0];
+ /** @type {number} */ this.m_layer = 0;
+ /** @type {gluShaderUtil.DataType} */ this.m_outputType = outputType;
+ };
+
+ es3fFboTestUtil.Texture2DArrayShader.prototype = Object.create(sglrShaderProgram.ShaderProgram.prototype);
+ es3fFboTestUtil.Texture2DArrayShader.prototype.constructor = es3fFboTestUtil.Texture2DArrayShader;
+
+ /**
+ * @param {number} layer
+ */
+ es3fFboTestUtil.Texture2DArrayShader.prototype.setLayer = function(layer) {
+ this.m_layer = layer;
+ };
+ /**
+ * @param {Array<number>} scale
+ * @param {Array<number>} bias
+ */
+ es3fFboTestUtil.Texture2DArrayShader.prototype.setTexScaleBias = function(scale, bias) {
+ this.m_texScale = scale;
+ this.m_texBias = bias;
+ };
+ /**
+ * @param {es3fFboTestUtil.Context} ctx GL-like context
+ * @param program
+ */
+ es3fFboTestUtil.Texture2DArrayShader.prototype.setUniforms = function(ctx, program) {
+ ctx.useProgram(program);
+
+ ctx.uniform1i(ctx.getUniformLocation(program, 'u_sampler0'), 0);
+ ctx.uniform1i(ctx.getUniformLocation(program, 'u_layer'), this.m_layer);
+ ctx.uniform4fv(ctx.getUniformLocation(program, 'u_scale'), this.m_texScale);
+ ctx.uniform4fv(ctx.getUniformLocation(program, 'u_bias'), this.m_texBias);
+ };
+
+ /**
+ * @param {Array<rrVertexAttrib.VertexAttrib>} inputs
+ * @param {Array<rrVertexPacket.VertexPacket>} packets
+ * @param {number} numPackets
+ */
+ es3fFboTestUtil.Texture2DArrayShader.prototype.shadeVertices = function(inputs, packets, numPackets) {
+ for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) {
+ /** @type {rrVertexPacket.VertexPacket} */ var packet = packets[packetNdx];
+
+ packet.position = rrVertexAttrib.readVertexAttrib(inputs[0], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT);
+ packet.outputs[0] = rrVertexAttrib.readVertexAttrib(inputs[1], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT);
+ }
+ };
+
+ /**
+ * @param {Array<rrFragmentOperations.Fragment>} packet
+ * @param {rrShadingContext.FragmentShadingContext} context
+ */
+ es3fFboTestUtil.Texture2DArrayShader.prototype.shadeFragments = function(packet, context) {
+ var numPackets = packet.length;
+ /** @const {Array<number>} */ var texScale = this.m_uniforms[1].value;
+ /** @const {Array<number>} */ var texBias = this.m_uniforms[2].value;
+ /** @const {number} */ var layer = this.m_uniforms[3].value[0];
+
+ var texCoords = [];
+ var colors = [];
+
+ for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) {
+ var tex = this.m_uniforms[0].sampler;
+ var ratioX = tex.m_view.getWidth() / context.getWidth();
+ var ratioY = tex.m_view.getHeight() / context.getHeight();
+ var lod = Math.floor(Math.log2(Math.max(ratioX, ratioY)));
+
+ /** @const {Array<number>} */ var coord = rrShadingContext.readTriangleVarying(packet[packetNdx], context, 0);
+ texCoords = [coord[0], coord[1], layer];
+
+ colors = tex.sample(texCoords, lod);
+
+ /** @const {Array<number>} */ var color = deMath.add(deMath.multiply(colors, texScale), texBias);
+ /** @const {Array<number>} */ var icolor = es3fFboTestUtil.castVectorSaturate(color, tcuTexture.deTypes.deInt32);
+ /** @const {Array<number>} */ var uicolor = es3fFboTestUtil.castVectorSaturate(color, tcuTexture.deTypes.deUint32);
+
+ if (this.m_outputType == gluShaderUtil.DataType.FLOAT_VEC4)
+ packet[packetNdx].value = color;
+ else if (this.m_outputType == gluShaderUtil.DataType.INT_VEC4)
+ packet[packetNdx].value = icolor;
+ else if (this.m_outputType == gluShaderUtil.DataType.UINT_VEC4)
+ packet[packetNdx].value = uicolor;
+ }
+ };
+
+ /**
+ * es3fFboTestUtil.Texture3DShader inherits from sglrShaderProgram
+ * @constructor
+ * @extends {sglrShaderProgram.ShaderProgram}
+ * @param {gluShaderUtil.DataType} samplerType
+ * @param {gluShaderUtil.DataType} outputType
+ */
+ es3fFboTestUtil.Texture3DShader = function(samplerType, outputType) {
+ /** @type {sglrShaderProgram.ShaderProgramDeclaration} */
+ var decl = new sglrShaderProgram.ShaderProgramDeclaration();
+ decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_position', rrGenericVector.GenericVecType.FLOAT));
+ decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_coord', rrGenericVector.GenericVecType.FLOAT));
+ decl.pushVertexToFragmentVarying(new sglrShaderProgram.VertexToFragmentVarying(rrGenericVector.GenericVecType.FLOAT));
+ decl.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(es3fFboTestUtil.mapDataTypeToGenericVecType(outputType)));
+ decl.pushUniform(new sglrShaderProgram.Uniform('u_sampler0', samplerType));
+ decl.pushUniform(new sglrShaderProgram.Uniform('u_scale', gluShaderUtil.DataType.FLOAT_VEC4));
+ decl.pushUniform(new sglrShaderProgram.Uniform('u_bias', gluShaderUtil.DataType.FLOAT_VEC4));
+ decl.pushUniform(new sglrShaderProgram.Uniform('u_depth', gluShaderUtil.DataType.FLOAT));
+ decl.pushVertexSource(new sglrShaderProgram.VertexSource(
+ '#version 300 es\n' +
+ 'in highp vec4 a_position;\n' +
+ 'in highp vec2 a_coord;\n' +
+ 'out highp vec2 v_coord;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = a_position;\n' +
+ ' v_coord = a_coord;\n' +
+ '}\n'));
+ decl.pushFragmentSource(new sglrShaderProgram.FragmentSource(
+ '#version 300 es\n' +
+ 'uniform highp ' + gluShaderUtil.getDataTypeName(samplerType) + ' u_sampler0;\n' +
+ 'uniform highp vec4 u_scale;\n' +
+ 'uniform highp vec4 u_bias;\n' +
+ 'uniform highp float u_depth;\n' +
+ 'in highp vec2 v_coord;\n' +
+ 'layout(location = 0) out highp ' + gluShaderUtil.getDataTypeName(outputType) + ' o_color;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' o_color = ' + gluShaderUtil.getDataTypeName(outputType) + '(vec4(texture(u_sampler0, vec3(v_coord, u_depth))) * u_scale + u_bias);\n' +
+ '}\n'));
+ sglrShaderProgram.ShaderProgram.call(this, decl);
+ /** @type {Array<number>} */ this.m_texScale = [1.0, 1.0, 1.0, 1.0];
+ /** @type {Array<number>} */ this.m_texBias = [0.0, 0.0, 0.0, 0.0];
+ /** @type {number} */ this.m_depth = 0.0;
+ /** @type {gluShaderUtil.DataType} */ this.m_outputType = outputType;
+ };
+
+ es3fFboTestUtil.Texture3DShader.prototype = Object.create(sglrShaderProgram.ShaderProgram.prototype);
+ es3fFboTestUtil.Texture3DShader.prototype.constructor = es3fFboTestUtil.Texture3DShader;
+
+ /**
+ * @param {number} depth
+ */
+ es3fFboTestUtil.Texture3DShader.prototype.setDepth = function(depth) {
+ this.m_depth = depth;
+ };
+
+ /**
+ * @param {Array<number>} scale
+ * @param {Array<number>} bias
+ */
+ es3fFboTestUtil.Texture3DShader.prototype.setTexScaleBias = function(scale, bias) {
+ this.m_texScale = scale;
+ this.m_texBias = bias;
+ };
+
+ /**
+ * @param context GL-like context
+ * @param program
+ */
+ es3fFboTestUtil.Texture3DShader.prototype.setUniforms = function(context, program) {
+ context.useProgram(program);
+ context.uniform1i(context.getUniformLocation(program, 'u_sampler0'), 0);
+ context.uniform1f(context.getUniformLocation(program, 'u_depth'), this.m_depth);
+ context.uniform4fv(context.getUniformLocation(program, 'u_scale'), this.m_texScale);
+ context.uniform4fv(context.getUniformLocation(program, 'u_bias'), this.m_texBias);
+ };
+
+ /**
+ * @param {Array<rrVertexAttrib.VertexAttrib>} inputs
+ * @param {Array<rrVertexPacket.VertexPacket>} packets
+ * @param {number} numPackets
+ */
+ es3fFboTestUtil.Texture3DShader.prototype.shadeVertices = function(inputs, packets, numPackets) {
+ for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) {
+ /** @type {rrVertexPacket.VertexPacket} */ var packet = packets[packetNdx];
+
+ packet.position = rrVertexAttrib.readVertexAttrib(inputs[0], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT);
+ packet.outputs[0] = rrVertexAttrib.readVertexAttrib(inputs[1], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT);
+ }
+ };
+
+ /**
+ * @param {Array<rrFragmentOperations.Fragment>} packet
+ * @param {rrShadingContext.FragmentShadingContext} context
+ */
+ es3fFboTestUtil.Texture3DShader.prototype.shadeFragments = function(packet, context) {
+ var numPackets = packet.length;
+ /** @const {Array<number>} */ var texScale = this.m_uniforms[1].value;
+ /** @const {Array<number>} */ var texBias = this.m_uniforms[2].value;
+ /** @const {number} */ var depth = this.m_uniforms[3].value[0];
+
+ var texCoords = [];
+ var colors = [];
+
+ for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) {
+ var tex = this.m_uniforms[0].sampler;
+ var ratioX = tex.m_view.getWidth() / context.getWidth();
+ var ratioY = tex.m_view.getHeight() / context.getHeight();
+ // TODO: what to do with Z coordinate?
+ var lod = Math.floor(Math.log2(Math.max(ratioX, ratioY)));
+
+ var coord = rrShadingContext.readTriangleVarying(packet[packetNdx], context, 0);
+ texCoords = [coord[0], coord[1], depth];
+
+ colors = tex.sample(texCoords, lod);
+
+ /** @const {Array<number>} */ var color = deMath.add(deMath.multiply(colors, texScale), texBias);
+ /** @const {Array<number>} */ var icolor = es3fFboTestUtil.castVectorSaturate(color, tcuTexture.deTypes.deInt32);
+ /** @const {Array<number>} */ var uicolor = es3fFboTestUtil.castVectorSaturate(color, tcuTexture.deTypes.deUint32);
+
+ if (this.m_outputType == gluShaderUtil.DataType.FLOAT_VEC4)
+ packet[packetNdx].value = color;
+ else if (this.m_outputType == gluShaderUtil.DataType.INT_VEC4)
+ packet[packetNdx].value = icolor;
+ else if (this.m_outputType == gluShaderUtil.DataType.UINT_VEC4)
+ packet[packetNdx].value = uicolor;
+ }
+ };
+
+ /**
+ * es3fFboTestUtil.DepthGradientShader inherits from sglrShaderProgram
+ * @constructor
+ * @extends {sglrShaderProgram.ShaderProgram}
+ * @param {gluShaderUtil.DataType} outputType
+ */
+ es3fFboTestUtil.DepthGradientShader = function(outputType) {
+ /** @type {sglrShaderProgram.ShaderProgramDeclaration} */
+ var decl = new sglrShaderProgram.ShaderProgramDeclaration();
+ decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_position', rrGenericVector.GenericVecType.FLOAT));
+ decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_coord', rrGenericVector.GenericVecType.FLOAT));
+ decl.pushVertexToFragmentVarying(new sglrShaderProgram.VertexToFragmentVarying(rrGenericVector.GenericVecType.FLOAT));
+ decl.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(es3fFboTestUtil.mapDataTypeToGenericVecType(outputType)));
+ decl.pushUniform(new sglrShaderProgram.Uniform('u_maxGradient', gluShaderUtil.DataType.FLOAT));
+ decl.pushUniform(new sglrShaderProgram.Uniform('u_minGradient', gluShaderUtil.DataType.FLOAT));
+ decl.pushUniform(new sglrShaderProgram.Uniform('u_color', gluShaderUtil.DataType.FLOAT_VEC4));
+ decl.pushVertexSource(new sglrShaderProgram.VertexSource(
+ '#version 300 es\n' +
+ 'in highp vec4 a_position;\n' +
+ 'in highp vec4 a_coord;\n' +
+ 'out highp vec4 v_coord;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = a_position;\n' +
+ ' v_coord = a_coord;\n' +
+ '}\n'));
+ decl.pushFragmentSource(new sglrShaderProgram.FragmentSource(
+ '#version 300 es\n' +
+ 'in highp vec4 v_coord;\n' +
+ 'uniform highp float u_minGradient;\n' +
+ 'uniform highp float u_maxGradient;\n' +
+ 'uniform highp vec4 u_color;\n' +
+ 'layout(location = 0) out highp ' + gluShaderUtil.getDataTypeName(outputType) + ' o_color;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' highp float x = v_coord.x;\n' +
+ ' highp float y = v_coord.y;\n' +
+ ' highp float f0 = (x + y) * 0.5;\n' +
+ ' gl_FragDepth = u_minGradient + (u_maxGradient-u_minGradient)*f0;\n' +
+ ' o_color = ' + gluShaderUtil.getDataTypeName(outputType) + '(u_color);\n' +
+ '}\n'));
+ this.m_outputType = outputType;
+ sglrShaderProgram.ShaderProgram.call(this, decl);
+ /** @const {sglrShaderProgram.Uniform} */ this.u_minGradient = this.getUniformByName('u_minGradient');
+ /** @const {sglrShaderProgram.Uniform} */ this.u_maxGradient = this.getUniformByName('u_maxGradient');
+ /** @const {sglrShaderProgram.Uniform} */ this.u_color = this.getUniformByName('u_color');
+ };
+
+ es3fFboTestUtil.DepthGradientShader.prototype = Object.create(sglrShaderProgram.ShaderProgram.prototype);
+ es3fFboTestUtil.DepthGradientShader.prototype.constructor = es3fFboTestUtil.DepthGradientShader;
+
+ /**
+ * @param ctx GL-like context
+ * @param program
+ * @param {number} gradientMin
+ * @param {number} gradientMax
+ * @param {Array<number>} color
+ */
+ es3fFboTestUtil.DepthGradientShader.prototype.setUniforms = function(ctx, program, gradientMin, gradientMax, color) {
+ ctx.useProgram(program);
+ ctx.uniform1fv(ctx.getUniformLocation(program, 'u_minGradient'), [gradientMin]);
+ ctx.uniform1fv(ctx.getUniformLocation(program, 'u_maxGradient'), [gradientMax]);
+ ctx.uniform4fv(ctx.getUniformLocation(program, 'u_color'), color);
+ };
+
+ /**
+ * @param {Array<rrVertexAttrib.VertexAttrib>} inputs
+ * @param {Array<rrVertexPacket.VertexPacket>} packets
+ * @param {number} numPackets
+ */
+ es3fFboTestUtil.DepthGradientShader.prototype.shadeVertices = function(inputs, packets, numPackets) {
+ for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) {
+ /** @type {rrVertexPacket.VertexPacket} */ var packet = packets[packetNdx];
+
+ packet.position = rrVertexAttrib.readVertexAttrib(inputs[0], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT);
+ packet.outputs[0] = rrVertexAttrib.readVertexAttrib(inputs[1], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT);
+ }
+ };
+
+ /**
+ * @param {Array<rrFragmentOperations.Fragment>} packet
+ * @param {rrShadingContext.FragmentShadingContext} context
+ */
+ es3fFboTestUtil.DepthGradientShader.prototype.shadeFragments = function(packet, context) {
+ var numPackets = packet.length;
+ /** @const {number} */ var gradientMin = this.u_minGradient.value[0];
+ /** @const {number} */ var gradientMax = this.u_maxGradient.value[0];
+ /** @type {Array<number>} */ var color = this.u_color.value;
+ /** @type {Array<number>} */ var icolor = es3fFboTestUtil.castVectorSaturate(color, tcuTexture.deTypes.deInt32);
+ /** @type {Array<number>} */ var uicolor = es3fFboTestUtil.castVectorSaturate(color, tcuTexture.deTypes.deUint32);
+
+ for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) {
+ /** @type {Array<number>} */ var coord = rrShadingContext.readTriangleVarying(packet[packetNdx], context, 0);
+ /** @const {number} */ var x = coord[0];
+ /** @const {number} */ var y = coord[1];
+ /** @const {number} */ var f0 = (x + y) * 0.5;
+
+ packet[packetNdx].sampleDepths[0] = gradientMin + (gradientMax - gradientMin) * f0;
+
+ if (this.m_outputType == gluShaderUtil.DataType.FLOAT_VEC4)
+ packet[packetNdx].value = color;
+ else if (this.m_outputType == gluShaderUtil.DataType.INT_VEC4)
+ packet[packetNdx].value = icolor;
+ else if (this.m_outputType == gluShaderUtil.DataType.UINT_VEC4)
+ packet[packetNdx].value = uicolor;
+ }
+ };
+
+ es3fFboTestUtil.getFormatName = function(format) {
+ switch (format) {
+ case gl.RGB565: return 'rgb565';
+ case gl.RGB5_A1: return 'rgb5_a1';
+ case gl.RGBA4: return 'rgba4';
+ case gl.DEPTH_COMPONENT16: return 'depth_component16';
+ case gl.STENCIL_INDEX8: return 'stencil_index8';
+ case gl.RGBA32F: return 'rgba32f';
+ case gl.RGBA32I: return 'rgba32i';
+ case gl.RGBA32UI: return 'rgba32ui';
+ case gl.RGBA16F: return 'rgba16f';
+ case gl.RGBA16I: return 'rgba16i';
+ case gl.RGBA16UI: return 'rgba16ui';
+ case gl.RGBA8: return 'rgba8';
+ case gl.RGBA8I: return 'rgba8i';
+ case gl.RGBA8UI: return 'rgba8ui';
+ case gl.SRGB8_ALPHA8: return 'srgb8_alpha8';
+ case gl.RGB10_A2: return 'rgb10_a2';
+ case gl.RGB10_A2UI: return 'rgb10_a2ui';
+ case gl.RGBA8_SNORM: return 'rgba8_snorm';
+ case gl.RGB8: return 'rgb8';
+ case gl.R11F_G11F_B10F: return 'r11f_g11f_b10f';
+ case gl.RGB32F: return 'rgb32f';
+ case gl.RGB32I: return 'rgb32i';
+ case gl.RGB32UI: return 'rgb32ui';
+ case gl.RGB16F: return 'rgb16f';
+ case gl.RGB16I: return 'rgb16i';
+ case gl.RGB16UI: return 'rgb16ui';
+ case gl.RGB8_SNORM: return 'rgb8_snorm';
+ case gl.RGB8I: return 'rgb8i';
+ case gl.RGB8UI: return 'rgb8ui';
+ case gl.SRGB8: return 'srgb8';
+ case gl.RGB9_E5: return 'rgb9_e5';
+ case gl.RG32F: return 'rg32f';
+ case gl.RG32I: return 'rg32i';
+ case gl.RG32UI: return 'rg32ui';
+ case gl.RG16F: return 'rg16f';
+ case gl.RG16I: return 'rg16i';
+ case gl.RG16UI: return 'rg16ui';
+ case gl.RG8: return 'rg8';
+ case gl.RG8I: return 'rg8i';
+ case gl.RG8UI: return 'rg8ui';
+ case gl.RG8_SNORM: return 'rg8_snorm';
+ case gl.R32F: return 'r32f';
+ case gl.R32I: return 'r32i';
+ case gl.R32UI: return 'r32ui';
+ case gl.R16F: return 'r16f';
+ case gl.R16I: return 'r16i';
+ case gl.R16UI: return 'r16ui';
+ case gl.R8: return 'r8';
+ case gl.R8I: return 'r8i';
+ case gl.R8UI: return 'r8ui';
+ case gl.R8_SNORM: return 'r8_snorm';
+ case gl.DEPTH_COMPONENT32F: return 'depth_component32f';
+ case gl.DEPTH_COMPONENT24: return 'depth_component24';
+ case gl.DEPTH32F_STENCIL8: return 'depth32f_stencil8';
+ case gl.DEPTH24_STENCIL8: return 'depth24_stencil8';
+
+ default:
+ throw new Error('Unknown format in getFromatName()');
+ }
+ };
+
+ /**
+ * @param {tcuTexture.TextureFormat} format
+ * @return {gluShaderUtil.DataType}
+ */
+ es3fFboTestUtil.getFragmentOutputType = function(format) {
+ switch (tcuTexture.getTextureChannelClass(format.type)) {
+ case tcuTexture.TextureChannelClass.FLOATING_POINT:
+ case tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT:
+ case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT:
+ return gluShaderUtil.DataType.FLOAT_VEC4;
+
+ case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER:
+ return gluShaderUtil.DataType.UINT_VEC4;
+
+ case tcuTexture.TextureChannelClass.SIGNED_INTEGER:
+ return gluShaderUtil.DataType.INT_VEC4;
+
+ default:
+ throw new Error('Unknown format');
+ }
+ };
+
+ /**
+ * @param {tcuTexture.TextureFormat} format
+ * @return {tcuTexture.TextureFormat}
+ */
+ es3fFboTestUtil.getFramebufferReadFormat = function(format) {
+ switch (tcuTexture.getTextureChannelClass(format.type)) {
+ case tcuTexture.TextureChannelClass.FLOATING_POINT:
+ return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.FLOAT);
+
+ case tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT:
+ case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT:
+ return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8);
+
+ case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER:
+ return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNSIGNED_INT32);
+
+ case tcuTexture.TextureChannelClass.SIGNED_INTEGER:
+ return new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.SIGNED_INT32);
+
+ default:
+ throw new Error('Unknown format in es3fFboTestUtil.getFramebufferReadFormat()');
+ }
+ };
+
+ /**
+ * @param {es3fFboTestUtil.Context} ctx GL-like context
+ * @param {tcuTexture.TextureFormat} format
+ * @param {Array<number>} value
+ */
+ es3fFboTestUtil.clearColorBuffer = function(ctx, format, value) {
+ /** @const @type {tcuTexture.TextureChannelClass} */
+ var fmtClass = tcuTexture.getTextureChannelClass(format.type);
+
+ switch (fmtClass) {
+ case tcuTexture.TextureChannelClass.FLOATING_POINT:
+ case tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT:
+ case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT:
+ ctx.clearBufferfv(gl.COLOR, 0, value);
+ break;
+
+ case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER:
+ ctx.clearBufferuiv(gl.COLOR, 0, value);
+ break;
+
+ case tcuTexture.TextureChannelClass.SIGNED_INTEGER:
+ ctx.clearBufferiv(gl.COLOR, 0, value);
+ break;
+
+ default:
+ throw new Error('Invalid channel class: ' + fmtClass);
+ }
+ };
+
+ /**
+ * @param {tcuTexture.TextureFormat} format
+ * @return {tcuRGBA.RGBA}
+ */
+ es3fFboTestUtil.getThresholdFromTextureFormat = function(format) {
+ /** @const @type {Array<number>} */ var bits = tcuTextureUtil.getTextureFormatMantissaBitDepth(format);
+ return tcuRGBA.newRGBAComponents(
+ es3fFboTestUtil.calculateU8ConversionError(bits[0]),
+ es3fFboTestUtil.calculateU8ConversionError(bits[1]),
+ es3fFboTestUtil.calculateU8ConversionError(bits[2]),
+ es3fFboTestUtil.calculateU8ConversionError(bits[3])
+ );
+ };
+
+ /**
+ * @param {number} glFormat
+ * @return {tcuRGBA.RGBA}
+ */
+ es3fFboTestUtil.getFormatThreshold = function(glFormat) {
+ /** @const @type {tcuTexture.TextureFormat} */ var format = gluTextureUtil.mapGLInternalFormat(glFormat);
+ return es3fFboTestUtil.getThresholdFromTextureFormat(format);
+ };
+
+ /**
+ * @param {number} srcBits
+ * @return {number}
+ */
+ es3fFboTestUtil.getToSRGB8ConversionError = function(srcBits) {
+ // \note These are pre-computed based on simulation results.
+ /** @const @type {Array<number>} */ var errors = [
+ 1, // 0 bits - rounding
+ 255, // 1 bits
+ 157, // 2 bits
+ 106, // 3 bits
+ 74, // 4 bits
+ 51, // 5 bits
+ 34, // 6 bits
+ 22, // 7 bits
+ 13, // 8 bits
+ 7, // 9 bits
+ 4, // 10 bits
+ 3, // 11 bits
+ 2 // 12 bits
+ // 1 from this on
+ ];
+
+ DE_ASSERT(srcBits >= 0);
+ if (srcBits < errors.length)
+ return errors[srcBits];
+ else
+ return 1;
+ };
+
+ /**
+ * @param {tcuTexture.TextureFormat} src
+ * @param {tcuTexture.TextureFormat} dst
+ * @return {tcuRGBA.RGBA}
+ */
+ es3fFboTestUtil.getToSRGBConversionThreshold = function(src, dst) {
+ // Only SRGB8 and SRGB8_ALPHA8 formats are supported.
+ DE_ASSERT(dst.type == tcuTexture.ChannelType.UNORM_INT8);
+ DE_ASSERT(dst.order == tcuTexture.ChannelOrder.sRGB || dst.order == tcuTexture.ChannelOrder.sRGBA);
+
+ /** @const @type {Array<number>} */ var bits = tcuTextureUtil.getTextureFormatMantissaBitDepth(src);
+ /** @const @type {boolean} */ var dstHasAlpha = dst.order == tcuTexture.ChannelOrder.sRGBA;
+
+ return tcuRGBA.newRGBAComponents(
+ es3fFboTestUtil.getToSRGB8ConversionError(bits[0]),
+ es3fFboTestUtil.getToSRGB8ConversionError(bits[1]),
+ es3fFboTestUtil.getToSRGB8ConversionError(bits[2]),
+ dstHasAlpha ? es3fFboTestUtil.calculateU8ConversionError(bits[3]) : 0);
+ };
+
+ /**
+ * es3fFboTestUtil.readPixels()
+ * @param {(WebGL2RenderingContext|sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext)} ctx
+ * @param {tcuSurface.Surface} dst
+ * @param {number} x
+ * @param {number} y
+ * @param {number} width
+ * @param {number} height
+ * @param {tcuTexture.TextureFormat} format
+ * @param {Array<number>} scale
+ * @param {Array<number>} bias
+ */
+ es3fFboTestUtil.readPixels = function(ctx, dst, x, y, width, height, format, scale, bias) {
+ /** @type {tcuTexture.TextureFormat} */ var readFormat = es3fFboTestUtil.getFramebufferReadFormat(format);
+ /** @type {gluTextureUtil.TransferFormat} */ var transferFmt = gluTextureUtil.getTransferFormat(readFormat);
+ /** @type {number} */ var alignment = 4; // \note gl.PACK_ALIGNMENT = 4 is assumed.
+ /** @type {number} */ var rowSize = deMath.deAlign32(readFormat.getPixelSize() * width, alignment);
+ var typedArrayType = tcuTexture.getTypedArray(readFormat.type);
+ var data = new typedArrayType(rowSize * height);
+ ctx.readPixels(x, y, width, height, transferFmt.format, transferFmt.dataType, data);
+
+ // Convert to surface.
+ var cpbaDescriptor = {
+ format: readFormat,
+ width: width,
+ height: height,
+ depth: 1,
+ rowPitch: rowSize,
+ slicePitch: 0,
+ data: data.buffer
+ };
+
+ /** @type {tcuTexture.ConstPixelBufferAccess} */
+ var src = new tcuTexture.ConstPixelBufferAccess(cpbaDescriptor);
+
+ dst.setSize(width, height);
+ /** @type {tcuTexture.PixelBufferAccess} */ var dstAccess = dst.getAccess();
+
+ for (var yo = 0; yo < height; yo++)
+ for (var xo = 0; xo < width; xo++)
+ dstAccess.setPixel(deMath.add(deMath.multiply(src.getPixel(xo, yo), scale), bias), xo, yo);
+ };
+
+ /**
+ * @param {number} srcBits
+ * @return {number}
+ */
+ es3fFboTestUtil.calculateU8ConversionError = function(srcBits) {
+ if (srcBits > 0) {
+ /** @const @type {number} */ var clampedBits = deMath.clamp(srcBits, 0, 8);
+ /** @const @type {number} */ var srcMaxValue = Math.max((1 << clampedBits) - 1, 1);
+ /** @const @type {number} */ var error = Math.floor(Math.ceil(255.0 * 2.0 / srcMaxValue));
+
+ return deMath.clamp(error, 0, 255);
+ } else
+ return 1;
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFloatStateQueryTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFloatStateQueryTests.js
new file mode 100644
index 0000000000..6b5431061e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFloatStateQueryTests.js
@@ -0,0 +1,431 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fFloatStateQueryTests');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('functional.gles3.es3fApiCase');
+goog.require('modules.shared.glsStateQuery');
+
+goog.scope(function() {
+ var es3fFloatStateQueryTests = functional.gles3.es3fFloatStateQueryTests;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var deRandom = framework.delibs.debase.deRandom;
+ var deMath = framework.delibs.debase.deMath;
+ var es3fApiCase = functional.gles3.es3fApiCase;
+ var glsStateQuery = modules.shared.glsStateQuery;
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fFloatStateQueryTests.DepthRangeCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fFloatStateQueryTests.DepthRangeCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fFloatStateQueryTests.DepthRangeCase.prototype.constructor = es3fFloatStateQueryTests.DepthRangeCase;
+
+ es3fFloatStateQueryTests.DepthRangeCase.prototype.test = function() {
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef);
+
+ this.check(glsStateQuery.verify(gl.DEPTH_RANGE, new Float32Array([0.0, 1.0])));
+
+ /** @type {Array<Float32Array>} */ var fixedTests = [
+ new Float32Array([0.5, 1.0]),
+ new Float32Array([0.0, 0.5]),
+ new Float32Array([0.0, 0.0]),
+ new Float32Array([1.0, 1.0])
+ ];
+
+ for (var ndx = 0; ndx < fixedTests.length; ++ndx) {
+ gl.depthRange(fixedTests[ndx][0], fixedTests[ndx][1]);
+ this.check(glsStateQuery.verify(gl.DEPTH_RANGE, fixedTests[ndx]));
+ }
+
+ /** @type {number} */ var numIterations = 120;
+ for (var i = 0; i < numIterations; ++i) {
+ // [dag] sorting to keep zNear < zFar
+ /** @type {Array<number>} */ var values = [rnd.getFloat(0, 1), rnd.getFloat(0, 1)].sort();
+ /** @type {Float32Array} */ var depth = new Float32Array(values);
+ gl.depthRange(depth[0], depth[1]);
+ this.check(glsStateQuery.verify(gl.DEPTH_RANGE, depth));
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fFloatStateQueryTests.LineWidthCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fFloatStateQueryTests.LineWidthCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fFloatStateQueryTests.LineWidthCase.prototype.constructor = es3fFloatStateQueryTests.LineWidthCase;
+
+ es3fFloatStateQueryTests.LineWidthCase.prototype.test = function() {
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef);
+
+ this.check(glsStateQuery.verify(gl.LINE_WIDTH, 1.0));
+
+ /** @type {Float32Array} */ var range = /** @type {Float32Array} */ (gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE));
+
+ /** @type {number} */ var numIterations = 120;
+ for (var i = 0; i < numIterations; ++i) {
+ /** @type {number} */ var reference = rnd.getFloat(range[0], range[1]);
+
+ gl.lineWidth(reference);
+ this.check(glsStateQuery.verify(gl.LINE_WIDTH, reference));
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fFloatStateQueryTests.PolygonOffsetFactorCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fFloatStateQueryTests.PolygonOffsetFactorCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fFloatStateQueryTests.PolygonOffsetFactorCase.prototype.constructor = es3fFloatStateQueryTests.PolygonOffsetFactorCase;
+
+ es3fFloatStateQueryTests.PolygonOffsetFactorCase.prototype.test = function() {
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef);
+
+ this.check(glsStateQuery.verify(gl.POLYGON_OFFSET_FACTOR, 0.0));
+
+ /** @type {Array<number>} */ var fixedTests = [0.0, 0.5, -0.5, 1.5];
+
+ for (var ndx = 0; ndx < fixedTests.length; ++ndx) {
+ gl.polygonOffset(fixedTests[ndx], 0);
+ this.check(glsStateQuery.verify(gl.POLYGON_OFFSET_FACTOR, fixedTests[ndx]));
+ }
+
+ /** @type {number} */ var numIterations = 120;
+ for (var i = 0; i < numIterations; ++i) {
+ /** @type {number} */ var reference = rnd.getFloat(-64000, 64000);
+
+ gl.polygonOffset(reference, 0);
+ this.check(glsStateQuery.verify(gl.POLYGON_OFFSET_FACTOR, reference));
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fFloatStateQueryTests.PolygonOffsetUnitsCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fFloatStateQueryTests.PolygonOffsetUnitsCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fFloatStateQueryTests.PolygonOffsetUnitsCase.prototype.constructor = es3fFloatStateQueryTests.PolygonOffsetUnitsCase;
+
+ es3fFloatStateQueryTests.PolygonOffsetUnitsCase.prototype.test = function() {
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef);
+
+ this.check(glsStateQuery.verify(gl.POLYGON_OFFSET_UNITS, 0.0));
+
+ /** @type {Array<number>} */ var fixedTests = [0.0, 0.5, -0.5, 1.5];
+
+ for (var ndx = 0; ndx < fixedTests.length; ++ndx) {
+ gl.polygonOffset(0, fixedTests[ndx]);
+ this.check(glsStateQuery.verify(gl.POLYGON_OFFSET_UNITS, fixedTests[ndx]));
+ }
+
+ /** @type {number} */ var numIterations = 120;
+ for (var i = 0; i < numIterations; ++i) {
+ /** @type {number} */ var reference = rnd.getFloat(-64000, 64000);
+
+ gl.polygonOffset(0, reference);
+ this.check(glsStateQuery.verify(gl.POLYGON_OFFSET_UNITS, reference));
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fFloatStateQueryTests.SampleCoverageCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fFloatStateQueryTests.SampleCoverageCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fFloatStateQueryTests.SampleCoverageCase.prototype.constructor = es3fFloatStateQueryTests.SampleCoverageCase;
+
+ es3fFloatStateQueryTests.SampleCoverageCase.prototype.test = function() {
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef);
+
+ this.check(glsStateQuery.verify(gl.SAMPLE_COVERAGE_VALUE, 1.0));
+
+ /** @type {Array<number>} */ var fixedTests = [0.0, 0.5, 0.45, 0.55];
+
+ for (var ndx = 0; ndx < fixedTests.length; ++ndx) {
+ gl.sampleCoverage(fixedTests[ndx], false);
+ this.check(glsStateQuery.verify(gl.SAMPLE_COVERAGE_VALUE, fixedTests[ndx]));
+ }
+
+ /** @type {Array<number>} */ var clampTests = [-1.0, -1.5, 1.45, 3.55];
+
+ for (var ndx = 0; ndx < clampTests.length; ++ndx) {
+ gl.sampleCoverage(clampTests[ndx], false);
+ this.check(glsStateQuery.verify(gl.SAMPLE_COVERAGE_VALUE, deMath.clamp(clampTests[ndx], 0.0, 1.0)));
+ }
+
+ /** @type {number} */ var numIterations = 120;
+ for (var i = 0; i < numIterations; ++i) {
+ /** @type {number} */ var reference = rnd.getFloat(0, 1);
+ /** @type {boolean} */ var invert = rnd.getBool() ? true : false;
+
+ gl.sampleCoverage(reference, invert);
+ this.check(glsStateQuery.verify(gl.SAMPLE_COVERAGE_VALUE, reference));
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fFloatStateQueryTests.BlendColorCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fFloatStateQueryTests.BlendColorCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fFloatStateQueryTests.BlendColorCase.prototype.constructor = es3fFloatStateQueryTests.BlendColorCase;
+
+ es3fFloatStateQueryTests.BlendColorCase.prototype.test = function() {
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef);
+
+ this.check(glsStateQuery.verify(gl.BLEND_COLOR, new Float32Array([0, 0, 0, 0])));
+
+ /** @type {Array<Float32Array>} */ var fixedTests = [
+ new Float32Array([0.5, 1.0, 0.5, 1.0]),
+ new Float32Array([0.0, 0.5, 0.0, 0.5]),
+ new Float32Array([0.0, 0.0, 0.0, 0.0]),
+ new Float32Array([1.0, 1.0, 1.0, 1.0])
+ ];
+ for (var ndx = 0; ndx < fixedTests.length; ++ndx) {
+ gl.blendColor(fixedTests[ndx][0], fixedTests[ndx][1], fixedTests[ndx][2], fixedTests[ndx][3]);
+ this.check(glsStateQuery.verify(gl.BLEND_COLOR, fixedTests[ndx]));
+ }
+
+ /** @type {number} */ var numIterations = 120;
+ for (var i = 0; i < numIterations; ++i) {
+ /** @type {number} */ var r = rnd.getFloat(0, 1);
+ /** @type {number} */ var g = rnd.getFloat(0, 1);
+ /** @type {number} */ var b = rnd.getFloat(0, 1);
+ /** @type {number} */ var a = rnd.getFloat(0, 1);
+
+ gl.blendColor(r, g, b, a);
+ this.check(glsStateQuery.verify(gl.BLEND_COLOR, new Float32Array([r, g, b, a])));
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fFloatStateQueryTests.ColorClearCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fFloatStateQueryTests.ColorClearCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fFloatStateQueryTests.ColorClearCase.prototype.constructor = es3fFloatStateQueryTests.ColorClearCase;
+
+ es3fFloatStateQueryTests.ColorClearCase.prototype.test = function() {
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef);
+
+ // [dag] In the C++ dEQP code, initial color clear value check is temorarily removed. (until the framework does not alter it)
+ this.check(glsStateQuery.verify(gl.COLOR_CLEAR_VALUE, new Float32Array([0, 0, 0, 0])));
+
+ /** @type {Array<Float32Array>} */ var fixedTests = [
+ new Float32Array([0.5, 1.0, 0.5, 1.0]),
+ new Float32Array([0.0, 0.5, 0.0, 0.5]),
+ new Float32Array([0.0, 0.0, 0.0, 0.0]),
+ new Float32Array([1.0, 1.0, 1.0, 1.0])
+ ];
+ for (var ndx = 0; ndx < fixedTests.length; ++ndx) {
+ gl.clearColor(fixedTests[ndx][0], fixedTests[ndx][1], fixedTests[ndx][2], fixedTests[ndx][3]);
+ this.check(glsStateQuery.verify(gl.COLOR_CLEAR_VALUE, fixedTests[ndx]));
+ }
+
+ /** @type {number} */ var numIterations = 120;
+ for (var i = 0; i < numIterations; ++i) {
+ /** @type {number} */ var r = rnd.getFloat(0, 1);
+ /** @type {number} */ var g = rnd.getFloat(0, 1);
+ /** @type {number} */ var b = rnd.getFloat(0, 1);
+ /** @type {number} */ var a = rnd.getFloat(0, 1);
+
+ gl.clearColor(r, g, b, a);
+ this.check(glsStateQuery.verify(gl.COLOR_CLEAR_VALUE, new Float32Array([r, g, b, a])));
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fFloatStateQueryTests.DepthClearCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fFloatStateQueryTests.DepthClearCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fFloatStateQueryTests.DepthClearCase.prototype.constructor = es3fFloatStateQueryTests.DepthClearCase;
+
+ es3fFloatStateQueryTests.DepthClearCase.prototype.test = function() {
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef);
+
+ this.check(glsStateQuery.verify(gl.DEPTH_CLEAR_VALUE, 1));
+
+ /** @type {number} */ var numIterations = 120;
+ for (var i = 0; i < numIterations; ++i) {
+ /** @type {number} */ var ref = rnd.getFloat(0, 1);
+
+ gl.clearDepth(ref);
+ this.check(glsStateQuery.verify(gl.DEPTH_CLEAR_VALUE, ref));
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fFloatStateQueryTests.MaxTextureLODBiasCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fFloatStateQueryTests.MaxTextureLODBiasCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fFloatStateQueryTests.MaxTextureLODBiasCase.prototype.constructor = es3fFloatStateQueryTests.MaxTextureLODBiasCase;
+
+ es3fFloatStateQueryTests.MaxTextureLODBiasCase.prototype.test = function() {
+ this.check(glsStateQuery.verifyGreaterOrEqual(gl.MAX_TEXTURE_LOD_BIAS, 2.0));
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fFloatStateQueryTests.AliasedPointSizeRangeCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fFloatStateQueryTests.AliasedPointSizeRangeCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fFloatStateQueryTests.AliasedPointSizeRangeCase.prototype.constructor = es3fFloatStateQueryTests.AliasedPointSizeRangeCase;
+
+ es3fFloatStateQueryTests.AliasedPointSizeRangeCase.prototype.test = function() {
+ var pointSizeRange = /** @type {Float32Array} */ (gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE));
+ /** @type {Float32Array} */ var reference = new Float32Array([1, 1]);
+ this.check(pointSizeRange[0] <= reference[0] && pointSizeRange[1] >= reference[1]);
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fFloatStateQueryTests.AliasedLineWidthRangeCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fFloatStateQueryTests.AliasedLineWidthRangeCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fFloatStateQueryTests.AliasedLineWidthRangeCase.prototype.constructor = es3fFloatStateQueryTests.AliasedLineWidthRangeCase;
+
+ es3fFloatStateQueryTests.AliasedLineWidthRangeCase.prototype.test = function() {
+ var lineWidthRange = /** @type {Float32Array} */ (gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE));
+ /** @type {Float32Array} */ var reference = new Float32Array([1, 1]);
+ this.check(lineWidthRange[0] <= reference[0] && lineWidthRange[1] >= reference[1]);
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fFloatStateQueryTests.FloatStateQueryTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'floats', 'Float Values');
+ };
+
+ es3fFloatStateQueryTests.FloatStateQueryTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fFloatStateQueryTests.FloatStateQueryTests.prototype.constructor = es3fFloatStateQueryTests.FloatStateQueryTests;
+
+ es3fFloatStateQueryTests.FloatStateQueryTests.prototype.init = function() {
+ this.addChild(new es3fFloatStateQueryTests.DepthRangeCase('depth_range', 'DEPTH_RANGE'));
+ this.addChild(new es3fFloatStateQueryTests.LineWidthCase('line_width', 'LINE_WIDTH'));
+ this.addChild(new es3fFloatStateQueryTests.PolygonOffsetFactorCase('polygon_offset_factor', 'POLYGON_OFFSET_FACTOR'));
+ this.addChild(new es3fFloatStateQueryTests.PolygonOffsetUnitsCase('polygon_offset_units', 'POLYGON_OFFSET_UNITS'));
+ this.addChild(new es3fFloatStateQueryTests.SampleCoverageCase('sample_coverage_value', 'SAMPLE_COVERAGE_VALUE'));
+ this.addChild(new es3fFloatStateQueryTests.BlendColorCase('blend_color', 'BLEND_COLOR'));
+ this.addChild(new es3fFloatStateQueryTests.ColorClearCase('color_clear_value', 'COLOR_CLEAR_VALUE'));
+ this.addChild(new es3fFloatStateQueryTests.DepthClearCase('depth_clear_value', 'DEPTH_CLEAR_VALUE'));
+ this.addChild(new es3fFloatStateQueryTests.MaxTextureLODBiasCase('max_texture_lod_bias', 'MAX_TEXTURE_LOD_BIAS'));
+ this.addChild(new es3fFloatStateQueryTests.AliasedPointSizeRangeCase('aliased_point_size_range', 'ALIASED_POINT_SIZE_RANGE'));
+ this.addChild(new es3fFloatStateQueryTests.AliasedLineWidthRangeCase('aliased_line_width_range', 'ALIASED_LINE_WIDTH_RANGE'));
+
+ };
+
+ /**
+ * Run test
+ * @param {WebGL2RenderingContext} context
+ */
+ es3fFloatStateQueryTests.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fFloatStateQueryTests.FloatStateQueryTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fFloatStateQueryTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFragDepthTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFragDepthTests.js
new file mode 100644
index 0000000000..8a892a0926
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFragDepthTests.js
@@ -0,0 +1,593 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fFragDepthTests');
+goog.require('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuRGBA');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('framework.opengl.gluDrawUtil');
+goog.require('modules.shared.glsShaderRenderCase');
+
+goog.scope(function() {
+ var es3fFragDepthTests = functional.gles3.es3fFragDepthTests;
+ var deMath = framework.delibs.debase.deMath;
+ var deRandom = framework.delibs.debase.deRandom;
+ var deString = framework.delibs.debase.deString;
+ var glsShaderRenderCase = modules.shared.glsShaderRenderCase;
+ var gluShaderProgram = framework.opengl.gluShaderProgram;
+ var gluDrawUtil = framework.opengl.gluDrawUtil;
+ var tcuImageCompare = framework.common.tcuImageCompare;
+ var tcuRGBA = framework.common.tcuRGBA;
+ var tcuSurface = framework.common.tcuSurface;
+ var tcuTestCase = framework.common.tcuTestCase;
+ /** @typedef {function(Array<number>):number} */ es3fFragDepthTests.EvalFragDepthFunc;
+
+ /** @const {string} */ es3fFragDepthTests.s_vertexShaderSrc = '' +
+ '#version 300 es\n' +
+ 'in highp vec4 a_position;\n' +
+ 'in highp vec2 a_coord;\n' +
+ 'out highp vec2 v_coord;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = a_position;\n' +
+ ' v_coord = a_coord;\n' +
+ '}\n';
+
+ /** @const {string} */ es3fFragDepthTests.s_defaultFragmentShaderSrc = '' +
+ '#version 300 es\n' +
+ 'uniform highp vec4 u_color;\n' +
+ 'layout(location = 0) out mediump vec4 o_color;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' o_color = u_color;\n' +
+ '}\n';
+
+ /**
+ * @param {number} func
+ * @param {*} a
+ * @param {*} b
+ * @return {boolean}
+ */
+ es3fFragDepthTests.compare = function(func, a, b) {
+ switch (func) {
+ case gl.NEVER: return false;
+ case gl.ALWAYS: return true;
+ case gl.LESS: return a < b;
+ case gl.LEQUAL: return a <= b;
+ case gl.EQUAL: return a === b;
+ case gl.NOTEQUAL: return a !== b;
+ case gl.GEQUAL: return a >= b;
+ case gl.GREATER: return a > b;
+ }
+ bufferedLogToConsole('Compare function not supported.');
+ return false;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} desc
+ * @param {string} fragSrc
+ * @param {?es3fFragDepthTests.EvalFragDepthFunc} evalFunc
+ * @param {number} compareFunc
+ */
+ es3fFragDepthTests.FragDepthCompareCase = function(name, desc, fragSrc, evalFunc, compareFunc) {
+ tcuTestCase.DeqpTest.call(this, name, desc);
+ /** @type {string} */ this.m_fragSrc = fragSrc;
+ /** @type {?es3fFragDepthTests.EvalFragDepthFunc} */ this.m_evalFunc = evalFunc;
+ /** @type {number} */ this.m_compareFunc = compareFunc;
+ };
+
+ es3fFragDepthTests.FragDepthCompareCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fFragDepthTests.FragDepthCompareCase.prototype.constructor = es3fFragDepthTests.FragDepthCompareCase;
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fFragDepthTests.FragDepthCompareCase.prototype.iterate = function() {
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name));
+ /** @type {number} */ var viewportW = Math.min(128, gl.drawingBufferWidth);
+ /** @type {number} */ var viewportH = Math.min(128, gl.drawingBufferHeight);
+ /** @type {number} */ var viewportX = rnd.getInt(0, gl.drawingBufferWidth - viewportW);
+ /** @type {number} */ var viewportY = rnd.getInt(0, gl.drawingBufferHeight - viewportH);
+ /** @type {tcuSurface.Surface} */ var renderedFrame = new tcuSurface.Surface(viewportW, viewportH);
+ /** @type {tcuSurface.Surface} */ var referenceFrame = new tcuSurface.Surface(viewportW, viewportH);
+ /** @type {number} */ var constDepth = 0.1;
+ var depthBits = /** @type {number} */ (gl.getParameter(gl.DEPTH_BITS));
+
+ /** @type {number} */ var xf;
+ /** @type {number} */ var d;
+ /** @type {boolean} */ var dpass;
+
+ if (depthBits == 0)
+ throw new Error('Depth buffer is required');
+
+ gl.depthMask(true);
+ gl.viewport(viewportX, viewportY, viewportW, viewportH);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+ gl.enable(gl.DEPTH_TEST);
+
+ /** @type {Array<number>} */ var quadIndices = [0, 1, 2, 2, 1, 3];
+
+ // Fill viewport with 2 quads - one with constant depth and another with d = [-1..1]
+ /** @type {gluShaderProgram.ShaderProgram} */
+ var basicQuadProgram = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(es3fFragDepthTests.s_vertexShaderSrc, es3fFragDepthTests.s_defaultFragmentShaderSrc));
+
+ if (!basicQuadProgram.isOk()) {
+ bufferedLogToConsole(basicQuadProgram.getProgramInfo().infoLog);
+ throw new Error('Compile failed');
+ }
+
+ /** @type {Array<number>} */ var constDepthCoord = [
+ -1.0, -1.0, constDepth, 1.0,
+ -1.0, 1.0, constDepth, 1.0,
+ 0.0, -1.0, constDepth, 1.0,
+ 0.0, 1.0, constDepth, 1.0
+ ];
+
+ /** @type {Array<number>} */ var varyingDepthCoord = [
+ 0.0, -1.0, 1.0, 1.0,
+ 0.0, 1.0, 0.0, 1.0,
+ 1.0, -1.0, 0.0, 1.0,
+ 1.0, 1.0, -1.0, 1.0
+ ];
+
+ gl.useProgram(basicQuadProgram.getProgram());
+ gl.uniform4f(gl.getUniformLocation(basicQuadProgram.getProgram(), 'u_color'), 0.0, 0.0, 1.0, 1.0);
+ gl.depthFunc(gl.ALWAYS);
+
+ /** @type {gluDrawUtil.VertexArrayBinding} */ var posBinding = gluDrawUtil.newFloatVertexArrayBinding('a_position', 4, 4, 0, constDepthCoord);
+ gluDrawUtil.draw(gl, basicQuadProgram.getProgram(), [posBinding], gluDrawUtil.triangles(quadIndices));
+
+ posBinding = gluDrawUtil.newFloatVertexArrayBinding('a_position', 4, 4, 0, varyingDepthCoord);
+ gluDrawUtil.draw(gl, basicQuadProgram.getProgram(), [posBinding], gluDrawUtil.triangles(quadIndices));
+
+ // Render with depth test.
+ /** @type {gluShaderProgram.ShaderProgram} */
+ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(es3fFragDepthTests.s_vertexShaderSrc, this.m_fragSrc));
+ bufferedLogToConsole(program.getProgramInfo().infoLog);
+
+ if (!program.isOk())
+ throw new Error('Compile failed');
+
+ /** @type {Array<number>} */ var coord = [
+ 0.0, 0.0,
+ 0.0, 1.0,
+ 1.0, 0.0,
+ 1.0, 1.0
+ ];
+
+ /** @type {Array<number>} */ var position = [
+ -1.0, -1.0, 1.0, 1.0,
+ -1.0, 1.0, 0.0, 1.0,
+ 1.0, -1.0, 0.0, 1.0,
+ 1.0, 1.0, -1.0, 1.0
+ ];
+
+ gl.useProgram(program.getProgram());
+ gl.depthFunc(this.m_compareFunc);
+ gl.uniform4f(gl.getUniformLocation(program.getProgram(), 'u_color'), 0.0, 1.0, 0.0, 1.0);
+
+ // Setup default helper uniforms.
+ glsShaderRenderCase.setupDefaultUniforms(program.getProgram());
+
+ /** @type {Array<gluDrawUtil.VertexArrayBinding>} */ var vertexArrays = [
+ gluDrawUtil.newFloatVertexArrayBinding('a_position', 4, 4, 0, position),
+ gluDrawUtil.newFloatVertexArrayBinding('a_coord', 2, 4, 0, coord)
+ ];
+
+ gluDrawUtil.draw(gl, program.getProgram(), vertexArrays, gluDrawUtil.triangles(quadIndices));
+
+ renderedFrame.readViewport(gl, [viewportX, viewportY, viewportW, viewportH]);
+
+ // Render reference.
+ for (var y = 0; y < referenceFrame.getHeight(); y++) {
+ /** @type {number} */ var yf = (y + 0.5) / referenceFrame.getHeight();
+ /** @type {number} */ var half = deMath.clamp(Math.floor(referenceFrame.getWidth() * 0.5 + 0.5), 0, referenceFrame.getWidth());
+
+ // Fill left half - comparison to constant 0.5
+ for (var x = 0; x < half; x++) {
+ xf = (x + 0.5) / referenceFrame.getWidth();
+ d = this.m_evalFunc([xf, yf]);
+ dpass = es3fFragDepthTests.compare(this.m_compareFunc, d, constDepth * 0.5 + 0.5);
+
+ referenceFrame.setPixel(x, y, dpass ? tcuRGBA.RGBA.green.toIVec() : tcuRGBA.RGBA.blue.toIVec());
+ }
+
+ // Fill right half - comparison to interpolated depth
+ for (var x = half; x < referenceFrame.getWidth(); x++) {
+ xf = (x + 0.5) / referenceFrame.getWidth();
+ /** @type {number} */ var xh = (x - half + 0.5) / (referenceFrame.getWidth() - half);
+ /** @type {number} */ var rd = 1.0 - (xh + yf) * 0.5;
+ d = this.m_evalFunc([xf, yf]);
+ dpass = es3fFragDepthTests.compare(this.m_compareFunc, d, rd);
+
+ referenceFrame.setPixel(x, y, dpass ? tcuRGBA.RGBA.green.toIVec() : tcuRGBA.RGBA.blue.toIVec());
+ }
+ }
+
+ /** @type {boolean} */ var isOk = tcuImageCompare.fuzzyCompare('Result', 'Image comparison result', referenceFrame.getAccess(), renderedFrame.getAccess(), 0.05);
+
+ if (!isOk)
+ testFailedOptions('Fail', false);
+ else
+ testPassedOptions('Pass', true);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} desc
+ * @param {string} fragSrc
+ * @param {es3fFragDepthTests.EvalFragDepthFunc} evalFunc
+ */
+ es3fFragDepthTests.FragDepthWriteCase = function(name, desc, fragSrc, evalFunc) {
+ tcuTestCase.DeqpTest.call(this, name, desc);
+ /** @type {string} */ this.m_fragSrc = fragSrc;
+ /** @type {es3fFragDepthTests.EvalFragDepthFunc} */ this.m_evalFunc = evalFunc;
+ };
+
+ es3fFragDepthTests.FragDepthWriteCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fFragDepthTests.FragDepthWriteCase.prototype.constructor = es3fFragDepthTests.FragDepthWriteCase;
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fFragDepthTests.FragDepthWriteCase.prototype.iterate = function() {
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name));
+ /** @type {number} */ var viewportW = Math.min(128, gl.drawingBufferWidth);
+ /** @type {number} */ var viewportH = Math.min(128, gl.drawingBufferHeight);
+ /** @type {number} */ var viewportX = rnd.getInt(0, gl.drawingBufferWidth - viewportW);
+ /** @type {number} */ var viewportY = rnd.getInt(0, gl.drawingBufferHeight - viewportH);
+ /** @type {tcuSurface.Surface} */ var renderedFrame = new tcuSurface.Surface(viewportW, viewportH);
+ /** @type {tcuSurface.Surface} */ var referenceFrame = new tcuSurface.Surface(viewportW, viewportH);
+ /** @type {number} */ var numDepthSteps = 16;
+ /** @type {number} */ var depthStep = 1.0 / (numDepthSteps - 1);
+ var depthBits = /** @type {number} */ (gl.getParameter(gl.DEPTH_BITS));
+
+ if (depthBits === 0)
+ throw new Error('Depth buffer is required');
+
+ gl.depthMask(true);
+ gl.viewport(viewportX, viewportY, viewportW, viewportH);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+ gl.enable(gl.DEPTH_TEST);
+ gl.depthFunc(gl.LESS);
+
+ /** @type {Array<number>} */ var quadIndices = [0, 1, 2, 2, 1, 3];
+
+ // Render with given shader.
+ /** @type {gluShaderProgram.ShaderProgram} */
+ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(es3fFragDepthTests.s_vertexShaderSrc, this.m_fragSrc));
+ bufferedLogToConsole(program.getProgramInfo().infoLog);
+
+ if (!program.isOk())
+ throw new Error('Compile failed');
+
+ /** @type {Array<number>} */ var coord = [
+ 0.0, 0.0,
+ 0.0, 1.0,
+ 1.0, 0.0,
+ 1.0, 1.0
+ ];
+
+ /** @type {Array<number>} */ var position = [
+ -1.0, -1.0, +1.0, 1.0,
+ -1.0, 1.0, 0.0, 1.0,
+ 1.0, -1.0, 0.0, 1.0,
+ 1.0, 1.0, -1.0, 1.0
+ ];
+
+ gl.useProgram(program.getProgram());
+ gl.uniform4f(gl.getUniformLocation(program.getProgram(), 'u_color'), 0.0, 1.0, 0.0, 1.0);
+
+ // Setup default helper uniforms.
+ glsShaderRenderCase.setupDefaultUniforms(program.getProgram());
+
+ /** @type {Array<gluDrawUtil.VertexArrayBinding>} */ var vertexArrays = [
+ gluDrawUtil.newFloatVertexArrayBinding('a_position', 4, 4, 0, position),
+ gluDrawUtil.newFloatVertexArrayBinding('a_coord', 2, 4, 0, coord)
+ ];
+ gluDrawUtil.draw(gl, program.getProgram(), vertexArrays, gluDrawUtil.triangles(quadIndices));
+
+ // Visualize by rendering full-screen quads with increasing depth and color.
+ program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(es3fFragDepthTests.s_vertexShaderSrc, es3fFragDepthTests.s_defaultFragmentShaderSrc));
+
+ if (!program.isOk()) {
+ bufferedLogToConsole(program.getProgramInfo().infoLog);
+ throw new Error('Compile failed');
+ }
+
+ /** @type {WebGLUniformLocation} */ var colorLoc = gl.getUniformLocation(program.getProgram(), 'u_color');
+
+ gl.useProgram(program.getProgram());
+ gl.depthMask(false);
+
+ for (var stepNdx = 0; stepNdx < numDepthSteps; stepNdx++) {
+ /** @type {number} */ var f = stepNdx * depthStep;
+ /** @type {number} */ var depth = f * 2.0 - 1.0;
+ /** @type {Array<number>} */ var color = [f, f, f, 1.0];
+
+ position = [
+ -1.0, -1.0, depth, 1.0,
+ -1.0, 1.0, depth, 1.0,
+ 1.0, -1.0, depth, 1.0,
+ 1.0, 1.0, depth, 1.0
+ ];
+
+ /** @type {gluDrawUtil.VertexArrayBinding} */
+ var posBinding = gluDrawUtil.newFloatVertexArrayBinding('a_position', 4, 4, 0, position);
+
+ gl.uniform4fv(colorLoc, color);
+ gluDrawUtil.draw(gl, program.getProgram(), [posBinding], gluDrawUtil.triangles(quadIndices));
+ }
+
+ renderedFrame.readViewport(gl, [viewportX, viewportY, viewportW, viewportH]);
+
+ // Render reference.
+ for (var y = 0; y < referenceFrame.getHeight(); y++)
+ for (var x = 0; x < referenceFrame.getWidth(); x++) {
+ /** @type {number} */ var xf = (x + 0.5) / referenceFrame.getWidth();
+ /** @type {number} */ var yf = (y + 0.5) / referenceFrame.getHeight();
+ /** @type {number} */ var d = this.m_evalFunc([xf, yf]);
+ /** @type {number} */ var step = Math.floor(d / depthStep);
+ /** @type {number} */ var col = deMath.clamp(Math.floor(step * depthStep * 255.0), 0, 255);
+
+ referenceFrame.setPixel(x, y, [col, col, col, 0xff]);
+ }
+
+ /** @type {boolean} */ var isOk = tcuImageCompare.fuzzyCompare('Result', 'Image comparison result', referenceFrame.getAccess(), renderedFrame.getAccess(), 0.05);
+
+ if (!isOk)
+ testFailedOptions('Fail', false);
+ else
+ testPassedOptions('Pass', true);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fFragDepthTests.FragDepthTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'fragdepth', 'gl_FragDepth tests');
+ };
+
+ es3fFragDepthTests.FragDepthTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fFragDepthTests.FragDepthTests.prototype.constructor = es3fFragDepthTests.FragDepthTests;
+
+ /**
+ * @param {Array<number>} coord
+ * @return {number}
+ */
+ es3fFragDepthTests.evalConstDepth = function(coord) {
+ return 0.5;
+ };
+
+ /**
+ * @param {Array<number>} coord
+ * @return {number}
+ */
+ es3fFragDepthTests.evalDynamicDepth = function(coord) {
+ return (coord[0] + coord[1]) * 0.5;
+ };
+
+ /**
+ * @param {Array<number>} coord
+ * @return {number}
+ */
+ es3fFragDepthTests.evalNoWrite = function(coord) {
+ return 1.0 - (coord[0] + coord[1]) * 0.5;
+ };
+
+ /**
+ * @param {Array<number>} coord
+ * @return {number}
+ */
+ es3fFragDepthTests.evalDynamicConditionalDepth = function(coord) {
+ /** @type {number} */ var d = (coord[0] + coord[1]) * 0.5;
+ if (coord[1] < 0.5)
+ return d;
+ else
+ return 1.0 - d;
+ };
+
+ es3fFragDepthTests.FragDepthTests.prototype.init = function() {
+ /**
+ * @struct
+ * @constructor
+ * @param {string} name
+ * @param {string} desc
+ * @param {es3fFragDepthTests.EvalFragDepthFunc} evalFunc
+ * @param {string} fragSrc
+ */
+ var Case = function(name, desc, evalFunc, fragSrc) {
+ /** @type {string} */ this.name = name;
+ /** @type {string} */ this.desc = desc;
+ /** @type {es3fFragDepthTests.EvalFragDepthFunc} */ this.evalFunc = evalFunc;
+ /** @type {string} */ this.fragSrc = fragSrc;
+ };
+
+ /** @type {Array<Case>} */ var cases = [
+ new Case('no_write', 'No gl_FragDepth write', es3fFragDepthTests.evalNoWrite,
+ '#version 300 es\n' +
+ 'uniform highp vec4 u_color;\n' +
+ 'layout(location = 0) out mediump vec4 o_color;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' o_color = u_color;\n' +
+ '}\n'
+ ),
+ new Case('const', 'Const depth write', es3fFragDepthTests.evalConstDepth,
+ '#version 300 es\n' +
+ 'uniform highp vec4 u_color;\n' +
+ 'layout(location = 0) out mediump vec4 o_color;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' o_color = u_color;\n' +
+ ' gl_FragDepth = 0.5;\n' +
+ '}\n'
+ ),
+ new Case('uniform', 'Uniform depth write', es3fFragDepthTests.evalConstDepth,
+ '#version 300 es\n' +
+ 'uniform highp vec4 u_color;\n' +
+ 'uniform highp float uf_half;\n' +
+ 'layout(location = 0) out mediump vec4 o_color;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' o_color = u_color;\n' +
+ ' gl_FragDepth = uf_half;\n' +
+ '}\n'
+ ),
+ new Case('dynamic', 'Dynamic depth write', es3fFragDepthTests.evalDynamicDepth,
+ '#version 300 es\n' +
+ 'uniform highp vec4 u_color;\n' +
+ 'in highp vec2 v_coord;\n' +
+ 'layout(location = 0) out mediump vec4 o_color;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' o_color = u_color;\n' +
+ ' gl_FragDepth = (v_coord.x+v_coord.y)*0.5;\n' +
+ '}\n'
+ ),
+ new Case('fragcoord_z', 'gl_FragDepth write from gl_FragCoord.z', es3fFragDepthTests.evalNoWrite,
+ '#version 300 es\n' +
+ 'uniform highp vec4 u_color;\n' +
+ 'layout(location = 0) out mediump vec4 o_color;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' o_color = u_color;\n' +
+ ' gl_FragDepth = gl_FragCoord.z;\n' +
+ '}\n'
+ ),
+ new Case('uniform_conditional_write', 'Uniform conditional write', es3fFragDepthTests.evalDynamicDepth,
+ '#version 300 es\n' +
+ 'uniform highp vec4 u_color;\n' +
+ 'uniform bool ub_true;\n' +
+ 'in highp vec2 v_coord;\n' +
+ 'layout(location = 0) out mediump vec4 o_color;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' o_color = u_color;\n' +
+ ' if (ub_true)\n' +
+ ' gl_FragDepth = (v_coord.x+v_coord.y)*0.5;\n' +
+ '}\n'
+ ),
+ new Case('dynamic_conditional_write', 'Uniform conditional write', es3fFragDepthTests.evalDynamicConditionalDepth,
+ '#version 300 es\n' +
+ 'uniform highp vec4 u_color;\n' +
+ 'uniform bool ub_true;\n' +
+ 'in highp vec2 v_coord;\n' +
+ 'layout(location = 0) out mediump vec4 o_color;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' o_color = u_color;\n' +
+ ' mediump float d = (v_coord.x+v_coord.y)*0.5f;\n' +
+ ' if (v_coord.y < 0.5)\n' +
+ ' gl_FragDepth = d;\n' +
+ ' else\n' +
+ ' gl_FragDepth = 1.0 - d;\n' +
+ '}\n'
+ ),
+ new Case('uniform_loop_write', 'Uniform loop write', es3fFragDepthTests.evalConstDepth,
+ '#version 300 es\n' +
+ 'uniform highp vec4 u_color;\n' +
+ 'uniform int ui_two;\n' +
+ 'uniform highp float uf_fourth;\n' +
+ 'in highp vec2 v_coord;\n' +
+ 'layout(location = 0) out mediump vec4 o_color;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' o_color = u_color;\n' +
+ ' gl_FragDepth = 0.0;\n' +
+ ' for (int i = 0; i < ui_two; i++)\n' +
+ ' gl_FragDepth += uf_fourth;\n' +
+ '}\n'
+ ),
+ new Case('write_in_function', 'Uniform loop write', es3fFragDepthTests.evalDynamicDepth,
+ '#version 300 es\n' +
+ 'uniform highp vec4 u_color;\n' +
+ 'uniform highp float uf_half;\n' +
+ 'in highp vec2 v_coord;\n' +
+ 'layout(location = 0) out mediump vec4 o_color;\n' +
+ 'void myfunc (highp vec2 coord)\n' +
+ '{\n' +
+ ' gl_FragDepth = (coord.x+coord.y)*0.5;\n' +
+ '}\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' o_color = u_color;\n' +
+ ' myfunc(v_coord);\n' +
+ '}\n'
+ )
+ ];
+
+ var testGroup = tcuTestCase.runner.testCases;
+
+ // .write
+ /** @type {tcuTestCase.DeqpTest} */ var writeGroup = tcuTestCase.newTest('write', 'gl_FragDepth write tests');
+ testGroup.addChild(writeGroup);
+ for (var ndx = 0; ndx < cases.length; ndx++)
+ writeGroup.addChild(new es3fFragDepthTests.FragDepthWriteCase(cases[ndx].name, cases[ndx].desc, cases[ndx].fragSrc, cases[ndx].evalFunc));
+
+ // .compare
+ /** @type {tcuTestCase.DeqpTest} */ var compareGroup = tcuTestCase.newTest('compare', 'gl_FragDepth used with depth comparison');
+ testGroup.addChild(compareGroup);
+ for (var ndx = 0; ndx < cases.length; ndx++)
+ compareGroup.addChild(new es3fFragDepthTests.FragDepthCompareCase(cases[ndx].name, cases[ndx].desc, cases[ndx].fragSrc, cases[ndx].evalFunc, gl.LESS));
+ };
+
+ /**
+ * Run test
+ * @param {WebGL2RenderingContext} context
+ */
+ es3fFragDepthTests.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fFragDepthTests.FragDepthTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fFragDepthTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFragmentOutputTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFragmentOutputTests.js
new file mode 100644
index 0000000000..b27eee7a6e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFragmentOutputTests.js
@@ -0,0 +1,1398 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fFragmentOutputTests');
+goog.require('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluTextureUtil');
+goog.require('functional.gles3.es3fFboTestUtil');
+
+goog.scope(function() {
+
+var es3fFragmentOutputTests = functional.gles3.es3fFragmentOutputTests;
+var gluShaderProgram = framework.opengl.gluShaderProgram;
+var es3fFboTestUtil = functional.gles3.es3fFboTestUtil;
+var gluShaderUtil = framework.opengl.gluShaderUtil;
+var deRandom = framework.delibs.debase.deRandom;
+var tcuTestCase = framework.common.tcuTestCase;
+var gluTextureUtil = framework.opengl.gluTextureUtil;
+var tcuTexture = framework.common.tcuTexture;
+var tcuTextureUtil = framework.common.tcuTextureUtil;
+var deMath = framework.delibs.debase.deMath;
+var tcuImageCompare = framework.common.tcuImageCompare;
+
+ /** @type {WebGL2RenderingContext} */ var gl;
+
+ var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+ };
+
+ /**
+ * es3fFragmentOutputTests.BufferSpec. Constructs the es3fFragmentOutputTests.BufferSpec object
+ * @constructor
+ * @param {WebGLRenderingContextBase.GLenum} format_
+ * @param {number} width_
+ * @param {number} height_
+ * @param {number} samples_
+ */
+ es3fFragmentOutputTests.BufferSpec = function(format_, width_, height_, samples_) {
+ this.format = format_;
+ this.width = width_;
+ this.height = height_;
+ this.samples = samples_;
+ };
+
+ /**
+ * es3fFragmentOutputTests.FragmentOutput. Constructs the es3fFragmentOutputTests.FragmentOutput object
+ * @constructor
+ * @param {gluShaderUtil.DataType} type_
+ * @param {gluShaderUtil.precision} precision_
+ * @param {number} location_
+ * @param {number=} arrayLength_
+ */
+ es3fFragmentOutputTests.FragmentOutput = function(type_, precision_, location_, arrayLength_) {
+ this.type = type_;
+ this.precision = precision_;
+ this.location = location_;
+ this.arrayLength = arrayLength_ || 0;
+ };
+
+ /**
+ * es3fFragmentOutputTests.FragmentOutputCase. Constructs the es3fFragmentOutputTests.FragmentOutputCase object
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} description
+ * @param {Array<es3fFragmentOutputTests.BufferSpec>} fboSpec
+ * @param {Array<es3fFragmentOutputTests.FragmentOutput>} outputs
+ * @return {Object} The currently modified object
+ */
+ es3fFragmentOutputTests.FragmentOutputCase = function(name, description, fboSpec, outputs) {
+ tcuTestCase.DeqpTest.call(this, name, description);
+ /** @type {Array<es3fFragmentOutputTests.BufferSpec>} */ this.m_fboSpec = fboSpec;
+ /** @type {Array<es3fFragmentOutputTests.FragmentOutput>} */ this.m_outputs = outputs;
+ /** @type {gluShaderProgram.ShaderProgram} */ this.m_program = null;
+ /** @type {WebGLFramebuffer} */ this.m_framebuffer = null;
+
+ /** @type {WebGLRenderbuffer} */ this.m_renderbuffer = null;
+ };
+
+ es3fFragmentOutputTests.FragmentOutputCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fFragmentOutputTests.FragmentOutputCase.prototype.constructor = es3fFragmentOutputTests.FragmentOutputCase;
+
+ /**
+ * es3fFragmentOutputTests.createProgram. Returns a ShaderProgram object
+ * @param {Array<es3fFragmentOutputTests.FragmentOutput>} outputs
+ * @return {gluShaderProgram.ShaderProgram} program
+ */
+ es3fFragmentOutputTests.createProgram = function(outputs) {
+
+ var vtx = '';
+ var frag = '';
+
+ vtx = '#version 300 es\n' + 'in highp vec4 a_position;\n';
+ frag = '#version 300 es\n';
+
+ /** @type {es3fFragmentOutputTests.FragmentOutput} */ var output = null;
+ /** @type {boolean} */ var isArray = false;
+ // Input-output declarations.
+ for (var outNdx = 0; outNdx < outputs.length; outNdx++) {
+ output = outputs[outNdx];
+ isArray = output.arrayLength > 0;
+ /** @type {string} */ var typeName = gluShaderUtil.getDataTypeName(output.type);
+ /** @type {string} */ var precName = gluShaderUtil.getPrecisionName(output.precision);
+ /** @type {boolean} */ var isFloat = gluShaderUtil.isDataTypeFloatOrVec(output.type);
+ /** @type {string} */ var interp = isFloat ? 'smooth' : 'flat';
+
+ if (isArray) {
+ for (var elemNdx = 0; elemNdx < output.arrayLength; elemNdx++) {
+ vtx += 'in ' + precName + ' ' + typeName + ' in' + outNdx + '_' + elemNdx + ';\n' +
+ interp + ' out ' + precName + ' ' + typeName + ' var' + outNdx + '_' + elemNdx + ';\n';
+ frag += interp + ' in ' + precName + ' ' + typeName + ' var' + outNdx + '_' + elemNdx + ';\n';
+ }
+ frag += 'layout(location = ' + output.location + ') out ' + precName + ' ' + typeName + ' out' + outNdx + '[' + output.arrayLength + '];\n';
+ } else {
+ vtx += 'in ' + precName + ' ' + typeName + ' in' + outNdx + ';\n' +
+ interp + ' out ' + precName + ' ' + typeName + ' var' + outNdx + ';\n';
+ frag += interp + ' in ' + precName + ' ' + typeName + ' var' + outNdx + ';\n' +
+ 'layout(location = ' + output.location + ') out ' + precName + ' ' + typeName + ' out' + outNdx + ';\n';
+ }
+ }
+
+ vtx += '\nvoid main()\n{\n';
+ frag += '\nvoid main()\n{\n';
+
+ vtx += ' gl_Position = a_position;\n';
+
+ // Copy body
+ for (var outNdx = 0; outNdx < outputs.length; outNdx++) {
+ output = outputs[outNdx];
+ isArray = output.arrayLength > 0;
+
+ if (isArray) {
+ for (var elemNdx = 0; elemNdx < output.arrayLength; elemNdx++) {
+ vtx += '\tvar' + outNdx + '_' + elemNdx + ' = in' + outNdx + '_' + elemNdx + ';\n';
+ frag += '\tout' + outNdx + '[' + elemNdx + '] = var' + outNdx + '_' + elemNdx + ';\n';
+ }
+ } else {
+ vtx += '\tvar' + outNdx + ' = in' + outNdx + ';\n';
+ frag += '\tout' + outNdx + ' = var' + outNdx + ';\n';
+ }
+ }
+
+ vtx += '}\n';
+ frag += '}\n';
+
+ /** @type {gluShaderProgram.ShaderProgram} */
+ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vtx, frag));
+ return program;
+ };
+
+ es3fFragmentOutputTests.FragmentOutputCase.prototype.init = function() {
+ // Check that all attachments are supported
+ for (var iter = 0; iter < this.m_fboSpec.length; ++iter) {
+ if (!gluTextureUtil.isSizedFormatColorRenderable(this.m_fboSpec[iter].format))
+ throw new Error('Unsupported attachment format');
+ }
+
+ DE_ASSERT(!this.m_program);
+ this.m_program = es3fFragmentOutputTests.createProgram(this.m_outputs);
+
+ // log << *m_program;
+ if (!this.m_program.isOk())
+ throw new Error('Compile failed. Program no created');
+
+ /*
+ // Print render target info to log.
+ log << TestLog::Section("Framebuffer", "Framebuffer configuration");
+
+ for (int ndx = 0; ndx < (int)m_fboSpec.size(); ndx++)
+ log << TestLog::Message << "COLOR_ATTACHMENT" << ndx << ": "
+ << glu::getPixelFormatStr(m_fboSpec[ndx].format) << ", "
+ << m_fboSpec[ndx].width << "x" << m_fboSpec[ndx].height << ", "
+ << m_fboSpec[ndx].samples << " samples"
+ << TestLog::EndMessage;
+
+ log << TestLog::EndSection;*/
+
+ // Create framebuffer.
+ this.m_framebuffer = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, this.m_framebuffer);
+
+ for (var bufNdx = 0; bufNdx < /* m_renderbuffers.size() */ this.m_fboSpec.length; bufNdx++) {
+ this.m_renderbuffer = gl.createRenderbuffer();
+ /** @type {es3fFragmentOutputTests.BufferSpec} */ var bufSpec = this.m_fboSpec[bufNdx];
+ /** @type {number} */ var attachment = gl.COLOR_ATTACHMENT0 + bufNdx;
+
+ gl.bindRenderbuffer(gl.RENDERBUFFER, this.m_renderbuffer);
+
+ gl.renderbufferStorageMultisample(gl.RENDERBUFFER, bufSpec.samples, bufSpec.format, bufSpec.width, bufSpec.height);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment, gl.RENDERBUFFER, this.m_renderbuffer);
+ }
+ /** @type {number} */ var fboStatus = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ if (fboStatus == gl.FRAMEBUFFER_UNSUPPORTED)
+ throw new Error('Framebuffer not supported');
+ else if (fboStatus != gl.FRAMEBUFFER_COMPLETE)
+ throw new Error('Incomplete framebuffer');
+ // throw tcu::TestError((string("Incomplete framebuffer: ") + glu::getFramebufferStatusStr(fboStatus), "", __FILE__, __LINE__);
+
+ // gl.bindRenderbuffer(gl.RENDERBUFFER, null); // TODO: maybe needed?
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ };
+
+ es3fFragmentOutputTests.FragmentOutputCase.prototype.deinit = function() {
+ // TODO: implement?
+ };
+
+ /**
+ * es3fFragmentOutputTests.getMinSize.
+ * @param {Array<es3fFragmentOutputTests.BufferSpec>} fboSpec
+ * @return {Array<number>} minSize
+ */
+ es3fFragmentOutputTests.getMinSize = function(fboSpec) {
+ /** @type {Array<number>} */ var minSize = [0x7fffffff, 0x7fffffff];
+ for (var i = 0; i < fboSpec.length; i++) {
+ minSize[0] = Math.min(minSize[0], fboSpec[i].width);
+ minSize[1] = Math.min(minSize[1], fboSpec[i].height);
+ }
+ return minSize;
+ };
+
+ /**
+ * es3fFragmentOutputTests.getNumInputVectors. Returns the length of the array of all the outputs (es3fFragmentOutputTests.FragmentOutput object)
+ * @param {Array<es3fFragmentOutputTests.FragmentOutput>} outputs
+ * @return {number} numVecs
+ */
+ es3fFragmentOutputTests.getNumInputVectors = function(outputs) {
+ /** @type {number} */ var numVecs = 0;
+ for (var i = 0; i < outputs.length; i++)
+ numVecs += (outputs[i].arrayLength > 0 ? outputs[i].arrayLength : 1);
+ return numVecs;
+ };
+
+ /**
+ * es3fFragmentOutputTests.getFloatRange
+ * @param {gluShaderUtil.precision} precision
+ * @return {Array<number>} Vec2
+ */
+ es3fFragmentOutputTests.getFloatRange = function(precision) {
+ /** @type {Array<Array<number>>} */
+ var ranges = // Vec2
+ [
+ [-2.0, 2.0],
+ [-16000.0, 16000.0],
+ [-1e35, 1e35]
+ ];
+ // DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(ranges) == glu::PRECISION_LAST);
+ // DE_ASSERT(de::inBounds<int>(precision, 0, DE_LENGTH_OF_ARRAY(ranges)));
+ return ranges[precision];
+ };
+
+ /**
+ * es3fFragmentOutputTests.getIntRange
+ * @param {gluShaderUtil.precision} precision
+ * @return {Array<number>} IVec2
+ */
+ es3fFragmentOutputTests.getIntRange = function(precision) {
+ /** @type {Array<Array<number>>} */
+ var ranges = // IVec2
+ [
+ [-(1 << 7), (1 << 7) - 1],
+ [-(1 << 15), (1 << 15) - 1],
+ [-0x80000000, 0x7fffffff]
+ ];
+ // DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(ranges) == glu::PRECISION_LAST);
+ // DE_ASSERT(de::inBounds<int>(precision, 0, DE_LENGTH_OF_ARRAY(ranges)));
+ return ranges[precision];
+ };
+
+ /**
+ * es3fFragmentOutputTests.getUintRange
+ * @param {gluShaderUtil.precision} precision
+ * @return {Array<number>} UVec2
+ */
+ es3fFragmentOutputTests.getUintRange = function(precision) {
+ /** @type {Array<Array<number>>} */
+ var ranges = // UVec2
+ [
+ [0, (1 << 8) - 1],
+ [0, (1 << 16) - 1],
+ [0, 0xffffffff]
+ ];
+ // DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(ranges) == glu::PRECISION_LAST);
+ // DE_ASSERT(de::inBounds<int>(precision, 0, DE_LENGTH_OF_ARRAY(ranges)));
+ return ranges[precision];
+
+ };
+
+ /**
+ * es3fFragmentOutputTests.readVec4
+ * @param {Array<number>} ptr
+ * @param {number} index
+ * @param {number} numComponents
+ * @return {Array<number>} Vec4
+ */
+ es3fFragmentOutputTests.readVec4 = function(ptr, index, numComponents) {
+ DE_ASSERT(numComponents >= 1);
+ return [
+ ptr[index + 0],
+ numComponents >= 2 ? ptr[index + 1] : 0.0,
+ numComponents >= 3 ? ptr[index + 2] : 0.0,
+ numComponents >= 4 ? ptr[index + 3] : 0.0
+ ];
+ };
+
+ /**
+ * es3fFragmentOutputTests.readIVec4
+ * @param {Array<number>} ptr
+ * @param {number} numComponents
+ * @return {Array<number>} IVec4
+ */
+ es3fFragmentOutputTests.readIVec4 = function(ptr, index, numComponents) {
+ DE_ASSERT(numComponents >= 1);
+ return [
+ ptr[index + 0],
+ numComponents >= 2 ? ptr[index + 1] : 0,
+ numComponents >= 3 ? ptr[index + 2] : 0,
+ numComponents >= 4 ? ptr[index + 3] : 0
+ ];
+ };
+
+ /**
+ * es3fFragmentOutputTests.renderFloatReference
+ * @param {tcuTexture.PixelBufferAccess} dst
+ * @param {number} gridWidth
+ * @param {number} gridHeight
+ * @param {number} numComponents
+ * @param {Array<number>} vertices
+ */
+ es3fFragmentOutputTests.renderFloatReference = function(dst, gridWidth, gridHeight, numComponents, vertices) {
+
+ /** @type {boolean} */ var isSRGB = dst.getFormat().order == tcuTexture.ChannelOrder.sRGB || dst.getFormat().order == tcuTexture.ChannelOrder.sRGBA;
+ /** @type {number} */ var cellW = dst.getWidth() / (gridWidth - 1);
+ /** @type {number} */ var cellH = dst.getHeight() / (gridHeight - 1);
+
+ for (var y = 0; y < dst.getHeight(); y++) {
+ for (var x = 0; x < dst.getWidth(); x++) {
+ /** @type {number} */ var cellX = deMath.clamp(Math.floor(x / cellW), 0, gridWidth - 2);
+ /** @type {number} */ var cellY = deMath.clamp(Math.floor(y / cellH), 0, gridHeight - 2);
+ /** @type {number} */ var xf = (x - cellX * cellW + 0.5) / cellW;
+ /** @type {number} */ var yf = (y - cellY * cellH + 0.5) / cellH;
+
+ /** @type {Array<number>} */ var v00 = es3fFragmentOutputTests.readVec4(vertices, ((cellY + 0) * gridWidth + cellX + 0) * numComponents, numComponents); // Vec4
+ /** @type {Array<number>} */ var v01 = es3fFragmentOutputTests.readVec4(vertices, ((cellY + 1) * gridWidth + cellX + 0) * numComponents, numComponents); // Vec4
+ /** @type {Array<number>} */ var v10 = es3fFragmentOutputTests.readVec4(vertices, ((cellY + 0) * gridWidth + cellX + 1) * numComponents, numComponents); // Vec4
+ /** @type {Array<number>} */ var v11 = es3fFragmentOutputTests.readVec4(vertices, ((cellY + 1) * gridWidth + cellX + 1) * numComponents, numComponents); // Vec4
+
+ /** @type {boolean} */ var tri = xf + yf >= 1.0;
+ /** @type {Array<number>} */ var v0 = tri ? v11 : v00; // Vec4&
+ /** @type {Array<number>} */ var v1 = tri ? v01 : v10; // Vec4&
+ /** @type {Array<number>} */ var v2 = tri ? v10 : v01; // Vec4&
+ /** @type {number} */ var s = tri ? 1.0 - xf : xf;
+ /** @type {number} */ var t = tri ? 1.0 - yf : yf;
+ /** @type {Array<number>} */ var color = deMath.add(v0, deMath.add(deMath.multiply((deMath.subtract(v1, v0)), [s, s, s, s]), deMath.multiply((deMath.subtract(v2, v0)), [t, t, t, t]))); // Vec4
+
+ dst.setPixel(isSRGB ? tcuTextureUtil.linearToSRGB(color) : color, x, y);
+ }
+ }
+ };
+
+ /**
+ * es3fFragmentOutputTests.renderIntReference
+ * @param {tcuTexture.PixelBufferAccess} dst
+ * @param {number} gridWidth
+ * @param {number} gridHeight
+ * @param {number} numComponents
+ * @param {Array<number>} vertices
+ */
+ es3fFragmentOutputTests.renderIntReference = function(dst, gridWidth, gridHeight, numComponents, vertices) {
+
+ /** @type {number} */ var cellW = dst.getWidth() / (gridWidth - 1);
+ /** @type {number} */ var cellH = dst.getHeight() / (gridHeight - 1);
+
+ for (var y = 0; y < dst.getHeight(); y++) {
+ for (var x = 0; x < dst.getWidth(); x++) {
+ /** @type {number} */ var cellX = deMath.clamp(Math.floor(x / cellW), 0, gridWidth - 2);
+ /** @type {number} */ var cellY = deMath.clamp(Math.floor(y / cellH), 0, gridHeight - 2);
+ /** @type {Array<number>} */ var c = es3fFragmentOutputTests.readIVec4(vertices, (cellY * gridWidth + cellX + 1) * numComponents, numComponents); // IVec4
+
+ dst.setPixelInt(c, x, y);
+ }
+ }
+ };
+
+ /**
+ * es3fFragmentOutputTests.s_swizzles
+ * @return {Array<Array<number>>}
+ */
+ es3fFragmentOutputTests.s_swizzles = function() {
+ var mat_swizzles = [
+ [0, 1, 2, 3],
+ [1, 2, 3, 0],
+ [2, 3, 0, 1],
+ [3, 0, 1, 2],
+ [3, 2, 1, 0],
+ [2, 1, 0, 3],
+ [1, 0, 3, 2],
+ [0, 3, 2, 1]
+ ];
+
+ return mat_swizzles;
+ };
+
+ /**
+ * es3fFragmentOutputTests.swizzleVec. Returns an Array from a position contained in the Array es3fFragmentOutputTests.s_swizzles []
+ * @param {Array<number>} vec
+ * @param {number} swzNdx
+ * @return {Array<number>} Swizzled array
+ */
+ es3fFragmentOutputTests.swizzleVec = function(vec, swzNdx) {
+ /** @type {Array<number>} */ var swz = es3fFragmentOutputTests.s_swizzles()[swzNdx % es3fFragmentOutputTests.s_swizzles().length];
+
+ return deMath.swizzle(vec, swz);
+ };
+
+ /**
+ * es3fFragmentOutputTests.AttachmentData struct class
+ * @constructor
+ * @return {Object}
+ */
+ es3fFragmentOutputTests.AttachmentData = function() {
+ return {
+ /** @type {tcuTexture.TextureFormat} */ format: null, //!< Actual format of attachment.
+ /** @type {tcuTexture.TextureFormat} */ referenceFormat: null, //!< Used for reference rendering.
+ /** @type {tcuTexture.TextureFormat} */ readFormat: null,
+ /** @type {number} */ numWrittenChannels: 0,
+ /** @type {gluShaderUtil.precision} */ outPrecision: gluShaderUtil.precision.PRECISION_LOWP,
+ /** @type {ArrayBuffer} */ renderedData: null,
+ /** @type {ArrayBuffer} */ referenceData: null
+ };
+ };
+
+ es3fFragmentOutputTests.FragmentOutputCase.prototype.iterate = function() {
+ // Compute grid size & index list.
+ /** @type {number} */ var minCellSize = 8;
+ /** @type {Array<number>} */ var minBufSize = es3fFragmentOutputTests.getMinSize(this.m_fboSpec); // IVec2
+ /** @type {number} */ var gridWidth = deMath.clamp(Math.floor(minBufSize[0] / minCellSize), 1, 255) + 1;
+ /** @type {number} */ var gridHeight = deMath.clamp(Math.floor(minBufSize[1] / minCellSize), 1, 255) + 1;
+ /** @type {number} */ var numVertices = gridWidth * gridHeight;
+ /** @type {number} */ var numQuads = (gridWidth - 1) * (gridHeight - 1);
+ /** @type {number} */ var numIndices = numQuads * 6;
+
+ /** @type {number} */ var numInputVecs = es3fFragmentOutputTests.getNumInputVectors(this.m_outputs);
+ /** @type {Array<Array<number>>} */ var inputs = []; // originally vector<vector<deUint32>
+
+ for (var inputNdx = 0; inputNdx < numInputVecs; inputNdx++)
+ inputs[inputNdx] = []; // inputs.length = numInputVecs;
+
+ /** @type {Array<number>} */ var positions = []; // originally vector<float>
+ /** @type {Array<number>} */ var indices = []; // originally vector<deUint16>
+
+ /** @type {number} */ var readAlignment = 4;
+ /** @type {number} */ var viewportW = minBufSize[0];
+ /** @type {number} */ var viewportH = minBufSize[1];
+ /** @type {number} */ var numAttachments = this.m_fboSpec.length;
+
+ /** @type {Array<number>} */ var drawBuffers = []; // originally vector<deUint32>
+ /** @type {Array<es3fFragmentOutputTests.AttachmentData>} */ var attachments = [];
+ /** @type {number} */ var attachmentW;
+ /** @type {number} */ var attachmentH;
+
+ // Initialize attachment data.
+ for (var ndx = 0; ndx < numAttachments; ndx++) {
+ /** @type {tcuTexture.TextureFormat} */ var texFmt = gluTextureUtil.mapGLInternalFormat(this.m_fboSpec[ndx].format);
+ /** @type {tcuTexture.TextureChannelClass} */ var chnClass = tcuTexture.getTextureChannelClass(texFmt.type);
+ /** @type {boolean} */ var isFixedPoint = (chnClass == tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT ||
+ chnClass == tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT);
+
+ // \note Fixed-point formats use float reference to enable more accurate result verification.
+ /** @type {tcuTexture.TextureFormat} */ var refFmt = isFixedPoint ? new tcuTexture.TextureFormat(texFmt.order, tcuTexture.ChannelType.FLOAT) : texFmt;
+ /** @type {tcuTexture.TextureFormat} */ var readFmt = es3fFboTestUtil.getFramebufferReadFormat(texFmt);
+ attachmentW = this.m_fboSpec[ndx].width;
+ attachmentH = this.m_fboSpec[ndx].height;
+
+ drawBuffers[ndx] = gl.COLOR_ATTACHMENT0 + ndx;
+ attachments[ndx] = new es3fFragmentOutputTests.AttachmentData();
+ attachments[ndx].format = texFmt;
+ attachments[ndx].readFormat = readFmt;
+ attachments[ndx].referenceFormat = refFmt;
+ attachments[ndx].renderedData = new ArrayBuffer(readFmt.getPixelSize() * attachmentW * attachmentH);
+ attachments[ndx].referenceData = new ArrayBuffer(refFmt.getPixelSize() * attachmentW * attachmentH);
+ }
+
+ // Initialize indices.
+ for (var quadNdx = 0; quadNdx < numQuads; quadNdx++) {
+ /** @type {number} */ var quadY = Math.floor(quadNdx / (gridWidth - 1));
+ /** @type {number} */ var quadX = quadNdx - quadY * (gridWidth - 1);
+
+ indices[quadNdx * 6 + 0] = quadX + quadY * gridWidth;
+ indices[quadNdx * 6 + 1] = quadX + (quadY + 1) * gridWidth;
+ indices[quadNdx * 6 + 2] = quadX + quadY * gridWidth + 1;
+ indices[quadNdx * 6 + 3] = indices[quadNdx * 6 + 1];
+ indices[quadNdx * 6 + 4] = quadX + (quadY + 1) * gridWidth + 1;
+ indices[quadNdx * 6 + 5] = indices[quadNdx * 6 + 2];
+ }
+
+ /** @type {number} */ var xf = 0;
+ /** @type {number} */ var yf = 0;
+ for (var y = 0; y < gridHeight; y++) {
+ for (var x = 0; x < gridWidth; x++) {
+ xf = x / (gridWidth - 1);
+ yf = y / (gridHeight - 1);
+
+ positions[(y * gridWidth + x) * 4 + 0] = 2.0 * xf - 1.0;
+ positions[(y * gridWidth + x) * 4 + 1] = 2.0 * yf - 1.0;
+ positions[(y * gridWidth + x) * 4 + 2] = 0.0;
+ positions[(y * gridWidth + x) * 4 + 3] = 1.0;
+ }
+ }
+ /** @type {es3fFragmentOutputTests.FragmentOutput} */ var output;
+ /** @type {boolean} */ var isArray;
+ /** @type {boolean} */ var isFloat;
+ /** @type {boolean} */ var isInt;
+ /** @type {boolean} */ var isUint;
+ /** @type {number} */ var numVecs;
+ /** @type {number} */ var numScalars;
+
+ var curInVec = 0;
+ for (var outputNdx = 0; outputNdx < this.m_outputs.length; outputNdx++) {
+ output = this.m_outputs[outputNdx];
+ isFloat = gluShaderUtil.isDataTypeFloatOrVec(output.type);
+ isInt = gluShaderUtil.isDataTypeIntOrIVec(output.type);
+ isUint = gluShaderUtil.isDataTypeUintOrUVec(output.type);
+ numVecs = output.arrayLength > 0 ? output.arrayLength : 1;
+ numScalars = gluShaderUtil.getDataTypeScalarSize(output.type);
+
+ for (var vecNdx = 0; vecNdx < numVecs; vecNdx++) {
+ inputs[curInVec].length = numVertices * numScalars;
+
+ // Record how many outputs are written in attachment.
+ DE_ASSERT(output.location + vecNdx < attachments.length);
+ attachments[output.location + vecNdx].numWrittenChannels = numScalars;
+ attachments[output.location + vecNdx].outPrecision = output.precision;
+
+ /** @type {Array<number>} */ var range = null;
+ /** @type {Array<number>} */ var minVal = null;
+ /** @type {Array<number>} */ var maxVal = null;
+ /** @type {Array<number>} */ var fmtBits = null;
+ /** @type {Array<number>} */ var fmtMaxVal = [];
+ /** @type {Array<number>} */ var rangeDiv = null;
+ /** @type {Array<number>} */ var step = [];
+ /** @type {number} */ var ix = 0;
+ /** @type {number} */ var iy = 0;
+ /** @type {Array<number>} */ var c = null;
+ /** @type {number} */ var pos = 0;
+ if (isFloat) {
+ range = es3fFragmentOutputTests.getFloatRange(output.precision); // Vec2
+ minVal = [range[0], range[0], range[0], range[0]]; // Vec4
+ maxVal = [range[1], range[1], range[1], range[1]]; // Vec4
+
+ if (deMath.deInBounds32(output.location + vecNdx, 0, attachments.length)) {
+ // \note Floating-point precision conversion is not well-defined. For that reason we must
+ // limit value range to intersection of both data type and render target value ranges.
+ /** @type {tcuTextureUtil.TextureFormatInfo} */ var fmtInfo = tcuTextureUtil.getTextureFormatInfo(attachments[output.location + vecNdx].format);
+ minVal = deMath.max(minVal, fmtInfo.valueMin);
+ maxVal = deMath.min(maxVal, fmtInfo.valueMax);
+ }
+
+ bufferedLogToConsole('out ' + curInVec + ' value range: ' + minVal + ' -> ' + maxVal);
+
+ for (var y = 0; y < gridHeight; y++) {
+ for (var x = 0; x < gridWidth; x++) {
+ xf = x / (gridWidth - 1);
+ yf = y / (gridHeight - 1);
+ /** @type {number} */ var f0 = (xf + yf) * 0.5;
+ /** @type {number} */ var f1 = 0.5 + (xf - yf) * 0.5;
+
+ /** @type {Array<number>} */ var f = es3fFragmentOutputTests.swizzleVec([f0, f1, 1.0 - f0, 1.0 - f1], curInVec); // Vec4
+ c = deMath.add(minVal, deMath.multiply(deMath.subtract(maxVal, minVal), f)); // Vec4
+
+ pos = (y * gridWidth + x) * numScalars;
+
+ for (var ndx = 0; ndx < numScalars; ndx++)
+ inputs[curInVec][pos + ndx] = c[ndx];
+ }
+ }
+ } else if (isInt) {
+ range = es3fFragmentOutputTests.getIntRange(output.precision); // IVec2
+ minVal = [range[0], range[0], range[0], range[0]]; // IVec4
+ maxVal = [range[1], range[1], range[1], range[1]]; // IVec4
+
+ if (deMath.deInBounds32(output.location + vecNdx, 0, attachments.length)) {
+ // Limit to range of output format as conversion mode is not specified.
+ fmtBits = tcuTextureUtil.getTextureFormatBitDepth(attachments[output.location + vecNdx].format); // IVec4
+ /** @type {Array<boolean>} */ var isZero = deMath.lessThanEqual(fmtBits, [0, 0, 0, 0]); // BVec4, array of booleans, size = 4
+
+ /** @type {Array<number>} */ var fmtMinVal = []; // IVec4
+
+ for (var i = 0; i < 4; i++) {
+
+ // const IVec4 fmtMinVal = (-(tcu::Vector<deInt64, 4>(1) << (fmtBits - 1 ).cast<deInt64>())).asInt();
+ fmtMinVal[i] = -1 * Math.pow(2, fmtBits[i] - 1); // TODO: check implementation, original above
+ // const IVec4 fmtMaxVal = ((tcu::Vector<deInt64, 4>(1) << (fmtBits - 1 ).cast<deInt64>()) - deInt64(1)).asInt();
+ fmtMaxVal[i] = Math.pow(2, fmtBits[i] - 1) - 1; // TODO: check implementation, original above
+ }
+
+ minVal = tcuTextureUtil.select(minVal, deMath.max(minVal, fmtMinVal), isZero);
+ maxVal = tcuTextureUtil.select(maxVal, deMath.min(maxVal, fmtMaxVal), isZero);
+ }
+
+ bufferedLogToConsole('out ' + curInVec + ' value range: ' + minVal + ' -> ' + maxVal);
+
+ rangeDiv = es3fFragmentOutputTests.swizzleVec([gridWidth - 1, gridHeight - 1, gridWidth - 1, gridHeight - 1], curInVec); // IVec4
+ for (var i = 0; i < 4; i++) {
+ // const IVec4 step = ((maxVal.cast<deInt64>() - minVal.cast<deInt64>()) / (rangeDiv.cast<deInt64>())).asInt();
+ step[i] = Math.floor((maxVal[i] - minVal[i]) / rangeDiv[i]); // TODO: check with the above line of code
+ }
+
+ for (var y = 0; y < gridHeight; y++) {
+ for (var x = 0; x < gridWidth; x++) {
+ ix = gridWidth - x - 1;
+ iy = gridHeight - y - 1;
+ c = deMath.add(minVal, deMath.multiply(step, es3fFragmentOutputTests.swizzleVec([x, y, ix, iy], curInVec))); // IVec4
+
+ pos = (y * gridWidth + x) * numScalars;
+
+ for (var ndx = 0; ndx < numScalars; ndx++)
+ inputs[curInVec][pos + ndx] = c[ndx];
+ }
+ }
+ } else if (isUint) {
+ range = es3fFragmentOutputTests.getUintRange(output.precision); // UVec2
+ maxVal = [range[1], range[1], range[1], range[1]]; // UVec4
+
+ if (deMath.deInBounds32(output.location + vecNdx, 0, attachments.length)) {
+ // Limit to range of output format as conversion mode is not specified.
+ fmtBits = tcuTextureUtil.getTextureFormatBitDepth(attachments[output.location + vecNdx].format); // IVec4
+
+ for (var i = 0; i < 4; i++) {
+ fmtMaxVal[i] = Math.pow(2, fmtBits[i]) - 1;
+ }
+
+ maxVal = deMath.min(maxVal, fmtMaxVal);
+ }
+
+ bufferedLogToConsole('out ' + curInVec + ' value range: ' + minVal + ' -> ' + maxVal);
+
+ rangeDiv = es3fFragmentOutputTests.swizzleVec([gridWidth - 1, gridHeight - 1, gridWidth - 1, gridHeight - 1], curInVec); // IVec4
+
+ for (var stepPos = 0; stepPos < maxVal.length; stepPos++) {
+ step[stepPos] = Math.floor(maxVal[stepPos] / rangeDiv[stepPos]);
+ }
+
+ DE_ASSERT(range[0] == 0);
+
+ for (var y = 0; y < gridHeight; y++) {
+ for (var x = 0; x < gridWidth; x++) {
+ ix = gridWidth - x - 1;
+ iy = gridHeight - y - 1;
+ c = deMath.multiply(step, es3fFragmentOutputTests.swizzleVec([x, y, ix, iy], curInVec)); // UVec4
+ pos = (y * gridWidth + x) * numScalars;
+
+ DE_ASSERT(deMath.boolAll(deMath.lessThanEqual(c, maxVal))); // TODO: sometimes crashes here, condition not asserted
+
+ for (var ndx = 0; ndx < numScalars; ndx++)
+ inputs[curInVec][pos + ndx] = c[ndx];
+ }
+ }
+ } else
+ DE_ASSERT(false);
+
+ curInVec += 1;
+ }
+ }
+
+ // Render using gl.
+ gl.useProgram(this.m_program.getProgram());
+ gl.bindFramebuffer(gl.FRAMEBUFFER, this.m_framebuffer);
+ gl.viewport(0, 0, viewportW, viewportH);
+ gl.drawBuffers(drawBuffers);
+ gl.disable(gl.DITHER); // Dithering causes issues with unorm formats. Those issues could be worked around in threshold, but it makes validation less accurate.
+
+ /** @type {WebGLBuffer} */ var buffer = null;
+ /** @type {string} */ var name;
+ curInVec = 0;
+ for (var outputNdx = 0; outputNdx < this.m_outputs.length; outputNdx++) {
+ output = this.m_outputs[outputNdx];
+ isArray = output.arrayLength > 0;
+ isFloat = gluShaderUtil.isDataTypeFloatOrVec(output.type);
+ isInt = gluShaderUtil.isDataTypeIntOrIVec(output.type);
+ isUint = gluShaderUtil.isDataTypeUintOrUVec(output.type);
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(output.type);
+ /** @type {number} */ var glScalarType = isFloat ? /* gluShaderUtil.DataType.FLOAT */ gl.FLOAT :
+ isInt ? /* gluShaderUtil.DataType.INT */ gl.INT :
+ isUint ? /* gluShaderUtil.DataType.UINT */ gl.UNSIGNED_INT : /* gluShaderUtil.DataType.INVALID */ gl.NONE;
+ numVecs = isArray ? output.arrayLength : 1;
+
+ for (var vecNdx = 0; vecNdx < numVecs; vecNdx++) {
+ name = 'in' + outputNdx + (isArray ? '_' + vecNdx : '');
+ /** @type {number} */ var loc = gl.getAttribLocation(this.m_program.getProgram(), name);
+
+ if (loc >= 0) {
+ buffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
+
+ gl.enableVertexAttribArray(loc);
+ if (isFloat) {
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(inputs[curInVec]), gl.STATIC_DRAW);
+ // KHRONOS WebGL 1.0 specification:
+ // void vertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset);
+ gl.vertexAttribPointer(loc, scalarSize, glScalarType, false, 0, 0); // offset = 0
+ } else {
+ gl.bufferData(gl.ARRAY_BUFFER, new Int32Array(inputs[curInVec]), gl.STATIC_DRAW);
+ // KHRONOS WebGL 2.0 specification:
+ // void vertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset)
+ gl.vertexAttribIPointer(loc, scalarSize, glScalarType, 0, 0); // offset = 0
+ }
+ } else
+ bufferedLogToConsole('Warning: No location for attribute "' + name + '" found.');
+
+ curInVec += 1;
+ }
+ }
+
+ /** @type {number} */ var posLoc = gl.getAttribLocation(this.m_program.getProgram(), 'a_position');
+ // TCU_CHECK(posLoc >= 0);
+ buffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW);
+
+ gl.enableVertexAttribArray(posLoc);
+ gl.vertexAttribPointer(posLoc, 4, gl.FLOAT, false, 0, 0); // offset = 0
+
+ /** @type {WebGLBuffer} */ var indexObject = gl.createBuffer();
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexObject);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(indices), gl.STATIC_DRAW);
+
+ gl.drawElements(gl.TRIANGLES, numIndices, gl.UNSIGNED_SHORT, 0); // offset = 0
+
+ // Render reference images.
+
+ var curInNdx = 0;
+ for (var outputNdx = 0; outputNdx < this.m_outputs.length; outputNdx++) {
+ output = this.m_outputs[outputNdx];
+ isArray = output.arrayLength > 0;
+ isFloat = gluShaderUtil.isDataTypeFloatOrVec(output.type);
+ isInt = gluShaderUtil.isDataTypeIntOrIVec(output.type);
+ isUint = gluShaderUtil.isDataTypeUintOrUVec(output.type);
+ scalarSize = gluShaderUtil.getDataTypeScalarSize(output.type);
+ numVecs = isArray ? output.arrayLength : 1;
+
+ for (var vecNdx = 0; vecNdx < numVecs; vecNdx++) {
+ /** @type {number} */ var location = output.location + vecNdx;
+ /** @type {Array<number>} */ var inputData = inputs[curInNdx];
+
+ DE_ASSERT(deMath.deInBounds32(location, 0, this.m_fboSpec.length));
+
+ /** @type {number} */ var bufW = this.m_fboSpec[location].width;
+ /** @type {number} */ var bufH = this.m_fboSpec[location].height;
+ /** @type {Object} */ var descriptor = {
+ format: attachments[location].referenceFormat,
+ width: bufW,
+ height: bufH,
+ depth: 1,
+ data: attachments[location].referenceData // ArrayBuffer
+ };
+ /** @type {tcuTexture.PixelBufferAccess} */ var buf = new tcuTexture.PixelBufferAccess(descriptor);
+ /** @type {tcuTexture.PixelBufferAccess} */ var viewportBuf = tcuTextureUtil.getSubregion(buf, 0, 0, 0, viewportW, viewportH, 1);
+
+ if (isInt || isUint)
+ es3fFragmentOutputTests.renderIntReference(viewportBuf, gridWidth, gridHeight, scalarSize, inputData);
+ else if (isFloat)
+ es3fFragmentOutputTests.renderFloatReference(viewportBuf, gridWidth, gridHeight, scalarSize, inputData);
+ else
+ DE_ASSERT(false);
+
+ curInNdx += 1;
+ }
+ }
+
+ // Compare all images.
+ /** @type {boolean} */ var allLevelsOk = true;
+ for (var attachNdx = 0; attachNdx < numAttachments; attachNdx++) {
+ attachmentW = this.m_fboSpec[attachNdx].width;
+ attachmentH = this.m_fboSpec[attachNdx].height;
+ /** @type {number} */ var numValidChannels = attachments[attachNdx].numWrittenChannels;
+ /** @type {Array<boolean>} */ var cmpMask = [numValidChannels >= 1, numValidChannels >= 2, numValidChannels >= 3, numValidChannels >= 4];
+ /** @type {gluShaderUtil.precision} */ var outPrecision = attachments[attachNdx].outPrecision;
+ /** @type {tcuTexture.TextureFormat} */ var format = attachments[attachNdx].format;
+ /** @type {Object} */
+ var renderedDescriptor = {
+ format: attachments[attachNdx].readFormat,
+ width: attachmentW,
+ height: attachmentH,
+ depth: 1,
+ rowPitch: deMath.deAlign32(attachments[attachNdx].readFormat.getPixelSize() * attachmentW, readAlignment),
+ slicePitch: 0,
+ data: attachments[attachNdx].renderedData // ArrayBuffer
+ };
+ /** @type {tcuTexture.PixelBufferAccess} */ var rendered = new tcuTexture.PixelBufferAccess(renderedDescriptor);
+ /** @type {gluTextureUtil.TransferFormat} */ var transferFmt = gluTextureUtil.getTransferFormat(attachments[attachNdx].readFormat);
+ gl.readBuffer(gl.COLOR_ATTACHMENT0 + attachNdx);
+ gl.readPixels(0, 0, attachmentW, attachmentH, transferFmt.format, transferFmt.dataType, rendered.getDataPtr());
+
+ /** @type {Object} */
+ var referenceDescriptor = {
+ format: attachments[attachNdx].referenceFormat,
+ width: attachmentW,
+ height: attachmentH,
+ depth: 1,
+ data: attachments[attachNdx].referenceData // ArrayBuffer
+ };
+ /** @type {tcuTexture.ConstPixelBufferAccess} */ var reference = new tcuTexture.ConstPixelBufferAccess(referenceDescriptor);
+ /** @type {tcuTexture.TextureChannelClass} */ var texClass = tcuTexture.getTextureChannelClass(format.type);
+ /** @type {boolean} */ var isOk = true;
+ name = 'Attachment ' + attachNdx;
+ /** @type {string} */ var desc = 'Color attachment ' + attachNdx;
+ /** @type {Array<number>} */ var threshold;
+
+ bufferedLogToConsole('Attachment ' + attachNdx + ': ' + numValidChannels + ' channels have defined values and used for comparison');
+
+ switch (texClass) {
+ case tcuTexture.TextureChannelClass.FLOATING_POINT: {
+ /** @type {Array<number>} */ var formatThreshold = []; // UVec4 //!< Threshold computed based on format.
+ formatThreshold.length = 4;
+ /** @type {number} */ var precThreshold = 0; // deUint32 //!< Threshold computed based on output type precision
+ /** @type {Array<number>} */ var finalThreshold = []; // UVec4
+ finalThreshold.length = 4;
+
+ switch (format.type) {
+ case tcuTexture.ChannelType.FLOAT:
+ formatThreshold = [4, 4, 4, 4]; // UVec4
+ break;
+ case tcuTexture.ChannelType.HALF_FLOAT:
+ formatThreshold = [(1 << 13) + 4, (1 << 13) + 4, (1 << 13) + 4, (1 << 13) + 4]; // UVec4
+ break;
+ case tcuTexture.ChannelType.UNSIGNED_INT_11F_11F_10F_REV:
+ formatThreshold = [(1 << 17) + 4, (1 << 17) + 4, (1 << 18) + 4, 4]; // UVec4
+ break;
+ default:
+ DE_ASSERT(false);
+ break;
+ }
+
+ switch (outPrecision) {
+ case gluShaderUtil.precision.PRECISION_LOWP:
+ precThreshold = (1 << 21);
+ break;
+ case gluShaderUtil.precision.PRECISION_MEDIUMP:
+ precThreshold = (1 << 13);
+ break;
+ case gluShaderUtil.precision.PRECISION_HIGHP:
+ precThreshold = 0;
+ break;
+ default:
+ DE_ASSERT(false);
+ }
+
+ finalThreshold = tcuTextureUtil.select(
+ deMath.max(formatThreshold, [precThreshold, precThreshold, precThreshold, precThreshold]),
+ [0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff], // C++ version: UVec4(~0u) bitwise not, all bits in the integer will be flipped
+ cmpMask);
+
+ isOk = tcuImageCompare.floatUlpThresholdCompare(name, desc, reference, rendered, finalThreshold /*, tcu::COMPARE_LOG_RESULT*/);
+ break;
+ }
+
+ case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT: {
+ // \note glReadPixels() allows only 8 bits to be read. This means that RGB10_A2 will loose some
+ // bits in the process and it must be taken into account when computing threshold.
+ /** @type {Array<number>} */ var bits = deMath.min([8, 8, 8, 8], tcuTextureUtil.getTextureFormatBitDepth(format)); // IVec4
+
+ /** @type {Array<number>} */ var baseThreshold = []; // Vec4
+ baseThreshold.length = 4;
+ for (var inc = 0; inc < baseThreshold.length; inc++) {
+ // TODO: check the operation below: baseThreshold = 1.0f / ((IVec4(1) << bits)-1).asFloat();
+ baseThreshold[inc] = 1.0 / ((1 << bits[inc]) - 1);
+ }
+
+ threshold = tcuTextureUtil.select(baseThreshold, [2.0, 2.0, 2.0, 2.0], cmpMask); // Vec4
+
+ isOk = tcuImageCompare.floatThresholdCompare(name, desc, reference, rendered, threshold/*, tcu::COMPARE_LOG_RESULT*/);
+ break;
+ }
+
+ case tcuTexture.TextureChannelClass.SIGNED_INTEGER:
+ case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER: {
+ // The C++ dEQP code uses ~0u but ~0 is -1 in Javascript
+ var UINT_MAX = Math.pow(2.0, 32.0) - 1;
+ threshold = tcuTextureUtil.select(
+ [0, 0, 0, 0],
+ [UINT_MAX, UINT_MAX, UINT_MAX, UINT_MAX],
+ cmpMask
+ ); // UVec4
+ isOk = tcuImageCompare.intThresholdCompare(name, desc, reference, rendered, threshold/*, tcu::COMPARE_LOG_RESULT*/);
+ break;
+ }
+
+ default:
+ testFailedOptions('Unsupported comparison', true);
+ break;
+ }
+
+ if (!isOk)
+ allLevelsOk = false;
+ }
+
+ if (numAttachments > 1) {
+ if (allLevelsOk)
+ testPassed('Image comparison passed for ' + numAttachments + ' attachments');
+ else
+ testFailed('Image comparison failed for some of ' + numAttachments + ' attachments');
+ } else {
+ if (allLevelsOk)
+ testPassed('Image comparison passed');
+ else
+ testFailed('Image comparison failed');
+ }
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * es3fFragmentOutputTests.createRandomCase. Constructs the es3fFragmentOutputTests.createRandomCase, child class of es3fFragmentOutputTests.FragmentOutputCase
+ * @constructor
+ * @param {number} minRenderTargets
+ * @param {number} maxRenderTargets
+ * @param {number} seed
+ * @return {es3fFragmentOutputTests.FragmentOutputCase} The currently modified object
+ */
+ es3fFragmentOutputTests.createRandomCase = function(minRenderTargets, maxRenderTargets, seed, colorBufferFloatSupported) {
+
+ /** @type {Array<gluShaderUtil.DataType>} */
+ var outputTypes = [
+ gluShaderUtil.DataType.FLOAT,
+ gluShaderUtil.DataType.FLOAT_VEC2,
+ gluShaderUtil.DataType.FLOAT_VEC3,
+ gluShaderUtil.DataType.FLOAT_VEC4,
+ gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT_VEC2,
+ gluShaderUtil.DataType.INT_VEC3,
+ gluShaderUtil.DataType.INT_VEC4,
+ gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT_VEC2,
+ gluShaderUtil.DataType.UINT_VEC3,
+ gluShaderUtil.DataType.UINT_VEC4
+ ];
+
+ /** @type {Array<gluShaderUtil.precision>} */
+ var precisions = [
+ gluShaderUtil.precision.PRECISION_LOWP,
+ gluShaderUtil.precision.PRECISION_MEDIUMP,
+ gluShaderUtil.precision.PRECISION_HIGHP
+ ];
+
+ /** @type {Array<WebGLRenderingContextBase.GLenum>} */
+ var floatFormats = [
+ gl.RGBA32F,
+ gl.RGBA16F,
+ gl.R11F_G11F_B10F,
+ gl.RG32F,
+ gl.RG16F,
+ gl.R32F,
+ gl.R16F,
+ gl.RGBA8,
+ gl.SRGB8_ALPHA8,
+ gl.RGB10_A2,
+ gl.RGBA4,
+ gl.RGB5_A1,
+ gl.RGB8,
+ gl.RGB565,
+ gl.RG8,
+ gl.R8
+ ];
+
+ /** @type {Array<WebGLRenderingContextBase.GLenum>} */
+ var colorBufferFloatFormats = [
+ gl.RGBA32F,
+ gl.RGBA16F,
+ gl.R11F_G11F_B10F,
+ gl.RG32F,
+ gl.RG16F,
+ gl.R32F,
+ gl.R16F
+ ];
+
+
+ /** @type {Array<WebGLRenderingContextBase.GLenum>} */
+ var intFormats = [
+ gl.RGBA32I,
+ gl.RGBA16I,
+ gl.RGBA8I,
+ gl.RG32I,
+ gl.RG16I,
+ gl.RG8I,
+ gl.R32I,
+ gl.R16I,
+ gl.R8I
+ ];
+
+ /** @type {Array<WebGLRenderingContextBase.GLenum>} */
+ var uintFormats = [
+ gl.RGBA32UI,
+ gl.RGBA16UI,
+ gl.RGBA8UI,
+ gl.RGB10_A2UI,
+ gl.RG32UI,
+ gl.RG16UI,
+ gl.RG8UI,
+ gl.R32UI,
+ gl.R16UI,
+ gl.R8UI
+ ];
+
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(seed);
+ /** @type {Array<es3fFragmentOutputTests.FragmentOutput>} */ var outputs = [];
+ /** @type {Array<es3fFragmentOutputTests.BufferSpec>} */ var targets = [];
+ /** @type {Array<gluShaderUtil.DataType>} */ var outTypes = [];
+
+ /** @type {number} */ var numTargets = rnd.getInt(minRenderTargets, maxRenderTargets);
+ /** @type {number} */ var width = 128; // \todo [2012-04-10 pyry] Separate randomized sizes per target?
+ /** @type {number} */ var height = 64;
+ /** @type {number} */ var samples = 0;
+
+ // Compute outputs.
+ /** @type {number} */ var curLoc = 0;
+ while (curLoc < numTargets) {
+ /** @type {boolean} */ var useArray = rnd.getFloat() < 0.3;
+ /** @type {number} */ var maxArrayLen = numTargets - curLoc;
+ /** @type {number} */ var arrayLen = useArray ? rnd.getInt(1, maxArrayLen) : 0;
+ /** @type {Array<gluShaderUtil.DataType>} */ var basicTypeArray = rnd.choose(outputTypes, undefined, 1);
+ /** @type {gluShaderUtil.DataType} */ var basicType = basicTypeArray[0];
+ /** @type {Array<gluShaderUtil.precision>} */ var precisionArray = rnd.choose(precisions, undefined, 1);
+ /** @type {gluShaderUtil.precision} */ var precision = precisionArray[0];
+ /** @type {number} */ var numLocations = useArray ? arrayLen : 1;
+
+ outputs.push(new es3fFragmentOutputTests.FragmentOutput(basicType, precision, curLoc, arrayLen));
+
+ for (var ndx = 0; ndx < numLocations; ndx++)
+ outTypes.push(basicType);
+
+ curLoc += numLocations;
+ }
+ DE_ASSERT(curLoc == numTargets);
+ DE_ASSERT(outTypes.length == numTargets);
+
+ // Compute buffers.
+ while (targets.length < numTargets) {
+ /** @type {gluShaderUtil.DataType} */ var outType = outTypes[targets.length];
+ /** @type {boolean} */ var isFloat = gluShaderUtil.isDataTypeFloatOrVec(outType);
+ /** @type {boolean} */ var isInt = gluShaderUtil.isDataTypeIntOrIVec(outType);
+ /** @type {boolean} */ var isUint = gluShaderUtil.isDataTypeUintOrUVec(outType);
+ /** @type {Array} */ var formatArray = [];
+ /** @type {number} */ var format = 0;
+
+ if (isFloat) {
+ formatArray = rnd.choose(floatFormats, undefined, 1);
+ format = formatArray[0];
+ if (colorBufferFloatFormats.indexOf(format) >= 0 && !colorBufferFloatSupported)
+ return null;
+ } else if (isInt) {
+ formatArray = rnd.choose(intFormats, undefined, 1);
+ format = formatArray[0];
+ } else if (isUint) {
+ formatArray = rnd.choose(uintFormats, undefined, 1);
+ format = formatArray[0];
+ } else
+ DE_ASSERT(false);
+
+ targets.push(new es3fFragmentOutputTests.BufferSpec(format, width, height, samples));
+ }
+
+ return new es3fFragmentOutputTests.FragmentOutputCase(seed.toString(), '', targets, outputs);
+
+ };
+
+ es3fFragmentOutputTests.init = function(gl) {
+ var state = tcuTestCase.runner;
+ state.testCases = tcuTestCase.newTest('fragment_outputs', 'Top level');
+ /** @const @type {tcuTestCase.DeqpTest} */ var testGroup = state.testCases;
+
+ /** @type {Array<WebGLRenderingContextBase.GLenum>} */
+ var requiredFloatFormats = [
+ gl.RGBA32F,
+ gl.RGBA16F,
+ gl.R11F_G11F_B10F,
+ gl.RG32F,
+ gl.RG16F,
+ gl.R32F,
+ gl.R16F
+ ];
+
+ /** @type {Array<WebGLRenderingContextBase.GLenum>} */
+ var requiredFixedFormats = [
+ gl.RGBA8,
+ gl.SRGB8_ALPHA8,
+ gl.RGB10_A2,
+ gl.RGBA4,
+ gl.RGB5_A1,
+ gl.RGB8,
+ gl.RGB565,
+ gl.RG8,
+ gl.R8
+ ];
+
+ /** @type {Array<WebGLRenderingContextBase.GLenum>} */
+ var requiredIntFormats = [
+ gl.RGBA32I,
+ gl.RGBA16I,
+ gl.RGBA8I,
+ gl.RG32I,
+ gl.RG16I,
+ gl.RG8I,
+ gl.R32I,
+ gl.R16I,
+ gl.R8I
+ ];
+
+ /** @type {Array<WebGLRenderingContextBase.GLenum>} */
+ var requiredUintFormats = [
+ gl.RGBA32UI,
+ gl.RGBA16UI,
+ gl.RGBA8UI,
+ gl.RGB10_A2UI,
+ gl.RG32UI,
+ gl.RG16UI,
+ gl.RG8UI,
+ gl.R32UI,
+ gl.R16UI,
+ gl.R8UI
+ ];
+
+ /** @type {Array<gluShaderUtil.precision>} */
+ var precisions = [
+
+ gluShaderUtil.precision.PRECISION_LOWP,
+ gluShaderUtil.precision.PRECISION_MEDIUMP,
+ gluShaderUtil.precision.PRECISION_HIGHP
+
+ ];
+
+ // .basic.
+
+ /** @const @type {number} */ var width = 64;
+ /** @const @type {number} */ var height = 64;
+ /** @const @type {number} */ var samples = 0;
+ /** @type {Array<es3fFragmentOutputTests.BufferSpec>} */ var fboSpec = null;
+ /** @type {gluShaderUtil.precision} */ var prec;
+ /** @type {string} */ var precName;
+
+ // .float
+ if (gl.getExtension('EXT_color_buffer_float')) {
+ /** @type {tcuTestCase.DeqpTest} */ var floatGroup = tcuTestCase.newTest('basic.float', 'Floating-point output tests');
+ testGroup.addChild(floatGroup);
+
+ for (var fmtNdx = 0; fmtNdx < requiredFloatFormats.length; fmtNdx++) {
+ var format = requiredFloatFormats[fmtNdx];
+ var fmtName = es3fFboTestUtil.getFormatName(format);
+ fboSpec = [];
+
+ fboSpec.push(new es3fFragmentOutputTests.BufferSpec(format, width, height, samples));
+
+ for (var precNdx = 0; precNdx < precisions.length; precNdx++) {
+ prec = precisions[precNdx];
+ precName = gluShaderUtil.getPrecisionName(prec);
+
+ // NOTE: Eliminated original OutputVec and toVec(), as it only returned an element of the outputs array in OutputVec
+ floatGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_float', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT, prec, 0)]));
+ floatGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_vec2', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT_VEC2, prec, 0)]));
+ floatGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_vec3', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT_VEC3, prec, 0)]));
+ floatGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_vec4', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT_VEC4, prec, 0)]));
+ }
+ }
+ }
+
+ // .fixed
+ /** @type {tcuTestCase.DeqpTest} */ var fixedGroup = tcuTestCase.newTest('basic.fixed', 'Fixed-point output tests');
+ testGroup.addChild(fixedGroup);
+ for (var fmtNdx = 0; fmtNdx < requiredFixedFormats.length; fmtNdx++) {
+ var format = requiredFixedFormats[fmtNdx];
+ var fmtName = es3fFboTestUtil.getFormatName(format);
+ fboSpec = [];
+
+ fboSpec.push(new es3fFragmentOutputTests.BufferSpec(format, width, height, samples));
+
+ for (var precNdx = 0; precNdx < precisions.length; precNdx++) {
+ prec = precisions[precNdx];
+ precName = gluShaderUtil.getPrecisionName(prec);
+
+ fixedGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_float', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT, prec, 0)]));
+ fixedGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_vec2', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT_VEC2, prec, 0)]));
+ fixedGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_vec3', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT_VEC3, prec, 0)]));
+ fixedGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_vec4', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT_VEC4, prec, 0)]));
+ }
+ }
+
+ // .int
+ /** @type {tcuTestCase.DeqpTest} */ var intGroup = tcuTestCase.newTest('basic.int', 'Integer output tests');
+ testGroup.addChild(intGroup);
+ for (var fmtNdx = 0; fmtNdx < requiredIntFormats.length; fmtNdx++) {
+ var format = requiredIntFormats[fmtNdx];
+ var fmtName = es3fFboTestUtil.getFormatName(format);
+ fboSpec = [];
+
+ fboSpec.push(new es3fFragmentOutputTests.BufferSpec(format, width, height, samples));
+
+ for (var precNdx = 0; precNdx < precisions.length; precNdx++) {
+ prec = precisions[precNdx];
+ precName = gluShaderUtil.getPrecisionName(prec);
+
+ intGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_int', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.INT, prec, 0)]));
+ intGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_ivec2', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.INT_VEC2, prec, 0)]));
+ intGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_ivec3', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.INT_VEC3, prec, 0)]));
+ intGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_ivec4', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.INT_VEC4, prec, 0)]));
+ }
+ }
+
+ // .uint
+ /** @type {tcuTestCase.DeqpTest} */ var uintGroup = tcuTestCase.newTest('basic.uint', 'Usigned integer output tests');
+ testGroup.addChild(uintGroup);
+ for (var fmtNdx = 0; fmtNdx < requiredUintFormats.length; fmtNdx++) {
+ var format = requiredUintFormats[fmtNdx];
+ var fmtName = es3fFboTestUtil.getFormatName(format);
+ fboSpec = [];
+
+ fboSpec.push(new es3fFragmentOutputTests.BufferSpec(format, width, height, samples));
+
+ for (var precNdx = 0; precNdx < precisions.length; precNdx++) {
+ prec = precisions[precNdx];
+ precName = gluShaderUtil.getPrecisionName(prec);
+
+ uintGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_uint', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.UINT, prec, 0)]));
+ uintGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_uvec2', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.UINT_VEC2, prec, 0)]));
+ uintGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_uvec3', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.UINT_VEC3, prec, 0)]));
+ uintGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_uvec4', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.UINT_VEC4, prec, 0)]));
+
+ }
+ }
+
+ // .array
+
+ /** @type {number} */ var numTargets = 3;
+
+ // .float
+ if (gl.getExtension('EXT_color_buffer_float')) {
+ /** @type {tcuTestCase.DeqpTest} */ var arrayFloatGroup = tcuTestCase.newTest('array.float', 'Floating-point output tests');
+ testGroup.addChild(arrayFloatGroup);
+ for (var fmtNdx = 0; fmtNdx < requiredFloatFormats.length; fmtNdx++) {
+ var format = requiredFloatFormats[fmtNdx];
+ var fmtName = es3fFboTestUtil.getFormatName(format);
+ fboSpec = [];
+
+ for (var ndx = 0; ndx < numTargets; ndx++)
+ fboSpec.push(new es3fFragmentOutputTests.BufferSpec(format, width, height, samples));
+
+ for (var precNdx = 0; precNdx < precisions.length; precNdx++) {
+ prec = precisions[precNdx];
+ precName = gluShaderUtil.getPrecisionName(prec);
+
+ arrayFloatGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_float', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT, prec, 0, numTargets)]));
+ arrayFloatGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_vec2', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT_VEC2, prec, 0, numTargets)]));
+ arrayFloatGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_vec3', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT_VEC3, prec, 0, numTargets)]));
+ arrayFloatGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_vec4', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT_VEC4, prec, 0, numTargets)]));
+ }
+ }
+ }
+
+ // .fixed
+ /** @type {tcuTestCase.DeqpTest} */ var arrayFixedGroup = tcuTestCase.newTest('array.fixed', 'Fixed-point output tests');
+ testGroup.addChild(arrayFixedGroup);
+ for (var fmtNdx = 0; fmtNdx < requiredFixedFormats.length; fmtNdx++) {
+ var format = requiredFixedFormats[fmtNdx];
+ var fmtName = es3fFboTestUtil.getFormatName(format);
+ fboSpec = [];
+
+ for (var ndx = 0; ndx < numTargets; ndx++)
+ fboSpec.push(new es3fFragmentOutputTests.BufferSpec(format, width, height, samples));
+
+ for (var precNdx = 0; precNdx < precisions.length; precNdx++) {
+ prec = precisions[precNdx];
+ precName = gluShaderUtil.getPrecisionName(prec);
+
+ arrayFixedGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_float', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT, prec, 0, numTargets)]));
+ arrayFixedGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_vec2', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT_VEC2, prec, 0, numTargets)]));
+ arrayFixedGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_vec3', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT_VEC3, prec, 0, numTargets)]));
+ arrayFixedGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_vec4', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.FLOAT_VEC4, prec, 0, numTargets)]));
+ }
+ }
+
+ // .int
+ /** @type {tcuTestCase.DeqpTest} */ var arrayIntGroup = tcuTestCase.newTest('array.int', 'Integer output tests');
+ testGroup.addChild(arrayIntGroup);
+ for (var fmtNdx = 0; fmtNdx < requiredIntFormats.length; fmtNdx++) {
+ var format = requiredIntFormats[fmtNdx];
+ var fmtName = es3fFboTestUtil.getFormatName(format);
+ fboSpec = [];
+
+ for (var ndx = 0; ndx < numTargets; ndx++)
+ fboSpec.push(new es3fFragmentOutputTests.BufferSpec(format, width, height, samples));
+
+ for (var precNdx = 0; precNdx < precisions.length; precNdx++) {
+ prec = precisions[precNdx];
+ precName = gluShaderUtil.getPrecisionName(prec);
+
+ arrayIntGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_int', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.INT, prec, 0, numTargets)]));
+ arrayIntGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_ivec2', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.INT_VEC2, prec, 0, numTargets)]));
+ arrayIntGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_ivec3', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.INT_VEC3, prec, 0, numTargets)]));
+ arrayIntGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_ivec4', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.INT_VEC4, prec, 0, numTargets)]));
+ }
+ }
+
+ // .uint
+ /** @type {tcuTestCase.DeqpTest} */ var arrayUintGroup = tcuTestCase.newTest('array.uint', 'Usigned integer output tests');
+ testGroup.addChild(arrayUintGroup);
+ for (var fmtNdx = 0; fmtNdx < requiredUintFormats.length; fmtNdx++) {
+ var format = requiredUintFormats[fmtNdx];
+ var fmtName = es3fFboTestUtil.getFormatName(format);
+ fboSpec = [];
+
+ for (var ndx = 0; ndx < numTargets; ndx++)
+ fboSpec.push(new es3fFragmentOutputTests.BufferSpec(format, width, height, samples));
+
+ for (var precNdx = 0; precNdx < precisions.length; precNdx++) {
+ prec = precisions[precNdx];
+ precName = gluShaderUtil.getPrecisionName(prec);
+
+ arrayUintGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_uint', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.UINT, prec, 0, numTargets)]));
+ arrayUintGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_uvec2', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.UINT_VEC2, prec, 0, numTargets)]));
+ arrayUintGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_uvec3', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.UINT_VEC3, prec, 0, numTargets)]));
+ arrayUintGroup.addChild(new es3fFragmentOutputTests.FragmentOutputCase(fmtName + '_' + precName + '_uvec4', '', fboSpec, [new es3fFragmentOutputTests.FragmentOutput(gluShaderUtil.DataType.UINT_VEC4, prec, 0, numTargets)]));
+ }
+ }
+
+ // .random
+
+ /** @type {Array<tcuTestCase.DeqpTest>} */ var randomGroup = [];
+ var numRandomGroups = 3;
+ for (var ii = 0; ii < numRandomGroups; ++ii) {
+ randomGroup[ii] = tcuTestCase.newTest('random', 'Random fragment output cases');
+ testGroup.addChild(randomGroup[ii]);
+ }
+
+ /** @type {boolean} */ var colorBufferFloatSupported = (gl.getExtension('EXT_color_buffer_float') != null);
+ for (var seed = 0; seed < 100; seed++) {
+ var test = es3fFragmentOutputTests.createRandomCase(2, 4, seed, colorBufferFloatSupported);
+ if (test !== null) {
+ randomGroup[seed % numRandomGroups].addChild(test);
+ }
+ }
+
+ };
+
+ /**
+ * Create and execute the test cases
+ */
+ es3fFragmentOutputTests.run = function(context, range) {
+ gl = context;
+ //Set up Test Root parameters
+ var testName = 'fragment_output';
+ var testDescription = 'Fragment Output Tests';
+ var state = tcuTestCase.runner;
+
+ state.testName = testName;
+ state.testCases = tcuTestCase.newTest(testName, testDescription, null);
+
+ //Set up name and description of this test series.
+ setCurrentTestName(testName);
+ description(testDescription);
+
+ try {
+ es3fFragmentOutputTests.init(gl);
+ if (range)
+ state.setRange(range);
+ tcuTestCase.runTestCases();
+ } catch (err) {
+ testFailedOptions('Failed to es3fFragmentOutputTests.run tests', false);
+ bufferedLogToConsole(err);
+ tcuTestCase.runner.terminate();
+ }
+
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFramebufferBlitTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFramebufferBlitTests.js
new file mode 100644
index 0000000000..ffc6a0c68c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fFramebufferBlitTests.js
@@ -0,0 +1,1261 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+'use strict';
+goog.provide('functional.gles3.es3fFramebufferBlitTests');
+goog.require('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuRGBA');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluTextureUtil');
+goog.require('framework.opengl.simplereference.sglrGLContext');
+goog.require('framework.opengl.simplereference.sglrReferenceContext');
+goog.require('framework.referencerenderer.rrUtil');
+goog.require('functional.gles3.es3fFboTestCase');
+goog.require('functional.gles3.es3fFboTestUtil');
+
+goog.scope(function() {
+
+ var es3fFramebufferBlitTests = functional.gles3.es3fFramebufferBlitTests;
+ var es3fFboTestCase = functional.gles3.es3fFboTestCase;
+ var es3fFboTestUtil = functional.gles3.es3fFboTestUtil;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var tcuSurface = framework.common.tcuSurface;
+ var tcuRGBA = framework.common.tcuRGBA;
+ var tcuImageCompare = framework.common.tcuImageCompare;
+ var tcuTexture = framework.common.tcuTexture;
+ var tcuTextureUtil = framework.common.tcuTextureUtil;
+ var deMath = framework.delibs.debase.deMath;
+ var gluTextureUtil = framework.opengl.gluTextureUtil;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var rrUtil = framework.referencerenderer.rrUtil;
+ var sglrReferenceContext = framework.opengl.simplereference.sglrReferenceContext;
+ var sglrGLContext = framework.opengl.simplereference.sglrGLContext;
+
+ var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+ };
+
+ /** @type {WebGL2RenderingContext} */ var gl;
+ /**
+ * es3fFramebufferBlitTests.BlitRectCase class, inherits from FboTestCase
+ * @constructor
+ * @extends {es3fFboTestCase.FboTestCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} filter deUint32
+ * @param {Array<number>} srcSize
+ * @param {Array<number>} srcRect
+ * @param {Array<number>} dstSize
+ * @param {Array<number>} dstRect
+ * @param {number=} cellSize
+ */
+ es3fFramebufferBlitTests.BlitRectCase = function(name, desc, filter, srcSize, srcRect, dstSize, dstRect, cellSize) {
+ es3fFboTestCase.FboTestCase.call(this, name, desc);
+ /** @const {number} */ this.m_filter = filter;
+ /** @const {Array<number>} */ this.m_srcSize = srcSize;
+ /** @const {Array<number>} */ this.m_srcRect = srcRect;
+ /** @const {Array<number>} */ this.m_dstSize = dstSize;
+ /** @const {Array<number>} */ this.m_dstRect = dstRect;
+ /** @const {number} */ this.m_cellSize = cellSize === undefined ? 8 : cellSize;
+ /** @const {Array<number>} */ this.m_gridCellColorA = [0.2, 0.7, 0.1, 1.0];
+ /** @const {Array<number>} */ this.m_gridCellColorB = [0.7, 0.1, 0.5, 0.8];
+ };
+
+ es3fFramebufferBlitTests.BlitRectCase.prototype = Object.create(es3fFboTestCase.FboTestCase.prototype);
+ es3fFramebufferBlitTests.BlitRectCase.prototype.constructor = es3fFramebufferBlitTests.BlitRectCase;
+
+ /**
+ * @param {tcuSurface.Surface} dst
+ */
+ es3fFramebufferBlitTests.BlitRectCase.prototype.render = function(dst) {
+ var ctx = this.getCurrentContext();
+ /** @type {number} */ var colorFormat = gl.RGBA8;
+
+ /** @type {es3fFboTestUtil.GradientShader} */
+ var gradShader = new es3fFboTestUtil.GradientShader(
+ gluShaderUtil.DataType.FLOAT_VEC4);
+ /** @type {es3fFboTestUtil.Texture2DShader} */
+ var texShader = new es3fFboTestUtil.Texture2DShader(
+ [gluShaderUtil.DataType.SAMPLER_2D],
+ gluShaderUtil.DataType.FLOAT_VEC4);
+
+ var gradShaderID = ctx.createProgram(gradShader);
+ var texShaderID = ctx.createProgram(texShader);
+
+ var srcFbo;
+ var dstFbo;
+ var srcRbo;
+ var dstRbo;
+
+ // Setup shaders
+ gradShader.setGradient(ctx, gradShaderID, [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]);
+ texShader.setUniforms(ctx, texShaderID);
+
+ // Create framebuffers.
+
+ /** @type {Array<number>} */ var size;
+
+ // source framebuffers
+ srcFbo = ctx.createFramebuffer();
+ srcRbo = ctx.createRenderbuffer();
+ size = this.m_srcSize;
+
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, srcRbo);
+ ctx.renderbufferStorage(gl.RENDERBUFFER, colorFormat, size[0], size[1]);
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, srcFbo);
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, srcRbo);
+ this.checkError();
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ // destination framebuffers
+ dstFbo = ctx.createFramebuffer();
+ dstRbo = ctx.createRenderbuffer();
+ size = this.m_dstSize;
+
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, dstRbo);
+ ctx.renderbufferStorage(gl.RENDERBUFFER, colorFormat, size[0], size[1]);
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, dstFbo);
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, dstRbo);
+ this.checkError();
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ // Fill destination with gradient.
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, dstFbo);
+ ctx.viewport(0, 0, this.m_dstSize[0], this.m_dstSize[1]);
+
+ rrUtil.drawQuad(ctx, gradShaderID, [-1, -1, 0], [1, 1, 0]);
+
+ // Fill source with grid pattern.
+ /** @const {number} */ var format = gl.RGBA;
+ /** @const {number} */ var dataType = gl.UNSIGNED_BYTE;
+ /** @const {number} */ var texW = this.m_srcSize[0];
+ /** @const {number} */ var texH = this.m_srcSize[1];
+ var gridTex;
+ /** @type {tcuTexture.TextureLevel} */ var data = new tcuTexture.TextureLevel(gluTextureUtil.mapGLTransferFormat(format, dataType), texW, texH, 1);
+
+ tcuTextureUtil.fillWithGrid(data.getAccess(), this.m_cellSize, this.m_gridCellColorA, this.m_gridCellColorB);
+
+ gridTex = ctx.createTexture();
+ ctx.bindTexture(gl.TEXTURE_2D, gridTex);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+ ctx.texImage2D(gl.TEXTURE_2D, 0, format, texW, texH, 0, format, dataType, data.getAccess().getDataPtr());
+
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, srcFbo);
+ ctx.viewport(0, 0, this.m_srcSize[0], this.m_srcSize[1]);
+
+ rrUtil.drawQuad(ctx, texShaderID, [-1, -1, 0], [1, 1, 0]);
+
+ // Perform copy.
+ ctx.bindFramebuffer(gl.READ_FRAMEBUFFER, srcFbo);
+ ctx.bindFramebuffer(gl.DRAW_FRAMEBUFFER, dstFbo);
+ ctx.blitFramebuffer(this.m_srcRect[0], this.m_srcRect[1], this.m_srcRect[2], this.m_srcRect[3],
+ this.m_dstRect[0], this.m_dstRect[1], this.m_dstRect[2], this.m_dstRect[3],
+ gl.COLOR_BUFFER_BIT, this.m_filter);
+
+ // Read back results.
+ ctx.bindFramebuffer(gl.READ_FRAMEBUFFER, dstFbo);
+
+ this.readPixelsUsingFormat(dst, 0, 0, this.m_dstSize[0], this.m_dstSize[1],
+ gluTextureUtil.mapGLInternalFormat(colorFormat),
+ [1.0, 1.0, 1.0, 1.0],
+ [0.0, 0.0, 0.0, 0.0]);
+ };
+
+ /**
+ * @param {tcuSurface.Surface} reference
+ * @param {tcuSurface.Surface} result
+ * @return {boolean}
+ */
+ es3fFramebufferBlitTests.BlitRectCase.prototype.compare = function(reference, result) {
+ // Use pixel-threshold compare for rect cases since 1px off will mean failure.
+ var threshold = [7, 7, 7, 7];
+ return tcuImageCompare.pixelThresholdCompare('Result', 'Image comparison result', reference, result, threshold);
+ };
+
+ /**
+ * es3fFramebufferBlitTests.BlitNearestFilterConsistencyCase class
+ * @constructor
+ * @extends {es3fFramebufferBlitTests.BlitRectCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {Array<number>} srcSize
+ * @param {Array<number>} srcRect
+ * @param {Array<number>} dstSize
+ * @param {Array<number>} dstRect
+ */
+ es3fFramebufferBlitTests.BlitNearestFilterConsistencyCase = function(name, desc, srcSize, srcRect, dstSize, dstRect) {
+ es3fFramebufferBlitTests.BlitRectCase.call(this, name, desc, gl.NEAREST, srcSize, srcRect, dstSize, dstRect, 1);
+ };
+
+ es3fFramebufferBlitTests.BlitNearestFilterConsistencyCase.prototype = Object.create(es3fFramebufferBlitTests.BlitRectCase.prototype);
+ es3fFramebufferBlitTests.BlitNearestFilterConsistencyCase.prototype.constructor = es3fFramebufferBlitTests.BlitNearestFilterConsistencyCase;
+
+ /**
+ * @param {tcuSurface.Surface} reference
+ * @param {tcuSurface.Surface} result
+ * @return {boolean}
+ */
+ es3fFramebufferBlitTests.BlitNearestFilterConsistencyCase.prototype.compare = function(reference, result) {
+ assertMsgOptions(result.getWidth() == reference.getWidth() && result.getHeight() == reference.getHeight(),
+ 'Reference and result images have different dimensions', false, true);
+
+ // Image origin must be visible (for baseColor)
+ DE_ASSERT(Math.min(this.m_dstRect[0], this.m_dstRect[2]) >= 0);
+ DE_ASSERT(Math.min(this.m_dstRect[1], this.m_dstRect[3]) >= 0);
+ /** @const {tcuRGBA.RGBA} */ var cellColorA = tcuRGBA.newRGBAFromVec(this.m_gridCellColorA);
+ /** @const {tcuRGBA.RGBA} */ var cellColorB = tcuRGBA.newRGBAFromVec(this.m_gridCellColorB);
+ // TODO: implement
+ // const tcu::RGBA threshold = this.m_context.getRenderTarget().getPixelFormat().getColorThreshold() + tcu::RGBA(7,7,7,7);
+ /** @type {tcuRGBA.RGBA} */ var threshold = tcuRGBA.newRGBAComponents(7, 7, 7, 7);
+ /** @const {Array<number>} */ //IVec4.xyzw
+ var destinationArea = [
+ deMath.clamp(Math.min(this.m_dstRect[0], this.m_dstRect[2]), 0, result.getWidth()),
+ deMath.clamp(Math.min(this.m_dstRect[1], this.m_dstRect[3]), 0, result.getHeight()),
+ deMath.clamp(Math.max(this.m_dstRect[0], this.m_dstRect[2]), 0, result.getWidth()),
+ deMath.clamp(Math.max(this.m_dstRect[1], this.m_dstRect[3]), 0, result.getHeight())];
+
+ /** @const {tcuRGBA.RGBA} */ var baseColor = new tcuRGBA.RGBA(result.getPixel(destinationArea[0], destinationArea[1]));
+
+ /** @const {boolean} */ var signConfig = tcuRGBA.compareThreshold(baseColor, cellColorA, threshold);
+
+ /** @type {boolean} */ var error = false;
+ /** @type {tcuSurface.Surface} */ var errorMask = new tcuSurface.Surface(result.getWidth(), result.getHeight());
+ /** @type {Array<boolean>} */ var horisontalSign = [];
+ /** @type {Array<boolean>} */ var verticalSign = [];
+
+ errorMask.getAccess().clear([0.0, 1.0, 0.0, 1.0]);
+
+ // Checking only area in our destination rect
+
+ // m_testCtx.getLog()
+ // << tcu::TestLog::Message
+ // << 'Verifying consistency of NEAREST filtering. Verifying rect ' << m_dstRect << '.\n'
+ // << 'Rounding direction of the NEAREST filter at the horisontal texel edge (x = n + 0.5) should not depend on the y-coordinate.\n'
+ // << 'Rounding direction of the NEAREST filter at the vertical texel edge (y = n + 0.5) should not depend on the x-coordinate.\n'
+ // << 'Blitting a grid (with uniform sized cells) should result in a grid (with non-uniform sized cells).'
+ // << tcu::TestLog::EndMessage;
+
+ // Verify that destination only contains valid colors
+
+ /** @type {tcuRGBA.RGBA} */ var color;
+
+ for (var dy = 0; dy < destinationArea[3] - destinationArea[1]; ++dy) {
+ for (var dx = 0; dx < destinationArea[2] - destinationArea[0]; ++dx) {
+ color = new tcuRGBA.RGBA(result.getPixel(destinationArea[0] + dx, destinationArea[1] + dy));
+
+ /** @const {boolean} */
+ var isValidColor =
+ tcuRGBA.compareThreshold(color, cellColorA, threshold) ||
+ tcuRGBA.compareThreshold(color, cellColorB, threshold);
+
+ if (!isValidColor) {
+ errorMask.setPixel(destinationArea[0] + dx, destinationArea[1] + dy, tcuRGBA.RGBA.red.toVec());
+ error = true;
+ }
+ }
+ }
+
+ if (error) {
+ // m_testCtx.getLog()
+ // << tcu::TestLog::Message
+ // << 'Image verification failed, destination rect contains unexpected values. '
+ // << 'Expected either ' << cellColorA << ' or ' << cellColorB << '.'
+ // << tcu::TestLog::EndMessage
+ // << tcu::TestLog::ImageSet('Result', 'Image verification result')
+ // << tcu::TestLog::Image('Result', 'Result', result)
+ // << tcu::TestLog::Image('ErrorMask', 'Error mask', errorMask)
+ // << tcu::TestLog::EndImageSet;
+ return false;
+ }
+
+ // Detect result edges by reading the first row and first column of the blitted area.
+ // Blitting a grid should result in a grid-like image. ('sign changes' should be consistent)
+
+ for (var dx = 0; dx < destinationArea[2] - destinationArea[0]; ++dx) {
+ color = new tcuRGBA.RGBA(result.getPixel(destinationArea[0] + dx, destinationArea[1]));
+ if (tcuRGBA.compareThreshold(color, cellColorA, threshold))
+ horisontalSign[dx] = true;
+ else if (tcuRGBA.compareThreshold(color, cellColorB, threshold))
+ horisontalSign[dx] = false;
+ else
+ DE_ASSERT(false);
+ }
+ for (var dy = 0; dy < destinationArea[3] - destinationArea[1]; ++dy) {
+ color = new tcuRGBA.RGBA(result.getPixel(destinationArea[0], destinationArea[1] + dy));
+
+ if (tcuRGBA.compareThreshold(color, cellColorA, threshold))
+ verticalSign[dy] = true;
+ else if (tcuRGBA.compareThreshold(color, cellColorB, threshold))
+ verticalSign[dy] = false;
+ else
+ DE_ASSERT(false);
+ }
+
+ // Verify grid-like image
+
+ for (var dy = 0; dy < destinationArea[3] - destinationArea[1]; ++dy) {
+ for (var dx = 0; dx < destinationArea[2] - destinationArea[0]; ++dx) {
+ color = new tcuRGBA.RGBA(result.getPixel(destinationArea[0] + dx, destinationArea[1] + dy));
+ /** @const {boolean} */ var resultSign = tcuRGBA.compareThreshold(cellColorA, color, threshold);
+ /** @const {boolean} */ var correctSign = (horisontalSign[dx] == verticalSign[dy]) == signConfig;
+
+ if (resultSign != correctSign) {
+ errorMask.setPixel(destinationArea[0] + dx, destinationArea[1] + dy, tcuRGBA.RGBA.red.toVec());
+ error = true;
+ }
+ }
+ }
+ // Report result
+
+ // if (error)
+ // {
+ // m_testCtx.getLog()
+ // << tcu::TestLog::Message
+ // << 'Image verification failed, nearest filter is not consistent.'
+ // << tcu::TestLog::EndMessage
+ // << tcu::TestLog::ImageSet('Result', 'Image verification result')
+ // << tcu::TestLog::Image('Result', 'Result', result)
+ // << tcu::TestLog::Image('ErrorMask', 'Error mask', errorMask)
+ // << tcu::TestLog::EndImageSet;
+ // }
+ // else
+ // {
+ // m_testCtx.getLog()
+ // << tcu::TestLog::Message
+ // << 'Image verification passed.'
+ // << tcu::TestLog::EndMessage
+ // << tcu::TestLog::ImageSet('Result', 'Image verification result')
+ // << tcu::TestLog::Image('Result', 'Result', result)
+ // << tcu::TestLog::EndImageSet;
+ // }
+
+ return !error;
+ };
+
+ /**
+ * es3fFramebufferBlitTests.FramebufferBlitTests class, inherits from TestCase
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fFramebufferBlitTests.FramebufferBlitTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'blit', 'Framebuffer blit tests');
+ };
+
+ es3fFramebufferBlitTests.FramebufferBlitTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fFramebufferBlitTests.FramebufferBlitTests.prototype.constructor = es3fFramebufferBlitTests.FramebufferBlitTests;
+
+ es3fFramebufferBlitTests.FramebufferBlitTests.prototype.init = function() {
+ /** @const {Array<number>} */ var colorFormats = [
+ // RGBA formats
+ gl.RGBA32I,
+ gl.RGBA32UI,
+ gl.RGBA16I,
+ gl.RGBA16UI,
+ gl.RGBA8,
+ gl.RGBA8I,
+ gl.RGBA8UI,
+ gl.SRGB8_ALPHA8,
+ gl.RGB10_A2,
+ gl.RGB10_A2UI,
+ gl.RGBA4,
+ gl.RGB5_A1,
+
+ // RGB formats
+ gl.RGB8,
+ gl.RGB565,
+
+ // RG formats
+ gl.RG32I,
+ gl.RG32UI,
+ gl.RG16I,
+ gl.RG16UI,
+ gl.RG8,
+ gl.RG8I,
+ gl.RG8UI,
+
+ // R formats
+ gl.R32I,
+ gl.R32UI,
+ gl.R16I,
+ gl.R16UI,
+ gl.R8,
+ gl.R8I,
+ gl.R8UI,
+
+ // gl.EXT_color_buffer_float
+ gl.RGBA32F,
+ gl.RGBA16F,
+ gl.R11F_G11F_B10F,
+ gl.RG32F,
+ gl.RG16F,
+ gl.R32F,
+ gl.R16F
+ ];
+
+ /** @const {Array<number>} */ var depthStencilFormats = [
+ gl.DEPTH_COMPONENT32F,
+ gl.DEPTH_COMPONENT24,
+ gl.DEPTH_COMPONENT16,
+ gl.DEPTH32F_STENCIL8,
+ gl.DEPTH24_STENCIL8,
+ gl.STENCIL_INDEX8
+ ];
+
+ // .rect
+ /** @constructor
+ * @param {string} name
+ * @param {Array<number>} srcRect
+ * @param {Array<number>} dstRect
+ */
+ var CopyRect = function(name, srcRect, dstRect) {
+ /** @const {string} */ this.name = name;
+ /** @type {Array<number>} */ this.srcRect = srcRect;
+ /** @type {Array<number>} */ this.dstRect = dstRect;
+ };
+
+ /** @const {Array<CopyRect>} */ var copyRects = [
+ new CopyRect('basic', [10, 20, 65, 100], [45, 5, 100, 85]),
+ new CopyRect('scale', [10, 20, 65, 100], [25, 30, 125, 94]),
+ new CopyRect('out_of_bounds', [-10, -15, 100, 63], [50, 30, 136, 144])
+ ];
+
+ /** @const {Array<CopyRect>} */ var filterConsistencyRects = [
+
+ new CopyRect('mag', [20, 10, 74, 88], [10, 10, 91, 101]),
+ new CopyRect('min', [10, 20, 78, 100], [20, 20, 71, 80]),
+ new CopyRect('out_of_bounds_mag', [21, 10, 73, 82], [11, 43, 141, 151]),
+ new CopyRect('out_of_bounds_min', [11, 21, 77, 97], [80, 82, 135, 139])
+ ];
+
+ /** @constructor
+ * @param {?string} name
+ * @param {Array<number>} srcSwizzle
+ * @param {Array<number>} dstSwizzle
+ */
+ var Swizzle = function(name, srcSwizzle, dstSwizzle) {
+ /** @const {?string} */ this.name = name;
+ /** @type {Array<number>} */ this.srcSwizzle = srcSwizzle;
+ /** @type {Array<number>} */ this.dstSwizzle = dstSwizzle;
+ };
+
+ /** @const {Array<Swizzle>} */ var swizzles = [
+ new Swizzle(null, [0, 1, 2, 3], [0, 1, 2, 3]),
+ new Swizzle('reverse_src_x', [2, 1, 0, 3], [0, 1, 2, 3]),
+ new Swizzle('reverse_src_y', [0, 3, 2, 1], [0, 1, 2, 3]),
+ new Swizzle('reverse_dst_x', [0, 1, 2, 3], [2, 1, 0, 3]),
+ new Swizzle('reverse_dst_y', [0, 1, 2, 3], [0, 3, 2, 1]),
+ new Swizzle('reverse_src_dst_x', [2, 1, 0, 3], [2, 1, 0, 3]),
+ new Swizzle('reverse_src_dst_y', [0, 3, 2, 1], [0, 3, 2, 1])
+ ];
+
+ /** @const {Array<number>} */ var srcSize = [127, 119];
+ /** @const {Array<number>} */ var dstSize = [132, 128];
+
+ // Blit rectangle tests.
+ for (var rectNdx = 0; rectNdx < copyRects.length; rectNdx++) {
+ /** @type {tcuTestCase.DeqpTest} */ var rectGroup = tcuTestCase.newTest('rect', 'Blit rectangle tests');
+ this.addChild(rectGroup);
+
+ for (var swzNdx = 0; swzNdx < swizzles.length; swzNdx++) {
+ /** @type {string} */ var name = copyRects[rectNdx].name + (swizzles[swzNdx].name ? ('_' + swizzles[swzNdx].name) : '');
+ /** @type {Array<number>} */ var srcSwz = swizzles[swzNdx].srcSwizzle;
+ /** @type {Array<number>} */ var dstSwz = swizzles[swzNdx].dstSwizzle;
+ /** @type {Array<number>} */ var srcRect = deMath.swizzle(copyRects[rectNdx].srcRect, srcSwz);
+ /** @type {Array<number>} */ var dstRect = deMath.swizzle(copyRects[rectNdx].dstRect, dstSwz);
+
+ rectGroup.addChild(new es3fFramebufferBlitTests.BlitRectCase((name + '_nearest'), '', gl.NEAREST, srcSize, srcRect, dstSize, dstRect));
+ rectGroup.addChild(new es3fFramebufferBlitTests.BlitRectCase((name + '_linear'), '', gl.LINEAR, srcSize, srcRect, dstSize, dstRect));
+ }
+ }
+
+ // Nearest filter tests
+ for (var rectNdx = 0; rectNdx < filterConsistencyRects.length; rectNdx++) {
+ /** @type {tcuTestCase.DeqpTest} */ var rectGroup = tcuTestCase.newTest('rect', 'Blit rectangle tests');
+ this.addChild(rectGroup);
+ for (var swzNdx = 0; swzNdx < swizzles.length; swzNdx++) {
+ var name = 'nearest_consistency_' + filterConsistencyRects[rectNdx].name + (swizzles[swzNdx].name ? ('_' + swizzles[swzNdx].name) : '');
+ var srcSwz = swizzles[swzNdx].srcSwizzle;
+ var dstSwz = swizzles[swzNdx].dstSwizzle;
+ var srcRect = deMath.swizzle(filterConsistencyRects[rectNdx].srcRect, srcSwz);
+ var dstRect = deMath.swizzle(filterConsistencyRects[rectNdx].dstRect, dstSwz);
+
+ rectGroup.addChild(new es3fFramebufferBlitTests.BlitNearestFilterConsistencyCase(name, 'Test consistency of the nearest filter', srcSize, srcRect, dstSize, dstRect));
+ }
+ }
+
+ // .conversion
+ for (var srcFmtNdx = 0; srcFmtNdx < colorFormats.length; srcFmtNdx++) {
+ /** @type {tcuTestCase.DeqpTest} */ var conversionGroup = tcuTestCase.newTest('conversion', 'Color conversion tests');
+ this.addChild(conversionGroup);
+ for (var dstFmtNdx = 0; dstFmtNdx < colorFormats.length; dstFmtNdx++) {
+ /** @type {number} */ var srcFormat = colorFormats[srcFmtNdx];
+ /** @type {tcuTexture.TextureFormat} */ var srcTexFmt = gluTextureUtil.mapGLInternalFormat(srcFormat);
+ /** @type {tcuTexture.TextureChannelClass} */ var srcType = tcuTexture.getTextureChannelClass(srcTexFmt.type);
+ /** @type {number} */ var dstFormat = colorFormats[dstFmtNdx];
+ /** @type {tcuTexture.TextureFormat} */ var dstTexFmt = gluTextureUtil.mapGLInternalFormat(dstFormat);
+ /** @type {tcuTexture.TextureChannelClass} */ var dstType = tcuTexture.getTextureChannelClass(dstTexFmt.type);
+
+ if (((srcType == tcuTexture.TextureChannelClass.FLOATING_POINT || srcType == tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT) !=
+ (dstType == tcuTexture.TextureChannelClass.FLOATING_POINT || dstType == tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT)) ||
+ ((srcType == tcuTexture.TextureChannelClass.SIGNED_INTEGER) != (dstType == tcuTexture.TextureChannelClass.SIGNED_INTEGER)) ||
+ ((srcType == tcuTexture.TextureChannelClass.UNSIGNED_INTEGER) != (dstType == tcuTexture.TextureChannelClass.UNSIGNED_INTEGER)))
+ continue; // Conversion not supported.
+
+ var name = es3fFboTestUtil.getFormatName(srcFormat) + '_to_' + es3fFboTestUtil.getFormatName(dstFormat);
+
+ conversionGroup.addChild(new es3fFramebufferBlitTests.BlitColorConversionCase(name, '', srcFormat, dstFormat, [127, 113]));
+ }
+ }
+
+ // .depth_stencil
+ /** @type {tcuTestCase.DeqpTest} */ var depthStencilGroup = tcuTestCase.newTest('depth_stencil', 'Depth and stencil blits');
+ this.addChild(depthStencilGroup);
+
+ for (var fmtNdx = 0; fmtNdx < depthStencilFormats.length; fmtNdx++) {
+ /** @type {number} */ var format = depthStencilFormats[fmtNdx];
+ /** @type {tcuTexture.TextureFormat} */ var texFmt = gluTextureUtil.mapGLInternalFormat(format);
+ /** @type {string} */ var fmtName = es3fFboTestUtil.getFormatName(format);
+ /** @type {boolean} */ var depth = texFmt.order == tcuTexture.ChannelOrder.D || texFmt.order == tcuTexture.ChannelOrder.DS;
+ /** @type {boolean} */ var stencil = texFmt.order == tcuTexture.ChannelOrder.S || texFmt.order == tcuTexture.ChannelOrder.DS;
+ /** @type {number} */ var buffers = (depth ? gl.DEPTH_BUFFER_BIT : 0) | (stencil ? gl.STENCIL_BUFFER_BIT : 0);
+
+ depthStencilGroup.addChild(new es3fFramebufferBlitTests.BlitDepthStencilCase((fmtName + '_basic'), '', format, buffers, [128, 128], [0, 0, 128, 128], buffers, [128, 128], [0, 0, 128, 128], buffers));
+ depthStencilGroup.addChild(new es3fFramebufferBlitTests.BlitDepthStencilCase((fmtName + '_scale'), '', format, buffers, [127, 119], [10, 30, 100, 70], buffers, [111, 130], [20, 5, 80, 130], buffers));
+
+ if (depth && stencil) {
+ depthStencilGroup.addChild(new es3fFramebufferBlitTests.BlitDepthStencilCase((fmtName + '_depth_only'), '', format, buffers, [128, 128], [0, 0, 128, 128], buffers, [128, 128], [0, 0, 128, 128], gl.DEPTH_BUFFER_BIT));
+ depthStencilGroup.addChild(new es3fFramebufferBlitTests.BlitDepthStencilCase((fmtName + '_stencil_only'), '', format, buffers, [128, 128], [0, 0, 128, 128], buffers, [128, 128], [0, 0, 128, 128], gl.STENCIL_BUFFER_BIT));
+ }
+ }
+
+ // .default_framebuffer
+ /**
+ * @constructor
+ * @param {string} name
+ * @param {es3fFramebufferBlitTests.BlitArea} area
+ */
+ var Area = function(name, area) {
+ /** @type {string} name */ this.name = name;
+ /** @type {es3fFramebufferBlitTests.BlitArea} area */ this.area = area;
+ };
+
+ /** @type {Array<Area>} */ var areas = [
+ new Area('scale', es3fFramebufferBlitTests.BlitArea.AREA_SCALE),
+ new Area('out_of_bounds', es3fFramebufferBlitTests.BlitArea.AREA_OUT_OF_BOUNDS)
+ ];
+
+ var numDefaultFbSubGroups = 7;
+ /** @type {Array<tcuTestCase.DeqpTest>} */ var defaultFbGroup = [];
+ for (var ii = 0; ii < numDefaultFbSubGroups; ++ii) {
+ defaultFbGroup[ii] = tcuTestCase.newTest('default_framebuffer', 'Blits with default framebuffer');
+ this.addChild(defaultFbGroup[ii]);
+ }
+ for (var fmtNdx = 0; fmtNdx < colorFormats.length; fmtNdx++) {
+ var format = colorFormats[fmtNdx];
+ var texFmt = gluTextureUtil.mapGLInternalFormat(format);
+ var fmtClass = tcuTexture.getTextureChannelClass(texFmt.type);
+ var filter = gluTextureUtil.isGLInternalColorFormatFilterable(format) ? gl.LINEAR : gl.NEAREST;
+ var filterable = gluTextureUtil.isGLInternalColorFormatFilterable(format);
+
+ if (fmtClass != tcuTexture.TextureChannelClass.FLOATING_POINT &&
+ fmtClass != tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT &&
+ fmtClass != tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT)
+ continue; // Conversion not supported.
+
+ defaultFbGroup[fmtNdx % numDefaultFbSubGroups].addChild(new es3fFramebufferBlitTests.BlitDefaultFramebufferCase(es3fFboTestUtil.getFormatName(format), '', format, filter));
+
+ for (var areaNdx = 0; areaNdx < areas.length; areaNdx++) {
+ var name = areas[areaNdx].name;
+ var addLinear = filterable;
+ var addNearest = !addLinear || (areas[areaNdx].area != es3fFramebufferBlitTests.BlitArea.AREA_OUT_OF_BOUNDS); // No need to check out-of-bounds with different filtering
+
+ if (addNearest) {
+
+ defaultFbGroup[fmtNdx % numDefaultFbSubGroups].addChild(new es3fFramebufferBlitTests.DefaultFramebufferBlitCase((es3fFboTestUtil.getFormatName(format) + '_nearest_' + name + '_blit_from_default'), '', format, gl.NEAREST, es3fFramebufferBlitTests.BlitDirection.BLIT_DEFAULT_TO_TARGET, areas[areaNdx].area));
+ defaultFbGroup[fmtNdx % numDefaultFbSubGroups].addChild(new es3fFramebufferBlitTests.DefaultFramebufferBlitCase((es3fFboTestUtil.getFormatName(format) + '_nearest_' + name + '_blit_to_default'), '', format, gl.NEAREST, es3fFramebufferBlitTests.BlitDirection.BLIT_TO_DEFAULT_FROM_TARGET, areas[areaNdx].area));
+ }
+
+ if (addLinear) {
+ defaultFbGroup[fmtNdx % numDefaultFbSubGroups].addChild(new es3fFramebufferBlitTests.DefaultFramebufferBlitCase((es3fFboTestUtil.getFormatName(format) + '_linear_' + name + '_blit_from_default'), '', format, gl.LINEAR, es3fFramebufferBlitTests.BlitDirection.BLIT_DEFAULT_TO_TARGET, areas[areaNdx].area));
+ defaultFbGroup[fmtNdx % numDefaultFbSubGroups].addChild(new es3fFramebufferBlitTests.DefaultFramebufferBlitCase((es3fFboTestUtil.getFormatName(format) + '_linear_' + name + '_blit_to_default'), '', format, gl.LINEAR, es3fFramebufferBlitTests.BlitDirection.BLIT_TO_DEFAULT_FROM_TARGET, areas[areaNdx].area));
+ }
+ }
+ }
+ };
+
+ /**
+ * @param {?tcuTexture.ChannelOrder} order
+ * @return {Array<boolean>}
+ */
+ es3fFramebufferBlitTests.getChannelMask = function(order) {
+ switch (order) {
+ case tcuTexture.ChannelOrder.R: return [true, false, false, false];
+ case tcuTexture.ChannelOrder.RG: return [true, true, false, false];
+ case tcuTexture.ChannelOrder.RGB: return [true, true, true, false];
+ case tcuTexture.ChannelOrder.RGBA: return [true, true, true, true];
+ case tcuTexture.ChannelOrder.sRGB: return [true, true, true, false];
+ case tcuTexture.ChannelOrder.sRGBA: return [true, true, true, true];
+ default:
+ DE_ASSERT(false);
+ return [false, false, false, false];
+ }
+ };
+
+ /**
+ * es3fFramebufferBlitTests.BlitColorConversionCase class, inherits from FboTestCase
+ * @constructor
+ * @extends {es3fFboTestCase.FboTestCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} srcFormat
+ * @param {number} dstFormat
+ * @param {Array<number>} size
+ */
+ es3fFramebufferBlitTests.BlitColorConversionCase = function(name, desc, srcFormat, dstFormat, size) {
+ es3fFboTestCase.FboTestCase.call(this, name, desc);
+ /** @type {number} */ this.m_srcFormat = srcFormat;
+ /** @type {number} */ this.m_dstFormat = dstFormat;
+ /** @type {Array<number>} */ this.m_size = size;
+ };
+
+ es3fFramebufferBlitTests.BlitColorConversionCase.prototype = Object.create(es3fFboTestCase.FboTestCase.prototype);
+ es3fFramebufferBlitTests.BlitColorConversionCase.prototype.constructor = es3fFramebufferBlitTests.BlitColorConversionCase;
+
+ es3fFramebufferBlitTests.BlitColorConversionCase.prototype.preCheck = function() {
+ this.checkFormatSupport(this.m_srcFormat);
+ this.checkFormatSupport(this.m_dstFormat);
+ return true; // No exception thrown
+ };
+
+ /**
+ * @param {tcuSurface.Surface} dst
+ */
+ es3fFramebufferBlitTests.BlitColorConversionCase.prototype.render = function(dst) {
+ var ctx = this.getCurrentContext();
+ /** @type {tcuTexture.TextureFormat} */ var srcFormat = gluTextureUtil.mapGLInternalFormat(this.m_srcFormat);
+ /** @type {tcuTexture.TextureFormat} */ var dstFormat = gluTextureUtil.mapGLInternalFormat(this.m_dstFormat);
+
+ /** @type {gluShaderUtil.DataType} */ var srcOutputType = es3fFboTestUtil.getFragmentOutputType(srcFormat);
+ /** @type {gluShaderUtil.DataType} */ var dstOutputType = es3fFboTestUtil.getFragmentOutputType(dstFormat);
+
+ // Compute ranges \note Doesn't handle case where src or dest is not subset of the another!
+ /** @type {tcuTextureUtil.TextureFormatInfo} */ var srcFmtRangeInfo = tcuTextureUtil.getTextureFormatInfo(srcFormat);
+ /** @type {tcuTextureUtil.TextureFormatInfo} */ var dstFmtRangeInfo = tcuTextureUtil.getTextureFormatInfo(dstFormat);
+
+ /** @type {Array<boolean>} */ var copyMask = deMath.logicalAndBool(es3fFramebufferBlitTests.getChannelMask(srcFormat.order), es3fFramebufferBlitTests.getChannelMask(dstFormat.order));
+ /** @type {Array<boolean>} */ var srcIsGreater = deMath.greaterThan(deMath.subtract(srcFmtRangeInfo.valueMax, srcFmtRangeInfo.valueMin), deMath.subtract(dstFmtRangeInfo.valueMax, dstFmtRangeInfo.valueMin));
+
+ /** @type {tcuTextureUtil.TextureFormatInfo} */ var srcRangeInfo = new tcuTextureUtil.TextureFormatInfo(
+ tcuTextureUtil.select(dstFmtRangeInfo.valueMin, srcFmtRangeInfo.valueMin, deMath.logicalAndBool(copyMask, srcIsGreater)),
+ tcuTextureUtil.select(dstFmtRangeInfo.valueMax, srcFmtRangeInfo.valueMax, deMath.logicalAndBool(copyMask, srcIsGreater)),
+ tcuTextureUtil.select(dstFmtRangeInfo.lookupScale, srcFmtRangeInfo.lookupScale, deMath.logicalAndBool(copyMask, srcIsGreater)),
+ tcuTextureUtil.select(dstFmtRangeInfo.lookupBias, srcFmtRangeInfo.lookupBias, deMath.logicalAndBool(copyMask, srcIsGreater)));
+ /** @type {tcuTextureUtil.TextureFormatInfo} */ var dstRangeInfo = new tcuTextureUtil.TextureFormatInfo(
+ tcuTextureUtil.select(dstFmtRangeInfo.valueMin, srcFmtRangeInfo.valueMin, deMath.logicalOrBool(deMath.logicalNotBool(copyMask), srcIsGreater)),
+ tcuTextureUtil.select(dstFmtRangeInfo.valueMax, srcFmtRangeInfo.valueMax, deMath.logicalOrBool(deMath.logicalNotBool(copyMask), srcIsGreater)),
+ tcuTextureUtil.select(dstFmtRangeInfo.lookupScale, srcFmtRangeInfo.lookupScale, deMath.logicalOrBool(deMath.logicalNotBool(copyMask), srcIsGreater)),
+ tcuTextureUtil.select(dstFmtRangeInfo.lookupBias, srcFmtRangeInfo.lookupBias, deMath.logicalOrBool(deMath.logicalNotBool(copyMask), srcIsGreater)));
+
+ // Shaders.
+ /** @type {es3fFboTestUtil.GradientShader} */
+ var gradientToSrcShader = new es3fFboTestUtil.GradientShader(srcOutputType);
+ /** @type {es3fFboTestUtil.GradientShader} */
+ var gradientToDstShader = new es3fFboTestUtil.GradientShader(dstOutputType);
+
+ var gradShaderSrcID = ctx.createProgram(gradientToSrcShader);
+ var gradShaderDstID = ctx.createProgram(gradientToDstShader);
+
+ var srcFbo;
+ var dstFbo;
+ var srcRbo;
+ var dstRbo;
+
+ // Create framebuffers.
+ // Source framebuffers
+ srcFbo = ctx.createFramebuffer();
+ srcRbo = ctx.createRenderbuffer();
+
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, srcRbo);
+ ctx.renderbufferStorage(gl.RENDERBUFFER, this.m_srcFormat, this.m_size[0], this.m_size[1]);
+
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, srcFbo);
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, srcRbo);
+ this.checkError();
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ // Destination framebuffers
+ dstFbo = ctx.createFramebuffer();
+ dstRbo = ctx.createRenderbuffer();
+
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, dstRbo);
+ ctx.renderbufferStorage(gl.RENDERBUFFER, this.m_dstFormat, this.m_size[0], this.m_size[1]);
+
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, dstFbo);
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, dstRbo);
+ this.checkError();
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ ctx.viewport(0, 0, this.m_size[0], this.m_size[1]);
+
+ // Render gradients.
+ for (var ndx = 0; ndx < 2; ndx++) {
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, ndx ? dstFbo : srcFbo);
+ if (ndx) {
+ gradientToDstShader.setGradient(ctx, gradShaderDstID, dstRangeInfo.valueMax, dstRangeInfo.valueMin);
+ rrUtil.drawQuad(ctx, gradShaderDstID, [-1, -1, 0], [1, 1, 0]);
+ } else {
+ gradientToSrcShader.setGradient(ctx, gradShaderSrcID, srcRangeInfo.valueMin, srcRangeInfo.valueMax);
+ rrUtil.drawQuad(ctx, gradShaderSrcID, [-1, -1, 0], [1, 1, 0]);
+ }
+ }
+
+ // Execute copy.
+ ctx.bindFramebuffer(gl.READ_FRAMEBUFFER, srcFbo);
+ ctx.bindFramebuffer(gl.DRAW_FRAMEBUFFER, dstFbo);
+ ctx.blitFramebuffer(0, 0, this.m_size[0], this.m_size[1], 0, 0, this.m_size[0], this.m_size[1], gl.COLOR_BUFFER_BIT, gl.NEAREST);
+ this.checkError();
+
+ // Read results.
+ ctx.bindFramebuffer(gl.READ_FRAMEBUFFER, dstFbo);
+ this.readPixelsUsingFormat(dst, 0, 0, this.m_size[0], this.m_size[1], dstFormat, dstRangeInfo.lookupScale, dstRangeInfo.lookupBias);
+
+ };
+
+ /**
+ * @param {tcuSurface.Surface} reference
+ * @param {tcuSurface.Surface} result
+ */
+ es3fFramebufferBlitTests.BlitColorConversionCase.prototype.compare = function(reference, result) {
+ /** @const {tcuTexture.TextureFormat} */ var srcFormat = gluTextureUtil.mapGLInternalFormat(this.m_srcFormat);
+ /** @const {tcuTexture.TextureFormat} */ var dstFormat = gluTextureUtil.mapGLInternalFormat(this.m_dstFormat);
+ /** @const {boolean} */ var srcIsSRGB = (srcFormat.order == tcuTexture.ChannelOrder.sRGBA);
+ /** @const {boolean} */ var dstIsSRGB = (dstFormat.order == tcuTexture.ChannelOrder.sRGBA);
+ /** @type {tcuRGBA.RGBA} */ var threshold = new tcuRGBA.RGBA();
+
+ if (dstIsSRGB)
+ threshold = es3fFboTestUtil.getToSRGBConversionThreshold(srcFormat, dstFormat);
+ else {
+ /** @type {tcuRGBA.RGBA} */ var srcMaxDiff = es3fFboTestUtil.getThresholdFromTextureFormat(srcFormat);
+ /** @type {tcuRGBA.RGBA} */ var dstMaxDiff = es3fFboTestUtil.getThresholdFromTextureFormat(dstFormat);
+ if (srcIsSRGB)
+ srcMaxDiff = tcuRGBA.multiply(srcMaxDiff, 2);
+
+ threshold = tcuRGBA.max(srcMaxDiff, dstMaxDiff);
+ }
+
+ // m_testCtx.getLog() << tcu::TestLog::Message << 'threshold = ' << threshold << tcu::TestLog::EndMessage;
+ return tcuImageCompare.pixelThresholdCompare('Result', 'Image comparison result', reference, result, threshold.toIVec());
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fFboTestCase.FboTestCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} format deUint32
+ * @param {number} srcBuffers deUint32
+ * @param {Array<number>} srcSize IVec2
+ * @param {Array<number>} srcRect IVec4
+ * @param {number} dstBuffers deUint32
+ * @param {Array<number>} dstSize IVec2
+ * @param {Array<number>} dstRect IVec4
+ * @param {number} copyBuffers deUint32
+ */
+ es3fFramebufferBlitTests.BlitDepthStencilCase = function(name, desc, format, srcBuffers, srcSize, srcRect, dstBuffers, dstSize, dstRect, copyBuffers) {
+ es3fFboTestCase.FboTestCase.call(this, name, desc);
+ /** @type {number} */ this.m_format = format;
+ /** @type {number} */ this.m_srcBuffers = srcBuffers;
+ /** @type {Array<number>} */ this.m_srcSize = srcSize;
+ /** @type {Array<number>} */ this.m_srcRect = srcRect;
+ /** @type {number} */ this.m_dstBuffers = dstBuffers;
+ /** @type {Array<number>} */ this.m_dstSize = dstSize;
+ /** @type {Array<number>} */ this.m_dstRect = dstRect;
+ /** @type {number} */ this.m_copyBuffers = copyBuffers;
+ };
+
+ es3fFramebufferBlitTests.BlitDepthStencilCase.prototype = Object.create(es3fFboTestCase.FboTestCase.prototype);
+ es3fFramebufferBlitTests.BlitDepthStencilCase.prototype.constructor = es3fFramebufferBlitTests.BlitDepthStencilCase;
+
+ /**
+ * @protected
+ */
+ es3fFramebufferBlitTests.BlitDepthStencilCase.prototype.preCheck = function() {
+ this.checkFormatSupport(this.m_format);
+ return true; // No exception thrown
+ };
+
+ /**
+ * @protected
+ * @param {tcuSurface.Surface} dst
+ */
+ es3fFramebufferBlitTests.BlitDepthStencilCase.prototype.render = function(dst) {
+ var ctx = this.getCurrentContext();
+ /** @const {number} */ var colorFormat = gl.RGBA8;
+ var gradShader = new es3fFboTestUtil.GradientShader(gluShaderUtil.DataType.FLOAT_VEC4);
+ var texShader = new es3fFboTestUtil.Texture2DShader(
+ [gluShaderUtil.DataType.SAMPLER_2D] ,
+ gluShaderUtil.DataType.FLOAT_VEC4);
+ var flatShader = new es3fFboTestUtil.FlatColorShader(gluShaderUtil.DataType.FLOAT_VEC4);
+
+ var flatShaderID = ctx.createProgram(flatShader);
+ var texShaderID = ctx.createProgram(texShader);
+ var gradShaderID = ctx.createProgram(gradShader);
+
+ var srcFbo;
+ var dstFbo;
+ var srcColorRbo;
+ var dstColorRbo;
+ var srcDepthStencilRbo;
+ var dstDepthStencilRbo;
+
+ // setup shaders
+ gradShader.setGradient(ctx, gradShaderID, [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]);
+ texShader.setUniforms(ctx, texShaderID);
+
+ // Create framebuffers
+ // Source framebuffers
+ srcFbo = ctx.createFramebuffer();
+ srcColorRbo = ctx.createRenderbuffer();
+ srcDepthStencilRbo = ctx.createRenderbuffer();
+
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, srcColorRbo);
+ ctx.renderbufferStorage(gl.RENDERBUFFER, colorFormat, this.m_srcSize[0], this.m_srcSize[1]);
+
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, srcDepthStencilRbo);
+ ctx.renderbufferStorage(gl.RENDERBUFFER, this.m_format, this.m_srcSize[0], this.m_srcSize[1]);
+
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, srcFbo);
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, srcColorRbo);
+
+ if (this.m_srcBuffers & gl.DEPTH_BUFFER_BIT)
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, srcDepthStencilRbo);
+ if (this.m_srcBuffers & gl.STENCIL_BUFFER_BIT)
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, srcDepthStencilRbo);
+
+ this.checkError();
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ // Clear depth to 1 and stencil to 0.
+ ctx.clearBufferfi(gl.DEPTH_STENCIL, 0, 1.0, 0);
+
+ // Destination framebuffers
+ dstFbo = ctx.createFramebuffer();
+ dstColorRbo = ctx.createRenderbuffer();
+ dstDepthStencilRbo = ctx.createRenderbuffer();
+
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, dstColorRbo);
+ ctx.renderbufferStorage(gl.RENDERBUFFER, colorFormat, this.m_dstSize[0], this.m_dstSize[1]);
+
+ ctx.bindRenderbuffer(gl.RENDERBUFFER, dstDepthStencilRbo);
+ ctx.renderbufferStorage(gl.RENDERBUFFER, this.m_format, this.m_dstSize[0], this.m_dstSize[1]);
+
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, dstFbo);
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, dstColorRbo);
+
+ if (this.m_dstBuffers & gl.DEPTH_BUFFER_BIT)
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, dstDepthStencilRbo);
+ if (this.m_dstBuffers & gl.STENCIL_BUFFER_BIT)
+ ctx.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, dstDepthStencilRbo);
+
+ this.checkError();
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ // Clear depth to 1 and stencil to 0.
+ ctx.clearBufferfi(gl.DEPTH_STENCIL, 0, 1.0, 0);
+
+ // Fill source with gradient, depth = [-1..1], stencil = 7
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, srcFbo);
+ ctx.viewport(0, 0, this.m_srcSize[0], this.m_srcSize[1]);
+ ctx.enable(gl.DEPTH_TEST);
+ ctx.enable(gl.STENCIL_TEST);
+ ctx.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE);
+ ctx.stencilFunc(gl.ALWAYS, 7, 0xff);
+
+ rrUtil.drawQuad(ctx, gradShaderID, [-1, -1, -1], [1, 1, 1]);
+
+ // Fill destination with grid pattern, depth = 0 and stencil = 1
+ /** @const {number} */ var format = gl.RGBA;
+ /** @const {number} */ var dataType = gl.UNSIGNED_BYTE;
+ /** @const {number} */ var texW = this.m_srcSize[0];
+ /** @const {number} */ var texH = this.m_srcSize[1];
+ /** @type {WebGLTexture|sglrReferenceContext.TextureContainer} */ var gridTex = null;
+ /** @type {tcuTexture.TextureLevel} */ var data = new tcuTexture.TextureLevel(gluTextureUtil.mapGLTransferFormat(format, dataType), texW, texH, 1);
+
+ tcuTextureUtil.fillWithGrid(data.getAccess(), 8, [0.2, 0.7, 0.1, 1.0], [0.7, 0.1, 0.5, 0.8]);
+
+ gridTex = ctx.createTexture();
+ ctx.bindTexture(gl.TEXTURE_2D, gridTex);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+ ctx.texImage2D(gl.TEXTURE_2D, 0, format, texW, texH, 0, format, dataType, data.getAccess().getDataPtr());
+
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, dstFbo);
+ ctx.viewport(0, 0, this.m_dstSize[0], this.m_dstSize[1]);
+ ctx.stencilFunc(gl.ALWAYS, 1, 0xff);
+
+ rrUtil.drawQuad(ctx, texShaderID, [-1, -1, 0], [1, 1, 0]);
+
+ // Perform copy.
+ ctx.bindFramebuffer(gl.READ_FRAMEBUFFER, srcFbo);
+ ctx.bindFramebuffer(gl.DRAW_FRAMEBUFFER, dstFbo);
+ ctx.blitFramebuffer(this.m_srcRect[0], this.m_srcRect[1], this.m_srcRect[2], this.m_srcRect[3], this.m_dstRect[0], this.m_dstRect[1], this.m_dstRect[2], this.m_dstRect[3], this.m_copyBuffers, gl.NEAREST);
+
+ // Render blue color where depth < 0, decrement on depth failure.
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, dstFbo);
+ ctx.viewport(0, 0, this.m_dstSize[0], this.m_dstSize[1]);
+ ctx.stencilOp(gl.KEEP, gl.DECR, gl.KEEP);
+ ctx.stencilFunc(gl.ALWAYS, 0, 0xff);
+
+ flatShader.setColor(this.getCurrentContext(), flatShaderID, [0.0, 0.0, 1.0, 1.0]);
+
+ rrUtil.drawQuad(ctx, flatShaderID, [-1, -1, 0], [1, 1, 0]);
+
+ if (this.m_dstBuffers & gl.STENCIL_BUFFER_BIT) {
+ // Render green color where stencil == 6.
+ ctx.disable(gl.DEPTH_TEST);
+ ctx.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);
+ ctx.stencilFunc(gl.EQUAL, 6, 0xff);
+
+ flatShader.setColor(this.getCurrentContext(), flatShaderID, [0.0, 1.0, 0.0, 1.0]);
+
+ rrUtil.drawQuad(ctx, flatShaderID, [-1, -1, 0], [1, 1, 0]);
+
+ }
+ this.readPixelsUsingFormat(dst, 0, 0, this.m_dstSize[0], this.m_dstSize[1], gluTextureUtil.mapGLInternalFormat(colorFormat), [1.0, 1.0, 1.0, 1.0], [0.0, 0.0, 0.0, 0.0]);
+
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fFboTestCase.FboTestCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} format
+ * @param {number} filter
+ */
+ es3fFramebufferBlitTests.BlitDefaultFramebufferCase = function(name, desc, format, filter) {
+ es3fFboTestCase.FboTestCase.call(this, name, desc);
+ /** @const {number} */ this.m_format = format;
+ /** @const {number} */ this.m_filter = filter;
+ };
+
+ es3fFramebufferBlitTests.BlitDefaultFramebufferCase.prototype = Object.create(es3fFboTestCase.FboTestCase.prototype);
+ es3fFramebufferBlitTests.BlitDefaultFramebufferCase.prototype.constructor = es3fFramebufferBlitTests.BlitDefaultFramebufferCase;
+
+ /**
+ * @protected
+ */
+ es3fFramebufferBlitTests.BlitDefaultFramebufferCase.prototype.preCheck = function() {
+ this.checkFormatSupport(this.m_format);
+ return true; // No exception thrown
+ };
+
+ /**
+ * @protected
+ * @param {tcuSurface.Surface} dst
+ */
+ es3fFramebufferBlitTests.BlitDefaultFramebufferCase.prototype.render = function(dst) {
+ var ctx = this.getCurrentContext();
+ /** @type {tcuTexture.TextureFormat} */ var colorFormat = gluTextureUtil.mapGLInternalFormat(this.m_format);
+ /** @type {gluTextureUtil.TransferFormat} */ var transferFmt = gluTextureUtil.getTransferFormat(colorFormat);
+
+ /** @type {es3fFboTestUtil.GradientShader} */ var gradShader = new es3fFboTestUtil.GradientShader(gluShaderUtil.DataType.FLOAT_VEC4);
+ /** @type {es3fFboTestUtil.Texture2DShader} */ var texShader = new es3fFboTestUtil.Texture2DShader([gluTextureUtil.getSampler2DType(colorFormat)], gluShaderUtil.DataType.FLOAT_VEC4);
+
+ var gradShaderID = ctx.createProgram(gradShader);
+ var texShaderID = ctx.createProgram(texShader);
+ var fbo;
+ var tex;
+ /** @const {number} */ var texW = 128;
+ /** @const {number} */ var texH = 128;
+
+ // Setup shaders
+ gradShader.setGradient(ctx, gradShaderID, [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]);
+ texShader.setUniforms(ctx, texShaderID);
+
+ // FBO
+ fbo = ctx.createFramebuffer();
+ tex = ctx.createTexture();
+
+ ctx.bindTexture(gl.TEXTURE_2D, tex);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, this.m_filter);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, this.m_filter);
+ ctx.texImage2D(gl.TEXTURE_2D, 0, this.m_format, texW, texH, 0, transferFmt.format, transferFmt.dataType, null);
+
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ ctx.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);
+ this.checkError();
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ // Render gradient to screen.
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, null);
+
+ rrUtil.drawQuad(ctx, gradShaderID, [-1, -1, 0], [1, 1, 0]);
+
+ // Blit gradient from screen to fbo.
+ ctx.bindFramebuffer(gl.DRAW_FRAMEBUFFER, fbo);
+ ctx.blitFramebuffer(0, 0, ctx.getWidth(), ctx.getHeight(), 0, 0, texW, texH, gl.COLOR_BUFFER_BIT, this.m_filter);
+
+ // Fill left half of viewport with quad that uses texture.
+ ctx.bindFramebuffer(gl.DRAW_FRAMEBUFFER, null);
+ ctx.clearBufferfv(gl.COLOR, 0, [1.0, 0.0, 0.0, 1.0]);
+
+ rrUtil.drawQuad(ctx, texShaderID, [-1, -1, 0], [1, 1, 0]);
+
+ // Blit fbo to right half.
+ ctx.bindFramebuffer(gl.READ_FRAMEBUFFER, fbo);
+ ctx.blitFramebuffer(0, 0, texW, texH, Math.floor(ctx.getWidth() / 2), 0, ctx.getWidth(), ctx.getHeight(), gl.COLOR_BUFFER_BIT, this.m_filter);
+
+ ctx.bindFramebuffer(gl.READ_FRAMEBUFFER, null);
+ this.readPixels(dst, 0, 0, ctx.getWidth(), ctx.getHeight());
+
+ };
+
+ /**
+ * @protected
+ * @param {tcuSurface.Surface} reference
+ * @param {tcuSurface.Surface} result
+ */
+ es3fFramebufferBlitTests.BlitDefaultFramebufferCase.prototype.compare = function(reference, result) {
+ /** @const {tcuRGBA.RGBA} */
+ var threshold = tcuRGBA.max(es3fFboTestUtil.getFormatThreshold(this.m_format), tcuRGBA.newRGBAComponents(12, 12, 12, 12));
+
+ //m_testCtx.getLog() << TestLog::Message << 'Comparing images, threshold: ' << threshold << TestLog::EndMessage;
+
+ return tcuImageCompare.bilinearCompare('Result', 'Image comparison result', reference.getAccess(), result.getAccess(), threshold);
+ };
+
+ /** @enum */
+ es3fFramebufferBlitTests.BlitDirection = {
+ BLIT_DEFAULT_TO_TARGET: 0,
+ BLIT_TO_DEFAULT_FROM_TARGET: 1
+ };
+
+ /** @enum */
+ es3fFramebufferBlitTests.BlitArea = {
+ AREA_SCALE: 0,
+ AREA_OUT_OF_BOUNDS: 1
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fFramebufferBlitTests.BlitDefaultFramebufferCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} format
+ * @param {number} filter
+ * @param {es3fFramebufferBlitTests.BlitDirection} dir
+ * @param {es3fFramebufferBlitTests.BlitArea} area
+ */
+ es3fFramebufferBlitTests.DefaultFramebufferBlitCase = function(name, desc, format, filter, dir, area) {
+ es3fFramebufferBlitTests.BlitDefaultFramebufferCase.call(this, name, desc, format, filter);
+ /** @const {es3fFramebufferBlitTests.BlitDirection} */ this.m_blitDir = dir;
+ /** @const {es3fFramebufferBlitTests.BlitArea} */ this.m_blitArea = area;
+ /** @type {Array<number>} */ this.m_srcRect = [-1, -1, -1, -1];
+ /** @type {Array<number>} */ this.m_dstRect = [-1, -1, -1, -1];
+ /** @type {Array<number>} */ this.m_interestingArea = [-1, -1, -1, -1];
+ };
+
+ es3fFramebufferBlitTests.DefaultFramebufferBlitCase.prototype = Object.create(es3fFramebufferBlitTests.BlitDefaultFramebufferCase.prototype);
+ es3fFramebufferBlitTests.DefaultFramebufferBlitCase.prototype.constructor = es3fFramebufferBlitTests.DefaultFramebufferBlitCase;
+
+ es3fFramebufferBlitTests.DefaultFramebufferBlitCase.prototype.init = function() {
+ // requirements
+ /** @const {number} */ var minViewportSize = 128;
+ if (gl.drawingBufferWidth < minViewportSize ||
+ gl.drawingBufferHeight < minViewportSize)
+ throw new Error('Viewport size ' + minViewportSize + 'x' + minViewportSize + ' required');
+
+ // prevent viewport randoming
+ this.m_viewportWidth = gl.drawingBufferWidth;
+ this.m_viewportHeight = gl.drawingBufferHeight;
+
+ // set proper areas
+ if (this.m_blitArea == es3fFramebufferBlitTests.BlitArea.AREA_SCALE) {
+ this.m_srcRect = [10, 20, 65, 100];
+ this.m_dstRect = [25, 30, 125, 94];
+ this.m_interestingArea = [0, 0, 128, 128];
+ } else if (this.m_blitArea == es3fFramebufferBlitTests.BlitArea.AREA_OUT_OF_BOUNDS) {
+ /** @const {Array<number>} */
+ var ubound = (this.m_blitDir == es3fFramebufferBlitTests.BlitDirection.BLIT_DEFAULT_TO_TARGET) ?
+ ([128, 128]) :
+ ([gl.drawingBufferWidth, gl.drawingBufferHeight]);
+
+ this.m_srcRect = [-10, -15, 100, 63];
+ this.m_dstRect = deMath.add(deMath.swizzle(ubound, [0, 1, 0, 1]), [-75, -99, 8, 16]);
+ this.m_interestingArea = [ubound[0] - 128, ubound[1] - 128, ubound[0], ubound[1]];
+ }
+ };
+
+ /**
+ * @param {tcuSurface.Surface} dst
+ */
+ es3fFramebufferBlitTests.DefaultFramebufferBlitCase.prototype.render = function(dst) {
+ /** @type {es3fFboTestCase.Context} */
+ var ctx = this.getCurrentContext();
+ // TOOD: implement
+ /** @type {tcuTexture.TextureFormat} */ var colorFormat = gluTextureUtil.mapGLInternalFormat(this.m_format);
+ /** @type {gluTextureUtil.TransferFormat} */ var transferFmt = gluTextureUtil.getTransferFormat(colorFormat);
+ /** @const {tcuTexture.TextureChannelClass} */
+ var targetClass = (this.m_blitDir == es3fFramebufferBlitTests.BlitDirection.BLIT_DEFAULT_TO_TARGET) ?
+ (tcuTexture.getTextureChannelClass(colorFormat.type)) :
+ (tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT);
+
+ var fbo;
+ var fboTex;
+ /** @const {number} */ var fboTexW = 128;
+ /** @const {number} */ var fboTexH = 128;
+ /** @const {number} */ var sourceWidth = (this.m_blitDir == es3fFramebufferBlitTests.BlitDirection.BLIT_DEFAULT_TO_TARGET) ? (ctx.getWidth()) : (fboTexW);
+ /** @const {number} */ var sourceHeight = (this.m_blitDir == es3fFramebufferBlitTests.BlitDirection.BLIT_DEFAULT_TO_TARGET) ? (ctx.getHeight()) : (fboTexH);
+ /** @const {number} */ var gridRenderWidth = Math.min(256, sourceWidth);
+ /** @const {number} */ var gridRenderHeight = Math.min(256, sourceHeight);
+
+ var targetFbo;
+ var sourceFbo;
+
+ // FBO
+ fbo = ctx.createFramebuffer();
+ fboTex = ctx.createTexture();
+
+ ctx.bindTexture(gl.TEXTURE_2D, fboTex);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, this.m_filter);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, this.m_filter);
+ ctx.texImage2D(gl.TEXTURE_2D, 0, this.m_format, fboTexW, fboTexH, 0, transferFmt.format, transferFmt.dataType, null);
+
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ ctx.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, fboTex, 0);
+ this.checkError();
+ this.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ targetFbo = (this.m_blitDir == es3fFramebufferBlitTests.BlitDirection.BLIT_DEFAULT_TO_TARGET) ? (fbo) : (null);
+ sourceFbo = (this.m_blitDir == es3fFramebufferBlitTests.BlitDirection.BLIT_DEFAULT_TO_TARGET) ? (null) : (fbo);
+
+ // Render grid to source framebuffer
+ /** @type {es3fFboTestUtil.Texture2DShader} */
+ var texShader = new es3fFboTestUtil.Texture2DShader(
+ [gluShaderUtil.DataType.SAMPLER_2D],
+ gluShaderUtil.DataType.FLOAT_VEC4);
+ var texShaderID = this.getCurrentContext().createProgram(texShader);
+ /** @const {number} */ var internalFormat = gl.RGBA8;
+ /** @const {number} */ var format = gl.RGBA;
+ /** @const {number} */ var dataType = gl.UNSIGNED_BYTE;
+ /** @const {number} */ var gridTexW = 128;
+ /** @const {number} */ var gridTexH = 128;
+ /** @type {WebGLTexture|framework.opengl.simplereference.sglrReferenceContext.TextureContainer|null} */
+ var gridTex = null;
+ /** @type {tcuTexture.TextureLevel} */ var data = new tcuTexture.TextureLevel(gluTextureUtil.mapGLTransferFormat(format, dataType), gridTexW, gridTexH, 1);
+
+ tcuTextureUtil.fillWithGrid(data.getAccess(), 9, [0.9, 0.5, 0.1, 0.9], [0.2, 0.8, 0.2, 0.7]);
+
+ gridTex = ctx.createTexture();
+ ctx.bindTexture(gl.TEXTURE_2D, gridTex);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ ctx.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+ ctx.texImage2D(gl.TEXTURE_2D, 0, internalFormat, gridTexW, gridTexH, 0, format, dataType, data.getAccess().getDataPtr());
+
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, sourceFbo);
+ ctx.viewport(0, 0, gridRenderWidth, gridRenderHeight);
+ ctx.clearBufferfv(gl.COLOR, 0, [1.0, 0.0, 0.0, 1.0]);
+
+ texShader.setUniforms(this.getCurrentContext(), texShaderID);
+
+ rrUtil.drawQuad(ctx, texShaderID, [-1, -1, 0], [1, 1, 0]);
+
+ ctx.useProgram(null);
+
+ // Blit source framebuffer to destination
+
+ ctx.bindFramebuffer(gl.READ_FRAMEBUFFER, sourceFbo);
+ ctx.bindFramebuffer(gl.DRAW_FRAMEBUFFER, targetFbo);
+ this.checkError();
+
+ if (targetClass == tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT ||
+ targetClass == tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT ||
+ targetClass == tcuTexture.TextureChannelClass.FLOATING_POINT)
+ ctx.clearBufferfv(gl.COLOR, 0, [1.0, 1.0, 0.0, 1.0]);
+ else if (targetClass == tcuTexture.TextureChannelClass.SIGNED_INTEGER)
+ ctx.clearBufferiv(gl.COLOR, 0, [0, 0, 0, 0]);
+ else if (targetClass == tcuTexture.TextureChannelClass.UNSIGNED_INTEGER)
+ ctx.clearBufferuiv(gl.COLOR, 0, [0, 0, 0, 0]);
+ else
+ DE_ASSERT(false);
+
+ ctx.blitFramebuffer(this.m_srcRect[0], this.m_srcRect[1], this.m_srcRect[2], this.m_srcRect[3], this.m_dstRect[0], this.m_dstRect[1], this.m_dstRect[2], this.m_dstRect[3], gl.COLOR_BUFFER_BIT, this.m_filter);
+ this.checkError();
+
+ // Read target
+
+ ctx.bindFramebuffer(gl.FRAMEBUFFER, targetFbo);
+
+ if (this.m_blitDir == es3fFramebufferBlitTests.BlitDirection.BLIT_TO_DEFAULT_FROM_TARGET)
+ this.readPixels(dst, this.m_interestingArea[0], this.m_interestingArea[1], this.m_interestingArea[2] - this.m_interestingArea[0], this.m_interestingArea[3] - this.m_interestingArea[1]);
+ else
+ this.readPixelsUsingFormat(dst, this.m_interestingArea[0], this.m_interestingArea[1], this.m_interestingArea[2] - this.m_interestingArea[0], this.m_interestingArea[3] - this.m_interestingArea[1], colorFormat, [1.0, 1.0, 1.0, 1.0], [0.0, 0.0, 0.0, 0.0]);
+
+ this.checkError();
+ };
+
+ es3fFramebufferBlitTests.run = function(context, range) {
+ gl = context;
+ //Set up root Test
+ var state = tcuTestCase.runner;
+
+ var test = new es3fFramebufferBlitTests.FramebufferBlitTests();
+ var testName = test.fullName();
+ var testDescription = test.getDescription() || '';
+
+ state.testName = testName;
+ state.setRoot(test);
+ //Set up name and description of this test series.
+ setCurrentTestName(testName);
+ description(testDescription);
+
+ try {
+ //Create test cases
+ test.init();
+ if (range)
+ state.setRange(range);
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ bufferedLogToConsole(err);
+ testFailedOptions('Failed to es3fFramebufferBlitTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fIndexedStateQueryTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fIndexedStateQueryTests.js
new file mode 100644
index 0000000000..a18f6708b2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fIndexedStateQueryTests.js
@@ -0,0 +1,409 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fIndexedStateQueryTests');
+goog.require('framework.common.tcuTestCase');
+goog.require('functional.gles3.es3fApiCase');
+
+goog.scope(function() {
+ var es3fIndexedStateQueryTests = functional.gles3.es3fIndexedStateQueryTests;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var es3fApiCase = functional.gles3.es3fApiCase;
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fIndexedStateQueryTests.TransformFeedbackCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fIndexedStateQueryTests.TransformFeedbackCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIndexedStateQueryTests.TransformFeedbackCase.prototype.constructor = es3fIndexedStateQueryTests.TransformFeedbackCase;
+
+ es3fIndexedStateQueryTests.TransformFeedbackCase.prototype.testTransformFeedback = function() {
+ throw new Error('This method should be overriden.');
+ };
+
+ es3fIndexedStateQueryTests.TransformFeedbackCase.prototype.test = function() {
+ /** @type {string} */ var transformFeedbackTestVertSource = '' +
+ '#version 300 es\n' +
+ 'out highp vec4 anotherOutput;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = vec4(0.0);\n' +
+ ' anotherOutput = vec4(0.0);\n' +
+ '}\n';
+ /** @type {string} */ var transformFeedbackTestFragSource = '' +
+ '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 fragColor;' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' fragColor = vec4(0.0);\n' +
+ '}\n';
+
+ /** @type {WebGLShader} */ var shaderVert = gl.createShader(gl.VERTEX_SHADER);
+ /** @type {WebGLShader} */ var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER);
+
+ gl.shaderSource(shaderVert, transformFeedbackTestVertSource);
+ gl.shaderSource(shaderFrag, transformFeedbackTestFragSource);
+
+ gl.compileShader(shaderVert);
+ gl.compileShader(shaderFrag);
+
+ /** @type {WebGLProgram} */ var shaderProg = gl.createProgram();
+ gl.attachShader(shaderProg, shaderVert);
+ gl.attachShader(shaderProg, shaderFrag);
+
+ /** @type {Array<string>} */ var transformFeedbackOutputs = ['gl_Position', 'anotherOutput'];
+
+ gl.transformFeedbackVaryings(shaderProg, transformFeedbackOutputs, gl.INTERLEAVED_ATTRIBS);
+ gl.linkProgram(shaderProg);
+
+ /** @type {WebGLTransformFeedback} */ var transformFeedbackId = gl.createTransformFeedback();
+ gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, transformFeedbackId);
+
+ this.testTransformFeedback();
+
+ // cleanup
+
+ gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, null);
+
+ gl.deleteTransformFeedback(transformFeedbackId);
+ gl.deleteShader(shaderVert);
+ gl.deleteShader(shaderFrag);
+ gl.deleteProgram(shaderProg);
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fIndexedStateQueryTests.TransformFeedbackCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fIndexedStateQueryTests.TransformFeedbackBufferBindingCase = function(name, description) {
+ es3fIndexedStateQueryTests.TransformFeedbackCase.call(this, name, description);
+ };
+
+ es3fIndexedStateQueryTests.TransformFeedbackBufferBindingCase.prototype = Object.create(es3fIndexedStateQueryTests.TransformFeedbackCase.prototype);
+ es3fIndexedStateQueryTests.TransformFeedbackBufferBindingCase.prototype.constructor = es3fIndexedStateQueryTests.TransformFeedbackBufferBindingCase;
+
+ es3fIndexedStateQueryTests.TransformFeedbackBufferBindingCase.prototype.testTransformFeedback = function() {
+ /** @type {number} */ var feedbackPositionIndex = 0;
+ /** @type {number} */ var feedbackOutputIndex = 1;
+ /** @type {Array<number>} */ var feedbackIndex = [feedbackPositionIndex, feedbackOutputIndex];
+
+ // bind buffers
+
+ /** @type {Array<WebGLBuffer>} */ var feedbackBuffers = [];
+ for (var ndx = 0; ndx < 2; ndx++)
+ feedbackBuffers[ndx] = gl.createBuffer();
+
+ for (var ndx = 0; ndx < feedbackBuffers.length; ndx++) {
+ gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, feedbackBuffers[ndx]);
+ gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, new Float32Array(16), gl.DYNAMIC_READ);
+ gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, feedbackIndex[ndx], feedbackBuffers[ndx]);
+ }
+
+ // test TRANSFORM_FEEDBACK_BUFFER_BINDING
+ for (var ndx = 0; ndx < feedbackBuffers.length; ndx++) {
+ var boundBuffer = /** @type {WebGLBuffer} */ (gl.getIndexedParameter(gl.TRANSFORM_FEEDBACK_BUFFER_BINDING, ndx));
+ this.check(boundBuffer === feedbackBuffers[ndx], 'buffers do not match');
+ }
+
+ // cleanup
+ for (var ndx = 0; ndx < feedbackBuffers.length; ndx++)
+ gl.deleteBuffer(feedbackBuffers[ndx]);
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fIndexedStateQueryTests.TransformFeedbackCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fIndexedStateQueryTests.TransformFeedbackBufferBufferCase = function(name, description) {
+ es3fIndexedStateQueryTests.TransformFeedbackCase.call(this, name, description);
+ };
+
+ es3fIndexedStateQueryTests.TransformFeedbackBufferBufferCase.prototype = Object.create(es3fIndexedStateQueryTests.TransformFeedbackCase.prototype);
+ es3fIndexedStateQueryTests.TransformFeedbackBufferBufferCase.prototype.constructor = es3fIndexedStateQueryTests.TransformFeedbackBufferBufferCase;
+
+ es3fIndexedStateQueryTests.TransformFeedbackBufferBufferCase.prototype.testTransformFeedback = function() {
+ /** @type {number} */ var feedbackPositionIndex = 0;
+ /** @type {number} */ var feedbackOutputIndex = 1;
+
+ /** @type {number} */ var rangeBufferOffset = 4;
+ /** @type {number} */ var rangeBufferSize = 8;
+
+ // bind buffers
+
+ /** @type {Array<WebGLBuffer>} */ var feedbackBuffers = [];
+ for (var ndx = 0; ndx < 2; ndx++)
+ feedbackBuffers[ndx] = gl.createBuffer();
+
+ gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, feedbackBuffers[0]);
+ gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, new Float32Array(16), gl.DYNAMIC_READ);
+ gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, feedbackPositionIndex, feedbackBuffers[0]);
+
+ gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, feedbackBuffers[1]);
+ gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, new Float32Array(16), gl.DYNAMIC_READ);
+ gl.bindBufferRange(gl.TRANSFORM_FEEDBACK_BUFFER, feedbackOutputIndex, feedbackBuffers[1], rangeBufferOffset, rangeBufferSize);
+
+ /** @type {Array<{index: number, pname: number, value: number}>} */ var requirements = [
+ {index: feedbackPositionIndex, pname: gl.TRANSFORM_FEEDBACK_BUFFER_START, value: 0},
+ {index: feedbackPositionIndex, pname: gl.TRANSFORM_FEEDBACK_BUFFER_SIZE, value: 0},
+ {index: feedbackOutputIndex, pname: gl.TRANSFORM_FEEDBACK_BUFFER_START, value: rangeBufferOffset},
+ {index: feedbackOutputIndex, pname: gl.TRANSFORM_FEEDBACK_BUFFER_SIZE, value: rangeBufferSize}
+ ];
+
+ for (var ndx = 0; ndx < requirements.length; ndx++) {
+ var state = /** @type {number} */ (gl.getIndexedParameter(requirements[ndx].pname, requirements[ndx].index));
+ this.check(state === requirements[ndx].value, 'got ' + state + '; expected ' + requirements[ndx].value);
+ }
+
+ // cleanup
+ for (var ndx = 0; ndx < feedbackBuffers.length; ndx++)
+ gl.deleteBuffer(feedbackBuffers[ndx]);
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fIndexedStateQueryTests.UniformBufferCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ /** @type {?WebGLProgram} */ this.m_program = null;
+ };
+
+ es3fIndexedStateQueryTests.UniformBufferCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIndexedStateQueryTests.UniformBufferCase.prototype.constructor = es3fIndexedStateQueryTests.UniformBufferCase;
+
+ es3fIndexedStateQueryTests.UniformBufferCase.prototype.testUniformBuffers = function() {
+ throw new Error('This method should be overriden.');
+ };
+
+ es3fIndexedStateQueryTests.UniformBufferCase.prototype.test = function() {
+
+ /** @type {string} */ var testVertSource = '' +
+ '#version 300 es\n' +
+ 'uniform highp vec4 input1;\n' +
+ 'uniform highp vec4 input2;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = input1 + input2;\n' +
+ '}\n';
+ /** @type {string} */ var testFragSource = '' +
+ '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 fragColor;' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' fragColor = vec4(0.0);\n' +
+ '}\n';
+
+ /** @type {WebGLShader} */ var shaderVert = gl.createShader(gl.VERTEX_SHADER);
+ /** @type {WebGLShader} */ var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER);
+
+ gl.shaderSource(shaderVert, testVertSource);
+ gl.shaderSource(shaderFrag, testFragSource);
+
+ gl.compileShader(shaderVert);
+ gl.compileShader(shaderFrag);
+
+ this.m_program = gl.createProgram();
+ gl.attachShader(this.m_program, shaderVert);
+ gl.attachShader(this.m_program, shaderFrag);
+ gl.linkProgram(this.m_program);
+ gl.useProgram(this.m_program);
+
+ this.testUniformBuffers();
+
+ gl.useProgram(null);
+ gl.deleteShader(shaderVert);
+ gl.deleteShader(shaderFrag);
+ gl.deleteProgram(this.m_program);
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fIndexedStateQueryTests.UniformBufferCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fIndexedStateQueryTests.UniformBufferBindingCase = function(name, description) {
+ es3fIndexedStateQueryTests.UniformBufferCase.call(this, name, description);
+ /** @type {?WebGLProgram} */ this.m_program = null;
+ };
+
+ es3fIndexedStateQueryTests.UniformBufferBindingCase.prototype = Object.create(es3fIndexedStateQueryTests.UniformBufferCase.prototype);
+ es3fIndexedStateQueryTests.UniformBufferBindingCase.prototype.constructor = es3fIndexedStateQueryTests.UniformBufferBindingCase;
+
+ es3fIndexedStateQueryTests.UniformBufferBindingCase.prototype.testUniformBuffers = function() {
+ /** @type {Array<string>} */ var uniformNames = ['input1', 'input2'];
+
+ /** @type {Array<number>} */ var uniformIndices = gl.getUniformIndices(this.m_program, uniformNames);
+
+ /** @type {Array<WebGLBuffer>} */ var buffers = [];
+ for (var ndx = 0; ndx < 2; ndx++)
+ buffers[ndx] = gl.createBuffer();
+
+ for (var ndx = 0; ndx < buffers.length; ++ndx) {
+ gl.bindBuffer(gl.UNIFORM_BUFFER, buffers[ndx]);
+ gl.bufferData(gl.UNIFORM_BUFFER, new Float32Array(32), gl.DYNAMIC_DRAW);
+ gl.bindBufferBase(gl.UNIFORM_BUFFER, uniformIndices[ndx], buffers[ndx]);
+ }
+
+ /** @type {Array<WebGLBuffer>} */ var boundBuffer = [];
+ for (var ndx = 0; ndx < buffers.length; ndx++) {
+ boundBuffer[ndx] = /** @type {WebGLBuffer} */ (gl.getIndexedParameter(gl.UNIFORM_BUFFER_BINDING, uniformIndices[ndx]));
+ this.check(boundBuffer[ndx] === buffers[ndx], 'buffers do not match');
+ }
+
+ for (var ndx = 0; ndx < buffers.length; ndx++)
+ gl.deleteBuffer(buffers[ndx]);
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fIndexedStateQueryTests.UniformBufferCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fIndexedStateQueryTests.UniformBufferBufferCase = function(name, description) {
+ es3fIndexedStateQueryTests.UniformBufferCase.call(this, name, description);
+ /** @type {?WebGLProgram} */ this.m_program = null;
+ };
+
+ es3fIndexedStateQueryTests.UniformBufferBufferCase.prototype = Object.create(es3fIndexedStateQueryTests.UniformBufferCase.prototype);
+ es3fIndexedStateQueryTests.UniformBufferBufferCase.prototype.constructor = es3fIndexedStateQueryTests.UniformBufferBufferCase;
+
+ es3fIndexedStateQueryTests.UniformBufferBufferCase.prototype.testUniformBuffers = function() {
+ /** @type {Array<string>} */ var uniformNames = ['input1', 'input2'];
+
+ /** @type {Array<number>} */ var uniformIndices = gl.getUniformIndices(this.m_program, uniformNames);
+
+ /** @type {number} */ var alignment = this.getAlignment();
+ if (alignment === -1) // cannot continue without this
+ return;
+
+ bufferedLogToConsole('Alignment is ' + alignment);
+
+ /** @type {number} */ var rangeBufferOffset = alignment;
+ /** @type {number} */ var rangeBufferSize = alignment * 2;
+ /** @type {number} */ var rangeBufferTotalSize = rangeBufferOffset + rangeBufferSize + 8; // + 8 has no special meaning, just to make it != with the size of the range
+
+ /** @type {Array<WebGLBuffer>} */ var buffers = [];
+ for (var ndx = 0; ndx < 2; ndx++)
+ buffers[ndx] = gl.createBuffer();
+
+ gl.bindBuffer(gl.UNIFORM_BUFFER, buffers[0]);
+ gl.bufferData(gl.UNIFORM_BUFFER, new Float32Array(32), gl.DYNAMIC_DRAW);
+ gl.bindBufferBase(gl.UNIFORM_BUFFER, uniformIndices[0], buffers[0]);
+
+ gl.bindBuffer(gl.UNIFORM_BUFFER, buffers[1]);
+ gl.bufferData(gl.UNIFORM_BUFFER, new Float32Array(32), gl.DYNAMIC_DRAW);
+ gl.bindBufferRange(gl.UNIFORM_BUFFER, uniformIndices[1], buffers[1], rangeBufferOffset, rangeBufferSize);
+
+ // test UNIFORM_BUFFER_START and UNIFORM_BUFFER_SIZE
+
+ /** @type {Array<{index: number, pname: number, value: number}>} */ var requirements = [
+ {index: uniformIndices[0], pname: gl.UNIFORM_BUFFER_START, value: 0},
+ {index: uniformIndices[0], pname: gl.UNIFORM_BUFFER_SIZE, value: 0},
+ {index: uniformIndices[1], pname: gl.UNIFORM_BUFFER_START, value: rangeBufferOffset},
+ {index: uniformIndices[1], pname: gl.UNIFORM_BUFFER_SIZE, value: rangeBufferSize}
+ ];
+
+ for (var ndx = 0; ndx < requirements.length; ndx++) {
+ var state = /** @type {number} */ (gl.getIndexedParameter(requirements[ndx].pname, requirements[ndx].index));
+
+ this.check(state === requirements[ndx].value, 'got ' + state + '; expected ' + requirements[ndx].value);
+ }
+
+ for (var ndx = 0; ndx < buffers.length; ndx++)
+ gl.deleteBuffer(buffers[ndx]);
+
+ };
+
+ /**
+ * @return {number}
+ */
+ es3fIndexedStateQueryTests.UniformBufferBufferCase.prototype.getAlignment = function() {
+ var state = /** @type {number} */ (gl.getParameter(gl.UNIFORM_BUFFER_OFFSET_ALIGNMENT));
+
+ if (state <= 256)
+ return state;
+
+ bufferedLogToConsole('ERROR: UNIFORM_BUFFER_OFFSET_ALIGNMENT has a maximum value of 256.');
+ testFailedOptions('invalid UNIFORM_BUFFER_OFFSET_ALIGNMENT value', false);
+
+ return -1;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fIndexedStateQueryTests.IndexedStateQueryTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'indexed', 'Indexed Integer Values');
+ };
+
+ es3fIndexedStateQueryTests.IndexedStateQueryTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fIndexedStateQueryTests.IndexedStateQueryTests.prototype.constructor = es3fIndexedStateQueryTests.IndexedStateQueryTests;
+
+ es3fIndexedStateQueryTests.IndexedStateQueryTests.prototype.init = function() {
+ // transform feedback
+ this.addChild(new es3fIndexedStateQueryTests.TransformFeedbackBufferBindingCase('transform_feedback_buffer_binding', 'TRANSFORM_FEEDBACK_BUFFER_BINDING'));
+ this.addChild(new es3fIndexedStateQueryTests.TransformFeedbackBufferBufferCase('transform_feedback_buffer_start_size', 'TRANSFORM_FEEDBACK_BUFFER_START and TRANSFORM_FEEDBACK_BUFFER_SIZE'));
+
+ // uniform buffers
+ this.addChild(new es3fIndexedStateQueryTests.UniformBufferBindingCase('uniform_buffer_binding', 'UNIFORM_BUFFER_BINDING'));
+ this.addChild(new es3fIndexedStateQueryTests.UniformBufferBufferCase('uniform_buffer_start_size', 'UNIFORM_BUFFER_START and UNIFORM_BUFFER_SIZE'));
+ };
+
+ /**
+ * Run test
+ * @param {WebGL2RenderingContext} context
+ */
+ es3fIndexedStateQueryTests.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fIndexedStateQueryTests.IndexedStateQueryTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fIndexedStateQueryTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fInstancedRenderingTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fInstancedRenderingTests.js
new file mode 100644
index 0000000000..adc7e857ca
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fInstancedRenderingTests.js
@@ -0,0 +1,711 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fInstancedRenderingTests');
+goog.require('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluTextureUtil');
+
+goog.scope(function() {
+
+var es3fInstancedRenderingTests = functional.gles3.es3fInstancedRenderingTests;
+var gluShaderUtil = framework.opengl.gluShaderUtil;
+var gluShaderProgram = framework.opengl.gluShaderProgram;
+var tcuTestCase = framework.common.tcuTestCase;
+var tcuSurface = framework.common.tcuSurface;
+var deString = framework.delibs.debase.deString;
+var deRandom = framework.delibs.debase.deRandom;
+var tcuImageCompare = framework.common.tcuImageCompare;
+var gluTextureUtil = framework.opengl.gluTextureUtil;
+var deMath = framework.delibs.debase.deMath;
+
+ /** @type {?WebGL2RenderingContext} */ var gl;
+
+ /** @const @type {number} */ es3fInstancedRenderingTests.MAX_RENDER_WIDTH = 128;
+ /** @const @type {number} */ es3fInstancedRenderingTests.MAX_RENDER_HEIGHT = 128;
+
+ /** @const @type {number} */ es3fInstancedRenderingTests.QUAD_GRID_SIZE = 127;
+
+ // Attribute divisors for the attributes defining the color's RGB components.
+ /** @const @type {number} */es3fInstancedRenderingTests.ATTRIB_DIVISOR_R = 3;
+ /** @const @type {number} */es3fInstancedRenderingTests.ATTRIB_DIVISOR_G = 2;
+ /** @const @type {number} */es3fInstancedRenderingTests.ATTRIB_DIVISOR_B = 1;
+
+ /** @const @type {number} */es3fInstancedRenderingTests.OFFSET_COMPONENTS = 3; // \note Affects whether a float or a vecN is used in shader, but only first component is non-zero.
+
+ // Scale and bias values when converting float to integer, when attribute is of integer type.
+ /** @const @type {number} */es3fInstancedRenderingTests.FLOAT_INT_SCALE = 100.0;
+ /** @const @type {number} */es3fInstancedRenderingTests.FLOAT_INT_BIAS = -50.0;
+ /** @const @type {number} */es3fInstancedRenderingTests.FLOAT_UINT_SCALE = 100.0;
+ /** @const @type {number} */es3fInstancedRenderingTests.FLOAT_UINT_BIAS = 0.0;
+
+ var DE_ASSERT = function(expression) {
+ if (!expression) throw new Error('Assert failed');
+ };
+
+ es3fInstancedRenderingTests.TCU_FAIL = function(message) {
+ throw new Error(message);
+ };
+
+ // es3fInstancedRenderingTests.InstancedRenderingCase
+
+ /**
+ * es3fInstancedRenderingTests.DrawFunction
+ * @enum {number}
+ */
+ es3fInstancedRenderingTests.DrawFunction = {
+ FUNCTION_DRAW_ARRAYS_INSTANCED: 0,
+ FUNCTION_DRAW_ELEMENTS_INSTANCED: 1
+ };
+
+ /**
+ * es3fInstancedRenderingTests.InstancingType
+ * @enum {number}
+ */
+ es3fInstancedRenderingTests.InstancingType = {
+ TYPE_INSTANCE_ID: 0,
+ TYPE_ATTRIB_DIVISOR: 1,
+ TYPE_MIXED: 2
+ };
+
+ /**
+ * es3fInstancedRenderingTests.InstancedRenderingCase class, inherits from TestCase class
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} description
+ * @param {es3fInstancedRenderingTests.DrawFunction} drawFunction
+ * @param {es3fInstancedRenderingTests.InstancingType} instancingType
+ * @param {gluShaderUtil.DataType} rgbAttrType
+ * @param {number} numInstances
+ */
+ es3fInstancedRenderingTests.InstancedRenderingCase = function(name, description, drawFunction, instancingType, rgbAttrType, numInstances) {
+ tcuTestCase.DeqpTest.call(this, name, description);
+ /** @type {es3fInstancedRenderingTests.DrawFunction} */ this.m_function = drawFunction;
+ /** @type {es3fInstancedRenderingTests.InstancingType} */ this.m_instancingType = instancingType;
+ /** @type {gluShaderUtil.DataType} */ this.m_rgbAttrType = rgbAttrType;
+ /** @type {number} */ this.m_numInstances = numInstances;
+ /** @type {gluShaderProgram.ShaderProgram} */ this.m_program = null;
+ /** @type {Array<number>} */ this.m_gridVertexPositions = [];
+ /** @type {Array<number>} */ this.m_gridIndices = [];
+ /** @type {Array<number>} */ this.m_instanceOffsets = [];
+ /** @type {Array<number>} */ this.m_instanceColorR = [];
+ /** @type {Array<number>} */ this.m_instanceColorG = [];
+ /** @type {Array<number>} */ this.m_instanceColorB = [];
+ };
+
+ es3fInstancedRenderingTests.InstancedRenderingCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fInstancedRenderingTests.InstancedRenderingCase.prototype.constructor = es3fInstancedRenderingTests.InstancedRenderingCase;
+
+ /**
+ * Helper function that does biasing and scaling when converting float to integer.
+ * @param {Array<number>} vec
+ * @param {number} val
+ */
+ es3fInstancedRenderingTests.InstancedRenderingCase.prototype.pushVarCompAttrib = function(vec, val) {
+ var isFloatCase = gluShaderUtil.isDataTypeFloatOrVec(this.m_rgbAttrType);
+ var isIntCase = gluShaderUtil.isDataTypeIntOrIVec(this.m_rgbAttrType);
+ var isUintCase = gluShaderUtil.isDataTypeUintOrUVec(this.m_rgbAttrType);
+ var isMatCase = gluShaderUtil.isDataTypeMatrix(this.m_rgbAttrType);
+ if (isFloatCase || isMatCase)
+ vec.push(val);
+ else if (isIntCase)
+ vec.push(val * es3fInstancedRenderingTests.FLOAT_INT_SCALE + es3fInstancedRenderingTests.FLOAT_INT_BIAS);
+ else if (isUintCase)
+ vec.push(val * es3fInstancedRenderingTests.FLOAT_UINT_SCALE + es3fInstancedRenderingTests.FLOAT_UINT_BIAS);
+ else
+ throw new Error('Invalid attribute type.');
+ };
+
+ es3fInstancedRenderingTests.InstancedRenderingCase.prototype.init = function() {
+ // Clear errors from previous tests
+ gl.getError();
+
+ /** @type {boolean} */ var isFloatCase = gluShaderUtil.isDataTypeFloatOrVec(this.m_rgbAttrType);
+ /** @type {boolean} */ var isIntCase = gluShaderUtil.isDataTypeIntOrIVec(this.m_rgbAttrType);
+ /** @type {boolean} */ var isUintCase = gluShaderUtil.isDataTypeUintOrUVec(this.m_rgbAttrType);
+ /** @type {boolean} */ var isMatCase = gluShaderUtil.isDataTypeMatrix(this.m_rgbAttrType);
+ /** @type {number} */ var typeSize = gluShaderUtil.getDataTypeScalarSize(this.m_rgbAttrType);
+ /** @type {boolean} */ var isScalarCase = typeSize == 1;
+ /** @type {string} */ var swizzleFirst = isScalarCase ? '' : '.x';
+ /** @type {string} */ var typeName = gluShaderUtil.getDataTypeName(this.m_rgbAttrType);
+
+ /** @type {string} */ var floatIntScaleStr = '(' + es3fInstancedRenderingTests.FLOAT_INT_SCALE.toFixed(3) + ')';
+ /** @type {string} */ var floatIntBiasStr = '(' + es3fInstancedRenderingTests.FLOAT_INT_BIAS.toFixed(3) + ')';
+ /** @type {string} */ var floatUintScaleStr = '(' + es3fInstancedRenderingTests.FLOAT_UINT_SCALE.toFixed(3) + ')';
+ /** @type {string} */ var floatUintBiasStr = '(' + es3fInstancedRenderingTests.FLOAT_UINT_BIAS.toFixed(3) + ')';
+
+ DE_ASSERT(isFloatCase || isIntCase || isUintCase || isMatCase);
+
+ // Generate shader.
+ // \note For case TYPE_MIXED, vertex position offset and color red component get their values from instance id, while green and blue get their values from instanced attributes.
+
+ /** @type {string} */ var numInstancesStr = this.m_numInstances.toString() + '.0';
+
+ /** @type {string} */ var instanceAttribs = '';
+ /** @type {string} */ var posExpression = '';
+ /** @type {string} */ var colorRExpression = '';
+ /** @type {string} */ var colorGExpression = '';
+ /** @type {string} */ var colorBExpression = '';
+
+ if (this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_INSTANCE_ID || this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_MIXED) {
+ posExpression = 'a_position + vec4(float(gl_InstanceID) * 2.0 / ' + numInstancesStr + ', 0.0, 0.0, 0.0)';
+ colorRExpression = 'float(gl_InstanceID)/' + numInstancesStr;
+
+ if (this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_INSTANCE_ID) {
+ colorGExpression = 'float(gl_InstanceID)*2.0/' + numInstancesStr;
+ colorBExpression = '1.0 - float(gl_InstanceID)/' + numInstancesStr;
+ }
+ }
+
+ if (this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR || this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_MIXED) {
+ if (this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR) {
+ posExpression = 'a_position + vec4(a_instanceOffset';
+
+ DE_ASSERT(es3fInstancedRenderingTests.OFFSET_COMPONENTS >= 1 && es3fInstancedRenderingTests.OFFSET_COMPONENTS <= 4);
+
+ for (var i = 0; i < 4 - es3fInstancedRenderingTests.OFFSET_COMPONENTS; i++)
+ posExpression += ', 0.0';
+ posExpression += ')';
+
+ if (isFloatCase)
+ colorRExpression = 'a_instanceR' + swizzleFirst;
+ else if (isIntCase)
+ colorRExpression = '(float(a_instanceR' + swizzleFirst + ') - ' + floatIntBiasStr + ') / ' + floatIntScaleStr;
+ else if (isUintCase)
+ colorRExpression = '(float(a_instanceR' + swizzleFirst + ') - ' + floatUintBiasStr + ') / ' + floatUintScaleStr;
+ else if (isMatCase)
+ colorRExpression = 'a_instanceR[0][0]';
+ else
+ DE_ASSERT(false);
+
+ instanceAttribs += 'in highp ' + (es3fInstancedRenderingTests.OFFSET_COMPONENTS == 1 ? 'float' : 'vec' + es3fInstancedRenderingTests.OFFSET_COMPONENTS.toString()) + ' a_instanceOffset;\n';
+ instanceAttribs += 'in mediump ' + typeName + ' a_instanceR;\n';
+ }
+
+ if (isFloatCase) {
+ colorGExpression = 'a_instanceG' + swizzleFirst;
+ colorBExpression = 'a_instanceB' + swizzleFirst;
+ } else if (isIntCase) {
+ colorGExpression = '(float(a_instanceG' + swizzleFirst + ') - ' + floatIntBiasStr + ') / ' + floatIntScaleStr;
+ colorBExpression = '(float(a_instanceB' + swizzleFirst + ') - ' + floatIntBiasStr + ') / ' + floatIntScaleStr;
+ } else if (isUintCase) {
+ colorGExpression = '(float(a_instanceG' + swizzleFirst + ') - ' + floatUintBiasStr + ') / ' + floatUintScaleStr;
+ colorBExpression = '(float(a_instanceB' + swizzleFirst + ') - ' + floatUintBiasStr + ') / ' + floatUintScaleStr;
+ } else if (isMatCase) {
+ colorGExpression = 'a_instanceG[0][0]';
+ colorBExpression = 'a_instanceB[0][0]';
+ } else
+ DE_ASSERT(false);
+
+ instanceAttribs += 'in mediump ' + typeName + ' a_instanceG;\n';
+ instanceAttribs += 'in mediump ' + typeName + ' a_instanceB;\n';
+ }
+
+ DE_ASSERT(!(posExpression.length == 0));
+ DE_ASSERT(!(colorRExpression.length == 0));
+ DE_ASSERT(!(colorGExpression.length == 0));
+ DE_ASSERT(!(colorBExpression.length == 0));
+
+ /** @type {string} */ var vertShaderSourceStr =
+ '#version 300 es\n' +
+ 'in highp vec4 a_position;\n' +
+ instanceAttribs +
+ 'out mediump vec4 v_color;\n' +
+ '\n' +
+ 'void main()\n' +
+ ' {\n' +
+ ' gl_Position = ' + posExpression + ';\n' +
+ ' v_color.r = ' + colorRExpression + ';\n' +
+ ' v_color.g = ' + colorGExpression + ';\n' +
+ ' v_color.b = ' + colorBExpression + ';\n' +
+ ' v_color.a = 1.0;\n' +
+ '}\n';
+
+ /** @type {string} */ var fragShaderSource =
+ '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 o_color;\n' +
+ 'in mediump vec4 v_color;\n' +
+ '\n' +
+ 'void main()\n' +
+ ' {\n' +
+ ' o_color = v_color;\n' +
+ '}\n';
+
+ // Create shader program and log it.
+
+ DE_ASSERT(!this.m_program);
+ this.m_program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertShaderSourceStr, fragShaderSource));
+
+ //tcu::TestLog& log = this.m_testCtx.getLog();
+ //log << *m_program;
+ // TODO: bufferedLogToConsole?
+ //bufferedLogToConsole(this.m_program);
+
+ assertMsgOptions(this.m_program.isOk(), 'Failed to compile shader', false, true);
+
+ // Vertex shader attributes.
+
+ if (this.m_function == es3fInstancedRenderingTests.DrawFunction.FUNCTION_DRAW_ELEMENTS_INSTANCED) {
+ // Vertex positions. Positions form a vertical bar of width <screen width>/<number of instances>.
+
+ for (var y = 0; y < es3fInstancedRenderingTests.QUAD_GRID_SIZE + 1; y++)
+ for (var x = 0; x < es3fInstancedRenderingTests.QUAD_GRID_SIZE + 1; x++) {
+ /** @type {number} */ var fx = -1.0 + x / es3fInstancedRenderingTests.QUAD_GRID_SIZE * 2.0 / this.m_numInstances;
+ /** @type {number} */ var fy = -1.0 + y / es3fInstancedRenderingTests.QUAD_GRID_SIZE * 2.0;
+
+ this.m_gridVertexPositions.push(fx);
+ this.m_gridVertexPositions.push(fy);
+ }
+
+ // Indices.
+
+ for (var y = 0; y < es3fInstancedRenderingTests.QUAD_GRID_SIZE; y++)
+ for (var x = 0; x < es3fInstancedRenderingTests.QUAD_GRID_SIZE; x++) {
+ /** @type {number} */ var ndx00 = y * (es3fInstancedRenderingTests.QUAD_GRID_SIZE + 1) + x;
+ /** @type {number} */ var ndx10 = y * (es3fInstancedRenderingTests.QUAD_GRID_SIZE + 1) + x + 1;
+ /** @type {number} */ var ndx01 = (y + 1) * (es3fInstancedRenderingTests.QUAD_GRID_SIZE + 1) + x;
+ /** @type {number} */ var ndx11 = (y + 1) * (es3fInstancedRenderingTests.QUAD_GRID_SIZE + 1) + x + 1;
+
+ // Lower-left triangle of a quad.
+ this.m_gridIndices.push(ndx00);
+ this.m_gridIndices.push(ndx10);
+ this.m_gridIndices.push(ndx01);
+
+ // Upper-right triangle of a quad.
+ this.m_gridIndices.push(ndx11);
+ this.m_gridIndices.push(ndx01);
+ this.m_gridIndices.push(ndx10);
+ }
+ } else {
+ DE_ASSERT(this.m_function == es3fInstancedRenderingTests.DrawFunction.FUNCTION_DRAW_ARRAYS_INSTANCED);
+
+ // Vertex positions. Positions form a vertical bar of width <screen width>/<number of instances>.
+
+ for (var y = 0; y < es3fInstancedRenderingTests.QUAD_GRID_SIZE; y++)
+ for (var x = 0; x < es3fInstancedRenderingTests.QUAD_GRID_SIZE; x++) {
+ /** @type {number} */ var fx0 = -1.0 + (x + 0) / es3fInstancedRenderingTests.QUAD_GRID_SIZE * 2.0 / this.m_numInstances;
+ /** @type {number} */ var fx1 = -1.0 + (x + 1) / es3fInstancedRenderingTests.QUAD_GRID_SIZE * 2.0 / this.m_numInstances;
+ /** @type {number} */ var fy0 = -1.0 + (y + 0) / es3fInstancedRenderingTests.QUAD_GRID_SIZE * 2.0;
+ /** @type {number} */ var fy1 = -1.0 + (y + 1) / es3fInstancedRenderingTests.QUAD_GRID_SIZE * 2.0;
+
+ // Vertices of a quad's lower-left triangle: (fx0, fy0), (fx1, fy0) and (fx0, fy1)
+ this.m_gridVertexPositions.push(fx0);
+ this.m_gridVertexPositions.push(fy0);
+ this.m_gridVertexPositions.push(fx1);
+ this.m_gridVertexPositions.push(fy0);
+ this.m_gridVertexPositions.push(fx0);
+ this.m_gridVertexPositions.push(fy1);
+
+ // Vertices of a quad's upper-right triangle: (fx1, fy1), (fx0, fy1) and (fx1, fy0)
+ this.m_gridVertexPositions.push(fx1);
+ this.m_gridVertexPositions.push(fy1);
+ this.m_gridVertexPositions.push(fx0);
+ this.m_gridVertexPositions.push(fy1);
+ this.m_gridVertexPositions.push(fx1);
+ this.m_gridVertexPositions.push(fy0);
+ }
+ }
+
+ // Instanced attributes: position offset and color RGB components.
+
+ if (this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR || this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_MIXED) {
+ if (this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR) {
+ // Offsets are such that the vertical bars are drawn next to each other.
+ for (var i = 0; i < this.m_numInstances; i++) {
+ this.m_instanceOffsets.push(i * 2.0 / this.m_numInstances);
+
+ DE_ASSERT(es3fInstancedRenderingTests.OFFSET_COMPONENTS >= 1 && es3fInstancedRenderingTests.OFFSET_COMPONENTS <= 4);
+
+ for (var j = 0; j < es3fInstancedRenderingTests.OFFSET_COMPONENTS - 1; j++)
+ this.m_instanceOffsets.push(0.0);
+ }
+
+ /** @type {number} */ var rInstances = Math.floor(this.m_numInstances / es3fInstancedRenderingTests.ATTRIB_DIVISOR_R) + (this.m_numInstances % es3fInstancedRenderingTests.ATTRIB_DIVISOR_R == 0 ? 0 : 1);
+ for (var i = 0; i < rInstances; i++) {
+ this.pushVarCompAttrib(this.m_instanceColorR, i / rInstances);
+
+ for (var j = 0; j < typeSize - 1; j++)
+ this.pushVarCompAttrib(this.m_instanceColorR, 0.0);
+ }
+ }
+
+ /** @type {number} */ var gInstances = Math.floor(this.m_numInstances / es3fInstancedRenderingTests.ATTRIB_DIVISOR_G) + (this.m_numInstances % es3fInstancedRenderingTests.ATTRIB_DIVISOR_G == 0 ? 0 : 1);
+ for (var i = 0; i < gInstances; i++) {
+ this.pushVarCompAttrib(this.m_instanceColorG, i * 2.0 / gInstances);
+
+ for (var j = 0; j < typeSize - 1; j++)
+ this.pushVarCompAttrib(this.m_instanceColorG, 0.0);
+ }
+
+ /** @type {number} */ var bInstances = Math.floor(this.m_numInstances / es3fInstancedRenderingTests.ATTRIB_DIVISOR_B) + (this.m_numInstances % es3fInstancedRenderingTests.ATTRIB_DIVISOR_B == 0 ? 0 : 1);
+ for (var i = 0; i < bInstances; i++) {
+ this.pushVarCompAttrib(this.m_instanceColorB, 1.0 - i / bInstances);
+
+ for (var j = 0; j < typeSize - 1; j++)
+ this.pushVarCompAttrib(this.m_instanceColorB, 0.0);
+ }
+ }
+ };
+
+ es3fInstancedRenderingTests.InstancedRenderingCase.prototype.deinit = function() {
+ var numVertexAttribArrays = /** @type{number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS));
+ for (var idx = 0; idx < numVertexAttribArrays; idx++) {
+ gl.disableVertexAttribArray(idx);
+ gl.vertexAttribDivisor(idx, 0);
+ }
+ };
+
+ es3fInstancedRenderingTests.InstancedRenderingCase.prototype.iterate = function() {
+ /** @type {number} */ var width = Math.min(gl.drawingBufferWidth, es3fInstancedRenderingTests.MAX_RENDER_WIDTH);
+ /** @type {number} */ var height = Math.min(gl.drawingBufferHeight, es3fInstancedRenderingTests.MAX_RENDER_HEIGHT);
+
+ /** @type {number} */ var xOffsetMax = gl.drawingBufferWidth - width;
+ /** @type {number} */ var yOffsetMax = gl.drawingBufferHeight - height;
+
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name));
+
+ /** @type {number} */ var xOffset = rnd.getInt(0, xOffsetMax);
+ /** @type {number} */ var yOffset = rnd.getInt(0, yOffsetMax);
+
+ /** @type {tcuSurface.Surface} */ var referenceImg = new tcuSurface.Surface(width, height);
+ /** @type {tcuSurface.Surface} */ var resultImg = new tcuSurface.Surface(width, height);
+
+ // Draw result.
+
+ gl.viewport(xOffset, yOffset, width, height);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ this.setupAndRender();
+
+ var resImg = resultImg.getAccess();
+ var resImgTransferFormat = gluTextureUtil.getTransferFormat(resImg.getFormat());
+
+ gl.readPixels(xOffset, yOffset, resImg.m_width, resImg.m_height, resImgTransferFormat.format, resImgTransferFormat.dataType, resultImg.m_pixels);
+
+ // Compute reference.
+ this.computeReference(referenceImg);
+
+ // Compare.
+
+ // Passing referenceImg.getAccess() and resultImg.getAccess() instead of referenceImg and resultImg
+ /** @type {boolean} */ var testOk = tcuImageCompare.fuzzyCompare('ComparisonResult', 'Image comparison result', referenceImg.getAccess(), resultImg.getAccess(), 0.05 /*, gluShaderUtil.COMPARE_LOG_RESULT*/);
+
+ assertMsgOptions(testOk, '', true, false);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @param {Array<number>} attrPtr
+ * @param {number} location
+ * @param {number} divisor
+ */
+ es3fInstancedRenderingTests.InstancedRenderingCase.prototype.setupVarAttribPointer = function(attrPtr, location, divisor) {
+ /** @type {boolean} */ var isFloatCase = gluShaderUtil.isDataTypeFloatOrVec(this.m_rgbAttrType);
+ /** @type {boolean} */ var isIntCase = gluShaderUtil.isDataTypeIntOrIVec(this.m_rgbAttrType);
+ /** @type {boolean} */ var isUintCase = gluShaderUtil.isDataTypeUintOrUVec(this.m_rgbAttrType);
+ /** @type {boolean} */ var isMatCase = gluShaderUtil.isDataTypeMatrix(this.m_rgbAttrType);
+ /** @type {number} */ var typeSize = gluShaderUtil.getDataTypeScalarSize(this.m_rgbAttrType);
+ /** @type {number} */ var numSlots = isMatCase ? gluShaderUtil.getDataTypeMatrixNumColumns(this.m_rgbAttrType) : 1; // Matrix uses as many attribute slots as it has columns.
+
+ for (var slotNdx = 0; slotNdx < numSlots; slotNdx++) {
+ /** @type {number} */ var curLoc = location + slotNdx;
+
+ gl.enableVertexAttribArray(curLoc);
+ gl.vertexAttribDivisor(curLoc, divisor);
+ var curLocGlBuffer = gl.createBuffer();
+ if (isFloatCase) {
+ var bufferCurLoc = new Float32Array(attrPtr);
+ gl.bindBuffer(gl.ARRAY_BUFFER, curLocGlBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, bufferCurLoc, gl.STATIC_DRAW);
+
+ gl.vertexAttribPointer(curLoc, typeSize, gl.FLOAT, false, 0, 0);
+ } else if (isIntCase) {
+ var bufferCurLoc = new Int32Array(attrPtr);
+ gl.bindBuffer(gl.ARRAY_BUFFER, curLocGlBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, bufferCurLoc, gl.STATIC_DRAW);
+
+ gl.vertexAttribIPointer(curLoc, typeSize, gl.INT, 0, 0);
+ } else if (isUintCase) {
+ var bufferCurLoc = new Uint32Array(attrPtr);
+ gl.bindBuffer(gl.ARRAY_BUFFER, curLocGlBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, bufferCurLoc, gl.STATIC_DRAW);
+
+ gl.vertexAttribIPointer(curLoc, typeSize, gl.UNSIGNED_INT, 0, 0);
+ } else if (isMatCase) {
+ /** @type {number} */ var numRows = gluShaderUtil.getDataTypeMatrixNumRows(this.m_rgbAttrType);
+ /** @type {number} */ var numCols = gluShaderUtil.getDataTypeMatrixNumColumns(this.m_rgbAttrType);
+
+ var bufferCurLoc = new Float32Array(attrPtr);
+ gl.bindBuffer(gl.ARRAY_BUFFER, curLocGlBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, bufferCurLoc, gl.STATIC_DRAW);
+
+ gl.vertexAttribPointer(curLoc, numRows, gl.FLOAT, false, numCols * numRows * 4, 0);
+ } else
+ DE_ASSERT(false);
+ }
+ };
+
+ es3fInstancedRenderingTests.InstancedRenderingCase.prototype.setupAndRender = function() {
+ /** @type {WebGLProgram} */ var program = this.m_program.getProgram();
+
+ gl.useProgram(program);
+ // Setup attributes.
+
+ // Position attribute is non-instanced.
+ /** @type {number} */ var positionLoc = gl.getAttribLocation(program, 'a_position');
+ gl.enableVertexAttribArray(positionLoc);
+ var positionBuffer = gl.createBuffer();
+ var bufferGridVertexPosition = new Float32Array(this.m_gridVertexPositions);
+ gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, bufferGridVertexPosition, gl.STATIC_DRAW);
+ gl.vertexAttribPointer(positionLoc, 2, gl.FLOAT, false, 0, 0);
+
+ if (this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR || this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_MIXED) {
+ if (this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR) {
+ // Position offset attribute is instanced with separate offset for every instance.
+ /** @type {number} */ var offsetLoc = gl.getAttribLocation(program, 'a_instanceOffset');
+ gl.enableVertexAttribArray(offsetLoc);
+ gl.vertexAttribDivisor(offsetLoc, 1);
+
+ var offsetLocGlBuffer = gl.createBuffer();
+ var bufferOffsetLoc = new Float32Array(this.m_instanceOffsets);
+ gl.bindBuffer(gl.ARRAY_BUFFER, offsetLocGlBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, bufferOffsetLoc, gl.STATIC_DRAW);
+
+ gl.vertexAttribPointer(offsetLoc, es3fInstancedRenderingTests.OFFSET_COMPONENTS, gl.FLOAT, false, 0, 0);
+
+ /** @type {number} */ var rLoc = gl.getAttribLocation(program, 'a_instanceR');
+ this.setupVarAttribPointer(this.m_instanceColorR, rLoc, es3fInstancedRenderingTests.ATTRIB_DIVISOR_R);
+ }
+
+ /** @type {number} */ var gLoc = gl.getAttribLocation(program, 'a_instanceG');
+ this.setupVarAttribPointer(this.m_instanceColorG, gLoc, es3fInstancedRenderingTests.ATTRIB_DIVISOR_G);
+
+ /** @type {number} */ var bLoc = gl.getAttribLocation(program, 'a_instanceB');
+ this.setupVarAttribPointer(this.m_instanceColorB, bLoc, es3fInstancedRenderingTests.ATTRIB_DIVISOR_B);
+ }
+
+ // Draw using appropriate function.
+
+ if (this.m_function == es3fInstancedRenderingTests.DrawFunction.FUNCTION_DRAW_ARRAYS_INSTANCED) {
+ /** @type {number} */ var numPositionComponents = 2;
+ gl.drawArraysInstanced(gl.TRIANGLES, 0, Math.floor(this.m_gridVertexPositions.length / numPositionComponents), this.m_numInstances);
+ } else {
+ var gridIndicesGLBuffer = gl.createBuffer();
+ var bufferGridIndices = new Uint16Array(this.m_gridIndices);
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, gridIndicesGLBuffer);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, bufferGridIndices, gl.STATIC_DRAW);
+
+ gl.drawElementsInstanced(gl.TRIANGLES, this.m_gridIndices.length, gl.UNSIGNED_SHORT, 0, this.m_numInstances);
+ }
+ gl.useProgram(null);
+ };
+
+ /**
+ * @param {tcuSurface.Surface} dst
+ */
+ es3fInstancedRenderingTests.InstancedRenderingCase.prototype.computeReference = function(dst) {
+ /** @type {number} */ var wid = dst.getWidth();
+ /** @type {number} */ var hei = dst.getHeight();
+
+ // Draw a rectangle (vertical bar) for each instance.
+
+ for (var instanceNdx = 0; instanceNdx < this.m_numInstances; instanceNdx++) {
+ /** @type {number} */ var xStart = Math.floor(instanceNdx * wid / this.m_numInstances);
+ /** @type {number} */ var xEnd = Math.floor((instanceNdx + 1) * wid / this.m_numInstances);
+
+ // Emulate attribute divisors if that is the case.
+
+ /** @type {number} */ var clrNdxR = this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR ? Math.floor(instanceNdx / es3fInstancedRenderingTests.ATTRIB_DIVISOR_R) : instanceNdx;
+ /** @type {number} */ var clrNdxG = this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR || this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_MIXED ? Math.floor(instanceNdx / es3fInstancedRenderingTests.ATTRIB_DIVISOR_G) : instanceNdx;
+ /** @type {number} */ var clrNdxB = this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR || this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_MIXED ? Math.floor(instanceNdx / es3fInstancedRenderingTests.ATTRIB_DIVISOR_B) : instanceNdx;
+
+ /** @type {number} */ var rInstances = this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR ? Math.floor(this.m_numInstances / es3fInstancedRenderingTests.ATTRIB_DIVISOR_R) + (this.m_numInstances % es3fInstancedRenderingTests.ATTRIB_DIVISOR_R == 0 ? 0 : 1) : this.m_numInstances;
+ /** @type {number} */ var gInstances = this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR || this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_MIXED ? Math.floor(this.m_numInstances / es3fInstancedRenderingTests.ATTRIB_DIVISOR_G) + (this.m_numInstances % es3fInstancedRenderingTests.ATTRIB_DIVISOR_G == 0 ? 0 : 1) : this.m_numInstances;
+ /** @type {number} */ var bInstances = this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR || this.m_instancingType == es3fInstancedRenderingTests.InstancingType.TYPE_MIXED ? Math.floor(this.m_numInstances / es3fInstancedRenderingTests.ATTRIB_DIVISOR_B) + (this.m_numInstances % es3fInstancedRenderingTests.ATTRIB_DIVISOR_B == 0 ? 0 : 1) : this.m_numInstances;
+
+ // Calculate colors.
+
+ /** @type {number} */ var r = clrNdxR / rInstances;
+ /** @type {number} */ var g = clrNdxG * 2.0 / gInstances;
+ /** @type {number} */ var b = 1.0 - clrNdxB / bInstances;
+
+ // Convert to integer and back if shader inputs are integers.
+
+ if (gluShaderUtil.isDataTypeIntOrIVec(this.m_rgbAttrType)) {
+ /** @type {number} */var intR = (r * es3fInstancedRenderingTests.FLOAT_INT_SCALE + es3fInstancedRenderingTests.FLOAT_INT_BIAS);
+ /** @type {number} */var intG = (g * es3fInstancedRenderingTests.FLOAT_INT_SCALE + es3fInstancedRenderingTests.FLOAT_INT_BIAS);
+ /** @type {number} */var intB = (b * es3fInstancedRenderingTests.FLOAT_INT_SCALE + es3fInstancedRenderingTests.FLOAT_INT_BIAS);
+ r = (intR - es3fInstancedRenderingTests.FLOAT_INT_BIAS) / es3fInstancedRenderingTests.FLOAT_INT_SCALE;
+ g = (intG - es3fInstancedRenderingTests.FLOAT_INT_BIAS) / es3fInstancedRenderingTests.FLOAT_INT_SCALE;
+ b = (intB - es3fInstancedRenderingTests.FLOAT_INT_BIAS) / es3fInstancedRenderingTests.FLOAT_INT_SCALE;
+ } else if (gluShaderUtil.isDataTypeUintOrUVec(this.m_rgbAttrType)) {
+ /** @type {number} */var uintR = (r * es3fInstancedRenderingTests.FLOAT_UINT_SCALE + es3fInstancedRenderingTests.FLOAT_UINT_BIAS);
+ /** @type {number} */var uintG = (g * es3fInstancedRenderingTests.FLOAT_UINT_SCALE + es3fInstancedRenderingTests.FLOAT_UINT_BIAS);
+ /** @type {number} */var uintB = (b * es3fInstancedRenderingTests.FLOAT_UINT_SCALE + es3fInstancedRenderingTests.FLOAT_UINT_BIAS);
+ r = (uintR - es3fInstancedRenderingTests.FLOAT_UINT_BIAS) / es3fInstancedRenderingTests.FLOAT_UINT_SCALE;
+ g = (uintG - es3fInstancedRenderingTests.FLOAT_UINT_BIAS) / es3fInstancedRenderingTests.FLOAT_UINT_SCALE;
+ b = (uintB - es3fInstancedRenderingTests.FLOAT_UINT_BIAS) / es3fInstancedRenderingTests.FLOAT_UINT_SCALE;
+ }
+
+ // Convert from float to unorm8.
+ var color = deMath.add(deMath.scale([r, g, b, 1.0], 255), [0.5, 0.5, 0.5, 0.5]);
+ color = deMath.clampVector(color, 0, 255);
+
+ // Draw rectangle.
+ for (var y = 0; y < hei; y++)
+ for (var x = xStart; x < xEnd; x++)
+ dst.setPixel(x, y, color);
+ }
+ };
+
+ es3fInstancedRenderingTests.init = function() {
+ var testGroup = tcuTestCase.runner.testCases;
+ /** @type {Array<number>} */ var instanceCounts = [1, 2, 4, 20];
+
+ for (var _function in es3fInstancedRenderingTests.DrawFunction) {
+ /** @type {?string} */ var functionName =
+ es3fInstancedRenderingTests.DrawFunction[_function] == es3fInstancedRenderingTests.DrawFunction.FUNCTION_DRAW_ARRAYS_INSTANCED ? 'draw_arrays_instanced' :
+ es3fInstancedRenderingTests.DrawFunction[_function] == es3fInstancedRenderingTests.DrawFunction.FUNCTION_DRAW_ELEMENTS_INSTANCED ? 'draw_elements_instanced' :
+ null;
+
+ /** @type {?string} */ var functionDesc =
+ es3fInstancedRenderingTests.DrawFunction[_function] == es3fInstancedRenderingTests.DrawFunction.FUNCTION_DRAW_ARRAYS_INSTANCED ? 'Use glDrawArraysInstanced()' :
+ es3fInstancedRenderingTests.DrawFunction[_function] == es3fInstancedRenderingTests.DrawFunction.FUNCTION_DRAW_ELEMENTS_INSTANCED ? 'Use glDrawElementsInstanced()' :
+ null;
+
+ DE_ASSERT(functionName != null);
+ DE_ASSERT(functionDesc != null);
+
+ /** @type {tcuTestCase.DeqpTest} */ var functionGroup = tcuTestCase.newTest(functionName, functionDesc);
+ testGroup.addChild(functionGroup);
+
+ for (var instancingType in es3fInstancedRenderingTests.InstancingType) {
+ /** @type {?string} */ var instancingTypeName =
+ es3fInstancedRenderingTests.InstancingType[instancingType] == es3fInstancedRenderingTests.InstancingType.TYPE_INSTANCE_ID ? 'instance_id' :
+ es3fInstancedRenderingTests.InstancingType[instancingType] == es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR ? 'attribute_divisor' :
+ es3fInstancedRenderingTests.InstancingType[instancingType] == es3fInstancedRenderingTests.InstancingType.TYPE_MIXED ? 'mixed' :
+ null;
+
+ /** @type {?string} */ var instancingTypeDesc =
+ es3fInstancedRenderingTests.InstancingType[instancingType] == es3fInstancedRenderingTests.InstancingType.TYPE_INSTANCE_ID ? 'Use gl_InstanceID for instancing' :
+ es3fInstancedRenderingTests.InstancingType[instancingType] == es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR ? 'Use vertex attribute divisors for instancing' :
+ es3fInstancedRenderingTests.InstancingType[instancingType] == es3fInstancedRenderingTests.InstancingType.TYPE_MIXED ? 'Use both gl_InstanceID and vertex attribute divisors for instancing' :
+ null;
+
+ DE_ASSERT(instancingTypeName != null);
+ DE_ASSERT(instancingTypeDesc != null);
+
+ /** @type {tcuTestCase.DeqpTest} */
+ var instancingTypeGroup = tcuTestCase.newTest(instancingTypeName, instancingTypeDesc);
+
+ functionGroup.addChild(instancingTypeGroup);
+
+ for (var countNdx in instanceCounts) {
+ /** @type {string} */ var countName = instanceCounts[countNdx].toString() + '_instances';
+ instancingTypeGroup.addChild(new es3fInstancedRenderingTests.InstancedRenderingCase(countName,
+ '',
+ es3fInstancedRenderingTests.DrawFunction[_function],
+ es3fInstancedRenderingTests.InstancingType[instancingType],
+ gluShaderUtil.DataType.FLOAT,
+ instanceCounts[countNdx]));
+ }
+ }
+ }
+
+ /** @type {Array<gluShaderUtil.DataType>} */ var s_testTypes =
+ [
+ gluShaderUtil.DataType.FLOAT,
+ gluShaderUtil.DataType.FLOAT_VEC2,
+ gluShaderUtil.DataType.FLOAT_VEC3,
+ gluShaderUtil.DataType.FLOAT_VEC4,
+ gluShaderUtil.DataType.FLOAT_MAT2,
+ gluShaderUtil.DataType.FLOAT_MAT2X3,
+ gluShaderUtil.DataType.FLOAT_MAT2X4,
+ gluShaderUtil.DataType.FLOAT_MAT3X2,
+ gluShaderUtil.DataType.FLOAT_MAT3,
+ gluShaderUtil.DataType.FLOAT_MAT3X4,
+ gluShaderUtil.DataType.FLOAT_MAT4X2,
+ gluShaderUtil.DataType.FLOAT_MAT4X3,
+ gluShaderUtil.DataType.FLOAT_MAT4,
+
+ gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT_VEC2,
+ gluShaderUtil.DataType.INT_VEC3,
+ gluShaderUtil.DataType.INT_VEC4,
+
+ gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT_VEC2,
+ gluShaderUtil.DataType.UINT_VEC3,
+ gluShaderUtil.DataType.UINT_VEC4
+ ];
+
+ /** @type {number} */ var typeTestNumInstances = 4;
+
+ /** @type {tcuTestCase.DeqpTest} */ var typesGroup = tcuTestCase.newTest('types', 'Tests for instanced attributes of particular data types');
+
+ testGroup.addChild(typesGroup);
+
+ for (var typeNdx in s_testTypes) {
+ /** @type {gluShaderUtil.DataType} */ var type = s_testTypes[typeNdx];
+ typesGroup.addChild(new es3fInstancedRenderingTests.InstancedRenderingCase(gluShaderUtil.getDataTypeName(type), '',
+ es3fInstancedRenderingTests.DrawFunction.FUNCTION_DRAW_ARRAYS_INSTANCED,
+ es3fInstancedRenderingTests.InstancingType.TYPE_ATTRIB_DIVISOR,
+ type,
+ typeTestNumInstances));
+ }
+ };
+
+ es3fInstancedRenderingTests.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var testName = 'instanced_rendering';
+ var testDescription = 'Instanced Rendering Tests';
+ var state = tcuTestCase.runner;
+
+ state.testName = testName;
+ state.setRoot(tcuTestCase.newTest(testName, testDescription, null));
+
+ //Set up name and description of this test series.
+ setCurrentTestName(testName);
+ description(testDescription);
+
+ try {
+ //Create test cases
+ es3fInstancedRenderingTests.init();
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fInstancedRenderingTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fIntegerStateQueryTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fIntegerStateQueryTests.js
new file mode 100644
index 0000000000..ec5048e4f3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fIntegerStateQueryTests.js
@@ -0,0 +1,2049 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fIntegerStateQueryTests');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.opengl.gluTextureUtil');
+goog.require('functional.gles3.es3fApiCase');
+goog.require('modules.shared.glsStateQuery');
+
+goog.scope(function() {
+ var es3fIntegerStateQueryTests = functional.gles3.es3fIntegerStateQueryTests;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var deRandom = framework.delibs.debase.deRandom;
+ var es3fApiCase = functional.gles3.es3fApiCase;
+ var glsStateQuery = modules.shared.glsStateQuery;
+
+ /** @type {string} */ var transformFeedbackTestVertSource = '' +
+ '#version 300 es\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = vec4(0.0);\n' +
+ '}\n';
+
+ /** @type {string} */ var transformFeedbackTestFragSource = '' +
+ '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 fragColor;' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' fragColor = vec4(0.0);\n' +
+ '}\n';
+
+ /** @type {string} */ var testVertSource = '' +
+ '#version 300 es\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = vec4(0.0);\n' +
+ '}\n';
+
+ /** @type {string} */ var testFragSource = '' +
+ '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 fragColor;' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' fragColor = vec4(0.0);\n' +
+ '}\n';
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fIntegerStateQueryTests.TransformFeedbackTestCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ /** @type {WebGLTransformFeedback} */ this.m_transformfeedback;
+ };
+
+ es3fIntegerStateQueryTests.TransformFeedbackTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.TransformFeedbackTestCase.prototype.constructor = es3fIntegerStateQueryTests.TransformFeedbackTestCase;
+
+ es3fIntegerStateQueryTests.TransformFeedbackTestCase.prototype.testTransformFeedback = function() {
+ throw new Error('This method should be implemented by child classes.');
+ };
+
+ es3fIntegerStateQueryTests.TransformFeedbackTestCase.prototype.test = function() {
+ this.beforeTransformFeedbackTest(); // [dag] added this as there is no other way this method would be called.
+
+ this.m_transformfeedback = gl.createTransformFeedback();
+
+ /** @type {WebGLShader} */ var shaderVert = gl.createShader(gl.VERTEX_SHADER);
+ gl.shaderSource(shaderVert, transformFeedbackTestVertSource);
+ gl.compileShader(shaderVert);
+
+ var compileStatus = /** @type {boolean} */ (gl.getShaderParameter(shaderVert, gl.COMPILE_STATUS));
+ glsStateQuery.compare(compileStatus, true);
+
+ /** @type {WebGLShader} */ var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER);
+ gl.shaderSource(shaderFrag, transformFeedbackTestFragSource);
+ gl.compileShader(shaderFrag);
+
+ compileStatus = /** @type {boolean} */ (gl.getShaderParameter(shaderFrag, gl.COMPILE_STATUS));
+ glsStateQuery.compare(compileStatus, true);
+
+ /** @type {WebGLProgram} */ var shaderProg = gl.createProgram();
+ gl.attachShader(shaderProg, shaderVert);
+ gl.attachShader(shaderProg, shaderFrag);
+ /** @type {Array<string>} */ var transform_feedback_outputs = ['gl_Position'];
+ gl.transformFeedbackVaryings(shaderProg, transform_feedback_outputs, gl.INTERLEAVED_ATTRIBS);
+ gl.linkProgram(shaderProg);
+
+ var linkStatus = /** @type {boolean} */ (gl.getProgramParameter(shaderProg, gl.LINK_STATUS));
+ glsStateQuery.compare(linkStatus, true);
+
+ gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, this.m_transformfeedback);
+
+
+ /** @type {WebGLBuffer} */ var feedbackBufferId = gl.createBuffer();
+ gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, feedbackBufferId);
+ gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, new Float32Array(16), gl.DYNAMIC_READ);
+ gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, feedbackBufferId);
+
+ gl.useProgram(shaderProg);
+
+ this.testTransformFeedback();
+
+ gl.useProgram(null);
+ gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, null);
+ gl.deleteTransformFeedback(this.m_transformfeedback);
+ gl.deleteBuffer(feedbackBufferId);
+ gl.deleteShader(shaderVert);
+ gl.deleteShader(shaderFrag);
+ gl.deleteProgram(shaderProg);
+
+ this.afterTransformFeedbackTest(); // [dag] added this as there is no other way this method would be called.
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fIntegerStateQueryTests.TransformFeedbackTestCase}
+ * @param {string} name
+ */
+ es3fIntegerStateQueryTests.TransformFeedbackBindingTestCase = function(name) {
+ es3fIntegerStateQueryTests.TransformFeedbackTestCase.call(this, name, 'GL_TRANSFORM_FEEDBACK_BINDING');
+ };
+
+ es3fIntegerStateQueryTests.TransformFeedbackBindingTestCase.prototype = Object.create(es3fIntegerStateQueryTests.TransformFeedbackTestCase.prototype);
+ es3fIntegerStateQueryTests.TransformFeedbackBindingTestCase.prototype.constructor = es3fIntegerStateQueryTests.TransformFeedbackBindingTestCase;
+
+
+ es3fIntegerStateQueryTests.TransformFeedbackBindingTestCase.prototype.beforeTransformFeedbackTest = function() {
+ this.check(glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_BINDING, null), 'beforeTransformFeedbackTest');
+ };
+
+ es3fIntegerStateQueryTests.TransformFeedbackBindingTestCase.prototype.testTransformFeedback = function() {
+ this.check(glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_BINDING, this.m_transformfeedback), 'testTransformFeedback');
+ };
+
+ es3fIntegerStateQueryTests.TransformFeedbackBindingTestCase.prototype.afterTransformFeedbackTest = function() {
+ this.check(glsStateQuery.verify(gl.TRANSFORM_FEEDBACK_BINDING, null), 'afterTransformFeedbackTest');
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} targetName
+ * @param {number} minValue
+ */
+ es3fIntegerStateQueryTests.ConstantMinimumValueTestCase = function(name, description, targetName, minValue) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ /** @type {number} */ this.m_targetName = targetName;
+ /** @type {number} */ this.m_minValue = minValue;
+ };
+
+ es3fIntegerStateQueryTests.ConstantMinimumValueTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.ConstantMinimumValueTestCase.prototype.constructor = es3fIntegerStateQueryTests.ConstantMinimumValueTestCase;
+
+ es3fIntegerStateQueryTests.ConstantMinimumValueTestCase.prototype.test = function() {
+ this.check(glsStateQuery.verifyGreaterOrEqual(this.m_targetName, this.m_minValue), 'Fail');
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} targetName
+ * @param {number} minValue
+ */
+ es3fIntegerStateQueryTests.ConstantMaximumValueTestCase = function(name, description, targetName, minValue) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ /** @type {number} */ this.m_targetName = targetName;
+ /** @type {number} */ this.m_minValue = minValue;
+ };
+
+ es3fIntegerStateQueryTests.ConstantMaximumValueTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.ConstantMaximumValueTestCase.prototype.constructor = es3fIntegerStateQueryTests.ConstantMaximumValueTestCase;
+
+ es3fIntegerStateQueryTests.ConstantMaximumValueTestCase.prototype.test = function() {
+ this.check(glsStateQuery.verifyLessOrEqual(this.m_targetName, this.m_minValue), 'Fail');
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fIntegerStateQueryTests.SampleBuffersTestCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fIntegerStateQueryTests.SampleBuffersTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.SampleBuffersTestCase.prototype.constructor = es3fIntegerStateQueryTests.SampleBuffersTestCase;
+
+ es3fIntegerStateQueryTests.SampleBuffersTestCase.prototype.test = function() {
+ /** @type {number} */ var expectedSampleBuffers = (/** @type {number} */ (gl.getParameter(gl.SAMPLES)) > 1) ? 1 : 0;
+
+ bufferedLogToConsole('Sample count is ' + expectedSampleBuffers + ', expecting GL_SAMPLE_BUFFERS to be ' + expectedSampleBuffers);
+
+ this.check(glsStateQuery.verify(gl.SAMPLE_BUFFERS, expectedSampleBuffers));
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fIntegerStateQueryTests.SamplesTestCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fIntegerStateQueryTests.SamplesTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.SamplesTestCase.prototype.constructor = es3fIntegerStateQueryTests.SamplesTestCase;
+
+ es3fIntegerStateQueryTests.SamplesTestCase.prototype.test = function() {
+ var numSamples = /** @type {number} */ (gl.getParameter(gl.SAMPLES));
+ // MSAA?
+ if (numSamples > 1) {
+ bufferedLogToConsole('Sample count is ' + numSamples);
+
+ this.check(glsStateQuery.verify(gl.SAMPLES, numSamples));
+ } else {
+ /** @type {Array<number>} */ var validSamples = [0, 1];
+
+ bufferedLogToConsole('Expecting GL_SAMPLES to be 0 or 1');
+
+ this.check(glsStateQuery.verifyAnyOf(gl.SAMPLES, validSamples));
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} targetName
+ */
+ es3fIntegerStateQueryTests.HintTestCase = function(name, description, targetName) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ /** @type {number} */ this.m_targetName = targetName;
+ };
+
+ es3fIntegerStateQueryTests.HintTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.HintTestCase.prototype.constructor = es3fIntegerStateQueryTests.HintTestCase;
+
+ es3fIntegerStateQueryTests.HintTestCase.prototype.test = function() {
+ this.check(glsStateQuery.verify(this.m_targetName, gl.DONT_CARE));
+
+ gl.hint(this.m_targetName, gl.NICEST);
+ this.check(glsStateQuery.verify(this.m_targetName, gl.NICEST));
+
+ gl.hint(this.m_targetName, gl.FASTEST);
+ this.check(glsStateQuery.verify(this.m_targetName, gl.FASTEST));
+
+ gl.hint(this.m_targetName, gl.DONT_CARE);
+ this.check(glsStateQuery.verify(this.m_targetName, gl.DONT_CARE));
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fIntegerStateQueryTests.DepthFuncTestCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fIntegerStateQueryTests.DepthFuncTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.DepthFuncTestCase.prototype.constructor = es3fIntegerStateQueryTests.DepthFuncTestCase;
+
+ es3fIntegerStateQueryTests.DepthFuncTestCase.prototype.test = function() {
+ this.check(glsStateQuery.verify(gl.DEPTH_FUNC, gl.LESS));
+
+ /** @type {Array<number>} */ var depthFunctions = [gl.NEVER, gl.ALWAYS, gl.LESS, gl.LEQUAL, gl.EQUAL, gl.GREATER, gl.GEQUAL, gl.NOTEQUAL];
+ for (var ndx = 0; ndx < depthFunctions.length; ndx++) {
+ gl.depthFunc(depthFunctions[ndx]);
+
+ this.check(glsStateQuery.verify(gl.DEPTH_FUNC, depthFunctions[ndx]));
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fIntegerStateQueryTests.CullFaceTestCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fIntegerStateQueryTests.CullFaceTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.CullFaceTestCase.prototype.constructor = es3fIntegerStateQueryTests.CullFaceTestCase;
+
+ es3fIntegerStateQueryTests.CullFaceTestCase.prototype.test = function() {
+ this.check(glsStateQuery.verify(gl.CULL_FACE_MODE, gl.BACK));
+
+ /** @type {Array<number>} */ var cullFaces = [gl.FRONT, gl.BACK, gl.FRONT_AND_BACK];
+ for (var ndx = 0; ndx < cullFaces.length; ndx++) {
+ gl.cullFace(cullFaces[ndx]);
+
+ this.check(glsStateQuery.verify(gl.CULL_FACE_MODE, cullFaces[ndx]));
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fIntegerStateQueryTests.FrontFaceTestCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fIntegerStateQueryTests.FrontFaceTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.FrontFaceTestCase.prototype.constructor = es3fIntegerStateQueryTests.FrontFaceTestCase;
+
+ es3fIntegerStateQueryTests.FrontFaceTestCase.prototype.test = function() {
+ this.check(glsStateQuery.verify(gl.FRONT_FACE, gl.CCW));
+
+ /** @type {Array<number>} */ var frontFaces = [gl.CW, gl.CCW];
+ for (var ndx = 0; ndx < frontFaces.length; ndx++) {
+ gl.frontFace(frontFaces[ndx]);
+
+ this.check(glsStateQuery.verify(gl.FRONT_FACE, frontFaces[ndx]));
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fIntegerStateQueryTests.ViewPortTestCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fIntegerStateQueryTests.ViewPortTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.ViewPortTestCase.prototype.constructor = es3fIntegerStateQueryTests.ViewPortTestCase;
+
+ es3fIntegerStateQueryTests.ViewPortTestCase.prototype.test = function() {
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef);
+
+ var maxViewportDimensions = /** @type {Array<number>} */ (gl.getParameter(gl.MAX_VIEWPORT_DIMS));
+
+ // verify initial value of first two values
+ this.check(glsStateQuery.verify(gl.VIEWPORT, new Int32Array([0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight])));
+
+ /** @type {number} */ var numIterations = 120;
+ for (var i = 0; i < numIterations; ++i) {
+ /** @type {number} */ var x = rnd.getInt(-64000, 64000);
+ /** @type {number} */ var y = rnd.getInt(-64000, 64000);
+ /** @type {number} */ var width = rnd.getInt(0, maxViewportDimensions[0]);
+ /** @type {number} */ var height = rnd.getInt(0, maxViewportDimensions[1]);
+
+ gl.viewport(x, y, width, height);
+ this.check(glsStateQuery.verify(gl.VIEWPORT, new Int32Array([x, y, width, height])));
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fIntegerStateQueryTests.ScissorBoxTestCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fIntegerStateQueryTests.ScissorBoxTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.ScissorBoxTestCase.prototype.constructor = es3fIntegerStateQueryTests.ScissorBoxTestCase;
+
+ es3fIntegerStateQueryTests.ScissorBoxTestCase.prototype.test = function() {
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef);
+
+ // verify initial value of first two values
+ this.check(glsStateQuery.verifyMask(gl.SCISSOR_BOX, [0, 0, 0, 0], [true, true, false, false]));
+
+ /** @type {number} */ var numIterations = 120;
+ for (var i = 0; i < numIterations; ++i) {
+ /** @type {number} */ var left = rnd.getInt(-64000, 64000);
+ /** @type {number} */ var bottom = rnd.getInt(-64000, 64000);
+ /** @type {number} */ var width = rnd.getInt(0, 64000);
+ /** @type {number} */ var height = rnd.getInt(0, 64000);
+
+ gl.scissor(left, bottom, width, height);
+ this.check(glsStateQuery.verify(gl.SCISSOR_BOX, new Int32Array([left, bottom, width, height])));
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fIntegerStateQueryTests.MaxViewportDimsTestCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fIntegerStateQueryTests.MaxViewportDimsTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.MaxViewportDimsTestCase.prototype.constructor = es3fIntegerStateQueryTests.MaxViewportDimsTestCase;
+
+ es3fIntegerStateQueryTests.MaxViewportDimsTestCase.prototype.test = function() {
+ this.check(glsStateQuery.verifyGreaterOrEqual(gl.MAX_VIEWPORT_DIMS, [gl.drawingBufferWidth, gl.drawingBufferHeight]));
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} testTargetName
+ */
+ es3fIntegerStateQueryTests.StencilRefTestCase = function(name, description, testTargetName) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ /** @type {number} */ this.m_testTargetName = testTargetName;
+ };
+
+ es3fIntegerStateQueryTests.StencilRefTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.StencilRefTestCase.prototype.constructor = es3fIntegerStateQueryTests.StencilRefTestCase;
+
+ es3fIntegerStateQueryTests.StencilRefTestCase.prototype.test = function() {
+ this.check(glsStateQuery.verify(this.m_testTargetName, 0));
+
+ var stencilBits = /** @type {number} */ (gl.getParameter(gl.STENCIL_BITS));
+
+ for (var stencilBit = 0; stencilBit < stencilBits; ++stencilBit) {
+ /** @type {number} */ var ref = 1 << stencilBit;
+
+ gl.stencilFunc(gl.ALWAYS, ref, 0); // mask should not affect the REF
+
+ this.check(glsStateQuery.verify(this.m_testTargetName, ref));
+
+ gl.stencilFunc(gl.ALWAYS, ref, ref);
+
+ this.check(glsStateQuery.verify(this.m_testTargetName, ref));
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} testTargetName
+ * @param {number} stencilFuncTargetFace
+ */
+ es3fIntegerStateQueryTests.StencilRefSeparateTestCase = function(name, description, testTargetName, stencilFuncTargetFace) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ /** @type {number} */ this.m_testTargetName = testTargetName;
+ /** @type {number} */ this.m_stencilFuncTargetFace = stencilFuncTargetFace;
+ };
+
+ es3fIntegerStateQueryTests.StencilRefSeparateTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.StencilRefSeparateTestCase.prototype.constructor = es3fIntegerStateQueryTests.StencilRefSeparateTestCase;
+
+ es3fIntegerStateQueryTests.StencilRefSeparateTestCase.prototype.test = function() {
+ this.check(glsStateQuery.verify(this.m_testTargetName, 0));
+
+ var stencilBits = /** @type {number} */ (gl.getParameter(gl.STENCIL_BITS));
+
+ for (var stencilBit = 0; stencilBit < stencilBits; ++stencilBit) {
+ /** @type {number} */ var ref = 1 << stencilBit;
+
+ gl.stencilFuncSeparate(this.m_stencilFuncTargetFace, gl.ALWAYS, ref, 0);
+
+ this.check(glsStateQuery.verify(this.m_testTargetName, ref));
+
+ gl.stencilFuncSeparate(this.m_stencilFuncTargetFace, gl.ALWAYS, ref, ref);
+
+ this.check(glsStateQuery.verify(this.m_testTargetName, ref));
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} stencilOpName
+ */
+ es3fIntegerStateQueryTests.StencilOpTestCase = function(name, description, stencilOpName) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ /** @type {number} */ this.m_stencilOpName = stencilOpName;
+ };
+
+ es3fIntegerStateQueryTests.StencilOpTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.StencilOpTestCase.prototype.constructor = es3fIntegerStateQueryTests.StencilOpTestCase;
+
+ es3fIntegerStateQueryTests.StencilOpTestCase.prototype.test = function() {
+ this.check(glsStateQuery.verify(this.m_stencilOpName, gl.KEEP));
+
+ /** @type {Array<number>} */ var stencilOpValues = [gl.KEEP, gl.ZERO, gl.REPLACE, gl.INCR, gl.DECR, gl.INVERT, gl.INCR_WRAP, gl.DECR_WRAP];
+ for (var ndx = 0; ndx < stencilOpValues.length; ++ndx) {
+ this.setStencilOp(stencilOpValues[ndx]);
+
+ this.check(glsStateQuery.verify(this.m_stencilOpName, stencilOpValues[ndx]));
+ }
+ };
+
+ es3fIntegerStateQueryTests.StencilOpTestCase.prototype.deinit = function() {
+ // [dag] need to reset everything once the test is done, otherwise related tests fail
+ gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);
+ };
+
+ /**
+ * @param {number} stencilOpValue
+ */
+ es3fIntegerStateQueryTests.StencilOpTestCase.prototype.setStencilOp = function(stencilOpValue) {
+ switch (this.m_stencilOpName) {
+ case gl.STENCIL_FAIL:
+ case gl.STENCIL_BACK_FAIL:
+ gl.stencilOp(stencilOpValue, gl.KEEP, gl.KEEP);
+ break;
+
+ case gl.STENCIL_PASS_DEPTH_FAIL:
+ case gl.STENCIL_BACK_PASS_DEPTH_FAIL:
+ gl.stencilOp(gl.KEEP, stencilOpValue, gl.KEEP);
+ break;
+
+ case gl.STENCIL_PASS_DEPTH_PASS:
+ case gl.STENCIL_BACK_PASS_DEPTH_PASS:
+ gl.stencilOp(gl.KEEP, gl.KEEP, stencilOpValue);
+ break;
+
+ default:
+ throw new Error('should not happen');
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fIntegerStateQueryTests.StencilOpTestCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} stencilOpName
+ * @param {number} stencilOpFace
+ */
+ es3fIntegerStateQueryTests.StencilOpSeparateTestCase = function(name, description, stencilOpName, stencilOpFace) {
+ es3fIntegerStateQueryTests.StencilOpTestCase.call(this, name, description, stencilOpName);
+ /** @type {number} */ this.m_stencilOpName = stencilOpName;
+ /** @type {number} */ this.m_stencilOpFace = stencilOpFace;
+ };
+
+ es3fIntegerStateQueryTests.StencilOpSeparateTestCase.prototype = Object.create(es3fIntegerStateQueryTests.StencilOpTestCase.prototype);
+ es3fIntegerStateQueryTests.StencilOpSeparateTestCase.prototype.constructor = es3fIntegerStateQueryTests.StencilOpSeparateTestCase;
+
+ es3fIntegerStateQueryTests.StencilOpSeparateTestCase.prototype.test = function() {};
+
+ /**
+ * @param {number} stencilOpValue
+ */
+ es3fIntegerStateQueryTests.StencilOpSeparateTestCase.prototype.setStencilOp = function(stencilOpValue) {
+ switch (this.m_stencilOpName) {
+ case gl.STENCIL_FAIL:
+ case gl.STENCIL_BACK_FAIL:
+ gl.stencilOpSeparate(this.m_stencilOpFace, stencilOpValue, gl.KEEP, gl.KEEP);
+ break;
+
+ case gl.STENCIL_PASS_DEPTH_FAIL:
+ case gl.STENCIL_BACK_PASS_DEPTH_FAIL:
+ gl.stencilOpSeparate(this.m_stencilOpFace, gl.KEEP, stencilOpValue, gl.KEEP);
+ break;
+
+ case gl.STENCIL_PASS_DEPTH_PASS:
+ case gl.STENCIL_BACK_PASS_DEPTH_PASS:
+ gl.stencilOpSeparate(this.m_stencilOpFace, gl.KEEP, gl.KEEP, stencilOpValue);
+ break;
+
+ default:
+ throw new Error('should not happen');
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fIntegerStateQueryTests.StencilFuncTestCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fIntegerStateQueryTests.StencilFuncTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.StencilFuncTestCase.prototype.constructor = es3fIntegerStateQueryTests.StencilFuncTestCase;
+
+ es3fIntegerStateQueryTests.StencilFuncTestCase.prototype.test = function() {
+ this.check(glsStateQuery.verify(gl.STENCIL_FUNC, gl.ALWAYS));
+
+ /** @type {Array<number>} */ var stencilfuncValues = [gl.NEVER, gl.ALWAYS, gl.LESS, gl.LEQUAL, gl.EQUAL, gl.GEQUAL, gl.GREATER, gl.NOTEQUAL];
+
+ for (var ndx = 0; ndx < stencilfuncValues.length; ++ndx) {
+ gl.stencilFunc(stencilfuncValues[ndx], 0, 0);
+
+ this.check(glsStateQuery.verify(gl.STENCIL_FUNC, stencilfuncValues[ndx]));
+
+ this.check(glsStateQuery.verify(gl.STENCIL_BACK_FUNC, stencilfuncValues[ndx]));
+ }
+ };
+
+ es3fIntegerStateQueryTests.StencilFuncTestCase.prototype.deinit = function() {
+ // [dag] reset stencilFunc to ALWAYS
+ gl.stencilFunc(gl.ALWAYS, 0, 0);
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} stencilFuncName
+ * @param {number} stencilFuncFace
+ */
+ es3fIntegerStateQueryTests.StencilFuncSeparateTestCase = function(name, description, stencilFuncName, stencilFuncFace) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ /** @type {number} */ this.m_stencilFuncName = stencilFuncName;
+ /** @type {number} */ this.m_stencilFuncFace = stencilFuncFace;
+ };
+
+ es3fIntegerStateQueryTests.StencilFuncSeparateTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.StencilFuncSeparateTestCase.prototype.constructor = es3fIntegerStateQueryTests.StencilFuncSeparateTestCase;
+
+ es3fIntegerStateQueryTests.StencilFuncSeparateTestCase.prototype.test = function() {
+ this.check(glsStateQuery.verify(this.m_stencilFuncName, gl.ALWAYS));
+
+ /** @type {Array<number>} */ var stencilfuncValues = [gl.NEVER, gl.ALWAYS, gl.LESS, gl.LEQUAL, gl.EQUAL, gl.GEQUAL, gl.GREATER, gl.NOTEQUAL];
+
+ for (var ndx = 0; ndx < stencilfuncValues.length; ++ndx) {
+ gl.stencilFuncSeparate(this.m_stencilFuncFace, stencilfuncValues[ndx], 0, 0);
+
+ this.check(glsStateQuery.verify(this.m_stencilFuncName, stencilfuncValues[ndx]));
+ }
+ };
+
+ es3fIntegerStateQueryTests.StencilFuncSeparateTestCase.prototype.deinit = function() {
+ // [dag] reset the stencil func
+ gl.stencilFuncSeparate(this.m_stencilFuncFace, gl.ALWAYS, 0, 0);
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} testTargetName
+ */
+ es3fIntegerStateQueryTests.StencilMaskTestCase = function(name, description, testTargetName) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ /** @type {number} */ this.m_testTargetName = testTargetName;
+ };
+
+ es3fIntegerStateQueryTests.StencilMaskTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.StencilMaskTestCase.prototype.constructor = es3fIntegerStateQueryTests.StencilMaskTestCase;
+
+ es3fIntegerStateQueryTests.StencilMaskTestCase.prototype.test = function() {
+ var stencilBits = /** @type {number} */ (gl.getParameter(gl.STENCIL_BITS));
+
+ this.check(glsStateQuery.verify(this.m_testTargetName, stencilBits));
+
+ for (var stencilBit = 0; stencilBit < stencilBits; ++stencilBit) {
+ /** @type {number} */ var mask = 1 << stencilBit;
+
+ gl.stencilFunc(gl.ALWAYS, 0, mask);
+
+ this.check(glsStateQuery.verify(this.m_testTargetName, mask));
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} testTargetName
+ * @param {number} stencilFuncTargetFace
+ */
+ es3fIntegerStateQueryTests.StencilMaskSeparateTestCase = function(name, description, testTargetName, stencilFuncTargetFace) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ /** @type {number} */ this.m_testTargetName = testTargetName;
+ /** @type {number} */ this.m_stencilFuncTargetFace = stencilFuncTargetFace;
+ };
+
+ es3fIntegerStateQueryTests.StencilMaskSeparateTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.StencilMaskSeparateTestCase.prototype.constructor = es3fIntegerStateQueryTests.StencilMaskSeparateTestCase;
+
+ es3fIntegerStateQueryTests.StencilMaskSeparateTestCase.prototype.test = function() {
+ var stencilBits = /** @type {number} */ (gl.getParameter(gl.STENCIL_BITS));
+
+ this.check(glsStateQuery.verify(this.m_testTargetName, stencilBits));
+
+ for (var stencilBit = 0; stencilBit < stencilBits; ++stencilBit) {
+ /** @type {number} */ var mask = 1 << stencilBit;
+
+ gl.stencilFuncSeparate(this.m_stencilFuncTargetFace, gl.ALWAYS, 0, mask);
+
+ this.check(glsStateQuery.verify(this.m_testTargetName, mask));
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} testTargetName
+ */
+ es3fIntegerStateQueryTests.StencilWriteMaskTestCase = function(name, description, testTargetName) {
+ /** @type {number} */ this.m_testTargetName = testTargetName;
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fIntegerStateQueryTests.StencilWriteMaskTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.StencilWriteMaskTestCase.prototype.constructor = es3fIntegerStateQueryTests.StencilWriteMaskTestCase;
+
+ es3fIntegerStateQueryTests.StencilWriteMaskTestCase.prototype.test = function() {
+ var stencilBits = /** @type {number} */ (gl.getParameter(gl.STENCIL_BITS));
+
+ for (var stencilBit = 0; stencilBit < stencilBits; ++stencilBit) {
+ /** @type {number} */ var mask = 1 << stencilBit;
+
+ gl.stencilMask(mask);
+
+ this.check(glsStateQuery.verify(this.m_testTargetName, mask));
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} testTargetName
+ * @param {number} stencilTargetFace
+ */
+ es3fIntegerStateQueryTests.StencilWriteMaskSeparateTestCase = function(name, description, testTargetName, stencilTargetFace) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ /** @type {number} */ this.m_testTargetName = testTargetName;
+ /** @type {number} */ this.m_stencilTargetFace = stencilTargetFace;
+ };
+
+ es3fIntegerStateQueryTests.StencilWriteMaskSeparateTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.StencilWriteMaskSeparateTestCase.prototype.constructor = es3fIntegerStateQueryTests.StencilWriteMaskSeparateTestCase;
+
+ es3fIntegerStateQueryTests.StencilWriteMaskSeparateTestCase.prototype.test = function() {
+ var stencilBits = /** @type {number} */ (gl.getParameter(gl.STENCIL_BITS));
+
+ for (var stencilBit = 0; stencilBit < stencilBits; ++stencilBit) {
+ /** @type {number} */ var mask = 1 << stencilBit;
+
+ gl.stencilMaskSeparate(this.m_stencilTargetFace, mask);
+
+ this.check(glsStateQuery.verify(this.m_testTargetName, mask));
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} testTargetName
+ * @param {number} initialValue
+ */
+ es3fIntegerStateQueryTests.PixelStoreTestCase = function(name, description, testTargetName, initialValue) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ /** @type {number} */ this.m_testTargetName = testTargetName;
+ /** @type {number} */ this.m_initialValue = initialValue;
+ };
+
+ es3fIntegerStateQueryTests.PixelStoreTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.PixelStoreTestCase.prototype.constructor = es3fIntegerStateQueryTests.PixelStoreTestCase;
+
+ es3fIntegerStateQueryTests.PixelStoreTestCase.prototype.test = function() {
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xabcdef);
+
+ this.check(glsStateQuery.verify(this.m_testTargetName, this.m_initialValue));
+
+ /** @type {number} */ var numIterations = 120;
+ for (var i = 0; i < numIterations; ++i) {
+ /** @type {number} */ var referenceValue = rnd.getInt(0, 64000);
+
+ gl.pixelStorei(this.m_testTargetName, referenceValue);
+
+ this.check(glsStateQuery.verify(this.m_testTargetName, referenceValue));
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} testTargetName
+ */
+ es3fIntegerStateQueryTests.PixelStoreAlignTestCase = function(name, description, testTargetName) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ /** @type {number} */ this.m_testTargetName = testTargetName;
+ };
+
+ es3fIntegerStateQueryTests.PixelStoreAlignTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.PixelStoreAlignTestCase.prototype.constructor = es3fIntegerStateQueryTests.PixelStoreAlignTestCase;
+
+ es3fIntegerStateQueryTests.PixelStoreAlignTestCase.prototype.test = function() {
+ this.check(glsStateQuery.verify(this.m_testTargetName, 4));
+
+ /** @type {Array<number>} */ var alignments = [1, 2, 4, 8];
+
+ for (var ndx = 0; ndx < alignments.length; ++ndx) {
+ /** @type {number} */ var referenceValue = alignments[ndx];
+
+ gl.pixelStorei(this.m_testTargetName, referenceValue);
+
+ this.check(glsStateQuery.verify(this.m_testTargetName, referenceValue));
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} testTargetName
+ * @param {number} initialValue
+ */
+ es3fIntegerStateQueryTests.BlendFuncTestCase = function(name, description, testTargetName) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ /** @type {number} */ this.m_testTargetName = testTargetName;
+ };
+
+ es3fIntegerStateQueryTests.BlendFuncTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.BlendFuncTestCase.prototype.constructor = es3fIntegerStateQueryTests.BlendFuncTestCase;
+
+ es3fIntegerStateQueryTests.BlendFuncTestCase.prototype.test = function() {
+ /** @type {Array<number>} */ var blendFuncValues = [
+ gl.ZERO, gl.ONE, gl.SRC_COLOR, gl.ONE_MINUS_SRC_COLOR, gl.DST_COLOR, gl.ONE_MINUS_DST_COLOR,
+ gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.DST_ALPHA, gl.ONE_MINUS_DST_ALPHA, gl.CONSTANT_COLOR,
+ gl.ONE_MINUS_CONSTANT_COLOR, gl.CONSTANT_ALPHA, gl.ONE_MINUS_CONSTANT_ALPHA,
+ gl.SRC_ALPHA_SATURATE
+ ];
+
+ for (var ndx = 0; ndx < blendFuncValues.length; ++ndx) {
+ /** @type {number} */ var referenceValue = blendFuncValues[ndx];
+
+ this.setBlendFunc(referenceValue);
+
+ this.check(glsStateQuery.verify(this.m_testTargetName, referenceValue));
+ }};
+
+ /**
+ * @param {number} func
+ */
+ es3fIntegerStateQueryTests.BlendFuncTestCase.prototype.setBlendFunc = function(func) {
+ switch (this.m_testTargetName) {
+ case gl.BLEND_SRC_RGB:
+ case gl.BLEND_SRC_ALPHA:
+ gl.blendFunc(func, gl.ZERO);
+ break;
+
+ case gl.BLEND_DST_RGB:
+ case gl.BLEND_DST_ALPHA:
+ gl.blendFunc(gl.ZERO, func);
+ break;
+
+ default:
+ throw new Error('should not happen');
+ }
+ };
+
+ es3fIntegerStateQueryTests.BlendFuncTestCase.prototype.deinit = function() {
+ gl.blendFunc(gl.ONE, gl.ZERO);
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fIntegerStateQueryTests.BlendFuncTestCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} testTargetName
+ * @param {number} initialValue
+ */
+ es3fIntegerStateQueryTests.BlendFuncSeparateTestCase = function(name, description, testTargetName) {
+ es3fIntegerStateQueryTests.BlendFuncTestCase.call(this, name, description, testTargetName);
+ /** @type {number} */ this.m_testTargetName = testTargetName;
+ };
+
+ es3fIntegerStateQueryTests.BlendFuncSeparateTestCase.prototype = Object.create(es3fIntegerStateQueryTests.BlendFuncTestCase.prototype);
+ es3fIntegerStateQueryTests.BlendFuncSeparateTestCase.prototype.constructor = es3fIntegerStateQueryTests.BlendFuncSeparateTestCase;
+
+ /**
+ * @param {number} func
+ */
+ es3fIntegerStateQueryTests.BlendFuncSeparateTestCase.prototype.setBlendFunc = function(func) {
+ switch (this.m_testTargetName) {
+ case gl.BLEND_SRC_RGB:
+ gl.blendFuncSeparate(func, gl.ZERO, gl.ZERO, gl.ZERO);
+ break;
+
+ case gl.BLEND_DST_RGB:
+ gl.blendFuncSeparate(gl.ZERO, func, gl.ZERO, gl.ZERO);
+ break;
+
+ case gl.BLEND_SRC_ALPHA:
+ gl.blendFuncSeparate(gl.ZERO, gl.ZERO, func, gl.ZERO);
+ break;
+
+ case gl.BLEND_DST_ALPHA:
+ gl.blendFuncSeparate(gl.ZERO, gl.ZERO, gl.ZERO, func);
+ break;
+
+ default:
+ throw new Error('should not happen');
+ }
+ };
+
+ es3fIntegerStateQueryTests.BlendFuncSeparateTestCase.prototype.deinit = function() {
+ gl.blendFuncSeparate(gl.ONE, gl.ZERO, gl.ONE, gl.ZERO);
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} testTargetName
+ * @param {number} initialValue
+ */
+ es3fIntegerStateQueryTests.BlendEquationTestCase = function(name, description, testTargetName, initialValue) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ /** @type {number} */ this.m_testTargetName = testTargetName;
+ /** @type {number} */ this.m_initialValue = initialValue;
+ };
+
+ es3fIntegerStateQueryTests.BlendEquationTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.BlendEquationTestCase.prototype.constructor = es3fIntegerStateQueryTests.BlendEquationTestCase;
+
+ es3fIntegerStateQueryTests.BlendEquationTestCase.prototype.test = function() {
+ this.check(glsStateQuery.verify(this.m_testTargetName, this.m_initialValue));
+
+ /** @type {Array<number>} */ var blendFuncValues = [gl.FUNC_ADD, gl.FUNC_SUBTRACT, gl.FUNC_REVERSE_SUBTRACT, gl.MIN, gl.MAX];
+
+ for (var ndx = 0; ndx < blendFuncValues.length; ++ndx) {
+ /** @type {number} */ var referenceValue = blendFuncValues[ndx];
+
+ this.setBlendEquation(referenceValue);
+
+ this.check(glsStateQuery.verify(this.m_testTargetName, referenceValue));
+ }
+ };
+
+ /**
+ * @param {number} equation
+ */
+ es3fIntegerStateQueryTests.BlendEquationTestCase.prototype.setBlendEquation = function(equation) {
+ gl.blendEquation(equation);
+ };
+
+ es3fIntegerStateQueryTests.BlendEquationTestCase.prototype.deinit = function() {
+ gl.blendEquation(this.m_initialValue);
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fIntegerStateQueryTests.BlendEquationTestCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} testTargetName
+ * @param {number} initialValue
+ */
+ es3fIntegerStateQueryTests.BlendEquationSeparateTestCase = function(name, description, testTargetName, initialValue) {
+ es3fIntegerStateQueryTests.BlendEquationTestCase.call(this, name, description, testTargetName, initialValue);
+ /** @type {number} */ this.m_testTargetName = testTargetName;
+ /** @type {number} */ this.m_initialValue = initialValue;
+ };
+
+ es3fIntegerStateQueryTests.BlendEquationSeparateTestCase.prototype = Object.create(es3fIntegerStateQueryTests.BlendEquationTestCase.prototype);
+ es3fIntegerStateQueryTests.BlendEquationSeparateTestCase.prototype.constructor = es3fIntegerStateQueryTests.BlendEquationSeparateTestCase;
+
+ /**
+ * @param {number} equation
+ */
+ es3fIntegerStateQueryTests.BlendEquationSeparateTestCase.prototype.setBlendEquation = function(equation) {
+ switch (this.m_testTargetName) {
+ case gl.BLEND_EQUATION_RGB:
+ gl.blendEquationSeparate(equation, gl.FUNC_ADD);
+ break;
+
+ case gl.BLEND_EQUATION_ALPHA:
+ gl.blendEquationSeparate(gl.FUNC_ADD, equation);
+ break;
+
+ default:
+ throw new Error('should not happen');
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} testTargetName
+ * @param {number} minValue
+ */
+ es3fIntegerStateQueryTests.ImplementationArrayTestCase = function(name, description, testTargetName, minValue) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ /** @type {number} */ this.m_testTargetName = testTargetName;
+ /** @type {number} */ this.m_minValue = minValue;
+ };
+
+ es3fIntegerStateQueryTests.ImplementationArrayTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.ImplementationArrayTestCase.prototype.constructor = es3fIntegerStateQueryTests.ImplementationArrayTestCase;
+
+ es3fIntegerStateQueryTests.ImplementationArrayTestCase.prototype.test = function() {
+ if (!framework.opengl.gluTextureUtil.enableCompressedTextureETC()) {
+ debug('Skipping ETC2 texture format tests: no support for WEBGL_compressed_texture_etc');
+ return;
+ }
+
+ var queryResult = /** @type {Array<number>} */ (gl.getParameter(this.m_testTargetName));
+ this.check(glsStateQuery.compare(queryResult.length, this.m_minValue));
+
+ /** @type {Array<number>} */ var textureFormats = [
+ gl.COMPRESSED_R11_EAC, gl.COMPRESSED_SIGNED_R11_EAC, gl.COMPRESSED_RG11_EAC, gl.COMPRESSED_SIGNED_RG11_EAC, gl.COMPRESSED_RGB8_ETC2, gl.COMPRESSED_SRGB8_ETC2,
+ gl.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, gl.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, gl.COMPRESSED_RGBA8_ETC2_EAC, gl.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
+ ];
+
+ for (var ndx = 0; ndx < textureFormats.length; ndx++) {
+ /** @type {number} */ var format = textureFormats[ndx];
+ /** @type {boolean} */ var isInArray = queryResult.indexOf(format) !== -1;
+ this.check(glsStateQuery.compare(isInArray, true));
+ }
+
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fIntegerStateQueryTests.CurrentProgramBindingTestCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fIntegerStateQueryTests.CurrentProgramBindingTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.CurrentProgramBindingTestCase.prototype.constructor = es3fIntegerStateQueryTests.CurrentProgramBindingTestCase;
+
+ es3fIntegerStateQueryTests.CurrentProgramBindingTestCase.prototype.test = function() {
+ this.check(glsStateQuery.verify(gl.CURRENT_PROGRAM, null));
+
+ /** @type {WebGLShader} */ var shaderVert = gl.createShader(gl.VERTEX_SHADER);
+ gl.shaderSource(shaderVert, testVertSource);
+ gl.compileShader(shaderVert);
+ var compileStatus = /** @type {boolean} */ (gl.getShaderParameter(shaderVert, gl.COMPILE_STATUS));
+ this.check(glsStateQuery.compare(compileStatus, true));
+
+ /** @type {WebGLShader} */ var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER);
+ gl.shaderSource(shaderFrag, testFragSource);
+ gl.compileShader(shaderFrag);
+ compileStatus = /** @type {boolean} */ (gl.getShaderParameter(shaderFrag, gl.COMPILE_STATUS));
+ this.check(glsStateQuery.compare(compileStatus, true));
+
+ /** @type {WebGLProgram} */ var shaderProg = gl.createProgram();
+ gl.attachShader(shaderProg, shaderVert);
+ gl.attachShader(shaderProg, shaderFrag);
+ gl.linkProgram(shaderProg);
+ var linkStatus = /** @type {boolean} */ (gl.getProgramParameter(shaderProg, gl.LINK_STATUS));
+ this.check(glsStateQuery.compare(linkStatus, true));
+
+ gl.useProgram(shaderProg);
+
+ this.check(glsStateQuery.verify(gl.CURRENT_PROGRAM, shaderProg));
+
+ gl.deleteShader(shaderVert);
+ gl.deleteShader(shaderFrag);
+ gl.deleteProgram(shaderProg);
+
+ this.check(glsStateQuery.verify(gl.CURRENT_PROGRAM, shaderProg));
+
+ gl.useProgram(null);
+ this.check(glsStateQuery.verify(gl.CURRENT_PROGRAM, null));
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fIntegerStateQueryTests.VertexArrayBindingTestCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fIntegerStateQueryTests.VertexArrayBindingTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.VertexArrayBindingTestCase.prototype.constructor = es3fIntegerStateQueryTests.VertexArrayBindingTestCase;
+
+ es3fIntegerStateQueryTests.VertexArrayBindingTestCase.prototype.test = function() {
+ this.check(glsStateQuery.verify(gl.VERTEX_ARRAY_BINDING, null));
+
+ /** @type {WebGLVertexArrayObject} */ var vertexArrayObject = gl.createVertexArray();
+
+ gl.bindVertexArray(vertexArrayObject);
+ this.check(glsStateQuery.verify(gl.VERTEX_ARRAY_BINDING, vertexArrayObject));
+
+ gl.deleteVertexArray(vertexArrayObject);
+ this.check(glsStateQuery.verify(gl.VERTEX_ARRAY_BINDING, null));
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} bufferBindingName
+ * @param {number} bufferType
+ */
+ es3fIntegerStateQueryTests.BufferBindingTestCase = function(name, description, bufferBindingName, bufferType) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ /** @type {number} */ this.m_bufferBindingName = bufferBindingName;
+ /** @type {number} */ this.m_bufferType = bufferType;
+ };
+
+ es3fIntegerStateQueryTests.BufferBindingTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.BufferBindingTestCase.prototype.constructor = es3fIntegerStateQueryTests.BufferBindingTestCase;
+
+ es3fIntegerStateQueryTests.BufferBindingTestCase.prototype.test = function() {
+ this.check(glsStateQuery.verify(this.m_bufferBindingName, null));
+
+ /** @type {WebGLBuffer} */ var bufferObject = gl.createBuffer();
+
+ gl.bindBuffer(this.m_bufferType, bufferObject);
+ this.check(glsStateQuery.verify(this.m_bufferBindingName, bufferObject));
+
+ gl.deleteBuffer(bufferObject);
+ this.check(glsStateQuery.verify(this.m_bufferBindingName, null));
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ */
+ es3fIntegerStateQueryTests.ElementArrayBufferBindingTestCase = function(name) {
+ es3fApiCase.ApiCase.call(this, name, 'GL_ELEMENT_ARRAY_BUFFER_BINDING', gl);
+ };
+
+ es3fIntegerStateQueryTests.ElementArrayBufferBindingTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.ElementArrayBufferBindingTestCase.prototype.constructor = es3fIntegerStateQueryTests.ElementArrayBufferBindingTestCase;
+
+ es3fIntegerStateQueryTests.ElementArrayBufferBindingTestCase.prototype.test = function() {
+ // Test with default VAO
+ bufferedLogToConsole('DefaultVAO: Test with default VAO');
+
+ this.check(glsStateQuery.verify(gl.ELEMENT_ARRAY_BUFFER_BINDING, null));
+
+ /** @type {WebGLBuffer} */ var bufferObject = gl.createBuffer();
+
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bufferObject);
+ this.check(glsStateQuery.verify(gl.ELEMENT_ARRAY_BUFFER_BINDING, bufferObject));
+
+ gl.deleteBuffer(bufferObject);
+ this.check(glsStateQuery.verify(gl.ELEMENT_ARRAY_BUFFER_BINDING, null));
+
+ // Test with multiple VAOs
+ bufferedLogToConsole('WithVAO: Test with VAO');
+
+ /** @type {Array<WebGLVertexArrayObject>} */ var vaos = [];
+ /** @type {Array<WebGLBuffer>} */ var buffers = [];
+
+ for (var ndx = 0; ndx < 2; ndx++) {
+ vaos[ndx] = gl.createVertexArray();
+ buffers[ndx] = gl.createBuffer();
+ }
+
+ // initial
+ gl.bindVertexArray(vaos[0]);
+ this.check(glsStateQuery.verify(gl.ELEMENT_ARRAY_BUFFER_BINDING, null));
+
+ // after setting
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffers[0]);
+ this.check(glsStateQuery.verify(gl.ELEMENT_ARRAY_BUFFER_BINDING, buffers[0]));
+
+ // initial of vao 2
+ gl.bindVertexArray(vaos[1]);
+ this.check(glsStateQuery.verify(gl.ELEMENT_ARRAY_BUFFER_BINDING, null));
+
+ // after setting to 2
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffers[1]);
+ this.check(glsStateQuery.verify(gl.ELEMENT_ARRAY_BUFFER_BINDING, buffers[1]));
+
+ // vao 1 still has buffer 1 bound?
+ gl.bindVertexArray(vaos[0]);
+ this.check(glsStateQuery.verify(gl.ELEMENT_ARRAY_BUFFER_BINDING, buffers[0]));
+
+ // deleting clears from bound vaos ...
+ for (var ndx = 0; ndx < 2; ndx++)
+ gl.deleteBuffer(buffers[ndx]);
+ this.check(glsStateQuery.verify(gl.ELEMENT_ARRAY_BUFFER_BINDING, null));
+
+ // ... but does not from non-bound vaos?
+ gl.bindVertexArray(vaos[1]);
+ this.check(glsStateQuery.verify(gl.ELEMENT_ARRAY_BUFFER_BINDING, buffers[1]));
+
+ for (var ndx = 0; ndx < 2; ndx++)
+ gl.deleteVertexArray(vaos[ndx]);
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fIntegerStateQueryTests.StencilClearValueTestCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fIntegerStateQueryTests.StencilClearValueTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.StencilClearValueTestCase.prototype.constructor = es3fIntegerStateQueryTests.StencilClearValueTestCase;
+
+ es3fIntegerStateQueryTests.StencilClearValueTestCase.prototype.test = function() {
+ this.check(glsStateQuery.verify(gl.STENCIL_CLEAR_VALUE, 0));
+
+ var stencilBits = /** @type {number} */ (gl.getParameter(gl.STENCIL_BITS));
+
+ for (var stencilBit = 0; stencilBit < stencilBits; ++stencilBit) {
+ /** @type {number} */ var ref = 1 << stencilBit;
+
+ gl.clearStencil(ref); // mask should not affect the REF
+
+ this.check(glsStateQuery.verify(gl.STENCIL_CLEAR_VALUE, ref));
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fIntegerStateQueryTests.ActiveTextureTestCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fIntegerStateQueryTests.ActiveTextureTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.ActiveTextureTestCase.prototype.constructor = es3fIntegerStateQueryTests.ActiveTextureTestCase;
+
+ es3fIntegerStateQueryTests.ActiveTextureTestCase.prototype.test = function() {
+ this.check(glsStateQuery.verify(gl.ACTIVE_TEXTURE, gl.TEXTURE0));
+
+ var textureUnits = /** @type {number} */ (gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS));
+
+ for (var ndx = 0; ndx < textureUnits; ++ndx) {
+ gl.activeTexture(gl.TEXTURE0 + ndx);
+
+ this.check(glsStateQuery.verify(gl.ACTIVE_TEXTURE, gl.TEXTURE0 + ndx));
+ }
+ };
+
+ es3fIntegerStateQueryTests.ActiveTextureTestCase.prototype.deinit = function() {
+ // [dag] reset the state of the context
+ gl.activeTexture(gl.TEXTURE0);
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fIntegerStateQueryTests.RenderbufferBindingTestCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fIntegerStateQueryTests.RenderbufferBindingTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.RenderbufferBindingTestCase.prototype.constructor = es3fIntegerStateQueryTests.RenderbufferBindingTestCase;
+
+ es3fIntegerStateQueryTests.RenderbufferBindingTestCase.prototype.test = function() {
+ this.check(glsStateQuery.verify(gl.RENDERBUFFER_BINDING, null));
+
+ /** @type {WebGLRenderbuffer} */ var renderBuffer = gl.createRenderbuffer();
+
+ gl.bindRenderbuffer(gl.RENDERBUFFER, renderBuffer);
+
+ this.check(glsStateQuery.verify(gl.RENDERBUFFER_BINDING, renderBuffer));
+
+ gl.deleteRenderbuffer(renderBuffer);
+ this.check(glsStateQuery.verify(gl.RENDERBUFFER_BINDING, null));
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fIntegerStateQueryTests.SamplerObjectBindingTestCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fIntegerStateQueryTests.SamplerObjectBindingTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.SamplerObjectBindingTestCase.prototype.constructor = es3fIntegerStateQueryTests.SamplerObjectBindingTestCase;
+
+ es3fIntegerStateQueryTests.SamplerObjectBindingTestCase.prototype.test = function() {
+ this.check(glsStateQuery.verify(gl.SAMPLER_BINDING, null));
+
+ bufferedLogToConsole('SingleUnit: Single unit');
+ /** @type {WebGLSampler} */ var sampler = gl.createSampler();
+
+ gl.bindSampler(0, sampler);
+
+ this.check(glsStateQuery.verify(gl.SAMPLER_BINDING, sampler));
+
+ gl.deleteSampler(sampler);
+ this.check(glsStateQuery.verify(gl.SAMPLER_BINDING, null));
+
+ bufferedLogToConsole('MultipleUnits: Multiple units');
+
+ /** @type {WebGLSampler} */ var samplerA = gl.createSampler();
+ /** @type {WebGLSampler} */ var samplerB = gl.createSampler();
+
+ gl.bindSampler(1, samplerA);
+ gl.bindSampler(2, samplerB);
+
+ this.check(glsStateQuery.verify(gl.SAMPLER_BINDING, null));
+
+ gl.activeTexture(gl.TEXTURE1);
+ this.check(glsStateQuery.verify(gl.SAMPLER_BINDING, samplerA));
+
+ gl.activeTexture(gl.TEXTURE2);
+ this.check(glsStateQuery.verify(gl.SAMPLER_BINDING, samplerB));
+
+ gl.deleteSampler(samplerB);
+ gl.deleteSampler(samplerA);
+ };
+
+ es3fIntegerStateQueryTests.SamplerObjectBindingTestCase.prototype.deinit = function() {
+ gl.activeTexture(gl.TEXTURE0);
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} testBindingName
+ * @param {number} textureType
+ */
+ es3fIntegerStateQueryTests.TextureBindingTestCase = function(name, description, testBindingName, textureType) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ /** @type {number} */ this.m_testBindingName = testBindingName;
+ /** @type {number} */ this.m_textureType = textureType;
+ };
+
+ es3fIntegerStateQueryTests.TextureBindingTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.TextureBindingTestCase.prototype.constructor = es3fIntegerStateQueryTests.TextureBindingTestCase;
+
+ es3fIntegerStateQueryTests.TextureBindingTestCase.prototype.test = function() {
+ this.check(glsStateQuery.verify(this.m_testBindingName, null));
+
+ /** @type {WebGLTexture} */ var texture = gl.createTexture();
+
+ gl.bindTexture(this.m_textureType, texture);
+ this.check(glsStateQuery.verify(this.m_testBindingName, texture));
+
+ gl.deleteTexture(texture);
+
+ this.check(glsStateQuery.verify(this.m_testBindingName, null));
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fIntegerStateQueryTests.FrameBufferBindingTestCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fIntegerStateQueryTests.FrameBufferBindingTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.FrameBufferBindingTestCase.prototype.constructor = es3fIntegerStateQueryTests.FrameBufferBindingTestCase;
+
+ es3fIntegerStateQueryTests.FrameBufferBindingTestCase.prototype.test = function() {
+ this.check(glsStateQuery.verify(gl.DRAW_FRAMEBUFFER_BINDING, null));
+ this.check(glsStateQuery.verify(gl.FRAMEBUFFER_BINDING, null));
+ this.check(glsStateQuery.verify(gl.READ_FRAMEBUFFER_BINDING, null));
+
+ /** @type {WebGLFramebuffer} */ var framebufferId = gl.createFramebuffer();
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, framebufferId);
+
+ this.check(glsStateQuery.verify(gl.DRAW_FRAMEBUFFER_BINDING, framebufferId));
+ this.check(glsStateQuery.verify(gl.FRAMEBUFFER_BINDING, framebufferId));
+ this.check(glsStateQuery.verify(gl.READ_FRAMEBUFFER_BINDING, framebufferId));
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+
+ this.check(glsStateQuery.verify(gl.DRAW_FRAMEBUFFER_BINDING, null));
+ this.check(glsStateQuery.verify(gl.FRAMEBUFFER_BINDING, null));
+ this.check(glsStateQuery.verify(gl.READ_FRAMEBUFFER_BINDING, null));
+
+ gl.bindFramebuffer(gl.READ_FRAMEBUFFER, framebufferId);
+
+ this.check(glsStateQuery.verify(gl.DRAW_FRAMEBUFFER_BINDING, null));
+ this.check(glsStateQuery.verify(gl.FRAMEBUFFER_BINDING, null));
+ this.check(glsStateQuery.verify(gl.READ_FRAMEBUFFER_BINDING, framebufferId));
+
+ gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, framebufferId);
+
+ this.check(glsStateQuery.verify(gl.DRAW_FRAMEBUFFER_BINDING, framebufferId));
+ this.check(glsStateQuery.verify(gl.FRAMEBUFFER_BINDING, framebufferId));
+ this.check(glsStateQuery.verify(gl.READ_FRAMEBUFFER_BINDING, framebufferId));
+
+ gl.deleteFramebuffer(framebufferId);
+
+ this.check(glsStateQuery.verify(gl.DRAW_FRAMEBUFFER_BINDING, null));
+ this.check(glsStateQuery.verify(gl.FRAMEBUFFER_BINDING, null));
+ this.check(glsStateQuery.verify(gl.READ_FRAMEBUFFER_BINDING, null));
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fIntegerStateQueryTests.ImplementationColorReadTestCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fIntegerStateQueryTests.ImplementationColorReadTestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.ImplementationColorReadTestCase.prototype.constructor = es3fIntegerStateQueryTests.ImplementationColorReadTestCase;
+
+ es3fIntegerStateQueryTests.ImplementationColorReadTestCase.prototype.test = function() {
+ /** @type {Array<number>} */ var defaultColorTypes = [
+ gl.UNSIGNED_BYTE, gl.BYTE, gl.UNSIGNED_SHORT, gl.SHORT,
+ gl.UNSIGNED_INT, gl.INT, gl.HALF_FLOAT, gl.FLOAT, gl.UNSIGNED_SHORT_5_6_5,
+ gl.UNSIGNED_SHORT_4_4_4_4, gl.UNSIGNED_SHORT_5_5_5_1,
+ gl.UNSIGNED_INT_2_10_10_10_REV, gl.UNSIGNED_INT_10F_11F_11F_REV
+ ];
+
+ /** @type {Array<number>} */ var defaultColorFormats = [
+ gl.RGBA, gl.RGBA_INTEGER, gl.RGB, gl.RGB_INTEGER,
+ gl.RG, gl.RG_INTEGER, gl.RED, gl.RED_INTEGER
+ ];
+
+ /** @type {Array<number>} */ var validColorTypes = [];
+ /** @type {Array<number>} */ var validColorFormats = [];
+
+ // Defined by the spec
+
+ for (var ndx = 0; ndx < defaultColorTypes.length; ++ndx)
+ validColorTypes.push(defaultColorTypes[ndx]);
+ for (var ndx = 0; ndx < defaultColorFormats.length; ++ndx)
+ validColorFormats.push(defaultColorFormats[ndx]);
+
+ // Extensions
+
+ // if (this.m_context.getContextInfo().isExtensionSupported("gl.EXT_texture_format_BGRA8888") ||
+ // this.m_context.getContextInfo().isExtensionSupported("gl.APPLE_texture_format_BGRA8888"))
+ // validColorFormats.push(gl.BGRA);
+ //
+ // if (this.m_context.getContextInfo().isExtensionSupported("gl.EXT_read_format_bgra")) {
+ // validColorFormats.push(gl.BGRA);
+ // validColorTypes.push(gl.UNSIGNED_SHORT_4_4_4_4_REV);
+ // validColorTypes.push(gl.UNSIGNED_SHORT_1_5_5_5_REV);
+ // }
+ //
+ // if (this.m_context.getContextInfo().isExtensionSupported("gl.IMG_read_format")) {
+ // validColorFormats.push(gl.BGRA);
+ // validColorTypes.push(gl.UNSIGNED_SHORT_4_4_4_4_REV);
+ // }
+ //
+ // if (this.m_context.getContextInfo().isExtensionSupported("gl.NV_sRGB_formats")) {
+ // validColorFormats.push(gl.SLUMINANCE_NV);
+ // validColorFormats.push(gl.SLUMINANCE_ALPHA_NV);
+ // }
+ //
+ // if (this.m_context.getContextInfo().isExtensionSupported("gl.NV_bgr")) {
+ // validColorFormats.push(gl.BGR_NV);
+ // }
+
+ this.check(glsStateQuery.verifyAnyOf(gl.IMPLEMENTATION_COLOR_READ_TYPE, validColorTypes));
+ this.check(glsStateQuery.verifyAnyOf(gl.IMPLEMENTATION_COLOR_READ_FORMAT, validColorFormats));
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fIntegerStateQueryTests.ReadBufferCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fIntegerStateQueryTests.ReadBufferCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.ReadBufferCase.prototype.constructor = es3fIntegerStateQueryTests.ReadBufferCase;
+
+ es3fIntegerStateQueryTests.ReadBufferCase.prototype.test = function() {
+ /** @type {Array<number>} */ var validInitialValues = [gl.BACK, gl.NONE];
+ this.check(glsStateQuery.verifyAnyOf(gl.READ_BUFFER, validInitialValues));
+
+ gl.readBuffer(gl.NONE);
+ this.check(glsStateQuery.verify(gl.READ_BUFFER, gl.NONE));
+
+ gl.readBuffer(gl.BACK);
+ this.check(glsStateQuery.verify(gl.READ_BUFFER, gl.BACK));
+
+ // test gl.READ_BUFFER with framebuffers
+
+ /** @type {WebGLFramebuffer} */ var framebufferId = gl.createFramebuffer();
+
+ /** @type {WebGLRenderbuffer} */ var renderbuffer_id = gl.createRenderbuffer();
+
+ gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer_id);
+
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA8, 128, 128);
+
+ gl.bindFramebuffer(gl.READ_FRAMEBUFFER, framebufferId);
+
+ gl.framebufferRenderbuffer(gl.READ_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, renderbuffer_id);
+
+ this.check(glsStateQuery.verify(gl.READ_BUFFER, gl.COLOR_ATTACHMENT0));
+
+ gl.deleteFramebuffer(framebufferId);
+ gl.deleteRenderbuffer(renderbuffer_id);
+
+ this.check(glsStateQuery.verify(gl.READ_BUFFER, gl.BACK));
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fIntegerStateQueryTests.DrawBufferCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ };
+
+ es3fIntegerStateQueryTests.DrawBufferCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.DrawBufferCase.prototype.constructor = es3fIntegerStateQueryTests.DrawBufferCase;
+
+ es3fIntegerStateQueryTests.DrawBufferCase.prototype.test = function() {
+ /** @type {Array<number>} */ var validInitialValues = [gl.BACK, gl.NONE];
+ this.check(glsStateQuery.verifyAnyOf(gl.DRAW_BUFFER0, validInitialValues));
+
+ /** @type {number} */ var bufs = gl.NONE;
+ gl.drawBuffers([bufs]);
+ this.check(glsStateQuery.verify(gl.DRAW_BUFFER0, gl.NONE));
+
+ bufs = gl.BACK;
+ gl.drawBuffers([bufs]);
+ this.check(glsStateQuery.verify(gl.DRAW_BUFFER0, gl.BACK));
+
+ // test gl.DRAW_BUFFER with framebuffers
+
+ /** @type {WebGLFramebuffer} */ var framebufferId = gl.createFramebuffer();
+
+ /** @type {Array<WebGLRenderbuffer>} */ var renderbuffer_ids = [];
+
+ for (var ndx = 0; ndx < 2; ndx++)
+ renderbuffer_ids[ndx] = gl.createRenderbuffer();
+
+ gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer_ids[0]);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA8, 128, 128);
+
+ gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer_ids[1]);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA8, 128, 128);
+
+ gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, framebufferId);
+
+ gl.framebufferRenderbuffer(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, renderbuffer_ids[0]);
+ gl.framebufferRenderbuffer(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT1, gl.RENDERBUFFER, renderbuffer_ids[1]);
+
+ // only the initial state the draw buffer for fragment color zero is defined
+ this.check(glsStateQuery.verify(gl.DRAW_BUFFER0, gl.COLOR_ATTACHMENT0));
+
+ /** @type {Array<number>} */ var bufTargets = [gl.NONE, gl.COLOR_ATTACHMENT1];
+ gl.drawBuffers(bufTargets);
+ this.check(glsStateQuery.verify(gl.DRAW_BUFFER0, gl.NONE));
+ this.check(glsStateQuery.verify(gl.DRAW_BUFFER1, gl.COLOR_ATTACHMENT1));
+
+ gl.deleteFramebuffer(framebufferId);
+ gl.deleteRenderbuffer(renderbuffer_ids[0]);
+ gl.deleteRenderbuffer(renderbuffer_ids[1]);
+
+ this.check(glsStateQuery.verify(gl.DRAW_BUFFER0, gl.BACK));
+ };
+
+ // Integer64
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} targetName
+ * @param {number} minValue
+ */
+ es3fIntegerStateQueryTests.ConstantMinimumValue64TestCase = function(name, description, targetName, minValue) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ /** @type {number} */ this.m_targetName = targetName;
+ /** @type {number} */ this.m_minValue = minValue;
+ };
+
+ es3fIntegerStateQueryTests.ConstantMinimumValue64TestCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.ConstantMinimumValue64TestCase.prototype.constructor = es3fIntegerStateQueryTests.ConstantMinimumValue64TestCase;
+
+ es3fIntegerStateQueryTests.ConstantMinimumValue64TestCase.prototype.test = function() {
+ this.check(glsStateQuery.verifyGreaterOrEqual(this.m_targetName, this.m_minValue), 'Fail');
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} targetName
+ * @param {number} targetMaxUniformBlocksName
+ * @param {number} targetMaxUniformComponentsName
+ */
+ es3fIntegerStateQueryTests.MaxCombinedStageUniformComponentsCase = function(name, description, targetName, targetMaxUniformBlocksName, targetMaxUniformComponentsName) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ /** @type {number} */ this.m_targetName = targetName;
+ /** @type {number} */ this.m_targetMaxUniformBlocksName = targetMaxUniformBlocksName;
+ /** @type {number} */ this.m_targetMaxUniformComponentsName = targetMaxUniformComponentsName;
+ };
+
+ es3fIntegerStateQueryTests.MaxCombinedStageUniformComponentsCase.prototype = Object.create(es3fApiCase.ApiCase.prototype);
+ es3fIntegerStateQueryTests.MaxCombinedStageUniformComponentsCase.prototype.constructor = es3fIntegerStateQueryTests.MaxCombinedStageUniformComponentsCase;
+
+ es3fIntegerStateQueryTests.MaxCombinedStageUniformComponentsCase.prototype.test = function() {
+ var uniformBlockSize = /** @type {number} */ (gl.getParameter(gl.MAX_UNIFORM_BLOCK_SIZE));
+ var maxUniformBlocks = /** @type {number} */ (gl.getParameter(this.m_targetMaxUniformBlocksName));
+ var maxUniformComponents = /** @type {number} */ (gl.getParameter(this.m_targetMaxUniformComponentsName));
+
+ // MAX_stage_UNIFORM_BLOCKS * MAX_UNIFORM_BLOCK_SIZE / 4 + MAX_stage_UNIFORM_COMPONENTS
+ /** @type {number} */ var minCombinedUniformComponents = maxUniformBlocks * uniformBlockSize / 4 + maxUniformComponents;
+
+ this.check(glsStateQuery.verifyGreaterOrEqual(this.m_targetName, minCombinedUniformComponents));
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fIntegerStateQueryTests.IntegerStateQueryTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'integers', 'Integer Values');
+ };
+
+ es3fIntegerStateQueryTests.IntegerStateQueryTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fIntegerStateQueryTests.IntegerStateQueryTests.prototype.constructor = es3fIntegerStateQueryTests.IntegerStateQueryTests;
+
+ es3fIntegerStateQueryTests.IntegerStateQueryTests.prototype.init = function() {
+ /**
+ * @struct
+ * @constructor
+ * @param {string} name
+ * @param {string} description
+ * @param {number} targetName
+ * @param {number} value
+ */
+ var LimitedStateInteger = function(name, description, targetName, value) {
+ /** @type {string} */ this.name = name;
+ /** @type {string} */ this.description = description;
+ /** @type {number} */ this.targetName = targetName;
+ /** @type {number} */ this.value = value;
+ };
+
+ /** @type {Array<LimitedStateInteger>} */ var implementationMinLimits = [
+ new LimitedStateInteger('subpixel_bits', 'SUBPIXEL_BITS has minimum value of 4', gl.SUBPIXEL_BITS, 4),
+ new LimitedStateInteger('max_3d_texture_size', 'MAX_3D_TEXTURE_SIZE has minimum value of 256', gl.MAX_3D_TEXTURE_SIZE, 256),
+ new LimitedStateInteger('max_texture_size', 'MAX_TEXTURE_SIZE has minimum value of 2048', gl.MAX_TEXTURE_SIZE, 2048),
+ new LimitedStateInteger('max_array_texture_layers', 'MAX_ARRAY_TEXTURE_LAYERS has minimum value of 256', gl.MAX_ARRAY_TEXTURE_LAYERS, 256),
+ new LimitedStateInteger('max_cube_map_texture_size', 'MAX_CUBE_MAP_TEXTURE_SIZE has minimum value of 2048', gl.MAX_CUBE_MAP_TEXTURE_SIZE, 2048),
+ new LimitedStateInteger('max_renderbuffer_size', 'MAX_RENDERBUFFER_SIZE has minimum value of 2048', gl.MAX_RENDERBUFFER_SIZE, 2048),
+ new LimitedStateInteger('max_draw_buffers', 'MAX_DRAW_BUFFERS has minimum value of 4', gl.MAX_DRAW_BUFFERS, 4),
+ new LimitedStateInteger('max_color_attachments', 'MAX_COLOR_ATTACHMENTS has minimum value of 4', gl.MAX_COLOR_ATTACHMENTS, 4),
+ new LimitedStateInteger('max_elements_indices', 'MAX_ELEMENTS_INDICES has minimum value of 0', gl.MAX_ELEMENTS_INDICES, 0),
+ new LimitedStateInteger('max_elements_vertices', 'MAX_ELEMENTS_VERTICES has minimum value of 0', gl.MAX_ELEMENTS_VERTICES, 0),
+ new LimitedStateInteger('max_vertex_attribs', 'MAX_VERTEX_ATTRIBS has minimum value of 16', gl.MAX_VERTEX_ATTRIBS, 16),
+ new LimitedStateInteger('max_vertex_uniform_components', 'MAX_VERTEX_UNIFORM_COMPONENTS has minimum value of 1024', gl.MAX_VERTEX_UNIFORM_COMPONENTS, 1024),
+ new LimitedStateInteger('max_vertex_uniform_vectors', 'MAX_VERTEX_UNIFORM_VECTORS has minimum value of 256', gl.MAX_VERTEX_UNIFORM_VECTORS, 256),
+ new LimitedStateInteger('max_vertex_uniform_blocks', 'MAX_VERTEX_UNIFORM_BLOCKS has minimum value of 12', gl.MAX_VERTEX_UNIFORM_BLOCKS, 12),
+ new LimitedStateInteger('max_vertex_output_components', 'MAX_VERTEX_OUTPUT_COMPONENTS has minimum value of 64', gl.MAX_VERTEX_OUTPUT_COMPONENTS, 64),
+ new LimitedStateInteger('max_vertex_texture_image_units', 'MAX_VERTEX_TEXTURE_IMAGE_UNITS has minimum value of 16', gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS, 16),
+ new LimitedStateInteger('max_fragment_uniform_components', 'MAX_FRAGMENT_UNIFORM_COMPONENTS has minimum value of 896', gl.MAX_FRAGMENT_UNIFORM_COMPONENTS, 896),
+ new LimitedStateInteger('max_fragment_uniform_vectors', 'MAX_FRAGMENT_UNIFORM_VECTORS has minimum value of 224', gl.MAX_FRAGMENT_UNIFORM_VECTORS, 224),
+ new LimitedStateInteger('max_fragment_uniform_blocks', 'MAX_FRAGMENT_UNIFORM_BLOCKS has minimum value of 12', gl.MAX_FRAGMENT_UNIFORM_BLOCKS, 12),
+ new LimitedStateInteger('max_fragment_input_components', 'MAX_FRAGMENT_INPUT_COMPONENTS has minimum value of 60', gl.MAX_FRAGMENT_INPUT_COMPONENTS, 60),
+ new LimitedStateInteger('max_texture_image_units', 'MAX_TEXTURE_IMAGE_UNITS has minimum value of 16', gl.MAX_TEXTURE_IMAGE_UNITS, 16),
+ new LimitedStateInteger('max_program_texel_offset', 'MAX_PROGRAM_TEXEL_OFFSET has minimum value of 7', gl.MAX_PROGRAM_TEXEL_OFFSET, 7),
+ new LimitedStateInteger('max_uniform_buffer_bindings', 'MAX_UNIFORM_BUFFER_BINDINGS has minimum value of 24', gl.MAX_UNIFORM_BUFFER_BINDINGS, 24),
+ new LimitedStateInteger('max_combined_uniform_blocks', 'MAX_COMBINED_UNIFORM_BLOCKS has minimum value of 24', gl.MAX_COMBINED_UNIFORM_BLOCKS, 24),
+ new LimitedStateInteger('max_varying_components', 'MAX_VARYING_COMPONENTS has minimum value of 60', gl.MAX_VARYING_COMPONENTS, 60),
+ new LimitedStateInteger('max_varying_vectors', 'MAX_VARYING_VECTORS has minimum value of 15', gl.MAX_VARYING_VECTORS, 15),
+ new LimitedStateInteger('max_combined_texture_image_units', 'MAX_COMBINED_TEXTURE_IMAGE_UNITS has minimum value of 32', gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS, 32),
+ new LimitedStateInteger('max_transform_feedback_interleaved_components', 'MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS has minimum value of 64', gl.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS, 64),
+ new LimitedStateInteger('max_transform_feedback_separate_attribs', 'MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS has minimum value of 4', gl.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, 4),
+ new LimitedStateInteger('max_transform_feedback_separate_components', 'MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS has minimum value of 4', gl.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS, 4),
+ new LimitedStateInteger('max_samples', 'MAX_SAMPLES has minimum value of 4', gl.MAX_SAMPLES, 4),
+ new LimitedStateInteger('red_bits', 'RED_BITS has minimum value of 0', gl.RED_BITS, 0),
+ new LimitedStateInteger('green_bits', 'GREEN_BITS has minimum value of 0', gl.GREEN_BITS, 0),
+ new LimitedStateInteger('blue_bits', 'BLUE_BITS has minimum value of 0', gl.BLUE_BITS, 0),
+ new LimitedStateInteger('alpha_bits', 'ALPHA_BITS has minimum value of 0', gl.ALPHA_BITS, 0),
+ new LimitedStateInteger('depth_bits', 'DEPTH_BITS has minimum value of 0', gl.DEPTH_BITS, 0),
+ new LimitedStateInteger('stencil_bits', 'STENCIL_BITS has minimum value of 0', gl.STENCIL_BITS, 0)
+ ];
+
+ /** @type {Array<LimitedStateInteger>} */ var implementationMaxLimits = [
+ new LimitedStateInteger('min_program_texel_offset', 'MIN_PROGRAM_TEXEL_OFFSET has maximum value of -8', gl.MIN_PROGRAM_TEXEL_OFFSET, -8),
+ new LimitedStateInteger('uniform_buffer_offset_alignment', 'UNIFORM_BUFFER_OFFSET_ALIGNMENT has minimum value of 1', gl.UNIFORM_BUFFER_OFFSET_ALIGNMENT, 256)
+ ];
+
+ var testCtx = this;
+
+ for (var testNdx = 0; testNdx < implementationMinLimits.length; testNdx++)
+ testCtx.addChild(new es3fIntegerStateQueryTests.ConstantMinimumValueTestCase(implementationMinLimits[testNdx].name, implementationMinLimits[testNdx].description, implementationMinLimits[testNdx].targetName, implementationMinLimits[testNdx].value));
+
+ for (var testNdx = 0; testNdx < implementationMaxLimits.length; testNdx++)
+ testCtx.addChild(new es3fIntegerStateQueryTests.ConstantMaximumValueTestCase(implementationMaxLimits[testNdx].name, implementationMaxLimits[testNdx].description, implementationMaxLimits[testNdx].targetName, implementationMaxLimits[testNdx].value));
+
+ testCtx.addChild(new es3fIntegerStateQueryTests.SampleBuffersTestCase('sample_buffers', 'SAMPLE_BUFFERS'));
+ testCtx.addChild(new es3fIntegerStateQueryTests.SamplesTestCase('samples' , 'SAMPLES'));
+ testCtx.addChild(new es3fIntegerStateQueryTests.HintTestCase('generate_mipmap_hint', 'GENERATE_MIPMAP_HINT', gl.GENERATE_MIPMAP_HINT));
+ testCtx.addChild(new es3fIntegerStateQueryTests.HintTestCase('fragment_shader_derivative_hint', 'FRAGMENT_SHADER_DERIVATIVE_HINT', gl.FRAGMENT_SHADER_DERIVATIVE_HINT));
+ testCtx.addChild(new es3fIntegerStateQueryTests.DepthFuncTestCase('depth_func', 'DEPTH_FUNC'));
+ testCtx.addChild(new es3fIntegerStateQueryTests.CullFaceTestCase('cull_face_mode', 'CULL_FACE_MODE'));
+ testCtx.addChild(new es3fIntegerStateQueryTests.FrontFaceTestCase('front_face_mode', 'FRONT_FACE'));
+ testCtx.addChild(new es3fIntegerStateQueryTests.ViewPortTestCase('viewport', 'VIEWPORT'));
+ testCtx.addChild(new es3fIntegerStateQueryTests.ScissorBoxTestCase('scissor_box', 'SCISSOR_BOX'));
+ testCtx.addChild(new es3fIntegerStateQueryTests.MaxViewportDimsTestCase('max_viewport_dims', 'MAX_VIEWPORT_DIMS'));
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilRefTestCase('stencil_ref', 'STENCIL_REF', gl.STENCIL_REF));
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilRefTestCase('stencil_back_ref', 'STENCIL_BACK_REF', gl.STENCIL_BACK_REF));
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilRefSeparateTestCase('stencil_ref_separate', 'STENCIL_REF (separate)', gl.STENCIL_REF, gl.FRONT));
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilRefSeparateTestCase('stencil_ref_separate_both', 'STENCIL_REF (separate)', gl.STENCIL_REF, gl.FRONT_AND_BACK));
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilRefSeparateTestCase('stencil_back_ref_separate', 'STENCIL_BACK_REF (separate)', gl.STENCIL_BACK_REF, gl.BACK));
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilRefSeparateTestCase('stencil_back_ref_separate_both', 'STENCIL_BACK_REF (separate)', gl.STENCIL_BACK_REF, gl.FRONT_AND_BACK));
+
+ /**
+ * @struct
+ * @constructor
+ * @param {string} name
+ * @param {string} frontDescription
+ * @param {number} frontTarget
+ * @param {string} backDescription
+ * @param {number} backTarget
+ */
+ var NamedStencilOp = function(name, frontDescription, frontTarget, backDescription, backTarget) {
+ /** @type {string} */ this.name = name;
+ /** @type {string} */ this.frontDescription = frontDescription;
+ /** @type {number} */ this.frontTarget = frontTarget;
+ /** @type {string} */ this.backDescription = backDescription;
+ /** @type {number} */ this.backTarget = backTarget;
+ };
+
+ /** @type {Array<NamedStencilOp>} */ var stencilOps = [
+ new NamedStencilOp('fail', 'STENCIL_FAIL', gl.STENCIL_FAIL, 'STENCIL_BACK_FAIL', gl.STENCIL_BACK_FAIL),
+ new NamedStencilOp('depth_fail', 'STENCIL_PASS_DEPTH_FAIL', gl.STENCIL_PASS_DEPTH_FAIL, 'STENCIL_BACK_PASS_DEPTH_FAIL', gl.STENCIL_BACK_PASS_DEPTH_FAIL),
+ new NamedStencilOp('depth_pass', 'STENCIL_PASS_DEPTH_PASS', gl.STENCIL_PASS_DEPTH_PASS, 'STENCIL_BACK_PASS_DEPTH_PASS', gl.STENCIL_BACK_PASS_DEPTH_PASS)
+ ];
+
+ for (var testNdx = 0; testNdx < stencilOps.length; testNdx++) {
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilOpTestCase('stencil_' + stencilOps[testNdx].name, stencilOps[testNdx].frontDescription, stencilOps[testNdx].frontTarget));
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilOpTestCase('stencil_back_' + stencilOps[testNdx].name, stencilOps[testNdx].backDescription, stencilOps[testNdx].backTarget));
+
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilOpSeparateTestCase('stencil_' + stencilOps[testNdx].name + '_separate_both', stencilOps[testNdx].frontDescription, stencilOps[testNdx].frontTarget, gl.FRONT_AND_BACK));
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilOpSeparateTestCase('stencil_back_' + stencilOps[testNdx].name + '_separate_both', stencilOps[testNdx].backDescription, stencilOps[testNdx].backTarget, gl.FRONT_AND_BACK));
+
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilOpSeparateTestCase('stencil_' + stencilOps[testNdx].name + '_separate', stencilOps[testNdx].frontDescription, stencilOps[testNdx].frontTarget, gl.FRONT));
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilOpSeparateTestCase('stencil_back_' + stencilOps[testNdx].name + '_separate', stencilOps[testNdx].backDescription, stencilOps[testNdx].backTarget, gl.BACK));
+ }
+
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilFuncTestCase('stencil_func', 'STENCIL_FUNC'));
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilFuncSeparateTestCase('stencil_func_separate', 'STENCIL_FUNC (separate)', gl.STENCIL_FUNC, gl.FRONT));
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilFuncSeparateTestCase('stencil_func_separate_both', 'STENCIL_FUNC (separate)', gl.STENCIL_FUNC, gl.FRONT_AND_BACK));
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilFuncSeparateTestCase('stencil_back_func_separate', 'STENCIL_FUNC (separate)', gl.STENCIL_BACK_FUNC, gl.BACK));
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilFuncSeparateTestCase('stencil_back_func_separate_both', 'STENCIL_FUNC (separate)', gl.STENCIL_BACK_FUNC, gl.FRONT_AND_BACK));
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilMaskTestCase('stencil_value_mask', 'STENCIL_VALUE_MASK', gl.STENCIL_VALUE_MASK));
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilMaskTestCase('stencil_back_value_mask', 'STENCIL_BACK_VALUE_MASK', gl.STENCIL_BACK_VALUE_MASK));
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilMaskSeparateTestCase('stencil_value_mask_separate', 'STENCIL_VALUE_MASK (separate)', gl.STENCIL_VALUE_MASK, gl.FRONT));
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilMaskSeparateTestCase('stencil_value_mask_separate_both', 'STENCIL_VALUE_MASK (separate)', gl.STENCIL_VALUE_MASK, gl.FRONT_AND_BACK));
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilMaskSeparateTestCase('stencil_back_value_mask_separate', 'STENCIL_BACK_VALUE_MASK (separate)', gl.STENCIL_BACK_VALUE_MASK, gl.BACK));
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilMaskSeparateTestCase('stencil_back_value_mask_separate_both', 'STENCIL_BACK_VALUE_MASK (separate)', gl.STENCIL_BACK_VALUE_MASK, gl.FRONT_AND_BACK));
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilWriteMaskTestCase('stencil_writemask', 'STENCIL_WRITEMASK', gl.STENCIL_WRITEMASK));
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilWriteMaskTestCase('stencil_back_writemask', 'STENCIL_BACK_WRITEMASK', gl.STENCIL_BACK_WRITEMASK));
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilWriteMaskSeparateTestCase('stencil_writemask_separate', 'STENCIL_WRITEMASK (separate)', gl.STENCIL_WRITEMASK, gl.FRONT));
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilWriteMaskSeparateTestCase('stencil_writemask_separate_both', 'STENCIL_WRITEMASK (separate)', gl.STENCIL_WRITEMASK, gl.FRONT_AND_BACK));
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilWriteMaskSeparateTestCase('stencil_back_writemask_separate', 'STENCIL_BACK_WRITEMASK (separate)', gl.STENCIL_BACK_WRITEMASK, gl.BACK));
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilWriteMaskSeparateTestCase('stencil_back_writemask_separate_both', 'STENCIL_BACK_WRITEMASK (separate)', gl.STENCIL_BACK_WRITEMASK, gl.FRONT_AND_BACK));
+
+ /**
+ * @struct
+ * @constructor
+ * @param {string} name
+ * @param {string} description
+ * @param {number} target
+ * @param {number} initialValue
+ */
+ var PixelStoreState = function(name, description, target, initialValue) {
+ /** @type {string} */ this.name = name;
+ /** @type {string} */ this.description = description;
+ /** @type {number} */ this.target = target;
+ /** @type {number} */ this.initialValue = initialValue;
+ };
+
+ /** @type {Array<PixelStoreState>} */ var pixelStoreStates = [
+ new PixelStoreState('unpack_image_height', 'UNPACK_IMAGE_HEIGHT', gl.UNPACK_IMAGE_HEIGHT, 0),
+ new PixelStoreState('unpack_skip_images', 'UNPACK_SKIP_IMAGES', gl.UNPACK_SKIP_IMAGES, 0),
+ new PixelStoreState('unpack_row_length', 'UNPACK_ROW_LENGTH', gl.UNPACK_ROW_LENGTH, 0),
+ new PixelStoreState('unpack_skip_rows', 'UNPACK_SKIP_ROWS', gl.UNPACK_SKIP_ROWS, 0),
+ new PixelStoreState('unpack_skip_pixels', 'UNPACK_SKIP_PIXELS', gl.UNPACK_SKIP_PIXELS, 0),
+ new PixelStoreState('pack_row_length', 'PACK_ROW_LENGTH', gl.PACK_ROW_LENGTH, 0),
+ new PixelStoreState('pack_skip_rows', 'PACK_SKIP_ROWS', gl.PACK_SKIP_ROWS, 0),
+ new PixelStoreState('pack_skip_pixels', 'PACK_SKIP_PIXELS', gl.PACK_SKIP_PIXELS, 0)
+ ];
+
+ for (var testNdx = 0; testNdx < pixelStoreStates.length; testNdx++)
+ testCtx.addChild(new es3fIntegerStateQueryTests.PixelStoreTestCase(pixelStoreStates[testNdx].name, pixelStoreStates[testNdx].description, pixelStoreStates[testNdx].target, pixelStoreStates[testNdx].initialValue));
+
+ testCtx.addChild(new es3fIntegerStateQueryTests.PixelStoreAlignTestCase('unpack_alignment', 'UNPACK_ALIGNMENT', gl.UNPACK_ALIGNMENT));
+ testCtx.addChild(new es3fIntegerStateQueryTests.PixelStoreAlignTestCase('pack_alignment', 'PACK_ALIGNMENT', gl.PACK_ALIGNMENT));
+
+ /**
+ * @struct
+ * @constructor
+ * @param {string} name
+ * @param {string} description
+ * @param {number} target
+ * @param {number} initialValue
+ */
+ var BlendColorState = function(name, description, target, initialValue) {
+ /** @type {string} */ this.name = name;
+ /** @type {string} */ this.description = description;
+ /** @type {number} */ this.target = target;
+ /** @type {number} */ this.initialValue = initialValue;
+ };
+
+ /** @type {Array<PixelStoreState>} */ var blendColorStates = [
+ new BlendColorState('blend_src_rgb', 'BLEND_SRC_RGB', gl.BLEND_SRC_RGB),
+ new BlendColorState('blend_src_alpha', 'BLEND_SRC_ALPHA', gl.BLEND_SRC_ALPHA),
+ new BlendColorState('blend_dst_rgb', 'BLEND_DST_RGB', gl.BLEND_DST_RGB),
+ new BlendColorState('blend_dst_alpha', 'BLEND_DST_ALPHA', gl.BLEND_DST_ALPHA)
+ ];
+
+ for (var testNdx = 0; testNdx < blendColorStates.length; testNdx++) {
+ testCtx.addChild(new es3fIntegerStateQueryTests.BlendFuncTestCase(blendColorStates[testNdx].name, blendColorStates[testNdx].description, blendColorStates[testNdx].target));
+ testCtx.addChild(new es3fIntegerStateQueryTests.BlendFuncSeparateTestCase(blendColorStates[testNdx].name + '_separate', blendColorStates[testNdx].description, blendColorStates[testNdx].target));
+ }
+
+ /**
+ * @struct
+ * @constructor
+ * @param {string} name
+ * @param {string} description
+ * @param {number} target
+ * @param {number} initialValue
+ */
+ var BlendEquationState = function(name, description, target, initialValue) {
+ /** @type {string} */ this.name = name;
+ /** @type {string} */ this.description = description;
+ /** @type {number} */ this.target = target;
+ /** @type {number} */ this.initialValue = initialValue;
+ };
+
+ /** @type {Array<PixelStoreState>} */ var blendEquationStates = [
+ new BlendEquationState('blend_equation_rgb', 'BLEND_EQUATION_RGB', gl.BLEND_EQUATION_RGB, gl.FUNC_ADD),
+ new BlendEquationState('blend_equation_alpha', 'BLEND_EQUATION_ALPHA', gl.BLEND_EQUATION_ALPHA, gl.FUNC_ADD)
+ ];
+
+ for (var testNdx = 0; testNdx < blendEquationStates.length; testNdx++) {
+ testCtx.addChild(new es3fIntegerStateQueryTests.BlendEquationTestCase(blendEquationStates[testNdx].name, blendEquationStates[testNdx].description, blendEquationStates[testNdx].target, blendEquationStates[testNdx].initialValue));
+ testCtx.addChild(new es3fIntegerStateQueryTests.BlendEquationSeparateTestCase(blendEquationStates[testNdx].name + '_separate', blendEquationStates[testNdx].description, blendEquationStates[testNdx].target, blendEquationStates[testNdx].initialValue));
+ }
+
+ /**
+ * @struct
+ * @constructor
+ * @param {string} name
+ * @param {string} description
+ * @param {number} target
+ * @param {number} minValue
+ */
+ var ImplementationArrayReturningState = function(name, description, target, minValue) {
+ /** @type {string} */ this.name = name;
+ /** @type {string} */ this.description = description;
+ /** @type {number} */ this.target = target;
+ /** @type {number} */ this.minValue = minValue;
+ };
+
+ /** @type {ImplementationArrayReturningState} */ var implementationArrayReturningStates = new ImplementationArrayReturningState('compressed_texture_formats', 'COMPRESSED_TEXTURE_FORMATS', gl.COMPRESSED_TEXTURE_FORMATS, 10);
+
+ testCtx.addChild(new es3fIntegerStateQueryTests.ImplementationArrayTestCase(implementationArrayReturningStates.name, implementationArrayReturningStates.description, implementationArrayReturningStates.target, implementationArrayReturningStates.minValue));
+
+ /**
+ * @struct
+ * @constructor
+ * @param {string} name
+ * @param {string} description
+ * @param {number} target
+ * @param {number} type
+ */
+ var BufferBindingState = function(name, description, target, type) {
+ /** @type {string} */ this.name = name;
+ /** @type {string} */ this.description = description;
+ /** @type {number} */ this.target = target;
+ /** @type {number} */ this.type = type;
+ };
+
+ /** @type {Array<BufferBindingState>} */ var bufferBindingStates = [
+ new BufferBindingState('array_buffer_binding', 'ARRAY_BUFFER_BINDING', gl.ARRAY_BUFFER_BINDING, gl.ARRAY_BUFFER),
+ new BufferBindingState('uniform_buffer_binding', 'UNIFORM_BUFFER_BINDING', gl.UNIFORM_BUFFER_BINDING, gl.UNIFORM_BUFFER),
+ new BufferBindingState('pixel_pack_buffer_binding', 'PIXEL_PACK_BUFFER_BINDING', gl.PIXEL_PACK_BUFFER_BINDING, gl.PIXEL_PACK_BUFFER),
+ new BufferBindingState('pixel_unpack_buffer_binding', 'PIXEL_UNPACK_BUFFER_BINDING', gl.PIXEL_UNPACK_BUFFER_BINDING, gl.PIXEL_UNPACK_BUFFER),
+ new BufferBindingState('transform_feedback_buffer_binding', 'TRANSFORM_FEEDBACK_BUFFER_BINDING', gl.TRANSFORM_FEEDBACK_BUFFER_BINDING, gl.TRANSFORM_FEEDBACK_BUFFER),
+ new BufferBindingState('copy_read_buffer_binding', 'COPY_READ_BUFFER_BINDING', gl.COPY_READ_BUFFER_BINDING, gl.COPY_READ_BUFFER),
+ new BufferBindingState('copy_write_buffer_binding', 'COPY_WRITE_BUFFER_BINDING', gl.COPY_WRITE_BUFFER_BINDING, gl.COPY_WRITE_BUFFER)
+ ];
+
+ for (var testNdx = 0; testNdx < bufferBindingStates.length; testNdx++)
+ testCtx.addChild(new es3fIntegerStateQueryTests.BufferBindingTestCase(bufferBindingStates[testNdx].name, bufferBindingStates[testNdx].description, bufferBindingStates[testNdx].target, bufferBindingStates[testNdx].type));
+
+ testCtx.addChild(new es3fIntegerStateQueryTests.ElementArrayBufferBindingTestCase('element_array_buffer_binding'));
+ testCtx.addChild(new es3fIntegerStateQueryTests.TransformFeedbackBindingTestCase('transform_feedback_binding'));
+ testCtx.addChild(new es3fIntegerStateQueryTests.TransformFeedbackBindingTestCase('transform_feedback_binding'));
+ testCtx.addChild(new es3fIntegerStateQueryTests.CurrentProgramBindingTestCase('current_program_binding', 'CURRENT_PROGRAM'));
+ testCtx.addChild(new es3fIntegerStateQueryTests.VertexArrayBindingTestCase('vertex_array_binding', 'VERTEX_ARRAY_BINDING'));
+ testCtx.addChild(new es3fIntegerStateQueryTests.StencilClearValueTestCase('stencil_clear_value', 'STENCIL_CLEAR_VALUE'));
+ testCtx.addChild(new es3fIntegerStateQueryTests.ActiveTextureTestCase('active_texture', 'ACTIVE_TEXTURE'));
+ testCtx.addChild(new es3fIntegerStateQueryTests.RenderbufferBindingTestCase('renderbuffer_binding', 'RENDERBUFFER_BINDING'));
+ testCtx.addChild(new es3fIntegerStateQueryTests.SamplerObjectBindingTestCase('sampler_binding', 'SAMPLER_BINDING'));
+
+ /**
+ * @struct
+ * @constructor
+ * @param {string} name
+ * @param {string} description
+ * @param {number} target
+ * @param {number} type
+ */
+ var TextureBinding = function(name, description, target, type) {
+ /** @type {string} */ this.name = name;
+ /** @type {string} */ this.description = description;
+ /** @type {number} */ this.target = target;
+ /** @type {number} */ this.type = type;
+ };
+
+ /** @type {Array<TextureBinding>} */ var textureBindings = [
+ new TextureBinding('texture_binding_2d', 'TEXTURE_BINDING_2D', gl.TEXTURE_BINDING_2D, gl.TEXTURE_2D),
+ new TextureBinding('texture_binding_3d', 'TEXTURE_BINDING_3D', gl.TEXTURE_BINDING_3D, gl.TEXTURE_3D),
+ new TextureBinding('texture_binding_2d_array', 'TEXTURE_BINDING_2D_ARRAY', gl.TEXTURE_BINDING_2D_ARRAY, gl.TEXTURE_2D_ARRAY),
+ new TextureBinding('texture_binding_cube_map', 'TEXTURE_BINDING_CUBE_MAP', gl.TEXTURE_BINDING_CUBE_MAP, gl.TEXTURE_CUBE_MAP)
+ ];
+
+ for (var testNdx = 0; testNdx < textureBindings.length; testNdx++)
+ testCtx.addChild(new es3fIntegerStateQueryTests.TextureBindingTestCase(textureBindings[testNdx].name, textureBindings[testNdx].description, textureBindings[testNdx].target, textureBindings[testNdx].type));
+
+ testCtx.addChild(new es3fIntegerStateQueryTests.FrameBufferBindingTestCase('framebuffer_binding', 'DRAW_FRAMEBUFFER_BINDING and READ_FRAMEBUFFER_BINDING'));
+ testCtx.addChild(new es3fIntegerStateQueryTests.ImplementationColorReadTestCase('implementation_color_read', 'IMPLEMENTATION_COLOR_READ_TYPE and IMPLEMENTATION_COLOR_READ_FORMAT'));
+ testCtx.addChild(new es3fIntegerStateQueryTests.ReadBufferCase('read_buffer', 'READ_BUFFER'));
+ testCtx.addChild(new es3fIntegerStateQueryTests.DrawBufferCase('draw_buffer', 'DRAW_BUFFER'));
+
+
+ // Integer64
+ /**
+ * @struct
+ * @constructor
+ * @param {string} name
+ * @param {string} description
+ * @param {number} targetName
+ * @param {number} minValue
+ */
+ var LimitedStateInteger64 = function(name, description, targetName, minValue) {
+ /** @type {string} */ this.name = name;
+ /** @type {string} */ this.description = description;
+ /** @type {number} */ this.targetName = targetName;
+ /** @type {number} */ this.minValue = minValue;
+
+ };
+
+ /** @type {Array<LimitedStateInteger64>} */ var implementationLimits = [
+ new LimitedStateInteger64('max_element_index', 'MAX_ELEMENT_INDEX', gl.MAX_ELEMENT_INDEX, 0x00FFFFFF),
+ new LimitedStateInteger64('max_server_wait_timeout', 'MAX_SERVER_WAIT_TIMEOUT', gl.MAX_SERVER_WAIT_TIMEOUT, 0),
+ new LimitedStateInteger64('max_uniform_block_size', 'MAX_UNIFORM_BLOCK_SIZE', gl.MAX_UNIFORM_BLOCK_SIZE, 16384)
+ ];
+
+ for (var testNdx = 0; testNdx < implementationLimits.length; testNdx++)
+ this.addChild(new es3fIntegerStateQueryTests.ConstantMinimumValue64TestCase(implementationLimits[testNdx].name, implementationLimits[testNdx].description, implementationLimits[testNdx].targetName, implementationLimits[testNdx].minValue));
+
+ this.addChild(new es3fIntegerStateQueryTests.MaxCombinedStageUniformComponentsCase('max_combined_vertex_uniform_components', 'MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS', gl.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS, gl.MAX_VERTEX_UNIFORM_BLOCKS, gl.MAX_VERTEX_UNIFORM_COMPONENTS));
+ this.addChild(new es3fIntegerStateQueryTests.MaxCombinedStageUniformComponentsCase('max_combined_fragment_uniform_components', 'MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS', gl.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS, gl.MAX_FRAGMENT_UNIFORM_BLOCKS, gl.MAX_FRAGMENT_UNIFORM_COMPONENTS));
+
+ };
+
+ /**
+ * Run test
+ * @param {WebGL2RenderingContext} context
+ */
+ es3fIntegerStateQueryTests.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fIntegerStateQueryTests.IntegerStateQueryTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fIntegerStateQueryTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fInternalFormatQueryTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fInternalFormatQueryTests.js
new file mode 100644
index 0000000000..8eb1b0e2c0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fInternalFormatQueryTests.js
@@ -0,0 +1,173 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fInternalFormatQueryTests');
+goog.require('framework.common.tcuTestCase');
+goog.require('functional.gles3.es3fApiCase');
+goog.require('modules.shared.glsStateQuery');
+
+goog.scope(function() {
+var es3fInternalFormatQueryTests = functional.gles3.es3fInternalFormatQueryTests;
+var tcuTestCase = framework.common.tcuTestCase;
+var glsStateQuery = modules.shared.glsStateQuery;
+var es3fApiCase = functional.gles3.es3fApiCase;
+
+var setParentClass = function(child, parent) {
+ child.prototype = Object.create(parent.prototype);
+ child.prototype.constructor = child;
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} internalFormat
+ * @param {boolean} isIntegerInternalFormat
+ */
+es3fInternalFormatQueryTests.SamplesCase = function(name, description, internalFormat, isIntegerInternalFormat) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ this.m_internalFormat = internalFormat;
+ this.m_isIntegerInternalFormat = isIntegerInternalFormat;
+};
+
+setParentClass(es3fInternalFormatQueryTests.SamplesCase, es3fApiCase.ApiCase);
+
+es3fInternalFormatQueryTests.SamplesCase.prototype.test = function() {
+ var samples = gl.getInternalformatParameter(gl.RENDERBUFFER, this.m_internalFormat, gl.SAMPLES);
+
+ this.check(!this.m_isIntegerInternalFormat || samples.length == 0, 'integer internal format should have 0 samples, got ' + samples.length);
+
+ if (samples.length == 0)
+ return;
+
+ var prevSampleCount = 0;
+ var sampleCount = 0;
+ for (var ndx = 0; ndx < samples.length; ++ndx, prevSampleCount = sampleCount) {
+ sampleCount = samples[ndx];
+
+ // sample count must be > 0
+ this.check(sampleCount > 0, 'Expected sample count to be at least one; got ' + sampleCount);
+
+ // samples must be ordered descending
+ this.check(ndx == 0 || sampleCount < prevSampleCount, 'Expected sample count to be ordered in descending order; got ' + prevSampleCount + ' at index ' + (ndx - 1) + ', and ' + sampleCount + ' at index ' + ndx);
+ }
+
+ // the maximum value in SAMPLES is guaranteed to be at least the value of MAX_SAMPLES
+ var maxSamples = /** @type {number} */ (gl.getParameter(gl.MAX_SAMPLES));
+ var maximumFormatSampleCount = samples[0];
+ this.check(maximumFormatSampleCount >= maxSamples, 'Expected maximum value in SAMPLES (' + maximumFormatSampleCount + ') to be at least the value of MAX_SAMPLES (' + maxSamples + ')');
+};
+
+/**
+* @constructor
+* @extends {tcuTestCase.DeqpTest}
+*/
+es3fInternalFormatQueryTests.InternalFormatQueryTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'internal_format', 'Internal Format Query tests');
+};
+
+es3fInternalFormatQueryTests.InternalFormatQueryTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+es3fInternalFormatQueryTests.InternalFormatQueryTests.prototype.constructor = es3fInternalFormatQueryTests.InternalFormatQueryTests;
+
+es3fInternalFormatQueryTests.InternalFormatQueryTests.prototype.init = function() {
+ var internalFormats = [
+ //name, format, is_integer
+ // color renderable and unsized
+ // \note These unsized formats seem to allowed by the spec, but they are not useful in any way. (You can't create a renderbuffer with such internalFormat)
+ ['rgba', gl.RGBA, false],
+ ['rgb', gl.RGB, false],
+
+ // color renderable
+ ['r8', gl.R8, false],
+ ['rg8', gl.RG8, false],
+ ['rgb8', gl.RGB8, false],
+ ['rgb565', gl.RGB565, false],
+ ['rgba4', gl.RGBA4, false],
+ ['rgb5_a1', gl.RGB5_A1, false],
+ ['rgba8', gl.RGBA8, false],
+ ['rgb10_a2', gl.RGB10_A2, false],
+ ['rgb10_a2ui', gl.RGB10_A2UI, true],
+ ['srgb8_alpha8', gl.SRGB8_ALPHA8, false],
+ ['r8i', gl.R8I, true],
+ ['r8ui', gl.R8UI, true],
+ ['r16i', gl.R16I, true],
+ ['r16ui', gl.R16UI, true],
+ ['r32i', gl.R32I, true],
+ ['r32ui', gl.R32UI, true],
+ ['rg8i', gl.RG8I, true],
+ ['rg8ui', gl.RG8UI, true],
+ ['rg16i', gl.RG16I, true],
+ ['rg16ui', gl.RG16UI, true],
+ ['rg32i', gl.RG32I, true],
+ ['rg32ui', gl.RG32UI, true],
+ ['rgba8i', gl.RGBA8I, true],
+ ['rgba8ui', gl.RGBA8UI, true],
+ ['rgba16i', gl.RGBA16I, true],
+ ['rgba16ui', gl.RGBA16UI, true],
+ ['rgba32i', gl.RGBA32I, true],
+ ['rgba32ui', gl.RGBA32UI, true],
+
+ // depth renderable
+ ['depth_component16', gl.DEPTH_COMPONENT16, false],
+ ['depth_component24', gl.DEPTH_COMPONENT24, false],
+ ['depth_component32f', gl.DEPTH_COMPONENT32F, false],
+ ['depth24_stencil8', gl.DEPTH24_STENCIL8, false],
+ ['depth32f_stencil8', gl.DEPTH32F_STENCIL8, false],
+
+ // stencil renderable
+ ['stencil_index8', gl.STENCIL_INDEX8, false]
+ // DEPTH24_STENCIL8, duplicate
+ // DEPTH32F_STENCIL8 duplicate
+ ];
+
+ for (var ndx = 0; ndx < internalFormats.length; ++ndx) {
+ var internalFormat = internalFormats[ndx];
+
+ this.addChild(new es3fInternalFormatQueryTests.SamplesCase(internalFormat[0] + '_samples', 'SAMPLES and NUM_SAMPLE_COUNTS', internalFormat[1], internalFormat[2]));
+ }
+};
+
+/**
+* Run test
+* @param {WebGL2RenderingContext} context
+*/
+es3fInternalFormatQueryTests.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fInternalFormatQueryTests.InternalFormatQueryTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fInternalFormatQueryTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fLifetimeTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fLifetimeTests.js
new file mode 100644
index 0000000000..b179022bfd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fLifetimeTests.js
@@ -0,0 +1,471 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+'use strict';
+goog.provide('functional.gles3.es3fLifetimeTests');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('modules.shared.glsLifetimeTests');
+goog.require('modules.shared.glsTextureTestUtil');
+
+goog.scope(function() {
+var es3fLifetimeTests = functional.gles3.es3fLifetimeTests;
+var glsLifetimeTests = modules.shared.glsLifetimeTests;
+var gluShaderProgram = framework.opengl.gluShaderProgram;
+var deRandom = framework.delibs.debase.deRandom;
+var tcuSurface = framework.common.tcuSurface;
+var glsTextureTestUtil = modules.shared.glsTextureTestUtil;
+var tcuTestCase = framework.common.tcuTestCase;
+
+/** @const */ var VIEWPORT_SIZE = 128;
+/** @const */ var NUM_COMPONENTS = 4;
+/** @const */ var NUM_VERTICES = 3;
+
+/** @type {WebGL2RenderingContext} */ var gl;
+
+var setParentClass = function(child, parent) {
+ child.prototype = Object.create(parent.prototype);
+ child.prototype.constructor = child;
+};
+
+/**
+ * @constructor
+ * @extends {gluShaderProgram.ShaderProgram}
+ */
+es3fLifetimeTests.ScaleProgram = function() {
+ gluShaderProgram.ShaderProgram.call(this, gl, this.getSources());
+ assertMsgOptions(this.isOk(), 'Program creation failed', false, true);
+ this.m_scaleLoc = gl.getUniformLocation(this.getProgram(), 'scale');
+ this.m_posLoc = gl.getAttribLocation(this.getProgram(), 'pos');
+};
+
+setParentClass(es3fLifetimeTests.ScaleProgram, gluShaderProgram.ShaderProgram);
+
+/**
+ * @param {WebGLVertexArrayObject} vao
+ * @param {number} scale
+ * @param {boolean} tf
+ * @param {tcuSurface.Surface} dst
+ */
+es3fLifetimeTests.ScaleProgram.prototype.draw = function(vao, scale, tf, dst) {
+ es3fLifetimeTests.ScaleProgram.seed = es3fLifetimeTests.ScaleProgram.seed || 0;
+ ++es3fLifetimeTests.ScaleProgram.seed;
+
+ var viewport = new glsTextureTestUtil.RandomViewport(document.getElementById('canvas'), VIEWPORT_SIZE, VIEWPORT_SIZE, es3fLifetimeTests.ScaleProgram.seed);
+ gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height);
+ gl.clearColor(0, 0, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+
+ gl.bindVertexArray(vao);
+ gl.enableVertexAttribArray(this.m_posLoc);
+ gl.useProgram(this.getProgram());
+
+ gl.uniform1f(this.m_scaleLoc, scale);
+
+ if (tf)
+ gl.beginTransformFeedback(gl.TRIANGLES);
+ gl.drawArrays(gl.TRIANGLES, 0, 3);
+ if (tf)
+ gl.endTransformFeedback();
+
+ if (dst)
+ glsLifetimeTests.readRectangle(viewport, dst);
+
+ gl.bindVertexArray(null);
+
+};
+
+/**
+ * @param {WebGLBuffer} buffer
+ * @param {WebGLVertexArrayObject} vao
+ */
+es3fLifetimeTests.ScaleProgram.prototype.setPos = function(buffer, vao) {
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
+ gl.bindVertexArray(vao);
+ gl.vertexAttribPointer(this.m_posLoc, NUM_COMPONENTS, gl.FLOAT, false, 0, 0);
+ gl.bindVertexArray(null);
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+};
+
+/**
+ * @private
+ */
+es3fLifetimeTests.ScaleProgram.prototype.getSources = function() {
+/** @const */ var s_vertexShaderSrc =
+ '#version 100\n' +
+ 'attribute vec4 pos;\n' +
+ 'uniform float scale;\n' +
+ 'void main ()\n' +
+ '{\n' +
+ ' gl_Position = vec4(scale * pos.xy, pos.zw);\n' +
+ '}';
+
+/** @const */ var s_fragmentShaderSrc =
+ '#version 100\n' +
+ 'void main ()\n' +
+ '{\n' +
+ ' gl_FragColor = vec4(1.0, 0.0, 1.0, 1.0);\n' +
+ '}';
+ var sources = new gluShaderProgram.ProgramSources();
+ sources.add(new gluShaderProgram.VertexSource(s_vertexShaderSrc));
+ sources.add(new gluShaderProgram.FragmentSource(s_fragmentShaderSrc));
+ sources.add(new gluShaderProgram.TransformFeedbackMode(gl.INTERLEAVED_ATTRIBS));
+ sources.add(new gluShaderProgram.TransformFeedbackVarying('gl_Position'));
+ return sources;
+};
+
+/**
+ * @constructor
+ * @extends {glsLifetimeTests.SimpleBinder}
+ */
+es3fLifetimeTests.VertexArrayBinder = function() {
+ glsLifetimeTests.SimpleBinder.call(this, null, gl.NONE, gl.VERTEX_ARRAY_BINDING);
+};
+
+setParentClass(es3fLifetimeTests.VertexArrayBinder, glsLifetimeTests.SimpleBinder);
+
+es3fLifetimeTests.VertexArrayBinder.prototype.bind = function(obj) {
+ var vao = /** @type {WebGLVertexArrayObject} */ (obj);
+ gl.bindVertexArray(vao);
+};
+
+/**
+ * @constructor
+ * @extends {glsLifetimeTests.Binder}
+ */
+es3fLifetimeTests.SamplerBinder = function() {
+ glsLifetimeTests.Binder.call(this);
+};
+
+setParentClass(es3fLifetimeTests.SamplerBinder, glsLifetimeTests.Binder);
+
+es3fLifetimeTests.SamplerBinder.prototype.bind = function(obj) {
+ var sampler = /** @type {WebGLSampler} */ (obj);
+ gl.bindSampler(0, sampler);
+};
+es3fLifetimeTests.SamplerBinder.prototype.getBinding = function() { return /** @type {WebGLSampler} */ (gl.getParameter(gl.SAMPLER_BINDING)); };
+
+/**
+ * @constructor
+ * @extends {glsLifetimeTests.Binder}
+ */
+es3fLifetimeTests.QueryBinder = function() {
+ glsLifetimeTests.Binder.call(this);
+};
+
+setParentClass(es3fLifetimeTests.QueryBinder, glsLifetimeTests.Binder);
+
+es3fLifetimeTests.QueryBinder.prototype.bind = function(obj) {
+ var query = /** @type {WebGLQuery} */ (obj);
+ if (query)
+ gl.beginQuery(gl.ANY_SAMPLES_PASSED, query);
+ else
+ gl.endQuery(gl.ANY_SAMPLES_PASSED);
+};
+
+es3fLifetimeTests.QueryBinder.prototype.getBinding = function() { return null; };
+
+/**
+ * @constructor
+ * @extends {glsLifetimeTests.Attacher}
+ * @param {glsLifetimeTests.Type} elementType
+ * @param {glsLifetimeTests.Type} varrType
+ * @param {es3fLifetimeTests.ScaleProgram} program
+ */
+es3fLifetimeTests.BufferVAOAttacher = function(elementType, varrType, program) {
+ glsLifetimeTests.Attacher.call(this, elementType, varrType);
+ this.m_program = program;
+};
+
+setParentClass(es3fLifetimeTests.BufferVAOAttacher, glsLifetimeTests.Attacher);
+
+/**
+ * @return {es3fLifetimeTests.ScaleProgram}
+ */
+es3fLifetimeTests.BufferVAOAttacher.prototype.getProgram = function() { return this.m_program; };
+
+/**
+ * @param {number} seed
+ * @param {number} usage
+ * @param {WebGLBuffer} buffer
+ */
+es3fLifetimeTests.initBuffer = function(seed, usage, buffer) {
+ /** @const */ var s_varrData = [
+ -1.0, 0.0, 0.0, 1.0,
+ 1.0, 1.0, 0.0, 1.0,
+ 0.0, -1.0, 0.0, 1.0
+ ];
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
+ if (seed == 0)
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(s_varrData), usage);
+ else {
+ var rnd = new deRandom.Random(seed);
+ var data = [];
+
+ for (var ndx = 0; ndx < NUM_VERTICES; ndx++) {
+ data.push(2 * (rnd.getFloat() - 0.5));
+ data.push(2 * (rnd.getFloat() - 0.5));
+ data.push(0);
+ data.push(1);
+ }
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(data), usage);
+ }
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+};
+
+es3fLifetimeTests.BufferVAOAttacher.prototype.initAttachment = function(seed, obj) {
+ var buffer = /** @type {WebGLBuffer} */ (obj);
+ es3fLifetimeTests.initBuffer(seed, gl.STATIC_DRAW, buffer);
+ bufferedLogToConsole('Initialized buffer ' + buffer + ' from seed ' + seed);
+};
+
+es3fLifetimeTests.BufferVAOAttacher.prototype.attach = function(element, target) {
+ var buffer = /** @type {WebGLBuffer} */ (element);
+ var vao = /** @type {WebGLVertexArrayObject} */ (target);
+
+ this.m_program.setPos(buffer, vao);
+ bufferedLogToConsole('Set the `pos` attribute in VAO ' + vao + ' to buffer ' + buffer);
+};
+
+es3fLifetimeTests.BufferVAOAttacher.prototype.detach = function(element, target) {
+ var vao = /** @type {WebGLVertexArrayObject} */ (target);
+ this.attach(null, vao);
+};
+
+es3fLifetimeTests.BufferVAOAttacher.prototype.getAttachment = function(target) {
+ var vao = /** @type {WebGLVertexArrayObject} */ (target);
+ gl.bindVertexArray(vao);
+ var name = gl.getVertexAttrib(this.m_posLoc, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING);
+ gl.bindVertexArray(null);
+ return name;
+};
+
+/**
+ * @constructor
+ * @extends {glsLifetimeTests.InputAttacher}
+ * @param {es3fLifetimeTests.BufferVAOAttacher} attacher
+ */
+es3fLifetimeTests.BufferVAOInputAttacher = function(attacher) {
+ glsLifetimeTests.InputAttacher.call(this, attacher);
+ this.m_program = attacher.getProgram();
+};
+
+setParentClass(es3fLifetimeTests.BufferVAOInputAttacher, glsLifetimeTests.InputAttacher);
+
+es3fLifetimeTests.BufferVAOInputAttacher.prototype.drawContainer = function(obj, dst) {
+ var vao = /** @type {WebGLVertexArrayObject} */ (obj);
+ this.m_program.draw(vao, 1.0, false, dst);
+ bufferedLogToConsole('Drew an output image with VAO ' + vao);
+};
+
+/**
+ * @constructor
+ * @extends {glsLifetimeTests.Attacher}
+ * @param {glsLifetimeTests.Type} elementType
+ * @param {glsLifetimeTests.Type} tfType
+*/
+es3fLifetimeTests.BufferTfAttacher = function(elementType, tfType) {
+ glsLifetimeTests.Attacher.call(this, elementType, tfType);
+};
+
+setParentClass(es3fLifetimeTests.BufferTfAttacher, glsLifetimeTests.Attacher);
+
+es3fLifetimeTests.BufferTfAttacher.prototype.initAttachment = function(seed, obj) {
+ var buffer = /** @type {WebGLBuffer} */ (obj);
+ es3fLifetimeTests.initBuffer(seed, gl.DYNAMIC_READ, buffer);
+ bufferedLogToConsole('Initialized buffer ' + buffer + ' from seed ' + seed);
+};
+
+es3fLifetimeTests.BufferTfAttacher.prototype.attach = function(element, target) {
+ var buffer = /** @type {WebGLBuffer} */ (element);
+ var tf = /** @type {WebGLTransformFeedback} */ (target);
+ gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tf);
+ gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, buffer);
+ gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, null);
+};
+
+es3fLifetimeTests.BufferTfAttacher.prototype.detach = function(element, target) {
+ var buffer = /** @type {WebGLBuffer} */ (element);
+ var tf = /** @type {WebGLTransformFeedback} */ (target);
+ gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tf);
+ gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, null);
+ gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, null);
+
+};
+
+es3fLifetimeTests.BufferTfAttacher.prototype.getAttachment = function(target) {
+ var tf = /** @type {WebGLTransformFeedback} */ (target);
+ gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tf);
+ var name = gl.getIndexedParameter(gl.TRANSFORM_FEEDBACK_BUFFER_BINDING, 0);
+ gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, null);
+ return name;
+};
+
+/**
+ * @constructor
+ * @extends {glsLifetimeTests.OutputAttacher}
+ */
+es3fLifetimeTests.BufferTfOutputAttacher = function(attacher, program) {
+ glsLifetimeTests.OutputAttacher.call(this, attacher);
+ this.m_program = program;
+};
+
+setParentClass(es3fLifetimeTests.BufferTfOutputAttacher, glsLifetimeTests.OutputAttacher);
+
+es3fLifetimeTests.BufferTfOutputAttacher.prototype.setupContainer = function(seed, obj) {
+ var tf = /** @type {WebGLTransformFeedback} */ (obj);
+ var posBuf = gl.createBuffer();
+ var vao = gl.createVertexArray();
+
+ es3fLifetimeTests.initBuffer(seed, gl.STATIC_DRAW, posBuf);
+ this.m_program.setPos(posBuf, vao);
+
+ gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tf);
+ this.m_program.draw(vao, -1.0, true, null);
+ bufferedLogToConsole('Drew an image with seed ' + seed + ' with transform feedback to ' + tf);
+ gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, null);
+ gl.deleteVertexArray(vao);
+ gl.deleteBuffer(posBuf);
+};
+
+es3fLifetimeTests.BufferTfOutputAttacher.prototype.drawAttachment = function(buffer, dst) {
+ var vao = gl.createVertexArray();
+
+ this.m_program.setPos(buffer, vao);
+ this.m_program.draw(vao, 1.0, false, dst);
+ bufferedLogToConsole('Drew output image with vertices from buffer ' + buffer);
+ gl.deleteVertexArray(vao);
+};
+
+/**
+ * @constructor
+ * @extends {glsLifetimeTests.ES2Types}
+ */
+es3fLifetimeTests.ES3Types = function() {
+ glsLifetimeTests.ES2Types.call(this);
+ this.m_program = new es3fLifetimeTests.ScaleProgram();
+ this.m_queryBind = new es3fLifetimeTests.QueryBinder();
+ this.m_queryType = new glsLifetimeTests.SimpleType('query', gl.createQuery, gl.deleteQuery, gl.isQuery, this.m_queryBind);
+ this.m_tfBind = new glsLifetimeTests.SimpleBinder(gl.bindTransformFeedback, gl.TRANSFORM_FEEDBACK,
+ gl.TRANSFORM_FEEDBACK_BINDING);
+ this.m_tfType = new glsLifetimeTests.SimpleType('transform_feedback', gl.createTransformFeedback, gl.deleteTransformFeedback, gl.isTransformFeedback, this.m_tfBind);
+ this.m_varrBind = new es3fLifetimeTests.VertexArrayBinder();
+ this.m_varrType = new glsLifetimeTests.SimpleType('vertex_array', gl.createVertexArray, gl.deleteVertexArray, gl.isVertexArray, this.m_varrBind);
+ this.m_samplerBind = new es3fLifetimeTests.SamplerBinder();
+ this.m_samplerType = new glsLifetimeTests.SimpleType('sampler', gl.createSampler, gl.deleteSampler, gl.isSampler, this.m_samplerBind, true);
+ this.m_bufVarrAtt = new es3fLifetimeTests.BufferVAOAttacher(this.m_bufferType, this.m_varrType, this.m_program);
+ this.m_bufVarrInAtt = new es3fLifetimeTests.BufferVAOInputAttacher(this.m_bufVarrAtt);
+ this.m_bufTfAtt = new es3fLifetimeTests.BufferTfAttacher(this.m_bufferType, this.m_tfType);
+ this.m_bufTfOutAtt = new es3fLifetimeTests.BufferTfOutputAttacher(this.m_bufTfAtt, this.m_program);
+
+ this.m_types.push(this.m_queryType, this.m_tfType, this.m_varrType, this.m_samplerType);
+ this.m_attachers.push(this.m_bufVarrAtt, this.m_bufTfAtt);
+ this.m_inAttachers.push(this.m_bufVarrInAtt);
+ this.m_outAttachers.push(this.m_bufTfOutAtt);
+};
+
+setParentClass(es3fLifetimeTests.ES3Types, glsLifetimeTests.ES2Types);
+
+/**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+es3fLifetimeTests.TfDeleteActiveTest = function(name, description) {
+ tcuTestCase.DeqpTest.call(this, name, description);
+};
+
+setParentClass(es3fLifetimeTests.TfDeleteActiveTest, tcuTestCase.DeqpTest);
+
+es3fLifetimeTests.TfDeleteActiveTest.prototype.iterate = function() {
+/** @const */ var s_xfbVertexSource =
+ '#version 300 es\n' +
+ 'void main ()\n' +
+ '{\n' +
+ ' gl_Position = vec4(float(gl_VertexID) / 2.0, float(gl_VertexID % 2) / 2.0, 0.0, 1.0);\n' +
+ '}\n';
+
+/** @const */ var s_xfbFragmentSource =
+ '#version 300 es\n' +
+ 'layout(location=0) out mediump vec4 dEQP_FragColor;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' dEQP_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n' +
+ '}\n';
+ var buf = gl.createBuffer();
+
+ var sources = new gluShaderProgram.ProgramSources();
+ sources.add(new gluShaderProgram.VertexSource(s_xfbVertexSource));
+ sources.add(new gluShaderProgram.FragmentSource(s_xfbFragmentSource));
+ sources.add(new gluShaderProgram.TransformFeedbackMode(gl.SEPARATE_ATTRIBS));
+ sources.add(new gluShaderProgram.TransformFeedbackVarying('gl_Position'));
+ var program = new gluShaderProgram.ShaderProgram(gl, sources);
+ if (!program.isOk()) {
+ bufferedLogToConsole(program.getProgramInfo().infoLog);
+ testFailedOptions('failed to build program', true);
+ }
+ gl.useProgram(program.getProgram());
+
+ var tf = gl.createTransformFeedback();
+ gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tf);
+ gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf);
+ gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, 48, gl.STATIC_DRAW);
+
+ gl.beginTransformFeedback(gl.TRIANGLES);
+ var errCode = gl.NONE;
+ gl.deleteTransformFeedback(tf);
+ errCode = gl.getError();
+ assertMsgOptions(errCode == gl.INVALID_OPERATION,
+ 'Deleting active transform feedback must produce INVALID_OPERATION', false, true);
+ gl.endTransformFeedback();
+ gl.deleteTransformFeedback(tf);
+ testPassed();
+ return tcuTestCase.IterateResult.STOP;
+};
+
+es3fLifetimeTests.genTestCases = function() {
+ var state = tcuTestCase.runner;
+ state.setRoot(tcuTestCase.newTest('lifetime', 'Top level'));
+
+ var types = new es3fLifetimeTests.ES3Types();
+ glsLifetimeTests.addTestCases(state.testCases, types);
+ /* TODO: Add TfDeleteActiveTest test */
+ var deleteActiveGroup = tcuTestCase.newTest('delete_active', 'Delete active object');
+ state.testCases.addChild(deleteActiveGroup);
+ deleteActiveGroup.addChild(
+ new es3fLifetimeTests.TfDeleteActiveTest('transform_feedback', 'Transform Feedback'));
+};
+
+/**
+ * Create and execute the test cases
+ */
+es3fLifetimeTests.run = function(context) {
+ gl = context;
+ try {
+ es3fLifetimeTests.genTestCases();
+ tcuTestCase.runner.runCallback(tcuTestCase.runTestCases);
+ } catch (err) {
+ bufferedLogToConsole(err);
+ tcuTestCase.runner.terminate();
+ }
+
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fMultisampleTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fMultisampleTests.js
new file mode 100644
index 0000000000..47e6267d35
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fMultisampleTests.js
@@ -0,0 +1,1744 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fMultisampleTests');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('framework.opengl.gluStrUtil');
+goog.require('framework.opengl.gluTextureUtil');
+goog.require('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuLogImage');
+goog.require('framework.common.tcuRGBA');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTexture');
+goog.require('modules.shared.glsTextureTestUtil');
+
+goog.scope(function() {
+ /** @type {?WebGL2RenderingContext} */ var gl;
+ var es3fMultisampleTests = functional.gles3.es3fMultisampleTests;
+ var deMath = framework.delibs.debase.deMath;
+ var deRandom = framework.delibs.debase.deRandom;
+ var deString = framework.delibs.debase.deString;
+ var gluShaderProgram = framework.opengl.gluShaderProgram;
+ var tcuRGBA = framework.common.tcuRGBA;
+ var tcuSurface = framework.common.tcuSurface;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var tcuTexture = framework.common.tcuTexture;
+ var gluStrUtil = framework.opengl.gluStrUtil;
+ var glsTextureTestUtil = modules.shared.glsTextureTestUtil;
+ var tcuImageCompare = framework.common.tcuImageCompare;
+ var gluTextureUtil = framework.opengl.gluTextureUtil;
+ var tcuLogImage = framework.common.tcuLogImage;
+
+ /**
+ * @constructor
+ * @struct
+ * @param {Array<number>} p0_
+ * @param {Array<number>} p1_
+ * @param {Array<number>} p2_
+ * @param {Array<number>} p3_
+ */
+ es3fMultisampleTests.QuadCorners = function(p0_, p1_, p2_, p3_) {
+ /** @type {Array<number>} */ this.p0 = p0_;
+ /** @type {Array<number>} */ this.p1 = p1_;
+ /** @type {Array<number>} */ this.p2 = p2_;
+ /** @type {Array<number>} */ this.p3 = p3_;
+ };
+
+ /**
+ * @param {number} defaultCount
+ * @return {number}
+ */
+ es3fMultisampleTests.getIterationCount = function(defaultCount) {
+ // The C++ test takes an argument from the command line.
+ // Leaving this function in case we want to be able to take an argument from the URL
+ return defaultCount;
+ };
+
+ /**
+ * @param {Array<number>} point
+ * @param {Array<number>} p0
+ * @param {Array<number>} p1
+ * @param {Array<number>} p2
+ * @param {Array<number>} p3
+ * @return {boolean}
+ */
+ es3fMultisampleTests.isInsideQuad = function(point, p0, p1, p2, p3) {
+ /** @type {number} */ var dot0 = (point[0] - p0[0]) * (p1[1] - p0[1]) + (point[1] - p0[1]) * (p0[0] - p1[0]);
+ /** @type {number} */ var dot1 = (point[0] - p1[0]) * (p2[1] - p1[1]) + (point[1] - p1[1]) * (p1[0] - p2[0]);
+ /** @type {number} */ var dot2 = (point[0] - p2[0]) * (p3[1] - p2[1]) + (point[1] - p2[1]) * (p2[0] - p3[0]);
+ /** @type {number} */ var dot3 = (point[0] - p3[0]) * (p0[1] - p3[1]) + (point[1] - p3[1]) * (p3[0] - p0[0]);
+
+ return (dot0 > 0) == (dot1 > 0) && (dot1 > 0) == (dot2 > 0) && (dot2 > 0) == (dot3 > 0);
+ };
+
+ /**
+ * Check if a region in an image is unicolored.
+ *
+ * Checks if the pixels in img inside the convex quadilateral defined by
+ * p0, p1, p2 and p3 are all (approximately) of the same color.
+ *
+ * @param {tcuSurface.Surface} img
+ * @param {Array<number>} p0
+ * @param {Array<number>} p1
+ * @param {Array<number>} p2
+ * @param {Array<number>} p3
+ * @return {boolean}
+ */
+ es3fMultisampleTests.isPixelRegionUnicolored = function(img, p0, p1, p2, p3) {
+ /** @type {number} */ var xMin = deMath.clamp(Math.min(p0[0], p1[0], p2[0], p3[0]), 0, img.getWidth() - 1);
+ /** @type {number} */ var yMin = deMath.clamp(Math.min(p0[1], p1[1], p2[1], p3[1]), 0, img.getHeight() - 1);
+ /** @type {number} */ var xMax = deMath.clamp(Math.max(p0[0], p1[0], p2[0], p3[0]), 0, img.getWidth() - 1);
+ /** @type {number} */ var yMax = deMath.clamp(Math.max(p0[1], p1[1], p2[1], p3[1]), 0, img.getHeight() - 1);
+ /** @type {boolean} */ var insideEncountered = false; //!< Whether we have already seen at least one pixel inside the region.
+ /** @type {tcuRGBA.RGBA} */ var insideColor; //!< Color of the first pixel inside the region.
+ /** @type {tcuRGBA.RGBA} */ var threshold = tcuRGBA.newRGBAComponents(3, 3, 3, 3);
+ for (var y = yMin; y <= yMax; y++)
+ for (var x = xMin; x <= xMax; x++)
+ if (es3fMultisampleTests.isInsideQuad([x, y], p0, p1, p2, p3)) {
+ /** @type {tcuRGBA.RGBA} */ var pixColor = new tcuRGBA.RGBA(img.getPixel(x, y));
+
+ if (insideEncountered)
+ if (!tcuRGBA.compareThreshold(pixColor, insideColor, threshold)) // Pixel color differs from already-detected color inside same region - region not unicolored.
+ return false;
+ else {
+ insideEncountered = true;
+ insideColor = pixColor;
+ }
+ }
+ return true;
+ };
+
+ /**
+ * [drawUnicolorTestErrors description]
+ * @param {tcuSurface.Surface} img
+ * @param {tcuTexture.PixelBufferAccess} errorImg
+ * @param {Array<number>} p0
+ * @param {Array<number>} p1
+ * @param {Array<number>} p2
+ * @param {Array<number>} p3
+ * @return {boolean}
+ */
+ es3fMultisampleTests.drawUnicolorTestErrors = function(img, errorImg, p0, p1, p2, p3) {
+ /** @type {number} */ var xMin = deMath.clamp(Math.min(p0[0], p1[0], p2[0], p3[0]), 0, img.getWidth() - 1);
+ /** @type {number} */ var yMin = deMath.clamp(Math.min(p0[1], p1[1], p2[1], p3[1]), 0, img.getHeight() - 1);
+ /** @type {number} */ var xMax = deMath.clamp(Math.max(p0[0], p1[0], p2[0], p3[0]), 0, img.getWidth() - 1);
+ /** @type {number} */ var yMax = deMath.clamp(Math.max(p0[1], p1[1], p2[1], p3[1]), 0, img.getHeight() - 1);
+ /** @type {tcuRGBA.RGBA} */ var refColor = new tcuRGBA.RGBA(img.getPixel(Math.floor((xMin + xMax) / 2), Math.floor((yMin + yMax) / 2)));
+ /** @type {tcuRGBA.RGBA} */ var threshold = tcuRGBA.newRGBAComponents(3, 3, 3, 3);
+ for (var y = yMin; y <= yMax; y++)
+ for (var x = xMin; x <= xMax; x++)
+ if (es3fMultisampleTests.isInsideQuad([x, y], p0, p1, p2, p3)) {
+ if (!tcuRGBA.compareThreshold(new tcuRGBA.RGBA(img.getPixel(x, y)), refColor, threshold)) {
+ img.setPixel(x, y, tcuRGBA.RGBA.red.toVec()); // TODO: this might also be toIVec()
+ errorImg.setPixel([1.0, 0.0, 0.0, 1.0], x, y);
+ }
+ }
+ return true;
+ };
+
+ /**
+ * @constructor
+ * @struct
+ * @param {number=} numSamples_
+ * @param {boolean=} useDepth_
+ * @param {boolean=} useStencil_
+ */
+ es3fMultisampleTests.FboParams = function(numSamples_, useDepth_, useStencil_) {
+ /** @type {boolean} */ var useFbo_ = true;
+ if (numSamples_ === undefined && useDepth_ === undefined && useStencil_ === undefined)
+ useFbo_ = false;
+ /** @type {boolean} */ this.useFbo = useFbo_;
+ /** @type {number} */ this.numSamples = numSamples_ === undefined ? -1 : numSamples_;
+ /** @type {boolean} */ this.useDepth = useDepth_ === undefined ? false : useDepth_;
+ /** @type {boolean} */ this.useStencil = useStencil_ === undefined ? false : useStencil_;
+
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} desiredViewportSize
+ * @param {es3fMultisampleTests.FboParams} fboParams
+ */
+ es3fMultisampleTests.MultisampleCase = function(name, desc, desiredViewportSize, fboParams) {
+ tcuTestCase.DeqpTest.call(this, name, desc);
+ /** @type {number} */ this.m_numSamples = 0;
+ /** @type {number} */ this.m_viewportSize = 0;
+ /** @type {number} */ this.m_desiredViewportSize = desiredViewportSize;
+ /** @type {es3fMultisampleTests.FboParams} */ this.m_fboParams = fboParams;
+ /** @type {WebGLRenderbuffer} */ this.m_msColorRbo = null;
+ /** @type {WebGLRenderbuffer} */ this.m_msDepthStencilRbo = null;
+ /** @type {WebGLRenderbuffer} */ this.m_resolveColorRbo = null;
+ /** @type {WebGLFramebuffer} */ this.m_msFbo = null;
+ /** @type {WebGLFramebuffer} */ this.m_resolveFbo = null;
+ /** @type {gluShaderProgram.ShaderProgram} */ this.m_program = null;
+ /** @type {number} */ this.m_attrPositionLoc = -1;
+ /** @type {number} */ this.m_attrColorLoc = -1;
+ /** @type {number} */ this.m_renderWidth = fboParams.useFbo ? 2 * desiredViewportSize : gl.drawingBufferWidth;
+ /** @type {number} */ this.m_renderHeight = fboParams.useFbo ? 2 * desiredViewportSize : gl.drawingBufferHeight;
+ /** @type {number} */ this.m_viewportX = 0;
+ /** @type {number} */ this.m_viewportY = 0;
+ /** @type {deRandom.Random} */ this.m_rnd = new deRandom.Random(deString.deStringHash(this.name));
+ if (this.m_fboParams.useFbo)
+ assertMsgOptions(this.m_fboParams.numSamples >= 0, 'fboParams.numSamples < 0', false, true);
+ };
+
+ es3fMultisampleTests.MultisampleCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+
+ /** Copy the constructor */
+ es3fMultisampleTests.MultisampleCase.prototype.constructor = es3fMultisampleTests.MultisampleCase;
+
+ /* Rest states */
+ es3fMultisampleTests.MultisampleCase.prototype.deinit = function() {
+ gl.colorMask(true, true, true, true);
+ gl.depthMask(true);
+
+ gl.clearColor(0.0, 0.0, 0.0, 0.0);
+ gl.clearDepth(1.0);
+ gl.clearStencil(0);
+
+ gl.disable(gl.STENCIL_TEST);
+ gl.disable(gl.DEPTH_TEST);
+ gl.disable(gl.BLEND)
+ gl.disable(gl.SAMPLE_COVERAGE);
+ gl.disable(gl.SAMPLE_ALPHA_TO_COVERAGE);
+
+ if (this.m_program) {
+ gl.deleteProgram(this.m_program.getProgram());
+ this.m_program = null;
+ }
+ if (this.m_msColorRbo) {
+ gl.deleteRenderbuffer(this.m_msColorRbo);
+ this.m_msColorRbo = null;
+ }
+ if (this.m_msDepthStencilRbo) {
+ gl.deleteRenderbuffer(this.m_msDepthStencilRbo);
+ this.m_msDepthStencilRbo = null;
+ }
+ if (this.m_resolveColorRbo) {
+ gl.deleteRenderbuffer(this.m_resolveColorRbo);
+ this.m_resolveColorRbo = null;
+ }
+
+ if (this.m_msFbo) {
+ gl.deleteFramebuffer(this.m_msFbo);
+ this.m_msFbo = null;
+ }
+ if (this.m_resolveFbo) {
+ gl.deleteFramebuffer(this.m_resolveFbo);
+ this.m_resolveFbo = null;
+ }
+
+ gl.bindRenderbuffer(gl.RENDERBUFFER, null);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ }
+
+ /**
+ * @protected
+ * @param {Array<number>} p0
+ * @param {Array<number>} p1
+ * @param {Array<number>} p2
+ * @param {Array<number>} c0
+ * @param {Array<number>} c1
+ * @param {Array<number>} c2
+ */
+ es3fMultisampleTests.MultisampleCase.prototype.renderTriangle_pAsVec3cAsVec4 = function(p0, p1, p2, c0, c1, c2) {
+ /** @type {Array<number>} */ var vertexPositions = [
+ p0[0], p0[1], p0[2], 1.0,
+ p1[0], p1[1], p1[2], 1.0,
+ p2[0], p2[1], p2[2], 1.0
+ ];
+ /** @type {Array<number>} */ var vertexColors = [
+ c0[0], c0[1], c0[2], c0[3],
+ c1[0], c1[1], c1[2], c1[3],
+ c2[0], c2[1], c2[2], c2[3]
+ ];
+
+ var posGLBuffer = gl.createBuffer();
+ /** @type {ArrayBufferView} */ var posBuffer = new Float32Array(vertexPositions);
+ gl.bindBuffer(gl.ARRAY_BUFFER, posGLBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, posBuffer, gl.STATIC_DRAW);
+
+ gl.enableVertexAttribArray(this.m_attrPositionLoc);
+ gl.vertexAttribPointer(this.m_attrPositionLoc, 4, gl.FLOAT, false, 0, 0);
+
+ var colGLBuffer = gl.createBuffer();
+ /** @type {ArrayBufferView} */ var colBuffer = new Float32Array(vertexColors);
+ gl.bindBuffer(gl.ARRAY_BUFFER, colGLBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, colBuffer, gl.STATIC_DRAW);
+
+ gl.enableVertexAttribArray(this.m_attrColorLoc);
+ gl.vertexAttribPointer(this.m_attrColorLoc, 4, gl.FLOAT, false, 0, 0);
+
+ gl.useProgram(this.m_program.getProgram());
+ gl.drawArrays(gl.TRIANGLES, 0, 3);
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+ gl.deleteBuffer(colGLBuffer);
+ gl.deleteBuffer(posGLBuffer);
+ };
+
+ /**
+ * @protected
+ * @param {Array<number>} p0
+ * @param {Array<number>} p1
+ * @param {Array<number>} p2
+ * @param {Array<number>} color
+ */
+ es3fMultisampleTests.MultisampleCase.prototype.renderTriangle_pAsVec3WithColor = function(p0, p1, p2, color) {
+ this.renderTriangle_pAsVec3cAsVec4(p0, p1, p2, color, color, color);
+ };
+
+ /**
+ * @protected
+ * @param {Array<number>} p0
+ * @param {Array<number>} p1
+ * @param {Array<number>} p2
+ * @param {Array<number>} c0
+ * @param {Array<number>} c1
+ * @param {Array<number>} c2
+ */
+ es3fMultisampleTests.MultisampleCase.prototype.renderTriangle_pAsVec2 = function(p0, p1, p2, c0, c1, c2) {
+ this.renderTriangle_pAsVec3cAsVec4(
+ [p0[0], p0[1], 0.0],
+ [p1[0], p1[1], 0.0],
+ [p2[0], p2[1], 0.0],
+ c0, c1, c2);
+ };
+
+ /**
+ * @protected
+ * @param {Array<number>} p0
+ * @param {Array<number>} p1
+ * @param {Array<number>} p2
+ * @param {Array<number>} color
+ */
+ es3fMultisampleTests.MultisampleCase.prototype.renderTriangle_pAsVec2WithColor = function(p0, p1, p2, color) {
+ this.renderTriangle_pAsVec2(p0, p1, p2, color, color, color);
+ };
+
+ /**
+ * @protected
+ * @param {Array<number>} p0
+ * @param {Array<number>} p1
+ * @param {Array<number>} p2
+ * @param {Array<number>} p3
+ * @param {Array<number>} c0
+ * @param {Array<number>} c1
+ * @param {Array<number>} c2
+ * @param {Array<number>} c3
+ */
+ es3fMultisampleTests.MultisampleCase.prototype.renderQuad = function(p0, p1, p2, p3, c0, c1, c2, c3) {
+ this.renderTriangle_pAsVec2(p0, p1, p2, c0, c1, c2);
+ this.renderTriangle_pAsVec2(p2, p1, p3, c2, c1, c3);
+ };
+
+ /**
+ * @protected
+ * @param {Array<number>} p0
+ * @param {Array<number>} p1
+ * @param {Array<number>} p2
+ * @param {Array<number>} p3
+ * @param {Array<number>} color
+ */
+ es3fMultisampleTests.MultisampleCase.prototype.renderQuad_WithColor = function(p0, p1, p2, p3, color) {
+ this.renderQuad(p0, p1, p2, p3, color, color, color, color);
+ };
+
+ /**
+ * @protected
+ * @param {Array<number>} p0
+ * @param {Array<number>} p1
+ * @param {Array<number>} color
+ */
+ es3fMultisampleTests.MultisampleCase.prototype.renderLine = function(p0, p1, color) {
+ /** @type {Array<number>} */ var vertexPositions = [
+ p0[0], p0[1], 0.0, 1.0,
+ p1[0], p1[1], 0.0, 1.0
+ ];
+ /** @type {Array<number>} */ var vertexColors = [
+ color[0], color[1], color[2], color[3],
+ color[0], color[1], color[2], color[3]
+ ];
+
+ var posGLBuffer = gl.createBuffer();
+ /** @type {ArrayBufferView} */ var posBuffer = new Float32Array(vertexPositions);
+ gl.bindBuffer(gl.ARRAY_BUFFER, posGLBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, posBuffer, gl.STATIC_DRAW);
+
+ gl.enableVertexAttribArray(this.m_attrPositionLoc);
+ gl.vertexAttribPointer(this.m_attrPositionLoc, 4, gl.FLOAT, false, 0, 0);
+
+ var colGLBuffer = gl.createBuffer();
+ /** @type {ArrayBufferView} */ var colBuffer = new Float32Array(vertexColors);
+ gl.bindBuffer(gl.ARRAY_BUFFER, colGLBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, colBuffer, gl.STATIC_DRAW);
+
+ gl.enableVertexAttribArray(this.m_attrColorLoc);
+ gl.vertexAttribPointer(this.m_attrColorLoc, 4, gl.FLOAT, false, 0, 0);
+
+ gl.useProgram(this.m_program.getProgram());
+ gl.drawArrays(gl.LINES, 0, 2);
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+ gl.deleteBuffer(colGLBuffer);
+ gl.deleteBuffer(posGLBuffer);
+ };
+
+ /**
+ * @protected
+ */
+ es3fMultisampleTests.MultisampleCase.prototype.randomizeViewport = function() {
+ this.m_viewportX = this.m_rnd.getInt(0, this.m_renderWidth - this.m_viewportSize);
+ this.m_viewportY = this.m_rnd.getInt(0, this.m_renderHeight - this.m_viewportSize);
+
+ gl.viewport(this.m_viewportX, this.m_viewportY, this.m_viewportSize, this.m_viewportSize);
+ };
+
+ /**
+ * @protected
+ * @return {tcuSurface.Surface}
+ */
+ es3fMultisampleTests.MultisampleCase.prototype.readImage = function() {
+ /** @type {tcuSurface.Surface} */
+ var dst = new tcuSurface.Surface(this.m_viewportSize, this.m_viewportSize);
+ /** @type {number} */ var pixelSize = dst.getAccess().getFormat().getPixelSize();
+ /** @type {number} */ var param = deMath.deIsPowerOfTwo32(pixelSize) ? Math.min(pixelSize, 8) : 1;
+ /** @type {gluTextureUtil.TransferFormat} */ var format = gluTextureUtil.getTransferFormat(dst.getAccess().getFormat());
+ /** @type {number} */ var width = dst.getAccess().getWidth();
+ /** @type {number} */ var height = dst.getAccess().getHeight();
+ if (this.m_fboParams.useFbo) {
+ gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, this.m_resolveFbo);
+ gl.blitFramebuffer(0, 0, this.m_renderWidth, this.m_renderHeight, 0, 0, this.m_renderWidth, this.m_renderHeight, gl.COLOR_BUFFER_BIT, gl.NEAREST);
+ gl.bindFramebuffer(gl.READ_FRAMEBUFFER, this.m_resolveFbo);
+
+ gl.pixelStorei(gl.PACK_ALIGNMENT, param);
+ gl.readPixels(this.m_viewportX, this.m_viewportY, width, height, format.format, format.dataType, dst.getAccess().getDataPtr());
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, this.m_msFbo);
+ }
+ else {
+ gl.pixelStorei(gl.PACK_ALIGNMENT, param);
+ gl.readPixels(this.m_viewportX, this.m_viewportY, width, height, format.format, format.dataType, dst.getAccess().getDataPtr());
+ }
+ return dst;
+ };
+
+ es3fMultisampleTests.MultisampleCase.prototype.init = function() {
+ /** @type {string} */ var vertShaderSource = '' +
+ '#version 300 es\n' +
+ 'in highp vec4 a_position;\n' +
+ 'in mediump vec4 a_color;\n' +
+ 'out mediump vec4 v_color;\n' +
+ 'void main()\n' +
+ '{\n' +
+ ' gl_Position = a_position;\n' +
+ ' v_color = a_color;\n' +
+ '}\n';
+
+ /** @type {string} */ var fragShaderSource = '' +
+ '#version 300 es\n' +
+ 'in mediump vec4 v_color;\n' +
+ 'layout(location = 0) out mediump vec4 o_color;\n' +
+ 'void main()\n' +
+ '{\n' +
+ ' o_color = v_color;\n' +
+ '}\n';
+
+ var numSamples = /** @type {number} */ (gl.getParameter(gl.SAMPLES));
+ if (!this.m_fboParams.useFbo && numSamples <= 1) {
+ var msg = 'No multisample buffers';
+ checkMessage(false, msg);
+ return false;
+ }
+
+ if (this.m_fboParams.useFbo) {
+ if (this.m_fboParams.numSamples > 0)
+ this.m_numSamples = this.m_fboParams.numSamples;
+ else {
+ bufferedLogToConsole('Querying maximum number of samples for ' + gluStrUtil.getPixelFormatName(gl.RGBA8) + ' with gl.getInternalformatParameter()');
+ var supportedSampleCountArray = /** @type {Int32Array} */ (gl.getInternalformatParameter(gl.RENDERBUFFER, gl.RGBA8, gl.SAMPLES));
+ if (supportedSampleCountArray.length == 0) {
+ var msg = 'No supported sample counts';
+ checkMessage(false, msg);
+ return false;
+ }
+ this.m_numSamples = supportedSampleCountArray[0];
+ }
+
+ bufferedLogToConsole('Using FBO of size (' + this.m_renderWidth + ', ' + this.m_renderHeight + ') with ' + this.m_numSamples + ' samples');
+ }
+ else {
+ // Query and log number of samples per pixel.
+ this.m_numSamples = numSamples;
+ bufferedLogToConsole('gl.SAMPLES =' + this.m_numSamples);
+ }
+
+ // Prepare program.
+
+ assertMsgOptions(!this.m_program, 'Program loaded when it should not be.', false, true);
+
+ this.m_program = new gluShaderProgram.ShaderProgram(
+ gl,
+ gluShaderProgram.makeVtxFragSources(vertShaderSource, fragShaderSource));
+
+ if (!this.m_program.isOk())
+ throw new Error('Failed to compile program');
+
+ this.m_attrPositionLoc = gl.getAttribLocation(this.m_program.getProgram(), 'a_position');
+ this.m_attrColorLoc = gl.getAttribLocation(this.m_program.getProgram(), 'a_color');
+
+ if (this.m_attrPositionLoc < 0 || this.m_attrColorLoc < 0) {
+ this.m_program = null;
+ throw new Error('Invalid attribute locations');
+ }
+
+ if (this.m_fboParams.useFbo) {
+ // Setup ms color RBO.
+ this.m_msColorRbo = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, this.m_msColorRbo);
+
+ /** @type {Int32Array} */ var supportedSampleCountArray = /** @type {Int32Array} */ (gl.getInternalformatParameter(gl.RENDERBUFFER, gl.RGBA8, gl.SAMPLES));
+ var maxSampleCount = supportedSampleCountArray[0];
+ if (maxSampleCount < this.m_numSamples) {
+ bufferedLogToConsole('skipping test: ' + this.m_numSamples + ' samples not supported; max is ' + maxSampleCount);
+ return false;
+ }
+
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'should be no GL error before renderbufferStorageMultisample');
+ gl.renderbufferStorageMultisample(gl.RENDERBUFFER, this.m_numSamples, gl.RGBA8, this.m_renderWidth, this.m_renderHeight);
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'should be no GL error after renderbufferStorageMultisample');
+
+
+ if (this.m_fboParams.useDepth || this.m_fboParams.useStencil) {
+ // Setup ms depth & stencil RBO.
+ this.m_msDepthStencilRbo = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, this.m_msDepthStencilRbo);
+ gl.renderbufferStorageMultisample(gl.RENDERBUFFER, this.m_numSamples, gl.DEPTH24_STENCIL8, this.m_renderWidth, this.m_renderHeight);
+ }
+
+ // Setup ms FBO.
+ this.m_msFbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, this.m_msFbo);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, this.m_msColorRbo);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, this.m_msDepthStencilRbo);
+
+ // Setup resolve color RBO.
+ this.m_resolveColorRbo = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, this.m_resolveColorRbo);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA8, this.m_renderWidth, this.m_renderHeight);
+
+ // Setup resolve FBO.
+ this.m_resolveFbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, this.m_resolveFbo);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, this.m_resolveColorRbo);
+
+ // Use ms FBO.
+ gl.bindFramebuffer(gl.FRAMEBUFFER, this.m_msFbo);
+ }
+
+ // Get suitable viewport size.
+
+ this.m_viewportSize = Math.min(this.m_desiredViewportSize, this.m_renderWidth, this.m_renderHeight);
+ this.randomizeViewport();
+ return true;
+ };
+
+ /**
+ * Base class for cases testing the value of sample count.
+ *
+ * Draws a test pattern (defined by renderPattern() of an inheriting class)
+ * and counts the number of distinct colors in the resulting image. That
+ * number should be at least the value of sample count plus one. This is
+ * repeated with increased values of m_currentIteration until this correct
+ * number of colors is detected or m_currentIteration reaches
+ * m_maxNumIterations.
+ *
+ * @extends {es3fMultisampleTests.MultisampleCase}
+ * @constructor
+ * @param {string} name
+ * @param {string} desc
+ * @param {es3fMultisampleTests.FboParams} fboParams
+ */
+ es3fMultisampleTests.NumSamplesCase = function(name, desc, fboParams) {
+ es3fMultisampleTests.MultisampleCase.call(this, name, desc, 256, fboParams);
+ /** @type {number} */ var DEFAULT_MAX_NUM_ITERATIONS = 16;
+ /** @type {number} */ this.m_currentIteration = 0;
+ /** @type {number} */ this.m_maxNumIterations = es3fMultisampleTests.getIterationCount(DEFAULT_MAX_NUM_ITERATIONS);
+ /** @type {Array<tcuRGBA.RGBA>} */ this.m_detectedColors = [];
+ };
+
+ es3fMultisampleTests.NumSamplesCase.prototype = Object.create(es3fMultisampleTests.MultisampleCase.prototype);
+
+ /** Copy the constructor */
+ es3fMultisampleTests.NumSamplesCase.prototype.constructor = es3fMultisampleTests.NumSamplesCase;
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fMultisampleTests.NumSamplesCase.prototype.iterate = function() {
+ this.randomizeViewport();
+
+ gl.clearColor(0.0, 0.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ this.renderPattern();
+
+ // Read and log rendered image.
+
+ /** @type {tcuSurface.Surface} */ var renderedImg = this.readImage();
+ tcuLogImage.logImage('RenderedImage', 'Rendered image', renderedImg.getAccess());
+
+ // Detect new, previously unseen colors from image.
+
+ /** @type {number} */ var requiredNumDistinctColors = this.m_numSamples + 1;
+
+ // If the number of samples is high (64 or more), we need to lower the threshold for detecting unique colors, otherwise two expected unique colors would be treated as the same color.
+ var threshold = Math.min(3, Math.floor(255 / this.m_numSamples) - 1);
+ var thresholdRGBA = tcuRGBA.newRGBAComponents(threshold, threshold, threshold, threshold);
+
+ for (var y = 0; y < renderedImg.getHeight() && this.m_detectedColors.length < requiredNumDistinctColors; y++)
+ for (var x = 0; x < renderedImg.getWidth() && this.m_detectedColors.length < requiredNumDistinctColors; x++) {
+ /** @type {tcuRGBA.RGBA} */ var color = new tcuRGBA.RGBA(renderedImg.getPixel(x, y));
+
+ /** @type {number} */ var i;
+ for (i = 0; i < this.m_detectedColors.length; i++) {
+ if (tcuRGBA.compareThreshold(color, this.m_detectedColors[i], thresholdRGBA))
+ break;
+ }
+
+ if (i === this.m_detectedColors.length)
+ this.m_detectedColors.push(color); // Color not previously detected.
+ }
+
+ // Log results.
+
+ bufferedLogToConsole('Number of distinct colors detected so far: ' + (this.m_detectedColors.length >= requiredNumDistinctColors ? 'at least ' : '') + this.m_detectedColors.length);
+
+
+ if (this.m_detectedColors.length < requiredNumDistinctColors) {
+ // Haven't detected enough different colors yet.
+
+ this.m_currentIteration++;
+
+ if (this.m_currentIteration >= this.m_maxNumIterations) {
+ testFailedOptions('Failure: Number of distinct colors detected is lower than sample count+1', false);
+ return tcuTestCase.IterateResult.STOP;
+ }
+ else {
+ bufferedLogToConsole('The number of distinct colors detected is lower than sample count+1 - trying again with a slightly altered pattern');
+ return tcuTestCase.IterateResult.CONTINUE;
+ }
+ }
+ else {
+ testPassedOptions('Success: The number of distinct colors detected is at least sample count+1', true);
+ return tcuTestCase.IterateResult.STOP;
+ }
+ };
+
+ /**
+ * @extends {es3fMultisampleTests.NumSamplesCase}
+ * @constructor
+ * @param {string} name
+ * @param {string} desc
+ * @param {number=} numFboSamples
+ */
+ es3fMultisampleTests.PolygonNumSamplesCase = function(name, desc, numFboSamples) {
+ numFboSamples = numFboSamples === undefined ? 0 : numFboSamples;
+ /** @type {es3fMultisampleTests.FboParams} */
+ var params = numFboSamples >= 0 ? new es3fMultisampleTests.FboParams(numFboSamples, false, false) : new es3fMultisampleTests.FboParams();
+ es3fMultisampleTests.NumSamplesCase.call(this, name, desc, params);
+ };
+
+ es3fMultisampleTests.PolygonNumSamplesCase.prototype = Object.create(es3fMultisampleTests.NumSamplesCase.prototype);
+
+ /** Copy the constructor */
+ es3fMultisampleTests.PolygonNumSamplesCase.prototype.constructor = es3fMultisampleTests.PolygonNumSamplesCase;
+
+ es3fMultisampleTests.PolygonNumSamplesCase.prototype.renderPattern = function() {
+ // The test pattern consists of several triangles with edges at different angles.
+
+ /** @type {number} */ var numTriangles = 25;
+ for (var i = 0; i < numTriangles; i++) {
+ /** @type {number} */ var angle0 = 2.0 * Math.PI * i / numTriangles + 0.001 * this.m_currentIteration;
+ /** @type {number} */ var angle1 = 2.0 * Math.PI * (i + 0.5) / numTriangles + 0.001 * this.m_currentIteration;
+
+ this.renderTriangle_pAsVec2WithColor(
+ [0.0, 0.0],
+ [Math.cos(angle0) * 0.95, Math.sin(angle0) * 0.95],
+ [Math.cos(angle1) * 0.95, Math.sin(angle1) * 0.95],
+ [1.0, 1.0, 1.0, 1.0]);
+ }
+ };
+
+ /**
+ * @extends {es3fMultisampleTests.NumSamplesCase}
+ * @constructor
+ * @param {string} name
+ * @param {string} desc
+ * @param {number=} numFboSamples
+ */
+ es3fMultisampleTests.LineNumSamplesCase = function(name, desc, numFboSamples) {
+ numFboSamples = numFboSamples === undefined ? 0 : numFboSamples;
+ /** @type {es3fMultisampleTests.FboParams} */
+ var params = numFboSamples >= 0 ? new es3fMultisampleTests.FboParams(numFboSamples, false, false) : new es3fMultisampleTests.FboParams();
+ es3fMultisampleTests.NumSamplesCase.call(this, name, desc, params);
+ };
+
+ es3fMultisampleTests.LineNumSamplesCase.prototype = Object.create(es3fMultisampleTests.NumSamplesCase.prototype);
+
+ /** Copy the constructor */
+ es3fMultisampleTests.LineNumSamplesCase.prototype.constructor = es3fMultisampleTests.LineNumSamplesCase;
+
+ es3fMultisampleTests.LineNumSamplesCase.prototype.renderPattern = function() {
+ // The test pattern consists of several lines at different angles.
+
+ // We scale the number of lines based on the viewport size. This is because a gl line's thickness is
+ // constant in pixel units, i.e. they get relatively thicker as viewport size decreases. Thus we must
+ // decrease the number of lines in order to decrease the extent of overlap among the lines in the
+ // center of the pattern.
+ /** @type {number} */ var numLines = Math.floor(100.0 * Math.sqrt(this.m_viewportSize / 256.0));
+
+ for (var i = 0; i < numLines; i++) {
+ /** @type {number} */ var angle = 2.0 * Math.PI * i / numLines + 0.001 * this.m_currentIteration;
+ this.renderLine([0.0, 0.0], [Math.cos(angle) * 0.95, Math.sin(angle) * 0.95], [1.0, 1.0, 1.0, 1.0]);
+ }
+ };
+
+ /**
+ * Case testing behaviour of common edges when multisampling.
+ *
+ * Draws a number of test patterns, each with a number of quads, each made
+ * of two triangles, rotated at different angles. The inner edge inside the
+ * quad (i.e. the common edge of the two triangles) still should not be
+ * visible, despite multisampling - i.e. the two triangles forming the quad
+ * should never get any common coverage bits in any pixel.
+ *
+ * @extends {es3fMultisampleTests.MultisampleCase}
+ * @constructor
+ * @param {string} name
+ * @param {string} desc
+ * @param {es3fMultisampleTests.CommonEdgeCase.CaseType} caseType
+ * @param {number} numFboSamples
+ */
+ es3fMultisampleTests.CommonEdgeCase = function(name, desc, caseType, numFboSamples) {
+ /** @type {number} */ var cases = caseType === es3fMultisampleTests.CommonEdgeCase.CaseType.SMALL_QUADS ? 128 : 32;
+ numFboSamples = numFboSamples === undefined ? 0 : numFboSamples;
+ /** @type {es3fMultisampleTests.FboParams} */
+ var params = numFboSamples >= 0 ? new es3fMultisampleTests.FboParams(numFboSamples, false, false) : new es3fMultisampleTests.FboParams();
+
+ es3fMultisampleTests.MultisampleCase.call(this, name, desc, cases, params);
+ /** @type {number} */ var DEFAULT_SMALL_QUADS_ITERATIONS = 16;
+ /** @type {number} */ var DEFAULT_BIGGER_THAN_VIEWPORT_QUAD_ITERATIONS = 64; // 8*8
+ /** @type {es3fMultisampleTests.CommonEdgeCase.CaseType} */ this.m_caseType = caseType;
+ /** @type {number} */ this.m_currentIteration = 0;
+ /** @type {number} */
+ this.m_numIterations = caseType === es3fMultisampleTests.CommonEdgeCase.CaseType.SMALL_QUADS ? es3fMultisampleTests.getIterationCount(DEFAULT_SMALL_QUADS_ITERATIONS) :
+ caseType === es3fMultisampleTests.CommonEdgeCase.CaseType.BIGGER_THAN_VIEWPORT_QUAD ? es3fMultisampleTests.getIterationCount(DEFAULT_BIGGER_THAN_VIEWPORT_QUAD_ITERATIONS) :
+ 8;
+ };
+
+ es3fMultisampleTests.CommonEdgeCase.prototype = Object.create(es3fMultisampleTests.MultisampleCase.prototype);
+
+ /** Copy the constructor */
+ es3fMultisampleTests.CommonEdgeCase.prototype.constructor = es3fMultisampleTests.CommonEdgeCase;
+
+ /**
+ * @enum {number}
+ */
+ es3fMultisampleTests.CommonEdgeCase.CaseType = {
+ SMALL_QUADS: 0, //!< Draw several small quads per iteration.
+ BIGGER_THAN_VIEWPORT_QUAD: 1, //!< Draw one bigger-than-viewport quad per iteration.
+ FIT_VIEWPORT_QUAD: 2 //!< Draw one exactly viewport-sized, axis aligned quad per iteration.
+ };
+
+ es3fMultisampleTests.CommonEdgeCase.prototype.init = function() {
+ var inited = es3fMultisampleTests.MultisampleCase.prototype.init.call(this);
+ if (!inited) {
+ return false;
+ }
+
+ if (this.m_caseType === es3fMultisampleTests.CommonEdgeCase.CaseType.SMALL_QUADS) {
+ // Check for a big enough viewport. With too small viewports the test case can't analyze the resulting image well enough.
+
+ /** @type {number} */ var minViewportSize = 32;
+
+ if (this.m_viewportSize < minViewportSize)
+ throw new Error('Render target width or height too low (is ' + this.m_viewportSize + ', should be at least ' + minViewportSize + ')');
+ }
+
+ gl.enable(gl.BLEND);
+ gl.blendEquation(gl.FUNC_ADD);
+ gl.blendFunc(gl.ONE, gl.ONE);
+ bufferedLogToConsole('Additive blending enabled in order to detect (erroneously) overlapping samples');
+ };
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fMultisampleTests.CommonEdgeCase.prototype.iterate = function() {
+ /** @type {tcuSurface.Surface} */ var errorImg = new tcuSurface.Surface(this.m_viewportSize, this.m_viewportSize);
+
+ this.randomizeViewport();
+
+ gl.clearColor(0.0, 0.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ // Draw test pattern. Test patterns consist of quads formed with two triangles.
+ // After drawing the pattern, we check that the interior pixels of each quad are
+ // all the same color - this is meant to verify that there are no artifacts on the inner edge.
+
+ /** @type {Array<es3fMultisampleTests.QuadCorners>} */ var unicoloredRegions = [];
+
+ /** @type {Array<Array<number>>} */ var corners;
+ /** @type {number} */ var angleCos;
+ /** @type {number} */ var angleSin;
+ /** @type {number} */ var angle;
+ /** @type {number} */ var quadDiagLen;
+ /** @type {number} */ var unicolorRegionScale;
+ /** @type {number} */ var quadBaseAngleNdx
+ /** @type {number} */ var quadSubAngleNdx;
+
+ if (this.m_caseType == es3fMultisampleTests.CommonEdgeCase.CaseType.SMALL_QUADS) {
+ // Draw several quads, rotated at different angles.
+
+ quadDiagLen = 2.0 / 3.0 * 0.9; // \note Fit 3 quads in both x and y directions.
+
+
+ // \note First and second iteration get exact 0 (and 90, 180, 270) and 45 (and 135, 225, 315) angle quads, as they are kind of a special case.
+
+ if (this.m_currentIteration === 0) {
+ angleCos = 1.0;
+ angleSin = 0.0;
+ }
+ else if (this.m_currentIteration === 1) {
+ angleCos = Math.SQRT1_2;
+ angleSin = Math.SQRT1_2;
+ }
+ else {
+ angle = 0.5 * Math.PI * (this.m_currentIteration - 1) / (this.m_numIterations - 1);
+ angleCos = Math.cos(angle);
+ angleSin = Math.sin(angle);
+ }
+
+ corners = [
+ deMath.scale([angleCos, angleSin], 0.5 * quadDiagLen),
+ deMath.scale([-angleSin, angleCos], 0.5 * quadDiagLen),
+ deMath.scale([-angleCos, -angleSin], 0.5 * quadDiagLen),
+ deMath.scale([angleSin, -angleCos], 0.5 * quadDiagLen)
+ ];
+
+ // Draw 8 quads.
+ // First four are rotated at angles angle+0, angle+90, angle+180 and angle+270.
+ // Last four are rotated the same angles as the first four, but the ordering of the last triangle's vertices is reversed.
+
+ for (var quadNdx = 0; quadNdx < 8; quadNdx++) {
+ /** @type {Array<number>} */
+ var center = deMath.addScalar(
+ deMath.scale([quadNdx % 3, quadNdx / 3], (2.0 - quadDiagLen)/ 2.0),
+ (-0.5 * (2.0 - quadDiagLen)));
+
+ this.renderTriangle_pAsVec2WithColor(
+ deMath.add(corners[(0 + quadNdx) % 4], center),
+ deMath.add(corners[(1 + quadNdx) % 4], center),
+ deMath.add(corners[(2 + quadNdx) % 4], center),
+ [0.5, 0.5, 0.5, 1.0]);
+
+ if (quadNdx >= 4) {
+ this.renderTriangle_pAsVec2WithColor(
+ deMath.add(corners[(3 + quadNdx) % 4], center),
+ deMath.add(corners[(2 + quadNdx) % 4], center),
+ deMath.add(corners[(0 + quadNdx) % 4], center),
+ [0.5, 0.5, 0.5, 1.0]);
+ }
+ else {
+ this.renderTriangle_pAsVec2WithColor(
+ deMath.add(corners[(0 + quadNdx) % 4], center),
+ deMath.add(corners[(2 + quadNdx) % 4], center),
+ deMath.add(corners[(3 + quadNdx) % 4], center),
+ [0.5, 0.5, 0.5, 1.0]);
+ }
+
+ // The size of the 'interior' of a quad is assumed to be approximately unicolorRegionScale*<actual size of quad>.
+ // By 'interior' we here mean the region of non-boundary pixels of the rendered quad for which we can safely assume
+ // that it has all coverage bits set to 1, for every pixel.
+ unicolorRegionScale = 1.0 - 6.0 * 2.0 / this.m_viewportSize / quadDiagLen;
+ unicoloredRegions.push(
+ new es3fMultisampleTests.QuadCorners(
+ deMath.add(center, deMath.scale(corners[0], unicolorRegionScale)),
+ deMath.add(center, deMath.scale(corners[1], unicolorRegionScale)),
+ deMath.add(center, deMath.scale(corners[2], unicolorRegionScale)),
+ deMath.add(center, deMath.scale(corners[3], unicolorRegionScale))));
+ }
+ }
+ else if (this.m_caseType === es3fMultisampleTests.CommonEdgeCase.CaseType.BIGGER_THAN_VIEWPORT_QUAD) {
+ // Draw a bigger-than-viewport quad, rotated at an angle depending on m_currentIteration.
+
+ quadBaseAngleNdx = Math.floor(this.m_currentIteration / 8);
+ quadSubAngleNdx = this.m_currentIteration % 8;
+
+ if (quadBaseAngleNdx === 0) {
+ angleCos = 1.0;
+ angleSin = 0.0;
+ }
+ else if (quadBaseAngleNdx === 1) {
+ angleCos = Math.SQRT1_2;
+ angleSin = Math.SQRT1_2;
+ }
+ else {
+ angle = 0.5 * Math.PI * (this.m_currentIteration - 1) / (this.m_numIterations - 1);
+ angleCos = Math.cos(angle);
+ angleSin = Math.sin(angle);
+ }
+
+ quadDiagLen = 2.5 / Math.max(angleCos, angleSin);
+
+ corners = [
+ deMath.scale([angleCos, angleSin], 0.5 * quadDiagLen),
+ deMath.scale([-angleSin, angleCos], 0.5 * quadDiagLen),
+ deMath.scale([-angleCos, -angleSin], 0.5 * quadDiagLen),
+ deMath.scale([angleSin, -angleCos], 0.5 * quadDiagLen)
+ ];
+
+ this.renderTriangle_pAsVec2WithColor(
+ corners[(0 + quadSubAngleNdx) % 4],
+ corners[(1 + quadSubAngleNdx) % 4],
+ corners[(2 + quadSubAngleNdx) % 4],
+ [0.5, 0.5, 0.5, 1.0]);
+
+ if (quadSubAngleNdx >= 4) {
+ this.renderTriangle_pAsVec2WithColor(
+ corners[(3 + quadSubAngleNdx) % 4],
+ corners[(2 + quadSubAngleNdx) % 4],
+ corners[(0 + quadSubAngleNdx) % 4],
+ [0.5, 0.5, 0.5, 1.0]);
+ }
+ else {
+ this.renderTriangle_pAsVec2WithColor(
+ corners[(0 + quadSubAngleNdx) % 4],
+ corners[(2 + quadSubAngleNdx) % 4],
+ corners[(3 + quadSubAngleNdx) % 4],
+ [0.5, 0.5, 0.5, 1.0]);
+ }
+
+ unicolorRegionScale = 1.0 - 6.0 * 2.0 / this.m_viewportSize / quadDiagLen;
+ unicoloredRegions.push(
+ new es3fMultisampleTests.QuadCorners(
+ deMath.scale(corners[0], unicolorRegionScale),
+ deMath.scale(corners[1], unicolorRegionScale),
+ deMath.scale(corners[2], unicolorRegionScale),
+ deMath.scale(corners[3], unicolorRegionScale)));
+ }
+ else if (this.m_caseType === es3fMultisampleTests.CommonEdgeCase.CaseType.FIT_VIEWPORT_QUAD) {
+ // Draw an exactly viewport-sized quad, rotated by multiples of 90 degrees angle depending on m_currentIteration.
+
+ quadSubAngleNdx = this.m_currentIteration % 8;
+
+ corners = [
+ [1.0, 1.0],
+ [-1.0, 1.0],
+ [-1.0, -1.0],
+ [1.0, -1.0]
+ ];
+
+ this.renderTriangle_pAsVec2WithColor(
+ corners[(0 + quadSubAngleNdx) % 4],
+ corners[(1 + quadSubAngleNdx) % 4],
+ corners[(2 + quadSubAngleNdx) % 4],
+ [0.5, 0.5, 0.5, 1.0]);
+
+ if (quadSubAngleNdx >= 4) {
+ this.renderTriangle_pAsVec2WithColor(
+ corners[(3 + quadSubAngleNdx) % 4],
+ corners[(2 + quadSubAngleNdx) % 4],
+ corners[(0 + quadSubAngleNdx) % 4],
+ [0.5, 0.5, 0.5, 1.0]);
+ }
+ else {
+ this.renderTriangle_pAsVec2WithColor(
+ corners[(0 + quadSubAngleNdx) % 4],
+ corners[(2 + quadSubAngleNdx) % 4],
+ corners[(3 + quadSubAngleNdx) % 4],
+ [0.5, 0.5, 0.5, 1.0]);
+ }
+
+ unicoloredRegions.push(new es3fMultisampleTests.QuadCorners(corners[0], corners[1], corners[2], corners[3]));
+ }
+ else
+ throw new Error('CaseType not supported.');
+
+ // Read pixels and check unicolored regions.
+
+ /** @type {tcuSurface.Surface} */ var renderedImg = this.readImage();
+
+ errorImg.getAccess().clear([0.0, 1.0, 0.0, 1.0]);
+ tcuLogImage.logImage('RenderedImage', 'Rendered image', renderedImg.getAccess());
+
+ /** @type {boolean} */ var errorsDetected = false;
+ for (var i = 0; i < unicoloredRegions.length; i++) {
+ /** @type {es3fMultisampleTests.QuadCorners} */ var region = unicoloredRegions[i];
+ /** @type {Array<number>} */ var p0Win = deMath.scale(deMath.addScalar(region.p0, 1.0), 0.5 * (this.m_viewportSize - 1) + 0.5);
+ /** @type {Array<number>} */ var p1Win = deMath.scale(deMath.addScalar(region.p1, 1.0), 0.5 * (this.m_viewportSize - 1) + 0.5);
+ /** @type {Array<number>} */ var p2Win = deMath.scale(deMath.addScalar(region.p2, 1.0), 0.5 * (this.m_viewportSize - 1) + 0.5);
+ /** @type {Array<number>} */ var p3Win = deMath.scale(deMath.addScalar(region.p3, 1.0), 0.5 * (this.m_viewportSize - 1) + 0.5);
+ /** @type {boolean} */ var errorsInCurrentRegion = !es3fMultisampleTests.isPixelRegionUnicolored(renderedImg, p0Win, p1Win, p2Win, p3Win);
+
+ if (errorsInCurrentRegion)
+ es3fMultisampleTests.drawUnicolorTestErrors(renderedImg, errorImg.getAccess(), p0Win, p1Win, p2Win, p3Win);
+
+ errorsDetected = errorsDetected || errorsInCurrentRegion;
+ }
+
+ this.m_currentIteration++;
+
+ if (errorsDetected) {
+ bufferedLogToConsole('Failure: Not all quad interiors seem unicolored - common-edge artifacts?');
+ bufferedLogToConsole('Erroneous pixels are drawn red in the following image');
+ tcuLogImage.logImage('RenderedImageWithErrors', 'Rendered image with errors marked', renderedImg.getAccess());
+ tcuLogImage.logImage('ErrorsOnly', 'Image with error pixels only', errorImg.getAccess());
+ testFailedOptions('Failed: iteration ' + (this.m_currentIteration - 1), false);
+ return tcuTestCase.IterateResult.STOP;
+ }
+ else if (this.m_currentIteration < this.m_numIterations) {
+ bufferedLogToConsole('Quads seem OK - moving on to next pattern');
+ return tcuTestCase.IterateResult.CONTINUE;
+ }
+ else {
+ bufferedLogToConsole('Success: All quad interiors seem unicolored (no common-edge artifacts)');
+ testPassedOptions('Passed: iteration ' + (this.m_currentIteration - 1), true);
+ return tcuTestCase.IterateResult.STOP;
+ }
+ };
+
+ /**
+ * Test that depth values are per-sample.
+ *
+ * Draws intersecting, differently-colored polygons and checks that there
+ * are at least sample count+1 distinct colors present, due to some of the
+ * samples at the intersection line belonging to one and some to another
+ * polygon.
+ *
+ * @extends {es3fMultisampleTests.NumSamplesCase}
+ * @constructor
+ * @param {string} name
+ * @param {string} desc
+ * @param {number=} numFboSamples
+ */
+ es3fMultisampleTests.SampleDepthCase = function(name, desc, numFboSamples) {
+ numFboSamples = numFboSamples === undefined ? 0 : numFboSamples;
+ /** @type {es3fMultisampleTests.FboParams} */
+ var params = numFboSamples >= 0 ? new es3fMultisampleTests.FboParams(numFboSamples, true, false) : new es3fMultisampleTests.FboParams();
+ es3fMultisampleTests.NumSamplesCase.call(this, name, desc, params);
+ };
+
+ es3fMultisampleTests.SampleDepthCase.prototype = Object.create(es3fMultisampleTests.NumSamplesCase.prototype);
+
+ /** Copy the constructor */
+ es3fMultisampleTests.SampleDepthCase.prototype.constructor = es3fMultisampleTests.SampleDepthCase;
+
+ es3fMultisampleTests.SampleDepthCase.prototype.init = function() {
+ var inited = es3fMultisampleTests.MultisampleCase.prototype.init.call(this);
+ if (!inited) {
+ return false;
+ }
+
+ gl.enable(gl.DEPTH_TEST);
+ gl.depthFunc(gl.LESS);
+
+ bufferedLogToConsole('Depth test enabled, depth func is gl.LESS');
+ bufferedLogToConsole('Drawing several bigger-than-viewport black or white polygons intersecting each other');
+ };
+
+ es3fMultisampleTests.SampleDepthCase.prototype.renderPattern = function() {
+ gl.clearColor(0.0, 0.0, 0.0, 0.0);
+ gl.clearDepth(1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+
+ /** @type {number} */ var numPolygons = 50;
+
+ for (var i = 0; i < numPolygons; i++) {
+ /** @type {Array<number>} */ var color = i % 2 == 0 ? [1.0, 1.0, 1.0, 1.0] : [0.0, 0.0, 0.0, 1.0];
+ /** @type {number} */ var angle = 2.0 * Math.PI * i / numPolygons + 0.001 * this.m_currentIteration;
+ /** @type {Array<number>} */ var pt0 = [3.0 * Math.cos(angle + 2.0 * Math.PI * 0.0 / 3.0), 3.0 * Math.sin(angle + 2.0 * Math.PI * 0.0 / 3.0), 1.0];
+ /** @type {Array<number>} */ var pt1 = [3.0 * Math.cos(angle + 2.0 * Math.PI * 1.0 / 3.0), 3.0 * Math.sin(angle + 2.0 * Math.PI * 1.0 / 3.0), 0.0];
+ /** @type {Array<number>} */ var pt2 = [3.0 * Math.cos(angle + 2.0 * Math.PI * 2.0 / 3.0), 3.0 * Math.sin(angle + 2.0 * Math.PI * 2.0 / 3.0), 0.0];
+
+ this.renderTriangle_pAsVec3WithColor(pt0, pt1, pt2, color);
+ }
+ };
+
+ /**
+ * Test that stencil buffer values are per-sample.
+ *
+ * Draws a unicolored pattern and marks drawn samples in stencil buffer;
+ * then clears and draws a viewport-size quad with that color and with
+ * proper stencil test such that the resulting image should be exactly the
+ * same as after the pattern was first drawn.
+ *
+ * @extends {es3fMultisampleTests.MultisampleCase}
+ * @constructor
+ * @param {string} name
+ * @param {string} desc
+ * @param {number=} numFboSamples
+ */
+ es3fMultisampleTests.SampleStencilCase = function(name, desc, numFboSamples) {
+ numFboSamples = numFboSamples === undefined ? 0 : numFboSamples;
+ /** @type {es3fMultisampleTests.FboParams} */
+ var params = numFboSamples >= 0 ? new es3fMultisampleTests.FboParams(numFboSamples, false, true) : new es3fMultisampleTests.FboParams();
+ es3fMultisampleTests.MultisampleCase.call(this, name, desc, 256, params);
+ };
+
+ es3fMultisampleTests.SampleStencilCase.prototype = Object.create(es3fMultisampleTests.MultisampleCase.prototype);
+
+ /** Copy the constructor */
+ es3fMultisampleTests.SampleStencilCase.prototype.constructor = es3fMultisampleTests.SampleStencilCase;
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fMultisampleTests.SampleStencilCase.prototype.iterate = function() {
+ this.randomizeViewport();
+
+ gl.clearColor(0.0, 0.0, 0.0, 1.0);
+ gl.clearStencil(0);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+ gl.enable(gl.STENCIL_TEST);
+ gl.stencilFunc(gl.ALWAYS, 1, 1);
+ gl.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE);
+
+ bufferedLogToConsole('Drawing a pattern with gl.stencilFunc(gl.ALWAYS, 1, 1) and gl.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE)');
+
+ /** @type {number} */ var numTriangles = 25;
+ for (var i = 0; i < numTriangles; i++) {
+ /** @type {number} */ var angle0 = 2.0 * Math.PI * i / numTriangles;
+ /** @type {number} */ var angle1 = 2.0 * Math.PI * (i + 0.5) / numTriangles;
+
+ this.renderTriangle_pAsVec2WithColor(
+ [0.0, 0.0],
+ [Math.cos(angle0) * 0.95, Math.sin(angle0) * 0.95],
+ [Math.cos(angle1) * 0.95, Math.sin(angle1) * 0.95],
+ [1.0, 1.0, 1.0, 1.0]);
+ }
+
+ /** @type {tcuSurface.Surface} */ var renderedImgFirst = this.readImage();
+ tcuLogImage.logImage('RenderedImgFirst', 'First image rendered', renderedImgFirst.getAccess());
+ bufferedLogToConsole('Clearing color buffer to black');
+
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.stencilFunc(gl.EQUAL, 1, 1);
+ gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);
+
+ bufferedLogToConsole('Checking that color buffer was actually cleared to black');
+
+ /** @type {tcuSurface.Surface} */ var clearedImg = this.readImage();
+
+ for (var y = 0; y < clearedImg.getHeight(); y++)
+ for (var x = 0; x < clearedImg.getWidth(); x++) {
+ /** @type {tcuRGBA.RGBA} */ var clr = new tcuRGBA.RGBA(clearedImg.getPixel(x, y));
+ if (!clr.equals(tcuRGBA.RGBA.black)) {
+ bufferedLogToConsole('Failure: first non-black pixel, color ' + clr.toString() + ', detected at coordinates (' + x + ', ' + y + ')');
+ tcuLogImage.logImage('ClearedImg', 'Image after clearing, erroneously non-black', clearedImg.getAccess());
+ testFailedOptions('Failed', false);
+ return tcuTestCase.IterateResult.STOP;
+ }
+ }
+
+ bufferedLogToConsole('Drawing a viewport-sized quad with gl.stencilFunc(gl.EQUAL, 1, 1) and gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP) - should result in same image as the first');
+
+ this.renderQuad_WithColor(
+ [-1.0, -1.0],
+ [1.0, -1.0],
+ [-1.0, 1.0],
+ [1.0, 1.0],
+ [1.0, 1.0, 1.0, 1.0]);
+
+ /** @type {tcuSurface.Surface} */ var renderedImgSecond = this.readImage();
+ tcuLogImage.logImage('RenderedImgSecond', 'Second image rendered', renderedImgSecond.getAccess());
+ /** @type {boolean} */
+ var passed = tcuImageCompare.pixelThresholdCompare(
+ 'ImageCompare',
+ 'Image comparison',
+ renderedImgFirst,
+ renderedImgSecond,
+ [0,0,0,0]);
+
+ if (passed) {
+ bufferedLogToConsole('Success: The two images rendered are identical');
+ testPassedOptions('Passed', true);
+ }
+ else
+ testFailedOptions('Failed', false);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * Tests coverage mask generation proportionality property.
+ *
+ * Tests that the number of coverage bits in a coverage mask created by
+ * gl.SAMPLE_ALPHA_TO_COVERAGE or gl.SAMPLE_COVERAGE is, on average,
+ * proportional to the alpha or coverage value, respectively. Draws
+ * multiple frames, each time increasing the alpha or coverage value used,
+ * and checks that the average color is changing appropriately.
+ *
+ * @extends {es3fMultisampleTests.MultisampleCase}
+ * @constructor
+ * @param {string} name
+ * @param {string} desc
+ * @param {es3fMultisampleTests.MaskProportionalityCase.CaseType} type
+ * @param {number=} numFboSamples
+ */
+ es3fMultisampleTests.MaskProportionalityCase = function(name, desc, type, numFboSamples) {
+ numFboSamples = numFboSamples === undefined ? 0 : numFboSamples;
+ /** @type {es3fMultisampleTests.FboParams} */
+ var params = numFboSamples >= 0 ? new es3fMultisampleTests.FboParams(numFboSamples, false, false) : new es3fMultisampleTests.FboParams();
+ es3fMultisampleTests.MultisampleCase.call(this, name, desc, 32, params);
+ /** @type {es3fMultisampleTests.MaskProportionalityCase.CaseType} */ this.m_type = type;
+ /** @type {number} */ this.m_numIterations;
+ /** @type {number} */ this.m_currentIteration = 0;
+ /** @type {number} */ this.m_previousIterationColorSum = -1;
+ };
+
+ es3fMultisampleTests.MaskProportionalityCase.prototype = Object.create(es3fMultisampleTests.MultisampleCase.prototype);
+
+ /** Copy the constructor */
+ es3fMultisampleTests.MaskProportionalityCase.prototype.constructor = es3fMultisampleTests.MaskProportionalityCase;
+
+ /**
+ * @enum {number}
+ */
+ es3fMultisampleTests.MaskProportionalityCase.CaseType = {
+ ALPHA_TO_COVERAGE: 0,
+ SAMPLE_COVERAGE: 1,
+ SAMPLE_COVERAGE_INVERTED: 2
+ };
+
+ es3fMultisampleTests.MaskProportionalityCase.prototype.init = function() {
+ var inited = es3fMultisampleTests.MultisampleCase.prototype.init.call(this);
+ if (!inited) {
+ return false;
+ }
+
+ if (this.m_type == es3fMultisampleTests.MaskProportionalityCase.CaseType.ALPHA_TO_COVERAGE) {
+ gl.enable(gl.SAMPLE_ALPHA_TO_COVERAGE);
+ bufferedLogToConsole('gl.SAMPLE_ALPHA_TO_COVERAGE is enabled');
+ }
+ else {
+ assertMsgOptions(
+ this.m_type == es3fMultisampleTests.MaskProportionalityCase.CaseType.SAMPLE_COVERAGE ||
+ this.m_type == es3fMultisampleTests.MaskProportionalityCase.CaseType.SAMPLE_COVERAGE_INVERTED,
+ 'CaseType should be SAMPLE_COVERAGE or SAMPLE_COVERAGE_INVERTED', false, true);
+
+ gl.enable(gl.SAMPLE_COVERAGE);
+ bufferedLogToConsole('gl.SAMPLE_COVERAGE is enabled');
+ }
+
+ this.m_numIterations = Math.max(2, es3fMultisampleTests.getIterationCount(this.m_numSamples * 5));
+
+ this.randomizeViewport(); // \note Using the same viewport for every iteration since coverage mask may depend on window-relative pixel coordinate.
+ };
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fMultisampleTests.MaskProportionalityCase.prototype.iterate = function() {
+ bufferedLogToConsole('Clearing color to black');
+ gl.colorMask(true, true, true, true);
+ gl.clearColor(0.0, 0.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ if (this.m_type === es3fMultisampleTests.MaskProportionalityCase.CaseType.ALPHA_TO_COVERAGE) {
+ gl.colorMask(true, true, true, false);
+ bufferedLogToConsole('Using color mask TRUE, TRUE, TRUE, FALSE');
+ }
+
+ // Draw quad.
+
+ /** @type {Array<number>} */ var pt0 = [-1.0, -1.0];
+ /** @type {Array<number>} */ var pt1 = [1.0, -1.0];
+ /** @type {Array<number>} */ var pt2 = [-1.0, 1.0];
+ /** @type {Array<number>} */ var pt3 = [1.0, 1.0];
+ /** @type {Array<number>} */ var quadColor = [1.0, 0.0, 0.0, 1.0];
+ /** @type {number} */ var alphaOrCoverageValue = this.m_currentIteration / (this.m_numIterations-1);
+
+ if (this.m_type === es3fMultisampleTests.MaskProportionalityCase.CaseType.ALPHA_TO_COVERAGE) {
+ bufferedLogToConsole('Drawing a red quad using alpha value ' + alphaOrCoverageValue);
+ quadColor[3] = alphaOrCoverageValue;
+ }
+ else {
+ assertMsgOptions(
+ this.m_type === es3fMultisampleTests.MaskProportionalityCase.CaseType.SAMPLE_COVERAGE ||
+ this.m_type === es3fMultisampleTests.MaskProportionalityCase.CaseType.SAMPLE_COVERAGE_INVERTED,
+ 'CaseType should be SAMPLE_COVERAGE or SAMPLE_COVERAGE_INVERTED', false, true);
+
+ /** @type {boolean} */ var isInverted = (this.m_type === es3fMultisampleTests.MaskProportionalityCase.CaseType.SAMPLE_COVERAGE_INVERTED);
+ /** @type {number} */ var coverageValue = isInverted ? 1.0 - alphaOrCoverageValue : alphaOrCoverageValue;
+ bufferedLogToConsole('Drawing a red quad using sample coverage value ' + coverageValue + (isInverted ? ' (inverted)' : ''));
+ gl.sampleCoverage(coverageValue, isInverted ? true : false);
+ }
+
+ this.renderQuad_WithColor(pt0, pt1, pt2, pt3, quadColor);
+
+ // Read and log image.
+ /** @type {tcuSurface.Surface} */ var renderedImg = this.readImage();
+ /** @type {number} */ var numPixels = renderedImg.getWidth() * renderedImg.getHeight();
+
+ tcuLogImage.logImage('RenderedImage', 'Rendered image', renderedImg.getAccess());
+ // Compute average red component in rendered image.
+
+ /** @type {number} */ var sumRed = 0;
+
+ for (var y = 0; y < renderedImg.getHeight(); y++)
+ for (var x = 0; x < renderedImg.getWidth(); x++)
+ sumRed += new tcuRGBA.RGBA(renderedImg.getPixel(x, y)).getRed();
+
+ bufferedLogToConsole('Average red color component: ' + (sumRed / 255.0 / numPixels));
+
+ // Check if average color has decreased from previous frame's color.
+
+ if (sumRed < this.m_previousIterationColorSum) {
+ bufferedLogToConsole('Failure: Current average red color component is lower than previous');
+ testFailedOptions('Failed', false);
+ return tcuTestCase.IterateResult.STOP;
+ }
+
+ // Check if coverage mask is not all-zeros if alpha or coverage value is 0 (or 1, if inverted).
+
+ if (this.m_currentIteration == 0 && sumRed != 0)
+ {
+ bufferedLogToConsole('Failure: Image should be completely black');
+ testFailedOptions('Failed', false);
+ return tcuTestCase.IterateResult.STOP;
+ }
+
+ if (this.m_currentIteration == this.m_numIterations-1 && sumRed != 0xff*numPixels)
+ {
+ bufferedLogToConsole('Failure: Image should be completely red');
+
+ testFailedOptions('Failed', false);
+ return tcuTestCase.IterateResult.STOP;
+ }
+
+ this.m_previousIterationColorSum = sumRed;
+
+ this.m_currentIteration++;
+
+ if (this.m_currentIteration >= this.m_numIterations)
+ {
+ bufferedLogToConsole('Success: Number of coverage mask bits set appears to be, on average, proportional to ' +
+ (this.m_type == es3fMultisampleTests.MaskProportionalityCase.CaseType.ALPHA_TO_COVERAGE ? 'alpha' :
+ this.m_type == es3fMultisampleTests.MaskProportionalityCase.CaseType.SAMPLE_COVERAGE ? 'sample coverage value' :
+ 'inverted sample coverage value'));
+
+ testPassedOptions('Passed', true);
+ return tcuTestCase.IterateResult.STOP;
+ }
+ else
+ return tcuTestCase.IterateResult.CONTINUE;
+ };
+
+ /**
+ * Tests coverage mask generation constancy property.
+ *
+ * Tests that the coverage mask created by gl.SAMPLE_ALPHA_TO_COVERAGE or
+ * gl.SAMPLE_COVERAGE is constant at given pixel coordinates, with a given
+ * alpha component or coverage value, respectively. Draws two quads, with
+ * the second one fully overlapping the first one such that at any given
+ * pixel, both quads have the same alpha or coverage value. This way, if
+ * the constancy property is fulfilled, only the second quad should be
+ * visible.
+ * @extends {es3fMultisampleTests.MultisampleCase}
+ * @constructor
+ * @param {string} name
+ * @param {string} desc
+ * @param {es3fMultisampleTests.MaskConstancyCase.CaseType} type
+ * @param {number=} numFboSamples
+ */
+ es3fMultisampleTests.MaskConstancyCase = function(name, desc, type, numFboSamples) {
+ numFboSamples = numFboSamples === undefined ? 0 : numFboSamples;
+ /** @type {es3fMultisampleTests.FboParams} */
+ var params = numFboSamples >= 0 ? new es3fMultisampleTests.FboParams(numFboSamples, false, false) : new es3fMultisampleTests.FboParams();
+ es3fMultisampleTests.MultisampleCase.call(this, name, desc, 256, params);
+ var CaseType = es3fMultisampleTests.MaskConstancyCase.CaseType;
+ /** @type {boolean} */ this.m_isAlphaToCoverageCase = (type === CaseType.ALPHA_TO_COVERAGE || type === CaseType.BOTH || type === CaseType.BOTH_INVERTED);
+ /** @type {boolean} */ this.m_isSampleCoverageCase = (type === CaseType.SAMPLE_COVERAGE || type === CaseType.SAMPLE_COVERAGE_INVERTED || type === CaseType.BOTH || type === CaseType.BOTH_INVERTED);
+ /** @type {boolean} */ this.m_isInvertedSampleCoverageCase = (type === CaseType.SAMPLE_COVERAGE_INVERTED || type === CaseType.BOTH_INVERTED);
+ };
+
+ es3fMultisampleTests.MaskConstancyCase.prototype = Object.create(es3fMultisampleTests.MultisampleCase.prototype);
+
+ /** Copy the constructor */
+ es3fMultisampleTests.MaskConstancyCase.prototype.constructor = es3fMultisampleTests.MaskConstancyCase;
+
+ /**
+ * @enum {number}
+ */
+ es3fMultisampleTests.MaskConstancyCase.CaseType = {
+ ALPHA_TO_COVERAGE: 0, //!< Use only alpha-to-coverage.
+ SAMPLE_COVERAGE: 1, //!< Use only sample coverage.
+ SAMPLE_COVERAGE_INVERTED: 2, //!< Use only inverted sample coverage.
+ BOTH: 3, //!< Use both alpha-to-coverage and sample coverage.
+ BOTH_INVERTED: 4 //!< Use both alpha-to-coverage and inverted sample coverage.
+ };
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fMultisampleTests.MaskConstancyCase.prototype.iterate = function() {
+ this.randomizeViewport();
+
+ bufferedLogToConsole('Clearing color to black');
+ gl.clearColor(0.0, 0.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ if (this.m_isAlphaToCoverageCase) {
+ gl.enable(gl.SAMPLE_ALPHA_TO_COVERAGE);
+ gl.colorMask(true, true, true, false);
+ bufferedLogToConsole('gl.SAMPLE_ALPHA_TO_COVERAGE is enabled');
+ bufferedLogToConsole('Color mask is TRUE, TRUE, TRUE, FALSE');
+ }
+
+ if (this.m_isSampleCoverageCase) {
+ gl.enable(gl.SAMPLE_COVERAGE);
+ bufferedLogToConsole('gl.SAMPLE_COVERAGE is enabled');
+ }
+
+ bufferedLogToConsole('Drawing several green quads, each fully overlapped by a red quad with the same ' +
+ (this.m_isAlphaToCoverageCase ? 'alpha' : '') +
+ (this.m_isAlphaToCoverageCase && this.m_isSampleCoverageCase ? ' and ' : '') +
+ (this.m_isInvertedSampleCoverageCase ? 'inverted ' : '') +
+ (this.m_isSampleCoverageCase ? 'sample coverage' : '') +
+ ' values');
+
+ /** @type {number} */ var numQuadRowsCols = this.m_numSamples * 4;
+
+ for (var row = 0; row < numQuadRowsCols; row++) {
+ for (var col = 0; col < numQuadRowsCols; col++) {
+ /** @type {number} */ var x0 = (col + 0) / numQuadRowsCols * 2.0 - 1.0;
+ /** @type {number} */ var x1 = (col + 1) / numQuadRowsCols * 2.0 - 1.0;
+ /** @type {number} */ var y0 = (row + 0) / numQuadRowsCols * 2.0 - 1.0;
+ /** @type {number} */ var y1 = (row + 1) / numQuadRowsCols * 2.0 - 1.0;
+ /** @type {Array<number>} */ var baseGreen = [0.0, 1.0, 0.0, 0.0];
+ /** @type {Array<number>} */ var baseRed = [1.0, 0.0, 0.0, 0.0];
+ /** @type {Array<number>} */ var alpha0 = [0.0, 0.0, 0.0, this.m_isAlphaToCoverageCase ? col / (numQuadRowsCols - 1) : 1.0];
+ /** @type {Array<number>} */ var alpha1 = [0.0, 0.0, 0.0, this.m_isAlphaToCoverageCase ? row / (numQuadRowsCols - 1) : 1.0];
+
+ if (this.m_isSampleCoverageCase) {
+ /** @type {number} */ var value = (row*numQuadRowsCols + col) / (numQuadRowsCols*numQuadRowsCols - 1);
+ gl.sampleCoverage(this.m_isInvertedSampleCoverageCase ? 1.0 - value : value, this.m_isInvertedSampleCoverageCase ? true : false);
+ }
+
+ this.renderQuad([x0, y0], [x1, y0], [x0, y1], [x1, y1],
+ deMath.add(baseGreen, alpha0), deMath.add(baseGreen, alpha1),
+ deMath.add(baseGreen, alpha0), deMath.add(baseGreen, alpha1));
+ this.renderQuad([x0, y0], [x1, y0], [x0, y1], [x1, y1],
+ deMath.add(baseRed, alpha0), deMath.add(baseRed, alpha1),
+ deMath.add(baseRed, alpha0), deMath.add(baseRed, alpha1));
+ }
+ }
+
+ /** @type {tcuSurface.Surface} */ var renderedImg = this.readImage();
+
+ tcuLogImage.logImage('RenderedImage', 'Rendered image', renderedImg.getAccess());
+ for (var y = 0; y < renderedImg.getHeight(); y++)
+ for (var x = 0; x < renderedImg.getWidth(); x++) {
+ if (new tcuRGBA.RGBA(renderedImg.getPixel(x, y)).getGreen() > 0) {
+ bufferedLogToConsole('Failure: Non-zero green color component detected - should have been completely overwritten by red quad');
+ testFailedOptions('Failed', false);
+ return tcuTestCase.IterateResult.STOP;
+ }
+ }
+
+ bufferedLogToConsole('Success: Coverage mask appears to be constant at a given pixel coordinate with a given ' +
+ (this.m_isAlphaToCoverageCase ? 'alpha' : '') +
+ (this.m_isAlphaToCoverageCase && this.m_isSampleCoverageCase ? ' and ' : '') +
+ (this.m_isSampleCoverageCase ? 'coverage value' : ''));
+
+ testPassedOptions('Passed', true);
+
+ return tcuTestCase.IterateResult.STOP;
+ }
+
+
+ /**
+ * Tests coverage mask inversion validity.
+ *
+ * Tests that the coverage masks obtained by glSampleCoverage(..., true)
+ * and glSampleCoverage(..., false) are indeed each others' inverses.
+ * This is done by drawing a pattern, with varying coverage values,
+ * overlapped by a pattern that has inverted masks and is otherwise
+ * identical. The resulting image is compared to one obtained by drawing
+ * the same pattern but with all-ones coverage masks.
+ * @extends {es3fMultisampleTests.MultisampleCase}
+ * @constructor
+ * @param {string} name
+ * @param {string} desc
+ * @param {number=} numFboSamples
+ */
+ es3fMultisampleTests.CoverageMaskInvertCase = function(name, desc, numFboSamples) {
+ numFboSamples = numFboSamples === undefined ? 0 : numFboSamples;
+ /** @type {es3fMultisampleTests.FboParams} */
+ var params = numFboSamples >= 0 ? new es3fMultisampleTests.FboParams(numFboSamples, false, false) : new es3fMultisampleTests.FboParams();
+ es3fMultisampleTests.MultisampleCase.call(this, name, desc, 256, params);
+ };
+
+ es3fMultisampleTests.CoverageMaskInvertCase.prototype = Object.create(es3fMultisampleTests.MultisampleCase.prototype);
+
+ /** Copy the constructor */
+ es3fMultisampleTests.CoverageMaskInvertCase.prototype.constructor = es3fMultisampleTests.CoverageMaskInvertCase;
+
+ /**
+ * @param {boolean} invertSampleCoverage
+ */
+ es3fMultisampleTests.CoverageMaskInvertCase.prototype.drawPattern = function(invertSampleCoverage) {
+ /** @type {number} */ var numTriangles = 25;
+ for (var i = 0; i < numTriangles; i++) {
+ gl.sampleCoverage(i / (numTriangles - 1), invertSampleCoverage ? true : false);
+
+ /** @type {number} */ var angle0 = 2.0 * Math.PI * i / numTriangles;
+ /** @type {number} */ var angle1 = 2.0 * Math.PI * (i + 0.5) / numTriangles;
+
+ this.renderTriangle_pAsVec2WithColor(
+ [0.0, 0.0],
+ [Math.cos(angle0) * 0.95, Math.sin(angle0) * 0.95],
+ [Math.cos(angle1) * 0.95, Math.sin(angle1) * 0.95],
+ [0.4 + i / numTriangles * 0.6,
+ 0.5 + i / numTriangles * 0.3,
+ 0.6 - i / numTriangles * 0.5,
+ 0.7 - i / numTriangles * 0.7]);
+ }
+ };
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fMultisampleTests.CoverageMaskInvertCase.prototype.iterate = function() {
+ this.randomizeViewport();
+
+ gl.enable(gl.BLEND);
+ gl.blendEquation(gl.FUNC_ADD);
+ gl.blendFunc(gl.ONE, gl.ONE);
+ bufferedLogToConsole('Additive blending enabled in order to detect (erroneously) overlapping samples');
+
+ bufferedLogToConsole('Clearing color to all-zeros');
+ gl.clearColor(0.0, 0.0, 0.0, 0.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ bufferedLogToConsole('Drawing the pattern with gl.SAMPLE_COVERAGE disabled');
+ this.drawPattern(false);
+ /** @type {tcuSurface.Surface} */ var renderedImgNoSampleCoverage = this.readImage();
+
+ tcuLogImage.logImage('RenderedImageNoSampleCoverage', 'Rendered image with gl.SAMPLE_COVERAGE disabled', renderedImgNoSampleCoverage.getAccess());
+ bufferedLogToConsole('Clearing color to all-zeros');
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.enable(gl.SAMPLE_COVERAGE);
+ bufferedLogToConsole('Drawing the pattern with gl.SAMPLE_COVERAGE enabled, using non-inverted masks');
+ this.drawPattern(false);
+ bufferedLogToConsole('Drawing the pattern with gl.SAMPLE_COVERAGE enabled, using same sample coverage values but inverted masks');
+ this.drawPattern(true);
+ /** @type {tcuSurface.Surface} */ var renderedImgSampleCoverage = this.readImage();
+
+ tcuLogImage.logImage('RenderedImageSampleCoverage', 'Rendered image with gl.SAMPLE_COVERAGE enabled', renderedImgSampleCoverage.getAccess());
+ /** @type {boolean} */ var passed = tcuImageCompare.pixelThresholdCompare(
+ 'CoverageVsNoCoverage',
+ 'Comparison of same pattern with gl.SAMPLE_COVERAGE disabled and enabled',
+ renderedImgNoSampleCoverage,
+ renderedImgSampleCoverage,
+ [0, 0, 0, 0]);
+
+ if (passed) {
+ bufferedLogToConsole('Success: The two images rendered are identical');
+ testPassedOptions('Passed', true);
+ }
+ else {
+ testFailedOptions('Failed', false);
+ }
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ es3fMultisampleTests.init = function() {
+ var testGroup = tcuTestCase.runner.testCases;
+ /**
+ * @enum {number}
+ */
+ var CaseType = {
+ DEFAULT_FRAMEBUFFER: 0,
+ FBO_4_SAMPLES: 1,
+ FBO_8_SAMPLES: 2,
+ FBO_MAX_SAMPLES: 3
+ };
+
+ for (var caseTypeI in CaseType) {
+ /** @type {CaseType} */ var caseType = CaseType[caseTypeI];
+ /** @type {number} */
+ var numFboSamples = caseType === CaseType.DEFAULT_FRAMEBUFFER ? -1 :
+ caseType === CaseType.FBO_4_SAMPLES ? 4 :
+ caseType === CaseType.FBO_8_SAMPLES ? 8 :
+ caseType === CaseType.FBO_MAX_SAMPLES ? 0 :
+ -2;
+
+ /** @type {?string} */
+ var name = caseType === CaseType.DEFAULT_FRAMEBUFFER ? 'default_framebuffer' :
+ caseType === CaseType.FBO_4_SAMPLES ? 'fbo_4_samples' :
+ caseType === CaseType.FBO_8_SAMPLES ? 'fbo_8_samples' :
+ caseType === CaseType.FBO_MAX_SAMPLES ? 'fbo_max_samples' :
+ null;
+ /** @type {?string} */
+ var desc = caseType === CaseType.DEFAULT_FRAMEBUFFER ? 'Render into default framebuffer' :
+ caseType === CaseType.FBO_4_SAMPLES ? 'Render into a framebuffer object with 4 samples' :
+ caseType === CaseType.FBO_8_SAMPLES ? 'Render into a framebuffer object with 8 samples' :
+ caseType === CaseType.FBO_MAX_SAMPLES ? 'Render into a framebuffer object with the maximum number of samples' :
+ null;
+
+ /** @type {tcuTestCase.DeqpTest} */ var group = tcuTestCase.newTest(name, desc);
+
+ assertMsgOptions(group.name != null, 'Error: No Test Name', false, true);
+ assertMsgOptions(group.description != null, 'Error: No Test Description', false, true);
+ assertMsgOptions(numFboSamples >= -1, 'Assert Failed: numFboSamples >= -1', false, true);
+ testGroup.addChild(group);
+
+ group.addChild(new es3fMultisampleTests.PolygonNumSamplesCase(
+ 'num_samples_polygon',
+ 'Test sanity of the sample count, with polygons',
+ numFboSamples));
+
+ group.addChild(new es3fMultisampleTests.LineNumSamplesCase(
+ 'num_samples_line',
+ 'Test sanity of the sample count, with lines',
+ numFboSamples));
+
+ group.addChild(new es3fMultisampleTests.CommonEdgeCase(
+ 'common_edge_small_quads',
+ 'Test polygons\'s common edges with small quads',
+ es3fMultisampleTests.CommonEdgeCase.CaseType.SMALL_QUADS,
+ numFboSamples));
+
+ group.addChild(new es3fMultisampleTests.CommonEdgeCase(
+ 'common_edge_big_quad',
+ 'Test polygon\'s common edges with bigger-than-viewport quads',
+ es3fMultisampleTests.CommonEdgeCase.CaseType.BIGGER_THAN_VIEWPORT_QUAD,
+ numFboSamples));
+
+ group.addChild(new es3fMultisampleTests.CommonEdgeCase(
+ 'common_edge_viewport_quad',
+ 'Test polygons\' common edges with exactly viewport-sized quads',
+ es3fMultisampleTests.CommonEdgeCase.CaseType.FIT_VIEWPORT_QUAD,
+ numFboSamples));
+
+ group.addChild(new es3fMultisampleTests.SampleDepthCase(
+ 'depth',
+ 'Test that depth values are per-sample',
+ numFboSamples));
+
+ group.addChild(new es3fMultisampleTests.SampleStencilCase(
+ 'stencil',
+ 'Test that stencil values are per-sample',
+ numFboSamples));
+
+ group.addChild(new es3fMultisampleTests.CoverageMaskInvertCase(
+ 'sample_coverage_invert',
+ 'Test that non-inverted and inverted sample coverage masks are each other\'s negations',
+ numFboSamples));
+
+
+ group.addChild(new es3fMultisampleTests.MaskProportionalityCase(
+ 'proportionality_alpha_to_coverage',
+ 'Test the proportionality property of GL_SAMPLE_ALPHA_TO_COVERAGE',
+ es3fMultisampleTests.MaskProportionalityCase.CaseType.ALPHA_TO_COVERAGE,
+ numFboSamples));
+ group.addChild(new es3fMultisampleTests.MaskProportionalityCase(
+ 'proportionality_sample_coverage',
+ 'Test the proportionality property of GL_SAMPLE_COVERAGE',
+ es3fMultisampleTests.MaskProportionalityCase.CaseType.SAMPLE_COVERAGE,
+ numFboSamples));
+ group.addChild(new es3fMultisampleTests.MaskProportionalityCase(
+ 'proportionality_sample_coverage_inverted',
+ 'Test the proportionality property of inverted-mask GL_SAMPLE_COVERAGE',
+ es3fMultisampleTests.MaskProportionalityCase.CaseType.SAMPLE_COVERAGE_INVERTED,
+ numFboSamples));
+
+ group.addChild(new es3fMultisampleTests.MaskConstancyCase(
+ 'constancy_alpha_to_coverage',
+ 'Test that coverage mask is constant at given coordinates with a given alpha or coverage value, using GL_SAMPLE_ALPHA_TO_COVERAGE',
+ es3fMultisampleTests.MaskConstancyCase.CaseType.ALPHA_TO_COVERAGE,
+ numFboSamples));
+ group.addChild(new es3fMultisampleTests.MaskConstancyCase(
+ 'constancy_sample_coverage',
+ 'Test that coverage mask is constant at given coordinates with a given alpha or coverage value, using GL_SAMPLE_COVERAGE',
+ es3fMultisampleTests.MaskConstancyCase.CaseType.SAMPLE_COVERAGE,
+ numFboSamples));
+ group.addChild(new es3fMultisampleTests.MaskConstancyCase(
+ 'constancy_sample_coverage_inverted',
+ 'Test that coverage mask is constant at given coordinates with a given alpha or coverage value, using inverted-mask GL_SAMPLE_COVERAGE',
+ es3fMultisampleTests.MaskConstancyCase.CaseType.SAMPLE_COVERAGE_INVERTED,
+ numFboSamples));
+ group.addChild(new es3fMultisampleTests.MaskConstancyCase(
+ 'constancy_both',
+ 'Test that coverage mask is constant at given coordinates with a given alpha or coverage value, using GL_SAMPLE_ALPHA_TO_COVERAGE and GL_SAMPLE_COVERAGE',
+ es3fMultisampleTests.MaskConstancyCase.CaseType.BOTH,
+ numFboSamples));
+ group.addChild(new es3fMultisampleTests.MaskConstancyCase(
+ 'constancy_both_inverted',
+ 'Test that coverage mask is constant at given coordinates with a given alpha or coverage value, using GL_SAMPLE_ALPHA_TO_COVERAGE and inverted-mask GL_SAMPLE_COVERAGE',
+ es3fMultisampleTests.MaskConstancyCase.CaseType.BOTH_INVERTED,
+ numFboSamples));
+ }
+ };
+
+ /**
+ * Run test
+ * @param {WebGL2RenderingContext} context
+ */
+ es3fMultisampleTests.run = function(context, range) {
+ gl = context;
+ //Set up Test Root parameters
+ var testName = 'multisample';
+ var testDescription = 'Multisample Tests';
+ var state = tcuTestCase.runner;
+
+ state.testName = testName;
+ state.setRoot(tcuTestCase.newTest(testName, testDescription, null));
+
+ //Set up name and description of this test series.
+ setCurrentTestName(testName);
+ description(testDescription);
+
+ try {
+ //Create test cases
+ es3fMultisampleTests.init();
+ if (range)
+ state.setRange(range);
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fMultisampleTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeBufferApiTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeBufferApiTests.js
new file mode 100644
index 0000000000..2a8910eb0d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeBufferApiTests.js
@@ -0,0 +1,1104 @@
+'use strict';
+goog.provide('functional.gles3.es3fNegativeBufferApiTests');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.opengl.gluStrUtil');
+goog.require('functional.gles3.es3fApiCase');
+
+goog.scope(function() {
+
+ var es3fNegativeBufferApiTests = functional.gles3.es3fNegativeBufferApiTests;
+ var es3fApiCase = functional.gles3.es3fApiCase;
+ var gluStrUtil = framework.opengl.gluStrUtil;
+ var tcuTestCase = framework.common.tcuTestCase;
+
+ /**
+ * @param {WebGL2RenderingContext} gl
+ */
+ es3fNegativeBufferApiTests.init = function(gl) {
+
+ var testGroup = tcuTestCase.runner.testCases;
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'bind_buffer', 'Invalid gl.bindBuffer() usage', gl,
+ function() {
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not one of the allowable values.');
+ gl.bindBuffer(-1, null);
+ this.expectError(gl.INVALID_ENUM);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'buffer_data', 'Invalid gl.bufferData() usage', gl,
+ function() {
+ var buffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER.');
+ gl.bufferData(-1, 0, gl.STREAM_DRAW);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if usage is not gl.STREAM_DRAW, gl.STATIC_DRAW, or gl.DYNAMIC_DRAW.');
+ gl.bufferData(gl.ARRAY_BUFFER, 0, -1);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if size is negative.');
+ gl.bufferData(gl.ARRAY_BUFFER, -1, gl.STREAM_DRAW);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if the reserved buffer object name 0 is bound to target.');
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+ gl.bufferData(gl.ARRAY_BUFFER, 0, gl.STREAM_DRAW);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.deleteBuffer(buffer);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'buffer_sub_data', 'Invalid gl.bufferSubData() usage', gl,
+ function() {
+ var buffer = gl.createBuffer();
+ var data = new ArrayBuffer(5);
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
+ gl.bufferData(gl.ARRAY_BUFFER, 10, gl.STREAM_DRAW);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER.');
+ gl.bufferSubData(-1, 1, data);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if the reserved buffer object name 0 is bound to target.');
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, data);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.deleteBuffer(buffer);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'buffer_sub_data_size_offset', 'Invalid gl.bufferSubData() usage', gl,
+ function() {
+ var buffer = gl.createBuffer();
+ var data = new ArrayBuffer(5);
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
+ gl.bufferData(gl.ARRAY_BUFFER, 10, gl.STREAM_DRAW);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if offset is negative');
+ gl.bufferSubData(gl.ARRAY_BUFFER, -1, data);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if the data would be written past the end of the buffer.');
+ gl.bufferSubData(gl.ARRAY_BUFFER, 7, data);
+ this.expectError(gl.INVALID_VALUE);
+ gl.bufferSubData(gl.ARRAY_BUFFER, 15, data);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('An exception is thrown if data is null.');
+ this.expectThrowNoError(function() {
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, null);
+ });
+
+ gl.deleteBuffer(buffer);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'clear', 'Invalid gl.clear() usage', gl,
+ function() {
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if any bit other than the three defined bits is set in mask.');
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+ this.expectError(gl.NO_ERROR);
+ gl.clear(0x0200);
+ this.expectError(gl.INVALID_VALUE);
+ gl.clear(0x1000);
+ this.expectError(gl.INVALID_VALUE);
+ gl.clear(0x0010);
+ this.expectError(gl.INVALID_VALUE);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'read_pixels', 'Invalid gl.readPixels() usage', gl,
+ function() {
+ var buffer = new ArrayBuffer(8);
+ var ubyteData = new Uint8Array(buffer);
+ var ushortData = new Uint16Array(buffer);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if the combination of format and type is unsupported.');
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_SHORT_4_4_4_4, ushortData);
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if the ArrayBuffer type does not match the type parameter.');
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, ushortData);
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if either width or height is negative.');
+ gl.readPixels(0, 0, -1, 1, gl.RGBA, gl.UNSIGNED_BYTE, ubyteData);
+ this.expectError(gl.INVALID_VALUE);
+ gl.readPixels(0, 0, 1, -1, gl.RGBA, gl.UNSIGNED_BYTE, ubyteData);
+ this.expectError(gl.INVALID_VALUE);
+ gl.readPixels(0, 0, -1, -1, gl.RGBA, gl.UNSIGNED_BYTE, ubyteData);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.');
+ var fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, ubyteData);
+ this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.deleteFramebuffer(fbo);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'read_pixels_format_mismatch', 'Invalid glReadPixels() usage', gl,
+ function() {
+ var buffer = new ArrayBuffer(8);
+ var ubyteData = new Uint8Array(buffer);
+ var ushortData = new Uint16Array(buffer);
+
+ bufferedLogToConsole('Unsupported combinations of format and type will generate a gl.INVALID_OPERATION error.');
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_SHORT_5_6_5, ushortData);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.readPixels(0, 0, 1, 1, gl.ALPHA, gl.UNSIGNED_SHORT_5_6_5, ushortData);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.readPixels(0, 0, 1, 1, gl.RGB, gl.UNSIGNED_SHORT_4_4_4_4, ushortData);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.readPixels(0, 0, 1, 1, gl.ALPHA, gl.UNSIGNED_SHORT_4_4_4_4, ushortData);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.readPixels(0, 0, 1, 1, gl.RGB, gl.UNSIGNED_SHORT_5_5_5_1, ushortData);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.readPixels(0, 0, 1, 1, gl.ALPHA, gl.UNSIGNED_SHORT_5_5_5_1, ushortData);
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.RGBA/gl.UNSIGNED_BYTE is always accepted and the other acceptable pair can be discovered by querying gl.IMPLEMENTATION_COLOR_READ_FORMAT and gl.IMPLEMENTATION_COLOR_READ_TYPE.');
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, ubyteData);
+ this.expectError(gl.NO_ERROR);
+ var readFormat = /** @type {number} */ (gl.getParameter(gl.IMPLEMENTATION_COLOR_READ_FORMAT));
+ var readType = /** @type {number} */ (gl.getParameter(gl.IMPLEMENTATION_COLOR_READ_TYPE));
+ gl.readPixels(0, 0, 1, 1, readFormat, readType, ubyteData);
+ this.expectError(gl.NO_ERROR);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'read_pixels_fbo_format_mismatch', 'Invalid gl.readPixels() usage', gl,
+ function() {
+ var ubyteData = new Uint8Array(4);
+ var floatData = new Float32Array(4);
+
+ var texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 32, 32, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+
+ var fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if currently bound framebuffer format is incompatible with format and type.');
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 32, 32, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
+ gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ this.expectError(gl.NO_ERROR);
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.FLOAT, floatData);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32I, 32, 32, 0, gl.RGBA_INTEGER, gl.INT, null);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
+ gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ this.expectError(gl.NO_ERROR);
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.FLOAT, floatData);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32UI, 32, 32, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT, null);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
+ gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ this.expectError(gl.NO_ERROR);
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.FLOAT, floatData);
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if gl.READ_FRAMEBUFFER_BINDING is non-zero, the read framebuffer is complete, and the value of gl.SAMPLE_BUFFERS for the read framebuffer is greater than zero.');
+
+ var rbo = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, rbo);
+ gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 4, gl.RGBA8, 32, 32);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo);
+
+ var binding = /** @type {WebGLFramebuffer} */ (gl.getParameter(gl.READ_FRAMEBUFFER_BINDING));
+ bufferedLogToConsole('gl.READ_FRAMEBUFFER_BINDING: ' + binding);
+ gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ var sampleBuffers = /** @type {number} */ (gl.getParameter(gl.SAMPLE_BUFFERS));
+ bufferedLogToConsole('gl.SAMPLE_BUFFERS: ' + sampleBuffers);
+ this.expectError(gl.NO_ERROR);
+
+ if (binding == null || sampleBuffers <= 0) {
+ this.testFailed('expected gl.READ_FRAMEBUFFER_BINDING to be non-zero and gl.SAMPLE_BUFFERS to be greater than zero');
+ } else {
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, ubyteData);
+ this.expectError(gl.INVALID_OPERATION);
+ }
+
+ gl.bindRenderbuffer(gl.RENDERBUFFER, null);
+ gl.deleteRenderbuffer(rbo);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.deleteFramebuffer(fbo);
+ gl.bindTexture(gl.TEXTURE_2D, null);
+ gl.deleteTexture(texture);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'bind_buffer_range', 'Invalid glBindBufferRange() usage', gl,
+ function() {
+ var bufEmpty = new ArrayBuffer(16);
+
+ var bufUniform = gl.createBuffer();
+ gl.bindBuffer(gl.UNIFORM_BUFFER, bufUniform);
+ gl.bufferData(gl.UNIFORM_BUFFER, bufEmpty, gl.STREAM_DRAW);
+
+ var bufTF = gl.createBuffer();
+ gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, bufTF);
+ gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, bufEmpty, gl.STREAM_DRAW);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not gl.TRANSFORM_FEEDBACK_BUFFER or gl.UNIFORM_BUFFER.');
+ gl.bindBufferRange(gl.ARRAY_BUFFER, 0, bufUniform, 0, 4);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if target is gl.TRANSFORM_FEEDBACK_BUFFER and index is greater than or equal to gl.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS.');
+ var maxTFSize = /** @type {number} */ (gl.getParameter(gl.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS));
+ gl.bindBufferRange(gl.TRANSFORM_FEEDBACK_BUFFER, maxTFSize, bufTF, 0, 4);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if target is gl.UNIFORM_BUFFER and index is greater than or equal to gl.MAX_UNIFORM_BUFFER_BINDINGS.');
+ var maxUSize = /** @type {number} */ (gl.getParameter(gl.MAX_UNIFORM_BUFFER_BINDINGS));
+ gl.bindBufferRange(gl.UNIFORM_BUFFER, maxUSize, bufUniform, 0, 4);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if size is less than or equal to zero.');
+ gl.bindBufferRange(gl.UNIFORM_BUFFER, 0, bufUniform, 0, -1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.bindBufferRange(gl.UNIFORM_BUFFER, 0, bufUniform, 0, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if target is gl.TRANSFORM_FEEDBACK_BUFFER and size or offset are not multiples of 4.');
+ gl.bindBufferRange(gl.TRANSFORM_FEEDBACK_BUFFER, 0, bufTF, 4, 5);
+ this.expectError(gl.INVALID_VALUE);
+ gl.bindBufferRange(gl.TRANSFORM_FEEDBACK_BUFFER, 0, bufTF, 5, 4);
+ this.expectError(gl.INVALID_VALUE);
+ gl.bindBufferRange(gl.TRANSFORM_FEEDBACK_BUFFER, 0, bufTF, 5, 7);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if target is gl.UNIFORM_BUFFER and offset is not a multiple of gl.UNIFORM_BUFFER_OFFSET_ALIGNMENT.');
+ var alignment = /** @type {number} */ (gl.getParameter(gl.UNIFORM_BUFFER_OFFSET_ALIGNMENT));
+ gl.bindBufferRange(gl.UNIFORM_BUFFER, 0, bufUniform, alignment + 1, 4);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteBuffer(bufUniform);
+ gl.deleteBuffer(bufTF);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'bind_buffer_base', 'Invalid glBindBufferBase() usage', gl,
+ function() {
+ var bufEmpty = new ArrayBuffer(16);
+
+ var bufUniform = gl.createBuffer();
+ gl.bindBuffer(gl.UNIFORM_BUFFER, bufUniform);
+ gl.bufferData(gl.UNIFORM_BUFFER, bufEmpty, gl.STREAM_DRAW);
+
+ var bufTF = gl.createBuffer();
+ gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, bufTF);
+ gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, bufEmpty, gl.STREAM_DRAW);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not gl.TRANSFORM_FEEDBACK_BUFFER or gl.UNIFORM_BUFFER.');
+ gl.bindBufferBase(-1, 0, bufUniform);
+ this.expectError(gl.INVALID_ENUM);
+ gl.bindBufferBase(gl.ARRAY_BUFFER, 0, bufUniform);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if target is gl.UNIFORM_BUFFER and index is greater than or equal to gl.MAX_UNIFORM_BUFFER_BINDINGS.');
+ var maxUSize = /** @type {number} */ (gl.getParameter(gl.MAX_UNIFORM_BUFFER_BINDINGS));
+ gl.bindBufferBase(gl.UNIFORM_BUFFER, maxUSize, bufUniform);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if target is gl.TRANSFORM_FEEDBACK_BUFFER andindex is greater than or equal to gl.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS.');
+ var maxTFSize = /** @type {number} */ (gl.getParameter(gl.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS));
+ gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, maxTFSize, bufTF);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteBuffer(bufUniform);
+ gl.deleteBuffer(bufTF);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'clear_bufferiv', 'Invalid gl.clearBufferiv() usage', gl,
+ function() {
+ var data = new Int32Array(32 * 32);
+
+ var texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32I, 32, 32, 0, gl.RGBA_INTEGER, gl.INT, null);
+
+ var fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
+ gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if buffer is not an accepted value.');
+ gl.clearBufferiv(-1, 0, data);
+ this.expectError(gl.INVALID_ENUM);
+ gl.clearBufferiv(gl.FRAMEBUFFER, 0, data);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if buffer is gl.COLOR, gl.FRONT, gl.BACK, gl.LEFT, gl.RIGHT, or gl.FRONT_AND_BACK and drawBuffer is greater than or equal to gl.MAX_DRAW_BUFFERS.');
+ var maxDrawBuffers = /** @type {number} */ (gl.getParameter(gl.MAX_DRAW_BUFFERS));
+ gl.clearBufferiv(gl.COLOR, maxDrawBuffers, data);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if buffer is gl.DEPTH or gl.DEPTH_STENCIL.');
+ gl.clearBufferiv(gl.DEPTH, 1, data);
+ this.expectError(gl.INVALID_ENUM);
+ gl.clearBufferiv(gl.DEPTH_STENCIL, 1, data);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if buffer is gl.STENCIL and drawBuffer is not zero.');
+ gl.clearBufferiv(gl.STENCIL, 1, data);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteFramebuffer(fbo);
+ gl.deleteTexture(texture);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'clear_bufferuiv', 'Invalid gl.clearBufferuiv() usage', gl,
+ function() {
+ var data = new Uint32Array(32 * 32);
+
+ var texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32UI, 32, 32, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT, null);
+
+ var fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
+ gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if buffer is not an accepted value.');
+ gl.clearBufferuiv(-1, 0, data);
+ this.expectError(gl.INVALID_ENUM);
+ gl.clearBufferuiv(gl.FRAMEBUFFER, 0, data);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if buffer is gl.COLOR, gl.FRONT, gl.BACK, gl.LEFT, gl.RIGHT, or gl.FRONT_AND_BACK and drawBuffer is greater than or equal to gl.MAX_DRAW_BUFFERS.');
+ var maxDrawBuffers = /** @type {number} */ (gl.getParameter(gl.MAX_DRAW_BUFFERS));
+ gl.clearBufferuiv(gl.COLOR, maxDrawBuffers, data);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if buffer is gl.DEPTH, gl.STENCIL or gl.DEPTH_STENCIL.');
+ gl.clearBufferuiv(gl.DEPTH, 1, data);
+ this.expectError(gl.INVALID_ENUM);
+ gl.clearBufferuiv(gl.STENCIL, 1, data);
+ this.expectError(gl.INVALID_ENUM);
+ gl.clearBufferuiv(gl.DEPTH_STENCIL, 1, data);
+ this.expectError(gl.INVALID_ENUM);
+
+ gl.deleteFramebuffer(fbo);
+ gl.deleteTexture(texture);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'clear_bufferfv', 'Invalid gl.clearBufferfv() usage', gl,
+ function() {
+ var data = new Float32Array(32 * 32);
+
+ var texture = gl.createTexture();
+ // Float type texture isn't color-renderable without EXT_color_buffer_float extension.
+ if (gl.getExtension('EXT_color_buffer_float')) {
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32F, 32, 32, 0, gl.RGBA, gl.FLOAT, null);
+
+ var fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
+ gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if buffer is not an accepted value.');
+ gl.clearBufferfv(-1, 0, data);
+ this.expectError(gl.INVALID_ENUM);
+ gl.clearBufferfv(gl.FRAMEBUFFER, 0, data);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if buffer is gl.COLOR, gl.FRONT, gl.BACK, gl.LEFT, gl.RIGHT, or gl.FRONT_AND_BACK and drawBuffer is greater than or equal to gl.MAX_DRAW_BUFFERS.');
+ var maxDrawBuffers = /** @type {number} */ (gl.getParameter(gl.MAX_DRAW_BUFFERS));
+ gl.clearBufferfv(gl.COLOR, maxDrawBuffers, data);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if buffer is gl.STENCIL or gl.DEPTH_STENCIL.');
+ gl.clearBufferfv(gl.STENCIL, 1, data);
+ this.expectError(gl.INVALID_ENUM);
+ gl.clearBufferfv(gl.DEPTH_STENCIL, 1, data);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if buffer is gl.DEPTH and drawBuffer is not zero.');
+ gl.clearBufferfv(gl.DEPTH, 1, data);
+ this.expectError(gl.INVALID_VALUE);
+ }
+
+ gl.deleteFramebuffer(fbo);
+ gl.deleteTexture(texture);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'clear_bufferfi', 'Invalid gl.clearBufferfi() usage', gl,
+ function() {
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if buffer is not an accepted value.');
+ gl.clearBufferfi(-1, 0, 1.0, 1);
+ this.expectError(gl.INVALID_ENUM);
+ gl.clearBufferfi(gl.FRAMEBUFFER, 0, 1.0, 1);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if buffer is not gl.DEPTH_STENCIL.');
+ gl.clearBufferfi(gl.DEPTH, 0, 1.0, 1);
+ this.expectError(gl.INVALID_ENUM);
+ gl.clearBufferfi(gl.STENCIL, 0, 1.0, 1);
+ this.expectError(gl.INVALID_ENUM);
+ gl.clearBufferfi(gl.COLOR, 0, 1.0, 1);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if buffer is gl.DEPTH_STENCIL and drawBuffer is not zero.');
+ gl.clearBufferfi(gl.DEPTH_STENCIL, 1, 1.0, 1);
+ this.expectError(gl.INVALID_VALUE);
+
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'copy_buffer_sub_data', 'Invalid gl.copyBufferSubData() usage', gl,
+ function() {
+ var buf = {
+ r: gl.createBuffer(),
+ w: gl.createBuffer()
+ };
+
+ gl.bindBuffer(gl.COPY_READ_BUFFER, buf.r);
+ gl.bufferData(gl.COPY_READ_BUFFER, 32, gl.DYNAMIC_COPY);
+ gl.bindBuffer(gl.COPY_WRITE_BUFFER, buf.w);
+ gl.bufferData(gl.COPY_WRITE_BUFFER, 32, gl.DYNAMIC_COPY);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if any of readoffset, writeoffset or size is negative.');
+ gl.copyBufferSubData(gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, 0, 0, -4);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyBufferSubData(gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, -1, 0, 4);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyBufferSubData(gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, 0, -1, 4);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if readoffset + size exceeds the size of the buffer object bound to readtarget.');
+ gl.copyBufferSubData(gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, 0, 0, 36);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyBufferSubData(gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, 24, 0, 16);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyBufferSubData(gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, 36, 0, 4);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if writeoffset + size exceeds the size of the buffer object bound to writetarget.');
+ gl.copyBufferSubData(gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, 0, 0, 36);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyBufferSubData(gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, 0, 24, 16);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyBufferSubData(gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, 0, 36, 4);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if the same buffer object is bound to both readtarget and writetarget and the ranges [readoffset, readoffset + size) and [writeoffset, writeoffset + size) overlap.');
+ gl.bindBuffer(gl.COPY_WRITE_BUFFER, buf.r);
+ gl.copyBufferSubData(gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, 0, 16, 4);
+ this.expectError(gl.NO_ERROR);
+ gl.copyBufferSubData(gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, 0, 0, 4);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyBufferSubData(gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, 0, 16, 18);
+ this.expectError(gl.INVALID_VALUE);
+ gl.bindBuffer(gl.COPY_WRITE_BUFFER, buf.w);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if null is bound to readtarget or writetarget.');
+ gl.bindBuffer(gl.COPY_READ_BUFFER, null);
+ gl.copyBufferSubData(gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, 0, 0, 16);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.bindBuffer(gl.COPY_READ_BUFFER, buf.r);
+
+ gl.bindBuffer(gl.COPY_WRITE_BUFFER, null);
+ gl.copyBufferSubData(gl.COPY_READ_BUFFER, gl.COPY_WRITE_BUFFER, 0, 0, 16);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.bindBuffer(gl.COPY_WRITE_BUFFER, buf.w);
+
+ gl.deleteBuffer(buf.w);
+ gl.deleteBuffer(buf.r);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'draw_buffers', 'Invalid glDrawBuffers() usage', gl,
+ function() {
+ var maxDrawBuffers = /** @type {number} */ (gl.getParameter(gl.MAX_DRAW_BUFFERS));
+ var values = [
+ gl.NONE,
+ gl.BACK,
+ gl.COLOR_ATTACHMENT0,
+ gl.DEPTH_ATTACHMENT
+ ];
+
+ var texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, 32, 32, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+
+ var fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
+ gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if one of the values in bufs is not an accepted value.');
+ gl.drawBuffers(values.slice(2, 4));
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if the GL is bound to the default framebuffer and the number of queried buffers is not 1.');
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.drawBuffers(values.slice(0, 2));
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if the GL is bound to the default framebuffer and the value in bufs is one of the gl.COLOR_ATTACHMENTn tokens.');
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.drawBuffers(values.slice(2, 3));
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if the GL is bound to a framebuffer object and the ith buffer listed in bufs is anything other than gl.NONE or gl.COLOR_ATTACHMENTSi.');
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.drawBuffers(values.slice(1, 2));
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.deleteTexture(texture);
+ gl.deleteFramebuffer(fbo);
+ }
+ ));
+
+ // Framebuffer Objects
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'bind_framebuffer', 'Invalid glBindFramebuffer() usage', gl,
+ function() {
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not gl.FRAMEBUFFER.');
+ gl.bindFramebuffer(-1, null);
+ this.expectError(gl.INVALID_ENUM);
+ gl.bindFramebuffer(gl.RENDERBUFFER, null);
+ this.expectError(gl.INVALID_ENUM);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'bind_renderbuffer', 'Invalid glBindRenderbuffer() usage', gl,
+ function() {
+ bufferedLogToConsole('glINVALID_ENUM is generated if target is not gl.RENDERBUFFER.');
+ gl.bindRenderbuffer(-1, null);
+ this.expectError(gl.INVALID_ENUM);
+ gl.bindRenderbuffer(gl.FRAMEBUFFER, null);
+ this.expectError(gl.INVALID_ENUM);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'check_framebuffer_status', 'Invalid glCheckFramebufferStatus() usage', gl,
+ function() {
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not gl.FRAMEBUFFER.');
+ gl.checkFramebufferStatus(-1);
+ this.expectError(gl.INVALID_ENUM);
+ gl.checkFramebufferStatus(gl.RENDERBUFFER);
+ this.expectError(gl.INVALID_ENUM);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'framebuffer_renderbuffer', 'Invalid glFramebufferRenderbuffer() usage', gl,
+ function() {
+ var rbo = gl.createRenderbuffer();
+ var fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not one of the accepted tokens.');
+ gl.framebufferRenderbuffer(-1, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, null);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if renderbuffertarget is not gl.RENDERBUFFER.');
+ gl.bindRenderbuffer(gl.RENDERBUFFER, rbo);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, -1, rbo);
+ this.expectError(gl.INVALID_ENUM);
+ gl.bindRenderbuffer(gl.RENDERBUFFER, null);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if zero is bound to target.');
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, null);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.deleteRenderbuffer(rbo);
+ gl.deleteFramebuffer(fbo);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'framebuffer_texture2d', 'Invalid glFramebufferTexture2D() usage', gl,
+ function() {
+
+ var fbo = gl.createFramebuffer();
+ var tex2D = gl.createTexture();
+ var texCube = gl.createTexture();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.bindTexture(gl.TEXTURE_2D, tex2D);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texCube);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not one of the accepted tokens.');
+ gl.framebufferTexture2D(-1, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, null, 0);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if textarget is not an accepted texture target.');
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, -1, tex2D, 0);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0 or larger than log_2 of maximum texture size.');
+ var maxTexSize = /** @type {number} */ (gl.getParameter(gl.MAX_TEXTURE_SIZE));
+ var maxCubeTexSize = /** @type {number} */ (gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE));
+ var maxSizePlane = Math.floor(Math.log2(maxTexSize)) + 1;
+ var maxSizeCube = Math.floor(Math.log2(maxCubeTexSize)) + 1;
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex2D, -1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex2D, maxSizePlane);
+ this.expectError(gl.INVALID_VALUE);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_CUBE_MAP_POSITIVE_X, texCube, maxSizeCube);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if textarget and texture are not compatible.');
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_CUBE_MAP_POSITIVE_X, tex2D, 0);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.deleteTexture(tex2D);
+
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texCube, 0);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.deleteTexture(texCube);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if zero is bound to target.');
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, null, 0);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.deleteFramebuffer(fbo);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'renderbuffer_storage', 'Invalid glRenderbufferStorage() usage', gl,
+ function() {
+ var rbo = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, rbo);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not gl.RENDERBUFFER.');
+ gl.renderbufferStorage(-1, gl.RGBA4, 1, 1);
+ this.expectError(gl.INVALID_ENUM);
+ gl.renderbufferStorage(gl.FRAMEBUFFER, gl.RGBA4, 1, 1);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if internalformat is not a color-renderable, depth-renderable, or stencil-renderable format.');
+ gl.renderbufferStorage(gl.RENDERBUFFER, -1, 1, 1);
+ this.expectError(gl.INVALID_ENUM);
+
+ // EXT_color_buffer_half_float disables error
+ if (gl.getExtension('EXT_color_buffer_half_float') === null) {
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGB16F, 1, 1);
+ this.expectError(gl.INVALID_ENUM);
+ }
+
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA8_SNORM, 1, 1);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height is less than zero.');
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, -1, 1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 1, -1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, -1, -1);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height is greater than gl.MAX_RENDERBUFFER_SIZE.');
+ var maxSize = /** @type {number} */ (gl.getParameter(gl.MAX_RENDERBUFFER_SIZE));
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 1, maxSize + 1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, maxSize + 1, 1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, maxSize + 1, maxSize + 1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.deleteRenderbuffer(rbo);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'blit_framebuffer', 'Invalid glBlitFramebuffer() usage', gl,
+ function() {
+
+ /** @type {Array<WebGLTexture>} */
+ var texture = [
+ gl.createTexture(), gl.createTexture()
+ ];
+ gl.bindTexture(gl.TEXTURE_2D, texture[0]);
+
+ /** @type {Array<WebGLRenderbuffer>} */
+ var rbo = [
+ gl.createRenderbuffer(), gl.createRenderbuffer()
+ ];
+ gl.bindRenderbuffer(gl.RENDERBUFFER, rbo[0]);
+
+ /** @type {Array<WebGLFramebuffer>} */
+ var fbo = [
+ gl.createFramebuffer(), gl.createFramebuffer()
+ ];
+ gl.bindFramebuffer(gl.READ_FRAMEBUFFER, fbo[0]);
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, 32, 32, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH24_STENCIL8, 32, 32);
+ gl.framebufferTexture2D(gl.READ_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture[0], 0);
+ gl.framebufferRenderbuffer(gl.READ_FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, rbo[0]);
+ gl.checkFramebufferStatus(gl.READ_FRAMEBUFFER);
+ gl.bindTexture(gl.TEXTURE_2D, texture[1]);
+ gl.bindRenderbuffer(gl.RENDERBUFFER, rbo[1]);
+ gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, fbo[1]);
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, 32, 32, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH24_STENCIL8, 32, 32);
+ gl.framebufferTexture2D(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture[1], 0);
+ gl.framebufferRenderbuffer(gl.DRAW_FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, rbo[1]);
+ gl.checkFramebufferStatus(gl.DRAW_FRAMEBUFFER);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if mask contains any of the gl.DEPTH_BUFFER_BIT or gl.STENCIL_BUFFER_BIT and filter is not gl.NEAREST.');
+ gl.blitFramebuffer(0, 0, 16, 16, 0, 0, 16, 16, gl.COLOR_BUFFER_BIT | gl.STENCIL_BUFFER_BIT, gl.LINEAR);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.blitFramebuffer(0, 0, 16, 16, 0, 0, 16, 16, gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT, gl.LINEAR);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.blitFramebuffer(0, 0, 16, 16, 0, 0, 16, 16, gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT, gl.LINEAR);
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if mask contains gl.COLOR_BUFFER_BIT and read buffer format is incompatible with draw buffer format.');
+ gl.bindTexture(gl.TEXTURE_2D, texture[0]);
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32UI, 32, 32, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT, null);
+ gl.framebufferTexture2D(gl.READ_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture[0], 0);
+ bufferedLogToConsole('// Read buffer: gl.RGBA32UI, draw buffer: gl.RGBA');
+ gl.blitFramebuffer(0, 0, 16, 16, 0, 0, 16, 16, gl.COLOR_BUFFER_BIT, gl.NEAREST);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32I, 32, 32, 0, gl.RGBA_INTEGER, gl.INT, null);
+ gl.framebufferTexture2D(gl.READ_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture[0], 0);
+ bufferedLogToConsole('// Read buffer: gl.RGBA32I, draw buffer: gl.RGBA');
+ gl.blitFramebuffer(0, 0, 16, 16, 0, 0, 16, 16, gl.COLOR_BUFFER_BIT, gl.NEAREST);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, 32, 32, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.framebufferTexture2D(gl.READ_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture[0], 0);
+ gl.bindTexture(gl.TEXTURE_2D, texture[1]);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32I, 32, 32, 0, gl.RGBA_INTEGER, gl.INT, null);
+ gl.framebufferTexture2D(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture[1], 0);
+ bufferedLogToConsole('// Read buffer: gl.RGBA8, draw buffer: gl.RGBA32I');
+ gl.blitFramebuffer(0, 0, 16, 16, 0, 0, 16, 16, gl.COLOR_BUFFER_BIT, gl.NEAREST);
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if filter is gl.LINEAR and the read buffer contains integer data.');
+ gl.bindTexture(gl.TEXTURE_2D, texture[0]);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32UI, 32, 32, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT, null);
+ gl.framebufferTexture2D(gl.READ_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture[0], 0);
+ gl.bindTexture(gl.TEXTURE_2D, texture[1]);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32UI, 32, 32, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT, null);
+ gl.framebufferTexture2D(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture[1], 0);
+ bufferedLogToConsole('// Read buffer: gl.RGBA32UI, filter: gl.LINEAR');
+ gl.blitFramebuffer(0, 0, 16, 16, 0, 0, 16, 16, gl.COLOR_BUFFER_BIT, gl.LINEAR);
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if mask contains gl.DEPTH_BUFFER_BIT or gl.STENCIL_BUFFER_BIT and the source and destination depth and stencil formats do not match.');
+ gl.bindRenderbuffer(gl.RENDERBUFFER, rbo[0]);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH32F_STENCIL8, 32, 32);
+ gl.framebufferRenderbuffer(gl.READ_FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, rbo[0]);
+ gl.blitFramebuffer(0, 0, 16, 16, 0, 0, 16, 16, gl.DEPTH_BUFFER_BIT, gl.NEAREST);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.blitFramebuffer(0, 0, 16, 16, 0, 0, 16, 16, gl.STENCIL_BUFFER_BIT, gl.NEAREST);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.deleteFramebuffer(fbo[1]);
+ gl.deleteFramebuffer(fbo[0]);
+ gl.deleteTexture(texture[1]);
+ gl.deleteTexture(texture[0]);
+ gl.deleteRenderbuffer(rbo[1]);
+ gl.deleteRenderbuffer(rbo[0]);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'blit_framebuffer_multisample', 'Invalid glBlitFramebuffer() usage', gl,
+ function() {
+
+ /** @type {Array<WebGLRenderbuffer>} */
+ var rbo = [
+ gl.createRenderbuffer(), gl.createRenderbuffer()
+ ];
+ /** @type {Array<WebGLFramebuffer>} */
+ var fbo = [
+ gl.createFramebuffer(), gl.createFramebuffer()
+ ];
+
+ gl.bindRenderbuffer(gl.RENDERBUFFER, rbo[0]);
+ gl.bindFramebuffer(gl.READ_FRAMEBUFFER, fbo[0]);
+ gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 4, gl.RGBA8, 32, 32);
+ gl.framebufferRenderbuffer(gl.READ_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo[0]);
+ gl.checkFramebufferStatus(gl.READ_FRAMEBUFFER);
+
+ gl.bindRenderbuffer(gl.RENDERBUFFER, rbo[1]);
+ gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, fbo[1]);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if the value of gl.SAMPLE_BUFFERS for the draw buffer is greater than zero.');
+ gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 4, gl.RGBA8, 32, 32);
+ gl.framebufferRenderbuffer(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo[1]);
+ gl.blitFramebuffer(0, 0, 16, 16, 0, 0, 16, 16, gl.COLOR_BUFFER_BIT, gl.NEAREST);
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if gl.SAMPLE_BUFFERS for the read buffer is greater than zero and the formats of draw and read buffers are not identical.');
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 32, 32);
+ gl.framebufferRenderbuffer(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo[1]);
+ gl.blitFramebuffer(0, 0, 16, 16, 0, 0, 16, 16, gl.COLOR_BUFFER_BIT, gl.NEAREST);
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if gl.SAMPLE_BUFFERS for the read buffer is greater than zero and the source and destination rectangles are not defined with the same (X0, Y0) and (X1, Y1) bounds.');
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA8, 32, 32);
+ gl.framebufferRenderbuffer(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo[1]);
+ gl.blitFramebuffer(0, 0, 16, 16, 2, 2, 18, 18, gl.COLOR_BUFFER_BIT, gl.NEAREST);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.deleteRenderbuffer(rbo[0]);
+ gl.deleteRenderbuffer(rbo[1]);
+ gl.deleteFramebuffer(fbo[0]);
+ gl.deleteFramebuffer(fbo[1]);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'framebuffer_texture_layer', 'Invalid glFramebufferTextureLayer() usage', gl,
+ function() {
+
+ var fbo = gl.createFramebuffer();
+ var tex3D = gl.createTexture();
+ var tex2DArray = gl.createTexture();
+ var tex2D = gl.createTexture();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+
+ gl.bindTexture(gl.TEXTURE_3D, tex3D);
+ gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.bindTexture(gl.TEXTURE_2D_ARRAY, tex2DArray);
+ gl.texImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.bindTexture(gl.TEXTURE_2D, tex2D);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not one of the accepted tokens.');
+ gl.framebufferTextureLayer(-1, gl.COLOR_ATTACHMENT0, tex3D, 0, 1);
+ this.expectError(gl.INVALID_ENUM);
+ gl.framebufferTextureLayer(gl.RENDERBUFFER, gl.COLOR_ATTACHMENT0, tex3D, 0, 1);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if attachment is not one of the accepted tokens.');
+ gl.framebufferTextureLayer(gl.FRAMEBUFFER, -1, tex3D, 0, 1);
+ this.expectError(gl.INVALID_ENUM);
+ gl.framebufferTextureLayer(gl.FRAMEBUFFER, gl.BACK, tex3D, 0, 1);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if texture is non-zero and not the name of a 3D texture or 2D array texture.');
+ gl.framebufferTextureLayer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, tex2D, 0, 0);
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if texture is not zero and layer is negative.');
+ gl.framebufferTextureLayer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, tex3D, 0, -1);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if texture is not zero and layer is greater than gl.MAX_3D_TEXTURE_SIZE-1 for a 3D texture.');
+ var max3DTexSize = /** @type {number} */ (gl.getParameter(gl.MAX_3D_TEXTURE_SIZE));
+ gl.framebufferTextureLayer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, tex3D, 0, max3DTexSize);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if texture is not zero and layer is greater than gl.MAX_ARRAY_TEXTURE_LAYERS-1 for a 2D array texture.');
+ var maxArrayTexLayers = /** @type {number} */ (gl.getParameter(gl.MAX_ARRAY_TEXTURE_LAYERS));
+ gl.framebufferTextureLayer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, tex2DArray, 0, maxArrayTexLayers);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if zero is bound to target.');
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.framebufferTextureLayer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, tex3D, 0, 1);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.deleteTexture(tex3D);
+ gl.deleteTexture(tex2DArray);
+ gl.deleteTexture(tex2D);
+ gl.deleteFramebuffer(fbo);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'invalidate_framebuffer', 'Invalid gl.invalidateFramebuffer() usage', gl,
+ function() {
+ var maxColorAttachments = /** @type {number} */ (gl.getParameter(gl.MAX_COLOR_ATTACHMENTS));
+ var attachments = [
+ gl.COLOR_ATTACHMENT0
+ ];
+
+ var fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+
+ var texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 32, 32, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
+ gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not gl.FRAMEBUFFER, gl.READ_FRAMEBUFFER or gl.DRAW_FRAMEBUFFER.');
+ gl.invalidateFramebuffer(-1, attachments);
+ this.expectError(gl.INVALID_ENUM);
+ gl.invalidateFramebuffer(gl.BACK, attachments);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if attachments contains gl.COLOR_ATTACHMENTm and m is greater than or equal to the value of gl.MAX_COLOR_ATTACHMENTS.');
+ gl.invalidateFramebuffer(gl.FRAMEBUFFER, [gl.COLOR_ATTACHMENT0 + maxColorAttachments]);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.deleteTexture(texture);
+ gl.deleteFramebuffer(fbo);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'invalidate_sub_framebuffer', 'Invalid gl.invalidateSubFramebuffer() usage', gl,
+ function() {
+ var fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+
+ var texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 32, 32, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
+ gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ this.expectError(gl.NO_ERROR);
+
+ var maxColorAttachments = /** @type {number} */ (gl.getParameter(gl.MAX_COLOR_ATTACHMENTS));
+ var att0 = [gl.COLOR_ATTACHMENT0];
+ var attm = [gl.COLOR_ATTACHMENT0 + maxColorAttachments];
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not gl.FRAMEBUFFER, gl.READ_FRAMEBUFFER or gl.DRAW_FRAMEBUFFER.');
+ gl.invalidateSubFramebuffer(-1, att0, 0, 0, 16, 16);
+ this.expectError(gl.INVALID_ENUM);
+ gl.invalidateSubFramebuffer(gl.BACK, att0, 0, 0, 16, 16);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if attachments contains gl.COLOR_ATTACHMENTm and m is greater than or equal to the value of gl.MAX_COLOR_ATTACHMENTS.');
+ gl.invalidateSubFramebuffer(gl.FRAMEBUFFER, attm, 0, 0, 16, 16);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.deleteFramebuffer(fbo);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'renderbuffer_storage_multisample', 'Invalid glRenderbufferStorageMultisample() usage', gl,
+ function() {
+
+ var rbo = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, rbo);
+ /** @type {Int32Array} */ var samplesSupportedRGBA4 = /** @type {Int32Array} */ gl.getInternalformatParameter(gl.RENDERBUFFER, gl.RGBA4, gl.SAMPLES);
+ // supported samples are written in descending numeric order, so the first one is the max samples
+ var maxSamplesSupportedRGBA4 = samplesSupportedRGBA4[0];
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not gl.RENDERBUFFER.');
+ gl.renderbufferStorageMultisample(-1, 2, gl.RGBA4, 1, 1);
+ this.expectError(gl.INVALID_ENUM);
+ gl.renderbufferStorageMultisample(gl.FRAMEBUFFER, 2, gl.RGBA4, 1, 1);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if samples is greater than the maximum number of samples supported for internalformat.');
+ gl.renderbufferStorageMultisample(gl.RENDERBUFFER, maxSamplesSupportedRGBA4 + 1, gl.RGBA4, 1, 1);
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if internalformat is not a color-renderable, depth-renderable, or stencil-renderable format.');
+ gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 2, -1, 1, 1);
+ this.expectError(gl.INVALID_ENUM);
+
+ // EXT_color_buffer_half_float disables error
+ if (gl.getExtension('EXT_color_buffer_half_float') === null) {
+ gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 2, gl.RGB16F, 1, 1);
+ this.expectError(gl.INVALID_ENUM);
+ }
+ gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 2, gl.RGBA8_SNORM, 1, 1);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height is less than zero.');
+ gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 2, gl.RGBA4, -1, 1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 2, gl.RGBA4, 1, -1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 2, gl.RGBA4, -1, -1);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height is greater than gl.MAX_RENDERBUFFER_SIZE.');
+ var maxSize = /** @type {number} */ (gl.getParameter(gl.MAX_RENDERBUFFER_SIZE));
+ gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 4, gl.RGBA4, 1, maxSize + 1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 4, gl.RGBA4, maxSize + 1, 1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 4, gl.RGBA4, maxSize + 1, maxSize + 1);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteRenderbuffer(rbo);
+ }
+ ));
+
+ };
+
+ /**
+ * @param {WebGL2RenderingContext} gl
+ */
+ es3fNegativeBufferApiTests.run = function(gl) {
+ var testName = 'negativeBufferApi';
+ var testDescription = 'Negative Buffer API tests';
+ var state = tcuTestCase.runner;
+
+ state.testName = testName;
+ state.testCases = tcuTestCase.newTest(testName, testDescription, null);
+
+ //Set up name and description of this test series.
+ setCurrentTestName(testName);
+ description(testDescription);
+ try {
+ es3fNegativeBufferApiTests.init(gl);
+ tcuTestCase.runner.runCallback(tcuTestCase.runTestCases);
+ } catch (err) {
+ bufferedLogToConsole(err);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeFragmentApiTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeFragmentApiTests.js
new file mode 100644
index 0000000000..c3675d436f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeFragmentApiTests.js
@@ -0,0 +1,339 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES 3.0 Module
+ * -------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief Negative Fragment Pipe API tests.
+ *//*--------------------------------------------------------------------*/
+'use strict';
+goog.provide('functional.gles3.es3fNegativeFragmentApiTests');
+goog.require('framework.common.tcuTestCase');
+goog.require('functional.gles3.es3fApiCase');
+
+goog.scope(function() {
+
+ var es3fNegativeFragmentApiTests = functional.gles3.es3fNegativeFragmentApiTests;
+ var es3fApiCase = functional.gles3.es3fApiCase;
+ var tcuTestCase = framework.common.tcuTestCase;
+
+ /**
+ * @param {WebGL2RenderingContext} gl
+ */
+ es3fNegativeFragmentApiTests.init = function(gl) {
+
+ var testGroup = tcuTestCase.runner.testCases;
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('scissor', 'Invalid gl.scissor() usage', gl, function() {
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if either width or height is negative.');
+ gl.scissor(0, 0, -1, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.scissor(0, 0, 0, -1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.scissor(0, 0, -1, -1);
+ this.expectError(gl.INVALID_VALUE);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('depth_func', 'Invalid gl.depthFunc() usage', gl, function() {
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if func is not an accepted value.');
+ gl.depthFunc(-1);
+ this.expectError(gl.INVALID_ENUM);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('viewport', 'Invalid gl.viewport() usage', gl, function() {
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if either width or height is negative.');
+ gl.viewport(0, 0, -1, 1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.viewport(0, 0, 1, -1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.viewport(0, 0, -1, -1);
+ this.expectError(gl.INVALID_VALUE);
+
+ }));
+
+ // Stencil functions
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('stencil_func', 'Invalid gl.stencilFunc() usage', gl, function() {
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if func is not one of the eight accepted values.');
+ gl.stencilFunc(-1, 0, 1);
+ this.expectError(gl.INVALID_ENUM);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('stencil_func_separate', 'Invalid gl.stencilFuncSeparate() usage', gl, function() {
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if face is not gl.FRONT, gl.BACK, or gl.FRONT_AND_BACK.');
+ gl.stencilFuncSeparate(-1, gl.NEVER, 0, 1);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if func is not one of the eight accepted values.');
+ gl.stencilFuncSeparate(gl.FRONT, -1, 0, 1);
+ this.expectError(gl.INVALID_ENUM);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('stencil_op', 'Invalid gl.stencilOp() usage', gl, function() {
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if sfail, dpfail, or dppass is any value other than the defined symbolic constant values.');
+ gl.stencilOp(-1, gl.ZERO, gl.REPLACE);
+ this.expectError(gl.INVALID_ENUM);
+ gl.stencilOp(gl.KEEP, -1, gl.REPLACE);
+ this.expectError(gl.INVALID_ENUM);
+ gl.stencilOp(gl.KEEP, gl.ZERO, -1);
+ this.expectError(gl.INVALID_ENUM);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('stencil_op_separate', 'Invalid gl.stencilOpSeparate() usage', gl, function() {
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if face is any value other than gl.FRONT, gl.BACK, or gl.FRONT_AND_BACK.');
+ gl.stencilOpSeparate(-1, gl.KEEP, gl.ZERO, gl.REPLACE);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if sfail, dpfail, or dppass is any value other than the eight defined symbolic constant values.');
+ gl.stencilOpSeparate(gl.FRONT, -1, gl.ZERO, gl.REPLACE);
+ this.expectError(gl.INVALID_ENUM);
+ gl.stencilOpSeparate(gl.FRONT, gl.KEEP, -1, gl.REPLACE);
+ this.expectError(gl.INVALID_ENUM);
+ gl.stencilOpSeparate(gl.FRONT, gl.KEEP, gl.ZERO, -1);
+ this.expectError(gl.INVALID_ENUM);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('stencil_mask_separate', 'Invalid gl.stencilMaskSeparate() usage', gl, function() {
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if face is not gl.FRONT, gl.BACK, or gl.FRONT_AND_BACK.');
+ gl.stencilMaskSeparate(-1, 0);
+ this.expectError(gl.INVALID_ENUM);
+
+ }));
+
+ // Blend functions
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('blend_equation', 'Invalid gl.blendEquation() usage', gl, function() {
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if mode is not gl.FUNC_ADD, gl.FUNC_SUBTRACT, gl.FUNC_REVERSE_SUBTRACT, gl.MAX or gl.MIN.');
+ gl.blendEquation(-1);
+ this.expectError(gl.INVALID_ENUM);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('blend_equation_separate', 'Invalid gl.blendEquationSeparate() usage', gl, function() {
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if modeRGB is not gl.FUNC_ADD, gl.FUNC_SUBTRACT, gl.FUNC_REVERSE_SUBTRACT, gl.MAX or gl.MIN.');
+ gl.blendEquationSeparate(-1, gl.FUNC_ADD);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if modeAlpha is not gl.FUNC_ADD, gl.FUNC_SUBTRACT, gl.FUNC_REVERSE_SUBTRACT, gl.MAX or gl.MIN.');
+ gl.blendEquationSeparate(gl.FUNC_ADD, -1);
+ this.expectError(gl.INVALID_ENUM);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('blend_func', 'Invalid gl.blendFunc() usage', gl, function() {
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if either sfactor or dfactor is not an accepted value.');
+ gl.blendFunc(-1, gl.ONE);
+ this.expectError(gl.INVALID_ENUM);
+ gl.blendFunc(gl.ONE, -1);
+ this.expectError(gl.INVALID_ENUM);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('blend_func_separate', 'Invalid gl.blendFuncSeparate() usage', gl, function() {
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if srcRGB, dstRGB, srcAlpha, or dstAlpha is not an accepted value.');
+ gl.blendFuncSeparate(-1, gl.ONE, gl.SRC_COLOR, gl.ONE_MINUS_SRC_COLOR);
+ this.expectError(gl.INVALID_ENUM);
+ gl.blendFuncSeparate(gl.ZERO, -1, gl.SRC_COLOR, gl.ONE_MINUS_SRC_COLOR);
+ this.expectError(gl.INVALID_ENUM);
+ gl.blendFuncSeparate(gl.ZERO, gl.ONE, -1, gl.ONE_MINUS_SRC_COLOR);
+ this.expectError(gl.INVALID_ENUM);
+ gl.blendFuncSeparate(gl.ZERO, gl.ONE, gl.SRC_COLOR, -1);
+ this.expectError(gl.INVALID_ENUM);
+
+ }));
+
+ // Rasterization API functions
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('cull_face', 'Invalid gl.cullFace() usage', gl, function() {
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if mode is not an accepted value.');
+ gl.cullFace(-1);
+ this.expectError(gl.INVALID_ENUM);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('front_face', 'Invalid gl.frontFace() usage', gl, function() {
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if mode is not an accepted value.');
+ gl.frontFace(-1);
+ this.expectError(gl.INVALID_ENUM);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('line_width', 'Invalid gl.lineWidth() usage', gl, function() {
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if width is less than or equal to 0.');
+ gl.lineWidth(0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.lineWidth(-1);
+ this.expectError(gl.INVALID_VALUE);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('begin_query', 'Invalid gl.beginQuery() usage', gl, function() {
+ /** @type{Array<WebGLQuery>} */ var ids = [];
+ ids[0] = gl.createQuery();
+ ids[1] = gl.createQuery();
+ ids[2] = gl.createQuery();
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not one of the accepted tokens.');
+ gl.beginQuery(-1, ids[0]);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if gl.beginQuery is executed while a query object of the same target is already active.');
+ gl.beginQuery(gl.ANY_SAMPLES_PASSED, ids[0]);
+ this.expectError(gl.NO_ERROR);
+ gl.beginQuery(gl.ANY_SAMPLES_PASSED, ids[1]);
+ this.expectError(gl.INVALID_OPERATION);
+ // \note gl.ANY_SAMPLES_PASSED and gl.ANY_SAMPLES_PASSED_CONSERVATIVE alias to the same target for the purposes of this error.
+ gl.beginQuery(gl.ANY_SAMPLES_PASSED_CONSERVATIVE, ids[1]);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.beginQuery(gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, ids[1]);
+ this.expectError(gl.NO_ERROR);
+ gl.beginQuery(gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, ids[2]);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.endQuery(gl.ANY_SAMPLES_PASSED);
+ gl.endQuery(gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('An exception is thrown if the name is null.');
+ this.expectThrowNoError(function() {
+ gl.beginQuery(gl.ANY_SAMPLES_PASSED, null);
+ });
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if the name has since been deleted with gl.deleteQuery.');
+ gl.deleteQuery(ids[2]);
+ this.expectError(gl.NO_ERROR);
+ gl.beginQuery(gl.ANY_SAMPLES_PASSED, ids[2]);
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if id is the name of an already active query object.');
+ gl.beginQuery(gl.ANY_SAMPLES_PASSED, ids[0]);
+ this.expectError(gl.NO_ERROR);
+ gl.beginQuery(gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, ids[0]);
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if id refers to an existing query object whose type does not does not match target.');
+ gl.endQuery(gl.ANY_SAMPLES_PASSED);
+ this.expectError(gl.NO_ERROR);
+ gl.beginQuery(gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, ids[0]);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.deleteQuery(ids[0]);
+ gl.deleteQuery(ids[1]);
+ gl.deleteQuery(ids[2]);
+ this.expectError(gl.NO_ERROR);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('end_query', 'Invalid gl.endQuery() usage', gl, function() {
+ /** @type{WebGLQuery} */ var id;
+ id = gl.createQuery();
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not one of the accepted tokens.');
+ gl.endQuery(-1);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if gl.endQuery is executed when a query object of the same target is not active.');
+ gl.endQuery(gl.ANY_SAMPLES_PASSED);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.beginQuery(gl.ANY_SAMPLES_PASSED, id);
+ this.expectError(gl.NO_ERROR);
+ gl.endQuery(gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.endQuery(gl.ANY_SAMPLES_PASSED);
+ this.expectError(gl.NO_ERROR);
+
+ gl.deleteQuery(id);
+ this.expectError(gl.NO_ERROR);
+ }));
+
+ // Sync objects
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('fence_sync', 'Invalid gl.fenceSync() usage', gl, function() {
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if condition is not gl.SYNC_GPU_COMMANDS_COMPLETE.');
+ gl.fenceSync(-1, 0);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if flags is not zero.');
+ gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0x0010);
+ this.expectError(gl.INVALID_VALUE);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('wait_sync', 'Invalid gl.waitSync() usage', gl, function() {
+ /** @type{WebGLSync} */ var sync = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0);
+
+ bufferedLogToConsole('An exception is thrown if sync is null.');
+ this.expectThrowNoError(function() {
+ gl.waitSync(null, 0, gl.TIMEOUT_IGNORED);
+ });
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if flags is not zero.');
+ gl.waitSync(sync, 0x0010, gl.TIMEOUT_IGNORED);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if timeout is not gl.TIMEOUT_IGNORED.');
+ gl.waitSync(sync, 0, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteSync(sync);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('client_wait_sync', 'Invalid gl.clientWaitSync() usage', gl, function() {
+ /** @type{WebGLSync} */ var sync = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0);
+
+ bufferedLogToConsole('An exception is thrown if sync is null.');
+ this.expectThrowNoError(function() {
+ gl.clientWaitSync (null, 0, 0);
+ });
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if flags contains any unsupported flag.');
+ gl.clientWaitSync(sync, 0x00000004, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteSync(sync);
+ }));
+
+ };
+
+ /**
+ * @param {WebGL2RenderingContext} gl
+ */
+ es3fNegativeFragmentApiTests.run = function(gl) {
+ var testName = 'negativeFragmentApi';
+ var testDescription = 'Negative Fragment API tests';
+ var state = tcuTestCase.runner;
+
+ state.testName = testName;
+ state.testCases = tcuTestCase.newTest(testName, testDescription, null);
+
+ //Set up name and description of this test series.
+ setCurrentTestName(testName);
+ description(testDescription);
+ try {
+ es3fNegativeFragmentApiTests.init(gl);
+ tcuTestCase.runner.runCallback(tcuTestCase.runTestCases);
+ } catch (err) {
+ bufferedLogToConsole(err);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeShaderApiTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeShaderApiTests.js
new file mode 100644
index 0000000000..6e48dab60d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeShaderApiTests.js
@@ -0,0 +1,1195 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fNegativeShaderApiTests');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('functional.gles3.es3fApiCase');
+
+goog.scope(function() {
+
+ var es3fNegativeShaderApiTests = functional.gles3.es3fNegativeShaderApiTests;
+ var es3fApiCase = functional.gles3.es3fApiCase;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var gluShaderProgram = framework.opengl.gluShaderProgram;
+
+ /**
+ * @type {string}
+ * @const
+ */
+ var vertexShaderSource = '#version 300 es\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = vec4(0.0);\n' +
+ '}\n';
+
+ /**
+ * @type {string}
+ * @const
+ */
+ var fragmentShaderSource = '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 fragColor;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' fragColor = vec4(0.0);\n' +
+ '}\n';
+
+ /**
+ * @type {string}
+ * @const
+ */
+ var uniformTestVertSource = '#version 300 es\n' +
+ 'uniform mediump vec4 vec4_v;\n' +
+ 'uniform mediump mat4 mat4_v;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = mat4_v * vec4_v;\n' +
+ '}\n';
+
+ /**
+ * @type {string}
+ * @const
+ */
+ var uniformTestFragSource = '#version 300 es\n' +
+ 'uniform mediump ivec4 ivec4_f;\n' +
+ 'uniform mediump uvec4 uvec4_f;\n' +
+ 'uniform sampler2D sampler_f;\n' +
+ 'layout(location = 0) out mediump vec4 fragColor;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' fragColor.xy = (vec4(uvec4_f) + vec4(ivec4_f)).xy;\n' +
+ ' fragColor.zw = texture(sampler_f, vec2(0.0, 0.0)).zw;\n' +
+ '}\n';
+
+ /**
+ * @type {string}
+ * @const
+ */
+ var uniformBlockVertSource = '#version 300 es\n' +
+ 'layout(std140) uniform Block { lowp float var; };\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = vec4(var);\n' +
+ '}\n';
+
+ /**
+ * @param {WebGL2RenderingContext} gl
+ */
+ es3fNegativeShaderApiTests.init = function(gl) {
+ var testGroup = tcuTestCase.runner.testCases;
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'create_shader', 'Invalid gl.createShader() usage', gl,
+ function() {
+ bufferedLogToConsole('INVALID_ENUM is generated if shaderType is not an accepted value.');
+ gl.createShader(-1);
+ this.expectError(gl.INVALID_ENUM);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('attach_shader', 'Invalid gl.attachShader() usage', gl,
+ function() {
+ /** @type {WebGLShader} */ var shader1 = gl.createShader(gl.VERTEX_SHADER);
+ /** @type {WebGLShader} */ var shader2 = gl.createShader(gl.VERTEX_SHADER);
+ /** @type {WebGLProgram} */ var program = gl.createProgram();
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if shader is already attached to program.');
+ gl.attachShader(program, shader1);
+ this.expectError(gl.NO_ERROR);
+ gl.attachShader(program, shader1);
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if a shader of the same type as shader is already attached to program.');
+ gl.attachShader(program, shader2);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.deleteProgram(program);
+ gl.deleteShader(shader1);
+ gl.deleteShader(shader2);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('detach_shader', 'Invalid gl.detachShader() usage', gl,
+ function() {
+ /** @type {WebGLShader} */ var shader = gl.createShader(gl.VERTEX_SHADER);
+ /** @type {WebGLProgram} */ var program = gl.createProgram();
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if shader is not attached to program.');
+ gl.detachShader(program, shader);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.deleteProgram(program);
+ gl.deleteShader(shader);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('link_program', 'Invalid gl.linkProgram() usage', gl,
+ function() {
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if program is the currently active program object and transform feedback mode is active.');
+
+ /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource));
+ /** @type {WebGLBuffer} */ var buf;
+ /** @type {WebGLTransformFeedback} */ var tfID;
+ /** @type {Array<string>} */ var tfVarying = ['gl_Position'];
+
+ tfID = gl.createTransformFeedback();
+ buf = gl.createBuffer();
+
+ gl.useProgram(program.getProgram());
+ gl.transformFeedbackVaryings(program.getProgram(), tfVarying, gl.INTERLEAVED_ATTRIBS);
+ gl.linkProgram(program.getProgram());
+ gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tfID);
+ gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, buf);
+ gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, 32, gl.DYNAMIC_DRAW);
+ gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf);
+ gl.beginTransformFeedback(gl.TRIANGLES);
+
+ this.expectError(gl.NO_ERROR);
+
+ gl.linkProgram(program.getProgram());
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.endTransformFeedback();
+ gl.deleteTransformFeedback(tfID);
+ gl.deleteBuffer(buf);
+ this.expectError(gl.NO_ERROR);
+
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('use_program', 'Invalid gl.useProgram() usage', gl,
+ function() {
+
+ /** @type {WebGLShader} */ var shader = gl.createShader(gl.VERTEX_SHADER);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if transform feedback mode is active and not paused.');
+ /** @type {gluShaderProgram.ShaderProgram} */ var program1 = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource));
+ /** @type {gluShaderProgram.ShaderProgram} */ var program2 = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource));
+ /** @type {WebGLBuffer} */ var buf;
+ /** @type {WebGLTransformFeedback} */ var tfID;
+ /** @type {Array<string>} */ var tfVarying = ['gl_Position'];
+
+ tfID = gl.createTransformFeedback();
+ buf = gl.createBuffer();
+
+ gl.useProgram(program1.getProgram());
+ gl.transformFeedbackVaryings(program1.getProgram(), tfVarying, gl.INTERLEAVED_ATTRIBS);
+ gl.linkProgram(program1.getProgram());
+ gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tfID);
+ gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, buf);
+ gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, 32, gl.DYNAMIC_DRAW);
+ gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf);
+ gl.beginTransformFeedback(gl.TRIANGLES);
+ this.expectError(gl.NO_ERROR);
+
+ gl.useProgram(program2.getProgram());
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.pauseTransformFeedback();
+ gl.useProgram(program2.getProgram());
+ this.expectError(gl.NO_ERROR);
+
+ gl.endTransformFeedback();
+ gl.deleteTransformFeedback(tfID);
+ gl.deleteBuffer(buf);
+ this.expectError(gl.NO_ERROR);
+
+ gl.useProgram(null);
+ gl.deleteShader(shader);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('bind_sampler', 'Invalid gl.bindSampler() usage', gl,
+ function() {
+ /** @type {number} */ var maxTexImageUnits;
+ /** @type {WebGLSampler} */ var sampler;
+ /** @type {WebGLSampler} */ var buf;
+ maxTexImageUnits = /** @type {number} */ (gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS));
+ sampler = gl.createSampler();
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if unit is greater than or equal to the value of gl.MAX_COMBIED_TEXTURE_IMAGE_UNITS.');
+ gl.bindSampler(maxTexImageUnits, sampler);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if sampler has been deleted by a call to glDeleteSamplers.');
+ gl.deleteSampler(sampler);
+ gl.bindSampler(1, sampler);
+ this.expectError(gl.INVALID_OPERATION);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_sampler_parameteriv', 'Invalid gl.getSamplerParameter() usage', gl,
+ function() {
+ /** @type {number} */ var params;
+ /** @type {WebGLSampler} */ var sampler;
+ sampler = gl.createSampler();
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not an accepted value.');
+ params = /** @type {number} */ (gl.getSamplerParameter(sampler, -1));
+ this.expectError(gl.INVALID_ENUM);
+
+ gl.deleteSampler(sampler);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_sampler_parameterfv', 'Invalid gl.getSamplerParameter() usage', gl,
+ function() {
+ /** @type {number} */ var params;
+ /** @type {WebGLSampler} */ var sampler;
+ sampler = gl.createSampler();
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not an accepted value.');
+ params = /** @type {number} */ (gl.getSamplerParameter(sampler, -1));
+ this.expectError(gl.INVALID_ENUM);
+
+ gl.deleteSampler(sampler);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('sampler_parameteri', 'Invalid gl.samplerParameteri() usage', gl,
+ function() {
+ /** @type {WebGLSampler} */ var sampler;
+ sampler = gl.createSampler();
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if params should have a defined constant value (based on the value of pname) and does not.');
+ gl.samplerParameteri(sampler, gl.TEXTURE_WRAP_S, -1);
+ this.expectError(gl.INVALID_ENUM);
+
+ gl.deleteSampler(sampler);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'sampler_parameteriv', 'Invalid gl.samplerParameteri() usage', gl,
+ function() {
+ /** @type {number} */ var params;
+ /** @type {WebGLSampler} */ var sampler;
+ sampler = gl.createSampler();
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if params should have a defined constant value (based on the value of pname) and does not.');
+ params = -1;
+ gl.samplerParameteri(sampler, gl.TEXTURE_WRAP_S, params);
+ this.expectError(gl.INVALID_ENUM);
+
+ gl.deleteSampler(sampler);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'sampler_parameterf', 'Invalid glSamplerParameterf() usage', gl,
+ function() {
+ /** @type {WebGLSampler} */ var sampler;
+ sampler = gl.createSampler();
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if params should have a defined constant value (based on the value of pname) and does not.');
+ gl.samplerParameterf(sampler, gl.TEXTURE_WRAP_S, -1.0);
+ this.expectError(gl.INVALID_ENUM);
+
+ gl.deleteSampler(sampler);
+ }
+ ));
+
+ // Shader data commands
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'get_attrib_location', 'Invalid gl.getAttribLocation() usage', gl,
+ function() {
+ /** @type {WebGLProgram} */ var programEmpty = gl.createProgram();
+ /** @type {WebGLShader} */ var shader = gl.createShader(gl.VERTEX_SHADER);
+ /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource));
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if program has not been successfully linked.');
+ gl.bindAttribLocation(programEmpty, 0, 'test');
+ gl.getAttribLocation(programEmpty, 'test');
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.useProgram(null);
+ gl.deleteShader(shader);
+ gl.deleteProgram(programEmpty);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'get_uniform_location', 'Invalid gl.getUniformLocation() usage', gl,
+ function() {
+ /** @type {WebGLProgram} */ var programEmpty = gl.createProgram();
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if program has not been successfully linked.');
+ gl.getUniformLocation(programEmpty, 'test');
+ this.expectError(gl.INVALID_OPERATION);
+ gl.deleteProgram(programEmpty);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback(
+ 'bind_attrib_location', 'Invalid gl.bindAttribLocation() usage', gl,
+ function() {
+ /** @type {WebGLProgram} */ var program = gl.createProgram();
+ var maxIndex = /** @type {number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS));
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater than or equal to gl.MAX_VERTEX_ATTRIBS.');
+ gl.bindAttribLocation(program, maxIndex, 'test');
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if name starts with the reserved prefix \'gl.\'.');
+ gl.bindAttribLocation(program, maxIndex-1, 'gl_test');
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.deleteProgram(program);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('uniform_block_binding', 'Invalid gl.uniformBlockBinding() usage', gl,
+ function() {
+ /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(uniformBlockVertSource, uniformTestFragSource));
+
+ gl.useProgram(program.getProgram());
+
+ /** @type {number} */ var maxUniformBufferBindings;
+ /** @type {number} */ var numActiveUniforms = -1;
+ /** @type {number} */ var numActiveBlocks = -1;
+ maxUniformBufferBindings = /** @type {number} */ (gl.getParameter(gl.MAX_UNIFORM_BUFFER_BINDINGS));
+ numActiveUniforms = /** @type {number} */ (gl.getProgramParameter(program.getProgram(), gl.ACTIVE_UNIFORMS));
+ numActiveBlocks = /** @type {number} */ (gl.getProgramParameter(program.getProgram(), gl.ACTIVE_UNIFORM_BLOCKS));
+ bufferedLogToConsole('// gl.MAX_UNIFORM_BUFFER_BINDINGS = ' + maxUniformBufferBindings);
+ bufferedLogToConsole('// gl.ACTIVE_UNIFORMS = ' + numActiveUniforms);
+ bufferedLogToConsole('// gl.ACTIVE_UNIFORM_BLOCKS = ' + numActiveBlocks);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if uniformBlockIndex is not an active uniform block index of program.');
+ gl.uniformBlockBinding(program.getProgram(), -1, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.uniformBlockBinding(program.getProgram(), 5, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if uniformBlockBinding is greater than or equal to the value of gl.MAX_UNIFORM_BUFFER_BINDINGS.');
+ gl.uniformBlockBinding(program.getProgram(), maxUniformBufferBindings, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('An exception is thrown if program is null.');
+ this.expectThrowNoError(function() {
+ gl.uniformBlockBinding(null, 0, 0);
+ });
+ }
+ ));
+
+ // glUniform*f
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('uniformf_incompatible_type', 'Invalid glUniform{1234}f() usage', gl,
+ function() {
+ /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource));
+
+ gl.useProgram(program.getProgram());
+ /** @type {WebGLUniformLocation} */ var vec4_v = gl.getUniformLocation(program.getProgram(), 'vec4_v'); // vec4
+ /** @type {WebGLUniformLocation} */ var ivec4_f = gl.getUniformLocation(program.getProgram(), 'ivec4_f'); // ivec4
+ /** @type {WebGLUniformLocation} */ var uvec4_f = gl.getUniformLocation(program.getProgram(), 'uvec4_f'); // uvec4
+ /** @type {WebGLUniformLocation} */ var sampler_f = gl.getUniformLocation(program.getProgram(), 'sampler_f'); // sampler2D
+ this.expectError(gl.NO_ERROR);
+
+ if (vec4_v == null || ivec4_f == null || uvec4_f == null || sampler_f == null) {
+ assertMsgOptions(false, 'Failed to retrieve uniform location', false, true);
+ }
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if the size of the uniform variable declared in the shader does not match the size indicated by the glUniform command.');
+ gl.useProgram(program.getProgram());
+ gl.uniform1f(vec4_v, 0.0);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform2f(vec4_v, 0.0, 0.0);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform3f(vec4_v, 0.0, 0.0, 0.0);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform4f(vec4_v, 0.0, 0.0, 0.0, 0.0);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if glUniform{1234}f is used to load a uniform variable of type int, ivec2, ivec3, ivec4, unsigned int, uvec2, uvec3, uvec4.');
+ gl.useProgram(program.getProgram());
+ gl.uniform4f(ivec4_f, 0.0, 0.0, 0.0, 0.0);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform4f(uvec4_f, 0.0, 0.0, 0.0, 0.0);
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if a sampler is loaded using a command other than glUniform1i and glUniform1iv.');
+ gl.useProgram(program.getProgram());
+ gl.uniform1f(sampler_f, 0.0);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.useProgram(null);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('uniformfv_incompatible_type', 'Invalid glUniform{1234}fv() usage', gl,
+ function() {
+ /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource));
+
+ gl.useProgram(program.getProgram());
+ /** @type {WebGLUniformLocation} */ var vec4_v = gl.getUniformLocation(program.getProgram(), 'vec4_v'); // vec4
+ /** @type {WebGLUniformLocation} */ var ivec4_f = gl.getUniformLocation(program.getProgram(), 'ivec4_f'); // ivec4
+ /** @type {WebGLUniformLocation} */ var uvec4_f = gl.getUniformLocation(program.getProgram(), 'uvec4_f'); // uvec4
+ /** @type {WebGLUniformLocation} */ var sampler_f = gl.getUniformLocation(program.getProgram(), 'sampler_f'); // sampler2D
+ this.expectError(gl.NO_ERROR);
+
+ if (vec4_v == null || ivec4_f == null || uvec4_f == null || sampler_f == null)
+ assertMsgOptions(false, 'Failed to retrieve uniform location', false, true);
+
+ /** @type {Float32Array} */ var data = new Float32Array(4);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if the size of the uniform variable declared in the shader does not match the size indicated by the glUniform command.');
+ gl.useProgram(program.getProgram());
+ gl.uniform1fv(vec4_v, new Float32Array(1));
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform2fv(vec4_v, new Float32Array(2));
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform3fv(vec4_v, new Float32Array(3));
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform4fv(vec4_v, new Float32Array(4));
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if glUniform{1234}fv is used to load a uniform variable of type /** @type {number} */ var , ivec2, ivec3, ivec4, unsigned /** @type {number} */ var , uvec2, uvec3, uvec4.');
+ gl.useProgram(program.getProgram());
+ gl.uniform4fv(ivec4_f, data);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform4fv(uvec4_f, data);
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if a sampler is loaded using a command other than glUniform1i and glUniform1iv.');
+ gl.useProgram(program.getProgram());
+ gl.uniform1fv(sampler_f, new Float32Array(1));
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.useProgram(null);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('uniformfv_invalid_count', 'Invalid glUniform{1234}fv() usage', gl,
+ function() {
+ /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource));
+
+ gl.useProgram(program.getProgram());
+ /** @type {WebGLUniformLocation} */ var vec4_v = gl.getUniformLocation(program.getProgram(), 'vec4_v'); // vec4
+ this.expectError(gl.NO_ERROR);
+
+ if (vec4_v == null)
+ assertMsgOptions(false, 'Failed to retrieve uniform location', false, true);
+
+ /** @type {Float32Array} */ var data = new Float32Array(12);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if count is greater than 1 and the indicated uniform variable is not an array variable.');
+ gl.useProgram(program.getProgram());
+ gl.uniform1fv(vec4_v, data);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform2fv(vec4_v, data);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform3fv(vec4_v, data);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform4fv(vec4_v, data);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.useProgram(null);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('uniformi_incompatible_type', 'Invalid glUniform{1234}i() usage', gl,
+ function() {
+ /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource));
+
+ gl.useProgram(program.getProgram());
+ /** @type {WebGLUniformLocation} */ var vec4_v = gl.getUniformLocation(program.getProgram(), 'vec4_v'); // vec4
+ /** @type {WebGLUniformLocation} */ var ivec4_f = gl.getUniformLocation(program.getProgram(), 'ivec4_f'); // ivec4
+ /** @type {WebGLUniformLocation} */ var uvec4_f = gl.getUniformLocation(program.getProgram(), 'uvec4_f'); // uvec4
+ /** @type {WebGLUniformLocation} */ var sampler_f = gl.getUniformLocation(program.getProgram(), 'sampler_f'); // sampler2D
+ this.expectError(gl.NO_ERROR);
+
+ if (vec4_v == null || ivec4_f == null || uvec4_f == null || sampler_f == null)
+ assertMsgOptions(false, 'Failed to retrieve uniform location', false, true);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if the size of the uniform variable declared in the shader does not match the size indicated by the glUniform command.');
+ gl.useProgram(program.getProgram());
+ gl.uniform1i(ivec4_f, 0);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform2i(ivec4_f, 0, 0);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform3i(ivec4_f, 0, 0, 0);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform4i(ivec4_f, 0, 0, 0, 0);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if glUniform{1234}i is used to load a uniform variable of type unsigned /** @type {number} */ var , uvec2, uvec3, uvec4, or an array of these.');
+ gl.useProgram(program.getProgram());
+ gl.uniform1i(uvec4_f, 0);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform2i(uvec4_f, 0, 0);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform3i(uvec4_f, 0, 0, 0);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform4i(uvec4_f, 0, 0, 0, 0);
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if glUniform{1234}i is used to load a uniform variable of type /** @type {number} */ var , vec2, vec3, or vec4.');
+ gl.useProgram(program.getProgram());
+ gl.uniform1i(vec4_v, 0);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform2i(vec4_v, 0, 0);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform3i(vec4_v, 0, 0, 0);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform4i(vec4_v, 0, 0, 0, 0);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.useProgram(null);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('uniformiv_incompatible_type', 'Invalid glUniform{1234}iv() usage', gl,
+ function() {
+ /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource));
+
+ gl.useProgram(program.getProgram());
+ /** @type {WebGLUniformLocation} */ var vec4_v = gl.getUniformLocation(program.getProgram(), 'vec4_v'); // vec4
+ /** @type {WebGLUniformLocation} */ var ivec4_f = gl.getUniformLocation(program.getProgram(), 'ivec4_f'); // ivec4
+ /** @type {WebGLUniformLocation} */ var uvec4_f = gl.getUniformLocation(program.getProgram(), 'uvec4_f'); // uvec4
+ /** @type {WebGLUniformLocation} */ var sampler_f = gl.getUniformLocation(program.getProgram(), 'sampler_f'); // sampler2D
+ this.expectError(gl.NO_ERROR);
+
+ if (vec4_v == null || ivec4_f == null || uvec4_f == null || sampler_f == null)
+ assertMsgOptions(false, 'Failed to retrieve uniform location', false, true);
+
+ /** @type {Int32Array} */ var data1 = new Int32Array(1);
+ /** @type {Int32Array} */ var data2 = new Int32Array(2);
+ /** @type {Int32Array} */ var data3 = new Int32Array(3);
+ /** @type {Int32Array} */ var data4 = new Int32Array(4);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if the size of the uniform variable declared in the shader does not match the size indicated by the glUniform command.');
+ gl.useProgram(program.getProgram());
+ gl.uniform1iv(ivec4_f, data1);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform2iv(ivec4_f, data2);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform3iv(ivec4_f, data3);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform4iv(ivec4_f, data4);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if glUniform{1234}iv is used to load a uniform variable of type /** @type {number} */ var , vec2, vec3, or vec4.');
+ gl.useProgram(program.getProgram());
+ gl.uniform1iv(vec4_v, data1);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform2iv(vec4_v, data2);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform3iv(vec4_v, data3);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform4iv(vec4_v, data4);
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if glUniform{1234}iv is used to load a uniform variable of type unsigned /** @type {number} */ var , uvec2, uvec3 or uvec4.');
+ gl.useProgram(program.getProgram());
+ gl.uniform1iv(uvec4_f, data1);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform2iv(uvec4_f, data2);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform3iv(uvec4_f, data3);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform4iv(uvec4_f, data4);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.useProgram(null);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('uniformiv_invalid_count', 'Invalid glUniform{1234}iv() usage', gl,
+ function() {
+ /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource));
+
+ gl.useProgram(program.getProgram());
+ /** @type {WebGLUniformLocation} */ var ivec4_f = gl.getUniformLocation(program.getProgram(), 'ivec4_f'); // ivec4
+ this.expectError(gl.NO_ERROR);
+
+ if (ivec4_f == null)
+ assertMsgOptions(false, 'Failed to retrieve uniform location', false, true);
+
+ /** @type {Int32Array} */ var data = new Int32Array(12);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if count is greater than 1 and the indicated uniform variable is not an array variable.');
+ gl.useProgram(program.getProgram());
+ gl.uniform1iv(ivec4_f, data);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform2iv(ivec4_f, data);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform3iv(ivec4_f, data);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform4iv(ivec4_f, data);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.useProgram(null);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('uniformui_incompatible_type', 'Invalid glUniform{1234}ui() usage', gl,
+ function() {
+ /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource));
+
+ gl.useProgram(program.getProgram());
+ /** @type {WebGLUniformLocation} */ var vec4_v = gl.getUniformLocation(program.getProgram(), 'vec4_v'); // vec4
+ /** @type {WebGLUniformLocation} */ var ivec4_f = gl.getUniformLocation(program.getProgram(), 'ivec4_f'); // ivec4
+ /** @type {WebGLUniformLocation} */ var uvec4_f = gl.getUniformLocation(program.getProgram(), 'uvec4_f'); // uvec4
+ /** @type {WebGLUniformLocation} */ var sampler_f = gl.getUniformLocation(program.getProgram(), 'sampler_f'); // sampler2D
+ this.expectError(gl.NO_ERROR);
+
+ if (vec4_v == null || ivec4_f == null || uvec4_f == null || sampler_f == null)
+ assertMsgOptions(false, 'Failed to retrieve uniform location', false, true);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if the size of the uniform variable declared in the shader does not match the size indicated by the glUniform command.');
+ gl.useProgram(program.getProgram());
+ gl.uniform1ui(uvec4_f, 0);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform2ui(uvec4_f, 0, 0);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform3ui(uvec4_f, 0, 0, 0);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform4ui(uvec4_f, 0, 0, 0, 0);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if glUniform{1234}i is used to load a uniform variable of type /** @type {number} */ var , ivec2, ivec3, ivec4, or an array of these.');
+ gl.useProgram(program.getProgram());
+ gl.uniform1ui(ivec4_f, 0);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform2ui(ivec4_f, 0, 0);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform3ui(ivec4_f, 0, 0, 0);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform4ui(ivec4_f, 0, 0, 0, 0);
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if glUniform{1234}i is used to load a uniform variable of type /** @type {number} */ var , vec2, vec3, or vec4.');
+ gl.useProgram(program.getProgram());
+ gl.uniform1ui(vec4_v, 0);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform2ui(vec4_v, 0, 0);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform3ui(vec4_v, 0, 0, 0);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform4ui(vec4_v, 0, 0, 0, 0);
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if a sampler is loaded using a command other than glUniform1i and glUniform1iv.');
+ gl.useProgram(program.getProgram());
+ gl.uniform1ui(sampler_f, 0);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.useProgram(null);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('uniformuiv_incompatible_type', 'Invalid glUniform{1234}uiv() usage', gl,
+ function() {
+ /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource));
+
+ gl.useProgram(program.getProgram());
+ /** @type {WebGLUniformLocation} */ var vec4_v = gl.getUniformLocation(program.getProgram(), 'vec4_v'); // vec4
+ /** @type {WebGLUniformLocation} */ var ivec4_f = gl.getUniformLocation(program.getProgram(), 'ivec4_f'); // ivec4
+ /** @type {WebGLUniformLocation} */ var uvec4_f = gl.getUniformLocation(program.getProgram(), 'uvec4_f'); // uvec4
+ /** @type {WebGLUniformLocation} */ var sampler_f = gl.getUniformLocation(program.getProgram(), 'sampler_f'); // sampler2D
+ this.expectError(gl.NO_ERROR);
+
+ if (vec4_v == null || ivec4_f == null || uvec4_f == null || sampler_f == null)
+ assertMsgOptions(false, 'Failed to retrieve uniform location', false, true);
+
+ /** @type {Uint32Array} */ var data1 = new Uint32Array(1);
+ /** @type {Uint32Array} */ var data2 = new Uint32Array(2);
+ /** @type {Uint32Array} */ var data3 = new Uint32Array(3);
+ /** @type {Uint32Array} */ var data4 = new Uint32Array(4);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if the size of the uniform variable declared in the shader does not match the size indicated by the glUniform command.');
+ gl.useProgram(program.getProgram());
+ gl.uniform1uiv(uvec4_f, data1);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform2uiv(uvec4_f, data2);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform3uiv(uvec4_f, data3);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform4uiv(uvec4_f, data4);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if glUniform{1234}uiv is used to load a uniform variable of type /** @type {number} */ var , vec2, vec3, or vec4.');
+ gl.useProgram(program.getProgram());
+ gl.uniform1uiv(vec4_v, data1);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform2uiv(vec4_v, data2);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform3uiv(vec4_v, data3);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform4uiv(vec4_v, data4);
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if glUniform{1234}uiv is used to load a uniform variable of type /** @type {number} */ var , ivec2, ivec3 or ivec4.');
+ gl.useProgram(program.getProgram());
+ gl.uniform1uiv(ivec4_f, data1);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform2uiv(ivec4_f, data2);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform3uiv(ivec4_f, data3);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform4uiv(ivec4_f, data4);
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if a sampler is loaded using a command other than glUniform1i and glUniform1iv.');
+ gl.useProgram(program.getProgram());
+ gl.uniform1uiv(sampler_f, data1);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.useProgram(null);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('uniformuiv_invalid_count', 'Invalid glUniform{1234}uiv() usage', gl,
+ function() {
+ /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource));
+
+ gl.useProgram(program.getProgram());
+ /** @type {WebGLUniformLocation} */ var uvec4_f = gl.getUniformLocation(program.getProgram(), 'uvec4_f'); // uvec4
+ this.expectError(gl.NO_ERROR);
+
+ if (uvec4_f == null)
+ assertMsgOptions(false, 'Failed to retrieve uniform location', false, true);
+
+ /** @type {Uint32Array} */ var data = new Uint32Array(12);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if count is greater than 1 and the indicated uniform variable is not an array variable.');
+ gl.useProgram(program.getProgram());
+ gl.uniform1uiv(uvec4_f, data);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform2uiv(uvec4_f, data);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform3uiv(uvec4_f, data);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniform4uiv(uvec4_f, data);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.useProgram(null);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('uniform_matrixfv_incompatible_type', 'Invalid glUniformMatrix{234}fv() usage', gl,
+ function() {
+ /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource));
+
+ gl.useProgram(program.getProgram());
+ /** @type {WebGLUniformLocation} */ var mat4_v = gl.getUniformLocation(program.getProgram(), 'mat4_v'); // mat4
+ /** @type {WebGLUniformLocation} */ var sampler_f = gl.getUniformLocation(program.getProgram(), 'sampler_f'); // sampler2D
+ this.expectError(gl.NO_ERROR);
+
+ if (mat4_v == null || sampler_f == null)
+ assertMsgOptions(false, 'Failed to retrieve uniform location', false, true);
+
+ /** @type {Float32Array} */ var data4 = new Float32Array(4);
+ /** @type {Float32Array} */ var data9 = new Float32Array(9);
+ /** @type {Float32Array} */ var data16 = new Float32Array(16);
+ /** @type {Float32Array} */ var data6 = new Float32Array(6);
+ /** @type {Float32Array} */ var data8 = new Float32Array(8);
+ /** @type {Float32Array} */ var data12 = new Float32Array(12);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if the size of the uniform variable declared in the shader does not match the size indicated by the glUniform command.');
+ gl.useProgram(program.getProgram());
+ gl.uniformMatrix2fv(mat4_v, false, data4);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniformMatrix3fv(mat4_v, false, data9);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniformMatrix4fv(mat4_v, false, data16);
+ this.expectError(gl.NO_ERROR);
+
+ gl.uniformMatrix2x3fv(mat4_v, false, data6);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniformMatrix3x2fv(mat4_v, false, data6);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniformMatrix2x4fv(mat4_v, false, data8);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniformMatrix4x2fv(mat4_v, false, data8);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniformMatrix3x4fv(mat4_v, false, data12);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniformMatrix4x3fv(mat4_v, false, data12);
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if a sampler is loaded using a command other than glUniform1i and glUniform1iv.');
+ gl.useProgram(program.getProgram());
+ gl.uniformMatrix2fv(sampler_f, false, data4);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniformMatrix3fv(sampler_f, false, data9);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniformMatrix4fv(sampler_f, false, data16);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.uniformMatrix2x3fv(sampler_f, false, data6);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniformMatrix3x2fv(sampler_f, false, data6);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniformMatrix2x4fv(sampler_f, false, data8);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniformMatrix4x2fv(sampler_f, false, data8);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniformMatrix3x4fv(sampler_f, false, data12);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniformMatrix4x3fv(sampler_f, false, data12);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.useProgram(null);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('uniform_matrixfv_invalid_count', 'Invalid glUniformMatrix{234}fv() usage', gl,
+ function() {
+ /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource));
+
+ gl.useProgram(program.getProgram());
+ /** @type {WebGLUniformLocation} */ var mat4_v = gl.getUniformLocation(program.getProgram(), 'mat4_v'); // mat4
+ this.expectError(gl.NO_ERROR);
+
+ if (mat4_v == null)
+ assertMsgOptions(false, 'Failed to retrieve uniform location', false, true);
+
+ /** @type {Float32Array} */ var data = new Float32Array(144);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if count is greater than 1 and the indicated uniform variable is not an array variable.');
+ gl.useProgram(program.getProgram());
+ gl.uniformMatrix2fv(mat4_v, false, data);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniformMatrix3fv(mat4_v, false, data);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniformMatrix4fv(mat4_v, false, data);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.uniformMatrix2x3fv(mat4_v, false, data);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniformMatrix3x2fv(mat4_v, false, data);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniformMatrix2x4fv(mat4_v, false, data);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniformMatrix4x2fv(mat4_v, false, data);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniformMatrix3x4fv(mat4_v, false, data);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.uniformMatrix4x3fv(mat4_v, false, data);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.useProgram(null);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('bind_transform_feedback', 'Invalid gl.bindTransformFeedback() usage', gl,
+ function() {
+ /** @type {Array<WebGLTransformFeedback>} */ var tfID = [];
+ /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource));
+ /** @type {WebGLBuffer} */ var buf;
+ /** @type {Array<string>} */ var tfVarying = ['gl_Position'];
+
+ buf = gl.createBuffer();
+ tfID[0] = gl.createTransformFeedback();
+ tfID[1] = gl.createTransformFeedback();
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not gl.TRANSFORM_FEEDBACK.');
+ gl.bindTransformFeedback(-1, tfID[0]);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if the transform feedback operation is active on the currently bound transform feedback object, and is not paused.');
+ gl.useProgram(program.getProgram());
+ gl.transformFeedbackVaryings(program.getProgram(), tfVarying, gl.INTERLEAVED_ATTRIBS);
+ gl.linkProgram(program.getProgram());
+ gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tfID[0]);
+ gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, buf);
+ gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, 32, gl.DYNAMIC_DRAW);
+ gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf);
+ gl.beginTransformFeedback(gl.TRIANGLES);
+ this.expectError(gl.NO_ERROR);
+
+ gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tfID[1]);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.endTransformFeedback();
+ this.expectError(gl.NO_ERROR);
+
+ gl.useProgram(null);
+ gl.deleteBuffer(buf);
+ gl.deleteTransformFeedback(tfID[0]);
+ gl.deleteTransformFeedback(tfID[1]);
+ this.expectError(gl.NO_ERROR);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('begin_transform_feedback', 'Invalid gl.beginTransformFeedback() usage', gl,
+ function() {
+ /** @type {Array<WebGLTransformFeedback>} */ var tfID = [];
+ /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource));
+ /** @type {WebGLBuffer} */ var buf;
+ /** @type {Array<string>} */ var tfVarying = ['gl_Position'];
+
+ buf = gl.createBuffer();
+ tfID[0] = gl.createTransformFeedback();
+ tfID[1] = gl.createTransformFeedback();
+
+ gl.useProgram(program.getProgram());
+ gl.transformFeedbackVaryings(program.getProgram(), tfVarying, gl.INTERLEAVED_ATTRIBS);
+ gl.linkProgram(program.getProgram());
+ gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tfID[0]);
+ gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, buf);
+ gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, 32, gl.DYNAMIC_DRAW);
+ gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if primitiveMode is not one of gl.POINTS, gl.LINES, or gl.TRIANGLES.');
+ gl.beginTransformFeedback(-1);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if transform feedback is already active.');
+ gl.beginTransformFeedback(gl.TRIANGLES);
+ this.expectError(gl.NO_ERROR);
+ gl.beginTransformFeedback(gl.POINTS);
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if any binding point used in transform feedback mode does not have a buffer object bound.');
+ /** @type{WebGLBuffer} */ var dummyBuf = gl.createBuffer()
+ gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, dummyBuf);
+ gl.beginTransformFeedback(gl.TRIANGLES);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if no binding points would be used because no program object is active.');
+ gl.useProgram(null);
+ gl.beginTransformFeedback(gl.TRIANGLES);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.useProgram(program.getProgram());
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if no binding points would be used because the active program object has specified no varying variables to record.');
+ gl.transformFeedbackVaryings(program.getProgram(), [], gl.INTERLEAVED_ATTRIBS);
+ gl.beginTransformFeedback(gl.TRIANGLES);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.endTransformFeedback();
+ gl.deleteBuffer(buf);
+ gl.deleteBuffer(dummyBuf);
+ gl.deleteTransformFeedback(tfID[0]);
+ gl.deleteTransformFeedback(tfID[1]);
+ this.expectError(gl.NO_ERROR);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('pause_transform_feedback', 'Invalid gl.pauseTransformFeedback() usage', gl,
+ function() {
+ /** @type {Array<WebGLTransformFeedback>} */ var tfID = [];
+ /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource));
+ /** @type {WebGLBuffer} */ var buf;
+ /** @type {Array<string>} */ var tfVarying = ['gl_Position'];
+
+ buf = gl.createBuffer();
+ tfID[0] = gl.createTransformFeedback();
+ tfID[1] = gl.createTransformFeedback();
+
+ gl.useProgram(program.getProgram());
+ gl.transformFeedbackVaryings(program.getProgram(), tfVarying, gl.INTERLEAVED_ATTRIBS);
+ gl.linkProgram(program.getProgram());
+ gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tfID[0]);
+ gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, buf);
+ gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, 32, gl.DYNAMIC_DRAW);
+ gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if the currently bound transform feedback object is not active or is paused.');
+ gl.pauseTransformFeedback();
+ this.expectError(gl.INVALID_OPERATION);
+ gl.beginTransformFeedback(gl.TRIANGLES);
+ gl.pauseTransformFeedback();
+ this.expectError(gl.NO_ERROR);
+ gl.pauseTransformFeedback();
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.endTransformFeedback();
+ gl.deleteBuffer(buf);
+ gl.deleteTransformFeedback(tfID[0]);
+ gl.deleteTransformFeedback(tfID[1]);
+ this.expectError(gl.NO_ERROR);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('resume_transform_feedback', 'Invalid gl.resumeTransformFeedback() usage', gl,
+ function() {
+ /** @type {Array<WebGLTransformFeedback>} */ var tfID = [];
+ /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource));
+ /** @type {WebGLBuffer} */ var buf;
+ /** @type {Array<string>} */ var tfVarying = ['gl_Position'];
+
+ buf = gl.createBuffer();
+ tfID[0] = gl.createTransformFeedback();
+ tfID[1] = gl.createTransformFeedback();
+
+ gl.useProgram(program.getProgram());
+ gl.transformFeedbackVaryings(program.getProgram(), tfVarying, gl.INTERLEAVED_ATTRIBS);
+ gl.linkProgram(program.getProgram());
+ gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tfID[0]);
+ gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, buf);
+ gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, 32, gl.DYNAMIC_DRAW);
+ gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if the currently bound transform feedback object is not active or is not paused.');
+ gl.resumeTransformFeedback();
+ this.expectError(gl.INVALID_OPERATION);
+ gl.beginTransformFeedback(gl.TRIANGLES);
+ gl.resumeTransformFeedback();
+ this.expectError(gl.INVALID_OPERATION);
+ gl.pauseTransformFeedback();
+ gl.resumeTransformFeedback();
+ this.expectError(gl.NO_ERROR);
+
+ gl.endTransformFeedback();
+ gl.deleteBuffer(buf);
+ gl.deleteTransformFeedback(tfID[0]);
+ gl.deleteTransformFeedback(tfID[1]);
+ this.expectError(gl.NO_ERROR);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('end_transform_feedback', 'Invalid gl.endTransformFeedback() usage', gl,
+ function() {
+ /** @type {WebGLTransformFeedback} */ var tfID;
+ /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource));
+ /** @type {WebGLBuffer} */ var buf;
+ /** @type {Array<string>} */ var tfVarying = ['gl_Position'];
+
+ buf = gl.createBuffer();
+ tfID = gl.createTransformFeedback();
+
+ gl.useProgram(program.getProgram());
+ gl.transformFeedbackVaryings(program.getProgram(), tfVarying, gl.INTERLEAVED_ATTRIBS);
+ gl.linkProgram(program.getProgram());
+ gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tfID);
+ gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, buf);
+ gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, 32, gl.DYNAMIC_DRAW);
+ gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if transform feedback is not active.');
+ gl.endTransformFeedback();
+ this.expectError(gl.INVALID_OPERATION);
+ gl.beginTransformFeedback(gl.TRIANGLES);
+ gl.endTransformFeedback();
+ this.expectError(gl.NO_ERROR);
+
+ gl.deleteBuffer(buf);
+ gl.deleteTransformFeedback(tfID);
+ this.expectError(gl.NO_ERROR);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_transform_feedback_varying', 'Invalid glGetTransformFeedbackVarying() usage', gl,
+ function() {
+ /** @type {WebGLTransformFeedback} */ var tfID;
+ /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource));
+ /** @type {gluShaderProgram.ShaderProgram} */ var programInvalid = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexShaderSource, ''));
+ /** @type {Array<string>} */ var tfVarying = ['gl_Position'];
+ /** @type {number} */ var maxTransformFeedbackVaryings = 0;
+
+ /** @type {number} */ var length;
+ /** @type {number} */ var size;
+ /** @type {number} */ var type;
+ /** @type {WebGLActiveInfo} */ var name;
+
+ tfID = gl.createTransformFeedback();
+
+ gl.transformFeedbackVaryings(program.getProgram(), tfVarying, gl.INTERLEAVED_ATTRIBS);
+ this.expectError(gl.NO_ERROR);
+ gl.linkProgram(program.getProgram());
+ this.expectError(gl.NO_ERROR);
+
+ gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tfID);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('An exception is thrown if program is null.');
+ this.expectThrowNoError(function() {
+ gl.getTransformFeedbackVarying(null, 0);
+ });
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater or equal to the value of gl.TRANSFORM_FEEDBACK_VARYINGS.');
+ maxTransformFeedbackVaryings = /** @type {number} */ (gl.getProgramParameter(program.getProgram(), gl.TRANSFORM_FEEDBACK_VARYINGS));
+ name = gl.getTransformFeedbackVarying(program.getProgram(), maxTransformFeedbackVaryings);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION or gl.INVALID_VALUE is generated program has not been linked.');
+ name = gl.getTransformFeedbackVarying(programInvalid.getProgram(), 0);
+ this.expectError([gl.INVALID_OPERATION, gl.INVALID_VALUE]);
+
+ gl.deleteTransformFeedback(tfID);
+ this.expectError(gl.NO_ERROR);
+ }
+ ));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('transform_feedback_varyings', 'Invalid gl.transformFeedbackVaryings() usage', gl,
+ function() {
+ /** @type {WebGLTransformFeedback} */ var tfID;
+ /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource));
+ /** @type {Array<string>} */ var tfVarying = ['gl_Position'];
+ /** @type {number} */ var maxTransformFeedbackSeparateAttribs = 0;
+
+ tfID = gl.createTransformFeedback();
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('An exception is thrown if program is null.');
+ this.expectThrowNoError(function() {
+ gl.transformFeedbackVaryings(null, tfVarying, gl.INTERLEAVED_ATTRIBS);
+ });
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if bufferMode is gl.SEPARATE_ATTRIBS and count is greater than gl.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS.');
+ maxTransformFeedbackSeparateAttribs = /** @type {number} */ (gl.getParameter(gl.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS));
+ for (var count = 0; count < maxTransformFeedbackSeparateAttribs; ++count) {
+ tfVarying = tfVarying.concat(['gl_Position']);
+ }
+ gl.transformFeedbackVaryings(program.getProgram(), tfVarying, gl.SEPARATE_ATTRIBS);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteTransformFeedback(tfID);
+ this.expectError(gl.NO_ERROR);
+ }
+ ));
+ };
+
+ /**
+ * Run test
+ * @param {WebGL2RenderingContext} gl
+ */
+ es3fNegativeShaderApiTests.run = function(gl) {
+ //Set up Test Root parameters
+ var testName = 'negative_shader_api';
+ var testDescription = 'Negative Shader Api Tests';
+ var state = tcuTestCase.runner;
+
+ state.testName = testName;
+ state.testCases = tcuTestCase.newTest(testName, testDescription, null);
+
+ //Set up name and description of this test series.
+ setCurrentTestName(testName);
+ description(testDescription);
+ try {
+ es3fNegativeShaderApiTests.init(gl);
+ tcuTestCase.runner.runCallback(tcuTestCase.runTestCases);
+ } catch (err) {
+ bufferedLogToConsole(err);
+ tcuTestCase.runner.terminate();
+ }
+ };
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeStateApiTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeStateApiTests.js
new file mode 100644
index 0000000000..40d6384edc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeStateApiTests.js
@@ -0,0 +1,927 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES 3.0 Module
+ * -------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief Negative GL State API tests.
+ *//*--------------------------------------------------------------------*/
+'use strict';
+goog.provide('functional.gles3.es3fNegativeStateApiTests');
+
+goog.require('framework.common.tcuTestCase');
+goog.require('functional.gles3.es3fApiCase');
+goog.require('framework.opengl.gluShaderProgram');
+
+goog.scope(function() {
+
+ var es3fNegativeStateApiTests = functional.gles3.es3fNegativeStateApiTests;
+ var es3fApiCase = functional.gles3.es3fApiCase;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var gluShaderProgram = framework.opengl.gluShaderProgram;
+
+ /**
+ * @type {string}
+ * @const
+ */
+ var uniformTestVertSource = '#version 300 es\n' +
+ 'uniform mediump vec4 vUnif_vec4;\n' +
+ 'in mediump vec4 attr;\n' +
+ 'layout(std140) uniform Block { mediump vec4 blockVar; };\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = vUnif_vec4 + blockVar + attr;\n' +
+ '}\n';
+
+ /**
+ * @type {string}
+ * @const
+ */
+ var uniformTestFragSource = '#version 300 es\n' +
+ 'uniform mediump ivec4 fUnif_ivec4;\n' +
+ 'uniform mediump uvec4 fUnif_uvec4;\n' +
+ 'layout(location = 0) out mediump vec4 fragColor;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' fragColor = vec4(vec4(fUnif_ivec4) + vec4(fUnif_uvec4));\n' +
+ '}\n';
+
+ /**
+ * @param {WebGL2RenderingContext} gl
+ */
+ es3fNegativeStateApiTests.init = function(gl) {
+
+ var testGroup = tcuTestCase.runner.testCases;
+
+ // Enabling & disabling states
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('enable', 'Invalid gl.enable() usage', gl, function() {
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if cap is not one of the allowed values.');
+ gl.enable(-1);
+ this.expectError(gl.INVALID_ENUM);
+
+ }));
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('disable', 'Invalid gl.disable() usage', gl, function() {
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if cap is not one of the allowed values.');
+ gl.disable(-1);
+ this.expectError(gl.INVALID_ENUM);
+
+ }));
+
+ // Simple state queries
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_parameter', 'Invalid gl.getParameter() usage', gl, function() {
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not one of the allowed values.');
+ /** @type{boolean} */ var params = false;
+ //glGetBooleanv(-1, params);
+ params = /** @type{boolean} */ (gl.getParameter(-1));
+ this.expectError(gl.INVALID_ENUM);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_indexed_parameter', 'Invalid gl.getIndexedParameter() usage', gl, function() {
+ /** @type{number} */ var data = -1;
+ /** @type{number} */ var maxUniformBufferBindings;
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if name is not an accepted value.');
+ data = /** @type{number} */ (gl.getIndexedParameter(-1, 0));
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if index is outside of the valid range for the indexed state target.');
+ maxUniformBufferBindings = /** @type{number} */ (gl.getParameter(gl.MAX_UNIFORM_BUFFER_BINDINGS));
+ this.expectError(gl.NO_ERROR);
+ data = /** @type{number} */ (gl.getIndexedParameter(gl.UNIFORM_BUFFER_BINDING, maxUniformBufferBindings));
+ this.expectError(gl.INVALID_VALUE);
+
+ }));
+
+ // Enumerated state queries: Shaders
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_attached_shaders', 'Invalid gl.getAttachedShaders() usage', gl, function() {
+ /** @type{WebGLShader} */ var shaderObject = gl.createShader(gl.VERTEX_SHADER);
+ /** @type{WebGLProgram} */ var program = gl.createProgram();
+
+ bufferedLogToConsole('An exception is thrown if program is null.');
+ this.expectThrowNoError(function() {
+ gl.getAttachedShaders(null);
+ });
+
+ gl.deleteShader(shaderObject);
+ gl.deleteProgram(program);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_shader_parameter', 'Invalid gl.getShaderParameter() usage', gl, function() {
+ /** @type{WebGLShader} */ var shader = gl.createShader(gl.VERTEX_SHADER);
+ /** @type{WebGLProgram} */ var program = gl.createProgram();
+ /** @type{number} */ var param = -1;
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not an accepted value.');
+ param = /** @type{number} */ (gl.getShaderParameter(shader, -1));
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('An exception is thrown if shader is null.');
+ this.expectThrowNoError(function() {
+ gl.getShaderParameter(null, gl.SHADER_TYPE);
+ });
+
+ gl.deleteShader(shader);
+ gl.deleteProgram(program);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_shader_info_log', 'Invalid gl.getShaderInfoLog() usage', gl, function() {
+ /** @type{WebGLShader} */ var shader = gl.createShader(gl.VERTEX_SHADER);
+ /** @type{WebGLProgram} */ var program = gl.createProgram();
+
+ bufferedLogToConsole('An exception is thrown if shader is null.');
+ this.expectThrowNoError(function() {
+ gl.getShaderInfoLog(null);
+ });
+
+ gl.deleteShader(shader);
+ gl.deleteProgram(program);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_shader_precision_format', 'Invalid gl.getShaderPrecisionFormat() usage', gl, function() {
+ /** @type{WebGLShaderPrecisionFormat } */ var precision;
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if shaderType or precisionType is not an accepted value.');
+ precision = gl.getShaderPrecisionFormat (-1, gl.MEDIUM_FLOAT);
+ this.expectError(gl.INVALID_ENUM);
+ precision = gl.getShaderPrecisionFormat (gl.VERTEX_SHADER, -1);
+ this.expectError(gl.INVALID_ENUM);
+ precision = gl.getShaderPrecisionFormat (-1, -1);
+ this.expectError(gl.INVALID_ENUM);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_shader_source', 'Invalid gl.getShaderSource() usage', gl, function() {
+ /** @type{WebGLProgram} */ var program = gl.createProgram();
+ /** @type{WebGLShader} */ var shader = gl.createShader(gl.VERTEX_SHADER);
+
+ bufferedLogToConsole('An exception is thrown if shader is null.');
+ this.expectThrowNoError(function() {
+ gl.getShaderSource(null);
+ });
+
+ gl.deleteProgram(program);
+ gl.deleteShader(shader);
+ }));
+
+ // Enumerated state queries: Programs
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_program_parameter', 'Invalid gl.getProgramParameter() usage', gl, function() {
+ /** @type{WebGLProgram} */ var program = gl.createProgram();
+ /** @type{WebGLShader} */ var shader = gl.createShader(gl.VERTEX_SHADER);
+ /** @type{boolean} */ var params;
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not an accepted value.');
+ params = /** @type{boolean} */ (gl.getProgramParameter(program, -1));
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('An exception is thrown if program is null.');
+ this.expectThrowNoError(function() {
+ gl.getProgramParameter(null, gl.LINK_STATUS);
+ });
+
+ gl.deleteProgram(program);
+ gl.deleteShader(shader);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_program_info_log', 'Invalid gl.getProgramInfoLog() usage', gl, function() {
+ /** @type{WebGLProgram} */ var program = gl.createProgram();
+ /** @type{WebGLShader} */ var shader = gl.createShader(gl.VERTEX_SHADER);
+
+ bufferedLogToConsole('An exception is thrown if program is null.');
+ this.expectThrowNoError(function() {
+ gl.getProgramInfoLog (null);
+ });
+
+ gl.deleteProgram(program);
+ gl.deleteShader(shader);
+ }));
+
+ // Enumerated state queries: Shader variables
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_tex_parameter', 'Invalid gl.getTexParameter() usage', gl, function() {
+ /** @type{WebGLTexture} */ var texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target or pname is not an accepted value.');
+ gl.getTexParameter (-1, gl.TEXTURE_MAG_FILTER);
+ this.expectError(gl.INVALID_ENUM);
+ gl.getTexParameter (gl.TEXTURE_2D, -1);
+ this.expectError(gl.INVALID_ENUM);
+ gl.getTexParameter (-1, -1);
+ this.expectError(gl.INVALID_ENUM);
+
+ gl.deleteTexture(texture);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_uniform', 'Invalid gl.getUniform() usage', gl, function() {
+ /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource));
+ gl.useProgram(program.getProgram());
+
+ /** @type{WebGLUniformLocation} */ var unif = gl.getUniformLocation(program.getProgram(), 'vUnif_vec4'); // vec4
+ assertMsgOptions(unif != null, 'Failed to retrieve uniform location', false, true);
+
+ /** @type{WebGLShader} */ var shader = gl.createShader(gl.VERTEX_SHADER);
+ /** @type{WebGLProgram} */ var programEmpty = gl.createProgram();
+ /** @type{*} */ var params;
+
+ bufferedLogToConsole('An exception is thrown if program is null.');
+ this.expectThrowNoError(function() {
+ gl.getUniform (null, unif);
+ });
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if program has not been successfully linked.');
+ params = gl.getUniform (programEmpty, unif);
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('An exception is thrown if location is null.');
+ this.expectThrowNoError(function() {
+ gl.getUniform (program.getProgram(), null);
+ });
+
+ gl.deleteShader(shader);
+ gl.deleteProgram(programEmpty);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_active_uniform', 'Invalid gl.getActiveUniform() usage', gl, function() {
+ /** @type{WebGLShader} */ var shader = gl.createShader(gl.VERTEX_SHADER);
+ /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource));
+ /** @type{number} */ var numActiveUniforms = -1;
+
+ numActiveUniforms = /** @type{number} */ (gl.getProgramParameter(program.getProgram(), gl.ACTIVE_UNIFORMS));
+ bufferedLogToConsole('// gl.ACTIVE_UNIFORMS = ' + numActiveUniforms + ' (expected 4).');
+
+ bufferedLogToConsole('An exception is thrown if program is null.');
+ this.expectThrowNoError(function() {
+ gl.getActiveUniform(null, 0);
+ });
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater than or equal to the number of active uniform variables in program.');
+ gl.useProgram(program.getProgram());
+ gl.getActiveUniform(program.getProgram(), numActiveUniforms);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.useProgram(null);
+ gl.deleteShader(shader);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_active_uniforms', 'Invalid gl.getActiveUniforms() usage', gl, function() {
+ /** @type{WebGLShader} */ var shader = gl.createShader(gl.VERTEX_SHADER);
+ /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource));
+ /** @type{Array<number>} */ var dummyUniformIndex = [1];
+ /** @type{Array<number>} */ var dummyParamDst;
+ /** @type{number} */ var numActiveUniforms = -1;
+
+ gl.useProgram(program.getProgram());
+
+ numActiveUniforms = /** @type{number} */ (gl.getProgramParameter(program.getProgram(), gl.ACTIVE_UNIFORMS));
+ bufferedLogToConsole('// gl.ACTIVE_UNIFORMS = ' + numActiveUniforms + ' (expected 4).');
+
+ bufferedLogToConsole('An exception is thrown if program is null.');
+ this.expectThrowNoError(function() {
+ gl.getActiveUniforms(null, dummyUniformIndex, gl.UNIFORM_TYPE);
+ });
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if any value in uniformIndices is greater than or equal to the value of gl.ACTIVE_UNIFORMS for program.');
+ /** @type{Array<number>} */ var invalidUniformIndices;
+ /** @type{Array<number>} */ var dummyParamsDst;
+ for (var excess = 0; excess <= 2; excess++) {
+ invalidUniformIndices = [1, numActiveUniforms - 1 + excess, 1];
+ dummyParamsDst = gl.getActiveUniforms(program.getProgram(), invalidUniformIndices, gl.UNIFORM_TYPE);
+ this.expectError(excess == 0 ? gl.NO_ERROR : gl.INVALID_VALUE);
+ }
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not an accepted token.');
+ dummyParamDst = gl.getActiveUniforms(program.getProgram(), dummyUniformIndex, -1);
+ this.expectError(gl.INVALID_ENUM);
+
+ gl.useProgram(null);
+ gl.deleteShader(shader);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_active_uniform_block_parameter', 'Invalid gl.getActiveUniformBlockParameter() usage', gl, function() {
+ /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource));
+ /** @type{*} */ var params;
+ /** @type{number} */ var numActiveBlocks = -1;
+
+ numActiveBlocks = /** @type{number} */ (gl.getProgramParameter(program.getProgram(), gl.ACTIVE_UNIFORM_BLOCKS));
+ bufferedLogToConsole('// gl.ACTIVE_UNIFORM_BLOCKS = ' + numActiveBlocks + ' (expected 1).');
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if uniformBlockIndex is greater than or equal to the value of gl.ACTIVE_UNIFORM_BLOCKS or is not the index of an active uniform block in program.');
+ gl.useProgram(program.getProgram());
+ this.expectError(gl.NO_ERROR);
+ params = gl.getActiveUniformBlockParameter(program.getProgram(), numActiveBlocks, gl.UNIFORM_BLOCK_BINDING);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not one of the accepted tokens.');
+ params = gl.getActiveUniformBlockParameter(program.getProgram(), 0, -1);
+ this.expectError(gl.INVALID_ENUM);
+
+ gl.useProgram(null);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_active_uniform_block_name', 'Invalid gl.getActiveUniformBlockName() usage', gl, function() {
+ /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource));
+ /** @type{number} */ var length = -1;
+ /** @type{number} */ var numActiveBlocks = -1;
+ /** @type{string} */ var uniformBlockName;
+
+ numActiveBlocks = /** @type{number} */ (gl.getProgramParameter(program.getProgram(), gl.ACTIVE_UNIFORM_BLOCKS));
+ bufferedLogToConsole('// gl.ACTIVE_UNIFORM_BLOCKS = ' + numActiveBlocks + ' (expected 1).');
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if uniformBlockIndex is greater than or equal to the value of gl.ACTIVE_UNIFORM_BLOCKS or is not the index of an active uniform block in program.');
+ gl.useProgram(program.getProgram());
+ this.expectError(gl.NO_ERROR);
+ uniformBlockName = gl.getActiveUniformBlockName(program.getProgram(), numActiveBlocks);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.useProgram(null);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_active_attrib', 'Invalid gl.getActiveAttrib() usage', gl, function() {
+ /** @type{WebGLShader} */ var shader = gl.createShader(gl.VERTEX_SHADER);
+ /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource));
+ /** @type{number} */ var numActiveAttributes = -1;
+
+ /** @type{WebGLActiveInfo} */ var activeInfo;
+ /** @type{number} */ var size = -1;
+ /** @type{number} */ var type = -1;
+ /** @type{string} */ var name;
+
+ numActiveAttributes = /** @type{number} */(gl.getProgramParameter(program.getProgram(), gl.ACTIVE_ATTRIBUTES));
+ bufferedLogToConsole('// gl.ACTIVE_ATTRIBUTES = ' + numActiveAttributes + ' (expected 1).');
+
+ gl.useProgram(program.getProgram());
+
+ bufferedLogToConsole('An exception is thrown if program is null.');
+ this.expectThrowNoError(function() {
+ gl.getActiveAttrib(null, 0);
+ });
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater than or equal to gl.ACTIVE_ATTRIBUTES.');
+ activeInfo = gl.getActiveAttrib(program.getProgram(), numActiveAttributes);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.useProgram(null);
+ gl.deleteShader(shader);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_uniform_indices', 'Invalid gl.getUniformIndices() usage', gl, function() {
+ /** @type{WebGLShader} */ var shader = gl.createShader(gl.VERTEX_SHADER);
+ /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(uniformTestVertSource, uniformTestFragSource));
+ gl.useProgram(program.getProgram());
+ /** @type{number} */ var numActiveBlocks = -1;
+ /** @type{Array<string>} */ var uniformName = ['Block.blockVar'];
+ /** @type{Array<number>} */ var uniformIndices = [-1];
+
+ numActiveBlocks = /** @type{number} */(gl.getProgramParameter(program.getProgram(), gl.ACTIVE_UNIFORM_BLOCKS));
+ bufferedLogToConsole('// gl.ACTIVE_UNIFORM_BLOCKS = ' + numActiveBlocks);
+ this.expectError (gl.NO_ERROR);
+
+ bufferedLogToConsole('An exception is thrown if program is null.');
+ this.expectThrowNoError(function() {
+ gl.getUniformIndices(null, uniformName);
+ });
+
+ gl.useProgram(null);
+ gl.deleteShader(shader);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_vertex_attrib', 'Invalid gl.getVertexAttrib() usage', gl, function() {
+ /** @type{*} */ var params;
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not an accepted value.');
+ params = gl.getVertexAttrib(0, -1);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater than or equal to gl.MAX_VERTEX_ATTRIBS.');
+ /** @type{number} */ var maxVertexAttribs;
+ maxVertexAttribs = /** @type{number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS));
+ params = gl.getVertexAttrib(maxVertexAttribs, gl.VERTEX_ATTRIB_ARRAY_ENABLED);
+ this.expectError(gl.INVALID_VALUE);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_vertex_attrib_offset', 'Invalid gl.getVertexAttribOffset() usage', gl, function() {
+ /** @type{number} */ var ptr;
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not an accepted value.');
+ ptr = gl.getVertexAttribOffset(0, -1);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater than or equal to gl.MAX_VERTEX_ATTRIBS.');
+ /** @type{number} */ var maxVertexAttribs;
+ maxVertexAttribs = /** @type{number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS));
+ ptr = gl.getVertexAttribOffset(maxVertexAttribs, gl.VERTEX_ATTRIB_ARRAY_POINTER);
+ this.expectError(gl.INVALID_VALUE);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_frag_data_location', 'Invalid gl.getFragDataLocation() usage', gl, function() {
+ /** @type{WebGLShader} */ var shader = gl.createShader(gl.VERTEX_SHADER);
+ /** @type{WebGLProgram} */ var program = gl.createProgram();
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if program has not been linked.');
+ gl.getFragDataLocation(program, 'gl_FragColor');
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.deleteProgram(program);
+ gl.deleteShader(shader);
+ }));
+
+ // Enumerated state queries: Buffers
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_buffer_parameter', 'Invalid gl.getBufferParameter() usage', gl, function() {
+ /** @type{number} */ var params = -1;
+ /** @type{WebGLBuffer} */ var buf;
+ buf = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buf);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target or value is not an accepted value.');
+ params = /** @type{number} */ (gl.getBufferParameter(-1, gl.BUFFER_SIZE));
+ this.expectError(gl.INVALID_ENUM);
+ params = /** @type{number} */ (gl.getBufferParameter(gl.ARRAY_BUFFER, -1));
+ this.expectError(gl.INVALID_ENUM);
+ params = /** @type{number} */ (gl.getBufferParameter(-1, -1));
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if the reserved buffer object name 0 is bound to target.');
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+ params = /** @type{number} */ (gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE));
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.deleteBuffer(buf);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_framebuffer_attachment_parameter', 'Invalid gl.getFramebufferAttachmentParameter() usage', gl, function() {
+ /** @type{*} */ var params;
+ /** @type{WebGLFramebuffer} */ var fbo;
+ /** @type{Array<WebGLRenderbuffer>} */ var rbo = [];
+
+ fbo = gl.createFramebuffer();
+ rbo[0] = gl.createRenderbuffer();
+ rbo[1] = gl.createRenderbuffer();
+
+ gl.bindFramebuffer (gl.FRAMEBUFFER, fbo);
+ gl.bindRenderbuffer (gl.RENDERBUFFER, rbo[0]);
+ gl.renderbufferStorage (gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, 16, 16);
+ gl.framebufferRenderbuffer (gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, rbo[0]);
+ gl.bindRenderbuffer (gl.RENDERBUFFER, rbo[1]);
+ gl.renderbufferStorage (gl.RENDERBUFFER, gl.STENCIL_INDEX8, 16, 16);
+ gl.framebufferRenderbuffer (gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, rbo[1]);
+ gl.checkFramebufferStatus (gl.FRAMEBUFFER);
+ this.expectError (gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not one of the accepted tokens.');
+ gl.getFramebufferAttachmentParameter(-1, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE); // TYPE is gl.RENDERBUFFER
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not valid for the value of gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE.');
+ gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL); // TYPE is gl.RENDERBUFFER
+ this.expectError(gl.INVALID_ENUM);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.BACK, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME); // TYPE is gl.FRAMEBUFFER_DEFAULT
+ this.expectError(gl.INVALID_ENUM);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if attachment is gl.DEPTH_STENCIL_ATTACHMENT and different objects are bound to the depth and stencil attachment points of target.');
+ gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME);
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if the value of gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is gl.NONE and pname is not gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME.');
+ gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME); // TYPE is gl.NONE
+ this.expectError(gl.NO_ERROR);
+ gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE); // TYPE is gl.NONE
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION or gl.INVALID_ENUM is generated if attachment is not one of the accepted values for the current binding of target.');
+ gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.BACK, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME); // A FBO is bound so gl.BACK is invalid
+ this.expectError([gl.INVALID_OPERATION, gl.INVALID_ENUM]);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME); // Default framebuffer is bound so gl.COLOR_ATTACHMENT0 is invalid
+ this.expectError([gl.INVALID_OPERATION, gl.INVALID_ENUM]);
+
+ gl.deleteFramebuffer(fbo);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_renderbuffer_parameter', 'Invalid gl.getRenderbufferParameter() usage', gl, function() {
+ /** @type{number} */ var params = -1;
+ /** @type{WebGLRenderbuffer} */ var rbo;
+ rbo = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, rbo);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not gl.RENDERBUFFER.');
+ gl.getRenderbufferParameter(-1, gl.RENDERBUFFER_WIDTH);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not one of the accepted tokens.');
+ gl.getRenderbufferParameter(gl.RENDERBUFFER, -1);
+ this.expectError(gl.INVALID_ENUM);
+
+ gl.deleteRenderbuffer(rbo);
+ gl.bindRenderbuffer(gl.RENDERBUFFER, null);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_internalformat_parameter', 'Invalid gl.getInternalformatParameter() usage', gl, function() {
+ /** @type{WebGLRenderbuffer} */ var rbo = gl.createRenderbuffer();
+ /** @type{WebGLFramebuffer} */ var fbo = gl.createFramebuffer();
+ /** @type{WebGLTexture} */ var tex = gl.createTexture();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, rbo);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not gl.SAMPLES or gl.NUM_SAMPLE_COUNTS.');
+ gl.getInternalformatParameter (gl.RENDERBUFFER, gl.RGBA8, -1);
+ this.expectError (gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if internalformat is not color-, depth-, or stencil-renderable.');
+ gl.getInternalformatParameter (gl.RENDERBUFFER, gl.RG8_SNORM, gl.NUM_SAMPLE_COUNTS);
+ this.expectError (gl.INVALID_ENUM);
+ gl.getInternalformatParameter (gl.RENDERBUFFER, gl.COMPRESSED_RGB8_ETC2, gl.NUM_SAMPLE_COUNTS);
+ this.expectError (gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not gl.RENDERBUFFER.');
+ gl.getInternalformatParameter (-1, gl.RGBA8, gl.NUM_SAMPLE_COUNTS);
+ this.expectError (gl.INVALID_ENUM);
+ gl.getInternalformatParameter (gl.FRAMEBUFFER, gl.RGBA8, gl.NUM_SAMPLE_COUNTS);
+ this.expectError (gl.INVALID_ENUM);
+ gl.getInternalformatParameter (gl.TEXTURE_2D, gl.RGBA8, gl.NUM_SAMPLE_COUNTS);
+ this.expectError (gl.INVALID_ENUM);
+
+ gl.deleteRenderbuffer(rbo);
+ gl.deleteFramebuffer(fbo);
+ gl.deleteTexture(tex);
+
+ }));
+
+ // Query object queries
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_query', 'Invalid gl.getQuery() usage', gl, function() {
+ /** @type{number} */ var params = -1;
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target or pname is not an accepted value.');
+ gl.getQuery (gl.ANY_SAMPLES_PASSED, -1);
+ this.expectError (gl.INVALID_ENUM);
+ gl.getQuery (-1, gl.CURRENT_QUERY);
+ this.expectError (gl.INVALID_ENUM);
+ gl.getQuery (-1, -1);
+ this.expectError (gl.INVALID_ENUM);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_query_parameter', 'Invalid gl.getQueryParameter() usage', gl, function() {
+
+ /** @type{WebGLQuery} */ var id;
+ id = gl.createQuery();
+
+ bufferedLogToConsole('An exception is thrown if the query object is null.');
+ this.expectThrowNoError(function() {
+ gl.getQueryParameter (null, gl.QUERY_RESULT_AVAILABLE);
+ });
+
+ bufferedLogToConsole('// Note: ' + id + ' is not a query object yet, since it hasn\'t been used by gl.beginQuery');
+ gl.getQueryParameter (id, gl.QUERY_RESULT_AVAILABLE);
+ this.expectError (gl.INVALID_OPERATION);
+
+ gl.beginQuery (gl.ANY_SAMPLES_PASSED, id);
+ gl.endQuery (gl.ANY_SAMPLES_PASSED);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not an accepted value.');
+ gl.getQueryParameter (id, -1);
+ this.expectError (gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if id is the name of a currently active query object.');
+ gl.beginQuery (gl.ANY_SAMPLES_PASSED, id);
+ this.expectError (gl.NO_ERROR);
+ gl.getQueryParameter (id, gl.QUERY_RESULT_AVAILABLE);
+ this.expectError (gl.INVALID_OPERATION);
+ gl.endQuery (gl.ANY_SAMPLES_PASSED);
+ this.expectError (gl.NO_ERROR);
+
+ gl.deleteQuery(id);
+ }));
+
+ // Sync object queries
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('get_sync_parameter', 'Invalid gl.getSyncParameter() usage', gl, function() {
+ /** @type{WebGLSync} */ var sync;
+
+ bufferedLogToConsole('An exception is thrown if sync is null.');
+ this.expectThrowNoError(function() {
+ gl.getSyncParameter (null, gl.OBJECT_TYPE);
+ });
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not one of the accepted tokens.');
+ sync = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0);
+ this.expectError (gl.NO_ERROR);
+ gl.getSyncParameter (sync, -1);
+ this.expectError (gl.INVALID_ENUM);
+
+ }));
+
+ // Enumerated boolean state queries
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('is_enabled', 'Invalid gl.isEnabled() usage', gl, function() {
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if cap is not an accepted value.');
+ gl.isEnabled(-1);
+ this.expectError(gl.INVALID_ENUM);
+ gl.isEnabled(gl.TRIANGLES);
+ this.expectError(gl.INVALID_ENUM);
+
+ }));
+
+ // Named Object Usage
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('is_buffer', 'Invalid gl.isBuffer() usage', gl, function() {
+ /** @type{WebGLBuffer} */ var buffer;
+ /** @type{boolean} */ var isBuffer;
+
+ bufferedLogToConsole('A name returned by glGenBuffers, but not yet associated with a buffer object by calling glBindBuffer, is not the name of a buffer object.');
+ isBuffer = gl.isBuffer(buffer);
+ assertMsgOptions(!isBuffer, 'Got invalid boolean value', false, true);
+
+ buffer = gl.createBuffer();
+ isBuffer = gl.isBuffer(buffer);
+ assertMsgOptions(!isBuffer, 'Got invalid boolean value', false, true);
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
+ isBuffer = gl.isBuffer(buffer);
+ assertMsgOptions(isBuffer, 'Got invalid boolean value', false, true);
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+ gl.deleteBuffer(buffer);
+ isBuffer = gl.isBuffer(buffer);
+ assertMsgOptions(!isBuffer, 'Got invalid boolean value', false, true);
+
+ this.expectError (gl.NO_ERROR);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('is_framebuffer', 'Invalid gl.isFramebuffer() usage', gl, function() {
+ /** @type{WebGLFramebuffer} */ var fbo;
+ /** @type{boolean} */ var isFbo;
+
+ bufferedLogToConsole('A name returned by glGenFramebuffers, but not yet bound through a call to gl.bindFramebuffer is not the name of a framebuffer object.');
+ isFbo = gl.isFramebuffer(fbo);
+ assertMsgOptions(!isFbo, 'Got invalid boolean value', false, true);
+
+ fbo = gl.createFramebuffer();
+ isFbo = gl.isFramebuffer(fbo);
+ assertMsgOptions(!isFbo, 'Got invalid boolean value', false, true);
+
+ gl.bindFramebuffer (gl.FRAMEBUFFER, fbo);
+ isFbo = gl.isFramebuffer(fbo);
+ assertMsgOptions(isFbo, 'Got invalid boolean value', false, true);
+
+ gl.bindFramebuffer (gl.FRAMEBUFFER, null);
+ gl.deleteFramebuffer(fbo);
+ isFbo = gl.isFramebuffer(fbo);
+ assertMsgOptions(!isFbo, 'Got invalid boolean value', false, true);
+
+ this.expectError (gl.NO_ERROR);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('is_program', 'Invalid gl.isProgram() usage', gl, function() {
+ /** @type{WebGLProgram} */ var program;
+ /** @type{boolean} */ var isProgram;
+
+ bufferedLogToConsole('A name created with gl.createProgram, and not yet deleted with glDeleteProgram is a name of a program object.');
+ isProgram = gl.isProgram(program);
+ assertMsgOptions(!isProgram, 'Got invalid boolean value', false, true);
+
+ program = gl.createProgram();
+ isProgram = gl.isProgram(program);
+ assertMsgOptions(isProgram, 'Got invalid boolean value', false, true);
+
+ gl.deleteProgram(program);
+ isProgram = gl.isProgram(program);
+ assertMsgOptions(!isProgram, 'Got invalid boolean value', false, true);
+
+ this.expectError (gl.NO_ERROR);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('is_renderbuffer', 'Invalid gl.isRenderbuffer() usage', gl, function() {
+ /** @type{WebGLRenderbuffer} */ var rbo;
+ /** @type{boolean} */ var isRbo;
+
+ bufferedLogToConsole('A name returned by glGenRenderbuffers, but not yet bound through a call to gl.bindRenderbuffer or gl.framebufferRenderbuffer is not the name of a renderbuffer object.');
+ isRbo = gl.isRenderbuffer(rbo);
+ assertMsgOptions(!isRbo, 'Got invalid boolean value', false, true);
+
+ rbo = gl.createRenderbuffer();
+ isRbo = gl.isRenderbuffer(rbo);
+ assertMsgOptions(!isRbo, 'Got invalid boolean value', false, true);
+
+ gl.bindRenderbuffer (gl.RENDERBUFFER, rbo);
+ isRbo = gl.isRenderbuffer(rbo);
+ assertMsgOptions(isRbo, 'Got invalid boolean value', false, true);
+
+ gl.bindRenderbuffer (gl.RENDERBUFFER, null);
+ gl.deleteRenderbuffer(rbo);
+ isRbo = gl.isRenderbuffer(rbo);
+ assertMsgOptions(!isRbo, 'Got invalid boolean value', false, true);
+
+ this.expectError (gl.NO_ERROR);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('is_shader', 'Invalid gl.isShader() usage', gl, function() {
+ /** @type{WebGLShader} */ var shader;
+ /** @type{boolean} */ var isShader;
+
+ bufferedLogToConsole('A name created with glCreateShader, and not yet deleted with glDeleteShader is a name of a shader object.');
+ isShader = gl.isProgram(shader);
+ assertMsgOptions(!isShader, 'Got invalid boolean value', false, true);
+
+ shader = gl.createShader(gl.VERTEX_SHADER);
+ isShader = gl.isShader(shader);
+ assertMsgOptions(isShader, 'Got invalid boolean value', false, true);
+
+ gl.deleteShader (shader);
+ isShader = gl.isShader(shader);
+ assertMsgOptions(!isShader, 'Got invalid boolean value', false, true);
+
+ this.expectError (gl.NO_ERROR);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('is_texture', 'Invalid gl.isTexture() usage', gl, function() {
+ /** @type{WebGLTexture} */ var texture;
+ /** @type{boolean} */ var isTexture;
+
+ bufferedLogToConsole('A name returned by glGenTextures, but not yet bound through a call to glBindTexture is not the name of a texture.');
+ isTexture = gl.isTexture(texture);
+ assertMsgOptions(!isTexture, 'Got invalid boolean value', false, true);
+
+ texture = gl.createTexture();
+ isTexture = gl.isTexture(texture);
+ assertMsgOptions(!isTexture, 'Got invalid boolean value', false, true);
+
+ gl.bindTexture (gl.TEXTURE_2D, texture);
+ isTexture = gl.isTexture(texture);
+ assertMsgOptions(isTexture, 'Got invalid boolean value', false, true);
+
+ gl.bindTexture (gl.TEXTURE_2D, null);
+ gl.deleteTexture(texture);
+ isTexture = gl.isTexture(texture);
+ assertMsgOptions(!isTexture, 'Got invalid boolean value', false, true);
+
+ this.expectError (gl.NO_ERROR);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('is_query', 'Invalid gl.isQuery() usage', gl, function() {
+ /** @type{WebGLQuery} */ var query;
+ /** @type{boolean} */ var isQuery;
+
+ bufferedLogToConsole('A name returned by glGenQueries, but not yet associated with a query object by calling gl.beginQuery, is not the name of a query object.');
+ isQuery = gl.isQuery(query);
+ assertMsgOptions(!isQuery, 'Got invalid boolean value', false, true);
+
+ query = gl.createQuery();
+ isQuery = gl.isQuery(query);
+ assertMsgOptions(!isQuery, 'Got invalid boolean value', false, true);
+
+ gl.beginQuery (gl.ANY_SAMPLES_PASSED, query);
+ isQuery = gl.isQuery(query);
+ assertMsgOptions(isQuery, 'Got invalid boolean value', false, true);
+
+ gl.endQuery (gl.ANY_SAMPLES_PASSED);
+ gl.deleteQuery (query);
+ isQuery = gl.isQuery(query);
+ assertMsgOptions(!isQuery, 'Got invalid boolean value', false, true);
+
+ this.expectError (gl.NO_ERROR);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('is_sampler', 'Invalid gl.isSampler() usage', gl, function() {
+ /** @type{WebGLSampler} */ var sampler;
+ /** @type{boolean} */ var isSampler;
+
+ bufferedLogToConsole('A name returned by glGenSamplers is the name of a sampler object.');
+ isSampler = gl.isSampler(sampler);
+ assertMsgOptions(!isSampler, 'Got invalid boolean value', false, true);
+
+ sampler = gl.createSampler();
+ isSampler = gl.isSampler(sampler);
+ assertMsgOptions(isSampler, 'Got invalid boolean value', false, true);
+
+ gl.bindSampler(0, sampler);
+ isSampler = gl.isSampler(sampler);
+ assertMsgOptions(isSampler, 'Got invalid boolean value', false, true);
+
+ gl.deleteSampler(sampler);
+ isSampler = gl.isSampler(sampler);
+ assertMsgOptions(!isSampler, 'Got invalid boolean value', false, true);
+
+ this.expectError (gl.NO_ERROR);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('is_sync', 'Invalid gl.isSync() usage', gl, function() {
+ /** @type{WebGLSync} */ var sync;
+ /** @type{boolean} */ var isSync;
+
+ bufferedLogToConsole('A name returned by gl.fenceSync is the name of a sync object.');
+ isSync = gl.isSync(sync);
+ assertMsgOptions(!isSync, 'Got invalid boolean value', false, true);
+
+ sync = gl.fenceSync (gl.SYNC_GPU_COMMANDS_COMPLETE, 0);
+ isSync = gl.isSync(sync);
+ assertMsgOptions(isSync, 'Got invalid boolean value', false, true);
+
+ gl.deleteSync (sync);
+ isSync = gl.isSync(sync);
+ assertMsgOptions(!isSync, 'Got invalid boolean value', false, true);
+
+ this.expectError (gl.NO_ERROR);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('is_transform_feedback', 'Invalid gl.isTransformFeedback() usage', gl, function() {
+ /** @type{WebGLTransformFeedback} */ var tf;
+ /** @type{boolean} */ var isTF;
+
+ bufferedLogToConsole('A name returned by glGenTransformFeedbacks, but not yet bound using glBindTransformFeedback, is not the name of a transform feedback object.');
+ isTF = gl.isTransformFeedback(tf);
+ assertMsgOptions(!isTF, 'Got invalid boolean value', false, true);
+
+ tf = gl.createTransformFeedback();
+ isTF = gl.isTransformFeedback(tf);
+ assertMsgOptions(!isTF, 'Got invalid boolean value', false, true);
+
+ gl.bindTransformFeedback (gl.TRANSFORM_FEEDBACK, tf);
+ isTF = gl.isTransformFeedback(tf);
+ assertMsgOptions(isTF, 'Got invalid boolean value', false, true);
+
+ gl.bindTransformFeedback (gl.TRANSFORM_FEEDBACK, null);
+ gl.deleteTransformFeedback (tf);
+ isTF = gl.isTransformFeedback(tf);
+ assertMsgOptions(!isTF, 'Got invalid boolean value', false, true);
+
+ this.expectError (gl.NO_ERROR);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('is_vertex_array', 'Invalid gl.isVertexArray() usage', gl, function() {
+ /** @type{WebGLVertexArrayObject} */ var vao;
+ /** @type{boolean} */ var isVao;
+
+ bufferedLogToConsole('A name returned by glGenVertexArrays, but not yet bound using glBindVertexArray, is not the name of a vertex array object.');
+ isVao = gl.isVertexArray(vao);
+ assertMsgOptions(!isVao, 'Got invalid boolean value', false, true);
+
+ vao = gl.createVertexArray();
+ isVao = gl.isVertexArray(vao);
+ assertMsgOptions(!isVao, 'Got invalid boolean value', false, true);
+
+ gl.bindVertexArray (vao);
+ isVao = gl.isVertexArray(vao);
+ assertMsgOptions(isVao, 'Got invalid boolean value', false, true);
+
+ gl.bindVertexArray (null);
+ gl.deleteVertexArray (vao);
+ isVao = gl.isVertexArray(vao);
+ assertMsgOptions(!isVao, 'Got invalid boolean value', false, true);
+
+ this.expectError (gl.NO_ERROR);
+ }));
+ };
+
+ /**
+ * @param {WebGL2RenderingContext} gl
+ */
+ es3fNegativeStateApiTests.run = function(gl) {
+ var testName = 'state';
+ var testDescription = 'Negative GL State API Cases';
+ var state = tcuTestCase.runner;
+
+ state.testName = testName;
+ state.testCases = tcuTestCase.newTest(testName, testDescription, null);
+
+ //Set up name and description of this test series.
+ setCurrentTestName(testName);
+ description(testDescription);
+ try {
+ es3fNegativeStateApiTests.init(gl);
+ tcuTestCase.runner.runCallback(tcuTestCase.runTestCases);
+ } catch (err) {
+ bufferedLogToConsole(err);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeTextureApiTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeTextureApiTests.js
new file mode 100644
index 0000000000..8bccf1bb37
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeTextureApiTests.js
@@ -0,0 +1,3002 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES 3.0 Module
+ * -------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief Negative Texture API tests.
+ *//*--------------------------------------------------------------------*/
+'use strict';
+goog.provide('functional.gles3.es3fNegativeTextureApiTests');
+
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.common.tcuTexture');
+goog.require('functional.gles3.es3fApiCase');
+goog.require('framework.opengl.gluTexture');
+goog.require('framework.opengl.gluTextureUtil');
+
+goog.scope(function() {
+
+ var es3fNegativeTextureApiTests = functional.gles3.es3fNegativeTextureApiTests;
+ var tcuTexture = framework.common.tcuTexture;
+ var es3fApiCase = functional.gles3.es3fApiCase;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var gluTexture = framework.opengl.gluTexture;
+ var gluTextureUtil = framework.opengl.gluTextureUtil;
+
+ function etc2Unsupported() {
+ debug("Skipping test: no support for WEBGL_compressed_texture_etc");
+ }
+
+
+ /**
+ * @param {number} width
+ * @param {number} height
+ * @return {number}
+ */
+ es3fNegativeTextureApiTests.etc2DataSize = function(width, height) {
+ return Math.ceil(width / 4) * Math.ceil(height / 4) * 8;
+ };
+
+ /**
+ * @param {number} width
+ * @param {number} height
+ * @return {number}
+ */
+ es3fNegativeTextureApiTests.etc2EacDataSize = function(width, height) {
+ return 2 * es3fNegativeTextureApiTests.etc2DataSize(width, height);
+ };
+
+ /**
+ * @param {function(number)} func
+ */
+ es3fNegativeTextureApiTests.forCubeFaces = function(func) {
+ var faceGLVar;
+ for (var faceIterTcu in tcuTexture.CubeFace) {
+ faceGLVar = gluTexture.cubeFaceToGLFace(tcuTexture.CubeFace[faceIterTcu]);
+ func(faceGLVar);
+ }
+ };
+
+ /**
+ * @param {WebGL2RenderingContext} gl
+ */
+ es3fNegativeTextureApiTests.init = function(gl) {
+
+ var haveCompressedTextureETC = gluTextureUtil.enableCompressedTextureETC();
+
+ var testGroup = tcuTestCase.runner.testCases;
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('activetexture', 'Invalid gl.ActiveTexture() usage', gl,
+ function() {
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if texture is not one of gl.TEXTUREi, where i ranges from 0 to (gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS - 1).');
+ gl.activeTexture(-1);
+ this.expectError(gl.INVALID_ENUM);
+ var numMaxTextureUnits = /** @type {number} */(gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS));
+ gl.activeTexture(gl.TEXTURE0 + numMaxTextureUnits);
+ this.expectError(gl.INVALID_ENUM);
+
+ }));
+
+ // gl.bindTexture
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('bindTexture', 'Invalid gl.bindTexture() usage', gl,
+ function() {
+
+ /** @type {Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not one of the allowable values.');
+ gl.bindTexture(0, texture[0]);
+ this.expectError(gl.INVALID_ENUM);
+ gl.bindTexture(gl.FRAMEBUFFER, texture[0]);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if texture was previously created with a target that doesn\'t match that of target.');
+ gl.bindTexture(gl.TEXTURE_2D, texture[0]);
+ this.expectError(gl.NO_ERROR);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[0]);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.bindTexture(gl.TEXTURE_3D, texture[0]);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.bindTexture(gl.TEXTURE_2D_ARRAY, texture[0]);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]);
+ this.expectError(gl.NO_ERROR);
+ gl.bindTexture(gl.TEXTURE_2D, texture[1]);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.bindTexture(gl.TEXTURE_3D, texture[1]);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.bindTexture(gl.TEXTURE_2D_ARRAY, texture[1]);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+ }));
+
+ // gl.compressedTexImage2D
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage2d_invalid_target', 'Invalid gl.compressedTexImage2D() usage', gl,
+ function() {
+ if (!haveCompressedTextureETC) { etc2Unsupported(); return; }
+
+ /** @type {Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture[0]);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]);
+
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is invalid.');
+ /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(0);
+ gl.compressedTexImage2D(0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, uint8);
+ this.expectError(gl.INVALID_ENUM);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, uint8);
+ this.expectError(gl.INVALID_ENUM);
+
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage2d_invalid_format', 'Invalid gl.compressedTexImage2D() usage', gl,
+ function() {
+
+
+ /** @type {Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture[0]);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]);
+
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if internalformat is not a supported format returned in gl.COMPRESSED_TEXTURE_FORMATS.');
+ /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(0);
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, uint8);
+ this.expectError(gl.INVALID_ENUM);
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0, 0, 0, uint8);
+ this.expectError(gl.INVALID_ENUM);
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA32F, 0, 0, 0, uint8);
+ this.expectError(gl.INVALID_ENUM);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, 0, 0, 0, 0, uint8);
+ this.expectError(gl.INVALID_ENUM);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, 0, 0, 0, 0, uint8);
+ this.expectError(gl.INVALID_ENUM);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, 0, 0, 0, 0, uint8);
+ this.expectError(gl.INVALID_ENUM);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, 0, 0, 0, 0, uint8);
+ this.expectError(gl.INVALID_ENUM);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, 0, 0, 0, 0, uint8);
+ this.expectError(gl.INVALID_ENUM);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, 0, 0, 0, 0, uint8);
+ this.expectError(gl.INVALID_ENUM);
+
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage2d_neg_level', 'Invalid gl.compressedTexImage2D() usage', gl,
+ function() {
+ if (!haveCompressedTextureETC) { etc2Unsupported(); return; }
+
+
+ /** @type {Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture[0]);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]);
+
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0.');
+ /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(0);
+ gl.compressedTexImage2D(gl.TEXTURE_2D, -1, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, -1, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, -1, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, -1, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, -1, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, -1, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, -1, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage2d_max_level', 'Invalid gl.compressedTexImage2D() usage', gl,
+ function() {
+ if (!haveCompressedTextureETC) { etc2Unsupported(); return; }
+
+
+ /** @type {Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture[0]);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]);
+
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_TEXTURE_SIZE) for a 2d texture target.');
+ /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(16, 16));
+
+ /** @type {number} */ var log2MaxTextureSize = Math.floor(Math.log2(/** @type {number} */(gl.getParameter(gl.MAX_TEXTURE_SIZE)))) + 1;
+ gl.compressedTexImage2D(gl.TEXTURE_2D, log2MaxTextureSize, gl.COMPRESSED_RGB8_ETC2, 16, 16, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_CUBE_MAP_TEXTURE_SIZE) for a cubemap target.');
+ /** @type {number} */ var log2MaxCubemapSize = Math.floor(Math.log2(/** @type {number} */(gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE)))) + 1;
+
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, log2MaxCubemapSize, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, log2MaxCubemapSize, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, log2MaxCubemapSize, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, log2MaxCubemapSize, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, log2MaxCubemapSize, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, log2MaxCubemapSize, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage2d_neg_width_height', 'Invalid gl.compressedTexImage2D() usage', gl,
+ function() {
+ if (!haveCompressedTextureETC) { etc2Unsupported(); return; }
+
+
+ /** @type {Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture[0]);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]);
+
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height is less than 0.');
+
+ bufferedLogToConsole('gl.TEXTURE_2D target');
+ /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(0);
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, 0, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, -1, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, -1, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_X target');
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, 0, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, -1, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, -1, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Y target');
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, 0, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, -1, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, -1, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Z target');
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, 0, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, -1, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, -1, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_X target');
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, 0, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, -1, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, -1, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Y target');
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, 0, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, -1, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, -1, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Z target');
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, 0, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, -1, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, -1, 0, uint8);
+ this.expectError(gl.INVALID_VALUE);
+
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage2d_max_width_height', 'Invalid gl.compressedTexImage2D() usage', gl,
+ function() {
+ if (!haveCompressedTextureETC) { etc2Unsupported(); return; }
+
+
+ /** @type {Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture[0]);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]);
+
+ var maxTextureSize = /** @type {number} */ (gl.getParameter(gl.MAX_TEXTURE_SIZE)) + 1;
+ var maxCubemapSize = /** @type {number} */ (gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE)) + 1;
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height is greater than gl.MAX_TEXTURE_SIZE.');
+
+ var maxSideSize = Math.max(maxCubemapSize, maxTextureSize);
+ var scratchBuffer = new ArrayBuffer(
+ Math.max(es3fNegativeTextureApiTests.etc2EacDataSize(maxSideSize, 1),
+ es3fNegativeTextureApiTests.etc2EacDataSize(1, maxSideSize)));
+ function getUint8ArrayEtc2EacDataSize(w, h) {
+ return new Uint8Array(scratchBuffer, 0, es3fNegativeTextureApiTests.etc2EacDataSize(w, h));
+ }
+
+ var dataTextureMaxByOne = getUint8ArrayEtc2EacDataSize(maxTextureSize, 1);
+ var dataTextureOneByMax = getUint8ArrayEtc2EacDataSize(1, maxTextureSize);
+
+ bufferedLogToConsole('gl.TEXTURE_2D target');
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, maxTextureSize, 1, 0, dataTextureMaxByOne);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 1, maxTextureSize, 0, dataTextureOneByMax);
+ this.expectError(gl.INVALID_VALUE);
+
+ var dataCubemapMaxByOne = getUint8ArrayEtc2EacDataSize(maxCubemapSize, 1);
+ var dataCubemapOneByMax = getUint8ArrayEtc2EacDataSize(1, maxCubemapSize);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_X target');
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, maxCubemapSize, 1, 0, dataCubemapMaxByOne);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 1, maxCubemapSize, 0, dataCubemapOneByMax);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Y target');
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, maxCubemapSize, 1, 0, dataCubemapMaxByOne);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 1, maxCubemapSize, 0, dataCubemapOneByMax);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Z target');
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, maxCubemapSize, 1, 0, dataCubemapMaxByOne);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 1, maxCubemapSize, 0, dataCubemapOneByMax);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_X target');
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, maxCubemapSize, 1, 0, dataCubemapMaxByOne);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 1, maxCubemapSize, 0, dataCubemapOneByMax);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Y target');
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, maxCubemapSize, 1, 0, dataCubemapMaxByOne);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 1, maxCubemapSize, 0, dataCubemapOneByMax);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Z target');
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, maxCubemapSize, 1, 0, dataCubemapMaxByOne);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 1, maxCubemapSize, 0, dataCubemapOneByMax);
+ this.expectError(gl.INVALID_VALUE);
+
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage2d_invalid_border', 'Invalid gl.compressedTexImage2D() usage', gl,
+ function() {
+ if (!haveCompressedTextureETC) { etc2Unsupported(); return; }
+
+
+ /** @type {Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture[0]);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]);
+
+
+ /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(0);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if border is not 0.');
+
+ bufferedLogToConsole('gl.TEXTURE_2D target');
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 1, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, -1, uint8);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_X target');
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 1, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, -1, uint8);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Y target');
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 1, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, -1, uint8);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Z target');
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 1, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, -1, uint8);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_X target');
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 1, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, -1, uint8);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Y target');
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 1, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, -1, uint8);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Z target');
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 1, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, -1, uint8);
+ this.expectError(gl.INVALID_VALUE);
+
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage2d_invalid_size', 'Invalid gl.compressedTexImage2D() usage', gl,
+ function() {
+ if (!haveCompressedTextureETC) { etc2Unsupported(); return; }
+
+
+ /** @type {WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if imageSize is not consistent with the format, dimensions, and contents of the specified compressed image data.');
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, new Uint8Array(1));
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 0, new Uint8Array(4 * 4 * 8));
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.COMPRESSED_RGB8_ETC2, 16, 16, 0, new Uint8Array(4 * 4 * 16));
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.COMPRESSED_SIGNED_R11_EAC, 16, 16, 0, new Uint8Array(4 * 4 * 16));
+ this.expectError(gl.INVALID_VALUE);
+
+
+ gl.deleteTexture(texture);
+
+
+ }));
+
+ // gl.copyTexImage2D
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('copyteximage2d_invalid_target', 'Invalid gl.copyTexImage2D() usage', gl,
+ function() {
+
+
+ /** @type {WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is invalid.');
+ gl.copyTexImage2D(0, 0, gl.RGB, 0, 0, 64, 64, 0);
+ this.expectError(gl.INVALID_ENUM);
+
+
+ gl.deleteTexture(texture);
+
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('copyteximage2d_invalid_format', 'Invalid gl.copyTexImage2D() usage', gl,
+ function() {
+
+
+ /** @type {Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture[0]);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]);
+
+
+ bufferedLogToConsole('gl.INVALID_ENUM or gl.INVALID_VALUE is generated if internalformat is not an accepted format.');
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 64, 64, 0);
+ this.expectError([gl.INVALID_ENUM, gl.INVALID_VALUE]);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, 0, 0, 0, 16, 16, 0);
+ this.expectError([gl.INVALID_ENUM, gl.INVALID_VALUE]);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, 0, 0, 0, 16, 16, 0);
+ this.expectError([gl.INVALID_ENUM, gl.INVALID_VALUE]);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, 0, 0, 0, 16, 16, 0);
+ this.expectError([gl.INVALID_ENUM, gl.INVALID_VALUE]);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, 0, 0, 0, 16, 16, 0);
+ this.expectError([gl.INVALID_ENUM, gl.INVALID_VALUE]);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, 0, 0, 0, 16, 16, 0);
+ this.expectError([gl.INVALID_ENUM, gl.INVALID_VALUE]);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, 0, 0, 0, 16, 16, 0);
+ this.expectError([gl.INVALID_ENUM, gl.INVALID_VALUE]);
+
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('copyteximage2d_inequal_width_height_cube', 'Invalid gl.copyTexImage2D() usage', gl,
+ function() {
+
+
+ /** @type {WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture);
+
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if target is one of the six cube map 2D image targets and the width and height parameters are not equal.');
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 0, 0, 16, 17, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, 0, 0, 16, 17, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, 0, 0, 16, 17, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, 0, 0, 16, 17, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, 0, 0, 16, 17, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, 0, 0, 16, 17, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+
+ gl.deleteTexture(texture);
+
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('copyteximage2d_neg_level', 'Invalid gl.copyTexImage2D() usage', gl,
+ function() {
+
+
+ /** @type {Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture[0]);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]);
+
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0.');
+ gl.copyTexImage2D(gl.TEXTURE_2D, -1, gl.RGB, 0, 0, 64, 64, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, -1, gl.RGB, 0, 0, 16, 16, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, -1, gl.RGB, 0, 0, 16, 16, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, -1, gl.RGB, 0, 0, 16, 16, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, -1, gl.RGB, 0, 0, 16, 16, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, -1, gl.RGB, 0, 0, 16, 16, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, -1, gl.RGB, 0, 0, 16, 16, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('copyteximage2d_max_level', 'Invalid gl.copyTexImage2D() usage', gl,
+ function() {
+
+ /** @type {Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture[0]);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]);
+
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_TEXTURE_SIZE).');
+ /** @type {number} */ var log2MaxTextureSize = Math.floor(Math.log2(/** @type {number} */(gl.getParameter(gl.MAX_TEXTURE_SIZE)))) + 1;
+ gl.copyTexImage2D(gl.TEXTURE_2D, log2MaxTextureSize, gl.RGB, 0, 0, 64, 64, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_CUBE_MAP_TEXTURE_SIZE).');
+ /** @type {number} */ var log2MaxCubemapSize = Math.floor(Math.log2(/** @type {number} */(gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE)))) + 1;
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, log2MaxCubemapSize, gl.RGB, 0, 0, 16, 16, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, log2MaxCubemapSize, gl.RGB, 0, 0, 16, 16, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, log2MaxCubemapSize, gl.RGB, 0, 0, 16, 16, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, log2MaxCubemapSize, gl.RGB, 0, 0, 16, 16, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, log2MaxCubemapSize, gl.RGB, 0, 0, 16, 16, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, log2MaxCubemapSize, gl.RGB, 0, 0, 16, 16, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('copyteximage2d_neg_width_height', 'Invalid gl.copyTexImage2D() usage', gl,
+ function() {
+
+
+ /** @type {Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture[0]);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]);
+
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height is less than 0.');
+
+ bufferedLogToConsole('gl.TEXTURE_2D target');
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGB, 0, 0, -1, 1, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGB, 0, 0, 1, -1, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGB, 0, 0, -1, -1, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_X target');
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 0, 0, -1, 1, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 0, 0, 1, -1, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 0, 0, -1, -1, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Y target');
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, 0, 0, -1, 1, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, 0, 0, 1, -1, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, 0, 0, -1, -1, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Z target');
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, 0, 0, -1, 1, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, 0, 0, 1, -1, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, 0, 0, -1, -1, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_X target');
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, 0, 0, -1, 1, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, 0, 0, 1, -1, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, 0, 0, -1, -1, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Y target');
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, 0, 0, -1, 1, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, 0, 0, 1, -1, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, 0, 0, -1, -1, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Z target');
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, 0, 0, -1, 1, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, 0, 0, 1, -1, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, 0, 0, -1, -1, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('copyteximage2d_max_width_height', 'Invalid gl.copyTexImage2D() usage', gl,
+ function() {
+
+
+ /** @type {Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture[0]);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]);
+
+
+ var maxTextureSize = /** @type {number} */(gl.getParameter(gl.MAX_TEXTURE_SIZE)) + 1;
+ var maxCubemapSize = /** @type {number} */(gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE)) + 1;
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height is greater than gl.MAX_TEXTURE_SIZE.');
+
+ bufferedLogToConsole('gl.TEXTURE_2D target');
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGB, 0, 0, maxTextureSize, 1, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGB, 0, 0, 1, maxTextureSize, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGB, 0, 0, maxTextureSize, maxTextureSize, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_X target');
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 0, 0, 1, maxCubemapSize, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 0, 0, maxCubemapSize, 1, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 0, 0, maxCubemapSize, maxCubemapSize, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Y target');
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, 0, 0, 1, maxCubemapSize, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, 0, 0, maxCubemapSize, 1, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, 0, 0, maxCubemapSize, maxCubemapSize, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Z target');
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, 0, 0, 1, maxCubemapSize, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, 0, 0, maxCubemapSize, 1, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, 0, 0, maxCubemapSize, maxCubemapSize, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_X target');
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, 0, 0, 1, maxCubemapSize, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, 0, 0, maxCubemapSize, 1, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, 0, 0, maxCubemapSize, maxCubemapSize, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Y target');
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, 0, 0, 1, maxCubemapSize, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, 0, 0, maxCubemapSize, 1, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, 0, 0, maxCubemapSize, maxCubemapSize, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Z target');
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, 0, 0, 1, maxCubemapSize, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, 0, 0, maxCubemapSize, 1, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, 0, 0, maxCubemapSize, maxCubemapSize, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('copyteximage2d_invalid_border', 'Invalid gl.copyTexImage2D() usage', gl,
+ function() {
+
+
+ /** @type {Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture[0]);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]);
+
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if border is not 0.');
+
+ bufferedLogToConsole('gl.TEXTURE_2D target');
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGB, 0, 0, 0, 0, -1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGB, 0, 0, 0, 0, 1);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_X target');
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 0, 0, 0, 0, -1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 0, 0, 0, 0, 1);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Y target');
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, 0, 0, 0, 0, -1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, 0, 0, 0, 0, 1);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_2D target');
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, 0, 0, 0, 0, -1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, 0, 0, 0, 0, 1);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_X target');
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, 0, 0, 0, 0, -1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, 0, 0, 0, 0, 1);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Y target');
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, 0, 0, 0, 0, -1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, 0, 0, 0, 0, 1);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Z target');
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, 0, 0, 0, 0, -1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, 0, 0, 0, 0, 1);
+ this.expectError(gl.INVALID_VALUE);
+
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('copyteximage2d_incomplete_framebuffer', 'Invalid gl.copyTexImage2D() usage', gl,
+ function() {
+
+
+ /** @type {Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture[0]);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]);
+
+
+ /** @type {WebGLFramebuffer} */ var fbo;
+ fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ bufferedLogToConsole('gl.INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.');
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, 0, 0, 0, 0, 0);
+ this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGBA8, 0, 0, 0, 0, 0);
+ this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGBA8, 0, 0, 0, 0, 0);
+ this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGBA8, 0, 0, 0, 0, 0);
+ this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGBA8, 0, 0, 0, 0, 0);
+ this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGBA8, 0, 0, 0, 0, 0);
+ this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION);
+ gl.copyTexImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGBA8, 0, 0, 0, 0, 0);
+ this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION);
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.deleteFramebuffer(fbo);
+
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+
+ }));
+
+ // gl.copyTexSubImage2D
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('copytexsubimage2d_invalid_target', 'Invalid gl.copyTexSubImage2D() usage', gl,
+ function() {
+
+ /** @type {WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is invalid.');
+ gl.copyTexSubImage2D(0, 0, 0, 0, 0, 0, 4, 4);
+ this.expectError(gl.INVALID_ENUM);
+
+ gl.deleteTexture(texture);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('copytexsubimage2d_neg_level', 'Invalid gl.copyTexSubImage2D() usage', gl,
+ function() {
+ /** @type {Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture[0]);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]);
+ es3fNegativeTextureApiTests.forCubeFaces(function(faceGL) {
+ gl.texImage2D(faceGL, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ });
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0.');
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, -1, 0, 0, 0, 0, 4, 4);
+ this.expectError(gl.INVALID_VALUE);
+ var local = this;
+ es3fNegativeTextureApiTests.forCubeFaces(function(faceGL) {
+ gl.copyTexSubImage2D(faceGL, -1, 0, 0, 0, 0, 4, 4);
+ local.expectError(gl.INVALID_VALUE);
+ });
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('copytexsubimage2d_max_level', 'Invalid gl.copyTexSubImage2D() usage', gl,
+ function() {
+ /** @type{Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture[0]);
+ gl.texImage2D (gl.TEXTURE_2D, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]);
+ es3fNegativeTextureApiTests.forCubeFaces(function(faceGL) {
+ gl.texImage2D(faceGL, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ });
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_TEXTURE_SIZE) for 2D texture targets.');
+ /** @type{number} */ var log2MaxTextureSize = Math.floor(Math.log2(/** @type{number} */(gl.getParameter(gl.MAX_TEXTURE_SIZE)))) + 1;
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, log2MaxTextureSize, 0, 0, 0, 0, 4, 4);
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_CUBE_MAP_SIZE) for cubemap targets.');
+ /** @type{number} */ var log2MaxCubemapSize = Math.floor(Math.log2(/** @type{number} */(gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE)))) + 1;
+ var local = this;
+ es3fNegativeTextureApiTests.forCubeFaces(function(faceGL) {
+ gl.copyTexSubImage2D(faceGL, log2MaxCubemapSize, 0, 0, 0, 0, 4, 4);
+ local.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+ });
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('copytexsubimage2d_neg_offset', 'Invalid gl.copyTexSubImage2D() usage', gl,
+ function() {
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texImage2D (gl.TEXTURE_2D, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if xoffset < 0 or yoffset < 0.');
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, -1, 0, 0, 0, 4, 4);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, -1, 0, 0, 4, 4);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, -1, -1, 0, 0, 4, 4);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteTexture(texture);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('copytexsubimage2d_invalid_offset', 'Invalid gl.copyTexSubImage2D() usage', gl,
+ function() {
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texImage2D (gl.TEXTURE_2D, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if xoffset + width > texture_width or yoffset + height > texture_height.');
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 14, 0, 0, 0, 4, 4);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, 14, 0, 0, 4, 4);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 14, 14, 0, 0, 4, 4);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteTexture(texture);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('copytexsubimage2d_neg_width_height', 'Invalid gl.copyTexSubImage2D() usage', gl,
+ function() {
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texImage2D (gl.TEXTURE_2D, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height is less than 0.');
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, -1, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, 0, -1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, -1, -1);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteTexture(texture);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('copytexsubimage2d_incomplete_framebuffer', 'Invalid gl.copyTexSubImage2D() usage', gl,
+ function() {
+ bufferedLogToConsole('gl.INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.');
+ /** @type{Array<WebGLTexture>} */ var texture = [];
+ /** @type{WebGLFramebuffer} */ var fbo;
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture[0]);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGBA, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGBA, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGBA, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGBA, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGBA, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGBA, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.NO_ERROR);
+
+ fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ this.expectError(gl.NO_ERROR);
+
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, 0, 0);
+ this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION);
+ gl.copyTexSubImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, 0, 0, 0, 0, 0, 0);
+ this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION);
+ gl.copyTexSubImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, 0, 0, 0, 0, 0, 0);
+ this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION);
+ gl.copyTexSubImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, 0, 0, 0, 0, 0, 0);
+ this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION);
+ gl.copyTexSubImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, 0, 0, 0, 0, 0, 0);
+ this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION);
+ gl.copyTexSubImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, 0, 0, 0, 0, 0, 0);
+ this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION);
+ gl.copyTexSubImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, 0, 0, 0, 0, 0, 0);
+ this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION);
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.deleteFramebuffer(fbo);
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+
+ }));
+
+ // glDeleteTextures
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('deletetextures', 'glDeleteTextures() usage', gl,
+ function() {
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+
+ bufferedLogToConsole('gl.NO_ERROR is generated if texture is null.');
+ gl.deleteTexture(null);
+ this.expectError(gl.NO_ERROR);
+
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.deleteTexture(null);
+ this.expectError(gl.NO_ERROR);
+
+ gl.deleteTexture(texture);
+ }));
+
+ // gl.generateMipmap
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('generatemipmap', 'Invalid gl.generateMipmap() usage', gl,
+ function() {
+ /** @type{Array<WebGLTexture>} */ var texture = [];
+ /** @type{WebGLFramebuffer} */ var fbo;
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not gl.TEXTURE_2D or gl.TEXTURE_CUBE_MAP.');
+ gl.generateMipmap(0);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('INVALID_OPERATION is generated if the texture bound to target is not cube complete.');
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[0]);
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.REPEAT);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 0, 0, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ gl.generateMipmap(gl.TEXTURE_CUBE_MAP);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[0]);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 16, 16, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, 16, 16, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, 16, 16, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, 16, 16, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, 16, 16, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, 32, 32, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ gl.generateMipmap(gl.TEXTURE_CUBE_MAP);
+ this.expectError(gl.INVALID_OPERATION);
+
+ if (haveCompressedTextureETC) {
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if the zero level array is stored in a compressed internal format.');
+ gl.bindTexture(gl.TEXTURE_2D, texture[1]);
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, new Uint8Array(0));
+ gl.generateMipmap(gl.TEXTURE_2D);
+ this.expectError(gl.INVALID_OPERATION);
+ } else {
+ etc2Unsupported();
+ }
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if the level base array was not specified with an unsized internal format or a sized internal format that is both color-renderable and texture-filterable.');
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB8_SNORM, 0, 0, 0, gl.RGB, gl.BYTE, null);
+ gl.generateMipmap(gl.TEXTURE_2D);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.R8I, 0, 0, 0, gl.RED_INTEGER, gl.BYTE, null);
+ gl.generateMipmap(gl.TEXTURE_2D);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32F, 0, 0, 0, gl.RGBA, gl.FLOAT, null);
+ gl.generateMipmap(gl.TEXTURE_2D);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+ }));
+
+ // gl.pixelStorei
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('pixelstorei', 'Invalid gl.pixelStorei() usage', gl,
+ function() {
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if pname is not an accepted value.');
+ gl.pixelStorei(0,1);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if a negative row length, pixel skip, or row skip value is specified, or if alignment is specified as other than 1, 2, 4, or 8.');
+ gl.pixelStorei(gl.PACK_ROW_LENGTH, -1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.pixelStorei(gl.PACK_SKIP_ROWS, -1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.pixelStorei(gl.PACK_SKIP_PIXELS, -1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.pixelStorei(gl.UNPACK_ROW_LENGTH, -1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, -1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.pixelStorei(gl.UNPACK_SKIP_ROWS, -1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, -1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.pixelStorei(gl.UNPACK_SKIP_IMAGES, -1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.pixelStorei(gl.PACK_ALIGNMENT, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.pixelStorei(gl.UNPACK_ALIGNMENT, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.pixelStorei(gl.PACK_ALIGNMENT, 16);
+ this.expectError(gl.INVALID_VALUE);
+ gl.pixelStorei(gl.UNPACK_ALIGNMENT, 16);
+ this.expectError(gl.INVALID_VALUE);
+
+ }));
+
+ // gl.texImage2D
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('teximage2d', 'Invalid gl.texImage2D() usage', gl,
+ function() {
+
+
+ /** @type {WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is invalid.');
+ gl.texImage2D(0, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if type is not a type constant.');
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, 0, null);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if format is not an accepted format constant.');
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, 0, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if internalFormat is not one of the accepted resolution and format symbolic constants.');
+ gl.texImage2D(gl.TEXTURE_2D, 0, 0, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if the combination of internalFormat, format and type is invalid.');
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGB, gl.UNSIGNED_SHORT_4_4_4_4, null);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB5_A1, 1, 1, 0, gl.RGB, gl.UNSIGNED_SHORT_5_5_5_1, null);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB10_A2, 1, 1, 0, gl.RGB, gl.UNSIGNED_INT_2_10_10_10_REV, null);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32UI, 1, 1, 0, gl.RGBA_INTEGER, gl.INT, null);
+ this.expectError(gl.INVALID_OPERATION);
+
+
+ gl.deleteTexture(texture);
+
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('teximage2d_inequal_width_height_cube', 'Invalid gl.texImage2D() usage', gl,
+ function() {
+
+ /** @type {WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if target is one of the six cube map 2D image targets and the width and height parameters are not equal.');
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 1, 2, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, 1, 2, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, 1, 2, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, 1, 2, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, 1, 2, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, 1, 2, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+
+ gl.deleteTexture(texture);
+
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('teximage2d_neg_level', 'Invalid gl.texImage2D() usage', gl,
+ function() {
+
+ /** @type {Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture[0]);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]);
+
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0.');
+ gl.texImage2D(gl.TEXTURE_2D, -1, gl.RGB, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0.');
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, -1, gl.RGB, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, -1, gl.RGB, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, -1, gl.RGB, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, -1, gl.RGB, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, -1, gl.RGB, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, -1, gl.RGB, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('teximage2d_max_level', 'Invalid gl.texImage2D() usage', gl,
+ function() {
+
+ /** @type {Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture[0]);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]);
+
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_TEXTURE_SIZE).');
+ /** @type{number} */ var log2MaxTextureSize = Math.floor(Math.log2(/** @type{number} */(gl.getParameter(gl.MAX_TEXTURE_SIZE)))) + 1;
+ gl.texImage2D(gl.TEXTURE_2D, log2MaxTextureSize, gl.RGB, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_CUBE_MAP_TEXTURE_SIZE).');
+ /** @type{number} */ var log2MaxCubemapSize = Math.floor(Math.log2(/** @type{number} */(gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE)))) + 1;
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, log2MaxCubemapSize, gl.RGB, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, log2MaxCubemapSize, gl.RGB, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, log2MaxCubemapSize, gl.RGB, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, log2MaxCubemapSize, gl.RGB, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, log2MaxCubemapSize, gl.RGB, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, log2MaxCubemapSize, gl.RGB, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('teximage2d_neg_width_height', 'Invalid gl.texImage2D() usage', gl,
+ function() {
+
+ /** @type {Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture[0]);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]);
+
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height is less than 0.');
+
+ bufferedLogToConsole('gl.TEXTURE_2D target');
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, -1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 1, -1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, -1, -1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_X target');
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, -1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 1, -1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, -1, -1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Y target');
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, -1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, 1, -1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, -1, -1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Z target');
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, -1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, 1, -1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, -1, -1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_X target');
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, -1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, 1, -1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, -1, -1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Y target');
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, -1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, 1, -1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, -1, -1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Z target');
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, -1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, 1, -1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, -1, -1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('teximage2d_max_width_height', 'Invalid gl.texImage2D() usage', gl,
+ function() {
+
+ /** @type {Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture[0]);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]);
+
+
+ var maxTextureSize = /** @type{number} */(gl.getParameter(gl.MAX_TEXTURE_SIZE)) + 1;
+ var maxCubemapSize = /** @type{number} */(gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE)) + 1;
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height is greater than gl.MAX_TEXTURE_SIZE.');
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, maxTextureSize, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 1, maxTextureSize, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, maxTextureSize, maxTextureSize, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height is greater than gl.MAX_CUBE_MAP_TEXTURE_SIZE.');
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_X target');
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, maxCubemapSize, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 1, maxCubemapSize, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, maxCubemapSize, maxCubemapSize, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Y target');
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, maxCubemapSize, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, 1, maxCubemapSize, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, maxCubemapSize, maxCubemapSize, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_POSITIVE_Z target');
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, maxCubemapSize, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, 1, maxCubemapSize, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, maxCubemapSize, maxCubemapSize, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_X target');
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, maxCubemapSize, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, 1, maxCubemapSize, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, maxCubemapSize, maxCubemapSize, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Y target');
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, maxCubemapSize, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, 1, maxCubemapSize, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, maxCubemapSize, maxCubemapSize, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.TEXTURE_CUBE_MAP_NEGATIVE_Z target');
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, maxCubemapSize, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, 1, maxCubemapSize, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, maxCubemapSize, maxCubemapSize, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('teximage2d_invalid_border', 'Invalid gl.texImage2D() usage', gl,
+ function() {
+
+ /** @type {Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture[0]);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]);
+
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if border is not 0.');
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 1, 1, 1, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 1, 1, -1, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGB, 1, 1, 1, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGB, 1, 1, 1, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGB, 1, 1, 1, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGB, 1, 1, 1, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGB, 1, 1, 1, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGB, 1, 1, 1, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+
+ }));
+
+ // gl.texSubImage2D
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('texsubimage2d', 'Invalid gl.texSubImage2D() usage', gl,
+ function() {
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 32, 32, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.NO_ERROR);
+
+ /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(64);
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is invalid.');
+ gl.texSubImage2D(0, 0, 0, 0, 4, 4, gl.RGBA, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if format is not an accepted format constant.');
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 4, 4, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if type is not a type constant.');
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 4, 4, gl.RGB, 0, uint8);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if the combination of internalFormat of the previously specified texture array, format and type is not valid.');
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 4, 4, gl.RGBA, gl.UNSIGNED_SHORT_5_6_5, uint8);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 4, 4, gl.RGB, gl.UNSIGNED_SHORT_4_4_4_4, uint8);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 4, 4, gl.RGB, gl.UNSIGNED_SHORT_5_5_5_1, uint8);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 4, 4, gl.RGB, gl.UNSIGNED_SHORT_5_5_5_1, uint8);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 4, 4, gl.RGBA_INTEGER, gl.UNSIGNED_INT, uint8);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 4, 4, gl.RGB, gl.FLOAT, uint8);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.deleteTexture(texture);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('texsubimage2d_neg_level', 'Invalid gl.texSubImage2D() usage', gl,
+ function() {
+ /** @type{Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture[0]);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 32, 32, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]);
+ es3fNegativeTextureApiTests.forCubeFaces(function(faceGL) {
+ gl.texImage2D(faceGL, 0, gl.RGB, 32, 32, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ });
+ this.expectError(gl.NO_ERROR);
+
+ /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(4);
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0.');
+ gl.texSubImage2D(gl.TEXTURE_2D, -1, 0, 0, 0, 0, gl.RGB, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0.');
+ var local = this;
+ es3fNegativeTextureApiTests.forCubeFaces(function(faceGL) {
+ gl.texSubImage2D(faceGL, -1, 0, 0, 0, 0, gl.RGB, gl.UNSIGNED_BYTE, uint8);
+ local.expectError(gl.INVALID_VALUE);
+ });
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('texsubimage2d_max_level', 'Invalid gl.texSubImage2D() usage', gl,
+ function() {
+ /** @type{Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_2D, texture[0]);
+ gl.texImage2D (gl.TEXTURE_2D, 0, gl.RGB, 32, 32, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ gl.bindTexture (gl.TEXTURE_CUBE_MAP, texture[1]);
+ es3fNegativeTextureApiTests.forCubeFaces(function(faceGL) {
+ gl.texImage2D(faceGL, 0, gl.RGB, 32, 32, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ });
+
+ this.expectError (gl.NO_ERROR);
+
+ /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(4);
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_TEXTURE_SIZE).');
+ /** @type{number} */ var log2MaxTextureSize = Math.floor(Math.log2(/** @type{number} */(gl.getParameter(gl.MAX_TEXTURE_SIZE)))) + 1;
+ gl.texSubImage2D(gl.TEXTURE_2D, log2MaxTextureSize, 0, 0, 0, 0, gl.RGB, gl.UNSIGNED_BYTE, uint8);
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_CUBE_MAP_TEXTURE_SIZE).');
+ /** @type{number} */ var log2MaxCubemapSize = Math.floor(Math.log2(/** @type{number} */(gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE)))) + 1;
+ var local = this;
+ es3fNegativeTextureApiTests.forCubeFaces(function(faceGL) {
+ gl.texSubImage2D(faceGL, log2MaxCubemapSize, 0, 0, 0, 0, gl.RGB, gl.UNSIGNED_BYTE, uint8);
+ local.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+ });
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('texsubimage2d_neg_offset', 'Invalid gl.texSubImage2D() usage', gl,
+ function() {
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 32, 32, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.NO_ERROR);
+
+ /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(4);
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if xoffset or yoffset are negative.');
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, -1, 0, 0, 0, gl.RGB, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, -1, 0, 0, gl.RGB, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, -1, -1, 0, 0, gl.RGB, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteTexture(texture);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('texsubimage2d_invalid_offset', 'Invalid gl.texSubImage2D() usage', gl,
+ function() {
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 32, 32, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.NO_ERROR);
+
+ /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(64);
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if xoffset + width > texture_width or yoffset + height > texture_height.');
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 30, 0, 4, 4, gl.RGBA, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 30, 4, 4, gl.RGBA, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 30, 30, 4, 4, gl.RGBA, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteTexture(texture);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('texsubimage2d_neg_width_height', 'Invalid gl.texSubImage2D() usage', gl,
+ function() {
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 32, 32, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.NO_ERROR);
+
+ /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(4);
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height is less than 0.');
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, -1, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, -1, gl.RGBA, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, -1, -1, gl.RGBA, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteTexture(texture);
+ }));
+
+ // gl.texParameteri
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('texparameteri', 'Invalid gl.texParameteri() usage', gl,
+ function() {
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target or pname is not one of the accepted defined values.');
+ gl.texParameteri(0, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ this.expectError([gl.INVALID_ENUM, gl.INVALID_OPERATION]);
+ gl.texParameteri(gl.TEXTURE_2D, 0, gl.LINEAR);
+ this.expectError([gl.INVALID_ENUM, gl.INVALID_OPERATION]);
+ gl.texParameteri(0, 0, gl.LINEAR);
+ this.expectError([gl.INVALID_ENUM, gl.INVALID_OPERATION]);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if params should have a defined symbolic constant value (based on the value of pname) and does not.');
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, 0);
+ this.expectError([gl.INVALID_ENUM, gl.INVALID_OPERATION]);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.REPEAT);
+ this.expectError([gl.INVALID_ENUM, gl.INVALID_OPERATION]);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, 0);
+ this.expectError([gl.INVALID_ENUM, gl.INVALID_OPERATION]);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.NEAREST);
+ this.expectError([gl.INVALID_ENUM, gl.INVALID_OPERATION]);
+
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target or pname is not one of the accepted defined values.');
+ gl.texParameteri(0, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ this.expectError(gl.INVALID_ENUM);
+ gl.texParameteri(gl.TEXTURE_2D, 0, gl.LINEAR);
+ this.expectError(gl.INVALID_ENUM);
+ gl.texParameteri(0, 0, gl.LINEAR);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if params should have a defined symbolic constant value (based on the value of pname) and does not.');
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, 0);
+ this.expectError(gl.INVALID_ENUM);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.REPEAT);
+ this.expectError(gl.INVALID_ENUM);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, 0);
+ this.expectError(gl.INVALID_ENUM);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.NEAREST);
+ this.expectError(gl.INVALID_ENUM);
+
+ gl.deleteTexture(texture);
+ }));
+
+ // gl.texParameterf
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('texparameterf', 'Invalid gl.texParameterf() usage', gl,
+ function() {
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target or pname is not one of the accepted defined values.');
+ gl.texParameterf(0, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ this.expectError([gl.INVALID_ENUM, gl.INVALID_OPERATION]);
+ gl.texParameterf(gl.TEXTURE_2D, 0, gl.LINEAR);
+ this.expectError([gl.INVALID_ENUM, gl.INVALID_OPERATION]);
+ gl.texParameterf(0, 0, gl.LINEAR);
+ this.expectError([gl.INVALID_ENUM, gl.INVALID_OPERATION]);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if params should have a defined symbolic constant value (based on the value of pname) and does not.');
+ gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, 0);
+ this.expectError([gl.INVALID_ENUM, gl.INVALID_OPERATION]);
+ gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.REPEAT);
+ this.expectError([gl.INVALID_ENUM, gl.INVALID_OPERATION]);
+ gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, 0);
+ this.expectError([gl.INVALID_ENUM, gl.INVALID_OPERATION]);
+ gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.NEAREST);
+ this.expectError([gl.INVALID_ENUM, gl.INVALID_OPERATION]);
+
+ /** @type{ WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target or pname is not one of the accepted defined values.');
+ gl.texParameterf(0, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ this.expectError(gl.INVALID_ENUM);
+ gl.texParameterf(gl.TEXTURE_2D, 0, gl.LINEAR);
+ this.expectError(gl.INVALID_ENUM);
+ gl.texParameterf(0, 0, gl.LINEAR);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if params should have a defined symbolic constant value (based on the value of pname) and does not.');
+ gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, 0);
+ this.expectError(gl.INVALID_ENUM);
+ gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.REPEAT);
+ this.expectError(gl.INVALID_ENUM);
+ gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, 0);
+ this.expectError(gl.INVALID_ENUM);
+ gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.NEAREST);
+ this.expectError(gl.INVALID_ENUM);
+
+ gl.deleteTexture(texture);
+ }));
+
+ // gl.compressedTexSubImage2D
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedtexsubimage2d', 'Invalid gl.compressedTexSubImage2D() usage', gl,
+ function() {
+ if (!haveCompressedTextureETC) { etc2Unsupported(); return; }
+
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_2D, texture);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is invalid.');
+ gl.compressedTexSubImage2D(0, 0, 0, 0, 0, 0, gl.COMPRESSED_RGB8_ETC2, new Uint8Array(0));
+ this.expectError(gl.INVALID_ENUM);
+
+ gl.compressedTexImage2D (gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 18, 18, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(18, 18)));
+ this.expectError (gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if format does not match the internal format of the texture image being modified.');
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, gl.COMPRESSED_RGB8_ETC2, new Uint8Array(0));
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('For ETC2/EAC images gl.INVALID_OPERATION is generated if width is not a multiple of four, and width + xoffset is not equal to the width of the texture level.');
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 4, 0, 10, 4, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(10, 4)));
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('For ETC2/EAC images gl.INVALID_OPERATION is generated if height is not a multiple of four, and height + yoffset is not equal to the height of the texture level.');
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 4, 4, 10, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(4, 10)));
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('For ETC2/EAC images gl.INVALID_OPERATION is generated if xoffset or yoffset is not a multiple of four.');
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 1, 4, 4, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(4, 4)));
+ this.expectError(gl.INVALID_OPERATION);
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 1, 0, 4, 4, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(4, 4)));
+ this.expectError(gl.INVALID_OPERATION);
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 1, 1, 4, 4, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(4, 4)));
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.deleteTexture(texture);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedtexsubimage2d_neg_level', 'Invalid gl.compressedTexSubImage2D() usage', gl,
+ function() {
+ if (!haveCompressedTextureETC) { etc2Unsupported(); return; }
+
+ /** @type{Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture[0]);
+ gl.compressedTexImage2D (gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 18, 18, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(18, 18)));
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]);
+ es3fNegativeTextureApiTests.forCubeFaces(function(faceGL) {
+ gl.compressedTexImage2D(faceGL, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 18, 18, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(18, 18)));
+ });
+
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0.');
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, -1, 0, 0, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0));
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0.');
+ var local = this;
+ es3fNegativeTextureApiTests.forCubeFaces(function(faceGL) {
+ gl.compressedTexSubImage2D(faceGL, -1, 0, 0, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0));
+ local.expectError(gl.INVALID_VALUE);
+ });
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedtexsubimage2d_max_level', 'Invalid gl.compressedTexSubImage2D() usage', gl,
+ function() {
+ if (!haveCompressedTextureETC) { etc2Unsupported(); return; }
+
+ /** @type{Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture[0]);
+ gl.compressedTexImage2D (gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 18, 18, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(18, 18)));
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture[1]);
+ es3fNegativeTextureApiTests.forCubeFaces(function(faceGL) {
+ gl.compressedTexImage2D(faceGL, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 18, 18, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(18, 18)));
+ });
+
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_TEXTURE_SIZE).');
+ /** @type{number} */ var log2MaxTextureSize = Math.floor(Math.log2(/** @type{number} */(gl.getParameter(gl.MAX_TEXTURE_SIZE)))) + 1;
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, log2MaxTextureSize, 0, 0, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0));
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_CUBE_MAP_TEXTURE_SIZE).');
+ /** @type{number} */ var log2MaxCubemapSize = Math.floor(Math.log2(/** @type{number} */(gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE)))) + 1;
+ var local = this;
+ es3fNegativeTextureApiTests.forCubeFaces(function(faceGL) {
+ gl.compressedTexSubImage2D(faceGL, log2MaxCubemapSize, 0, 0, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0));
+ local.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+ });
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedtexsubimage2d_neg_offset', 'Invalid gl.compressedTexSubImage2D() usage', gl,
+ function() {
+ if (!haveCompressedTextureETC) { etc2Unsupported(); return; }
+
+ /** @type{ WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 8, 8, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(8, 8)));
+
+ // \note Both gl.INVALID_VALUE and gl.INVALID_OPERATION are valid here since implementation may
+ // first check if offsets are valid for certain format and only after that check that they
+ // are not negative.
+ bufferedLogToConsole('gl.INVALID_VALUE or gl.INVALID_OPERATION is generated if xoffset or yoffset are negative.');
+
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, -4, 0, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0));
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, -4, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0));
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, -4, -4, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0));
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+
+ gl.deleteTexture(texture);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedtexsubimage2d_invalid_offset', 'Invalid gl.compressedTexSubImage2D() usage', gl,
+ function() {
+ if (!haveCompressedTextureETC) { etc2Unsupported(); return; }
+
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_2D, texture);
+ gl.compressedTexImage2D (gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(16, 16)));
+ this.expectError (gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_VALUE or gl.INVALID_OPERATION is generated if xoffset + width > texture_width or yoffset + height > texture_height.');
+
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 12, 0, 8, 4, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(8, 4)));
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 12, 4, 8, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(4, 8)));
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 12, 12, 8, 8, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(8, 8)));
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+
+ gl.deleteTexture(texture);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedtexsubimage2d_neg_width_height', 'Invalid gl.compressedTexSubImage2D() usage', gl,
+ function() {
+ if (!haveCompressedTextureETC) { etc2Unsupported(); return; }
+
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_2D, texture);
+ gl.compressedTexImage2D (gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(16, 16)));
+ this.expectError (gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_VALUE or gl.INVALID_OPERATION is generated if width or height is less than 0.');
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, -4, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0));
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, -4, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0));
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, -4, -4, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0));
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+
+ gl.deleteTexture(texture);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedtexsubimage2d_invalid_size', 'Invalid gl.compressedTexImage2D() usage', gl,
+ function() {
+ if (!haveCompressedTextureETC) { etc2Unsupported(); return; }
+
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_2D, texture);
+ gl.compressedTexImage2D (gl.TEXTURE_2D, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(16, 16)));
+ this.expectError (gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if imageSize is not consistent with the format, dimensions, and contents of the specified compressed image data.');
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(1));
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 16, 16, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(4*4*16-1));
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteTexture(texture);
+ }));
+
+ // gl.texImage3D
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('teximage3d', 'Invalid gl.texImage3D() usage', gl,
+ function() {
+ /** @type{Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_2D, texture[0]);
+ gl.bindTexture (gl.TEXTURE_3D, texture[1]);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is invalid.');
+ gl.texImage3D(0, 0, gl.RGBA, 1, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_ENUM);
+ gl.texImage3D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if type is not a type constant.');
+ gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, 1, 1, 1, 0, gl.RGBA, 0, null);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if format is not an accepted format constant.');
+ gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, 1, 1, 1, 0, 0, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if internalFormat is not one of the accepted resolution and format symbolic constants.');
+ gl.texImage3D(gl.TEXTURE_3D, 0, 0, 1, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if target is gl.TEXTURE_3D and format is gl.DEPTH_COMPONENT, or gl.DEPTH_STENCIL.');
+ gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, 1, 1, 1, 0, gl.DEPTH_STENCIL, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, 1, 1, 1, 0, gl.DEPTH_COMPONENT, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if the combination of internalFormat, format and type is invalid.');
+ gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGB, 1, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, 1, 1, 1, 0, gl.RGB, gl.UNSIGNED_SHORT_4_4_4_4, null);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGB5_A1, 1, 1, 1, 0, gl.RGB, gl.UNSIGNED_SHORT_5_5_5_1, null);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGB10_A2, 1, 1, 1, 0, gl.RGB, gl.UNSIGNED_INT_2_10_10_10_REV, null);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA32UI, 1, 1, 1, 0, gl.RGBA_INTEGER, gl.INT, null);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('teximage3d_neg_level', 'Invalid gl.texImage3D() usage', gl,
+ function() {
+ // NOTE: this method hangs the browser if the textures are binded.
+ /** @type{Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_3D, texture[0]);
+ gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture[1]);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0.');
+ gl.texImage3D(gl.TEXTURE_3D, -1, gl.RGB, 1, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage3D(gl.TEXTURE_2D_ARRAY, -1, gl.RGB, 1, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('teximage3d_max_level', 'Invalid gl.texImage3D() usage', gl,
+ function() {
+
+ /** @type{Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_3D, texture[0]);
+ gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture[1]);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_3D_TEXTURE_SIZE).');
+ /** @type{number} */ var log2Max3DTextureSize = Math.floor(Math.log2(/** @type{number} */ (gl.getParameter(gl.MAX_3D_TEXTURE_SIZE)))) + 1;
+ gl.texImage3D(gl.TEXTURE_3D, log2Max3DTextureSize, gl.RGB, 1, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_TEXTURE_SIZE).');
+ /** @type{number} */ var log2MaxTextureSize = Math.floor(Math.log2(/** @type{number} */ (gl.getParameter(gl.MAX_TEXTURE_SIZE)))) + 1;
+ gl.texImage3D(gl.TEXTURE_2D_ARRAY, log2MaxTextureSize, gl.RGB, 1, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('teximage3d_neg_width_height_depth', 'Invalid gl.texImage3D() usage', gl,
+ function() {
+
+ /** @type{Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_3D, texture[0]);
+ gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture[1]);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height is less than 0.');
+ gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, -1, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, 1, -1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, 1, 1, -1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, -1, -1, -1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.texImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, -1, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, 1, -1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, 1, 1, -1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, -1, -1, -1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('teximage3d_max_width_height_depth', 'Invalid gl.texImage3D() usage', gl,
+ function() {
+
+ /** @type{Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_3D, texture[0]);
+ gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture[1]);
+
+ var max3DTextureSize = /** @type{number} */ (gl.getParameter(gl.MAX_3D_TEXTURE_SIZE)) + 1;
+ var maxTextureSize = /** @type{number} */ (gl.getParameter(gl.MAX_TEXTURE_SIZE)) + 1;
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if width, height or depth is greater than gl.MAX_3D_TEXTURE_SIZE.');
+ gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, max3DTextureSize, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, 1, max3DTextureSize, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, 1, 1, max3DTextureSize, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, max3DTextureSize, max3DTextureSize, max3DTextureSize, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if width, height or depth is greater than gl.MAX_TEXTURE_SIZE.');
+ gl.texImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, maxTextureSize, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, 1, maxTextureSize, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, 1, 1, maxTextureSize, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, maxTextureSize, maxTextureSize, maxTextureSize, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('teximage3d_invalid_border', 'Invalid gl.texImage3D() usage', gl,
+ function() {
+ /** @type{Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_3D, texture[0]);
+ gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture[1]);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if border is not 0 or 1.');
+ gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGB, 1, 1, 1, -1, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGB, 1, 1, 1, 2, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.RGB, 1, 1, 1, -1, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.RGB, 1, 1, 1, 2, gl.RGB, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+ }));
+
+ // gl.texSubImage3D
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('texsubimage3d', 'Invalid gl.texSubImage3D() usage', gl,
+ function() {
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_3D, texture);
+ gl.texImage3D (gl.TEXTURE_3D, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError (gl.NO_ERROR);
+
+ /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(256);
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is invalid.');
+ gl.texSubImage3D(0, 0, 0, 0, 0, 4, 4, 4, gl.RGBA, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_ENUM);
+ gl.texSubImage3D(gl.TEXTURE_2D, 0, 0, 0, 0, 4, 4, 4, gl.RGBA, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if format is not an accepted format constant.');
+ gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, 0, 4, 4, 4, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if type is not a type constant.');
+ gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, 4, 4, 4, gl.RGB, 0, uint8);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if the combination of internalFormat of the previously specified texture array, format and type is not valid.');
+ gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, 4, 4, 4, gl.RGB, gl.UNSIGNED_SHORT_4_4_4_4, uint8);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, 4, 4, 4, gl.RGB, gl.UNSIGNED_SHORT_5_5_5_1, uint8);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, 4, 4, 4, gl.RGB, gl.UNSIGNED_SHORT_5_5_5_1, uint8);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, 4, 4, 4, gl.RGBA_INTEGER, gl.UNSIGNED_INT, uint8);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, 4, 4, 4, gl.RGB, gl.FLOAT, uint8);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.deleteTexture(texture);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('texsubimage3d_neg_level', 'Invalid gl.texSubImage3D() usage', gl,
+ function() {
+ /** @type{Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_3D, texture[0]);
+ gl.texImage3D (gl.TEXTURE_3D, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture[1]);
+ gl.texImage3D (gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError (gl.NO_ERROR);
+
+ /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(4);
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0.');
+ gl.texSubImage3D(gl.TEXTURE_3D, -1, 0, 0, 0, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texSubImage3D(gl.TEXTURE_2D_ARRAY, -1, 0, 0, 0, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('texsubimage3d_max_level', 'Invalid gl.texSubImage3D() usage', gl,
+ function() {
+ /** @type{Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_3D, texture[0]);
+ gl.texImage3D (gl.TEXTURE_3D, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture[1]);
+ gl.texImage3D (gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError (gl.NO_ERROR);
+
+ /** @type{number} */ var log2Max3DTextureSize = Math.floor(Math.log2(/** @type{number} */(gl.getParameter(gl.MAX_3D_TEXTURE_SIZE)))) + 1;
+ /** @type{number} */ var log2MaxTextureSize = Math.floor(Math.log2(/** @type{number} */(gl.getParameter(gl.MAX_TEXTURE_SIZE)))) + 1;
+
+ /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(4);
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_3D_TEXTURE_SIZE).');
+ gl.texSubImage3D(gl.TEXTURE_3D, log2Max3DTextureSize, 0, 0, 0, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8);
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_TEXTURE_SIZE).');
+ gl.texSubImage3D(gl.TEXTURE_2D_ARRAY, log2MaxTextureSize, 0, 0, 0, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8);
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('texsubimage3d_neg_offset', 'Invalid gl.texSubImage3D() usage', gl,
+ function() {
+ /** @type{Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_3D, texture[0]);
+ gl.texImage3D (gl.TEXTURE_3D, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture[1]);
+ gl.texImage3D (gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError (gl.NO_ERROR);
+
+ /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(4);
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if xoffset, yoffset or zoffset are negative.');
+ gl.texSubImage3D(gl.TEXTURE_3D, 0, -1, 0, 0, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, -1, 0, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, 0, -1, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texSubImage3D(gl.TEXTURE_3D, 0, -1, -1, -1, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texSubImage3D(gl.TEXTURE_2D_ARRAY, 0, -1, 0, 0, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, -1, 0, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 0, -1, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texSubImage3D(gl.TEXTURE_2D_ARRAY, 0, -1, -1, -1, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('texsubimage3d_invalid_offset', 'Invalid gl.texSubImage3D() usage', gl,
+ function() {
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_3D, texture);
+ gl.texImage3D (gl.TEXTURE_3D, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError (gl.NO_ERROR);
+
+ /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(256);
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if xoffset + width > texture_width.');
+ gl.texSubImage3D(gl.TEXTURE_3D, 0, 2, 0, 0, 4, 4, 4, gl.RGBA, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if yoffset + height > texture_height.');
+ gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, 2, 0, 4, 4, 4, gl.RGBA, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if zoffset + depth > texture_depth.');
+ gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 2, 4, 4, 4, gl.RGBA, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteTexture(texture);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('texsubimage3d_neg_width_height', 'Invalid gl.texSubImage3D() usage', gl,
+ function() {
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_3D, texture);
+ gl.texImage3D (gl.TEXTURE_3D, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+
+ /** @type {ArrayBufferView} */ var uint8 = new Uint8Array(4);
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if width, height or depth is less than 0.');
+ gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, -1, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, 0, -1, 0, gl.RGBA, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, 0, 0, -1, gl.RGBA, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_VALUE);
+ gl.texSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, -1, -1, -1, gl.RGBA, gl.UNSIGNED_BYTE, uint8);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteTexture(texture);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('copytexsubimage3d', 'Invalid gl.copyTexSubImage3D() usage', gl,
+ function() {
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_3D, texture);
+ gl.texImage3D (gl.TEXTURE_3D, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is invalid.');
+ gl.copyTexSubImage3D(0, 0, 0, 0, 0, 0, 0, 4, 0);
+ this.expectError(gl.INVALID_ENUM);
+
+ gl.deleteTexture(texture);
+ }));
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('copytexsubimage3d_neg_level', 'Invalid gl.copyTexSubImage3D() usage', gl,
+ function() {
+ /** @type{Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_3D, texture[0]);
+ gl.texImage3D (gl.TEXTURE_3D, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture[1]);
+ gl.texImage3D (gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError (gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0.');
+ gl.copyTexSubImage3D(gl.TEXTURE_3D, -1, 0, 0, 0, 0, 0, 4, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexSubImage3D(gl.TEXTURE_2D_ARRAY, -1, 0, 0, 0, 0, 0, 4, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('copytexsubimage3d_max_level', 'Invalid gl.copyTexSubImage3D() usage', gl,
+ function() {
+ /** @type{number} */ var log2Max3DTextureSize = Math.floor(Math.log2(/** @type{number} */(gl.getParameter(gl.MAX_3D_TEXTURE_SIZE)))) + 1;
+ /** @type{number} */ var log2MaxTextureSize = Math.floor(Math.log2(/** @type{number} */(gl.getParameter(gl.MAX_TEXTURE_SIZE)))) + 1;
+
+ /** @type{Array<WebGLTexture>} */ var texture = [];
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_3D, texture[0]);
+ gl.texImage3D (gl.TEXTURE_3D, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture[1]);
+ gl.texImage3D (gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError (gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_3D_TEXTURE_SIZE).');
+ gl.copyTexSubImage3D(gl.TEXTURE_3D, log2Max3DTextureSize, 0, 0, 0, 0, 0, 4, 0);
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_TEXTURE_SIZE).');
+ gl.copyTexSubImage3D(gl.TEXTURE_2D_ARRAY, log2MaxTextureSize, 0, 0, 0, 0, 0, 4, 0);
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('copytexsubimage3d_neg_offset', 'Invalid gl.copyTexSubImage3D() usage', gl,
+ function() {
+ /** @type{ WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_3D, texture);
+ gl.texImage3D (gl.TEXTURE_3D, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if xoffset, yoffset or zoffset is negative.');
+ gl.copyTexSubImage3D(gl.TEXTURE_3D, 0, -1, 0, 0, 0, 0, 4, 4);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexSubImage3D(gl.TEXTURE_3D, 0, 0, -1, 0, 0, 0, 4, 4);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexSubImage3D(gl.TEXTURE_3D, 0, 0, 0, -1, 0, 0, 4, 4);
+ this.expectError(gl.INVALID_VALUE);
+ gl.copyTexSubImage3D(gl.TEXTURE_3D, 0, -1, -1, -1, 0, 0, 4, 4);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteTexture(texture);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('copytexsubimage3d_invalid_offset', 'Invalid gl.copyTexSubImage3D() usage', gl,
+ function() {
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_3D, texture);
+ gl.texImage3D (gl.TEXTURE_3D, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if xoffset + width > texture_width.');
+ gl.copyTexSubImage3D(gl.TEXTURE_3D, 0, 1, 0, 0, 0, 0, 4, 4);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if yoffset + height > texture_height.');
+ gl.copyTexSubImage3D(gl.TEXTURE_3D, 0, 0, 1, 0, 0, 0, 4, 4);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if zoffset + 1 > texture_depth.');
+ gl.copyTexSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 4, 0, 0, 4, 4);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteTexture(texture);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('copytexsubimage3d_neg_width_height', 'Invalid gl.copyTexSubImage3D() usage', gl,
+ function() {
+ /** @type{ WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_3D, texture);
+ gl.texImage3D (gl.TEXTURE_3D, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if width < 0.');
+ gl.copyTexSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, 0, 0, -4, 4);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if height < 0.');
+ gl.copyTexSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, 0, 0, 4, -4);
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteTexture(texture);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('copytexsubimage3d_incomplete_framebuffer', 'Invalid gl.copyTexSubImage3D() usage', gl,
+ function() {
+ bufferedLogToConsole('gl.INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.');
+ /** @type{Array<WebGLTexture>} */ var texture = [];
+ /** @type{WebGLFramebuffer} */ var fbo;
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_3D, texture[0]);
+ gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.bindTexture(gl.TEXTURE_2D_ARRAY, texture[1]);
+ gl.texImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.RGBA, 4, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ this.expectError(gl.NO_ERROR);
+
+ fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.READ_FRAMEBUFFER, fbo);
+ gl.checkFramebufferStatus(gl.READ_FRAMEBUFFER);
+ this.expectError(gl.NO_ERROR);
+
+ gl.copyTexSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, 0, 0, 4, 4);
+ this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION);
+ gl.copyTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, 0, 0, 4, 4);
+ this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION);
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.deleteFramebuffer(fbo);
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+ }));
+
+ // gl.compressedTexImage3D
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage3d', 'Invalid gl.compressedTexImage3D() usage', gl,
+ function() {
+ if (!haveCompressedTextureETC) { etc2Unsupported(); return; }
+
+ /** @type{Array<WebGLTexture>} */ var texture = [];
+
+ // We have to create and bind textures to each target for the test because default textures are not supported by WebGL.
+ texture[0] = gl.createTexture();
+ texture[1] = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_CUBE_MAP, texture[0]);
+ gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture[1]);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is invalid.');
+ gl.compressedTexImage3D(0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, 0, new Uint8Array(0));
+ this.expectError(gl.INVALID_ENUM);
+ gl.compressedTexImage3D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, 0, new Uint8Array(0));
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if internalformat is not one of the specific compressed internal formats.');
+ gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, 0, 0, new Uint8Array(0));
+ this.expectError(gl.INVALID_ENUM);
+ gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.RGBA8, 0, 0, 0, 0, new Uint8Array(0));
+ this.expectError(gl.INVALID_ENUM);
+
+ gl.deleteTexture(texture[0]);
+ gl.deleteTexture(texture[1]);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage3d_neg_level', 'Invalid gl.compressedTexImage3D() usage', gl,
+ function() {
+ if (!haveCompressedTextureETC) { etc2Unsupported(); return; }
+
+ /** @type{ WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0.');
+ gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, -1, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, 0, new Uint8Array(0));
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteTexture(texture);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage3d_max_level', 'Invalid gl.compressedTexImage3D() usage', gl,
+ function() {
+ if (!haveCompressedTextureETC) { etc2Unsupported(); return; }
+
+ /** @type{ WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_TEXTURE_SIZE).');
+ /** @type{number} */ var log2MaxTextureSize = Math.floor(Math.log2(/** @type{number} */(gl.getParameter(gl.MAX_TEXTURE_SIZE)))) + 1;
+ gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, log2MaxTextureSize, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, 0, new Uint8Array(0));
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+
+ gl.deleteTexture(texture);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage3d_neg_width_height_depth', 'Invalid gl.compressedTexImage3D() usage', gl,
+ function() {
+ if (!haveCompressedTextureETC) { etc2Unsupported(); return; }
+
+ /** @type{ WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if width, height or depth is less than 0.');
+ gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, 0, 0, 0, new Uint8Array(0));
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, -1, 0, 0, new Uint8Array(0));
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, -1, 0, new Uint8Array(0));
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, -1, -1, -1, 0, new Uint8Array(0));
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteTexture(texture);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage3d_max_width_height_depth', 'Invalid gl.compressedTexImage3D() usage', gl,
+ function() {
+ if (!haveCompressedTextureETC) { etc2Unsupported(); return; }
+
+ /** @type{ WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture);
+
+ var maxTextureSize = /** @type{number} */(gl.getParameter(gl.MAX_TEXTURE_SIZE)) + 1;
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if width, height or depth is greater than gl.MAX_TEXTURE_SIZE.');
+ gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, maxTextureSize, 0, 0, 0, new Uint8Array(0));
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, maxTextureSize, 0, 0, new Uint8Array(0));
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, maxTextureSize, 0, new Uint8Array(0));
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, maxTextureSize, maxTextureSize, maxTextureSize, 0, new Uint8Array(0));
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteTexture(texture);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage3d_invalid_border', 'Invalid gl.compressedTexImage3D() usage', gl,
+ function() {
+ if (!haveCompressedTextureETC) { etc2Unsupported(); return; }
+
+ /** @type{ WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if border is not 0.');
+ gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, -1, new Uint8Array(0));
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, 1, new Uint8Array(0));
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteTexture(texture);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedteximage3d_invalid_size', 'Invalid gl.compressedTexImage3D() usage', gl,
+ function() {
+ if (!haveCompressedTextureETC) { etc2Unsupported(); return; }
+
+ /** @type{ WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if imageSize is not consistent with the format, dimensions, and contents of the specified compressed image data.');
+ gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 0, 0, 0, 0, new Uint8Array(1));
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 1, 0, new Uint8Array(4*4*8));
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGB8_ETC2, 16, 16, 1, 0, new Uint8Array(4*4*16));
+ this.expectError(gl.INVALID_VALUE);
+ gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_SIGNED_R11_EAC, 16, 16, 1, 0, new Uint8Array(4*4*16));
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteTexture(texture);
+
+ }));
+
+ // gl.compressedTexSubImage3D
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedtexsubimage3d', 'Invalid gl.compressedTexSubImage3D() usage', gl,
+ function() {
+ if (!haveCompressedTextureETC) { etc2Unsupported(); return; }
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is invalid.');
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.compressedTexSubImage3D(0, 0, 0, 0, 0, 0, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0));
+ this.expectError(gl.INVALID_ENUM);
+
+ gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture);
+ gl.compressedTexImage3D (gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 18, 18, 1, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(18, 18)));
+ this.expectError (gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if format does not match the internal format of the texture image being modified.');
+ gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, 0, 0, 0, gl.COMPRESSED_RGB8_ETC2, new Uint8Array(0));
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if internalformat is an ETC2/EAC format and target is not gl.TEXTURE_2D_ARRAY.');
+ gl.compressedTexSubImage3D(gl.TEXTURE_3D, 0, 0, 0, 0, 18, 18, 1, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(18, 18)));
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('For ETC2/EAC images gl.INVALID_OPERATION is generated if width is not a multiple of four, and width + xoffset is not equal to the width of the texture level.');
+ gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 4, 0, 0, 10, 4, 1, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(10, 4)));
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('For ETC2/EAC images gl.INVALID_OPERATION is generated if height is not a multiple of four, and height + yoffset is not equal to the height of the texture level.');
+ gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 4, 0, 4, 10, 1, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(4, 10)));
+ this.expectError(gl.INVALID_OPERATION);
+
+ bufferedLogToConsole('For ETC2/EAC images gl.INVALID_OPERATION is generated if xoffset or yoffset is not a multiple of four.');
+ gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 1, 0, 0, 4, 4, 1, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(4, 4)));
+ this.expectError(gl.INVALID_OPERATION);
+ gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 1, 0, 4, 4, 1, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(4, 4)));
+ this.expectError(gl.INVALID_OPERATION);
+ gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 1, 1, 0, 4, 4, 1, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(4, 4)));
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.deleteTexture(texture);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedtexsubimage3d_neg_level', 'Invalid gl.compressedTexSubImage3D() usage', gl,
+ function() {
+ if (!haveCompressedTextureETC) { etc2Unsupported(); return; }
+
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture);
+ gl.compressedTexImage3D (gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 1, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(16, 16)));
+ this.expectError (gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is less than 0.');
+ gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, -1, 0, 0, 0, 0, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0));
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteTexture(texture);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedtexsubimage3d_max_level', 'Invalid gl.compressedTexSubImage3D() usage', gl,
+ function() {
+ if (!haveCompressedTextureETC) { etc2Unsupported(); return; }
+
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture);
+ gl.compressedTexImage3D (gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 1, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(16, 16)));
+ this.expectError (gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if level is greater than log_2(gl.MAX_TEXTURE_SIZE).');
+ /** @type{number} */ var log2MaxTextureSize = Math.floor(Math.log2(/** @type{number} */(gl.getParameter(gl.MAX_TEXTURE_SIZE)))) + 1;
+ gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, log2MaxTextureSize, 0, 0, 0, 0, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0));
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+
+ gl.deleteTexture(texture);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedtexsubimage3d_neg_offset', 'Invalid gl.compressedTexSubImage3D() usage', gl,
+ function() {
+ if (!haveCompressedTextureETC) { etc2Unsupported(); return; }
+
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture);
+ gl.compressedTexImage3D (gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 1, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(16, 16)));
+ this.expectError (gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_VALUE or gl.INVALID_OPERATION is generated if xoffset, yoffset or zoffset are negative.');
+ gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, -4, 0, 0, 0, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0));
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+ gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, -4, 0, 0, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0));
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+ gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 0, -4, 0, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0));
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+ gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, -4, -4, -4, 0, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0));
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+
+ gl.deleteTexture(texture);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedtexsubimage3d_invalid_offset', 'Invalid gl.compressedTexSubImage3D() usage', gl,
+ function() {
+ if (!haveCompressedTextureETC) { etc2Unsupported(); return; }
+
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture);
+ gl.compressedTexImage3D (gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 4, 4, 1, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(4, 4)));
+ this.expectError (gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_VALUE or gl.INVALID_OPERATION is generated if xoffset + width > texture_width or yoffset + height > texture_height.');
+
+ gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 12, 0, 0, 8, 4, 1, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(8, 4)));
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+ gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 12, 0, 4, 8, 1, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(4, 8)));
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+ gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 0, 12, 4, 4, 1, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(4, 4)));
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+ gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 12, 12, 12, 8, 8, 1, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(8, 8)));
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+
+ gl.deleteTexture(texture);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedtexsubimage3d_neg_width_height_depth', 'Invalid gl.compressedTexSubImage3D() usage', gl,
+ function() {
+ if (!haveCompressedTextureETC) { etc2Unsupported(); return; }
+
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture);
+ gl.compressedTexImage3D (gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 1, 0, new Uint8Array(es3fNegativeTextureApiTests.etc2EacDataSize(16, 16)));
+ this.expectError (gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_VALUE or gl.INVALID_OPERATION is generated if width, height or depth are negative.');
+ gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, -4, 0, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0));
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+ gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, 0, -4, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0));
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+ gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, 0, 0, -4, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0));
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+ gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, -4, -4, -4, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0));
+ this.expectError([gl.INVALID_VALUE, gl.INVALID_OPERATION]);
+
+ gl.deleteTexture(texture);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('compressedtexsubimage3d_invalid_size', 'Invalid gl.compressedTexSubImage3D() usage', gl,
+ function() {
+ if (!haveCompressedTextureETC) { etc2Unsupported(); return; }
+
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_2D_ARRAY, texture);
+ gl.compressedTexImage3D (gl.TEXTURE_2D_ARRAY, 0, gl.COMPRESSED_RGBA8_ETC2_EAC, 16, 16, 1, 0, new Uint8Array(4*4*16));
+ this.expectError (gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if imageSize is not consistent with the format, dimensions, and contents of the specified compressed image data.');
+ gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, 16, 16, 1, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(0));
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, 16, 16, 1, gl.COMPRESSED_RGBA8_ETC2_EAC, new Uint8Array(4*4*16-1));
+ this.expectError(gl.INVALID_VALUE);
+
+ gl.deleteTexture(texture);
+ }));
+
+ // gl.texStorage2D
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('texstorage2d', 'Invalid gl.texStorage2D() usage', gl,
+ function() {
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_2D, texture);
+
+ bufferedLogToConsole('gl.INVALID_ENUM or gl.INVALID_VALUE is generated if internalformat is not a valid sized internal format.');
+ gl.texStorage2D (gl.TEXTURE_2D, 1, 0, 16, 16);
+ this.expectError ([gl.INVALID_ENUM, gl.INVALID_VALUE]);
+ gl.texStorage2D (gl.TEXTURE_2D, 1, gl.RGBA_INTEGER, 16, 16);
+ this.expectError ([gl.INVALID_ENUM, gl.INVALID_VALUE]);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not one of the accepted target enumerants.');
+ gl.texStorage2D (0, 1, gl.RGBA8, 16, 16);
+ this.expectError (gl.INVALID_ENUM);
+ gl.texStorage2D (gl.TEXTURE_3D, 1, gl.RGBA8, 16, 16);
+ this.expectError (gl.INVALID_ENUM);
+ gl.texStorage2D (gl.TEXTURE_2D_ARRAY, 1, gl.RGBA8, 16, 16);
+ this.expectError (gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if width or height are less than 1.');
+ gl.texStorage2D (gl.TEXTURE_2D, 1, gl.RGBA8, 0, 16);
+ this.expectError (gl.INVALID_VALUE);
+ gl.texStorage2D (gl.TEXTURE_2D, 1, gl.RGBA8, 16, 0);
+ this.expectError (gl.INVALID_VALUE);
+ gl.texStorage2D (gl.TEXTURE_2D, 1, gl.RGBA8, 0, 0);
+ this.expectError (gl.INVALID_VALUE);
+
+ gl.deleteTexture(texture);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('texstorage2d_invalid_binding', 'Invalid gl.texStorage2D() usage', gl,
+ function() {
+ gl.bindTexture (gl.TEXTURE_2D, null);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if there is no texture object curently bound to target.');
+ gl.texStorage2D (gl.TEXTURE_2D, 1, gl.RGBA8, 16, 16);
+ this.expectError (gl.INVALID_OPERATION);
+
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_2D, texture);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if the texture object currently bound to target already has gl.TEXTURE_IMMUTABLE_FORMAT set to true.');
+ /** @type{number} */ var immutable;
+ immutable = /** @type{number} */(gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_IMMUTABLE_FORMAT));
+ bufferedLogToConsole('// gl.TEXTURE_IMMUTABLE_FORMAT = ' + ((immutable != 0) ? 'true' : 'false'));
+ gl.texStorage2D (gl.TEXTURE_2D, 1, gl.RGBA8, 16, 16);
+ this.expectError (gl.NO_ERROR);
+ immutable = /** @type{number} */(gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_IMMUTABLE_FORMAT));
+ bufferedLogToConsole('// gl.TEXTURE_IMMUTABLE_FORMAT = ' + ((immutable != 0) ? 'true' : 'false'));
+ gl.texStorage2D (gl.TEXTURE_2D, 1, gl.RGBA8, 16, 16);
+ this.expectError (gl.INVALID_OPERATION);
+
+ gl.deleteTexture(texture);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('texstorage2d_invalid_levels', 'Invalid gl.texStorage2D() usage', gl,
+ function() {
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_2D, texture);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if levels is less than 1.');
+ gl.texStorage2D (gl.TEXTURE_2D, 0, gl.RGBA8, 16, 16);
+ this.expectError (gl.INVALID_VALUE);
+ gl.texStorage2D (gl.TEXTURE_2D, 0, gl.RGBA8, 0, 0);
+ this.expectError (gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if levels is greater than floor(log_2(max(width, height))) + 1');
+ /** @type{number} */ var log2MaxSize = Math.floor(Math.log2(Math.max(16, 4))) + 1 + 1;
+ gl.texStorage2D (gl.TEXTURE_2D, log2MaxSize, gl.RGBA8, 16, 4);
+ this.expectError (gl.INVALID_OPERATION);
+ gl.texStorage2D (gl.TEXTURE_2D, log2MaxSize, gl.RGBA8, 4, 16);
+ this.expectError (gl.INVALID_OPERATION);
+ gl.texStorage2D (gl.TEXTURE_2D, log2MaxSize, gl.RGBA8, 16, 16);
+ this.expectError (gl.INVALID_OPERATION);
+
+ gl.deleteTexture(texture);
+ }));
+
+ // gl.texStorage3D
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('texstorage3d', 'Invalid gl.texStorage3D() usage', gl,
+ function() {
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_3D, texture);
+
+ bufferedLogToConsole('gl.INVALID_ENUM or gl.INVALID_VALUE is generated if internalformat is not a valid sized internal format.');
+ gl.texStorage3D (gl.TEXTURE_3D, 1, 0, 4, 4, 4);
+ this.expectError ([gl.INVALID_ENUM, gl.INVALID_VALUE]);
+ gl.texStorage3D (gl.TEXTURE_3D, 1, gl.RGBA_INTEGER, 4, 4, 4);
+ this.expectError ([gl.INVALID_ENUM, gl.INVALID_VALUE]);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if target is not one of the accepted target enumerants.');
+ gl.texStorage3D (0, 1, gl.RGBA8, 4, 4, 4);
+ this.expectError (gl.INVALID_ENUM);
+ gl.texStorage3D (gl.TEXTURE_CUBE_MAP, 1, gl.RGBA8, 4, 4, 4);
+ this.expectError (gl.INVALID_ENUM);
+ gl.texStorage3D (gl.TEXTURE_2D, 1, gl.RGBA8, 4, 4, 4);
+ this.expectError (gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if width, height or depth are less than 1.');
+ gl.texStorage3D (gl.TEXTURE_3D, 1, gl.RGBA8, 0, 4, 4);
+ this.expectError (gl.INVALID_VALUE);
+ gl.texStorage3D (gl.TEXTURE_3D, 1, gl.RGBA8, 4, 0, 4);
+ this.expectError (gl.INVALID_VALUE);
+ gl.texStorage3D (gl.TEXTURE_3D, 1, gl.RGBA8, 4, 4, 0);
+ this.expectError (gl.INVALID_VALUE);
+ gl.texStorage3D (gl.TEXTURE_3D, 1, gl.RGBA8, 0, 0, 0);
+ this.expectError (gl.INVALID_VALUE);
+
+ gl.deleteTexture(texture);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('texstorage3d_invalid_binding', 'Invalid gl.texStorage3D() usage', gl,
+ function() {
+ gl.bindTexture (gl.TEXTURE_3D, null);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if there is no texture object curently bound to target.');
+ gl.texStorage3D (gl.TEXTURE_3D, 1, gl.RGBA8, 4, 4, 4);
+ this.expectError (gl.INVALID_OPERATION);
+
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_3D, texture);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if the texture object currently bound to target already has gl.TEXTURE_IMMUTABLE_FORMAT set to true.');
+ /** @type{number} */ var immutable;
+ immutable = /** @type{number} */(gl.getTexParameter(gl.TEXTURE_3D, gl.TEXTURE_IMMUTABLE_FORMAT));
+ bufferedLogToConsole('// gl.TEXTURE_IMMUTABLE_FORMAT = ' + ((immutable != 0) ? 'true' : 'false'));
+ gl.texStorage3D (gl.TEXTURE_3D, 1, gl.RGBA8, 4, 4, 4);
+ this.expectError (gl.NO_ERROR);
+ immutable = /** @type{number} */(gl.getTexParameter(gl.TEXTURE_3D, gl.TEXTURE_IMMUTABLE_FORMAT));
+ bufferedLogToConsole('// gl.TEXTURE_IMMUTABLE_FORMAT = ' + ((immutable != 0) ? 'true' : 'false'));
+ gl.texStorage3D (gl.TEXTURE_3D, 1, gl.RGBA8, 4, 4, 4);
+ this.expectError (gl.INVALID_OPERATION);
+
+ gl.deleteTexture(texture);
+ }));
+
+ // NOTE: the test doesn't cause glError using the parameters defined in the original test of C code
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('texstorage3d_invalid_levels', 'Invalid gl.texStorage3D() usage', gl,
+ function() {
+ /** @type{WebGLTexture} */ var texture;
+ texture = gl.createTexture();
+ gl.bindTexture (gl.TEXTURE_3D, texture);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if levels is less than 1.');
+ gl.texStorage3D (gl.TEXTURE_3D, 0, gl.RGBA8, 4, 4, 4);
+ this.expectError (gl.INVALID_VALUE);
+ gl.texStorage3D (gl.TEXTURE_3D, 0, gl.RGBA8, 0, 0, 0);
+ this.expectError (gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if levels is greater than floor(log_2(max(width, height, depth))) + 1');
+ /** @type{number} */ var log2MaxSize = Math.floor(Math.log2(8)) + 1 + 1;
+ gl.texStorage3D (gl.TEXTURE_3D, log2MaxSize, gl.RGBA8, 8, 2, 2);
+ this.expectError (gl.INVALID_OPERATION);
+ gl.texStorage3D (gl.TEXTURE_3D, log2MaxSize, gl.RGBA8, 2, 8, 2);
+ this.expectError (gl.INVALID_OPERATION);
+ gl.texStorage3D (gl.TEXTURE_3D, log2MaxSize, gl.RGBA8, 2, 2, 8);
+ this.expectError (gl.INVALID_OPERATION);
+ gl.texStorage3D (gl.TEXTURE_3D, log2MaxSize, gl.RGBA8, 8, 8, 8);
+ this.expectError (gl.INVALID_OPERATION);
+
+ gl.deleteTexture(texture);
+ }));
+ };
+
+ /**
+ * @param {WebGL2RenderingContext} gl
+ */
+ es3fNegativeTextureApiTests.run = function(gl) {
+ var testName = 'negativeTextureApi';
+ var testDescription = 'Negative Texture API tests';
+ var state = tcuTestCase.runner;
+
+ state.testName = testName;
+ state.testCases = tcuTestCase.newTest(testName, testDescription, null);
+
+ //Set up name and description of this test series.
+ setCurrentTestName(testName);
+ description(testDescription);
+ try {
+ es3fNegativeTextureApiTests.init(gl);
+ tcuTestCase.runner.runCallback(tcuTestCase.runTestCases);
+ } catch (err) {
+ bufferedLogToConsole(err);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeVertexArrayApiTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeVertexArrayApiTests.js
new file mode 100644
index 0000000000..d921a6f52b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fNegativeVertexArrayApiTests.js
@@ -0,0 +1,906 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES 3.0 Module
+ * -------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief Negative Vertex Array API tests.
+ *//*--------------------------------------------------------------------*/
+'use strict';
+goog.provide('functional.gles3.es3fNegativeVertexArrayApiTests');
+
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.common.tcuTexture');
+goog.require('functional.gles3.es3fApiCase');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('framework.opengl.simplereference.sglrGLContext');
+
+goog.scope(function() {
+
+ var es3fNegativeVertexArrayApiTests = functional.gles3.es3fNegativeVertexArrayApiTests;
+ var tcuTexture = framework.common.tcuTexture;
+ var es3fApiCase = functional.gles3.es3fApiCase;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var gluShaderProgram = framework.opengl.gluShaderProgram;
+ var sglrGLContext = framework.opengl.simplereference.sglrGLContext;
+
+ /**
+ * @type {string}
+ * @const
+ */
+ var vertexShaderSource = '#version 300 es\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = vec4(0.0);\n' +
+ '}\n';
+
+ /**
+ * @type {string}
+ * @const
+ */
+ var fragmentShaderSource = '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 fragColor;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' fragColor = vec4(0.0);\n' +
+ '}\n';
+
+ /**
+ * @param {WebGL2RenderingContext} gl
+ */
+ es3fNegativeVertexArrayApiTests.init = function(gl) {
+
+ var testGroup = tcuTestCase.runner.testCases;
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('vertex_attribf', 'Invalid glVertexAttrib{1234}f() usage', gl, function() {
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater than or equal to gl.MAX_VERTEX_ATTRIBS.');
+ var maxVertexAttribs = /** @type{number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS));
+ gl.vertexAttrib1f(maxVertexAttribs, 0.0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.vertexAttrib2f(maxVertexAttribs, 0.0, 0.0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.vertexAttrib3f(maxVertexAttribs, 0.0, 0.0, 0.0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.vertexAttrib4f(maxVertexAttribs, 0.0, 0.0, 0.0, 0.0);
+ this.expectError(gl.INVALID_VALUE);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('vertex_attribfv', 'Invalid glVertexAttrib{1234}fv() usage', gl, function() {
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater than or equal to gl.MAX_VERTEX_ATTRIBS.');
+ var maxVertexAttribs = /** @type{number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS));
+ /** @type{Array<number>} */ var v = [0.0];
+ gl.vertexAttrib1fv(maxVertexAttribs, v);
+ this.expectError(gl.INVALID_VALUE);
+ gl.vertexAttrib2fv(maxVertexAttribs, v);
+ this.expectError(gl.INVALID_VALUE);
+ gl.vertexAttrib3fv(maxVertexAttribs, v);
+ this.expectError(gl.INVALID_VALUE);
+ gl.vertexAttrib4fv(maxVertexAttribs, v);
+ this.expectError(gl.INVALID_VALUE);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('vertex_attribi4', 'Invalid glVertexAttribI4{i|ui}f() usage', gl, function() {
+ var maxVertexAttribs = /** @type{number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS));
+ /** @type{number} */ var valInt = 0;
+ /** @type{number} */ var valUint = 0;
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater than or equal to gl.MAX_VERTEX_ATTRIBS.');
+ gl.vertexAttribI4i(maxVertexAttribs, valInt, valInt, valInt, valInt);
+ this.expectError(gl.INVALID_VALUE);
+ gl.vertexAttribI4ui(maxVertexAttribs, valUint, valUint, valUint, valUint);
+ this.expectError(gl.INVALID_VALUE);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('vertex_attribi4v', 'Invalid glVertexAttribI4{i|ui}fv() usage', gl, function() {
+ var maxVertexAttribs = /** @type{number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS));
+ /** @type{Array<number>} */ var valInt = [0];
+ /** @type{Array<number>} */ var valUint = [0];
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater than or equal to gl.MAX_VERTEX_ATTRIBS.');
+ gl.vertexAttribI4iv(maxVertexAttribs, valInt);
+ this.expectError(gl.INVALID_VALUE);
+ gl.vertexAttribI4uiv(maxVertexAttribs, valUint);
+ this.expectError(gl.INVALID_VALUE);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('vertex_attrib_pointer', 'Invalid gl.vertexAttribPointer() usage', gl, function() {
+ /** @type{WebGLBuffer} */ var buffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if type is not an accepted value.');
+ gl.vertexAttribPointer(0, 1, 0, true, 0, 0);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater than or equal to gl.MAX_VERTEX_ATTRIBS.');
+ var maxVertexAttribs = /** @type{number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS));
+ gl.vertexAttribPointer(maxVertexAttribs, 1, gl.BYTE, true, 0, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if size is not 1, 2, 3, or 4.');
+ gl.vertexAttribPointer(0, 0, gl.BYTE, true, 0, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if stride is negative.');
+ gl.vertexAttribPointer(0, 1, gl.BYTE, true, -1, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if type is gl.INT_2_10_10_10_REV or gl.UNSIGNED_INT_2_10_10_10_REV and size is not 4.');
+ gl.vertexAttribPointer(0, 2, gl.INT_2_10_10_10_REV, true, 0, 0);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.vertexAttribPointer(0, 2, gl.UNSIGNED_INT_2_10_10_10_REV, true, 0, 0);
+ this.expectError(gl.INVALID_OPERATION);
+ gl.vertexAttribPointer(0, 4, gl.INT_2_10_10_10_REV, true, 0, 0);
+ this.expectError(gl.NO_ERROR);
+ gl.vertexAttribPointer(0, 4, gl.UNSIGNED_INT_2_10_10_10_REV, true, 0, 0);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated a non-zero vertex array object is bound, zero is bound to the gl.ARRAY_BUFFER buffer object binding point and the pointer argument is not NULL.');
+ /** @type{WebGLVertexArrayObject} */ var vao;
+ /** @type{number} */ var offset = 1;
+ vao = gl.createVertexArray();
+ gl.bindVertexArray(vao);
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+ this.expectError(gl.NO_ERROR);
+
+ gl.vertexAttribPointer(0, 1, gl.BYTE, true, 0, offset);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.bindVertexArray(null);
+ gl.deleteVertexArray(vao);
+ this.expectError(gl.NO_ERROR);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('vertex_attrib_i_pointer', 'Invalid gl.vertexAttribIPointer() usage', gl, function() {
+ /** @type{WebGLBuffer} */ var buffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if type is not an accepted value.');
+ gl.vertexAttribIPointer(0, 1, 0, 0, 0);
+ this.expectError(gl.INVALID_ENUM);
+ gl.vertexAttribIPointer(0, 4, gl.INT_2_10_10_10_REV, 0, 0);
+ this.expectError(gl.INVALID_ENUM);
+ gl.vertexAttribIPointer(0, 4, gl.UNSIGNED_INT_2_10_10_10_REV, 0, 0);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater than or equal to gl.MAX_VERTEX_ATTRIBS.');
+ var maxVertexAttribs = /** @type{number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS));
+ gl.vertexAttribIPointer(maxVertexAttribs, 1, gl.BYTE, 0, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if size is not 1, 2, 3, or 4.');
+ gl.vertexAttribIPointer(0, 0, gl.BYTE, 0, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if stride is negative.');
+ gl.vertexAttribIPointer(0, 1, gl.BYTE, -1, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated a non-zero vertex array object is bound, zero is bound to the gl.ARRAY_BUFFER buffer object binding point and the pointer argument is not NULL.');
+ /** @type{WebGLVertexArrayObject} */ var vao;
+ /** @type{number} */ var offset = 1;
+ vao = gl.createVertexArray();
+ gl.bindVertexArray(vao);
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+ this.expectError(gl.NO_ERROR);
+
+ gl.vertexAttribIPointer(0, 1, gl.BYTE, 0, offset);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.bindVertexArray(null);
+ gl.deleteVertexArray(vao);
+ this.expectError(gl.NO_ERROR);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('enable_vertex_attrib_array', 'Invalid gl.enableVertexAttribArray() usage', gl, function() {
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater than or equal to gl.MAX_VERTEX_ATTRIBS.');
+ var maxVertexAttribs = /** @type{number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS));
+ gl.enableVertexAttribArray(maxVertexAttribs);
+ this.expectError(gl.INVALID_VALUE);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('disable_vertex_attrib_array', 'Invalid gl.disableVertexAttribArray() usage', gl, function() {
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater than or equal to gl.MAX_VERTEX_ATTRIBS.');
+ var maxVertexAttribs = /** @type{number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS));
+ gl.disableVertexAttribArray(maxVertexAttribs);
+ this.expectError(gl.INVALID_VALUE);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('vertex_attrib_divisor', 'Invalid gl.vertexAttribDivisor() usage', gl, function() {
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if index is greater than or equal to gl.MAX_VERTEX_ATTRIBS.');
+ var maxVertexAttribs = /** @type{number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS));
+ gl.vertexAttribDivisor(maxVertexAttribs, 0);
+ this.expectError(gl.INVALID_VALUE);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_arrays', 'Invalid gl.drawArrays() usage', gl, function() {
+ /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource));
+ gl.useProgram(program.getProgram());
+ /** @type{WebGLFramebuffer} */ var fbo;
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if mode is not an accepted value.');
+ gl.drawArrays(-1, 0, 1);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if count is negative.');
+ gl.drawArrays(gl.POINTS, 0, -1);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.');
+ fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ gl.drawArrays(gl.POINTS, 0, 1);
+ this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.deleteFramebuffer(fbo);
+
+ gl.useProgram(null);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_arrays_invalid_program', 'Invalid gl.drawArrays() usage', gl, function() {
+ gl.useProgram(null);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if gl.useProgram(null) is used.');
+ gl.drawArrays(gl.POINTS, 0, 1);
+ this.expectError(gl.INVALID_OPERATION);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_arrays_incomplete_primitive', 'Invalid gl.drawArrays() usage', gl, function() {
+ /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource));
+ gl.useProgram(program.getProgram());
+ /** @type{WebGLFramebuffer} */ var fbo;
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if mode is not an accepted value.');
+ gl.drawArrays(-1, 0, 1);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if count is negative.');
+ gl.drawArrays(gl.TRIANGLES, 0, -1);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.');
+ fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ gl.drawArrays(gl.TRIANGLES, 0, 1);
+ this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.deleteFramebuffer(fbo);
+
+ gl.useProgram(null);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_elements', 'Invalid gl.drawElements() usage', gl, function() {
+ /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource));
+ gl.useProgram(program.getProgram());
+ /** @type{WebGLFramebuffer} */ var fbo;
+ /** @type{WebGLBuffer} */ var buf;
+ /** @type{WebGLTransformFeedback} */ var tfID;
+ /** @type{number} */ var vertices = 0;
+
+ /** @type{WebGLBuffer} */ var bufElements = gl.createBuffer();
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bufElements);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if mode is not an accepted value.');
+ gl.drawElements(-1, 0, gl.UNSIGNED_BYTE, vertices);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if type is not one of the accepted values.');
+ gl.drawElements(gl.POINTS, 0, -1, vertices);
+ this.expectError(gl.INVALID_ENUM);
+ gl.drawElements(gl.POINTS, 0, gl.FLOAT, vertices);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if count is negative.');
+ gl.drawElements(gl.POINTS, -1, gl.UNSIGNED_BYTE, vertices);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.');
+ fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ gl.drawElements(gl.POINTS, 0, gl.UNSIGNED_BYTE, vertices);
+ this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.deleteFramebuffer(fbo);
+
+ if (!sglrGLContext.isExtensionSupported(gl, 'EXT_geometry_shader')) { // gl.EXT_geometry_shader removes error
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if transform feedback is active and not paused.');
+ /** @type{Array<string>} */ var tfVarying = ['gl_Position'];
+
+ buf = gl.createBuffer();
+ tfID = gl.createTransformFeedback();
+
+ gl.useProgram (program.getProgram());
+ gl.transformFeedbackVaryings (program.getProgram(), tfVarying, gl.INTERLEAVED_ATTRIBS);
+ gl.linkProgram (program.getProgram());
+ gl.bindTransformFeedback (gl.TRANSFORM_FEEDBACK, tfID);
+ gl.bindBuffer (gl.TRANSFORM_FEEDBACK_BUFFER, buf);
+ gl.bufferData (gl.TRANSFORM_FEEDBACK_BUFFER, 32, gl.DYNAMIC_DRAW);
+ gl.bindBufferBase (gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf);
+ gl.beginTransformFeedback (gl.POINTS);
+ this.expectError (gl.NO_ERROR);
+
+ gl.drawElements (gl.POINTS, 0, gl.UNSIGNED_BYTE, vertices);
+ this.expectError (gl.INVALID_OPERATION);
+
+ gl.bufferData (gl.ELEMENT_ARRAY_BUFFER, 32, gl.STATIC_DRAW);
+
+ gl.pauseTransformFeedback();
+ gl.drawElements (gl.POINTS, 0, gl.UNSIGNED_BYTE, vertices);
+ this.expectError (gl.NO_ERROR);
+
+ gl.endTransformFeedback ();
+ gl.deleteBuffer(buf);
+ gl.deleteTransformFeedback(tfID);
+ gl.deleteBuffer(bufElements);
+ this.expectError (gl.NO_ERROR);
+
+ }
+
+ gl.useProgram(null);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_elements_invalid_program', 'Invalid gl.drawElements() usage', gl, function() {
+ gl.useProgram(null);
+ /** @type{number} */ var vertices = 0;
+
+ /** @type{WebGLBuffer} */ var bufElements = gl.createBuffer();
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bufElements);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if gl.useProgram(null) was set.');
+ gl.drawElements(gl.POINTS, 0, gl.UNSIGNED_BYTE, vertices);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.deleteBuffer(bufElements);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_elements_incomplete_primitive', 'Invalid gl.drawElements() usage', gl, function() {
+ /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource));
+ gl.useProgram(program.getProgram());
+ /** @type{WebGLFramebuffer} */ var fbo;
+ /** @type{WebGLBuffer} */ var buf;
+ /** @type{WebGLTransformFeedback} */ var tfID;
+ /** @type{number} */ var vertices = 0;
+
+ /** @type{WebGLBuffer} */ var bufElements = gl.createBuffer();
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bufElements);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if mode is not an accepted value.');
+ gl.drawElements(-1, 0, gl.UNSIGNED_BYTE, vertices);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if type is not one of the accepted values.');
+ gl.drawElements(gl.TRIANGLES, 0, -1, vertices);
+ this.expectError(gl.INVALID_ENUM);
+ gl.drawElements(gl.TRIANGLES, 0, gl.FLOAT, vertices);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if count is negative.');
+ gl.drawElements(gl.TRIANGLES, -1, gl.UNSIGNED_BYTE, vertices);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.');
+ fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ gl.drawElements(gl.TRIANGLES, 0, gl.UNSIGNED_BYTE, vertices);
+ this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.deleteFramebuffer(fbo);
+
+ if (!sglrGLContext.isExtensionSupported(gl, 'EXT_geometry_shader')) {// gl.EXT_geometry_shader removes error
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if transform feedback is active and not paused.');
+ /** @type{Array<string>} */ var tfVarying = ['gl_Position'];
+
+ buf = gl.createBuffer();
+ tfID = gl.createTransformFeedback();
+
+ gl.useProgram (program.getProgram());
+ gl.transformFeedbackVaryings (program.getProgram(), tfVarying, gl.INTERLEAVED_ATTRIBS);
+ gl.linkProgram (program.getProgram());
+ gl.bindTransformFeedback (gl.TRANSFORM_FEEDBACK, tfID);
+ gl.bindBuffer (gl.TRANSFORM_FEEDBACK_BUFFER, buf);
+ gl.bufferData (gl.TRANSFORM_FEEDBACK_BUFFER, 32, gl.DYNAMIC_DRAW);
+ gl.bindBufferBase (gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf);
+ gl.beginTransformFeedback (gl.TRIANGLES);
+ this.expectError (gl.NO_ERROR);
+
+ gl.drawElements (gl.TRIANGLES, 0, gl.UNSIGNED_BYTE, vertices);
+ this.expectError (gl.INVALID_OPERATION);
+
+ gl.bufferData (gl.ELEMENT_ARRAY_BUFFER, 32, gl.STATIC_DRAW);
+
+ gl.pauseTransformFeedback();
+ gl.drawElements (gl.TRIANGLES, 0, gl.UNSIGNED_BYTE, vertices);
+ this.expectError (gl.NO_ERROR);
+
+ gl.endTransformFeedback ();
+ gl.deleteBuffer(buf);
+ gl.deleteTransformFeedback(tfID);
+ gl.deleteBuffer(bufElements);
+ this.expectError (gl.NO_ERROR);
+
+ }
+
+ gl.useProgram(null);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_arrays_instanced', 'Invalid gl.drawArraysInstanced() usage', gl, function() {
+ /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource));
+ gl.useProgram(program.getProgram());
+ /** @type{WebGLFramebuffer} */ var fbo;
+
+ /** @type{WebGLBuffer} */ var bufElements = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, bufElements);
+
+ gl.vertexAttribDivisor(0, 1);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if mode is not an accepted value.');
+ gl.drawArraysInstanced(-1, 0, 1, 1);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if count or primcount are negative.');
+ gl.drawArraysInstanced(gl.POINTS, 0, -1, 1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.drawArraysInstanced(gl.POINTS, 0, 1, -1);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.');
+ fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ gl.drawArraysInstanced(gl.POINTS, 0, 1, 1);
+ this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.deleteFramebuffer(fbo);
+
+ gl.deleteBuffer(bufElements);
+
+ gl.useProgram(null);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_arrays_instanced_invalid_program', 'Invalid gl.drawArraysInstanced() usage', gl, function() {
+ gl.useProgram(null);
+
+ /** @type{WebGLBuffer} */ var bufElements = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, bufElements);
+
+ gl.vertexAttribDivisor(0, 1);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if gl.useProgram(null) is set.');
+ gl.drawArraysInstanced(gl.POINTS, 0, 1, 1);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.deleteBuffer(bufElements);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_arrays_instanced_incomplete_primitive', 'Invalid gl.drawArraysInstanced() usage', gl, function() {
+ /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource));
+ gl.useProgram(program.getProgram());
+ /** @type{WebGLFramebuffer} */ var fbo;
+
+ /** @type{WebGLBuffer} */ var bufElements = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, bufElements);
+
+ gl.vertexAttribDivisor(0, 1);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if mode is not an accepted value.');
+ gl.drawArraysInstanced(-1, 0, 1, 1);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if count or primcount are negative.');
+ gl.drawArraysInstanced(gl.TRIANGLES, 0, -1, 1);
+ this.expectError(gl.INVALID_VALUE);
+ gl.drawArraysInstanced(gl.TRIANGLES, 0, 1, -1);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.');
+ fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ gl.drawArraysInstanced(gl.TRIANGLES, 0, 1, 1);
+ this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.deleteFramebuffer(fbo);
+
+ gl.deleteBuffer(bufElements);
+
+ gl.useProgram(null);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_elements_instanced', 'Invalid gl.drawElementsInstanced() usage', gl, function() {
+ /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource));
+ gl.useProgram(program.getProgram());
+ /** @type{WebGLFramebuffer} */ var fbo;
+ /** @type{WebGLBuffer} */ var buf;
+ /** @type{WebGLTransformFeedback} */ var tfID;
+ /** @type{number} */ var vertices = 0;
+
+ /** @type{WebGLBuffer} */ var bufElements = gl.createBuffer();
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bufElements);
+
+ gl.vertexAttribDivisor(0, 1);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if mode is not an accepted value.');
+ gl.drawElementsInstanced(-1, 0, gl.UNSIGNED_BYTE, vertices, 1);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if type is not one of the accepted values.');
+ gl.drawElementsInstanced(gl.POINTS, 0, -1, vertices, 1);
+ this.expectError(gl.INVALID_ENUM);
+ gl.drawElementsInstanced(gl.POINTS, 0, gl.FLOAT, vertices, 1);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if count or primcount are negative.');
+ gl.drawElementsInstanced(gl.POINTS, -1, gl.UNSIGNED_BYTE, vertices, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.drawElementsInstanced(gl.POINTS, 0, gl.UNSIGNED_BYTE, vertices, -1);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.');
+ fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ gl.drawElementsInstanced(gl.POINTS, 0, gl.UNSIGNED_BYTE, vertices, 1);
+ this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.deleteFramebuffer(fbo);
+
+ if (!sglrGLContext.isExtensionSupported(gl, 'EXT_geometry_shader')) {// gl.EXT_geometry_shader removes error
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if transform feedback is active and not paused.');
+ /** @type{Array<string>} */ var tfVarying = ['gl_Position'];
+
+ buf = gl.createBuffer();
+ tfID = gl.createTransformFeedback();
+
+ gl.useProgram (program.getProgram());
+ gl.transformFeedbackVaryings (program.getProgram(), tfVarying, gl.INTERLEAVED_ATTRIBS);
+ gl.linkProgram (program.getProgram());
+ gl.bindTransformFeedback (gl.TRANSFORM_FEEDBACK, tfID);
+ gl.bindBuffer (gl.TRANSFORM_FEEDBACK_BUFFER, buf);
+ gl.bufferData (gl.TRANSFORM_FEEDBACK_BUFFER, 32, gl.DYNAMIC_DRAW);
+ gl.bindBufferBase (gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf);
+ gl.beginTransformFeedback (gl.POINTS);
+ this.expectError (gl.NO_ERROR);
+
+ gl.drawElementsInstanced (gl.POINTS, 0, gl.UNSIGNED_BYTE, vertices, 1);
+ this.expectError (gl.INVALID_OPERATION);
+
+ gl.bufferData (gl.ELEMENT_ARRAY_BUFFER, 32, gl.STATIC_DRAW);
+
+ gl.pauseTransformFeedback();
+ gl.drawElementsInstanced (gl.POINTS, 0, gl.UNSIGNED_BYTE, vertices, 1);
+ this.expectError (gl.NO_ERROR);
+
+ gl.endTransformFeedback ();
+ gl.deleteBuffer(buf);
+ gl.deleteTransformFeedback(tfID);
+ gl.deleteBuffer(bufElements);
+ this.expectError (gl.NO_ERROR);
+
+ }
+
+ gl.useProgram(null);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_elements_instanced_invalid_program', 'Invalid gl.drawElementsInstanced() usage', gl, function() {
+ gl.useProgram(null);
+ /** @type{number} */ var vertices = 0;
+
+ /** @type{WebGLBuffer} */ var bufElements;
+ bufElements = gl.createBuffer();
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bufElements);
+
+ gl.vertexAttribDivisor(0, 1);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if gl.useProgram(null) is set.');
+ gl.drawElementsInstanced(gl.POINTS, 0, gl.UNSIGNED_BYTE, vertices, 1);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.deleteBuffer(bufElements);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_elements_instanced_incomplete_primitive', 'Invalid gl.drawElementsInstanced() usage', gl, function() {
+ /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource));
+ gl.useProgram(program.getProgram());
+ /** @type{WebGLFramebuffer} */ var fbo;
+ /** @type{WebGLBuffer} */ var buf;
+ /** @type{WebGLTransformFeedback} */ var tfID;
+ /** @type{number} */ var vertices = 0;
+
+ /** @type{WebGLBuffer} */ var bufElements;
+ bufElements = gl.createBuffer();
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bufElements);
+
+ gl.vertexAttribDivisor(0, 1);
+ this.expectError(gl.NO_ERROR);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if mode is not an accepted value.');
+ gl.drawElementsInstanced(-1, 0, gl.UNSIGNED_BYTE, vertices, 1);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if type is not one of the accepted values.');
+ gl.drawElementsInstanced(gl.TRIANGLES, 0, -1, vertices, 1);
+ this.expectError(gl.INVALID_ENUM);
+ gl.drawElementsInstanced(gl.TRIANGLES, 0, gl.FLOAT, vertices, 1);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if count or primcount are negative.');
+ gl.drawElementsInstanced(gl.TRIANGLES, -1, gl.UNSIGNED_BYTE, vertices, 0);
+ this.expectError(gl.INVALID_VALUE);
+ gl.drawElementsInstanced(gl.TRIANGLES, 0, gl.UNSIGNED_BYTE, vertices, -1);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.');
+ fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ gl.drawElementsInstanced(gl.TRIANGLES, 0, gl.UNSIGNED_BYTE, vertices, 1);
+ this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.deleteFramebuffer(fbo);
+
+ if (!sglrGLContext.isExtensionSupported(gl, 'EXT_geometry_shader')) {// gl.EXT_geometry_shader removes error
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if transform feedback is active and not paused.');
+ /** @type{Array<string>} */ var tfVarying = ['gl_Position'];
+
+ buf = gl.createBuffer();
+ tfID = gl.createTransformFeedback();
+
+ gl.useProgram (program.getProgram());
+ gl.transformFeedbackVaryings (program.getProgram(), tfVarying, gl.INTERLEAVED_ATTRIBS);
+ gl.linkProgram (program.getProgram());
+ gl.bindTransformFeedback (gl.TRANSFORM_FEEDBACK, tfID);
+ gl.bindBuffer (gl.TRANSFORM_FEEDBACK_BUFFER, buf);
+ gl.bufferData (gl.TRANSFORM_FEEDBACK_BUFFER, 32, gl.DYNAMIC_DRAW);
+ gl.bindBufferBase (gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf);
+ gl.beginTransformFeedback (gl.TRIANGLES);
+ this.expectError (gl.NO_ERROR);
+
+ gl.drawElementsInstanced (gl.TRIANGLES, 0, gl.UNSIGNED_BYTE, vertices, 1);
+ this.expectError (gl.INVALID_OPERATION);
+
+ gl.bufferData (gl.ELEMENT_ARRAY_BUFFER, 32, gl.STATIC_DRAW);
+
+ gl.pauseTransformFeedback();
+ gl.drawElementsInstanced (gl.TRIANGLES, 0, gl.UNSIGNED_BYTE, vertices, 1);
+ this.expectError (gl.NO_ERROR);
+
+ gl.endTransformFeedback ();
+ gl.deleteBuffer(buf);
+ gl.deleteTransformFeedback(tfID);
+ gl.deleteBuffer(bufElements);
+ this.expectError (gl.NO_ERROR);
+
+ }
+
+ gl.useProgram(null);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_range_elements', 'Invalid gl.drawRangeElements() usage', gl, function() {
+ /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource));
+ gl.useProgram(program.getProgram());
+ /** @type{WebGLFramebuffer} */ var fbo;
+ /** @type{WebGLBuffer} */ var buf;
+ /** @type{WebGLTransformFeedback} */ var tfID;
+ /** @type{number} */ var vertices = 0;
+
+ /** @type{WebGLBuffer} */ var bufElements;
+ bufElements = gl.createBuffer();
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bufElements);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if mode is not an accepted value.');
+ gl.drawRangeElements(-1, 0, 1, 0, gl.UNSIGNED_BYTE, vertices);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if type is not one of the accepted values.');
+ gl.drawRangeElements(gl.POINTS, 0, 1, 0, -1, vertices);
+ this.expectError(gl.INVALID_ENUM);
+ gl.drawRangeElements(gl.POINTS, 0, 1, 0, gl.FLOAT, vertices);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if count is negative.');
+ gl.drawRangeElements(gl.POINTS, 0, 1, -1, gl.UNSIGNED_BYTE, vertices);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if end < start.');
+ gl.drawRangeElements(gl.POINTS, 1, 0, 0, gl.UNSIGNED_BYTE, vertices);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.');
+ fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ gl.drawRangeElements(gl.POINTS, 0, 1, 0, gl.UNSIGNED_BYTE, vertices);
+ this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.deleteFramebuffer(fbo);
+
+ if (!sglrGLContext.isExtensionSupported(gl, 'EXT_geometry_shader')) {// gl.EXT_geometry_shader removes error
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if transform feedback is active and not paused.');
+ /** @type{Array<string>} */ var tfVarying = ['gl_Position'];
+
+ buf = gl.createBuffer();
+ tfID = gl.createTransformFeedback();
+
+ gl.useProgram (program.getProgram());
+ gl.transformFeedbackVaryings (program.getProgram(), tfVarying, gl.INTERLEAVED_ATTRIBS);
+ gl.linkProgram (program.getProgram());
+ gl.bindTransformFeedback (gl.TRANSFORM_FEEDBACK, tfID);
+ gl.bindBuffer (gl.TRANSFORM_FEEDBACK_BUFFER, buf);
+ gl.bufferData (gl.TRANSFORM_FEEDBACK_BUFFER, 32, gl.DYNAMIC_DRAW);
+ gl.bindBufferBase (gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf);
+ gl.beginTransformFeedback (gl.POINTS);
+ this.expectError (gl.NO_ERROR);
+
+ gl.drawRangeElements (gl.POINTS, 0, 1, 0, gl.UNSIGNED_BYTE, vertices);
+ this.expectError (gl.INVALID_OPERATION);
+
+ gl.bufferData (gl.ELEMENT_ARRAY_BUFFER, 32, gl.STATIC_DRAW);
+
+ gl.pauseTransformFeedback();
+ gl.drawRangeElements (gl.POINTS, 0, 1, 0, gl.UNSIGNED_BYTE, vertices);
+ this.expectError (gl.NO_ERROR);
+
+ gl.endTransformFeedback ();
+ gl.deleteBuffer(buf);
+ gl.deleteTransformFeedback(tfID);
+ gl.deleteBuffer(bufElements);
+ this.expectError (gl.NO_ERROR);
+
+ }
+
+ gl.useProgram(null);
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_range_elements_invalid_program', 'Invalid gl.drawRangeElements() usage', gl, function() {
+ gl.useProgram(null);
+ /** @type{number} */ var vertices = 0;
+
+ /** @type{WebGLBuffer} */ var bufElements;
+ bufElements = gl.createBuffer();
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bufElements);
+ gl.bufferData (gl.ELEMENT_ARRAY_BUFFER, 32, gl.STATIC_DRAW);
+
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if gl.useProgram(null) is set.');
+ gl.drawRangeElements(gl.POINTS, 0, 1, 0, gl.UNSIGNED_BYTE, vertices);
+ this.expectError(gl.INVALID_OPERATION);
+
+ gl.deleteBuffer(bufElements);
+
+ }));
+
+ testGroup.addChild(new es3fApiCase.ApiCaseCallback('draw_range_elements_incomplete_primitive', 'Invalid gl.drawRangeElements() usage', gl, function() {
+ /** @type{gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl,gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource));
+ gl.useProgram(program.getProgram());
+ /** @type{WebGLFramebuffer} */ var fbo;
+ /** @type{WebGLBuffer} */ var buf;
+ /** @type{WebGLTransformFeedback} */ var tfID;
+ /** @type{number} */ var vertices = 0;
+
+ /** @type{WebGLBuffer} */ var bufElements;
+ bufElements = gl.createBuffer();
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bufElements);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if mode is not an accepted value.');
+ gl.drawRangeElements(-1, 0, 1, 0, gl.UNSIGNED_BYTE, vertices);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_ENUM is generated if type is not one of the accepted values.');
+ gl.drawRangeElements(gl.TRIANGLES, 0, 1, 0, -1, vertices);
+ this.expectError(gl.INVALID_ENUM);
+ gl.drawRangeElements(gl.TRIANGLES, 0, 1, 0, gl.FLOAT, vertices);
+ this.expectError(gl.INVALID_ENUM);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if count is negative.');
+ gl.drawRangeElements(gl.TRIANGLES, 0, 1, -1, gl.UNSIGNED_BYTE, vertices);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_VALUE is generated if end < start.');
+ gl.drawRangeElements(gl.TRIANGLES, 1, 0, 0, gl.UNSIGNED_BYTE, vertices);
+ this.expectError(gl.INVALID_VALUE);
+
+ bufferedLogToConsole('gl.INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound framebuffer is not framebuffer complete.');
+ fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ gl.drawRangeElements(gl.TRIANGLES, 0, 1, 0, gl.UNSIGNED_BYTE, vertices);
+ this.expectError(gl.INVALID_FRAMEBUFFER_OPERATION);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.deleteFramebuffer(fbo);
+
+ if (!sglrGLContext.isExtensionSupported(gl, 'EXT_geometry_shader')) {// gl.EXT_geometry_shader removes error
+ bufferedLogToConsole('gl.INVALID_OPERATION is generated if transform feedback is active and not paused.');
+ /** @type{Array<string>} */ var tfVarying = ['gl_Position'];
+
+ buf = gl.createBuffer();
+ tfID = gl.createTransformFeedback();
+
+ gl.useProgram (program.getProgram());
+ gl.transformFeedbackVaryings (program.getProgram(), tfVarying, gl.INTERLEAVED_ATTRIBS);
+ gl.linkProgram (program.getProgram());
+ gl.bindTransformFeedback (gl.TRANSFORM_FEEDBACK, tfID);
+ gl.bindBuffer (gl.TRANSFORM_FEEDBACK_BUFFER, buf);
+ gl.bufferData (gl.TRANSFORM_FEEDBACK_BUFFER, 32, gl.DYNAMIC_DRAW);
+ gl.bindBufferBase (gl.TRANSFORM_FEEDBACK_BUFFER, 0, buf);
+ gl.beginTransformFeedback (gl.TRIANGLES);
+ this.expectError (gl.NO_ERROR);
+
+ gl.drawRangeElements (gl.TRIANGLES, 0, 1, 0, gl.UNSIGNED_BYTE, vertices);
+ this.expectError (gl.INVALID_OPERATION);
+
+ gl.bufferData (gl.ELEMENT_ARRAY_BUFFER, 32, gl.STATIC_DRAW);
+
+ gl.pauseTransformFeedback();
+ gl.drawRangeElements (gl.TRIANGLES, 0, 1, 0, gl.UNSIGNED_BYTE, vertices);
+ this.expectError (gl.NO_ERROR);
+
+ gl.endTransformFeedback ();
+ gl.deleteBuffer(buf);
+ gl.deleteTransformFeedback(tfID);
+ gl.deleteBuffer(bufElements);
+ this.expectError (gl.NO_ERROR);
+
+ }
+
+ gl.useProgram(null);
+ }));
+ };
+
+ /**
+ * @param {WebGL2RenderingContext} gl
+ */
+ es3fNegativeVertexArrayApiTests.run = function(gl) {
+ var testName = 'vertex_array';
+ var testDescription = 'Negative Vertex Array API Cases';
+ var state = tcuTestCase.runner;
+
+ state.testName = testName;
+ state.testCases = tcuTestCase.newTest(testName, testDescription, null);
+
+ //Set up name and description of this test series.
+ setCurrentTestName(testName);
+ description(testDescription);
+ try {
+ es3fNegativeVertexArrayApiTests.init(gl);
+ tcuTestCase.runner.runCallback(tcuTestCase.runTestCases);
+ } catch (err) {
+ bufferedLogToConsole(err);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fOcclusionQueryTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fOcclusionQueryTests.js
new file mode 100644
index 0000000000..8549d657bd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fOcclusionQueryTests.js
@@ -0,0 +1,511 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fOcclusionQueryTests');
+goog.require('framework.common.tcuLogImage');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.opengl.gluShaderProgram');
+
+goog.scope(function() {
+var es3fOcclusionQueryTests = functional.gles3.es3fOcclusionQueryTests;
+var tcuTestCase = framework.common.tcuTestCase;
+var tcuLogImage = framework.common.tcuLogImage;
+var tcuSurface = framework.common.tcuSurface;
+var deRandom = framework.delibs.debase.deRandom;
+var deString = framework.delibs.debase.deString;
+var gluShaderProgram = framework.opengl.gluShaderProgram;
+
+var setParentClass = function(child, parent) {
+ child.prototype = Object.create(parent.prototype);
+ child.prototype.constructor = child;
+};
+
+/** @const */ var DEPTH_WRITE_COLOR = [0, 0, 1, 1];
+/** @const */ var DEPTH_CLEAR_COLOR = [0, 0.5, 0.8, 1];
+/** @const */ var STENCIL_WRITE_COLOR = [0, 1, 0, 1];
+/** @const */ var STENCIL_CLEAR_COLOR = [0, 0.8, 0.5, 1];
+/** @const */ var TARGET_COLOR = [1, 0, 0, 1];
+/** @const */ var ELEMENTS_PER_VERTEX = 4;
+/** @const */ var NUM_CASE_ITERATIONS = 10;
+
+// Constants to tweak visible/invisible case probability balance.
+
+/** @const */ var DEPTH_CLEAR_OFFSET = 100;
+/** @const */ var STENCIL_CLEAR_OFFSET = 100;
+/** @const */ var SCISSOR_OFFSET = 100;
+/** @const */ var SCISSOR_MINSIZE = 250;
+
+/** @const */ var OCCLUDER_SCISSOR = (1 << 0);
+/** @const */ var OCCLUDER_DEPTH_WRITE = (1 << 1);
+/** @const */ var OCCLUDER_DEPTH_CLEAR = (1 << 2);
+/** @const */ var OCCLUDER_STENCIL_WRITE = (1 << 3);
+/** @const */ var OCCLUDER_STENCIL_CLEAR = (1 << 4);
+
+/**
+ * @enum
+ */
+es3fOcclusionQueryTests.State = {
+ DRAW: 0,
+ VERIFY: 1,
+ FINISH: 2
+};
+
+/* Maximum time to wait for query result (in seconds) */
+/** @const */ var MAX_VERIFY_WAIT = 5;
+
+/**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+es3fOcclusionQueryTests.OcclusionQueryCase = function(name, description, numOccluderDraws, numOccludersPerDraw, occluderSize, numTargetDraws, numTargetsPerDraw, targetSize, queryMode, occluderTypes) {
+ tcuTestCase.DeqpTest.call(this, name, description);
+ this.m_numOccluderDraws = numOccluderDraws;
+ this.m_numOccludersPerDraw = numOccludersPerDraw;
+ this.m_occluderSize = occluderSize;
+ this.m_numTargetDraws = numTargetDraws;
+ this.m_numTargetsPerDraw = numTargetsPerDraw;
+ this.m_targetSize = targetSize;
+ this.m_queryMode = queryMode;
+ this.m_occluderTypes = occluderTypes;
+ this.m_program = null;
+ this.m_iterNdx = 0;
+ this.m_rnd = new deRandom.Random(deString.deStringHash(name));
+ this.m_state = es3fOcclusionQueryTests.State.DRAW;
+ /** @type {WebGLQuery} */ this.m_query;
+};
+
+setParentClass(es3fOcclusionQueryTests.OcclusionQueryCase, tcuTestCase.DeqpTest);
+
+es3fOcclusionQueryTests.OcclusionQueryCase.prototype.generateVertices = function(width, height, primitiveCount, verticesPerPrimitive, rnd, primitiveSize, minZ, maxZ) {
+ var dst = [];
+ var w = width / 2;
+ var h = height / 2;
+ var s = primitiveSize / 2;
+
+ var vertexCount = verticesPerPrimitive * primitiveCount;
+
+ // First loop gets a random point inside unit square
+ for (var i = 0; i < vertexCount; i += 3) {
+ var rndX = rnd.getFloat(-w, w);
+ var rndY = rnd.getFloat(-h, h);
+
+ // Second loop gets 3 random points within given distance s from (rndX, rndY)
+ for (var j = 0; j < verticesPerPrimitive; j++) {
+ var offset = (i + j) * ELEMENTS_PER_VERTEX;
+ dst[offset] = rndX + rnd.getFloat(-s, s); // x
+ dst[offset + 1] = rndY + rnd.getFloat(-s, s); // y
+ dst[offset + 2] = rnd.getFloat(minZ, maxZ); // z
+ dst[offset + 3] = 1; // w
+ }
+ }
+ return dst;
+};
+
+es3fOcclusionQueryTests.OcclusionQueryCase.prototype.init = function() {
+ var vertShaderSource =
+ '#version 300 es\n' +
+ 'layout(location = 0) in mediump vec4 a_position;\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = a_position;\n' +
+ '}\n';
+
+ var fragShaderSource =
+ '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 dEQP_FragColor;\n' +
+ 'uniform mediump vec4 u_color;\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' mediump float depth_gradient = gl_FragCoord.z;\n' +
+ ' mediump float bias = 0.1;\n' +
+ ' dEQP_FragColor = vec4(u_color.xyz * (depth_gradient + bias), 1);\n' +
+ '}\n';
+
+ this.m_program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertShaderSource, fragShaderSource));
+
+ if (!this.m_program.isOk())
+ testFailedOptions('Failed to compile program', true);
+
+ this.m_buffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, this.m_buffer);
+ gl.vertexAttribPointer(0, ELEMENTS_PER_VERTEX, gl.FLOAT, false, 0, 0);
+};
+
+es3fOcclusionQueryTests.OcclusionQueryCase.prototype.draw = function() {
+ var colorUnif = gl.getUniformLocation(this.m_program.getProgram(), 'u_color');
+
+ var targetW = gl.drawingBufferWidth;
+ var targetH = gl.drawingBufferHeight;
+
+ bufferedLogToConsole('Case iteration ' + (this.m_iterNdx + 1) + ' / ' + NUM_CASE_ITERATIONS);
+ bufferedLogToConsole('Parameters:\n' +
+ '- ' + this.m_numOccluderDraws + ' occluder draws, ' + this.m_numOccludersPerDraw + ' primitive writes per draw,\n' +
+ '- ' + this.m_numTargetDraws + ' target draws, ' + this.m_numTargetsPerDraw + ' targets per draw\n');
+
+ gl.clearColor(0, 0, 0, 1);
+ gl.clearDepth(1);
+ gl.clearStencil(0);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+ gl.useProgram(this.m_program.getProgram());
+ gl.enableVertexAttribArray(0);
+
+ // Draw occluders
+
+ var occOptions = [];
+ if (this.m_occluderTypes & OCCLUDER_DEPTH_WRITE) occOptions.push(OCCLUDER_DEPTH_WRITE);
+ if (this.m_occluderTypes & OCCLUDER_DEPTH_CLEAR) occOptions.push(OCCLUDER_DEPTH_CLEAR);
+ if (this.m_occluderTypes & OCCLUDER_STENCIL_WRITE) occOptions.push(OCCLUDER_STENCIL_WRITE);
+ if (this.m_occluderTypes & OCCLUDER_STENCIL_CLEAR) occOptions.push(OCCLUDER_STENCIL_CLEAR);
+
+ for (var i = 0; i < this.m_numOccluderDraws; i++) {
+ if (occOptions.length == 0)
+ break;
+
+ var type = occOptions[this.m_rnd.getInt(0, occOptions.length - 1)]; // Choosing a random occluder type from available options
+
+ switch (type) {
+ case OCCLUDER_DEPTH_WRITE:
+ bufferedLogToConsole('Occluder draw ' + (i + 1) + ' / ' + this.m_numOccluderDraws + ' : ' + 'Depth write');
+
+ var occluderVertices = this.generateVertices(2, 2, this.m_numOccludersPerDraw, 3, this.m_rnd, this.m_occluderSize, 0, 0.6); // Generate vertices for occluding primitives
+
+ gl.enable(gl.DEPTH_TEST);
+ gl.uniform4f(colorUnif, DEPTH_WRITE_COLOR[0], DEPTH_WRITE_COLOR[1], DEPTH_WRITE_COLOR[2], DEPTH_WRITE_COLOR[3]);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(occluderVertices), gl.STATIC_DRAW);
+ gl.drawArrays(gl.TRIANGLES, 0, 3 * this.m_numOccludersPerDraw);
+ gl.disable(gl.DEPTH_TEST);
+
+ break;
+
+ case OCCLUDER_DEPTH_CLEAR: {
+ var scissorBoxX = this.m_rnd.getInt(-DEPTH_CLEAR_OFFSET, targetW);
+ var scissorBoxY = this.m_rnd.getInt(-DEPTH_CLEAR_OFFSET, targetH);
+ var scissorBoxW = this.m_rnd.getInt(DEPTH_CLEAR_OFFSET, targetW + DEPTH_CLEAR_OFFSET);
+ var scissorBoxH = this.m_rnd.getInt(DEPTH_CLEAR_OFFSET, targetH + DEPTH_CLEAR_OFFSET);
+
+ bufferedLogToConsole('Occluder draw ' + (i + 1) + ' / ' + this.m_numOccluderDraws + ' : ' + 'Depth clear');
+ bufferedLogToConsole('Depth-clearing box drawn at ' +
+ '(' + scissorBoxX + ', ' + scissorBoxY + ')' +
+ ', width = ' + scissorBoxW + ', height = ' + scissorBoxH + '.');
+
+ gl.enable(gl.SCISSOR_TEST);
+ gl.scissor(scissorBoxX, scissorBoxY, scissorBoxW, scissorBoxH);
+ gl.clearDepth(0);
+ gl.clearColor(DEPTH_CLEAR_COLOR[0], DEPTH_CLEAR_COLOR[1], DEPTH_CLEAR_COLOR[2], DEPTH_CLEAR_COLOR[3]);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.disable(gl.SCISSOR_TEST);
+
+ break;
+ }
+
+ case OCCLUDER_STENCIL_WRITE:
+ bufferedLogToConsole('Occluder draw ' + (i + 1) + ' / ' + this.m_numOccluderDraws + ' : ' + 'Stencil write');
+
+ occluderVertices = this.generateVertices(2, 2, this.m_numOccludersPerDraw, 3, this.m_rnd, this.m_occluderSize, 0, 0.6);
+
+ gl.stencilFunc(gl.ALWAYS, 1, 0xFF);
+ gl.stencilOp(gl.KEEP, gl.KEEP, gl.REPLACE);
+
+ gl.enable(gl.STENCIL_TEST);
+ gl.uniform4f(colorUnif, STENCIL_WRITE_COLOR[0], STENCIL_WRITE_COLOR[1], STENCIL_WRITE_COLOR[2], STENCIL_WRITE_COLOR[3]);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(occluderVertices), gl.STATIC_DRAW);
+ gl.drawArrays(gl.TRIANGLES, 0, 3 * this.m_numOccludersPerDraw);
+ gl.disable(gl.STENCIL_TEST);
+
+ break;
+
+ case OCCLUDER_STENCIL_CLEAR: {
+ var scissorBoxX = this.m_rnd.getInt(-STENCIL_CLEAR_OFFSET, targetW);
+ var scissorBoxY = this.m_rnd.getInt(-STENCIL_CLEAR_OFFSET, targetH);
+ var scissorBoxW = this.m_rnd.getInt(STENCIL_CLEAR_OFFSET, targetW + STENCIL_CLEAR_OFFSET);
+ var scissorBoxH = this.m_rnd.getInt(STENCIL_CLEAR_OFFSET, targetH + STENCIL_CLEAR_OFFSET);
+
+ bufferedLogToConsole('Occluder draw ' + (i + 1) + ' / ' + this.m_numOccluderDraws + ' : ' + 'Stencil clear');
+ bufferedLogToConsole('Stencil-clearing box drawn at ' +
+ '(' + scissorBoxX + ', ' + scissorBoxY + ')' +
+ ', width = ' + scissorBoxW + ', height = ' + scissorBoxH + '.');
+
+ gl.enable(gl.SCISSOR_TEST);
+ gl.scissor(scissorBoxX, scissorBoxY, scissorBoxW, scissorBoxH);
+ gl.clearStencil(1);
+ gl.clearColor(STENCIL_CLEAR_COLOR[0], STENCIL_CLEAR_COLOR[1], STENCIL_CLEAR_COLOR[2], STENCIL_CLEAR_COLOR[3]);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+ gl.disable(gl.SCISSOR_TEST);
+
+ break;
+ }
+
+ default:
+ throw new Error('Invalid occluder type: ' + type);
+ }
+ }
+
+ if (this.m_occluderTypes & OCCLUDER_SCISSOR) {
+ var scissorBoxX = this.m_rnd.getInt(-SCISSOR_OFFSET, targetW - SCISSOR_OFFSET);
+ var scissorBoxY = this.m_rnd.getInt(-SCISSOR_OFFSET, targetH - SCISSOR_OFFSET);
+ var scissorBoxW = this.m_rnd.getInt(SCISSOR_MINSIZE, targetW + SCISSOR_OFFSET);
+ var scissorBoxH = this.m_rnd.getInt(SCISSOR_MINSIZE, targetH + SCISSOR_OFFSET);
+
+ bufferedLogToConsole('Scissor box drawn at ' +
+ '(' + scissorBoxX + ', ' + scissorBoxY + ')' +
+ ', width = ' + scissorBoxW + ', height = ' + scissorBoxH + '.');
+
+ gl.enable(gl.SCISSOR_TEST);
+ gl.scissor(scissorBoxX, scissorBoxY, scissorBoxW, scissorBoxH);
+ }
+
+ this.m_query = gl.createQuery();
+ gl.beginQuery(this.m_queryMode, this.m_query);
+
+ // Draw target primitives
+
+ gl.enable(gl.DEPTH_TEST);
+ gl.enable(gl.STENCIL_TEST);
+ gl.stencilFunc(gl.EQUAL, 0, 0xFF);
+
+ for (var i = 0; i < this.m_numTargetDraws; i++) {
+ var targetVertices = this.generateVertices(2, 2, this.m_numTargetsPerDraw, 3, this.m_rnd, this.m_targetSize, 0.4, 1); // Generate vertices for target primitives
+
+ if (targetVertices.length > 0) {
+ gl.uniform4f(colorUnif, TARGET_COLOR[0], TARGET_COLOR[1], TARGET_COLOR[2], TARGET_COLOR[3]);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(targetVertices), gl.STATIC_DRAW);
+ gl.drawArrays(gl.TRIANGLES, 0, 3 * this.m_numTargetsPerDraw);
+ }
+ }
+
+ gl.endQuery(this.m_queryMode);
+ gl.disable(gl.SCISSOR_TEST);
+ gl.disable(gl.STENCIL_TEST);
+ gl.disable(gl.DEPTH_TEST);
+ this.m_state = es3fOcclusionQueryTests.State.VERIFY;
+};
+
+es3fOcclusionQueryTests.OcclusionQueryCase.prototype.verify = function() {
+ // Check that query result is available.
+ var resultAvailable = /** @type {boolean} */ (gl.getQueryParameter(this.m_query, gl.QUERY_RESULT_AVAILABLE));
+ if (!resultAvailable) {
+ if (!this.m_verifyStart)
+ this.m_verifyStart = new Date();
+ else {
+ var current = new Date();
+ var elapsedTime = 0.001 * (current.getTime() - this.m_verifyStart.getTime());
+ if (elapsedTime > MAX_VERIFY_WAIT) {
+ testFailed('Query result not available after ' + elapsedTime + ' seconds.');
+ this.m_state = es3fOcclusionQueryTests.State.FINISH;
+ }
+ }
+ return;
+ }
+
+ // Read query result.
+ var result = /** @type {number} */ (gl.getQueryParameter(this.m_query, gl.QUERY_RESULT));
+ var queryResult = (result > 0);
+
+ gl.deleteQuery(this.m_query);
+
+ // Read pixel data
+
+ var pixels = new tcuSurface.Surface();
+ pixels.readViewport(gl);
+ var colorReadResult = false;
+ var width = pixels.getWidth();
+ var height = pixels.getHeight();
+
+ for (var y = 0; y < height; y++) {
+ for (var x = 0; x < width; x++) {
+ if (pixels.getPixel(x, y)[0] != 0) {
+ colorReadResult = true;
+ break;
+ }
+ }
+ if (colorReadResult) break;
+ }
+
+ var message = 'Occlusion query result: Target ' + (queryResult ? 'visible' : 'invisible') + '. ' +
+ 'Framebuffer read result: Target ' + (colorReadResult ? 'visible' : 'invisible');
+
+ var testOk = false;
+ if (this.m_queryMode == gl.ANY_SAMPLES_PASSED_CONSERVATIVE) {
+ if (queryResult || colorReadResult)
+ testOk = queryResult; // Allow conservative occlusion query to return false positives.
+ else
+ testOk = queryResult == colorReadResult;
+ } else
+ testOk = (queryResult == colorReadResult);
+
+ if (!testOk) {
+ tcuLogImage.logImage('Result image', 'Result image', pixels.getAccess());
+ testFailed(message);
+ this.m_state = es3fOcclusionQueryTests.State.FINISH;
+ return;
+ }
+
+ bufferedLogToConsole(message);
+ bufferedLogToConsole('Case passed!');
+
+ if (++this.m_iterNdx < NUM_CASE_ITERATIONS) {
+ this.m_state = es3fOcclusionQueryTests.State.DRAW
+ } else {
+ this.m_state = es3fOcclusionQueryTests.State.FINISH;
+ testPassed();
+ }
+};
+
+
+es3fOcclusionQueryTests.OcclusionQueryCase.prototype.iterate = function() {
+ switch(this.m_state) {
+ case es3fOcclusionQueryTests.State.DRAW:
+ this.draw();
+ break;
+ case es3fOcclusionQueryTests.State.VERIFY:
+ this.verify();
+ break;
+ case es3fOcclusionQueryTests.State.FINISH:
+ return tcuTestCase.IterateResult.STOP;
+ default:
+ throw new Error('Invalid state: ' + this.m_state);
+ }
+
+ return tcuTestCase.IterateResult.CONTINUE;
+};
+
+/**
+* @constructor
+* @extends {tcuTestCase.DeqpTest}
+*/
+es3fOcclusionQueryTests.OcclusionQueryTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'occlusion_query', 'Occlusion Query Tests');
+};
+
+es3fOcclusionQueryTests.OcclusionQueryTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+es3fOcclusionQueryTests.OcclusionQueryTests.prototype.constructor = es3fOcclusionQueryTests.OcclusionQueryTests;
+
+es3fOcclusionQueryTests.OcclusionQueryTests.prototype.init = function() {
+ // Strict occlusion query cases
+
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor', 'scissor', 1, 10, 1.6, 1, 1, 0.3, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('depth_write', 'depth_write', 8, 10, 1.6, 1, 7, 0.3, gl.ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_WRITE));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('depth_clear', 'depth_clear', 5, 10, 1.6, 1, 5, 0.2, gl.ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('stencil_write', 'stencil_write', 8, 10, 2.0, 1, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_STENCIL_WRITE));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('stencil_clear', 'stencil_clear', 5, 10, 2.0, 1, 3, 0.3, gl.ANY_SAMPLES_PASSED, OCCLUDER_STENCIL_CLEAR));
+
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor_depth_write', 'scissor_depth_write', 5, 10, 1.6, 2, 5, 0.3, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor_depth_clear', 'scissor_depth_clear', 7, 10, 1.6, 2, 5, 1.0, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor_stencil_write', 'scissor_stencil_write', 4, 10, 1.6, 2, 5, 0.3, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_STENCIL_WRITE));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor_stencil_clear', 'scissor_stencil_clear', 4, 10, 1.6, 2, 5, 1.0, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_STENCIL_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('depth_write_depth_clear', 'depth_write_depth_clear', 7, 10, 1.6, 1, 5, 0.2, gl.ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('depth_write_stencil_write', 'depth_write_stencil_write', 8, 10, 1.6, 1, 5, 0.3, gl.ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_WRITE));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('depth_write_stencil_clear', 'depth_write_stencil_clear', 8, 10, 1.6, 1, 5, 0.3, gl.ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('depth_clear_stencil_write', 'depth_clear_stencil_write', 8, 10, 1.6, 1, 5, 0.3, gl.ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('depth_clear_stencil_clear', 'depth_clear_stencil_clear', 12, 10, 1.6, 1, 5, 0.2, gl.ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('stencil_write_stencil_clear', 'stencil_write_stencil_clear', 5, 10, 2.0, 1, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR));
+
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor_depth_write_depth_clear', 'scissor_depth_write_depth_clear', 5, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor_depth_write_stencil_write', 'scissor_depth_write_stencil_write', 4, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_WRITE));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor_depth_write_stencil_clear', 'scissor_depth_write_stencil_clear', 6, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor_depth_clear_stencil_write', 'scissor_depth_clear_stencil_write', 4, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor_depth_clear_stencil_clear', 'scissor_depth_clear_stencil_clear', 5, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor_stencil_write_stencil_clear', 'scissor_stencil_write_stencil_clear', 4, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('depth_write_depth_clear_stencil_write', 'depth_write_depth_clear_stencil_write', 7, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('depth_write_depth_clear_stencil_clear', 'depth_write_depth_clear_stencil_clear', 7, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('depth_write_stencil_write_stencil_clear', 'depth_write_stencil_write_stencil_clear', 7, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('depth_clear_stencil_write_stencil_clear', 'depth_clear_stencil_write_stencil_clear', 7, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR));
+
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor_depth_write_depth_clear_stencil_write', 'scissor_depth_write_depth_clear_stencil_write', 4, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor_depth_write_depth_clear_stencil_clear', 'scissor_depth_write_depth_clear_stencil_clear', 4, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor_depth_write_stencil_write_stencil_clear', 'scissor_depth_write_stencil_write_stencil_clear', 5, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('scissor_depth_clear_stencil_write_stencil_clear', 'scissor_depth_clear_stencil_write_stencil_clear', 4, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('depth_write_depth_clear_stencil_write_stencil_clear', 'depth_write_depth_clear_stencil_write_stencil_clear', 7, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED, OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR));
+
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('all_occluders', 'all_occluders', 7, 10, 1.6, 3, 5, 0.6, gl.ANY_SAMPLES_PASSED, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR));
+
+ // Conservative occlusion query cases
+
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor', 'conservative_scissor', 1, 10, 1.6, 1, 1, 0.3, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_depth_write', 'conservative_depth_write', 8, 10, 1.6, 1, 7, 0.3, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_WRITE));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_depth_clear', 'conservative_depth_clear', 5, 10, 1.6, 1, 5, 0.2, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_stencil_write', 'conservative_stencil_write', 8, 10, 2.0, 1, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_STENCIL_WRITE));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_stencil_clear', 'conservative_stencil_clear', 5, 10, 2.0, 1, 3, 0.3, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_STENCIL_CLEAR));
+
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor_depth_write', 'conservative_scissor_depth_write', 5, 10, 1.6, 2, 5, 0.3, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor_depth_clear', 'conservative_scissor_depth_clear', 7, 10, 1.6, 2, 5, 1.0, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor_stencil_write', 'conservative_scissor_stencil_write', 4, 10, 1.6, 2, 5, 0.3, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_STENCIL_WRITE));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor_stencil_clear', 'conservative_scissor_stencil_clear', 4, 10, 1.6, 2, 5, 1.0, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_STENCIL_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_depth_write_depth_clear', 'conservative_depth_write_depth_clear', 7, 10, 1.6, 1, 5, 0.2, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_depth_write_stencil_write', 'conservative_depth_write_stencil_write', 8, 10, 1.6, 1, 5, 0.3, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_WRITE));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_depth_write_stencil_clear', 'conservative_depth_write_stencil_clear', 8, 10, 1.6, 1, 5, 0.3, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_depth_clear_stencil_write', 'conservative_depth_clear_stencil_write', 8, 10, 1.6, 1, 5, 0.3, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_depth_clear_stencil_clear', 'conservative_depth_clear_stencil_clear', 12, 10, 1.6, 1, 5, 0.2, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_stencil_write_stencil_clear', 'conservative_stencil_write_stencil_clear', 5, 10, 2.0, 1, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR));
+
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor_depth_write_depth_clear', 'conservative_scissor_depth_write_depth_clear', 5, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor_depth_write_stencil_write', 'conservative_scissor_depth_write_stencil_write', 4, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_WRITE));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor_depth_write_stencil_clear', 'conservative_scissor_depth_write_stencil_clear', 6, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor_depth_clear_stencil_write', 'conservative_scissor_depth_clear_stencil_write', 4, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor_depth_clear_stencil_clear', 'conservative_scissor_depth_clear_stencil_clear', 5, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor_stencil_write_stencil_clear', 'conservative_scissor_stencil_write_stencil_clear', 4, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_depth_write_depth_clear_stencil_write', 'conservative_depth_write_depth_clear_stencil_write', 7, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_depth_write_depth_clear_stencil_clear', 'conservative_depth_write_depth_clear_stencil_clear', 7, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_depth_write_stencil_write_stencil_clear', 'conservative_depth_write_stencil_write_stencil_clear', 7, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_depth_clear_stencil_write_stencil_clear', 'conservative_depth_clear_stencil_write_stencil_clear', 7, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR));
+
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor_depth_write_depth_clear_stencil_write', 'conservative_scissor_depth_write_depth_clear_stencil_write', 4, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor_depth_write_depth_clear_stencil_clear', 'conservative_scissor_depth_write_depth_clear_stencil_clear', 4, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor_depth_write_stencil_write_stencil_clear', 'conservative_scissor_depth_write_stencil_write_stencil_clear', 5, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_scissor_depth_clear_stencil_write_stencil_clear', 'conservative_scissor_depth_clear_stencil_write_stencil_clear', 4, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR));
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_depth_write_depth_clear_stencil_write_stencil_clear', 'conservative_depth_write_depth_clear_stencil_write_stencil_clear', 7, 10, 1.6, 2, 5, 0.4, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR));
+
+ this.addChild(new es3fOcclusionQueryTests.OcclusionQueryCase('conservative_all_occluders', 'conservative_all_occluders', 7, 10, 1.6, 3, 5, 0.6, gl.ANY_SAMPLES_PASSED_CONSERVATIVE, OCCLUDER_SCISSOR | OCCLUDER_DEPTH_WRITE | OCCLUDER_DEPTH_CLEAR | OCCLUDER_STENCIL_WRITE | OCCLUDER_STENCIL_CLEAR));
+
+};
+
+/**
+* Run test
+* @param {WebGL2RenderingContext} context
+*/
+es3fOcclusionQueryTests.run = function(context, range) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fOcclusionQueryTests.OcclusionQueryTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ if (range)
+ state.setRange(range);
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fOcclusionQueryTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fPixelBufferObjectTest.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fPixelBufferObjectTest.js
new file mode 100644
index 0000000000..ac577193aa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fPixelBufferObjectTest.js
@@ -0,0 +1,585 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+'use strict';
+goog.provide('functional.gles3.es3fPixelBufferObjectTest');
+goog.require('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('framework.opengl.gluTextureUtil');
+
+goog.scope(function() {
+
+var es3fPixelBufferObjectTest = functional.gles3.es3fPixelBufferObjectTest;
+var gluShaderProgram = framework.opengl.gluShaderProgram;
+var tcuTestCase = framework.common.tcuTestCase;
+var deRandom = framework.delibs.debase.deRandom;
+var deString = framework.delibs.debase.deString;
+var tcuTextureUtil = framework.common.tcuTextureUtil;
+var tcuTexture = framework.common.tcuTexture;
+var gluTextureUtil = framework.opengl.gluTextureUtil;
+var tcuImageCompare = framework.common.tcuImageCompare;
+
+ var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+ };
+
+ es3fPixelBufferObjectTest.DE_STATIC_ASSERT = function(expression) {
+ if (!expression) throw new Error('Assert failed');
+ };
+
+ /** @enum */
+ es3fPixelBufferObjectTest.FramebufferType = {
+ FRAMEBUFFERTYPE_NATIVE: 0,
+ FRAMEBUFFERTYPE_RENDERBUFFER: 1
+ };
+
+ /**
+ * @constructor
+ * @struct
+ */
+ es3fPixelBufferObjectTest.TestSpec = function() { // This is originaly a struct
+ this.name = '';
+ this.description = '';
+ this.useColorClear = false;
+ this.renderTriangles = false;
+ /** @type {es3fPixelBufferObjectTest.FramebufferType} */ this.framebufferType;
+ /** @type {number} */ this.renderbufferFormat;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {es3fPixelBufferObjectTest.TestSpec} spec
+ */
+ es3fPixelBufferObjectTest.ReadPixelsTest = function(spec) {
+ tcuTestCase.DeqpTest.call(this, spec.name, spec.description);
+ this.m_random = new deRandom.Random(deString.deStringHash(spec.name));
+ this.m_program = null;
+ this.m_framebuffeType = spec.framebufferType;
+ this.m_renderbufferFormat = spec.renderbufferFormat;
+ this.m_texChannelClass = undefined;
+ this.m_useColorClears = spec.useColorClear;
+ this.m_renderTriangles = spec.renderTriangles;
+ this.m_colorScale = 1.0;
+
+ if (this.m_framebuffeType === es3fPixelBufferObjectTest.FramebufferType.FRAMEBUFFERTYPE_NATIVE) {
+ this.m_colorScale = 1.0;
+ } else if (this.m_framebuffeType === es3fPixelBufferObjectTest.FramebufferType.FRAMEBUFFERTYPE_RENDERBUFFER) {
+ this.m_texChannelClass = tcuTexture.getTextureChannelClass(gluTextureUtil.mapGLInternalFormat(spec.renderbufferFormat).type);
+ switch (this.m_texChannelClass) {
+ case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT:
+ this.m_colorScale = 1.0;
+ break;
+ case tcuTexture.TextureChannelClass.SIGNED_INTEGER:
+ this.m_colorScale = 100.0;
+ break;
+ case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER:
+ this.m_colorScale = 100.0;
+ break;
+ case tcuTexture.TextureChannelClass.FLOATING_POINT:
+ this.m_colorScale = 100.0;
+ break;
+ default:
+ DE_ASSERT(false);
+ }
+ } else {
+ DE_ASSERT(false);
+ }
+ };
+
+ es3fPixelBufferObjectTest.ReadPixelsTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fPixelBufferObjectTest.ReadPixelsTest.prototype.constructor = es3fPixelBufferObjectTest.ReadPixelsTest;
+
+ es3fPixelBufferObjectTest.ReadPixelsTest.prototype.init = function() {
+ var outtype = '';
+
+ if (this.m_framebuffeType === es3fPixelBufferObjectTest.FramebufferType.FRAMEBUFFERTYPE_NATIVE)
+ outtype = 'vec4';
+ else if (this.m_framebuffeType === es3fPixelBufferObjectTest.FramebufferType.FRAMEBUFFERTYPE_RENDERBUFFER) {
+ switch (this.m_texChannelClass) {
+ case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT:
+ outtype = 'vec4';
+ break;
+ case tcuTexture.TextureChannelClass.SIGNED_INTEGER:
+ outtype = 'ivec4';
+ break;
+ case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER:
+ outtype = 'uvec4';
+ break;
+ case tcuTexture.TextureChannelClass.FLOATING_POINT:
+ outtype = 'vec4';
+ break;
+ default:
+ DE_ASSERT(false);
+ }
+ } else
+ DE_ASSERT(false);
+
+ /** @type {string} */ var vertexShaderSource =
+ '#version 300 es\n' +
+ 'in mediump vec3 a_position;\n' +
+ 'in mediump vec4 a_color;\n' +
+ 'uniform mediump float u_colorScale;\n' +
+ 'out mediump vec4 v_color;\n' +
+ 'void main(void)\n' +
+ ' {\n' +
+ '\tgl_Position = vec4(a_position, 1.0);\n' +
+ '\tv_color = u_colorScale * a_color;\n' +
+ '}';
+
+ /** @type {string} */ var fragmentShaderSource =
+ '#version 300 es\n' +
+ 'in mediump vec4 v_color;\n' +
+ 'layout (location = 0) out mediump ' +
+ outtype +
+ ' o_color;\n' +
+ 'void main(void)\n' +
+ ' {\n' +
+ '\to_color = ' +
+ outtype +
+ '(v_color);\n' +
+ '}';
+
+ this.m_program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexShaderSource, fragmentShaderSource));
+
+ if (!this.m_program.isOk())
+ throw new Error('Compile failed. Program not created');
+
+ };
+
+ /**
+ * @param {Array<number>} a
+ * @param {Array<number>} b
+ * @param {Array<number>} c
+ */
+ es3fPixelBufferObjectTest.ReadPixelsTest.prototype.renderTriangle = function(a, b, c) {
+
+ var positions = new Float32Array(36);
+
+ positions[0] = a[0];
+ positions[1] = a[1];
+ positions[2] = a[2];
+
+ positions[3] = b[0];
+ positions[4] = b[1];
+ positions[5] = b[2];
+
+ positions[6] = c[0];
+ positions[7] = c[1];
+ positions[8] = c[2];
+
+ var colors = new Float32Array([
+ 1.0, 0.0, 0.0, 1.0,
+ 0.0, 1.0, 0.0, 1.0,
+ 0.0, 0.0, 1.0, 1.0]);
+
+ gl.useProgram(this.m_program.getProgram());
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'useProgram failed ', false, true);
+
+ /** @type {WebGLUniformLocation} */ var colorScaleLoc = gl.getUniformLocation(this.m_program.getProgram(), 'u_colorScale');
+ assertMsgOptions(colorScaleLoc != -1, 'Could not find u_colorScale ', false, true);
+
+ gl.uniform1f(colorScaleLoc, this.m_colorScale);
+
+ /** @type {number} */ var coordLoc = gl.getAttribLocation(this.m_program.getProgram(), 'a_position');
+ assertMsgOptions(coordLoc != -1, 'Could not find a_position ', false, true);
+
+ /** @type {number} */ var colorLoc = gl.getAttribLocation(this.m_program.getProgram(), 'a_color');
+ assertMsgOptions(colorLoc != -1, 'Could not find a_color ', false, true);
+
+ gl.enableVertexAttribArray(colorLoc);
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'enableVertexAttribArray failed ', false, true);
+ gl.enableVertexAttribArray(coordLoc);
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'enableVertexAttribArray failed ', false, true);
+
+ var pos = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, pos);
+ gl.bufferData(gl.ARRAY_BUFFER, positions, gl.STATIC_DRAW);
+ gl.vertexAttribPointer(coordLoc, 3, gl.FLOAT, false, 0, 0);
+
+ var c = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, c);
+ gl.bufferData(gl.ARRAY_BUFFER, colors, gl.STATIC_DRAW);
+ gl.vertexAttribPointer(colorLoc, 4, gl.FLOAT, false, 0, 0);
+
+ gl.drawArrays(gl.TRIANGLES, 0, 3);
+
+ gl.disableVertexAttribArray(colorLoc);
+ gl.disableVertexAttribArray(coordLoc);
+ };
+
+ /**
+ * @param {number} r
+ * @param {number} g
+ * @param {number} b
+ * @param {number} a
+ */
+
+ es3fPixelBufferObjectTest.ReadPixelsTest.prototype.clearColor = function(r, g, b, a) {
+ if (this.m_framebuffeType == es3fPixelBufferObjectTest.FramebufferType.FRAMEBUFFERTYPE_NATIVE) {
+ gl.clearColor(r, g, b, a);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ } else if (this.m_framebuffeType == es3fPixelBufferObjectTest.FramebufferType.FRAMEBUFFERTYPE_RENDERBUFFER) {
+ switch (this.m_texChannelClass) {
+ case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT:
+ gl.clearColor(r, g, b, a);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ break;
+ case tcuTexture.TextureChannelClass.SIGNED_INTEGER:
+ gl.clearBufferiv(gl.COLOR, 0, new Int32Array([r, g, b, a]));
+ break;
+ case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER:
+ gl.clearBufferuiv(gl.COLOR, 0, new Uint32Array([r, g, b, a]));
+ break;
+ case tcuTexture.TextureChannelClass.FLOATING_POINT:
+ gl.clearBufferfv(gl.COLOR, 0, new Float32Array([r, g, b, a]));
+ break;
+ default:
+ DE_ASSERT(false);
+ }
+ } else
+ DE_ASSERT(false);
+
+ };
+
+ es3fPixelBufferObjectTest.ReadPixelsTest.prototype.iterate = function() {
+ var width = gl.drawingBufferWidth;
+ var height = gl.drawingBufferHeight;
+
+ var framebuffer = null;
+ var renderbuffer = null;
+
+ switch (this.m_framebuffeType) {
+ case es3fPixelBufferObjectTest.FramebufferType.FRAMEBUFFERTYPE_NATIVE:
+ gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
+ break;
+ case es3fPixelBufferObjectTest.FramebufferType.FRAMEBUFFERTYPE_RENDERBUFFER:
+ framebuffer = gl.createFramebuffer();
+ renderbuffer = gl.createRenderbuffer();
+
+ gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);
+ gl.renderbufferStorage(gl.RENDERBUFFER, this.m_renderbufferFormat, width, height);
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, renderbuffer);
+ break;
+ }
+
+ this.clearColor(this.m_colorScale * 0.4, this.m_colorScale * 1.0, this.m_colorScale * 0.5, this.m_colorScale * 1.0);
+
+ if (this.m_useColorClears) {
+ /** @type {number} */ var maxClearCount = 10;
+ /** @type {number} */ var minClearCount = 6;
+ /** @type {number} */ var minClearSize = 15;
+
+ /** @type {number} */ var clearCount = this.m_random.getInt(minClearCount, maxClearCount);
+
+ for (var clearNdx = 0; clearNdx < clearCount; clearNdx++) {
+ /** @type {number} */ var clearX = this.m_random.getInt(0, width - minClearSize);
+ /** @type {number} */ var clearY = this.m_random.getInt(0, height - minClearSize);
+
+ /** @type {number} */ var clearWidth = this.m_random.getInt(minClearSize, width - clearX);
+ /** @type {number} */ var clearHeight = this.m_random.getInt(minClearSize, height - clearY);
+
+ /** @type {number} */ var clearRed = this.m_colorScale * this.m_random.getFloat();
+ /** @type {number} */ var clearGreen = this.m_colorScale * this.m_random.getFloat();
+ /** @type {number} */ var clearBlue = this.m_colorScale * this.m_random.getFloat();
+ /** @type {number} */ var clearAlpha = this.m_colorScale * (0.5 + 0.5 * this.m_random.getFloat());
+
+ gl.enable(gl.SCISSOR_TEST);
+ gl.scissor(clearX, clearY, clearWidth, clearHeight);
+
+ this.clearColor(clearRed, clearGreen, clearBlue, clearAlpha);
+ }
+
+ gl.disable(gl.SCISSOR_TEST);
+
+ }
+
+ if (this.m_renderTriangles) {
+ /** @type {number} */ var minTriangleCount = 4;
+ /** @type {number} */ var maxTriangleCount = 10;
+
+ /** @type {number} */ var triangleCount = this.m_random.getInt(minTriangleCount, maxTriangleCount);
+
+ for (var triangleNdx = 0; triangleNdx < triangleCount; triangleNdx++) {
+ /** @type {number} */ var x1 = 2.0 * this.m_random.getFloat() - 1.0;
+ /** @type {number} */ var y1 = 2.0 * this.m_random.getFloat() - 1.0;
+ /** @type {number} */ var z1 = 2.0 * this.m_random.getFloat() - 1.0;
+
+ /** @type {number} */ var x2 = 2.0 * this.m_random.getFloat() - 1.0;
+ /** @type {number} */ var y2 = 2.0 * this.m_random.getFloat() - 1.0;
+ /** @type {number} */ var z2 = 2.0 * this.m_random.getFloat() - 1.0;
+
+ /** @type {number} */ var x3 = 2.0 * this.m_random.getFloat() - 1.0;
+ /** @type {number} */ var y3 = 2.0 * this.m_random.getFloat() - 1.0;
+ /** @type {number} */ var z3 = 2.0 * this.m_random.getFloat() - 1.0;
+
+ this.renderTriangle([x1, y1, z1], [x2, y2, z2], [x3, y3, z3]);
+ }
+ }
+
+ /** @type {tcuTexture.TextureFormat} */ var readFormat;
+ /** @type {number} */ var readPixelsFormat;
+ /** @type {number} */ var readPixelsType;
+ /** @type {boolean} */ var floatCompare;
+
+ if (this.m_framebuffeType == es3fPixelBufferObjectTest.FramebufferType.FRAMEBUFFERTYPE_NATIVE) {
+ readFormat = gluTextureUtil.mapGLTransferFormat(gl.RGBA, gl.UNSIGNED_BYTE);
+ readPixelsFormat = gl.RGBA;
+ readPixelsType = gl.UNSIGNED_BYTE;
+ floatCompare = false;
+ } else if (this.m_framebuffeType == es3fPixelBufferObjectTest.FramebufferType.FRAMEBUFFERTYPE_RENDERBUFFER) {
+ switch (this.m_texChannelClass) {
+ case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT:
+ readFormat = gluTextureUtil.mapGLTransferFormat(gl.RGBA, gl.UNSIGNED_BYTE);
+ readPixelsFormat = gl.RGBA;
+ readPixelsType = gl.UNSIGNED_BYTE;
+ floatCompare = true;
+ break;
+ case tcuTexture.TextureChannelClass.SIGNED_INTEGER:
+ readFormat = gluTextureUtil.mapGLTransferFormat(gl.RGBA_INTEGER, gl.INT);
+ readPixelsFormat = gl.RGBA_INTEGER;
+ readPixelsType = gl.INT;
+ floatCompare = false;
+ break;
+ case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER:
+ readFormat = gluTextureUtil.mapGLTransferFormat(gl.RGBA_INTEGER, gl.UNSIGNED_INT);
+ readPixelsFormat = gl.RGBA_INTEGER;
+ readPixelsType = gl.UNSIGNED_INT;
+ floatCompare = false;
+ break;
+ case tcuTexture.TextureChannelClass.FLOATING_POINT:
+ readFormat = gluTextureUtil.mapGLTransferFormat(gl.RGBA, gl.FLOAT);
+ readPixelsFormat = gl.RGBA;
+ readPixelsType = gl.FLOAT;
+ floatCompare = true;
+ break;
+ default:
+ DE_ASSERT(false);
+ // Silence warning
+ readFormat = gluTextureUtil.mapGLTransferFormat(gl.RGBA, gl.FLOAT);
+ readPixelsFormat = gl.RGBA;
+ readPixelsType = gl.FLOAT;
+ floatCompare = true;
+ }
+ } else {
+ // Silence warnings
+ readFormat = gluTextureUtil.mapGLTransferFormat(gl.RGBA, gl.FLOAT);
+ readPixelsFormat = gl.RGBA;
+ readPixelsType = gl.FLOAT;
+ floatCompare = true;
+ DE_ASSERT(false);
+ }
+
+ var readReference = new tcuTexture.Texture2D(readFormat, width, height);
+ readReference.allocLevel(0);
+
+ var pixelBuffer = gl.createBuffer();
+
+ gl.bindBuffer(gl.PIXEL_PACK_BUFFER, pixelBuffer);
+ gl.bufferData(gl.PIXEL_PACK_BUFFER, readReference.getLevel(0).getDataSize(), gl.STREAM_READ);
+ gl.readPixels(0, 0, width, height, readPixelsFormat, readPixelsType, 0);
+
+ var bufferData = new Uint8Array(readReference.getLevel(0).getDataSize());
+
+ gl.getBufferSubData(gl.PIXEL_PACK_BUFFER, 0, bufferData);
+
+ var readResult = new tcuTexture.ConstPixelBufferAccess({
+ width: width,
+ height: height,
+ format: readFormat,
+ data: bufferData.buffer});
+
+ gl.bindBuffer(gl.PIXEL_PACK_BUFFER, null);
+
+ gl.readPixels(0, 0, width, height, readPixelsFormat, readPixelsType, readReference.getLevel(0).getDataPtr());
+
+ if (framebuffer)
+ gl.deleteFramebuffer(framebuffer);
+
+ if (renderbuffer)
+ gl.deleteRenderbuffer(renderbuffer);
+
+ var isOk = false;
+
+ if (floatCompare) {
+ // When converting between integers and floats, certain GPUs might have different behaviors
+ // from javascript in rounding (up vs down). Increase tolerance to allow both behaviors.
+ // Detailed discussion in Mesa upstream can be found at:
+ // https://bugs.freedesktop.org/show_bug.cgi?id=89314.
+ var threshold;
+ switch (this.m_renderbufferFormat) {
+ case gl.RGB10_A2:
+ case gl.RGB5_A1:
+ case gl.RGB565:
+ threshold = [0.004, 0.004, 0.004, 0.0];
+ break;
+ default:
+ threshold = [0.0, 0.0, 0.0, 0.0];
+ break;
+ }
+ isOk = tcuImageCompare.floatThresholdCompare('Result comparison', 'Result of read pixels to memory compared with result of read pixels to buffer', readReference.getLevel(0), readResult, threshold);
+ }
+ else
+ isOk = tcuImageCompare.intThresholdCompare('Result comparison', 'Result of read pixels to memory compared with result of read pixels to buffer', readReference.getLevel(0), readResult, [0, 0, 0, 0]);
+
+ gl.deleteBuffer(pixelBuffer);
+
+ assertMsgOptions(isOk, this.getDescription(), true, true);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ es3fPixelBufferObjectTest.init = function() {
+ var state = tcuTestCase.runner;
+ /** @type {tcuTestCase.DeqpTest} */ var testGroup = state.testCases;
+
+ /** @type {tcuTestCase.DeqpTest} */ var nativeFramebufferGroup = tcuTestCase.newTest('native', 'Tests with reading from native framebuffer');
+
+ var nativeFramebufferTests = [{
+ name: 'clears',
+ description: 'Simple read pixels test with color clears',
+ useColorClear: true,
+ renderTriangles: false,
+ framebufferType: es3fPixelBufferObjectTest.FramebufferType.FRAMEBUFFERTYPE_NATIVE,
+ renderbufferFormat: gl.NONE
+ }, {
+ name: 'triangles',
+ description: 'Simple read pixels test rendering triangles',
+ useColorClear: false,
+ renderTriangles: true,
+ framebufferType: es3fPixelBufferObjectTest.FramebufferType.FRAMEBUFFERTYPE_NATIVE,
+ renderbufferFormat: gl.NONE
+ }
+ ];
+
+ for (var testNdx = 0; testNdx < nativeFramebufferTests.length; testNdx++)
+ nativeFramebufferGroup.addChild(new es3fPixelBufferObjectTest.ReadPixelsTest(nativeFramebufferTests[testNdx]));
+
+ testGroup.addChild(nativeFramebufferGroup);
+
+ /** @type {tcuTestCase.DeqpTest} */ var renderbufferGroup = tcuTestCase.newTest('renderbuffer', 'Tests with reading from renderbuffer');
+
+ var renderbufferFormats = [
+ gl.RGBA8,
+ gl.RGBA8I,
+ gl.RGBA8UI,
+ gl.RGBA16I,
+ gl.RGBA16UI,
+ gl.RGBA32I,
+ gl.RGBA32UI,
+
+ gl.SRGB8_ALPHA8,
+ gl.RGB10_A2,
+ gl.RGB10_A2UI,
+ gl.RGBA4,
+ gl.RGB5_A1,
+
+ gl.RGB8,
+ gl.RGB565,
+
+ gl.RG8,
+ gl.RG8I,
+ gl.RG8UI,
+ gl.RG16I,
+ gl.RG16UI,
+ gl.RG32I,
+ gl.RG32UI
+ ];
+
+ var renderbufferFormatsStr = [
+ 'rgba8',
+ 'rgba8i',
+ 'rgba8ui',
+ 'rgba16i',
+ 'rgba16ui',
+ 'rgba32i',
+ 'rgba32ui',
+
+ 'srgb8_alpha8',
+ 'rgb10_a2',
+ 'rgb10_a2ui',
+ 'rgba4',
+ 'rgb5_a1',
+
+ 'rgb8',
+ 'rgb565',
+
+ 'rg8',
+ 'rg8i',
+ 'rg8ui',
+ 'rg16i',
+ 'rg16ui',
+ 'rg32i',
+ 'rg32ui'
+ ];
+ es3fPixelBufferObjectTest.DE_STATIC_ASSERT(renderbufferFormatsStr.length == renderbufferFormats.length);
+
+ for (var formatNdx = 0; formatNdx < renderbufferFormats.length; formatNdx++) {
+ for (var trianglesClears = 0; trianglesClears < 2; trianglesClears++) {
+ var nameDescription = renderbufferFormatsStr[formatNdx] + '_' + (trianglesClears == 0 ? 'triangles' : 'clears');
+ var testSpec = new es3fPixelBufferObjectTest.TestSpec();
+ testSpec.name = nameDescription;
+ testSpec.description = nameDescription;
+ testSpec.useColorClear = trianglesClears == 1;
+ testSpec.renderTriangles = trianglesClears == 0;
+ testSpec.framebufferType = es3fPixelBufferObjectTest.FramebufferType.FRAMEBUFFERTYPE_RENDERBUFFER;
+ testSpec.renderbufferFormat = renderbufferFormats[formatNdx];
+
+ renderbufferGroup.addChild(new es3fPixelBufferObjectTest.ReadPixelsTest(testSpec));
+ }
+ }
+
+ testGroup.addChild(renderbufferGroup);
+ };
+
+ es3fPixelBufferObjectTest.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var testName = 'pixel_buffer_object';
+ var testDescription = 'Pixel Buffer Object Tests';
+ var state = tcuTestCase.runner;
+
+ state.testName = testName;
+ state.testCases = tcuTestCase.newTest(testName, testDescription, null);
+
+ //Set up name and description of this test series.
+ setCurrentTestName(testName);
+ description(testDescription);
+
+ try {
+ //Create test cases
+ es3fPixelBufferObjectTest.init();
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ bufferedLogToConsole(err);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fPrimitiveRestartTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fPrimitiveRestartTests.js
new file mode 100644
index 0000000000..ac0da2fe66
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fPrimitiveRestartTests.js
@@ -0,0 +1,709 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fPrimitiveRestartTests');
+goog.require('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('framework.opengl.gluTextureUtil');
+
+goog.scope(function() {
+
+var es3fPrimitiveRestartTests = functional.gles3.es3fPrimitiveRestartTests;
+var tcuTestCase = framework.common.tcuTestCase;
+var gluShaderProgram = framework.opengl.gluShaderProgram;
+var tcuSurface = framework.common.tcuSurface;
+var deMath = framework.delibs.debase.deMath;
+var deRandom = framework.delibs.debase.deRandom;
+var deString = framework.delibs.debase.deString;
+var tcuImageCompare = framework.common.tcuImageCompare;
+var gluTextureUtil = framework.opengl.gluTextureUtil;
+
+ /** @type {WebGL2RenderingContext} */ var gl;
+ /** @const @type {number} */ es3fPrimitiveRestartTests.MAX_RENDER_WIDTH = 256;
+ /** @const @type {number} */ es3fPrimitiveRestartTests.MAX_RENDER_HEIGHT = 256;
+
+ /** @const @type {number} */ es3fPrimitiveRestartTests.MAX_UNSIGNED_BYTE = 255;
+ /** @const @type {number} */ es3fPrimitiveRestartTests.MAX_UNSIGNED_SHORT = 65535;
+ /** @const @type {number} */ es3fPrimitiveRestartTests.MAX_UNSIGNED_INT = 4294967295;
+
+ /** @const @type {number} */ es3fPrimitiveRestartTests.RESTART_INDEX_UNSIGNED_BYTE = es3fPrimitiveRestartTests.MAX_UNSIGNED_BYTE;
+ /** @const @type {number} */ es3fPrimitiveRestartTests.RESTART_INDEX_UNSIGNED_SHORT = es3fPrimitiveRestartTests.MAX_UNSIGNED_SHORT;
+ /** @const @type {number} */ es3fPrimitiveRestartTests.RESTART_INDEX_UNSIGNED_INT = es3fPrimitiveRestartTests.MAX_UNSIGNED_INT;
+
+ var DE_ASSERT = function(expression) {
+ if (!expression) throw new Error('Assert failed');
+ };
+
+ /**
+ * @enum
+ */
+ es3fPrimitiveRestartTests.PrimitiveType = {
+ PRIMITIVE_POINTS: 0,
+ PRIMITIVE_LINE_STRIP: 1,
+ PRIMITIVE_LINE_LOOP: 2,
+ PRIMITIVE_LINES: 3,
+ PRIMITIVE_TRIANGLE_STRIP: 4,
+ PRIMITIVE_TRIANGLE_FAN: 5,
+ PRIMITIVE_TRIANGLES: 6
+ };
+
+ /**
+ * @enum
+ */
+ es3fPrimitiveRestartTests.IndexType = {
+ INDEX_UNSIGNED_BYTE: 0,
+ INDEX_UNSIGNED_SHORT: 1,
+ INDEX_UNSIGNED_INT: 2
+ };
+
+ /**
+ * @enum
+ */
+ es3fPrimitiveRestartTests.DrawFunction = {
+ FUNCTION_DRAW_ELEMENTS: 0,
+ FUNCTION_DRAW_ELEMENTS_INSTANCED: 1,
+ FUNCTION_DRAW_RANGE_ELEMENTS: 2
+ };
+
+ /**
+ * es3fPrimitiveRestartTests.PrimitiveRestartCase class, inherits from TestCase class
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {?string} name
+ * @param {string} description
+ * @param {es3fPrimitiveRestartTests.PrimitiveType} primType
+ * @param {es3fPrimitiveRestartTests.IndexType} indexType
+ * @param {es3fPrimitiveRestartTests.DrawFunction} _function
+ * @param {boolean} beginWithRestart
+ * @param {boolean} endWithRestart
+ * @param {boolean} duplicateRestarts
+ */
+ es3fPrimitiveRestartTests.PrimitiveRestartCase = function(name, description, primType, indexType, _function, beginWithRestart, endWithRestart, duplicateRestarts) {
+ tcuTestCase.DeqpTest.call(this, name, description);
+ /** @type {es3fPrimitiveRestartTests.PrimitiveType} */ this.m_primType = primType;
+ /** @type {es3fPrimitiveRestartTests.IndexType} */ this.m_indexType = indexType;
+ /** @type {es3fPrimitiveRestartTests.DrawFunction} */ this.m_function = _function;
+ /** @type {boolean} */ this.m_beginWithRestart = beginWithRestart; // Whether there will be restart indices at the beginning of the index array.
+ /** @type {boolean} */ this.m_endWithRestart = endWithRestart; // Whether there will be restart indices at the end of the index array.
+ /** @type {boolean} */ this.m_duplicateRestarts = duplicateRestarts; // Whether two consecutive restarts are used instead of one.
+ /** @type {gluShaderProgram.ShaderProgram} */ this.m_program = null;
+
+ // \note Only one of the following index vectors is used (according to m_indexType).
+ /** @type {Array<number>} */ this.m_indicesUB = []; //deUint8
+ /** @type {Array<number>} */ this.m_indicesUS = []; //deUint16
+ /** @type {Array<number>} */ this.m_indicesUI = []; //deUint32
+
+ /** @type {Array<number>} */ this.m_positions = [];
+ };
+
+ es3fPrimitiveRestartTests.PrimitiveRestartCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fPrimitiveRestartTests.PrimitiveRestartCase.prototype.constructor = es3fPrimitiveRestartTests.PrimitiveRestartCase;
+
+ /**
+ * Draw with the appropriate GLES3 draw function.
+ * @param {number} startNdx
+ * @param {number} count
+ */
+ es3fPrimitiveRestartTests.PrimitiveRestartCase.prototype.draw = function(startNdx, count) {
+ /** @type {number} */ var primTypeGL;
+
+ switch (this.m_primType) {
+ case es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_POINTS:
+ primTypeGL = gl.POINTS;
+ break;
+ case es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_LINE_STRIP:
+ primTypeGL = gl.LINE_STRIP;
+ break;
+ case es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_LINE_LOOP:
+ primTypeGL = gl.LINE_LOOP;
+ break;
+ case es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_LINES:
+ primTypeGL = gl.LINES;
+ break;
+ case es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_TRIANGLE_STRIP:
+ primTypeGL = gl.TRIANGLE_STRIP;
+ break;
+ case es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_TRIANGLE_FAN:
+ primTypeGL = gl.TRIANGLE_FAN;
+ break;
+ case es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_TRIANGLES:
+ primTypeGL = gl.TRIANGLES;
+ break;
+ default:
+ DE_ASSERT(false);
+ primTypeGL = 0;
+ }
+
+ /** @type {number} */ var indexTypeGL;
+
+ switch (this.m_indexType) {
+ case es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_BYTE:
+ indexTypeGL = gl.UNSIGNED_BYTE;
+ break;
+ case es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_SHORT:
+ indexTypeGL = gl.UNSIGNED_SHORT;
+ break;
+ case es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_INT:
+ indexTypeGL = gl.UNSIGNED_INT;
+ break;
+ default:
+ DE_ASSERT(false);
+ indexTypeGL = 0;
+ }
+
+ /** @type {number} */ var restartIndex = this.m_indexType == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_BYTE ? es3fPrimitiveRestartTests.RESTART_INDEX_UNSIGNED_BYTE :
+ this.m_indexType == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_SHORT ? es3fPrimitiveRestartTests.RESTART_INDEX_UNSIGNED_SHORT :
+ this.m_indexType == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_INT ? es3fPrimitiveRestartTests.RESTART_INDEX_UNSIGNED_INT :
+ 0;
+
+ DE_ASSERT(restartIndex != 0);
+
+ var indexGLBuffer = gl.createBuffer();
+ var bufferIndex = this.getIndexPtr(startNdx);
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexGLBuffer);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, bufferIndex, gl.STATIC_DRAW);
+
+ if (this.m_function == es3fPrimitiveRestartTests.DrawFunction.FUNCTION_DRAW_ELEMENTS) {
+ gl.drawElements(primTypeGL, count, indexTypeGL, 0);
+ } else if (this.m_function == es3fPrimitiveRestartTests.DrawFunction.FUNCTION_DRAW_ELEMENTS_INSTANCED) {
+ gl.drawElementsInstanced(primTypeGL, count, indexTypeGL, 0, 1);
+ } else {
+ DE_ASSERT(this.m_function == es3fPrimitiveRestartTests.DrawFunction.FUNCTION_DRAW_RANGE_ELEMENTS);
+
+ // Find the largest non-restart index in the index array (for glDrawRangeElements() end parameter).
+
+ /** @type {number} */ var max = 0;
+
+ /** @type {number} */ var numIndices = this.getNumIndices();
+ for (var i = 0; i < numIndices; i++) {
+ /** @type {number} */ var index = this.getIndex(i);
+ if (index != restartIndex && index > max)
+ max = index;
+ }
+ //TODO: drawRangeElements -> check getIndexPtr usage
+ gl.drawRangeElements(primTypeGL, 0, max, count, indexTypeGL, 0);
+ }
+ };
+
+ es3fPrimitiveRestartTests.PrimitiveRestartCase.prototype.renderWithRestart = function() {
+ // Primitive Restart is always on in WebGL2
+ //gl.enable(gl.PRIMITIVE_RESTART_FIXED_INDEX);
+
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+
+ this.draw(0, this.getNumIndices());
+ };
+
+ es3fPrimitiveRestartTests.PrimitiveRestartCase.prototype.renderWithoutRestart = function() {
+ /** @type {number} */ var restartIndex = this.m_indexType == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_BYTE ? es3fPrimitiveRestartTests.RESTART_INDEX_UNSIGNED_BYTE :
+ this.m_indexType == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_SHORT ? es3fPrimitiveRestartTests.RESTART_INDEX_UNSIGNED_SHORT :
+ this.m_indexType == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_INT ? es3fPrimitiveRestartTests.RESTART_INDEX_UNSIGNED_INT :
+ 0;
+
+ DE_ASSERT(restartIndex != 0);
+ // Primitive Restart is always on in WebGL2
+ //gl.disable(gl.PRIMITIVE_RESTART_FIXED_INDEX);
+
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+
+ // Draw, emulating primitive restart.
+
+ /** @type {number} */ var numIndices = this.getNumIndices();
+
+ DE_ASSERT(numIndices >= 0);
+
+ /** @type {number} */ var indexArrayStartNdx = 0; // Keep track of the draw start index - first index after a primitive restart, or initially the first index altogether.
+
+ for (var indexArrayNdx = 0; indexArrayNdx <= numIndices; indexArrayNdx++) { // \note Goes one "too far" in order to detect end of array as well.
+ if (indexArrayNdx >= numIndices || this.getIndex(indexArrayNdx) == restartIndex) {// \note Handle end of array the same way as a restart index encounter.
+ if (indexArrayStartNdx < numIndices) {
+ // Draw from index indexArrayStartNdx to index indexArrayNdx-1 .
+
+ this.draw(indexArrayStartNdx, indexArrayNdx - indexArrayStartNdx);
+ }
+
+ indexArrayStartNdx = indexArrayNdx + 1; // Next draw starts just after this restart index.
+ }
+ }
+ };
+
+ /**
+ * @param {number} index
+ */
+ es3fPrimitiveRestartTests.PrimitiveRestartCase.prototype.addIndex = function(index) {
+ if (this.m_indexType == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_BYTE) {
+ DE_ASSERT(deMath.deInRange32(index, 0, es3fPrimitiveRestartTests.MAX_UNSIGNED_BYTE));
+ this.m_indicesUB.push(index); // deUint8
+ } else if (this.m_indexType == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_SHORT) {
+ DE_ASSERT(deMath.deInRange32(index, 0, es3fPrimitiveRestartTests.MAX_UNSIGNED_SHORT));
+ this.m_indicesUS.push(index); // deUint16
+ } else if (this.m_indexType == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_INT) {
+ DE_ASSERT(deMath.deInRange32(index, 0, es3fPrimitiveRestartTests.MAX_UNSIGNED_INT));
+ this.m_indicesUI.push(index); // // deUint32
+ } else
+ DE_ASSERT(false);
+ };
+
+ /**
+ * @param {number} indexNdx
+ * @return {number}
+ */
+ es3fPrimitiveRestartTests.PrimitiveRestartCase.prototype.getIndex = function(indexNdx) {
+ switch (this.m_indexType) {
+ case es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_BYTE:
+ return this.m_indicesUB[indexNdx]; //deUint32
+ case es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_SHORT:
+ return this.m_indicesUS[indexNdx]; //deUint32
+ case es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_INT:
+ return this.m_indicesUI[indexNdx];
+ default:
+ DE_ASSERT(false);
+ return 0;
+ }
+ };
+
+ /**
+ * @return {number}
+ */
+ es3fPrimitiveRestartTests.PrimitiveRestartCase.prototype.getNumIndices = function() {
+ switch (this.m_indexType) {
+ case es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_BYTE:
+ return this.m_indicesUB.length;
+ case es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_SHORT:
+ return this.m_indicesUS.length;
+ case es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_INT:
+ return this.m_indicesUI.length;
+ default:
+ DE_ASSERT(false);
+ return 0;
+ }
+ };
+
+ /**
+ * Pointer to the index value at index indexNdx.
+ * @param {number} indexNdx
+ * @return {Uint8Array|Uint16Array|Uint32Array}
+ */
+ es3fPrimitiveRestartTests.PrimitiveRestartCase.prototype.getIndexPtr = function(indexNdx) {
+ //TODO: implement
+ switch (this.m_indexType) {
+ case es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_BYTE:
+ return new Uint8Array(this.m_indicesUB).subarray(indexNdx);
+ case es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_SHORT:
+ return new Uint16Array(this.m_indicesUS).subarray(indexNdx);
+ case es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_INT:
+ return new Uint32Array(this.m_indicesUI).subarray(indexNdx);
+ default:
+ DE_ASSERT(false);
+ return null;
+ }
+ };
+
+ es3fPrimitiveRestartTests.PrimitiveRestartCase.prototype.init = function() {
+ // Clear errors from previous tests
+ gl.getError();
+
+ // Create shader program.
+
+ /** @type {string} */ var vertShaderSource =
+ '#version 300 es\n' +
+ 'in highp vec4 a_position;\n' +
+ '\n' +
+ 'void main()\n' +
+ ' {\n' +
+ ' gl_Position = a_position;\n';
+
+ if (this.m_primType == es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_POINTS) {
+ vertShaderSource += ' gl_PointSize = 1.0;\n';
+ }
+
+ vertShaderSource += '}\n';
+
+ /** @type {string} */ var fragShaderSource =
+ '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 o_color;\n' +
+ '\n' +
+ 'void main()\n' +
+ ' {\n' +
+ ' o_color = vec4(1.0f);\n' +
+ '}\n';
+
+ DE_ASSERT(!this.m_program);
+
+ this.m_program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertShaderSource, fragShaderSource));
+
+ if (!this.m_program.isOk()) {
+ //m_testCtx.getLog() << *this.m_program;
+ testFailedOptions('Failed to compile shader', true);
+ }
+
+ /** @type {number} */ var restartIndex = this.m_indexType == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_BYTE ? es3fPrimitiveRestartTests.RESTART_INDEX_UNSIGNED_BYTE :
+ this.m_indexType == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_SHORT ? es3fPrimitiveRestartTests.RESTART_INDEX_UNSIGNED_SHORT :
+ this.m_indexType == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_INT ? es3fPrimitiveRestartTests.RESTART_INDEX_UNSIGNED_INT :
+ 0;
+
+ DE_ASSERT(restartIndex != 0);
+
+ DE_ASSERT(this.getNumIndices() == 0);
+
+ // If testing a case with restart at beginning, add it there.
+ if (this.m_beginWithRestart) {
+ this.addIndex(restartIndex);
+ if (this.m_duplicateRestarts)
+ this.addIndex(restartIndex);
+ }
+
+ // Generate vertex positions and indices depending on primitive type.
+ // \note At this point, restarts shall not be added to the start or the end of the index vector. Those are special cases, and are done above and after the following if-else chain, respectively.
+ /** @type {number} */ var curIndex;
+ /** @type {number} */ var numRows;
+ /** @type {number} */ var numCols;
+ /** @type {number} */ var fx;
+ /** @type {number} */ var fy;
+ /** @type {number} */ var centerY;
+ /** @type {number} */ var centerX;
+ /** @type {number} */ var numVertices;
+ /** @type {number} */ var numArcVertices;
+ /** @type {number} */ var numStrips;
+
+ if (this.m_primType == es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_POINTS) {
+ // Generate rows with different numbers of points.
+
+ curIndex = 0;
+ numRows = 20;
+
+ for (var row = 0; row < numRows; row++) {
+ for (var col = 0; col < row + 1; col++) {
+ fx = -1.0 + 2.0 * (col + 0.5) / numRows;
+ fy = -1.0 + 2.0 * (row + 0.5) / numRows;
+
+ this.m_positions.push(fx);
+ this.m_positions.push(fy);
+
+ this.addIndex(curIndex++);
+ }
+
+ if (row < numRows - 1) { // Add a restart after all but last row.
+ this.addIndex(restartIndex);
+ if (this.m_duplicateRestarts)
+ this.addIndex(restartIndex);
+ }
+ }
+ } else if (this.m_primType == es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_LINE_STRIP || this.m_primType == es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_LINE_LOOP || this.m_primType == es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_LINES) {
+ // Generate a numRows x numCols arrangement of line polygons of different vertex counts.
+
+ curIndex = 0;
+ numRows = 4;
+ numCols = 4;
+
+ for (var row = 0; row < numRows; row++) {
+ centerY = -1.0 + 2.0 * (row + 0.5) / numRows;
+
+ for (var col = 0; col < numCols; col++) {
+ centerX = -1.0 + 2.0 * (col + 0.5) / numCols;
+ numVertices = row * numCols + col + 1;
+
+ for (var i = 0; i < numVertices; i++) {
+ fx = centerX + 0.9 * Math.cos(i * 2.0 * Math.PI / numVertices) / numCols;
+ fy = centerY + 0.9 * Math.sin(i * 2.0 * Math.PI / numVertices) / numRows;
+
+ this.m_positions.push(fx);
+ this.m_positions.push(fy);
+
+ this.addIndex(curIndex++);
+ }
+
+ if (col < numCols - 1 || row < numRows - 1) {// Add a restart after all but last polygon.
+ this.addIndex(restartIndex);
+ if (this.m_duplicateRestarts)
+ this.addIndex(restartIndex);
+ }
+ }
+ }
+ } else if (this.m_primType == es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_TRIANGLE_STRIP) {
+ // Generate a number of horizontal triangle strips of different lengths.
+
+ curIndex = 0;
+ numStrips = 20;
+
+ for (var stripNdx = 0; stripNdx < numStrips; stripNdx++) {
+ numVertices = stripNdx + 1;
+
+ for (var i = 0; i < numVertices; i++) {
+ fx = -0.9 + 1.8 * (i / 2 * 2) / numStrips;
+ fy = -0.9 + 1.8 * (stripNdx + (i % 2 == 0 ? 0.0 : 0.8)) / numStrips;
+
+ this.m_positions.push(fx);
+ this.m_positions.push(fy);
+
+ this.addIndex(curIndex++);
+ }
+
+ if (stripNdx < numStrips - 1) { // Add a restart after all but last strip.
+ this.addIndex(restartIndex);
+ if (this.m_duplicateRestarts)
+ this.addIndex(restartIndex);
+ }
+ }
+ } else if (this.m_primType == es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_TRIANGLE_FAN) {
+ // Generate a numRows x numCols arrangement of triangle fan polygons of different vertex counts.
+
+ curIndex = 0;
+ numRows = 4;
+ numCols = 4;
+
+ for (var row = 0; row < numRows; row++) {
+ centerY = -1.0 + 2.0 * (row + 0.5) / numRows;
+
+ for (var col = 0; col < numCols; col++) {
+ centerX = -1.0 + 2.0 * (col + 0.5) / numCols;
+ numArcVertices = row * numCols + col;
+
+ this.m_positions.push(centerX);
+ this.m_positions.push(centerY);
+
+ this.addIndex(curIndex++);
+
+ for (var i = 0; i < numArcVertices; i++) {
+ fx = centerX + 0.9 * Math.cos(i * 2.0 * Math.PI / numArcVertices) / numCols;
+ fy = centerY + 0.9 * Math.sin(i * 2.0 * Math.PI / numArcVertices) / numRows;
+
+ this.m_positions.push(fx);
+ this.m_positions.push(fy);
+
+ this.addIndex(curIndex++);
+ }
+
+ if (col < numCols - 1 || row < numRows - 1) { // Add a restart after all but last polygon.
+ this.addIndex(restartIndex);
+ if (this.m_duplicateRestarts)
+ this.addIndex(restartIndex);
+ }
+ }
+ }
+ } else if (this.m_primType == es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_TRIANGLES) {
+ // Generate a number of rows with (potentially incomplete) triangles.
+
+ curIndex = 0;
+ numRows = 3 * 7;
+
+ for (var rowNdx = 0; rowNdx < numRows; rowNdx++) {
+ numVertices = rowNdx + 1;
+
+ for (var i = 0; i < numVertices; i++) {
+ fx = -0.9 + 1.8 * ((i / 3) + (i % 3 == 2 ? 0.8 : 0.0)) * 3 / numRows;
+ fy = -0.9 + 1.8 * (rowNdx + (i % 3 == 0 ? 0.0 : 0.8)) / numRows;
+
+ this.m_positions.push(fx);
+ this.m_positions.push(fy);
+
+ this.addIndex(curIndex++);
+ }
+
+ if (rowNdx < numRows - 1) { // Add a restart after all but last row.
+ this.addIndex(restartIndex);
+ if (this.m_duplicateRestarts)
+ this.addIndex(restartIndex);
+ }
+ }
+ } else
+ DE_ASSERT(false);
+
+ // If testing a case with restart at end, add it there.
+ if (this.m_endWithRestart) {
+ this.addIndex(restartIndex);
+ if (this.m_duplicateRestarts)
+ this.addIndex(restartIndex);
+ }
+
+ // Special case assertions.
+
+ /** @type {number} */ var numIndices = this.getNumIndices();
+
+ DE_ASSERT(numIndices > 0);
+ DE_ASSERT(this.m_beginWithRestart || this.getIndex(0) != restartIndex); // We don't want restarts at beginning unless the case is a special case.
+ DE_ASSERT(this.m_endWithRestart || this.getIndex(numIndices - 1) != restartIndex); // We don't want restarts at end unless the case is a special case.
+
+ if (!this.m_duplicateRestarts)
+ for (var i = 1; i < numIndices; i++)
+ DE_ASSERT(this.getIndex(i) != restartIndex || this.getIndex(i - 1) != restartIndex); // We don't want duplicate restarts unless the case is a special case.
+
+ };
+
+ es3fPrimitiveRestartTests.PrimitiveRestartCase.prototype.iterate = function() {
+ /** @type {number} */ var width = Math.min(gl.drawingBufferWidth, es3fPrimitiveRestartTests.MAX_RENDER_WIDTH);
+ /** @type {number} */ var height = Math.min(gl.drawingBufferHeight, es3fPrimitiveRestartTests.MAX_RENDER_HEIGHT);
+
+ /** @type {number} */ var xOffsetMax = gl.drawingBufferWidth - width;
+ /** @type {number} */ var yOffsetMax = gl.drawingBufferHeight - height;
+
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name));
+
+ /** @type {number} */ var xOffset = rnd.getInt(0, xOffsetMax);
+ /** @type {number} */ var yOffset = rnd.getInt(0, yOffsetMax);
+ /** @type {tcuSurface.Surface} */ var referenceImg = new tcuSurface.Surface(width, height);
+ /** @type {tcuSurface.Surface} */ var resultImg = new tcuSurface.Surface(width, height);
+
+ gl.viewport(xOffset, yOffset, width, height);
+ gl.clearColor(0.0, 0.0, 0.0, 1.0);
+
+ var program = this.m_program.getProgram();
+ gl.useProgram(program);
+
+ // Setup position attribute.
+
+ /** @type {number} */ var loc = gl.getAttribLocation(program, 'a_position');
+ gl.enableVertexAttribArray(loc);
+
+ var locGlBuffer = gl.createBuffer();
+ var bufferLoc = new Float32Array(this.m_positions);
+ gl.bindBuffer(gl.ARRAY_BUFFER, locGlBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, bufferLoc, gl.STATIC_DRAW);
+ gl.vertexAttribPointer(loc, 2, gl.FLOAT, false, 0, 0);
+
+ // Render result.
+ this.renderWithRestart();
+ var resImg = resultImg.getAccess();
+ var resImgTransferFormat = gluTextureUtil.getTransferFormat(resImg.getFormat());
+ gl.readPixels(xOffset, yOffset, resImg.m_width, resImg.m_height, resImgTransferFormat.format, resImgTransferFormat.dataType, resultImg.m_pixels);
+
+ // Render reference (same scene as the real deal, but emulate primitive restart without actually using it).
+ this.renderWithoutRestart();
+
+ var refImg = referenceImg.getAccess();
+ var refImgTransferFormat = gluTextureUtil.getTransferFormat(refImg.getFormat());
+
+ gl.readPixels(xOffset, yOffset, refImg.m_width, refImg.m_height, refImgTransferFormat.format, refImgTransferFormat.dataType, referenceImg.m_pixels);
+
+ // Compare.
+ /** @type {boolean} */ var testOk = tcuImageCompare.pixelThresholdCompare('ComparisonResult', 'Image comparison result', referenceImg, resultImg, [0, 0, 0, 0]);
+
+ assertMsgOptions(testOk, '', true, false);
+ gl.useProgram(null);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ es3fPrimitiveRestartTests.init = function() {
+ var testGroup = tcuTestCase.runner.testCases;
+ for (var isRestartBeginCaseI = 0; isRestartBeginCaseI <= 1; isRestartBeginCaseI++) {
+ for (var isRestartEndCaseI = 0; isRestartEndCaseI <= 1; isRestartEndCaseI++) {
+ for (var isDuplicateRestartCaseI = 0; isDuplicateRestartCaseI <= 1; isDuplicateRestartCaseI++) {
+ /** @type {boolean} */ var isRestartBeginCase = isRestartBeginCaseI != 0;
+ /** @type {boolean} */ var isRestartEndCase = isRestartEndCaseI != 0;
+ /** @type {boolean} */ var isDuplicateRestartCase = isDuplicateRestartCaseI != 0;
+
+ /** @type {string} */ var specialCaseGroupName = '';
+
+ if (isRestartBeginCase) specialCaseGroupName = 'begin_restart';
+ if (isRestartEndCase) specialCaseGroupName += (deString.deIsStringEmpty(specialCaseGroupName) ? '' : '_') + 'end_restart';
+ if (isDuplicateRestartCase) specialCaseGroupName += (deString.deIsStringEmpty(specialCaseGroupName) ? '' : '_') + 'duplicate_restarts';
+
+ if (deString.deIsStringEmpty(specialCaseGroupName))
+ specialCaseGroupName = 'basic';
+
+ /** @type {tcuTestCase.DeqpTest} */ var specialCaseGroup = tcuTestCase.newTest(specialCaseGroupName, '');
+ testGroup.addChild(specialCaseGroup);
+
+ for (var primType in es3fPrimitiveRestartTests.PrimitiveType) {
+ /** @type {string} */ var primTypeName = es3fPrimitiveRestartTests.PrimitiveType[primType] == es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_POINTS ? 'points' :
+ es3fPrimitiveRestartTests.PrimitiveType[primType] == es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_LINE_STRIP ? 'line_strip' :
+ es3fPrimitiveRestartTests.PrimitiveType[primType] == es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_LINE_LOOP ? 'line_loop' :
+ es3fPrimitiveRestartTests.PrimitiveType[primType] == es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_LINES ? 'lines' :
+ es3fPrimitiveRestartTests.PrimitiveType[primType] == es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_TRIANGLE_STRIP ? 'triangle_strip' :
+ es3fPrimitiveRestartTests.PrimitiveType[primType] == es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_TRIANGLE_FAN ? 'triangle_fan' :
+ es3fPrimitiveRestartTests.PrimitiveType[primType] == es3fPrimitiveRestartTests.PrimitiveType.PRIMITIVE_TRIANGLES ? 'triangles' :
+ '';
+
+ DE_ASSERT(primTypeName != null);
+
+ /** @type {tcuTestCase.DeqpTest} */ var primTypeGroup = tcuTestCase.newTest(primTypeName, '');
+ specialCaseGroup.addChild(primTypeGroup);
+
+ for (var indexType in es3fPrimitiveRestartTests.IndexType) {
+ /** @type {string} */ var indexTypeName = es3fPrimitiveRestartTests.IndexType[indexType] == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_BYTE ? 'unsigned_byte' :
+ es3fPrimitiveRestartTests.IndexType[indexType] == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_SHORT ? 'unsigned_short' :
+ es3fPrimitiveRestartTests.IndexType[indexType] == es3fPrimitiveRestartTests.IndexType.INDEX_UNSIGNED_INT ? 'unsigned_int' :
+ '';
+
+ DE_ASSERT(indexTypeName != null);
+
+ /** @type {tcuTestCase.DeqpTest} */ var indexTypeGroup = tcuTestCase.newTest(indexTypeName, '');
+ primTypeGroup.addChild(indexTypeGroup);
+
+ for (var _function in es3fPrimitiveRestartTests.DrawFunction) {
+ /** @type {?string} */ var functionName = es3fPrimitiveRestartTests.DrawFunction[_function] == es3fPrimitiveRestartTests.DrawFunction.FUNCTION_DRAW_ELEMENTS ? 'draw_elements' :
+ es3fPrimitiveRestartTests.DrawFunction[_function] == es3fPrimitiveRestartTests.DrawFunction.FUNCTION_DRAW_ELEMENTS_INSTANCED ? 'draw_elements_instanced' :
+ es3fPrimitiveRestartTests.DrawFunction[_function] == es3fPrimitiveRestartTests.DrawFunction.FUNCTION_DRAW_RANGE_ELEMENTS ? 'draw_range_elements' :
+ null;
+
+ DE_ASSERT(functionName != null);
+
+ indexTypeGroup.addChild(new es3fPrimitiveRestartTests.PrimitiveRestartCase(functionName,
+ '',
+ es3fPrimitiveRestartTests.PrimitiveType[primType],
+ es3fPrimitiveRestartTests.IndexType[indexType],
+ es3fPrimitiveRestartTests.DrawFunction[_function],
+ isRestartBeginCase,
+ isRestartEndCase,
+ isDuplicateRestartCase));
+ }
+ }
+ }
+ }
+ }
+ }
+ };
+
+ es3fPrimitiveRestartTests.run = function(context, range) {
+ gl = context;
+ //Set up Test Root parameters
+ var testName = 'primitive_restart';
+ var testDescription = 'Primitive Restart Tests';
+ var state = tcuTestCase.runner;
+
+ state.testName = testName;
+ state.setRoot(tcuTestCase.newTest(testName, testDescription, null));
+
+ //Set up name and description of this test series.
+ setCurrentTestName(testName);
+ description(testDescription);
+
+ try {
+ //Create test cases
+ es3fPrimitiveRestartTests.init();
+ if (range)
+ state.setRange(range);
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fPrimitiveRestartTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fRasterizerDiscardTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fRasterizerDiscardTests.js
new file mode 100644
index 0000000000..ce74648569
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fRasterizerDiscardTests.js
@@ -0,0 +1,485 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES 3.0 Module
+ * -------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief Rasterizer discard tests.
+ *//*--------------------------------------------------------------------*/
+
+goog.provide('functional.gles3.es3fRasterizerDiscardTests');
+goog.require('framework.common.tcuLogImage');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.opengl.gluDrawUtil');
+goog.require('framework.opengl.gluShaderProgram');
+
+goog.scope(function() {
+var es3fRasterizerDiscardTests = functional.gles3.es3fRasterizerDiscardTests;
+var deString = framework.delibs.debase.deString;
+var tcuTestCase = framework.common.tcuTestCase;
+var deRandom = framework.delibs.debase.deRandom;
+var gluShaderProgram = framework.opengl.gluShaderProgram;
+var tcuSurface = framework.common.tcuSurface;
+var gluDrawUtil = framework.opengl.gluDrawUtil;
+var tcuLogImage = framework.common.tcuLogImage;
+
+/** @const */ var NUM_CASE_ITERATIONS = 1;
+/** @const */ var FAIL_COLOR_RED = [1, 0, 0.0, 1];
+/** @const */ var PASS_COLOR_BLUE = [0, 0, 0.5, 1];
+/** @const */ var BLACK_COLOR = [0, 0, 0.0, 1];
+/** @const */ var FAIL_DEPTH = 0;
+/** @const */ var FAIL_STENCIL = 1;
+/** @const */ var UNIT_SQUARE = [
+ 1, 1, 0.05, 1,
+ 1, -1, 0.05, 1,
+ -1, 1, 0.05, 1,
+ -1, -1, 0.05, 1
+];
+
+/** @type {WebGL2RenderingContext} */ var gl;
+
+/**
+ * @enum
+ */
+es3fRasterizerDiscardTests.CaseType = {
+ WRITE_DEPTH: 0,
+ WRITE_STENCIL: 1,
+ CLEAR_COLOR: 2,
+ CLEAR_DEPTH: 3,
+ CLEAR_STENCIL: 4
+};
+
+/**
+ * @enum {{useFBO: boolean, useScissor: boolean}}
+ */
+es3fRasterizerDiscardTests.CaseOptions = {
+ FBO: {useFBO: true, useScissor: false},
+ SCISSOR: {useFBO: false, useScissor: true}
+};
+
+/**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} numPrimitives
+ * @param {es3fRasterizerDiscardTests.CaseType} caseType
+ * @param {?es3fRasterizerDiscardTests.CaseOptions} caseOptions
+ * @param {gluDrawUtil.primitiveType=} drawMode
+ */
+es3fRasterizerDiscardTests.RasterizerDiscardCase = function(name, description, numPrimitives, caseType, caseOptions, drawMode) {
+ tcuTestCase.DeqpTest.call(this, name, description);
+ this.m_numPrimitives = numPrimitives;
+ this.m_caseType = caseType;
+ this.m_caseOptions = caseOptions || {useFBO: false, useScissor: false};
+ this.m_drawMode = drawMode || gluDrawUtil.primitiveType.TRIANGLES;
+ this.m_program = null;
+ this.m_fbo = null;
+ this.m_colorBuf = null;
+ this.m_depthStencilBuf = null;
+ this.m_iterNdx = 0;
+ this.m_rnd = new deRandom.Random(deString.deStringHash(name));
+};
+
+es3fRasterizerDiscardTests.RasterizerDiscardCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+es3fRasterizerDiscardTests.RasterizerDiscardCase.prototype.constructor = es3fRasterizerDiscardTests.RasterizerDiscardCase;
+
+/**
+ * @param {number} numPrimitives
+ * @param {deRandom.Random} rnd
+ * @param {gluDrawUtil.primitiveType} drawMode
+ * @return {Array<number>}
+ */
+es3fRasterizerDiscardTests.generateVertices = function(numPrimitives, rnd, drawMode) {
+ var dst = [];
+ var numVertices;
+
+ switch (drawMode) {
+ case gl.POINTS: numVertices = numPrimitives; break;
+ case gl.LINES: numVertices = 2 * numPrimitives; break;
+ case gl.LINE_STRIP: numVertices = numPrimitives + 1; break;
+ case gl.LINE_LOOP: numVertices = numPrimitives + 2; break;
+ case gl.TRIANGLES: numVertices = 3 * numPrimitives; break;
+ case gl.TRIANGLE_STRIP: numVertices = numPrimitives + 2; break;
+ case gl.TRIANGLE_FAN: numVertices = numPrimitives + 2; break;
+ default:
+ throw new Error('Invalid drawMode: ' + drawMode);
+ }
+
+ for (var i = 0; i < numVertices; i++) {
+ dst[i * 4] = rnd.getFloat(-1.0, 1.0); // x
+ dst[i * 4 + 1] = rnd.getFloat(-1.0, 1.0); // y
+ dst[i * 4 + 2] = rnd.getFloat(0.1, 0.9); // z
+ dst[i * 4 + 3] = 1.0; // w
+ }
+
+ return dst;
+};
+
+es3fRasterizerDiscardTests.RasterizerDiscardCase.prototype.setupFramebufferObject = function() {
+ var width = gl.drawingBufferWidth;
+ var height = gl.drawingBufferHeight;
+
+ // Create framebuffer object
+
+ this.m_fbo = gl.createFramebuffer();
+ this.m_colorBuf = gl.createTexture();
+ this.m_depthStencilBuf = gl.createRenderbuffer();
+
+ // Create color texture
+
+ gl.bindTexture(gl.TEXTURE_2D, this.m_colorBuf);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+
+ // Create depth and stencil buffers
+
+ gl.bindRenderbuffer(gl.RENDERBUFFER, this.m_depthStencilBuf);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH24_STENCIL8, width, height);
+
+ // Attach texture and buffers to FBO
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, this.m_fbo);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.m_colorBuf, 0);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, this.m_depthStencilBuf);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, this.m_depthStencilBuf);
+
+ var fboStatus = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ if (fboStatus == gl.FRAMEBUFFER_UNSUPPORTED)
+ throw new Error('Framebuffer unsupported');
+ else if (fboStatus != gl.FRAMEBUFFER_COMPLETE)
+ throw new Error('Failed to create framebuffer object: ' + deString.enumToString(gl, fboStatus));
+};
+
+es3fRasterizerDiscardTests.RasterizerDiscardCase.prototype.deleteFramebufferObject = function() {
+ gl.deleteTexture(this.m_colorBuf);
+ gl.deleteRenderbuffer(this.m_depthStencilBuf);
+ gl.deleteFramebuffer(this.m_fbo);
+};
+
+es3fRasterizerDiscardTests.RasterizerDiscardCase.prototype.init = function() {
+ var vertShaderSource =
+ '#version 300 es\n' +
+ 'layout(location = 0) in mediump vec4 a_position;\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = a_position;\n' +
+ '}\n';
+
+ var fragShaderSource =
+ '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 dEQP_FragColor;\n' +
+ 'uniform mediump vec4 u_color;\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' mediump float depth_gradient = gl_FragCoord.z;\n' +
+ ' mediump float bias = 0.1;\n' +
+ ' dEQP_FragColor = vec4(u_color.xyz * (depth_gradient + bias), 1.0);\n' +
+ '}\n';
+
+ this.m_program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertShaderSource, fragShaderSource));
+
+ if (!this.m_program.isOk()) {
+ bufferedLogToConsole(this.m_program);
+ testFailedOptions('Failed to compile shader program', true);
+ }
+};
+
+es3fRasterizerDiscardTests.RasterizerDiscardCase.prototype.deinit = function() {
+ this.deleteFramebufferObject();
+ this.m_program = null;
+};
+
+es3fRasterizerDiscardTests.RasterizerDiscardCase.prototype.iterate = function() {
+ var program = this.m_program.getProgram();
+ var colorUnif = gl.getUniformLocation(program, 'u_color');
+ var failColorFound = false;
+ var passColorFound = false;
+ var vertices;
+
+ bufferedLogToConsole('Case iteration ' + (this.m_iterNdx + 1) + ' / ' + NUM_CASE_ITERATIONS);
+
+ // Create and bind FBO if needed
+
+ if (this.m_caseOptions.useFBO) {
+ this.setupFramebufferObject();
+ }
+
+ if (this.m_caseOptions.useScissor) {
+ gl.enable(gl.SCISSOR_TEST);
+ gl.scissor(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
+ bufferedLogToConsole('Scissor test enabled: glScissor(0, 0, ' + gl.drawingBufferWidth + ', ' + gl.drawingBufferHeight + ')');
+ }
+
+ gl.useProgram(this.m_program.getProgram());
+
+ gl.enable(gl.DEPTH_TEST);
+ gl.depthRange(0, 1);
+ gl.depthFunc(gl.LEQUAL);
+
+ gl.enable(gl.STENCIL_TEST);
+ gl.stencilFunc(gl.NOTEQUAL, 1, 0xFF);
+ gl.stencilOp(gl.REPLACE, gl.KEEP, gl.KEEP);
+
+ gl.clearColor(PASS_COLOR_BLUE[0], PASS_COLOR_BLUE[1], PASS_COLOR_BLUE[2], PASS_COLOR_BLUE[3]);
+ gl.clearDepth(1);
+ gl.clearStencil(0);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+
+ // Generate vertices
+ vertices = es3fRasterizerDiscardTests.generateVertices(this.m_numPrimitives, this.m_rnd, this.m_drawMode);
+ var posLoc = gl.getAttribLocation(program, 'a_position');
+ var vertexArrays = [];
+ vertexArrays.push(new gluDrawUtil.VertexArrayBinding(gl.FLOAT, posLoc, 4, vertices.length / 4, vertices));
+ // Clear color to black for depth and stencil clear cases
+
+ if (this.m_caseType == es3fRasterizerDiscardTests.CaseType.CLEAR_DEPTH || this.m_caseType == es3fRasterizerDiscardTests.CaseType.CLEAR_STENCIL) {
+ gl.clearColor(BLACK_COLOR[0], BLACK_COLOR[1], BLACK_COLOR[2], BLACK_COLOR[3]);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ }
+
+ // Set fail values for color, depth and stencil
+
+ gl.uniform4fv(colorUnif, FAIL_COLOR_RED);
+ gl.clearColor(FAIL_COLOR_RED[0], FAIL_COLOR_RED[1], FAIL_COLOR_RED[2], FAIL_COLOR_RED[3]);
+ gl.clearDepth(FAIL_DEPTH);
+ gl.clearStencil(FAIL_STENCIL);
+
+ // Enable rasterizer discard
+
+ gl.enable(gl.RASTERIZER_DISCARD);
+ bufferedLogToConsole('Rasterizer discard enabled');
+
+ // Do to-be-discarded primitive draws and buffer clears
+
+ switch (this.m_caseType) {
+ case es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH:
+ gluDrawUtil.draw(gl, program, vertexArrays, new gluDrawUtil.PrimitiveList(this.m_drawMode, vertices.length / 4));
+ break;
+ case es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL:
+ gluDrawUtil.draw(gl, program, vertexArrays, new gluDrawUtil.PrimitiveList(this.m_drawMode, vertices.length / 4));
+ break;
+ case es3fRasterizerDiscardTests.CaseType.CLEAR_COLOR:
+ if (this.m_caseOptions.useFBO)
+ gl.clearBufferfv(gl.COLOR, 0, FAIL_COLOR_RED);
+ else
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ break;
+ case es3fRasterizerDiscardTests.CaseType.CLEAR_DEPTH:
+ if (this.m_caseOptions.useFBO)
+ gl.clearBufferfv(gl.DEPTH, 0, [FAIL_DEPTH]);
+ else
+ gl.clear(gl.DEPTH_BUFFER_BIT);
+ break;
+ case es3fRasterizerDiscardTests.CaseType.CLEAR_STENCIL:
+ if (this.m_caseOptions.useFBO)
+ gl.clearBufferiv(gl.STENCIL, 0, [FAIL_STENCIL]);
+ else
+ gl.clear(gl.STENCIL_BUFFER_BIT);
+ break;
+ default:
+ throw new Error('Invalid case type ' + this.m_caseType);
+ }
+
+ // Disable rasterizer discard
+
+ gl.disable(gl.RASTERIZER_DISCARD);
+ bufferedLogToConsole('Rasterizer discard disabled');
+
+ if (this.m_caseType == es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL) {
+ if (this.m_caseOptions.useFBO || gl.getContextAttributes().stencil) {
+ // Draw a full-screen square that colors all pixels red if they have stencil value 1.
+ var square = [new gluDrawUtil.VertexArrayBinding(gl.FLOAT, posLoc, 4, UNIT_SQUARE.length / 4, UNIT_SQUARE)];
+
+ gl.stencilFunc(gl.EQUAL, 1, 0xFF);
+ gluDrawUtil.draw(gl, program, square,
+ new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.TRIANGLE_STRIP, UNIT_SQUARE.length / 4));
+ }
+ // \note If no stencil buffers are present and test is rendering to default framebuffer, test will always pass.
+ } else if (this.m_caseType == es3fRasterizerDiscardTests.CaseType.CLEAR_DEPTH || this.m_caseType == es3fRasterizerDiscardTests.CaseType.CLEAR_STENCIL) {
+ // Draw pass-indicating primitives for depth and stencil clear cases
+
+ gl.uniform4fv(colorUnif, PASS_COLOR_BLUE);
+ gluDrawUtil.draw(gl, program, vertexArrays, new gluDrawUtil.PrimitiveList(this.m_drawMode, vertices.length / 4));
+ }
+
+ gl.finish();
+ gl.disable(gl.STENCIL_TEST);
+ gl.disable(gl.DEPTH_TEST);
+ gl.disable(gl.SCISSOR_TEST);
+
+ // Read and check pixel data
+
+ var pixels = new tcuSurface.Surface();
+ pixels.readViewport(gl);
+
+ var width = pixels.getWidth();
+ var height = pixels.getHeight();
+
+ for (var y = 0; y < height; y++) {
+ for (var x = 0; x < width; x++) {
+ var pixel = pixels.getPixel(x, y);
+ if (pixel[2] != 0)
+ passColorFound = true;
+
+ if (pixel[0] != 0) {
+ failColorFound = true;
+ break;
+ }
+ }
+ if (failColorFound) break;
+ }
+
+ // Delete FBO if created
+
+ if (this.m_caseOptions.useFBO)
+ this.deleteFramebufferObject();
+
+ // Evaluate test result
+
+ var testOk = passColorFound && !failColorFound;
+
+ if (!testOk) {
+ tcuLogImage.logImage('Result image', '', pixels.getAccess());
+ testFailed('Primitive or buffer clear was not discarded.');
+ return tcuTestCase.IterateResult.STOP;
+ }
+ bufferedLogToConsole('Primitive or buffer clear was discarded correctly.');
+
+ if (++this.m_iterNdx < NUM_CASE_ITERATIONS)
+ return tcuTestCase.IterateResult.CONTINUE;
+
+ testPassed();
+ return tcuTestCase.IterateResult.STOP;
+};
+
+es3fRasterizerDiscardTests.init = function() {
+ var state = tcuTestCase.runner;
+ var testGroup = state.testCases;
+
+ var basic = tcuTestCase.newTest('basic', 'Rasterizer discard test for default framebuffer');
+ var scissor = tcuTestCase.newTest('scissor', 'Rasterizer discard test for default framebuffer with scissor test enabled');
+ var fbo = tcuTestCase.newTest('fbo', 'Rasterizer discard test for framebuffer object');
+
+ testGroup.addChild(basic);
+ testGroup.addChild(scissor);
+ testGroup.addChild(fbo);
+
+ // Default framebuffer cases
+
+ basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_points', 'points', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, null, gluDrawUtil.primitiveType.POINTS));
+ basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_lines', 'lines', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, null, gluDrawUtil.primitiveType.LINES));
+ basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_line_strip', 'line_strip', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, null, gluDrawUtil.primitiveType.LINE_STRIP));
+ basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_line_loop', 'line_loop', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, null, gluDrawUtil.primitiveType.LINE_LOOP));
+ basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_triangles', 'triangles', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, null, gluDrawUtil.primitiveType.TRIANGLES));
+ basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_triangle_strip', 'triangle_strip', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, null, gluDrawUtil.primitiveType.TRIANGLE_STRIP));
+ basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_triangle_fan', 'triangle_fan', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, null, gluDrawUtil.primitiveType.TRIANGLE_FAN));
+
+ basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_points', 'points', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, null, gluDrawUtil.primitiveType.POINTS));
+ basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_lines', 'lines', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, null, gluDrawUtil.primitiveType.LINES));
+ basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_line_strip', 'line_strip', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, null, gluDrawUtil.primitiveType.LINE_STRIP));
+ basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_line_loop', 'line_loop', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, null, gluDrawUtil.primitiveType.LINE_LOOP));
+ basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_triangles', 'triangles', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, null, gluDrawUtil.primitiveType.TRIANGLES));
+ basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_triangle_strip', 'triangle_strip', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, null, gluDrawUtil.primitiveType.TRIANGLE_STRIP));
+ basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_triangle_fan', 'triangle_fan', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, null, gluDrawUtil.primitiveType.TRIANGLE_FAN));
+
+ basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('clear_color', 'clear_color', 4, es3fRasterizerDiscardTests.CaseType.CLEAR_COLOR, null));
+ basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('clear_depth', 'clear_depth', 4, es3fRasterizerDiscardTests.CaseType.CLEAR_DEPTH, null));
+ basic.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('clear_stencil', 'clear_stencil', 4, es3fRasterizerDiscardTests.CaseType.CLEAR_STENCIL, null));
+
+ // Default framebuffer cases with scissor test enabled
+
+ scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_points', 'points', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, es3fRasterizerDiscardTests.CaseOptions.SCISSOR, gluDrawUtil.primitiveType.POINTS));
+ scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_lines', 'lines', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, es3fRasterizerDiscardTests.CaseOptions.SCISSOR, gluDrawUtil.primitiveType.LINES));
+ scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_line_strip', 'line_strip', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, es3fRasterizerDiscardTests.CaseOptions.SCISSOR, gluDrawUtil.primitiveType.LINE_STRIP));
+ scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_line_loop', 'line_loop', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, es3fRasterizerDiscardTests.CaseOptions.SCISSOR, gluDrawUtil.primitiveType.LINE_LOOP));
+ scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_triangles', 'triangles', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, es3fRasterizerDiscardTests.CaseOptions.SCISSOR, gluDrawUtil.primitiveType.TRIANGLES));
+ scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_triangle_strip', 'triangle_strip', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, es3fRasterizerDiscardTests.CaseOptions.SCISSOR, gluDrawUtil.primitiveType.TRIANGLE_STRIP));
+ scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_triangle_fan', 'triangle_fan', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, es3fRasterizerDiscardTests.CaseOptions.SCISSOR, gluDrawUtil.primitiveType.TRIANGLE_FAN));
+
+ scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_points', 'points', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, es3fRasterizerDiscardTests.CaseOptions.SCISSOR, gluDrawUtil.primitiveType.POINTS));
+ scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_lines', 'lines', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, es3fRasterizerDiscardTests.CaseOptions.SCISSOR, gluDrawUtil.primitiveType.LINES));
+ scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_line_strip', 'line_strip', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, es3fRasterizerDiscardTests.CaseOptions.SCISSOR, gluDrawUtil.primitiveType.LINE_STRIP));
+ scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_line_loop', 'line_loop', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, es3fRasterizerDiscardTests.CaseOptions.SCISSOR, gluDrawUtil.primitiveType.LINE_LOOP));
+ scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_triangles', 'triangles', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, es3fRasterizerDiscardTests.CaseOptions.SCISSOR, gluDrawUtil.primitiveType.TRIANGLES));
+ scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_triangle_strip', 'triangle_strip', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, es3fRasterizerDiscardTests.CaseOptions.SCISSOR, gluDrawUtil.primitiveType.TRIANGLE_STRIP));
+ scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_triangle_fan', 'triangle_fan', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, es3fRasterizerDiscardTests.CaseOptions.SCISSOR, gluDrawUtil.primitiveType.TRIANGLE_FAN));
+
+ scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('clear_color', 'clear_color', 4, es3fRasterizerDiscardTests.CaseType.CLEAR_COLOR, es3fRasterizerDiscardTests.CaseOptions.SCISSOR));
+ scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('clear_depth', 'clear_depth', 4, es3fRasterizerDiscardTests.CaseType.CLEAR_DEPTH, es3fRasterizerDiscardTests.CaseOptions.SCISSOR));
+ scissor.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('clear_stencil', 'clear_stencil', 4, es3fRasterizerDiscardTests.CaseType.CLEAR_STENCIL, es3fRasterizerDiscardTests.CaseOptions.SCISSOR));
+
+ // FBO cases
+
+ fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_points', 'points', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, es3fRasterizerDiscardTests.CaseOptions.FBO, gluDrawUtil.primitiveType.POINTS));
+ fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_lines', 'lines', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, es3fRasterizerDiscardTests.CaseOptions.FBO, gluDrawUtil.primitiveType.LINES));
+ fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_line_strip', 'line_strip', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, es3fRasterizerDiscardTests.CaseOptions.FBO, gluDrawUtil.primitiveType.LINE_STRIP));
+ fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_line_loop', 'line_loop', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, es3fRasterizerDiscardTests.CaseOptions.FBO, gluDrawUtil.primitiveType.LINE_LOOP));
+ fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_triangles', 'triangles', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, es3fRasterizerDiscardTests.CaseOptions.FBO, gluDrawUtil.primitiveType.TRIANGLES));
+ fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_triangle_strip', 'triangle_strip', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, es3fRasterizerDiscardTests.CaseOptions.FBO, gluDrawUtil.primitiveType.TRIANGLE_STRIP));
+ fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_depth_triangle_fan', 'triangle_fan', 4, es3fRasterizerDiscardTests.CaseType.WRITE_DEPTH, es3fRasterizerDiscardTests.CaseOptions.FBO, gluDrawUtil.primitiveType.TRIANGLE_FAN));
+
+ fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_points', 'points', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, es3fRasterizerDiscardTests.CaseOptions.FBO, gluDrawUtil.primitiveType.POINTS));
+ fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_lines', 'lines', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, es3fRasterizerDiscardTests.CaseOptions.FBO, gluDrawUtil.primitiveType.LINES));
+ fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_line_strip', 'line_strip', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, es3fRasterizerDiscardTests.CaseOptions.FBO, gluDrawUtil.primitiveType.LINE_STRIP));
+ fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_line_loop', 'line_loop', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, es3fRasterizerDiscardTests.CaseOptions.FBO, gluDrawUtil.primitiveType.LINE_LOOP));
+ fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_triangles', 'triangles', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, es3fRasterizerDiscardTests.CaseOptions.FBO, gluDrawUtil.primitiveType.TRIANGLES));
+ fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_triangle_strip', 'triangle_strip', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, es3fRasterizerDiscardTests.CaseOptions.FBO, gluDrawUtil.primitiveType.TRIANGLE_STRIP));
+ fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('write_stencil_triangle_fan', 'triangle_fan', 4, es3fRasterizerDiscardTests.CaseType.WRITE_STENCIL, es3fRasterizerDiscardTests.CaseOptions.FBO, gluDrawUtil.primitiveType.TRIANGLE_FAN));
+
+ fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('clear_color', 'clear_color', 4, es3fRasterizerDiscardTests.CaseType.CLEAR_COLOR, es3fRasterizerDiscardTests.CaseOptions.FBO));
+ fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('clear_depth', 'clear_depth', 4, es3fRasterizerDiscardTests.CaseType.CLEAR_DEPTH, es3fRasterizerDiscardTests.CaseOptions.FBO));
+ fbo.addChild(new es3fRasterizerDiscardTests.RasterizerDiscardCase('clear_stencil', 'clear_stencil', 4, es3fRasterizerDiscardTests.CaseType.CLEAR_STENCIL, es3fRasterizerDiscardTests.CaseOptions.FBO));
+};
+
+/**
+ * Create and execute the test cases
+ */
+es3fRasterizerDiscardTests.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var testName = 'rasterizer_discard';
+ var testDescription = 'Rasterizer Discard Tests';
+ var state = tcuTestCase.runner;
+
+ state.testName = testName;
+ state.testCases = tcuTestCase.newTest(testName, testDescription, null);
+
+ //Set up name and description of this test series.
+ setCurrentTestName(testName);
+ description(testDescription);
+
+ try {
+ es3fRasterizerDiscardTests.init();
+ tcuTestCase.runTestCases();
+ } catch (err) {
+ testFailedOptions('Failed to run tests', false);
+ bufferedLogToConsole(err);
+ tcuTestCase.runner.terminate();
+ }
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fRboStateQueryTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fRboStateQueryTests.js
new file mode 100644
index 0000000000..9903102990
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fRboStateQueryTests.js
@@ -0,0 +1,308 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fRboStateQueryTests');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('functional.gles3.es3fApiCase');
+goog.require('modules.shared.glsStateQuery');
+
+goog.scope(function() {
+var es3fRboStateQueryTests = functional.gles3.es3fRboStateQueryTests;
+var tcuTestCase = framework.common.tcuTestCase;
+var glsStateQuery = modules.shared.glsStateQuery;
+var es3fApiCase = functional.gles3.es3fApiCase;
+var deRandom = framework.delibs.debase.deRandom;
+
+var setParentClass = function(child, parent) {
+ child.prototype = Object.create(parent.prototype);
+ child.prototype.constructor = child;
+};
+
+/**
+ * @this {es3fApiCase.ApiCase}
+ */
+var checkRenderbufferComponentSize = function(r, g, b, a, d, s) {
+ var referenceSizes = [r, g, b, a, d, s];
+ var paramNames = [
+ gl.RENDERBUFFER_RED_SIZE,
+ gl.RENDERBUFFER_GREEN_SIZE,
+ gl.RENDERBUFFER_BLUE_SIZE,
+ gl.RENDERBUFFER_ALPHA_SIZE,
+ gl.RENDERBUFFER_DEPTH_SIZE,
+ gl.RENDERBUFFER_STENCIL_SIZE
+ ];
+
+ for (var ndx = 0; ndx < referenceSizes.length; ++ndx) {
+ if (referenceSizes[ndx] == -1)
+ continue;
+ var value = /** @type {number} */ (gl.getRenderbufferParameter(gl.RENDERBUFFER, paramNames[ndx]));
+
+ this.check(value >= referenceSizes[ndx], 'Expected greater or equal to ' + referenceSizes[ndx] + ' got ' + value);
+ }
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fRboStateQueryTests.RboSizeCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fRboStateQueryTests.RboSizeCase, es3fApiCase.ApiCase);
+
+es3fRboStateQueryTests.RboSizeCase.prototype.test = function() {
+ var rnd = new deRandom.Random(0xabcdef);
+
+ var renderbufferID = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID);
+
+ this.check(glsStateQuery.verifyRenderbuffer(gl.RENDERBUFFER_WIDTH, 0));
+ this.check(glsStateQuery.verifyRenderbuffer(gl.RENDERBUFFER_HEIGHT, 0));
+
+ var numIterations = 60;
+ for (var i = 0; i < numIterations; ++i) {
+ var w = rnd.getInt(0, 128);
+ var h = rnd.getInt(0, 128);
+
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGB8, w, h);
+
+ this.check(glsStateQuery.verifyRenderbuffer(gl.RENDERBUFFER_WIDTH, w));
+ this.check(glsStateQuery.verifyRenderbuffer(gl.RENDERBUFFER_HEIGHT, h));
+ }
+ gl.deleteRenderbuffer(renderbufferID);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fRboStateQueryTests.RboInternalFormatCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fRboStateQueryTests.RboInternalFormatCase, es3fApiCase.ApiCase);
+
+es3fRboStateQueryTests.RboInternalFormatCase.prototype.test = function() {
+ var renderbufferID = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID);
+
+ this.check(glsStateQuery.verifyRenderbuffer(gl.RENDERBUFFER_INTERNAL_FORMAT, gl.RGBA4));
+
+ var requiredColorformats = [
+ gl.R8, gl.RG8, gl.RGB8, gl.RGB565, gl.RGBA4, gl.RGB5_A1, gl.RGBA8, gl.RGB10_A2,
+ gl.RGB10_A2UI, gl.SRGB8_ALPHA8, gl.R8I, gl.R8UI, gl.R16I, gl.R16UI, gl.R32I, gl.R32UI,
+ gl.RG8I, gl.RG8UI, gl.RG16I, gl.RG16UI, gl.RG32I, gl.RG32UI, gl.RGBA8I, gl.RGBA8UI,
+ gl.RGBA16I, gl.RGBA16UI, gl.RGBA32I, gl.RGBA32UI
+ ];
+
+ for (var ndx = 0; ndx < requiredColorformats.length; ++ndx) {
+ gl.renderbufferStorage(gl.RENDERBUFFER, requiredColorformats[ndx], 128, 128);
+
+ this.check(glsStateQuery.verifyRenderbuffer(gl.RENDERBUFFER_INTERNAL_FORMAT, requiredColorformats[ndx]));
+ }
+ gl.deleteRenderbuffer(renderbufferID);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fRboStateQueryTests.RboComponentSizeColorCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fRboStateQueryTests.RboComponentSizeColorCase, es3fApiCase.ApiCase);
+
+es3fRboStateQueryTests.RboComponentSizeColorCase.prototype.test = function() {
+ var renderbufferID = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID);
+
+ checkRenderbufferComponentSize.bind(this, 0, 0, 0, 0, 0, 0);
+
+ var requiredColorFormats = [
+ // format, r, g, b, a
+ [gl.R8, 8, 0, 0, 0],
+ [gl.RG8, 8, 8, 0, 0],
+ [gl.RGB8, 8, 8, 8, 0],
+ [gl.RGB565, 5, 6, 5, 0],
+ [gl.RGBA4, 4, 4, 4, 4],
+ [gl.RGB5_A1, 5, 5, 5, 1],
+ [gl.RGBA8, 8, 8, 8, 8],
+ [gl.RGB10_A2, 10, 10, 10, 2],
+ [gl.RGB10_A2UI, 10, 10, 10, 2],
+ [gl.SRGB8_ALPHA8, 8, 8, 8, 8],
+ [gl.R8I, 8, 0, 0, 0],
+ [gl.R8UI, 8, 0, 0, 0],
+ [gl.R16I, 16, 0, 0, 0],
+ [gl.R16UI, 16, 0, 0, 0],
+ [gl.R32I, 32, 0, 0, 0],
+ [gl.R32UI, 32, 0, 0, 0],
+ [gl.RG8I, 8, 8, 0, 0],
+ [gl.RG8UI, 8, 8, 0, 0],
+ [gl.RG16I, 16, 16, 0, 0],
+ [gl.RG16UI, 16, 16, 0, 0],
+ [gl.RG32I, 32, 32, 0, 0],
+ [gl.RG32UI, 32, 32, 0, 0],
+ [gl.RGBA8I, 8, 8, 8, 8],
+ [gl.RGBA8UI, 8, 8, 8, 8],
+ [gl.RGBA16I, 16, 16, 16, 16],
+ [gl.RGBA16UI, 16, 16, 16, 16],
+ [gl.RGBA32I, 32, 32, 32, 32],
+ [gl.RGBA32UI, 32, 32, 32, 32]
+ ];
+
+ for (var ndx = 0; ndx < requiredColorFormats.length; ++ndx) {
+ gl.renderbufferStorage(gl.RENDERBUFFER, requiredColorFormats[ndx][0], 128, 128);
+
+ checkRenderbufferComponentSize.bind(this, requiredColorFormats[ndx][1], requiredColorFormats[ndx][2], requiredColorFormats[ndx][3], requiredColorFormats[ndx][4], -1, -1);
+ }
+ gl.deleteRenderbuffer(renderbufferID);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fRboStateQueryTests.RboComponentSizeDepthCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fRboStateQueryTests.RboComponentSizeDepthCase, es3fApiCase.ApiCase);
+
+es3fRboStateQueryTests.RboComponentSizeDepthCase.prototype.test = function() {
+ var renderbufferID = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID);
+
+ var requiredDepthFormats = [
+ // format, depth, stencil
+ [gl.DEPTH_COMPONENT16, 16, 0],
+ [gl.DEPTH_COMPONENT24, 24, 0],
+ [gl.DEPTH_COMPONENT32F, 32, 0],
+ [gl.DEPTH24_STENCIL8, 24, 8],
+ [gl.DEPTH32F_STENCIL8, 32, 8]
+ ];
+
+ for (var ndx = 0; ndx < requiredDepthFormats.length; ++ndx) {
+ gl.renderbufferStorage(gl.RENDERBUFFER, requiredDepthFormats[ndx][0], 128, 128);
+
+ checkRenderbufferComponentSize.bind(this, -1, -1, -1, -1, requiredDepthFormats[ndx][1], requiredDepthFormats[ndx][2]);
+ }
+
+ // STENCIL_INDEX8 is required, in that case sBits >= 8
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.STENCIL_INDEX8, 128, 128);
+
+ var value = /** @type {number} */ (gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_STENCIL_SIZE));
+ this.check(value >= 8, 'Expected greater or equal to 8; got ' + value);
+
+ gl.deleteRenderbuffer(renderbufferID);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fRboStateQueryTests.RboSamplesCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fRboStateQueryTests.RboSamplesCase, es3fApiCase.ApiCase);
+
+es3fRboStateQueryTests.RboSamplesCase.prototype.test = function() {
+ var rnd = new deRandom.Random(0xabcdef);
+
+ var renderbufferID = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, renderbufferID);
+
+ this.check(glsStateQuery.verifyRenderbuffer(gl.RENDERBUFFER_SAMPLES, 0));
+
+ var max_samples = /** @type {number} */ (gl.getParameter(gl.MAX_SAMPLES));
+
+ // 0 samples is a special case
+ gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 0, gl.RGBA8, 128, 128);
+
+ this.check(glsStateQuery.verifyRenderbuffer(gl.RENDERBUFFER_SAMPLES, 0));
+
+ // test [1, n] samples
+ for (var samples = 1; samples <= max_samples; ++samples) {
+ gl.renderbufferStorageMultisample(gl.RENDERBUFFER, samples, gl.RGBA8, 128, 128);
+ var value = /** @type {number} */ (gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_SAMPLES));
+ this.check(value >= samples, 'Expected greater or equal to ' + samples + ' got ' + value);
+ }
+
+ gl.deleteRenderbuffer(renderbufferID);
+};
+
+/**
+* @constructor
+* @extends {tcuTestCase.DeqpTest}
+*/
+es3fRboStateQueryTests.RboStateQueryTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'rbo', 'Rbo State Query tests');
+};
+
+es3fRboStateQueryTests.RboStateQueryTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+es3fRboStateQueryTests.RboStateQueryTests.prototype.constructor = es3fRboStateQueryTests.RboStateQueryTests;
+
+es3fRboStateQueryTests.RboStateQueryTests.prototype.init = function() {
+ this.addChild(new es3fRboStateQueryTests.RboSizeCase('renderbuffer_size', 'RENDERBUFFER_WIDTH and RENDERBUFFER_HEIGHT'));
+ this.addChild(new es3fRboStateQueryTests.RboInternalFormatCase('renderbuffer_internal_format', 'RENDERBUFFER_INTERNAL_FORMAT'));
+ this.addChild(new es3fRboStateQueryTests.RboComponentSizeColorCase('renderbuffer_component_size_color', 'RENDERBUFFER_x_SIZE'));
+ this.addChild(new es3fRboStateQueryTests.RboComponentSizeDepthCase('renderbuffer_component_size_depth', 'RENDERBUFFER_x_SIZE'));
+ this.addChild(new es3fRboStateQueryTests.RboSamplesCase('renderbuffer_samples', 'RENDERBUFFER_SAMPLES'));
+};
+
+/**
+* Run test
+* @param {WebGL2RenderingContext} context
+*/
+es3fRboStateQueryTests.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fRboStateQueryTests.RboStateQueryTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fRboStateQueryTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fReadPixelTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fReadPixelTests.js
new file mode 100644
index 0000000000..7996c9196c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fReadPixelTests.js
@@ -0,0 +1,517 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fReadPixelTests');
+goog.require('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuRGBA');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('framework.opengl.gluTextureUtil');
+
+goog.scope(function() {
+ var es3fReadPixelTests = functional.gles3.es3fReadPixelTests;
+ var tcuImageCompare = framework.common.tcuImageCompare;
+ var tcuRGBA = framework.common.tcuRGBA;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var tcuTexture = framework.common.tcuTexture;
+ var tcuTextureUtil = framework.common.tcuTextureUtil;
+ var deString = framework.delibs.debase.deString;
+ var deRandom = framework.delibs.debase.deRandom;
+ var gluTextureUtil = framework.opengl.gluTextureUtil;
+ var gluShaderProgram = framework.opengl.gluShaderProgram;
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} description
+ * @param {boolean} chooseFormat
+ * @param {number} alignment
+ * @param {number} rowLength
+ * @param {number} skipRows
+ * @param {number} skipPixels
+ * @param {number=} format
+ * @param {number=} type
+ */
+ es3fReadPixelTests.ReadPixelsTest = function(name, description, chooseFormat, alignment, rowLength, skipRows, skipPixels, format, type) {
+ tcuTestCase.DeqpTest.call(this, name, description);
+
+ /** @type {number} */ this.m_seed = deString.deStringHash(name);
+ /** @type {boolean} */ this.m_chooseFormat = chooseFormat;
+ /** @type {number} */ this.m_alignment = alignment;
+ /** @type {number} */ this.m_rowLength = rowLength;
+ /** @type {number} */ this.m_skipRows = skipRows;
+ /** @type {number} */ this.m_skipPixels = skipPixels;
+ /** @type {number} */ this.m_format = format !== undefined ? format : gl.RGBA;
+ /** @type {number} */ this.m_type = type !== undefined ? type : gl.UNSIGNED_BYTE;
+
+ /** @const {number} */ this.m_width = 13;
+ /** @const {number} */ this.m_height = 13;
+ };
+
+ es3fReadPixelTests.ReadPixelsTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fReadPixelTests.ReadPixelsTest.prototype.constructor = es3fReadPixelTests.ReadPixelsTest;
+
+ /**
+ * @param {tcuTexture.Texture2D} reference
+ */
+ es3fReadPixelTests.ReadPixelsTest.prototype.render = function(reference) {
+ var refType = /** @type {tcuTexture.ChannelType} */ (reference.getFormat().type);
+ /** @type {number} */ var width = reference.getWidth();
+ /** @type {number} */ var height = reference.getHeight();
+ /** @return {tcuTexture.PixelBufferAccess} */ var level0 = reference.getLevel(0);
+
+ // Create program
+ /** @type {string} */ var vertexSource = '#version 300 es\n' +
+ 'in mediump vec2 i_coord;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ '\tgl_Position = vec4(i_coord, 0.0, 1.0);\n' +
+ '}\n';
+
+ /** @type {string} */ var fragmentSource = '#version 300 es\n';
+
+ if (refType === tcuTexture.ChannelType.SIGNED_INT32)
+ fragmentSource += 'layout(location = 0) out mediump ivec4 o_color;\n';
+ else if (refType === tcuTexture.ChannelType.UNSIGNED_INT32)
+ fragmentSource += 'layout(location = 0) out mediump uvec4 o_color;\n';
+ else
+ fragmentSource += 'layout(location = 0) out mediump vec4 o_color;\n';
+
+ fragmentSource += 'void main (void)\n' +
+ '{\n';
+
+ if (refType === tcuTexture.ChannelType.UNSIGNED_INT32)
+ fragmentSource += '\to_color = uvec4(0, 0, 0, 1000);\n';
+ else if (refType === tcuTexture.ChannelType.SIGNED_INT32)
+ fragmentSource += '\to_color = ivec4(0, 0, 0, 1000);\n';
+ else
+ fragmentSource += '\to_color = vec4(0.0, 0.0, 0.0, 1.0);\n';
+
+ fragmentSource += '}\n';
+
+ /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexSource, fragmentSource));
+
+ assertMsgOptions(program.isOk(), 'Program failed', false, true);
+
+ gl.useProgram(program.getProgram());
+
+ // Render
+ /** @type {Array<number>} */ var coords = [
+ -0.5, -0.5,
+ 0.5, -0.5,
+ 0.5, 0.5,
+
+ 0.5, 0.5,
+ -0.5, 0.5,
+ -0.5, -0.5
+ ];
+ /** @type {number} */ var coordLoc;
+
+ coordLoc = gl.getAttribLocation(program.getProgram(), 'i_coord');
+
+ gl.enableVertexAttribArray(coordLoc);
+
+ /** @type {WebGLBuffer} */ var coordsGLBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, coordsGLBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(coords), gl.STATIC_DRAW);
+ gl.vertexAttribPointer(coordLoc, 2, gl.FLOAT, false, 0, 0);
+
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ gl.disableVertexAttribArray(coordLoc);
+
+ // Render reference
+
+ /** @type {number} */ var coordX1 = Math.floor((-0.5 * width / 2.0) + width / 2.0);
+ /** @type {number} */ var coordY1 = Math.floor((-0.5 * height / 2.0) + height / 2.0);
+ /** @type {number} */ var coordX2 = Math.floor((0.5 * width / 2.0) + width / 2.0);
+ /** @type {number} */ var coordY2 = Math.floor((0.5 * height / 2.0) + height / 2.0);
+
+ for (var x = 0; x < width; x++) {
+ if (x < coordX1 || x > coordX2)
+ continue;
+
+ for (var y = 0; y < height; y++) {
+ if (y >= coordY1 && y <= coordY2) {
+ if (refType === tcuTexture.ChannelType.SIGNED_INT32)
+ level0.setPixelInt([0, 0, 0, 1000], x, y);
+ else if (refType === tcuTexture.ChannelType.UNSIGNED_INT32)
+ level0.setPixelInt([0, 0, 0, 1000], x, y);
+ else
+ level0.setPixel([0.0, 0.0, 0.0, 1.0], x, y);
+ }
+ }
+ }
+ };
+
+ /**
+ * @return {{format: tcuTexture.TextureFormat, pixelSize: number, align: boolean}}
+ */
+ es3fReadPixelTests.ReadPixelsTest.prototype.getFormatInfo = function() {
+ if (this.m_chooseFormat) {
+ this.m_format = /** @type {number} */ (gl.getParameter(gl.IMPLEMENTATION_COLOR_READ_FORMAT));
+ this.m_type = /** @type {number} */ (gl.getParameter(gl.IMPLEMENTATION_COLOR_READ_TYPE));
+ }
+
+ /** @type {tcuTexture.TextureFormat} */ var fmt = gluTextureUtil.mapGLTransferFormat(this.m_format, this.m_type);
+ /** @type {boolean} */ var align_;
+ switch (this.m_type) {
+ case gl.BYTE:
+ case gl.UNSIGNED_BYTE:
+ case gl.SHORT:
+ case gl.UNSIGNED_SHORT:
+ case gl.INT:
+ case gl.UNSIGNED_INT:
+ case gl.FLOAT:
+ case gl.HALF_FLOAT:
+ align_ = true;
+ break;
+
+ case gl.UNSIGNED_SHORT_5_6_5:
+ case gl.UNSIGNED_SHORT_4_4_4_4:
+ case gl.UNSIGNED_SHORT_5_5_5_1:
+ case gl.UNSIGNED_INT_2_10_10_10_REV:
+ case gl.UNSIGNED_INT_10F_11F_11F_REV:
+ case gl.UNSIGNED_INT_24_8:
+ case gl.FLOAT_32_UNSIGNED_INT_24_8_REV:
+ case gl.UNSIGNED_INT_5_9_9_9_REV:
+ align_ = false;
+ break;
+
+ default:
+ throw new Error('Unsupported format');
+ }
+
+ /** @type {number} */ var pxSize = fmt.getPixelSize();
+
+ return {format: fmt, pixelSize: pxSize, align: align_};
+ };
+
+ /**
+ * @param {tcuTexture.Texture2D} reference
+ * @param {boolean} align
+ * @param {number} pixelSize
+ * @return {goog.TypedArray}
+ */
+ es3fReadPixelTests.ReadPixelsTest.prototype.clearColor = function(reference, align, pixelSize) {
+ /** @type {number} */ var width = reference.getWidth();
+ /** @type {number} */ var height = reference.getHeight();
+ /** @return {tcuTexture.PixelBufferAccess} */ var level0 = reference.getLevel(0);
+
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(this.m_seed);
+ /** @type {WebGLFramebuffer} */ var framebuffer;
+ /** @type {WebGLRenderbuffer} */ var renderbuffer;
+ /** @type {number} */ var red;
+ /** @type {number} */ var green;
+ /** @type {number} */ var blue;
+ /** @type {number} */ var alpha;
+ /** @type {Array<number>} */ var color;
+
+ if (this.m_format === gl.RGBA_INTEGER) {
+ if (this.m_type === gl.UNSIGNED_INT) {
+ renderbuffer = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA32UI, this.m_width, this.m_height);
+ } else if (this.m_type === gl.INT) {
+ renderbuffer = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA32I, this.m_width, this.m_height);
+ } else
+ throw new Error('Type not supported');
+
+ gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);
+ framebuffer = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, renderbuffer);
+ } else if (this.m_format === gl.RGBA || /*this.m_format === gl.BGRA ||*/ this.m_format === gl.RGB) {
+ // Empty
+ } else
+ throw new Error('Format not supported');
+
+ gl.viewport(0, 0, width, height);
+
+ // Clear color
+ if (this.m_format === gl.RGBA || this.m_format === gl.RGB) {
+ red = rnd.getFloat();
+ green = rnd.getFloat();
+ blue = rnd.getFloat();
+ alpha = rnd.getFloat();
+
+ color = [red, green, blue, alpha];
+ // Clear target
+ gl.clearColor(red, green, blue, alpha);
+ bufferedLogToConsole('ClearColor: (' + red + ', ' + green + ', ' + blue + ')');
+
+ gl.clearBufferfv(gl.COLOR, 0, color);
+
+ // Clear reference
+ level0.clear(color);
+ } else if (this.m_format === gl.RGBA_INTEGER) {
+ if (this.m_type === gl.INT) {
+ red = Math.abs(rnd.getInt());
+ green = Math.abs(rnd.getInt());
+ blue = Math.abs(rnd.getInt());
+ alpha = Math.abs(rnd.getInt());
+
+ color = [red, green, blue, alpha];
+ bufferedLogToConsole('ClearColor: (' + red + ', ' + green + ', ' + blue + ')');
+
+ gl.clearBufferiv(gl.COLOR, 0, color);
+
+ // Clear reference
+ level0.clear([red, green, blue, alpha]);
+ } else if (this.m_type === gl.UNSIGNED_INT) {
+ red = Math.abs(rnd.getInt());
+ green = Math.abs(rnd.getInt());
+ blue = Math.abs(rnd.getInt());
+ alpha = Math.abs(rnd.getInt());
+
+ color = [red, green, blue, alpha];
+ bufferedLogToConsole('ClearColor: (' + red + ', ' + green + ', ' + blue + ')');
+
+ gl.clearBufferuiv(gl.COLOR, 0, color);
+
+ // Clear reference
+ level0.clear(color);
+ } else
+ throw new Error('Type not supported.');
+ } else
+ throw new Error('Format not supported.');
+
+ this.render(reference);
+
+ /** @type {number} */ var rowWidth = (this.m_rowLength === 0 ? this.m_width : this.m_rowLength) + this.m_skipPixels;
+ /** @type {number} */ var rowPitch = (align ? this.m_alignment * Math.ceil(pixelSize * rowWidth / this.m_alignment) : rowWidth * pixelSize);
+
+ var arrayType = tcuTexture.getTypedArray(reference.getFormat().type);
+ /** @type {goog.TypedArray} */ var pixelData = new arrayType(rowPitch * (this.m_height + this.m_skipRows));
+ gl.readPixels(0, 0, this.m_width, this.m_height, this.m_format, this.m_type, pixelData);
+
+ if (framebuffer)
+ gl.deleteFramebuffer(framebuffer);
+
+ if (renderbuffer)
+ gl.deleteRenderbuffer(renderbuffer);
+
+ return pixelData;
+ };
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fReadPixelTests.ReadPixelsTest.prototype.iterate = function() {
+ /** @type {tcuTexture.TextureFormat} */ var format = new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8);
+ /** @type {number} */ var pixelSize;
+ /** @type {boolean} */ var align;
+
+ /** @type {{format: tcuTexture.TextureFormat, pixelSize: number, align: boolean}} */ var formatInfo = this.getFormatInfo();
+ format = formatInfo.format;
+ align = formatInfo.align;
+ pixelSize = formatInfo.pixelSize;
+
+ bufferedLogToConsole('Format: ' + this.m_format + ', Type: ' + this.m_type);
+
+ /** @type {tcuTexture.Texture2D} */ var reference = new tcuTexture.Texture2D(format, this.m_width, this.m_height);
+ reference.allocLevel(0);
+ /** @return {tcuTexture.PixelBufferAccess} */ var level0 = reference.getLevel(0);
+
+ this.m_alignment = /** @type {number} */ (gl.getParameter(gl.PACK_ALIGNMENT));
+ bufferedLogToConsole('gl.PACK_ALIGNMENT: ' + this.m_alignment);
+
+ this.m_rowLength = /** @type {number} */ (gl.getParameter(gl.PACK_ROW_LENGTH));
+ bufferedLogToConsole('gl.PACK_ROW_LENGTH: ' + this.m_rowLength);
+
+ this.m_skipRows = /** @type {number} */ (gl.getParameter(gl.PACK_SKIP_ROWS));
+ bufferedLogToConsole('gl.PACK_SKIP_ROWS: ' + this.m_skipRows);
+
+ this.m_skipPixels = /** @type {number} */ (gl.getParameter(gl.PACK_SKIP_PIXELS));
+ bufferedLogToConsole('gl.PACK_SKIP_PIXELS: ' + this.m_skipPixels);
+
+ gl.viewport(0, 0, this.m_width, this.m_height);
+
+ /** @type {goog.TypedArray} */ var pixelData = this.clearColor(reference, align, pixelSize);
+
+ /** @type {number} */ var rowWidth = (this.m_rowLength === 0 ? this.m_width : this.m_rowLength);
+ /** @type {number} */ var rowPitch = (align ? this.m_alignment * Math.ceil(pixelSize * rowWidth / this.m_alignment) : rowWidth * pixelSize);
+ /** @type {Array<number>} */ var formatBitDepths = [];
+ /** @type {number} */ var redThreshold;
+ /** @type {number} */ var greenThreshold;
+ /** @type {number} */ var blueThreshold;
+ /** @type {number} */ var alphaThreshold;
+ var redBits = /** @type {number} */ (gl.getParameter(gl.RED_BITS));
+ var blueBits = /** @type {number} */ (gl.getParameter(gl.BLUE_BITS));
+ var greenBits = /** @type {number} */ (gl.getParameter(gl.GREEN_BITS));
+ var alphaBits = /** @type {number} */ (gl.getParameter(gl.ALPHA_BITS));
+ /** @type {(tcuRGBA.RGBA|Array<number>)} */ var threshold;
+ /** @type {tcuTexture.PixelBufferAccess} */ var result;
+ // \note gl.RGBA_INTEGER uses always renderbuffers that are never multisampled. Otherwise default framebuffer is used.
+ if (this.m_format !== gl.RGBA_INTEGER && /** @type {number} */ (gl.getParameter(gl.SAMPLES)) > 1) {
+ formatBitDepths = tcuTextureUtil.getTextureFormatBitDepth(format);
+ redThreshold = Math.ceil(256.0 * (2.0 / (1 << Math.min(redBits, formatBitDepths[0]))));
+ greenThreshold = Math.ceil(256.0 * (2.0 / (1 << Math.min(greenBits, formatBitDepths[1]))));
+ blueThreshold = Math.ceil(256.0 * (2.0 / (1 << Math.min(blueBits, formatBitDepths[2]))));
+ alphaThreshold = Math.ceil(256.0 * (2.0 / (1 << Math.min(alphaBits, formatBitDepths[3]))));
+
+ result = tcuTexture.PixelBufferAccess.newFromTextureFormat(format, this.m_width, this.m_height, 1, rowPitch, 0, pixelData.buffer);
+ threshold = new tcuRGBA.RGBA([redThreshold, greenThreshold, blueThreshold, alphaThreshold]);
+ if (tcuImageCompare.bilinearCompare('Result', 'Result', level0, result, threshold))
+ testPassedOptions('Pass', true);
+ else
+ testFailedOptions('Fail', false);
+ } else {
+ formatBitDepths = tcuTextureUtil.getTextureFormatBitDepth(format);
+ redThreshold = 2.0 / (1 << Math.min(redBits, formatBitDepths[0]));
+ greenThreshold = 2.0 / (1 << Math.min(greenBits, formatBitDepths[1]));
+ blueThreshold = 2.0 / (1 << Math.min(blueBits, formatBitDepths[2]));
+ alphaThreshold = 2.0 / (1 << Math.min(alphaBits, formatBitDepths[3]));
+
+ // Compare
+ result = new tcuTexture.PixelBufferAccess({
+ format: format,
+ width: this.m_width,
+ height: this.m_height,
+ rowPitch: rowPitch,
+ data: pixelData.buffer,
+ offset: pixelSize * this.m_skipPixels + this.m_skipRows * rowPitch
+ });
+
+ threshold = [redThreshold, greenThreshold, blueThreshold, alphaThreshold];
+ if (tcuImageCompare.floatThresholdCompare('Result', 'Result', level0, result, threshold))
+ testPassedOptions('Pass', true);
+ else
+ testFailedOptions('Fail', false);
+ }
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fReadPixelTests.ReadPixelTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'read_pixels', 'ReadPixel tests');
+ };
+
+ es3fReadPixelTests.ReadPixelTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fReadPixelTests.ReadPixelTests.prototype.constructor = es3fReadPixelTests.ReadPixelTests;
+
+ es3fReadPixelTests.ReadPixelTests.prototype.init = function() {
+ /** @type {tcuTestCase.DeqpTest} */ var groupAlignment = tcuTestCase.newTest('alignment', 'Read pixels pack alignment parameter tests');
+
+ groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_1', '', false, 1, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE));
+ groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_2', '', false, 2, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE));
+ groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_4', '', false, 4, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE));
+ groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_8', '', false, 8, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE));
+
+ groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_1', '', false, 1, 0, 0, 0, gl.RGBA_INTEGER, gl.INT));
+ groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_2', '', false, 2, 0, 0, 0, gl.RGBA_INTEGER, gl.INT));
+ groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_4', '', false, 4, 0, 0, 0, gl.RGBA_INTEGER, gl.INT));
+ groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_8', '', false, 8, 0, 0, 0, gl.RGBA_INTEGER, gl.INT));
+
+ groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_1', '', false, 1, 0, 0, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT));
+ groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_2', '', false, 2, 0, 0, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT));
+ groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_4', '', false, 4, 0, 0, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT));
+ groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_8', '', false, 8, 0, 0, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT));
+
+ groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_1', '', true, 1, 0, 0, 0));
+ groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_2', '', true, 2, 0, 0, 0));
+ groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_4', '', true, 4, 0, 0, 0));
+ groupAlignment.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_8', '', true, 8, 0, 0, 0));
+
+ this.addChild(groupAlignment);
+
+ /** @type {tcuTestCase.DeqpTest} */ var groupRowLength = tcuTestCase.newTest('rowlength', 'Read pixels rowlength test');
+ groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_17', '', false, 4, 17, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE));
+ groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_19', '', false, 4, 19, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE));
+ groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_23', '', false, 4, 23, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE));
+ groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_29', '', false, 4, 29, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE));
+
+ groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_17', '', false, 4, 17, 0, 0, gl.RGBA_INTEGER, gl.INT));
+ groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_19', '', false, 4, 19, 0, 0, gl.RGBA_INTEGER, gl.INT));
+ groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_23', '', false, 4, 23, 0, 0, gl.RGBA_INTEGER, gl.INT));
+ groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_29', '', false, 4, 29, 0, 0, gl.RGBA_INTEGER, gl.INT));
+
+ groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_17', '', false, 4, 17, 0, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT));
+ groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_19', '', false, 4, 19, 0, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT));
+ groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_23', '', false, 4, 23, 0, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT));
+ groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_29', '', false, 4, 29, 0, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT));
+
+ groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_17', '', true, 4, 17, 0, 0));
+ groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_19', '', true, 4, 19, 0, 0));
+ groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_23', '', true, 4, 23, 0, 0));
+ groupRowLength.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_29', '', true, 4, 29, 0, 0));
+
+ this.addChild(groupRowLength);
+
+ /** @type {tcuTestCase.DeqpTest} */ var groupSkip = tcuTestCase.newTest('skip', 'Read pixels skip pixels and rows test');
+ groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_0_3', '', false, 4, 17, 0, 3, gl.RGBA, gl.UNSIGNED_BYTE));
+ groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_3_0', '', false, 4, 17, 3, 0, gl.RGBA, gl.UNSIGNED_BYTE));
+ groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_3_3', '', false, 4, 17, 3, 3, gl.RGBA, gl.UNSIGNED_BYTE));
+ groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_ubyte_3_5', '', false, 4, 17, 3, 5, gl.RGBA, gl.UNSIGNED_BYTE));
+
+ groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_0_3', '', false, 4, 17, 0, 3, gl.RGBA_INTEGER, gl.INT));
+ groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_3_0', '', false, 4, 17, 3, 0, gl.RGBA_INTEGER, gl.INT));
+ groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_3_3', '', false, 4, 17, 3, 3, gl.RGBA_INTEGER, gl.INT));
+ groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_int_3_5', '', false, 4, 17, 3, 5, gl.RGBA_INTEGER, gl.INT));
+
+ groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_0_3', '', false, 4, 17, 0, 3, gl.RGBA_INTEGER, gl.UNSIGNED_INT));
+ groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_3_0', '', false, 4, 17, 3, 0, gl.RGBA_INTEGER, gl.UNSIGNED_INT));
+ groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_3_3', '', false, 4, 17, 3, 3, gl.RGBA_INTEGER, gl.UNSIGNED_INT));
+ groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('rgba_uint_3_5', '', false, 4, 17, 3, 5, gl.RGBA_INTEGER, gl.UNSIGNED_INT));
+
+ groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_0_3', '', true, 4, 17, 0, 3));
+ groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_3_0', '', true, 4, 17, 3, 0));
+ groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_3_3', '', true, 4, 17, 3, 3));
+ groupSkip.addChild(new es3fReadPixelTests.ReadPixelsTest('choose_3_5', '', true, 4, 17, 3, 5));
+
+ this.addChild(groupSkip);
+ };
+
+ /**
+ * Run test
+ * @param {WebGL2RenderingContext} context
+ */
+ es3fReadPixelTests.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fReadPixelTests.ReadPixelTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fReadPixelTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fSamplerObjectTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fSamplerObjectTests.js
new file mode 100644
index 0000000000..271a2186ae
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fSamplerObjectTests.js
@@ -0,0 +1,313 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fSamplerObjectTests');
+goog.require('framework.common.tcuTestCase');
+goog.require('modules.shared.glsSamplerObjectTest');
+
+goog.scope(function() {
+
+var es3fSamplerObjectTests = functional.gles3.es3fSamplerObjectTests;
+var tcuTestCase = framework.common.tcuTestCase;
+var glsSamplerObjectTest = modules.shared.glsSamplerObjectTest;
+
+ /** @type {WebGL2RenderingContext} */ var gl;
+
+ // TODO: implement glsSamplerObjectTest and validate constructors
+ es3fSamplerObjectTests.init = function() {
+ var testGroup = tcuTestCase.runner.testCases;
+ /** @type {Array<glsSamplerObjectTest.TestSpec>} */ var simpleTestCases = [
+ new glsSamplerObjectTest.TestSpec('diff_wrap_t', 'Different gl.TEXTURE_WRAP_T', gl.TEXTURE_2D,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.MIRRORED_REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_wrap_s', 'Different gl.TEXTURE_WRAP_S', gl.TEXTURE_2D,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.MIRRORED_REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_wrap_r', 'Different gl.TEXTURE_WRAP_R', gl.TEXTURE_2D,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.MIRRORED_REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_min_filter', 'Different gl.TEXTURE_MIN_FILTER', gl.TEXTURE_2D,
+ new glsSamplerObjectTest.SamplingState(gl.LINEAR, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_mag_filter', 'Different gl.TEXTURE_MAG_FILTER', gl.TEXTURE_2D,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_max_lod', 'Different gl.TEXTURE_MAX_LOD', gl.TEXTURE_2D,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, -999.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_min_lod', 'Different gl.TEXTURE_MIN_LOD', gl.TEXTURE_2D,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 0.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 100.0, 1000.0)
+ )
+ ];
+
+ /** @type {tcuTestCase.DeqpTest} */ var simpleTexture2D = tcuTestCase.newTest('single_tex_2d', 'Simple 2D texture with sampler');
+
+ for (var testNdx = 0; testNdx < simpleTestCases.length; testNdx++)
+ simpleTexture2D.addChild(new glsSamplerObjectTest.TextureSamplerTest(simpleTestCases[testNdx]));
+
+ testGroup.addChild(simpleTexture2D);
+
+ /** @type {Array<glsSamplerObjectTest.TestSpec>} */ var multiTestCases = [
+ new glsSamplerObjectTest.TestSpec('diff_wrap_t', 'Different gl.TEXTURE_WRAP_T', gl.TEXTURE_2D,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.MIRRORED_REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.MIRRORED_REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_wrap_s', 'Different gl.TEXTURE_WRAP_S', gl.TEXTURE_2D,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.MIRRORED_REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.MIRRORED_REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_wrap_r', 'Different gl.TEXTURE_WRAP_R', gl.TEXTURE_2D,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.MIRRORED_REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.MIRRORED_REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_min_filter', 'Different gl.TEXTURE_MIN_FILTER', gl.TEXTURE_2D,
+ new glsSamplerObjectTest.SamplingState(gl.LINEAR, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.LINEAR, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_mag_filter', 'Different gl.TEXTURE_MAG_FILTER', gl.TEXTURE_2D,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_max_lod', 'Different gl.TEXTURE_MAX_LOD', gl.TEXTURE_2D,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, -999.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_min_lod', 'Different gl.TEXTURE_MIN_LOD', gl.TEXTURE_2D,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 0.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 0.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 100.0, 1000.0)
+ )
+ ];
+
+ /** @type {tcuTestCase.DeqpTest} */ var multiTexture2D = tcuTestCase.newTest('multi_tex_2d', 'Multiple texture units 2D texture with sampler');
+
+ for (var testNdx = 0; testNdx < multiTestCases.length; testNdx++)
+ multiTexture2D.addChild(new glsSamplerObjectTest.MultiTextureSamplerTest(multiTestCases[testNdx]));
+
+ testGroup.addChild(multiTexture2D);
+
+ /** @type {Array<glsSamplerObjectTest.TestSpec>} */ var simpleTestCases3D = [
+ new glsSamplerObjectTest.TestSpec('diff_wrap_t', 'Different gl.TEXTURE_WRAP_T', gl.TEXTURE_3D,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.MIRRORED_REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_wrap_s', 'Different gl.TEXTURE_WRAP_S', gl.TEXTURE_3D,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.MIRRORED_REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_wrap_r', 'Different gl.TEXTURE_WRAP_R', gl.TEXTURE_3D,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.MIRRORED_REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_min_filter', 'Different gl.TEXTURE_MIN_FILTER', gl.TEXTURE_3D,
+ new glsSamplerObjectTest.SamplingState(gl.LINEAR, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_mag_filter', 'Different gl.TEXTURE_MAG_FILTER', gl.TEXTURE_3D,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_max_lod', 'Different gl.TEXTURE_MAX_LOD', gl.TEXTURE_3D,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, -999.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_min_lod', 'Different gl.TEXTURE_MIN_LOD', gl.TEXTURE_3D,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 0.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 100.0, 1000.0)
+ )
+ ];
+
+ /** @type {tcuTestCase.DeqpTest} */ var simpleTexture3D = tcuTestCase.newTest('single_tex_3d', 'Simple 3D texture with sampler');
+
+ for (var testNdx = 0; testNdx < simpleTestCases3D.length; testNdx++)
+ simpleTexture3D.addChild(new glsSamplerObjectTest.TextureSamplerTest(simpleTestCases3D[testNdx]));
+
+ testGroup.addChild(simpleTexture3D);
+
+ /** @type {Array<glsSamplerObjectTest.TestSpec>} */ var multiTestCases3D = [
+ new glsSamplerObjectTest.TestSpec('diff_wrap_t', 'Different gl.TEXTURE_WRAP_T', gl.TEXTURE_3D,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.MIRRORED_REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.MIRRORED_REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_wrap_s', 'Different gl.TEXTURE_WRAP_S', gl.TEXTURE_3D,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.MIRRORED_REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.MIRRORED_REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_wrap_r', 'Different gl.TEXTURE_WRAP_R', gl.TEXTURE_3D,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.MIRRORED_REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.MIRRORED_REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_min_filter', 'Different gl.TEXTURE_MIN_FILTER', gl.TEXTURE_3D,
+ new glsSamplerObjectTest.SamplingState(gl.LINEAR, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.LINEAR, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_mag_filter', 'Different gl.TEXTURE_MAG_FILTER', gl.TEXTURE_3D,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_max_lod', 'Different gl.TEXTURE_MAX_LOD', gl.TEXTURE_3D,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, -999.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_min_lod', 'Different gl.TEXTURE_MIN_LOD', gl.TEXTURE_3D,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 0.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 0.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 100.0, 1000.0)
+ )
+ ];
+
+ /** @type {tcuTestCase.DeqpTest} */ var multiTexture3D = tcuTestCase.newTest('multi_tex_3d', 'Multiple texture units 3D texture with sampler');
+
+ for (var testNdx = 0; testNdx < multiTestCases3D.length; testNdx++)
+ multiTexture3D.addChild(new glsSamplerObjectTest.MultiTextureSamplerTest(multiTestCases3D[testNdx]));
+
+ testGroup.addChild(multiTexture3D);
+
+ /** @type {Array<glsSamplerObjectTest.TestSpec>} */ var simpleTestCasesCube = [
+ new glsSamplerObjectTest.TestSpec('diff_wrap_t', 'Different gl.TEXTURE_WRAP_T', gl.TEXTURE_CUBE_MAP,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.MIRRORED_REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_wrap_s', 'Different gl.TEXTURE_WRAP_S', gl.TEXTURE_CUBE_MAP,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.MIRRORED_REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_wrap_r', 'Different gl.TEXTURE_WRAP_R', gl.TEXTURE_CUBE_MAP,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.MIRRORED_REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_min_filter', 'Different gl.TEXTURE_MIN_FILTER', gl.TEXTURE_CUBE_MAP,
+ new glsSamplerObjectTest.SamplingState(gl.LINEAR, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_mag_filter', 'Different gl.TEXTURE_MAG_FILTER', gl.TEXTURE_CUBE_MAP,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_max_lod', 'Different gl.TEXTURE_MAX_LOD', gl.TEXTURE_CUBE_MAP,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, -999.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_min_lod', 'Different gl.TEXTURE_MIN_LOD', gl.TEXTURE_CUBE_MAP,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 0.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 100.0, 1000.0)
+ )
+ ];
+
+ /** @type {tcuTestCase.DeqpTest} */ var simpleTextureCube = tcuTestCase.newTest('single_cubemap', 'Simple cubemap texture with sampler');
+
+ for (var testNdx = 0; testNdx < simpleTestCasesCube.length; testNdx++)
+ simpleTextureCube.addChild(new glsSamplerObjectTest.TextureSamplerTest(simpleTestCasesCube[testNdx]));
+
+ testGroup.addChild(simpleTextureCube);
+
+ /** @type {Array<glsSamplerObjectTest.TestSpec>} */ var multiTestCasesCube = [
+ new glsSamplerObjectTest.TestSpec('diff_wrap_t', 'Different gl.TEXTURE_WRAP_T', gl.TEXTURE_CUBE_MAP,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.MIRRORED_REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.MIRRORED_REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_wrap_s', 'Different gl.TEXTURE_WRAP_S', gl.TEXTURE_CUBE_MAP,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.MIRRORED_REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.MIRRORED_REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_wrap_r', 'Different gl.TEXTURE_WRAP_R', gl.TEXTURE_CUBE_MAP,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.MIRRORED_REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.MIRRORED_REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_min_filter', 'Different gl.TEXTURE_MIN_FILTER', gl.TEXTURE_CUBE_MAP,
+ new glsSamplerObjectTest.SamplingState(gl.LINEAR, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.LINEAR, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_mag_filter', 'Different gl.TEXTURE_MAG_FILTER', gl.TEXTURE_CUBE_MAP,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_max_lod', 'Different gl.TEXTURE_MAX_LOD', gl.TEXTURE_CUBE_MAP,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, -1000.0, -999.0)
+ ),
+ new glsSamplerObjectTest.TestSpec('diff_min_lod', 'Different gl.TEXTURE_MIN_LOD', gl.TEXTURE_CUBE_MAP,
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 0.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 0.0, 1000.0),
+ new glsSamplerObjectTest.SamplingState(gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST, gl.REPEAT, gl.REPEAT, gl.REPEAT, 100.0, 1000.0)
+ )
+ ];
+
+ /** @type {tcuTestCase.DeqpTest} */ var multiTextureCube = tcuTestCase.newTest('multi_cubemap', 'Multiple texture units cubemap textures with sampler');
+
+ for (var testNdx = 0; testNdx < multiTestCasesCube.length; testNdx++)
+ multiTextureCube.addChild(new glsSamplerObjectTest.MultiTextureSamplerTest(multiTestCasesCube[testNdx]));
+
+ testGroup.addChild(multiTextureCube);
+ };
+
+ es3fSamplerObjectTests.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var testName = 'sampler_object';
+ var testDescription = 'Sampler Object Tests';
+ var state = tcuTestCase.runner;
+
+ state.testName = testName;
+ state.setRoot(tcuTestCase.newTest(testName, testDescription, null));
+
+ //Set up name and description of this test series.
+ setCurrentTestName(testName);
+ description(testDescription);
+
+ try {
+ //Create test cases
+ es3fSamplerObjectTests.init();
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fSamplerObjectTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fSamplerStateQueryTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fSamplerStateQueryTests.js
new file mode 100644
index 0000000000..22cfde12aa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fSamplerStateQueryTests.js
@@ -0,0 +1,205 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fSamplerStateQueryTests');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('functional.gles3.es3fApiCase');
+goog.require('modules.shared.glsStateQuery');
+
+goog.scope(function() {
+var es3fSamplerStateQueryTests = functional.gles3.es3fSamplerStateQueryTests;
+var tcuTestCase = framework.common.tcuTestCase;
+var glsStateQuery = modules.shared.glsStateQuery;
+var es3fApiCase = functional.gles3.es3fApiCase;
+var deRandom = framework.delibs.debase.deRandom;
+
+var setParentClass = function(child, parent) {
+ child.prototype = Object.create(parent.prototype);
+ child.prototype.constructor = child;
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fSamplerStateQueryTests.SamplerCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ /** @type {WebGLSampler} */ this.m_sampler;
+};
+
+setParentClass(es3fSamplerStateQueryTests.SamplerCase, es3fApiCase.ApiCase);
+
+es3fSamplerStateQueryTests.SamplerCase.prototype.testSampler = function() {
+ throw new Error('Virtual function. Please override.');
+};
+
+es3fSamplerStateQueryTests.SamplerCase.prototype.test = function() {
+ this.m_sampler = gl.createSampler();
+
+ this.testSampler();
+
+ gl.deleteSampler(this.m_sampler);
+};
+
+/**
+ * @constructor
+ * @extends {es3fSamplerStateQueryTests.SamplerCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} valueName
+ * @param {number} initialValue
+ * @param {Array<number>} valueRange
+ */
+es3fSamplerStateQueryTests.SamplerModeCase = function(name, description, valueName, initialValue, valueRange) {
+ es3fSamplerStateQueryTests.SamplerCase.call(this, name, description);
+ this.m_valueName = valueName;
+ this.m_initialValue = initialValue;
+ this.m_valueRange = valueRange;
+};
+
+setParentClass(es3fSamplerStateQueryTests.SamplerModeCase, es3fSamplerStateQueryTests.SamplerCase);
+
+es3fSamplerStateQueryTests.SamplerModeCase.prototype.testSampler = function() {
+ this.check(glsStateQuery.verifySampler(this.m_sampler, this.m_valueName, this.m_initialValue));
+
+ for (var ndx = 0; ndx < this.m_valueRange.length; ++ndx) {
+ gl.samplerParameteri(this.m_sampler, this.m_valueName, this.m_valueRange[ndx]);
+
+ this.check(glsStateQuery.verifySampler(this.m_sampler, this.m_valueName, this.m_valueRange[ndx]));
+ }
+
+ //check unit conversions with float
+
+ for (var ndx = 0; ndx < this.m_valueRange.length; ++ndx) {
+ gl.samplerParameterf(this.m_sampler, this.m_valueName, this.m_valueRange[ndx]);
+
+ this.check(glsStateQuery.verifySampler(this.m_sampler, this.m_valueName, this.m_valueRange[ndx]));
+ }
+};
+
+/**
+ * @constructor
+ * @extends {es3fSamplerStateQueryTests.SamplerCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} lodTarget
+ * @param {number} initialValue
+ */
+es3fSamplerStateQueryTests.SamplerLODCase = function(name, description, lodTarget, initialValue) {
+ es3fSamplerStateQueryTests.SamplerCase.call(this, name, description);
+ this.m_lodTarget = lodTarget;
+ this.m_initialValue = initialValue;
+};
+
+setParentClass(es3fSamplerStateQueryTests.SamplerLODCase, es3fSamplerStateQueryTests.SamplerCase);
+
+es3fSamplerStateQueryTests.SamplerLODCase.prototype.testSampler = function() {
+ var rnd = new deRandom.Random(0xabcdef);
+
+ this.check(glsStateQuery.verifySampler(this.m_sampler, this.m_lodTarget, this.m_initialValue));
+ var numIterations = 60;
+ for (var ndx = 0; ndx < numIterations; ++ndx) {
+ var ref = rnd.getFloat(-64000, 64000);
+
+ gl.samplerParameterf(this.m_sampler, this.m_lodTarget, ref);
+
+ this.check(glsStateQuery.verifySampler(this.m_sampler, this.m_lodTarget, ref));
+ }
+
+ // check unit conversions with int
+
+ for (var ndx = 0; ndx < numIterations; ++ndx) {
+ var ref = rnd.getInt(-64000, 64000);
+
+ gl.samplerParameteri(this.m_sampler, this.m_lodTarget, ref);
+
+ this.check(glsStateQuery.verifySampler(this.m_sampler, this.m_lodTarget, ref));
+ }
+};
+
+/**
+* @constructor
+* @extends {tcuTestCase.DeqpTest}
+*/
+es3fSamplerStateQueryTests.SamplerStateQueryTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'sampler', 'Sampler State Query tests');
+};
+
+es3fSamplerStateQueryTests.SamplerStateQueryTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+es3fSamplerStateQueryTests.SamplerStateQueryTests.prototype.constructor = es3fSamplerStateQueryTests.SamplerStateQueryTests;
+
+es3fSamplerStateQueryTests.SamplerStateQueryTests.prototype.init = function() {
+ var wrapValues = [gl.CLAMP_TO_EDGE, gl.REPEAT, gl.MIRRORED_REPEAT];
+ this.addChild(new es3fSamplerStateQueryTests.SamplerModeCase('sampler_texture_wrap_s' , 'TEXTURE_WRAP_S',
+ gl.TEXTURE_WRAP_S, gl.REPEAT, wrapValues));
+ this.addChild(new es3fSamplerStateQueryTests.SamplerModeCase('sampler_texture_wrap_t' , 'TEXTURE_WRAP_T',
+ gl.TEXTURE_WRAP_T, gl.REPEAT, wrapValues));
+ this.addChild(new es3fSamplerStateQueryTests.SamplerModeCase('sampler_texture_wrap_r' , 'TEXTURE_WRAP_R',
+ gl.TEXTURE_WRAP_R, gl.REPEAT, wrapValues));
+
+ var magValues = [gl.NEAREST, gl.LINEAR];
+ this.addChild(new es3fSamplerStateQueryTests.SamplerModeCase('sampler_texture_mag_filter' , 'TEXTURE_MAG_FILTER',
+ gl.TEXTURE_MAG_FILTER, gl.LINEAR, magValues));
+
+ var minValues = [gl.NEAREST, gl.LINEAR, gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST_MIPMAP_LINEAR, gl.LINEAR_MIPMAP_NEAREST, gl.LINEAR_MIPMAP_LINEAR];
+ this.addChild(new es3fSamplerStateQueryTests.SamplerModeCase('sampler_texture_min_filter' , 'TEXTURE_MIN_FILTER',
+ gl.TEXTURE_MIN_FILTER, gl.NEAREST_MIPMAP_LINEAR, minValues));
+
+ this.addChild(new es3fSamplerStateQueryTests.SamplerLODCase('sampler_texture_min_lod' , 'TEXTURE_MIN_LOD', gl.TEXTURE_MIN_LOD, -1000));
+ this.addChild(new es3fSamplerStateQueryTests.SamplerLODCase('sampler_texture_max_lod' , 'TEXTURE_MAX_LOD', gl.TEXTURE_MAX_LOD, 1000));
+
+ var modes = [gl.COMPARE_REF_TO_TEXTURE, gl.NONE];
+ this.addChild(new es3fSamplerStateQueryTests.SamplerModeCase('sampler_texture_compare_mode' , 'TEXTURE_COMPARE_MODE',
+ gl.TEXTURE_COMPARE_MODE, gl.NONE, modes));
+
+ var compareFuncs = [gl.LEQUAL, gl.GEQUAL, gl.LESS, gl.GREATER, gl.EQUAL, gl.NOTEQUAL, gl.ALWAYS, gl.NEVER];
+ this.addChild(new es3fSamplerStateQueryTests.SamplerModeCase('sampler_texture_compare_func' , 'TEXTURE_COMPARE_FUNC',
+ gl.TEXTURE_COMPARE_FUNC, gl.LEQUAL, compareFuncs));
+};
+
+/**
+* Run test
+* @param {WebGL2RenderingContext} context
+*/
+es3fSamplerStateQueryTests.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fSamplerStateQueryTests.SamplerStateQueryTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fSamplerStateQueryTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderApiTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderApiTests.js
new file mode 100644
index 0000000000..2768f0325b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderApiTests.js
@@ -0,0 +1,650 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fShaderApiTests');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('functional.gles3.es3fApiCase');
+
+goog.scope(function() {
+var es3fShaderApiTests = functional.gles3.es3fShaderApiTests;
+var tcuTestCase = framework.common.tcuTestCase;
+var es3fApiCase = functional.gles3.es3fApiCase;
+var gluShaderProgram = framework.opengl.gluShaderProgram;
+var deRandom = framework.delibs.debase.deRandom;
+var deString = framework.delibs.debase.deString;
+
+/** @type {WebGL2RenderingContext} */ var gl;
+
+var setParentClass = function(child, parent) {
+ child.prototype = Object.create(parent.prototype);
+ child.prototype.constructor = child;
+};
+
+var getSimpleShaderSource = function(shaderType) {
+ var simpleVertexShaderSource =
+ '#version 300 es\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = vec4(0.0);\n' +
+ '}\n';
+
+ var simpleFragmentShaderSource =
+ '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 o_fragColor;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' o_fragColor = vec4(0.0);\n' +
+ '}\n';
+
+ switch (shaderType) {
+ case gluShaderProgram.shaderType.VERTEX:
+ return simpleVertexShaderSource;
+ case gluShaderProgram.shaderType.FRAGMENT:
+ return simpleFragmentShaderSource;
+ default:
+ throw new Error('Invalid shader type');
+ }
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+es3fShaderApiTests.CreateShaderCase = function(name, description, shaderType) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ this.m_shaderType = shaderType;
+};
+
+setParentClass(es3fShaderApiTests.CreateShaderCase, es3fApiCase.ApiCase);
+
+es3fShaderApiTests.CreateShaderCase.prototype.test = function() {
+ var shaderObject = gl.createShader(gluShaderProgram.getGLShaderType(gl, this.m_shaderType));
+ this.check(shaderObject != null);
+ gl.deleteShader(shaderObject);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+es3fShaderApiTests.CompileShaderCase = function(name, description, shaderType) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ this.m_shaderType = shaderType;
+};
+
+setParentClass(es3fShaderApiTests.CompileShaderCase, es3fApiCase.ApiCase);
+
+es3fShaderApiTests.CompileShaderCase.prototype.checkCompileStatus = function(shader) {
+ var status = /** @type {boolean} */ (gl.getShaderParameter(shader, gl.COMPILE_STATUS));
+ return status;
+};
+
+es3fShaderApiTests.CompileShaderCase.prototype.test = function() {
+ var shaderObject = gl.createShader(gluShaderProgram.getGLShaderType(gl, this.m_shaderType));
+ var shaderSource = getSimpleShaderSource(this.m_shaderType);
+
+ this.check(shaderObject != null);
+
+ gl.shaderSource(shaderObject, shaderSource);
+ gl.compileShader(shaderObject);
+
+ this.check(this.checkCompileStatus(shaderObject));
+
+ gl.deleteShader(shaderObject);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+es3fShaderApiTests.ShaderSourceReplaceCase = function(name, description, shaderType) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ this.m_shaderType = shaderType;
+};
+
+setParentClass(es3fShaderApiTests.ShaderSourceReplaceCase, es3fApiCase.ApiCase);
+
+es3fShaderApiTests.ShaderSourceReplaceCase.prototype.generateFirstSource = function() {
+ return getSimpleShaderSource(this.m_shaderType);
+};
+
+es3fShaderApiTests.ShaderSourceReplaceCase.prototype.generateSecondSource = function() {
+ var source = '#version 300 es\n' +
+ 'precision mediump float;\n';
+
+ if (this.m_shaderType == gluShaderProgram.shaderType.FRAGMENT)
+ source += 'layout(location = 0) out mediump vec4 o_fragColor;\n';
+
+ source += 'void main()\n'+
+ '{\n'+
+ ' float variable = 1.0f;\n';
+
+ if (this.m_shaderType == gluShaderProgram.shaderType.VERTEX) source += ' gl_Position = vec4(variable);\n';
+ else if (this.m_shaderType == gluShaderProgram.shaderType.FRAGMENT) source += ' o_fragColor = vec4(variable);\n';
+
+ source += '}\n';
+
+ return source;
+};
+
+es3fShaderApiTests.ShaderSourceReplaceCase.prototype.test = function() {
+ var shaderObject = gl.createShader(gluShaderProgram.getGLShaderType(gl, this.m_shaderType));
+ var firstSource = this.generateFirstSource();
+ var secondSource = this.generateSecondSource();
+
+ this.check(shaderObject != null);
+
+ gl.shaderSource(shaderObject, firstSource);
+ this.check(firstSource == gl.getShaderSource(shaderObject));
+
+ gl.shaderSource(shaderObject, secondSource);
+ this.check(secondSource == gl.getShaderSource(shaderObject));
+
+ gl.deleteShader(shaderObject);
+};
+
+/**
+ * @constructor
+ */
+es3fShaderApiTests.SourceGenerator = function() {};
+
+/**
+ * @param {gluShaderProgram.shaderType} shaderType
+ * @return {string}
+ */
+es3fShaderApiTests.SourceGenerator.prototype.next = function(shaderType) {
+ throw new Error('Virtual function. Please override');
+};
+
+/**
+ * @param {gluShaderProgram.shaderType} shaderType
+ * @return {boolean}
+ */
+es3fShaderApiTests.SourceGenerator.prototype.finished = function(shaderType) {
+ throw new Error('Virtual function. Please override');
+};
+
+/**
+ * @constructor
+ * @extends {es3fShaderApiTests.SourceGenerator}
+ */
+es3fShaderApiTests.ConstantShaderGenerator = function(rnd) {
+ es3fShaderApiTests.SourceGenerator.call(this);
+ this.m_rnd = rnd;
+};
+
+setParentClass(es3fShaderApiTests.ConstantShaderGenerator, es3fShaderApiTests.SourceGenerator);
+
+es3fShaderApiTests.SourceGenerator.prototype.next = function(shaderType) {
+ var value = this.m_rnd.getFloat(0.0, 1.0);
+ var outputName = (shaderType == gluShaderProgram.shaderType.VERTEX) ? 'gl_Position' : 'o_fragColor';
+
+ var out = '#version 300 es\n';
+
+ if (shaderType == gluShaderProgram.shaderType.FRAGMENT)
+ out += 'layout(location = 0) out mediump vec4 o_fragColor;\n';
+
+ out += 'void main (void)\n';
+ out += '{\n';
+ out += ' ' + outputName + ' = vec4(' + value + ');\n';
+ out += '}\n';
+
+ return out;
+};
+
+es3fShaderApiTests.SourceGenerator.prototype.finished = function(shaderType) {
+ return false;
+};
+
+// Shader allocation utility
+
+/**
+ * @constructor
+ * @param {es3fShaderApiTests.SourceGenerator} generator
+ */
+es3fShaderApiTests.ShaderAllocator = function(generator) {
+ this.m_srcGen = generator;
+ this.m_shaders = {};
+};
+
+/**
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+es3fShaderApiTests.ShaderAllocator.prototype.createShader = function(shaderType) {
+ var shader = new gluShaderProgram.Shader(gl, shaderType);
+ this.m_shaders[shaderType] = shader;
+ this.setSource(shaderType);
+ return shader;
+};
+
+/**
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+es3fShaderApiTests.ShaderAllocator.prototype.deleteShader = function(shaderType) {
+ this.m_shaders[shaderType].destroy();
+ this.m_shaders[shaderType] = null;
+};
+
+/**
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+es3fShaderApiTests.ShaderAllocator.prototype.setSource = function(shaderType) {
+ var source = this.m_srcGen.next(shaderType);
+ this.m_shaders[shaderType].setSources(source);
+};
+
+/**
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+es3fShaderApiTests.ShaderAllocator.prototype.get = function(shaderType) {
+ return this.m_shaders[shaderType];
+};
+
+// Base class for simple program API tests
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderApiTests.SimpleProgramCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ this.m_vertShader = null;
+ this.m_fragShader = null;
+ this.m_program = null;
+};
+
+setParentClass(es3fShaderApiTests.SimpleProgramCase, es3fApiCase.ApiCase);
+
+es3fShaderApiTests.SimpleProgramCase.prototype.compileShaders = function() {
+ var vertSource = getSimpleShaderSource(gluShaderProgram.shaderType.VERTEX);
+ var fragSource = getSimpleShaderSource(gluShaderProgram.shaderType.FRAGMENT);
+
+ var vertShader = gl.createShader(gl.VERTEX_SHADER);
+ var fragShader = gl.createShader(gl.FRAGMENT_SHADER);
+
+ this.check(vertShader != null);
+ this.check(fragShader != null);
+
+ gl.shaderSource(vertShader, vertSource);
+ gl.compileShader(vertShader);
+
+ gl.shaderSource(fragShader, fragSource);
+ gl.compileShader(fragShader);
+
+ this.m_vertShader = vertShader;
+ this.m_fragShader = fragShader;
+};
+
+es3fShaderApiTests.SimpleProgramCase.prototype.linkProgram = function() {
+ var program = gl.createProgram();
+
+ this.check(program != null);
+
+ gl.attachShader(program, this.m_vertShader);
+ gl.attachShader(program, this.m_fragShader);
+
+ gl.linkProgram(program);
+
+ this.m_program = program;
+};
+
+es3fShaderApiTests.SimpleProgramCase.prototype.cleanup = function() {
+ gl.deleteShader(this.m_vertShader);
+ gl.deleteShader(this.m_fragShader);
+ gl.deleteProgram(this.m_program);
+};
+
+/**
+ * @constructor
+ * @extends {es3fShaderApiTests.SimpleProgramCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderApiTests.DeleteShaderCase = function(name, description) {
+ es3fShaderApiTests.SimpleProgramCase.call(this, name, description);
+};
+
+setParentClass(es3fShaderApiTests.DeleteShaderCase, es3fShaderApiTests.SimpleProgramCase);
+
+es3fShaderApiTests.DeleteShaderCase.prototype.checkDeleteStatus = function(shader) {
+ var status = /** @type {boolean} */ (gl.getShaderParameter(shader, gl.DELETE_STATUS));
+ return status;
+};
+
+es3fShaderApiTests.DeleteShaderCase.prototype.deleteShaders = function() {
+ gl.deleteShader(this.m_vertShader);
+ gl.deleteShader(this.m_fragShader);
+};
+
+es3fShaderApiTests.DeleteShaderCase.prototype.test = function() {
+ this.compileShaders();
+ this.linkProgram();
+
+ this.deleteShaders();
+
+ this.check(this.checkDeleteStatus(this.m_vertShader) && this.checkDeleteStatus(this.m_fragShader));
+
+ gl.deleteProgram(this.m_program);
+
+ this.check(!(gl.isShader(this.m_vertShader) || gl.isShader(this.m_fragShader)));
+};
+
+/**
+ * @constructor
+ * @extends {es3fShaderApiTests.SimpleProgramCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderApiTests.LinkVertexFragmentCase = function(name, description) {
+ es3fShaderApiTests.SimpleProgramCase.call(this, name, description);
+};
+
+setParentClass(es3fShaderApiTests.LinkVertexFragmentCase, es3fShaderApiTests.SimpleProgramCase);
+
+es3fShaderApiTests.LinkVertexFragmentCase.prototype.checkLinkStatus = function(program) {
+ var status = /** @type {boolean} */ (gl.getProgramParameter(program, gl.LINK_STATUS));
+ return status;
+};
+
+es3fShaderApiTests.LinkVertexFragmentCase.prototype.test = function() {
+ this.compileShaders();
+ this.linkProgram();
+
+ this.check(this.checkLinkStatus(this.m_program), 'Fail, expected LINK_STATUS to be TRUE.');
+
+ this.cleanup();
+};
+
+// Base class for program state persistence cases
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+es3fShaderApiTests.ProgramStateCase = function(name, description, shaderType) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ this.m_shaderType = shaderType;
+ this.m_rnd = new deRandom.Random(deString.deStringHash(name) ^ 0x713de0ca);
+};
+
+setParentClass(es3fShaderApiTests.ProgramStateCase, es3fApiCase.ApiCase);
+
+/**
+ * @param {gluShaderProgram.Program} program
+ * @param {es3fShaderApiTests.ShaderAllocator} shaders
+ */
+es3fShaderApiTests.ProgramStateCase.prototype.buildProgram = function(program, shaders) {
+ var vertShader = shaders.createShader(gluShaderProgram.shaderType.VERTEX);
+ var fragShader = shaders.createShader(gluShaderProgram.shaderType.FRAGMENT);
+
+ vertShader.compile();
+ fragShader.compile();
+
+ program.attachShader(vertShader.getShader());
+ program.attachShader(fragShader.getShader());
+ program.link();
+};
+
+/**
+ * @param {gluShaderProgram.Program} program
+ * @param {gluShaderProgram.ProgramInfo} reference
+ */
+es3fShaderApiTests.ProgramStateCase.prototype.verify = function(program, reference) {
+ var programInfo = program.getInfo();
+ this.check(programInfo.linkOk, 'Fail, link status may only change as a result of linking');
+
+ this.check(programInfo.linkTimeUs == reference.linkTimeUs, 'Fail, reported link time changed.');
+
+ this.check(programInfo.infoLog == reference.infoLog, 'Fail, program infolog changed.');
+};
+
+es3fShaderApiTests.ProgramStateCase.prototype.test = function() {
+ var sourceGen = new es3fShaderApiTests.ConstantShaderGenerator(this.m_rnd);
+
+ var shaders = new es3fShaderApiTests.ShaderAllocator(sourceGen);
+ var program = new gluShaderProgram.Program(gl);
+
+ this.buildProgram(program, shaders);
+
+ if (program.getLinkStatus()) {
+ var programInfo = program.getInfo();
+
+ this.executeForProgram(program, shaders);
+
+ this.verify(program, programInfo);
+
+ } else{
+ this.check(false, "Fail, couldn't link program.");
+ }
+
+};
+
+/**
+ * @constructor
+ * @extends {es3fShaderApiTests.ProgramStateCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+es3fShaderApiTests.ProgramStateDetachShaderCase = function(name, description, shaderType) {
+ es3fShaderApiTests.ProgramStateCase.call(this, name, description, shaderType);
+};
+
+setParentClass(es3fShaderApiTests.ProgramStateDetachShaderCase, es3fShaderApiTests.ProgramStateCase);
+
+es3fShaderApiTests.ProgramStateDetachShaderCase.prototype.executeForProgram = function(program, shaders) {
+ var caseShader = shaders.get(this.m_shaderType);
+ program.detachShader(caseShader.getShader());
+};
+
+/**
+ * @constructor
+ * @extends {es3fShaderApiTests.ProgramStateCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+es3fShaderApiTests.ProgramStateReattachShaderCase = function(name, description, shaderType) {
+ es3fShaderApiTests.ProgramStateCase.call(this, name, description, shaderType);
+};
+
+setParentClass(es3fShaderApiTests.ProgramStateReattachShaderCase, es3fShaderApiTests.ProgramStateCase);
+
+es3fShaderApiTests.ProgramStateReattachShaderCase.prototype.executeForProgram = function(program, shaders) {
+ var caseShader = shaders.get(this.m_shaderType);
+ program.detachShader(caseShader.getShader());
+ program.attachShader(caseShader.getShader());
+};
+
+/**
+ * @constructor
+ * @extends {es3fShaderApiTests.ProgramStateCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+es3fShaderApiTests.ProgramStateDeleteShaderCase = function(name, description, shaderType) {
+ es3fShaderApiTests.ProgramStateCase.call(this, name, description, shaderType);
+};
+
+setParentClass(es3fShaderApiTests.ProgramStateDeleteShaderCase, es3fShaderApiTests.ProgramStateCase);
+
+es3fShaderApiTests.ProgramStateDeleteShaderCase.prototype.executeForProgram = function(program, shaders) {
+ var caseShader = shaders.get(this.m_shaderType);
+ program.detachShader(caseShader.getShader());
+ shaders.deleteShader(this.m_shaderType);
+};
+
+/**
+ * @constructor
+ * @extends {es3fShaderApiTests.ProgramStateCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+es3fShaderApiTests.ProgramStateReplaceShaderCase = function(name, description, shaderType) {
+ es3fShaderApiTests.ProgramStateCase.call(this, name, description, shaderType);
+};
+
+setParentClass(es3fShaderApiTests.ProgramStateReplaceShaderCase, es3fShaderApiTests.ProgramStateCase);
+
+es3fShaderApiTests.ProgramStateReplaceShaderCase.prototype.executeForProgram = function(program, shaders) {
+ var caseShader = shaders.get(this.m_shaderType);
+ program.detachShader(caseShader.getShader());
+ shaders.deleteShader(this.m_shaderType);
+ program.attachShader(shaders.createShader(this.m_shaderType).getShader());
+};
+
+/**
+ * @constructor
+ * @extends {es3fShaderApiTests.ProgramStateCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+es3fShaderApiTests.ProgramStateRecompileShaderCase = function(name, description, shaderType) {
+ es3fShaderApiTests.ProgramStateCase.call(this, name, description, shaderType);
+};
+
+setParentClass(es3fShaderApiTests.ProgramStateRecompileShaderCase, es3fShaderApiTests.ProgramStateCase);
+
+es3fShaderApiTests.ProgramStateRecompileShaderCase.prototype.executeForProgram = function(program, shaders) {
+ var caseShader = shaders.get(this.m_shaderType);
+ caseShader.compile();
+};
+
+/**
+ * @constructor
+ * @extends {es3fShaderApiTests.ProgramStateCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+es3fShaderApiTests.ProgramStateReplaceSourceCase = function(name, description, shaderType) {
+ es3fShaderApiTests.ProgramStateCase.call(this, name, description, shaderType);
+};
+
+setParentClass(es3fShaderApiTests.ProgramStateReplaceSourceCase, es3fShaderApiTests.ProgramStateCase);
+
+es3fShaderApiTests.ProgramStateReplaceSourceCase.prototype.executeForProgram = function(program, shaders) {
+ var caseShader = shaders.get(this.m_shaderType);
+ shaders.setSource(this.m_shaderType);
+ caseShader.compile();
+};
+
+/**
+* @constructor
+* @extends {tcuTestCase.DeqpTest}
+*/
+es3fShaderApiTests.ShaderApiTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'shader_api', 'Shader API Cases');
+};
+
+es3fShaderApiTests.ShaderApiTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+es3fShaderApiTests.ShaderApiTests.prototype.constructor = es3fShaderApiTests.ShaderApiTests;
+
+es3fShaderApiTests.ShaderApiTests.prototype.init = function() {
+ // create and delete shaders
+ var createDeleteGroup = new tcuTestCase.DeqpTest('create_delete', 'glCreateShader() tests');
+ this.addChild(createDeleteGroup);
+
+ createDeleteGroup.addChild(new es3fShaderApiTests.CreateShaderCase('create_vertex_shader', 'Create vertex shader object', gluShaderProgram.shaderType.VERTEX));
+ createDeleteGroup.addChild(new es3fShaderApiTests.CreateShaderCase('create_fragment_shader', 'Create fragment shader object', gluShaderProgram.shaderType.FRAGMENT));
+
+ createDeleteGroup.addChild(new es3fShaderApiTests.DeleteShaderCase('delete_vertex_fragment', 'Delete vertex shader and fragment shader'));
+
+ // compile and link
+ var compileLinkGroup = new tcuTestCase.DeqpTest('compile_link', 'Compile and link tests');
+ this.addChild(compileLinkGroup);
+
+ compileLinkGroup.addChild(new es3fShaderApiTests.CompileShaderCase('compile_vertex_shader', 'Compile vertex shader', gluShaderProgram.shaderType.VERTEX));
+ compileLinkGroup.addChild(new es3fShaderApiTests.CompileShaderCase('compile_fragment_shader', 'Compile fragment shader', gluShaderProgram.shaderType.FRAGMENT));
+
+ compileLinkGroup.addChild(new es3fShaderApiTests.LinkVertexFragmentCase('link_vertex_fragment', 'Link vertex and fragment shaders'));
+
+ // shader source
+ var shaderSourceGroup = new tcuTestCase.DeqpTest('shader_source', 'glShaderSource() tests');
+ this.addChild(shaderSourceGroup);
+ shaderSourceGroup.addChild(new es3fShaderApiTests.ShaderSourceReplaceCase('replace_source_vertex', 'Replace source code of vertex shader', gluShaderProgram.shaderType.VERTEX));
+ shaderSourceGroup.addChild(new es3fShaderApiTests.ShaderSourceReplaceCase('replace_source_fragment', 'Replace source code of fragment shader', gluShaderProgram.shaderType.FRAGMENT));
+
+ // link status and infolog
+ var linkStatusGroup = new tcuTestCase.DeqpTest('program_state', 'Program state persistence tests');
+ this.addChild(linkStatusGroup);
+
+ linkStatusGroup.addChild(new es3fShaderApiTests.ProgramStateDetachShaderCase('detach_shader_vertex', 'detach vertex shader', gluShaderProgram.shaderType.VERTEX));
+ linkStatusGroup.addChild(new es3fShaderApiTests.ProgramStateReattachShaderCase('reattach_shader_vertex', 'reattach vertex shader', gluShaderProgram.shaderType.VERTEX));
+ linkStatusGroup.addChild(new es3fShaderApiTests.ProgramStateDeleteShaderCase('delete_shader_vertex', 'delete vertex shader', gluShaderProgram.shaderType.VERTEX));
+ linkStatusGroup.addChild(new es3fShaderApiTests.ProgramStateReplaceShaderCase('replace_shader_vertex', 'replace vertex shader object', gluShaderProgram.shaderType.VERTEX));
+ linkStatusGroup.addChild(new es3fShaderApiTests.ProgramStateRecompileShaderCase('recompile_shader_vertex', 'recompile vertex shader', gluShaderProgram.shaderType.VERTEX));
+ linkStatusGroup.addChild(new es3fShaderApiTests.ProgramStateReplaceSourceCase('replace_source_vertex', 'replace vertex shader source', gluShaderProgram.shaderType.VERTEX));
+
+ linkStatusGroup.addChild(new es3fShaderApiTests.ProgramStateDetachShaderCase('detach_shader_fragment', 'detach fragment shader', gluShaderProgram.shaderType.FRAGMENT));
+ linkStatusGroup.addChild(new es3fShaderApiTests.ProgramStateReattachShaderCase('reattach_shader_fragment', 'reattach fragment shader', gluShaderProgram.shaderType.FRAGMENT));
+ linkStatusGroup.addChild(new es3fShaderApiTests.ProgramStateDeleteShaderCase('delete_shader_fragment', 'delete fragment shader', gluShaderProgram.shaderType.FRAGMENT));
+ linkStatusGroup.addChild(new es3fShaderApiTests.ProgramStateReplaceShaderCase('replace_shader_fragment', 'replace fragment shader object', gluShaderProgram.shaderType.FRAGMENT));
+ linkStatusGroup.addChild(new es3fShaderApiTests.ProgramStateRecompileShaderCase('recompile_shader_fragment', 'recompile fragment shader', gluShaderProgram.shaderType.FRAGMENT));
+ linkStatusGroup.addChild(new es3fShaderApiTests.ProgramStateReplaceSourceCase('replace_source_fragment', 'replace fragment shader source', gluShaderProgram.shaderType.FRAGMENT));
+
+};
+
+/**
+* Run test
+* @param {WebGL2RenderingContext} context
+*/
+es3fShaderApiTests.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fShaderApiTests.ShaderApiTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fShaderApiTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderBuiltinVarTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderBuiltinVarTests.js
new file mode 100644
index 0000000000..c696c6c12e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderBuiltinVarTests.js
@@ -0,0 +1,1109 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fShaderBuiltinVarTests');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuLogImage');
+goog.require('framework.common.tcuPixelFormat');
+goog.require('framework.common.tcuRGBA');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.opengl.gluDrawUtil');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluVarType');
+goog.require('framework.opengl.simplereference.sglrReferenceContext');
+goog.require('framework.opengl.simplereference.sglrShaderProgram');
+goog.require('framework.referencerenderer.rrFragmentOperations');
+goog.require('framework.referencerenderer.rrGenericVector');
+goog.require('framework.referencerenderer.rrMultisamplePixelBufferAccess');
+goog.require('framework.referencerenderer.rrRenderer');
+goog.require('framework.referencerenderer.rrRenderState');
+goog.require('framework.referencerenderer.rrShadingContext');
+goog.require('framework.referencerenderer.rrVertexAttrib');
+goog.require('framework.referencerenderer.rrVertexPacket');
+goog.require('modules.shared.glsShaderRenderCase');
+goog.require('modules.shared.glsShaderExecUtil');
+
+goog.scope(function() {
+ var es3fShaderBuiltinVarTests = functional.gles3.es3fShaderBuiltinVarTests;
+ var deMath = framework.delibs.debase.deMath;
+ var deString = framework.delibs.debase.deString;
+ var deRandom = framework.delibs.debase.deRandom;
+ var glsShaderExecUtil = modules.shared.glsShaderExecUtil;
+ var glsShaderRenderCase = modules.shared.glsShaderRenderCase;
+ var gluShaderProgram = framework.opengl.gluShaderProgram;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var gluDrawUtil = framework.opengl.gluDrawUtil;
+ var gluVarType = framework.opengl.gluVarType;
+ var tcuPixelFormat = framework.common.tcuPixelFormat;
+ var tcuSurface = framework.common.tcuSurface;
+ var tcuTexture = framework.common.tcuTexture;
+ var tcuLogImage = framework.common.tcuLogImage;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var tcuImageCompare = framework.common.tcuImageCompare;
+ var tcuRGBA = framework.common.tcuRGBA;
+ var rrGenericVector = framework.referencerenderer.rrGenericVector;
+ var rrFragmentOperations = framework.referencerenderer.rrFragmentOperations;
+ var rrMultisamplePixelBufferAccess = framework.referencerenderer.rrMultisamplePixelBufferAccess;
+ var rrRenderer = framework.referencerenderer.rrRenderer;
+ var rrRenderState = framework.referencerenderer.rrRenderState;
+ var rrShadingContext = framework.referencerenderer.rrShadingContext;
+ var rrVertexAttrib = framework.referencerenderer.rrVertexAttrib;
+ var rrVertexPacket = framework.referencerenderer.rrVertexPacket;
+ var sglrShaderProgram = framework.opengl.simplereference.sglrShaderProgram;
+ var sglrReferenceContext = framework.opengl.simplereference.sglrReferenceContext;
+
+ /** @typedef {function():number} */ es3fShaderBuiltinVarTests.GetConstantValueFunc;
+
+ /**
+ * @param {number} pname
+ * @return {number} getParameter returns values of any kind
+ */
+ es3fShaderBuiltinVarTests.getInteger = function(pname) {
+ return /** @type {number} */ (gl.getParameter(pname));
+ };
+
+ /**
+ * @param {number} pname
+ * @return {number} forcing number
+ */
+ es3fShaderBuiltinVarTests.getVectorsFromComps = function(pname) {
+ var value = /** @type {number} */ (gl.getParameter(pname));
+ assertMsgOptions(value%4 === 0, 'Expected value to be divisible by 4.', false, true);
+ return value / 4;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} desc
+ * @param {string} varName
+ * @param {es3fShaderBuiltinVarTests.GetConstantValueFunc} getValue
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+ es3fShaderBuiltinVarTests.ShaderBuiltinConstantCase = function(name, desc, varName, getValue, shaderType) {
+ tcuTestCase.DeqpTest.call(this, name, desc);
+ /** @type {string} */ this.m_varName = varName;
+ /** @type {es3fShaderBuiltinVarTests.GetConstantValueFunc} */ this.m_getValue = getValue;
+ /** @type {gluShaderProgram.shaderType} */ this.m_shaderType = shaderType;
+ };
+
+ es3fShaderBuiltinVarTests.ShaderBuiltinConstantCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fShaderBuiltinVarTests.ShaderBuiltinConstantCase.prototype.constructor = es3fShaderBuiltinVarTests.ShaderBuiltinConstantCase;
+
+ es3fShaderBuiltinVarTests.ShaderBuiltinConstantCase.prototype.deinit = function() {
+ // an attempt to cleanup the GL state when the test fails
+ bufferedLogToConsole('ShaderBuildInConstantCase.deinit()');
+ gl.useProgram(null);
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.bindRenderbuffer(gl.RENDERBUFFER, null);
+ };
+
+ /**
+ * @param {gluShaderProgram.shaderType} shaderType
+ * @param {string} varName
+ * @return {glsShaderExecUtil.ShaderExecutor}
+ */
+ es3fShaderBuiltinVarTests.ShaderBuiltinConstantCase.prototype.createGetConstantExecutor = function(shaderType, varName) {
+ /** @type {glsShaderExecUtil.ShaderSpec} */ var shaderSpec = new glsShaderExecUtil.ShaderSpec();
+ shaderSpec.version = gluShaderUtil.GLSLVersion.V300_ES;
+ shaderSpec.source = 'result = ' + varName + ';\n';
+ shaderSpec.outputs.push(new glsShaderExecUtil.Symbol('result',
+ gluVarType.newTypeBasic(gluShaderUtil.DataType.INT, gluShaderUtil.precision.PRECISION_HIGHP)));
+ return glsShaderExecUtil.createExecutor(shaderType, shaderSpec);
+
+ };
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fShaderBuiltinVarTests.ShaderBuiltinConstantCase.prototype.iterate = function() {
+ /** @type {glsShaderExecUtil.ShaderExecutor} */
+ var shaderExecutor = this.createGetConstantExecutor(this.m_shaderType, this.m_varName);
+ /** @type {number} */ var reference = this.m_getValue();
+ /** @type {goog.NumberArray} */ var shaderExecutorResult;
+ /** @type {number} */ var result;
+
+ if (!shaderExecutor.isOk())
+ assertMsgOptions(false, 'Compile failed', false, true);
+
+ shaderExecutor.useProgram();
+
+ shaderExecutorResult = shaderExecutor.execute(1, null);
+ result = new Int32Array(shaderExecutorResult[0].buffer)[0];
+
+ bufferedLogToConsole(this.m_varName + ' = ' + result);
+
+ if (result != reference) {
+ bufferedLogToConsole('ERROR: Expected ' + this.m_varName + ' = ' + reference + '\n' +
+ 'Test shader:' + shaderExecutor.m_program.getProgramInfo().infoLog);
+ testFailedOptions('Invalid builtin constant value', false);
+ } else
+ testPassedOptions('Pass', true);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @struct
+ * @constructor
+ * @param {number=} near
+ * @param {number=} far
+ */
+ es3fShaderBuiltinVarTests.DepthRangeParams = function(near, far) {
+ /** @type {number} */ this.zNear = near === undefined ? 0.0 : near;
+ /** @type {number} */ this.zFar = far === undefined ? 1.0 : far;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsShaderRenderCase.ShaderEvaluator}
+ * @param {es3fShaderBuiltinVarTests.DepthRangeParams} params
+ */
+ es3fShaderBuiltinVarTests.DepthRangeEvaluator = function(params) {
+ /** @type {es3fShaderBuiltinVarTests.DepthRangeParams} */ this.m_params = params;
+ };
+
+ es3fShaderBuiltinVarTests.DepthRangeEvaluator.prototype = Object.create(glsShaderRenderCase.ShaderEvaluator.prototype);
+ es3fShaderBuiltinVarTests.DepthRangeEvaluator.prototype.constructor = es3fShaderBuiltinVarTests.DepthRangeEvaluator;
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ */
+ es3fShaderBuiltinVarTests.DepthRangeEvaluator.prototype.evaluate = function(c) {
+ /** @type {number} */ var zNear = deMath.clamp(this.m_params.zNear, 0.0, 1.0);
+ /** @type {number} */ var zFar = deMath.clamp(this.m_params.zFar, 0.0, 1.0);
+ /** @type {number} */ var diff = zFar - zNear;
+ c.color[0] = zNear;
+ c.color[1] = zFar;
+ c.color[2] = diff * 0.5 + 0.5;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsShaderRenderCase.ShaderRenderCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {boolean} isVertexCase
+ */
+ es3fShaderBuiltinVarTests.ShaderDepthRangeTest = function(name, desc, isVertexCase) {
+ glsShaderRenderCase.ShaderRenderCase.call(this, name, desc, isVertexCase);
+ /** @type {es3fShaderBuiltinVarTests.DepthRangeParams} */ this.m_depthRange = new es3fShaderBuiltinVarTests.DepthRangeParams();
+ /** @type {es3fShaderBuiltinVarTests.DepthRangeEvaluator} */ this.m_evaluator = new es3fShaderBuiltinVarTests.DepthRangeEvaluator(this.m_depthRange);
+ /** @type {number} */ this.m_iterNdx = 0;
+ };
+
+ es3fShaderBuiltinVarTests.ShaderDepthRangeTest.prototype = Object.create(glsShaderRenderCase.ShaderRenderCase.prototype);
+ es3fShaderBuiltinVarTests.ShaderDepthRangeTest.prototype.constructor = es3fShaderBuiltinVarTests.ShaderDepthRangeTest;
+
+ es3fShaderBuiltinVarTests.ShaderDepthRangeTest.prototype.init = function() {
+ /** @type {string} */ var defaultVertSrc = '' +
+ '#version 300 es\n' +
+ 'in highp vec4 a_position;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = a_position;\n' +
+ '}\n';
+ /** @type {string} */ var defaultFragSrc = '' +
+ '#version 300 es\n' +
+ 'in mediump vec4 v_color;\n' +
+ 'layout(location = 0) out mediump vec4 o_color;\n\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' o_color = v_color;\n' +
+ '}\n';
+
+ // Construct shader.
+ /** @type {string} */ var src = '#version 300 es\n';
+ if (this.m_isVertexCase)
+ src += 'in highp vec4 a_position;\n' +
+ 'out mediump vec4 v_color;\n';
+ else
+ src += 'layout(location = 0) out mediump vec4 o_color;\n';
+
+ src += 'void main (void)\n{\n' +
+ '\t' + (this.m_isVertexCase ? 'v_color' : 'o_color') + ' = vec4(gl_DepthRange.near, gl_DepthRange.far, gl_DepthRange.diff*0.5 + 0.5, 1.0);\n';
+
+ if (this.m_isVertexCase)
+ src += '\tgl_Position = a_position;\n';
+
+ src += '}\n';
+
+ this.m_vertShaderSource = this.m_isVertexCase ? src : defaultVertSrc;
+ this.m_fragShaderSource = this.m_isVertexCase ? defaultFragSrc : src;
+
+ this.postinit();
+ };
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fShaderBuiltinVarTests.ShaderDepthRangeTest.prototype.iterate = function() {
+ /** @type {Array<es3fShaderBuiltinVarTests.DepthRangeParams>} */ var cases = [
+ new es3fShaderBuiltinVarTests.DepthRangeParams(0.0, 1.0)
+ ];
+
+ this.m_depthRange = cases[this.m_iterNdx];
+ bufferedLogToConsole('gl.depthRange(' + this.m_depthRange.zNear + ', ' + this.m_depthRange.zFar + ')');
+ gl.depthRange(this.m_depthRange.zNear, this.m_depthRange.zFar);
+
+ this.postiterate();
+ this.m_iterNdx += 1;
+
+ if (this.m_iterNdx == cases.length)
+ return tcuTestCase.IterateResult.STOP;
+ else
+ return tcuTestCase.IterateResult.CONTINUE;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fShaderBuiltinVarTests.FragCoordXYZCase = function() {
+ tcuTestCase.DeqpTest.call(this, 'fragcoord_xyz', 'gl_FragCoord.xyz Test');
+ };
+
+ es3fShaderBuiltinVarTests.FragCoordXYZCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fShaderBuiltinVarTests.FragCoordXYZCase.prototype.constructor = es3fShaderBuiltinVarTests.FragCoordXYZCase;
+
+ es3fShaderBuiltinVarTests.FragCoordXYZCase.prototype.iterate = function() {
+ /** @type {number} */ var width = gl.drawingBufferWidth;
+ /** @type {number} */ var height = gl.drawingBufferHeight;
+ /** @type {Array<number>} */ var threshold = deMath.add([1, 1, 1, 1], tcuPixelFormat.PixelFormatFromContext(gl).getColorThreshold());
+ /** @type {Array<number>} */ var scale = [1. / width, 1. / height, 1.0];
+
+ /** @type {tcuSurface.Surface} */ var testImg = new tcuSurface.Surface(width, height);
+ /** @type {tcuSurface.Surface} */ var refImg = new tcuSurface.Surface(width, height);
+
+ /** @type {string} */ var vtxSource = '' +
+ '#version 300 es\n' +
+ 'in highp vec4 a_position;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = a_position;\n' +
+ '}\n';
+ /** @type {string} */ var fragSource = '' +
+ '#version 300 es\n' +
+ 'uniform highp vec3 u_scale;\n' +
+ 'layout(location = 0) out mediump vec4 o_color;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' o_color = vec4(gl_FragCoord.xyz*u_scale, 1.0);\n' +
+ '}\n';
+ /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vtxSource, fragSource));
+
+ bufferedLogToConsole(program.getProgramInfo().infoLog);
+
+ if (!program.isOk())
+ throw new Error('Compile failed');
+
+ // Draw with GL.
+ /** @type {Array<number>} */ var positions = [
+ -1.0, 1.0, -1.0, 1.0,
+ -1.0, -1.0, 0.0, 1.0,
+ 1.0, 1.0, 0.0, 1.0,
+ 1.0, -1.0, 1.0, 1.0
+ ];
+ /** @type {Array<number>} */ var indices = [0, 1, 2, 2, 1, 3];
+
+ /** @type {WebGLUniformLocation} */ var scaleLoc = gl.getUniformLocation(program.getProgram(), 'u_scale');
+ /** @type {gluDrawUtil.VertexArrayBinding} */ var posBinding = gluDrawUtil.newFloatVertexArrayBinding('a_position', 4, 4, 0, positions);
+
+ gl.useProgram(program.getProgram());
+ gl.uniform3fv(scaleLoc, scale);
+
+ gl.viewport(0, 0, width, height);
+ gluDrawUtil.draw(gl, program.getProgram(), [posBinding], gluDrawUtil.triangles(indices));
+
+ testImg.readViewport(gl, [0, 0, width, height]);
+
+ // Draw reference
+ for (var y = 0; y < refImg.getHeight(); y++) {
+ for (var x = 0; x < refImg.getWidth(); x++) {
+ /** @type {number} */ var xf = (x + .5) / refImg.getWidth();
+ /** @type {number} */ var yf = (refImg.getHeight() - y - 1 + .5) / refImg.getHeight();
+ /** @type {number} */ var z = (xf + yf) / 2.0;
+ /** @type {Array<number>} */ var fragCoord = [x + .5, y + .5, z];
+ /** @type {Array<number>} */ var scaledFC = deMath.multiply(fragCoord, scale);
+ /** @type {Array<number>} */
+ var color = [
+ deMath.clamp(Math.floor(scaledFC[0] * 255 + 0.5), 0, 255),
+ deMath.clamp(Math.floor(scaledFC[1] * 255 + 0.5), 0, 255),
+ deMath.clamp(Math.floor(scaledFC[2] * 255 + 0.5), 0, 255),
+ 255];
+ refImg.setPixel(x, y, color);
+ }
+ }
+
+ // Compare
+ /** @type {boolean} */ var isOk = tcuImageCompare.pixelThresholdCompare('Result', 'Image comparison result', refImg, testImg, threshold);
+
+ if (!isOk)
+ testFailedOptions('Image comparison failed', false);
+ else
+ testPassedOptions('Pass', true);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @param {Array<number>} s
+ * @param {Array<number>} w
+ * @param {number} nx
+ * @param {number} ny
+ * @return {number}
+ */
+ es3fShaderBuiltinVarTests.projectedTriInterpolate = function(s, w, nx, ny) {
+ return (s[0] * (1.0 - nx - ny)/w[0] + s[1] * ny / w[1] + s[2] * nx / w[2]) / ((1.0 - nx - ny) / w[0] + ny / w[1] + nx / w[2]);
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fShaderBuiltinVarTests.FragCoordWCase = function() {
+ tcuTestCase.DeqpTest.call(this, 'fragcoord_w', 'gl_FragCoord.w Test');
+ };
+
+ es3fShaderBuiltinVarTests.FragCoordWCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fShaderBuiltinVarTests.FragCoordWCase.prototype.constructor = es3fShaderBuiltinVarTests.FragCoordWCase;
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fShaderBuiltinVarTests.FragCoordWCase.prototype.iterate = function() {
+ /** @type {number} */ var width = gl.drawingBufferWidth;
+ /** @type {number} */ var height = gl.drawingBufferHeight;
+ /** @type {Array<number>} */ var threshold = deMath.add([1, 1, 1, 1], tcuPixelFormat.PixelFormatFromContext(gl).getColorThreshold());
+
+ /** @type {tcuSurface.Surface} */ var testImg = new tcuSurface.Surface(width, height);
+ /** @type {tcuSurface.Surface} */ var refImg = new tcuSurface.Surface(width, height);
+
+ /** @type {Array<number>} */ var w = [1.7, 2.0, 1.2, 1.0];
+
+ /** @type {string} */ var vtxSource = '#version 300 es\n' +
+ 'in highp vec4 a_position;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = a_position;\n' +
+ '}\n';
+
+ /** @type {string} */ var fragSource = '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 o_color;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' o_color = vec4(0.0, 1.0/gl_FragCoord.w - 1.0, 0.0, 1.0);\n' +
+ '}\n';
+
+ /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vtxSource, fragSource));
+ bufferedLogToConsole(program.getProgramInfo().infoLog);
+
+ if (!program.isOk())
+ throw new Error('Compile failed');
+
+ // Draw with GL.
+ /** @type {Array<number>} */ var positions = [
+ -w[0], w[0], 0.0, w[0],
+ -w[1], -w[1], 0.0, w[1],
+ w[2], w[2], 0.0, w[2],
+ w[3], -w[3], 0.0, w[3]
+ ];
+ /** @type {Array<number>} */ var indices = [0, 1, 2, 2, 1, 3];
+
+ /** @type {gluDrawUtil.VertexArrayBinding} */ var posBinding = gluDrawUtil.newFloatVertexArrayBinding('a_position', 4, 4, 0, positions);
+ gl.useProgram(program.getProgram());
+
+ gluDrawUtil.draw(gl, program.getProgram(), [posBinding], gluDrawUtil.triangles(indices));
+ testImg.readViewport(gl, [0, 0, width, height]);
+
+ // Draw reference
+ for (var y = 0; y < refImg.getHeight(); y++) {
+ for (var x = 0; x < refImg.getWidth(); x++) {
+ /** @type {number} */ var xf = (x + 0.5) / refImg.getWidth();
+ /** @type {number} */ var yf = (refImg.getHeight() - y - 1 + 0.5) / refImg.getHeight();
+ /** @type {number} */ var oow = ((xf + yf) < 1.0) ?
+ es3fShaderBuiltinVarTests.projectedTriInterpolate([w[0], w[1], w[2]], [w[0], w[1], w[2]], xf, yf) :
+ es3fShaderBuiltinVarTests.projectedTriInterpolate([w[3], w[2], w[1]], [w[3], w[2], w[1]], 1.0 - xf, 1.0 - yf);
+ /** @type {Array<number>} */
+ var color = [
+ 0,
+ deMath.clamp(Math.floor((oow - 1.0) * 255 + 0.5), 0, 255),
+ 0,
+ 255];
+ refImg.setPixel(x, y, color);
+ }
+ }
+
+ // Compare
+ /** @type {boolean} */ var isOk = tcuImageCompare.pixelThresholdCompare('Result', 'Image comparison result', refImg, testImg, threshold);
+
+ if (!isOk) {
+ testFailedOptions('Image comparison failed', false);
+ } else
+ testPassedOptions('Pass', true);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fShaderBuiltinVarTests.PointCoordCase = function() {
+ tcuTestCase.DeqpTest.call(this, 'pointcoord', 'gl_PointCoord Test');
+ };
+
+ es3fShaderBuiltinVarTests.PointCoordCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fShaderBuiltinVarTests.PointCoordCase.prototype.constructor = es3fShaderBuiltinVarTests.PointCoordCase;
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fShaderBuiltinVarTests.PointCoordCase.prototype.iterate = function() {
+ /** @type {number} */ var width = Math.min(256, gl.drawingBufferWidth);
+ /** @type {number} */ var height = Math.min(256, gl.drawingBufferHeight);
+ /** @type {number} */ var threshold = 0.02;
+
+ /** @type {number} */ var numPoints = 8;
+
+ /** @type {Array<number>} */ var coords = [];
+ /** @type {Array<number>} */ var pointSizeRange = [0.0, 0.0];
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(0x145fa);
+ /** @type {tcuSurface.Surface} */ var testImg = new tcuSurface.Surface(width, height);
+ /** @type {tcuSurface.Surface} */ var refImg = new tcuSurface.Surface(width, height);
+
+ pointSizeRange = /** @type {Array<number>} */ (gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE));
+
+ if (pointSizeRange[0] <= 0.0 || pointSizeRange[1] <= 0.0 || pointSizeRange[1] < pointSizeRange[0])
+ throw new Error('Invalid gl.ALIASED_POINT_SIZE_RANGE');
+
+ // Compute coordinates.
+ for (var i = 0; i < numPoints; i++)
+ coords.push([
+ rnd.getFloat(-0.9, 0.9),
+ rnd.getFloat(-0.9, 0.9),
+ rnd.getFloat(pointSizeRange[0], pointSizeRange[1])
+ ]);
+
+ /** @type {string} */ var vtxSource = '#version 300 es\n' +
+ 'in highp vec3 a_positionSize;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = vec4(a_positionSize.xy, 0.0, 1.0);\n' +
+ ' gl_PointSize = a_positionSize.z;\n' +
+ '}\n';
+
+ /** @type {string} */ var fragSource = '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 o_color;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' o_color = vec4(gl_PointCoord, 0.0, 1.0);\n' +
+ '}\n';
+
+ /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vtxSource, fragSource));
+ bufferedLogToConsole(program.getProgramInfo().infoLog);
+
+ if (!program.isOk())
+ throw new Error('Compile failed');
+
+ // Draw with GL.
+ var newCoords = [].concat.apply([], coords);
+
+ // /** @type {gluDrawUtil.VertexArrayBinding} */ var posBinding = gluDrawUtil.newFloatVertexArrayBinding('a_positionSize', 3, coords.length, 0, coords);
+ /** @type {gluDrawUtil.VertexArrayBinding} */
+ var posBinding = gluDrawUtil.newFloatVertexArrayBinding('a_positionSize', 3, coords.length, 12, newCoords);
+ /** @type {number} */ var viewportX = rnd.getInt(0, gl.drawingBufferWidth - width);
+ /** @type {number} */ var viewportY = rnd.getInt(0, gl.drawingBufferHeight - height);
+
+ gl.viewport(viewportX, viewportY, width, height);
+ gl.clearColor(0.0, 0.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ gl.useProgram(program.getProgram());
+
+ gluDrawUtil.draw(gl, program.getProgram(), [posBinding], gluDrawUtil.pointsFromElements(coords.length));
+ testImg.readViewport(gl, [viewportX, viewportY, width, height]);
+
+ // Draw reference
+ refImg.getAccess().clear([0.0, 0.0, 0.0, 1.0]);
+ for (var i = 0; i < coords.length; i++) {
+ /** @type {number} */ var x0 = Math.round(width * (coords[i][0] * 0.5 + 0.5) - coords[i][2] * 0.5);
+ /** @type {number} */ var y0 = Math.round(height* (coords[i][1] * 0.5 + 0.5) - coords[i][2] * 0.5);
+ /** @type {number} */ var x1 = Math.round(width * (coords[i][0] * 0.5 + 0.5) + coords[i][2] * 0.5);
+ /** @type {number} */ var y1 = Math.round(height * (coords[i][1] * 0.5 + 0.5) + coords[i][2] * 0.5);
+ /** @type {number} */ var w = x1 - x0;
+ /** @type {number} */ var h = y1 - y0;
+
+ for (var yo = 0; yo < h; yo++) {
+ for (var xo = 0; xo < w; xo++) {
+ /** @type {number} */ var xf = (xo + 0.5) / w;
+ /** @type {number} */ var yf = ((h - yo - 1) + 0.5) / h;
+ /** @type {number} */ var dx = x0 + xo;
+ /** @type {number} */ var dy = y0 + yo;
+ /** @type {Array<number>} */
+ var color = [
+ deMath.clamp(Math.floor(xf * 255 + 0.5), 0, 255),
+ deMath.clamp(Math.floor(yf * 255 + 0.5), 0, 255),
+ 0,
+ 255];
+ if (deMath.deInBounds32(dx, 0, refImg.getWidth()) && deMath.deInBounds32(dy, 0, refImg.getHeight()))
+ refImg.setPixel(dx, dy, color);
+ }
+ }
+ }
+
+ // Compare
+ /** @type {boolean} */ var isOk = tcuImageCompare.fuzzyCompare('Result', 'Image comparison result', refImg.getAccess(), testImg.getAccess(), threshold);
+
+ if (!isOk) {
+ testFailedOptions('Image comparison failed', false);
+ } else
+ testPassedOptions('Pass', true);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fShaderBuiltinVarTests.FrontFacingCase = function() {
+ tcuTestCase.DeqpTest.call(this, 'frontfacing', 'gl_FrontFacing Test');
+ };
+
+ es3fShaderBuiltinVarTests.FrontFacingCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fShaderBuiltinVarTests.FrontFacingCase.prototype.constructor = es3fShaderBuiltinVarTests.FrontFacingCase;
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fShaderBuiltinVarTests.FrontFacingCase.prototype.iterate = function() {
+ // Test case renders two adjecent quads, where left is has front-facing
+ // triagles and right back-facing. Color is selected based on gl_FrontFacing
+ // value.
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(0x89f2c);
+ /** @type {number} */ var width = Math.min(64, gl.drawingBufferWidth);
+ /** @type {number} */ var height = Math.min(64, gl.drawingBufferHeight);
+ /** @type {number} */ var viewportX = rnd.getInt(0, gl.drawingBufferWidth - width);
+ /** @type {number} */ var viewportY = rnd.getInt(0, gl.drawingBufferHeight - height);
+ /** @type {Array<number>} */ var threshold = deMath.add([1, 1, 1, 1], tcuPixelFormat.PixelFormatFromContext(gl).getColorThreshold());
+
+ /** @type {tcuSurface.Surface} */ var testImg = new tcuSurface.Surface(width, height);
+ /** @type {tcuSurface.Surface} */ var refImg = new tcuSurface.Surface(width, height);
+
+ /** @type {string} */ var vtxSource = '#version 300 es\n' +
+ 'in highp vec4 a_position;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = a_position;\n' +
+ '}\n';
+
+ /** @type {string} */ var fragSource = '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 o_color;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' if (gl_FrontFacing)\n' +
+ ' o_color = vec4(0.0, 1.0, 0.0, 1.0);\n' +
+ ' else\n' +
+ ' o_color = vec4(0.0, 0.0, 1.0, 1.0);\n' +
+ '}\n';
+
+ /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vtxSource, fragSource));
+
+ bufferedLogToConsole(program.getProgramInfo().infoLog);
+
+ if (!program.isOk())
+ throw new Error('Compile failed');
+
+ // Draw with GL.
+ /** @type {Array<number>} */ var positions = [
+ -1.0, 1.0, 0.0, 1.0,
+ -1.0, -1.0, 0.0, 1.0,
+ 1.0, 1.0, 0.0, 1.0,
+ 1.0, -1.0, 0.0, 1.0
+ ];
+
+ /** @type {Array<number>} */ var indicesCCW = [0, 1, 2, 2, 1, 3];
+ /** @type {Array<number>} */ var indicesCW = [2, 1, 0, 3, 1, 2];
+
+ /** @type {gluDrawUtil.VertexArrayBinding} */ var posBinding = gluDrawUtil.newFloatVertexArrayBinding('a_position', 4, 4, 0, positions);
+
+ gl.useProgram(program.getProgram());
+
+ gl.viewport(viewportX, viewportY, Math.floor(width / 2), height);
+
+ gluDrawUtil.draw(gl, program.getProgram(), [posBinding], gluDrawUtil.triangles(indicesCCW));
+
+ gl.viewport(viewportX + Math.floor(width / 2), viewportY, width - Math.floor(width / 2), height);
+ gluDrawUtil.draw(gl, program.getProgram(), [posBinding], gluDrawUtil.triangles(indicesCW));
+ testImg.readViewport(gl, [viewportX, viewportY, width, height]);
+ // Draw reference
+ for (var y = 0; y < refImg.getHeight(); y++) {
+ for (var x = 0; x < Math.floor(refImg.getWidth() / 2); x++)
+ refImg.setPixel(x, y, tcuRGBA.RGBA.green.toIVec());
+
+ for (var x = Math.floor(refImg.getWidth() / 2); x < refImg.getWidth(); x++)
+ refImg.setPixel(x, y, tcuRGBA.RGBA.blue.toIVec());
+ }
+
+ // Compare
+ /** @type {boolean} */ var isOk = tcuImageCompare.pixelThresholdCompare('Result', 'Image comparison result', refImg, testImg, threshold);
+
+ if (!isOk) {
+ testFailedOptions('Image comparison failed', false);
+ } else
+ testPassedOptions('Pass', true);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fShaderBuiltinVarTests.VertexIDCase = function() {
+ tcuTestCase.DeqpTest.call(this, 'vertex_id', 'gl_VertexID Test');
+ /** @type {?gluShaderProgram.ShaderProgram} */ this.m_program = null;
+ /** @type {WebGLBuffer} */ this.m_positionBuffer = null;
+ /** @type {WebGLBuffer} */ this.m_elementBuffer = null;
+ /** @type {number} */ this.m_viewportW = 0;
+ /** @type {number} */ this.m_viewportH = 0;
+ /** @type {number} */ this.m_iterNdx = 0;
+ /** @type {Array<Array<number>>} */ this.m_positions = [];
+ /** @type {Array<Array<number>>} */ this.m_colors = [];
+ };
+
+ es3fShaderBuiltinVarTests.VertexIDCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fShaderBuiltinVarTests.VertexIDCase.prototype.constructor = es3fShaderBuiltinVarTests.VertexIDCase;
+
+ es3fShaderBuiltinVarTests.VertexIDCase.MAX_VERTICES = 24; //!< 8 triangles, totals 24 vertices
+
+ es3fShaderBuiltinVarTests.VertexIDCase.prototype.init = function() {
+ /** @type {number} */ var width = gl.drawingBufferWidth;
+ /** @type {number} */ var height = gl.drawingBufferHeight;
+
+ /** @type {number} */ var quadWidth = 32;
+ /** @type {number} */ var quadHeight = 32;
+
+ if (width < quadWidth)
+ throw new Error('Too small render target');
+
+ /** @type {number} */ var maxQuadsX = Math.floor(width / quadWidth);
+ /** @type {number} */ var numVertices = es3fShaderBuiltinVarTests.VertexIDCase.MAX_VERTICES;
+
+ /** @type {number} */ var numQuads = Math.floor(numVertices / 6) + (numVertices % 6 != 0 ? 1 : 0);
+ /** @type {number} */ var viewportW = Math.min(numQuads, maxQuadsX)*quadWidth;
+ /** @type {number} */ var viewportH = (Math.floor(numQuads/maxQuadsX) + (numQuads % maxQuadsX != 0 ? 1 : 0)) * quadHeight;
+
+ if (viewportH > height)
+ throw new Error('Too small render target');
+
+ assertMsgOptions(viewportW <= width && viewportH <= height, 'Unexpected viewport dimensions.', false, true);
+
+ assertMsgOptions(!this.m_program, 'Program should not be defined at this point.', false, true);
+
+ /** @type {string} */ var vtxSource = '#version 300 es\n' +
+ 'in highp vec4 a_position;\n' +
+ 'out mediump vec4 v_color;\n' +
+ 'uniform highp vec4 u_colors[24];\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = a_position;\n' +
+ ' v_color = u_colors[gl_VertexID];\n' +
+ '}\n';
+
+ /** @type {string} */ var fragSource = '#version 300 es\n' +
+ 'in mediump vec4 v_color;\n' +
+ 'layout(location = 0) out mediump vec4 o_color;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' o_color = v_color;\n' +
+ '}\n';
+
+ this.m_program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vtxSource, fragSource));
+ bufferedLogToConsole(this.m_program.getProgramInfo().infoLog);
+
+ if (!this.m_program.isOk()) {
+ this.m_program = null;
+ throw new Error('Compile failed');
+ }
+
+ this.m_positionBuffer = gl.createBuffer();
+ this.m_elementBuffer = gl.createBuffer();
+
+ // Set colors (in dynamic memory to save static data space).
+ this.m_colors[0] = [0.0, 0.0, 0.0, 1.0];
+ this.m_colors[1] = [0.5, 1.0, 0.5, 1.0];
+ this.m_colors[2] = [0.0, 0.5, 1.0, 1.0];
+ this.m_colors[3] = [0.0, 1.0, 0.0, 1.0];
+ this.m_colors[4] = [0.0, 1.0, 1.0, 1.0];
+ this.m_colors[5] = [0.5, 0.0, 0.0, 1.0];
+ this.m_colors[6] = [0.5, 0.0, 1.0, 1.0];
+ this.m_colors[7] = [0.5, 0.0, 0.5, 1.0];
+ this.m_colors[8] = [1.0, 0.0, 0.0, 1.0];
+ this.m_colors[9] = [0.5, 1.0, 0.0, 1.0];
+ this.m_colors[10] = [0.0, 0.5, 0.0, 1.0];
+ this.m_colors[11] = [0.5, 1.0, 1.0, 1.0];
+ this.m_colors[12] = [0.0, 0.0, 1.0, 1.0];
+ this.m_colors[13] = [1.0, 0.0, 0.5, 1.0];
+ this.m_colors[14] = [0.0, 0.5, 0.5, 1.0];
+ this.m_colors[15] = [1.0, 1.0, 0.5, 1.0];
+ this.m_colors[16] = [1.0, 0.0, 1.0, 1.0];
+ this.m_colors[17] = [1.0, 0.5, 0.0, 1.0];
+ this.m_colors[18] = [0.0, 1.0, 0.5, 1.0];
+ this.m_colors[19] = [1.0, 0.5, 1.0, 1.0];
+ this.m_colors[20] = [1.0, 1.0, 0.0, 1.0];
+ this.m_colors[21] = [1.0, 0.5, 0.5, 1.0];
+ this.m_colors[22] = [0.0, 0.0, 0.5, 1.0];
+ this.m_colors[23] = [1.0, 1.0, 1.0, 1.0];
+
+ // Compute positions.
+ assertMsgOptions(numVertices % 3 == 0, 'Number of vertices should be multiple of 3.', false, true);
+
+ for (var vtxNdx = 0; vtxNdx < numVertices; vtxNdx += 3) {
+ /** @type {number} */ var h = 2.0 * quadHeight / viewportH;
+ /** @type {number} */ var w = 2.0 * quadWidth / viewportW;
+
+ /** @type {number} */ var triNdx = Math.floor(vtxNdx / 3);
+ /** @type {number} */ var quadNdx = Math.floor(triNdx / 2);
+ /** @type {number} */ var quadY = Math.floor(quadNdx / maxQuadsX);
+ /** @type {number} */ var quadX = quadNdx % maxQuadsX;
+
+ /** @type {number} */ var x0 = -1.0 + quadX * w;
+ /** @type {number} */ var y0 = -1.0 + quadY * h;
+
+ if (triNdx % 2 === 0) {
+ this.m_positions[vtxNdx + 0] = [x0, y0, 0.0, 1.0];
+ this.m_positions[vtxNdx + 1] = [x0+w, y0+h, 0.0, 1.0];
+ this.m_positions[vtxNdx + 2] = [x0, y0+h, 0.0, 1.0];
+ } else {
+ this.m_positions[vtxNdx + 0] = [x0 + w, y0 + h, 0.0, 1.0];
+ this.m_positions[vtxNdx + 1] = [x0, y0, 0.0, 1.0];
+ this.m_positions[vtxNdx + 2] = [x0+w, y0, 0.0, 1.0];
+ }
+ }
+
+ this.m_viewportW = viewportW;
+ this.m_viewportH = viewportH;
+ this.m_iterNdx = 0;
+
+ };
+
+ es3fShaderBuiltinVarTests.VertexIDCase.prototype.deinit = function() {
+ this.m_program = null;
+
+ if (this.m_positionBuffer) {
+ gl.deleteBuffer(this.m_positionBuffer);
+ this.m_positionBuffer = null;
+ }
+
+ if (this.m_elementBuffer) {
+ gl.deleteBuffer(this.m_elementBuffer);
+ this.m_elementBuffer = null;
+ }
+
+ this.m_positions = [];
+ this.m_colors = [];
+ };
+
+ /**
+ * @constructor
+ * @extends {sglrShaderProgram.ShaderProgram}
+ */
+ es3fShaderBuiltinVarTests.VertexIDReferenceShader = function() {
+ /** @type {sglrShaderProgram.ShaderProgramDeclaration} */ var declaration = new sglrShaderProgram.ShaderProgramDeclaration();
+ declaration.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('', rrGenericVector.GenericVecType.FLOAT));
+ declaration.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('', rrGenericVector.GenericVecType.FLOAT));
+ declaration.pushVertexToFragmentVarying(new sglrShaderProgram.VertexToFragmentVarying(rrGenericVector.GenericVecType.FLOAT, new sglrShaderProgram.VaryingFlags()));
+ declaration.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(rrGenericVector.GenericVecType.FLOAT));
+ declaration.pushVertexSource(new sglrShaderProgram.VertexSource('')); // ShaderProgram fails if we don't push a source, even though GLSL source is not used
+ declaration.pushFragmentSource(new sglrShaderProgram.FragmentSource(''));
+ sglrShaderProgram.ShaderProgram.call(this, declaration);
+ };
+
+ es3fShaderBuiltinVarTests.VertexIDReferenceShader.prototype = Object.create(sglrShaderProgram.ShaderProgram.prototype);
+ es3fShaderBuiltinVarTests.VertexIDReferenceShader.prototype.constructor = es3fShaderBuiltinVarTests.VertexIDReferenceShader;
+
+ /** @const {number} */ es3fShaderBuiltinVarTests.VertexIDReferenceShader.VARYINGLOC_COLOR = 0;
+
+ /**
+ * @param {Array<rrVertexAttrib.VertexAttrib>} inputs
+ * @param {Array<rrVertexPacket.VertexPacket>} packets
+ */
+ es3fShaderBuiltinVarTests.VertexIDReferenceShader.prototype.shadeVertices = function(inputs, packets) {
+ for (var packetNdx = 0; packetNdx < packets.length; ++packetNdx) {
+ /** @type {number} */ var positionAttrLoc = 0;
+ /** @type {number} */ var colorAttrLoc = 1;
+
+ /** @type {rrVertexPacket.VertexPacket} */ var packet = packets[packetNdx];
+
+ // Transform to position
+ packet.position = rrVertexAttrib.readVertexAttrib(inputs[positionAttrLoc], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT);
+
+ // Pass color to FS
+ packet.outputs[es3fShaderBuiltinVarTests.VertexIDReferenceShader.VARYINGLOC_COLOR] = rrVertexAttrib.readVertexAttrib(inputs[colorAttrLoc], packet.instanceNdx, packet.vertexNdx, rrGenericVector.GenericVecType.FLOAT);
+ }
+ };
+
+ /**
+ * @param {Array<rrFragmentOperations.Fragment>} packets
+ * @param {rrShadingContext.FragmentShadingContext} context
+ */
+ es3fShaderBuiltinVarTests.VertexIDReferenceShader.prototype.shadeFragments = function(packets, context) {
+ for (var packetNdx = 0; packetNdx < packets.length; ++packetNdx) {
+ /** @type {rrFragmentOperations.Fragment} */ var packet = packets[packetNdx];
+ packet.value = rrShadingContext.readVarying(packet, context, es3fShaderBuiltinVarTests.VertexIDReferenceShader.VARYINGLOC_COLOR);
+ }
+ };
+
+ /**
+ * @param {tcuTexture.PixelBufferAccess} dst
+ * @param {Array<number>} indices
+ * @param {goog.NumberArray} positions
+ * @param {goog.NumberArray} colors
+ */
+ es3fShaderBuiltinVarTests.VertexIDCase.prototype.renderReference = function(dst, indices, positions, colors) {
+ /** @type {rrRenderState.RenderState} */
+ var referenceState = new rrRenderState.RenderState(
+ new rrRenderState.ViewportState(rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.fromSinglesampleAccess(dst))
+ );
+
+ /** @type {rrRenderer.RenderTarget} */
+ var referenceTarget = new rrRenderer.RenderTarget(
+ rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess.fromSinglesampleAccess(dst)
+ );
+
+ /** @type {es3fShaderBuiltinVarTests.VertexIDReferenceShader} */
+ var referenceShaderProgram = new es3fShaderBuiltinVarTests.VertexIDReferenceShader();
+
+ /** @type {Array<rrVertexAttrib.VertexAttrib>} */ var attribs = [];
+ attribs[0] = new rrVertexAttrib.VertexAttrib();
+ attribs[0].type = rrVertexAttrib.VertexAttribType.FLOAT;
+ attribs[0].size = 4;
+ attribs[0].stride = 0;
+ attribs[0].instanceDivisor = 0;
+ attribs[0].pointer = positions.buffer;
+
+ attribs[1] = new rrVertexAttrib.VertexAttrib();
+ attribs[1].type = rrVertexAttrib.VertexAttribType.FLOAT;
+ attribs[1].size = 4;
+ attribs[1].stride = 0;
+ attribs[1].instanceDivisor = 0;
+ attribs[1].pointer = colors.buffer;
+ rrRenderer.drawTriangles(referenceState, referenceTarget, referenceShaderProgram,
+ attribs, rrRenderer.PrimitiveType.TRIANGLES, 0, indices.length, /*instanceID = */ 0);
+ };
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fShaderBuiltinVarTests.VertexIDCase.prototype.iterate = function() {
+ /** @type {number} */ var width = gl.drawingBufferWidth;
+ /** @type {number} */ var height = gl.drawingBufferHeight;
+ /** @type {number} */ var viewportW = this.m_viewportW;
+ /** @type {number} */ var viewportH = this.m_viewportH;
+
+ /** @type {number} */ var threshold = 0.02;
+
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(0xcf23ab1 ^ deString.deStringHash(this.m_iterNdx.toString()));
+ /** @type {tcuSurface.Surface} */ var refImg = new tcuSurface.Surface(viewportW, viewportH);
+ /** @type {tcuSurface.Surface} */ var testImg = new tcuSurface.Surface(viewportW, viewportH);
+
+ /** @type {number} */ var viewportX = rnd.getInt(0, width - viewportW);
+ /** @type {number} */ var viewportY = rnd.getInt(0, height - viewportH);
+
+ /** @type {number} */ var posLoc = gl.getAttribLocation(this.m_program.getProgram(), 'a_position');
+ /** @type {WebGLUniformLocation} */ var colorsLoc = gl.getUniformLocation(this.m_program.getProgram(), 'u_colors[0]');
+ /** @type {Array<number>} */ var clearColor = [0.0, 0.0, 0.0, 1.0];
+ /** @type {Array<number>} */ var indices = [];
+ /** @type {Array<Array<number>>} */ var mappedPos = [];
+ /** @type {goog.NumberArray} */ var flatColorArray;
+ /** @type {goog.NumberArray} */ var flatPosArray;
+ // Setup common state.
+ gl.viewport(viewportX, viewportY, viewportW, viewportH);
+ gl.useProgram(this.m_program.getProgram());
+ gl.bindBuffer(gl.ARRAY_BUFFER, this.m_positionBuffer);
+ gl.enableVertexAttribArray(posLoc);
+ gl.vertexAttribPointer(posLoc, 4, gl.FLOAT, false, 0, 0);
+ gl.uniform4fv(colorsLoc, [].concat.apply([], this.m_colors));
+
+ // Clear render target to black.
+ gl.clearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ refImg.getAccess().clear(clearColor);
+
+ if (this.m_iterNdx === 0) {
+ bufferedLogToConsole('Iter0: glDrawArrays()');
+
+ flatPosArray = new Float32Array([].concat.apply([], this.m_positions));
+ flatColorArray = new Float32Array([].concat.apply([], this.m_colors));
+ gl.bufferData(gl.ARRAY_BUFFER, flatPosArray.buffer, gl.DYNAMIC_DRAW);
+ gl.drawArrays(gl.TRIANGLES, 0, Math.floor(flatPosArray.length / 4));
+
+ //glu::readPixels(m_context.getRenderContext(), viewportX, viewportY, testImg.getAccess());
+ testImg.readViewport(gl, [viewportX, viewportY, viewportW, viewportH]);
+ // Reference indices
+ for (var ndx = 0; ndx < this.m_positions.length; ndx++)
+ indices.push(ndx);
+
+ this.renderReference(refImg.getAccess(), indices, flatPosArray, flatColorArray);
+ } else if (this.m_iterNdx === 1) {
+ bufferedLogToConsole('Iter1: glDrawElements(), indices in buffer');
+
+ // Compute initial indices and suffle
+ for (var ndx = 0; ndx < this.m_positions.length; ndx++)
+ indices.push(ndx);
+ // deRandom.shuffle(rnd, indices);
+ // \note [2015-08-05 dag] The original test shuffles the indices array but the reference renderer cannot handle triangles with sides not parallel to the axes.
+
+ // Use indices to re-map positions.
+ for (var ndx = 0; ndx < indices.length; ndx++)
+ mappedPos[indices[ndx]] = this.m_positions[ndx];
+
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.m_elementBuffer);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, (new Uint16Array(indices)).buffer, gl.DYNAMIC_DRAW);
+
+ flatPosArray = new Float32Array([].concat.apply([], mappedPos));
+ flatColorArray = new Float32Array([].concat.apply([], this.m_colors));
+ gl.bufferData(gl.ARRAY_BUFFER, flatPosArray.buffer, gl.DYNAMIC_DRAW);
+ gl.drawElements(gl.TRIANGLES, indices.length, gl.UNSIGNED_SHORT, 0);
+
+ //glu::readPixels(m_context.getRenderContext(), viewportX, viewportY, testImg.getAccess());
+ testImg.readViewport(gl, [viewportX, viewportY, viewportW, viewportH]);
+ refImg.getAccess().clear(clearColor);
+ this.renderReference(refImg.getAccess(), indices, flatPosArray, flatColorArray);
+ } else
+ throw new Error('Iteration count exceeded.');
+
+ if (!tcuImageCompare.fuzzyCompare('Result', 'Image comparison result', refImg.getAccess(), testImg.getAccess(), threshold))
+ testFailedOptions('Image comparison failed', false);
+ else
+ testPassedOptions('Pass', true);
+
+ this.m_iterNdx += 1;
+ return (this.m_iterNdx < 2) ? tcuTestCase.IterateResult.CONTINUE : tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fShaderBuiltinVarTests.ShaderBuiltinVarTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'builtin_variable', 'Built-in Variable Tests');
+ };
+
+ es3fShaderBuiltinVarTests.ShaderBuiltinVarTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fShaderBuiltinVarTests.ShaderBuiltinVarTests.prototype.constructor = es3fShaderBuiltinVarTests.ShaderBuiltinVarTests;
+
+ es3fShaderBuiltinVarTests.ShaderBuiltinVarTests.prototype.init = function() {
+ var testGroup = tcuTestCase.runner.testCases;
+ // Builtin constants.
+ /**
+ * @struct
+ * @constructor
+ * @param {string} caseName
+ * @param {string} varName
+ * @param {es3fShaderBuiltinVarTests.GetConstantValueFunc} getValue
+ */
+ var BuiltinConstant = function(caseName, varName, getValue) {
+ /** @type {string} */ this.caseName = caseName;
+ /** @type {string} */ this.varName = varName;
+ /** @type {es3fShaderBuiltinVarTests.GetConstantValueFunc} */ this.getValue = getValue;
+
+ };
+
+ /** @type {Array<BuiltinConstant>} */ var builtinConstants = [
+ // GLES 2.
+
+ new BuiltinConstant('max_vertex_attribs', 'gl_MaxVertexAttribs', function() { return es3fShaderBuiltinVarTests.getInteger(gl.MAX_VERTEX_ATTRIBS); }),
+ new BuiltinConstant('max_vertex_uniform_vectors', 'gl_MaxVertexUniformVectors', function() { return es3fShaderBuiltinVarTests.getInteger(gl.MAX_VERTEX_UNIFORM_VECTORS); }),
+ new BuiltinConstant('max_fragment_uniform_vectors', 'gl_MaxFragmentUniformVectors', function() { return es3fShaderBuiltinVarTests.getInteger(gl.MAX_FRAGMENT_UNIFORM_VECTORS); }),
+ new BuiltinConstant('max_texture_image_units', 'gl_MaxTextureImageUnits', function() { return es3fShaderBuiltinVarTests.getInteger(gl.MAX_TEXTURE_IMAGE_UNITS); }),
+ new BuiltinConstant('max_vertex_texture_image_units', 'gl_MaxVertexTextureImageUnits', function() { return es3fShaderBuiltinVarTests.getInteger(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS); }),
+ new BuiltinConstant('max_combined_texture_image_units', 'gl_MaxCombinedTextureImageUnits', function() { return es3fShaderBuiltinVarTests.getInteger(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS); }),
+ new BuiltinConstant('max_draw_buffers', 'gl_MaxDrawBuffers', function() { return es3fShaderBuiltinVarTests.getInteger(gl.MAX_DRAW_BUFFERS); }),
+
+ // GLES 3.
+
+ new BuiltinConstant('max_vertex_output_vectors', 'gl_MaxVertexOutputVectors', function() { return es3fShaderBuiltinVarTests.getVectorsFromComps(gl.MAX_VERTEX_OUTPUT_COMPONENTS); }),
+ new BuiltinConstant('max_fragment_input_vectors', 'gl_MaxFragmentInputVectors', function() { return es3fShaderBuiltinVarTests.getVectorsFromComps(gl.MAX_FRAGMENT_INPUT_COMPONENTS); }),
+ new BuiltinConstant('min_program_texel_offset', 'gl_MinProgramTexelOffset', function() { return es3fShaderBuiltinVarTests.getInteger(gl.MIN_PROGRAM_TEXEL_OFFSET); }),
+ new BuiltinConstant('max_program_texel_offset', 'gl_MaxProgramTexelOffset', function() { return es3fShaderBuiltinVarTests.getInteger(gl.MAX_PROGRAM_TEXEL_OFFSET); })
+ ];
+
+ for (var ndx = 0; ndx < builtinConstants.length; ndx++) {
+ /** @type {string} */ var caseName = builtinConstants[ndx].caseName;
+ /** @type {string} */ var varName = builtinConstants[ndx].varName;
+ /** @type {es3fShaderBuiltinVarTests.GetConstantValueFunc} */ var getValue = builtinConstants[ndx].getValue;
+
+ testGroup.addChild(new es3fShaderBuiltinVarTests.ShaderBuiltinConstantCase(caseName + '_vertex', varName, varName, getValue, gluShaderProgram.shaderType.VERTEX));
+ testGroup.addChild(new es3fShaderBuiltinVarTests.ShaderBuiltinConstantCase(caseName + '_fragment', varName, varName, getValue, gluShaderProgram.shaderType.FRAGMENT));
+ }
+
+ testGroup.addChild(new es3fShaderBuiltinVarTests.ShaderDepthRangeTest('depth_range_vertex', 'gl_DepthRange', true));
+ testGroup.addChild(new es3fShaderBuiltinVarTests.ShaderDepthRangeTest('depth_range_fragment', 'gl_DepthRange', false));
+
+ // Vertex shader builtin variables.
+ testGroup.addChild(new es3fShaderBuiltinVarTests.VertexIDCase());
+ // \todo [2013-03-20 pyry] gl_InstanceID -- tested in instancing tests quite thoroughly.
+
+ // Fragment shader builtin variables.
+ testGroup.addChild(new es3fShaderBuiltinVarTests.FragCoordXYZCase());
+ testGroup.addChild(new es3fShaderBuiltinVarTests.FragCoordWCase());
+ testGroup.addChild(new es3fShaderBuiltinVarTests.PointCoordCase());
+ testGroup.addChild(new es3fShaderBuiltinVarTests.FrontFacingCase());
+ };
+
+ /**
+ * Run test
+ * @param {WebGL2RenderingContext} context
+ */
+ es3fShaderBuiltinVarTests.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fShaderBuiltinVarTests.ShaderBuiltinVarTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fShaderBuiltinVarTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderCommonFunctionTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderCommonFunctionTests.js
new file mode 100644
index 0000000000..5c24c73f90
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderCommonFunctionTests.js
@@ -0,0 +1,1973 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fShaderCommonFunctionTests');
+goog.require('framework.common.tcuFloat');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluVarType');
+goog.require('modules.shared.glsShaderExecUtil');
+goog.scope(function() {
+ var es3fShaderCommonFunctionTests = functional.gles3.es3fShaderCommonFunctionTests;
+ var tcuFloat = framework.common.tcuFloat;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var gluShaderProgram = framework.opengl.gluShaderProgram;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var gluVarType = framework.opengl.gluVarType;
+ var deRandom = framework.delibs.debase.deRandom;
+ var deMath = framework.delibs.debase.deMath;
+ var deString = framework.delibs.debase.deString;
+ var glsShaderExecUtil = modules.shared.glsShaderExecUtil;
+
+ /** @typedef {function(new: es3fShaderCommonFunctionTests.CommonFunctionCase, gluShaderUtil.DataType, gluShaderUtil.precision, gluShaderProgram.shaderType)} */ es3fShaderCommonFunctionTests.TestClass;
+
+ /**
+ * @enum
+ */
+ es3fShaderCommonFunctionTests.Types = {
+ FLOAT: 0,
+ INT: 1,
+ UINT: 2
+ };
+
+ /**
+ * @param {Array<number>} values
+ */
+ es3fShaderCommonFunctionTests.vecToFloat16 = function(values) {
+ for (var ndx = 0; ndx < values.length; ndx++)
+ values[ndx] = tcuFloat.newFloat16(values[ndx]).getValue();
+ };
+
+ /**
+ * @param {es3fShaderCommonFunctionTests.Types} type
+ * @param {deRandom.Random} rnd
+ * @param {number} minValue
+ * @param {number} maxValue
+ * @return {number}
+ */
+ es3fShaderCommonFunctionTests.randomScalar = function(type, rnd, minValue, maxValue) {
+ switch (type) {
+ case es3fShaderCommonFunctionTests.Types.FLOAT: return rnd.getFloat(minValue, maxValue);
+ case es3fShaderCommonFunctionTests.Types.INT: return rnd.getInt(minValue, maxValue);
+ case es3fShaderCommonFunctionTests.Types.UINT: return Math.abs(rnd.getInt(minValue, maxValue));
+ default: throw new Error('Only FLOAT, INT, and UINT are supported.');
+ }
+ };
+
+ /**
+ * @param {es3fShaderCommonFunctionTests.Types} type
+ * @param {Array<number>} size
+ * @param {deRandom.Random} rnd
+ * @param {Array<number>} minValue
+ * @param {Array<number>} maxValue
+ * @return {Array<number>}
+ */
+ es3fShaderCommonFunctionTests.randomVector = function(type, size, rnd, minValue, maxValue) {
+ /** @type {Array<number>} */ var res = [];
+ for (var ndx = 0; ndx < size; ndx++)
+ res.push(es3fShaderCommonFunctionTests.randomScalar(type, rnd, minValue[ndx], maxValue[ndx]));
+ return res;
+ };
+
+ /**
+ * @param {es3fShaderCommonFunctionTests.Types} type
+ * @param {Array<number>} size
+ * @param {deRandom.Random} rnd
+ * @param {Array<number>} minValue
+ * @param {Array<number>} maxValue
+ * @param {number} numValues
+ * @param {number=} offset
+ * @return {Array<Array<number>>}
+ */
+ es3fShaderCommonFunctionTests.fillRandomVectors = function(type, size, rnd, minValue, maxValue, numValues, offset) {
+ offset = offset === undefined ? 0 : offset;
+ /** @type {Array<Array<number>>} */ var access;
+ for (var ndx = 0; ndx < numValues; ndx++)
+ access[offset + ndx] = es3fShaderCommonFunctionTests.randomVector(type, size, rnd, minValue, maxValue);
+ return access;
+ };
+
+ /**
+ * @param {es3fShaderCommonFunctionTests.Types} type
+ * @param {deRandom.Random} rnd
+ * @param {number} minValue
+ * @param {number} maxValue
+ * @param {number} numValues
+ * @param {number=} offset
+ * @return {Array<number>}
+ */
+ es3fShaderCommonFunctionTests.fillRandomScalars = function(type, rnd, minValue, maxValue, numValues, offset) {
+ offset = offset === undefined ? 0 : offset;
+ /** @type {Array<number>} */ var access = [];
+ for (var ndx = 0; ndx < numValues; ndx++)
+ access[offset + ndx] = es3fShaderCommonFunctionTests.randomScalar(type, rnd, minValue, maxValue);
+ return access;
+ };
+
+ /**
+ * @param {number} input
+ * @param {number} output
+ * @return {number}
+ */
+ es3fShaderCommonFunctionTests.numBitsLostInOp = function(input, output) {
+ /** @type {number} */ var inExp = tcuFloat.newFloat32(input).exponent();
+ /** @type {number} */ var outExp = tcuFloat.newFloat32(output).exponent();
+ return Math.max(0, inExp - outExp); // Lost due to mantissa shift.
+ };
+
+ /**
+ * @param {number} a
+ * @param {number} b
+ * @return {number}
+ */
+ es3fShaderCommonFunctionTests.getUlpDiff = function(a, b) {
+ /** @type {number} */ var aBits = tcuFloat.newFloat32(a).bits();
+ /** @type {number} */ var bBits = tcuFloat.newFloat32(b).bits();
+ return aBits > bBits ? aBits - bBits : bBits - aBits;
+ };
+
+ /**
+ * @param {number} a
+ * @param {number} b
+ * @return {number}
+ */
+ es3fShaderCommonFunctionTests.getUlpDiffIgnoreZeroSign = function(a, b) {
+ if (tcuFloat.newFloat32(a).isZero())
+ return es3fShaderCommonFunctionTests.getUlpDiff(new tcuFloat.deFloat().construct(tcuFloat.newFloat32(b).sign(), 0, 0).getValue(), b);
+ else if (tcuFloat.newFloat32(b).isZero())
+ return es3fShaderCommonFunctionTests.getUlpDiff(a, new tcuFloat.deFloat().construct(tcuFloat.newFloat32(a).sign(), 0, 0).getValue());
+ else
+ return es3fShaderCommonFunctionTests.getUlpDiff(a, b);
+ };
+
+ /**
+ * @param {gluShaderUtil.precision} precision
+ * @return {boolean}
+ */
+ es3fShaderCommonFunctionTests.supportsSignedZero = function(precision) {
+ // \note GLSL ES 3.0 doesn't really require support for -0, but we require it for highp
+ // as it is very widely supported.
+ return precision == gluShaderUtil.precision.PRECISION_HIGHP;
+ };
+
+ /**
+ * @param {number} value
+ * @param {number} ulpDiff
+ * @return {number}
+ */
+ es3fShaderCommonFunctionTests.getEpsFromMaxUlpDiff = function(value, ulpDiff) {
+ /** @type {number} */ var exp = tcuFloat.newFloat32(value).exponent();
+ return new tcuFloat.deFloat().construct(+1, exp, (1 << 23) | ulpDiff).getValue() - new tcuFloat.deFloat().construct(+1, exp, 1 << 23).getValue();
+ };
+
+ /**
+ * @param {number} numAccurateBits
+ * @return {number}
+ */
+ es3fShaderCommonFunctionTests.getMaxUlpDiffFromBits = function(numAccurateBits) {
+ /** @type {number} */ var numGarbageBits = 23 - numAccurateBits;
+ /** @type {number} */ var mask = (1 << numGarbageBits) - 1;
+
+ return mask;
+ };
+
+ /**
+ * @param {number} value
+ * @param {number} numAccurateBits
+ * @return {number}
+ */
+ es3fShaderCommonFunctionTests.getEpsFromBits = function(value, numAccurateBits) {
+ return es3fShaderCommonFunctionTests.getEpsFromMaxUlpDiff(value, es3fShaderCommonFunctionTests.getMaxUlpDiffFromBits(numAccurateBits));
+ };
+
+ /**
+ * @param {gluShaderUtil.precision} precision
+ * @return {number}
+ */
+ es3fShaderCommonFunctionTests.getMinMantissaBits = function(precision) {
+ /** @type {Array<number>} */ var bits = [
+ 7, // lowp
+ 10, // mediump
+ 23 // highp
+ ];
+
+ assertMsgOptions(deMath.deInBounds32(precision, 0, bits.length), 'Unexpected precision option.', false, true);
+ return bits[precision];
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} description
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+ es3fShaderCommonFunctionTests.CommonFunctionCase = function(name, description, shaderType) {
+ tcuTestCase.DeqpTest.call(this, name, description);
+ /** @type {gluShaderProgram.shaderType} */ this.m_shaderType = shaderType;
+ /** @type {number} */ this.m_numValues = 100;
+ /** @type {glsShaderExecUtil.ShaderExecutor} */ this.m_executor = null;
+ /** @type {glsShaderExecUtil.ShaderSpec} */ this.m_spec = new glsShaderExecUtil.ShaderSpec();
+ this.m_spec.version = gluShaderUtil.GLSLVersion.V300_ES;
+ /** @type {string} */ this.m_failMsg; //!< Comparison failure help message.
+ };
+
+ es3fShaderCommonFunctionTests.CommonFunctionCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fShaderCommonFunctionTests.CommonFunctionCase.prototype.constructor = es3fShaderCommonFunctionTests.CommonFunctionCase;
+
+ es3fShaderCommonFunctionTests.CommonFunctionCase.prototype.init = function() {
+ assertMsgOptions(!this.m_executor, 'Shader executor should be null at this point', false, true);
+ this.m_executor = glsShaderExecUtil.createExecutor(this.m_shaderType, this.m_spec);
+ if (!this.m_executor.isOk())
+ throw new Error('Compile failed');
+ };
+
+ es3fShaderCommonFunctionTests.CommonFunctionCase.prototype.deinit = function() {
+ this.m_executor = null;
+ };
+
+ /**
+ * @param {Array<glsShaderExecUtil.Symbol>} symbols
+ * @return {Array<number>}
+ */
+ es3fShaderCommonFunctionTests.getScalarSizes = function(symbols) {
+ /** @type {Array<number>} */ var sizes = [];
+ for (var ndx = 0; ndx < symbols.length; ++ndx)
+ sizes.push(symbols[ndx].varType.getScalarSize());
+ return sizes;
+ };
+
+ /**
+ * @param {Array<glsShaderExecUtil.Symbol>} symbols
+ * @return {number}
+ */
+ es3fShaderCommonFunctionTests.computeTotalScalarSize = function(symbols) {
+ /** @type {number} */ var totalSize = 0;
+ for (var sym in symbols)
+ totalSize += symbols[sym].varType.getScalarSize();
+ return totalSize;
+ };
+
+ /**
+ * @param {boolean} value
+ * @return {string}
+ */
+ es3fShaderCommonFunctionTests.ToBoolString = function(value) {
+ return value ? "true" : "false";
+ };
+
+ /**
+ * @param {gluVarType.VarType} varType
+ * @param {Array<*>} values
+ * @return {string}
+ */
+ es3fShaderCommonFunctionTests.VarValue = function(varType, values) {
+ /** @type {gluShaderUtil.DataType} */ var basicType = varType.getBasicType();
+ /** @type {gluShaderUtil.DataType} */ var scalarType = gluShaderUtil.getDataTypeScalarTypeAsDataType(basicType);
+ /** @type {number} */ var numComponents = gluShaderUtil.getDataTypeScalarSize(basicType);
+ /** @type {string} */ var outputStr = "";
+
+ if (numComponents > 1) {
+ outputStr += gluShaderUtil.getDataTypeName(basicType) + "(";
+ }
+
+ for (var compNdx = 0; compNdx < numComponents; ++compNdx) {
+ if (compNdx != 0) {
+ outputStr += ", ";
+ }
+
+ // tcu::toHex() is all commented out in this project.
+ // e.g. Line 199 of es3fShaderPackingFunctionTests.js
+ switch (scalarType) {
+ case gluShaderUtil.DataType.FLOAT:
+ case gluShaderUtil.DataType.INT:
+ case gluShaderUtil.DataType.UINT:
+ outputStr += values[compNdx];
+ break;
+ case gluShaderUtil.DataType.BOOL:
+ outputStr += es3fShaderCommonFunctionTests.ToBoolString(values[compNdx]);
+ break;
+
+ default:
+ throw Error('Unrecognized dataType ' + scalarType);
+ }
+ }
+
+ if (numComponents > 1) {
+ outputStr += ")";
+ }
+
+ return outputStr;
+ }
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fShaderCommonFunctionTests.CommonFunctionCase.prototype.iterate = function() {
+ /** @type {number} */ var numInputScalars = es3fShaderCommonFunctionTests.computeTotalScalarSize(this.m_spec.inputs);
+ /** @type {number} */ var numOutputScalars = es3fShaderCommonFunctionTests.computeTotalScalarSize(this.m_spec.outputs);
+ /** @type {Array<goog.TypedArray>} */ var inputData = [];
+ /** @type {Array<goog.TypedArray>} */ var outputData = [];
+ /** @type {gluShaderUtil.DataType} */ var inputType = this.m_spec.inputs[0].varType.getBasicType();
+ /** @type {gluShaderUtil.DataType} */ var outputType = this.m_spec.outputs[0].varType.getBasicType();
+ /** @type {Array<Array<number>>} */ var inputValues;
+ /** @type {ArrayBuffer} */ var outputValues;
+ inputValues = this.getInputValues(this.m_numValues);
+
+ for (var inNdx = 0; inNdx < inputValues.length; inNdx++) {
+ var data = inputType >= gluShaderUtil.DataType.FLOAT && inputType <= gluShaderUtil.DataType.FLOAT_VEC4 ? new Float32Array(inputValues[inNdx]) :
+ inputType >= gluShaderUtil.DataType.INT && inputType <= gluShaderUtil.DataType.INT_VEC4 ? new Int32Array(inputValues[inNdx]) :
+ inputType >= gluShaderUtil.DataType.UINT && inputType <= gluShaderUtil.DataType.UINT_VEC4 ? new Uint32Array(inputValues[inNdx]) :
+ null;
+ inputData.push(data);
+ }
+
+ // Execute shader.
+ this.m_executor.useProgram();
+ outputValues = this.m_executor.execute(this.m_numValues, inputData);
+ for (var outNdx = 0; outNdx < outputValues.length; outNdx++) {
+ var data = outputType >= gluShaderUtil.DataType.FLOAT && outputType <= gluShaderUtil.DataType.FLOAT_VEC4 ? new Float32Array(outputValues[outNdx].buffer) :
+ outputType >= gluShaderUtil.DataType.INT && outputType <= gluShaderUtil.DataType.INT_VEC4 ? new Int32Array(outputValues[outNdx].buffer) :
+ outputType >= gluShaderUtil.DataType.UINT && outputType <= gluShaderUtil.DataType.UINT_VEC4 ? new Uint32Array(outputValues[outNdx].buffer) :
+ outputType >= gluShaderUtil.DataType.BOOL && outputType <= gluShaderUtil.DataType.BOOL_VEC4 ? new Int32Array(outputValues[outNdx].buffer) :
+ null;
+ outputData.push(data);
+ }
+
+ // TODO: verify proper TypedArray for BOOL types; defaulting to Int32Array in the mean time (outputValues returns 400 bytes, we need 100 elements)
+ // Compare results.
+ /** @type {Array<number>} */ var inScalarSizes = es3fShaderCommonFunctionTests.getScalarSizes(this.m_spec.inputs);
+ /** @type {Array<number>} */ var outScalarSizes = es3fShaderCommonFunctionTests.getScalarSizes(this.m_spec.outputs);
+ /** @type {Array<*>} */ var curInputPtr = [];
+ /** @type {Array<*>} */ var curOutputPtr = [];
+ /** @type {number} */ var numFailed = 0;
+
+ for (var inNdx = 0; inNdx < inputData.length; inNdx++) {
+ curInputPtr[inNdx] = [];
+ for (var valNdx = 0; valNdx < inputData[inNdx].length; valNdx += inScalarSizes[inNdx])
+ curInputPtr[inNdx].push(inputData[inNdx].slice(valNdx, valNdx + inScalarSizes[inNdx]));
+ }
+
+ for (var outNdx = 0; outNdx < outputData.length; outNdx++) {
+ curOutputPtr[outNdx] = [];
+ for (var valNdx = 0; valNdx < outputData[outNdx].length; valNdx += outScalarSizes[outNdx])
+ curOutputPtr[outNdx].push(outputData[outNdx].slice(valNdx, valNdx + outScalarSizes[outNdx]));
+ }
+
+ this.m_failMsg = '';
+ for (var valNdx = 0; valNdx < this.m_numValues; valNdx++) {
+ var curInputValues = [];
+ var curOutputValues = [];
+ for (var inNdx = 0; inNdx < inputData.length; inNdx++) {
+ curInputValues.push(curInputPtr[inNdx][valNdx]);
+ }
+ for (var outNdx = 0; outNdx < outputData.length; outNdx++) {
+ curOutputValues.push(curOutputPtr[outNdx][valNdx]);
+ }
+ if (!this.compare(curInputValues, curOutputValues)) {
+ // \todo [2013-08-08 pyry] We probably want to log reference value as well?
+
+ bufferedLogToConsole('ERROR: comparison failed for value ' + valNdx + ':\n ' + this.m_failMsg);
+ bufferedLogToConsole(' inputs:');
+ for (var inNdx = 0; inNdx < inputData.length; ++inNdx) {
+ var varValue = es3fShaderCommonFunctionTests.VarValue(this.m_spec.inputs[0].varType, curInputValues[inNdx]);
+ bufferedLogToConsole(' ' + this.m_spec.inputs[inNdx].name + ' = ' + varValue);
+ }
+
+ bufferedLogToConsole(' outputs:');
+ for (var outNdx = 0; outNdx < outputData.length; ++outNdx) {
+ var varValue = es3fShaderCommonFunctionTests.VarValue(this.m_spec.inputs[0].varType, curOutputValues[outNdx]);
+ bufferedLogToConsole(' ' + this.m_spec.outputs[outNdx].name + ' = ' + varValue);
+ }
+
+ this.m_failMsg = '';
+ numFailed += 1;
+ }
+ }
+
+ bufferedLogToConsole((this.m_numValues - numFailed) + ' / ' + this.m_numValues + ' values passed');
+
+ /** @type {boolean} */ var isOk = numFailed === 0;
+
+ if (!isOk)
+ testFailedOptions('Result comparison failed', false);
+ else
+ testPassedOptions('Pass', true);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @param {gluShaderUtil.precision} precision
+ * @return {string}
+ */
+ es3fShaderCommonFunctionTests.getPrecisionPostfix = function(precision) {
+ /** @type {Array<string>} */ var s_postfix = [
+ '_lowp',
+ '_mediump',
+ '_highp'
+ ];
+ assertMsgOptions(0 <= precision && precision < s_postfix.length, 'Error: Out of range', false, true);
+ return s_postfix[precision];
+ };
+
+ /**
+ * @param {gluShaderProgram.shaderType} shaderType
+ * @return {string}
+ */
+ es3fShaderCommonFunctionTests.getShaderTypePostfix = function(shaderType) {
+ /** @type {Array<string>} */ var s_postfix = [
+ '_vertex',
+ '_fragment'
+ ];
+ assertMsgOptions(0 <= shaderType && shaderType < s_postfix.length, 'Error Out of range', false, true);
+ return s_postfix[shaderType];
+ };
+
+ /**
+ * @param {gluShaderUtil.DataType} baseType
+ * @param {gluShaderUtil.precision} precision
+ * @param {gluShaderProgram.shaderType} shaderType
+ * @return {string}
+ */
+ es3fShaderCommonFunctionTests.getCommonFuncCaseName = function(baseType, precision, shaderType) {
+ return gluShaderUtil.getDataTypeName(baseType) +
+ es3fShaderCommonFunctionTests.getPrecisionPostfix(precision) +
+ es3fShaderCommonFunctionTests.getShaderTypePostfix(shaderType);
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fShaderCommonFunctionTests.CommonFunctionCase}
+ * @param {gluShaderUtil.DataType} baseType
+ * @param {gluShaderUtil.precision} precision
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+ es3fShaderCommonFunctionTests.AbsCase = function(baseType, precision, shaderType) {
+ es3fShaderCommonFunctionTests.CommonFunctionCase.call(this,
+ es3fShaderCommonFunctionTests.getCommonFuncCaseName(baseType, precision, shaderType),
+ 'abs', shaderType);
+ this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(baseType, precision)));
+ this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(baseType, precision)));
+ this.m_spec.source = 'out0 = abs(in0);';
+ };
+
+ es3fShaderCommonFunctionTests.AbsCase.prototype = Object.create(es3fShaderCommonFunctionTests.CommonFunctionCase.prototype);
+ es3fShaderCommonFunctionTests.AbsCase.prototype.constructor = es3fShaderCommonFunctionTests.AbsCase;
+
+ /**
+ * @param {number} numValues
+ * @return {*}
+ */
+ es3fShaderCommonFunctionTests.AbsCase.prototype.getInputValues = function(numValues) {
+ /** @type {Array<Array<number>>} */ var floatRanges = [
+ [-2.0, 2.0], // lowp
+ [-1e3, 1e3], // mediump
+ [-1e7, 1e7] // highp
+ ];
+
+ /** @type {Array<Array<number>>} */ var intRanges = [
+ [-(1 << 7) + 1, (1 << 7) - 1],
+ [-(1 << 15) + 1, (1 << 15) - 1],
+ [-0x80000000 + 1, 0x7fffffff]
+ ];
+
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0x235fac);
+
+ /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType();
+ /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision();
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type);
+ /** @type {Array<Array<number>>} */ var values = [];
+ values[0] = [];
+
+ if (gluShaderUtil.isDataTypeFloatOrVec(type))
+ values[0] = es3fShaderCommonFunctionTests.fillRandomScalars(es3fShaderCommonFunctionTests.Types.FLOAT, rnd, floatRanges[precision][0], floatRanges[precision][1], numValues * scalarSize);
+ else
+ values[0] = es3fShaderCommonFunctionTests.fillRandomScalars(es3fShaderCommonFunctionTests.Types.INT, rnd, intRanges[precision][0], intRanges[precision][1], numValues * scalarSize);
+
+ return values;
+ };
+
+ /**
+ * @param {*} inputs
+ * @param {*} outputs
+ * @return {boolean}
+ */
+ es3fShaderCommonFunctionTests.AbsCase.prototype.compare = function(inputs, outputs) {
+ /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType();
+ /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision();
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type);
+
+ /** @type {number} */ var in0;
+ /** @type {number} */ var out0;
+ /** @type {number} */ var ref0;
+
+ if (gluShaderUtil.isDataTypeFloatOrVec(type)) {
+ /** @type {number} */ var mantissaBits = es3fShaderCommonFunctionTests.getMinMantissaBits(precision);
+ /** @type {number} */ var maxUlpDiff = (1 << (23 - mantissaBits)) - 1;
+
+ for (var compNdx = 0; compNdx < scalarSize; compNdx++) {
+ in0 = inputs[0][compNdx];
+ out0 = outputs[0][compNdx];
+ ref0 = Math.abs(in0);
+ /** @type {number} */ var ulpDiff0 = es3fShaderCommonFunctionTests.getUlpDiff(out0, ref0);
+
+ if (ulpDiff0 > maxUlpDiff) {
+ this.m_failMsg += 'Expected [' + compNdx + '] = ' + ref0 /*HexFloat(ref0)*/ + ' with ULP threshold ' + maxUlpDiff + ', got ULP diff ' + ulpDiff0;
+ return false;
+ }
+ }
+ } else
+ for (var compNdx = 0; compNdx < scalarSize; compNdx++) {
+ in0 = inputs[0][compNdx];
+ out0 = outputs[0][compNdx];
+ ref0 = Math.abs(in0);
+
+ if (out0 != ref0) {
+ this.m_failMsg += 'Expected [' + compNdx + '] = ' + ref0;
+ return false;
+ }
+ }
+
+ return true;
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fShaderCommonFunctionTests.CommonFunctionCase}
+ * @param {gluShaderUtil.DataType} baseType
+ * @param {gluShaderUtil.precision} precision
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+ es3fShaderCommonFunctionTests.SignCase = function(baseType, precision, shaderType) {
+ es3fShaderCommonFunctionTests.CommonFunctionCase.call(this,
+ es3fShaderCommonFunctionTests.getCommonFuncCaseName(baseType, precision, shaderType),
+ 'sign', shaderType);
+ this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(baseType, precision)));
+ this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(baseType, precision)));
+ this.m_spec.source = 'out0 = sign(in0);';
+ };
+
+ es3fShaderCommonFunctionTests.SignCase.prototype = Object.create(es3fShaderCommonFunctionTests.CommonFunctionCase.prototype);
+ es3fShaderCommonFunctionTests.SignCase.prototype.constructor = es3fShaderCommonFunctionTests.SignCase;
+
+ /**
+ * @param {number} numValues
+ * @return {*}
+ */
+ es3fShaderCommonFunctionTests.SignCase.prototype.getInputValues = function(numValues) {
+ /** @type {Array<Array<number>>} */ var floatRanges = [
+ [-2.0, 2.0], // lowp
+ [-1e4, 1e4], // mediump
+ [-1e8, 1e8] // highp
+ ];
+
+ /** @type {Array<Array<number>>} */ var intRanges = [
+ [-(1 << 7), (1 << 7) - 1],
+ [-(1 << 15), (1 << 15) - 1],
+ [0x80000000, 0x7fffffff]
+ ];
+
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0x324);
+
+ /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType();
+ /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision();
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type);
+ /** @type {Array<Array<number>>} */ var values = [];
+ values[0] = [];
+
+ if (gluShaderUtil.isDataTypeFloatOrVec(type)) {
+ // Special cases.
+ // [dag] The special cases are 1, -1, and 0
+ var specialCases = [1.0, -1.0, 0.0];
+ for (var caseNdx = 0; caseNdx < specialCases.length; caseNdx++)
+ for (var scalarNdx = 0; scalarNdx < scalarSize; scalarNdx++) {
+ values[0].push(specialCases[caseNdx]);
+ }
+ values[0] = values[0].concat(es3fShaderCommonFunctionTests.fillRandomScalars(es3fShaderCommonFunctionTests.Types.FLOAT, rnd, floatRanges[precision][0], floatRanges[precision][1], (numValues - 3) * scalarSize));
+ } else {
+ var specialCases = [1, -1, 0];
+ for (var caseNdx = 0; caseNdx < specialCases.length; caseNdx++)
+ for (var scalarNdx = 0; scalarNdx < scalarSize; scalarNdx++) {
+ values[0].push(specialCases[caseNdx]);
+ }
+ values[0] = values[0].concat(es3fShaderCommonFunctionTests.fillRandomScalars(es3fShaderCommonFunctionTests.Types.INT, rnd, intRanges[precision][0], intRanges[precision][1], (numValues - 3) * scalarSize));
+ }
+
+ return values;
+ };
+
+ /**
+ * @param {*} inputs
+ * @param {*} outputs
+ * @return {boolean}
+ */
+ es3fShaderCommonFunctionTests.SignCase.prototype.compare = function(inputs, outputs) {
+ /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType();
+ /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision();
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type);
+
+ /** @type {number} */ var in0;
+ /** @type {number} */ var out0;
+ /** @type {number} */ var ref0;
+
+ if (gluShaderUtil.isDataTypeFloatOrVec(type)) {
+ // Both highp and mediump should be able to represent -1, 0, and +1 exactly
+ /** @type {number} */ var maxUlpDiff = precision === gluShaderUtil.precision.PRECISION_LOWP ?
+ es3fShaderCommonFunctionTests.getMaxUlpDiffFromBits(es3fShaderCommonFunctionTests.getMinMantissaBits(precision)) :
+ 0;
+
+ for (var compNdx = 0; compNdx < scalarSize; compNdx++) {
+ in0 = inputs[0][compNdx];
+ out0 = outputs[0][compNdx];
+ ref0 = in0 < 0.0 ? -1.0 :
+ in0 > 0.0 ? 1.0 : 0.0;
+ /** @type {number} */ var ulpDiff0 = es3fShaderCommonFunctionTests.getUlpDiff(out0, ref0);
+
+ if (ulpDiff0 > maxUlpDiff) {
+ this.m_failMsg += 'Expected [' + compNdx + '] = ' + ref0 /*HexFloat(ref0)*/ + ' with ULP threshold ' + maxUlpDiff + ', got ULP diff ' + ulpDiff0;
+ return false;
+ }
+ }
+ } else {
+ for (var compNdx = 0; compNdx < scalarSize; compNdx++) {
+ in0 = inputs[0][compNdx];
+ out0 = outputs[0][compNdx];
+ ref0 = in0 < 0 ? -1 :
+ in0 > 0 ? 1 : 0;
+
+ if (out0 != ref0) {
+ this.m_failMsg += 'Expected [' + compNdx + '] = ' + ref0;
+ return false;
+ }
+ }
+ }
+
+ return true;
+ };
+
+ /**
+ * @param {number} v
+ * @return {number}
+ */
+ es3fShaderCommonFunctionTests.roundEven = function(v) {
+ /** @type {number} */ var q = deMath.deFloatFrac(v);
+ /** @type {number} */ var truncated = Math.trunc(v - q);
+ /** @type {number} */ var rounded = (q > 0.5) ? (truncated + 1) : // Rounded up
+ (q == 0.5 && (truncated % 2 != 0)) ? (truncated + 1) : // Round to nearest even at 0.5
+ truncated; // Rounded down
+ return rounded;
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fShaderCommonFunctionTests.CommonFunctionCase}
+ * @param {gluShaderUtil.DataType} baseType
+ * @param {gluShaderUtil.precision} precision
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+ es3fShaderCommonFunctionTests.RoundEvenCase = function(baseType, precision, shaderType) {
+ es3fShaderCommonFunctionTests.CommonFunctionCase.call(this,
+ es3fShaderCommonFunctionTests.getCommonFuncCaseName(baseType, precision, shaderType),
+ 'roundEven', shaderType);
+ this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(baseType, precision)));
+ this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(baseType, precision)));
+ this.m_spec.source = 'out0 = roundEven(in0);';
+ };
+
+ es3fShaderCommonFunctionTests.RoundEvenCase.prototype = Object.create(es3fShaderCommonFunctionTests.CommonFunctionCase.prototype);
+ es3fShaderCommonFunctionTests.RoundEvenCase.prototype.constructor = es3fShaderCommonFunctionTests.RoundEvenCase;
+
+ /**
+ * @param {number} numValues
+ * @return {*}
+ */
+ es3fShaderCommonFunctionTests.RoundEvenCase.prototype.getInputValues = function(numValues) {
+ /** @type {Array<Array<number>>} */ var ranges = [
+ [-2.0, 2.0], // lowp
+ [-1e3, 1e3], // mediump
+ [-1e7, 1e7] // highp
+ ];
+
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0xac23f);
+
+ /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType();
+ /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision();
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type);
+ /** @type {number} */ var numSpecialCases = 0;
+ /** @type {Array<Array<number>>} */ var values = [];
+ values[0] = [];
+ // Special cases.
+ if (precision !== gluShaderUtil.precision.PRECISION_LOWP) {
+ assertMsgOptions(numValues >= 20, 'numValues should be greater or equal than 20', false, true);
+ for (var ndx = 0; ndx < 20; ndx++) {
+ /** @type {number} */ var v = deMath.clamp(ndx - 10.5, ranges[precision][0], ranges[precision][1]);
+ for (var scalarNdx = 0; scalarNdx < scalarSize; scalarNdx++) {
+ values[0].push(v);
+ }
+ numSpecialCases += 1;
+ }
+ }
+
+ // Random cases.
+ values[0] = values[0].concat(es3fShaderCommonFunctionTests.fillRandomScalars(es3fShaderCommonFunctionTests.Types.FLOAT, rnd, ranges[precision][0], ranges[precision][1], (numValues - numSpecialCases) * scalarSize));
+
+ // If precision is mediump, make sure values can be represented in fp16 exactly
+ if (precision === gluShaderUtil.precision.PRECISION_MEDIUMP)
+ es3fShaderCommonFunctionTests.vecToFloat16(values[0]);
+
+ return values;
+ };
+
+ /**
+ * @param {*} inputs
+ * @param {*} outputs
+ * @return {boolean}
+ */
+ es3fShaderCommonFunctionTests.RoundEvenCase.prototype.compare = function(inputs, outputs) {
+ /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType();
+ /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision();
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type);
+ /** @type {number} */ var in0;
+ /** @type {number} */ var out0;
+
+ if (precision == gluShaderUtil.precision.PRECISION_HIGHP || precision == gluShaderUtil.precision.PRECISION_MEDIUMP) {
+ // Require exact rounding result.
+ for (var compNdx = 0; compNdx < scalarSize; compNdx++) {
+ in0 = inputs[0][compNdx];
+ out0 = outputs[0][compNdx];
+ /** @type {number} */ var ref = es3fShaderCommonFunctionTests.roundEven(in0);
+
+ /** @type {number} */ var ulpDiff = es3fShaderCommonFunctionTests.getUlpDiffIgnoreZeroSign(out0, ref);
+
+ if (ulpDiff > 0) {
+ this.m_failMsg += 'Expected [' + compNdx + '] = ' + ref + ', got ULP diff ' + ulpDiff;
+ return false;
+ }
+ }
+ } else {
+ /** @type {number} */ var mantissaBits = es3fShaderCommonFunctionTests.getMinMantissaBits(precision);
+ /** @type {number} */ var maxUlpDiff = es3fShaderCommonFunctionTests.getMaxUlpDiffFromBits(mantissaBits); // ULP diff for rounded integer value.
+ /** @type {number} */ var eps = es3fShaderCommonFunctionTests.getEpsFromBits(1.0, mantissaBits); // epsilon for rounding bounds
+
+ for (var compNdx = 0; compNdx < scalarSize; compNdx++) {
+ in0 = inputs[0][compNdx];
+ out0 = outputs[0][compNdx];
+ /** @type {number} */ var minRes = Math.floor(es3fShaderCommonFunctionTests.roundEven(in0 - eps));
+ /** @type {number} */ var maxRes = Math.floor(es3fShaderCommonFunctionTests.roundEven(in0 + eps));
+ /** @type {boolean} */ var anyOk = false;
+
+ for (var roundedVal = minRes; roundedVal <= maxRes; roundedVal++) {
+ ulpDiff = es3fShaderCommonFunctionTests.getUlpDiffIgnoreZeroSign(out0, roundedVal);
+
+ if (ulpDiff <= maxUlpDiff) {
+ anyOk = true;
+ break;
+ }
+ }
+
+ if (!anyOk) {
+ this.m_failMsg += 'Expected [' + compNdx + '] = [' + minRes + ', ' + maxRes + '] with ULP threshold ' + maxUlpDiff;
+ return false;
+ }
+ }
+ }
+
+ return true;
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fShaderCommonFunctionTests.CommonFunctionCase}
+ * @param {gluShaderUtil.DataType} baseType
+ * @param {gluShaderUtil.precision} precision
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+ es3fShaderCommonFunctionTests.ModfCase = function(baseType, precision, shaderType) {
+ es3fShaderCommonFunctionTests.CommonFunctionCase.call(this,
+ es3fShaderCommonFunctionTests.getCommonFuncCaseName(baseType, precision, shaderType),
+ 'modf', shaderType);
+ this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(baseType, precision)));
+ this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(baseType, precision)));
+ this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out1', gluVarType.newTypeBasic(baseType, precision)));
+ this.m_spec.source = 'out0 = modf(in0, out1);';
+ };
+
+ es3fShaderCommonFunctionTests.ModfCase.prototype = Object.create(es3fShaderCommonFunctionTests.CommonFunctionCase.prototype);
+ es3fShaderCommonFunctionTests.ModfCase.prototype.constructor = es3fShaderCommonFunctionTests.ModfCase;
+
+ /**
+ * @param {number} numValues
+ * @return {*}
+ */
+ es3fShaderCommonFunctionTests.ModfCase.prototype.getInputValues = function(numValues) {
+ /** @type {Array<Array<number>>} */ var ranges = [
+ [-2.0, 2.0], // lowp
+ [-1e3, 1e3], // mediump
+ [-1e7, 1e7] // highp
+ ];
+
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0xac23f);
+
+ /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType();
+ /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision();
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type);
+ /** @type {Array<Array<number>>} */ var values = [];
+ values[0] = es3fShaderCommonFunctionTests.fillRandomScalars(es3fShaderCommonFunctionTests.Types.FLOAT, rnd, ranges[precision][0], ranges[precision][1], numValues * scalarSize);
+
+ return values;
+ };
+
+ /**
+ * @param {*} inputs
+ * @param {*} outputs
+ * @return {boolean}
+ */
+ es3fShaderCommonFunctionTests.ModfCase.prototype.compare = function(inputs, outputs) {
+ /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType();
+ /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision();
+ /** @type {boolean} */ var hasZeroSign = es3fShaderCommonFunctionTests.supportsSignedZero(precision);
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type);
+ /** @type {number} */ var mantissaBits = es3fShaderCommonFunctionTests.getMinMantissaBits(precision);
+ /** @type {number} */ var in0;
+ /** @type {number} */ var out0;
+ /** @type {number} */ var out1;
+
+ for (var compNdx = 0; compNdx < scalarSize; compNdx++) {
+ in0 = inputs[0][compNdx];
+ out0 = outputs[0][compNdx];
+ out1 = outputs[1][compNdx];
+
+ /** @type {number} */ var refOut1 = Math.floor(in0);
+ /** @type {number} */ var refOut0 = in0 - refOut1;
+
+ /** @type {number} */ var bitsLost = precision != gluShaderUtil.precision.PRECISION_HIGHP ? es3fShaderCommonFunctionTests.numBitsLostInOp(in0, refOut0) : 0;
+ /** @type {number} */ var maxUlpDiff = es3fShaderCommonFunctionTests.getMaxUlpDiffFromBits(Math.max(mantissaBits - bitsLost, 0));
+
+ /** @type {number} */ var resSum = out0 + out1;
+
+ /** @type {number} */ var ulpDiff = hasZeroSign ? es3fShaderCommonFunctionTests.getUlpDiff(resSum, in0) : es3fShaderCommonFunctionTests.getUlpDiffIgnoreZeroSign(resSum, in0);
+
+ if (ulpDiff > maxUlpDiff) {
+ this.m_failMsg += 'Expected [' + compNdx + '] = (' + refOut0 + ') + (' + refOut1 + ') = ' + in0 + ' with ULP threshold ' +
+ maxUlpDiff + ', got ULP diff ' + ulpDiff;
+ return false;
+ }
+ }
+
+ return true;
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fShaderCommonFunctionTests.CommonFunctionCase}
+ * @param {gluShaderUtil.DataType} baseType
+ * @param {gluShaderUtil.precision} precision
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+ es3fShaderCommonFunctionTests.IsnanCase = function(baseType, precision, shaderType) {
+ es3fShaderCommonFunctionTests.CommonFunctionCase.call(this,
+ es3fShaderCommonFunctionTests.getCommonFuncCaseName(baseType, precision, shaderType),
+ 'isnan', shaderType);
+ assertMsgOptions(gluShaderUtil.isDataTypeFloatOrVec(baseType), 'Assert error.', false, true);
+
+ /** @type {number} */ var vecSize = gluShaderUtil.getDataTypeScalarSize(baseType);
+ /** @type {gluShaderUtil.DataType} */ var boolType = vecSize > 1 ?
+ gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.BOOL, vecSize) :
+ gluShaderUtil.DataType.BOOL;
+
+ this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(baseType, precision)));
+ this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(boolType)));
+ this.m_spec.source = 'out0 = isnan(in0);';
+ };
+
+ es3fShaderCommonFunctionTests.IsnanCase.prototype = Object.create(es3fShaderCommonFunctionTests.CommonFunctionCase.prototype);
+ es3fShaderCommonFunctionTests.IsnanCase.prototype.constructor = es3fShaderCommonFunctionTests.IsnanCase;
+
+ /**
+ * @param {number} numValues
+ * @return {*}
+ */
+ es3fShaderCommonFunctionTests.IsnanCase.prototype.getInputValues = function(numValues) {
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0xc2a39f);
+
+ /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType();
+ /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision();
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type);
+ /** @type {number} */ var mantissaBits = es3fShaderCommonFunctionTests.getMinMantissaBits(precision);
+ /** @type {number} */ var mantissaMask = (~es3fShaderCommonFunctionTests.getMaxUlpDiffFromBits(mantissaBits)) & ((1 << 23) - 1);
+ /** @type {Array<Array<number>>} */ var values = [];
+ values[0] = [];
+
+ for (var valNdx = 0; valNdx < numValues * scalarSize; valNdx++) {
+ /** @type {boolean} */ var isNan = rnd.getFloat() > 0.3;
+ /** @type {boolean} */ var isInf = !isNan && rnd.getFloat() > 0.4;
+ /** @type {number} */ var mantissa = !isInf ? ((1 << 22) | (Math.abs(rnd.getInt()) & mantissaMask)) : 0;
+ /** @type {number} */ var exp = !isNan && !isInf ? (Math.abs(rnd.getInt()) & 0x7f) : 0xff;
+ /** @type {number} */ var sign = Math.abs(rnd.getInt()) & 0x1;
+ /** @type {number} */ var value = (sign << 31) | (exp << 23) | mantissa;
+
+ // Convert int to float.
+ var view = new DataView(new ArrayBuffer(4));
+ view.setInt32(0, value, true);
+ value = view.getFloat32(0, true);
+
+ assertMsgOptions(tcuFloat.newFloat32(value).isInf() === isInf && tcuFloat.newFloat32(value).isNaN() === isNan, 'Assert error.', false, true);
+
+ values[0].push(value);
+ }
+
+ return values;
+ };
+
+ /**
+ * @param {*} inputs
+ * @param {*} outputs
+ * @return {boolean}
+ */
+ es3fShaderCommonFunctionTests.IsnanCase.prototype.compare = function(inputs, outputs) {
+ /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType();
+ /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision();
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type);
+
+ /** @type {number} */ var in0;
+ /** @type {number} */ var out0;
+ /** @type {number} */ var ref;
+
+ if (precision === gluShaderUtil.precision.PRECISION_HIGHP) {
+ for (var compNdx = 0; compNdx < scalarSize; compNdx++) {
+ in0 = inputs[0][compNdx];
+ out0 = outputs[0][compNdx];
+ ref = tcuFloat.newFloat32(in0).isNaN() ? 1 : 0;
+
+ if (out0 !== ref) {
+ this.m_failMsg += 'Expected [' + compNdx + '] = ' + ref;
+ return false;
+ }
+ }
+ } else {
+ for (var compNdx = 0; compNdx < scalarSize; compNdx++) {
+ out0 = outputs[0][compNdx];
+
+ if (out0 !== 0 && out0 !== 1) {
+ this.m_failMsg += 'Expected [' + compNdx + '] = 0 / 1';
+ return false;
+ }
+ }
+ }
+ return true;
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fShaderCommonFunctionTests.CommonFunctionCase}
+ * @param {gluShaderUtil.DataType} baseType
+ * @param {gluShaderUtil.precision} precision
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+ es3fShaderCommonFunctionTests.IsinfCase = function(baseType, precision, shaderType) {
+ es3fShaderCommonFunctionTests.CommonFunctionCase.call(this,
+ es3fShaderCommonFunctionTests.getCommonFuncCaseName(baseType, precision, shaderType),
+ 'isinf', shaderType);
+ assertMsgOptions(gluShaderUtil.isDataTypeFloatOrVec(baseType), 'Assert error.', false, true);
+
+ /** @type {number} */ var vecSize = gluShaderUtil.getDataTypeScalarSize(baseType);
+ /** @type {gluShaderUtil.DataType} */ var boolType = vecSize > 1 ?
+ gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.BOOL, vecSize) :
+ gluShaderUtil.DataType.BOOL;
+
+ this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(baseType, precision)));
+ this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(boolType)));
+ this.m_spec.source = 'out0 = isinf(in0);';
+ };
+
+ es3fShaderCommonFunctionTests.IsinfCase.prototype = Object.create(es3fShaderCommonFunctionTests.CommonFunctionCase.prototype);
+ es3fShaderCommonFunctionTests.IsinfCase.prototype.constructor = es3fShaderCommonFunctionTests.IsinfCase;
+
+ /**
+ * @param {number} numValues
+ * @return {*}
+ */
+ es3fShaderCommonFunctionTests.IsinfCase.prototype.getInputValues = function(numValues) {
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0xc2a39f);
+
+ /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType();
+ /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision();
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type);
+ /** @type {number} */ var mantissaBits = es3fShaderCommonFunctionTests.getMinMantissaBits(precision);
+ /** @type {number} */ var mantissaMask = (~es3fShaderCommonFunctionTests.getMaxUlpDiffFromBits(mantissaBits)) & ((1 << 23) - 1);
+ /** @type {Array<Array<number>>} */ var values = [];
+ values[0] = [];
+
+ for (var valNdx = 0; valNdx < numValues * scalarSize; valNdx++) {
+ /** @type {boolean} */ var isInf = rnd.getFloat() > 0.3;
+ /** @type {boolean} */ var isNan = !isInf && rnd.getFloat() > 0.4;
+ /** @type {number} */ var mantissa = !isInf ? ((1 << 22) | (Math.abs(rnd.getInt()) & mantissaMask)) : 0;
+ /** @type {number} */ var exp = !isNan && !isInf ? (Math.abs(rnd.getInt()) & 0x7f) : 0xff;
+ /** @type {number} */ var sign = Math.abs(rnd.getInt()) & 0x1;
+ /** @type {number} */ var value = (sign << 31) | (exp << 23) | mantissa;
+
+ // Convert int to float.
+ var view = new DataView(new ArrayBuffer(4));
+ view.setInt32(0, value, true);
+ value = view.getFloat32(0, true);
+
+ assertMsgOptions(tcuFloat.newFloat32(value).isInf() === isInf && tcuFloat.newFloat32(value).isNaN() === isNan, 'Assert error.', false, true);
+
+ values[0].push(value);
+ }
+
+ return values;
+ };
+
+ /**
+ * @param {*} inputs
+ * @param {*} outputs
+ * @return {boolean}
+ */
+ es3fShaderCommonFunctionTests.IsinfCase.prototype.compare = function(inputs, outputs) {
+ /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType();
+ /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision();
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type);
+
+ /** @type {number} */ var in0;
+ /** @type {number} */ var out0;
+ /** @type {number} */ var ref;
+
+ if (precision === gluShaderUtil.precision.PRECISION_HIGHP) {
+ for (var compNdx = 0; compNdx < scalarSize; compNdx++) {
+ in0 = inputs[0][compNdx];
+ out0 = outputs[0][compNdx];
+ ref = tcuFloat.newFloat32(in0).isInf() ? 1 : 0;
+
+ if (out0 !== ref) {
+ this.m_failMsg += 'Expected [' + compNdx + '] = ' + ref;
+ return false;
+ }
+ }
+ } else {
+ for (var compNdx = 0; compNdx < scalarSize; compNdx++) {
+ out0 = outputs[0][compNdx];
+
+ if (out0 !== 0 && out0 !== 1) {
+ this.m_failMsg += 'Expected [' + compNdx + '] = 0 / 1';
+ return false;
+ }
+ }
+ }
+ return true;
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fShaderCommonFunctionTests.CommonFunctionCase}
+ * @param {gluShaderUtil.DataType} baseType
+ * @param {gluShaderUtil.precision} precision
+ * @param {gluShaderProgram.shaderType} shaderType
+ * @param {boolean} outIsSigned
+ */
+ es3fShaderCommonFunctionTests.FloatBitsToUintIntCase = function(baseType, precision, shaderType, outIsSigned) {
+ es3fShaderCommonFunctionTests.CommonFunctionCase.call(this,
+ es3fShaderCommonFunctionTests.getCommonFuncCaseName(baseType, precision, shaderType),
+ outIsSigned ? 'floatBitsToInt' : 'floatBitsToUint', shaderType);
+
+ /** @type {number} */ var vecSize = gluShaderUtil.getDataTypeScalarSize(baseType);
+ /** @type {gluShaderUtil.DataType} */ var intType = outIsSigned ?
+ (vecSize > 1 ? gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.INT, vecSize) : gluShaderUtil.DataType.INT) :
+ (vecSize > 1 ? gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.UINT, vecSize) : gluShaderUtil.DataType.UINT);
+
+ this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(baseType, precision)));
+ this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(intType, gluShaderUtil.precision.PRECISION_HIGHP)));
+ this.m_spec.source = outIsSigned ? 'out0 = floatBitsToInt(in0);' : 'out0 = floatBitsToUint(in0);';
+ };
+
+ es3fShaderCommonFunctionTests.FloatBitsToUintIntCase.prototype = Object.create(es3fShaderCommonFunctionTests.CommonFunctionCase.prototype);
+ es3fShaderCommonFunctionTests.FloatBitsToUintIntCase.prototype.constructor = es3fShaderCommonFunctionTests.FloatBitsToUintIntCase;
+
+ /**
+ * @param {number} numValues
+ * @return {*}
+ */
+ es3fShaderCommonFunctionTests.FloatBitsToUintIntCase.prototype.getInputValues = function(numValues) {
+
+ /** @type {Array<number>} */ var ranges = [
+ [-2.0, 2.0], // lowp
+ [-1e3, 1e3], // mediump
+ [-1e7, 1e7] // highp
+ ];
+
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0x2790a);
+
+ /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType();
+ /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision();
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type);
+ /** @type {Array<Array<number>>} */ var values = [];
+
+ values[0] = es3fShaderCommonFunctionTests.fillRandomScalars(es3fShaderCommonFunctionTests.Types.FLOAT, rnd, ranges[precision][0], ranges[precision][1], numValues * scalarSize);
+ return values;
+ };
+
+ /**
+ * @param {*} inputs
+ * @param {*} outputs
+ * @return {boolean}
+ */
+ es3fShaderCommonFunctionTests.FloatBitsToUintIntCase.prototype.compare = function(inputs, outputs) {
+ /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType();
+ /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision();
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type);
+ /** @type {number} */ var mantissaBits = es3fShaderCommonFunctionTests.getMinMantissaBits(precision);
+ /** @type {number} */ var maxUlpDiff = es3fShaderCommonFunctionTests.getMaxUlpDiffFromBits(mantissaBits);
+
+ /** @type {number} */ var in0;
+ /** @type {number} */ var out0;
+ /** @type {number} */ var refOut0;
+ /** @type {number} */ var ulpDiff;
+
+ for (var compNdx = 0; compNdx < scalarSize; compNdx++) {
+ in0 = inputs[0][compNdx];
+ out0 = outputs[0][compNdx];
+
+ // Convert int to uint because ref out is in uint format.
+ var view = new DataView(new ArrayBuffer(4));
+ view.setInt32(0, out0, true);
+ out0 = view.getUint32(0, true);
+
+ refOut0 = tcuFloat.newFloat32(in0).bits();
+ ulpDiff = Math.abs(out0 - refOut0);
+ if (ulpDiff > maxUlpDiff) {
+ this.m_failMsg += 'Expected [' + compNdx + '] = ' + refOut0 + ' with threshold ' +
+ maxUlpDiff + ', got diff ' + ulpDiff;
+ return false;
+ }
+ }
+ return true;
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fShaderCommonFunctionTests.FloatBitsToUintIntCase}
+ * @param {gluShaderUtil.DataType} baseType
+ * @param {gluShaderUtil.precision} precision
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+ es3fShaderCommonFunctionTests.FloatBitsToIntCase = function(baseType, precision, shaderType) {
+ es3fShaderCommonFunctionTests.FloatBitsToUintIntCase.call(this, baseType, precision, shaderType, true);
+ };
+
+ es3fShaderCommonFunctionTests.FloatBitsToIntCase.prototype = Object.create(es3fShaderCommonFunctionTests.FloatBitsToUintIntCase.prototype);
+ es3fShaderCommonFunctionTests.FloatBitsToIntCase.prototype.constructor = es3fShaderCommonFunctionTests.FloatBitsToIntCase;
+
+ /**
+ * @constructor
+ * @extends {es3fShaderCommonFunctionTests.FloatBitsToUintIntCase}
+ * @param {gluShaderUtil.DataType} baseType
+ * @param {gluShaderUtil.precision} precision
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+ es3fShaderCommonFunctionTests.FloatBitsToUintCase = function(baseType, precision, shaderType) {
+ es3fShaderCommonFunctionTests.FloatBitsToUintIntCase.call(this, baseType, precision, shaderType, false);
+ };
+
+ es3fShaderCommonFunctionTests.FloatBitsToUintCase.prototype = Object.create(es3fShaderCommonFunctionTests.FloatBitsToUintIntCase.prototype);
+ es3fShaderCommonFunctionTests.FloatBitsToUintCase.prototype.constructor = es3fShaderCommonFunctionTests.FloatBitsToUintCase;
+
+ /**
+ * @constructor
+ * @extends {es3fShaderCommonFunctionTests.CommonFunctionCase}
+ * @param {gluShaderUtil.DataType} baseType
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+ es3fShaderCommonFunctionTests.BitsToFloatCase = function(baseType, shaderType) {
+ es3fShaderCommonFunctionTests.CommonFunctionCase.call(this,
+ es3fShaderCommonFunctionTests.getCommonFuncCaseName(baseType, gluShaderUtil.precision.PRECISION_HIGHP, shaderType),
+ gluShaderUtil.isDataTypeIntOrIVec(baseType) ? 'intBitsToFloat' : 'uintBitsToFloat', shaderType);
+ /** @type {boolean} */ var inIsSigned = gluShaderUtil.isDataTypeIntOrIVec(baseType);
+ /** @type {number} */ var vecSize = gluShaderUtil.getDataTypeScalarSize(baseType);
+ /** @type {gluShaderUtil.DataType} */ var floatType = vecSize > 1 ? gluShaderUtil.getDataTypeFloatVec(vecSize) : gluShaderUtil.DataType.FLOAT;
+
+ this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(baseType, gluShaderUtil.precision.PRECISION_HIGHP)));
+ this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(floatType, gluShaderUtil.precision.PRECISION_HIGHP)));
+ this.m_spec.source = inIsSigned ? 'out0 = intBitsToFloat(in0);' : 'out0 = uintBitsToFloat(in0);';
+ };
+
+ es3fShaderCommonFunctionTests.BitsToFloatCase.prototype = Object.create(es3fShaderCommonFunctionTests.CommonFunctionCase.prototype);
+ es3fShaderCommonFunctionTests.BitsToFloatCase.prototype.constructor = es3fShaderCommonFunctionTests.BitsToFloatCase;
+
+ /**
+ * @param {number} numValues
+ * @return {*}
+ */
+ es3fShaderCommonFunctionTests.BitsToFloatCase.prototype.getInputValues = function(numValues) {
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0xbbb225);
+
+ /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType();
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type);
+ /** @type {Array<number>} */ var range = [-1e8, 1e8];
+ /** @type {Array<Array<number>>} */ var values = [];
+
+ values[0] = es3fShaderCommonFunctionTests.fillRandomScalars(es3fShaderCommonFunctionTests.Types.FLOAT, rnd, range[0], range[1], numValues * scalarSize);
+ return values;
+ };
+
+ /**
+ * @param {*} inputs
+ * @param {*} outputs
+ * @return {boolean}
+ */
+ es3fShaderCommonFunctionTests.BitsToFloatCase.prototype.compare = function(inputs, outputs) {
+ /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType();
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type);
+ /** @type {number} */ var maxUlpDiff = 0;
+
+ /** @type {number} */ var in0;
+ /** @type {number} */ var out0;
+ /** @type {number} */ var ulpDiff;
+ /** @type {number} */ var refOut0;
+
+ for (var compNdx = 0; compNdx < scalarSize; compNdx++) {
+ in0 = inputs[0][compNdx];
+ out0 = outputs[0][compNdx];
+
+ // Convert int to float
+ var view = new DataView(new ArrayBuffer(4));
+ view.setInt32(0, in0, true);
+ in0 = view.getFloat32(0, true);
+
+ ulpDiff = es3fShaderCommonFunctionTests.getUlpDiff(in0, out0);
+ if (ulpDiff > maxUlpDiff) {
+ this.m_failMsg += 'Expected [' + compNdx + '] = ' + in0 + ' with ULP threshold ' +
+ maxUlpDiff + ', got ULP diff ' + ulpDiff;
+ return false;
+ }
+ }
+ return true;
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fShaderCommonFunctionTests.CommonFunctionCase}
+ * @param {gluShaderUtil.DataType} baseType
+ * @param {gluShaderUtil.precision} precision
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+ es3fShaderCommonFunctionTests.FloorCase = function(baseType, precision, shaderType) {
+ es3fShaderCommonFunctionTests.CommonFunctionCase.call(this,
+ es3fShaderCommonFunctionTests.getCommonFuncCaseName(baseType, precision, shaderType),
+ 'floor', shaderType);
+ this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(baseType, precision)));
+ this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(baseType, precision)));
+ this.m_spec.source = 'out0 = floor(in0);';
+ };
+
+ es3fShaderCommonFunctionTests.FloorCase.prototype = Object.create(es3fShaderCommonFunctionTests.CommonFunctionCase.prototype);
+ es3fShaderCommonFunctionTests.FloorCase.prototype.constructor = es3fShaderCommonFunctionTests.FloorCase;
+
+ /**
+ * @param {number} numValues
+ * @return {*}
+ */
+ es3fShaderCommonFunctionTests.FloorCase.prototype.getInputValues = function(numValues) {
+ /** @type {Array<Array<number>>} */ var ranges = [
+ [-2.0, 2.0], // lowp
+ [-1e3, 1e3], // mediump
+ [-1e7, 1e7] // highp
+ ];
+
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0xac23f);
+
+ /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType();
+ /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision();
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type);
+ /** @type {Array<Array<number>>} */ var values = [];
+ // Random cases.
+ values[0] = es3fShaderCommonFunctionTests.fillRandomScalars(es3fShaderCommonFunctionTests.Types.FLOAT, rnd, ranges[precision][0], ranges[precision][1], numValues * scalarSize);
+
+ // If precision is mediump, make sure values can be represented in fp16 exactly
+ if (precision === gluShaderUtil.precision.PRECISION_MEDIUMP)
+ es3fShaderCommonFunctionTests.vecToFloat16(values[0]);
+
+ return values;
+ };
+
+ /**
+ * @param {*} inputs
+ * @param {*} outputs
+ * @return {boolean}
+ */
+ es3fShaderCommonFunctionTests.FloorCase.prototype.compare = function(inputs, outputs) {
+ /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType();
+ /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision();
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type);
+
+ /** @type {number} */ var in0;
+ /** @type {number} */ var out0;
+ /** @type {number} */ var ref;
+ /** @type {number} */ var ulpDiff;
+
+ if (precision === gluShaderUtil.precision.PRECISION_HIGHP || precision === gluShaderUtil.precision.PRECISION_MEDIUMP) {
+ // Require exact result.
+ for (var compNdx = 0; compNdx < scalarSize; compNdx++) {
+ in0 = inputs[0][compNdx];
+ out0 = outputs[0][compNdx];
+ ref = Math.floor(in0);
+
+ ulpDiff = es3fShaderCommonFunctionTests.getUlpDiff(out0, ref);
+
+ if (ulpDiff > 0) {
+ this.m_failMsg += 'Expected [' + compNdx + '] = ' + ref + ', got ULP diff ' + ulpDiff;
+ return false;
+ }
+ }
+ } else {
+ /** @type {number} */ var mantissaBits = es3fShaderCommonFunctionTests.getMinMantissaBits(precision);
+ /** @type {number} */ var maxUlpDiff = es3fShaderCommonFunctionTests.getMaxUlpDiffFromBits(mantissaBits); // ULP diff for rounded integer value.
+ /** @type {number} */ var eps = es3fShaderCommonFunctionTests.getEpsFromBits(1.0, mantissaBits); // epsilon for rounding bounds
+
+ for (var compNdx = 0; compNdx < scalarSize; compNdx++) {
+ in0 = inputs[0][compNdx];
+ out0 = outputs[0][compNdx];
+ /** @type {number} */ var minRes = Math.floor(in0 - eps);
+ /** @type {number} */ var maxRes = Math.floor(in0 + eps);
+ /** @type {boolean} */ var anyOk = false;
+
+ for (var roundedVal = minRes; roundedVal <= maxRes; roundedVal++) {
+ ulpDiff = es3fShaderCommonFunctionTests.getUlpDiff(out0, roundedVal);
+
+ if (ulpDiff <= maxUlpDiff) {
+ anyOk = true;
+ break;
+ }
+ }
+
+ if (!anyOk) {
+ this.m_failMsg += 'Expected [' + compNdx + '] = [' + minRes + ', ' + maxRes + '] with ULP threshold ' + maxUlpDiff;
+ return false;
+ }
+ }
+ }
+
+ return true;
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fShaderCommonFunctionTests.CommonFunctionCase}
+ * @param {gluShaderUtil.DataType} baseType
+ * @param {gluShaderUtil.precision} precision
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+ es3fShaderCommonFunctionTests.TruncCase = function(baseType, precision, shaderType) {
+ es3fShaderCommonFunctionTests.CommonFunctionCase.call(this,
+ es3fShaderCommonFunctionTests.getCommonFuncCaseName(baseType, precision, shaderType),
+ 'trunc', shaderType);
+ this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(baseType, precision)));
+ this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(baseType, precision)));
+ this.m_spec.source = 'out0 = trunc(in0);';
+ };
+
+ es3fShaderCommonFunctionTests.TruncCase.prototype = Object.create(es3fShaderCommonFunctionTests.CommonFunctionCase.prototype);
+ es3fShaderCommonFunctionTests.TruncCase.prototype.constructor = es3fShaderCommonFunctionTests.TruncCase;
+
+ /**
+ * @param {number} numValues
+ * @return {*}
+ */
+ es3fShaderCommonFunctionTests.TruncCase.prototype.getInputValues = function(numValues) {
+ /** @type {Array<Array<number>>} */ var ranges = [
+ [-2.0, 2.0], // lowp
+ [-1e3, 1e3], // mediump
+ [-1e7, 1e7] // highp
+ ];
+
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0xac23f);
+
+ /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType();
+ /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision();
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type);
+
+ /** @type {Array<number>} */ var specialCases = [0.0, -0.0, -0.9, 0.9, 1.0, -1.0];
+ /** @type {Array<Array<number>>} */ var values = [];
+ values[0] = [];
+
+ // Special cases
+ for (var caseNdx = 0; caseNdx < specialCases.length; caseNdx++)
+ for (var scalarNdx = 0; scalarNdx < scalarSize; scalarNdx++)
+ values[0].push(specialCases[caseNdx]);
+
+ // Random cases.
+ values[0] = values[0].concat(es3fShaderCommonFunctionTests.fillRandomScalars(es3fShaderCommonFunctionTests.Types.FLOAT, rnd, ranges[precision][0], ranges[precision][1], (numValues - specialCases.length) * scalarSize));
+
+ // If precision is mediump, make sure values can be represented in fp16 exactly
+ if (precision === gluShaderUtil.precision.PRECISION_MEDIUMP)
+ es3fShaderCommonFunctionTests.vecToFloat16(values[0]);
+
+ return values;
+ };
+
+ /**
+ * @param {*} inputs
+ * @param {*} outputs
+ * @return {boolean}
+ */
+ es3fShaderCommonFunctionTests.TruncCase.prototype.compare = function(inputs, outputs) {
+ /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType();
+ /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision();
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type);
+
+ /** @type {number} */ var in0;
+ /** @type {number} */ var out0;
+ /** @type {number} */ var ref;
+ /** @type {number} */ var ulpDiff;
+
+ if (precision === gluShaderUtil.precision.PRECISION_HIGHP || precision === gluShaderUtil.precision.PRECISION_MEDIUMP) {
+ // Require exact result.
+ for (var compNdx = 0; compNdx < scalarSize; compNdx++) {
+ in0 = inputs[0][compNdx];
+ out0 = outputs[0][compNdx];
+ /** @type {boolean} */ var isNeg = tcuFloat.newFloat32(in0).sign() < 0;
+ ref = isNeg ? (-Math.floor(-in0)) : Math.floor(in0);
+
+ // \note: trunc() function definition is a bit broad on negative zeros. Ignore result sign if zero.
+ ulpDiff = es3fShaderCommonFunctionTests.getUlpDiffIgnoreZeroSign(out0, ref);
+
+ if (ulpDiff > 0) {
+ this.m_failMsg += 'Expected [' + compNdx + '] = ' + ref + ', got ULP diff ' + ulpDiff;
+ return false;
+ }
+ }
+ } else {
+ /** @type {number} */ var mantissaBits = es3fShaderCommonFunctionTests.getMinMantissaBits(precision);
+ /** @type {number} */ var maxUlpDiff = es3fShaderCommonFunctionTests.getMaxUlpDiffFromBits(mantissaBits); // ULP diff for rounded integer value.
+ /** @type {number} */ var eps = es3fShaderCommonFunctionTests.getEpsFromBits(1.0, mantissaBits); // epsilon for rounding bounds
+
+ for (var compNdx = 0; compNdx < scalarSize; compNdx++) {
+ in0 = inputs[0][compNdx];
+ out0 = outputs[0][compNdx];
+ /** @type {number} */ var minRes = Math.trunc(in0 - eps);
+ /** @type {number} */ var maxRes = Math.trunc(in0 + eps);
+ /** @type {boolean} */ var anyOk = false;
+
+ for (var roundedVal = minRes; roundedVal <= maxRes; roundedVal++) {
+ ulpDiff = es3fShaderCommonFunctionTests.getUlpDiffIgnoreZeroSign(out0, roundedVal);
+
+ if (ulpDiff <= maxUlpDiff) {
+ anyOk = true;
+ break;
+ }
+ }
+
+ if (!anyOk) {
+ this.m_failMsg += 'Expected [' + compNdx + '] = [' + minRes + ', ' + maxRes + '] with ULP threshold ' + maxUlpDiff;
+ return false;
+ }
+ }
+ }
+
+ return true;
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fShaderCommonFunctionTests.CommonFunctionCase}
+ * @param {gluShaderUtil.DataType} baseType
+ * @param {gluShaderUtil.precision} precision
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+ es3fShaderCommonFunctionTests.RoundCase = function(baseType, precision, shaderType) {
+ es3fShaderCommonFunctionTests.CommonFunctionCase.call(this,
+ es3fShaderCommonFunctionTests.getCommonFuncCaseName(baseType, precision, shaderType),
+ 'round', shaderType);
+ this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(baseType, precision)));
+ this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(baseType, precision)));
+ this.m_spec.source = 'out0 = round(in0);';
+ };
+
+ es3fShaderCommonFunctionTests.RoundCase.prototype = Object.create(es3fShaderCommonFunctionTests.CommonFunctionCase.prototype);
+ es3fShaderCommonFunctionTests.RoundCase.prototype.constructor = es3fShaderCommonFunctionTests.RoundCase;
+
+ /**
+ * @param {number} numValues
+ * @return {*}
+ */
+ es3fShaderCommonFunctionTests.RoundCase.prototype.getInputValues = function(numValues) {
+ /** @type {Array<Array<number>>} */ var ranges = [
+ [-2.0, 2.0], // lowp
+ [-1e3, 1e3], // mediump
+ [-1e7, 1e7] // highp
+ ];
+
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0xac23f);
+
+ /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType();
+ /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision();
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type);
+ /** @type {number} */ var numSpecialCases = 0;
+
+ /** @type {Array<Array<number>>} */ var values = [];
+ values[0] = []
+
+ // Special cases.
+ if (precision === gluShaderUtil.precision.PRECISION_LOWP) {
+ assertMsgOptions(numValues >= 10, 'Sample too small.', false, true);
+ for (var ndx = 0; ndx < 10; ndx++) {
+ /** @type {number} */ var v = deMath.clamp(ndx - 5.5, ranges[precision][0], ranges[precision][1]);
+ for (var iter = 1; iter <= scalarSize; iter++)
+ values[0].push(v);
+ numSpecialCases += 1;
+ }
+ }
+
+ // Random cases.
+ values[0] = values[0].concat(es3fShaderCommonFunctionTests.fillRandomScalars(es3fShaderCommonFunctionTests.Types.FLOAT, rnd, ranges[precision][0], ranges[precision][1], (numValues - numSpecialCases) * scalarSize));
+
+ // If precision is mediump, make sure values can be represented in fp16 exactly
+ if (precision === gluShaderUtil.precision.PRECISION_MEDIUMP)
+ es3fShaderCommonFunctionTests.vecToFloat16(values[0]);
+
+ return values;
+ };
+
+ /**
+ * @param {*} inputs
+ * @param {*} outputs
+ * @return {boolean}
+ */
+ es3fShaderCommonFunctionTests.RoundCase.prototype.compare = function(inputs, outputs) {
+ /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType();
+ /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision();
+ /** @type {boolean} */ var hasZeroSign = es3fShaderCommonFunctionTests.supportsSignedZero(precision);
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type);
+
+ /** @type {number} */ var in0;
+ /** @type {number} */ var out0;
+ /** @type {number} */ var ulpDiff;
+
+ if (precision === gluShaderUtil.precision.PRECISION_HIGHP || precision === gluShaderUtil.precision.PRECISION_MEDIUMP) {
+ // Require exact result.
+ for (var compNdx = 0; compNdx < scalarSize; compNdx++) {
+ in0 = inputs[0][compNdx];
+ out0 = outputs[0][compNdx];
+
+ if ((in0 - Math.floor(in0)) === 0.5) {
+ /** @type {number} */ var ref0 = Math.floor(in0);
+ /** @type {number} */ var ref1 = Math.ceil(in0);
+ /** @type {number} */ var ulpDiff0 = hasZeroSign ? es3fShaderCommonFunctionTests.getUlpDiff(out0, ref0) : es3fShaderCommonFunctionTests.getUlpDiffIgnoreZeroSign(out0, ref0);
+ /** @type {number} */ var ulpDiff1 = hasZeroSign ? es3fShaderCommonFunctionTests.getUlpDiff(out0, ref1) : es3fShaderCommonFunctionTests.getUlpDiffIgnoreZeroSign(out0, ref1);
+ if (ulpDiff0 > 0 && ulpDiff1 > 0) {
+ this.m_failMsg += 'Expected [' + compNdx + '] = ' + ref0 + ' or ' + ref1 + ', got ULP diff ' + Math.min(ulpDiff0, ulpDiff1);
+ return false;
+ }
+ } else {
+ // Require exact result
+ /** @type {number} */ var ref = es3fShaderCommonFunctionTests.roundEven(in0);
+ ulpDiff = hasZeroSign ? es3fShaderCommonFunctionTests.getUlpDiff(out0, ref) : es3fShaderCommonFunctionTests.getUlpDiffIgnoreZeroSign(out0, ref);
+
+ if (ulpDiff > 0) {
+ this.m_failMsg += 'Expected [' + compNdx + '] = ' + ref + ', got ULP diff ' + ulpDiff;
+ return false;
+ }
+ }
+ }
+ } else {
+ /** @type {number} */ var mantissaBits = es3fShaderCommonFunctionTests.getMinMantissaBits(precision);
+ /** @type {number} */ var maxUlpDiff = es3fShaderCommonFunctionTests.getMaxUlpDiffFromBits(mantissaBits); // ULP diff for rounded integer value.
+ /** @type {number} */ var eps = es3fShaderCommonFunctionTests.getEpsFromBits(1.0, mantissaBits); // epsilon for rounding bounds
+
+ for (var compNdx = 0; compNdx < scalarSize; compNdx++) {
+ in0 = inputs[0][compNdx];
+ out0 = outputs[0][compNdx];
+ /** @type {number} */ var minRes = Math.floor(es3fShaderCommonFunctionTests.roundEven(in0 - eps));
+ /** @type {number} */ var maxRes = Math.floor(es3fShaderCommonFunctionTests.roundEven(in0 + eps));
+ /** @type {boolean} */ var anyOk = false;
+
+ for (var roundedVal = minRes; roundedVal <= maxRes; roundedVal++) {
+ ulpDiff = es3fShaderCommonFunctionTests.getUlpDiffIgnoreZeroSign(out0, roundedVal);
+
+ if (ulpDiff <= maxUlpDiff) {
+ anyOk = true;
+ break;
+ }
+ }
+
+ if (!anyOk) {
+ this.m_failMsg += 'Expected [' + compNdx + '] = [' + minRes + ', ' + maxRes + '] with ULP threshold ' + maxUlpDiff;
+ return false;
+ }
+ }
+ }
+
+ return true;
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fShaderCommonFunctionTests.CommonFunctionCase}
+ * @param {gluShaderUtil.DataType} baseType
+ * @param {gluShaderUtil.precision} precision
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+ es3fShaderCommonFunctionTests.CeilCase = function(baseType, precision, shaderType) {
+ es3fShaderCommonFunctionTests.CommonFunctionCase.call(this,
+ es3fShaderCommonFunctionTests.getCommonFuncCaseName(baseType, precision, shaderType),
+ 'ceil', shaderType);
+ this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(baseType, precision)));
+ this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(baseType, precision)));
+ this.m_spec.source = 'out0 = ceil(in0);';
+ };
+
+ es3fShaderCommonFunctionTests.CeilCase.prototype = Object.create(es3fShaderCommonFunctionTests.CommonFunctionCase.prototype);
+ es3fShaderCommonFunctionTests.CeilCase.prototype.constructor = es3fShaderCommonFunctionTests.CeilCase;
+
+ /**
+ * @param {number} numValues
+ * @return {*}
+ */
+ es3fShaderCommonFunctionTests.CeilCase.prototype.getInputValues = function(numValues) {
+ /** @type {Array<Array<number>>} */ var ranges = [
+ [-2.0, 2.0], // lowp
+ [-1e3, 1e3], // mediump
+ [-1e7, 1e7] // highp
+ ];
+
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0xac23f);
+
+ /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType();
+ /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision();
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type);
+
+ /** @type {Array<Array<number>>} */ var values = [];
+
+ // Random cases.
+ values[0] = es3fShaderCommonFunctionTests.fillRandomScalars(es3fShaderCommonFunctionTests.Types.FLOAT, rnd, ranges[precision][0], ranges[precision][1], numValues * scalarSize);
+
+ // If precision is mediump, make sure values can be represented in fp16 exactly
+ if (precision === gluShaderUtil.precision.PRECISION_MEDIUMP)
+ es3fShaderCommonFunctionTests.vecToFloat16(values[0]);
+
+ return values;
+ };
+
+ /**
+ * @param {*} inputs
+ * @param {*} outputs
+ * @return {boolean}
+ */
+ es3fShaderCommonFunctionTests.CeilCase.prototype.compare = function(inputs, outputs) {
+ /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType();
+ /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision();
+ /** @type {boolean} */ var hasZeroSign = es3fShaderCommonFunctionTests.supportsSignedZero(precision);
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type);
+
+ /** @type {number} */ var in0;
+ /** @type {number} */ var out0;
+ /** @type {number} */ var ref;
+ /** @type {number} */ var ulpDiff;
+
+ if (precision === gluShaderUtil.precision.PRECISION_HIGHP || precision === gluShaderUtil.precision.PRECISION_MEDIUMP) {
+ // Require exact result.
+ for (var compNdx = 0; compNdx < scalarSize; compNdx++) {
+ in0 = inputs[0][compNdx];
+ out0 = outputs[0][compNdx];
+ ref = Math.ceil(in0);
+ ulpDiff = hasZeroSign ? es3fShaderCommonFunctionTests.getUlpDiff(out0, ref) : es3fShaderCommonFunctionTests.getUlpDiffIgnoreZeroSign(out0, ref);
+
+ if (ulpDiff > 0) {
+ this.m_failMsg += 'Expected [' + compNdx + '] = ' + ref + ', got ULP diff ' + ulpDiff;
+ return false;
+ }
+ }
+ } else {
+ /** @type {number} */ var mantissaBits = es3fShaderCommonFunctionTests.getMinMantissaBits(precision);
+ /** @type {number} */ var maxUlpDiff = es3fShaderCommonFunctionTests.getMaxUlpDiffFromBits(mantissaBits); // ULP diff for rounded integer value.
+ /** @type {number} */ var eps = es3fShaderCommonFunctionTests.getEpsFromBits(1.0, mantissaBits); // epsilon for rounding bounds
+
+ for (var compNdx = 0; compNdx < scalarSize; compNdx++) {
+ in0 = inputs[0][compNdx];
+ out0 = outputs[0][compNdx];
+ /** @type {number} */ var minRes = Math.ceil(in0 - eps);
+ /** @type {number} */ var maxRes = Math.ceil(in0 + eps);
+ /** @type {boolean} */ var anyOk = false;
+
+ for (var roundedVal = minRes; roundedVal <= maxRes; roundedVal++) {
+ ulpDiff = es3fShaderCommonFunctionTests.getUlpDiffIgnoreZeroSign(out0, roundedVal);
+
+ if (ulpDiff <= maxUlpDiff) {
+ anyOk = true;
+ break;
+ }
+ }
+
+ if (!anyOk & deMath.deInRange32(0, minRes, maxRes)) {
+ ulpDiff = Math.abs(Math.floor(tcuFloat.newFloat32(out0).bits()) - 0x80000000);
+ anyOk = ulpDiff <= maxUlpDiff;
+ }
+
+ if (!anyOk) {
+ this.m_failMsg += 'Expected [' + compNdx + '] = [' + minRes + ', ' + maxRes + '] with ULP threshold ' + maxUlpDiff;
+ return false;
+ }
+ }
+ }
+
+ return true;
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fShaderCommonFunctionTests.CommonFunctionCase}
+ * @param {gluShaderUtil.DataType} baseType
+ * @param {gluShaderUtil.precision} precision
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+ es3fShaderCommonFunctionTests.FractCase = function(baseType, precision, shaderType) {
+ es3fShaderCommonFunctionTests.CommonFunctionCase.call(this,
+ es3fShaderCommonFunctionTests.getCommonFuncCaseName(baseType, precision, shaderType),
+ 'fract', shaderType);
+ this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(baseType, precision)));
+ this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(baseType, precision)));
+ this.m_spec.source = 'out0 = fract(in0);';
+ };
+
+ es3fShaderCommonFunctionTests.FractCase.prototype = Object.create(es3fShaderCommonFunctionTests.CommonFunctionCase.prototype);
+ es3fShaderCommonFunctionTests.FractCase.prototype.constructor = es3fShaderCommonFunctionTests.FractCase;
+
+ /**
+ * @param {number} numValues
+ * @return {*}
+ */
+ es3fShaderCommonFunctionTests.FractCase.prototype.getInputValues = function(numValues) {
+ /** @type {Array<Array<number>>} */ var ranges = [
+ [-2.0, 2.0], // lowp
+ [-1e3, 1e3], // mediump
+ [-1e7, 1e7] // highp
+ ];
+
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0xac23f);
+
+ /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType();
+ /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision();
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type);
+ /** @type {number} */ var numSpecialCases = 0;
+
+ /** @type {Array<Array<number>>} */ var values = [];
+ values[0] = [];
+
+ // Special cases.
+ if (precision !== gluShaderUtil.precision.PRECISION_LOWP) {
+ assertMsgOptions(numValues >= 10, 'Sample too small.', false, true);
+ for (var ndx = 0; ndx < 10; ndx++) {
+ /** @type {number} */ var v = deMath.clamp(ndx - 5.5, ranges[precision][0], ranges[precision][1]);
+ for (var scalarNdx = 0; scalarNdx < scalarSize; scalarNdx++) {
+ values[0].push(v);
+ }
+ numSpecialCases += 1;
+ }
+ }
+
+ // Random cases.
+ values[0] = values[0].concat(es3fShaderCommonFunctionTests.fillRandomScalars(es3fShaderCommonFunctionTests.Types.FLOAT, rnd, ranges[precision][0], ranges[precision][1], (numValues - numSpecialCases) * scalarSize));
+
+ // If precision is mediump, make sure values can be represented in fp16 exactly
+ if (precision === gluShaderUtil.precision.PRECISION_MEDIUMP)
+ es3fShaderCommonFunctionTests.vecToFloat16(values[0])
+
+ return values;
+ };
+
+ /**
+ * @param {*} inputs
+ * @param {*} outputs
+ * @return {boolean}
+ */
+ es3fShaderCommonFunctionTests.FractCase.prototype.compare = function(inputs, outputs) {
+ /** @type {gluShaderUtil.DataType} */ var type = this.m_spec.inputs[0].varType.getBasicType();
+ /** @type {gluShaderUtil.precision} */ var precision = this.m_spec.inputs[0].varType.getPrecision();
+ /** @type {boolean} */ var hasZeroSign = es3fShaderCommonFunctionTests.supportsSignedZero(precision);
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(type);
+
+ /** @type {number} */ var in0;
+ /** @type {number} */ var out0;
+ /** @type {number} */ var ref;
+ /** @type {number} */ var ulpDiff;
+
+ if (precision === gluShaderUtil.precision.PRECISION_HIGHP || precision === gluShaderUtil.precision.PRECISION_MEDIUMP) {
+ // Require exact result.
+ for (var compNdx = 0; compNdx < scalarSize; compNdx++) {
+ in0 = inputs[0][compNdx];
+ out0 = outputs[0][compNdx];
+ ref = in0 - Math.floor(in0);
+ ulpDiff = hasZeroSign ? es3fShaderCommonFunctionTests.getUlpDiff(out0, ref) : es3fShaderCommonFunctionTests.getUlpDiffIgnoreZeroSign(out0, ref);
+
+ if (ulpDiff > 0) {
+ this.m_failMsg += 'Expected [' + compNdx + '] = ' + ref + ', got ULP diff ' + ulpDiff;
+ return false;
+ }
+ }
+ } else {
+ /** @type {number} */ var mantissaBits = es3fShaderCommonFunctionTests.getMinMantissaBits(precision);
+ /** @type {number} */ var eps = es3fShaderCommonFunctionTests.getEpsFromBits(1.0, mantissaBits); // epsilon for rounding bounds
+
+ for (var compNdx = 0; compNdx < scalarSize; compNdx++) {
+ in0 = inputs[0][compNdx];
+ out0 = outputs[0][compNdx];
+
+ if (Math.floor(in0 - eps) == Math.floor(in0 + eps)) {
+ ref = in0 - Math.floor(in0);
+ /** @type {number} */ var bitsLost = es3fShaderCommonFunctionTests.numBitsLostInOp(in0, ref);
+ /** @type {number} */ var maxUlpDiff = es3fShaderCommonFunctionTests.getMaxUlpDiffFromBits(Math.max(0, mantissaBits - bitsLost)); // ULP diff for rounded integer value.
+ ulpDiff = es3fShaderCommonFunctionTests.getUlpDiffIgnoreZeroSign(out0, ref);
+ if (ulpDiff > maxUlpDiff) {
+ this.m_failMsg += 'Expected [' + compNdx + '] = ' + ref + ' with ULP threshold ' + maxUlpDiff + ', got diff ' + ulpDiff;
+ return false;
+ }
+ } else {
+ if (out0 >= 1.0) {
+ this.m_failMsg += 'Expected [' + compNdx + '] < 1.0';
+ return false;
+ }
+ }
+ }
+ }
+
+ return true;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fShaderCommonFunctionTests.ShaderCommonFunctionTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'common', 'Common function tests');
+ };
+
+ es3fShaderCommonFunctionTests.ShaderCommonFunctionTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fShaderCommonFunctionTests.ShaderCommonFunctionTests.prototype.constructor = es3fShaderCommonFunctionTests.ShaderCommonFunctionTests;
+
+ /**
+ * @param {tcuTestCase.DeqpTest} parent
+ * @param {es3fShaderCommonFunctionTests.TestClass} testClass
+ * @param {string} functionName
+ * @param {boolean} floatTypes
+ * @param {boolean} intTypes
+ * @param {boolean} uintTypes
+ */
+ es3fShaderCommonFunctionTests.addFunctionCases = function(parent, testClass, functionName, floatTypes, intTypes, uintTypes) {
+ /** @type {tcuTestCase.DeqpTest} */ var group = tcuTestCase.newTest(functionName, functionName);
+ parent.addChild(group);
+
+ /** @type {Array<gluShaderUtil.DataType>} */ var scalarTypes = [
+ gluShaderUtil.DataType.FLOAT,
+ gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.UINT
+ ];
+
+ for (var scalarTypeNdx = 0; scalarTypeNdx < scalarTypes.length; scalarTypeNdx++) {
+ /** @type {gluShaderUtil.DataType} */ var scalarType = scalarTypes[scalarTypeNdx];
+
+ if ((!floatTypes && scalarType == gluShaderUtil.DataType.FLOAT) ||
+ (!intTypes && scalarType == gluShaderUtil.DataType.INT) ||
+ (!uintTypes && scalarType == gluShaderUtil.DataType.UINT))
+ continue;
+
+ for (var vecSize = 1; vecSize <= 4; vecSize++)
+ for (var prec = gluShaderUtil.precision.PRECISION_LOWP; prec <= gluShaderUtil.precision.PRECISION_HIGHP; prec++)
+ for (var shaderType = gluShaderProgram.shaderType.VERTEX; shaderType <= gluShaderProgram.shaderType.FRAGMENT; shaderType++)
+ group.addChild(new testClass(/** @type {gluShaderUtil.DataType} */ (scalarType + vecSize - 1), prec, shaderType));
+ }
+ };
+
+ es3fShaderCommonFunctionTests.ShaderCommonFunctionTests.prototype.init = function() {
+ var testGroup = tcuTestCase.runner.testCases;
+
+ es3fShaderCommonFunctionTests.addFunctionCases(testGroup, es3fShaderCommonFunctionTests.AbsCase, 'abs', true, true, false);
+ es3fShaderCommonFunctionTests.addFunctionCases(testGroup, es3fShaderCommonFunctionTests.SignCase, 'sign', true, true, false);
+ es3fShaderCommonFunctionTests.addFunctionCases(testGroup, es3fShaderCommonFunctionTests.FloorCase, 'floor', true, false, false);
+ es3fShaderCommonFunctionTests.addFunctionCases(testGroup, es3fShaderCommonFunctionTests.TruncCase, 'trunc', true, false, false);
+ es3fShaderCommonFunctionTests.addFunctionCases(testGroup, es3fShaderCommonFunctionTests.RoundCase, 'round', true, false, false);
+ es3fShaderCommonFunctionTests.addFunctionCases(testGroup, es3fShaderCommonFunctionTests.RoundEvenCase, 'roundeven', true, false, false);
+ es3fShaderCommonFunctionTests.addFunctionCases(testGroup, es3fShaderCommonFunctionTests.CeilCase, 'ceil', true, false, false);
+ es3fShaderCommonFunctionTests.addFunctionCases(testGroup, es3fShaderCommonFunctionTests.FractCase, 'fract', true, false, false);
+ // mod
+ es3fShaderCommonFunctionTests.addFunctionCases(testGroup, es3fShaderCommonFunctionTests.ModfCase, 'modf', true, false, false);
+ // min, max, clamp, mix, step, smoothstep
+ es3fShaderCommonFunctionTests.addFunctionCases(testGroup, es3fShaderCommonFunctionTests.IsnanCase, 'isnan', true, false, false);
+ es3fShaderCommonFunctionTests.addFunctionCases(testGroup, es3fShaderCommonFunctionTests.IsinfCase, 'isinf', true, false, false);
+ es3fShaderCommonFunctionTests.addFunctionCases(testGroup, es3fShaderCommonFunctionTests.FloatBitsToIntCase, 'floatbitstoint', true, false, false);
+ es3fShaderCommonFunctionTests.addFunctionCases(testGroup, es3fShaderCommonFunctionTests.FloatBitsToUintCase, 'floatbitstouint', true, false, false);
+
+ // (u)intBitsToFloat()
+ /** @type {tcuTestCase.DeqpTest} */ var intGroup = tcuTestCase.newTest('intbitstofloat', 'intBitsToFloat() Tests');
+ /** @type {tcuTestCase.DeqpTest} */ var uintGroup = tcuTestCase.newTest('uintbitstofloat', 'uintBitsToFloat() Tests');
+
+ testGroup.addChild(intGroup);
+ testGroup.addChild(uintGroup);
+
+ /** @type {Array<gluShaderProgram.shaderType>} */ var shaderTypes = [
+ gluShaderProgram.shaderType.VERTEX,
+ gluShaderProgram.shaderType.FRAGMENT
+ ];
+
+ for (var vecSize = 1; vecSize < 4; vecSize++) {
+ /** @type {gluShaderUtil.DataType} */ var intType = vecSize > 1 ?
+ gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.INT, vecSize) :
+ gluShaderUtil.DataType.INT;
+
+ /** @type {gluShaderUtil.DataType} */ var uintType = vecSize > 1 ?
+ gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.UINT, vecSize) :
+ gluShaderUtil.DataType.UINT;
+
+ for (var shaderType in shaderTypes) {
+ intGroup.addChild(new es3fShaderCommonFunctionTests.BitsToFloatCase(intType, shaderTypes[shaderType]));
+ uintGroup.addChild(new es3fShaderCommonFunctionTests.BitsToFloatCase(uintType, shaderTypes[shaderType]));
+ }
+ }
+ };
+
+ /**
+ * Run test
+ * @param {WebGL2RenderingContext} context
+ */
+ es3fShaderCommonFunctionTests.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fShaderCommonFunctionTests.ShaderCommonFunctionTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fShaderCommonFunctionTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderDerivateTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderDerivateTests.js
new file mode 100644
index 0000000000..9c859c296f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderDerivateTests.js
@@ -0,0 +1,1696 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fShaderDerivateTests');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.opengl.gluDrawUtil');
+goog.require('framework.opengl.gluPixelTransfer');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluTexture');
+goog.require('framework.opengl.gluTextureUtil');
+goog.require('framework.common.tcuInterval');
+goog.require('framework.common.tcuFloat');
+goog.require('framework.common.tcuLogImage');
+goog.require('framework.common.tcuMatrix');
+goog.require('framework.common.tcuPixelFormat');
+goog.require('framework.common.tcuRGBA');
+goog.require('framework.common.tcuStringTemplate');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.common.tcuTestCase');
+goog.require('modules.shared.glsShaderRenderCase');
+
+goog.scope(function() {
+ var es3fShaderDerivateTests = functional.gles3.es3fShaderDerivateTests;
+ var deMath = framework.delibs.debase.deMath;
+ var deRandom = framework.delibs.debase.deRandom;
+ var deString = framework.delibs.debase.deString;
+ var gluDrawUtil = framework.opengl.gluDrawUtil;
+ var gluPixelTransfer = framework.opengl.gluPixelTransfer;
+ var gluShaderProgram = framework.opengl.gluShaderProgram;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var gluTexture = framework.opengl.gluTexture;
+ var gluTextureUtil = framework.opengl.gluTextureUtil;
+ var tcuInterval = framework.common.tcuInterval;
+ var tcuFloat = framework.common.tcuFloat;
+ var tcuLogImage = framework.common.tcuLogImage;
+ var tcuMatrix = framework.common.tcuMatrix;
+ var tcuPixelFormat = framework.common.tcuPixelFormat;
+ var tcuRGBA = framework.common.tcuRGBA;
+ var tcuStringTemplate = framework.common.tcuStringTemplate;
+ var tcuSurface = framework.common.tcuSurface;
+ var tcuTexture = framework.common.tcuTexture;
+ var tcuTextureUtil = framework.common.tcuTextureUtil;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var glsShaderRenderCase = modules.shared.glsShaderRenderCase;
+
+ /** @const {number} */ es3fShaderDerivateTests.VIEWPORT_WIDTH = 167;
+ /** @const {number} */ es3fShaderDerivateTests.VIEWPORT_HEIGHT = 103;
+ /** @const {number} */ es3fShaderDerivateTests.FBO_WIDTH = 99;
+ /** @const {number} */ es3fShaderDerivateTests.FBO_HEIGHT = 133;
+ /** @const {number} */ es3fShaderDerivateTests.MAX_FAILED_MESSAGES = 10;
+ /** @const {number} */ es3fShaderDerivateTests.INTERPOLATION_LOST_BITS = 3; // number mantissa of bits allowed to be lost in varying interpolation
+ /**
+ * @enum {number}
+ */
+ es3fShaderDerivateTests.DerivateFunc = {
+ DFDX: 0,
+ DFDY: 1,
+ FWIDTH: 2
+ };
+
+ /**
+ * @enum {number}
+ */
+ es3fShaderDerivateTests.SurfaceType = {
+ DEFAULT_FRAMEBUFFER: 0,
+ UNORM_FBO: 1,
+ FLOAT_FBO: 2 // \note Uses RGBA32UI fbo actually, since FP rendertargets are not in core spec.
+ };
+
+ /**
+ * @enum {number}
+ */
+ es3fShaderDerivateTests.VerificationLogging = {
+ LOG_ALL: 0,
+ LOG_NOTHING: 1
+ };
+
+ /**
+ * @param {es3fShaderDerivateTests.DerivateFunc} func
+ * @return {string}
+ */
+ es3fShaderDerivateTests.getDerivateFuncName = function(func) {
+ switch (func) {
+ case es3fShaderDerivateTests.DerivateFunc.DFDX: return 'dFdx';
+ case es3fShaderDerivateTests.DerivateFunc.DFDY: return 'dFdy';
+ case es3fShaderDerivateTests.DerivateFunc.FWIDTH: return 'fwidth';
+ default: throw new Error('Derivate Func not supported.');
+ }
+ };
+
+ /**
+ * @param {es3fShaderDerivateTests.DerivateFunc} func
+ * @return {string}
+ */
+ es3fShaderDerivateTests.getDerivateFuncCaseName = function(func) {
+ switch (func) {
+ case es3fShaderDerivateTests.DerivateFunc.DFDX: return 'dfdx';
+ case es3fShaderDerivateTests.DerivateFunc.DFDY: return 'dfdy';
+ case es3fShaderDerivateTests.DerivateFunc.FWIDTH: return 'fwidth';
+ default: throw new Error('Derivate Func not supported.');
+ }
+ };
+
+ /**
+ * @param {?gluShaderUtil.DataType} type
+ * @return {Array<boolean>}
+ */
+ es3fShaderDerivateTests.getDerivateMask = function(type) {
+ switch (type) {
+ case gluShaderUtil.DataType.FLOAT: return [true, false, false, false];
+ case gluShaderUtil.DataType.FLOAT_VEC2: return [true, true, false, false];
+ case gluShaderUtil.DataType.FLOAT_VEC3: return [true, true, true, false];
+ case gluShaderUtil.DataType.FLOAT_VEC4: return [true, true, true, true];
+ default: throw new Error('Data Type not supported.');
+ }
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} surface
+ * @param {Array<number>} derivScale
+ * @param {Array<number>} derivBias
+ * @param {number} x
+ * @param {number} y
+ * @return {Array<number>}
+ */
+ es3fShaderDerivateTests.readDerivate = function(surface, derivScale, derivBias, x, y) {
+ return deMath.divide(deMath.subtract(surface.getPixel(x, y), derivBias), derivScale);
+ };
+
+ /**
+ * @param {Array<number>} v
+ * @return {Array<number>}
+ */
+ es3fShaderDerivateTests.getCompExpBits = function(v) {
+ return [tcuFloat.newFloat32(v[0]).exponentBits(),
+ tcuFloat.newFloat32(v[1]).exponentBits(),
+ tcuFloat.newFloat32(v[2]).exponentBits(),
+ tcuFloat.newFloat32(v[3]).exponentBits()];
+ };
+
+ /**
+ * @param {number} value
+ * @param {number} numAccurateBits
+ * @return {number}
+ */
+ es3fShaderDerivateTests.computeFloatingPointError = function(value, numAccurateBits) {
+ /** @type {number} */ var numGarbageBits = 23 - numAccurateBits;
+ /** @type {number} */ var mask = (1 << numGarbageBits) - 1 ;
+ /** @type {number} */ var exp = tcuFloat.newFloat32(value).exponent();
+
+ return (new tcuFloat.deFloat()).construct(1, exp, (1 << 23) | mask).getValue() - (new tcuFloat.deFloat()).construct(1, exp, 1 << 23).getValue();
+ };
+
+ /**
+ * @param {?gluShaderUtil.precision} precision
+ * @return {number}
+ */
+ es3fShaderDerivateTests.getNumMantissaBits = function(precision) {
+ switch (precision) {
+ case gluShaderUtil.precision.PRECISION_HIGHP: return 23;
+ case gluShaderUtil.precision.PRECISION_MEDIUMP: return 10;
+ case gluShaderUtil.precision.PRECISION_LOWP: return 6;
+ default:
+ throw new Error('Precision not supported: ' + precision);
+ }
+ };
+
+ /**
+ * @param {?gluShaderUtil.precision} precision
+ * @return {number}
+ */
+ es3fShaderDerivateTests.getMinExponent = function(precision) {
+ switch (precision) {
+ case gluShaderUtil.precision.PRECISION_HIGHP: return -126;
+ case gluShaderUtil.precision.PRECISION_MEDIUMP: return -14;
+ case gluShaderUtil.precision.PRECISION_LOWP: return -8;
+ default:
+ throw new Error('Precision not supported: ' + precision);
+ }
+ };
+
+ /**
+ * @param {number} exp
+ * @param {number} numMantissaBits
+ * @return {number}
+ */
+ es3fShaderDerivateTests.getSingleULPForExponent = function(exp, numMantissaBits) {
+ if (numMantissaBits > 0) {
+ assertMsgOptions(numMantissaBits <= 23, 'numMantissaBits must be less or equal than 23.', false, true);
+
+ /** @type {number} */ var ulpBitNdx = 23 - numMantissaBits;
+
+ return (new tcuFloat.deFloat()).construct(1, exp, (1 << 23) | (1 << ulpBitNdx)).getValue() - (new tcuFloat.deFloat()).construct(1, exp, 1 << 23).getValue();
+ } else {
+ assertMsgOptions(numMantissaBits === 0, 'numMantissaBits must equal to 0.', false, true);
+ return (new tcuFloat.deFloat()).construct(1, exp, (1 << 23)).getValue()
+ }
+ };
+
+ /**
+ * @param {number} value
+ * @param {number} numMantissaBits
+ * @return {number}
+ */
+ es3fShaderDerivateTests.getSingleULPForValue = function(value, numMantissaBits) {
+ /** @type {number} */ var exp = (new tcuFloat.deFloat().deFloatNumber(value)).exponent();
+ return es3fShaderDerivateTests.getSingleULPForExponent(exp, numMantissaBits);
+ };
+
+ /**
+ * @param {number} value
+ * @param {number} minExponent
+ * @param {number} numAccurateBits
+ * @return {number}
+ */
+ es3fShaderDerivateTests.convertFloorFlushToZero = function(value, minExponent, numAccurateBits) {
+ if (value === 0.0) {
+ return 0.0;
+ } else {
+ /** @type {tcuFloat.deFloat} */ var inputFloat = new tcuFloat.deFloat().deFloatNumber(value);
+ /** @type {number} */ var numTruncatedBits = 23 - numAccurateBits;
+ /** @type {number} */ var truncMask = (1 << numTruncatedBits) - 1;
+
+ if (value > 0.0) {
+ if (value > 0.0 && (new tcuFloat.deFloat().deFloatNumber(value)).exponent() < minExponent) {
+ // flush to zero if possible
+ return 0.0;
+ } else {
+ // just mask away non-representable bits
+ return (new tcuFloat.deFloat()).construct(1, inputFloat.exponent(), inputFloat.mantissa() & ~truncMask).getValue();
+ }
+ } else {
+ if (inputFloat.mantissa() & truncMask) {
+ // decrement one ulp if truncated bits are non-zero (i.e. if value is not representable)
+ return (new tcuFloat.deFloat()).construct(-1, inputFloat.exponent(), inputFloat.mantissa() & ~truncMask).getValue() - es3fShaderDerivateTests.getSingleULPForExponent(inputFloat.exponent(), numAccurateBits);
+ } else {
+ // value is representable, no need to do anything
+ return value;
+ }
+ }
+ }
+ };
+
+ /**
+ * @param {number} value
+ * @param {number} minExponent
+ * @param {number} numAccurateBits
+ * @return {number}
+ */
+ es3fShaderDerivateTests.convertCeilFlushToZero = function(value, minExponent, numAccurateBits) {
+ return -es3fShaderDerivateTests.convertFloorFlushToZero(-value, minExponent, numAccurateBits);
+ };
+
+ /**
+ * @param {number} value
+ * @param {number} numUlps
+ * @param {number} numMantissaBits
+ * @return {number}
+ */
+ es3fShaderDerivateTests.addErrorUlp = function(value, numUlps, numMantissaBits) {
+ return value + numUlps * es3fShaderDerivateTests.getSingleULPForValue(value, numMantissaBits);
+ };
+
+ /**
+ * @param {?gluShaderUtil.precision} precision
+ * @param {Array<number>} valueMin
+ * @param {Array<number>} valueMax
+ * @param {Array<number>} expectedDerivate
+ * @return {Array<number>}
+ */
+ es3fShaderDerivateTests.getDerivateThreshold = function(precision, valueMin, valueMax, expectedDerivate) {
+ /** @type {number} */ var baseBits = es3fShaderDerivateTests.getNumMantissaBits(precision);
+ /** @type {Array<number>} */ var derivExp = es3fShaderDerivateTests.getCompExpBits(expectedDerivate);
+ /** @type {Array<number>} */ var maxValueExp = deMath.max(es3fShaderDerivateTests.getCompExpBits(valueMin), es3fShaderDerivateTests.getCompExpBits(valueMax));
+ /** @type {Array<number>} */ var numBitsLost = deMath.subtract(maxValueExp, deMath.min(maxValueExp, derivExp));
+ /** @type {Array<number>} */
+ var numAccurateBits = deMath.max(
+ deMath.addScalar(
+ deMath.subtract(
+ [baseBits, baseBits, baseBits, baseBits],
+ numBitsLost),
+ -es3fShaderDerivateTests.INTERPOLATION_LOST_BITS),
+ [0, 0, 0, 0]);
+
+ return [es3fShaderDerivateTests.computeFloatingPointError(expectedDerivate[0], numAccurateBits[0]),
+ es3fShaderDerivateTests.computeFloatingPointError(expectedDerivate[1], numAccurateBits[1]),
+ es3fShaderDerivateTests.computeFloatingPointError(expectedDerivate[2], numAccurateBits[2]),
+ es3fShaderDerivateTests.computeFloatingPointError(expectedDerivate[3], numAccurateBits[3])];
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} result
+ * @param {tcuTexture.PixelBufferAccess} errorMask
+ * @param {?gluShaderUtil.DataType} dataType
+ * @param {Array<number>} reference
+ * @param {Array<number>} threshold
+ * @param {Array<number>} scale
+ * @param {Array<number>} bias
+ * @param {es3fShaderDerivateTests.VerificationLogging=} logPolicy
+ * @return {boolean}
+ */
+ es3fShaderDerivateTests.verifyConstantDerivate = function(result, errorMask, dataType, reference, threshold, scale, bias, logPolicy) {
+ logPolicy = logPolicy === undefined ? es3fShaderDerivateTests.VerificationLogging.LOG_ALL : logPolicy;
+ /** @type {Array<boolean>} */ var mask = deMath.logicalNotBool(es3fShaderDerivateTests.getDerivateMask(dataType));
+ /** @type {number} */ var numFailedPixels = 0;
+
+ if (logPolicy === es3fShaderDerivateTests.VerificationLogging.LOG_ALL)
+ bufferedLogToConsole('Expecting ' + reference + ' with threshold ' + threshold);
+
+ for (var y = 0; y < result.getHeight(); y++) {
+ for (var x = 0; x < result.getWidth(); x++) {
+ /** @type {Array<number>} */ var resDerivate = es3fShaderDerivateTests.readDerivate(result, scale, bias, x, y);
+ /** @type {boolean} */
+ var isOk = deMath.boolAll(
+ deMath.logicalOrBool(
+ deMath.lessThanEqual(
+ deMath.abs(deMath.subtract(reference, resDerivate)),
+ threshold),
+ mask));
+
+ if (!isOk) {
+ if (numFailedPixels < es3fShaderDerivateTests.MAX_FAILED_MESSAGES && logPolicy === es3fShaderDerivateTests.VerificationLogging.LOG_ALL)
+ bufferedLogToConsole('FAIL: got ' + resDerivate + ', diff = ' + deMath.abs(deMath.subtract(reference, resDerivate)) + ', at x = ' + x + ', y = ' + y);
+ numFailedPixels += 1;
+ errorMask.setPixel(tcuRGBA.RGBA.red.toVec(), x, y);
+ }
+ }
+ }
+
+ if (numFailedPixels >= es3fShaderDerivateTests.MAX_FAILED_MESSAGES && logPolicy === es3fShaderDerivateTests.VerificationLogging.LOG_ALL)
+ bufferedLogToConsole('...');
+
+ if (numFailedPixels > 0 && logPolicy === es3fShaderDerivateTests.VerificationLogging.LOG_ALL)
+ bufferedLogToConsole('FAIL: found ' + numFailedPixels + ' failed pixels');
+
+ return numFailedPixels === 0;
+ };
+
+ /**
+ * .-----.
+ * | s_x |
+ * M x | s_y |
+ * | 1.0 |
+ * '-----'
+ * @struct
+ * @constructor
+ */
+ es3fShaderDerivateTests.Linear2DFunctionEvaluator = function() {
+ /** @type {tcuMatrix.Matrix} */ this.matrix = new tcuMatrix.Matrix(4, 3);
+ };
+
+ es3fShaderDerivateTests.Linear2DFunctionEvaluator.prototype.evaluateAt = function(screenX, screenY) {
+ /** @type {Array<number>} */ var position = [screenX, screenY, 1.0];
+ return tcuMatrix.multiplyMatVec(this.matrix, position);
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} result
+ * @param {tcuTexture.PixelBufferAccess} errorMask
+ * @param {?gluShaderUtil.DataType} dataType
+ * @param {?gluShaderUtil.precision} precision
+ * @param {Array<number>} derivScale
+ * @param {Array<number>} derivBias
+ * @param {Array<number>} surfaceThreshold
+ * @param {es3fShaderDerivateTests.DerivateFunc} derivateFunc
+ * @param {es3fShaderDerivateTests.Linear2DFunctionEvaluator} func
+ * @return {boolean}
+ */
+ es3fShaderDerivateTests.reverifyConstantDerivateWithFlushRelaxations = function(result, errorMask, dataType, precision, derivScale, derivBias, surfaceThreshold, derivateFunc, func) {
+ assertMsgOptions(result.getWidth() === errorMask.getWidth(), 'Dimensions of result and errorMask inconsistent.', false, true);
+ assertMsgOptions(result.getHeight() === errorMask.getHeight(), 'Dimensions of result and errorMask inconsistent.', false, true);
+ assertMsgOptions(derivateFunc === es3fShaderDerivateTests.DerivateFunc.DFDX || derivateFunc === es3fShaderDerivateTests.DerivateFunc.DFDY, 'Derivate Function should be DFDX or DFDY.', false, true);
+
+ /** @type {Array<number>} */ var red = [255, 0, 0, 255];
+ /** @type {Array<number>} */ var green = [0, 255, 0, 255];
+ /** @type {number} */ var divisionErrorUlps = 2.5;
+
+ /** @type {number} */ var numComponents = gluShaderUtil.getDataTypeScalarTypeAsDataType(dataType);
+ /** @type {number} */ var numBits = es3fShaderDerivateTests.getNumMantissaBits(precision);
+ /** @type {number} */ var minExponent = es3fShaderDerivateTests.getMinExponent(precision);
+
+ /** @type {number} */ var numVaryingSampleBits = numBits - es3fShaderDerivateTests.INTERPOLATION_LOST_BITS;
+ /** @type {number} */ var numFailedPixels = 0;
+
+ errorMask.clear(green);
+
+ // search for failed pixels
+ for (var y = 0; y < result.getHeight(); ++y)
+ for (var x = 0; x < result.getWidth(); ++x) {
+ // flushToZero?(f2z?(functionValueCurrent) - f2z?(functionValueBefore))
+ // flushToZero? ( ------------------------------------------------------------------------ +- 2.5 ULP )
+ // dx
+
+ /** @type {Array<number>} */ var resultDerivative = es3fShaderDerivateTests.readDerivate(result, derivScale, derivBias, x, y);
+
+ // sample at the front of the back pixel and the back of the front pixel to cover the whole area of
+ // legal sample positions. In general case this is NOT OK, but we know that the target funtion is
+ // (mostly*) linear which allows us to take the sample points at arbitrary points. This gets us the
+ // maximum difference possible in exponents which are used in error bound calculations.
+ // * non-linearity may happen around zero or with very high function values due to subnorms not
+ // behaving well.
+ /** @type {Array<number>} */ var functionValueForward = (derivateFunc === es3fShaderDerivateTests.DerivateFunc.DFDX) ?
+ (func.evaluateAt(x + 2.0, y + 0.5)) :
+ (func.evaluateAt(x + 0.5, y + 2.0));
+ /** @type {Array<number>} */ var functionValueBackward = (derivateFunc === es3fShaderDerivateTests.DerivateFunc.DFDX) ?
+ (func.evaluateAt(x - 1.0, y + 0.5)) :
+ (func.evaluateAt(x + 0.5, y - 1.0));
+
+ /** @type {boolean} */ var anyComponentFailed = false;
+
+ // check components separately
+ for (var c = 0; c < numComponents; ++c) {
+ // interpolation value range
+ /** @type {tcuInterval.Interval} */ var forwardComponent = tcuInterval.withIntervals(
+ new tcuInterval.Interval(es3fShaderDerivateTests.convertFloorFlushToZero(
+ es3fShaderDerivateTests.addErrorUlp(functionValueForward[c], -0.5, numVaryingSampleBits), minExponent, numBits)),
+ new tcuInterval.Interval(es3fShaderDerivateTests.convertCeilFlushToZero(
+ es3fShaderDerivateTests.addErrorUlp(functionValueForward[c], +0.5, numVaryingSampleBits), minExponent, numBits))
+ );
+
+ /** @type {tcuInterval.Interval} */ var backwardComponent = tcuInterval.withIntervals(
+ new tcuInterval.Interval(es3fShaderDerivateTests.convertFloorFlushToZero(
+ es3fShaderDerivateTests.addErrorUlp(functionValueBackward[c], -0.5, numVaryingSampleBits), minExponent, numBits)),
+ new tcuInterval.Interval(es3fShaderDerivateTests.convertCeilFlushToZero(
+ es3fShaderDerivateTests.addErrorUlp(functionValueBackward[c], +0.5, numVaryingSampleBits), minExponent, numBits))
+ );
+
+ /** @type {number} */
+ var maxValueExp = Math.max(
+ (new tcuFloat.deFloat().deFloatNumber(forwardComponent.lo())).exponent(),
+ (new tcuFloat.deFloat().deFloatNumber(forwardComponent.hi())).exponent(),
+ (new tcuFloat.deFloat().deFloatNumber(backwardComponent.lo())).exponent(),
+ (new tcuFloat.deFloat().deFloatNumber(backwardComponent.hi())).exponent());
+
+ // subtraction in nominator will likely cause a cancellation of the most
+ // significant bits. Apply error bounds.
+ /** @type {tcuInterval.Interval} */ var nominator = tcuInterval.Interval.operatorSub(forwardComponent, backwardComponent);
+ /** @type {number} */ var nominatorLoExp = (new tcuFloat.deFloat().deFloatNumber(nominator.lo())).exponent();
+ /** @type {number} */ var nominatorHiExp = (new tcuFloat.deFloat().deFloatNumber(nominator.hi())).exponent();
+ /** @type {number} */ var nominatorLoBitsLost = maxValueExp - nominatorLoExp;
+ /** @type {number} */ var nominatorHiBitsLost = maxValueExp - nominatorHiExp;
+ /** @type {number} */ var nominatorLoBits = Math.max(0, numBits - nominatorLoBitsLost);
+ /** @type {number} */ var nominatorHiBits = Math.max(0, numBits - nominatorHiBitsLost);
+
+ /** @type {tcuInterval.Interval} */ var nominatorRange = tcuInterval.withIntervals(
+ new tcuInterval.Interval(es3fShaderDerivateTests.convertFloorFlushToZero(nominator.lo(), minExponent, nominatorLoBits)),
+ new tcuInterval.Interval(es3fShaderDerivateTests.convertCeilFlushToZero(nominator.hi(), minExponent, nominatorHiBits)));
+ //
+ /** @type {tcuInterval.Interval} */ var divisionRange = tcuInterval.Interval.operatorDiv(nominatorRange, new tcuInterval.Interval(3.0)); // legal sample area is anywhere within this and neighboring pixels (i.e. size = 3)
+ /** @type {tcuInterval.Interval} */ var divisionResultRange = tcuInterval.withIntervals(
+ new tcuInterval.Interval(es3fShaderDerivateTests.convertFloorFlushToZero(es3fShaderDerivateTests.addErrorUlp(divisionRange.lo(), -divisionErrorUlps, numBits), minExponent, numBits)),
+ new tcuInterval.Interval(es3fShaderDerivateTests.convertCeilFlushToZero(es3fShaderDerivateTests.addErrorUlp(divisionRange.hi(), divisionErrorUlps, numBits), minExponent, numBits)));
+ /** @type {tcuInterval.Interval} */ var finalResultRange = tcuInterval.withIntervals(
+ new tcuInterval.Interval(divisionResultRange.lo() - surfaceThreshold[c]),
+ new tcuInterval.Interval(divisionResultRange.hi() + surfaceThreshold[c]));
+
+ if (resultDerivative[c] >= finalResultRange.lo() && resultDerivative[c] <= finalResultRange.hi()) {
+ // value ok
+ } else {
+ if (numFailedPixels < es3fShaderDerivateTests.MAX_FAILED_MESSAGES)
+ bufferedLogToConsole('Error in pixel at ' + x + ', ' + y + ' with component ' + c + ' (channel ' + ('rgba'[c]) + ')\n' +
+ '\tGot pixel value ' + result.getPixelInt(x, y) + '\n' +
+ '\t\tdFd' + ((derivateFunc === es3fShaderDerivateTests.DerivateFunc.DFDX) ? 'x' : 'y') + ' ~= ' + resultDerivative[c] + '\n' +
+ '\t\tdifference to a valid range: ' +
+ ((resultDerivative[c] < finalResultRange.lo()) ? '-' : '+') +
+ ((resultDerivative[c] < finalResultRange.lo()) ? (finalResultRange.lo() - resultDerivative[c]) : (resultDerivative[c] - finalResultRange.hi())) +
+ '\n' +
+ '\tDerivative value range:\n' +
+ '\t\tMin: ' + finalResultRange.lo() + '\n' +
+ '\t\tMax: ' + finalResultRange.hi() + '\n');
+
+ ++numFailedPixels;
+ anyComponentFailed = true;
+ }
+ }
+
+ if (anyComponentFailed)
+ errorMask.setPixel(red, x, y);
+ }
+
+ if (numFailedPixels >= es3fShaderDerivateTests.MAX_FAILED_MESSAGES)
+ bufferedLogToConsole('...');
+
+ if (numFailedPixels > 0)
+ bufferedLogToConsole('FAIL: found ' + numFailedPixels + ' failed pixels');
+
+ return numFailedPixels === 0;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} description
+ */
+ es3fShaderDerivateTests.TriangleDerivateCase = function(name, description) {
+ tcuTestCase.DeqpTest.call(this, name, description);
+ /** @type {?gluShaderUtil.DataType} */ this.m_dataType = null;
+ /** @type {?gluShaderUtil.precision} */ this.m_precision = null;
+
+ /** @type {?gluShaderUtil.DataType} */ this.m_coordDataType = null;
+ /** @type {?gluShaderUtil.precision} */ this.m_coordPrecision = null;
+
+ /** @type {string} */ this.m_fragmentSrc;
+
+ /** @type {Array<number>} */ this.m_coordMin = [];
+ /** @type {Array<number>} */ this.m_coordMax = [];
+ /** @type {Array<number>} */ this.m_derivScale = [];
+ /** @type {Array<number>} */ this.m_derivBias = [];
+
+ /** @type {es3fShaderDerivateTests.SurfaceType} */ this.m_surfaceType = es3fShaderDerivateTests.SurfaceType.DEFAULT_FRAMEBUFFER;
+ /** @type {number} */ this.m_numSamples = 0;
+ /** @type {number} */ this.m_hint = gl.DONT_CARE;
+
+ assertMsgOptions(this.m_surfaceType !== es3fShaderDerivateTests.SurfaceType.DEFAULT_FRAMEBUFFER || this.m_numSamples === 0, 'Did not expect surfaceType = DEFAULT_FRAMEBUFFER or numSamples = 0', false, true);
+ };
+
+ es3fShaderDerivateTests.TriangleDerivateCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fShaderDerivateTests.TriangleDerivateCase.prototype.constructor = es3fShaderDerivateTests.TriangleDerivateCase;
+
+ es3fShaderDerivateTests.TriangleDerivateCase.prototype.deinit = function() {};
+
+ /** @param {WebGLProgram} program */
+ es3fShaderDerivateTests.TriangleDerivateCase.prototype.setupRenderState = function(program) {};
+
+ /**
+ * @param {?gluShaderUtil.DataType} coordType
+ * @param {?gluShaderUtil.precision} precision
+ * @return {string}
+ */
+ es3fShaderDerivateTests.genVertexSource = function(coordType, precision) {
+ assertMsgOptions(gluShaderUtil.isDataTypeFloatOrVec(coordType), 'Coord Type not supported', false, true);
+
+ /** @type {string} */ var vertexTmpl = '' +
+ '#version 300 es\n' +
+ 'in highp vec4 a_position;\n' +
+ 'in ${PRECISION} ${DATATYPE} a_coord;\n' +
+ 'out ${PRECISION} ${DATATYPE} v_coord;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = a_position;\n' +
+ ' v_coord = a_coord;\n' +
+ '}\n';
+
+ /** @type {Object} */ var vertexParams = {};
+
+ vertexParams['PRECISION'] = gluShaderUtil.getPrecisionName(precision);
+ vertexParams['DATATYPE'] = gluShaderUtil.getDataTypeName(coordType);
+
+ return tcuStringTemplate.specialize(vertexTmpl, vertexParams);
+ };
+
+ /**
+ * @return {Array<number>}
+ */
+ es3fShaderDerivateTests.TriangleDerivateCase.prototype.getViewportSize = function() {
+ if (this.m_surfaceType === es3fShaderDerivateTests.SurfaceType.DEFAULT_FRAMEBUFFER) {
+ /** @type {number} */ var width = Math.min(gl.drawingBufferWidth, es3fShaderDerivateTests.VIEWPORT_WIDTH);
+ /** @type {number} */ var height = Math.min(gl.drawingBufferHeight, es3fShaderDerivateTests.VIEWPORT_HEIGHT);
+ return [width, height];
+ } else
+ return [es3fShaderDerivateTests.FBO_WIDTH, es3fShaderDerivateTests.FBO_HEIGHT];
+ };
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fShaderDerivateTests.TriangleDerivateCase.prototype.iterate = function() {
+ /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(es3fShaderDerivateTests.genVertexSource(this.m_coordDataType, this.m_coordPrecision), this.m_fragmentSrc));
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0xbbc24);
+ /** @type {boolean} */ var useFbo = this.m_surfaceType != es3fShaderDerivateTests.SurfaceType.DEFAULT_FRAMEBUFFER;
+ /** @type {number} */ var fboFormat = this.m_surfaceType === es3fShaderDerivateTests.SurfaceType.FLOAT_FBO ? gl.RGBA32UI : gl.RGBA8;
+ /** @type {Array<number>} */ var viewportSize = this.getViewportSize();
+ /** @type {number} */ var viewportX = useFbo ? 0 : rnd.getInt(0, gl.drawingBufferWidth - viewportSize[0]);
+ /** @type {number} */ var viewportY = useFbo ? 0 : rnd.getInt(0, gl.drawingBufferHeight - viewportSize[1]);
+ /** @type {?WebGLFramebuffer} */ var fbo = null;
+ /** @type {?WebGLRenderbuffer} */ var rbo = null;
+ /** @type {tcuTexture.TextureLevel} */ var result = null;
+
+ bufferedLogToConsole(program.getProgramInfo().infoLog);
+
+ if (!program.isOk())
+ assertMsgOptions(false, 'Compile failed', false, true);
+
+ if (useFbo) {
+ bufferedLogToConsole('Rendering to FBO, format = ' + wtu.glEnumToString(gl, fboFormat) + ', samples = ' + this.m_numSamples);
+
+ fbo = gl.createFramebuffer();
+ rbo = gl.createRenderbuffer();
+
+ gl.bindRenderbuffer(gl.RENDERBUFFER, rbo);
+ gl.renderbufferStorageMultisample(gl.RENDERBUFFER, this.m_numSamples, fboFormat, viewportSize[0], viewportSize[1]);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo);
+ } else {
+ /** @type {tcuPixelFormat.PixelFormat} */ var pixelFormat = tcuPixelFormat.PixelFormatFromContext(gl);
+
+ bufferedLogToConsole('Rendering to default framebuffer\n' +
+ '\tColor depth: R=' + pixelFormat.redBits + ', G=' + pixelFormat.greenBits + ', B=' + pixelFormat.blueBits + ', A=' + pixelFormat.alphaBits);
+ }
+
+ bufferedLogToConsole('in: ' + this.m_coordMin + ' ' + this.m_coordMax + '\n' +
+ 'v_coord.x = in.x * x\n' +
+ 'v_coord.y = in.y * y\n' +
+ 'v_coord.z = in.z * (x+y)/2\n' +
+ 'v_coord.w = in.w * (1 - (x+y)/2)\n' +
+ '\n' +
+ 'u_scale: ' + this.m_derivScale + ', u_bias: ' + this.m_derivBias + ' (displayed values have scale/bias removed)' +
+ 'Viewport: ' + viewportSize[0] + 'x' + viewportSize[1] +
+ 'gl.FRAGMENT_SHADER_DERIVATE_HINT: ' + wtu.glEnumToString(gl, this.m_hint));
+ // Draw
+ /** @type {Array<number>} */ var positions = [
+ -1.0, -1.0, 0.0, 1.0,
+ -1.0, 1.0, 0.0, 1.0,
+ 1.0, -1.0, 0.0, 1.0,
+ 1.0, 1.0, 0.0, 1.0
+ ];
+
+ /** @type {Array<number>} */ var coords =[
+ this.m_coordMin[0], this.m_coordMin[1], this.m_coordMin[2], this.m_coordMax[3],
+ this.m_coordMin[0], this.m_coordMax[1], (this.m_coordMin[2] + this.m_coordMax[2]) * 0.5, (this.m_coordMin[3]+this.m_coordMax[3]) * 0.5,
+ this.m_coordMax[0], this.m_coordMin[1], (this.m_coordMin[2] + this.m_coordMax[2]) * 0.5, (this.m_coordMin[3]+this.m_coordMax[3]) * 0.5,
+ this.m_coordMax[0], this.m_coordMax[1], this.m_coordMax[2], this.m_coordMin[3]
+ ];
+
+ /** @type {Array<gluDrawUtil.VertexArrayBinding>} */ var vertexArrays = [
+ gluDrawUtil.newFloatVertexArrayBinding('a_position', 4, 4, 0, positions),
+ gluDrawUtil.newFloatVertexArrayBinding('a_coord', 4, 4, 0, coords)
+ ];
+
+ /** @type {Array<number>} */ var indices = [0, 2, 1, 2, 3, 1];
+
+ gl.clearColor(0.125, 0.25, 0.5, 1.0);
+ // We can't really call clear() on gl.COLOR_BUFFER_BIT here as in c++ deqp.
+ // The fbo format might be of integer type and WebGL2 requires an INVALID_OPERATION to be generated.
+ var formatObj = gluTextureUtil.mapGLInternalFormat(fboFormat);
+ var fmtClass = tcuTexture.getTextureChannelClass(formatObj.type);
+ switch (fmtClass) {
+ case tcuTexture.TextureChannelClass.FLOATING_POINT:
+ case tcuTexture.TextureChannelClass.SIGNED_FIXED_POINT:
+ case tcuTexture.TextureChannelClass.UNSIGNED_FIXED_POINT:
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+ break;
+ case tcuTexture.TextureChannelClass.UNSIGNED_INTEGER:
+ gl.clearBufferuiv(gl.COLOR, 0, new Uint32Array([31, 63, 127, 255]));
+ gl.clear(gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+ break;
+ case tcuTexture.TextureChannelClass.SIGNED_INTEGER:
+ gl.clearBufferiv(gl.COLOR, 0, new Int32Array([31, 63, 127, 255]));
+ gl.clear(gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+ break;
+ default:
+ throw new Error('Invalid channelclass ' + fmtClass);
+ }
+ gl.disable(gl.DITHER);
+
+ gl.useProgram(program.getProgram());
+
+ /** @type {WebGLUniformLocation} */ var scaleLoc = gl.getUniformLocation(program.getProgram(), 'u_scale');
+ /** @type {WebGLUniformLocation} */ var biasLoc = gl.getUniformLocation(program.getProgram(), 'u_bias');
+
+ switch (this.m_dataType) {
+ case gluShaderUtil.DataType.FLOAT:
+ gl.uniform1f(scaleLoc, this.m_derivScale[0]);
+ gl.uniform1f(biasLoc, this.m_derivBias[0]);
+ break;
+
+ case gluShaderUtil.DataType.FLOAT_VEC2:
+ gl.uniform2fv(scaleLoc, this.m_derivScale.slice(0,2));
+ gl.uniform2fv(biasLoc, this.m_derivBias.slice(0,2));
+ break;
+
+ case gluShaderUtil.DataType.FLOAT_VEC3:
+ gl.uniform3fv(scaleLoc, this.m_derivScale.slice(0,3));
+ gl.uniform3fv(biasLoc, this.m_derivBias.slice(0,3));
+ break;
+
+ case gluShaderUtil.DataType.FLOAT_VEC4:
+ gl.uniform4fv(scaleLoc, this.m_derivScale);
+ gl.uniform4fv(biasLoc, this.m_derivBias);
+ break;
+
+ default:
+ throw new Error('Data Type not supported: ' + this.m_dataType);
+ }
+
+ glsShaderRenderCase.setupDefaultUniforms(program.getProgram());
+ this.setupRenderState(program.getProgram());
+
+ gl.hint(gl.FRAGMENT_SHADER_DERIVATIVE_HINT, this.m_hint);
+
+ gl.viewport(viewportX, viewportY, viewportSize[0], viewportSize[1]);
+ gluDrawUtil.draw(gl, program.getProgram(), vertexArrays, gluDrawUtil.triangles(indices));
+
+ // Read back results
+
+ /** @type {boolean} */ var isMSAA = useFbo && this.m_numSamples > 0;
+ /** @type {?WebGLFramebuffer} */ var resFbo = null;
+ /** @type {?WebGLRenderbuffer} */ var resRbo = null;
+
+ // Resolve if necessary
+ if (isMSAA) {
+ resFbo = gl.createFramebuffer();
+ resRbo = gl.createRenderbuffer();
+
+ gl.bindRenderbuffer(gl.RENDERBUFFER, resRbo);
+ gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 0, fboFormat, viewportSize[0], viewportSize[1]);
+ gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, resFbo);
+ gl.framebufferRenderbuffer(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, resRbo);
+
+ gl.blitFramebuffer(0, 0, viewportSize[0], viewportSize[1], 0, 0, viewportSize[0], viewportSize[1], gl.COLOR_BUFFER_BIT, gl.NEAREST);
+
+ gl.bindFramebuffer(gl.READ_FRAMEBUFFER, resFbo);
+ }
+ switch (this.m_surfaceType) {
+ case es3fShaderDerivateTests.SurfaceType.DEFAULT_FRAMEBUFFER:
+ case es3fShaderDerivateTests.SurfaceType.UNORM_FBO:
+ var dataFormat = new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNORM_INT8);
+ result = new tcuTexture.TextureLevel(dataFormat, viewportSize[0], viewportSize[1]);
+ gluPixelTransfer.readPixels(gl, viewportX, viewportY, dataFormat, result);
+ break;
+
+ case es3fShaderDerivateTests.SurfaceType.FLOAT_FBO:
+ var dataFormat = new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.FLOAT);
+ var transferFormat = new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, tcuTexture.ChannelType.UNSIGNED_INT32);
+ result = new tcuTexture.TextureLevel(dataFormat, viewportSize[0], viewportSize[1]);
+ gluPixelTransfer.readPixels(gl, viewportX, viewportY, transferFormat, result);
+ break;
+
+ default:
+ throw new Error('Surface Type not supported: ' + this.m_surfaceType);
+ }
+
+ // Verify
+ /** @type {tcuSurface.Surface} */
+ var errorMask = new tcuSurface.Surface(result.getWidth(), result.getHeight());
+
+ errorMask.getAccess().clear(tcuRGBA.RGBA.green.toVec());
+
+ /** @type {boolean} */ var isOk = this.verify(result.getAccess(), errorMask.getAccess());
+
+ if (!isOk) {
+ tcuLogImage.logImage('Rendered', 'Rendered image', result.getAccess());
+ tcuLogImage.logImage('ErrorMask', 'Error mask', errorMask.getAccess());
+ testFailedOptions('Fail', false);
+ } else
+ testPassedOptions('Pass', true);
+
+ // Cleaning up buffers
+ gl.deleteFramebuffer(fbo);
+ gl.deleteRenderbuffer(rbo);
+ gl.deleteFramebuffer(resFbo);
+ gl.deleteRenderbuffer(resRbo);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @return {Array<number>}
+ */
+ es3fShaderDerivateTests.TriangleDerivateCase.prototype.getSurfaceThreshold = function() {
+ switch (this.m_surfaceType) {
+ case es3fShaderDerivateTests.SurfaceType.DEFAULT_FRAMEBUFFER:
+ /** @type {tcuPixelFormat.PixelFormat} */ var pixelFormat = tcuPixelFormat.PixelFormatFromContext(gl);
+ /** @type {Array<number>} */ var channelBits = [pixelFormat.redBits, pixelFormat.greenBits, pixelFormat.blueBits, pixelFormat.alphaBits];
+ /** @type {Array<number>} */ var intThreshold = deMath.arrayShiftLeft([1, 1, 1, 1], deMath.subtract([8, 8, 8, 8], channelBits));
+ /** @type {Array<number>} */ var normThreshold = deMath.scale(intThreshold, 1.0/255.0);
+
+ return normThreshold;
+
+ case es3fShaderDerivateTests.SurfaceType.UNORM_FBO: return deMath.scale([1, 1, 1, 1], 1.0/255.0);
+ case es3fShaderDerivateTests.SurfaceType.FLOAT_FBO: return [0.0, 0.0, 0.0, 0.0];
+ default:
+ assertMsgOptions(false, 'Surface Type not supported. Falling back to default retun value [0.0, 0.0, 0.0, 0.0]', false, false);
+ return [0.0, 0.0, 0.0, 0.0];
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fShaderDerivateTests.TriangleDerivateCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {es3fShaderDerivateTests.DerivateFunc} func
+ * @param {gluShaderUtil.DataType} type
+ */
+ es3fShaderDerivateTests.ConstantDerivateCase = function(name, description, func, type) {
+ es3fShaderDerivateTests.TriangleDerivateCase.call(this, name, description);
+ /** @type {es3fShaderDerivateTests.DerivateFunc} */ this.m_func = func;
+ this.m_dataType = type;
+ this.m_precision = gluShaderUtil.precision.PRECISION_HIGHP;
+ this.m_coordDataType = this.m_dataType;
+ this.m_coordPrecision = this.m_precision;
+ };
+
+ es3fShaderDerivateTests.ConstantDerivateCase.prototype = Object.create(es3fShaderDerivateTests.TriangleDerivateCase.prototype);
+ es3fShaderDerivateTests.ConstantDerivateCase.prototype.constructor = es3fShaderDerivateTests.ConstantDerivateCase;
+
+ es3fShaderDerivateTests.ConstantDerivateCase.prototype.init = function() {
+ /** @type {string} */ var fragmentTmpl = '' +
+ '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 o_color;\n' +
+ 'uniform ${PRECISION} ${DATATYPE} u_scale;\n' +
+ 'uniform ${PRECISION} ${DATATYPE} u_bias;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' ${PRECISION} ${DATATYPE} res = ${FUNC}(${VALUE}) * u_scale + u_bias;\n' +
+ ' o_color = ${CAST_TO_OUTPUT};\n' +
+ '}\n';
+
+ /** @type {Object} */ var fragmentParams = {};
+ fragmentParams['PRECISION'] = gluShaderUtil.getPrecisionName(this.m_precision);
+ fragmentParams['DATATYPE'] = gluShaderUtil.getDataTypeName(this.m_dataType);
+ fragmentParams['FUNC'] = es3fShaderDerivateTests.getDerivateFuncName(this.m_func);
+ fragmentParams['VALUE'] = this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC4 ? 'vec4(1.0, 7.2, -1e5, 0.0)' :
+ this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC3 ? 'vec3(1e2, 8.0, 0.01)' :
+ this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC2 ? 'vec2(-0.0, 2.7)' :
+ '7.7';
+ fragmentParams['CAST_TO_OUTPUT'] = this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC4 ? 'res' :
+ this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC3 ? 'vec4(res, 1.0)' :
+ this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC2 ? 'vec4(res, 0.0, 1.0)' :
+ 'vec4(res, 0.0, 0.0, 1.0)';
+
+ this.m_fragmentSrc = tcuStringTemplate.specialize(fragmentTmpl, fragmentParams);
+
+ this.m_derivScale = [1e3, 1e3, 1e3, 1e3];
+ this.m_derivBias = [0.5, 0.5, 0.5, 0.5];
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} result
+ * @param {tcuTexture.PixelBufferAccess} errorMask
+ * @return {boolean}
+ */
+ es3fShaderDerivateTests.ConstantDerivateCase.prototype.verify = function(result, errorMask) {
+ /** @type {Array<number>} */ var reference = [0.0, 0.0, 0.0, 0.0]; // Derivate of constant argument should always be 0
+ /** @type {Array<number>} */ var threshold = deMath.divide(this.getSurfaceThreshold(), deMath.abs(this.m_derivScale));
+ return es3fShaderDerivateTests.verifyConstantDerivate(result, errorMask, this.m_dataType,
+ reference, threshold, this.m_derivScale, this.m_derivBias);
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fShaderDerivateTests.TriangleDerivateCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {es3fShaderDerivateTests.DerivateFunc} func
+ * @param {gluShaderUtil.DataType} type
+ * @param {gluShaderUtil.precision} precision
+ * @param {number} hint
+ * @param {es3fShaderDerivateTests.SurfaceType} surfaceType
+ * @param {number} numSamples
+ * @param {string} fragmentSrcTmpl
+ */
+ es3fShaderDerivateTests.LinearDerivateCase = function(name, description, func, type, precision, hint, surfaceType, numSamples, fragmentSrcTmpl) {
+ es3fShaderDerivateTests.TriangleDerivateCase.call(this, name, description);
+ /** @type {es3fShaderDerivateTests.DerivateFunc} */ this.m_func = func;
+ /** @type {string} */ this.m_fragmentTmpl = fragmentSrcTmpl;
+ this.m_dataType = type;
+ this.m_precision = precision;
+ this.m_coordDataType = this.m_dataType;
+ this.m_coordPrecision = this.m_precision;
+ this.m_hint = hint;
+ this.m_surfaceType = surfaceType;
+ this.m_numSamples = numSamples;
+ };
+
+ es3fShaderDerivateTests.LinearDerivateCase.prototype = Object.create(es3fShaderDerivateTests.TriangleDerivateCase.prototype);
+ es3fShaderDerivateTests.LinearDerivateCase.prototype.constructor = es3fShaderDerivateTests.LinearDerivateCase;
+
+ es3fShaderDerivateTests.LinearDerivateCase.prototype.init = function() {
+ /** @type {Array<number>} */ var viewportSize = this.getViewportSize();
+ /** @type {number} */ var w = viewportSize[0];
+ /** @type {number} */ var h = viewportSize[1];
+ /** @type {boolean} */ var packToInt = this.m_surfaceType === es3fShaderDerivateTests.SurfaceType.FLOAT_FBO;
+
+ /** @type {Object} */ var fragmentParams = {};
+ fragmentParams['OUTPUT_TYPE'] = gluShaderUtil.getDataTypeName(packToInt ? gluShaderUtil.DataType.UINT_VEC4 : gluShaderUtil.DataType.FLOAT_VEC4);
+ fragmentParams['OUTPUT_PREC'] = gluShaderUtil.getPrecisionName(packToInt ? gluShaderUtil.precision.PRECISION_HIGHP : this.m_precision);
+ fragmentParams['PRECISION'] = gluShaderUtil.getPrecisionName(this.m_precision);
+ fragmentParams['DATATYPE'] = gluShaderUtil.getDataTypeName(this.m_dataType);
+ fragmentParams['FUNC'] = es3fShaderDerivateTests.getDerivateFuncName(this.m_func);
+
+ if (packToInt) {
+ fragmentParams['CAST_TO_OUTPUT'] = this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC4 ? 'floatBitsToUint(res)' :
+ this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC3 ? 'floatBitsToUint(vec4(res, 1.0))' :
+ this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC2 ? 'floatBitsToUint(vec4(res, 0.0, 1.0))' :
+ 'floatBitsToUint(vec4(res, 0.0, 0.0, 1.0))';
+ } else {
+ fragmentParams['CAST_TO_OUTPUT'] = this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC4 ? 'res' :
+ this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC3 ? 'vec4(res, 1.0)' :
+ this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC2 ? 'vec4(res, 0.0, 1.0)' :
+ 'vec4(res, 0.0, 0.0, 1.0)';
+ }
+
+ this.m_fragmentSrc = tcuStringTemplate.specialize(this.m_fragmentTmpl, fragmentParams);
+
+ switch (this.m_precision) {
+ case gluShaderUtil.precision.PRECISION_HIGHP:
+ this.m_coordMin = [-97., 0.2, 71., 74.];
+ this.m_coordMax = [-13.2, -77., 44., 76.];
+ break;
+
+ case gluShaderUtil.precision.PRECISION_MEDIUMP:
+ this.m_coordMin = [-37.0, 47., -7., 0.0];
+ this.m_coordMax = [-1.0, 12., 7., 19.];
+ break;
+
+ case gluShaderUtil.precision.PRECISION_LOWP:
+ this.m_coordMin = [0.0, -1.0, 0.0, 1.0];
+ this.m_coordMax = [1.0, 1.0, -1.0, -1.0];
+ break;
+
+ default:
+ throw new Error('Precision not supported: ' + this.m_precision);
+ }
+
+ if (this.m_surfaceType === es3fShaderDerivateTests.SurfaceType.FLOAT_FBO) {
+ // No scale or bias used for accuracy.
+ this.m_derivScale = [1.0, 1.0, 1.0, 1.0];
+ this.m_derivBias = [0.0, 0.0, 0.0, 0.0];
+ } else {
+ // Compute scale - bias that normalizes to 0..1 range.
+ /** @type {Array<number>} */ var dx = deMath.divide(deMath.subtract(this.m_coordMax, this.m_coordMin), [w, w, w * 0.5, -w * 0.5]);
+ /** @type {Array<number>} */ var dy = deMath.divide(deMath.subtract(this.m_coordMax, this.m_coordMin), [h, h, h * 0.5, -h * 0.5]);
+
+ switch (this.m_func) {
+ case es3fShaderDerivateTests.DerivateFunc.DFDX:
+ this.m_derivScale = deMath.divide([0.5, 0.5, 0.5, 0.5], dx);
+ break;
+
+ case es3fShaderDerivateTests.DerivateFunc.DFDY:
+ this.m_derivScale = deMath.divide([0.5, 0.5, 0.5, 0.5], dy);
+ break;
+
+ case es3fShaderDerivateTests.DerivateFunc.FWIDTH:
+ this.m_derivScale = deMath.divide([0.5, 0.5, 0.5, 0.5], deMath.add(deMath.abs(dx), deMath.abs(dy)));
+ break;
+
+ default:
+ throw new Error('Derivate Function not supported: ' + this.m_func);
+ }
+
+ this.m_derivBias = [0.0, 0.0, 0.0, 0.0];
+ }
+ };
+
+ /**
+ * @param {tcuTexture.ConstPixelBufferAccess} result
+ * @param {tcuTexture.PixelBufferAccess} errorMask
+ * @return {boolean}
+ */
+ es3fShaderDerivateTests.LinearDerivateCase.prototype.verify = function(result, errorMask) {
+ /** @type {Array<number>} */ var xScale = [1.0, 0.0, 0.5, -0.5];
+ /** @type {Array<number>} */ var yScale = [0.0, 1.0, 0.5, -0.5];
+ /** @type {Array<number>} */ var surfaceThreshold = deMath.divide(this.getSurfaceThreshold(), deMath.abs(this.m_derivScale));
+
+ /** @type {number} */ var w;
+ /** @type {number} */ var h;
+ /** @type {Array<number>} */ var reference;
+ /** @type {Array<number>} */ var threshold;
+
+ if (this.m_func === es3fShaderDerivateTests.DerivateFunc.DFDX || this.m_func === es3fShaderDerivateTests.DerivateFunc.DFDY) {
+ /** @type {boolean} */ var isX = this.m_func === es3fShaderDerivateTests.DerivateFunc.DFDX;
+ /** @type {number} */ var div = isX ? result.getWidth() : result.getHeight();
+ /** @type {Array<number>} */ var scale = isX ? xScale : yScale;
+ reference = deMath.multiply(deMath.scale(deMath.subtract(this.m_coordMax, this.m_coordMin), 1/div), scale);
+ /** @type {Array<number>} */ var opThreshold = es3fShaderDerivateTests.getDerivateThreshold(this.m_precision, deMath.multiply(this.m_coordMin, scale), deMath.multiply(this.m_coordMax, scale), reference);
+ threshold = deMath.max(surfaceThreshold, opThreshold);
+ bufferedLogToConsole('Verifying result image.\n' +
+ '\tValid derivative is ' + reference + ' with threshold ' + threshold);
+
+ // short circuit if result is strictly within the normal value error bounds.
+ // This improves performance significantly.
+ if (es3fShaderDerivateTests.verifyConstantDerivate(result, errorMask,
+ this.m_dataType, reference, threshold, this.m_derivScale,
+ this.m_derivBias, es3fShaderDerivateTests.VerificationLogging.LOG_NOTHING)) {
+ bufferedLogToConsole('No incorrect derivatives found, result valid.');
+ return true;
+ }
+
+ // some pixels exceed error bounds calculated for normal values. Verify that these
+ // potentially invalid pixels are in fact valid due to (for example) subnorm flushing.
+
+ bufferedLogToConsole('Initial verification failed, verifying image by calculating accurate error bounds for each result pixel.\n' +
+ '\tVerifying each result derivative is within its range of legal result values.');
+
+ /** @type {Array<number>} */ var viewportSize = this.getViewportSize();
+ /** @type {Array<number>} */ var valueRamp = deMath.subtract(this.m_coordMax, this.m_coordMin);
+ /** @type {es3fShaderDerivateTests.Linear2DFunctionEvaluator} */ var function_ = new es3fShaderDerivateTests.Linear2DFunctionEvaluator();
+ w = viewportSize[0];
+ h = viewportSize[1];
+
+ function_.matrix.setRow(0, [valueRamp[0] / w, 0.0, this.m_coordMin[0]]);
+ function_.matrix.setRow(1, [0.0, valueRamp[1] / h, this.m_coordMin[1]]);
+ function_.matrix.setRow(2, deMath.scale([valueRamp[2] / w, valueRamp[2] / h, this.m_coordMin[2] + this.m_coordMin[2]], 1 / 2.0));
+ function_.matrix.setRow(3, deMath.scale([-valueRamp[3] / w, -valueRamp[3] / h, this.m_coordMax[3] + this.m_coordMax[3]], 1 / 2.0));
+
+ return es3fShaderDerivateTests.reverifyConstantDerivateWithFlushRelaxations(
+ result, errorMask, this.m_dataType, this.m_precision, this.m_derivScale,
+ this.m_derivBias, surfaceThreshold, this.m_func, function_);
+ } else {
+ assertMsgOptions(this.m_func === es3fShaderDerivateTests.DerivateFunc.FWIDTH, 'Expected DerivateFunc.FWIDTH', false, true);
+ w = result.getWidth();
+ h = result.getHeight();
+
+ /** @type {Array<number>} */ var dx = deMath.multiply(deMath.scale(deMath.subtract(this.m_coordMax, this.m_coordMin), 1 / w), xScale);
+ /** @type {Array<number>} */ var dy = deMath.multiply(deMath.scale(deMath.subtract(this.m_coordMax, this.m_coordMin), 1 / h), yScale);
+ reference = deMath.add(deMath.abs(dx), deMath.abs(dy));
+ /** @type {Array<number>} */ var dxThreshold = es3fShaderDerivateTests.getDerivateThreshold(this.m_precision, deMath.multiply(this.m_coordMin, xScale), deMath.multiply(this.m_coordMax, xScale), dx);
+ /** @type {Array<number>} */ var dyThreshold = es3fShaderDerivateTests.getDerivateThreshold(this.m_precision, deMath.multiply(this.m_coordMin, yScale), deMath.multiply(this.m_coordMax, yScale), dy);
+ threshold = deMath.max(surfaceThreshold, deMath.max(dxThreshold, dyThreshold));
+
+ return es3fShaderDerivateTests.verifyConstantDerivate(result, errorMask, this.m_dataType,
+ reference, threshold, this.m_derivScale, this.m_derivBias);
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fShaderDerivateTests.TriangleDerivateCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {es3fShaderDerivateTests.DerivateFunc} func
+ * @param {gluShaderUtil.DataType} type
+ * @param {gluShaderUtil.precision} precision
+ * @param {number} hint
+ * @param {es3fShaderDerivateTests.SurfaceType} surfaceType
+ * @param {number} numSamples
+ */
+ es3fShaderDerivateTests.TextureDerivateCase = function(name, description, func, type, precision, hint, surfaceType, numSamples) {
+ es3fShaderDerivateTests.TriangleDerivateCase.call(this, name, description);
+ /** @type {es3fShaderDerivateTests.DerivateFunc} */ this.m_func = func;
+ /** @type {gluTexture.Texture2D} */ this.m_texture = null;
+ /** @type {Array<number>} */ this.m_texValueMin = [];
+ /** @type {Array<number>} */ this.m_texValueMax = [];
+ this.m_dataType = type;
+ this.m_precision = precision;
+ this.m_coordDataType = gluShaderUtil.DataType.FLOAT_VEC2;
+ this.m_coordPrecision = gluShaderUtil.precision.PRECISION_HIGHP;
+ this.m_hint = hint;
+ this.m_surfaceType = surfaceType;
+ this.m_numSamples = numSamples;
+ };
+
+ es3fShaderDerivateTests.TextureDerivateCase.prototype = Object.create(es3fShaderDerivateTests.TriangleDerivateCase.prototype);
+ es3fShaderDerivateTests.TextureDerivateCase.prototype.constructor = es3fShaderDerivateTests.TextureDerivateCase;
+
+ es3fShaderDerivateTests.TextureDerivateCase.prototype.deinit = function() {
+ this.m_texture = null;
+ };
+
+ es3fShaderDerivateTests.TextureDerivateCase.prototype.init = function() {
+ // Generate shader
+ /** @type {string} */ var fragmentTmpl = '' +
+ '#version 300 es\n' +
+ 'in highp vec2 v_coord;\n' +
+ 'layout(location = 0) out ${OUTPUT_PREC} ${OUTPUT_TYPE} o_color;\n' +
+ 'uniform ${PRECISION} sampler2D u_sampler;\n' +
+ 'uniform ${PRECISION} ${DATATYPE} u_scale;\n' +
+ 'uniform ${PRECISION} ${DATATYPE} u_bias;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' ${PRECISION} vec4 tex = texture(u_sampler, v_coord);\n' +
+ ' ${PRECISION} ${DATATYPE} res = ${FUNC}(tex${SWIZZLE}) * u_scale + u_bias;\n' +
+ ' o_color = ${CAST_TO_OUTPUT};\n' +
+ '}\n';
+
+ /** @type {boolean} */ var packToInt = this.m_surfaceType === es3fShaderDerivateTests.SurfaceType.FLOAT_FBO;
+ /** @type {Object} */ var fragmentParams = {};
+ /** @type {Array<number>} */ var viewportSize;
+ fragmentParams['OUTPUT_TYPE'] = gluShaderUtil.getDataTypeName(packToInt ? gluShaderUtil.DataType.UINT_VEC4 : gluShaderUtil.DataType.FLOAT_VEC4);
+ fragmentParams['OUTPUT_PREC'] = gluShaderUtil.getPrecisionName(packToInt ? gluShaderUtil.precision.PRECISION_HIGHP : this.m_precision);
+ fragmentParams['PRECISION'] = gluShaderUtil.getPrecisionName(this.m_precision);
+ fragmentParams['DATATYPE'] = gluShaderUtil.getDataTypeName(this.m_dataType);
+ fragmentParams['FUNC'] = es3fShaderDerivateTests.getDerivateFuncName(this.m_func);
+ fragmentParams['SWIZZLE'] = this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC4 ? '' :
+ this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC3 ? '.xyz' :
+ this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC2 ? '.xy' :
+ '.x';
+
+ if (packToInt) {
+ fragmentParams['CAST_TO_OUTPUT'] = this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC4 ? 'floatBitsToUint(res)' :
+ this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC3 ? 'floatBitsToUint(vec4(res, 1.0))' :
+ this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC2 ? 'floatBitsToUint(vec4(res, 0.0, 1.0))' :
+ 'floatBitsToUint(vec4(res, 0.0, 0.0, 1.0))';
+ } else {
+ fragmentParams['CAST_TO_OUTPUT'] = this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC4 ? 'res' :
+ this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC3 ? 'vec4(res, 1.0)' :
+ this.m_dataType === gluShaderUtil.DataType.FLOAT_VEC2 ? 'vec4(res, 0.0, 1.0)' :
+ 'vec4(res, 0.0, 0.0, 1.0)';
+ }
+
+ this.m_fragmentSrc = tcuStringTemplate.specialize(fragmentTmpl, fragmentParams);
+
+ // Texture size matches viewport and nearest sampling is used. Thus texture sampling
+ // is equal to just interpolating the texture value range.
+
+ // Determine value range for texture.
+
+ switch (this.m_precision) {
+ case gluShaderUtil.precision.PRECISION_HIGHP:
+ this.m_texValueMin = [-97., 0.2, 71., 74.];
+ this.m_texValueMax = [-13.2, -77., 44., 76.];
+ break;
+
+ case gluShaderUtil.precision.PRECISION_MEDIUMP:
+ this.m_texValueMin = [-37.0, 47., -7., 0.0];
+ this.m_texValueMax = [-1.0, 12., 7., 19.];
+ break;
+
+ case gluShaderUtil.precision.PRECISION_LOWP:
+ this.m_texValueMin = [0.0, -1.0, 0.0, 1.0];
+ this.m_texValueMax = [1.0, 1.0, -1.0, -1.0];
+ break;
+
+ default:
+ throw new Error(false, 'Precision not supported:' + this.m_precision);
+ }
+
+ // Lowp and mediump cases use RGBA16F format, while highp uses RGBA32F.
+ viewportSize = this.getViewportSize();
+ assertMsgOptions(!this.m_texture, 'Texture not null', false, true);
+ this.m_texture = gluTexture.texture2DFromInternalFormat(gl, this.m_precision === gluShaderUtil.precision.PRECISION_HIGHP ? gl.RGBA32F : gl.RGBA16F, viewportSize[0], viewportSize[1]);
+ this.m_texture.getRefTexture().allocLevel(0);
+
+ // Texture coordinates
+ this.m_coordMin = [0.0, 0.0, 0.0, 0.0];
+ this.m_coordMax = [1.0, 1.0, 1.0, 1.0];
+
+ // Fill with gradients.
+ /** @type {tcuTexture.PixelBufferAccess} */ var level0 = this.m_texture.getRefTexture().getLevel(0);
+ for (var y = 0; y < level0.getHeight(); y++) {
+ for (var x = 0; x < level0.getWidth(); x++) {
+ /** @type {number} */ var xf = (x + 0.5) / level0.getWidth();
+ /** @type {number} */ var yf = (y + 0.5) / level0.getHeight();
+ /** @type {Array<number>} */ var s = [xf, yf, (xf + yf) / 2.0, 1.0 - (xf + yf) / 2.0];
+
+ level0.setPixel(deMath.add(this.m_texValueMin, deMath.multiply(deMath.subtract(this.m_texValueMax, this.m_texValueMin), s)), x, y);
+ }
+ }
+
+ this.m_texture.upload();
+
+ if (this.m_surfaceType === es3fShaderDerivateTests.SurfaceType.FLOAT_FBO) {
+ // No scale or bias used for accuracy.
+ this.m_derivScale = [1.0, 1.0, 1.0, 1.0];
+ this.m_derivBias = [0.0, 0.0, 0.0, 0.0];
+ } else {
+ // Compute scale - bias that normalizes to 0..1 range.
+ viewportSize = this.getViewportSize();
+ /** @type {number} */ var w = viewportSize[0];
+ /** @type {number} */ var h = viewportSize[1];
+ /** @type {Array<number>} */ var dx = deMath.divide(deMath.subtract(this.m_texValueMax, this.m_texValueMin), [w, w, w * 0.5, -w * 0.5]);
+ /** @type {Array<number>} */ var dy = deMath.divide(deMath.subtract(this.m_texValueMax, this.m_texValueMin), [h, h, h * 0.5, -h * 0.5]);
+
+ switch (this.m_func) {
+ case es3fShaderDerivateTests.DerivateFunc.DFDX:
+ this.m_derivScale = deMath.divide([0.5, 0.5, 0.5, 0.5], dx);
+ break;
+
+ case es3fShaderDerivateTests.DerivateFunc.DFDY:
+ this.m_derivScale = deMath.divide([0.5, 0.5, 0.5, 0.5], dy);
+ break;
+
+ case es3fShaderDerivateTests.DerivateFunc.FWIDTH:
+ this.m_derivScale = deMath.divide([0.5, 0.5, 0.5, 0.5], deMath.add(deMath.abs(dx), deMath.abs(dy)));
+ break;
+
+ default:
+ throw new Error('Derivate Function not supported: ' + this.m_func);
+ }
+
+ this.m_derivBias = [0.0, 0.0, 0.0, 0.0];
+ }
+ };
+
+ /**
+ * @param {WebGLProgram} program
+ */
+ es3fShaderDerivateTests.TextureDerivateCase.prototype.setupRenderState = function(program) {
+ /** @type {number} */ var texUnit = 1;
+
+ gl.activeTexture(gl.TEXTURE0 + texUnit);
+ gl.bindTexture(gl.TEXTURE_2D, this.m_texture.getGLTexture());
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+
+ gl.uniform1i(gl.getUniformLocation(program, 'u_sampler'), texUnit);
+ };
+
+ /**
+ * @param {tcuTexture.PixelBufferAccess} result
+ * @param {tcuTexture.PixelBufferAccess} errorMask
+ * @return {boolean}
+ */
+ es3fShaderDerivateTests.TextureDerivateCase.prototype.verify = function(result, errorMask) {
+ // \note Edges are ignored in comparison
+ if (result.getWidth() < 2 || result.getHeight() < 2)
+ throw new Error('Too small viewport');
+
+ /** @type {tcuTexture.PixelBufferAccess} */ var compareArea = tcuTextureUtil.getSubregion(result, 1, 1, 0, result.getWidth() - 2, result.getHeight() - 2, 1);
+ /** @type {tcuTexture.PixelBufferAccess} */ var maskArea = tcuTextureUtil.getSubregion(errorMask, 1, 1, 0, errorMask.getWidth() - 2, errorMask.getHeight() - 2, 1);
+ /** @type {Array<number>} */ var xScale = [1.0, 0.0, 0.5, -0.5];
+ /** @type {Array<number>} */ var yScale = [0.0, 1.0, 0.5, -0.5];
+ /** @type {number} */ var w = result.getWidth();
+ /** @type {number} */ var h = result.getHeight();
+
+ /** @type {Array<number>} */ var surfaceThreshold = deMath.divide(this.getSurfaceThreshold(), deMath.abs(this.m_derivScale));
+ /** @type {Array<number>} */ var reference;
+ /** @type {Array<number>} */ var threshold;
+ if (this.m_func == es3fShaderDerivateTests.DerivateFunc.DFDX || this.m_func == es3fShaderDerivateTests.DerivateFunc.DFDY) {
+ /** @type {boolean} */ var isX = this.m_func == es3fShaderDerivateTests.DerivateFunc.DFDX;
+ /** @type {number} */ var div = isX ? w : h;
+ /** @type {Array<number>} */ var scale = isX ? xScale : yScale;
+ reference = deMath.multiply(deMath.scale(deMath.subtract(this.m_texValueMax, this.m_texValueMin), 1 / div), scale);
+ /** @type {Array<number>} */ var opThreshold = es3fShaderDerivateTests.getDerivateThreshold(this.m_precision, deMath.multiply(this.m_texValueMin, scale), deMath.multiply(this.m_texValueMax, scale), reference);
+ threshold = deMath.max(surfaceThreshold, opThreshold);
+
+ bufferedLogToConsole('Verifying result image.\n'+
+ '\tValid derivative is ' + reference + ' with threshold ' + threshold);
+
+ // short circuit if result is strictly within the normal value error bounds.
+ // This improves performance significantly.
+ if (es3fShaderDerivateTests.verifyConstantDerivate(compareArea, maskArea, this.m_dataType,
+ reference, threshold, this.m_derivScale, this.m_derivBias,
+ es3fShaderDerivateTests.VerificationLogging.LOG_NOTHING)) {
+ bufferedLogToConsole('No incorrect derivatives found, result valid.');
+ return true;
+ }
+ // some pixels exceed error bounds calculated for normal values. Verify that these
+ // potentially invalid pixels are in fact valid due to (for example) subnorm flushing.
+
+ bufferedLogToConsole('Initial verification failed, verifying image by calculating accurate error bounds for each result pixel.\n' +
+ '\tVerifying each result derivative is within its range of legal result values.');
+
+ /** @type {Array<number>} */ var valueRamp = deMath.subtract(this.m_texValueMax, this.m_texValueMin);
+ /** @type {es3fShaderDerivateTests.Linear2DFunctionEvaluator} */ var function_ = new es3fShaderDerivateTests.Linear2DFunctionEvaluator();
+
+ function_.matrix.setRow(0, [valueRamp[0] / w, 0.0, this.m_texValueMin[0]]);
+ function_.matrix.setRow(1, [0.0, valueRamp[1] / h, this.m_texValueMin[1]]);
+ function_.matrix.setRow(2, deMath.scale([valueRamp[2] / w, valueRamp[2] / h, this.m_texValueMin[2] + this.m_texValueMin[2]], 1 / 2.0));
+ function_.matrix.setRow(3, deMath.scale([-valueRamp[3] / w, -valueRamp[3] / h, this.m_texValueMax[3] + this.m_texValueMax[3]], 1 / 2.0));
+
+ return es3fShaderDerivateTests.reverifyConstantDerivateWithFlushRelaxations(compareArea, maskArea, this.m_dataType, this.m_precision,
+ this.m_derivScale, this.m_derivBias, surfaceThreshold, this.m_func, function_);
+ } else {
+ assertMsgOptions(this.m_func == es3fShaderDerivateTests.DerivateFunc.FWIDTH, 'Expected Derivate Function FWIDTH', false, true);
+ /** @type {Array<number>} */ var dx = deMath.multiply(deMath.scale(deMath.subtract(this.m_texValueMax, this.m_texValueMin), 1 / w), xScale);
+ /** @type {Array<number>} */ var dy = deMath.multiply(deMath.scale(deMath.subtract(this.m_texValueMax, this.m_texValueMin), 1 / h), yScale);
+ reference = deMath.add(deMath.abs(dx), deMath.abs(dy));
+ /** @type {Array<number>} */ var dxThreshold = es3fShaderDerivateTests.getDerivateThreshold(this.m_precision, deMath.multiply(this.m_texValueMin, xScale), deMath.multiply(this.m_texValueMax, xScale), dx);
+ /** @type {Array<number>} */ var dyThreshold = es3fShaderDerivateTests.getDerivateThreshold(this.m_precision, deMath.multiply(this.m_texValueMin, yScale), deMath.multiply(this.m_texValueMax, yScale), dy);
+ threshold = deMath.max(surfaceThreshold, deMath.max(dxThreshold, dyThreshold));
+
+ return es3fShaderDerivateTests.verifyConstantDerivate(compareArea, maskArea, this.m_dataType,
+ reference, threshold, this.m_derivScale, this.m_derivBias);
+ };
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fShaderDerivateTests.ShaderDerivateTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'derivate', 'Derivate Function Tests');
+ };
+
+ es3fShaderDerivateTests.ShaderDerivateTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fShaderDerivateTests.ShaderDerivateTests.prototype.constructor = es3fShaderDerivateTests.ShaderDerivateTests
+
+ /**
+ * @struct
+ * @constructor
+ * @param {string} name
+ * @param {es3fShaderDerivateTests.DerivateFunc} func
+ * @param {gluShaderUtil.DataType} dataType_
+ * @param {gluShaderUtil.precision} precision_
+ */
+ es3fShaderDerivateTests.FunctionSpec = function(name, func, dataType_, precision_) {
+ this.name = name;
+ this.function_ = func;
+ this.dataType = dataType_;
+ this.precision = precision_;
+ };
+
+ es3fShaderDerivateTests.ShaderDerivateTests.prototype.init = function() {
+ var testGroup = tcuTestCase.runner.testCases;
+ /**
+ * @struct
+ * @constructor
+ * @param {string} name
+ * @param {string} description
+ * @param {string} source
+ */
+ var LinearDerivateCase = function(name, description, source) {
+ /** @type {string} */ this.name = name;
+ /** @type {string} */ this.description = description;
+ /** @type {string} */ this.source = source;
+ };
+
+ /** @type {Array<LinearDerivateCase>} */
+ var s_linearDerivateCases = [
+ new LinearDerivateCase(
+ 'linear',
+ 'Basic derivate of linearly interpolated argument',
+ '#version 300 es\n' +
+ 'in ${PRECISION} ${DATATYPE} v_coord;\n' +
+ 'layout(location = 0) out ${OUTPUT_PREC} ${OUTPUT_TYPE} o_color;\n' +
+ 'uniform ${PRECISION} ${DATATYPE} u_scale;\n' +
+ 'uniform ${PRECISION} ${DATATYPE} u_bias;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' ${PRECISION} ${DATATYPE} res = ${FUNC}(v_coord) * u_scale + u_bias;\n' +
+ ' o_color = ${CAST_TO_OUTPUT};\n' +
+ '}\n'),
+ new LinearDerivateCase(
+ 'in_function',
+ 'Derivate of linear function argument',
+ '#version 300 es\n' +
+ 'in ${PRECISION} ${DATATYPE} v_coord;\n' +
+ 'layout(location = 0) out ${OUTPUT_PREC} ${OUTPUT_TYPE} o_color;\n' +
+ 'uniform ${PRECISION} ${DATATYPE} u_scale;\n' +
+ 'uniform ${PRECISION} ${DATATYPE} u_bias;\n' +
+ '\n' +
+ '${PRECISION} ${DATATYPE} computeRes (${PRECISION} ${DATATYPE} value)\n' +
+ '{\n' +
+ ' return ${FUNC}(v_coord) * u_scale + u_bias;\n' +
+ '}\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' ${PRECISION} ${DATATYPE} res = computeRes(v_coord);\n' +
+ ' o_color = ${CAST_TO_OUTPUT};\n' +
+ '}\n'),
+ new LinearDerivateCase(
+ 'static_if',
+ 'Derivate of linearly interpolated value in static if',
+ '#version 300 es\n' +
+ 'in ${PRECISION} ${DATATYPE} v_coord;\n' +
+ 'layout(location = 0) out ${OUTPUT_PREC} ${OUTPUT_TYPE} o_color;\n' +
+ 'uniform ${PRECISION} ${DATATYPE} u_scale;\n' +
+ 'uniform ${PRECISION} ${DATATYPE} u_bias;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' ${PRECISION} ${DATATYPE} res;\n' +
+ ' if (false)\n' +
+ ' res = ${FUNC}(-v_coord) * u_scale + u_bias;\n' +
+ ' else\n' +
+ ' res = ${FUNC}(v_coord) * u_scale + u_bias;\n' +
+ ' o_color = ${CAST_TO_OUTPUT};\n' +
+ '}\n'),
+ new LinearDerivateCase(
+ 'static_loop',
+ 'Derivate of linearly interpolated value in static loop',
+ '#version 300 es\n' +
+ 'in ${PRECISION} ${DATATYPE} v_coord;\n' +
+ 'layout(location = 0) out ${OUTPUT_PREC} ${OUTPUT_TYPE} o_color;\n' +
+ 'uniform ${PRECISION} ${DATATYPE} u_scale;\n' +
+ 'uniform ${PRECISION} ${DATATYPE} u_bias;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' ${PRECISION} ${DATATYPE} res = ${DATATYPE}(0.0);\n' +
+ ' for (int i = 0; i < 2; i++)\n' +
+ ' res += ${FUNC}(v_coord * float(i));\n' +
+ ' res = res * u_scale + u_bias;\n' +
+ ' o_color = ${CAST_TO_OUTPUT};\n' +
+ '}\n'),
+ new LinearDerivateCase(
+ 'static_switch',
+ 'Derivate of linearly interpolated value in static switch',
+ '#version 300 es\n' +
+ 'in ${PRECISION} ${DATATYPE} v_coord;\n' +
+ 'layout(location = 0) out ${OUTPUT_PREC} ${OUTPUT_TYPE} o_color;\n' +
+ 'uniform ${PRECISION} ${DATATYPE} u_scale;\n' +
+ 'uniform ${PRECISION} ${DATATYPE} u_bias;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' ${PRECISION} ${DATATYPE} res;\n' +
+ ' switch (1)\n' +
+ ' {\n' +
+ ' case 0: res = ${FUNC}(-v_coord) * u_scale + u_bias; break;\n' +
+ ' case 1: res = ${FUNC}(v_coord) * u_scale + u_bias; break;\n' +
+ ' }\n' +
+ ' o_color = ${CAST_TO_OUTPUT};\n' +
+ '}\n'),
+ new LinearDerivateCase(
+ 'uniform_if',
+ 'Derivate of linearly interpolated value in uniform if',
+ '#version 300 es\n' +
+ 'in ${PRECISION} ${DATATYPE} v_coord;\n' +
+ 'layout(location = 0) out ${OUTPUT_PREC} ${OUTPUT_TYPE} o_color;\n' +
+ 'uniform ${PRECISION} ${DATATYPE} u_scale;\n' +
+ 'uniform ${PRECISION} ${DATATYPE} u_bias;\n' +
+ 'uniform bool ub_true;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' ${PRECISION} ${DATATYPE} res;\n' +
+ ' if (ub_true)\n' +
+ ' res = ${FUNC}(v_coord) * u_scale + u_bias;\n' +
+ ' else\n' +
+ ' res = ${FUNC}(-v_coord) * u_scale + u_bias;\n' +
+ ' o_color = ${CAST_TO_OUTPUT};\n' +
+ '}\n'),
+ new LinearDerivateCase(
+ 'uniform_loop',
+ 'Derivate of linearly interpolated value in uniform loop',
+ '#version 300 es\n' +
+ 'in ${PRECISION} ${DATATYPE} v_coord;\n' +
+ 'layout(location = 0) out ${OUTPUT_PREC} ${OUTPUT_TYPE} o_color;\n' +
+ 'uniform ${PRECISION} ${DATATYPE} u_scale;\n' +
+ 'uniform ${PRECISION} ${DATATYPE} u_bias;\n' +
+ 'uniform int ui_two;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' ${PRECISION} ${DATATYPE} res = ${DATATYPE}(0.0);\n' +
+ ' for (int i = 0; i < ui_two; i++)\n' +
+ ' res += ${FUNC}(v_coord * float(i));\n' +
+ ' res = res * u_scale + u_bias;\n' +
+ ' o_color = ${CAST_TO_OUTPUT};\n' +
+ '}\n'),
+ new LinearDerivateCase(
+ 'uniform_switch',
+ 'Derivate of linearly interpolated value in uniform switch',
+ '#version 300 es\n' +
+ 'in ${PRECISION} ${DATATYPE} v_coord;\n' +
+ 'layout(location = 0) out ${OUTPUT_PREC} ${OUTPUT_TYPE} o_color;\n' +
+ 'uniform ${PRECISION} ${DATATYPE} u_scale;\n' +
+ 'uniform ${PRECISION} ${DATATYPE} u_bias;\n' +
+ 'uniform int ui_one;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' ${PRECISION} ${DATATYPE} res;\n' +
+ ' switch (ui_one)\n' +
+ ' {\n' +
+ ' case 0: res = ${FUNC}(-v_coord) * u_scale + u_bias; break;\n' +
+ ' case 1: res = ${FUNC}(v_coord) * u_scale + u_bias; break;\n' +
+ ' }\n' +
+ ' o_color = ${CAST_TO_OUTPUT};\n' +
+ '}\n')
+ ];
+
+ /**
+ * @struct
+ * @constructor
+ * @param {string} name
+ * @param {es3fShaderDerivateTests.SurfaceType} surfaceType
+ * @param {number} numSamples
+ */
+ var FboConfig = function(name, surfaceType, numSamples) {
+ /** @type {string} */ this.name = name;
+ /** @type {es3fShaderDerivateTests.SurfaceType} */ this.surfaceType = surfaceType;
+ /** @type {number} */ this.numSamples = numSamples;
+ };
+
+ /** @type {Array<FboConfig>} */ var s_fboConfigs = [
+ new FboConfig('fbo', es3fShaderDerivateTests.SurfaceType.DEFAULT_FRAMEBUFFER, 0),
+ new FboConfig('fbo_msaa2', es3fShaderDerivateTests.SurfaceType.UNORM_FBO, 2),
+ new FboConfig('fbo_msaa4', es3fShaderDerivateTests.SurfaceType.UNORM_FBO, 4),
+ new FboConfig('fbo_float', es3fShaderDerivateTests.SurfaceType.FLOAT_FBO, 0)
+ ];
+
+ /**
+ * @struct
+ * @constructor
+ * @param {string} name
+ * @param {number} hint
+ */
+ var Hint = function(name, hint) {
+ /** @type {string} */ this.name = name;
+ /** @type {number} */ this.hint = hint;
+ };
+
+ /** @type {Array<Hint>} */ var s_hints = [
+ new Hint('fastest', gl.FASTEST),
+ new Hint('nicest', gl.NICEST)
+ ];
+
+ /**
+ * @struct
+ * @constructor
+ * @param {string} name
+ * @param {es3fShaderDerivateTests.SurfaceType} surfaceType
+ * @param {number} numSamples
+ */
+ var HintFboConfig = function(name, surfaceType, numSamples) {
+ /** @type {string} */ this.name = name;
+ /** @type {es3fShaderDerivateTests.SurfaceType} */ this.surfaceType = surfaceType;
+ /** @type {number} */ this.numSamples = numSamples;
+ };
+
+ /** @type {Array<HintFboConfig>} */ var s_hintFboConfigs = [
+ new HintFboConfig('default', es3fShaderDerivateTests.SurfaceType.DEFAULT_FRAMEBUFFER, 0),
+ new HintFboConfig('fbo_msaa4', es3fShaderDerivateTests.SurfaceType.UNORM_FBO, 4),
+ new HintFboConfig('fbo_float', es3fShaderDerivateTests.SurfaceType.FLOAT_FBO, 0)
+ ];
+
+ /**
+ * @struct
+ * @constructor
+ * @param {string} name
+ * @param {es3fShaderDerivateTests.SurfaceType} surfaceType
+ * @param {number} numSamples
+ * @param {number} hint
+ */
+ var TextureConfig = function(name, surfaceType, numSamples, hint) {
+ /** @type {string} */ this.name = name;
+ /** @type {es3fShaderDerivateTests.SurfaceType} */ this.surfaceType = surfaceType;
+ /** @type {number} */ this.numSamples = numSamples;
+ /** @type {number} */ this.hint = hint;
+ };
+
+ /** @type {Array<TextureConfig>} */ var s_textureConfigs = [
+ new TextureConfig('basic', es3fShaderDerivateTests.SurfaceType.DEFAULT_FRAMEBUFFER, 0, gl.DONT_CARE),
+ new TextureConfig('msaa4', es3fShaderDerivateTests.SurfaceType.UNORM_FBO, 4, gl.DONT_CARE),
+ new TextureConfig('float_fastest', es3fShaderDerivateTests.SurfaceType.FLOAT_FBO, 0, gl.FASTEST),
+ new TextureConfig('float_nicest', es3fShaderDerivateTests.SurfaceType.FLOAT_FBO, 0, gl.NICEST)
+ ];
+
+ /** @type {gluShaderUtil.DataType} */ var dataType;
+ /** @type {string} */ var source;
+ /** @type {gluShaderUtil.precision} */ var precision;
+ /** @type {es3fShaderDerivateTests.SurfaceType} */ var surfaceType;
+ /** @type {number} */ var numSamples;
+ /** @type {number} */ var hint;
+ /** @type {string} */ var caseName;
+ /** @type {tcuTestCase.DeqpTest} */ var fboGroup;
+
+ // .dfdx, .dfdy, .fwidth
+ for (var funcNdx in es3fShaderDerivateTests.DerivateFunc) {
+ /** @type {es3fShaderDerivateTests.DerivateFunc} */ var function_ = es3fShaderDerivateTests.DerivateFunc[funcNdx];
+ /** @type {tcuTestCase.DeqpTest} */ var functionGroup = tcuTestCase.newTest(es3fShaderDerivateTests.getDerivateFuncCaseName(function_), es3fShaderDerivateTests.getDerivateFuncName(function_));
+ testGroup.addChild(functionGroup);
+
+ // .constant - no precision variants, checks that derivate of constant arguments is 0
+ /** @type {tcuTestCase.DeqpTest} */ var constantGroup = tcuTestCase.newTest('constant', 'Derivate of constant argument');
+ functionGroup.addChild(constantGroup);
+
+ for (var vecSize = 1; vecSize <= 4; vecSize++) {
+ dataType = vecSize > 1 ? gluShaderUtil.getDataTypeFloatVec(vecSize) : gluShaderUtil.DataType.FLOAT;
+ constantGroup.addChild(new es3fShaderDerivateTests.ConstantDerivateCase(gluShaderUtil.getDataTypeName(dataType), '', function_, dataType));
+ }
+
+ // Cases based on LinearDerivateCase
+ for (var caseNdx = 0; caseNdx < s_linearDerivateCases.length; caseNdx++) {
+ /** @type {tcuTestCase.DeqpTest} */ var linearCaseGroup = tcuTestCase.newTest(s_linearDerivateCases[caseNdx].name, s_linearDerivateCases[caseNdx].description);
+ source = s_linearDerivateCases[caseNdx].source;
+ functionGroup.addChild(linearCaseGroup);
+
+ for (var vecSize = 1; vecSize <= 4; vecSize++)
+ for (var precNdx in gluShaderUtil.precision) {
+ dataType = vecSize > 1 ? gluShaderUtil.getDataTypeFloatVec(vecSize) : gluShaderUtil.DataType.FLOAT;
+ precision = gluShaderUtil.precision[precNdx];
+ surfaceType = es3fShaderDerivateTests.SurfaceType.DEFAULT_FRAMEBUFFER;
+ numSamples = 0;
+ hint = gl.DONT_CARE;
+
+ if (caseNdx !== 0 && precision === gluShaderUtil.precision.PRECISION_LOWP)
+ continue; // Skip as lowp doesn't actually produce any bits when rendered to default FB.
+
+ caseName = gluShaderUtil.getDataTypeName(dataType) + '_' + gluShaderUtil.getPrecisionName(precision);
+
+ linearCaseGroup.addChild(new es3fShaderDerivateTests.LinearDerivateCase(caseName, '', function_, dataType, precision, hint, surfaceType, numSamples, source));
+ }
+ }
+
+ // Fbo cases
+ for (var caseNdx = 0; caseNdx < s_fboConfigs.length; caseNdx++) {
+ fboGroup = tcuTestCase.newTest(s_fboConfigs[caseNdx].name, 'Derivate usage when rendering into FBO');
+ source = s_linearDerivateCases[0].source; // use source from .linear group
+ surfaceType = s_fboConfigs[caseNdx].surfaceType;
+ numSamples = s_fboConfigs[caseNdx].numSamples;
+ functionGroup.addChild(fboGroup);
+
+ for (var vecSize = 1; vecSize <= 4; vecSize++)
+ for (var precNdx in gluShaderUtil.precision) {
+ dataType = vecSize > 1 ? gluShaderUtil.getDataTypeFloatVec(vecSize) : gluShaderUtil.DataType.FLOAT;
+ precision = gluShaderUtil.precision[precNdx];
+ hint = gl.DONT_CARE;
+
+ if (surfaceType !== es3fShaderDerivateTests.SurfaceType.FLOAT_FBO && precision === gluShaderUtil.precision.PRECISION_LOWP)
+ continue; // Skip as lowp doesn't actually produce any bits when rendered to U8 RT.
+
+ caseName = gluShaderUtil.getDataTypeName(dataType) + '_' + gluShaderUtil.getPrecisionName(precision);
+
+ fboGroup.addChild(new es3fShaderDerivateTests.LinearDerivateCase(caseName, '', function_, dataType, precision, hint, surfaceType, numSamples, source));
+ }
+ }
+
+ // .fastest, .nicest
+ for (var hintCaseNdx = 0; hintCaseNdx < s_hints.length; hintCaseNdx++) {
+ /** @type {tcuTestCase.DeqpTest} */ var hintGroup = tcuTestCase.newTest(s_hints[hintCaseNdx].name, 'Shader derivate hints');
+ source = s_linearDerivateCases[0].source; // use source from .linear group
+ hint = s_hints[hintCaseNdx].hint;
+ functionGroup.addChild(hintGroup);
+
+ for (var fboCaseNdx = 0; fboCaseNdx < s_hintFboConfigs.length; fboCaseNdx++) {
+ fboGroup = tcuTestCase.newTest(s_hintFboConfigs[fboCaseNdx].name, '');
+ surfaceType = s_hintFboConfigs[fboCaseNdx].surfaceType;
+ numSamples = s_hintFboConfigs[fboCaseNdx].numSamples;
+ hintGroup.addChild(fboGroup);
+
+ for (var vecSize = 1; vecSize <= 4; vecSize++)
+ for (var precNdx in gluShaderUtil.precision) {
+ dataType = vecSize > 1 ? gluShaderUtil.getDataTypeFloatVec(vecSize) : gluShaderUtil.DataType.FLOAT;
+ precision = gluShaderUtil.precision[precNdx];
+
+ if (surfaceType !== es3fShaderDerivateTests.SurfaceType.FLOAT_FBO && precision === gluShaderUtil.precision.PRECISION_LOWP)
+ continue; // Skip as lowp doesn't actually produce any bits when rendered to U8 RT.
+
+ caseName = gluShaderUtil.getDataTypeName(dataType) + '_' + gluShaderUtil.getPrecisionName(precision);
+
+ fboGroup.addChild(new es3fShaderDerivateTests.LinearDerivateCase(caseName, '', function_, dataType, precision, hint, surfaceType, numSamples, source));
+ }
+ }
+ }
+
+ // .texture
+ /** @type {tcuTestCase.DeqpTest} */ var textureGroup = tcuTestCase.newTest('texture', 'Derivate of texture lookup result');
+ functionGroup.addChild(textureGroup);
+
+ for (var texCaseNdx = 0; texCaseNdx < s_textureConfigs.length; texCaseNdx++) {
+ /** @type {tcuTestCase.DeqpTest} */ var caseGroup = tcuTestCase.newTest(s_textureConfigs[texCaseNdx].name, '');
+ surfaceType = s_textureConfigs[texCaseNdx].surfaceType;
+ numSamples = s_textureConfigs[texCaseNdx].numSamples;
+ hint = s_textureConfigs[texCaseNdx].hint;
+ textureGroup.addChild(caseGroup);
+
+ for (var vecSize = 1; vecSize <= 4; vecSize++)
+ for (var precNdx in gluShaderUtil.precision) {
+ dataType = vecSize > 1 ? gluShaderUtil.getDataTypeFloatVec(vecSize) : gluShaderUtil.DataType.FLOAT;
+ precision = gluShaderUtil.precision[precNdx];
+
+ if (surfaceType !== es3fShaderDerivateTests.SurfaceType.FLOAT_FBO && precision === gluShaderUtil.precision.PRECISION_LOWP)
+ continue; // Skip as lowp doesn't actually produce any bits when rendered to U8 RT.
+
+ caseName = gluShaderUtil.getDataTypeName(dataType) + '_' + gluShaderUtil.getPrecisionName(precision);
+
+ caseGroup.addChild(new es3fShaderDerivateTests.TextureDerivateCase(caseName, '', function_, dataType, precision, hint, surfaceType, numSamples));
+ }
+ }
+ }
+ };
+
+ /**
+ * Run test
+ * @param {WebGL2RenderingContext} context
+ */
+ es3fShaderDerivateTests.run = function(context, range) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fShaderDerivateTests.ShaderDerivateTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ if (range)
+ state.setRange(range);
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fShaderDerivateTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderIndexingTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderIndexingTests.js
new file mode 100644
index 0000000000..c08db90758
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderIndexingTests.js
@@ -0,0 +1,1278 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fShaderIndexingTests');
+goog.require('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuStringTemplate');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('framework.opengl.gluTexture');
+goog.require('modules.shared.glsShaderRenderCase');
+
+goog.scope(function() {
+ /** @type {?WebGL2RenderingContext} */ var gl;
+ var es3fShaderIndexingTests = functional.gles3.es3fShaderIndexingTests;
+ var deMath = framework.delibs.debase.deMath;
+ var glsShaderRenderCase = modules.shared.glsShaderRenderCase;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var gluTexture = framework.opengl.gluTexture;
+ var gluShaderProgram = framework.opengl.gluShaderProgram;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var tcuStringTemplate = framework.common.tcuStringTemplate;
+ /**
+ * @enum {number}
+ */
+ es3fShaderIndexingTests.IndexAccessType = {
+ STATIC: 0,
+ DYNAMIC: 1,
+ STATIC_LOOP: 2,
+ DYNAMIC_LOOP: 3
+ };
+
+ /**
+ * @param {es3fShaderIndexingTests.IndexAccessType} accessType
+ * @return {string}
+ */
+ es3fShaderIndexingTests.getIndexAccessTypeName = function(accessType) {
+ /** @type {Array<string>} */ var s_names = [
+ 'static',
+ 'dynamic',
+ 'static_loop',
+ 'dynamic_loop'
+ ];
+ return s_names[accessType];
+ };
+
+ /**
+ * @enum {number}
+ */
+ es3fShaderIndexingTests.VectorAccessType = {
+ DIRECT: 0,
+ COMPONENT: 1,
+ SUBSCRIPT_STATIC: 2,
+ SUBSCRIPT_DYNAMIC: 3,
+ SUBSCRIPT_STATIC_LOOP: 4,
+ SUBSCRIPT_DYNAMIC_LOOP: 5
+ };
+
+ /**
+ * @param {es3fShaderIndexingTests.VectorAccessType} accessType
+ * @return {string}
+ */
+ es3fShaderIndexingTests.getVectorAccessTypeName = function(accessType) {
+ /** @type {Array<string>} */ var s_names = [
+ 'direct',
+ 'component',
+ 'static_subscript',
+ 'dynamic_subscript',
+ 'static_loop_subscript',
+ 'dynamic_loop_subscript'
+ ];
+ assertMsgOptions(deMath.deInBounds32(accessType, 0, s_names.length), 'Index out of bounds', false, true);
+ return s_names[accessType];
+ };
+
+ /** @param {glsShaderRenderCase.ShaderEvalContext} c */
+ es3fShaderIndexingTests.evalArrayCoordsFloat = function(c) {
+ c.color[0] = 1.875 * c.coords[0];
+ };
+
+ /** @param {glsShaderRenderCase.ShaderEvalContext} c */
+ es3fShaderIndexingTests.evalArrayCoordsVec2 = function(c) {
+ var swizzled = deMath.swizzle(c.coords, [0, 1]);
+ c.color[0] = 1.875 * swizzled[0];
+ c.color[1] = 1.875 * swizzled[1];
+ };
+
+ /** @param {glsShaderRenderCase.ShaderEvalContext} c */
+ es3fShaderIndexingTests.evalArrayCoordsVec3 = function(c) {
+ var swizzled = deMath.swizzle(c.coords, [0, 1, 2]);
+ c.color[0] = 1.875 * swizzled[0];
+ c.color[1] = 1.875 * swizzled[1];
+ c.color[2] = 1.875 * swizzled[2];
+ };
+
+ /** @param {glsShaderRenderCase.ShaderEvalContext} c */
+ es3fShaderIndexingTests.evalArrayCoordsVec4 = function(c) {
+ c.color = deMath.scale(c.coords, 1.875);
+ };
+
+ /**
+ * @param {gluShaderUtil.DataType} dataType
+ * @return {function(glsShaderRenderCase.ShaderEvalContext)}
+ */
+ es3fShaderIndexingTests.getArrayCoordsEvalFunc = function(dataType) {
+ if (dataType === gluShaderUtil.DataType.FLOAT) return es3fShaderIndexingTests.evalArrayCoordsFloat;
+ else if (dataType === gluShaderUtil.DataType.FLOAT_VEC2) return es3fShaderIndexingTests.evalArrayCoordsVec2;
+ else if (dataType === gluShaderUtil.DataType.FLOAT_VEC3) return es3fShaderIndexingTests.evalArrayCoordsVec3;
+ else if (dataType === gluShaderUtil.DataType.FLOAT_VEC4) return es3fShaderIndexingTests.evalArrayCoordsVec4;
+ else throw new Error('Invalid data type.');
+ };
+
+
+ /** @param {glsShaderRenderCase.ShaderEvalContext} c */
+ es3fShaderIndexingTests.evalArrayUniformFloat = function(c) {
+ c.color[0] = 1.875 * c.constCoords[0];
+ };
+
+ /** @param {glsShaderRenderCase.ShaderEvalContext} c */
+ es3fShaderIndexingTests.evalArrayUniformVec2 = function(c) {
+ var swizzled = deMath.swizzle(c.constCoords, [0, 1]);
+ c.color[0] = 1.875 * swizzled[0];
+ c.color[1] = 1.875 * swizzled[1];
+ };
+
+ /** @param {glsShaderRenderCase.ShaderEvalContext} c */
+ es3fShaderIndexingTests.evalArrayUniformVec3 = function(c) {
+ var swizzled = deMath.swizzle(c.constCoords, [0, 1, 2]);
+ c.color[0] = 1.875 * swizzled[0];
+ c.color[1] = 1.875 * swizzled[1];
+ c.color[2] = 1.875 * swizzled[2];
+ };
+
+ /** @param {glsShaderRenderCase.ShaderEvalContext} c */
+ es3fShaderIndexingTests.evalArrayUniformVec4 = function(c) {
+ c.color = deMath.scale(c.constCoords, 1.875);
+ };
+
+ /**
+ * @param {gluShaderUtil.DataType} dataType
+ * @return {function(glsShaderRenderCase.ShaderEvalContext)}
+ */
+ es3fShaderIndexingTests.getArrayUniformEvalFunc = function(dataType) {
+ if (dataType === gluShaderUtil.DataType.FLOAT) return es3fShaderIndexingTests.evalArrayUniformFloat;
+ else if (dataType === gluShaderUtil.DataType.FLOAT_VEC2) return es3fShaderIndexingTests.evalArrayUniformVec2;
+ else if (dataType === gluShaderUtil.DataType.FLOAT_VEC3) return es3fShaderIndexingTests.evalArrayUniformVec3;
+ else if (dataType === gluShaderUtil.DataType.FLOAT_VEC4) return es3fShaderIndexingTests.evalArrayUniformVec4;
+ else throw new Error('Invalid data type.');
+ };
+
+ /**
+ * @constructor
+ * @extends {glsShaderRenderCase.ShaderRenderCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {boolean} isVertexCase
+ * @param {gluShaderUtil.DataType} varType
+ * @param {function(glsShaderRenderCase.ShaderEvalContext)} evalFunc
+ * @param {string} vertShaderSource
+ * @param {string} fragShaderSource
+ */
+ es3fShaderIndexingTests.ShaderIndexingCase = function(name, description, isVertexCase, varType, evalFunc, vertShaderSource, fragShaderSource) {
+ glsShaderRenderCase.ShaderRenderCase.call(this, name, description, isVertexCase, evalFunc);
+ /** @type {gluShaderUtil.DataType} */ this.m_varType = varType;
+ /** @type {string} */ this.m_vertShaderSource = vertShaderSource;
+ /** @type {string} */ this.m_fragShaderSource = fragShaderSource;
+ };
+
+ es3fShaderIndexingTests.ShaderIndexingCase.prototype = Object.create(glsShaderRenderCase.ShaderRenderCase.prototype);
+ es3fShaderIndexingTests.ShaderIndexingCase.prototype.constructor = es3fShaderIndexingTests.ShaderIndexingCase;
+
+ /**
+ * @param {?WebGLProgram} programID
+ * @param {Array<number>} constCoords
+ */
+ es3fShaderIndexingTests.ShaderIndexingCase.prototype.setupUniforms = function(programID, constCoords) {
+ /** @type {(Array<number>|Float32Array)} */ var arr = [];
+ /** @type {Array<number>} */ var array1d = [];
+ /** @type {?WebGLUniformLocation} */ var arrLoc = gl.getUniformLocation(programID, 'u_arr');
+ if (arrLoc != null) {
+ if (this.m_varType === gluShaderUtil.DataType.FLOAT) {
+ arr[0] = constCoords[0];
+ arr[1] = constCoords[0] * 0.5;
+ arr[2] = constCoords[0] * 0.25;
+ arr[3] = constCoords[0] * 0.125;
+ gl.uniform1fv(arrLoc, arr);
+ }
+ else if (this.m_varType === gluShaderUtil.DataType.FLOAT_VEC2) {
+ arr[0] = deMath.swizzle(constCoords, [0, 1]);
+ arr[1] = deMath.scale(deMath.swizzle(constCoords, [0, 1]), 0.5);
+ arr[2] = deMath.scale(deMath.swizzle(constCoords, [0, 1]), 0.25);
+ arr[3] = deMath.scale(deMath.swizzle(constCoords, [0, 1]), 0.125);
+ for (var i = 0; i < arr.length; i++)
+ array1d = array1d.concat(arr[i]);
+ gl.uniform2fv(arrLoc, array1d);
+ }
+ else if (this.m_varType === gluShaderUtil.DataType.FLOAT_VEC3) {
+ arr[0] = deMath.swizzle(constCoords, [0, 1, 2]);
+ arr[1] = deMath.scale(deMath.swizzle(constCoords, [0, 1, 2]), 0.5);
+ arr[2] = deMath.scale(deMath.swizzle(constCoords, [0, 1, 2]), 0.25);
+ arr[3] = deMath.scale(deMath.swizzle(constCoords, [0, 1, 2]), 0.125);
+ for (var i = 0; i < arr.length; i++)
+ array1d = array1d.concat(arr[i]);
+ gl.uniform3fv(arrLoc, array1d);
+ }
+ else if (this.m_varType === gluShaderUtil.DataType.FLOAT_VEC4) {
+ arr[0] = deMath.swizzle(constCoords, [0,1,2,3]);
+ arr[1] = deMath.scale(deMath.swizzle(constCoords, [0, 1, 2, 3]), 0.5);
+ arr[2] = deMath.scale(deMath.swizzle(constCoords, [0, 1, 2, 3]), 0.25);
+ arr[3] = deMath.scale(deMath.swizzle(constCoords, [0, 1, 2, 3]), 0.125);
+ for (var i = 0; i < arr.length; i++)
+ array1d = array1d.concat(arr[i]);
+ gl.uniform4fv(arrLoc, array1d);
+ }
+ else
+ throw new Error('u_arr should not have location assigned in this test case');
+ }
+ };
+
+ /**
+ * @param {string} caseName
+ * @param {string} description
+ * @param {gluShaderUtil.DataType} varType
+ * @param {es3fShaderIndexingTests.IndexAccessType} vertAccess
+ * @param {es3fShaderIndexingTests.IndexAccessType} fragAccess
+ * @return {es3fShaderIndexingTests.ShaderIndexingCase}
+ */
+ es3fShaderIndexingTests.createVaryingArrayCase = function(caseName, description, varType, vertAccess, fragAccess) {
+ /** @type {string} */ var vtx = '';
+ vtx += '#version 300 es\n' +
+ 'in highp vec4 a_position;\n' +
+ 'in highp vec4 a_coords;\n';
+
+ if (vertAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC)
+ vtx += 'uniform mediump int ui_zero, ui_one, ui_two, ui_three;\n';
+ else if (vertAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC_LOOP)
+ vtx += 'uniform mediump int ui_four;\n';
+
+ vtx += 'out ${PRECISION} ${VAR_TYPE} var[${ARRAY_LEN}];\n' +
+ '\n' +
+ 'void main()\n' +
+ '{\n' +
+ ' gl_Position = a_position;\n';
+
+ if (vertAccess === es3fShaderIndexingTests.IndexAccessType.STATIC) {
+ vtx += ' var[0] = ${VAR_TYPE}(a_coords);\n' +
+ ' var[1] = ${VAR_TYPE}(a_coords) * 0.5;\n' +
+ ' var[2] = ${VAR_TYPE}(a_coords) * 0.25;\n' +
+ ' var[3] = ${VAR_TYPE}(a_coords) * 0.125;\n';
+ }
+ else if (vertAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC) {
+ vtx += ' var[ui_zero] = ${VAR_TYPE}(a_coords);\n' +
+ ' var[ui_one] = ${VAR_TYPE}(a_coords) * 0.5;\n' +
+ ' var[ui_two] = ${VAR_TYPE}(a_coords) * 0.25;\n' +
+ ' var[ui_three] = ${VAR_TYPE}(a_coords) * 0.125;\n';
+ }
+ else if (vertAccess === es3fShaderIndexingTests.IndexAccessType.STATIC_LOOP) {
+ vtx += ' ${PRECISION} ${VAR_TYPE} coords = ${VAR_TYPE}(a_coords);\n' +
+ ' for (int i = 0; i < 4; i++)\n' +
+ ' {\n' +
+ ' var[i] = ${VAR_TYPE}(coords);\n' +
+ ' coords = coords * 0.5;\n' +
+ ' }\n';
+ }
+ else {
+ assertMsgOptions(vertAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC_LOOP, 'Not Dynamic_Loop', false, true);
+ vtx += ' ${PRECISION} ${VAR_TYPE} coords = ${VAR_TYPE}(a_coords);\n' +
+ ' for (int i = 0; i < ui_four; i++)\n' +
+ ' {\n' +
+ ' var[i] = ${VAR_TYPE}(coords);\n' +
+ ' coords = coords * 0.5;\n' +
+ ' }\n';
+ }
+ vtx += '}\n';
+
+ /** @type {string} */ var frag = '';
+ frag += '#version 300 es\n' +
+ 'precision mediump int;\n' +
+ 'layout(location = 0) out mediump vec4 o_color;\n';
+
+ if (fragAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC)
+ frag += 'uniform mediump int ui_zero, ui_one, ui_two, ui_three;\n';
+ else if (fragAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC_LOOP)
+ frag += 'uniform int ui_four;\n';
+
+ frag += 'in ${PRECISION} ${VAR_TYPE} var[${ARRAY_LEN}];\n' +
+ '\n' +
+ 'void main()\n' +
+ '{\n' +
+ ' ${PRECISION} ${VAR_TYPE} res = ${VAR_TYPE}(0.0);\n';
+
+ if (fragAccess === es3fShaderIndexingTests.IndexAccessType.STATIC) {
+ frag += ' res += var[0];\n' +
+ ' res += var[1];\n' +
+ ' res += var[2];\n' +
+ ' res += var[3];\n';
+ }
+ else if (fragAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC) {
+ frag += ' res += var[ui_zero];\n' +
+ ' res += var[ui_one];\n' +
+ ' res += var[ui_two];\n' +
+ ' res += var[ui_three];\n';
+ }
+ else if (fragAccess === es3fShaderIndexingTests.IndexAccessType.STATIC_LOOP) {
+ frag += ' for (int i = 0; i < 4; i++)\n' +
+ ' res += var[i];\n';
+ }
+ else {
+ assertMsgOptions(fragAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC_LOOP, 'Not Dynamic_Loop', false, true);
+ frag += ' for (int i = 0; i < ui_four; i++)\n' +
+ ' res += var[i];\n';
+ }
+ frag += ' o_color = vec4(res${PADDING});\n' +
+ '}\n';
+
+ // Fill in shader templates.
+ /** @type {Object} */ var params = {};
+ params['VAR_TYPE'] = gluShaderUtil.getDataTypeName(varType);
+ params['ARRAY_LEN'] = '4';
+ params['PRECISION'] = 'mediump';
+
+ if (varType === gluShaderUtil.DataType.FLOAT)
+ params['PADDING'] = ', 0.0, 0.0, 1.0';
+ else if (varType === gluShaderUtil.DataType.FLOAT_VEC2)
+ params['PADDING'] = ', 0.0, 1.0';
+ else if (varType === gluShaderUtil.DataType.FLOAT_VEC3)
+ params['PADDING'] = ', 1.0';
+ else
+ params['PADDING'] = '';
+
+ /** @type {string} */ var vertexShaderSource = tcuStringTemplate.specialize(vtx, params);
+ /** @type {string} */ var fragmentShaderSource = tcuStringTemplate.specialize(frag, params);
+
+ /** @type {function(glsShaderRenderCase.ShaderEvalContext)} */
+ var evalFunc = es3fShaderIndexingTests.getArrayCoordsEvalFunc(varType);
+ return new es3fShaderIndexingTests.ShaderIndexingCase(caseName, description, true, varType, evalFunc, vertexShaderSource, fragmentShaderSource);
+ };
+
+ /**
+ * @param {string} caseName
+ * @param {string} description
+ * @param {boolean} isVertexCase
+ * @param {gluShaderUtil.DataType} varType
+ * @param {es3fShaderIndexingTests.IndexAccessType} readAccess
+ * @return {es3fShaderIndexingTests.ShaderIndexingCase}
+ */
+ es3fShaderIndexingTests.createUniformArrayCase = function(caseName, description, isVertexCase, varType, readAccess) {
+ /** @type {string} */ var vtx = '';
+ /** @type {string} */ var frag = '';
+ /** @type {string} */ var op = '';
+
+ vtx += '#version 300 es\n';
+ frag += '#version 300 es\n';
+
+ vtx += 'in highp vec4 a_position;\n';
+ vtx += 'in highp vec4 a_coords;\n';
+ frag += 'layout(location = 0) out mediump vec4 o_color;\n';
+
+ if (isVertexCase) {
+ vtx += 'out mediump vec4 v_color;\n';
+ frag += 'in mediump vec4 v_color;\n';
+ }
+ else {
+ vtx += 'out mediump vec4 v_coords;\n';
+ frag += 'in mediump vec4 v_coords;\n';
+ }
+
+ if (readAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC)
+ op += 'uniform mediump int ui_zero, ui_one, ui_two, ui_three;\n';
+ else if (readAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC_LOOP)
+ op += 'uniform mediump int ui_four;\n';
+
+ op += 'uniform ${PRECISION} ${VAR_TYPE} u_arr[${ARRAY_LEN}];\n';
+
+ vtx += isVertexCase ? op : '';
+ frag += isVertexCase ? '' : op;
+ op = '';
+
+ vtx += '\n';
+ vtx += 'void main()\n';
+ vtx += '{\n';
+ vtx += ' gl_Position = a_position;\n';
+
+ frag += '\n';
+ frag += 'void main()\n';
+ frag += '{\n';
+
+ // Read array.
+ op += ' ${PRECISION} ${VAR_TYPE} res = ${VAR_TYPE}(0.0);\n';
+ if (readAccess === es3fShaderIndexingTests.IndexAccessType.STATIC) {
+ op += ' res += u_arr[0];\n';
+ op += ' res += u_arr[1];\n';
+ op += ' res += u_arr[2];\n';
+ op += ' res += u_arr[3];\n';
+ }
+ else if (readAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC) {
+ op += ' res += u_arr[ui_zero];\n';
+ op += ' res += u_arr[ui_one];\n';
+ op += ' res += u_arr[ui_two];\n';
+ op += ' res += u_arr[ui_three];\n';
+ }
+ else if (readAccess === es3fShaderIndexingTests.IndexAccessType.STATIC_LOOP) {
+ op += ' for (int i = 0; i < 4; i++)\n';
+ op += ' res += u_arr[i];\n';
+ }
+ else {
+ assertMsgOptions(readAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC_LOOP, 'readAccess not supported.', false, true);
+ op += ' for (int i = 0; i < ui_four; i++)\n';
+ op += ' res += u_arr[i];\n';
+ }
+
+ vtx += isVertexCase ? op : '';
+ frag += isVertexCase ? '' : op;
+ op = '';
+
+ if (isVertexCase) {
+ vtx += ' v_color = vec4(res${PADDING});\n';
+ frag += ' o_color = v_color;\n';
+ }
+ else {
+ vtx += ' v_coords = a_coords;\n';
+ frag += ' o_color = vec4(res${PADDING});\n';
+ }
+
+ vtx += '}\n';
+ frag += '}\n';
+
+ // Fill in shader templates.
+ /** @type {Object} */ var params = {};
+ params['VAR_TYPE'] = gluShaderUtil.getDataTypeName(varType);
+ params['ARRAY_LEN'] = '4';
+ params['PRECISION'] = 'mediump';
+
+ if (varType === gluShaderUtil.DataType.FLOAT)
+ params['PADDING'] = ', 0.0, 0.0, 1.0';
+ else if (varType === gluShaderUtil.DataType.FLOAT_VEC2)
+ params['PADDING'] = ', 0.0, 1.0';
+ else if (varType === gluShaderUtil.DataType.FLOAT_VEC3)
+ params['PADDING'] = ', 1.0';
+ else
+ params['PADDING'] = '';
+
+
+ /** @type {string} */ var vertexShaderSource = tcuStringTemplate.specialize(vtx, params);
+ /** @type {string} */ var fragmentShaderSource = tcuStringTemplate.specialize(frag, params);
+
+ /** @type {function(glsShaderRenderCase.ShaderEvalContext)} */
+ var evalFunc = es3fShaderIndexingTests.getArrayUniformEvalFunc(varType);
+ return new es3fShaderIndexingTests.ShaderIndexingCase(caseName, description, isVertexCase, varType, evalFunc, vertexShaderSource, fragmentShaderSource);
+ };
+
+ /**
+ * @param {string} caseName
+ * @param {string} description
+ * @param {boolean} isVertexCase
+ * @param {gluShaderUtil.DataType} varType
+ * @param {es3fShaderIndexingTests.IndexAccessType} writeAccess
+ * @param {es3fShaderIndexingTests.IndexAccessType} readAccess
+ * @return {es3fShaderIndexingTests.ShaderIndexingCase}
+ */
+ es3fShaderIndexingTests.createTmpArrayCase = function(caseName, description, isVertexCase, varType, writeAccess, readAccess) {
+ /** @type {string} */ var vtx = '';
+ /** @type {string} */ var frag = '';
+ /** @type {string} */ var op = '';
+
+ vtx += '#version 300 es\n';
+ frag += '#version 300 es\n';
+
+ vtx += 'in highp vec4 a_position;\n' +
+ 'in highp vec4 a_coords;\n';
+ frag += 'layout(location = 0) out mediump vec4 o_color;\n';
+
+ if (isVertexCase) {
+ vtx += 'out mediump vec4 v_color;\n';
+ frag += 'in mediump vec4 v_color;\n';
+ }
+ else {
+ vtx += 'out mediump vec4 v_coords;\n';
+ frag += 'in mediump vec4 v_coords;\n';
+ }
+
+ if (writeAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC || readAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC)
+ op += 'uniform mediump int ui_zero, ui_one, ui_two, ui_three;\n';
+
+ if (writeAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC_LOOP || readAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC_LOOP)
+ op += 'uniform mediump int ui_four;\n';
+
+ vtx += isVertexCase ? op : '';
+ frag += isVertexCase ? '' : op;
+ op = '';
+
+ vtx += '\n' +
+ 'void main()\n' +
+ '{\n' +
+ ' gl_Position = a_position;\n';
+
+ frag += '\n' +
+ 'void main()\n' +
+ '{\n';
+
+ // Write array.
+ if (isVertexCase)
+ op += ' ${PRECISION} ${VAR_TYPE} coords = ${VAR_TYPE}(a_coords);\n';
+ else
+ op += ' ${PRECISION} ${VAR_TYPE} coords = ${VAR_TYPE}(v_coords);\n';
+
+ op += ' ${PRECISION} ${VAR_TYPE} arr[${ARRAY_LEN}];\n';
+ if (writeAccess === es3fShaderIndexingTests.IndexAccessType.STATIC) {
+ op += ' arr[0] = ${VAR_TYPE}(coords);\n' +
+ ' arr[1] = ${VAR_TYPE}(coords) * 0.5;\n' +
+ ' arr[2] = ${VAR_TYPE}(coords) * 0.25;\n' +
+ ' arr[3] = ${VAR_TYPE}(coords) * 0.125;\n';
+ }
+ else if (writeAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC) {
+ op += ' arr[ui_zero] = ${VAR_TYPE}(coords);\n' +
+ ' arr[ui_one] = ${VAR_TYPE}(coords) * 0.5;\n' +
+ ' arr[ui_two] = ${VAR_TYPE}(coords) * 0.25;\n' +
+ ' arr[ui_three] = ${VAR_TYPE}(coords) * 0.125;\n';
+ }
+ else if (writeAccess === es3fShaderIndexingTests.IndexAccessType.STATIC_LOOP) {
+ op += ' for (int i = 0; i < 4; i++)\n' +
+ ' {\n' +
+ ' arr[i] = ${VAR_TYPE}(coords);\n' +
+ ' coords = coords * 0.5;\n' +
+ ' }\n';
+ }
+ else {
+ assertMsgOptions(writeAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC_LOOP, 'writeAccess not supported', false, true);
+ op += ' for (int i = 0; i < ui_four; i++)\n' +
+ ' {\n' +
+ ' arr[i] = ${VAR_TYPE}(coords);\n' +
+ ' coords = coords * 0.5;\n' +
+ ' }\n';
+ }
+
+ // Read array.
+ op += ' ${PRECISION} ${VAR_TYPE} res = ${VAR_TYPE}(0.0);\n';
+ if (readAccess === es3fShaderIndexingTests.IndexAccessType.STATIC) {
+ op += ' res += arr[0];\n' +
+ ' res += arr[1];\n' +
+ ' res += arr[2];\n' +
+ ' res += arr[3];\n';
+ }
+ else if (readAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC) {
+ op += ' res += arr[ui_zero];\n' +
+ ' res += arr[ui_one];\n' +
+ ' res += arr[ui_two];\n' +
+ ' res += arr[ui_three];\n';
+ }
+ else if (readAccess === es3fShaderIndexingTests.IndexAccessType.STATIC_LOOP) {
+ op += ' for (int i = 0; i < 4; i++)\n' +
+ ' res += arr[i];\n';
+ }
+ else {
+ assertMsgOptions(readAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC_LOOP, 'readAccess not supported.', false, true);
+ op += ' for (int i = 0; i < ui_four; i++)\n' +
+ ' res += arr[i];\n';
+ }
+
+ vtx += isVertexCase ? op : '';
+ frag += isVertexCase ? '' : op;
+ op = '';
+
+ if (isVertexCase) {
+ vtx += ' v_color = vec4(res${PADDING});\n';
+ frag += ' o_color = v_color;\n';
+ }
+ else {
+ vtx += ' v_coords = a_coords;\n';
+ frag += ' o_color = vec4(res${PADDING});\n';
+ }
+
+ vtx += '}\n';
+ frag += '}\n';
+
+ // Fill in shader templates.
+ /** @type {Object} */ var params = {};
+ params["VAR_TYPE"] = gluShaderUtil.getDataTypeName(varType);
+ params["ARRAY_LEN"] = "4";
+ params["PRECISION"] = "mediump";
+
+ if (varType === gluShaderUtil.DataType.FLOAT)
+ params['PADDING'] = ', 0.0, 0.0, 1.0';
+ else if (varType === gluShaderUtil.DataType.FLOAT_VEC2)
+ params['PADDING'] = ', 0.0, 1.0';
+ else if (varType === gluShaderUtil.DataType.FLOAT_VEC3)
+ params['PADDING'] = ', 1.0';
+ else
+ params['PADDING'] = '';
+
+ /** @type {string} */ var vertexShaderSource = tcuStringTemplate.specialize(vtx, params);
+ /** @type {string} */ var fragmentShaderSource = tcuStringTemplate.specialize(frag, params);
+
+ /** @type {function(glsShaderRenderCase.ShaderEvalContext)} */
+ var evalFunc = es3fShaderIndexingTests.getArrayCoordsEvalFunc(varType);
+ return new es3fShaderIndexingTests.ShaderIndexingCase(caseName, description, isVertexCase, varType, evalFunc, vertexShaderSource, fragmentShaderSource);
+ };
+
+ // VECTOR SUBSCRIPT.
+
+ /** @param {glsShaderRenderCase.ShaderEvalContext} c */
+ es3fShaderIndexingTests.evalSubscriptVec2 = function(c) {
+ c.color[0] = c.coords[0] + 0.5 * c.coords[1];
+ c.color[1] = c.coords[0] + 0.5 * c.coords[1];
+ c.color[2] = c.coords[0] + 0.5 * c.coords[1];
+ };
+ /** @param {glsShaderRenderCase.ShaderEvalContext} c */
+ es3fShaderIndexingTests.evalSubscriptVec3 = function(c) {
+ c.color[0] = c.coords[0] + 0.5 * c.coords[1] + 0.25 * c.coords[2];
+ c.color[1] = c.coords[0] + 0.5 * c.coords[1] + 0.25 * c.coords[2];
+ c.color[2] = c.coords[0] + 0.5 * c.coords[1] + 0.25 * c.coords[2];
+ };
+ /** @param {glsShaderRenderCase.ShaderEvalContext} c */
+ es3fShaderIndexingTests.evalSubscriptVec4 = function(c) {
+ c.color[0] = c.coords[0] + 0.5 * c.coords[1] + 0.25 * c.coords[2] + 0.125 * c.coords[3];
+ c.color[1] = c.coords[0] + 0.5 * c.coords[1] + 0.25 * c.coords[2] + 0.125 * c.coords[3];
+ c.color[2] = c.coords[0] + 0.5 * c.coords[1] + 0.25 * c.coords[2] + 0.125 * c.coords[3];
+ };
+
+ /**
+ * @param {gluShaderUtil.DataType} dataType
+ * @return {function(glsShaderRenderCase.ShaderEvalContext)}
+ */
+ es3fShaderIndexingTests.getVectorSubscriptEvalFunc = function(dataType) {
+ if (dataType === gluShaderUtil.DataType.FLOAT_VEC2) return es3fShaderIndexingTests.evalSubscriptVec2;
+ else if (dataType === gluShaderUtil.DataType.FLOAT_VEC3) return es3fShaderIndexingTests.evalSubscriptVec3;
+ else if (dataType === gluShaderUtil.DataType.FLOAT_VEC4) return es3fShaderIndexingTests.evalSubscriptVec4;
+ else throw new Error('Invalid data type.');
+ };
+
+ /**
+ * @param {string} caseName
+ * @param {string} description
+ * @param {boolean} isVertexCase
+ * @param {gluShaderUtil.DataType} varType
+ * @param {es3fShaderIndexingTests.VectorAccessType} writeAccess
+ * @param {es3fShaderIndexingTests.VectorAccessType} readAccess
+ * @return {es3fShaderIndexingTests.ShaderIndexingCase}
+ */
+ es3fShaderIndexingTests.createVectorSubscriptCase = function(caseName, description, isVertexCase, varType, writeAccess, readAccess) {
+ /** @type {string} */ var vtx = '';
+ /** @type {string} */ var frag = '';
+ /** @type {string} */ var op = '' ;
+
+ /** @type {number} */ var vecLen = gluShaderUtil.getDataTypeScalarSize(varType);
+ /** @type {string} */ var vecLenName = glsShaderRenderCase.getIntUniformName(vecLen);
+
+ vtx += '#version 300 es\n';
+ frag += '#version 300 es\n';
+
+ vtx += 'in highp vec4 a_position;\n' +
+ 'in highp vec4 a_coords;\n';
+ frag += 'layout(location = 0) out mediump vec4 o_color;\n';
+
+ if (isVertexCase) {
+ vtx += 'out mediump vec3 v_color;\n';
+ frag += 'in mediump vec3 v_color;\n';
+ }
+ else {
+ vtx += 'out mediump vec4 v_coords;\n';
+ frag += 'in mediump vec4 v_coords;\n';
+ }
+
+ if (writeAccess === es3fShaderIndexingTests.VectorAccessType.SUBSCRIPT_DYNAMIC ||
+ readAccess === es3fShaderIndexingTests.VectorAccessType.SUBSCRIPT_DYNAMIC){
+ op += 'uniform mediump int ui_zero';
+ if (vecLen >= 2) op += ', ui_one';
+ if (vecLen >= 3) op += ', ui_two';
+ if (vecLen >= 4) op += ', ui_three';
+ op += ';\n';
+ }
+
+ if (writeAccess === es3fShaderIndexingTests.VectorAccessType.SUBSCRIPT_DYNAMIC_LOOP ||
+ readAccess === es3fShaderIndexingTests.VectorAccessType.SUBSCRIPT_DYNAMIC_LOOP)
+ op += 'uniform mediump int ' + vecLenName + ';\n';
+
+ vtx += isVertexCase ? op : '';
+ frag += isVertexCase ? '' : op;
+ op = '';
+
+ vtx += '\n' +
+ 'void main()\n' +
+ '{\n' +
+ ' gl_Position = a_position;\n';
+
+ frag += '\n' +
+ 'void main()\n' +
+ '{\n';
+
+ // Write vector.
+ if (isVertexCase)
+ op += ' ${PRECISION} ${VAR_TYPE} coords = ${VAR_TYPE}(a_coords);\n';
+ else
+ op += ' ${PRECISION} ${VAR_TYPE} coords = ${VAR_TYPE}(v_coords);\n';
+
+ op += ' ${PRECISION} ${VAR_TYPE} tmp;\n';
+ if (writeAccess === es3fShaderIndexingTests.VectorAccessType.DIRECT)
+ op += ' tmp = coords.${SWIZZLE} * vec4(1.0, 0.5, 0.25, 0.125).${SWIZZLE};\n';
+ else if (writeAccess === es3fShaderIndexingTests.VectorAccessType.COMPONENT) {
+ op += ' tmp.x = coords.x;\n';
+ if (vecLen >= 2) op += ' tmp.y = coords.y * 0.5;\n';
+ if (vecLen >= 3) op += ' tmp.z = coords.z * 0.25;\n';
+ if (vecLen >= 4) op += ' tmp.w = coords.w * 0.125;\n';
+ }
+ else if (writeAccess === es3fShaderIndexingTests.VectorAccessType.SUBSCRIPT_STATIC) {
+ op += ' tmp[0] = coords.x;\n';
+ if (vecLen >= 2) op += ' tmp[1] = coords.y * 0.5;\n';
+ if (vecLen >= 3) op += ' tmp[2] = coords.z * 0.25;\n';
+ if (vecLen >= 4) op += ' tmp[3] = coords.w * 0.125;\n';
+ }
+ else if (writeAccess === es3fShaderIndexingTests.VectorAccessType.SUBSCRIPT_DYNAMIC) {
+ op += ' tmp[ui_zero] = coords.x;\n';
+ if (vecLen >= 2) op += ' tmp[ui_one] = coords.y * 0.5;\n';
+ if (vecLen >= 3) op += ' tmp[ui_two] = coords.z * 0.25;\n';
+ if (vecLen >= 4) op += ' tmp[ui_three] = coords.w * 0.125;\n';
+ }
+ else if (writeAccess === es3fShaderIndexingTests.VectorAccessType.SUBSCRIPT_STATIC_LOOP) {
+ op += ' for (int i = 0; i < ' + vecLen + '; i++)\n';
+ op += ' {\n';
+ op += ' tmp[i] = coords.x;\n';
+ op += ' coords = coords.${ROT_SWIZZLE} * 0.5;\n';
+ op += ' }\n';
+ }
+ else {
+ assertMsgOptions(writeAccess === es3fShaderIndexingTests.VectorAccessType.SUBSCRIPT_DYNAMIC_LOOP, 'writeAccess not supported.', false, true);
+ op += ' for (int i = 0; i < ' + vecLenName + '; i++)\n';
+ op += ' {\n';
+ op += ' tmp[i] = coords.x;\n';
+ op += ' coords = coords.${ROT_SWIZZLE} * 0.5;\n';
+ op += ' }\n';
+ }
+
+ // Read vector.
+ op += ' ${PRECISION} float res = 0.0;\n';
+ if (readAccess === es3fShaderIndexingTests.VectorAccessType.DIRECT)
+ op += ' res = dot(tmp, ${VAR_TYPE}(1.0));\n';
+ else if (readAccess === es3fShaderIndexingTests.VectorAccessType.COMPONENT) {
+ op += ' res += tmp.x;\n';
+ if (vecLen >= 2) op += ' res += tmp.y;\n';
+ if (vecLen >= 3) op += ' res += tmp.z;\n';
+ if (vecLen >= 4) op += ' res += tmp.w;\n';
+ }
+ else if (readAccess === es3fShaderIndexingTests.VectorAccessType.SUBSCRIPT_STATIC) {
+ op += ' res += tmp[0];\n';
+ if (vecLen >= 2) op += ' res += tmp[1];\n';
+ if (vecLen >= 3) op += ' res += tmp[2];\n';
+ if (vecLen >= 4) op += ' res += tmp[3];\n';
+ }
+ else if (readAccess === es3fShaderIndexingTests.VectorAccessType.SUBSCRIPT_DYNAMIC) {
+ op += ' res += tmp[ui_zero];\n';
+ if (vecLen >= 2) op += ' res += tmp[ui_one];\n';
+ if (vecLen >= 3) op += ' res += tmp[ui_two];\n';
+ if (vecLen >= 4) op += ' res += tmp[ui_three];\n';
+ }
+ else if (readAccess === es3fShaderIndexingTests.VectorAccessType.SUBSCRIPT_STATIC_LOOP) {
+ op += ' for (int i = 0; i < ' + vecLen + '; i++)\n';
+ op += ' res += tmp[i];\n';
+ }
+ else {
+ assertMsgOptions(readAccess === es3fShaderIndexingTests.VectorAccessType.SUBSCRIPT_DYNAMIC_LOOP, 'readAccess not supported', false, true);
+ op += ' for (int i = 0; i < ' + vecLenName + '; i++)\n';
+ op += ' res += tmp[i];\n';
+ }
+
+ vtx += isVertexCase ? op : '';
+ frag += isVertexCase ? '' : op;
+ op = '';
+
+ if (isVertexCase) {
+ vtx += ' v_color = vec3(res);\n';
+ frag += ' o_color = vec4(v_color.rgb, 1.0);\n';
+ }
+ else {
+ vtx += ' v_coords = a_coords;\n';
+ frag += ' o_color = vec4(vec3(res), 1.0);\n';
+ }
+
+ vtx += '}\n';
+ frag += '}\n';
+
+ // Fill in shader templates.
+ /** @type {Array<string>} */ var s_swizzles = ['', 'x', 'xy', 'xyz', 'xyzw'];
+ /** @type {Array<string>} */ var s_rotSwizzles = ['', 'x', 'yx', 'yzx', 'yzwx'];
+
+ /** @type {Object} */ var params = {};
+ params["VAR_TYPE"] = gluShaderUtil.getDataTypeName(varType);
+ params["PRECISION"] = "mediump";
+ params["SWIZZLE"] = s_swizzles[vecLen];
+ params["ROT_SWIZZLE"] = s_rotSwizzles[vecLen];
+
+ /** @type {string} */ var vertexShaderSource = tcuStringTemplate.specialize(vtx, params);
+ /** @type {string} */ var fragmentShaderSource = tcuStringTemplate.specialize(frag, params);
+
+ /** @type {function(glsShaderRenderCase.ShaderEvalContext)} */
+ var evalFunc = es3fShaderIndexingTests.getVectorSubscriptEvalFunc(varType);
+ return new es3fShaderIndexingTests.ShaderIndexingCase(caseName, description, isVertexCase, varType, evalFunc, vertexShaderSource, fragmentShaderSource);
+ };
+
+ // MATRIX SUBSCRIPT.
+
+ /** @param {glsShaderRenderCase.ShaderEvalContext} c */
+ es3fShaderIndexingTests.evalSubscriptMat2 = function(c) {
+ var swizzle01 = deMath.swizzle(c.coords, [0, 1]);
+ var swizzle12 = deMath.swizzle(c.coords, [1, 2]);
+ c.color[0] = swizzle01[0] + 0.5 * swizzle12[0];
+ c.color[1] = swizzle01[1] + 0.5 * swizzle12[1];
+ };
+
+ /** @param {glsShaderRenderCase.ShaderEvalContext} c */
+ es3fShaderIndexingTests.evalSubscriptMat2x3 = function(c) {
+ var swizzle012 = deMath.swizzle(c.coords, [0, 1, 2]);
+ var swizzle123 = deMath.swizzle(c.coords, [1, 2, 3]);
+ c.color[0] = swizzle012[0] + 0.5 * swizzle123[0];
+ c.color[1] = swizzle012[1] + 0.5 * swizzle123[1];
+ c.color[2] = swizzle012[2] + 0.5 * swizzle123[2];
+ };
+
+ /** @param {glsShaderRenderCase.ShaderEvalContext} c */
+ es3fShaderIndexingTests.evalSubscriptMat2x4 = function(c) {
+ c.color = deMath.add(
+ deMath.swizzle(c.coords, [0,1,2,3]),
+ deMath.scale(deMath.swizzle(c.coords, [1,2,3,0]), 0.5));
+ };
+
+ /** @param {glsShaderRenderCase.ShaderEvalContext} c */
+ es3fShaderIndexingTests.evalSubscriptMat3x2 = function(c) {
+ var swizzle01 = deMath.swizzle(c.coords, [0, 1]);
+ var swizzle12 = deMath.swizzle(c.coords, [1, 2]);
+ var swizzle23 = deMath.swizzle(c.coords, [2, 3]);
+ c.color[0] = swizzle01[0] + 0.5 * swizzle12[0] + 0.25 * swizzle23[0];
+ c.color[1] = swizzle01[1] + 0.5 * swizzle12[1] + 0.25 * swizzle23[1];
+ };
+
+ /** @param {glsShaderRenderCase.ShaderEvalContext} c */
+ es3fShaderIndexingTests.evalSubscriptMat3 = function(c) {
+ var swizzle012 = deMath.swizzle(c.coords, [0, 1, 2]);
+ var swizzle123 = deMath.swizzle(c.coords, [1, 2, 3]);
+ var swizzle230 = deMath.swizzle(c.coords, [2, 3, 0]);
+ c.color[0] = swizzle012[0] + 0.5 * swizzle123[0] + 0.25 * swizzle230[0];
+ c.color[1] = swizzle012[1] + 0.5 * swizzle123[1] + 0.25 * swizzle230[1];
+ c.color[2] = swizzle012[2] + 0.5 * swizzle123[2] + 0.25 * swizzle230[2];
+ };
+
+ /** @param {glsShaderRenderCase.ShaderEvalContext} c */
+ es3fShaderIndexingTests.evalSubscriptMat3x4 = function(c) {
+ var swizzle0123 = deMath.swizzle(c.coords, [0, 1, 2, 3]);
+ var swizzle1230 = deMath.swizzle(c.coords, [1, 2, 3, 0]);
+ var swizzle2301 = deMath.swizzle(c.coords, [2, 3, 0, 1]);
+ c.color = deMath.add(
+ swizzle0123,
+ deMath.add(
+ deMath.scale(swizzle1230, 0.5),
+ deMath.scale(swizzle2301, 0.25)));
+ };
+
+ /** @param {glsShaderRenderCase.ShaderEvalContext} c */
+ es3fShaderIndexingTests.evalSubscriptMat4x2 = function(c) {
+ var swizzle01 = deMath.swizzle(c.coords, [0, 1]);
+ var swizzle12 = deMath.swizzle(c.coords, [1, 2]);
+ var swizzle23 = deMath.swizzle(c.coords, [2, 3]);
+ var swizzle30 = deMath.swizzle(c.coords, [3, 0]);
+ c.color[0] = swizzle01[0] + 0.5 * swizzle12[0] + 0.25 * swizzle23[0] + 0.125 * swizzle30[0];
+ c.color[1] = swizzle01[1] + 0.5 * swizzle12[1] + 0.25 * swizzle23[1] + 0.125 * swizzle30[1];
+ };
+
+ /** @param {glsShaderRenderCase.ShaderEvalContext} c */
+ es3fShaderIndexingTests.evalSubscriptMat4x3 = function(c) {
+ var swizzle012 = deMath.swizzle(c.coords, [0, 1, 2]);
+ var swizzle123 = deMath.swizzle(c.coords, [1, 2, 3]);
+ var swizzle230 = deMath.swizzle(c.coords, [2, 3, 0]);
+ var swizzle301 = deMath.swizzle(c.coords, [3, 0, 1]);
+ c.color[0] = swizzle012[0] + 0.5 * swizzle123[0] + 0.25 * swizzle230[0] + 0.125 * swizzle301[0];
+ c.color[1] = swizzle012[1] + 0.5 * swizzle123[1] + 0.25 * swizzle230[1] + 0.125 * swizzle301[1];
+ c.color[2] = swizzle012[2] + 0.5 * swizzle123[2] + 0.25 * swizzle230[2] + 0.125 * swizzle301[2];
+ };
+
+ /** @param {glsShaderRenderCase.ShaderEvalContext} c */
+ es3fShaderIndexingTests.evalSubscriptMat4 = function(c) {
+ var swizzle1230 = deMath.swizzle(c.coords, [1, 2, 3, 0]);
+ var swizzle2301 = deMath.swizzle(c.coords, [2, 3, 0, 1]);
+ var swizzle3012 = deMath.swizzle(c.coords, [3, 0, 1, 2]);
+ c.color = deMath.add(
+ c.coords,
+ deMath.add(
+ deMath.scale(swizzle1230, 0.5),
+ deMath.add(
+ deMath.scale(swizzle2301, 0.25),
+ deMath.scale(swizzle3012, 0.125))));
+ };
+
+ /**
+ * @param {gluShaderUtil.DataType} dataType
+ * @return {function(glsShaderRenderCase.ShaderEvalContext)}
+ */
+ es3fShaderIndexingTests.getMatrixSubscriptEvalFunc = function(dataType) {
+ switch (dataType) {
+ case gluShaderUtil.DataType.FLOAT_MAT2: return es3fShaderIndexingTests.evalSubscriptMat2;
+ case gluShaderUtil.DataType.FLOAT_MAT2X3: return es3fShaderIndexingTests.evalSubscriptMat2x3;
+ case gluShaderUtil.DataType.FLOAT_MAT2X4: return es3fShaderIndexingTests.evalSubscriptMat2x4;
+ case gluShaderUtil.DataType.FLOAT_MAT3X2: return es3fShaderIndexingTests.evalSubscriptMat3x2;
+ case gluShaderUtil.DataType.FLOAT_MAT3: return es3fShaderIndexingTests.evalSubscriptMat3;
+ case gluShaderUtil.DataType.FLOAT_MAT3X4: return es3fShaderIndexingTests.evalSubscriptMat3x4;
+ case gluShaderUtil.DataType.FLOAT_MAT4X2: return es3fShaderIndexingTests.evalSubscriptMat4x2;
+ case gluShaderUtil.DataType.FLOAT_MAT4X3: return es3fShaderIndexingTests.evalSubscriptMat4x3;
+ case gluShaderUtil.DataType.FLOAT_MAT4: return es3fShaderIndexingTests.evalSubscriptMat4;
+ default:
+ throw new Error('Invalid data type.');
+ }
+ };
+
+ /**
+ * @param {string} caseName
+ * @param {string} description
+ * @param {boolean} isVertexCase
+ * @param {gluShaderUtil.DataType} varType
+ * @param {es3fShaderIndexingTests.IndexAccessType} writeAccess
+ * @param {es3fShaderIndexingTests.IndexAccessType} readAccess
+ * @return {es3fShaderIndexingTests.ShaderIndexingCase}
+ */
+ es3fShaderIndexingTests.createMatrixSubscriptCase = function(caseName, description, isVertexCase, varType, writeAccess, readAccess) {
+ /** @type {string} */ var vtx = '';
+ /** @type {string} */ var frag = '';
+ /** @type {string} */ var op = '';
+
+ /** @type {number} */ var numCols = gluShaderUtil.getDataTypeMatrixNumColumns(varType);
+ /** @type {number} */ var numRows = gluShaderUtil.getDataTypeMatrixNumRows(varType);
+ /** @type {string} */ var matSizeName = glsShaderRenderCase.getIntUniformName(numCols);
+ /** @type {gluShaderUtil.DataType} */ var vecType = gluShaderUtil.getDataTypeFloatVec(numRows);
+
+ vtx += '#version 300 es\n';
+ frag += '#version 300 es\n';
+
+ vtx += 'in highp vec4 a_position;\n' +
+ 'in highp vec4 a_coords;\n';
+ frag += 'layout(location = 0) out mediump vec4 o_color;\n';
+
+ if (isVertexCase) {
+ vtx += 'out mediump vec4 v_color;\n';
+ frag += 'in mediump vec4 v_color;\n';
+ }
+ else {
+ vtx += 'out mediump vec4 v_coords;\n';
+ frag += 'in mediump vec4 v_coords;\n';
+ }
+
+ if (writeAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC || readAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC) {
+ op += 'uniform mediump int ui_zero';
+ if (numCols >= 2) op += ', ui_one';
+ if (numCols >= 3) op += ', ui_two';
+ if (numCols >= 4) op += ', ui_three';
+ op += ';\n';
+ }
+
+ if (writeAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC_LOOP || readAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC_LOOP)
+ op += 'uniform mediump int ' + matSizeName + ';\n';
+
+ vtx += isVertexCase ? op : '';
+ frag += isVertexCase ? '' : op;
+ op = '';
+
+ vtx += '\n' +
+ 'void main()\n' +
+ '{\n' +
+ ' gl_Position = a_position;\n';
+
+ frag += '\n' +
+ 'void main()\n' +
+ '{\n';
+
+ // Write matrix.
+ if (isVertexCase)
+ op += ' ${PRECISION} vec4 coords = a_coords;\n';
+ else
+ op += ' ${PRECISION} vec4 coords = v_coords;\n';
+
+ op += ' ${PRECISION} ${MAT_TYPE} tmp;\n';
+ if (writeAccess === es3fShaderIndexingTests.IndexAccessType.STATIC) {
+ op += ' tmp[0] = ${VEC_TYPE}(coords);\n';
+ if (numCols >= 2) op += ' tmp[1] = ${VEC_TYPE}(coords.yzwx) * 0.5;\n';
+ if (numCols >= 3) op += ' tmp[2] = ${VEC_TYPE}(coords.zwxy) * 0.25;\n';
+ if (numCols >= 4) op += ' tmp[3] = ${VEC_TYPE}(coords.wxyz) * 0.125;\n';
+ }
+ else if (writeAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC) {
+ op += ' tmp[ui_zero] = ${VEC_TYPE}(coords);\n';
+ if (numCols >= 2) op += ' tmp[ui_one] = ${VEC_TYPE}(coords.yzwx) * 0.5;\n';
+ if (numCols >= 3) op += ' tmp[ui_two] = ${VEC_TYPE}(coords.zwxy) * 0.25;\n';
+ if (numCols >= 4) op += ' tmp[ui_three] = ${VEC_TYPE}(coords.wxyz) * 0.125;\n';
+ }
+ else if (writeAccess === es3fShaderIndexingTests.IndexAccessType.STATIC_LOOP) {
+ op += ' for (int i = 0; i < ' + numCols + '; i++)\n';
+ op += ' {\n';
+ op += ' tmp[i] = ${VEC_TYPE}(coords);\n';
+ op += ' coords = coords.yzwx * 0.5;\n';
+ op += ' }\n';
+ }
+ else {
+ assertMsgOptions(writeAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC_LOOP, 'writeAccess not supported', false, true);
+ op += ' for (int i = 0; i < ' + matSizeName + '; i++)\n';
+ op += ' {\n';
+ op += ' tmp[i] = ${VEC_TYPE}(coords);\n';
+ op += ' coords = coords.yzwx * 0.5;\n';
+ op += ' }\n';
+ }
+
+ // Read matrix.
+ op += ' ${PRECISION} ${VEC_TYPE} res = ${VEC_TYPE}(0.0);\n';
+ if (readAccess === es3fShaderIndexingTests.IndexAccessType.STATIC) {
+ op += ' res += tmp[0];\n';
+ if (numCols >= 2) op += ' res += tmp[1];\n';
+ if (numCols >= 3) op += ' res += tmp[2];\n';
+ if (numCols >= 4) op += ' res += tmp[3];\n';
+ }
+ else if (readAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC) {
+ op += ' res += tmp[ui_zero];\n';
+ if (numCols >= 2) op += ' res += tmp[ui_one];\n';
+ if (numCols >= 3) op += ' res += tmp[ui_two];\n';
+ if (numCols >= 4) op += ' res += tmp[ui_three];\n';
+ }
+ else if (readAccess === es3fShaderIndexingTests.IndexAccessType.STATIC_LOOP) {
+ op += ' for (int i = 0; i < ' + numCols + '; i++)\n';
+ op += ' res += tmp[i];\n';
+ }
+ else {
+ assertMsgOptions(readAccess === es3fShaderIndexingTests.IndexAccessType.DYNAMIC_LOOP, 'readAccess not supported', false, true);
+ op += ' for (int i = 0; i < ' + matSizeName + '; i++)\n';
+ op += ' res += tmp[i];\n';
+ }
+
+ vtx += isVertexCase ? op : '';
+ frag += isVertexCase ? '' : op;
+ op = '';
+
+ if (isVertexCase) {
+ vtx += ' v_color = vec4(res${PADDING});\n';
+ frag += ' o_color = v_color;\n';
+ }
+ else {
+ vtx += ' v_coords = a_coords;\n';
+ frag += ' o_color = vec4(res${PADDING});\n';
+ }
+
+ vtx += '}\n';
+ frag += '}\n';
+
+ // Fill in shader templates.
+
+ /** @type {Object} */ var params = {};
+ params['MAT_TYPE'] = gluShaderUtil.getDataTypeName(varType);
+ params['VEC_TYPE'] = gluShaderUtil.getDataTypeName(vecType);
+ params['PRECISION'] = "mediump";
+
+
+ if (numRows === 2)
+ params['PADDING'] = ', 0.0, 1.0';
+ else if (numRows === 3)
+ params['PADDING'] = ', 1.0';
+ else
+ params['PADDING'] = '';
+
+ /** @type {string} */ var vertexShaderSource = tcuStringTemplate.specialize(vtx, params);
+ /** @type {string} */ var fragmentShaderSource = tcuStringTemplate.specialize(frag, params);
+
+ /** @type {function(glsShaderRenderCase.ShaderEvalContext)} */
+ var evalFunc = es3fShaderIndexingTests.getMatrixSubscriptEvalFunc(varType);
+ return new es3fShaderIndexingTests.ShaderIndexingCase(caseName, description, isVertexCase, varType, evalFunc, vertexShaderSource, fragmentShaderSource);
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fShaderIndexingTests.ShaderIndexingTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'indexing', 'Indexing Tests');
+ };
+
+ es3fShaderIndexingTests.ShaderIndexingTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fShaderIndexingTests.ShaderIndexingTests.prototype.constructor = es3fShaderIndexingTests.ShaderIndexingTests;
+
+ es3fShaderIndexingTests.ShaderIndexingTests.prototype.init = function() {
+ var testGroup = tcuTestCase.runner.testCases;
+ /** @type {Array<gluShaderProgram.shaderType>} */ var s_shaderTypes = [
+ gluShaderProgram.shaderType.VERTEX,
+ gluShaderProgram.shaderType.FRAGMENT
+ ];
+ /** @type {Array<gluShaderUtil.DataType>} */ var s_floatAndVecTypes = [
+ gluShaderUtil.DataType.FLOAT,
+ gluShaderUtil.DataType.FLOAT_VEC2,
+ gluShaderUtil.DataType.FLOAT_VEC3,
+ gluShaderUtil.DataType.FLOAT_VEC4
+ ];
+ /** @type {string} */ var name;
+ /** @type {string} */ var desc;
+ /** @type {string} */ var shaderTypeName;
+ /** @type {boolean} */ var isVertexCase;
+ /** @type {gluShaderProgram.shaderType} */ var shaderType;
+ /** @type {string} */ var writeAccessName;
+ /** @type {string} */ var readAccessName;
+ // Varying array access cases.
+ /** @type {tcuTestCase.DeqpTest} */ var varyingGroup = tcuTestCase.newTest('varying_array', 'Varying array access tests.');
+ testGroup.addChild(varyingGroup);
+ /** @type {gluShaderUtil.DataType} */ var varType;
+ for (var typeNdx = 0; typeNdx < s_floatAndVecTypes.length; typeNdx++) {
+ varType = s_floatAndVecTypes[typeNdx];
+ for (var vertAccessStr in es3fShaderIndexingTests.IndexAccessType) {
+ for (var fragAccessStr in es3fShaderIndexingTests.IndexAccessType) {
+ var vertAccess = es3fShaderIndexingTests.IndexAccessType[vertAccessStr];
+ var fragAccess = es3fShaderIndexingTests.IndexAccessType[fragAccessStr];
+ /** @type {string} */ var vertAccessName = es3fShaderIndexingTests.getIndexAccessTypeName(vertAccess);
+ /** @type {string} */ var fragAccessName = es3fShaderIndexingTests.getIndexAccessTypeName(fragAccess);
+ name = gluShaderUtil.getDataTypeName(varType) + '_' + vertAccessName + '_write_' + fragAccessName + '_read';
+ desc = 'Varying array with ' + vertAccessName + ' write in vertex shader and ' + fragAccessName + ' read in fragment shader.';
+ varyingGroup.addChild(es3fShaderIndexingTests.createVaryingArrayCase(name, desc, varType, vertAccess, fragAccess));
+ }
+ }
+ }
+
+ // Uniform array access cases.
+ /** @type {tcuTestCase.DeqpTest} */ var uniformGroup = tcuTestCase.newTest("uniform_array", "Uniform array access tests.");
+ testGroup.addChild(uniformGroup);
+
+ for (var typeNdx = 0; typeNdx < s_floatAndVecTypes.length; typeNdx++) {
+ varType = s_floatAndVecTypes[typeNdx];
+ for (var readAccessStr in es3fShaderIndexingTests.IndexAccessType) {
+ var readAccess = es3fShaderIndexingTests.IndexAccessType[readAccessStr];
+ readAccessName = es3fShaderIndexingTests.getIndexAccessTypeName(readAccess);
+ for (var shaderTypeNdx = 0; shaderTypeNdx < s_shaderTypes.length; shaderTypeNdx++) {
+ shaderType = s_shaderTypes[shaderTypeNdx];
+ shaderTypeName = gluShaderProgram.getShaderTypeName(shaderType);
+ name = gluShaderUtil.getDataTypeName(varType) + "_" + readAccessName + "_read_" + shaderTypeName;
+ desc = "Uniform array with " + readAccessName + " read in " + shaderTypeName + " shader.";
+ isVertexCase = shaderType === gluShaderProgram.shaderType.VERTEX;
+ uniformGroup.addChild(es3fShaderIndexingTests.createUniformArrayCase(name, desc, isVertexCase, varType, readAccess));
+ }
+ }
+ }
+
+ // Temporary array access cases.
+ /** @type {tcuTestCase.DeqpTest} */ var tmpGroup = tcuTestCase.newTest("tmp_array", "Temporary array access tests.");
+ testGroup.addChild(tmpGroup);
+
+ for (var typeNdx = 0; typeNdx < s_floatAndVecTypes.length; typeNdx++) {
+ varType = s_floatAndVecTypes[typeNdx];
+ for (var writeAccess in es3fShaderIndexingTests.IndexAccessType) {
+ for (var readAccess in es3fShaderIndexingTests.IndexAccessType) {
+ writeAccessName = es3fShaderIndexingTests.getIndexAccessTypeName(es3fShaderIndexingTests.IndexAccessType[writeAccess]);
+ readAccessName = es3fShaderIndexingTests.getIndexAccessTypeName(es3fShaderIndexingTests.IndexAccessType[readAccess]);
+
+ for (var shaderTypeNdx = 0; shaderTypeNdx < s_shaderTypes.length; shaderTypeNdx++) {
+ shaderType = s_shaderTypes[shaderTypeNdx];
+ shaderTypeName = gluShaderProgram.getShaderTypeName(shaderType);
+ name = gluShaderUtil.getDataTypeName(varType) + "_" + writeAccessName + "_write_" + readAccessName + "_read_" + shaderTypeName;
+ desc = "Temporary array with " + writeAccessName + " write and " + readAccessName + " read in " + shaderTypeName + " shader.";
+ isVertexCase = (shaderType === gluShaderProgram.shaderType.VERTEX);
+ tmpGroup.addChild(es3fShaderIndexingTests.createTmpArrayCase(name, desc, isVertexCase, varType, es3fShaderIndexingTests.IndexAccessType[writeAccess], es3fShaderIndexingTests.IndexAccessType[readAccess]));
+ }
+ }
+ }
+ }
+
+ // Vector indexing with subscripts.
+
+ /** @type {Array<gluShaderUtil.DataType>} */ var s_vectorTypes = [
+ gluShaderUtil.DataType.FLOAT_VEC2,
+ gluShaderUtil.DataType.FLOAT_VEC3,
+ gluShaderUtil.DataType.FLOAT_VEC4
+ ];
+
+ for (var typeNdx = 0; typeNdx < s_vectorTypes.length; typeNdx++) {
+ /** @type {tcuTestCase.DeqpTest} */ var vecGroup = tcuTestCase.newTest("vector_subscript", "Vector subscript indexing.");
+ testGroup.addChild(vecGroup);
+
+ varType = s_vectorTypes[typeNdx];
+ for (var writeAccess in es3fShaderIndexingTests.VectorAccessType) {
+ for (var readAccess in es3fShaderIndexingTests.VectorAccessType) {
+ writeAccessName = es3fShaderIndexingTests.getVectorAccessTypeName(es3fShaderIndexingTests.VectorAccessType[writeAccess]);
+ readAccessName = es3fShaderIndexingTests.getVectorAccessTypeName(es3fShaderIndexingTests.VectorAccessType[readAccess]);
+
+ for (var shaderTypeNdx = 0; shaderTypeNdx < s_shaderTypes.length; shaderTypeNdx++) {
+ shaderType = s_shaderTypes[shaderTypeNdx];
+ shaderTypeName = gluShaderProgram.getShaderTypeName(shaderType);
+ name = gluShaderUtil.getDataTypeName(varType) + "_" + writeAccessName + "_write_" + readAccessName + "_read_" + shaderTypeName;
+ desc = "Vector subscript access with " + writeAccessName + " write and " + readAccessName + " read in " + shaderTypeName + " shader.";
+ isVertexCase = shaderType === gluShaderProgram.shaderType.VERTEX;
+ vecGroup.addChild(es3fShaderIndexingTests.createVectorSubscriptCase(name, desc, isVertexCase, varType, es3fShaderIndexingTests.VectorAccessType[writeAccess], es3fShaderIndexingTests.VectorAccessType[readAccess]));
+ }
+ }
+ }
+ }
+
+ // Matrix indexing with subscripts.
+ /** @type {Array<tcuTestCase.DeqpTest>} */ var matGroup = [
+ tcuTestCase.newTest("matrix_subscript", "Matrix subscript indexing."),
+ tcuTestCase.newTest("matrix_subscript", "Matrix subscript indexing."),
+ tcuTestCase.newTest("matrix_subscript", "Matrix subscript indexing."),
+ ];
+ for (var ii = 0; ii < matGroup.length; ++ii) {
+ testGroup.addChild(matGroup[ii]);
+ }
+
+ /** @type {Array<gluShaderUtil.DataType>} */ var s_matrixTypes = [
+ gluShaderUtil.DataType.FLOAT_MAT2,
+ gluShaderUtil.DataType.FLOAT_MAT2X3,
+ gluShaderUtil.DataType.FLOAT_MAT2X4,
+ gluShaderUtil.DataType.FLOAT_MAT3X2,
+ gluShaderUtil.DataType.FLOAT_MAT3,
+ gluShaderUtil.DataType.FLOAT_MAT3X4,
+ gluShaderUtil.DataType.FLOAT_MAT4X2,
+ gluShaderUtil.DataType.FLOAT_MAT4X3,
+ gluShaderUtil.DataType.FLOAT_MAT4
+ ];
+
+ for (var typeNdx = 0; typeNdx < s_matrixTypes.length; typeNdx++) {
+ varType = s_matrixTypes[typeNdx];
+ for (var writeAccess in es3fShaderIndexingTests.IndexAccessType) {
+ for (var readAccess in es3fShaderIndexingTests.IndexAccessType) {
+ writeAccessName = es3fShaderIndexingTests.getIndexAccessTypeName(es3fShaderIndexingTests.IndexAccessType[writeAccess]);
+ readAccessName = es3fShaderIndexingTests.getIndexAccessTypeName(es3fShaderIndexingTests.IndexAccessType[readAccess]);
+
+ for (var shaderTypeNdx = 0; shaderTypeNdx < s_shaderTypes.length; shaderTypeNdx++) {
+ shaderType = s_shaderTypes[shaderTypeNdx];
+ shaderTypeName = gluShaderProgram.getShaderTypeName(shaderType);
+ name = gluShaderUtil.getDataTypeName(varType) + "_" + writeAccessName + "_write_" + readAccessName + "_read_" + shaderTypeName;
+ desc = "Vector subscript access with " + writeAccessName + " write and " + readAccessName + " read in " + shaderTypeName + " shader.";
+ isVertexCase = shaderType === gluShaderProgram.shaderType.VERTEX;
+ matGroup[typeNdx % matGroup.length].addChild(es3fShaderIndexingTests.createMatrixSubscriptCase(
+ name, desc, isVertexCase, varType, es3fShaderIndexingTests.IndexAccessType[writeAccess], es3fShaderIndexingTests.IndexAccessType[readAccess]));
+ }
+ }
+ }
+ }
+ };
+
+ /**
+ * Run test
+ * @param {WebGL2RenderingContext} context
+ */
+ es3fShaderIndexingTests.run = function(context, range) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fShaderIndexingTests.ShaderIndexingTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ if (range)
+ state.setRange(range);
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fShaderIndexingTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderLoopTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderLoopTests.js
new file mode 100644
index 0000000000..822b121bda
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderLoopTests.js
@@ -0,0 +1,1251 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fShaderLoopTests');
+goog.require('framework.common.tcuStringTemplate');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('modules.shared.glsShaderRenderCase');
+
+goog.scope(function() {
+var es3fShaderLoopTests = functional.gles3.es3fShaderLoopTests;
+var tcuTestCase = framework.common.tcuTestCase;
+var deMath = framework.delibs.debase.deMath;
+var gluShaderUtil = framework.opengl.gluShaderUtil;
+var gluShaderProgram = framework.opengl.gluShaderProgram;
+var glsShaderRenderCase = modules.shared.glsShaderRenderCase;
+var tcuStringTemplate = framework.common.tcuStringTemplate;
+// Repeated with for, while, do-while. Examples given as 'for' loops.
+// Repeated for const, uniform, dynamic loops.
+
+/**
+ * @enum {number}
+ */
+es3fShaderLoopTests.LoopCase = {
+ LOOPCASE_EMPTY_BODY: 0, // for (...) { }
+ LOOPCASE_INFINITE_WITH_UNCONDITIONAL_BREAK_FIRST: 1, // for (...) { break; <body>; }
+ LOOPCASE_INFINITE_WITH_UNCONDITIONAL_BREAK_LAST: 2, // for (...) { <body>; break; }
+ LOOPCASE_INFINITE_WITH_CONDITIONAL_BREAK: 3, // for (...) { <body>; if (cond) break; }
+ LOOPCASE_SINGLE_STATEMENT: 4, // for (...) statement;
+ LOOPCASE_COMPOUND_STATEMENT: 5, // for (...) { statement; statement; }
+ LOOPCASE_SEQUENCE_STATEMENT: 6, // for (...) statement, statement;
+ LOOPCASE_NO_ITERATIONS: 7, // for (i=0; i<0; i++) ...
+ LOOPCASE_SINGLE_ITERATION: 8, // for (i=0; i<1; i++) ...
+ LOOPCASE_SELECT_ITERATION_COUNT: 9, // for (i=0; i<a?b:c; i++) ...
+ LOOPCASE_CONDITIONAL_CONTINUE: 10, // for (...) { if (cond) continue; }
+ LOOPCASE_UNCONDITIONAL_CONTINUE: 11, // for (...) { <body>; continue; }
+ LOOPCASE_ONLY_CONTINUE: 12, // for (...) { continue; }
+ LOOPCASE_DOUBLE_CONTINUE: 13, // for (...) { if (cond) continue; <body>; continue; }
+ LOOPCASE_CONDITIONAL_BREAK: 14, // for (...) { if (cond) break; }
+ LOOPCASE_UNCONDITIONAL_BREAK: 15, // for (...) { <body>; break; }
+ LOOPCASE_PRE_INCREMENT: 16, // for (...; ++i) { <body>; }
+ LOOPCASE_POST_INCREMENT: 17, // for (...; i++) { <body>; }
+ LOOPCASE_MIXED_BREAK_CONTINUE: 18,
+ LOOPCASE_VECTOR_COUNTER: 19, // for (ivec3 ndx = ...; ndx.x < ndx.y; ndx.x += ndx.z) { ... }
+ LOOPCASE_101_ITERATIONS: 20, // loop for 101 iterations
+ LOOPCASE_SEQUENCE: 21, // two loops in sequence
+ LOOPCASE_NESTED: 22, // two nested loops
+ LOOPCASE_NESTED_SEQUENCE: 23, // two loops in sequence nested inside a third
+ LOOPCASE_NESTED_TRICKY_DATAFLOW_1: 24, // nested loops with tricky data flow
+ LOOPCASE_NESTED_TRICKY_DATAFLOW_2: 25 // nested loops with tricky data flow
+};
+
+/**
+ * @param {es3fShaderLoopTests.LoopCase} loopCase
+ * @return {string}
+ */
+es3fShaderLoopTests.getLoopCaseName = function(loopCase) {
+ /** @type {Array<string>} */ var s_names = [
+ 'empty_body',
+ 'infinite_with_unconditional_break_first',
+ 'infinite_with_unconditional_break_last',
+ 'infinite_with_conditional_break',
+ 'single_statement',
+ 'compound_statement',
+ 'sequence_statement',
+ 'no_iterations',
+ 'single_iteration',
+ 'select_iteration_count',
+ 'conditional_continue',
+ 'unconditional_continue',
+ 'only_continue',
+ 'double_continue',
+ 'conditional_break',
+ 'unconditional_break',
+ 'pre_increment',
+ 'post_increment',
+ 'mixed_break_continue',
+ 'vector_counter',
+ '101_iterations',
+ 'sequence',
+ 'nested',
+ 'nested_sequence',
+ 'nested_tricky_dataflow_1',
+ 'nested_tricky_dataflow_2'
+ ];
+ // DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_names) == es3fShaderLoopTests.LoopCase.LOOPCASE_LAST);
+ // DE_ASSERT(deInBounds32((int)loopCase, 0, LOOPCASE_LAST));
+ return s_names[loopCase];
+};
+
+// Complex loop cases.
+
+/*enum LoopBody
+{
+ LOOPBODY_READ_UNIFORM = 0,
+ LOOPBODY_READ_UNIFORM_ARRAY,
+ LOOPBODY_READ_
+};*/
+
+/**
+ * @enum {number}
+ */
+es3fShaderLoopTests.LoopType = {
+ LOOPTYPE_FOR: 0,
+ LOOPTYPE_WHILE: 1,
+ LOOPTYPE_DO_WHILE: 2
+};
+
+/**
+ * @param {es3fShaderLoopTests.LoopType} loopType
+ * @return {string}
+ */
+es3fShaderLoopTests.getLoopTypeName = function(loopType) {
+ /** @type {Array<string>} */ var s_names = [
+ 'for',
+ 'while',
+ 'do_while'
+ ];
+
+ // DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_names) === es3fShaderLoopTests.LoopType.LOOPTYPE_LAST);
+ // DE_ASSERT(deInBounds32((int)loopType, 0, LOOPTYPE_LAST));
+ return s_names[loopType];
+};
+
+/**
+ * @enum {number}
+ */
+es3fShaderLoopTests.LoopCountType = {
+ LOOPCOUNT_CONSTANT: 0,
+ LOOPCOUNT_UNIFORM: 1,
+ LOOPCOUNT_DYNAMIC: 2
+};
+
+/**
+ * @param {es3fShaderLoopTests.LoopCountType} countType
+ * @return {string}
+ */
+es3fShaderLoopTests.getLoopCountTypeName = function(countType) {
+ /** @type {Array<string>} */ var s_names = [
+ 'constant',
+ 'uniform',
+ 'dynamic'
+ ];
+
+ // DE_STATIC_ASSERT(DE_LENGTH_OF_ARRAY(s_names) == es3fShaderLoopTests.LoopCountType.LOOPCOUNT_LAST);
+ // DE_ASSERT(deInBounds32((int)countType, 0, es3fShaderLoopTests.LoopCountType.LOOPCOUNT_LAST));
+ return s_names[countType];
+};
+
+/**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ */
+es3fShaderLoopTests.evalLoop0Iters = function(c) {
+ var swizzled = deMath.swizzle(c.coords, [0, 1, 2]);
+ c.color[0] = swizzled[0];
+ c.color[1] = swizzled[1];
+ c.color[2] = swizzled[2];
+};
+
+/**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ */
+es3fShaderLoopTests.evalLoop1Iters = function(c) {
+ var swizzled = deMath.swizzle(c.coords, [1, 2, 3]);
+ c.color[0] = swizzled[0];
+ c.color[1] = swizzled[1];
+ c.color[2] = swizzled[2];
+};
+
+/**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ */
+es3fShaderLoopTests.evalLoop2Iters = function(c) {
+ var swizzled = deMath.swizzle(c.coords, [2, 3, 0]);
+ c.color[0] = swizzled[0];
+ c.color[1] = swizzled[1];
+ c.color[2] = swizzled[2];
+};
+
+/**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ */
+es3fShaderLoopTests.evalLoop3Iters = function(c) {
+ var swizzled = deMath.swizzle(c.coords, [3, 0, 1]);
+ c.color[0] = swizzled[0];
+ c.color[1] = swizzled[1];
+ c.color[2] = swizzled[2];
+};
+
+/**
+ * @param {number} numIters
+ * @return {glsShaderRenderCase.ShaderEvalFunc}
+ */
+es3fShaderLoopTests.getLoopEvalFunc = function(numIters) {
+ switch (numIters % 4) {
+ case 0: return es3fShaderLoopTests.evalLoop0Iters;
+ case 1: return es3fShaderLoopTests.evalLoop1Iters;
+ case 2: return es3fShaderLoopTests.evalLoop2Iters;
+ case 3: return es3fShaderLoopTests.evalLoop3Iters;
+ }
+
+ throw new Error('Invalid loop iteration count.');
+};
+
+// ShaderLoopCase
+
+/**
+ * @constructor
+ * @extends {glsShaderRenderCase.ShaderRenderCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {boolean} isVertexCase
+ * @param {glsShaderRenderCase.ShaderEvalFunc} evalFunc
+ * @param {string} vertShaderSource
+ * @param {string} fragShaderSource
+ */
+es3fShaderLoopTests.ShaderLoopCase = function(name, description, isVertexCase, evalFunc, vertShaderSource, fragShaderSource) {
+ glsShaderRenderCase.ShaderRenderCase.call(this, name, description, isVertexCase, evalFunc);
+ /** @type {string} */ this.m_vertShaderSource = vertShaderSource;
+ /** @type {string} */ this.m_fragShaderSource = fragShaderSource;
+};
+
+es3fShaderLoopTests.ShaderLoopCase.prototype = Object.create(glsShaderRenderCase.ShaderRenderCase.prototype);
+es3fShaderLoopTests.ShaderLoopCase.prototype.constructor = es3fShaderLoopTests.ShaderLoopCase;
+
+// Test case creation.
+
+/**
+ * @param {string} caseName
+ * @param {string} description
+ * @param {boolean} isVertexCase
+ * @param {es3fShaderLoopTests.LoopType} loopType
+ * @param {es3fShaderLoopTests.LoopCountType} loopCountType
+ * @param {gluShaderUtil.precision} loopCountPrecision
+ * @param {gluShaderUtil.DataType} loopCountDataType
+ * @return {es3fShaderLoopTests.ShaderLoopCase}
+ */
+es3fShaderLoopTests.createGenericLoopCase = function(caseName, description, isVertexCase, loopType, loopCountType, loopCountPrecision, loopCountDataType) {
+ /** @type {string} */ var vtx = '';
+ /** @type {string} */ var frag = '';
+ /** @type {string} */ var op = '';
+
+ vtx += '#version 300 es\n';
+ frag += '#version 300 es\n';
+
+ vtx += 'in highp vec4 a_position;\n';
+ vtx += 'in highp vec4 a_coords;\n';
+ frag += 'layout(location = 0) out mediump vec4 o_color;\n';
+
+ if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC)
+ vtx += 'in mediump float a_one;\n';
+
+ if (isVertexCase) {
+ vtx += 'out mediump vec3 v_color;\n';
+ frag += 'in mediump vec3 v_color;\n';
+ }
+ else {
+ vtx += 'out mediump vec4 v_coords;\n';
+ frag += 'in mediump vec4 v_coords;\n';
+
+ if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC) {
+ vtx += 'out mediump float v_one;\n';
+ frag += 'in mediump float v_one;\n';
+ }
+ }
+
+ // \todo [petri] Pass numLoopIters from outside?
+ /** @type {number} */ var numLoopIters = 3;
+ /** @type {boolean} */ var isIntCounter = gluShaderUtil.isDataTypeIntOrIVec(loopCountDataType);
+
+ if (isIntCounter) {
+ if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_UNIFORM || loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC)
+ op += 'uniform ${COUNTER_PRECISION} int ' + glsShaderRenderCase.getIntUniformName(numLoopIters) + ';\n';
+ }
+ else {
+ if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_UNIFORM || loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC)
+ op += 'uniform ${COUNTER_PRECISION} float ' + glsShaderRenderCase.getFloatFractionUniformName(numLoopIters) + ';\n';
+
+ if (numLoopIters != 1)
+ op += 'uniform ${COUNTER_PRECISION} float uf_one;\n';
+ }
+
+ vtx += isVertexCase ? op : '';
+ frag += isVertexCase ? '' : op;
+ op = '';
+
+ vtx += "\n" +
+ "void main()\n" +
+ "{\n" +
+ " gl_Position = a_position;\n";
+
+ frag += "\n" +
+ "void main()\n" +
+ "{\n";
+
+ if (isVertexCase)
+ vtx += ' ${PRECISION} vec4 coords = a_coords;\n';
+ else
+ frag += ' ${PRECISION} vec4 coords = v_coords;\n';
+
+ if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC) {
+ if (isIntCounter) {
+ if (isVertexCase)
+ vtx += ' ${COUNTER_PRECISION} int one = int(a_one + 0.5);\n';
+ else
+ frag += ' ${COUNTER_PRECISION} int one = int(v_one + 0.5);\n';
+ }
+ else {
+ if (isVertexCase)
+ vtx += ' ${COUNTER_PRECISION} float one = a_one;\n';
+ else
+ frag += ' ${COUNTER_PRECISION} float one = v_one;\n';
+ }
+ }
+
+ // Read array.
+ op += ' ${PRECISION} vec4 res = coords;\n';
+
+ // Loop iteration count.
+ /** @type {string} */ var iterMaxStr;
+
+ if (isIntCounter) {
+ if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_CONSTANT)
+ iterMaxStr = numLoopIters.toString();
+ else if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_UNIFORM)
+ iterMaxStr = glsShaderRenderCase.getIntUniformName(numLoopIters);
+ else if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC)
+ iterMaxStr = glsShaderRenderCase.getIntUniformName(numLoopIters) + '*one';
+ else
+ throw new Error('Loop Count Type not supported: ' + loopCountType);
+ }
+ else {
+ if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_CONSTANT)
+ iterMaxStr = '1.0';
+ else if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_UNIFORM)
+ iterMaxStr = 'uf_one';
+ else if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC)
+ iterMaxStr = 'uf_one*one';
+ else
+ throw new Error('Loop Count Type not supported: ' + loopCountType);
+ }
+
+ // Loop operations.
+ /** @type {string} */ var initValue = isIntCounter ? '0' : '0.05';
+ /** @type {string} */ var loopCountDeclStr = '' + gluShaderUtil.getPrecisionName(loopCountPrecision) + ' ' + gluShaderUtil.getDataTypeName(loopCountDataType) + ' ndx = ' + initValue;
+ /** @type {string} */ var loopCmpStr = 'ndx < ' + iterMaxStr;
+ /** @type {string} */ var incrementStr;
+
+ if (isIntCounter)
+ incrementStr = 'ndx++';
+ else {
+ if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_CONSTANT)
+ incrementStr = 'ndx += ' + (1.0 / numLoopIters);
+ else if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_UNIFORM)
+ incrementStr = 'ndx += ' + glsShaderRenderCase.getFloatFractionUniformName(numLoopIters);
+ else if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC)
+ incrementStr = 'ndx += ' + glsShaderRenderCase.getFloatFractionUniformName(numLoopIters) + '*one';
+ else
+ throw new Error('Loop Count Type not supported: ' + loopCountType);
+ }
+
+ // Loop body.
+ /** @type {string} */ var loopBody = ' res = res.yzwx;\n';;
+
+ if (loopType === es3fShaderLoopTests.LoopType.LOOPTYPE_FOR) {
+ op += ' for (' + loopCountDeclStr + '; ' + loopCmpStr + '; ' + incrementStr + ')\n' +
+ ' {\n' +
+ loopBody +
+ ' }\n';
+ }
+ else if (loopType === es3fShaderLoopTests.LoopType.LOOPTYPE_WHILE) {
+ op += '\t' + loopCountDeclStr + ';\n' +
+ ' while (' + loopCmpStr + ')\n' +
+ ' {\n' +
+ loopBody +
+ '\t\t' + incrementStr + ';\n' +
+ ' }\n';
+ }
+ else if (loopType === es3fShaderLoopTests.LoopType.LOOPTYPE_DO_WHILE)
+ {
+ op += '\t' + loopCountDeclStr + ';\n' +
+ ' do\n' +
+ ' {\n' +
+ loopBody +
+ '\t\t' + incrementStr + ';\n' +
+ ' } while (' + loopCmpStr + ');\n';
+ }
+ else
+ throw new Error('Loop Type not supported: ' + loopType);
+
+ vtx += isVertexCase ? op : '';
+ frag += isVertexCase ? '' : op;
+ op = '';
+
+ if (isVertexCase) {
+ vtx += ' v_color = res.rgb;\n';
+ frag += ' o_color = vec4(v_color.rgb, 1.0);\n';
+ }
+ else {
+ vtx += ' v_coords = a_coords;\n';
+ frag += ' o_color = vec4(res.rgb, 1.0);\n';
+
+ if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC)
+ vtx += ' v_one = a_one;\n';
+ }
+
+ vtx += '}\n';
+ frag += '}\n';
+
+ // Fill in shader templates.
+ /** @type {Object} */ var params = {};
+ params['LOOP_VAR_TYPE'] = gluShaderUtil.getDataTypeName(loopCountDataType);
+ params['PRECISION'] = 'mediump';
+ params['COUNTER_PRECISION'] = gluShaderUtil.getPrecisionName(loopCountPrecision);
+
+ /** @type {string} */ var vertexShaderSource = tcuStringTemplate.specialize(vtx, params);
+ /** @type {string} */ var fragmentShaderSource = tcuStringTemplate.specialize(frag, params);
+
+ // Create the case.
+ /** @type {glsShaderRenderCase.ShaderEvalFunc} */
+ var evalFunc = es3fShaderLoopTests.getLoopEvalFunc(numLoopIters);
+ return new es3fShaderLoopTests.ShaderLoopCase(caseName, description, isVertexCase, evalFunc, vertexShaderSource, fragmentShaderSource);
+};
+
+// \todo [petri] Generalize to float as well?
+
+/**
+ * @param {string} caseName
+ * @param {string} description
+ * @param {boolean} isVertexCase
+ * @param {es3fShaderLoopTests.LoopCase} loopCase
+ * @param {es3fShaderLoopTests.LoopType} loopType
+ * @param {es3fShaderLoopTests.LoopCountType} loopCountType
+ * @return {es3fShaderLoopTests.ShaderLoopCase}
+ */
+es3fShaderLoopTests.createSpecialLoopCase = function(caseName, description, isVertexCase, loopCase, loopType, loopCountType) {
+ /** @type {string} */ var vtx = '';
+ /** @type {string} */ var frag = '';
+ /** @type {string} */ var op = '';
+
+ vtx += '#version 300 es\n';
+ frag += '#version 300 es\n';
+
+ vtx += 'in highp vec4 a_position;\n';
+ vtx += 'in highp vec4 a_coords;\n';
+ frag += 'layout(location = 0) out mediump vec4 o_color;\n';
+
+ if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC)
+ vtx += 'in mediump float a_one;\n';
+
+ // Attribute and varyings.
+ if (isVertexCase) {
+ vtx += 'out mediump vec3 v_color;\n';
+ frag += 'in mediump vec3 v_color;\n';
+ }
+ else {
+ vtx += 'out mediump vec4 v_coords;\n';
+ frag += 'in mediump vec4 v_coords;\n';
+
+ if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC) {
+ vtx += 'out mediump float v_one;\n';
+ frag += 'in mediump float v_one;\n';
+ }
+ }
+
+ if (loopCase === es3fShaderLoopTests.LoopCase.LOOPCASE_SELECT_ITERATION_COUNT)
+ op += 'uniform bool ub_true;\n';
+
+ op += 'uniform ${COUNTER_PRECISION} int ui_zero, ui_one, ui_two, ui_three, ui_four, ui_five, ui_six;\n';
+ if (loopCase === es3fShaderLoopTests.LoopCase.LOOPCASE_101_ITERATIONS)
+ op += 'uniform ${COUNTER_PRECISION} int ui_oneHundredOne;\n';
+
+ vtx += isVertexCase ? op : '';
+ frag += isVertexCase ? '' : op;
+ op = '';
+
+ /** @type {number} */ var iterCount = 3; // value to use in loop
+ /** @type {number} */ var numIters = 3; // actual number of iterations
+
+ vtx += '\n' +
+ 'void main()\n' +
+ '{\n' +
+ ' gl_Position = a_position;\n';
+
+ frag += '\n' +
+ 'void main()\n' +
+ '{\n';
+
+ if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC) {
+ if (isVertexCase)
+ vtx += ' ${COUNTER_PRECISION} int one = int(a_one + 0.5);\n';
+ else
+ frag += ' ${COUNTER_PRECISION} int one = int(v_one + 0.5);\n';
+ }
+
+ if (isVertexCase)
+ vtx += ' ${PRECISION} vec4 coords = a_coords;\n';
+ else
+ frag += ' ${PRECISION} vec4 coords = v_coords;\n';
+
+ // Read array.
+ op += ' ${PRECISION} vec4 res = coords;\n';
+
+ // Handle all loop types.
+ /** @type {string} */ var counterPrecisionStr = 'mediump';
+ /** @type {string} */ var forLoopStr = '';
+ /** @type {string} */ var whileLoopStr = '';
+ /** @type {string} */ var doWhileLoopPreStr = '';
+ /** @type {string} */ var doWhileLoopPostStr = '';
+
+ if (loopType === es3fShaderLoopTests.LoopType.LOOPTYPE_FOR) {
+ switch (loopCase) {
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_EMPTY_BODY:
+ numIters = 0;
+ op += ' ${FOR_LOOP} {}\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_INFINITE_WITH_UNCONDITIONAL_BREAK_FIRST:
+ numIters = 0;
+ op += ' for (;;) { break; res = res.yzwx; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_INFINITE_WITH_UNCONDITIONAL_BREAK_LAST:
+ numIters = 1;
+ op += ' for (;;) { res = res.yzwx; break; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_INFINITE_WITH_CONDITIONAL_BREAK:
+ numIters = 2;
+ op += ' ${COUNTER_PRECISION} int i = 0;\n' +
+ ' for (;;) { res = res.yzwx; if (i == ${ONE}) break; i++; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_SINGLE_STATEMENT:
+ op += ' ${FOR_LOOP} res = res.yzwx;\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_COMPOUND_STATEMENT:
+ iterCount = 2;
+ numIters = 2 * iterCount;
+ op += ' ${FOR_LOOP} { res = res.yzwx; res = res.yzwx; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_SEQUENCE_STATEMENT:
+ iterCount = 2;
+ numIters = 2 * iterCount;
+ op += ' ${FOR_LOOP} res = res.yzwx, res = res.yzwx;\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_NO_ITERATIONS:
+ iterCount = 0;
+ numIters = 0;
+ op += ' ${FOR_LOOP} res = res.yzwx;\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_SINGLE_ITERATION:
+ iterCount = 1;
+ numIters = 1;
+ op += ' ${FOR_LOOP} res = res.yzwx;\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_SELECT_ITERATION_COUNT:
+ op += ' for (int i = 0; i < (ub_true ? ${ITER_COUNT} : 0); i++) res = res.yzwx;\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_CONDITIONAL_CONTINUE:
+ numIters = iterCount - 1;
+ op += ' ${FOR_LOOP} { if (i == ${TWO}) continue; res = res.yzwx; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_UNCONDITIONAL_CONTINUE:
+ op += ' ${FOR_LOOP} { res = res.yzwx; continue; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_ONLY_CONTINUE:
+ numIters = 0;
+ op += ' ${FOR_LOOP} { continue; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_DOUBLE_CONTINUE:
+ numIters = iterCount - 1;
+ op += ' ${FOR_LOOP} { if (i == ${TWO}) continue; res = res.yzwx; continue; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_CONDITIONAL_BREAK:
+ numIters = 2;
+ op += ' ${FOR_LOOP} { if (i == ${TWO}) break; res = res.yzwx; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_UNCONDITIONAL_BREAK:
+ numIters = 1;
+ op += ' ${FOR_LOOP} { res = res.yzwx; break; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_PRE_INCREMENT:
+ op += ' for (int i = 0; i < ${ITER_COUNT}; ++i) { res = res.yzwx; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_POST_INCREMENT:
+ op += ' ${FOR_LOOP} { res = res.yzwx; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_MIXED_BREAK_CONTINUE:
+ numIters = 2;
+ iterCount = 5;
+ op += ' ${FOR_LOOP} { if (i == 0) continue; else if (i == 3) break; res = res.yzwx; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_VECTOR_COUNTER:
+ op += ' for (${COUNTER_PRECISION} ivec4 i = ivec4(0, 1, ${ITER_COUNT}, 0); i.x < i.z; i.x += i.y) { res = res.yzwx; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_101_ITERATIONS:
+ numIters = iterCount = 101;
+ op += ' ${FOR_LOOP} res = res.yzwx;\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_SEQUENCE:
+ iterCount = 5;
+ numIters = 5;
+ op += ' ${COUNTER_PRECISION} int i;\n' +
+ ' for (i = 0; i < ${TWO}; i++) { res = res.yzwx; }\n' +
+ ' for (; i < ${ITER_COUNT}; i++) { res = res.yzwx; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_NESTED:
+ numIters = 2 * iterCount;
+ op += ' for (${COUNTER_PRECISION} int i = 0; i < ${TWO}; i++)\n' +
+ ' {\n' +
+ ' for (${COUNTER_PRECISION} int j = 0; j < ${ITER_COUNT}; j++)\n' +
+ ' res = res.yzwx;\n' +
+ ' }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_NESTED_SEQUENCE:
+ numIters = 3 * iterCount;
+ op += ' for (${COUNTER_PRECISION} int i = 0; i < ${ITER_COUNT}; i++)\n' +
+ ' {\n' +
+ ' for (${COUNTER_PRECISION} int j = 0; j < ${TWO}; j++)\n' +
+ ' res = res.yzwx;\n' +
+ ' for (${COUNTER_PRECISION} int j = 0; j < ${ONE}; j++)\n' +
+ ' res = res.yzwx;\n' +
+ ' }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_NESTED_TRICKY_DATAFLOW_1:
+ numIters = 2;
+ op += ' ${FOR_LOOP}\n' +
+ ' {\n' +
+ ' res = coords; // ignore outer loop effect \n' +
+ ' for (${COUNTER_PRECISION} int j = 0; j < ${TWO}; j++)\n' +
+ ' res = res.yzwx;\n' +
+ ' }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_NESTED_TRICKY_DATAFLOW_2:
+ numIters = iterCount;
+ op += ' ${FOR_LOOP}\n' +
+ ' {\n' +
+ ' res = coords.wxyz;\n' +
+ ' for (${COUNTER_PRECISION} int j = 0; j < ${TWO}; j++)\n' +
+ ' res = res.yzwx;\n' +
+ ' coords = res;\n' +
+ ' }\n';
+ break;
+
+ default:
+ throw new Error('Case not supported: ' + loopCase);
+ }
+
+ if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_CONSTANT)
+ forLoopStr = 'for (' + counterPrecisionStr + ' int i = 0; i < ' + iterCount + '; i++)';
+ else if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_UNIFORM)
+ forLoopStr = 'for (' + counterPrecisionStr + ' int i = 0; i < ' + glsShaderRenderCase.getIntUniformName(iterCount) + '; i++)';
+ else if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC)
+ forLoopStr = 'for (' + counterPrecisionStr + ' int i = 0; i < one*' + glsShaderRenderCase.getIntUniformName(iterCount) + '; i++)';
+ else
+ throw new Error('Loop Count Type not supported: ' + loopCountType);
+ }
+ else if (loopType === es3fShaderLoopTests.LoopType.LOOPTYPE_WHILE) {
+ switch (loopCase) {
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_EMPTY_BODY:
+ numIters = 0;
+ op += ' ${WHILE_LOOP} {}\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_INFINITE_WITH_UNCONDITIONAL_BREAK_FIRST:
+ numIters = 0;
+ op += ' while (true) { break; res = res.yzwx; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_INFINITE_WITH_UNCONDITIONAL_BREAK_LAST:
+ numIters = 1;
+ op += ' while (true) { res = res.yzwx; break; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_INFINITE_WITH_CONDITIONAL_BREAK:
+ numIters = 2;
+ op += ' ${COUNTER_PRECISION} int i = 0;\n' +
+ ' while (true) { res = res.yzwx; if (i == ${ONE}) break; i++; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_SINGLE_STATEMENT:
+ op += ' ${WHILE_LOOP} res = res.yzwx;\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_COMPOUND_STATEMENT:
+ iterCount = 2;
+ numIters = 2 * iterCount;
+ op += ' ${WHILE_LOOP} { res = res.yzwx; res = res.yzwx; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_SEQUENCE_STATEMENT:
+ iterCount = 2;
+ numIters = 2 * iterCount;
+ op += ' ${WHILE_LOOP} res = res.yzwx, res = res.yzwx;\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_NO_ITERATIONS:
+ iterCount = 0;
+ numIters = 0;
+ op += ' ${WHILE_LOOP} res = res.yzwx;\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_SINGLE_ITERATION:
+ iterCount = 1;
+ numIters = 1;
+ op += ' ${WHILE_LOOP} res = res.yzwx;\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_SELECT_ITERATION_COUNT:
+ op += ' ${COUNTER_PRECISION} int i = 0;\n' +
+ ' while (i < (ub_true ? ${ITER_COUNT} : 0)) { res = res.yzwx; i++; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_CONDITIONAL_CONTINUE:
+ numIters = iterCount - 1;
+ op += ' ${WHILE_LOOP} { if (i == ${TWO}) continue; res = res.yzwx; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_UNCONDITIONAL_CONTINUE:
+ op += ' ${WHILE_LOOP} { res = res.yzwx; continue; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_ONLY_CONTINUE:
+ numIters = 0;
+ op += ' ${WHILE_LOOP} { continue; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_DOUBLE_CONTINUE:
+ numIters = iterCount - 1;
+ op += ' ${WHILE_LOOP} { if (i == ${ONE}) continue; res = res.yzwx; continue; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_CONDITIONAL_BREAK:
+ numIters = 2;
+ op += ' ${WHILE_LOOP} { if (i == ${THREE}) break; res = res.yzwx; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_UNCONDITIONAL_BREAK:
+ numIters = 1;
+ op += ' ${WHILE_LOOP} { res = res.yzwx; break; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_PRE_INCREMENT:
+ numIters = iterCount - 1;
+ op += ' ${COUNTER_PRECISION} int i = 0;\n' +
+ ' while (++i < ${ITER_COUNT}) { res = res.yzwx; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_POST_INCREMENT:
+ op += ' ${COUNTER_PRECISION} int i = 0;\n' +
+ ' while (i++ < ${ITER_COUNT}) { res = res.yzwx; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_MIXED_BREAK_CONTINUE:
+ numIters = 2;
+ iterCount = 5;
+ op += ' ${WHILE_LOOP} { if (i == 0) continue; else if (i == 3) break; res = res.yzwx; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_VECTOR_COUNTER:
+ op += ' ${COUNTER_PRECISION} ivec4 i = ivec4(0, 1, ${ITER_COUNT}, 0);\n' +
+ ' while (i.x < i.z) { res = res.yzwx; i.x += i.y; }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_101_ITERATIONS:
+ numIters = iterCount = 101;
+ op += ' ${WHILE_LOOP} res = res.yzwx;\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_SEQUENCE:
+ iterCount = 6;
+ numIters = iterCount - 1;
+ op += ' ${COUNTER_PRECISION} int i = 0;\n' +
+ ' while (i++ < ${TWO}) { res = res.yzwx; }\n' +
+ ' while (i++ < ${ITER_COUNT}) { res = res.yzwx; }\n'; // \note skips one iteration
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_NESTED:
+ numIters = 2 * iterCount;
+ op += ' ${COUNTER_PRECISION} int i = 0;\n' +
+ ' while (i++ < ${TWO})\n' +
+ ' {\n' +
+ ' ${COUNTER_PRECISION} int j = 0;\n' +
+ ' while (j++ < ${ITER_COUNT})\n' +
+ ' res = res.yzwx;\n' +
+ ' }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_NESTED_SEQUENCE:
+ numIters = 2 * iterCount;
+ op += ' ${COUNTER_PRECISION} int i = 0;\n' +
+ ' while (i++ < ${ITER_COUNT})\n' +
+ ' {\n' +
+ ' ${COUNTER_PRECISION} int j = 0;\n' +
+ ' while (j++ < ${ONE})\n' +
+ ' res = res.yzwx;\n' +
+ ' while (j++ < ${THREE})\n' + // \note skips one iteration
+ ' res = res.yzwx;\n' +
+ ' }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_NESTED_TRICKY_DATAFLOW_1:
+ numIters = 2;
+ op += ' ${WHILE_LOOP}\n' +
+ ' {\n' +
+ ' res = coords; // ignore outer loop effect \n' +
+ ' ${COUNTER_PRECISION} int j = 0;\n' +
+ ' while (j++ < ${TWO})\n' +
+ ' res = res.yzwx;\n' +
+ ' }\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_NESTED_TRICKY_DATAFLOW_2:
+ numIters = iterCount;
+ op += ' ${WHILE_LOOP}\n' +
+ ' {\n' +
+ ' res = coords.wxyz;\n' +
+ ' ${COUNTER_PRECISION} int j = 0;\n' +
+ ' while (j++ < ${TWO})\n' +
+ ' res = res.yzwx;\n' +
+ ' coords = res;\n' +
+ ' }\n';
+ break;
+
+ default:
+ throw new Error('Loop Case not supported: ' + loopCase);
+ }
+
+ if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_CONSTANT)
+ whileLoopStr = '\t' + counterPrecisionStr + ' int i = 0;\n' + ' while(i++ < ' + iterCount + ')';
+ else if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_UNIFORM)
+ whileLoopStr = '\t' + counterPrecisionStr + ' int i = 0;\n' + ' while(i++ < ' + glsShaderRenderCase.getIntUniformName(iterCount) + ')';
+ else if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC)
+ whileLoopStr = '\t' + counterPrecisionStr + ' int i = 0;\n' + ' while(i++ < one*' + glsShaderRenderCase.getIntUniformName(iterCount) + ')';
+ else
+ throw new Error('Loop Count Type not supported: ' + loopCountType);
+ }
+ else {
+ assertMsgOptions(loopType === es3fShaderLoopTests.LoopType.LOOPTYPE_DO_WHILE, 'Expected LOOPTYPE_DO_WHILE', false, true);
+
+ switch (loopCase) {
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_EMPTY_BODY:
+ numIters = 0;
+ op += ' ${DO_WHILE_PRE} {} ${DO_WHILE_POST}\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_INFINITE_WITH_UNCONDITIONAL_BREAK_FIRST:
+ numIters = 0;
+ op += ' do { break; res = res.yzwx; } while (true);\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_INFINITE_WITH_UNCONDITIONAL_BREAK_LAST:
+ numIters = 1;
+ op += ' do { res = res.yzwx; break; } while (true);\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_INFINITE_WITH_CONDITIONAL_BREAK:
+ numIters = 2;
+ op += ' ${COUNTER_PRECISION} int i = 0;\n' +
+ ' do { res = res.yzwx; if (i == ${ONE}) break; i++; } while (true);\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_SINGLE_STATEMENT:
+ op += ' ${DO_WHILE_PRE} res = res.yzwx; ${DO_WHILE_POST}\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_COMPOUND_STATEMENT:
+ iterCount = 2;
+ numIters = 2 * iterCount;
+ op += ' ${DO_WHILE_PRE} { res = res.yzwx; res = res.yzwx; } ${DO_WHILE_POST}\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_SEQUENCE_STATEMENT:
+ iterCount = 2;
+ numIters = 2 * iterCount;
+ op += ' ${DO_WHILE_PRE} res = res.yzwx, res = res.yzwx; ${DO_WHILE_POST}\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_NO_ITERATIONS:
+ //assertMsgOptions(false, 'LOOPCASE_NO_ITERATIONS', false, false);
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_SINGLE_ITERATION:
+ iterCount = 1;
+ numIters = 1;
+ op += ' ${DO_WHILE_PRE} res = res.yzwx; ${DO_WHILE_POST}\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_SELECT_ITERATION_COUNT:
+ op += ' ${COUNTER_PRECISION} int i = 0;\n' +
+ ' do { res = res.yzwx; } while (++i < (ub_true ? ${ITER_COUNT} : 0));\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_CONDITIONAL_CONTINUE:
+ numIters = iterCount - 1;
+ op += ' ${DO_WHILE_PRE} { if (i == ${TWO}) continue; res = res.yzwx; } ${DO_WHILE_POST}\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_UNCONDITIONAL_CONTINUE:
+ op += ' ${DO_WHILE_PRE} { res = res.yzwx; continue; } ${DO_WHILE_POST}\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_ONLY_CONTINUE:
+ numIters = 0;
+ op += ' ${DO_WHILE_PRE} { continue; } ${DO_WHILE_POST}\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_DOUBLE_CONTINUE:
+ numIters = iterCount - 1;
+ op += ' ${DO_WHILE_PRE} { if (i == ${TWO}) continue; res = res.yzwx; continue; } ${DO_WHILE_POST}\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_CONDITIONAL_BREAK:
+ numIters = 2;
+ op += ' ${DO_WHILE_PRE} { res = res.yzwx; if (i == ${ONE}) break; } ${DO_WHILE_POST}\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_UNCONDITIONAL_BREAK:
+ numIters = 1;
+ op += ' ${DO_WHILE_PRE} { res = res.yzwx; break; } ${DO_WHILE_POST}\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_PRE_INCREMENT:
+ op += ' ${COUNTER_PRECISION} int i = 0;\n' +
+ ' do { res = res.yzwx; } while (++i < ${ITER_COUNT});\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_POST_INCREMENT:
+ numIters = iterCount + 1;
+ op += ' ${COUNTER_PRECISION} int i = 0;\n' +
+ ' do { res = res.yzwx; } while (i++ < ${ITER_COUNT});\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_MIXED_BREAK_CONTINUE:
+ numIters = 2;
+ iterCount = 5;
+ op += ' ${DO_WHILE_PRE} { if (i == 0) continue; else if (i == 3) break; res = res.yzwx; } ${DO_WHILE_POST}\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_VECTOR_COUNTER:
+ op += ' ${COUNTER_PRECISION} ivec4 i = ivec4(0, 1, ${ITER_COUNT}, 0);\n' +
+ ' do { res = res.yzwx; } while ((i.x += i.y) < i.z);\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_101_ITERATIONS:
+ numIters = iterCount = 101;
+ op += ' ${DO_WHILE_PRE} res = res.yzwx; ${DO_WHILE_POST}\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_SEQUENCE:
+ iterCount = 5;
+ numIters = 5;
+ op += ' ${COUNTER_PRECISION} int i = 0;\n' +
+ ' do { res = res.yzwx; } while (++i < ${TWO});\n' +
+ ' do { res = res.yzwx; } while (++i < ${ITER_COUNT});\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_NESTED:
+ numIters = 2 * iterCount;
+ op += ' ${COUNTER_PRECISION} int i = 0;\n' +
+ ' do\n' +
+ ' {\n' +
+ ' ${COUNTER_PRECISION} int j = 0;\n' +
+ ' do\n' +
+ ' res = res.yzwx;\n' +
+ ' while (++j < ${ITER_COUNT});\n' +
+ ' } while (++i < ${TWO});\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_NESTED_SEQUENCE:
+ numIters = 3 * iterCount;
+ op += ' ${COUNTER_PRECISION} int i = 0;\n' +
+ ' do\n' +
+ ' {\n' +
+ ' ${COUNTER_PRECISION} int j = 0;\n' +
+ ' do\n' +
+ ' res = res.yzwx;\n' +
+ ' while (++j < ${TWO});\n' +
+ ' do\n' +
+ ' res = res.yzwx;\n' +
+ ' while (++j < ${THREE});\n' +
+ ' } while (++i < ${ITER_COUNT});\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_NESTED_TRICKY_DATAFLOW_1:
+ numIters = 2;
+ op += ' ${DO_WHILE_PRE}\n' +
+ ' {\n' +
+ ' res = coords; // ignore outer loop effect \n' +
+ ' ${COUNTER_PRECISION} int j = 0;\n' +
+ ' do\n' +
+ ' res = res.yzwx;\n' +
+ ' while (++j < ${TWO});\n' +
+ ' } ${DO_WHILE_POST}\n';
+ break;
+
+ case es3fShaderLoopTests.LoopCase.LOOPCASE_NESTED_TRICKY_DATAFLOW_2:
+ numIters = iterCount;
+ op += ' ${DO_WHILE_PRE}\n' +
+ ' {\n' +
+ ' res = coords.wxyz;\n' +
+ ' ${COUNTER_PRECISION} int j = 0;\n' +
+ ' while (j++ < ${TWO})\n' +
+ ' res = res.yzwx;\n' +
+ ' coords = res;\n' +
+ ' } ${DO_WHILE_POST}\n';
+ break;
+
+ default:
+ throw new Error('Loop Case not supported: ' + loopCase);
+ }
+
+ doWhileLoopPreStr = '\t' + counterPrecisionStr + ' int i = 0;\n' + '\tdo ';
+ if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_CONSTANT)
+ doWhileLoopPostStr = ' while (++i < ' + iterCount + ');\n';
+ else if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_UNIFORM)
+ doWhileLoopPostStr = ' while (++i < ' + glsShaderRenderCase.getIntUniformName(iterCount) + ');\n';
+ else if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC)
+ doWhileLoopPostStr = ' while (++i < one*' + glsShaderRenderCase.getIntUniformName(iterCount) + ');\n';
+ else
+ throw new Error('Loop Count Type not supported: ' + loopCountType);
+ }
+
+ vtx += isVertexCase ? op : '';
+ frag += isVertexCase ? '' : op;
+ op = '';
+
+ // Shader footers.
+ if (isVertexCase) {
+ vtx += ' v_color = res.rgb;\n';
+ frag += ' o_color = vec4(v_color.rgb, 1.0);\n';
+ }
+ else {
+ vtx += ' v_coords = a_coords;\n';
+ frag += ' o_color = vec4(res.rgb, 1.0);\n';
+
+ if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC)
+ vtx += ' v_one = a_one;\n';
+ }
+
+ vtx += '}\n';
+ frag += '}\n';
+
+ // Constants.
+ /** @type {string} */ var oneStr = '';
+ /** @type {string} */ var twoStr = '';
+ /** @type {string} */ var threeStr = '';
+ /** @type {string} */ var iterCountStr = '';
+
+ if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_CONSTANT) {
+ oneStr = '1';
+ twoStr = '2';
+ threeStr = '3';
+ iterCountStr = iterCount.toString();
+ }
+ else if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_UNIFORM) {
+ oneStr = 'ui_one';
+ twoStr = 'ui_two';
+ threeStr = 'ui_three';
+ iterCountStr = glsShaderRenderCase.getIntUniformName(iterCount);
+ }
+ else if (loopCountType === es3fShaderLoopTests.LoopCountType.LOOPCOUNT_DYNAMIC) {
+ oneStr = 'one*ui_one';
+ twoStr = 'one*ui_two';
+ threeStr = 'one*ui_three';
+ iterCountStr = 'one*' + glsShaderRenderCase.getIntUniformName(iterCount);
+ }
+ else throw new Error('Loop Count Type not supported: ' + loopCountType);
+
+ // Fill in shader templates.
+ /** @type {Object} */ var params = {};
+ params["PRECISION"] = "mediump";
+ params["ITER_COUNT"] = iterCountStr;
+ params["COUNTER_PRECISION"] = counterPrecisionStr;
+ params["FOR_LOOP"] = forLoopStr;
+ params["WHILE_LOOP"] = whileLoopStr;
+ params["DO_WHILE_PRE"] = doWhileLoopPreStr;
+ params["DO_WHILE_POST"] = doWhileLoopPostStr;
+ params["ONE"] = oneStr;
+ params["TWO"] = twoStr;
+ params["THREE"] = threeStr;
+
+ /** @type {string} */ var vertexShaderSource = tcuStringTemplate.specialize(vtx, params);
+ /** @type {string} */ var fragmentShaderSource = tcuStringTemplate.specialize(frag, params);
+
+ // Create the case.
+ /** @type {glsShaderRenderCase.ShaderEvalFunc} */
+ var evalFunc = es3fShaderLoopTests.getLoopEvalFunc(numIters);
+ return new es3fShaderLoopTests.ShaderLoopCase(caseName, description, isVertexCase, evalFunc, vertexShaderSource, fragmentShaderSource);
+};
+
+// ShaderLoopTests.
+
+/**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+es3fShaderLoopTests.ShaderLoopTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'loops', 'Loop Tests');
+};
+
+es3fShaderLoopTests.ShaderLoopTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+es3fShaderLoopTests.ShaderLoopTests.prototype.constructor = es3fShaderLoopTests.ShaderLoopTests;
+
+es3fShaderLoopTests.ShaderLoopTests.prototype.init = function() {
+ var testGroup = tcuTestCase.runner.testCases;
+ // Loop cases.
+
+ /** @type {Array<gluShaderProgram.shaderType>} */ var s_shaderTypes = [
+ gluShaderProgram.shaderType.VERTEX,
+ gluShaderProgram.shaderType.FRAGMENT
+ ];
+
+ /** @type {Array<gluShaderUtil.DataType>} */ var s_countDataType = [
+ gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.FLOAT
+ ];
+
+ /** @type {gluShaderProgram.shaderType} */ var shaderType;
+ /** @type {string} */ var shaderTypeName;
+ /** @type {boolean} */ var isVertexCase;
+ /** @type {string} */ var name;
+ /** @type {string} */ var desc;
+
+ for (var loopType in es3fShaderLoopTests.LoopType) {
+ /** @type {string} */ var loopTypeName = es3fShaderLoopTests.getLoopTypeName(es3fShaderLoopTests.LoopType[loopType]);
+ /** @type {tcuTestCase.DeqpTest} */ var loopTypeGroup = tcuTestCase.newTest(loopTypeName, 'Loop tests with ' + loopTypeName + ' loop type');
+ testGroup.addChild(loopTypeGroup);
+
+ for (var loopCountType in es3fShaderLoopTests.LoopCountType) {
+ /** @type {string} */ var loopCountName = es3fShaderLoopTests.getLoopCountTypeName(es3fShaderLoopTests.LoopCountType[loopCountType]);
+
+ /** @type {string} */ var groupName = loopCountName + '_iterations';
+ /** @type {string} */ var groupDesc = 'Loop tests with ' + loopCountName + ' loop counter.';
+
+ /** @type {tcuTestCase.DeqpTest} */ var group = tcuTestCase.newTest(groupName, groupDesc);
+ loopTypeGroup.addChild(group);
+
+ // Generic cases.
+
+ for (var precision in gluShaderUtil.precision) {
+ /** @type {string} */ var precisionName = gluShaderUtil.getPrecisionName(gluShaderUtil.precision[precision]);
+
+ for (var dataTypeNdx = 0; dataTypeNdx < s_countDataType.length; dataTypeNdx++) {
+ /** @type {gluShaderUtil.DataType} */ var loopDataType = s_countDataType[dataTypeNdx];
+ /** @type {string} */ var dataTypeName = gluShaderUtil.getDataTypeName(loopDataType);
+
+ for (var shaderTypeNdx = 0; shaderTypeNdx < s_shaderTypes.length; shaderTypeNdx++) {
+ shaderType = s_shaderTypes[shaderTypeNdx];
+ shaderTypeName = gluShaderProgram.getShaderTypeName(shaderType);
+ isVertexCase = (shaderType == gluShaderProgram.shaderType.VERTEX);
+
+
+ name = 'basic_' + precisionName + '_' + dataTypeName + '_' + shaderTypeName;
+ desc = loopTypeName + ' loop with ' + precisionName + dataTypeName + ' ' + loopCountName + ' iteration count in ' + shaderTypeName + ' shader.';
+ group.addChild(es3fShaderLoopTests.createGenericLoopCase(name, desc, isVertexCase, es3fShaderLoopTests.LoopType[loopType], es3fShaderLoopTests.LoopCountType[loopCountType], gluShaderUtil.precision[precision], loopDataType));
+ }
+ }
+ }
+
+ // Special cases.
+
+ for (var loopCase in es3fShaderLoopTests.LoopCase) {
+ /** @type {string} */ var loopCaseName = es3fShaderLoopTests.getLoopCaseName(es3fShaderLoopTests.LoopCase[loopCase]);
+
+ // no-iterations not possible with do-while.
+ if ((es3fShaderLoopTests.LoopCase[loopCase] == es3fShaderLoopTests.LoopCase.LOOPCASE_NO_ITERATIONS) && (es3fShaderLoopTests.LoopType[loopType] == es3fShaderLoopTests.LoopType.LOOPTYPE_DO_WHILE))
+ continue;
+
+ for (var shaderTypeNdx = 0; shaderTypeNdx < s_shaderTypes.length; shaderTypeNdx++) {
+ shaderType = s_shaderTypes[shaderTypeNdx];
+ shaderTypeName = gluShaderProgram.getShaderTypeName(shaderType);
+ isVertexCase = (shaderType == gluShaderProgram.shaderType.VERTEX);
+
+ name = loopCaseName + '_' + shaderTypeName;
+ desc = loopCaseName + ' loop with ' + loopTypeName + ' iteration count in ' + shaderTypeName + ' shader.';
+ group.addChild(es3fShaderLoopTests.createSpecialLoopCase(name, desc, isVertexCase, es3fShaderLoopTests.LoopCase[loopCase], es3fShaderLoopTests.LoopType[loopType], es3fShaderLoopTests.LoopCountType[loopCountType]));
+ }
+ }
+ }
+ }
+};
+
+/**
+* Run test
+* @param {WebGL2RenderingContext} context
+*/
+es3fShaderLoopTests.run = function(context, range) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fShaderLoopTests.ShaderLoopTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+ try {
+ if (range)
+ state.setRange(range);
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fShaderLoopTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderMatrixTest.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderMatrixTest.js
new file mode 100644
index 0000000000..5af21863f5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderMatrixTest.js
@@ -0,0 +1,1852 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+'use strict';
+goog.provide('functional.gles3.es3fShaderMatrixTest');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('modules.shared.glsShaderRenderCase');
+goog.require('framework.common.tcuMatrix');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.common.tcuTestCase');
+
+goog.scope(function() {
+
+ var es3fShaderMatrixTest= functional.gles3.es3fShaderMatrixTest;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var glsShaderRenderCase = modules.shared.glsShaderRenderCase;
+ var tcuMatrix = framework.common.tcuMatrix;
+ var deMath = framework.delibs.debase.deMath;
+ var tcuTestCase = framework.common.tcuTestCase;
+
+
+ /** @const {Array<number>}*/ var s_constInFloat = [0.5, -0.2];
+ /** @const {Array<Array<number>>}*/ var s_constInVec2 = [[1.2, 0.5], [0.5, 1.0]];
+ /** @const {Array<Array<number>>}*/ var s_constInVec3 = [[1.1, 0.1, 0.5], [-0.2, 0.5, 0.8]];
+ /** @const {Array<Array<number>>}*/ var s_constInVec4 = [[1.4, 0.2, -0.5, 0.7], [0.2, -1.0, 0.5, 0.8]];
+
+ /** @typedef {function(glsShaderRenderCase.ShaderEvalContext)} */ es3fShaderMatrixTest.MatrixShaderEvalFunc;
+
+ /** @const {Array<Array<number>>}*/ var s_constInMat2x2 = [
+ [-0.1, 1.0, -0.2, 0.0],
+ [0.8, 0.1, 0.5, -0.9]
+ ];
+ /** @const {Array<Array<number>>}*/ var s_constInMat3x2 = [
+ [0.8, -0.3, 0.3, 1.0, 1.2, -1.2],
+ [1.2, -1.0, 0.5, -0.8, 1.1, 0.3]
+ ];
+
+ /** @const {Array<Array<number>>}*/ var s_constInMat4x2 = [
+ [-0.2, 0.5, 0.0, -1.0, 1.2, -0.5, 0.3, -0.9],
+ [1.0, 0.1, -1.1, 0.6, 0.8, -1.2, -1.1, 0.7]
+ ];
+
+ /** @const {Array<Array<number>>}*/ var s_constInMat2x3 = [
+ [-0.6, -0.1, -0.7, -1.2, -0.2, 0.0],
+ [1.1, 0.6, 0.8, 1.0, 0.7, 0.1]
+ ];
+
+ /** @const {Array<Array<number>>}*/ var s_constInMat3x3 = [
+ [-0.2, 1.1, 1.2, -1.0, 1.2, 0.5, 0.7, -0.2, 1.0],
+ [-0.1, -0.1, 0.1, -0.1, -0.2, 1.0, -0.5, 0.1, -0.4]
+ ];
+
+ /** @const {Array<Array<number>>}*/ var s_constInMat4x3 = [
+ [-0.9, 0.0, 0.6, 0.2, 0.9, -0.1, -0.3, -0.7, -0.1, 0.1, 1.0, 0.0],
+ [0.5, 0.7, 0.7, 1.2, 1.1, 0.1, 1.0, -1.0, -0.2, -0.2, -0.3, -0.5]
+ ];
+
+ /** @const {Array<Array<number>>}*/ var s_constInMat2x4 = [
+ [-0.6, -1.1, -0.6, -0.6, -0.2, -0.6, -0.1, -0.1],
+ [-1.2, -1.0, 0.7, -1.0, 0.7, 0.7, -0.4, -0.3]
+ ];
+
+ /** @const {Array<Array<number>>}*/ var s_constInMat3x4 = [
+ [0.6, -0.4, 1.2, 0.9, 0.8, 0.4, 1.1, 0.3, 0.5, -0.2, 0.0, 1.1],
+ [-0.8, 1.2, -0.2, -1.1, -0.9, -0.5, -1.2, 1.0, 1.2, 0.1, -0.7, -0.5]
+ ];
+
+ /** @const {Array<Array<number>>}*/ var s_constInMat4x4 = [
+ [0.3, 0.9, -0.2, 1.0, -0.4, -0.6, 0.6, -1.0, -0.9, -0.1, 0.3, -0.2, -0.3, -0.9, 1.0, 0.1],
+ [0.4, -0.7, -0.8, 0.7, -0.4, -0.8, 0.6, -0.3, 0.7, -1.0, 0.1, -0.3, 0.2, 0.6, 0.4, -1.0]
+ ];
+
+ // Operation info
+
+ /**
+ * @enum
+ */
+ es3fShaderMatrixTest.OperationType = {
+ OPERATIONTYPE_BINARY_OPERATOR: 0,
+ OPERATIONTYPE_BINARY_FUNCTION: 1,
+ OPERATIONTYPE_UNARY_PREFIX_OPERATOR: 2,
+ OPERATIONTYPE_UNARY_POSTFIX_OPERATOR: 3,
+ OPERATIONTYPE_UNARY_FUNCTION: 4,
+ OPERATIONTYPE_ASSIGNMENT: 5
+ };
+
+ /**
+ * @param {es3fShaderMatrixTest.MatrixOp} op
+ * @return {string}
+ */
+ es3fShaderMatrixTest.getOperationName = function(op) {
+ switch (op) {
+ case es3fShaderMatrixTest.MatrixOp.OP_ADD: return '+';
+ case es3fShaderMatrixTest.MatrixOp.OP_SUB: return '-';
+ case es3fShaderMatrixTest.MatrixOp.OP_MUL: return '*';
+ case es3fShaderMatrixTest.MatrixOp.OP_DIV: return '/';
+ case es3fShaderMatrixTest.MatrixOp.OP_COMP_MUL: return 'matrixCompMult';
+ case es3fShaderMatrixTest.MatrixOp.OP_OUTER_PRODUCT: return 'outerProduct';
+ case es3fShaderMatrixTest.MatrixOp.OP_TRANSPOSE: return 'transpose';
+ case es3fShaderMatrixTest.MatrixOp.OP_INVERSE: return 'inverse';
+ case es3fShaderMatrixTest.MatrixOp.OP_DETERMINANT: return 'determinant';
+ case es3fShaderMatrixTest.MatrixOp.OP_UNARY_PLUS: return '+';
+ case es3fShaderMatrixTest.MatrixOp.OP_NEGATION: return '-';
+ case es3fShaderMatrixTest.MatrixOp.OP_PRE_INCREMENT: return '++';
+ case es3fShaderMatrixTest.MatrixOp.OP_PRE_DECREMENT: return '--';
+ case es3fShaderMatrixTest.MatrixOp.OP_POST_INCREMENT: return '++';
+ case es3fShaderMatrixTest.MatrixOp.OP_POST_DECREMENT: return '--';
+ case es3fShaderMatrixTest.MatrixOp.OP_ADD_INTO: return '+=';
+ case es3fShaderMatrixTest.MatrixOp.OP_SUBTRACT_FROM: return '-=';
+ case es3fShaderMatrixTest.MatrixOp.OP_MULTIPLY_INTO: return '*=';
+ case es3fShaderMatrixTest.MatrixOp.OP_DIVIDE_INTO: return '/=';
+ default:
+ throw new Error('Error invalid Matrix Operation');
+ }
+ };
+
+ /**
+ * @param {es3fShaderMatrixTest.MatrixOp} op
+ * @return {es3fShaderMatrixTest.OperationType}
+ */
+ es3fShaderMatrixTest.getOperationType = function (op) {
+ switch (op)
+ {
+ case es3fShaderMatrixTest.MatrixOp.OP_ADD: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_BINARY_OPERATOR;
+ case es3fShaderMatrixTest.MatrixOp.OP_SUB: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_BINARY_OPERATOR;
+ case es3fShaderMatrixTest.MatrixOp.OP_MUL: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_BINARY_OPERATOR;
+ case es3fShaderMatrixTest.MatrixOp.OP_DIV: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_BINARY_OPERATOR;
+ case es3fShaderMatrixTest.MatrixOp.OP_COMP_MUL: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_BINARY_FUNCTION;
+ case es3fShaderMatrixTest.MatrixOp.OP_OUTER_PRODUCT: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_BINARY_FUNCTION;
+ case es3fShaderMatrixTest.MatrixOp.OP_TRANSPOSE: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_UNARY_FUNCTION;
+ case es3fShaderMatrixTest.MatrixOp.OP_INVERSE: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_UNARY_FUNCTION;
+ case es3fShaderMatrixTest.MatrixOp.OP_DETERMINANT: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_UNARY_FUNCTION;
+ case es3fShaderMatrixTest.MatrixOp.OP_UNARY_PLUS: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_UNARY_PREFIX_OPERATOR;
+ case es3fShaderMatrixTest.MatrixOp.OP_NEGATION: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_UNARY_PREFIX_OPERATOR;
+ case es3fShaderMatrixTest.MatrixOp.OP_PRE_INCREMENT: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_UNARY_PREFIX_OPERATOR;
+ case es3fShaderMatrixTest.MatrixOp.OP_PRE_DECREMENT: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_UNARY_PREFIX_OPERATOR;
+ case es3fShaderMatrixTest.MatrixOp.OP_POST_INCREMENT: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_UNARY_POSTFIX_OPERATOR;
+ case es3fShaderMatrixTest.MatrixOp.OP_POST_DECREMENT: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_UNARY_POSTFIX_OPERATOR;
+ case es3fShaderMatrixTest.MatrixOp.OP_ADD_INTO: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_ASSIGNMENT;
+ case es3fShaderMatrixTest.MatrixOp.OP_SUBTRACT_FROM: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_ASSIGNMENT;
+ case es3fShaderMatrixTest.MatrixOp.OP_MULTIPLY_INTO: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_ASSIGNMENT;
+ case es3fShaderMatrixTest.MatrixOp.OP_DIVIDE_INTO: return es3fShaderMatrixTest.OperationType.OPERATIONTYPE_ASSIGNMENT;
+ default:
+ throw new Error('Error invalid Matrix Operation');
+ }
+ };
+
+ /**
+ * @enum
+ */
+ es3fShaderMatrixTest.MatrixType = {
+ TESTMATRIXTYPE_DEFAULT: 0,
+ TESTMATRIXTYPE_NEGATED: 1,
+ TESTMATRIXTYPE_INCREMENTED: 2,
+ TESTMATRIXTYPE_DECREMENTED: 3,
+ TESTMATRIXTYPE_NEGATED_INCREMENTED: 4,
+ TESTMATRIXTYPE_INCREMENTED_LESS: 5
+ };
+
+ /**
+ * @param {es3fShaderMatrixTest.MatrixOp} op
+ * @return {es3fShaderMatrixTest.MatrixType}
+ */
+ es3fShaderMatrixTest.getOperationTestMatrixType = function (op) {
+ switch(op) {
+ case es3fShaderMatrixTest.MatrixOp.OP_ADD: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DEFAULT;
+ case es3fShaderMatrixTest.MatrixOp.OP_SUB: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DEFAULT;
+ case es3fShaderMatrixTest.MatrixOp.OP_MUL: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DEFAULT;
+ case es3fShaderMatrixTest.MatrixOp.OP_DIV: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DEFAULT;
+ case es3fShaderMatrixTest.MatrixOp.OP_COMP_MUL: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DEFAULT;
+ case es3fShaderMatrixTest.MatrixOp.OP_OUTER_PRODUCT: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DEFAULT;
+ case es3fShaderMatrixTest.MatrixOp.OP_TRANSPOSE: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DEFAULT;
+ case es3fShaderMatrixTest.MatrixOp.OP_INVERSE: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DEFAULT;
+ case es3fShaderMatrixTest.MatrixOp.OP_DETERMINANT: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DEFAULT;
+ case es3fShaderMatrixTest.MatrixOp.OP_UNARY_PLUS: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DECREMENTED;
+ case es3fShaderMatrixTest.MatrixOp.OP_NEGATION: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_NEGATED_INCREMENTED;
+ case es3fShaderMatrixTest.MatrixOp.OP_PRE_INCREMENT: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_NEGATED;
+ case es3fShaderMatrixTest.MatrixOp.OP_PRE_DECREMENT: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_INCREMENTED;
+ case es3fShaderMatrixTest.MatrixOp.OP_POST_INCREMENT: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_NEGATED;
+ case es3fShaderMatrixTest.MatrixOp.OP_POST_DECREMENT: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DEFAULT;
+ case es3fShaderMatrixTest.MatrixOp.OP_ADD_INTO: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DEFAULT;
+ case es3fShaderMatrixTest.MatrixOp.OP_SUBTRACT_FROM: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_INCREMENTED_LESS;
+ case es3fShaderMatrixTest.MatrixOp.OP_MULTIPLY_INTO: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_NEGATED;
+ case es3fShaderMatrixTest.MatrixOp.OP_DIVIDE_INTO: return es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DECREMENTED;
+ default:
+ throw new Error('Error invalid Matrix Operation');
+ }
+ };
+
+ /**
+ * @param {es3fShaderMatrixTest.MatrixOp} op
+ * @return {boolean}
+ */
+ es3fShaderMatrixTest.isOperationBinary = function (op) {
+ return es3fShaderMatrixTest.getOperationType(op) == es3fShaderMatrixTest.OperationType.OPERATIONTYPE_BINARY_OPERATOR ||
+ es3fShaderMatrixTest.getOperationType(op) == es3fShaderMatrixTest.OperationType.OPERATIONTYPE_BINARY_FUNCTION ||
+ es3fShaderMatrixTest.getOperationType(op) == es3fShaderMatrixTest.OperationType.OPERATIONTYPE_ASSIGNMENT;
+ };
+
+ /**
+ * @param {es3fShaderMatrixTest.MatrixOp} op
+ * @return {boolean}
+ */
+ es3fShaderMatrixTest.isOperationMatrixScalar = function (op) {
+ return op == es3fShaderMatrixTest.MatrixOp.OP_ADD ||
+ op == es3fShaderMatrixTest.MatrixOp.OP_SUB ||
+ op == es3fShaderMatrixTest.MatrixOp.OP_MUL ||
+ op == es3fShaderMatrixTest.MatrixOp.OP_DIV;
+ };
+
+ /**
+ * @param {es3fShaderMatrixTest.MatrixOp} op
+ * @return {boolean}
+ */
+ es3fShaderMatrixTest.isOperationMatrixVector = function (op) {
+ return op == es3fShaderMatrixTest.MatrixOp.OP_MUL;
+ };
+
+
+ /**
+ * @param {es3fShaderMatrixTest.MatrixOp} op
+ * @return {boolean}
+ */
+ es3fShaderMatrixTest.isOperationArithmeticMatrixMatrix = function (op) {
+ return op == es3fShaderMatrixTest.MatrixOp.OP_MUL;
+ };
+
+ /**
+ * @param {es3fShaderMatrixTest.MatrixOp} op
+ * @return {boolean}
+ */
+ es3fShaderMatrixTest.isOperationComponentwiseMatrixMatrix = function (op) {
+ return op == es3fShaderMatrixTest.MatrixOp.OP_ADD ||
+ op == es3fShaderMatrixTest.MatrixOp.OP_SUB ||
+ op == es3fShaderMatrixTest.MatrixOp.OP_MUL ||
+ op == es3fShaderMatrixTest.MatrixOp.OP_DIV ||
+ op == es3fShaderMatrixTest.MatrixOp.OP_COMP_MUL;
+ };
+
+ /**
+ * @param {es3fShaderMatrixTest.MatrixOp} op
+ * @return {boolean}
+ */
+ es3fShaderMatrixTest.isOperationVectorVector = function (op) {
+ return op == es3fShaderMatrixTest.MatrixOp.OP_OUTER_PRODUCT;
+ };
+
+ /**
+ * @param {es3fShaderMatrixTest.MatrixOp} op
+ * @return {boolean}
+ */
+ es3fShaderMatrixTest.isOperationUnaryAnyMatrix = function (op) {
+ return op == es3fShaderMatrixTest.MatrixOp.OP_TRANSPOSE ||
+ op == es3fShaderMatrixTest.MatrixOp.OP_UNARY_PLUS ||
+ op == es3fShaderMatrixTest.MatrixOp.OP_NEGATION ||
+ op == es3fShaderMatrixTest.MatrixOp.OP_PRE_INCREMENT ||
+ op == es3fShaderMatrixTest.MatrixOp.OP_PRE_DECREMENT ||
+ op == es3fShaderMatrixTest.MatrixOp.OP_POST_INCREMENT ||
+ op == es3fShaderMatrixTest.MatrixOp.OP_POST_DECREMENT;
+ };
+
+ /**
+ * @param {es3fShaderMatrixTest.MatrixOp} op
+ * @return {boolean}
+ */
+ es3fShaderMatrixTest.isOperationUnarySymmetricMatrix = function (op) {
+ return op == es3fShaderMatrixTest.MatrixOp.OP_INVERSE ||
+ op == es3fShaderMatrixTest.MatrixOp.OP_DETERMINANT;
+ };
+
+ /**
+ * @param {es3fShaderMatrixTest.MatrixOp} op
+ * @return {boolean}
+ */
+ es3fShaderMatrixTest.isOperationValueModifying = function (op) {
+ return op == es3fShaderMatrixTest.MatrixOp.OP_PRE_INCREMENT ||
+ op == es3fShaderMatrixTest.MatrixOp.OP_PRE_DECREMENT ||
+ op == es3fShaderMatrixTest.MatrixOp.OP_POST_INCREMENT ||
+ op == es3fShaderMatrixTest.MatrixOp.OP_POST_DECREMENT;
+ };
+
+ /**
+ * @param {es3fShaderMatrixTest.MatrixOp} op
+ * @return {boolean}
+ */
+ es3fShaderMatrixTest.isOperationAssignment = function(op) {
+ return op == es3fShaderMatrixTest.MatrixOp.OP_ADD_INTO ||
+ op == es3fShaderMatrixTest.MatrixOp.OP_SUBTRACT_FROM ||
+ op == es3fShaderMatrixTest.MatrixOp.OP_MULTIPLY_INTO ||
+ op == es3fShaderMatrixTest.MatrixOp.OP_DIVIDE_INTO;
+ };
+
+ /**
+ * @param {es3fShaderMatrixTest.MatrixOp} op
+ * @return {boolean}
+ */
+ es3fShaderMatrixTest.isOperationAssignmentAnyMatrix = function(op) {
+ return op == es3fShaderMatrixTest.MatrixOp.OP_ADD_INTO ||
+ op == es3fShaderMatrixTest.MatrixOp.OP_SUBTRACT_FROM ||
+ op == es3fShaderMatrixTest.MatrixOp.OP_DIVIDE_INTO;
+ };
+
+ /**
+ * @param {es3fShaderMatrixTest.MatrixOp} op
+ * @return {boolean}
+ */
+ es3fShaderMatrixTest.isOperationAssignmentSymmetricMatrix = function(op) {
+ return op == es3fShaderMatrixTest.MatrixOp.OP_MULTIPLY_INTO;
+ };
+
+ // Operation nature
+
+ /**
+ * @enum
+ */
+ es3fShaderMatrixTest.OperationNature = {
+ OPERATIONNATURE_PURE: 0,
+ OPERATIONNATURE_MUTATING: 1,
+ OPERATIONNATURE_ASSIGNMENT: 2
+ };
+
+ /**
+ * @param {es3fShaderMatrixTest.MatrixOp} op
+ * @return {es3fShaderMatrixTest.OperationNature}
+ */
+ es3fShaderMatrixTest.getOperationNature = function (op) {
+ if (es3fShaderMatrixTest.isOperationAssignment(op))
+ return es3fShaderMatrixTest.OperationNature.OPERATIONNATURE_ASSIGNMENT;
+ if (es3fShaderMatrixTest.isOperationValueModifying(op))
+ return es3fShaderMatrixTest.OperationNature.OPERATIONNATURE_MUTATING;
+ return es3fShaderMatrixTest.OperationNature.OPERATIONNATURE_PURE;
+ };
+
+ // Input value loader.
+ /**
+ * @param {es3fShaderMatrixTest.InputType} inputType
+ * @param {gluShaderUtil.DataType} typeFormat
+ * @param {glsShaderRenderCase.ShaderEvalContext} evalCtx
+ * @param {number} inputNdx
+ * @return {Array<number>|tcuMatrix.Matrix|number}
+ */
+ es3fShaderMatrixTest.getInputValue = function (inputType, typeFormat, evalCtx, inputNdx) {
+ if (inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_CONST) {
+ switch (typeFormat) {
+ case gluShaderUtil.DataType.FLOAT:
+ return s_constInFloat[inputNdx];
+ case gluShaderUtil.DataType.FLOAT_VEC2:
+ return s_constInVec2[inputNdx];
+ case gluShaderUtil.DataType.FLOAT_VEC3:
+ return s_constInVec3[inputNdx];
+ case gluShaderUtil.DataType.FLOAT_VEC4:
+ return s_constInVec4[inputNdx];
+ case gluShaderUtil.DataType.FLOAT_MAT2:
+ return tcuMatrix.matrixFromDataArray(2, 2, s_constInMat2x2[inputNdx]);
+ case gluShaderUtil.DataType.FLOAT_MAT2X3:
+ return tcuMatrix.matrixFromDataArray(3, 2, s_constInMat2x3[inputNdx]);
+ case gluShaderUtil.DataType.FLOAT_MAT2X4:
+ return tcuMatrix.matrixFromDataArray(4, 2, s_constInMat2x4[inputNdx]);
+ case gluShaderUtil.DataType.FLOAT_MAT3X2:
+ return tcuMatrix.matrixFromDataArray(2, 3, s_constInMat3x2[inputNdx]);
+ case gluShaderUtil.DataType.FLOAT_MAT3:
+ return tcuMatrix.matrixFromDataArray(3, 3, s_constInMat3x3[inputNdx]);
+ case gluShaderUtil.DataType.FLOAT_MAT3X4:
+ return tcuMatrix.matrixFromDataArray(4, 3, s_constInMat3x4[inputNdx]);
+ case gluShaderUtil.DataType.FLOAT_MAT4X2:
+ return tcuMatrix.matrixFromDataArray(2, 4, s_constInMat4x2[inputNdx]);
+ case gluShaderUtil.DataType.FLOAT_MAT4X3:
+ return tcuMatrix.matrixFromDataArray(3, 4, s_constInMat4x3[inputNdx]);
+ case gluShaderUtil.DataType.FLOAT_MAT4:
+ return tcuMatrix.matrixFromDataArray(4, 4, s_constInMat4x4[inputNdx]);
+ }
+ } else if (inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC) {
+ switch (typeFormat) {
+ case gluShaderUtil.DataType.FLOAT:
+ return evalCtx.coords[0];
+ case gluShaderUtil.DataType.FLOAT_VEC2:
+ return deMath.swizzle(evalCtx.coords, [0, 1]);
+ case gluShaderUtil.DataType.FLOAT_VEC3:
+ return deMath.swizzle(evalCtx.coords, [0, 1, 2]);
+ case gluShaderUtil.DataType.FLOAT_VEC4:
+ return deMath.swizzle(evalCtx.coords, [0, 1, 2, 3]);
+ case gluShaderUtil.DataType.FLOAT_MAT2:
+ var m = new tcuMatrix.Matrix(2, 2);
+ m.setCol(0, deMath.swizzle(evalCtx.in_[0], [0, 1]));
+ m.setCol(1, deMath.swizzle(evalCtx.in_[1], [0, 1]));
+ return m;
+ case gluShaderUtil.DataType.FLOAT_MAT2X3:
+ var m = new tcuMatrix.Matrix(3, 2);
+ m.setCol(0, deMath.swizzle(evalCtx.in_[0], [0, 1, 2]));
+ m.setCol(1, deMath.swizzle(evalCtx.in_[1], [0, 1, 2]));
+ return m;
+ case gluShaderUtil.DataType.FLOAT_MAT2X4:
+ var m = new tcuMatrix.Matrix(4, 2);
+ m.setCol(0, deMath.swizzle(evalCtx.in_[0], [0, 1, 2, 3]));
+ m.setCol(1, deMath.swizzle(evalCtx.in_[1], [0, 1, 2, 3]));
+ return m;
+ case gluShaderUtil.DataType.FLOAT_MAT3X2:
+ var m = new tcuMatrix.Matrix(2, 3);
+ m.setCol(0, deMath.swizzle(evalCtx.in_[0], [0, 1]));
+ m.setCol(1, deMath.swizzle(evalCtx.in_[1], [0, 1]));
+ m.setCol(2, deMath.swizzle(evalCtx.in_[2], [0, 1]));
+ return m;
+ case gluShaderUtil.DataType.FLOAT_MAT3:
+ var m = new tcuMatrix.Matrix(3, 3);
+ m.setCol(0, deMath.swizzle(evalCtx.in_[0], [0, 1, 2]));
+ m.setCol(1, deMath.swizzle(evalCtx.in_[1], [0, 1, 2]));
+ m.setCol(2, deMath.swizzle(evalCtx.in_[2], [0, 1, 2]));
+ return m;
+ case gluShaderUtil.DataType.FLOAT_MAT3X4:
+ var m = new tcuMatrix.Matrix(4, 3);
+ m.setCol(0, evalCtx.in_[0]);
+ m.setCol(1, evalCtx.in_[1]);
+ m.setCol(2, evalCtx.in_[2]);
+ return m;
+ case gluShaderUtil.DataType.FLOAT_MAT4X2:
+ var m = new tcuMatrix.Matrix(2, 4);
+ m.setCol(0, deMath.swizzle(evalCtx.in_[0], [0, 1]));
+ m.setCol(1, deMath.swizzle(evalCtx.in_[1], [0, 1]));
+ m.setCol(2, deMath.swizzle(evalCtx.in_[2], [0, 1]));
+ m.setCol(3, deMath.swizzle(evalCtx.in_[3], [0, 1]));
+ return m;
+ case gluShaderUtil.DataType.FLOAT_MAT4X3:
+ var m = new tcuMatrix.Matrix(3, 4);
+ m.setCol(0, deMath.swizzle(evalCtx.in_[0], [0, 1, 2]));
+ m.setCol(1, deMath.swizzle(evalCtx.in_[1], [0, 1, 2]));
+ m.setCol(2, deMath.swizzle(evalCtx.in_[2], [0, 1, 2]));
+ m.setCol(3, deMath.swizzle(evalCtx.in_[3], [0, 1, 2]));
+ return m;
+ case gluShaderUtil.DataType.FLOAT_MAT4:
+ var m = new tcuMatrix.Matrix(4, 4);
+ m.setCol(0, evalCtx.in_[0]);
+ m.setCol(1, evalCtx.in_[1]);
+ m.setCol(2, evalCtx.in_[2]);
+ m.setCol(3, evalCtx.in_[3]);
+ return m;
+ }
+ }
+ throw new Error('Invalid input type');
+ };
+
+ /**
+ * @param {Array<number>} value
+ * @return {Array<number>}
+ */
+ es3fShaderMatrixTest.reduceVecToVec3 = function (value) {
+ if (value.length == 3) {
+ return value;
+ } else if (value.length == 2) {
+ return deMath.swizzle(value, [0, 1, 0])
+ } else {
+ return [value[0], value[1], value[2] + value[3]];
+ }
+ };
+
+ /**
+ * @param {tcuMatrix.Matrix} value
+ * @return {Array<number>}
+ */
+ es3fShaderMatrixTest.reduceMatToVec3 = function (value) {
+ if (value.cols == 2) {
+ if (value.rows == 2) {
+ // mat2
+ return [value.get(0, 0), value.get(0, 1), value.get(1, 0) + value.get(1, 1)];
+ } else if (value.rows == 3){
+ //mat2x3
+ return deMath.add(value.getColumn(0), value.getColumn(1));
+ } else {
+ //mat2x4
+ return deMath.add(deMath.swizzle(value.getColumn(0), [0, 1, 2]), deMath.swizzle(value.getColumn(1), [1, 2, 3]));
+ }
+ } else if (value.cols == 3) {
+ if (value.rows == 2) {
+ return [value.get(0, 0) + value.get(1, 0), value.get(0, 1) + value.get(1, 1), value.get(0, 2) + value.get(1, 2)];
+ } else if (value.rows == 3) {
+ return deMath.add(deMath.add(value.getColumn(0), value.getColumn(1)), value.getColumn(2));
+ } else {
+ return deMath.add(deMath.add(deMath.swizzle(value.getColumn(0), [0, 1, 2]), deMath.swizzle(value.getColumn(1), [1, 2, 3])), deMath.swizzle(value.getColumn(2), [2, 3, 0]))
+ }
+ } else {
+ if (value.rows == 2) {
+ return [value.get(0, 0) + value.get(1, 0) + value.get(0, 3), value.get(0, 1) + value.get(1, 1) + value.get(1, 3), value.get(0, 2) + value.get(1, 2)];
+ } else if (value.rows == 3) {
+ return deMath.add(deMath.add(deMath.add(value.getColumn(0), value.getColumn(1)), value.getColumn(2)), value.getColumn(3));
+ } else {
+ return deMath.add(deMath.add(deMath.add(deMath.swizzle(value.getColumn(0), [0, 1, 2]), deMath.swizzle(value.getColumn(1), [1, 2, 3])), deMath.swizzle(value.getColumn(2), [2, 3, 0])), deMath.swizzle(value.getColumn(3), [3, 0, 1]));
+ }
+ }
+ };
+
+ /**
+ * @param {Array<number>|tcuMatrix.Matrix|number} value
+ * @return {Array<number>}
+ */
+ es3fShaderMatrixTest.reduceToVec3 = function (value) {
+ if (value instanceof tcuMatrix.Matrix)
+ return es3fShaderMatrixTest.reduceMatToVec3(value);
+ else if (value instanceof Array)
+ return es3fShaderMatrixTest.reduceVecToVec3(value);
+ else
+ throw new Error('Impossible case');
+ };
+
+ es3fShaderMatrixTest.add = function (a, b) {
+ if (a instanceof tcuMatrix.Matrix) {
+ if (b instanceof tcuMatrix.Matrix)
+ return tcuMatrix.add(a, b);
+ else if (b instanceof Array)
+ throw new Error('Unimplemented');
+ else
+ return tcuMatrix.addMatScal(a, b);
+ }
+ else {
+ if (b instanceof tcuMatrix.Matrix)
+ throw new Error('Unimplemented');
+ else
+ return deMath.add(a, b);
+ }
+ };
+
+ es3fShaderMatrixTest.subtract = function (a, b) {
+ if (a instanceof tcuMatrix.Matrix) {
+ if (b instanceof tcuMatrix.Matrix)
+ return tcuMatrix.subtract(a, b);
+ else if (b instanceof Array)
+ throw new Error('Unimplemented');
+ else
+ return tcuMatrix.subtractMatScal(a, b);
+ }
+ else {
+ if (b instanceof tcuMatrix.Matrix)
+ throw new Error('Unimplemented');
+ else
+ return deMath.subtract(a, b);
+ }
+ };
+
+ es3fShaderMatrixTest.multiply = function (a, b) {
+ if (a instanceof tcuMatrix.Matrix) {
+ if (b instanceof tcuMatrix.Matrix)
+ return tcuMatrix.multiply(a, b);
+ else if (b instanceof Array)
+ return tcuMatrix.multiplyMatVec(a, b);
+ else
+ return tcuMatrix.multiplyMatScal(a, b);
+ } else {
+ if (b instanceof tcuMatrix.Matrix)
+ return tcuMatrix.multiplyVecMat(a, b);
+ else
+ return deMath.multiply(a, b);
+ }
+ };
+
+ es3fShaderMatrixTest.divide = function (a, b) {
+ if (a instanceof tcuMatrix.Matrix) {
+ if (b instanceof tcuMatrix.Matrix)
+ return tcuMatrix.divide(a, b);
+ else if (b instanceof Array)
+ throw new Error('Unimplemented');
+ else
+ return tcuMatrix.divideMatScal(a, b);
+ }
+ else {
+ if (b instanceof tcuMatrix.Matrix)
+ throw new Error('Unimplemented');
+ else
+ return deMath.divide(a, b);
+ }
+ };
+
+
+ /**
+ * @param {tcuMatrix.Matrix} a
+ * @param {tcuMatrix.Matrix} b
+ * @return {tcuMatrix.Matrix}
+ */
+ es3fShaderMatrixTest.matrixCompMult = function (a, b) {
+ /** @type {tcuMatrix.Matrix} */ var retVal = new tcuMatrix.Matrix(a.rows, a.cols);
+
+ for (var r = 0; r < a.rows; ++r) {
+ for (var c = 0; c < a.cols; ++c) {
+ retVal.set(r, c, a.get(r, c) * b.get(r, c));
+ }
+ }
+ return retVal;
+ };
+
+ /**
+ * @param {tcuMatrix.Matrix} mat
+ * @return {tcuMatrix.Matrix}
+ */
+ es3fShaderMatrixTest.transpose = function (mat) {
+ /** @type {tcuMatrix.Matrix} */ var retVal = new tcuMatrix.Matrix(mat.cols, mat.rows);
+
+ for (var r = 0; r < mat.rows; ++r) {
+ for (var c = 0; c < mat.cols; ++c) {
+ retVal.set(c, r, mat.get(r, c));
+ }
+ }
+
+ return retVal;
+ };
+
+ /**
+ * @param {tcuMatrix.Matrix} mat
+ * @return {number}
+ */
+ es3fShaderMatrixTest.determinantMat2 = function (mat) {
+ return mat.get(0, 0) * mat.get(1, 1) - mat.get(1, 0) * mat.get(0,1);
+ };
+
+ /**
+ * @param {tcuMatrix.Matrix} mat
+ * @return {number}
+ */
+ es3fShaderMatrixTest.determinantMat3 = function (mat) {
+ return + mat.get(0, 0) * mat.get(1, 1) * mat.get(2, 2)
+ + mat.get(0, 1) * mat.get(1, 2) * mat.get(2, 0)
+ + mat.get(0, 2) * mat.get(1, 0) * mat.get(2, 1)
+ - mat.get(0, 0) * mat.get(1, 2) * mat.get(2, 1)
+ - mat.get(0, 1) * mat.get(1, 0) * mat.get(2, 2)
+ - mat.get(0, 2) * mat.get(1, 1) * mat.get(2, 0);
+ };
+
+ /**
+ * @param {tcuMatrix.Matrix} mat
+ * @return {number}
+ */
+ es3fShaderMatrixTest.determinantMat4 = function (mat) {
+ /** @type {Array<Array<number>>} */ var minorMatrices = [
+ [
+ mat.get(1, 1), mat.get(2, 1), mat.get(3, 1),
+ mat.get(1, 2), mat.get(2, 2), mat.get(3, 2),
+ mat.get(1, 3), mat.get(2, 3), mat.get(3, 3)
+ ],
+ [
+ mat.get(1, 0), mat.get(2, 0), mat.get(3, 0),
+ mat.get(1, 2), mat.get(2, 2), mat.get(3, 2),
+ mat.get(1, 3), mat.get(2, 3), mat.get(3, 3)
+ ],
+ [
+ mat.get(1, 0), mat.get(2, 0), mat.get(3, 0),
+ mat.get(1, 1), mat.get(2, 1), mat.get(3, 1),
+ mat.get(1, 3), mat.get(2, 3), mat.get(3, 3)
+ ],
+ [
+ mat.get(1, 0), mat.get(2, 0), mat.get(3, 0),
+ mat.get(1, 1), mat.get(2, 1), mat.get(3, 1),
+ mat.get(1, 2), mat.get(2, 2), mat.get(3, 2)
+ ]
+ ];
+
+ return + mat.get(0, 0) * es3fShaderMatrixTest.determinant(tcuMatrix.matrixFromDataArray(3, 3, minorMatrices[0]))
+ - mat.get(0, 1) * es3fShaderMatrixTest.determinant(tcuMatrix.matrixFromDataArray(3, 3, minorMatrices[1]))
+ + mat.get(0, 2) * es3fShaderMatrixTest.determinant(tcuMatrix.matrixFromDataArray(3, 3, minorMatrices[2]))
+ - mat.get(0, 3) * es3fShaderMatrixTest.determinant(tcuMatrix.matrixFromDataArray(3, 3, minorMatrices[3]));
+ };
+
+ /**
+ * @param {tcuMatrix.Matrix} mat
+ * @return {number}
+ */
+ es3fShaderMatrixTest.determinant = function (mat) {
+ if (mat.rows == 2) {
+ return es3fShaderMatrixTest.determinantMat2(mat);
+ } else if (mat.rows == 3) {
+ return es3fShaderMatrixTest.determinantMat3(mat);
+ } else {
+ return es3fShaderMatrixTest.determinantMat4(mat);
+ }
+ };
+
+ /**
+ * @param {tcuMatrix.Matrix} mat
+ * @return {tcuMatrix.Matrix}
+ */
+ es3fShaderMatrixTest.inverseMat2 = function (mat) {
+ /** @type {number} */ var det = es3fShaderMatrixTest.determinant(mat);
+ /** @type {tcuMatrix.Matrix} */ var retVal = new tcuMatrix.Mat2();
+
+ if (det == 0.0) {
+ throw new Error('Wrong determinant')
+ }
+
+ retVal.set(0, 0, mat.get(1, 1) / det);
+ retVal.set(0, 1, -mat.get(0, 1) / det);
+ retVal.set(1, 0, -mat.get(1, 0) / det);
+ retVal.set(1, 1, mat.get(0, 0) / det);
+
+ return retVal;
+ };
+
+ /**
+ * @param {tcuMatrix.Matrix} mat
+ * @return {tcuMatrix.Matrix}
+ */
+ es3fShaderMatrixTest.inverseMat3 = function (mat) {
+ if (es3fShaderMatrixTest.determinant(mat) == 0.0) {
+ throw new Error('Wrong determinant')
+ }
+
+ /** @type {Array<number>} */ var areaA = [mat.get(0, 0), mat.get(0, 1), mat.get(1, 0), mat.get(1,1)];
+ /** @type {Array<number>} */ var areaB = [mat.get(0, 2), mat.get(1, 2)];
+ /** @type {Array<number>} */ var areaC = [mat.get(2, 0), mat.get(2, 1)];
+ /** @type {Array<number>} */ var areaD = [mat.get(2,2)];
+
+ /** @type {tcuMatrix.Matrix} */ var invA = es3fShaderMatrixTest.inverse(tcuMatrix.matrixFromDataArray(2, 2, areaA));
+ /** @type {tcuMatrix.Matrix} */ var matB = tcuMatrix.matrixFromDataArray(2, 1, areaB);
+ /** @type {tcuMatrix.Matrix} */ var matC = tcuMatrix.matrixFromDataArray(1, 2, areaC);
+ /** @type {tcuMatrix.Matrix} */ var matD = tcuMatrix.matrixFromDataArray(1, 1, areaD);
+
+ /** @type {tcuMatrix.Matrix} */ var tmp = tcuMatrix.subtract(matD, tcuMatrix.multiply(matC, tcuMatrix.multiply(invA, matB)));
+ /** @type {number} */ var schurComplement = 1.0 / tmp.get(0, 0);
+ /** @type {tcuMatrix.Matrix} */ var zeroMat = new tcuMatrix.Matrix(2, 2, 0);
+
+ /** @type {tcuMatrix.Matrix} */ var blockA = tcuMatrix.add(invA, tcuMatrix.multiply(tcuMatrix.multiply(invA, tcuMatrix.multiply(tcuMatrix.multiplyMatScal(matB, schurComplement), matC)), invA));
+ /** @type {tcuMatrix.Matrix} */ var blockB = tcuMatrix.multiplyMatScal(tcuMatrix.multiply(tcuMatrix.subtract(zeroMat, invA), matB), schurComplement);
+ /** @type {tcuMatrix.Matrix} */ var blockC = tcuMatrix.multiply(matC, tcuMatrix.multiplyMatScal(invA, - schurComplement));
+ /** @type {number} */ var blockD = schurComplement;
+
+ /** @type {Array<number>} */ var result = [
+ blockA.get(0, 0), blockA.get(0, 1), blockB.get(0, 0),
+ blockA.get(1, 0), blockA.get(1, 1), blockB.get(1, 0),
+ blockC.get(0, 0), blockC.get(0, 1), blockD
+ ];
+
+ return tcuMatrix.matrixFromDataArray(3, 3, result);
+ }
+
+ /**
+ * @param {tcuMatrix.Matrix} mat
+ * @return {tcuMatrix.Matrix}
+ */
+ es3fShaderMatrixTest.inverseMat4 = function (mat) {
+ // Blockwise inversion
+ if (es3fShaderMatrixTest.determinant(mat) == 0.0) {
+ throw new Error('Wrong determinant')
+ }
+
+ /** @type {Array<number>} */ var areaA = [
+ mat.get(0, 0), mat.get(0, 1),
+ mat.get(1, 0), mat.get(1, 1)
+ ];
+ /** @type {Array<number>} */ var areaB = [
+ mat.get(0, 2), mat.get(0, 3),
+ mat.get(1, 2), mat.get(1, 3)
+ ];
+ /** @type {Array<number>} */ var areaC = [
+ mat.get(2, 0), mat.get(2, 1),
+ mat.get(3, 0), mat.get(3, 1)
+ ];
+ /** @type {Array<number>} */ var areaD = [
+ mat.get(2, 2), mat.get(2, 3),
+ mat.get(3, 2), mat.get(3, 3)
+ ];
+
+ /** @type {tcuMatrix.Matrix} */ var invA = es3fShaderMatrixTest.inverse(tcuMatrix.matrixFromDataArray(2, 2, areaA));
+ /** @type {tcuMatrix.Matrix} */ var matB = tcuMatrix.matrixFromDataArray(2, 2, areaB);
+ /** @type {tcuMatrix.Matrix} */ var matC = tcuMatrix.matrixFromDataArray(2, 2, areaC);
+ /** @type {tcuMatrix.Matrix} */ var matD = tcuMatrix.matrixFromDataArray(2, 2, areaD);
+
+ /** @type {tcuMatrix.Matrix} */ var schurComplement = es3fShaderMatrixTest.inverse(tcuMatrix.subtract(matD, (tcuMatrix.multiply(matC, tcuMatrix.multiply(invA, matB)))));
+ /** @type {tcuMatrix.Matrix} */ var zeroMat = new tcuMatrix.Matrix(2, 2, 0);
+
+ /** @type {tcuMatrix.Matrix} */ var blockA = tcuMatrix.add(invA, tcuMatrix.multiply(tcuMatrix.multiply(tcuMatrix.multiply(tcuMatrix.multiply(invA, matB), schurComplement), matC), invA));
+ /** @type {tcuMatrix.Matrix} */ var blockB = tcuMatrix.multiply(tcuMatrix.multiply(tcuMatrix.subtract(zeroMat, invA), matB), schurComplement);
+ /** @type {tcuMatrix.Matrix} */ var blockC = tcuMatrix.multiply(tcuMatrix.multiply(tcuMatrix.subtract(zeroMat, schurComplement),matC), invA);
+ /** @type {tcuMatrix.Matrix} */ var blockD = schurComplement;
+
+ /** @type {Array<number>} */ var result = [
+ blockA.get(0, 0), blockA.get(0, 1), blockB.get(0, 0), blockB.get(0, 1),
+ blockA.get(1, 0), blockA.get(1, 1), blockB.get(1, 0), blockB.get(1, 1),
+ blockC.get(0, 0), blockC.get(0, 1), blockD.get(0, 0), blockD.get(0, 1),
+ blockC.get(1, 0), blockC.get(1, 1), blockD.get(1, 0), blockD.get(1, 1)
+ ];
+
+ return tcuMatrix.matrixFromDataArray(4, 4, result);
+ };
+
+ /**
+ * @param {tcuMatrix.Matrix} mat
+ * @return {tcuMatrix.Matrix}
+ */
+ es3fShaderMatrixTest.inverse = function (mat) {
+ if (mat.cols == 2) {
+ return es3fShaderMatrixTest.inverseMat2(mat)
+ } else if (mat.cols == 3) {
+ return es3fShaderMatrixTest.inverseMat3(mat)
+ } else {
+ return es3fShaderMatrixTest.inverseMat4(mat)
+ }
+ };
+
+ /**
+ * @param {tcuMatrix.Matrix} mat
+ * @return {tcuMatrix.Matrix}
+ */
+ es3fShaderMatrixTest.negate = function (mat) {
+ /** @type {tcuMatrix.Matrix} */ var retVal = new tcuMatrix.Matrix(mat.rows, mat.cols);
+
+ for (var r = 0; r < mat.rows; ++r)
+ for (var c = 0; c < mat.cols; ++c)
+ retVal.set(r,c, -mat.get(r, c));
+
+ return retVal;
+ };
+
+ /**
+ * @param {tcuMatrix.Matrix} mat
+ * @return {tcuMatrix.Matrix}
+ */
+ es3fShaderMatrixTest.increment = function (mat) {
+ /** @type {tcuMatrix.Matrix} */ var retVal = new tcuMatrix.Matrix(mat.rows, mat.cols);
+
+ for (var r = 0; r < mat.rows; ++r)
+ for (var c = 0; c < mat.cols; ++c)
+ retVal.set(r,c, mat.get(r, c) + 1.0);
+
+ return retVal;
+ };
+
+ /**
+ * @param {tcuMatrix.Matrix} mat
+ * @return {tcuMatrix.Matrix}
+ */
+ es3fShaderMatrixTest.decrement = function (mat) {
+ /** @type {tcuMatrix.Matrix} */ var retVal = new tcuMatrix.Matrix(mat.rows, mat.cols);
+
+ for (var r = 0; r < mat.rows; ++r)
+ for (var c = 0; c < mat.cols; ++c)
+ retVal.set(r,c, mat.get(r, c) - 1.0);
+
+ return retVal;
+ };
+
+ /**
+ * @param {Array<number>} a
+ * @param {Array<number>} b
+ * @return {tcuMatrix.Matrix}
+ */
+ es3fShaderMatrixTest.outerProduct = function (a, b) {
+ /** @type {tcuMatrix.Matrix} */ var retVal = new tcuMatrix.Matrix(b.length, a.length);
+
+ for (var r = 0; r < b.length; ++r) {
+ for (var c = 0; c < a.length; ++c) {
+ retVal.set(r, c, a[c] * b[r]);
+ }
+ }
+
+ return es3fShaderMatrixTest.transpose(retVal);
+ };
+
+ /**
+ * @enum
+ */
+ es3fShaderMatrixTest.InputType = {
+ INPUTTYPE_CONST: 0,
+ INPUTTYPE_UNIFORM: 1,
+ INPUTTYPE_DYNAMIC: 2
+ };
+
+ /**
+ * @enum
+ */
+ es3fShaderMatrixTest.MatrixOp = {
+ OP_ADD: 0,
+ OP_SUB: 1,
+ OP_MUL: 2,
+ OP_DIV: 3,
+ OP_COMP_MUL: 4,
+ OP_OUTER_PRODUCT: 5,
+ OP_TRANSPOSE: 6,
+ OP_INVERSE: 7,
+ OP_DETERMINANT: 8,
+ OP_UNARY_PLUS: 9,
+ OP_NEGATION: 10,
+ OP_PRE_INCREMENT: 11,
+ OP_PRE_DECREMENT: 12,
+ OP_POST_INCREMENT: 13,
+ OP_POST_DECREMENT: 14,
+ OP_ADD_INTO: 15,
+ OP_SUBTRACT_FROM: 16,
+ OP_MULTIPLY_INTO: 17,
+ OP_DIVIDE_INTO: 18,
+ OP_LAST: 19
+ };
+
+ /**
+ * @constructor
+ * @param {es3fShaderMatrixTest.InputType=} inputType_
+ * @param {gluShaderUtil.DataType=} dataType_
+ * @param {gluShaderUtil.precision=} precision_
+ * @struct
+ */
+ es3fShaderMatrixTest.ShaderInput = function (inputType_, dataType_, precision_){
+ this.inputType = inputType_ || es3fShaderMatrixTest.InputType.INPUTTYPE_CONST;
+ this.dataType = dataType_ || gluShaderUtil.DataType.INVALID;
+ this.precision = precision_ || gluShaderUtil.precision.PRECISION_LOWP;
+ };
+
+ /**
+ * @param {es3fShaderMatrixTest.ShaderInput} in0
+ * @param {es3fShaderMatrixTest.ShaderInput} in1
+ * @param {es3fShaderMatrixTest.MatrixOp} op
+ */
+ es3fShaderMatrixTest.getEvalFunc = function (in0, in1, op) {
+ var setColor = function(evalCtx, src) {
+ for (var i = 0; i < 3; i++)
+ evalCtx.color[i] = src[i];
+ };
+ switch(op){
+ case es3fShaderMatrixTest.MatrixOp.OP_ADD:
+ return function (evalCtx) {
+ var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ?
+ es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0)
+ : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0);
+ var in1_ = in1.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ?
+ es3fShaderMatrixTest.getInputValue(in1.inputType, in1.dataType, evalCtx, 1)
+ : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in1.dataType, evalCtx, 1);
+
+ setColor(evalCtx, es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.add(in0_, in1_)));
+ };
+ case es3fShaderMatrixTest.MatrixOp.OP_SUB:
+ return function (evalCtx) {
+ var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ?
+ es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0)
+ : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0);
+ var in1_ = in1.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ?
+ es3fShaderMatrixTest.getInputValue(in1.inputType, in1.dataType, evalCtx, 1)
+ : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in1.dataType, evalCtx, 1);
+
+ setColor(evalCtx, es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.subtract(in0_, in1_)));
+ };
+ case es3fShaderMatrixTest.MatrixOp.OP_MUL:
+ return function (evalCtx) {
+ var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ?
+ es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0)
+ : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0);
+ var in1_ = in1.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ?
+ es3fShaderMatrixTest.getInputValue(in1.inputType, in1.dataType, evalCtx, 1)
+ : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in1.dataType, evalCtx, 1);
+
+ setColor(evalCtx, es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.multiply(in0_, in1_)));
+ };
+ case es3fShaderMatrixTest.MatrixOp.OP_DIV:
+ return function (evalCtx) {
+ var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ?
+ es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0)
+ : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0);
+ var in1_ = in1.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ?
+ es3fShaderMatrixTest.getInputValue(in1.inputType, in1.dataType, evalCtx, 1)
+ : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in1.dataType, evalCtx, 1);
+
+ setColor(evalCtx, es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.divide(in0_, in1_)));
+ };
+ case es3fShaderMatrixTest.MatrixOp.OP_COMP_MUL:
+ return function (evalCtx) {
+ var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ?
+ es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0)
+ : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0);
+ var in1_ = in1.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ?
+ es3fShaderMatrixTest.getInputValue(in1.inputType, in1.dataType, evalCtx, 1)
+ : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in1.dataType, evalCtx, 1);
+
+ setColor(evalCtx, es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.matrixCompMult(/** @type {tcuMatrix.Matrix} */(in0_), /** @type {tcuMatrix.Matrix} */(in1_))));
+ };
+ case es3fShaderMatrixTest.MatrixOp.OP_OUTER_PRODUCT:
+ return function (evalCtx) {
+ var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ?
+ es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0)
+ : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0);
+ var in1_ = in1.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ?
+ es3fShaderMatrixTest.getInputValue(in1.inputType, in1.dataType, evalCtx, 1)
+ : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in1.dataType, evalCtx, 1);
+
+ setColor(evalCtx, es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.outerProduct(/** @type {Array<number>} */(in0_), /** @type {Array<number>} */(in1_))));
+ };
+ case es3fShaderMatrixTest.MatrixOp.OP_TRANSPOSE:
+ return function (evalCtx) {
+ var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ?
+ es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0)
+ : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0);
+
+ setColor(evalCtx, es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.transpose(/** @type {tcuMatrix.Matrix} */(in0_))));
+ };
+ case es3fShaderMatrixTest.MatrixOp.OP_INVERSE:
+ return function (evalCtx) {
+ var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ?
+ es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0)
+ : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0);
+
+ setColor(evalCtx, es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.inverse(/** @type {tcuMatrix.Matrix} */(in0_))));
+ };
+ case es3fShaderMatrixTest.MatrixOp.OP_DETERMINANT:
+ return function (evalCtx) {
+ var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ?
+ es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0)
+ : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0);
+
+ var det = es3fShaderMatrixTest.determinant(/** @type {tcuMatrix.Matrix} */(in0_));
+ setColor(evalCtx, [det, det, det]);
+ };
+ case es3fShaderMatrixTest.MatrixOp.OP_UNARY_PLUS:
+ return function (evalCtx) {
+ var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ?
+ es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0)
+ : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0);
+
+ setColor(evalCtx, es3fShaderMatrixTest.reduceToVec3(/** @type {tcuMatrix.Matrix} */(in0_)));
+ };
+ case es3fShaderMatrixTest.MatrixOp.OP_NEGATION:
+ return function (evalCtx) {
+ var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ?
+ es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0)
+ : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0);
+
+ setColor(evalCtx, es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.negate(/** @type {tcuMatrix.Matrix} */(in0_))));
+ };
+ case es3fShaderMatrixTest.MatrixOp.OP_PRE_INCREMENT:
+ return function (evalCtx) {
+ var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ?
+ es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0)
+ : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0);
+
+ var val0 = es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.increment(/** @type {tcuMatrix.Matrix} */(in0_)));
+ var val1 = es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.increment(/** @type {tcuMatrix.Matrix} */(in0_)));
+ setColor(evalCtx, deMath.add(val0, val1));
+ };
+ case es3fShaderMatrixTest.MatrixOp.OP_PRE_DECREMENT:
+ return function (evalCtx) {
+ var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ?
+ es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0)
+ : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0);
+
+ var val0 = es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.decrement(/** @type {tcuMatrix.Matrix} */(in0_)));
+ var val1 = es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.decrement(/** @type {tcuMatrix.Matrix} */(in0_)));
+ setColor(evalCtx, deMath.add(val0, val1));
+ };
+ case es3fShaderMatrixTest.MatrixOp.OP_POST_INCREMENT:
+ return function (evalCtx) {
+ var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ?
+ es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0)
+ : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0);
+
+ var val0 = es3fShaderMatrixTest.reduceToVec3((in0_));
+ var val1 = es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.increment(/** @type {tcuMatrix.Matrix} */(in0_)));
+ setColor(evalCtx, deMath.add(val0, val1));
+ };
+ case es3fShaderMatrixTest.MatrixOp.OP_POST_DECREMENT:
+ return function (evalCtx) {
+ var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ?
+ es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0)
+ : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0);
+
+ var val0 = es3fShaderMatrixTest.reduceToVec3((in0_));
+ var val1 = es3fShaderMatrixTest.reduceToVec3(es3fShaderMatrixTest.decrement(/** @type {tcuMatrix.Matrix} */(in0_)));
+ setColor(evalCtx, deMath.add(val0, val1));
+ };
+ case es3fShaderMatrixTest.MatrixOp.OP_ADD_INTO:
+ return function (evalCtx) {
+ var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ?
+ es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0)
+ : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0);
+ var in1_ = in1.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ?
+ es3fShaderMatrixTest.getInputValue(in1.inputType, in0.dataType, evalCtx, 1)
+ : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in1.dataType, evalCtx, 1);
+
+ setColor(evalCtx, es3fShaderMatrixTest.reduceToVec3(tcuMatrix.add(/** @type {tcuMatrix.Matrix} */(in0_), /** @type {tcuMatrix.Matrix} */(in1_))));
+ };
+ case es3fShaderMatrixTest.MatrixOp.OP_SUBTRACT_FROM:
+ return function (evalCtx) {
+ var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ?
+ es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0)
+ : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0);
+ var in1_ = in1.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ?
+ es3fShaderMatrixTest.getInputValue(in1.inputType, in0.dataType, evalCtx, 1)
+ : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in1.dataType, evalCtx, 1);
+
+ setColor(evalCtx, es3fShaderMatrixTest.reduceToVec3(tcuMatrix.subtract(/** @type {tcuMatrix.Matrix} */(in0_), /** @type {tcuMatrix.Matrix} */(in1_))));
+ };
+ case es3fShaderMatrixTest.MatrixOp.OP_MULTIPLY_INTO:
+ return function (evalCtx) {
+ var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ?
+ es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0)
+ : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0);
+ var in1_ = in1.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ?
+ es3fShaderMatrixTest.getInputValue(in1.inputType, in0.dataType, evalCtx, 1)
+ : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in1.dataType, evalCtx, 1);
+
+ setColor(evalCtx, es3fShaderMatrixTest.reduceToVec3(tcuMatrix.multiply(/** @type {tcuMatrix.Matrix} */(in0_), /** @type {tcuMatrix.Matrix} */(in1_))));
+ };
+ case es3fShaderMatrixTest.MatrixOp.OP_DIVIDE_INTO:
+ return function (evalCtx) {
+ var in0_ = in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ?
+ es3fShaderMatrixTest.getInputValue(in0.inputType, in0.dataType, evalCtx, 0)
+ : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in0.dataType, evalCtx, 0);
+ var in1_ = in1.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ?
+ es3fShaderMatrixTest.getInputValue(in1.inputType, in1.dataType, evalCtx, 1)
+ : es3fShaderMatrixTest.getInputValue(es3fShaderMatrixTest.InputType.INPUTTYPE_CONST, in1.dataType, evalCtx, 1);
+
+ setColor(evalCtx, es3fShaderMatrixTest.reduceToVec3(tcuMatrix.divide(/** @type {tcuMatrix.Matrix} */(in0_), /** @type {tcuMatrix.Matrix} */(in1_))));
+ };
+ }
+ };
+
+ /**
+ * @constructor
+ * @param {es3fShaderMatrixTest.MatrixShaderEvalFunc} evalFunc
+ * @param {es3fShaderMatrixTest.InputType} inType0
+ * @param {es3fShaderMatrixTest.InputType} inType1
+ * @extends {glsShaderRenderCase.ShaderEvaluator}
+ */
+ es3fShaderMatrixTest.MatrixShaderEvaluator = function(evalFunc, inType0, inType1) {
+ glsShaderRenderCase.ShaderEvaluator.call(this);
+ this.m_matEvalFunc = evalFunc;
+ this.m_inType0 = inType0;
+ this.m_inType1 = inType1;
+ };
+
+ es3fShaderMatrixTest.MatrixShaderEvaluator.prototype = Object.create(glsShaderRenderCase.ShaderEvaluator);
+ es3fShaderMatrixTest.MatrixShaderEvaluator.prototype.constructor = es3fShaderMatrixTest.MatrixShaderEvaluator;
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} evalCtx
+ */
+ es3fShaderMatrixTest.MatrixShaderEvaluator.prototype.evaluate = function (evalCtx) {
+ this.m_matEvalFunc(evalCtx);
+ }
+
+ /**
+ * @param {Array<number>} v
+ * @param {number} size
+ */
+ es3fShaderMatrixTest.writeVectorConstructor = function (v, size) {
+ var str = 'vec' + size + '';
+ for (var ndx = 0; ndx < size; ndx++) {
+ if (ndx != 0)
+ str += ', ';
+ str += v[ndx].toString;
+ }
+ str += ')';
+ return str;
+ }
+
+ /**
+ * @param {tcuMatrix.Matrix} m
+ */
+ es3fShaderMatrixTest.writeMatrixConstructor = function (m) {
+ var str = '';
+ if (m.rows == m.cols)
+ str += 'mat' + m.cols;
+ else
+ str += 'mat' + m.cols + 'x' + m.rows;
+
+ str += '(';
+ for (var colNdx = 0; colNdx < m.cols; colNdx++) {
+ for (var rowNdx = 0; rowNdx < m.rows; rowNdx++) {
+ if (rowNdx > 0 || colNdx > 0)
+ str += ', ';
+ str += m.get(rowNdx, colNdx).toString();
+ }
+ }
+ str += ')';
+ return str;
+ };
+
+ /**
+ * @constructor
+ * @param {string} name
+ * @param {string} desc
+ * @param {es3fShaderMatrixTest.ShaderInput} in0
+ * @param {es3fShaderMatrixTest.ShaderInput} in1
+ * @param {es3fShaderMatrixTest.MatrixOp} op
+ * @param {boolean} isVertexCase
+ * @extends {glsShaderRenderCase.ShaderRenderCase}
+ */
+ es3fShaderMatrixTest.ShaderMatrixCase = function(name, desc, in0, in1, op, isVertexCase) {
+ var evalFunc = es3fShaderMatrixTest.getEvalFunc(in0, in1, op);
+ glsShaderRenderCase.ShaderRenderCase.call(this, name, desc, isVertexCase, evalFunc);
+ this.m_in0 = in0;
+ this.m_in1 = in1;
+ this.m_op = op;
+ this.m_evaluator = new es3fShaderMatrixTest.MatrixShaderEvaluator(evalFunc, in0.inputType, in1.inputType);
+ };
+
+ es3fShaderMatrixTest.ShaderMatrixCase.prototype = Object.create(glsShaderRenderCase.ShaderRenderCase.prototype);
+ es3fShaderMatrixTest.ShaderMatrixCase.prototype.constructor = es3fShaderMatrixTest.ShaderMatrixCase;
+
+
+ es3fShaderMatrixTest.ShaderMatrixCase.prototype.init = function () {
+ var shaderSources = [ '', '' ];
+ var vtx = 0;
+ var frag = 1;
+ var op = this.m_isVertexCase ? vtx : frag;
+
+ /** @type {boolean} */ var isInDynMat0 = gluShaderUtil.isDataTypeMatrix(this.m_in0.dataType) && this.m_in0.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC;
+ /** @type {boolean} */ var isInDynMat1 = gluShaderUtil.isDataTypeMatrix(this.m_in1.dataType) && this.m_in1.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC;
+ /** @type {Array<string>} */ var inValues = [];
+ /** @type {gluShaderUtil.DataType} */ var resultType;
+ /** @type {gluShaderUtil.precision} */ var resultPrec = this.m_in0.precision;
+ /** @type {Array<string>} */ var passVars = [];
+ /** @type {number} */ var numInputs = (es3fShaderMatrixTest.isOperationBinary(this.m_op)) ? (2) : (1);
+
+ /** @type {string} */ var operationValue0 = '';
+ /** @type {string} */ var operationValue1 = '';
+
+ if (isInDynMat0 && isInDynMat1) {
+ throw new Error ('Only single dynamic matrix input is allowed.');
+ }
+
+ if (this.m_op == es3fShaderMatrixTest.MatrixOp.OP_MUL && gluShaderUtil.isDataTypeMatrix(this.m_in0.dataType) && gluShaderUtil.isDataTypeMatrix(this.m_in1.dataType)) {
+ resultType = gluShaderUtil.getDataTypeMatrix(gluShaderUtil.getDataTypeMatrixNumColumns(this.m_in1.dataType), gluShaderUtil.getDataTypeMatrixNumRows(this.m_in0.dataType));
+ } else if (this.m_op == es3fShaderMatrixTest.MatrixOp.OP_OUTER_PRODUCT) {
+ resultType = gluShaderUtil.getDataTypeMatrix(gluShaderUtil.getDataTypeScalarSize(this.m_in1.dataType), gluShaderUtil.getDataTypeScalarSize(this.m_in0.dataType));
+ } else if (this.m_op == es3fShaderMatrixTest.MatrixOp.OP_TRANSPOSE) {
+ resultType = gluShaderUtil.getDataTypeMatrix(gluShaderUtil.getDataTypeMatrixNumRows(this.m_in0.dataType), gluShaderUtil.getDataTypeMatrixNumColumns(this.m_in0.dataType));
+ } else if (this.m_op == es3fShaderMatrixTest.MatrixOp.OP_INVERSE) {
+ resultType = this.m_in0.dataType;
+ } else if (this.m_op == es3fShaderMatrixTest.MatrixOp.OP_DETERMINANT) {
+ resultType = gluShaderUtil.DataType.FLOAT;
+ } else if (es3fShaderMatrixTest.getOperationType(this.m_op) == es3fShaderMatrixTest.OperationType.OPERATIONTYPE_UNARY_PREFIX_OPERATOR ||
+ es3fShaderMatrixTest.getOperationType(this.m_op) == es3fShaderMatrixTest.OperationType.OPERATIONTYPE_UNARY_POSTFIX_OPERATOR) {
+ resultType = this.m_in0.dataType;
+ } else if (gluShaderUtil.isDataTypeMatrix(this.m_in0.dataType) && gluShaderUtil.isDataTypeMatrix(this.m_in1.dataType)) {
+ if (this.m_in0.dataType !== this.m_in1.dataType) {
+ throw new Error ('Incompatible data types');
+ }
+ resultType = this.m_in0.dataType;
+ } else if (gluShaderUtil.isDataTypeMatrix(this.m_in0.dataType) || gluShaderUtil.isDataTypeMatrix(this.m_in1.dataType)) {
+ /** @type {number} */ var matNdx = gluShaderUtil.isDataTypeMatrix(this.m_in0.dataType) ? 0 : 1;
+ /** @type {gluShaderUtil.DataType} */ var matrixType = matNdx == 0 ? this.m_in0.dataType : this.m_in1.dataType;
+ /** @type {gluShaderUtil.DataType} */ var otherType = matNdx == 0 ? this.m_in1.dataType : this.m_in0.dataType;
+
+ if (otherType == gluShaderUtil.DataType.FLOAT)
+ resultType = matrixType;
+ else {
+ if (!gluShaderUtil.isDataTypeVector(otherType)) {
+ throw new Error ('Is not data type vector');
+ }
+ resultType = gluShaderUtil.getDataTypeFloatVec(matNdx == 0 ? gluShaderUtil.getDataTypeMatrixNumRows(matrixType) : gluShaderUtil.getDataTypeMatrixNumColumns(matrixType));
+ }
+ } else {
+ throw new Error ('Error');
+ }
+
+ shaderSources[vtx] += '#version 300 es\n';
+ shaderSources[frag] += '#version 300 es\n';
+
+ shaderSources[vtx] += 'in highp vec4 a_position;\n';
+ shaderSources[frag] += 'layout(location = 0) out mediump vec4 dEQP_FragColor;\n';
+ if (this.m_isVertexCase) {
+ shaderSources[vtx] += 'out mediump vec4 v_color;\n';
+ shaderSources[frag] += 'in mediump vec4 v_color;\n';
+ }
+
+ // Input declarations.
+ for (var inNdx = 0; inNdx < numInputs; inNdx++) {
+ /** @type {es3fShaderMatrixTest.ShaderInput} */ var ind = inNdx > 0 ? this.m_in1 : this.m_in0;
+ /** @type {string} */ var precName = gluShaderUtil.getPrecisionName(ind.precision);
+ /** @type {string} */ var typeName = gluShaderUtil.getDataTypeName(ind.dataType);
+ /** @type {number} */ var inValueNdx = inNdx > 0 ? 1 : 0;
+
+ if (ind.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC) {
+ shaderSources[vtx] += 'in ' + precName + ' ' + typeName + ' a_';
+
+ if (gluShaderUtil.isDataTypeMatrix(ind.dataType)) {
+ // a_matN, v_matN
+ shaderSources[vtx] += typeName + ';\n';
+ if (!this.m_isVertexCase) {
+ shaderSources[vtx] += 'out ' + precName + ' ' + typeName + ' v_' + typeName + ';\n';
+ shaderSources[frag] += 'in ' + precName + ' ' + typeName + ' v_' + typeName + ';\n';
+ passVars.push(typeName);
+ }
+
+ inValues[inValueNdx] = (this.m_isVertexCase ? 'a_' : 'v_') + gluShaderUtil.getDataTypeName(ind.dataType);
+ } else {
+ // a_coords, v_coords
+ shaderSources[vtx] += 'coords;\n';
+ if (!this.m_isVertexCase) {
+ shaderSources[vtx] += 'out ' + precName + ' ' + typeName + ' v_coords;\n';
+ shaderSources[frag] += 'in ' + precName + ' ' + typeName + ' v_coords;\n';
+ passVars.push('coords');
+ }
+
+ inValues[inValueNdx] = this.m_isVertexCase ? 'a_coords' : 'v_coords';
+ }
+ } else if (ind.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_UNIFORM) {
+ shaderSources[op] += 'uniform ' + precName + ' ' + typeName + ' u_in' + inNdx + ';\n';
+ inValues[inValueNdx] = 'u_in' + inNdx.toString();
+ } else if (ind.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_CONST) {
+ shaderSources[op] += 'const ' + precName + ' ' + typeName + ' in' + inNdx + ' = ';
+
+ // Generate declaration.
+ switch (ind.dataType) {
+ case gluShaderUtil.DataType.FLOAT:
+ shaderSources[op] += s_constInFloat[inNdx].toString();
+ break;
+ case gluShaderUtil.DataType.FLOAT_VEC2:
+ shaderSources[op] += es3fShaderMatrixTest.writeVectorConstructor( s_constInVec2[inNdx], 2);
+ break;
+ case gluShaderUtil.DataType.FLOAT_VEC3:
+ shaderSources[op] += es3fShaderMatrixTest.writeVectorConstructor( s_constInVec3[inNdx], 3);
+ break;
+ case gluShaderUtil.DataType.FLOAT_VEC4:
+ shaderSources[op] += es3fShaderMatrixTest.writeVectorConstructor( s_constInVec4[inNdx], 4);
+ break;
+ case gluShaderUtil.DataType.FLOAT_MAT2:
+ shaderSources[op] += es3fShaderMatrixTest.writeMatrixConstructor( tcuMatrix.matrixFromDataArray(2, 2, s_constInMat2x2[inNdx]));
+ break;
+ case gluShaderUtil.DataType.FLOAT_MAT2X3:
+ shaderSources[op] += es3fShaderMatrixTest.writeMatrixConstructor( tcuMatrix.matrixFromDataArray(3, 2, s_constInMat2x3[inNdx]));
+ break;
+ case gluShaderUtil.DataType.FLOAT_MAT2X4:
+ shaderSources[op] += es3fShaderMatrixTest.writeMatrixConstructor( tcuMatrix.matrixFromDataArray(4, 2, s_constInMat2x4[inNdx]));
+ break;
+ case gluShaderUtil.DataType.FLOAT_MAT3X2:
+ shaderSources[op] += es3fShaderMatrixTest.writeMatrixConstructor( tcuMatrix.matrixFromDataArray(2, 3, s_constInMat3x2[inNdx]));
+ break;
+ case gluShaderUtil.DataType.FLOAT_MAT3:
+ shaderSources[op] += es3fShaderMatrixTest.writeMatrixConstructor( tcuMatrix.matrixFromDataArray(3, 3, s_constInMat3x3[inNdx]));
+ break;
+ case gluShaderUtil.DataType.FLOAT_MAT3X4:
+ shaderSources[op] += es3fShaderMatrixTest.writeMatrixConstructor( tcuMatrix.matrixFromDataArray(4, 3, s_constInMat3x4[inNdx]));
+ break;
+ case gluShaderUtil.DataType.FLOAT_MAT4X2:
+ shaderSources[op] += es3fShaderMatrixTest.writeMatrixConstructor( tcuMatrix.matrixFromDataArray(2, 4, s_constInMat4x2[inNdx]));
+ break;
+ case gluShaderUtil.DataType.FLOAT_MAT4X3:
+ shaderSources[op] += es3fShaderMatrixTest.writeMatrixConstructor( tcuMatrix.matrixFromDataArray(3, 4, s_constInMat4x3[inNdx]));
+ break;
+ case gluShaderUtil.DataType.FLOAT_MAT4:
+ shaderSources[op] += es3fShaderMatrixTest.writeMatrixConstructor( tcuMatrix.matrixFromDataArray(4, 4, s_constInMat4x4[inNdx]));
+ break;
+
+ default:
+ throw new Error('Data type error');
+ }
+
+ shaderSources[op] += ';\n';
+
+ inValues[inValueNdx] = 'in' + inNdx.toString();
+ }
+ }
+
+ shaderSources[vtx] += '\n'
+ + 'void main (void)\n'
+ + '{\n'
+ + ' gl_Position = a_position;\n';
+ shaderSources[frag] += '\n'
+ + 'void main (void)\n'
+ + '{\n';
+
+ if (this.m_isVertexCase)
+ shaderSources[frag] += ' dEQP_FragColor = v_color;\n';
+ else {
+ for (var i = 0; i != passVars.length; i++)
+ shaderSources[vtx] += ' v_' + passVars[i] + ' = ' + 'a_' + passVars[i] + ';\n';
+ }
+
+ // Operation.
+
+ switch (es3fShaderMatrixTest.getOperationNature(this.m_op)) {
+ case es3fShaderMatrixTest.OperationNature.OPERATIONNATURE_PURE:
+ if (es3fShaderMatrixTest.getOperationType(this.m_op) == es3fShaderMatrixTest.OperationType.OPERATIONTYPE_ASSIGNMENT)
+ throw new Error('Wrong operation type');
+
+ operationValue0 = inValues[0];
+ operationValue1 = inValues[1];
+ break;
+
+ case es3fShaderMatrixTest.OperationNature.OPERATIONNATURE_MUTATING:
+ if (es3fShaderMatrixTest.getOperationType(this.m_op) == es3fShaderMatrixTest.OperationType.OPERATIONTYPE_ASSIGNMENT)
+ throw new Error('Wrong operation type');
+
+ shaderSources[op] += ' ' + gluShaderUtil.getPrecisionName(resultPrec) + ' ' + gluShaderUtil.getDataTypeName(resultType) + ' tmpValue = ' + inValues[0] + ';\n';
+
+ operationValue0 = 'tmpValue';
+ operationValue1 = inValues[1];
+ break;
+
+ case es3fShaderMatrixTest.OperationNature.OPERATIONNATURE_ASSIGNMENT:
+ if (es3fShaderMatrixTest.getOperationType(this.m_op) != es3fShaderMatrixTest.OperationType.OPERATIONTYPE_ASSIGNMENT)
+ throw new Error('Wrong operation type');
+
+ operationValue0 = inValues[0];
+ operationValue1 = inValues[1];
+ break;
+
+ default:
+ throw new Error('Wrong operation nature');
+ }
+
+ switch (es3fShaderMatrixTest.getOperationType(this.m_op)) {
+ case es3fShaderMatrixTest.OperationType.OPERATIONTYPE_BINARY_OPERATOR:
+ shaderSources[op] += ' ' + gluShaderUtil.getPrecisionName(resultPrec) + ' '
+ + gluShaderUtil.getDataTypeName(resultType)
+ + ' res = ' + operationValue0 + ' '
+ + es3fShaderMatrixTest.getOperationName(this.m_op) + ' '
+ + operationValue1 + ';\n';
+ break;
+ case es3fShaderMatrixTest.OperationType.OPERATIONTYPE_UNARY_PREFIX_OPERATOR:
+ shaderSources[op] += ' ' + gluShaderUtil.getPrecisionName(resultPrec) + ' '
+ + gluShaderUtil.getDataTypeName(resultType)
+ + ' res = ' + es3fShaderMatrixTest.getOperationName(this.m_op)
+ + operationValue0 + ';\n';
+ break;
+ case es3fShaderMatrixTest.OperationType.OPERATIONTYPE_UNARY_POSTFIX_OPERATOR:
+ shaderSources[op] += ' ' + gluShaderUtil.getPrecisionName(resultPrec) + ' '
+ + gluShaderUtil.getDataTypeName(resultType)
+ + ' res = ' + operationValue0
+ + es3fShaderMatrixTest.getOperationName(this.m_op) + ';\n';
+ break;
+ case es3fShaderMatrixTest.OperationType.OPERATIONTYPE_BINARY_FUNCTION:
+ shaderSources[op] += ' ' + gluShaderUtil.getPrecisionName(resultPrec)
+ + ' ' + gluShaderUtil.getDataTypeName(resultType)
+ + ' res = ' + es3fShaderMatrixTest.getOperationName(this.m_op)
+ + '(' + operationValue0
+ + ', ' + operationValue1 + ');\n';
+ break;
+ case es3fShaderMatrixTest.OperationType.OPERATIONTYPE_UNARY_FUNCTION:
+ shaderSources[op] += ' ' + gluShaderUtil.getPrecisionName(resultPrec)
+ + ' ' + gluShaderUtil.getDataTypeName(resultType)
+ + ' res = ' + es3fShaderMatrixTest.getOperationName(this.m_op)
+ + '(' + operationValue0 + ');\n';
+ break;
+ case es3fShaderMatrixTest.OperationType.OPERATIONTYPE_ASSIGNMENT:
+ shaderSources[op] += ' ' + gluShaderUtil.getPrecisionName(resultPrec)
+ + ' ' + gluShaderUtil.getDataTypeName(resultType)
+ + ' res = ' + operationValue0 + ';\n';
+ shaderSources[op] += ' res ' + es3fShaderMatrixTest.getOperationName(this.m_op)
+ + ' ' + operationValue1 + ';\n';
+ break;
+ default:
+ throw new Error('Wrong operation type');
+ }
+
+ // Reduction to vec3 (rgb). Check the used value too if it was modified
+ shaderSources[op] += ' ' + (this.m_isVertexCase ? 'v_color' : 'dEQP_FragColor') + ' = ';
+
+ if (es3fShaderMatrixTest.isOperationValueModifying(this.m_op))
+ shaderSources[op] += 'vec4(' + this.genGLSLMatToVec3Reduction(resultType, 'res')
+ + ', 1.0) + vec4(' + this.genGLSLMatToVec3Reduction(resultType, 'tmpValue')
+ + ', 0.0);\n';
+ else
+ shaderSources[op] += 'vec4(' + this.genGLSLMatToVec3Reduction(resultType, 'res')
+ + ', 1.0);\n';
+
+ shaderSources[vtx] += '}\n';
+ shaderSources[frag] += '}\n';
+
+ this.m_vertShaderSource = shaderSources[vtx];
+ this.m_fragShaderSource = shaderSources[frag];
+
+ // \todo [2012-02-14 pyry] Compute better values for matrix tests.
+ for (var attribNdx = 0; attribNdx < 4; attribNdx++) {
+ this.m_userAttribTransforms[attribNdx] = new tcuMatrix.Matrix(4, 4, 0);
+ this.m_userAttribTransforms[attribNdx].set(0, 3, 0.2);// !< prevent matrix*vec from going into zero (assuming vec.w != 0)
+ this.m_userAttribTransforms[attribNdx].set(1, 3, 0.1);// !<
+ this.m_userAttribTransforms[attribNdx].set(2, 3, 0.4 + 0.15 * attribNdx);// !<
+ this.m_userAttribTransforms[attribNdx].set(3, 3, 0.7);// !<
+ this.m_userAttribTransforms[attribNdx].set((0 + attribNdx) % 4, 0, 1.0);
+ this.m_userAttribTransforms[attribNdx].set((1 + attribNdx) % 4, 1, 1.0);
+ this.m_userAttribTransforms[attribNdx].set((2 + attribNdx) % 4, 2, 1.0);
+ this.m_userAttribTransforms[attribNdx].set((3 + attribNdx) % 4, 3, 1.0);
+ }
+
+ // prevent bad reference cases such as black result images by fine-tuning used matrices
+ if (es3fShaderMatrixTest.getOperationTestMatrixType(this.m_op) != es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DEFAULT) {
+ for (var attribNdx = 0; attribNdx < 4; attribNdx++) {
+ for (var row = 0; row < 4; row++)
+ for (var col = 0; col < 4; col++) {
+ switch (es3fShaderMatrixTest.getOperationTestMatrixType(this.m_op)) {
+ case es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_NEGATED:
+ this.m_userAttribTransforms[attribNdx].set(row, col, -this.m_userAttribTransforms[attribNdx].get(row, col));
+ break;
+ case es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_INCREMENTED:
+ this.m_userAttribTransforms[attribNdx].set(row, col, this.m_userAttribTransforms[attribNdx].get(row, col) + 0.3);
+ break;
+ case es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_DECREMENTED:
+ this.m_userAttribTransforms[attribNdx].set(row, col, this.m_userAttribTransforms[attribNdx].get(row, col) - 0.3);
+ break;
+ case es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_NEGATED_INCREMENTED:
+ this.m_userAttribTransforms[attribNdx].set(row, col, -(this.m_userAttribTransforms[attribNdx].get(row, col) + 0.3));
+ break;
+ case es3fShaderMatrixTest.MatrixType.TESTMATRIXTYPE_INCREMENTED_LESS:
+ this.m_userAttribTransforms[attribNdx].set(row, col, this.m_userAttribTransforms[attribNdx].get(row, col) - 0.1);
+ break;
+ default:
+ throw new Error('Wrong Matrix type');
+ }
+ }
+ }
+ }
+
+ glsShaderRenderCase.ShaderRenderCase.prototype.init.call(this);
+ };
+
+
+ es3fShaderMatrixTest.ShaderMatrixCase.prototype.setupUniforms = function(programId, constCoords) {
+ for (var inNdx = 0; inNdx < 2; inNdx++)
+ {
+ var input = inNdx > 0 ? this.m_in1 : this.m_in0;
+
+ if (input.inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_UNIFORM)
+ {
+ var loc = gl.getUniformLocation(programId, "u_in" + inNdx);
+
+ if (!loc)
+ continue;
+
+ switch (input.dataType)
+ {
+ case gluShaderUtil.DataType.FLOAT: gl.uniform1f(loc, s_constInFloat[inNdx]); break;
+ case gluShaderUtil.DataType.FLOAT_VEC2: gl.uniform2fv(loc, s_constInVec2[inNdx]); break;
+ case gluShaderUtil.DataType.FLOAT_VEC3: gl.uniform3fv(loc, s_constInVec3[inNdx]); break;
+ case gluShaderUtil.DataType.FLOAT_VEC4: gl.uniform4fv(loc, s_constInVec4[inNdx]); break;
+ // \note GLES3 supports transpose in matrix upload.
+ case gluShaderUtil.DataType.FLOAT_MAT2: gl.uniformMatrix2fv (loc, true, s_constInMat2x2[inNdx]); break;
+ case gluShaderUtil.DataType.FLOAT_MAT2X3: gl.uniformMatrix2x3fv(loc, true, s_constInMat2x3[inNdx]); break;
+ case gluShaderUtil.DataType.FLOAT_MAT2X4: gl.uniformMatrix2x4fv(loc, true, s_constInMat2x4[inNdx]); break;
+ case gluShaderUtil.DataType.FLOAT_MAT3X2: gl.uniformMatrix3x2fv(loc, true, s_constInMat3x2[inNdx]); break;
+ case gluShaderUtil.DataType.FLOAT_MAT3: gl.uniformMatrix3fv (loc, true, s_constInMat3x3[inNdx]); break;
+ case gluShaderUtil.DataType.FLOAT_MAT3X4: gl.uniformMatrix3x4fv(loc, true, s_constInMat3x4[inNdx]); break;
+ case gluShaderUtil.DataType.FLOAT_MAT4X2: gl.uniformMatrix4x2fv(loc, true, s_constInMat4x2[inNdx]); break;
+ case gluShaderUtil.DataType.FLOAT_MAT4X3: gl.uniformMatrix4x3fv(loc, true, s_constInMat4x3[inNdx]); break;
+ case gluShaderUtil.DataType.FLOAT_MAT4: gl.uniformMatrix4fv (loc, true, s_constInMat4x4[inNdx]); break;
+ default:
+ throw new Error('Invalid datatype' + input.dataType);
+ }
+ }
+ }
+ };
+
+
+
+ /**
+ * @param {gluShaderUtil.DataType} matType
+ * @param {string} varName
+ * @return {string}
+ */
+ es3fShaderMatrixTest.ShaderMatrixCase.prototype.genGLSLMatToVec3Reduction = function (matType, varName) {
+ /** @type {string} */ var op = '';
+
+ switch (matType) {
+ case gluShaderUtil.DataType.FLOAT:
+ op += varName + ', '
+ + varName + ', '
+ + varName + '';
+ break;
+ case gluShaderUtil.DataType.FLOAT_VEC2:
+ op += varName + '.x, '
+ + varName + '.y, '
+ + varName + '.x';
+ break;
+ case gluShaderUtil.DataType.FLOAT_VEC3:
+ op += varName + '';
+ break;
+ case gluShaderUtil.DataType.FLOAT_VEC4:
+ op += varName + '.x, '
+ + varName + '.y, '
+ + varName + '.z+'
+ + varName + '.w';
+ break;
+ case gluShaderUtil.DataType.FLOAT_MAT2:
+ op += varName + '[0][0], '
+ + varName + '[1][0], '
+ + varName + '[0][1]+'
+ + varName + '[1][1]';
+ break;
+ case gluShaderUtil.DataType.FLOAT_MAT2X3:
+ op += varName + '[0] + '
+ + varName + '[1]';
+ break;
+ case gluShaderUtil.DataType.FLOAT_MAT2X4:
+ op += varName + '[0].xyz + '
+ + varName + '[1].yzw';
+ break;
+ case gluShaderUtil.DataType.FLOAT_MAT3X2:
+ op += varName + '[0][0]+'
+ + varName + '[0][1], '
+ + varName + '[1][0]+'
+ + varName + '[1][1], '
+ + varName + '[2][0]+'
+ + varName + '[2][1]';
+ break;
+ case gluShaderUtil.DataType.FLOAT_MAT3:
+ op += varName + '[0] + '
+ + varName + '[1] + '
+ + varName + '[2]';
+ break;
+ case gluShaderUtil.DataType.FLOAT_MAT3X4:
+ op += varName + '[0].xyz + '
+ + varName + '[1].yzw + '
+ + varName + '[2].zwx';
+ break;
+ case gluShaderUtil.DataType.FLOAT_MAT4X2:
+ op += varName + '[0][0]+'
+ + varName + '[0][1]+'
+ + varName + '[3][0], '
+ + varName + '[1][0]+'
+ + varName + '[1][1]+'
+ + varName + '[3][1], '
+ + varName + '[2][0]+'
+ + varName + '[2][1]';
+ break;
+ case gluShaderUtil.DataType.FLOAT_MAT4X3:
+ op += varName + '[0] + '
+ + varName + '[1] + '
+ + varName + '[2] + '
+ + varName + '[3]';
+ break;
+ case gluShaderUtil.DataType.FLOAT_MAT4:
+ op += varName + '[0].xyz+'
+ + varName + '[1].yzw+'
+ + varName + '[2].zwx+'
+ + varName + '[3].wxy';
+ break;
+
+ default:
+ throw new Error('Wrong data type');
+ }
+
+ return op;
+ }
+
+ /**
+ * @constructor
+ * @param {string} name
+ * @param {string} desc
+ * @param {es3fShaderMatrixTest.MatrixOp} op
+ * @param {boolean} extendedInputTypeCases
+ * @param {boolean} createInputTypeGroup
+ */
+ es3fShaderMatrixTest.ops = function (name, desc, op, extendedInputTypeCases, createInputTypeGroup) {
+ this.name = name;
+ this.desc = desc;
+ this.op = op;
+ this.extendedInputTypeCases = extendedInputTypeCases;
+ this.createInputTypeGroup = createInputTypeGroup;
+ };
+
+ /**
+ * @constructor
+ * @param {string} name
+ * @param {string} desc
+ * @param {es3fShaderMatrixTest.InputType} type
+ */
+ es3fShaderMatrixTest.InputTypeSpec = function (name, desc, type) {
+ this.name = name;
+ this.desc = desc;
+ this.type = type;
+ };
+
+ es3fShaderMatrixTest.init = function () {
+ var state = tcuTestCase.runner;
+
+ var ops = [
+ new es3fShaderMatrixTest.ops('add', 'Matrix addition tests', es3fShaderMatrixTest.MatrixOp.OP_ADD, true, true),
+ new es3fShaderMatrixTest.ops('sub', 'Matrix subtraction tests', es3fShaderMatrixTest.MatrixOp.OP_SUB, true, true),
+ new es3fShaderMatrixTest.ops('mul', 'Matrix multiplication tests', es3fShaderMatrixTest.MatrixOp.OP_MUL, true, true),
+ new es3fShaderMatrixTest.ops('div', 'Matrix division tests', es3fShaderMatrixTest.MatrixOp.OP_DIV, true, true),
+ new es3fShaderMatrixTest.ops('matrixcompmult', 'Matrix component-wise multiplication tests', es3fShaderMatrixTest.MatrixOp.OP_COMP_MUL, false, true),
+ new es3fShaderMatrixTest.ops('outerproduct', 'Matrix outerProduct() tests', es3fShaderMatrixTest.MatrixOp.OP_OUTER_PRODUCT, false, true),
+ new es3fShaderMatrixTest.ops('transpose', 'Matrix transpose() tests', es3fShaderMatrixTest.MatrixOp.OP_TRANSPOSE, false, true),
+ new es3fShaderMatrixTest.ops('determinant', 'Matrix determinant() tests', es3fShaderMatrixTest.MatrixOp.OP_DETERMINANT, false, true),
+ new es3fShaderMatrixTest.ops('inverse', 'Matrix inverse() tests', es3fShaderMatrixTest.MatrixOp.OP_INVERSE, false, true),
+ new es3fShaderMatrixTest.ops('unary_addition', 'Matrix unary addition tests', es3fShaderMatrixTest.MatrixOp.OP_UNARY_PLUS, false, false),
+ new es3fShaderMatrixTest.ops('negation', 'Matrix negation tests', es3fShaderMatrixTest.MatrixOp.OP_NEGATION, false, false),
+ new es3fShaderMatrixTest.ops('pre_increment', 'Matrix prefix increment tests', es3fShaderMatrixTest.MatrixOp.OP_PRE_INCREMENT, false, false),
+ new es3fShaderMatrixTest.ops('pre_decrement', 'Matrix prefix decrement tests', es3fShaderMatrixTest.MatrixOp.OP_PRE_DECREMENT, false, false),
+ new es3fShaderMatrixTest.ops('post_increment', 'Matrix postfix increment tests', es3fShaderMatrixTest.MatrixOp.OP_POST_INCREMENT, false, false),
+ new es3fShaderMatrixTest.ops('post_decrement', 'Matrix postfix decrement tests', es3fShaderMatrixTest.MatrixOp.OP_POST_DECREMENT, false, false),
+ new es3fShaderMatrixTest.ops('add_assign', 'Matrix add into tests', es3fShaderMatrixTest.MatrixOp.OP_ADD_INTO, false, false),
+ new es3fShaderMatrixTest.ops('sub_assign', 'Matrix subtract from tests', es3fShaderMatrixTest.MatrixOp.OP_SUBTRACT_FROM,false, false),
+ new es3fShaderMatrixTest.ops('mul_assign', 'Matrix multiply into tests', es3fShaderMatrixTest.MatrixOp.OP_MULTIPLY_INTO,false, false),
+ new es3fShaderMatrixTest.ops('div_assign', 'Matrix divide into tests', es3fShaderMatrixTest.MatrixOp.OP_DIVIDE_INTO,false, false)
+ ];
+
+ var extendedInputTypes = [
+ new es3fShaderMatrixTest.InputTypeSpec('const', 'Constant matrix input', es3fShaderMatrixTest.InputType.INPUTTYPE_CONST),
+ new es3fShaderMatrixTest.InputTypeSpec('uniform', 'Uniform matrix input', es3fShaderMatrixTest.InputType.INPUTTYPE_UNIFORM),
+ new es3fShaderMatrixTest.InputTypeSpec('dynamic', 'Dynamic matrix input', es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC)
+ ];
+
+ var reducedInputTypes = [
+ new es3fShaderMatrixTest.InputTypeSpec('dynamic', 'Dynamic matrix input', es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC)
+ ];
+
+ /** @type {Array<gluShaderUtil.DataType>} */ var matrixTypes = [
+ gluShaderUtil.DataType.FLOAT_MAT2,
+ gluShaderUtil.DataType.FLOAT_MAT2X3,
+ gluShaderUtil.DataType.FLOAT_MAT2X4,
+ gluShaderUtil.DataType.FLOAT_MAT3X2,
+ gluShaderUtil.DataType.FLOAT_MAT3,
+ gluShaderUtil.DataType.FLOAT_MAT3X4,
+ gluShaderUtil.DataType.FLOAT_MAT4X2,
+ gluShaderUtil.DataType.FLOAT_MAT4X3,
+ gluShaderUtil.DataType.FLOAT_MAT4
+ ];
+
+ /** @type {Array<gluShaderUtil.precision>} */ var precisions = [
+ gluShaderUtil.precision.PRECISION_LOWP,
+ gluShaderUtil.precision.PRECISION_MEDIUMP,
+ gluShaderUtil.precision.PRECISION_HIGHP
+ ];
+
+ for (var opNdx = 0; opNdx < ops.length; opNdx++) {
+ var inTypeList = ops[opNdx].extendedInputTypeCases ? extendedInputTypes : reducedInputTypes;
+ var inTypeListSize = ops[opNdx].extendedInputTypeCases ? extendedInputTypes.length : reducedInputTypes.length;
+ var op = ops[opNdx].op;
+
+ for (var inTypeNdx = 0; inTypeNdx < inTypeListSize; inTypeNdx++) {
+ var inputType = inTypeList[inTypeNdx].type;
+ var group = [];
+
+ if (ops[opNdx].name != 'mul') {
+ if (ops[opNdx].createInputTypeGroup) {
+ group[0] = tcuTestCase.newTest(ops[opNdx].name + '.' + inTypeList[inTypeNdx].name, inTypeList[inTypeNdx].desc);
+ } else {
+ group[0] = tcuTestCase.newTest(ops[opNdx].name, ops[opNdx].desc);
+ }
+ state.testCases.addChild(group[0]);
+ } else {
+ for (var ii = 0; ii < precisions.length; ++ii) {
+ group[ii] = tcuTestCase.newTest(ops[opNdx].name + '.' + inTypeList[inTypeNdx].name, inTypeList[inTypeNdx].desc);
+ state.testCases.addChild(group[ii]);
+ }
+ }
+
+ for (var matTypeNdx = 0; matTypeNdx < matrixTypes.length; matTypeNdx++) {
+ var matType = matrixTypes[matTypeNdx];
+ var numCols = gluShaderUtil.getDataTypeMatrixNumColumns(matType);
+ var numRows = gluShaderUtil.getDataTypeMatrixNumRows(matType);
+ var matTypeName = gluShaderUtil.getDataTypeName(matType);
+
+ for (var precNdx = 0; precNdx < precisions.length; precNdx++) {
+ var inGroup;
+ if (ops[opNdx].name != 'mul') {
+ inGroup = group[0];
+ } else {
+ inGroup = group[precNdx];
+ }
+
+ var precision = precisions[precNdx];
+ var precName = gluShaderUtil.getPrecisionName(precision);
+ var baseName = precName + '_' + matTypeName + '_';
+ var matIn = new es3fShaderMatrixTest.ShaderInput(inputType, matType, precision);
+
+ if (es3fShaderMatrixTest.isOperationMatrixScalar(op)) {
+ // Matrix-scalar \note For div cases we use uniform input.
+ var scalarIn = new es3fShaderMatrixTest.ShaderInput(op == es3fShaderMatrixTest.MatrixOp.OP_DIV ? es3fShaderMatrixTest.InputType.INPUTTYPE_UNIFORM : es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC, gluShaderUtil.DataType.FLOAT, precision);
+ inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(baseName + 'float_vertex', 'Matrix-scalar case', matIn, scalarIn, op, true));
+ inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(baseName + 'float_fragment', 'Matrix-scalar case', matIn, scalarIn, op, false));
+ }
+
+ if (es3fShaderMatrixTest.isOperationMatrixVector(op)) {
+ // Matrix-vector.
+ var colVecType = gluShaderUtil.getDataTypeFloatVec(numCols);
+ var colVecIn = new es3fShaderMatrixTest.ShaderInput(op == es3fShaderMatrixTest.MatrixOp.OP_DIV ? es3fShaderMatrixTest.InputType.INPUTTYPE_UNIFORM : es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC, colVecType, precision);
+
+ inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(baseName + gluShaderUtil.getDataTypeName(colVecType) + '_vertex', 'Matrix-vector case', matIn, colVecIn, op, true));
+ inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(baseName + gluShaderUtil.getDataTypeName(colVecType) + '_fragment', 'Matrix-vector case', matIn, colVecIn, op, false));
+
+ // Vector-matrix.
+ var rowVecType = gluShaderUtil.getDataTypeFloatVec(numRows);
+ var rowVecIn = new es3fShaderMatrixTest.ShaderInput(op == es3fShaderMatrixTest.MatrixOp.OP_DIV ? es3fShaderMatrixTest.InputType.INPUTTYPE_UNIFORM : es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC, rowVecType, precision);
+ var vecMatName = precName + '_' + gluShaderUtil.getDataTypeName(rowVecType) + '_' + matTypeName;
+
+ inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(vecMatName + '_vertex', 'Vector-matrix case', rowVecIn, matIn, op, true));
+ inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(vecMatName + '_fragment', 'Vector-matrix case', rowVecIn, matIn, op, false));
+ }
+
+ if (es3fShaderMatrixTest.isOperationArithmeticMatrixMatrix(op)) {
+ // Arithmetic matrix-matrix multiplication.
+ for (var otherCols = 2; otherCols <= 4; otherCols++) {
+ var otherMatIn = new es3fShaderMatrixTest.ShaderInput(inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? es3fShaderMatrixTest.InputType.INPUTTYPE_UNIFORM : inputType, gluShaderUtil.getDataTypeMatrix(otherCols, numCols), precision);
+ inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(baseName + gluShaderUtil.getDataTypeName(otherMatIn.dataType) + '_vertex', 'Matrix-matrix case', matIn, otherMatIn, op, true));
+ inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(baseName + gluShaderUtil.getDataTypeName(otherMatIn.dataType) + '_fragment', 'Matrix-matrix case', matIn, otherMatIn, op, false));
+ }
+ } else if (es3fShaderMatrixTest.isOperationComponentwiseMatrixMatrix(op)) {
+ // Component-wise.
+ var otherMatIn = new es3fShaderMatrixTest.ShaderInput(inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? es3fShaderMatrixTest.InputType.INPUTTYPE_UNIFORM : inputType, matType, precision);
+ inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(baseName + matTypeName + '_vertex', 'Matrix-matrix case', matIn, otherMatIn, op, true));
+ inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(baseName + matTypeName + '_fragment', 'Matrix-matrix case', matIn, otherMatIn, op, false));
+ }
+
+ if (es3fShaderMatrixTest.isOperationVectorVector(op)) {
+ var vec1In = new es3fShaderMatrixTest.ShaderInput(inputType, gluShaderUtil.getDataTypeFloatVec(numRows), precision);
+ var vec2In = new es3fShaderMatrixTest.ShaderInput((inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC) ? es3fShaderMatrixTest.InputType.INPUTTYPE_UNIFORM : inputType, gluShaderUtil.getDataTypeFloatVec(numCols), precision);
+
+ inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(baseName + 'float_vertex', 'Vector-vector case', vec1In, vec2In, op, true));
+ inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(baseName + 'float_fragment', 'Vector-vector case', vec1In, vec2In, op, false));
+ }
+
+ if (es3fShaderMatrixTest.isOperationUnaryAnyMatrix(op) || (es3fShaderMatrixTest.isOperationUnarySymmetricMatrix(op) && numCols == numRows)) {
+ var voidInput = new es3fShaderMatrixTest.ShaderInput();
+ inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(baseName + 'float_vertex', 'Matrix case', matIn, voidInput, op, true));
+ inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(baseName + 'float_fragment', 'Matrix case', matIn, voidInput, op, false));
+ }
+
+ if (es3fShaderMatrixTest.isOperationAssignmentAnyMatrix(op) || (es3fShaderMatrixTest.isOperationAssignmentSymmetricMatrix(op) && numCols == numRows)) {
+ var otherMatIn = new es3fShaderMatrixTest.ShaderInput(inputType == es3fShaderMatrixTest.InputType.INPUTTYPE_DYNAMIC ? es3fShaderMatrixTest.InputType.INPUTTYPE_UNIFORM : inputType, matType, precision);
+ inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(baseName + 'float_vertex', 'Matrix assignment case', matIn, otherMatIn, op, true));
+ inGroup.addChild(new es3fShaderMatrixTest.ShaderMatrixCase(baseName + 'float_fragment', 'Matrix assignment case', matIn, otherMatIn, op, false));
+ }
+ }
+ }
+ }
+ }
+ }
+
+ es3fShaderMatrixTest.run = function(context, range) {
+ gl = context;
+ //Set up Test Root parameters
+ var testName = 'shader_matrix';
+ var testDescription = 'Shader Matrix Test';
+ var state = tcuTestCase.runner;
+
+ state.testName = testName;
+ state.testCases = tcuTestCase.newTest(testName, testDescription, null);
+
+ //Set up name and description of this test series.
+ setCurrentTestName(testName);
+ description(testDescription);
+
+ try {
+ //Create test cases
+ es3fShaderMatrixTest.init();
+ if (range)
+ state.setRange(range);
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ bufferedLogToConsole(err);
+ tcuTestCase.runner.terminate();
+ }
+ };
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderOperatorTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderOperatorTests.js
new file mode 100644
index 0000000000..5dfd0311d3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderOperatorTests.js
@@ -0,0 +1,3252 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fShaderOperatorTests');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('framework.delibs.debase.deMath');
+goog.require('modules.shared.glsShaderRenderCase');
+goog.require('framework.common.tcuMatrix');
+
+goog.scope(function() {
+var es3fShaderOperatorTests = functional.gles3.es3fShaderOperatorTests;
+var tcuTestCase = framework.common.tcuTestCase;
+var gluShaderUtil = framework.opengl.gluShaderUtil;
+var gluShaderProgram = framework.opengl.gluShaderProgram;
+var deMath = framework.delibs.debase.deMath;
+var glsShaderRenderCase = modules.shared.glsShaderRenderCase;
+var tcuMatrix = framework.common.tcuMatrix;
+
+/** @const */ es3fShaderOperatorTests.MAX_INPUTS = 3;
+
+let canvasWH = 256;
+if (tcuTestCase.isQuickMode()) {
+ canvasWH = 32;
+}
+
+es3fShaderOperatorTests.stringJoin = function(elems, delim) {
+ var result = '';
+ for (var i = 0; i < elems.length; i++)
+ result += (i > 0 ? delim : '') + elems[i];
+ return result;
+};
+
+es3fShaderOperatorTests.twoValuedVec4 = function(first, second, firstMask) {
+ var elems = [];
+ for (var i = 0; i < 4; i++)
+ elems[i] = firstMask[i] ? first : second;
+
+ return 'vec4(' + es3fShaderOperatorTests.stringJoin(elems, ', ') + ')';
+};
+
+var setParentClass = function(child, parent) {
+ child.prototype = Object.create(parent.prototype);
+ child.prototype.constructor = child;
+};
+
+var negate = function(x) {
+ return -x;
+};
+
+var addOne = function(x) {
+ return x + 1;
+};
+
+var subOne = function(x) {
+ return x - 1;
+};
+
+/**
+ * @param {number} a
+ * @param {number} b
+ */
+var add = function(a, b) {
+ return a + b;
+};
+
+/**
+ * @param {number} a
+ * @param {number} b
+ */
+var sub = function(a, b) {
+ return a - b;
+};
+
+/**
+ * @param {number} a
+ * @param {number} b
+ */
+var mul = function(a, b) {
+ return a * b;
+};
+
+/**
+ * @param {number} a
+ * @param {number} b
+ */
+var div = function(a, b) {
+ return a / b;
+};
+
+/**
+ * @param {number} a
+ * @param {number} b
+ * @return {number}
+ */
+var lessThan = function(a, b) {
+ return a < b ? 1 : 0;
+};
+
+/**
+ * @param {Array<number>} a
+ * @param {Array<number>} b
+ * @return {Array<number>}
+ */
+var lessThanVec = function(a, b) {
+ var res = [];
+ for (var i = 0; i < a.length; i++)
+ res[i] = a[i] < b[i];
+ return res
+};
+
+/**
+ * @param {number} a
+ * @param {number} b
+ * @return {number}
+ */
+var lessThanEqual = function(a, b) {
+ return a <= b ? 1 : 0;
+};
+
+/**
+ * @param {Array<number>} a
+ * @param {Array<number>} b
+ * @return {Array<number>}
+ */
+var lessThanEqualVec = function(a, b) {
+ var res = [];
+ for (var i = 0; i < a.length; i++)
+ res[i] = a[i] <= b[i];
+ return res;
+};
+
+/**
+ * @param {number} a
+ * @param {number} b
+ */
+var greaterThan = function(a, b) {
+ return a > b ? 1 : 0;
+};
+
+/**
+ * @param {Array<number>} a
+ * @param {Array<number>} b
+ * @return {Array<number>}
+ */
+var greaterThanVec = function(a, b) {
+ var res = [];
+ for (var i = 0; i < a.length; i++)
+ res[i] = a[i] > b[i];
+ return res;
+};
+
+/**
+ * @param {number} a
+ * @param {number} b
+ */
+var greaterThanEqual = function(a, b) {
+ return a >= b ? 1 : 0;
+};
+
+/**
+ * @param {Array<number>} a
+ * @param {Array<number>} b
+ * @return {Array<number>}
+ */
+var greaterThanEqualVec = function(a, b) {
+ var res = [];
+ for (var i = 0; i < a.length; i++)
+ res[i] = a[i] >= b[i];
+ return res;
+};
+
+/**
+ * @param {Array<number>} a
+ * @param {Array<number>} b
+ * @return {number}
+ */
+var allEqual = function(a, b) {
+ return deMath.equal(a, b) ? 1 : 0;
+};
+
+/**
+ * @param {Array<number>} a
+ * @param {Array<number>} b
+ * @return {Array<number>}
+ */
+var allEqualVec = function(a, b) {
+ var res = [];
+ for (var i = 0; i < a.length; i++)
+ res[i] = a[i] == b[i];
+ return res;
+};
+
+/**
+ * @param {Array<number>} a
+ * @param {Array<number>} b
+ * @return {number}
+ */
+var anyNotEqual = function(a, b) {
+ return !deMath.equal(a, b) ? 1 : 0;
+};
+
+/**
+ * @param {Array<number>} a
+ * @param {Array<number>} b
+ * @return {Array<number>}
+ */
+var anyNotEqualVec = function(a, b) {
+ var res = [];
+ for (var i = 0; i < a.length; i++)
+ res[i] = a[i] != b[i];
+ return res;
+};
+
+/**
+ * @param {Array<number>} a
+ * @return {Array<number>}
+ */
+var boolNotVec = function(a) {
+ var res = [];
+ for (var i = 0; i < a.length; i++)
+ res[i] = !a[i];
+ return res;
+}
+
+/**
+ * @param {Array<number>} a
+ * @return {boolean}
+ */
+var boolAny = function(a) {
+ for (var i = 0; i < a.length; i++)
+ if (a[i] == true)
+ return true;
+ return false;
+}
+
+/**
+ * @param {Array<number>} a
+ * @return {boolean}
+ */
+var boolAll = function(a) {
+ for (var i = 0; i < a.length; i++)
+ if (a[i] == false)
+ return false;
+ return true;
+}
+
+/**
+ * @param {number} a
+ * @param {number} b
+ */
+var logicalAnd = function(a, b) {
+ return a && b ? 1 : 0;
+};
+
+/**
+ * @param {number} a
+ * @param {number} b
+ */
+var logicalOr = function(a, b) {
+ return a || b ? 1 : 0;
+};
+
+/**
+ * @param {number} a
+ * @param {number} b
+ */
+var logicalXor = function(a, b) {
+ return a != b ? 1 : 0;
+};
+
+/**
+ * @param {number} a
+ */
+var exp2 = function(a) {
+ return deFloatExp2(a);
+};
+
+/**
+ * @param {number} a
+ */
+var inverseSqrt = function(a) {
+ return deFloatRsq(a);
+};
+
+/**
+ * @param {Array<number>} a
+ * @param {number} b
+ * @return {Array<number>}
+ */
+var minVecScalar = function(a, b) {
+ var res = [];
+ for (var i = 0; i < a.length; i++)
+ res[i] = Math.min(a[i], b);
+ return res;
+};
+
+/**
+ * @param {Array<number>} a
+ * @param {number} b
+ * @return {Array<number>}
+ */
+var maxVecScalar = function(a, b) {
+ var res = [];
+ for (var i = 0; i < a.length; i++)
+ res[i] = Math.max(a[i], b);
+ return res;
+};
+
+/**
+ * @param {number} a
+ * @param {number} b
+ * @param {number} c
+ * @return {number}
+ */
+var mix = function(a, b, c) {
+ return a * (1.0 - c) + b * c;
+};
+/**
+ * @param {Array<number>} a
+ * @param {Array<number>} b
+ * @param {number} c
+ * @return {Array<number>}
+ */
+var mixVecVecScalar = function(a, b, c) {
+ var res = [];
+ for (var i = 0; i < a.length; i++)
+ res[i] = mix(a[i], b[i], c);
+ return res;
+};
+
+/**
+ * @param {Array<number>} a
+ * @param {number} b
+ * @param {number} c
+ * @return {Array<number>}
+ */
+var clampVecScalarScalar = function(a, b, c) {
+ var res = [];
+ for (var i = 0; i < a.length; i++)
+ res[i] = deMath.clamp(a[i], b, c);
+ return res;
+};
+
+/**
+ * @param {number} a
+ * @param {number} b
+ * @return {number}
+ */
+var step = function(a, b) {
+ return b < a ? 0.0 : 1.0;
+};
+
+/**
+ * @param {number} a
+ * @param {Array<number>} b
+ * @return {Array<number>}
+ */
+var stepScalarVec = function(a, b) {
+ var res = [];
+ for (var i = 0; i < b.length; i++)
+ res[i] = step(a, b[i]);
+ return res;
+};
+
+/**
+ * @param {number} a
+ * @param {number} b
+ * @param {number} c
+ * @return {number}
+ */
+var smoothStep = function(a, b, c) {
+ if (c <= a) return 0.0;
+ if (c >= b) return 1.0;
+ var t = deMath.clamp((c - a) / (b - a), 0.0, 1.0);
+ return t * t * (3.0 - 2.0 * t);
+};
+
+/**
+ * @param {number} a
+ * @param {number} b
+ * @param {Array<number>} c
+ * @return {Array<number>}
+ */
+var smoothStepScalarScalarVec = function(a, b, c) {
+ var res = [];
+ for (var i = 0; i < c.length; i++)
+ res[i] = smoothStep(a, b, c[i]);
+ return res;
+};
+
+/**
+ * @param {number} a
+ * @return {number}
+ */
+var roundToEven = function(a) {
+ var q = deMath.deFloatFrac(a);
+ var r = a - q;
+
+ if (q > 0.5)
+ r += 1.0;
+ else if (q == 0.5 && r % 2 != 0)
+ r += 1.0;
+
+ return r;
+};
+
+/**
+ * @param {number} a
+ * @return {number}
+ */
+var fract = function(a) {
+ return a - Math.floor(a);
+};
+
+/**
+ * @param {number} a
+ * @return {number}
+ */
+var radians = function(a) {
+ return deFloatRadians(a);
+}
+
+/**
+ * @param {number} a
+ * @return {number}
+ */
+var degrees = function(a) {
+ return deFloatDegrees(a);
+}
+
+/**
+ * @param {number} a
+ * @param {Array<number>} b
+ */
+var addScalarVec = function(a, b) {
+ return deMath.addScalar(b, a);
+};
+
+/**
+ * @param {number} a
+ * @param {Array<number>} b
+ */
+var subScalarVec = function(a, b) {
+ var dst = [];
+ for (var i = 0; i < b.length; i++)
+ dst.push(a - b[i]);
+ return dst;
+};
+
+/**
+ * @param {number} a
+ * @param {Array<number>} b
+ */
+var mulScalarVec = function(a, b) {
+ var dst = [];
+ for (var i = 0; i < b.length; i++)
+ dst.push(a * b[i]);
+ return dst;
+};
+
+/**
+ * @param {number} a
+ * @param {Array<number>} b
+ */
+var divScalarVec = function(a, b) {
+ var dst = [];
+ for (var i = 0; i < b.length; i++)
+ dst.push(a / b[i]);
+ return dst;
+};
+
+/**
+ * @param {number} a
+ * @param {Array<number>} b
+ */
+var modScalarVec = function(a, b) {
+ var dst = [];
+ for (var i = 0; i < b.length; i++)
+ dst.push(a % b[i]);
+ return dst;
+};
+
+var bitwiseAndScalarVec = function(a, b) {
+ var dst = [];
+ for (var i = 0; i < b.length; i++)
+ dst.push(deMath.binaryOp(a, b[i], deMath.BinaryOp.AND));
+ return dst;
+};
+
+var bitwiseOrScalarVec = function(a, b) {
+ var dst = [];
+ for (var i = 0; i < b.length; i++)
+ dst.push(deMath.binaryOp(a, b[i], deMath.BinaryOp.OR));
+ return dst;
+};
+
+var bitwiseXorScalarVec = function(a, b) {
+ var dst = [];
+ for (var i = 0; i < b.length; i++)
+ dst.push(deMath.binaryOp(a, b[i], deMath.BinaryOp.XOR));
+ return dst;
+};
+
+/**
+ * @param {Array<number>} a
+ * @return {number}
+ */
+var length = function(a) {
+ var squareSum = 0;
+ for (var i = 0; i < a.length; i++)
+ squareSum += a[i] * a[i];
+ return Math.sqrt(squareSum);
+};
+
+/**
+ * @param {Array<number>} a
+ * @param {Array<number>} b
+ * @return {number}
+ */
+var distance = function(a, b) {
+ var res = deMath.subtract(a, b)
+ return length(res);
+};
+
+/**
+ * @param {Array<number>} a
+ * @param {Array<number>} b
+ * @return {number}
+ */
+var dot = function(a, b) {
+ var res = deMath.multiply(a, b);
+ var sum = 0;
+ for (var i = 0; i < res.length; i++)
+ sum += res[i];
+ return sum;
+};
+
+/**
+ * @param {Array<number>} a
+ * @return {Array<number>}
+ */
+var normalize = function(a) {
+ var ooLen = 1 / length(a);
+ var res = [];
+ for (var i = 0; i < a.length; i++)
+ res[i] = ooLen * a[i];
+ return res;
+};
+
+/**
+ * @param {Array<number>} a
+ * @param {Array<number>} b
+ * @param {Array<number>} c
+ * @return {Array<number>}
+ */
+var faceforward = function(a, b, c) {
+ return dot(c, b) < 0 ? a : deMath.scale(a, -1);
+};
+
+/**
+ * @param {Array<number>} a
+ * @param {Array<number>} b
+ * @return {Array<number>}
+ */
+var reflect = function(a, b) {
+ return deMath.subtract(a, deMath.scale(deMath.scale(b, dot(b, a)), 2));
+};
+
+/**
+ * @param {Array<number>} a
+ * @param {Array<number>} b
+ * @param {number} c
+ * @return {Array<number>}
+ */
+var refract = function(a, b, c) {
+ var cosAngle = dot(b, a);
+ var k = 1 - c * c * (1 - cosAngle * cosAngle);
+ if (k < 0) {
+ var res = new Array(a.length);
+ return res.fill(0)
+ } else
+ return deMath.subtract(deMath.scale(a, c), deMath.scale(b, c * cosAngle + Math.sqrt(k)));
+};
+
+/**
+ * @param {Array<number>} a
+ * @param {Array<number>} b
+ * @return {Array<number>}
+ */
+var cross = function(a, b) {
+ if (a.length != 3 || b.length != 3)
+ throw new Error('Arrays must have the size of 3');
+ return [
+ a[1] * b[2] - b[1] * a[2],
+ a[2] * b[0] - b[2] * a[0],
+ a[0] * b[1] - b[0] * a[1]];
+};
+
+var nop = function(v) {
+ return v;
+};
+
+var selection = function(cond, a, b) {
+ return cond ? a : b;
+};
+
+var boolNot = function(a) {
+ return !a;
+};
+
+var bitwiseNot = function(a) {
+ return ~a;
+};
+
+/**
+ * @param {number} x
+ * @return {number}
+ */
+var deFloatRadians = function(x) {
+ return x * (Math.PI / 180.0);
+};
+
+/**
+ * @param {number} x
+ * @return {number}
+ */
+var deFloatDegrees = function(x) {
+ return x * (180.0 / Math.PI);
+};
+
+/**
+ * @param {number} x
+ * @return {number}
+ */
+var deFloatExp2 = function(x) {
+ return Math.exp(x * Math.LN2);
+};
+
+/**
+ * @param {number} x
+ * @return {number}
+ */
+var deFloatLog2 = function(x) {
+ return Math.log(x) * Math.LOG2E;
+};
+
+/**
+ * @param {number} x
+ * @return {number}
+ */
+var deFloatRsq = function(x) {
+ var s = Math.sqrt(x);
+ return s == 0.0 ? 0.0 : (1.0 / s);
+};
+
+/**
+ * @constructor
+ * @param {boolean} low
+ * @param {boolean} medium
+ * @param {boolean} high
+ */
+es3fShaderOperatorTests.Precision = function(low, medium, high) {
+ this.low = low;
+ this.medium = medium;
+ this.high = high;
+};
+
+/** @const */ es3fShaderOperatorTests.Precision.Low = new es3fShaderOperatorTests.Precision(true, false, false);
+/** @const */ es3fShaderOperatorTests.Precision.Medium = new es3fShaderOperatorTests.Precision(false, true, false);
+/** @const */ es3fShaderOperatorTests.Precision.High = new es3fShaderOperatorTests.Precision(false, false, true);
+/** @const */ es3fShaderOperatorTests.Precision.LowMedium = new es3fShaderOperatorTests.Precision(true, true, false);
+/** @const */ es3fShaderOperatorTests.Precision.MediumHigh = new es3fShaderOperatorTests.Precision(false, true, true);
+/** @const */ es3fShaderOperatorTests.Precision.All = new es3fShaderOperatorTests.Precision(true, true, true);
+/** @const */ es3fShaderOperatorTests.Precision.None = new es3fShaderOperatorTests.Precision(false, false, false);
+
+/**
+ * @enum
+ */
+es3fShaderOperatorTests.ValueType = {
+ NONE: 0,
+ FLOAT: (1 << 0), // float scalar
+ FLOAT_VEC: (1 << 1), // float vector
+ FLOAT_GENTYPE: (1 << 2), // float scalar/vector
+ VEC3: (1 << 3), // vec3 only
+ MATRIX: (1 << 4), // matrix
+ BOOL: (1 << 5), // boolean scalar
+ BOOL_VEC: (1 << 6), // boolean vector
+ BOOL_GENTYPE: (1 << 7), // boolean scalar/vector
+ INT: (1 << 8), // int scalar
+ INT_VEC: (1 << 9), // int vector
+ INT_GENTYPE: (1 << 10), // int scalar/vector
+ UINT: (1 << 11), // uint scalar
+ UINT_VEC: (1 << 12), // uint vector
+ UINT_GENTYPE: (1 << 13) // uint scalar/vector
+};
+
+/**
+ * @param {es3fShaderOperatorTests.ValueType} type
+ * @return {boolean}
+ */
+es3fShaderOperatorTests.isBoolType = function(type) {
+ return (type & (es3fShaderOperatorTests.ValueType.BOOL | es3fShaderOperatorTests.ValueType.BOOL_VEC | es3fShaderOperatorTests.ValueType.BOOL_GENTYPE)) != 0;
+};
+
+/**
+ * @param {es3fShaderOperatorTests.ValueType} type
+ * @return {boolean}
+ */
+es3fShaderOperatorTests.isIntType = function(type) {
+ return (type & (es3fShaderOperatorTests.ValueType.INT | es3fShaderOperatorTests.ValueType.INT_VEC | es3fShaderOperatorTests.ValueType.INT_GENTYPE)) != 0;
+};
+
+/**
+ * @param {es3fShaderOperatorTests.ValueType} type
+ * @return {boolean}
+ */
+es3fShaderOperatorTests.isUintType = function(type) {
+ return (type & (es3fShaderOperatorTests.ValueType.UINT | es3fShaderOperatorTests.ValueType.UINT_VEC | es3fShaderOperatorTests.ValueType.UINT_GENTYPE)) != 0;
+};
+
+/**
+ * @param {es3fShaderOperatorTests.ValueType} type
+ * @return {boolean}
+ */
+es3fShaderOperatorTests.isScalarType = function(type) {
+ return type == es3fShaderOperatorTests.ValueType.FLOAT || type == es3fShaderOperatorTests.ValueType.BOOL || type == es3fShaderOperatorTests.ValueType.INT || type == es3fShaderOperatorTests.ValueType.UINT;
+};
+
+/**
+ * @param {es3fShaderOperatorTests.ValueType} type
+ * @return {boolean}
+ */
+es3fShaderOperatorTests.isFloatType = function(type) {
+ return (type & (es3fShaderOperatorTests.ValueType.FLOAT | es3fShaderOperatorTests.ValueType.FLOAT_VEC | es3fShaderOperatorTests.ValueType.FLOAT_GENTYPE)) != 0;
+};
+
+/**
+ * @param {gluShaderProgram.shaderType} shaderType
+ * @param {gluShaderUtil.precision} uintPrecision
+ * @return {number}
+ */
+es3fShaderOperatorTests.getGLSLUintMaxAsFloat = function(shaderType, uintPrecision) {
+ switch (uintPrecision) {
+ case gluShaderUtil.precision.PRECISION_LOWP:
+ var intPrecisionGL = gl.LOW_INT;
+ break;
+ case gluShaderUtil.precision.PRECISION_MEDIUMP:
+ var intPrecisionGL = gl.MEDIUM_INT;
+ break;
+ case gluShaderUtil.precision.PRECISION_HIGHP:
+ var intPrecisionGL = gl.HIGH_INT;
+ break;
+ default:
+ assertMsgOptions(false, 'Invalid shader type', false, false);
+ var intPrecisionGL = 0;
+ }
+
+ switch (shaderType) {
+ case gluShaderProgram.shaderType.VERTEX:
+ var shaderTypeGL = gl.VERTEX_SHADER;
+ break;
+ case gluShaderProgram.shaderType.FRAGMENT:
+ var shaderTypeGL = gl.FRAGMENT_SHADER;
+ break;
+ default:
+ assertMsgOptions(false, 'Invalid shader type', false, false);
+ var shaderTypeGL = 0;
+ }
+
+ /** @type {WebGLShaderPrecisionFormat } */ var sPrecision = gl.getShaderPrecisionFormat(shaderTypeGL, intPrecisionGL);
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'glGetShaderPrecisionFormat failed', false, true);
+
+ if (!deMath.deInBounds32(sPrecision.rangeMin, 8, 32))
+ throw new Error('Out of range');
+
+ var numBitsInType = sPrecision.rangeMin + 1;
+ return Math.pow(2, numBitsInType) - 1;
+};
+
+/**
+ * @enum
+ */
+es3fShaderOperatorTests.OperationType = {
+ FUNCTION: 0,
+ OPERATOR: 1,
+ SIDE_EFFECT_OPERATOR: 2 // Test the side-effect (as opposed to the result) of a side-effect operator.
+};
+
+/**
+ * swizzling indices for assigning the tested function output to the correct color channel
+ */
+es3fShaderOperatorTests.outIndices = [];
+es3fShaderOperatorTests.outIndices[1] = [0];
+es3fShaderOperatorTests.outIndices[2] = [1, 2];
+es3fShaderOperatorTests.outIndices[3] = [0, 1, 2];
+es3fShaderOperatorTests.outIndices[4] = [0, 1, 2, 3];
+
+var convert = function(input, dataType) {
+ switch (dataType) {
+ case gluShaderUtil.DataType.INT:
+ if (input instanceof Array) {
+ var ret = [];
+ for (var i = 0; i < input.length; i++)
+ ret[i] = deMath.intCast(input[i]);
+ return ret;
+ }
+ return deMath.intCast(input);
+ case gluShaderUtil.DataType.UINT:
+ if (input instanceof Array) {
+ var ret = [];
+ for (var i = 0; i < input.length; i++)
+ ret[i] = deMath.uintCast(input[i]);
+ return ret;
+ }
+ return deMath.uintCast(input);
+ case gluShaderUtil.DataType.BOOL:
+ if (input instanceof Array) {
+ var ret = [];
+ for (var i = 0; i < input.length; i++)
+ ret[i] = input[i] > 0 ? 1 : 0;
+ return ret;
+ }
+ return input > 0 ? 1 : 0;
+
+ }
+ return input;
+};
+
+/**
+ * Generate unary functions which have the same input and return type
+ * @param {function(number): number} func
+ * @param {gluShaderUtil.DataType=} dataTypeIn
+ * @param {gluShaderUtil.DataType=} dataTypeOut
+ */
+es3fShaderOperatorTests.unaryGenTypeFuncs = function(func, dataTypeOut, dataTypeIn) {
+ var run = function(output, func, input) {
+ if (input instanceof Array) {
+ var len = input.length;
+ var indices = es3fShaderOperatorTests.outIndices[len];
+ for (var i = 0; i < input.length; i++)
+ output[indices[i]] = convert(func(convert(input[i], dataTypeIn)), dataTypeOut);
+ } else
+ output[0] = convert(func(convert(input, dataTypeIn)), dataTypeOut);
+ };
+
+ var functions = {};
+ functions.scalar = function(c) { run(c.color, func, c.in_[0][2]); };
+ functions.vec2 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [3, 1])); };
+ functions.vec3 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [2, 0, 1])); };
+ functions.vec4 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [1, 2, 3, 0])); };
+ return functions;
+};
+
+/**
+ * Generate unary functions which have the same input and return type
+ * @param {function(Array<number>): Array<number>} func
+ * @param {gluShaderUtil.DataType=} dataTypeIn
+ * @param {gluShaderUtil.DataType=} dataTypeOut
+ */
+es3fShaderOperatorTests.unaryArrayFuncs = function(func, dataTypeOut, dataTypeIn) {
+ var run = function(output, func, input) {
+ var len = input.length;
+ var indices = es3fShaderOperatorTests.outIndices[len];
+ var value = convert(func(convert(input, dataTypeIn)), dataTypeOut);
+ for (var i = 0; i < input.length; i++)
+ output[indices[i]] = value[i];
+ };
+
+ var functions = {};
+ functions.scalar = function(c) { run(c.color, func, [c.in_[0][2]]); };
+ functions.vec2 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [3, 1])); };
+ functions.vec3 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [2, 0, 1])); };
+ functions.vec4 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [1, 2, 3, 0])); };
+ return functions;
+};
+
+/**
+ * Generate unary functions which always have scalar return type
+ * @param {function(Array<number>): number} func
+ * @param {gluShaderUtil.DataType=} dataTypeIn
+ * @param {gluShaderUtil.DataType=} dataTypeOut
+ */
+es3fShaderOperatorTests.unaryScalarGenTypeFuncs = function(func, dataTypeOut, dataTypeIn) {
+ var run = function(output, func, input) {
+ output[0] = convert(func(convert(input, dataTypeIn)), dataTypeOut);
+ };
+
+ var functions = {};
+ functions.scalar = function(c) { run(c.color, func, [c.in_[0][2]]); };
+ functions.vec2 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [3, 1])); };
+ functions.vec3 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [2, 0, 1])); };
+ functions.vec4 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [1, 2, 3, 0])); };
+ return functions;
+};
+
+/**
+ * Generate unary functions which always have bolean return type
+ * @param {function(Array<number>): boolean} func
+ * @param {gluShaderUtil.DataType=} dataTypeIn
+ * @param {gluShaderUtil.DataType=} dataTypeOut
+ */
+es3fShaderOperatorTests.unaryBooleanGenTypeFuncs = function(func, dataTypeOut, dataTypeIn) {
+ var run = function(output, func, input) {
+ output[0] = convert(func(convert(input, dataTypeIn)), dataTypeOut);
+ };
+
+ var functions = {};
+ functions.scalar = function(c) { run(c.color, func, [c.in_[0][2] > 0.0]); };
+ functions.vec2 = function(c) { run(c.color, func, greaterThanVec(deMath.swizzle(c.in_[0], [3, 1]), [0, 0])); };
+ functions.vec3 = function(c) { run(c.color, func, greaterThanVec(deMath.swizzle(c.in_[0], [2, 0, 1]), [0, 0, 0])); };
+ functions.vec4 = function(c) { run(c.color, func, greaterThanVec(deMath.swizzle(c.in_[0], [1, 2, 3, 0]), [0, 0, 0, 0])); };
+ return functions;
+};
+
+/**
+ * Generate binary functions which have the same input and return type
+ * @param {function(number, number): number} func
+ * @param {gluShaderUtil.DataType=} dataTypeIn
+ * @param {gluShaderUtil.DataType=} dataTypeOut
+ */
+es3fShaderOperatorTests.binaryGenTypeFuncs = function(func, dataTypeOut, dataTypeIn) {
+ var run = function(output, func, input1, input2) {
+ if (input1 instanceof Array) {
+ var len = input1.length;
+ var indices = es3fShaderOperatorTests.outIndices[len];
+ for (var i = 0; i < input1.length; i++)
+ output[indices[i]] = convert(func(convert(input1[i], dataTypeIn), convert(input2[i], dataTypeIn)), dataTypeOut);
+ } else {
+ var value = convert(func(convert(input1, dataTypeIn), convert(input2, dataTypeIn)), dataTypeOut);
+ output[0] = value;
+ }
+ };
+
+ var functions = {};
+ functions.scalar = function(c) { run(c.color, func, c.in_[0][2], c.in_[1][0]); };
+ functions.vec2 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [3, 1]), deMath.swizzle(c.in_[1], [1, 0])); };
+ functions.vec3 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [2, 0, 1]), deMath.swizzle(c.in_[1], [1, 2, 0])); };
+ functions.vec4 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [1, 2, 3, 0]), deMath.swizzle(c.in_[1], [3, 2, 1, 0])); };
+ return functions;
+};
+
+/**
+ * Generate binary functions which have the same input and return type
+ * @param {function(number, number, number): number} func
+ * @param {gluShaderUtil.DataType=} dataTypeIn
+ * @param {gluShaderUtil.DataType=} dataTypeOut
+ */
+es3fShaderOperatorTests.ternaryGenTypeFuncs = function(func, dataTypeOut, dataTypeIn) {
+ var run = function(output, func, input1, input2, input3) {
+ if (input1 instanceof Array) {
+ var len = input1.length;
+ var indices = es3fShaderOperatorTests.outIndices[len];
+ for (var i = 0; i < input1.length; i++)
+ output[indices[i]] = convert(func(convert(input1[i], dataTypeIn), convert(input2[i], dataTypeIn), convert(input3[i], dataTypeIn)), dataTypeOut);
+ } else {
+ var value = convert(func(convert(input1, dataTypeIn), convert(input2, dataTypeIn), convert(input3, dataTypeIn)), dataTypeOut);
+ output[0] = value;
+ }
+ };
+
+ var functions = {};
+ functions.scalar = function(c) { run(c.color, func, c.in_[0][2], c.in_[1][0], c.in_[2][1]); };
+ functions.vec2 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [3, 1]), deMath.swizzle(c.in_[1], [1, 0]), deMath.swizzle(c.in_[2], [2, 1])); };
+ functions.vec3 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [2, 0, 1]), deMath.swizzle(c.in_[1], [1, 2, 0]), deMath.swizzle(c.in_[2], [3, 1, 2])); };
+ functions.vec4 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [1, 2, 3, 0]), deMath.swizzle(c.in_[1], [3, 2, 1, 0]), deMath.swizzle(c.in_[2], [0, 3, 2, 1])); };
+ return functions;
+};
+
+/**
+ * Generate binary functions which have the same input and return type
+ * @param {function(Array<number>, Array<number>): number} func
+ * @param {gluShaderUtil.DataType=} dataTypeIn
+ * @param {gluShaderUtil.DataType=} dataTypeOut
+ */
+es3fShaderOperatorTests.binaryScalarGenTypeFuncs = function(func, dataTypeOut, dataTypeIn) {
+ var run = function(output, func, input1, input2) {
+ var value = convert(func(convert(input1, dataTypeIn), convert(input2, dataTypeIn)), dataTypeOut);
+ output[0] = value;
+ };
+
+ var functions = {};
+ functions.scalar = function(c) { run(c.color, func, [c.in_[0][2]], [c.in_[1][0]]); };
+ functions.vec2 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [3, 1]), deMath.swizzle(c.in_[1], [1, 0])); };
+ functions.vec3 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [2, 0, 1]), deMath.swizzle(c.in_[1], [1, 2, 0])); };
+ functions.vec4 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [1, 2, 3, 0]), deMath.swizzle(c.in_[1], [3, 2, 1, 0])); };
+ return functions;
+};
+
+/**
+ * Generate (cond ? a : b) functions
+ * @param {gluShaderUtil.DataType} dataType
+ * Returns an array of functions, indexed by datatype size
+ */
+es3fShaderOperatorTests.selectionFuncs = function(dataType) {
+ var run = function(output, input0, input1, input2) {
+ var value = selection(input0, input1, input2);
+ value = convert(value, dataType);
+ if (value instanceof Array) {
+ var len = value.length;
+ var indices = es3fShaderOperatorTests.outIndices[len];
+ for (var i = 0; i < len; i++)
+ output[indices[i]] = value[i];
+ } else
+ output[0] = value;
+ };
+
+ var functions = [];
+ functions[1] = function(c) { run(c.color, c.in_[0][2] > 0, c.in_[1][0], c.in_[2][1]); };
+ functions[2] = function(c) { run(c.color, c.in_[0][2] > 0, deMath.swizzle(c.in_[1], [1, 0]), deMath.swizzle(c.in_[2], [2, 1])); };
+ functions[3] = function(c) { run(c.color, c.in_[0][2] > 0, deMath.swizzle(c.in_[1], [1, 2, 0]), deMath.swizzle(c.in_[2], [3, 1, 2])); };
+ functions[4] = function(c) { run(c.color, c.in_[0][2] > 0, deMath.swizzle(c.in_[1], [3, 2, 1, 0]), deMath.swizzle(c.in_[2], [0, 3, 2, 1])); };
+ return functions;
+};
+
+var cp = function(dst, src) {
+ var len = src.length;
+ var indices = es3fShaderOperatorTests.outIndices[len];
+ for (var i = 0; i < len; i++)
+ dst[indices[i]] = src[i];
+};
+
+/**
+ * Generate binary functions of form: vec = func(scalar, vec)
+ * @param {function(number, Array<number>): Array<number>} func
+ * @param {gluShaderUtil.DataType=} dataTypeIn
+ * @param {gluShaderUtil.DataType=} dataTypeOut
+ */
+es3fShaderOperatorTests.binaryScalarVecFuncs = function(func, dataTypeOut, dataTypeIn) {
+ /**
+ * @param {function(number, Array<number>): Array<number>} func
+ * @param {number} input1
+ * @param {Array<number>} input2
+ */
+ var run = function(output, func, input1, input2) {
+ var in1 = convert(input1, dataTypeIn);
+ var in2 = convert(input2, dataTypeIn);
+ var value = func(in1, in2);
+ value = convert(value, dataTypeOut);
+ cp(output, value);
+ };
+ var functions = {};
+ functions.vec2 = function(c) { run(c.color, func, c.in_[0][2], deMath.swizzle(c.in_[1], [1, 0])); };
+ functions.vec3 = function(c) { run(c.color, func, c.in_[0][2], deMath.swizzle(c.in_[1], [1, 2, 0])); };
+ functions.vec4 = function(c) { run(c.color, func, c.in_[0][2], deMath.swizzle(c.in_[1], [3, 2, 1, 0])); };
+ return functions;
+};
+
+/**
+ * Generate binary functions of form: vec = func(vec, scalar)
+ * @param {function(Array<number>, number): Array<number>} func
+ * @param {gluShaderUtil.DataType=} dataTypeIn
+ * @param {gluShaderUtil.DataType=} dataTypeOut
+ */
+es3fShaderOperatorTests.binaryVecScalarFuncs = function(func, dataTypeOut, dataTypeIn) {
+ /**
+ * @param {function(Array<number>, number): Array<number>} func
+ * @param {Array<number>} input1
+ * @param {number} input2
+ */
+ var run = function(output, func, input1, input2) {
+ var in1 = convert(input1, dataTypeIn);
+ var in2 = convert(input2, dataTypeIn);
+ var value = func(in1, in2);
+ value = convert(value, dataTypeOut);
+ cp(output, value);
+ };
+ var functions = {};
+ functions.vec2 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [3, 1]), c.in_[1][0]); };
+ functions.vec3 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [2, 0, 1]), c.in_[1][0]); };
+ functions.vec4 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [1, 2, 3, 0]), c.in_[1][0]); };
+ return functions;
+};
+
+/**
+ * Generate binary functions of form: vec = func(vec, vec, scalar)
+ * @param {function(Array<number>, Array<number>, number): Array<number>} func
+ * @param {gluShaderUtil.DataType=} dataTypeIn
+ * @param {gluShaderUtil.DataType=} dataTypeOut
+ */
+es3fShaderOperatorTests.ternaryVecVecScalarFuncs = function(func, dataTypeOut, dataTypeIn) {
+ /**
+ * @param {function(Array<number>, Array<number>, number): Array<number>} func
+ * @param {Array<number>} input1
+ * @param {Array<number>} input2
+ * @param {number} input3
+ */
+ var run = function(output, func, input1, input2, input3) {
+ var in1 = convert(input1, dataTypeIn);
+ var in2 = convert(input2, dataTypeIn);
+ var in3 = convert(input3, dataTypeIn);
+ var value = func(in1, in2, in3);
+ value = convert(value, dataTypeOut);
+ cp(output, value);
+ };
+ var functions = {};
+ functions.scalar = function(c) { run(c.color, func, [c.in_[0][2]], [c.in_[1][0]], c.in_[2][1]); };
+ functions.vec2 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [3, 1]), deMath.swizzle(c.in_[1], [1, 0]), c.in_[2][1]); };
+ functions.vec3 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [2, 0, 1]), deMath.swizzle(c.in_[1], [1, 2, 0]), c.in_[2][1]); };
+ functions.vec4 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [1, 2, 3, 0]), deMath.swizzle(c.in_[1], [3, 2, 1, 0]), c.in_[2][1]); };
+ return functions;
+};
+
+/**
+ * Generate binary functions of form: vec = func(vec, scalar, scalar)
+ * @param {function(Array<number>, number, number): Array<number>} func
+ * @param {gluShaderUtil.DataType=} dataTypeIn
+ * @param {gluShaderUtil.DataType=} dataTypeOut
+ */
+es3fShaderOperatorTests.ternaryVecScalarScalarFuncs = function(func, dataTypeOut, dataTypeIn) {
+ /**
+ * @param {function(Array<number>, number, number): Array<number>} func
+ * @param {Array<number>} input1
+ * @param {number} input2
+ * @param {number} input3
+ */
+ var run = function(output, func, input1, input2, input3) {
+ var in1 = convert(input1, dataTypeIn);
+ var in2 = convert(input2, dataTypeIn);
+ var in3 = convert(input3, dataTypeIn);
+ var value = func(in1, in2, in3);
+ value = convert(value, dataTypeOut);
+ cp(output, value);
+ };
+ var functions = {};
+ functions.vec2 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [3, 1]), c.in_[1][0], c.in_[2][1]); };
+ functions.vec3 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [2, 0, 1]), c.in_[1][0], c.in_[2][1]); };
+ functions.vec4 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [1, 2, 3, 0]), c.in_[1][0], c.in_[2][1]); };
+ return functions;
+};
+
+/**
+ * Generate binary functions of form: vec = func(scalar, scalar, vec)
+ * @param {function(number, number, Array<number>): Array<number>} func
+ * @param {gluShaderUtil.DataType=} dataTypeIn
+ * @param {gluShaderUtil.DataType=} dataTypeOut
+ */
+es3fShaderOperatorTests.ternaryScalarScalarVecFuncs = function(func, dataTypeOut, dataTypeIn) {
+ /**
+ * @param {function(number, number, Array<number>): Array<number>} func
+ * @param {number} input1
+ * @param {number} input2
+ * @param {Array<number>} input3
+ */
+ var run = function(output, func, input1, input2, input3) {
+ var in1 = convert(input1, dataTypeIn);
+ var in2 = convert(input2, dataTypeIn);
+ var in3 = convert(input3, dataTypeIn);
+ var value = func(in1, in2, in3);
+ value = convert(value, dataTypeOut);
+ cp(output, value);
+ };
+ var functions = {};
+ functions.vec2 = function(c) { run(c.color, func, c.in_[0][2], c.in_[1][0], deMath.swizzle(c.in_[2], [2, 1])); };
+ functions.vec3 = function(c) { run(c.color, func, c.in_[0][2], c.in_[1][0], deMath.swizzle(c.in_[2], [3, 1, 2])); };
+ functions.vec4 = function(c) { run(c.color, func, c.in_[0][2], c.in_[1][0], deMath.swizzle(c.in_[2], [0, 3, 2, 1])); };
+ return functions;
+};
+
+/**
+ * Generate binary functions of form: vec = func(vec, vec, vec)
+ * @param {function(Array<number>, Array<number>, Array<number>): Array<number>} func
+ * @param {gluShaderUtil.DataType=} dataTypeIn
+ * @param {gluShaderUtil.DataType=} dataTypeOut
+ */
+es3fShaderOperatorTests.ternaryVecVecVecFuncs = function(func, dataTypeOut, dataTypeIn) {
+ /**
+ * @param {function(Array<number>, Array<number>, Array<number>): Array<number>} func
+ * @param {Array<number>} input1
+ * @param {Array<number>} input2
+ * @param {Array<number>} input3
+ */
+ var run = function(output, func, input1, input2, input3) {
+ var in1 = convert(input1, dataTypeIn);
+ var in2 = convert(input2, dataTypeIn);
+ var in3 = convert(input3, dataTypeIn);
+ var value = func(in1, in2, in3);
+ value = convert(value, dataTypeOut);
+ cp(output, value);
+ };
+ var functions = {};
+ functions.vec2 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [3, 1]), deMath.swizzle(c.in_[1], [1, 0]), deMath.swizzle(c.in_[2], [2, 1])); };
+ functions.vec3 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [2, 0, 1]), deMath.swizzle(c.in_[1], [1, 2, 0]), deMath.swizzle(c.in_[2], [3, 1, 2])); };
+ functions.vec4 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [1, 2, 3, 0]), deMath.swizzle(c.in_[1], [3, 2, 1, 0]), deMath.swizzle(c.in_[2], [0, 3, 2, 1])); };
+ return functions;
+};
+
+/**
+ * Generate binary functions of form: vec = func(vec, vec)
+ * @param {function(Array<number>, Array<number>): Array<number>} func
+ * @param {gluShaderUtil.DataType=} dataTypeIn
+ * @param {gluShaderUtil.DataType=} dataTypeOut
+ */
+es3fShaderOperatorTests.binaryVecVecFuncs = function(func, dataTypeOut, dataTypeIn) {
+ /**
+ * @param {function(Array<number>, Array<number>): Array<number>} func
+ * @param {Array<number>} input1
+ * @param {Array<number>} input2
+ */
+ var run = function(output, func, input1, input2) {
+ var in1 = convert(input1, dataTypeIn);
+ var in2 = convert(input2, dataTypeIn);
+ var value = func(in1, in2);
+ value = convert(value, dataTypeOut);
+ cp(output, value);
+ };
+ var functions = {};
+ functions.vec2 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [3, 1]), deMath.swizzle(c.in_[1], [1, 0])); };
+ functions.vec3 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [2, 0, 1]), deMath.swizzle(c.in_[1], [1, 2, 0])); };
+ functions.vec4 = function(c) { run(c.color, func, deMath.swizzle(c.in_[0], [1, 2, 3, 0]), deMath.swizzle(c.in_[1], [3, 2, 1, 0])); };
+ return functions;
+};
+
+/**
+ * @constructor
+ * @param {es3fShaderOperatorTests.ValueType} valueType
+ * @param {es3fShaderOperatorTests.FloatScalar} rangeMin
+ * @param {es3fShaderOperatorTests.FloatScalar} rangeMax
+ */
+es3fShaderOperatorTests.Value = function(valueType, rangeMin, rangeMax) {
+ this.valueType = valueType;
+ this.rangeMin = rangeMin;
+ this.rangeMax = rangeMax;
+};
+
+/**
+ * @enum
+ */
+es3fShaderOperatorTests.Symbol = {
+ SYMBOL_LOWP_UINT_MAX: 0,
+ SYMBOL_MEDIUMP_UINT_MAX: 1,
+
+ SYMBOL_LOWP_UINT_MAX_RECIPROCAL: 2,
+ SYMBOL_MEDIUMP_UINT_MAX_RECIPROCAL: 3,
+
+ SYMBOL_ONE_MINUS_UINT32MAX_DIV_LOWP_UINT_MAX: 4,
+ SYMBOL_ONE_MINUS_UINT32MAX_DIV_MEDIUMP_UINT_MAX: 5
+
+};
+
+/**
+ * @constructor
+ * @param {number|es3fShaderOperatorTests.Symbol} value
+ * @param {boolean=} isSymbol
+ */
+es3fShaderOperatorTests.FloatScalar = function(value, isSymbol) {
+ if (isSymbol)
+ this.symbol = /** @type {es3fShaderOperatorTests.Symbol} */ (value);
+ else
+ this.constant = /** @type {number} */ (value);
+};
+
+/**
+ * @param {gluShaderProgram.shaderType} shaderType
+ * @return {number}
+ */
+es3fShaderOperatorTests.FloatScalar.prototype.getValue = function(shaderType) {
+ if (this.constant !== undefined)
+ return this.constant;
+ else
+ switch (this.symbol) {
+ case es3fShaderOperatorTests.Symbol.SYMBOL_LOWP_UINT_MAX:
+ return es3fShaderOperatorTests.getGLSLUintMaxAsFloat(shaderType, gluShaderUtil.precision.PRECISION_LOWP);
+ case es3fShaderOperatorTests.Symbol.SYMBOL_MEDIUMP_UINT_MAX:
+ return es3fShaderOperatorTests.getGLSLUintMaxAsFloat(shaderType, gluShaderUtil.precision.PRECISION_MEDIUMP);
+
+ case es3fShaderOperatorTests.Symbol.SYMBOL_LOWP_UINT_MAX_RECIPROCAL:
+ return 1.0 / es3fShaderOperatorTests.getGLSLUintMaxAsFloat(shaderType, gluShaderUtil.precision.PRECISION_LOWP);
+ case es3fShaderOperatorTests.Symbol.SYMBOL_MEDIUMP_UINT_MAX_RECIPROCAL:
+ return 1.0 / es3fShaderOperatorTests.getGLSLUintMaxAsFloat(shaderType, gluShaderUtil.precision.PRECISION_MEDIUMP);
+
+ case es3fShaderOperatorTests.Symbol.SYMBOL_ONE_MINUS_UINT32MAX_DIV_LOWP_UINT_MAX:
+ return 1.0 - 0xFFFFFFFF / es3fShaderOperatorTests.getGLSLUintMaxAsFloat(shaderType, gluShaderUtil.precision.PRECISION_LOWP);
+ case es3fShaderOperatorTests.Symbol.SYMBOL_ONE_MINUS_UINT32MAX_DIV_MEDIUMP_UINT_MAX:
+ return 1.0 - 0xFFFFFFFF / es3fShaderOperatorTests.getGLSLUintMaxAsFloat(shaderType, gluShaderUtil.precision.PRECISION_MEDIUMP);
+
+ default:
+ assertMsgOptions(false, 'Invalid shader type', false, false);
+ return 0.0;
+ }
+};
+
+/**
+ * @constructor
+ * @param {gluShaderUtil.DataType=} type
+ * @param {es3fShaderOperatorTests.FloatScalar=} rangeMin
+ * @param {es3fShaderOperatorTests.FloatScalar=} rangeMax
+ */
+es3fShaderOperatorTests.ShaderValue = function(type, rangeMin, rangeMax) {
+ this.type = type || gluShaderUtil.DataType.INVALID;
+ this.rangeMin = rangeMin || new es3fShaderOperatorTests.FloatScalar(0);
+ this.rangeMax = rangeMax || new es3fShaderOperatorTests.FloatScalar(0);
+};
+
+/**
+ * @constructor
+ */
+es3fShaderOperatorTests.ShaderDataSpec = function() {
+ /** @type {es3fShaderOperatorTests.FloatScalar} */ this.resultScale = new es3fShaderOperatorTests.FloatScalar(1);
+ /** @type {es3fShaderOperatorTests.FloatScalar} */ this.resultBias = new es3fShaderOperatorTests.FloatScalar(0);
+ /** @type {es3fShaderOperatorTests.FloatScalar} */ this.referenceScale = new es3fShaderOperatorTests.FloatScalar(1);
+ /** @type {es3fShaderOperatorTests.FloatScalar} */ this.referenceBias = new es3fShaderOperatorTests.FloatScalar(0);
+ /** @type {es3fShaderOperatorTests.Precision} */ this.precision = es3fShaderOperatorTests.Precision.None;
+ /** @type {gluShaderUtil.DataType} */ this.output;
+ /** @type {number} */ this.numInputs = 0;
+ /** @type {Array<es3fShaderOperatorTests.ShaderValue>}*/ this.inputs = [];
+ for (var i = 0; i < es3fShaderOperatorTests.MAX_INPUTS; i++)
+ this.inputs[i] = new es3fShaderOperatorTests.ShaderValue();
+};
+
+/**
+ * @constructor
+ * @struct
+ * @param {string} caseName
+ * @param {string} shaderFuncName
+ * @param {es3fShaderOperatorTests.ValueType} outValue
+ * @param {Array<es3fShaderOperatorTests.Value>} inputs
+ * @param {es3fShaderOperatorTests.FloatScalar} resultScale
+ * @param {es3fShaderOperatorTests.FloatScalar} resultBias
+ * @param {es3fShaderOperatorTests.FloatScalar} referenceScale
+ * @param {es3fShaderOperatorTests.FloatScalar} referenceBias
+ * @param {gluShaderUtil.precision} precision
+ * @param {*} functions
+ * @param {es3fShaderOperatorTests.OperationType=} type
+ * @param {boolean=} isUnaryPrefix
+ */
+es3fShaderOperatorTests.BuiltinFuncInfo = function(caseName, shaderFuncName, outValue, inputs, resultScale, resultBias, referenceScale, referenceBias, precision, functions, type, isUnaryPrefix) {
+ this.caseName = caseName;
+ this.shaderFuncName = shaderFuncName;
+ this.outValue = outValue;
+ this.inputs = inputs;
+ this.resultScale = resultScale;
+ this.resultBias = resultBias;
+ this.referenceScale = referenceScale;
+ this.referenceBias = referenceBias;
+ this.precision = precision;
+ this.evalFunctions = functions;
+ this.type = type || es3fShaderOperatorTests.OperationType.FUNCTION;
+ this.isUnaryPrefix = isUnaryPrefix === undefined ? true : isUnaryPrefix;
+};
+
+es3fShaderOperatorTests.builtinOperInfo = function(caseName, shaderFuncName, outValue, inputs, scale, bias, precision, functions) {
+ return new es3fShaderOperatorTests.BuiltinFuncInfo(caseName,
+ shaderFuncName,
+ outValue,
+ inputs,
+ scale,
+ bias,
+ scale,
+ bias,
+ precision,
+ functions,
+ es3fShaderOperatorTests.OperationType.OPERATOR);
+};
+
+es3fShaderOperatorTests.builtinFunctionInfo = function(caseName, shaderFuncName, outValue, inputs, scale, bias, precision, functions) {
+ return new es3fShaderOperatorTests.BuiltinFuncInfo(caseName,
+ shaderFuncName,
+ outValue,
+ inputs,
+ scale,
+ bias,
+ scale,
+ bias,
+ precision,
+ functions,
+ es3fShaderOperatorTests.OperationType.FUNCTION);
+};
+
+es3fShaderOperatorTests.builtinSideEffOperInfo = function(caseName, shaderFuncName, outValue, inputs, scale, bias, precision, functions) {
+ return new es3fShaderOperatorTests.BuiltinFuncInfo(caseName,
+ shaderFuncName,
+ outValue,
+ inputs,
+ scale,
+ bias,
+ scale,
+ bias,
+ precision,
+ functions,
+ es3fShaderOperatorTests.OperationType.SIDE_EFFECT_OPERATOR);
+};
+
+es3fShaderOperatorTests.builtinOperInfoSeparateRefScaleBias = function(caseName, shaderFuncName, outValue, inputs, scale, bias, precision, functions, referenceScale, referenceBias) {
+ return new es3fShaderOperatorTests.BuiltinFuncInfo(caseName,
+ shaderFuncName,
+ outValue,
+ inputs,
+ scale,
+ bias,
+ referenceScale,
+ referenceBias,
+ precision,
+ functions,
+ es3fShaderOperatorTests.OperationType.OPERATOR);
+};
+
+es3fShaderOperatorTests.BuiltinPostSideEffOperInfo = function(caseName, shaderFuncName, outValue, inputs, scale, bias, precision, functions) {
+ return new es3fShaderOperatorTests.BuiltinFuncInfo(caseName,
+ shaderFuncName,
+ outValue,
+ inputs,
+ scale,
+ bias,
+ scale,
+ bias,
+ precision,
+ functions,
+ es3fShaderOperatorTests.OperationType.SIDE_EFFECT_OPERATOR,
+ false);
+};
+es3fShaderOperatorTests.BuiltinPostOperInfo = function(caseName, shaderFuncName, outValue, inputs, scale, bias, precision, functions) {
+ return new es3fShaderOperatorTests.BuiltinFuncInfo(caseName,
+ shaderFuncName,
+ outValue,
+ inputs,
+ scale,
+ bias,
+ scale,
+ bias,
+ precision,
+ functions,
+ es3fShaderOperatorTests.OperationType.OPERATOR,
+ false);
+};
+
+/**
+ * @constructor
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderOperatorTests.BuiltinFuncGroup = function(name, description) {
+ this.name = name;
+ this.description = description;
+ this.funcInfos = [];
+};
+
+es3fShaderOperatorTests.BuiltinFuncGroup.prototype.push = function(a) { this.funcInfos.push(a); };
+
+var s_inSwizzles = [
+
+ ['z', 'wy', 'zxy', 'yzwx'],
+ ['x', 'yx', 'yzx', 'wzyx'],
+ ['y', 'zy', 'wyz', 'xwzy']
+];
+
+var s_outSwizzles = ['x', 'yz', 'xyz', 'xyzw'];
+
+var s_outSwizzleChannelMasks = [
+ [true, false, false, false],
+ [false, true, true, false],
+ [true, true, true, false],
+ [true, true, true, true]
+];
+
+/**
+ * @constructor
+ * @extends {glsShaderRenderCase.ShaderEvaluator}
+ * @param {gluShaderProgram.shaderType} shaderType
+ * @param {glsShaderRenderCase.ShaderEvalFunc} evalFunc
+ * @param {es3fShaderOperatorTests.FloatScalar} scale
+ * @param {es3fShaderOperatorTests.FloatScalar} bias
+ * @param {number} resultScalarSize
+ */
+es3fShaderOperatorTests.OperatorShaderEvaluator = function(shaderType, evalFunc, scale, bias, resultScalarSize) {
+ glsShaderRenderCase.ShaderEvaluator.call(this, evalFunc);
+ this.m_shaderType = shaderType;
+ this.m_scale = scale;
+ this.m_bias = bias;
+ this.m_resultScalarSize = resultScalarSize;
+ this.m_areScaleAndBiasEvaluated = false;
+};
+
+setParentClass(es3fShaderOperatorTests.OperatorShaderEvaluator, glsShaderRenderCase.ShaderEvaluator);
+
+es3fShaderOperatorTests.OperatorShaderEvaluator.prototype.evaluate = function(ctx) {
+ this.m_evalFunc(ctx);
+
+ if (!this.m_areScaleAndBiasEvaluated) {
+ this.m_evaluatedScale = this.m_scale.getValue(this.m_shaderType);
+ this.m_evaluatedBias = this.m_bias.getValue(this.m_shaderType);
+ this.m_areScaleAndBiasEvaluated = true;
+ }
+
+ for (var i = 0; i < 4; i++)
+ if (s_outSwizzleChannelMasks[this.m_resultScalarSize - 1][i])
+ ctx.color[i] = ctx.color[i] * this.m_evaluatedScale + this.m_evaluatedBias;
+};
+
+/**
+ * @constructor
+ * @extends {glsShaderRenderCase.ShaderRenderCase}
+ * @param {string} caseName
+ * @param {string} description
+ * @param {boolean} isVertexCase
+ * @param {glsShaderRenderCase.ShaderEvalFunc} evalFunc
+ * @param {string} shaderOp
+ * @param {es3fShaderOperatorTests.ShaderDataSpec} spec
+ */
+es3fShaderOperatorTests.ShaderOperatorCase = function(caseName, description, isVertexCase, evalFunc, shaderOp, spec) {
+ glsShaderRenderCase.ShaderRenderCase.call(this, caseName, description, isVertexCase, evalFunc);
+ this.m_spec = spec;
+ this.m_shaderOp = shaderOp;
+ var shaderType = isVertexCase ? gluShaderProgram.shaderType.VERTEX : gluShaderProgram.shaderType.FRAGMENT;
+ this.m_evaluator = new es3fShaderOperatorTests.OperatorShaderEvaluator(shaderType,
+ evalFunc,
+ spec.referenceScale,
+ spec.referenceBias,
+ gluShaderUtil.getDataTypeScalarSize(spec.output));
+};
+
+setParentClass(es3fShaderOperatorTests.ShaderOperatorCase, glsShaderRenderCase.ShaderRenderCase);
+
+es3fShaderOperatorTests.ShaderOperatorCase.prototype.setupShaderData = function() {
+ var shaderType = this.m_isVertexCase ? gluShaderProgram.shaderType.VERTEX : gluShaderProgram.shaderType.FRAGMENT;
+ var precision = this.m_spec.precision !== undefined ? gluShaderUtil.getPrecisionName(this.m_spec.precision) : null;
+ var inputPrecision = [];
+ var sources = [];
+ sources[0] = ''; //vertex
+ sources[1] = ''; //fragment
+ var vtx = 0;
+ var frag = 1;
+ var op = this.m_isVertexCase ? vtx : frag;
+
+ sources[vtx] += '#version 300 es\n';
+ sources[frag] += '#version 300 es\n';
+
+ // Compute precision for inputs.
+ for (var i = 0; i < this.m_spec.numInputs; i++) {
+ var isBoolVal = gluShaderUtil.isDataTypeBoolOrBVec(this.m_spec.inputs[i].type);
+ var isIntVal = gluShaderUtil.isDataTypeIntOrIVec(this.m_spec.inputs[i].type);
+ var isUintVal = gluShaderUtil.isDataTypeUintOrUVec(this.m_spec.inputs[i].type);
+ // \note Mediump interpolators are used for booleans, and highp for integers.
+ var prec = isBoolVal ? gluShaderUtil.precision.PRECISION_MEDIUMP :
+ isIntVal || isUintVal ? gluShaderUtil.precision.PRECISION_HIGHP :
+ this.m_spec.precision;
+ inputPrecision[i] = gluShaderUtil.getPrecisionName(prec);
+ }
+
+ // Attributes.
+ sources[vtx] += 'in highp vec4 a_position;\n';
+ for (var i = 0; i < this.m_spec.numInputs; i++)
+ sources[vtx] += 'in ' + inputPrecision[i] + ' vec4 a_in' + i + ';\n';
+
+ // Color output.
+ sources[frag] += 'layout(location = 0) out mediump vec4 o_color;\n';
+
+ if (this.m_isVertexCase) {
+ sources[vtx] += 'out mediump vec4 v_color;\n';
+ sources[frag] += 'in mediump vec4 v_color;\n';
+ } else{
+ for (var i = 0; i < this.m_spec.numInputs; i++) {
+ sources[vtx] += 'out ' + inputPrecision[i] + ' vec4 v_in' + i + ';\n';
+ sources[frag] += 'in ' + inputPrecision[i] + ' vec4 v_in' + i + ';\n';
+ }
+ }
+
+ sources[vtx] += '\n';
+ sources[vtx] += 'void main()\n';
+ sources[vtx] += '{\n';
+ sources[vtx] += ' gl_Position = a_position;\n';
+
+ sources[frag] += '\n';
+ sources[frag] += 'void main()\n';
+ sources[frag] += '{\n';
+
+ // Expression inputs.
+ var prefix = this.m_isVertexCase ? 'a_' : 'v_';
+ for (var i = 0; i < this.m_spec.numInputs; i++) {
+ var inType = this.m_spec.inputs[i].type;
+ var inSize = gluShaderUtil.getDataTypeScalarSize(inType);
+ var isInt = gluShaderUtil.isDataTypeIntOrIVec(inType);
+ var isUint = gluShaderUtil.isDataTypeUintOrUVec(inType);
+ var isBool = gluShaderUtil.isDataTypeBoolOrBVec(inType);
+ var typeName = gluShaderUtil.getDataTypeName(inType);
+ var swizzle = s_inSwizzles[i][inSize - 1];
+
+ sources[op] += '\t';
+ if (precision && !isBool) sources[op] += precision + ' ';
+
+ sources[op] += typeName + ' in' + i + ' = ';
+
+ if (isBool) {
+ if (inSize == 1) sources[op] += '(';
+ else sources[op] += 'greaterThan(';
+ } else if (isInt || isUint)
+ sources[op] += typeName + '(';
+
+ sources[op] += prefix + 'in' + i + '.' + swizzle;
+
+ if (isBool) {
+ if (inSize == 1) sources[op] += ' > 0.0)';
+ else sources[op] += ', vec' + inSize + '(0.0))';
+ } else if (isInt || isUint)
+ sources[op] += ')';
+
+ sources[op] += ';\n';
+ }
+
+ // Result variable.
+ var outTypeName = gluShaderUtil.getDataTypeName(this.m_spec.output);
+ var isBoolOut = gluShaderUtil.isDataTypeBoolOrBVec(this.m_spec.output);
+
+ sources[op] += '\t';
+ if (precision && !isBoolOut) sources[op] += precision + ' ';
+ sources[op] += outTypeName + ' res = ' + outTypeName + '(0.0);\n\n';
+
+
+ // Expression.
+ sources[op] += '\t' + this.m_shaderOp + '\n\n';
+
+ // Convert to color.
+ var isResFloatVec = gluShaderUtil.isDataTypeFloatOrVec(this.m_spec.output);
+ var outScalarSize = gluShaderUtil.getDataTypeScalarSize(this.m_spec.output);
+
+ sources[op] += '\thighp vec4 color = vec4(0.0, 0.0, 0.0, 1.0);\n';
+ sources[op] += '\tcolor.' + s_outSwizzles[outScalarSize - 1] + ' = ';
+
+ if (!isResFloatVec && outScalarSize == 1)
+ sources[op] += 'float(res)';
+ else if (!isResFloatVec)
+ sources[op] += 'vec' + outScalarSize + '(res)';
+ else
+ sources[op] += 'res';
+
+ sources[op] += ';\n';
+
+ // Scale & bias.
+ var resultScale = this.m_spec.resultScale.getValue(shaderType);
+ var resultBias = this.m_spec.resultBias.getValue(shaderType);
+ if ((resultScale != 1.0) || (resultBias != 0.0)) {
+ sources[op] += '\tcolor = color';
+ if (resultScale != 1.0) sources[op] += ' * ' + es3fShaderOperatorTests.twoValuedVec4(resultScale.toString(10), '1.0', s_outSwizzleChannelMasks[outScalarSize - 1]);
+ if (resultBias != 0.0) sources[op] += ' + ' + es3fShaderOperatorTests.twoValuedVec4(resultBias.toString(10), '0.0', s_outSwizzleChannelMasks[outScalarSize - 1]);
+ sources[op] += ';\n';
+ }
+
+ // ..
+ if (this.m_isVertexCase) {
+ sources[vtx] += ' v_color = color;\n';
+ sources[frag] += ' o_color = v_color;\n';
+ } else{
+ for (var i = 0; i < this.m_spec.numInputs; i++)
+ sources[vtx] += ' v_in' + i + ' = a_in' + i + ';\n';
+ sources[frag] += ' o_color = color;\n';
+ }
+
+ sources[vtx] += '}\n';
+ sources[frag] += '}\n';
+
+ this.m_vertShaderSource = sources[vtx];
+ this.m_fragShaderSource = sources[frag];
+
+ // Setup the user attributes.
+ this.m_userAttribTransforms = [];
+ for (var inputNdx = 0; inputNdx < this.m_spec.numInputs; inputNdx++) {
+ var v = this.m_spec.inputs[inputNdx];
+
+ var rangeMin = v.rangeMin.getValue(shaderType);
+ var rangeMax = v.rangeMax.getValue(shaderType);
+ var scale = rangeMax - rangeMin;
+ var minBias = rangeMin;
+ var maxBias = rangeMax;
+ var attribMatrix = new tcuMatrix.Matrix(4, 4);
+
+ for (var rowNdx = 0; rowNdx < 4; rowNdx++) {
+ var row;
+
+ switch ((rowNdx + inputNdx) % 4) {
+ case 0: row = [scale, 0.0, 0.0, minBias]; break;
+ case 1: row = [0.0, scale, 0.0, minBias]; break;
+ case 2: row = [-scale, 0.0, 0.0, maxBias]; break;
+ case 3: row = [0.0, -scale, 0.0, maxBias]; break;
+ default: throw new Error('Invalid row index');
+ }
+
+ attribMatrix.setRow(rowNdx, row);
+ }
+
+ this.m_userAttribTransforms[inputNdx] = attribMatrix;
+ }
+
+};
+
+// Reference functions for specific sequence operations for the sequence operator tests.
+/**
+ * Reference for expression "in0, in2 + in1, in1 + in0"
+ * @param {Array<number>} in0 Vec4
+ * @param {Array<number>} in1 Vec4
+ * @param {Array<number>} in2 Vec4
+ * @return {Array<number>} Vec4
+ */
+es3fShaderOperatorTests.sequenceNoSideEffCase0 = function(in0, in1, in2) {
+ return deMath.add(in1, in0);
+};
+
+/**
+ * Reference for expression "in0, in2 + in1, in1 + in0"
+ * @param {number} in0 float
+ * @param {number} in1 deUint32
+ * @param {number} in2 float
+ * @return {number} deUint32
+ */
+es3fShaderOperatorTests.sequenceNoSideEffCase1 = function(in0, in1, in2) {
+ in1 = convert(in1, gluShaderUtil.DataType.UINT);
+ return convert(in1 + in1, gluShaderUtil.DataType.UINT);
+};
+
+/**
+ * Reference for expression "in0 && in1, in0, ivec2(vec2(in0) + in2)"
+ * @param {boolean} in0
+ * @param {boolean} in1
+ * @param {Array<number>} in2 Vec2
+ * @return {Array<number>} IVec2
+ */
+es3fShaderOperatorTests.sequenceNoSideEffCase2 = function(in0, in1, in2) {
+ in0 = convert(in0, gluShaderUtil.DataType.BOOL);
+ return convert([in0 + in2[0], in0 + in2[1]], gluShaderUtil.DataType.INT);
+};
+
+/**
+ * Reference for expression "in0 + vec4(in1), in2, in1"
+ * @param {Array<number>} in0 Vec4
+ * @param {Array<number>} in1 IVec4
+ * @param {Array<boolean>} in2 BVec4
+ * @return {Array<number>} IVec4
+ */
+es3fShaderOperatorTests.sequenceNoSideEffCase3 = function(in0, in1, in2) {
+ return convert(in1, gluShaderUtil.DataType.INT);
+};
+
+/**
+ * Reference for expression "in0++, in1 = in0 + in2, in2 = in1"
+ * @param {Array<number>} in0 Vec4
+ * @param {Array<number>} in1 Vec4
+ * @param {Array<number>} in2 Vec4
+ * @return {Array<number>} Vec4
+ */
+es3fShaderOperatorTests.sequenceSideEffCase0 = function(in0, in1, in2) {
+ return deMath.add(deMath.add(in0, [1.0, 1.0, 1.0, 1.0]), in2);
+};
+
+/**
+ * Reference for expression "in1++, in0 = float(in1), in1 = uint(in0 + in2)"
+ * @param {number} in0 float
+ * @param {number} in1 deUint32
+ * @param {number} in2 float
+ * @return {number} deUint32
+ */
+es3fShaderOperatorTests.sequenceSideEffCase1 = function(in0, in1, in2) {
+ in1 = convert(in1, gluShaderUtil.DataType.UINT);
+ return convert(in1 + 1.0 + in2, gluShaderUtil.DataType.UINT);
+};
+
+/**
+ * Reference for expression "in1 = in0, in2++, in2 = in2 + vec2(in1), ivec2(in2)"
+ * @param {boolean} in0
+ * @param {boolean} in1
+ * @param {Array<number>} in2 Vec2
+ * @return {Array<number>} IVec2
+ */
+es3fShaderOperatorTests.sequenceSideEffCase2 = function(in0, in1, in2) {
+ in0 = convert(in0, gluShaderUtil.DataType.BOOL);
+ return convert(deMath.add(deMath.add(in2, [1.0, 1.0]), [in0, in0]), gluShaderUtil.DataType.INT);
+};
+
+/**
+ * Reference for expression "in0 = in0 + vec4(in2), in1 = in1 + ivec4(in0), in1++"
+ * @param {Array<number>} in0 Vec4
+ * @param {Array<number>} in1 IVec4
+ * @param {Array<boolean>} in2 BVec4
+ * @return {Array<number>} IVec4
+ */
+es3fShaderOperatorTests.sequenceSideEffCase3 = function(in0, in1, in2) {
+ in1 = convert(in1, gluShaderUtil.DataType.INT);
+ in2 = convert(in2, gluShaderUtil.DataType.BOOL);
+ in0 = deMath.add(in0, in2);
+ in1 = deMath.add(in1, convert(in0, gluShaderUtil.DataType.INT));
+ return in1;
+};
+
+// ShaderEvalFunc-type wrappers for the above functions.
+
+/** @param {glsShaderRenderCase.ShaderEvalContext} ctx */
+es3fShaderOperatorTests.evalSequenceNoSideEffCase0 = function(ctx) {
+ ctx.color = es3fShaderOperatorTests.sequenceNoSideEffCase0(
+ deMath.swizzle(ctx.in_[0], [1, 2, 3, 0]),
+ deMath.swizzle(ctx.in_[1], [3, 2, 1, 0]),
+ deMath.swizzle(ctx.in_[2], [0, 3, 2, 1])
+ );
+};
+
+/** @param {glsShaderRenderCase.ShaderEvalContext} ctx */
+es3fShaderOperatorTests.evalSequenceNoSideEffCase1 = function(ctx) {
+ ctx.color[0] = es3fShaderOperatorTests.sequenceNoSideEffCase1(
+ ctx.in_[0][2],
+ ctx.in_[1][0],
+ ctx.in_[2][1]
+ );
+};
+
+/** @param {glsShaderRenderCase.ShaderEvalContext} ctx */
+es3fShaderOperatorTests.evalSequenceNoSideEffCase2 = function(ctx) {
+ /** @type {Array<number>} */ var result = es3fShaderOperatorTests.sequenceNoSideEffCase2(
+ ctx.in_[0][2] > 0.0,
+ ctx.in_[1][0] > 0.0,
+ deMath.swizzle(ctx.in_[2], [2, 1])
+ );
+ ctx.color[1] = result[0];
+ ctx.color[2] = result[1];
+};
+
+/** @param {glsShaderRenderCase.ShaderEvalContext} ctx */
+es3fShaderOperatorTests.evalSequenceNoSideEffCase3 = function(ctx) {
+ ctx.color = es3fShaderOperatorTests.sequenceNoSideEffCase3(
+ deMath.swizzle(ctx.in_[0], [1, 2, 3, 0]),
+ deMath.swizzle(ctx.in_[1], [3, 2, 1, 0]),
+ deMath.greaterThan(deMath.swizzle(ctx.in_[2], [0, 3, 2, 1]), [0.0, 0.0, 0.0, 0.0])
+ );
+};
+
+/** @param {glsShaderRenderCase.ShaderEvalContext} ctx */
+es3fShaderOperatorTests.evalSequenceSideEffCase0 = function(ctx) {
+ ctx.color = es3fShaderOperatorTests.sequenceSideEffCase0(
+ deMath.swizzle(ctx.in_[0], [1, 2, 3, 0]),
+ deMath.swizzle(ctx.in_[1], [3, 2, 1, 0]),
+ deMath.swizzle(ctx.in_[2], [0, 3, 2, 1])
+ );
+};
+
+/** @param {glsShaderRenderCase.ShaderEvalContext} ctx */
+es3fShaderOperatorTests.evalSequenceSideEffCase1 = function(ctx) {
+ ctx.color[0] = es3fShaderOperatorTests.sequenceSideEffCase1(
+ ctx.in_[0][2],
+ ctx.in_[1][0],
+ ctx.in_[2][1]
+ );
+};
+
+/** @param {glsShaderRenderCase.ShaderEvalContext} ctx */
+es3fShaderOperatorTests.evalSequenceSideEffCase2 = function(ctx) {
+ /** @type {Array<number>} */ var result = es3fShaderOperatorTests.sequenceSideEffCase2(
+ ctx.in_[0][2] > 0.0,
+ ctx.in_[1][0] > 0.0,
+ deMath.swizzle(ctx.in_[2], [2, 1])
+ );
+ ctx.color[1] = result[0];
+ ctx.color[2] = result[1];
+};
+
+/** @param {glsShaderRenderCase.ShaderEvalContext} ctx */
+es3fShaderOperatorTests.evalSequenceSideEffCase3 = function(ctx) {
+ ctx.color = es3fShaderOperatorTests.sequenceSideEffCase3(
+ deMath.swizzle(ctx.in_[0], [1, 2, 3, 0]),
+ deMath.swizzle(ctx.in_[1], [3, 2, 1, 0]),
+ deMath.greaterThan(deMath.swizzle(ctx.in_[2], [0, 3, 2, 1]), [0.0, 0.0, 0.0, 0.0])
+ );
+};
+
+/**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+es3fShaderOperatorTests.ShaderOperatorTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'shaderop', 'Shader operators tests');
+};
+
+setParentClass(es3fShaderOperatorTests.ShaderOperatorTests, tcuTestCase.DeqpTest);
+
+es3fShaderOperatorTests.ShaderOperatorTests.prototype.init = function() {
+ var op = es3fShaderOperatorTests.builtinOperInfo;
+ var side = es3fShaderOperatorTests.builtinSideEffOperInfo;
+ var separate = es3fShaderOperatorTests.builtinOperInfoSeparateRefScaleBias;
+ var postSide = es3fShaderOperatorTests.BuiltinPostSideEffOperInfo;
+ var postOp = es3fShaderOperatorTests.BuiltinPostOperInfo;
+ var all = es3fShaderOperatorTests.Precision.All;
+ var highp = es3fShaderOperatorTests.Precision.High;
+ var mediump = es3fShaderOperatorTests.Precision.Medium;
+ var mediumhighp = es3fShaderOperatorTests.Precision.MediumHigh;
+ var lowp = es3fShaderOperatorTests.Precision.Low;
+ var na = es3fShaderOperatorTests.Precision.None;
+ var GT = es3fShaderOperatorTests.ValueType.FLOAT_GENTYPE;
+ var UGT = es3fShaderOperatorTests.ValueType.UINT_GENTYPE;
+ var IGT = es3fShaderOperatorTests.ValueType.INT_GENTYPE;
+ var BGT = es3fShaderOperatorTests.ValueType.BOOL_GENTYPE;
+ var F = es3fShaderOperatorTests.ValueType.FLOAT;
+ var I = es3fShaderOperatorTests.ValueType.INT;
+ var U = es3fShaderOperatorTests.ValueType.UINT;
+ var BV = es3fShaderOperatorTests.ValueType.BOOL_VEC;
+ var FV = es3fShaderOperatorTests.ValueType.FLOAT_VEC;
+ var IV = es3fShaderOperatorTests.ValueType.INT_VEC;
+ var UV = es3fShaderOperatorTests.ValueType.UINT_VEC;
+ var B = es3fShaderOperatorTests.ValueType.BOOL;
+ var V3 = es3fShaderOperatorTests.ValueType.VEC3;
+ var lUMax = es3fShaderOperatorTests.Symbol.SYMBOL_LOWP_UINT_MAX;
+ var mUMax = es3fShaderOperatorTests.Symbol.SYMBOL_MEDIUMP_UINT_MAX;
+ var lUMaxR = es3fShaderOperatorTests.Symbol.SYMBOL_LOWP_UINT_MAX_RECIPROCAL;
+ var mUMaxR = es3fShaderOperatorTests.Symbol.SYMBOL_MEDIUMP_UINT_MAX_RECIPROCAL;
+ var f = function(value) {
+ return new es3fShaderOperatorTests.FloatScalar(value);
+ };
+ var s = function(value) {
+ return new es3fShaderOperatorTests.FloatScalar(value, true);
+ };
+ var v = function(type, a, b) {
+ return new es3fShaderOperatorTests.Value(type, f(a), f(b));
+ };
+ var v2 = function(type, a, b) {
+ return new es3fShaderOperatorTests.Value(type, f(a), s(b));
+ };
+ var funcInfoGroups = [];
+ var unary = new es3fShaderOperatorTests.BuiltinFuncGroup('unary_operator', 'Unary operator tests');
+ funcInfoGroups.push(unary);
+
+ unary.push(op('plus', '+', GT, [v(GT, -1.0, 1.0)], f(0.5), f(0.5), all,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(nop)));
+ unary.push(op('plus', '+', IGT, [v(IGT, -5.0, 5.0)], f(0.1), f(0.5), all,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(nop, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ unary.push(op('plus', '+', UGT, [v(UGT, 0.0, 2e2)], f(5e-3), f(0.0), all,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(nop, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ unary.push(op('minus', '-', GT, [v(GT, -1.0, 1.0)], f(0.5), f(0.5), all,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(negate)));
+ unary.push(op('minus', '-', IGT, [v(IGT, -5.0, 5.0)], f(0.1), f(0.5), all,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(negate, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ unary.push(separate('minus', '-', UGT, [v2(UGT, 0.0, lUMax)], s(lUMaxR), f(0.0), lowp,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(negate, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT), s(lUMaxR),
+ s(es3fShaderOperatorTests.Symbol.SYMBOL_ONE_MINUS_UINT32MAX_DIV_LOWP_UINT_MAX)));
+ unary.push(separate('minus', '-', UGT, [v2(UGT, 0.0, mUMax)], s(mUMaxR), f(0.0), mediump,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(negate, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT), s(mUMaxR),
+ s(es3fShaderOperatorTests.Symbol.SYMBOL_ONE_MINUS_UINT32MAX_DIV_MEDIUMP_UINT_MAX)));
+ unary.push(op('minus', '-', UGT, [v(UGT, 0.0, 4e9)], f(2e-10), f(0.0), highp,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(negate, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ unary.push(op('not', '!', B, [v(B, -1.0, 1.0)], f(1.0), f(0.0), na,{'scalar': es3fShaderOperatorTests.unaryGenTypeFuncs(boolNot, gluShaderUtil.DataType.BOOL,
+ gluShaderUtil.DataType.BOOL).scalar}));
+ unary.push(op('bitwise_not', '~', IGT, [v(IGT, -1e5, 1e5)], f(5e-5), f(0.5), highp,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(bitwiseNot, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ unary.push(op('bitwise_not', '~', UGT, [v(UGT, 0.0, 2e9)], f(2e-10), f(0.0), highp,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(bitwiseNot, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+
+ // Pre/post incr/decr side effect cases.
+ unary = new es3fShaderOperatorTests.BuiltinFuncGroup('unary_operator', 'Unary operator tests');
+ funcInfoGroups.push(unary);
+
+ unary.push(side('pre_increment_effect', '++', GT, [v(GT, -1.0, 1.0)], f(0.5), f(0.0), all,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(addOne)));
+ unary.push(side('pre_increment_effect', '++', IGT, [v(IGT, -6.0, 4.0)], f(0.1), f(0.5), all,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(addOne, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ unary.push(side('pre_increment_effect', '++', UGT, [v(UGT, 0.0, 9.0)], f(0.1), f(0.5), all,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(addOne, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ unary.push(side('pre_decrement_effect', '--', GT, [v(GT, -1.0, 1.0)], f(0.5), f(1.0), all,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(subOne)));
+ unary.push(side('pre_decrement_effect', '--', IGT, [v(IGT, -4.0, 6.0)], f(0.1), f(0.5), all,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(subOne, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ unary.push(side('pre_decrement_effect', '--', UGT, [v(UGT, 0.0, 10.0)], f(0.1), f(0.0), all,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(subOne, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ unary.push(postSide('post_increment_result', '++', GT, [v(GT, -1.0, 1.0)], f(0.5), f(0.0), all,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(addOne)));
+ unary.push(postSide('post_increment_result', '++', IGT, [v(IGT, -6.0, 4.0)], f(0.1), f(0.5), all,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(addOne, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ unary.push(postSide('post_increment_result', '++', UGT, [v(UGT, 0.0, 9.0)], f(0.1), f(0.0), all,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(addOne, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ unary.push(postSide('post_decrement_result', '--', GT, [v(GT, -1.0, 1.0)], f(0.5), f(1.0), all,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(subOne)));
+ unary.push(postSide('post_decrement_result', '--', IGT, [v(IGT, -4.0, 6.0)], f(0.1), f(0.5), all,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(subOne, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ unary.push(postSide('post_decrement_result', '--', UGT, [v(UGT, 1.0, 10.0)], f(0.1), f(0.0), all,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(subOne, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+
+ // Pre/post incr/decr result cases.
+ unary = new es3fShaderOperatorTests.BuiltinFuncGroup('unary_operator', 'Unary operator tests');
+ funcInfoGroups.push(unary);
+
+ unary.push(op('pre_increment_result', '++', GT, [v(GT, -1.0, 1.0)], f(0.5), f(0.0), all,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(addOne)));
+ unary.push(op('pre_increment_result', '++', IGT, [v(IGT, -6.0, 4.0)], f(0.1), f(0.5), all,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(addOne, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ unary.push(op('pre_increment_result', '++', UGT, [v(UGT, 0.0, 9.0)], f(0.1), f(0.0), all,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(addOne, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ unary.push(op('pre_dencrement_result', '--', GT, [v(GT, -1.0, 1.0)], f(0.5), f(1.0), all,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(subOne)));
+ unary.push(op('pre_decrement_result', '--', IGT, [v(IGT, -4.0, 6.0)], f(0.1), f(0.5), all,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(subOne, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ unary.push(op('pre_decrement_result', '--', UGT, [v(UGT, 0.0, 10.0)], f(0.1), f(0.0), all,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(subOne, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ unary.push(postOp('post_increment_result', '++', GT, [v(GT, -1.0, 1.0)], f(0.5), f(0.5), all,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(nop)));
+ unary.push(postOp('post_increment_result', '++', IGT, [v(IGT, -5.0, 5.0)], f(0.1), f(0.5), all,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(nop, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ unary.push(postOp('post_increment_result', '++', UGT, [v(UGT, 0.0, 9.0)], f(0.1), f(0.0), all,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(nop, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ unary.push(postOp('post_decrement_result', '--', GT, [v(GT, -1.0, 1.0)], f(0.5), f(0.5), all,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(nop)));
+ unary.push(postOp('post_decrement_result', '--', IGT, [v(IGT, -5.0, 5.0)], f(0.1), f(0.5), all,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(nop, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ unary.push(postOp('post_decrement_result', '--', UGT, [v(UGT, 1.0, 10.0)], f(0.1), f(0.0), all,
+ es3fShaderOperatorTests.unaryGenTypeFuncs(nop, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+
+ var binary;
+
+ // Normal binary operations and their corresponding assignment operations have lots in common; generate both in the following loop.
+ // 0: normal op test, 1: assignment op side-effect test, 2: assignment op result test
+ for (var binaryOperatorType = 0; binaryOperatorType <= 2; binaryOperatorType++) {
+ var isNormalOp = binaryOperatorType == 0;
+ var isAssignEff = binaryOperatorType == 1;
+ var isAssignRes = binaryOperatorType == 2;
+
+ var addName = isNormalOp ? 'add' : isAssignEff ? 'add_assign_effect' : 'add_assign_result';
+ var subName = isNormalOp ? 'sub' : isAssignEff ? 'sub_assign_effect' : 'sub_assign_result';
+ var mulName = isNormalOp ? 'mul' : isAssignEff ? 'mul_assign_effect' : 'mul_assign_result';
+ var divName = isNormalOp ? 'div' : isAssignEff ? 'div_assign_effect' : 'div_assign_result';
+ var modName = isNormalOp ? 'mod' : isAssignEff ? 'mod_assign_effect' : 'mod_assign_result';
+ var andName = isNormalOp ? 'bitwise_and' : isAssignEff ? 'bitwise_and_assign_effect' : 'bitwise_and_assign_result';
+ var orName = isNormalOp ? 'bitwise_or' : isAssignEff ? 'bitwise_or_assign_effect' : 'bitwise_or_assign_result';
+ var xorName = isNormalOp ? 'bitwise_xor' : isAssignEff ? 'bitwise_xor_assign_effect' : 'bitwise_xor_assign_result';
+ var leftShiftName = isNormalOp ? 'left_shift' : isAssignEff ? 'left_shift_assign_effect' : 'left_shift_assign_result';
+ var rightShiftName = isNormalOp ? 'right_shift' : isAssignEff ? 'right_shift_assign_effect' : 'right_shift_assign_result';
+ var addOp = isNormalOp ? '+' : '+=';
+ var subOp = isNormalOp ? '-' : '-=';
+ var mulOp = isNormalOp ? '*' : '*=';
+ var divOp = isNormalOp ? '/' : '/=';
+ var modOp = isNormalOp ? '%' : '%=';
+ var andOp = isNormalOp ? '&' : '&=';
+ var orOp = isNormalOp ? '|' : '|=';
+ var xorOp = isNormalOp ? '^' : '^=';
+ var leftShiftOp = isNormalOp ? '<<' : '<<=';
+ var rightShiftOp = isNormalOp ? '>>' : '>>=';
+
+ op = isAssignEff ? es3fShaderOperatorTests.builtinSideEffOperInfo : es3fShaderOperatorTests.builtinOperInfo;
+
+ binary = new es3fShaderOperatorTests.BuiltinFuncGroup('binary_operator', 'Binary operator tests');
+ funcInfoGroups.push(binary);
+
+ // The add operator.
+
+ binary.push(op(addName, addOp, GT, [v(GT, -1.0, 1.0), v(GT, -1.0, 1.0)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryGenTypeFuncs(add)));
+ binary.push(op(addName, addOp, IGT, [v(IGT, -4.0, 6.0), v(IGT, -6.0, 5.0)], f(0.1), f(0.5),
+ mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(add, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(addName, addOp, IGT, [v(IGT, -2e9, 2e9), v(IGT, -2e9, 2e9)], f(4e-10), f(0.5),
+ highp, es3fShaderOperatorTests.binaryGenTypeFuncs(add, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(addName, addOp, UGT, [v(UGT, 0.0, 1e2), v(UGT, 0.0, 1e2)], f(5e-3), f(0.0),
+ mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(add, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(addName, addOp, UGT, [v(UGT, 0.0, 4e9), v(UGT, 0.0, 4e9)], f(2e-10), f(0.0),
+ highp, es3fShaderOperatorTests.binaryGenTypeFuncs(add, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+
+ binary.push(op(addName, addOp, FV, [v(FV, -1.0, 1.0), v(F, -1.0, 1.0)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.addScalar)));
+ binary.push(op(addName, addOp, IV, [v(IV, -4.0, 6.0), v(I, -6.0, 5.0)], f(0.1), f(0.5),
+ mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.addScalar, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(addName, addOp, IV, [v(IV, -2e9, 2e9), v(I, -2e9, 2e9)], f(4e-10), f(0.5),
+ highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.addScalar, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(addName, addOp, UV, [v(UV, 0.0, 1e2), v(U, 0.0, 1e2)], f(5e-3), f(0.0),
+ mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.addScalar, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(addName, addOp, UV, [v(UV, 0.0, 4e9), v(U, 0.0, 4e9)], f(2e-10), f(0.0),
+ highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.addScalar, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+
+ if (isNormalOp) {
+ binary.push(op(addName, addOp, FV, [v(F, -1.0, 1.0), v(FV, -1.0, 1.0)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryScalarVecFuncs(addScalarVec)));
+ binary.push(op(addName, addOp, IV, [v(I, -4.0, 6.0), v(IV, -6.0, 5.0)], f(0.1), f(0.5),
+ mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(addScalarVec, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(addName, addOp, IV, [v(I, -2e9, 2e9), v(IV, -2e9, 2e9)], f(4e-10), f(0.5),
+ highp, es3fShaderOperatorTests.binaryScalarVecFuncs(addScalarVec, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(addName, addOp, UV, [v(U, 0.0, 1e2), v(UV, 0.0, 1e2)], f(5e-3), f(0.0),
+ mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(addScalarVec, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(addName, addOp, UV, [v(U, 0.0, 4e9), v(UV, 0.0, 4e9)], f(2e-10), f(0.0),
+ highp, es3fShaderOperatorTests.binaryScalarVecFuncs(addScalarVec, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ }
+
+ // The subtract operator.
+
+ binary.push(op(subName, subOp, GT, [v(GT, -1.0, 1.0), v(GT, -1.0, 1.0)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryGenTypeFuncs(sub)));
+ binary.push(op(subName, subOp, IGT, [v(IGT, -4.0, 6.0), v(IGT, -6.0, 5.0)], f(0.1), f(0.5),
+ mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(sub, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(subName, subOp, IGT, [v(IGT, -2e9, 2e9), v(IGT, -2e9, 2e9)], f(4e-10), f(0.5),
+ highp, es3fShaderOperatorTests.binaryGenTypeFuncs(sub, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(subName, subOp, UGT, [v(UGT, 1e2, 2e2), v(UGT, 0.0, 1e2)], f(5e-3), f(0.0),
+ mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(sub, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(subName, subOp, UGT, [v(UGT, .5e9, 3.7e9), v(UGT, 0.0, 3.9e9)], f(2e-10), f(0.0),
+ highp, es3fShaderOperatorTests.binaryGenTypeFuncs(sub, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(subName, subOp, FV, [v(FV, -1.0, 1.0), v(F, -1.0, 1.0)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.subScalar)));
+ binary.push(op(subName, subOp, IV, [v(IV, -4.0, 6.0), v(I, -6.0, 5.0)], f(0.1), f(0.5),
+ mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.subScalar, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(subName, subOp, IV, [v(IV, -2e9, 2e9), v(I, -2e9, 2e9)], f(4e-10), f(0.5),
+ highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.subScalar, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(subName, subOp, UV, [v(UV, 1e2, 2e2), v(U, 0.0, 1e2)], f(5e-3), f(0.0),
+ mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.subScalar, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(subName, subOp, UV, [v(UV, 0.0, 4e9), v(U, 0.0, 4e9)], f(2e-10), f(0.0),
+ highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.subScalar, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+
+ if (isNormalOp) {
+ binary.push(op(subName, subOp, FV, [v(F, -1.0, 1.0), v(FV, -1.0, 1.0)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryScalarVecFuncs(subScalarVec)));
+ binary.push(op(subName, subOp, IV, [v(I, -4.0, 6.0), v(IV, -6.0, 5.0)], f(0.1), f(0.5),
+ mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(subScalarVec, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(subName, subOp, IV, [v(I, -2e9, 2e9), v(IV, -2e9, 2e9)], f(4e-10), f(0.5),
+ highp, es3fShaderOperatorTests.binaryScalarVecFuncs(subScalarVec, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(subName, subOp, UV, [v(U, 1e2, 2e2), v(UV, 0.0, 1e2)], f(5e-3), f(0.0),
+ mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(subScalarVec, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(subName, subOp, UV, [v(U, 0.0, 4e9), v(UV, 0.0, 4e9)], f(2e-10), f(0.0),
+ highp, es3fShaderOperatorTests.binaryScalarVecFuncs(subScalarVec, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ }
+
+ binary = new es3fShaderOperatorTests.BuiltinFuncGroup('binary_operator', 'Binary operator tests');
+ funcInfoGroups.push(binary);
+
+ // The multiply operator.
+
+ binary.push(op(mulName, mulOp, GT, [v(GT, -1.0, 1.0), v(GT, -1.0, 1.0)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryGenTypeFuncs(mul)));
+ binary.push(op(mulName, mulOp, IGT, [v(IGT, -4.0, 6.0), v(IGT, -6.0, 5.0)], f(0.1), f(0.5),
+ mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(mul, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(mulName, mulOp, IGT, [v(IGT, -3e5, 3e5), v(IGT, -3e4, 3e4)], f(4e-10), f(0.5),
+ highp, es3fShaderOperatorTests.binaryGenTypeFuncs(mul, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(mulName, mulOp, UGT, [v(UGT, 0.0, 16.0), v(UGT, 0.0, 16.0)], f(4e-3), f(0.0),
+ mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(mul, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(mulName, mulOp, UGT, [v(UGT, 0.0, 6e5), v(UGT, 0.0, 6e4)], f(2e-10), f(0.0),
+ highp, es3fShaderOperatorTests.binaryGenTypeFuncs(mul, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(mulName, mulOp, FV, [v(FV, -1.0, 1.0), v(F, -1.0, 1.0)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.scale)));
+ binary.push(op(mulName, mulOp, IV, [v(IV, -4.0, 6.0), v(I, -6.0, 5.0)], f(0.1), f(0.5),
+ mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.scale, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(mulName, mulOp, IV, [v(IV, -3e5, 3e5), v(I, -3e4, 3e4)], f(4e-10), f(0.5),
+ highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.scale, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(mulName, mulOp, UV, [v(UV, 0.0, 16.0), v(U, 0.0, 16.0)], f(4e-3), f(0.0),
+ mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.scale, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(mulName, mulOp, UV, [v(UV, 0.0, 6e5), v(U, 0.0, 6e4)], f(2e-10), f(0.0),
+ highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.scale, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+
+ if (isNormalOp) {
+ binary.push(op(mulName, mulOp, FV, [v(F, -1.0, 1.0), v(FV, -1.0, 1.0)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryScalarVecFuncs(mulScalarVec)));
+ binary.push(op(mulName, mulOp, IV, [v(I, -4.0, 6.0), v(IV, -6.0, 5.0)], f(0.1), f(0.5),
+ mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(mulScalarVec, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(mulName, mulOp, IV, [v(I, -3e5, 3e5), v(IV, -3e4, 3e4)], f(4e-10), f(0.5),
+ highp, es3fShaderOperatorTests.binaryScalarVecFuncs(mulScalarVec, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(mulName, mulOp, UV, [v(U, 0.0, 16.0), v(UV, 0.0, 16.0)], f(4e-3), f(0.0),
+ mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(mulScalarVec, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(mulName, mulOp, UV, [v(U, 0.0, 6e5), v(UV, 0.0, 6e4)], f(2e-10), f(0.0),
+ highp, es3fShaderOperatorTests.binaryScalarVecFuncs(mulScalarVec, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ }
+
+ // The divide operator.
+
+ binary.push(op(divName, divOp, GT, [v(GT, -1.0, 1.0), v(GT, -2.0, -0.5)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryGenTypeFuncs(div)));
+ binary.push(op(divName, divOp, IGT, [v(IGT, 24.0, 24.0), v(IGT, -4.0, -1.0)], f(0.04), f(1.0),
+ mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(div, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(divName, divOp, IGT, [v(IGT, 40320.0, 40320.0), v(IGT, -8.0, -1.0)], f(1e-5), f(0.5),
+ highp, es3fShaderOperatorTests.binaryGenTypeFuncs(div, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(divName, divOp, UGT, [v(UGT, 0.0, 24.0), v(UGT, 1.0, 4.0)], f(0.04), f(0.0),
+ mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(div, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(divName, divOp, UGT, [v(UGT, 0.0, 40320.0), v(UGT, 1.0, 8.0)], f(1e-5), f(0.0),
+ highp, es3fShaderOperatorTests.binaryGenTypeFuncs(div, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(divName, divOp, FV, [v(FV, -1.0, 1.0), v(F, -2.0, -0.5)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.divideScale)));
+ binary.push(op(divName, divOp, IV, [v(IV, 24.0, 24.0), v(I, -4.0, -1.0)], f(0.04), f(1.0),
+ mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.divideScale, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(divName, divOp, IV, [v(IV, 40320.0, 40320.0), v(I, -8.0, -1.0)], f(1e-5), f(0.5),
+ highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.divideScale, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(divName, divOp, UV, [v(UV, 0.0, 24.0), v(U, 1.0, 4.0)], f(0.04), f(0.0),
+ mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.divideScale, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(divName, divOp, UV, [v(UV, 0.0, 40320.0), v(U, 1.0, 8.0)], f(1e-5), f(0.0),
+ highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.divideScale, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+
+ if (isNormalOp) {
+ binary.push(op(divName, divOp, FV, [v(F, -1.0, 1.0), v(FV, -2.0, -0.5)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryScalarVecFuncs(divScalarVec)));
+ binary.push(op(divName, divOp, IV, [v(I, 24.0, 24.0), v(IV, -4.0, -1.0)], f(0.04), f(1.0),
+ mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(divScalarVec, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(divName, divOp, IV, [v(I, 40320.0, 40320.0), v(IV, -8.0, -1.0)], f(1e-5), f(0.5),
+ highp, es3fShaderOperatorTests.binaryScalarVecFuncs(divScalarVec, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(divName, divOp, UV, [v(U, 0.0, 24.0), v(UV, 1.0, 4.0)], f(0.04), f(0.0),
+ mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(divScalarVec, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(divName, divOp, UV, [v(U, 0.0, 40320.0), v(UV, 1.0, 8.0)], f(1e-5), f(0.0),
+ highp, es3fShaderOperatorTests.binaryScalarVecFuncs(divScalarVec, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ }
+
+ binary = new es3fShaderOperatorTests.BuiltinFuncGroup('binary_operator', 'Binary operator tests');
+ funcInfoGroups.push(binary);
+
+ // The modulus operator.
+
+ binary.push(op(modName, modOp, IGT, [v(IGT, 0.0, 6.0), v(IGT, 1.1, 6.1)], f(0.25), f(0.5),
+ mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.mod, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(modName, modOp, IGT, [v(IGT, 0.0, 14.0), v(IGT, 1.1, 11.1)], f(0.1), f(0.5),
+ highp, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.mod, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(modName, modOp, UGT, [v(UGT, 0.0, 6.0), v(UGT, 1.1, 6.1)], f(0.25), f(0.0),
+ mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.mod, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(modName, modOp, UGT, [v(UGT, 0.0, 24.0), v(UGT, 1.1, 11.1)], f(0.1), f(0.0),
+ highp, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.mod, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(modName, modOp, IV, [v(IV, 0.0, 6.0), v(I, 1.1, 6.1)], f(0.25), f(0.5),
+ mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.modScale, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(modName, modOp, IV, [v(IV, 0.0, 6.0), v(I, 1.1, 11.1)], f(0.1), f(0.5),
+ highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.modScale, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(modName, modOp, UV, [v(UV, 0.0, 6.0), v(U, 1.1, 6.1)], f(0.25), f(0.0),
+ mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.modScale, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(modName, modOp, UV, [v(UV, 0.0, 24.0), v(U, 1.1, 11.1)], f(0.1), f(0.0),
+ highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.modScale, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+
+ if (isNormalOp) {
+ binary.push(op(modName, modOp, IV, [v(I, 0.0, 6.0), v(IV, 1.1, 6.1)], f(0.25), f(0.5),
+ mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(modScalarVec, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(modName, modOp, IV, [v(I, 0.0, 6.0), v(IV, 1.1, 11.1)], f(0.1), f(0.5),
+ highp, es3fShaderOperatorTests.binaryScalarVecFuncs(modScalarVec, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(modName, modOp, UV, [v(U, 0.0, 6.0), v(UV, 1.1, 6.1)], f(0.25), f(0.0),
+ mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(modScalarVec, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(modName, modOp, UV, [v(U, 0.0, 24.0), v(UV, 1.1, 11.1)], f(0.1), f(0.0),
+ highp, es3fShaderOperatorTests.binaryScalarVecFuncs(modScalarVec, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ }
+
+ // The bitwise and operator.
+
+ binary.push(op(andName, andOp, IGT, [v(IGT, -16.0, 16.0), v(IGT, -16.0, 16.0)], f(0.03), f(0.5),
+ mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.binaryAnd, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(andName, andOp, IGT, [v(IGT, -2e9, 2e9), v(IGT, -2e9, 2e9)], f(4e-10), f(0.5),
+ highp, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.binaryAnd, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(andName, andOp, UGT, [v(UGT, 0.0, 32.0), v(UGT, 0.0, 32.0)], f(0.03), f(0.0),
+ mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.binaryAnd, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(andName, andOp, UGT, [v(UGT, 0.0, 4e9), v(UGT, 0.0, 4e9)], f(2e-10), f(0.0),
+ highp, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.binaryAnd, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(andName, andOp, IV, [v(IV, -16.0, 16.0), v(I, -16.0, 16.0)], f(0.03), f(0.5),
+ mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.binaryAndVecScalar, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(andName, andOp, IV, [v(IV, -2e9, 2e9), v(I, -2e9, 2e9)], f(4e-10), f(0.5),
+ highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.binaryAndVecScalar, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(andName, andOp, UV, [v(UV, 0.0, 32.0), v(U, 0.0, 32.0)], f(0.03), f(0.0),
+ mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.binaryAndVecScalar, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(andName, andOp, UV, [v(UV, 0.0, 4e9), v(U, 0.0, 4e9)], f(2e-10), f(0.0),
+ highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.binaryAndVecScalar, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+
+ if (isNormalOp) {
+ binary.push(op(andName, andOp, IV, [v(I, -16.0, 16.0), v(IV, -16.0, 16.0)], f(0.03), f(0.5),
+ mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(bitwiseAndScalarVec, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(andName, andOp, IV, [v(I, -2e9, 2e9), v(IV, -2e9, 2e9)], f(4e-10), f(0.5),
+ highp, es3fShaderOperatorTests.binaryScalarVecFuncs(bitwiseAndScalarVec, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(andName, andOp, UV, [v(U, 0.0, 32.0), v(UV, 0.0, 32.0)], f(0.03), f(0.0),
+ mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(bitwiseAndScalarVec, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(andName, andOp, UV, [v(U, 0.0, 4e9), v(UV, 0.0, 4e9)], f(2e-10), f(0.0),
+ highp, es3fShaderOperatorTests.binaryScalarVecFuncs(bitwiseAndScalarVec, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ }
+
+ binary = new es3fShaderOperatorTests.BuiltinFuncGroup('binary_operator', 'Binary operator tests');
+ funcInfoGroups.push(binary);
+
+ // The bitwise or operator.
+
+ binary.push(op(orName, orOp, IGT, [v(IGT, -16.0, 16.0), v(IGT, -16.0, 16.0)], f(0.03), f(0.5),
+ mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.binaryOr, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(orName, orOp, IGT, [v(IGT, -2e9, 2e9), v(IGT, -2e9, 2e9)], f(4e-10), f(0.5),
+ highp, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.binaryOr, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(orName, orOp, UGT, [v(UGT, 0.0, 32.0), v(UGT, 0.0, 32.0)], f(0.03), f(0.0),
+ mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.binaryOr, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(orName, orOp, UGT, [v(UGT, 0.0, 4e9), v(UGT, 0.0, 4e9)], f(2e-10), f(0.0),
+ highp, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.binaryOr, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(orName, orOp, IV, [v(IV, -16.0, 16.0), v(I, -16.0, 16.0)], f(0.03), f(0.5),
+ mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.binaryOrVecScalar, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(orName, orOp, IV, [v(IV, -2e9, 2e9), v(I, -2e9, 2e9)], f(4e-10), f(0.5),
+ highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.binaryOrVecScalar, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(orName, orOp, UV, [v(UV, 0.0, 32.0), v(U, 0.0, 32.0)], f(0.03), f(0.0),
+ mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.binaryOrVecScalar, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(orName, orOp, UV, [v(UV, 0.0, 4e9), v(U, 0.0, 4e9)], f(2e-10), f(0.0),
+ highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.binaryOrVecScalar, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+
+ if (isNormalOp) {
+ binary.push(op(orName, orOp, IV, [v(I, -16.0, 16.0), v(IV, -16.0, 16.0)], f(0.03), f(0.5),
+ mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(bitwiseOrScalarVec, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(orName, orOp, IV, [v(I, -2e9, 2e9), v(IV, -2e9, 2e9)], f(4e-10), f(0.5),
+ highp, es3fShaderOperatorTests.binaryScalarVecFuncs(bitwiseOrScalarVec, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(orName, orOp, UV, [v(U, 0.0, 32.0), v(UV, 0.0, 32.0)], f(0.03), f(0.0),
+ mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(bitwiseOrScalarVec, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(orName, orOp, UV, [v(U, 0.0, 4e9), v(UV, 0.0, 4e9)], f(2e-10), f(0.0),
+ highp, es3fShaderOperatorTests.binaryScalarVecFuncs(bitwiseOrScalarVec, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ }
+
+ // The bitwise xor operator.
+
+ binary.push(op(xorName, xorOp, IGT, [v(IGT, -16.0, 16.0), v(IGT, -16.0, 16.0)], f(0.03), f(0.5),
+ mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.binaryXor, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(xorName, xorOp, IGT, [v(IGT, -2e9, 2e9), v(IGT, -2e9, 2e9)], f(4e-10), f(0.5),
+ highp, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.binaryXor, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(xorName, xorOp, UGT, [v(UGT, 0.0, 32.0), v(UGT, 0.0, 32.0)], f(0.03), f(0.0),
+ mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.binaryXor, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(xorName, xorOp, UGT, [v(UGT, 0.0, 4e9), v(UGT, 0.0, 4e9)], f(2e-10), f(0.0),
+ highp, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.binaryXor, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(xorName, xorOp, IV, [v(IV, -16.0, 16.0), v(I, -16.0, 16.0)], f(0.03), f(0.5),
+ mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.binaryXorVecScalar, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(xorName, xorOp, IV, [v(IV, -2e9, 2e9), v(I, -2e9, 2e9)], f(4e-10), f(0.5),
+ highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.binaryXorVecScalar, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(xorName, xorOp, UV, [v(UV, 0.0, 32.0), v(U, 0.0, 32.0)], f(0.03), f(0.0),
+ mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.binaryXorVecScalar, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(xorName, xorOp, UV, [v(UV, 0.0, 4e9), v(U, 0.0, 4e9)], f(2e-10), f(0.0),
+ highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.binaryXorVecScalar, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+
+ if (isNormalOp) {
+ binary.push(op(xorName, xorOp, IV, [v(I, -16.0, 16.0), v(IV, -16.0, 16.0)], f(0.03), f(0.5),
+ mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(bitwiseXorScalarVec, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(xorName, xorOp, IV, [v(I, -2e9, 2e9), v(IV, -2e9, 2e9)], f(4e-10), f(0.5),
+ highp, es3fShaderOperatorTests.binaryScalarVecFuncs(bitwiseXorScalarVec, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(xorName, xorOp, UV, [v(U, 0.0, 32.0), v(UV, 0.0, 32.0)], f(0.03), f(0.0),
+ mediump, es3fShaderOperatorTests.binaryScalarVecFuncs(bitwiseXorScalarVec, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(xorName, xorOp, UV, [v(U, 0.0, 4e9), v(UV, 0.0, 4e9)], f(2e-10), f(0.0),
+ highp, es3fShaderOperatorTests.binaryScalarVecFuncs(bitwiseXorScalarVec, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ }
+
+ binary = new es3fShaderOperatorTests.BuiltinFuncGroup('binary_operator', 'Binary operator tests');
+ funcInfoGroups.push(binary);
+
+ // The left shift operator. Second operand (shift amount) can be either int or uint, even for uint and int first operand, respectively.
+ for (var isSignedAmount = 0; isSignedAmount <= 1; isSignedAmount++) {
+ var gType = isSignedAmount == 0 ? UGT : IGT;
+ var sType = isSignedAmount == 0 ? U : I;
+ binary.push(op(leftShiftName, leftShiftOp, IGT, [v(IGT, -7.0, 7.0), v(gType, 0.0, 4.0)], f(4e-3), f(0.5),
+ mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.shiftLeft, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(leftShiftName, leftShiftOp, IGT, [v(IGT, -7.0, 7.0), v(gType, 0.0, 27.0)], f(5e-10), f(0.5),
+ highp, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.shiftLeft, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(leftShiftName, leftShiftOp, UGT, [v(UGT, 0.0, 7.0), v(gType, 0.0, 5.0)], f(4e-3), f(0.0),
+ mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.shiftLeft, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(leftShiftName, leftShiftOp, UGT, [v(UGT, 0.0, 7.0), v(gType, 0.0, 28.0)], f(5e-10), f(0.0),
+ highp, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.shiftLeft, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(leftShiftName, leftShiftOp, IV, [v(IV, -7.0, 7.0), v(sType, 0.0, 4.0)], f(4e-3), f(0.5),
+ mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.shiftLeftVecScalar, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(leftShiftName, leftShiftOp, IV, [v(IV, -7.0, 7.0), v(sType, 0.0, 27.0)], f(5e-10), f(0.5),
+ highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.shiftLeftVecScalar, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(leftShiftName, leftShiftOp, UV, [v(UV, 0.0, 7.0), v(sType, 0.0, 5.0)], f(4e-3), f(0.0),
+ mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.shiftLeftVecScalar, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(leftShiftName, leftShiftOp, UV, [v(UV, 0.0, 7.0), v(sType, 0.0, 28.0)], f(5e-10), f(0.0),
+ highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.shiftLeftVecScalar, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ }
+
+ // The right shift operator. Second operand (shift amount) can be either int or uint, even for uint and int first operand, respectively.
+
+ for (var isSignedAmount = 0; isSignedAmount <= 1; isSignedAmount++) {
+ gType = isSignedAmount == 0 ? UGT : IGT;
+ sType = isSignedAmount == 0 ? U : I;
+ binary.push(op(rightShiftName, rightShiftOp, IGT, [v(IGT, -127.0, 127.0), v(gType, 0.0, 8.0)], f(4e-3), f(0.5),
+ mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.shiftRight, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(rightShiftName, rightShiftOp, IGT, [v(IGT, -2e9, 2e9), v(gType, 0.0, 31.0)], f(5e-10), f(0.5),
+ highp, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.shiftRight, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(rightShiftName, rightShiftOp, UGT, [v(UGT, 0.0, 255.0), v(gType, 0.0, 8.0)], f(4e-3), f(0.0),
+ mediump, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.shiftRight, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(rightShiftName, rightShiftOp, UGT, [v(UGT, 0.0, 4e9), v(gType, 0.0, 31.0)], f(5e-10), f(0.0),
+ highp, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.shiftRight, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(rightShiftName, rightShiftOp, IV, [v(IV, -127.0, 127.0), v(sType, 0.0, 8.0)], f(4e-3), f(0.5),
+ mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.shiftRightVecScalar, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(rightShiftName, rightShiftOp, IV, [v(IV, -2e9, 2e9), v(sType, 0.0, 31.0)], f(5e-10), f(0.5),
+ highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.shiftRightVecScalar, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op(rightShiftName, rightShiftOp, UV, [v(UV, 0.0, 255.0), v(sType, 0.0, 8.0)], f(4e-3), f(0.0),
+ mediump, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.shiftRightVecScalar, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op(rightShiftName, rightShiftOp, UV, [v(UV, 0.0, 4e9), v(sType, 0.0, 31.0)], f(5e-10), f(0.0),
+ highp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.shiftRightVecScalar, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ }
+ }
+
+ // Rest of binary operators.
+ // Scalar relational operators.
+ binary = new es3fShaderOperatorTests.BuiltinFuncGroup('binary_operator', 'Binary operator tests');
+ funcInfoGroups.push(binary);
+
+ binary.push(op('less', '<', B, [v(F, -1.0, 1.0), v(F, -1.0, 1.0)], f(1.0), f(0.0),
+ all, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(lessThan).scalar}));
+ binary.push(op('less', '<', B, [v(I, -5.0, 5.0), v(I, -5.0, 5.0)], f(1.0), f(0.0),
+ all, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(lessThan, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT).scalar}));
+ binary.push(op('less', '<', B, [v(U, 0.0, 16.0), v(U, 0.0, 16.0)], f(1.0), f(0.0),
+ all, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(lessThan, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT).scalar}));
+ binary.push(op('less_or_equal', '<=', B, [v(F, -1.0, 1.0), v(F, -1.0, 1.0)], f(1.0), f(0.0),
+ all, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(lessThanEqual).scalar}));
+ binary.push(op('less_or_equal', '<=', B, [v(I, -5.0, 5.0), v(I, -5.0, 5.0)], f(1.0), f(0.0),
+ all, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(lessThanEqual, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT).scalar}));
+ binary.push(op('less_or_equal', '<=', B, [v(U, 0.0, 16.0), v(U, 0.0, 16.0)], f(1.0), f(0.0),
+ all, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(lessThanEqual, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT).scalar}));
+ binary.push(op('greater', '>', B, [v(F, -1.0, 1.0), v(F, -1.0, 1.0)], f(1.0), f(0.0),
+ all, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(greaterThan).scalar}));
+ binary.push(op('greater', '>', B, [v(I, -5.0, 5.0), v(I, -5.0, 5.0)], f(1.0), f(0.0),
+ all, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(greaterThan, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT).scalar}));
+ binary.push(op('greater', '>', B, [v(U, 0.0, 16.0), v(U, 0.0, 16.0)], f(1.0), f(0.0),
+ all, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(greaterThan, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT).scalar}));
+ binary.push(op('greater_or_equal', '>=', B, [v(F, -1.0, 1.0), v(F, -1.0, 1.0)], f(1.0), f(0.0),
+ all, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(greaterThanEqual).scalar}));
+ binary.push(op('greater_or_equal', '>=', B, [v(I, -5.0, 5.0), v(I, -5.0, 5.0)], f(1.0), f(0.0),
+ all, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(greaterThanEqual, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT).scalar}));
+ binary.push(op('greater_or_equal', '>=', B, [v(U, 0.0, 16.0), v(U, 0.0, 16.0)], f(1.0), f(0.0),
+ all, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(greaterThanEqual, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT).scalar}));
+
+ binary.push(op('equal', '==', B, [v(GT, -1.0, 1.0), v(GT, -1.0, 1.0)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryScalarGenTypeFuncs(allEqual)));
+ binary.push(op('equal', '==', B, [v(IGT, -5.5, 4.7), v(IGT, -2.1, 0.1)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryScalarGenTypeFuncs(allEqual, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op('equal', '==', B, [v(UGT, 0.0, 8.0), v(UGT, 3.5, 4.5)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryScalarGenTypeFuncs(allEqual, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op('equal', '==', B, [v(BGT, -2.1, 2.1), v(BGT, -1.1, 3.0)], f(1.0), f(0.0),
+ na, es3fShaderOperatorTests.binaryScalarGenTypeFuncs(allEqual, gluShaderUtil.DataType.BOOL,
+ gluShaderUtil.DataType.BOOL)));
+ binary.push(op('not_equal', '!=', B, [v(GT, -1.0, 1.0), v(GT, -1.0, 1.0)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryScalarGenTypeFuncs(anyNotEqual)));
+ binary.push(op('not_equal', '!=', B, [v(IGT, -5.5, 4.7), v(IGT, -2.1, 0.1)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryScalarGenTypeFuncs(anyNotEqual, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ binary.push(op('not_equal', '!=', B, [v(UGT, 0.0, 8.0), v(UGT, 3.5, 4.5)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryScalarGenTypeFuncs(anyNotEqual, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ binary.push(op('not_equal', '!=', B, [v(BGT, -2.1, 2.1), v(BGT, -1.1, 3.0)], f(1.0), f(0.0),
+ na, es3fShaderOperatorTests.binaryScalarGenTypeFuncs(anyNotEqual, gluShaderUtil.DataType.BOOL,
+ gluShaderUtil.DataType.BOOL)));
+
+ // Logical operators.
+ binary.push(op('logical_and', '&&', B, [v(B, -1.0, 1.0), v(B, -1.0, 1.0)], f(1.0), f(0.0),
+ na, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(logicalAnd, gluShaderUtil.DataType.BOOL,
+ gluShaderUtil.DataType.BOOL).scalar}));
+ binary.push(op('logical_or', '||', B, [v(B, -1.0, 1.0), v(B, -1.0, 1.0)], f(1.0), f(0.0),
+ na, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(logicalOr, gluShaderUtil.DataType.BOOL,
+ gluShaderUtil.DataType.BOOL).scalar}));
+ binary.push(op('logical_xor', '^^', B, [v(B, -1.0, 1.0), v(B, -1.0, 1.0)], f(1.0), f(0.0),
+ na, {scalar: es3fShaderOperatorTests.binaryGenTypeFuncs(logicalXor, gluShaderUtil.DataType.BOOL,
+ gluShaderUtil.DataType.BOOL).scalar}));
+
+ // 8.1 Angle and Trigonometry Functions.
+ var trig = new es3fShaderOperatorTests.BuiltinFuncGroup("angle_and_trigonometry", "Angle and trigonometry function tests.");
+ funcInfoGroups.push(trig);
+ op = es3fShaderOperatorTests.builtinFunctionInfo;
+ trig.push(op("radians", "radians", GT, [v(GT, -1.0, 1.0)], f(25.0), f(0.5),
+ mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(radians)));
+ trig.push(op("degrees", "degrees", GT, [v(GT, -1.0, 1.0)], f(0.04), f(0.5),
+ mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(degrees)));
+ trig.push(op("sin", "sin", GT, [v(GT, -5.0, 5.0)], f(0.5), f(0.5),
+ mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.sin)));
+ trig.push(op("sin", "sin", GT, [v(GT, -1.5, 1.5)], f(0.5), f(0.5),
+ lowp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.sin)));
+ trig.push(op("cos", "cos", GT, [v(GT, -5.0, 5.0)], f(0.5), f(0.5),
+ mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.cos)));
+ trig.push(op("cos", "cos", GT, [v(GT, -1.5, 1.5)], f(0.5), f(0.5),
+ lowp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.cos)));
+ trig.push(op("tan", "tan", GT, [v(GT, -5.0, 5.0)], f(0.5), f(0.5),
+ mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.tan)));
+ trig.push(op("tan", "tan", GT, [v(GT, -1.5, 5.5)], f(0.5), f(0.5),
+ lowp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.tan)));
+
+ trig = new es3fShaderOperatorTests.BuiltinFuncGroup("angle_and_trigonometry", "Angle and trigonometry function tests.");
+ funcInfoGroups.push(trig);
+ trig.push(op("asin", "asin", GT, [v(GT, -1.0, 1.0)], f(1.0), f(0.0),
+ mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.asin)));
+ trig.push(op("acos", "acos", GT, [v(GT, -1.0, 1.0)], f(1.0), f(0.0),
+ mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.acos)));
+ trig.push(op("atan", "atan", GT, [v(GT, -4.0, 4.0)], f(0.5), f(0.5),
+ mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.atan)));
+ trig.push(op("atan2", "atan", GT, [v(GT, -4.0, 4.0), v(GT, 0.5, 2.0)], f(0.5), f(0.5),
+ mediumhighp, es3fShaderOperatorTests.binaryGenTypeFuncs(Math.atan2)));
+
+ trig = new es3fShaderOperatorTests.BuiltinFuncGroup("angle_and_trigonometry", "Angle and trigonometry function tests.");
+ funcInfoGroups.push(trig);
+ trig.push(op("sinh", "sinh", GT, [v(GT, -5.0, 5.0)], f(0.5), f(0.5),
+ mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.sinh)));
+ trig.push(op("sinh", "sinh", GT, [v(GT, -1.5, 1.5)], f(0.5), f(0.5),
+ lowp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.sinh)));
+ trig.push(op("cosh", "cosh", GT, [v(GT, -5.0, 5.0)], f(0.5), f(0.5),
+ mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.cosh)));
+ trig.push(op("cosh", "cosh", GT, [v(GT, -1.5, 1.5)], f(0.5), f(0.5),
+ lowp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.cosh)));
+ trig.push(op("tanh", "tanh", GT, [v(GT, -5.0, 5.0)], f(0.5), f(0.5),
+ mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.tanh)));
+ trig.push(op("tanh", "tanh", GT, [v(GT, -1.5, 5.5)], f(0.5), f(0.5),
+ lowp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.tanh)));
+
+ trig = new es3fShaderOperatorTests.BuiltinFuncGroup("angle_and_trigonometry", "Angle and trigonometry function tests.");
+ funcInfoGroups.push(trig);
+ trig.push(op("asinh", "asinh", GT, [v(GT, -1.0, 1.0)], f(1.0), f(0.0),
+ mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.asinh)));
+ trig.push(op("acosh", "acosh", GT, [v(GT, 1.0, 2.2)], f(1.0), f(0.0),
+ mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.acosh)));
+ // Results are undefined if |x| >= 1, so it diverses from C++ version here.
+ trig.push(op("atanh", "atanh", GT, [v(GT, -0.99, 0.99)], f(1.0), f(0.0),
+ mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.atanh)));
+
+ // 8.2 Exponential Functions.
+ var exps = new es3fShaderOperatorTests.BuiltinFuncGroup("exponential", "Exponential function tests");
+ exps.push(op("pow", "pow", GT, [v(GT, 0.1, 8.0), v(GT, -4.0, 2.0)], f(1.0), f(0.0),
+ mediumhighp, es3fShaderOperatorTests.binaryGenTypeFuncs(Math.pow)));
+ exps.push(op("exp", "exp", GT, [v(GT, -6.0, 3.0)], f(0.5), f(0.0),
+ mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.exp)));
+ exps.push(op("log", "log", GT, [v(GT, 0.1, 10.0)], f(0.5), f(0.3),
+ mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.log)));
+ exps.push(op("exp2", "exp2", GT, [v(GT, -7.0, 2.0)], f(1.0), f(0.0),
+ mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(exp2)));
+ exps.push(op("log2", "log2", GT, [v(GT, 0.1, 10.0)], f(1.0), f(0.0),
+ mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.log2)));
+ exps.push(op("sqrt", "sqrt", GT, [v(GT, 0.0, 10.0)], f(0.3), f(0.0),
+ mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.sqrt)));
+ exps.push(op("inversesqrt", "inversesqrt", GT, [v(GT, 0.5, 10.0)], f(1.0), f(0.0),
+ mediumhighp, es3fShaderOperatorTests.unaryGenTypeFuncs(inverseSqrt)));
+
+ funcInfoGroups.push(exps);
+
+ // 8.3 Common Functions.
+ var comm = new es3fShaderOperatorTests.BuiltinFuncGroup("common_functions", "Common function tests.");
+ funcInfoGroups.push(comm);
+ comm.push(op("abs", "abs", GT, [v(GT, -2.0, 2.0)], f(0.5), f(0.5),
+ all, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.abs)));
+ comm.push(op("sign", "sign", GT, [v(GT, -1.5, 1.5)], f(0.3), f(0.5),
+ all, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.sign)));
+ comm.push(op("floor", "floor", GT, [v(GT, 2.5, 2.5)], f(0.2), f(0.7),
+ all, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.floor)));
+ comm.push(op("trunc", "trunc", GT, [v(GT, 2.5, 2.5)], f(0.2), f(0.7),
+ all, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.trunc)));
+ comm.push(op("round", "round", GT, [v(GT, 2.5, 2.5)], f(0.2), f(0.7),
+ all, es3fShaderOperatorTests.unaryGenTypeFuncs(roundToEven)));
+
+ comm = new es3fShaderOperatorTests.BuiltinFuncGroup("common_functions", "Common function tests.");
+ funcInfoGroups.push(comm);
+
+ comm.push(op("roundEven", "roundEven", GT, [v(GT, 2.5, 2.5)], f(0.2), f(0.7),
+ all, es3fShaderOperatorTests.unaryGenTypeFuncs(roundToEven)));
+ comm.push(op("ceil", "ceil", GT, [v(GT, 2.5, 2.5)], f(0.2), f(0.5),
+ all, es3fShaderOperatorTests.unaryGenTypeFuncs(Math.ceil)));
+ comm.push(op("fract", "fract", GT, [v(GT, -1.5, 1.5)], f(0.8), f(0.1),
+ all, es3fShaderOperatorTests.unaryGenTypeFuncs(fract)));
+ comm.push(op("mod", "mod", GT, [v(GT, -2.0, 2.0), v(GT, 0.9, 6.0)], f(0.5), f(0.5),
+ mediumhighp, es3fShaderOperatorTests.binaryGenTypeFuncs(deMath.mod)));
+ comm.push(op("mod", "mod", GT, [v(FV, -2.0, 2.0), v(F, 0.9, 6.0)], f(0.5), f(0.5),
+ mediumhighp, es3fShaderOperatorTests.binaryVecScalarFuncs(deMath.modScale)));
+
+ comm = new es3fShaderOperatorTests.BuiltinFuncGroup("common_functions", "Common function tests.");
+ funcInfoGroups.push(comm);
+
+ comm.push(op("min", "min", GT, [v(GT, -1.0, 1.0), v(GT, -1.0, 1.0)], f(0.5), f(0.5),
+ all, es3fShaderOperatorTests.binaryGenTypeFuncs(Math.min)));
+ comm.push(op("min", "min", GT, [v(FV, -1.0, 1.0), v(F, -1.0, 1.0)], f(0.5), f(0.5),
+ all, es3fShaderOperatorTests.binaryVecScalarFuncs(minVecScalar)));
+ comm.push(op("min", "min", IGT, [v(IGT, -4.0, 4.0), v(IGT, -4.0, 4.0)], f(0.125), f(0.5),
+ all, es3fShaderOperatorTests.binaryGenTypeFuncs(Math.min, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ comm.push(op("min", "min", IGT, [v(IV, -4.0, 4.0), v(I, -4.0, 4.0)], f(0.125), f(0.5),
+ all, es3fShaderOperatorTests.binaryVecScalarFuncs(minVecScalar, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ comm.push(op("min", "min", UGT, [v(UGT, 0.0, 8.0), v(UGT, 0.0, 8.0)], f(0.125), f(0.0),
+ all, es3fShaderOperatorTests.binaryGenTypeFuncs(Math.min, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+
+ comm = new es3fShaderOperatorTests.BuiltinFuncGroup("common_functions", "Common function tests.");
+ funcInfoGroups.push(comm);
+
+ comm.push(op("min", "min", UGT, [v(UV, 0.0, 8.0), v(U, 0.0, 8.0)], f(0.125), f(0.0),
+ all, es3fShaderOperatorTests.binaryVecScalarFuncs(minVecScalar, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ comm.push(op("max", "max", GT, [v(GT, -1.0, 1.0), v(GT, -1.0, 1.0)], f(0.5), f(0.5),
+ all, es3fShaderOperatorTests.binaryGenTypeFuncs(Math.max)));
+ comm.push(op("max", "max", GT, [v(FV, -1.0, 1.0), v(F, -1.0, 1.0)], f(0.5), f(0.5),
+ all, es3fShaderOperatorTests.binaryVecScalarFuncs(maxVecScalar)));
+ comm.push(op("max", "max", IGT, [v(IGT, -4.0, 4.0), v(IGT, -4.0, 4.0)], f(0.125), f(0.5),
+ all, es3fShaderOperatorTests.binaryGenTypeFuncs(Math.max, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ comm.push(op("max", "max", IGT, [v(IV, -4.0, 4.0), v(I, -4.0, 4.0)], f(0.125), f(0.5),
+ all, es3fShaderOperatorTests.binaryVecScalarFuncs(maxVecScalar, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+
+ comm = new es3fShaderOperatorTests.BuiltinFuncGroup("common_functions", "Common function tests.");
+ funcInfoGroups.push(comm);
+
+ comm.push(op("max", "max", UGT, [v(UGT, 0.0, 8.0), v(UGT, 0.0, 8.0)], f(0.125), f(0.0),
+ all, es3fShaderOperatorTests.binaryGenTypeFuncs(Math.max, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ comm.push(op("max", "max", UGT, [v(UV, 0.0, 8.0), v(U, 0.0, 8.0)], f(0.125), f(0.0),
+ all, es3fShaderOperatorTests.binaryVecScalarFuncs(maxVecScalar, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ comm.push(op("clamp", "clamp", GT, [v(GT, -1.0, 1.0), v(GT, -0.5, 0.5), v(GT, 0.5, 1.0)], f(0.5), f(0.5),
+ all, es3fShaderOperatorTests.ternaryGenTypeFuncs(deMath.clamp)));
+ comm.push(op("clamp", "clamp", GT, [v(FV, -1.0, 1.0), v(F, -0.5, 0.5), v(F, 0.5, 1.0)], f(0.5), f(0.5),
+ all, es3fShaderOperatorTests.ternaryVecScalarScalarFuncs(clampVecScalarScalar)));
+ comm.push(op("clamp", "clamp", IGT, [v(IGT, -4.0, 4.0), v(IGT, -2.0, 2.0), v(IGT, 2.0, 4.0)], f(0.125), f(0.5),
+ all, es3fShaderOperatorTests.ternaryGenTypeFuncs(deMath.clamp, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+
+ comm = new es3fShaderOperatorTests.BuiltinFuncGroup("common_functions", "Common function tests.");
+ funcInfoGroups.push(comm);
+
+ comm.push(op("clamp", "clamp", IGT, [v(IGT, -4.0, 4.0), v(I, -2.0, 2.0), v(I, 2.0, 4.0)], f(0.125), f(0.5),
+ all, es3fShaderOperatorTests.ternaryVecScalarScalarFuncs(clampVecScalarScalar, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ comm.push(op("clamp", "clamp", UGT, [v(UGT, 0.0, 8.0), v(UGT, 2.0, 6.0), v(UGT, 6.0, 8.0)], f(0.125), f(0.0),
+ all, es3fShaderOperatorTests.ternaryGenTypeFuncs(deMath.clamp, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ comm.push(op("clamp", "clamp", UGT, [v(UV, 0.0, 8.0), v(U, 2.0, 6.0), v(U, 6.0, 8.0)], f(0.125), f(0.0),
+ all, es3fShaderOperatorTests.ternaryVecScalarScalarFuncs(clampVecScalarScalar, gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT)));
+ comm.push(op("mix", "mix", GT, [v(GT, -1.0, 1.0), v(GT, -1.0, 1.0), v(GT, 0.0, 1.0)], f(0.5), f(0.5),
+ all, es3fShaderOperatorTests.ternaryGenTypeFuncs(mix)));
+ comm.push(op("mix", "mix", GT, [v(FV, -1.0, 1.0), v(FV, -1.0, 1.0), v(F, 0.0, 1.0)], f(0.5), f(0.5),
+ all, es3fShaderOperatorTests.ternaryVecVecScalarFuncs(mixVecVecScalar)));
+
+ comm = new es3fShaderOperatorTests.BuiltinFuncGroup("common_functions", "Common function tests.");
+ funcInfoGroups.push(comm);
+
+ comm.push(op("step", "step", GT, [v(GT, -1.0, 1.0), v(GT, -1.0, 0.0)], f(0.5), f(0.25),
+ all, es3fShaderOperatorTests.binaryGenTypeFuncs(step)));
+ comm.push(op("step", "step", GT, [v(F, -1.0, 1.0), v(FV, -1.0, 0.0)], f(0.5), f(0.25),
+ all, es3fShaderOperatorTests.binaryScalarVecFuncs(stepScalarVec)));
+ comm.push(op("smoothstep", "smoothstep", GT, [v(GT, -0.5, 0.0), v(GT, 0.1, 1.0), v(GT, -1.0, 1.0)], f(0.5), f(0.5),
+ all, es3fShaderOperatorTests.ternaryGenTypeFuncs(smoothStep)));
+ comm.push(op("smoothstep", "smoothstep", GT, [v(F, -0.5, 0.0), v(F, 0.1, 1.0), v(FV, -1.0, 1.0)], f(0.5), f(0.5),
+ all, es3fShaderOperatorTests.ternaryScalarScalarVecFuncs(smoothStepScalarScalarVec)));
+
+ // 8.4 Geometric Functions.
+ var geom = new es3fShaderOperatorTests.BuiltinFuncGroup("geometric", "Geometric function tests.");
+ geom.push(op("length", "length", F, [v(GT, -5.0, 5.0)], f(0.1), f(0.5),
+ mediumhighp, es3fShaderOperatorTests.unaryScalarGenTypeFuncs(length)));
+ geom.push(op("distance", "distance", F, [v(GT, -5.0, 5.0), v(GT, -5.0, 5.0)], f(0.1), f(0.5),
+ mediumhighp, es3fShaderOperatorTests.binaryScalarGenTypeFuncs(distance)));
+ geom.push(op("dot", "dot", F, [v(GT, -5.0, 5.0), v(GT, -5.0, 5.0)], f(0.1), f(0.5),
+ mediumhighp, es3fShaderOperatorTests.binaryScalarGenTypeFuncs(dot)));
+ geom.push(op("cross", "cross", V3, [v(GT, -5.0, 5.0), v(GT, -5.0, 5.0)], f(0.1), f(0.5),
+ mediumhighp, {vec3: es3fShaderOperatorTests.binaryVecVecFuncs(cross).vec3}));
+ geom.push(op("normalize", "normalize", GT, [v(GT, 0.1, 4.0)], f(0.5), f(0.5),
+ mediumhighp, es3fShaderOperatorTests.unaryArrayFuncs(normalize)));
+ geom.push(op("faceforward", "faceforward", GT, [v(GT, -5.0, 5.0), v(GT, -5.0, 5.0), v(GT, -1.0, 1.0)], f(0.5), f(0.5),
+ mediumhighp, es3fShaderOperatorTests.ternaryVecVecVecFuncs(faceforward)));
+ geom.push(op("reflect", "reflect", GT, [v(GT, -0.8, -0.5), v(GT, 0.5, 0.8)], f(0.5), f(0.5),
+ mediumhighp, es3fShaderOperatorTests.binaryVecVecFuncs(reflect)));
+ geom.push(op("refract", "refract", GT, [v(GT, -0.8, 1.2), v(GT, -1.1, 0.5), v(F, 0.2, 1.5)], f(0.5), f(0.5),
+ mediumhighp, es3fShaderOperatorTests.ternaryVecVecScalarFuncs(refract)));
+
+ funcInfoGroups.push(geom);
+
+ // 8.6 Vector Relational Functions.
+ var floatComp = new es3fShaderOperatorTests.BuiltinFuncGroup("float_compare", "Floating point comparison tests.");
+ floatComp.push(op("lessThan", "lessThan", BV, [v(FV, -1.0, 1.0), v(FV, -1.0, 1.0)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryVecVecFuncs(lessThanVec)));
+ floatComp.push(op("lessThanEqual", "lessThanEqual", BV, [v(FV, -1.0, 1.0), v(FV, -1.0, 1.0)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryVecVecFuncs(lessThanEqualVec)));
+ floatComp.push(op("greaterThan", "greaterThan", BV, [v(FV, -1.0, 1.0), v(FV, -1.0, 1.0)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryVecVecFuncs(greaterThanVec)));
+ floatComp.push(op("greaterThanEqual", "greaterThanEqual", BV, [v(FV, -1.0, 1.0), v(FV, -1.0, 1.0)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryVecVecFuncs(greaterThanEqualVec)));
+ floatComp.push(op("equal", "equal", BV, [v(FV, -1.0, 1.0), v(FV, -1.0, 1.0)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryVecVecFuncs(allEqualVec)));
+ floatComp.push(op("notEqual", "notEqual", BV, [v(FV, -1.0, 1.0), v(FV, -1.0, 1.0)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryVecVecFuncs(anyNotEqualVec)));
+
+ funcInfoGroups.push(floatComp);
+
+ var intComp = new es3fShaderOperatorTests.BuiltinFuncGroup("int_compare", "Integer comparison tests.");
+ intComp.push(op("lessThan", "lessThan", BV, [v(IV, 5.2, 4.9), v(IV, -5.0, 5.0)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryVecVecFuncs(lessThanVec, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ intComp.push(op("lessThanEqual", "lessThanEqual", BV, [v(IV, -5.2, 4.9), v(IV, -5.0, 5.0)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryVecVecFuncs(lessThanEqualVec, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ intComp.push(op("greaterThan", "greaterThan", BV, [v(IV, -5.2, 4.9), v(IV, -5.0, 5.0)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryVecVecFuncs(greaterThanVec, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ intComp.push(op("greaterThanEqual", "greaterThanEqual", BV, [v(IV, -5.2, 4.9), v(IV, -5.0, 5.0)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryVecVecFuncs(greaterThanEqualVec, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ intComp.push(op("equal", "equal", BV, [v(IV, -5.2, 4.9), v(IV, -5.0, 5.0)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryVecVecFuncs(allEqualVec, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+ intComp.push(op("notEqual", "notEqual", BV, [v(IV, -5.2, 4.9), v(IV, -5.0, 5.0)], f(1.0), f(0.0),
+ all, es3fShaderOperatorTests.binaryVecVecFuncs(anyNotEqualVec, gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT)));
+
+ funcInfoGroups.push(intComp);
+
+ var boolComp = new es3fShaderOperatorTests.BuiltinFuncGroup("bool_compare", "Boolean comparison tests.");
+ var evalBoolEqual = es3fShaderOperatorTests.binaryVecVecFuncs(allEqualVec, gluShaderUtil.DataType.BOOL,
+ gluShaderUtil.DataType.BOOL);
+ var evalBoolNotEqual = es3fShaderOperatorTests.binaryVecVecFuncs(anyNotEqualVec, gluShaderUtil.DataType.BOOL,
+ gluShaderUtil.DataType.BOOL);
+ var evalBoolAny = es3fShaderOperatorTests.unaryBooleanGenTypeFuncs(boolAny, gluShaderUtil.DataType.BOOL,
+ gluShaderUtil.DataType.BOOL);
+ evalBoolAny.scalar = null;
+ var evalBoolAll = es3fShaderOperatorTests.unaryBooleanGenTypeFuncs(boolAll, gluShaderUtil.DataType.BOOL,
+ gluShaderUtil.DataType.BOOL);
+ evalBoolAll.scalar = null;
+ var evalBoolNot = es3fShaderOperatorTests.unaryArrayFuncs(boolNotVec, gluShaderUtil.DataType.BOOL,
+ gluShaderUtil.DataType.BOOL);
+ evalBoolNot.scalar = null;
+
+ boolComp.push(op("equal", "equal", BV, [v(BV, -5.2, 4.9), v(BV, -5.0, 5.0)], f(1.0), f(0.0),
+ na, evalBoolEqual));
+ boolComp.push(op("notEqual", "notEqual", BV, [v(BV, -5.2, 4.9), v(BV, -5.0, 5.0)], f(1.0), f(0.0),
+ na, evalBoolNotEqual));
+ boolComp.push(op("any", "any", B, [v(BV, -1.0, 0.3)], f(1.0), f(0.0),
+ na, evalBoolAny));
+ boolComp.push(op("all", "all", B, [v(BV, -0.3, 1.0)], f(1.0), f(0.0),
+ na, evalBoolAll));
+ boolComp.push(op("not", "not", BV, [v(BV, -1.0, 1.0)], f(1.0), f(0.0),
+ na, evalBoolNot));
+
+ funcInfoGroups.push(boolComp);
+
+ var s_shaderTypes = [
+ gluShaderProgram.shaderType.VERTEX,
+ gluShaderProgram.shaderType.FRAGMENT
+ ];
+
+ var s_floatTypes = [
+ gluShaderUtil.DataType.FLOAT,
+ gluShaderUtil.DataType.FLOAT_VEC2,
+ gluShaderUtil.DataType.FLOAT_VEC3,
+ gluShaderUtil.DataType.FLOAT_VEC4
+ ];
+
+ var s_intTypes = [
+ gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT_VEC2,
+ gluShaderUtil.DataType.INT_VEC3,
+ gluShaderUtil.DataType.INT_VEC4
+ ];
+
+ var s_uintTypes = [
+ gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT_VEC2,
+ gluShaderUtil.DataType.UINT_VEC3,
+ gluShaderUtil.DataType.UINT_VEC4
+ ];
+
+ var s_boolTypes = [
+ gluShaderUtil.DataType.BOOL,
+ gluShaderUtil.DataType.BOOL_VEC2,
+ gluShaderUtil.DataType.BOOL_VEC3,
+ gluShaderUtil.DataType.BOOL_VEC4
+ ];
+
+ for (var outerGroupNdx = 0; outerGroupNdx < funcInfoGroups.length; outerGroupNdx++) {
+ // Create outer group.
+ var outerGroupInfo = funcInfoGroups[outerGroupNdx];
+ var outerGroup = new tcuTestCase.DeqpTest(outerGroupInfo.name, outerGroupInfo.description);
+ this.addChild(outerGroup);
+
+ // Only create new group if name differs from previous one.
+ var innerGroup = null;
+
+ for (var funcInfoNdx = 0; funcInfoNdx < outerGroupInfo.funcInfos.length; funcInfoNdx++) {
+ var funcInfo = outerGroupInfo.funcInfos[funcInfoNdx];
+ var shaderFuncName = funcInfo.shaderFuncName;
+ var isBoolCase = (funcInfo.precision == es3fShaderOperatorTests.Precision.None);
+ var isBoolOut = es3fShaderOperatorTests.isBoolType(funcInfo.outValue);
+ var isIntOut = es3fShaderOperatorTests.isIntType(funcInfo.outValue);
+ var isUintOut = es3fShaderOperatorTests.isUintType(funcInfo.outValue);
+ var isFloatOut = !isBoolOut && !isIntOut && !isUintOut;
+
+ if (!innerGroup || (innerGroup.name != funcInfo.caseName)) {
+ var groupDesc = 'Built-in function ' + shaderFuncName + '() tests.';
+ innerGroup = new tcuTestCase.DeqpTest(funcInfo.caseName, groupDesc);
+ outerGroup.addChild(innerGroup);
+ }
+
+ for (var inScalarSize = 1; inScalarSize <= 4; inScalarSize++) {
+ var outScalarSize = ((funcInfo.outValue == es3fShaderOperatorTests.ValueType.FLOAT) || (funcInfo.outValue == es3fShaderOperatorTests.ValueType.BOOL)) ? 1 : inScalarSize; // \todo [petri] Int.
+ var outDataType = isFloatOut ? s_floatTypes[outScalarSize - 1] :
+ isIntOut ? s_intTypes[outScalarSize - 1] :
+ isUintOut ? s_uintTypes[outScalarSize - 1] :
+ isBoolOut ? s_boolTypes[outScalarSize - 1] :
+ undefined;
+
+ var evalFunc = null;
+ if (inScalarSize == 1) evalFunc = funcInfo.evalFunctions.scalar;
+ else if (inScalarSize == 2) evalFunc = funcInfo.evalFunctions.vec2;
+ else if (inScalarSize == 3) evalFunc = funcInfo.evalFunctions.vec3;
+ else if (inScalarSize == 4) evalFunc = funcInfo.evalFunctions.vec4;
+ else throw new Error('Invalid scalar size ' + inScalarSize);
+
+ // Skip if no valid eval func.
+ // \todo [petri] Better check for V3 only etc. cases?
+ if (evalFunc == null)
+ continue;
+
+ var precisions = ['low', 'medium', 'high'];
+ for (var precId = 0; precId < precisions.length; precId++) {
+ var precision = precisions[precId];
+ if ((funcInfo.precision[precision]) ||
+ (funcInfo.precision == es3fShaderOperatorTests.Precision.None && precision === 'medium')) { // use mediump interpolators for booleans
+ var precisionPrefix = isBoolCase ? '' : precision + 'p_';
+
+ for (var shaderTypeNdx = 0; shaderTypeNdx < s_shaderTypes.length; shaderTypeNdx++) {
+ var shaderType = s_shaderTypes[shaderTypeNdx];
+ var shaderSpec = new es3fShaderOperatorTests.ShaderDataSpec();
+ var shaderTypeName = gluShaderProgram.getShaderTypeName(shaderType);
+ var isVertexCase = shaderType == gluShaderProgram.shaderType.VERTEX;
+ var isUnaryOp = (funcInfo.inputs.length == 1);
+
+ // \note Data type names will be added to description and name in a following loop.
+ var desc = 'Built-in function ' + shaderFuncName + '(';
+ var name = precisionPrefix;
+
+ // Generate shader op.
+ var shaderOp = 'res = ';
+
+ var precNames = [gluShaderUtil.precision.PRECISION_LOWP,
+ gluShaderUtil.precision.PRECISION_MEDIUMP,
+ gluShaderUtil.precision.PRECISION_HIGHP];
+ // Setup shader data info.
+ shaderSpec.numInputs = 0;
+ shaderSpec.precision = isBoolCase ? undefined : precNames[precId];
+ shaderSpec.output = outDataType;
+ shaderSpec.resultScale = funcInfo.resultScale;
+ shaderSpec.resultBias = funcInfo.resultBias;
+ shaderSpec.referenceScale = funcInfo.referenceScale;
+ shaderSpec.referenceBias = funcInfo.referenceBias;
+
+ if (funcInfo.type == es3fShaderOperatorTests.OperationType.OPERATOR) {
+ if (isUnaryOp && funcInfo.isUnaryPrefix)
+ shaderOp += shaderFuncName;
+ } else if (funcInfo.type == es3fShaderOperatorTests.OperationType.FUNCTION)
+ shaderOp += shaderFuncName + '(';
+ else // SIDE_EFFECT_OPERATOR
+ shaderOp += 'in0;\n\t';
+
+ for (var inputNdx = 0; inputNdx < funcInfo.inputs.length; inputNdx++) {
+ var prevNdx = inputNdx > 0 ? inputNdx - 1 : funcInfo.inputs.length - 1;
+ var prevValue = funcInfo.inputs[prevNdx];
+ var value = funcInfo.inputs[inputNdx];
+
+ if (value.valueType == es3fShaderOperatorTests.ValueType.NONE)
+ continue; // Skip unused input.
+
+ var prevInScalarSize = es3fShaderOperatorTests.isScalarType(prevValue.valueType) ? 1 : inScalarSize;
+ var prevInDataType = es3fShaderOperatorTests.isFloatType(prevValue.valueType) ? s_floatTypes[prevInScalarSize - 1] :
+ es3fShaderOperatorTests.isIntType(prevValue.valueType) ? s_intTypes[prevInScalarSize - 1] :
+ es3fShaderOperatorTests.isUintType(prevValue.valueType) ? s_uintTypes[prevInScalarSize - 1] :
+ es3fShaderOperatorTests.isBoolType(prevValue.valueType) ? s_boolTypes[prevInScalarSize - 1] :
+ undefined;
+
+ var curInScalarSize = es3fShaderOperatorTests.isScalarType(value.valueType) ? 1 : inScalarSize;
+ var curInDataType = es3fShaderOperatorTests.isFloatType(value.valueType) ? s_floatTypes[curInScalarSize - 1] :
+ es3fShaderOperatorTests.isIntType(value.valueType) ? s_intTypes[curInScalarSize - 1] :
+ es3fShaderOperatorTests.isUintType(value.valueType) ? s_uintTypes[curInScalarSize - 1] :
+ es3fShaderOperatorTests.isBoolType(value.valueType) ? s_boolTypes[curInScalarSize - 1] :
+ undefined;
+
+ // Write input type(s) to case description and name.
+
+ if (inputNdx > 0)
+ desc += ', ';
+
+ desc += gluShaderUtil.getDataTypeName(curInDataType);
+
+ if (inputNdx == 0 || prevInDataType != curInDataType) // \note Only write input type to case name if different from previous input type (avoid overly long names).
+ name += gluShaderUtil.getDataTypeName(curInDataType) + '_';
+
+ // Generate op input source.
+
+ if (funcInfo.type == es3fShaderOperatorTests.OperationType.OPERATOR || funcInfo.type == es3fShaderOperatorTests.OperationType.FUNCTION) {
+ if (inputNdx != 0) {
+ if (funcInfo.type == es3fShaderOperatorTests.OperationType.OPERATOR && !isUnaryOp)
+ shaderOp += ' ' + shaderFuncName + ' ';
+ else
+ shaderOp += ', ';
+ }
+
+ shaderOp += 'in' + inputNdx.toString(10);
+
+ if (funcInfo.type == es3fShaderOperatorTests.OperationType.OPERATOR && isUnaryOp && !funcInfo.isUnaryPrefix)
+ shaderOp += shaderFuncName;
+ } else{
+ if (inputNdx != 0 || (isUnaryOp && funcInfo.isUnaryPrefix))
+ shaderOp += (isUnaryOp ? '' : ' ') + shaderFuncName + (isUnaryOp ? '' : ' ');
+
+ shaderOp += inputNdx == 0 ? 'res' : 'in' + inputNdx.toString(10); // \note in0 has already been assigned to res, so start from in1.
+
+ if (isUnaryOp && !funcInfo.isUnaryPrefix)
+ shaderOp += shaderFuncName;
+ }
+
+ // Fill in shader info.
+ shaderSpec.inputs[shaderSpec.numInputs++] = new es3fShaderOperatorTests.ShaderValue(curInDataType, value.rangeMin, value.rangeMax);
+ }
+
+ if (funcInfo.type == es3fShaderOperatorTests.OperationType.FUNCTION)
+ shaderOp += ')';
+
+ shaderOp += ';';
+
+ desc += ').';
+ name += shaderTypeName;
+
+ // Create the test case.
+ innerGroup.addChild(new es3fShaderOperatorTests.ShaderOperatorCase(name, desc, isVertexCase, evalFunc, shaderOp, shaderSpec));
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // The ?: selection operator.
+
+ var s_selectionInfo = [
+ gluShaderUtil.DataType.FLOAT,
+ gluShaderUtil.DataType.FLOAT_VEC2,
+ gluShaderUtil.DataType.FLOAT_VEC3,
+ gluShaderUtil.DataType.FLOAT_VEC4,
+ gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT_VEC2,
+ gluShaderUtil.DataType.INT_VEC3,
+ gluShaderUtil.DataType.INT_VEC4,
+ gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT_VEC2,
+ gluShaderUtil.DataType.UINT_VEC3,
+ gluShaderUtil.DataType.UINT_VEC4,
+ gluShaderUtil.DataType.BOOL,
+ gluShaderUtil.DataType.BOOL_VEC2,
+ gluShaderUtil.DataType.BOOL_VEC3,
+ gluShaderUtil.DataType.BOOL_VEC4
+ ];
+
+ var selectionEvalFuncsFloat = es3fShaderOperatorTests.selectionFuncs(gluShaderUtil.DataType.FLOAT);
+ var selectionEvalFuncsInt = es3fShaderOperatorTests.selectionFuncs(gluShaderUtil.DataType.INT);
+ var selectionEvalFuncsUint = es3fShaderOperatorTests.selectionFuncs(gluShaderUtil.DataType.UINT);
+ var selectionEvalFuncsBool = es3fShaderOperatorTests.selectionFuncs(gluShaderUtil.DataType.BOOL);
+
+ var selectionGroup = new tcuTestCase.DeqpTest('selection', 'Selection operator tests');
+ this.addChild(selectionGroup);
+
+ for (var typeNdx = 0; typeNdx < s_selectionInfo.length; typeNdx++) {
+ var curType = s_selectionInfo[typeNdx];
+ var scalarSize = gluShaderUtil.getDataTypeScalarSize(curType);
+ var isBoolCase = gluShaderUtil.isDataTypeBoolOrBVec(curType);
+ var isFloatCase = gluShaderUtil.isDataTypeFloatOrVec(curType);
+ var isIntCase = gluShaderUtil.isDataTypeIntOrIVec(curType);
+ var isUintCase = gluShaderUtil.isDataTypeUintOrUVec(curType);
+ var dataTypeStr = gluShaderUtil.getDataTypeName(curType);
+
+ var evalFuncs = selectionEvalFuncsFloat;
+ if (isBoolCase)
+ evalFuncs = selectionEvalFuncsBool;
+ else if (isIntCase)
+ evalFuncs = selectionEvalFuncsInt;
+ else if (isUintCase)
+ evalFuncs = selectionEvalFuncsUint;
+
+ var evalFunc = evalFuncs[scalarSize];
+
+ for (var prec in gluShaderUtil.precision) {
+ var precision = gluShaderUtil.precision[prec];
+ if (isBoolCase && precision != gluShaderUtil.precision.PRECISION_MEDIUMP) // Use mediump interpolators for booleans.
+ continue;
+
+ var precisionStr = gluShaderUtil.getPrecisionName(precision);
+ var precisionPrefix = isBoolCase ? '' : (precisionStr + '_');
+
+ for (var shaderTypeNdx = 0; shaderTypeNdx < s_shaderTypes.length; shaderTypeNdx++) {
+ var shaderType = s_shaderTypes[shaderTypeNdx];
+ var shaderSpec = new es3fShaderOperatorTests.ShaderDataSpec();
+ var shaderTypeName = gluShaderProgram.getShaderTypeName(shaderType);
+ var isVertexCase = shaderType == gluShaderProgram.shaderType.VERTEX;
+
+ var name = precisionPrefix + dataTypeStr + '_' + shaderTypeName;
+
+ shaderSpec.numInputs = 3;
+ shaderSpec.precision = isBoolCase ? undefined : precision;
+ shaderSpec.output = curType;
+ shaderSpec.resultScale = isBoolCase ? f(1.0) : isFloatCase ? f(0.5) : isUintCase ? f(0.5) : f(0.1);
+ shaderSpec.resultBias = isBoolCase ? f(0.0) : isFloatCase ? f(0.5) : isUintCase ? f(0.0) : f(0.5);
+ shaderSpec.referenceScale = shaderSpec.resultScale;
+ shaderSpec.referenceBias = shaderSpec.resultBias;
+
+ var rangeMin = isBoolCase ? -1.0 : isFloatCase ? -1.0 : isUintCase ? 0.0 : -5.0;
+ var rangeMax = isBoolCase ? 1.0 : isFloatCase ? 1.0 : isUintCase ? 2.0 : 5.0;
+
+ shaderSpec.inputs[0] = new es3fShaderOperatorTests.ShaderValue(gluShaderUtil.DataType.BOOL, f(-1.0), f(1.0));
+ shaderSpec.inputs[1] = new es3fShaderOperatorTests.ShaderValue(curType, f(rangeMin), f(rangeMax));
+ shaderSpec.inputs[2] = new es3fShaderOperatorTests.ShaderValue(curType, f(rangeMin), f(rangeMax));
+
+ selectionGroup.addChild(new es3fShaderOperatorTests.ShaderOperatorCase(name, '', isVertexCase, evalFunc, 'res = in0 ? in1 : in2;', shaderSpec));
+ }
+ }
+ }
+
+ // The sequence operator (comma).
+ /** @type {tcuTestCase.DeqpTest} */ var sequenceGroup = new tcuTestCase.DeqpTest('sequence', 'sequence');
+ this.addChild(sequenceGroup);
+
+ /** @type {tcuTestCase.DeqpTest} */ var sequenceNoSideEffGroup = new tcuTestCase.DeqpTest('no_side_effects', 'Sequence tests without side-effects');
+ /** @type {tcuTestCase.DeqpTest} */ var sequenceSideEffGroup = new tcuTestCase.DeqpTest('side_effects', 'Sequence tests with side-effects');
+ sequenceGroup.addChild(sequenceNoSideEffGroup);
+ sequenceGroup.addChild(sequenceSideEffGroup);
+
+ /**
+ * @struct
+ * @constructor
+ * @param {boolean} containsSideEffects
+ * @param {string} caseName
+ * @param {string} expressionStr
+ * @param {number} numInputs
+ * @param {Array<gluShaderUtil.DataType>} inputTypes
+ * @param {gluShaderUtil.DataType} resultType
+ * @param {glsShaderRenderCase.ShaderEvalFunc} evalFunc
+ */
+ var SequenceCase = function(containsSideEffects, caseName, expressionStr, numInputs, inputTypes, resultType, evalFunc) {
+ /** @type {boolean} */ this.containsSideEffects = containsSideEffects;
+ /** @type {string} */ this.caseName = caseName;
+ /** @type {string} */ this.expressionStr = expressionStr;
+ /** @type {number} */ this.numInputs = numInputs;
+ /** @type {Array<gluShaderUtil.DataType>} */ this.inputTypes = inputTypes;
+ /** @type {gluShaderUtil.DataType} */ this.resultType = resultType;
+ /** @type {glsShaderRenderCase.ShaderEvalFunc} */ this.evalFunc = evalFunc;
+ };
+
+ /** @type {Array<SequenceCase>} */ var s_sequenceCases = [
+ new SequenceCase(false, 'vec4', 'in0, in2 + in1, in1 + in0', 3, [gluShaderUtil.DataType.FLOAT_VEC4, gluShaderUtil.DataType.FLOAT_VEC4, gluShaderUtil.DataType.FLOAT_VEC4], gluShaderUtil.DataType.FLOAT_VEC4, es3fShaderOperatorTests.evalSequenceNoSideEffCase0),
+ new SequenceCase(false, 'float_uint', 'in0 + in2, in1 + in1', 3, [gluShaderUtil.DataType.FLOAT, gluShaderUtil.DataType.UINT, gluShaderUtil.DataType.FLOAT], gluShaderUtil.DataType.UINT, es3fShaderOperatorTests.evalSequenceNoSideEffCase1),
+ new SequenceCase(false, 'bool_vec2', 'in0 && in1, in0, ivec2(vec2(in0) + in2)', 3, [gluShaderUtil.DataType.BOOL, gluShaderUtil.DataType.BOOL, gluShaderUtil.DataType.FLOAT_VEC2], gluShaderUtil.DataType.INT_VEC2, es3fShaderOperatorTests.evalSequenceNoSideEffCase2),
+ new SequenceCase(false, 'vec4_ivec4_bvec4', 'in0 + vec4(in1), in2, in1', 3, [gluShaderUtil.DataType.FLOAT_VEC4, gluShaderUtil.DataType.INT_VEC4, gluShaderUtil.DataType.BOOL_VEC4], gluShaderUtil.DataType.INT_VEC4, es3fShaderOperatorTests.evalSequenceNoSideEffCase3),
+
+ new SequenceCase(true, 'vec4', 'in0++, in1 = in0 + in2, in2 = in1', 3, [gluShaderUtil.DataType.FLOAT_VEC4, gluShaderUtil.DataType.FLOAT_VEC4, gluShaderUtil.DataType.FLOAT_VEC4], gluShaderUtil.DataType.FLOAT_VEC4, es3fShaderOperatorTests.evalSequenceSideEffCase0),
+ new SequenceCase(true, 'float_uint', 'in1++, in0 = float(in1), in1 = uint(in0 + in2)', 3, [gluShaderUtil.DataType.FLOAT, gluShaderUtil.DataType.UINT, gluShaderUtil.DataType.FLOAT], gluShaderUtil.DataType.UINT, es3fShaderOperatorTests.evalSequenceSideEffCase1),
+ new SequenceCase(true, 'bool_vec2', 'in1 = in0, in2++, in2 = in2 + vec2(in1), ivec2(in2)', 3, [gluShaderUtil.DataType.BOOL, gluShaderUtil.DataType.BOOL, gluShaderUtil.DataType.FLOAT_VEC2], gluShaderUtil.DataType.INT_VEC2, es3fShaderOperatorTests.evalSequenceSideEffCase2),
+ new SequenceCase(true, 'vec4_ivec4_bvec4', 'in0 = in0 + vec4(in2), in1 = in1 + ivec4(in0), in1++', 3, [gluShaderUtil.DataType.FLOAT_VEC4, gluShaderUtil.DataType.INT_VEC4, gluShaderUtil.DataType.BOOL_VEC4], gluShaderUtil.DataType.INT_VEC4, es3fShaderOperatorTests.evalSequenceSideEffCase3)
+ ];
+
+ for (var caseNdx = 0; caseNdx < s_sequenceCases.length; caseNdx++) {
+ for (var precision in gluShaderUtil.precision) {
+ for (var shaderTypeNdx = 0; shaderTypeNdx < s_shaderTypes.length; shaderTypeNdx++) {
+ /** @type {gluShaderProgram.shaderType} */ var shaderType = s_shaderTypes[shaderTypeNdx];
+ /** @type {es3fShaderOperatorTests.ShaderDataSpec} */ var shaderSpec = new es3fShaderOperatorTests.ShaderDataSpec();
+ /** @type {string} */ var shaderTypeName = gluShaderProgram.getShaderTypeName(shaderType);
+ /** @type {boolean} */ var isVertexCase = shaderType === gluShaderProgram.shaderType.VERTEX;
+
+ /** @type {string} */ var name = gluShaderUtil.getPrecisionName(gluShaderUtil.precision[precision]) + '_' + s_sequenceCases[caseNdx].caseName + '_' + shaderTypeName;
+
+ shaderSpec.numInputs = s_sequenceCases[caseNdx].numInputs;
+ shaderSpec.precision = gluShaderUtil.precision[precision];
+ shaderSpec.output = s_sequenceCases[caseNdx].resultType;
+ shaderSpec.resultScale = f(0.5);
+ shaderSpec.resultBias = f(0.0);
+ shaderSpec.referenceScale = shaderSpec.resultScale;
+ shaderSpec.referenceBias = shaderSpec.resultBias;
+
+ for (var inputNdx = 0; inputNdx < s_sequenceCases[caseNdx].numInputs; inputNdx++) {
+ /** @type {gluShaderUtil.DataType} */ var type = s_sequenceCases[caseNdx].inputTypes[inputNdx];
+ /** @type {es3fShaderOperatorTests.FloatScalar} */ var rangeMin = gluShaderUtil.isDataTypeFloatOrVec(type) ?
+ f(-0.5) : gluShaderUtil.isDataTypeIntOrIVec(type) ?
+ f(-2.0) : gluShaderUtil.isDataTypeUintOrUVec(type) ?
+ f(0.0) : f(-1.0);
+
+ /** @type {es3fShaderOperatorTests.FloatScalar} */ var rangeMax = gluShaderUtil.isDataTypeFloatOrVec(type) ?
+ f(0.5) : gluShaderUtil.isDataTypeIntOrIVec(type) ?
+ f(2.0) : gluShaderUtil.isDataTypeUintOrUVec(type) ?
+ f(2.0) : f(1.0);
+
+ shaderSpec.inputs[inputNdx] = new es3fShaderOperatorTests.ShaderValue(type, rangeMin, rangeMax);
+ }
+
+ /** @type {string} */ var expression = 'res = (' + s_sequenceCases[caseNdx].expressionStr + ');';
+
+ if (s_sequenceCases[caseNdx].containsSideEffects)
+ sequenceSideEffGroup.addChild(new es3fShaderOperatorTests.ShaderOperatorCase(name, '', isVertexCase, s_sequenceCases[caseNdx].evalFunc, expression, shaderSpec));
+ else
+ sequenceNoSideEffGroup.addChild(new es3fShaderOperatorTests.ShaderOperatorCase(name, '', isVertexCase, s_sequenceCases[caseNdx].evalFunc, expression, shaderSpec));
+ }
+ }
+ }
+
+};
+
+/**
+* Run test
+* @param {WebGL2RenderingContext} context
+*/
+es3fShaderOperatorTests.run = function(context, range) {
+ gl = context;
+
+ const canvas = gl.canvas;
+ canvas.width = canvasWH;
+ canvas.height = canvasWH;
+
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fShaderOperatorTests.ShaderOperatorTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ if (range)
+ state.setRange(range);
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fShaderOperatorTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderPackingFunctionTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderPackingFunctionTests.js
new file mode 100644
index 0000000000..3e4233db4c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderPackingFunctionTests.js
@@ -0,0 +1,791 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fShaderPackingFunctionTests');
+goog.require('framework.common.tcuFloat');
+goog.require('framework.common.tcuMatrixUtil');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluVarType');
+goog.require('modules.shared.glsShaderExecUtil');
+
+
+
+goog.scope(function() {
+ var es3fShaderPackingFunctionTests = functional.gles3.es3fShaderPackingFunctionTests;
+ var tcuFloat = framework.common.tcuFloat;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var deMath = framework.delibs.debase.deMath;
+ var deRandom = framework.delibs.debase.deRandom;
+ var deString = framework.delibs.debase.deString;
+ var gluShaderProgram = framework.opengl.gluShaderProgram;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var gluVarType = framework.opengl.gluVarType;
+ var glsShaderExecUtil = modules.shared.glsShaderExecUtil;
+ var tcuMatrixUtil = framework.common.tcuMatrixUtil;
+ /**
+ * @param {number} a
+ * @param {number} b
+ * @return {number}
+ */
+ es3fShaderPackingFunctionTests.getUlpDiff = function(a, b) {
+ /** @type {number} */ var aBits = tcuFloat.newFloat32(a).bits();
+ /** @type {number} */ var bBits = tcuFloat.newFloat32(b).bits();
+ return aBits > bBits ? aBits - bBits : bBits - aBits;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} description
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+ es3fShaderPackingFunctionTests.ShaderPackingFunctionCase = function(name, description, shaderType) {
+ tcuTestCase.DeqpTest.call(this, name, description);
+ /** @type {gluShaderProgram.shaderType} */ this.m_shaderType = shaderType;
+ /** @type {?glsShaderExecUtil.ShaderSpec} */ this.m_spec = new glsShaderExecUtil.ShaderSpec();
+ /** @type {?glsShaderExecUtil.ShaderExecutor} */ this.m_executor = null;
+ };
+
+ es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.prototype.constructor = es3fShaderPackingFunctionTests.ShaderPackingFunctionCase;
+
+ es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.prototype.init = function() {
+ assertMsgOptions(!this.m_executor, 'Error: Executor is not null.', false, true);
+ this.m_executor = glsShaderExecUtil.createExecutor(this.m_shaderType, this.m_spec);
+ if (!this.m_executor.isOk())
+ throw new Error('Compile failed');
+ };
+
+ es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.prototype.deinit = function() {
+ this.m_executor = null;
+ };
+
+ /**
+ * @param {gluShaderUtil.precision} precision
+ * @return {string}
+ */
+ es3fShaderPackingFunctionTests.getPrecisionPostfix = function(precision) {
+ /** @type {Array<string>} */ var s_postfix = [
+ '_lowp',
+ '_mediump',
+ '_highp'
+ ];
+ assertMsgOptions(0 <= precision && precision < s_postfix.length, 'Error: Out of range', false, true);
+ return s_postfix[precision];
+ };
+
+ /**
+ * @param {gluShaderProgram.shaderType} shaderType
+ * @return {string}
+ */
+ es3fShaderPackingFunctionTests.getShaderTypePostfix = function(shaderType) {
+ /** @type {Array<string>} */ var s_postfix = [
+ '_vertex',
+ '_fragment'
+ ];
+ assertMsgOptions(0 <= shaderType && shaderType < s_postfix.length, 'Error Out of range', false, true);
+ return s_postfix[shaderType];
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fShaderPackingFunctionTests.ShaderPackingFunctionCase}
+ * @param {gluShaderProgram.shaderType} shaderType
+ * @param {gluShaderUtil.precision} precision
+ */
+ es3fShaderPackingFunctionTests.PackSnorm2x16Case = function(shaderType, precision) {
+ /** @const {string} */ var name = 'packsnorm2x16' +
+ es3fShaderPackingFunctionTests.getPrecisionPostfix(precision) +
+ es3fShaderPackingFunctionTests.getShaderTypePostfix(shaderType);
+ es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.call(this, name, 'packSnorm2x16', shaderType);
+ this.m_precision = precision;
+
+ this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_VEC2, precision)));
+ this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(gluShaderUtil.DataType.UINT, gluShaderUtil.precision.PRECISION_HIGHP)));
+ this.m_spec.source = 'out0 = packSnorm2x16(in0);';
+ };
+
+ es3fShaderPackingFunctionTests.PackSnorm2x16Case.prototype = Object.create(es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.prototype);
+ es3fShaderPackingFunctionTests.PackSnorm2x16Case.prototype.constructor = es3fShaderPackingFunctionTests.PackSnorm2x16Case;
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fShaderPackingFunctionTests.PackSnorm2x16Case.prototype.iterate = function() {
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0x776002);
+ /** @type {Array<Array<number>>} */ var inputs = [];
+ /** @type {goog.TypedArray} */ var outputs; // deUint32
+ /** @type {goog.TypedArray} */ var shaderExecutorOutput;
+ /** @type {number} */ var maxDiff = this.m_precision == gluShaderUtil.precision.PRECISION_HIGHP ? 1 : // Rounding only.
+ this.m_precision == gluShaderUtil.precision.PRECISION_MEDIUMP ? 33 : // (2^-10) * (2^15) + 1
+ this.m_precision == gluShaderUtil.precision.PRECISION_LOWP ? 129 : 0; // (2^-8) * (2^15) + 1
+ /** @type {number} */ var x;
+ /** @type {number} */ var y;
+ // Special values to check.
+ inputs.push([0.0, 0.0]);
+ inputs.push([-1.0, 1.0]);
+ inputs.push([0.5, -0.5]);
+ inputs.push([-1.5, 1.5]);
+ inputs.push([0.25, -0.75]);
+
+ // Random values, mostly in range.
+ for (var ndx = 0; ndx < 15; ndx++) {
+ x = rnd.getFloat() * 2.5 - 1.25;
+ y = rnd.getFloat() * 2.5 - 1.25;
+ inputs.push([x, y]);
+ }
+
+ // Large random values.
+ for (var ndx = 0; ndx < 80; ndx++) {
+ x = rnd.getFloat() * 1e6 - 0.5e6;
+ y = rnd.getFloat() * 1e6 - 0.5e6;
+ inputs.push([x, y]);
+ }
+
+ bufferedLogToConsole('Executing shader for ' + inputs.length + ' input values');
+
+ this.m_executor.useProgram();
+ shaderExecutorOutput = this.m_executor.execute(inputs.length, [tcuMatrixUtil.flatten(inputs)])[0];
+
+ // Convert outputs if we get them as Uint8Array.
+ // - VertexShaderExecutor.execute() returns either an array of Uint8Array
+ // - FragmentShaderExecutor.execute() returns either an array of Uint8Array or Uint32Array
+ outputs = new Uint32Array(shaderExecutorOutput.buffer);
+
+ // Verify
+ /** @type {number} */ var numValues = inputs.length;
+ /** @type {number} */ var maxPrints = 10;
+ /** @type {number} */ var numFailed = 0;
+
+ for (var valNdx = 0; valNdx < numValues; valNdx++) {
+ /** @type {number} */ var ref0 = (deMath.clamp(Math.floor(deMath.clamp(inputs[valNdx][0], -1.0, 1.0) * 32767.0), -(1 << 15), (1 << 15) - 1)) & 0xFFFF;
+ /** @type {number} */ var ref1 = (deMath.clamp(Math.floor(deMath.clamp(inputs[valNdx][1], -1.0, 1.0) * 32767.0), -(1 << 15), (1 << 15) - 1)) & 0xFFFF;
+ /** @type {number} */ var ref = (ref1 << 16) | ref0;
+ /** @type {number} */ var res = outputs[valNdx];
+ /** @type {number} */ var res0 = (res & 0xffff);
+ /** @type {number} */ var res1 = deMath.shiftRight(res, 16);
+ /** @type {number} */ var diff0 = Math.abs(ref0 - res0);
+ /** @type {number} */ var diff1 = Math.abs(ref1 - res1);
+
+ if (diff0 > maxDiff || diff1 > maxDiff) {
+ if (numFailed < maxPrints) {
+ bufferedLogToConsole(
+ 'ERROR: Mismatch in value ' + valNdx +
+ ', expected packSnorm2x16(' + inputs[valNdx] + ') = ' + ref + //tcu::toHex(ref)
+ ', got ' + res + // tcu::toHex(res)
+ '\n diffs = (' + diff0 + ', ' + diff1 + '), max diff = ' + maxDiff);
+ }
+ else if (numFailed == maxPrints)
+ bufferedLogToConsole('...');
+
+ numFailed += 1;
+ }
+ }
+
+ bufferedLogToConsole((numValues - numFailed) + ' / ' + numValues + ' values passed');
+
+ /** @type {boolean} */ var isOk = numFailed === 0;
+ if (!isOk)
+ testFailedOptions('Result comparison failed', false);
+ else
+ testPassedOptions('Pass', true);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+
+ /**
+ * @constructor
+ * @extends {es3fShaderPackingFunctionTests.ShaderPackingFunctionCase}
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+ es3fShaderPackingFunctionTests.UnpackSnorm2x16Case = function(shaderType) {
+ /** @const {string} */ var name = 'unpacksnorm2x16' + es3fShaderPackingFunctionTests.getShaderTypePostfix(shaderType);
+ es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.call(this, name, 'unpackSnorm2x16', shaderType);
+
+ this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(gluShaderUtil.DataType.UINT, gluShaderUtil.precision.PRECISION_HIGHP)));
+ this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_VEC2, gluShaderUtil.precision.PRECISION_HIGHP)));
+ this.m_spec.source = 'out0 = unpackSnorm2x16(in0);';
+ };
+
+ es3fShaderPackingFunctionTests.UnpackSnorm2x16Case.prototype = Object.create(es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.prototype);
+ es3fShaderPackingFunctionTests.UnpackSnorm2x16Case.prototype.constructor = es3fShaderPackingFunctionTests.UnpackSnorm2x16Case;
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fShaderPackingFunctionTests.UnpackSnorm2x16Case.prototype.iterate = function() {
+ /** @type {number} */ var maxDiff = 1; // Rounding error.
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0x776002);
+ /** @type {Array<number>} */ var inputs = [];
+ /** @type {goog.TypedArray} */ var shaderExecutorOutput; //vector<vec2<float>>
+ /** @type {goog.TypedArray} */ var outputs; //vector<vec2<float>>
+
+ inputs.push(0x00000000);
+ inputs.push(0x7fff8000);
+ inputs.push(0x80007fff);
+ inputs.push(0xffffffff);
+ inputs.push(0x0001fffe);
+
+ // Random values.
+ for (var ndx = 0; ndx < 95; ndx++)
+ inputs.push(rnd.getInt());
+
+ bufferedLogToConsole('Executing shader for ' + inputs.length + ' input values');
+
+ this.m_executor.useProgram();
+ shaderExecutorOutput = this.m_executor.execute(inputs.length, [inputs])[0]; // This test case only has one output
+
+ // Convert outputs if we get them as Uint8Array.
+ // - VertexShaderExecutor.execute() returns either an array of Uint8Array
+ // - FragmentShaderExecutor.execute() returns either an array of Uint8Array or Uint32Array
+ outputs = new Float32Array(shaderExecutorOutput.buffer);
+
+ // Verify
+ /** @type {number} */ var numValues = inputs.length;
+ /** @type {number} */ var maxPrints = 10;
+ /** @type {number} */ var numFailed = 0;
+
+ for (var valNdx = 0; valNdx < inputs.length; valNdx++) {
+ /** @type {number} */ var in0 = Math.floor(inputs[valNdx] & 0xffff);
+ // Convert 16-bit uint to 16-bit int
+ var view = new DataView(new ArrayBuffer(4));
+ view.setUint16(0, in0, true);
+ in0 = view.getInt16(0, true);
+ /** @type {number} */ var in1 = Math.floor(deMath.shiftRight(inputs[valNdx], 16));
+ // Convert 16-bit uint to 16-bit int
+ var view = new DataView(new ArrayBuffer(4));
+ view.setUint16(0, in1, true);
+ in1 = view.getInt16(0, true);
+ /** @type {number} */ var ref0 = deMath.clamp(in0 / 32767., -1.0, 1.0);
+ /** @type {number} */ var ref1 = deMath.clamp(in1 / 32767., -1.0, 1.0);
+ /** @type {number} */ var res0 = outputs[2 * valNdx];
+ /** @type {number} */ var res1 = outputs[2 * valNdx + 1];
+
+ /** @type {number} */ var diff0 = es3fShaderPackingFunctionTests.getUlpDiff(ref0, res0);
+ /** @type {number} */ var diff1 = es3fShaderPackingFunctionTests.getUlpDiff(ref1, res1);
+
+ if (diff0 > maxDiff || diff1 > maxDiff) {
+ if (numFailed < maxPrints)
+ bufferedLogToConsole('ERROR: Mismatch in value ' + valNdx + ',\n' +
+ ' expected unpackSnorm2x16(' + inputs[valNdx].toString(16) + ') = ' +
+ 'vec2(' + ref0.toString(16) + ', ' + ref1.toString(16) + ')' +
+ ', got vec2(' + res0.toString(16) + ', ' + res1.toString(16) + ')' +
+ '\n ULP diffs = (' + diff0 + ', ' + diff1 + '), max diff = ' + maxDiff);
+ else if (numFailed == maxPrints)
+ bufferedLogToConsole('...');
+
+ numFailed += 1;
+ }
+ }
+
+ bufferedLogToConsole((numValues - numFailed) + ' / ' + numValues + ' values passed');
+
+ /** @type {boolean} */ var isOk = numFailed === 0;
+ if (!isOk)
+ testFailedOptions('Result comparison failed', false);
+ else
+ testPassedOptions('Pass', true);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fShaderPackingFunctionTests.ShaderPackingFunctionCase}
+ * @param {gluShaderProgram.shaderType} shaderType
+ * @param {gluShaderUtil.precision} precision
+ */
+ es3fShaderPackingFunctionTests.PackUnorm2x16Case = function(shaderType, precision) {
+ /** @const {string} */ var name = 'packunorm2x16' +
+ es3fShaderPackingFunctionTests.getPrecisionPostfix(precision) +
+ es3fShaderPackingFunctionTests.getShaderTypePostfix(shaderType);
+ es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.call(this, name, 'packUnorm2x16', shaderType);
+ this.m_precision = precision;
+
+ this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_VEC2, precision)));
+ this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(gluShaderUtil.DataType.UINT, gluShaderUtil.precision.PRECISION_HIGHP)));
+ this.m_spec.source = 'out0 = packUnorm2x16(in0);';
+ };
+
+ es3fShaderPackingFunctionTests.PackUnorm2x16Case.prototype = Object.create(es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.prototype);
+ es3fShaderPackingFunctionTests.PackUnorm2x16Case.prototype.constructor = es3fShaderPackingFunctionTests.PackUnorm2x16Case;
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fShaderPackingFunctionTests.PackUnorm2x16Case.prototype.iterate = function() {
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0x776002);
+ /** @type {Array<Array<number>>} */ var inputs = [];
+ /** @type {goog.TypedArray} */ var shaderExecutorOutput;
+ /** @type {goog.TypedArray} */ var outputs; // deUint32
+ /** @type {number} */ var maxDiff = this.m_precision == gluShaderUtil.precision.PRECISION_HIGHP ? 1 : // Rounding only.
+ this.m_precision == gluShaderUtil.precision.PRECISION_MEDIUMP ? 65 : // (2^-10) * (2^16) + 1
+ this.m_precision == gluShaderUtil.precision.PRECISION_LOWP ? 257 : 0; // (2^-8) * (2^16) + 1
+ /** @type {number} */ var x;
+ /** @type {number} */ var y;
+ // Special values to check.
+ inputs.push([0.0, 0.0]);
+ inputs.push([0.5, 1.0]);
+ inputs.push([1.0, 0.5]);
+ inputs.push([-0.5, 1.5]);
+ inputs.push([0.25, 0.75]);
+
+ // Random values, mostly in range.
+ for (var ndx = 0; ndx < 15; ndx++) {
+ x = rnd.getFloat() * 1.25;
+ y = rnd.getFloat() * 1.25;
+ inputs.push([x, y]);
+ }
+
+ // Large random values.
+ for (var ndx = 0; ndx < 80; ndx++) {
+ x = rnd.getFloat() * 1e6 - 1e5;
+ y = rnd.getFloat() * 1e6 - 1e5;
+ inputs.push([x, y]);
+ }
+
+ bufferedLogToConsole('Executing shader for ' + inputs.length + ' input values');
+
+ this.m_executor.useProgram();
+ shaderExecutorOutput = this.m_executor.execute(inputs.length, [tcuMatrixUtil.flatten(inputs)])[0];
+
+ // Convert outputs if we get them as Uint8Array.
+ // - VertexShaderExecutor.execute() returns either an array of Uint8Array
+ // - FragmentShaderExecutor.execute() returns either an array of Uint8Array or Uint32Array
+ outputs = new Uint32Array(shaderExecutorOutput.buffer);
+
+ // Verify
+ /** @type {number} */ var numValues = inputs.length;
+ /** @type {number} */ var maxPrints = 10;
+ /** @type {number} */ var numFailed = 0;
+
+ for (var valNdx = 0; valNdx < inputs.length; valNdx++) {
+ /** @type {number} */ var ref0 = deMath.clamp(Math.floor(deMath.clamp(inputs[valNdx][0], 0.0, 1.0) * 65535.0), 0, (1 << 16) - 1) & 0xFFFF;
+ /** @type {number} */ var ref1 = deMath.clamp(Math.floor(deMath.clamp(inputs[valNdx][1], 0.0, 1.0) * 65535.0), 0, (1 << 16) - 1) & 0xFFFF;
+ /** @type {number} */ var ref = (ref1 << 16) | ref0;
+ /** @type {number} */ var res = outputs[valNdx];
+ /** @type {number} */ var res0 = (res & 0xffff);
+ /** @type {number} */ var res1 = deMath.shiftRight(res, 16);
+ /** @type {number} */ var diff0 = Math.abs(ref0 - res0);
+ /** @type {number} */ var diff1 = Math.abs(ref1 - res1);
+
+ if (diff0 > maxDiff || diff1 > maxDiff) {
+ if (numFailed < maxPrints)
+ bufferedLogToConsole('ERROR: Mismatch in value ' + valNdx +
+ ', expected packUnorm2x16(' + inputs[valNdx] + ') = ' + ref /*tcu::toHex(ref)*/ +
+ ', got ' + res /*tcu::toHex(res)*/ +
+ '\n diffs = (' + diff0 + ', ' + diff1 + '), max diff = ' + maxDiff);
+ else if (numFailed === maxPrints)
+ bufferedLogToConsole('...');
+
+ numFailed += 1;
+ }
+ }
+
+ bufferedLogToConsole((numValues - numFailed) + ' / ' + numValues + ' values passed');
+
+ /** @type {boolean} */ var isOk = numFailed === 0;
+ if (!isOk)
+ testFailedOptions('Result comparison failed', false);
+ else
+ testPassedOptions('Pass', true);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fShaderPackingFunctionTests.ShaderPackingFunctionCase}
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+ es3fShaderPackingFunctionTests.UnpackUnorm2x16Case = function(shaderType) {
+ /** @const {string} */ var name = 'unpackunorm2x16' +
+ es3fShaderPackingFunctionTests.getShaderTypePostfix(shaderType);
+ es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.call(this, name, 'unpackUnorm2x16', shaderType);
+
+ this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(gluShaderUtil.DataType.UINT, gluShaderUtil.precision.PRECISION_HIGHP)));
+ this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_VEC2, gluShaderUtil.precision.PRECISION_HIGHP)));
+ this.m_spec.source = 'out0 = unpackUnorm2x16(in0);';
+ };
+
+ es3fShaderPackingFunctionTests.UnpackUnorm2x16Case.prototype = Object.create(es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.prototype);
+ es3fShaderPackingFunctionTests.UnpackUnorm2x16Case.prototype.constructor = es3fShaderPackingFunctionTests.UnpackUnorm2x16Case;
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fShaderPackingFunctionTests.UnpackUnorm2x16Case.prototype.iterate = function() {
+ /** @type {number} */ var maxDiff = 1; // Rounding error.
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0x776002);
+ /** @type {Array<number>} */ var inputs = [];
+ /** @type {goog.TypedArray} */ var shaderExecutorOutput;
+ /** @type {goog.TypedArray} */ var outputs; //vector<vec2>
+
+ inputs.push(0x00000000);
+ inputs.push(0x7fff8000);
+ inputs.push(0x80007fff);
+ inputs.push(0xffffffff);
+ inputs.push(0x0001fffe);
+
+ // Random values.
+ for (var ndx = 0; ndx < 95; ndx++)
+ inputs.push(rnd.getInt());
+
+ bufferedLogToConsole('Executing shader for ' + inputs.length + ' input values');
+
+ this.m_executor.useProgram();
+ shaderExecutorOutput = this.m_executor.execute(inputs.length, [inputs])[0];
+
+ // Convert outputs if we get them as Uint8Array.
+ // - VertexShaderExecutor.execute() returns either an array of Uint8Array
+ // - FragmentShaderExecutor.execute() returns either an array of Uint8Array or Uint32Array
+ outputs = new Float32Array(shaderExecutorOutput.buffer);
+
+ // Verify
+ /** @type {number} */ var numValues = inputs.length;
+ /** @type {number} */ var maxPrints = 10;
+ /** @type {number} */ var numFailed = 0;
+
+ for (var valNdx = 0; valNdx < inputs.length; valNdx++) {
+ /** @type {number} */ var in0 = Math.floor(inputs[valNdx] & 0xffff);
+ /** @type {number} */ var in1 = Math.floor(deMath.shiftRight(inputs[valNdx], 16));
+ /** @type {number} */ var ref0 = in0 / 65535.0;
+ /** @type {number} */ var ref1 = in1 / 65535.0;
+ /** @type {number} */ var res0 = outputs[2 * valNdx];
+ /** @type {number} */ var res1 = outputs[2 * valNdx + 1];
+
+ /** @type {number} */ var diff0 = es3fShaderPackingFunctionTests.getUlpDiff(ref0, res0);
+ /** @type {number} */ var diff1 = es3fShaderPackingFunctionTests.getUlpDiff(ref1, res1);
+
+ if (diff0 > maxDiff || diff1 > maxDiff) {
+ if (numFailed < maxPrints)
+ bufferedLogToConsole('ERROR: Mismatch in value ' + valNdx + ',\n' +
+ ' expected unpackUnorm2x16(' + inputs[valNdx].toString(16) + ') = ' +
+ 'vec2(' + ref0.toString(16) + ', ' + ref1.toString(16) + ')' +
+ ', got vec2(' + res0.toString(16) + ', ' + res1.toString(16) + ')' +
+ '\n ULP diffs = (' + diff0 + ', ' + diff1 + '), max diff = ' + maxDiff);
+ else if (numFailed === maxPrints)
+ bufferedLogToConsole('...');
+
+ numFailed += 1;
+ }
+ }
+
+ bufferedLogToConsole((numValues - numFailed) + ' / ' + numValues + ' values passed');
+
+ /** @type {boolean} */ var isOk = numFailed === 0;
+ if (!isOk)
+ testFailedOptions('Result comparison failed', false);
+ else
+ testPassedOptions('Pass', true);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fShaderPackingFunctionTests.ShaderPackingFunctionCase}
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+ es3fShaderPackingFunctionTests.PackHalf2x16Case = function(shaderType) {
+ /** @const {string} */ var name = 'packhalf2x16' +
+ es3fShaderPackingFunctionTests.getShaderTypePostfix(shaderType);
+ es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.call(this, name, 'packHalf2x16', shaderType);
+
+ this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_VEC2, gluShaderUtil.precision.PRECISION_HIGHP)));
+ this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(gluShaderUtil.DataType.UINT, gluShaderUtil.precision.PRECISION_HIGHP)));
+ this.m_spec.source = 'out0 = packHalf2x16(in0);';
+ };
+
+ es3fShaderPackingFunctionTests.PackHalf2x16Case.prototype = Object.create(es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.prototype);
+ es3fShaderPackingFunctionTests.PackHalf2x16Case.prototype.constructor = es3fShaderPackingFunctionTests.PackHalf2x16Case;
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fShaderPackingFunctionTests.PackHalf2x16Case.prototype.iterate = function() {
+ /** @type {number} */ var maxDiff = 0; // Values can be represented exactly in mediump.
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0x776002);
+ /** @type {Array<Array<number>>} */ var inputs = [];
+ /** @type {goog.TypedArray} */ var shaderExecutorOutput;
+ /** @type {goog.TypedArray} */ var outputs; // deUint32
+
+ // Special values to check.
+ inputs.push([0.0, 0.0]);
+ inputs.push([0.5, 1.0]);
+ inputs.push([1.0, 0.5]);
+ inputs.push([-0.5, 1.5]);
+ inputs.push([0.25, 0.75]);
+
+ // Random values.
+ /** @type {number} */ var minExp = -14;
+ /** @type {number} */ var maxExp = 15;
+
+ /** @type {Array<number>} */ var v = [];
+ for (var ndx = 0; ndx < 95; ndx++) {
+ for (var c = 0; c < 2; c++) {
+ /** @type {number} */ var s = rnd.getBool() ? 1 : -1;
+ /** @type {number} */ var exp = rnd.getInt(minExp, maxExp);
+ /** @type {number} */ var mantissa = rnd.getInt(0) & ((1 << 23) - 1);
+
+ v[c] = (new tcuFloat.deFloat()).construct(s, exp ? exp : 1 /* avoid denormals */, (1 << 23) | mantissa).getValue();
+ }
+ inputs.push(v);
+ }
+
+ // Convert input values to fp16 and back to make sure they can be represented exactly in mediump.
+ for (var inVal in inputs)
+ inputs[inVal] = [tcuFloat.newFloat16(inputs[inVal][0]).getValue(), tcuFloat.newFloat16(inputs[inVal][1]).getValue()];
+
+ bufferedLogToConsole('Executing shader for ' + inputs.length + ' input values');
+
+ this.m_executor.useProgram();
+ shaderExecutorOutput = this.m_executor.execute(inputs.length, [tcuMatrixUtil.flatten(inputs)])[0];
+
+ // Convert outputs if we get them as Uint8Array.
+ // - VertexShaderExecutor.execute() returns either an array of Uint8Array
+ // - FragmentShaderExecutor.execute() returns either an array of Uint8Array or Uint32Array
+ outputs = new Uint32Array(shaderExecutorOutput.buffer);
+
+ // Verify
+ /** @type {number} */ var numValues = inputs.length;
+ /** @type {number} */ var maxPrints = 10;
+ /** @type {number} */ var numFailed = 0;
+
+ for (var valNdx = 0; valNdx < inputs.length; valNdx++) {
+ /** @type {number} */ var ref0 = tcuFloat.newFloat16(inputs[valNdx][0]).bits();
+ /** @type {number} */ var ref1 = tcuFloat.newFloat16(inputs[valNdx][1]).bits();
+ /** @type {number} */ var ref = (ref1 << 16) | ref0;
+ /** @type {number} */ var res = outputs[valNdx];
+ /** @type {number} */ var res0 = (res & 0xffff);
+ /** @type {number} */ var res1 = deMath.shiftRight(res, 16);
+ /** @type {number} */ var diff0 = Math.abs(ref0 - res0);
+ /** @type {number} */ var diff1 = Math.abs(ref1 - res1);
+
+ if (diff0 > maxDiff || diff1 > maxDiff) {
+ if (numFailed < maxPrints)
+ bufferedLogToConsole('ERROR: Mismatch in value ' + valNdx +
+ ', expected packHalf2x16(' + inputs[valNdx] + ') = ' + ref /*tcu::toHex(ref)*/ +
+ ', got ' + res /*tcu::toHex(res)*/ +
+ '\n diffs = (' + diff0 + ', ' + diff1 + '), max diff = ' + maxDiff);
+ else if (numFailed == maxPrints)
+ bufferedLogToConsole('...');
+
+ numFailed += 1;
+ }
+ }
+
+ bufferedLogToConsole((numValues - numFailed) + ' / ' + numValues + ' values passed');
+
+ /** @type {boolean} */ var isOk = numFailed === 0;
+ if (!isOk)
+ testFailedOptions('Result comparison failed', false);
+ else
+ testPassedOptions('Pass', true);
+
+ return tcuTestCase.IterateResult.STOP;
+
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fShaderPackingFunctionTests.ShaderPackingFunctionCase}
+ * @param {gluShaderProgram.shaderType} shaderType
+ */
+ es3fShaderPackingFunctionTests.UnpackHalf2x16Case = function(shaderType) {
+ /** @const {string} */ var name = 'unpackhalf2x16' +
+ es3fShaderPackingFunctionTests.getShaderTypePostfix(shaderType);
+ es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.call(this, name, 'unpackHalf2x16', shaderType);
+
+ this.m_spec.inputs.push(new glsShaderExecUtil.Symbol('in0', gluVarType.newTypeBasic(gluShaderUtil.DataType.UINT, gluShaderUtil.precision.PRECISION_HIGHP)));
+ this.m_spec.outputs.push(new glsShaderExecUtil.Symbol('out0', gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_VEC2, gluShaderUtil.precision.PRECISION_MEDIUMP)));
+ this.m_spec.source = 'out0 = unpackHalf2x16(in0);';
+ };
+
+ es3fShaderPackingFunctionTests.UnpackHalf2x16Case.prototype = Object.create(es3fShaderPackingFunctionTests.ShaderPackingFunctionCase.prototype);
+ es3fShaderPackingFunctionTests.UnpackHalf2x16Case.prototype.constructor = es3fShaderPackingFunctionTests.UnpackHalf2x16Case;
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fShaderPackingFunctionTests.UnpackHalf2x16Case.prototype.iterate = function() {
+ /** @type {number} */ var maxDiff = 0; // All bits must be accurate.
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ 0x776002);
+ /** @type {Array<number>} */ var inputs = [];
+ /** @type {goog.TypedArray} */ var outputs; // vector<vec2<float>>
+ /** @type {goog.TypedArray} */ var shaderExecutorOutput;
+
+ // Special values.
+ inputs.push((tcuFloat.newFloat16(0.0).bits() << 16) | tcuFloat.newFloat16(1.0).bits());
+ inputs.push((tcuFloat.newFloat16(1.0).bits() << 16) | tcuFloat.newFloat16(0.0).bits());
+ inputs.push((tcuFloat.newFloat16(-1.0).bits() << 16) | tcuFloat.newFloat16(0.5).bits());
+ inputs.push((tcuFloat.newFloat16(0.5).bits() << 16) | tcuFloat.newFloat16(-0.5).bits());
+
+ // Construct random values.
+ /** @type {number} */ var minExp = -14;
+ /** @type {number} */ var maxExp = 15;
+ /** @type {number} */ var mantBits = 10;
+
+ /** @type {number} */ var inVal = 0;
+ for (var ndx = 0; ndx < 96; ndx++) {
+ for (var c = 0; c < 2; c++) {
+ /** @type {number} */ var s = rnd.getBool() ? 1 : -1;
+ /** @type {number} */ var exp = rnd.getInt(minExp, maxExp);
+ /** @type {number} */ var mantissa = rnd.getInt(0) & ((1 << mantBits) - 1);
+ /** @type {number} */ var value = tcuFloat.newFloat16(0).construct(s, exp ? exp : 1 /* avoid denorm */, (1 << 10) | mantissa).bits();
+
+ inVal |= value << (16 * c);
+ }
+ inputs.push(inVal);
+ }
+
+ bufferedLogToConsole('Executing shader for ' + inputs.length + ' input values');
+
+ this.m_executor.useProgram();
+ shaderExecutorOutput = this.m_executor.execute(inputs.length, [inputs])[0];
+
+ // Convert outputs if we get them as Uint8Array.
+ // - VertexShaderExecutor.execute() returns either an array of Uint8Array
+ // - FragmentShaderExecutor.execute() returns either an array of Uint8Array or Uint32Array
+ outputs = new Float32Array(shaderExecutorOutput.buffer);
+
+ // Verify
+ /** @type {number} */ var numValues = inputs.length
+ /** @type {number} */ var maxPrints = 10;
+ /** @type {number} */ var numFailed = 0;
+
+ for (var valNdx = 0; valNdx < inputs.length; valNdx++) {
+ /** @type {number} */ var in0 = (inputs[valNdx] & 0xffff);
+ /** @type {number} */ var in1 = deMath.shiftRight(inputs[valNdx], 16);
+ /** @type {number} */ var ref0 = tcuFloat.halfFloatToNumber(in0);
+ /** @type {number} */ var ref1 = tcuFloat.halfFloatToNumber(in1);
+ /** @type {number} */ var res0 = outputs[2 * valNdx];
+ /** @type {number} */ var res1 = outputs[2 * valNdx + 1];
+ /** @type {number} */ var refBits0 = tcuFloat.newFloat32(ref0).bits();
+ /** @type {number} */ var refBits1 = tcuFloat.newFloat32(ref1).bits();
+ /** @type {number} */ var resBits0 = tcuFloat.newFloat32(res0).bits();
+ /** @type {number} */ var resBits1 = tcuFloat.newFloat32(res1).bits();
+
+ /** @type {number} */ var diff0 = Math.abs(refBits0 - resBits0);
+ /** @type {number} */ var diff1 = Math.abs(refBits1 - resBits1);
+
+ if (isNaN(ref0) && isNaN(res0))
+ diff0 = 0;
+ if (isNaN(ref1) && isNaN(res1))
+ diff1 = 0;
+
+ if (diff0 > maxDiff || diff1 > maxDiff) {
+ if (numFailed < maxPrints)
+ bufferedLogToConsole('ERROR: Mismatch in value ' + valNdx + ',\n' +
+ ' expected unpackHalf2x16(' + inputs[valNdx] /*tcu::toHex(inputs[valNdx])*/ + ') = ' +
+ 'vec2(' + ref0 + ' / ' + refBits0 /*tcu::toHex(refBits0)*/ + ', ' + ref1 + ' / ' + refBits1 /*tcu::toHex(refBits1)*/ + ')' +
+ ', got vec2(' + res0 + ' / ' + resBits0 /*tcu::toHex(resBits0)*/ + ', ' + res1 + ' / ' + resBits1 /*tcu::toHex(resBits1)*/ + ')' +
+ '\n ULP diffs = (' + diff0 + ', ' + diff1 + '), max diff = ' + maxDiff);
+ else if (numFailed == maxPrints)
+ bufferedLogToConsole('...');
+
+ numFailed += 1;
+ }
+ }
+
+ bufferedLogToConsole((numValues - numFailed) + ' / ' + numValues + ' values passed');
+
+ /** @type {boolean} */ var isOk = numFailed === 0;
+ if (!isOk)
+ testFailedOptions('Result comparison failed', false);
+ else
+ testPassedOptions('Pass', true);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fShaderPackingFunctionTests.ShaderPackingFunctionTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'pack_unpack', 'Floating-point pack and unpack function tests');
+ };
+
+ es3fShaderPackingFunctionTests.ShaderPackingFunctionTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fShaderPackingFunctionTests.ShaderPackingFunctionTests.prototype.constructor = es3fShaderPackingFunctionTests.ShaderPackingFunctionTests;
+
+ es3fShaderPackingFunctionTests.ShaderPackingFunctionTests.prototype.init = function() {
+ var testGroup = tcuTestCase.runner.testCases;
+ testGroup.addChild(new es3fShaderPackingFunctionTests.PackSnorm2x16Case(gluShaderProgram.shaderType.VERTEX, gluShaderUtil.precision.PRECISION_LOWP));
+ testGroup.addChild(new es3fShaderPackingFunctionTests.PackSnorm2x16Case(gluShaderProgram.shaderType.FRAGMENT, gluShaderUtil.precision.PRECISION_LOWP));
+ testGroup.addChild(new es3fShaderPackingFunctionTests.PackSnorm2x16Case(gluShaderProgram.shaderType.VERTEX, gluShaderUtil.precision.PRECISION_MEDIUMP));
+ testGroup.addChild(new es3fShaderPackingFunctionTests.PackSnorm2x16Case(gluShaderProgram.shaderType.FRAGMENT, gluShaderUtil.precision.PRECISION_MEDIUMP));
+ testGroup.addChild(new es3fShaderPackingFunctionTests.PackSnorm2x16Case(gluShaderProgram.shaderType.VERTEX, gluShaderUtil.precision.PRECISION_HIGHP));
+ testGroup.addChild(new es3fShaderPackingFunctionTests.PackSnorm2x16Case(gluShaderProgram.shaderType.FRAGMENT, gluShaderUtil.precision.PRECISION_HIGHP));
+
+ testGroup.addChild(new es3fShaderPackingFunctionTests.UnpackSnorm2x16Case(gluShaderProgram.shaderType.VERTEX));
+ testGroup.addChild(new es3fShaderPackingFunctionTests.UnpackSnorm2x16Case(gluShaderProgram.shaderType.FRAGMENT));
+
+ testGroup.addChild(new es3fShaderPackingFunctionTests.PackUnorm2x16Case(gluShaderProgram.shaderType.VERTEX, gluShaderUtil.precision.PRECISION_LOWP));
+ testGroup.addChild(new es3fShaderPackingFunctionTests.PackUnorm2x16Case(gluShaderProgram.shaderType.FRAGMENT, gluShaderUtil.precision.PRECISION_LOWP));
+ testGroup.addChild(new es3fShaderPackingFunctionTests.PackUnorm2x16Case(gluShaderProgram.shaderType.VERTEX, gluShaderUtil.precision.PRECISION_MEDIUMP));
+ testGroup.addChild(new es3fShaderPackingFunctionTests.PackUnorm2x16Case(gluShaderProgram.shaderType.FRAGMENT, gluShaderUtil.precision.PRECISION_MEDIUMP));
+ testGroup.addChild(new es3fShaderPackingFunctionTests.PackUnorm2x16Case(gluShaderProgram.shaderType.VERTEX, gluShaderUtil.precision.PRECISION_HIGHP));
+ testGroup.addChild(new es3fShaderPackingFunctionTests.PackUnorm2x16Case(gluShaderProgram.shaderType.FRAGMENT, gluShaderUtil.precision.PRECISION_HIGHP));
+
+ testGroup.addChild(new es3fShaderPackingFunctionTests.UnpackUnorm2x16Case(gluShaderProgram.shaderType.VERTEX));
+ testGroup.addChild(new es3fShaderPackingFunctionTests.UnpackUnorm2x16Case(gluShaderProgram.shaderType.FRAGMENT));
+
+ testGroup.addChild(new es3fShaderPackingFunctionTests.PackHalf2x16Case(gluShaderProgram.shaderType.VERTEX));
+ testGroup.addChild(new es3fShaderPackingFunctionTests.PackHalf2x16Case(gluShaderProgram.shaderType.FRAGMENT));
+
+ testGroup.addChild(new es3fShaderPackingFunctionTests.UnpackHalf2x16Case(gluShaderProgram.shaderType.VERTEX));
+ testGroup.addChild(new es3fShaderPackingFunctionTests.UnpackHalf2x16Case(gluShaderProgram.shaderType.FRAGMENT));
+ };
+
+ /**
+ * Run test
+ * @param {WebGL2RenderingContext} context
+ */
+ es3fShaderPackingFunctionTests.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fShaderPackingFunctionTests.ShaderPackingFunctionTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fShaderPackingFunctionTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderPrecisionTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderPrecisionTests.js
new file mode 100644
index 0000000000..28a697397c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderPrecisionTests.js
@@ -0,0 +1,947 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fShaderPrecisionTests');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.common.tcuFloat');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.opengl.gluDrawUtil');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('framework.opengl.gluShaderUtil');
+
+goog.scope(function() {
+ var es3fShaderPrecisionTests = functional.gles3.es3fShaderPrecisionTests;
+ var deMath = framework.delibs.debase.deMath;
+ var deRandom = framework.delibs.debase.deRandom;
+ var deString = framework.delibs.debase.deString;
+ var tcuFloat = framework.common.tcuFloat;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var gluDrawUtil = framework.opengl.gluDrawUtil;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var gluShaderProgram = framework.opengl.gluShaderProgram;
+
+ /** @const {number} */ es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH = 32;
+ /** @const {number} */ es3fShaderPrecisionTests.FRAMEBUFFER_HEIGHT = 32;
+
+ es3fShaderPrecisionTests.add = function(a, b) { return a + b; };
+ es3fShaderPrecisionTests.sub = function(a, b) { return a - b; };
+ es3fShaderPrecisionTests.mul = function(a, b) { return a * b; };
+ // a * b = (a1 * 2^16 + a0) * (b1 * 2^16 + b0) = a1 * b1 * 2^32 + (a0 * b1 + a1 * b0) * 2^16 + a0 * b0
+ // 32bit integer multiplication may overflow in JavaScript. Only return low 32bit of the result.
+ es3fShaderPrecisionTests.mul32 = function(a, b) {
+ var sign = Math.sign(a) * Math.sign(b);
+ a = Math.abs(a);
+ b = Math.abs(b);
+ var a1 = deMath.split16(a)[1];
+ var a0 = deMath.split16(a)[0];
+ var b1 = deMath.split16(b)[1];
+ var b0 = deMath.split16(b)[0];
+ return sign * ((a0 * b1 + a1 * b0) * 0x10000 + a0 * b0);
+ }
+ es3fShaderPrecisionTests.div = function(a, b) { if (b !== 0) return a / b; else throw new Error('division by zero.')};
+
+ /**
+ * @param {gluShaderUtil.precision} precision
+ * @param {string} evalOp
+ * @param {boolean} isVertexCase
+ * @return {gluShaderProgram.ShaderProgram}
+ */
+ es3fShaderPrecisionTests.createFloatPrecisionEvalProgram = function(precision, evalOp, isVertexCase) {
+ /** @type {gluShaderUtil.DataType} */ var type = gluShaderUtil.DataType.FLOAT;
+ /** @type {gluShaderUtil.DataType} */ var outType = gluShaderUtil.DataType.UINT;
+ /** @type {string} */ var typeName = gluShaderUtil.getDataTypeName(type);
+ /** @type {string} */ var outTypeName = gluShaderUtil.getDataTypeName(outType);
+ /** @type {string} */ var precName = gluShaderUtil.getPrecisionName(precision);
+ /** @type {string} */ var vtx = '';
+ /** @type {string} */ var frag = '';
+ /** @type {string} */ var op = '';
+
+ vtx += '#version 300 es\n' +
+ 'in highp vec4 a_position;\n' +
+ 'in ' + precName + ' ' + typeName + ' a_in0;\n' +
+ 'in ' + precName + ' ' + typeName + ' a_in1;\n';
+ frag += '#version 300 es\n' +
+ 'layout(location = 0) out highp ' + outTypeName + ' o_out;\n';
+
+ if (isVertexCase) {
+ vtx += 'flat out ' + precName + ' ' + typeName + ' v_out;\n';
+ frag += 'flat in ' + precName + ' ' + typeName + ' v_out;\n';
+ } else {
+ vtx += 'flat out ' + precName + ' ' + typeName + ' v_in0;\n' +
+ 'flat out ' + precName + ' ' + typeName + ' v_in1;\n';
+ frag += 'flat in ' + precName + ' ' + typeName + ' v_in0;\n' +
+ 'flat in ' + precName + ' ' + typeName + ' v_in1;\n';
+ }
+
+ vtx += '\nvoid main (void)\n{\n' +
+ ' gl_Position = a_position;\n';
+ frag += '\nvoid main (void)\n{\n';
+
+ op += '\t' + precName + ' ' + typeName + ' in0 = ' + (isVertexCase ? 'a_' : 'v_') + 'in0;\n' +
+ '\t' + precName + ' ' + typeName + ' in1 = ' + (isVertexCase ? 'a_' : 'v_') + 'in1;\n';
+
+ if (!isVertexCase)
+ op += '\t' + precName + ' ' + typeName + ' res;\n';
+
+ op += '\t' + (isVertexCase ? 'v_out' : 'res') + ' = ' + evalOp + ';\n';
+
+ vtx += isVertexCase ? op : '';
+ frag += isVertexCase ? '' : op;
+ op = '';
+
+ if (isVertexCase) {
+ frag += ' o_out = floatBitsToUint(v_out);\n';
+ } else {
+ vtx += ' v_in0 = a_in0;\n' +
+ ' v_in1 = a_in1;\n';
+ frag += ' o_out = floatBitsToUint(res);\n';
+ }
+
+ vtx += '}\n';
+ frag += '}\n';
+
+ return new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vtx, frag));
+ };
+
+ /**
+ * @param {gluShaderUtil.DataType} type
+ * @param {gluShaderUtil.precision} precision
+ * @param {string} evalOp
+ * @param {boolean} isVertexCase
+ * @return {gluShaderProgram.ShaderProgram}
+ */
+ es3fShaderPrecisionTests.createIntUintPrecisionEvalProgram = function(type, precision, evalOp, isVertexCase) {
+ /** @type {string} */ var typeName = gluShaderUtil.getDataTypeName(type);
+ /** @type {string} */ var precName = gluShaderUtil.getPrecisionName(precision);
+ /** @type {string} */ var vtx = '';
+ /** @type {string} */ var frag = '';
+ /** @type {string} */ var op = '';
+
+ vtx += '#version 300 es\n' +
+ 'in highp vec4 a_position;\n' +
+ 'in ' + precName + ' ' + typeName + ' a_in0;\n' +
+ 'in ' + precName + ' ' + typeName + ' a_in1;\n';
+ frag += '#version 300 es\n' +
+ 'layout(location = 0) out ' + precName + ' ' + typeName + ' o_out;\n';
+
+ if (isVertexCase) {
+ vtx += 'flat out ' + precName + ' ' + typeName + ' v_out;\n';
+ frag += 'flat in ' + precName + ' ' + typeName + ' v_out;\n';
+ } else {
+ vtx += 'flat out ' + precName + ' ' + typeName + ' v_in0;\n' +
+ 'flat out ' + precName + ' ' + typeName + ' v_in1;\n';
+ frag += 'flat in ' + precName + ' ' + typeName + ' v_in0;\n' +
+ 'flat in ' + precName + ' ' + typeName + ' v_in1;\n';
+ }
+
+ vtx += '\nvoid main (void)\n{\n'+
+ ' gl_Position = a_position;\n';
+ frag += '\nvoid main (void)\n{\n';
+
+ op += '\t' + precName + ' ' + typeName + ' in0 = ' + (isVertexCase ? 'a_' : 'v_') + 'in0;\n' +
+ '\t' + precName + ' ' + typeName + ' in1 = ' + (isVertexCase ? 'a_' : 'v_') + 'in1;\n';
+
+ op += '\t' + (isVertexCase ? 'v_' : 'o_') + 'out = ' + evalOp + ';\n';
+
+ vtx += isVertexCase ? op : '';
+ frag += isVertexCase ? '' : op;
+ op = '';
+
+ if (isVertexCase) {
+ frag += ' o_out = v_out;\n';
+ } else {
+ vtx += ' v_in0 = a_in0;\n' +
+ ' v_in1 = a_in1;\n';
+ }
+
+ vtx += '}\n';
+ frag += '}\n';
+
+ return new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vtx, frag));
+ };
+
+ /** @typedef {function(number, number)} */ es3fShaderPrecisionTests.EvalFunc;
+
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} desc
+ * @param {string} op
+ * @param {es3fShaderPrecisionTests.EvalFunc} evalFunc
+ * @param {gluShaderUtil.precision} precision
+ * @param {Array<number>} rangeA
+ * @param {Array<number>} rangeB
+ * @param {boolean} isVertexCase
+ */
+ es3fShaderPrecisionTests.ShaderFloatPrecisionCase = function(name, desc, op, evalFunc, precision, rangeA, rangeB, isVertexCase) {
+ tcuTestCase.DeqpTest.call(this, name, desc);
+ // Case parameters.
+ /** @type {string} */ this.m_op = op;
+ /** @type {es3fShaderPrecisionTests.EvalFunc} */ this.m_evalFunc = evalFunc;
+ /** @type {gluShaderUtil.precision} */ this.m_precision = precision;
+ /** @type {Array<number>} */ this.m_rangeA = rangeA;
+ /** @type {Array<number>} */ this.m_rangeB = rangeB;
+ /** @type {boolean} */ this.m_isVertexCase = isVertexCase;
+
+ /** @type {number} */ this.m_numTestsPerIter = 32;
+ /** @type {number} */ this.m_numIters = 4;
+ /** @type {deRandom.Random} */ this.m_rnd = new deRandom.Random(deString.deStringHash(this.name));
+
+ // Iteration state.
+ /** @type {?gluShaderProgram.ShaderProgram} */ this.m_program = null;
+ /** @type {?WebGLFramebuffer} */ this.m_framebuffer = null;
+ /** @type {?WebGLRenderbuffer} */ this.m_renderbuffer = null;
+ /** @type {number} */ this.m_iterNdx = 0;
+ /** @type {Array<boolean>} */ this.m_iterPass = [];
+ };
+
+ es3fShaderPrecisionTests.ShaderFloatPrecisionCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fShaderPrecisionTests.ShaderFloatPrecisionCase.prototype.constructor = es3fShaderPrecisionTests.ShaderFloatPrecisionCase;
+
+ es3fShaderPrecisionTests.ShaderFloatPrecisionCase.prototype.init = function() {
+ assertMsgOptions(!this.m_program && !this.m_framebuffer && !this.m_renderbuffer, 'Program/Framebuffer/Renderbuffer should be null at this point.', false, true);
+
+ // Create program.
+ this.m_program = es3fShaderPrecisionTests.createFloatPrecisionEvalProgram(this.m_precision, this.m_op, this.m_isVertexCase);
+
+ if (!this.m_program.isOk())
+ assertMsgOptions(false, 'Compile failed', false, true);
+
+ // Create framebuffer.
+ this.m_framebuffer = gl.createFramebuffer();
+ this.m_renderbuffer = gl.createRenderbuffer();
+
+ gl.bindRenderbuffer(gl.RENDERBUFFER, this.m_renderbuffer);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.R32UI, es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH, es3fShaderPrecisionTests.FRAMEBUFFER_HEIGHT);
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, this.m_framebuffer);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, this.m_renderbuffer);
+
+ assertMsgOptions(gl.checkFramebufferStatus(gl.FRAMEBUFFER) === gl.FRAMEBUFFER_COMPLETE, 'Framebuffer is incomplete', false, true);
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+
+ this.m_iterNdx = 0;
+ };
+
+ es3fShaderPrecisionTests.ShaderFloatPrecisionCase.prototype.deinit = function() {
+ if(this.m_framebuffer)
+ gl.deleteFramebuffer(this.m_framebuffer);
+ if(this.m_renderbuffer)
+ gl.deleteRenderbuffer(this.m_renderbuffer);
+ this.m_program = null;
+ this.m_framebuffer = null;
+ this.m_renderbuffer = null;
+ };
+
+ /**
+ * @param {number} in0
+ * @param {number} in1
+ * @param {number} reference
+ * @param {number} result
+ */
+
+ es3fShaderPrecisionTests.ShaderFloatPrecisionCase.prototype.compare = function(in0, in1, reference, result) {
+ // Comparison is done using 64-bit reference value to accurately evaluate rounding mode error.
+ // If 32-bit reference value is used, 2 bits of rounding error must be allowed.
+
+ // For mediump and lowp types the comparison currently allows 3 bits of rounding error:
+ // two bits from conversions and one from actual operation.
+
+ // \todo [2013-09-30 pyry] Make this more strict: determine if rounding can actually happen.
+
+ /** @type {number} */ var mantissaBits = this.m_precision == gluShaderUtil.precision.PRECISION_HIGHP ? 23 : 10;
+ /** @type {number} */ var numPrecBits = 52 - mantissaBits;
+
+ /** @type {number} */ var in0Exp = tcuFloat.newFloat32(in0).exponent();
+ /** @type {number} */ var in1Exp = tcuFloat.newFloat32(in1).exponent();
+ /** @type {number} */ var resExp = tcuFloat.newFloat32(result).exponent();
+ /** @type {number} */ var numLostBits = Math.max(in0Exp - resExp, in1Exp - resExp, 0); // Lost due to mantissa shift.
+
+ /** @type {number} */ var roundingUlpError = this.m_precision == gluShaderUtil.precision.PRECISION_HIGHP ? 1 : 3;
+ /** @type {number} */ var maskBits = numLostBits + numPrecBits;
+
+ bufferedLogToConsole("Assuming " + mantissaBits + " mantissa bits, " + numLostBits + " bits lost in operation, and " + roundingUlpError + " ULP rounding error.")
+
+ // These numbers should never be larger than 52 bits. An assertion in getBitRange verifies this.
+ /** @type {number} */ var accurateRefBits = tcuFloat.newFloat64(reference).getBitRange(maskBits, 64);
+ /** @type {number} */ var accurateResBits = tcuFloat.newFloat64(result).getBitRange(maskBits, 64);
+ /** @type {number} */ var ulpDiff = Math.abs(accurateRefBits - accurateResBits);
+
+ if (ulpDiff > roundingUlpError) {
+ bufferedLogToConsole("ERROR: comparison failed! ULP diff (ignoring lost/undefined bits) = " + ulpDiff );
+ return false;
+ }
+ else
+ return true;
+ };
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fShaderPrecisionTests.ShaderFloatPrecisionCase.prototype.iterate = function() {
+ var testPassed = true;
+ var testPassedMsg = 'Pass';
+
+ // Constant data.
+ /** @type {Array<number>} */ var position =[
+ -1.0, -1.0, 0.0, 1.0,
+ -1.0, 1.0, 0.0, 1.0,
+ 1.0, -1.0, 0.0, 1.0,
+ 1.0, 1.0, 0.0, 1.0
+ ];
+
+ /** @type {Array<number>} */ var indices = [0, 1, 2, 2, 1, 3];
+ /** @type {number} */ var numVertices = 4;
+ /** @type {Array<number>} */ var in0Arr = [0.0, 0.0, 0.0, 0.0];
+ /** @type {Array<number>} */ var in1Arr = [0.0, 0.0, 0.0, 0.0];
+
+ /** @type {Array<gluDrawUtil.VertexArrayBinding>} */ var vertexArrays = [];
+
+ // Image read from GL.
+ /** @type {goog.TypedArray} */ var pixels_uint = new Uint32Array(es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH * es3fShaderPrecisionTests.FRAMEBUFFER_HEIGHT * 4);
+
+ // \todo [2012-05-03 pyry] Could be cached.
+ /** @type {WebGLProgram} */ var prog = this.m_program.getProgram();
+
+ gl.useProgram(prog);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, this.m_framebuffer);
+
+ vertexArrays[0] = gluDrawUtil.newFloatVertexArrayBinding("a_position", 4, numVertices, 0, position);
+
+
+ // Compute values and reference.
+ for (var testNdx = 0; testNdx < this.m_numTestsPerIter; testNdx++) {
+ /** @type {number} */ var in0 = this.m_rnd.getFloat(this.m_rangeA[0], this.m_rangeA[1]);
+ /** @type {number} */ var in1 = this.m_rnd.getFloat(this.m_rangeB[0], this.m_rangeB[1]);
+
+ // These random numbers are used in the reference computation. But
+ // highp is only 32 bits, so these float64s must be rounded to
+ // float32 first for correctness. This is needed for highp_mul_* on
+ // one Linux/NVIDIA machine.
+ in0 = tcuFloat.newFloat32(in0).getValue();
+ in1 = tcuFloat.newFloat32(in1).getValue();
+
+ /** @type {number} */ var refD = this.m_evalFunc(in0, in1);
+
+ bufferedLogToConsole("iter " + this.m_iterNdx + ", test " + testNdx + ": "+
+ "in0 = " + in0 + " / " + tcuFloat.newFloat32(in0).bits() +
+ ", in1 = " + in1 + " / " + tcuFloat.newFloat32(in1).bits() +
+ " reference = " + refD + " / " + tcuFloat.newFloat32(refD).bits());
+
+ in0Arr = [in0, in0, in0, in0];
+ in1Arr = [in1, in1, in1, in1];
+ vertexArrays[1] = gluDrawUtil.newFloatVertexArrayBinding("a_in0", 1, numVertices, 0, in0Arr);
+ vertexArrays[2] = gluDrawUtil.newFloatVertexArrayBinding("a_in1", 1, numVertices, 0, in1Arr);
+
+ gluDrawUtil.draw(gl, prog, vertexArrays, gluDrawUtil.triangles(indices));
+
+ gl.readPixels(0, 0, es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH,
+ es3fShaderPrecisionTests.FRAMEBUFFER_HEIGHT, gl.RGBA_INTEGER, gl.UNSIGNED_INT, pixels_uint);
+
+ var pixels = new Float32Array(pixels_uint.buffer);
+ bufferedLogToConsole(" result = " + pixels[0] + " / " + tcuFloat.newFloat32(pixels[0]).bits());
+
+ // Verify results
+ /** @type {boolean} */ var firstPixelOk = this.compare(in0, in1, refD, pixels[0]);
+
+ if (firstPixelOk) {
+ // Check that rest of pixels match to first one.
+ /** @type {number} */ var firstPixelBits = tcuFloat.newFloat32(pixels[0]).bits();
+ /** @type {boolean} */ var allPixelsOk = true;
+
+ for (var y = 0; y < es3fShaderPrecisionTests.FRAMEBUFFER_HEIGHT; y++) {
+ for (var x = 0; x < es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH; x++) {
+ /** @type {number} */ var pixelBits = tcuFloat.newFloat32(pixels[(y * es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH + x) * 4]).bits();
+
+ if (pixelBits != firstPixelBits) {
+ bufferedLogToConsole("ERROR: Inconsistent results, got " + pixelBits + " at (" + x + ", " + y + ")")
+ allPixelsOk = false;
+ }
+ }
+
+ if (!allPixelsOk)
+ break;
+ }
+
+ if (!allPixelsOk){
+ bufferedLogToConsole("iter " + this.m_iterNdx + ", test " + testNdx + "Inconsistent values in framebuffer");
+ testPassed = false;
+ testPassedMsg = 'Inconsistent values in framebuffer';
+ }
+ }
+ else{
+ bufferedLogToConsole("iter " + this.m_iterNdx + ", test " + testNdx + "Result comparison failed");
+ testPassed = false;
+ testPassedMsg = 'Result comparison failed'
+ }
+ }
+
+ // [dag] Aggregating test results to make the test less verbose.
+ this.m_iterPass[this.m_iterNdx] = testPassed;
+
+ // [dag] Show test results after the last iteration is done.
+ if (this.m_iterPass.length === this.m_numIters) {
+ if (!deMath.boolAll(this.m_iterPass))
+ testFailedOptions(testPassedMsg, false);
+ else
+ testPassedOptions(testPassedMsg, true);
+ }
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+
+ this.m_iterNdx += 1;
+ return (this.m_iterNdx < this.m_numIters) ? tcuTestCase.IterateResult.CONTINUE : tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} desc
+ * @param {string} op
+ * @param {es3fShaderPrecisionTests.EvalFunc} evalFunc
+ * @param {gluShaderUtil.precision} precision
+ * @param {number} bits
+ * @param {Array<number>} rangeA
+ * @param {Array<number>} rangeB
+ * @param {boolean} isVertexCase
+ */
+ es3fShaderPrecisionTests.ShaderIntPrecisionCase = function(name, desc, op, evalFunc, precision, bits, rangeA, rangeB, isVertexCase) {
+ tcuTestCase.DeqpTest.call(this, name, desc);
+ // Case parameters.
+ /** @type {string} */ this.m_op = op;
+ /** @type {es3fShaderPrecisionTests.EvalFunc} */ this.m_evalFunc = evalFunc;
+ /** @type {gluShaderUtil.precision} */ this.m_precision = precision;
+ /** @type {number} */ this.m_bits = bits;
+ /** @type {Array<number>} */ this.m_rangeA = rangeA;
+ /** @type {Array<number>} */ this.m_rangeB = rangeB;
+ /** @type {boolean} */ this.m_isVertexCase = isVertexCase;
+
+ /** @type {number} */ this.m_numTestsPerIter = 32;
+ /** @type {number} */ this.m_numIters = 4;
+ /** @type {deRandom.Random} */ this.m_rnd = new deRandom.Random(deString.deStringHash(this.name));
+
+ // Iteration state.
+ /** @type {gluShaderProgram.ShaderProgram} */ this.m_program = null;
+ /** @type {WebGLFramebuffer} */ this.m_framebuffer = null;
+ /** @type {WebGLRenderbuffer} */ this.m_renderbuffer = null;
+ /** @type {number} */ this.m_iterNdx = 0;
+ };
+
+ es3fShaderPrecisionTests.ShaderIntPrecisionCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fShaderPrecisionTests.ShaderIntPrecisionCase.prototype.constructor = es3fShaderPrecisionTests.ShaderIntPrecisionCase;
+
+ es3fShaderPrecisionTests.ShaderIntPrecisionCase.prototype.init = function() {
+ assertMsgOptions(!this.m_program && !this.m_framebuffer && !this.m_renderbuffer, 'Program/Framebuffer/Renderbuffer should be null at this point.', false, true);
+ // Create program.
+ this.m_program = es3fShaderPrecisionTests.createIntUintPrecisionEvalProgram(gluShaderUtil.DataType.INT, this.m_precision, this.m_op, this.m_isVertexCase);
+
+ if (!this.m_program.isOk())
+ assertMsgOptions(false, 'Compile failed', false, true);
+
+ // Create framebuffer.
+ this.m_framebuffer = gl.createFramebuffer();
+ this.m_renderbuffer = gl.createRenderbuffer();
+
+ gl.bindRenderbuffer(gl.RENDERBUFFER, this.m_renderbuffer);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.R32I, es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH, es3fShaderPrecisionTests.FRAMEBUFFER_HEIGHT);
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, this.m_framebuffer);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, this.m_renderbuffer);
+
+ assertMsgOptions(gl.checkFramebufferStatus(gl.FRAMEBUFFER) === gl.FRAMEBUFFER_COMPLETE, 'Framebuffer is incomplete', false, true);
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+
+ this.m_iterNdx = 0;
+
+ bufferedLogToConsole("Number of accurate bits assumed = " + this.m_bits);
+ };
+
+ es3fShaderPrecisionTests.ShaderIntPrecisionCase.prototype.deinit = function() {
+ if(this.m_framebuffer)
+ gl.deleteFramebuffer(this.m_framebuffer);
+ if(this.m_renderbuffer)
+ gl.deleteRenderbuffer(this.m_renderbuffer);
+ this.m_program = null;
+ this.m_framebuffer = null;
+ this.m_renderbuffer = null;
+ };
+
+ /**
+ * @param {number} value
+ * @param {number} bits
+ * @return {number}
+ */
+
+ es3fShaderPrecisionTests.extendTo32Bit = function(value, bits) {
+ return (value & ((1 << (bits - 1)) - 1)) | ((value & (1 << (bits - 1))) << (32 - bits)) >> (32 - bits);
+ };
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fShaderPrecisionTests.ShaderIntPrecisionCase.prototype.iterate = function() {
+ var testPassed = true;
+ var testPassedMsg = 'Pass';
+ // Constant data.
+ /** @type {Array<number>} */ var position = [
+ -1.0, -1.0, 0.0, 1.0,
+ -1.0, 1.0, 0.0, 1.0,
+ 1.0, -1.0, 0.0, 1.0,
+ 1.0, 1.0, 0.0, 1.0
+ ]
+ /** @type {Array<number>} */ var indices = [0, 1, 2, 2, 1, 3];
+
+ /** @type {number} */ var numVertices = 4;
+ /** @type {Array<number>} */ var in0Arr = [0, 0, 0, 0];
+ /** @type {Array<number>} */ var in1Arr = [0, 0, 0, 0];
+
+ /** @type {number} */ var mask = this.m_bits === 32 ? 0xffffffff : ((1 << this.m_bits) - 1);
+ /** @type {goog.TypedArray} */ var pixels = new Int32Array(es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH * es3fShaderPrecisionTests.FRAMEBUFFER_HEIGHT * 4);
+ /** @type {Array<gluDrawUtil.VertexArrayBinding>} */ var vertexArrays = [];
+
+ /** @type {WebGLProgram} */ var prog = this.m_program.getProgram();
+
+ // \todo [2012-05-03 pyry] A bit hacky. getInt() should work fine with ranges like this.
+ /** @type {boolean} */ var isMaxRangeA = this.m_rangeA[0] === 0x80000000 && this.m_rangeA[1] === 0x7fffffff;
+ /** @type {boolean} */ var isMaxRangeB = this.m_rangeB[0] === 0x80000000 && this.m_rangeB[1] === 0x7fffffff;
+
+ gl.useProgram(prog);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, this.m_framebuffer);
+
+ vertexArrays[0] = gluDrawUtil.newFloatVertexArrayBinding("a_position", 4, numVertices, 0, position);
+
+ // Compute values and reference.
+ for (var testNdx = 0; testNdx < this.m_numTestsPerIter; testNdx++) {
+ /** @type {number} */ var in0 = this.m_rnd.getInt(this.m_rangeA[0], this.m_rangeA[1]); //es3fShaderPrecisionTests.extendTo32Bit(((isMaxRangeA ? Math.abs(this.m_rnd.getInt()) : this.m_rnd.getInt(this.m_rangeA[0], this.m_rangeA[1])) & mask), this.m_bits);
+ /** @type {number} */ var in1 = this.m_rnd.getInt(this.m_rangeB[0], this.m_rangeB[1]); //es3fShaderPrecisionTests.extendTo32Bit(((isMaxRangeB ? Math.abs(this.m_rnd.getInt()) : this.m_rnd.getInt(this.m_rangeB[0], this.m_rangeB[1])) & mask), this.m_bits);
+ /** @type {number} */ var refMasked = this.m_evalFunc(in0, in1) & mask;
+ /** @type {number} */ var refOut = es3fShaderPrecisionTests.extendTo32Bit(refMasked, this.m_bits);
+
+ bufferedLogToConsole("iter " + this.m_iterNdx + ", test " + testNdx + ": " +
+ "in0 = " + in0 + ", in1 = " + in1 + ", ref out = " + refOut + " / " + refMasked);
+
+ in0Arr = [in0, in0, in0, in0];
+ in1Arr = [in1, in1, in1, in1];
+
+ vertexArrays[1] = gluDrawUtil.newInt32VertexArrayBinding("a_in0", 1, numVertices, 0, in0Arr);
+ vertexArrays[2] = gluDrawUtil.newInt32VertexArrayBinding("a_in1", 1, numVertices, 0, in1Arr);
+
+ gluDrawUtil.draw(gl, prog, vertexArrays, gluDrawUtil.triangles(indices));
+
+ gl.readPixels(0, 0, es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH,
+ es3fShaderPrecisionTests.FRAMEBUFFER_HEIGHT,
+ gl.RGBA_INTEGER, gl.INT, pixels);
+
+ // Compare pixels.
+ for (var y = 0; y < es3fShaderPrecisionTests.FRAMEBUFFER_HEIGHT; y++) {
+ for (var x = 0; x < es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH; x++) {
+ /** @type {number} */ var cmpOut = pixels[(y * es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH + x) * 4];
+ /** @type {number} */ var cmpMasked = cmpOut & mask;
+
+ if (cmpMasked != refMasked) {
+ bufferedLogToConsole("Comparison failed (at " + x + ", " + y + "): " +
+ + "got " + cmpOut + " / " + cmpOut);
+ testPassed = false;
+ testPassedMsg = 'Comparison failed';
+ }
+ }
+ }
+ }
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+
+ this.m_iterNdx += 1;
+ if (!testPassed) {
+ testFailedOptions(testPassedMsg, false);
+ return tcuTestCase.IterateResult.STOP;
+ } else if (testPassed && this.m_iterNdx < this.m_numIters) {
+ return tcuTestCase.IterateResult.CONTINUE;
+ } else {
+ testPassedOptions(testPassedMsg, true);
+ return tcuTestCase.IterateResult.STOP;
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} desc
+ * @param {string} op
+ * @param {es3fShaderPrecisionTests.EvalFunc} evalFunc
+ * @param {gluShaderUtil.precision} precision
+ * @param {number} bits
+ * @param {Array<number>} rangeA
+ * @param {Array<number>} rangeB
+ * @param {boolean} isVertexCase
+ */
+ es3fShaderPrecisionTests.ShaderUintPrecisionCase = function(name, desc, op, evalFunc, precision, bits, rangeA, rangeB, isVertexCase) {
+ tcuTestCase.DeqpTest.call(this, name, desc);
+ // Case parameters.
+ /** @type {string} */ this.m_op = op;
+ /** @type {es3fShaderPrecisionTests.EvalFunc} */ this.m_evalFunc = evalFunc;
+ /** @type {gluShaderUtil.precision} */ this.m_precision = precision;
+ /** @type {number} */ this.m_bits = bits;
+ /** @type {Array<number>} */ this.m_rangeA = rangeA;
+ /** @type {Array<number>} */ this.m_rangeB = rangeB;
+ /** @type {boolean} */ this.m_isVertexCase = isVertexCase;
+
+ /** @type {number} */ this.m_numTestsPerIter = 32;
+ /** @type {number} */ this.m_numIters = 4;
+ /** @type {deRandom.Random} */ this.m_rnd = new deRandom.Random(deString.deStringHash(this.name));
+
+ // Iteration state.
+ /** @type {gluShaderProgram.ShaderProgram} */ this.m_program = null;
+ /** @type {WebGLFramebuffer} */ this.m_framebuffer = null;
+ /** @type {WebGLRenderbuffer} */ this.m_renderbuffer = null;
+ /** @type {number} */ this.m_iterNdx = 0;
+ };
+
+ es3fShaderPrecisionTests.ShaderUintPrecisionCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fShaderPrecisionTests.ShaderUintPrecisionCase.prototype.constructor = es3fShaderPrecisionTests.ShaderUintPrecisionCase;
+
+ es3fShaderPrecisionTests.ShaderUintPrecisionCase.prototype.init = function() {
+ assertMsgOptions(!this.m_program && !this.m_framebuffer && !this.m_renderbuffer, 'Program/Framebuffer/Renderbuffer should be null at this point.', false, true);
+ // Create program.
+ this.m_program = es3fShaderPrecisionTests.createIntUintPrecisionEvalProgram(gluShaderUtil.DataType.UINT, this.m_precision, this.m_op, this.m_isVertexCase);
+
+ if (!this.m_program.isOk())
+ assertMsgOptions(false, 'Compile failed', false, true);
+
+ // Create framebuffer.
+ this.m_framebuffer = gl.createFramebuffer();
+ this.m_renderbuffer = gl.createRenderbuffer();
+
+ gl.bindRenderbuffer(gl.RENDERBUFFER, this.m_renderbuffer);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.R32UI, es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH, es3fShaderPrecisionTests.FRAMEBUFFER_HEIGHT);
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, this.m_framebuffer);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, this.m_renderbuffer);
+
+ assertMsgOptions(gl.checkFramebufferStatus(gl.FRAMEBUFFER) === gl.FRAMEBUFFER_COMPLETE, 'Framebuffer is incomplete', false, true);
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+
+ this.m_iterNdx = 0;
+
+ bufferedLogToConsole("Number of accurate bits assumed = " + this.m_bits);
+ };
+
+ es3fShaderPrecisionTests.ShaderUintPrecisionCase.prototype.deinit = function() {
+ if(this.m_framebuffer)
+ gl.deleteFramebuffer(this.m_framebuffer);
+ if(this.m_renderbuffer)
+ gl.deleteRenderbuffer(this.m_renderbuffer);
+ this.m_program = null;
+ this.m_framebuffer = null;
+ this.m_renderbuffer = null;
+ };
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fShaderPrecisionTests.ShaderUintPrecisionCase.prototype.iterate = function() {
+ var testPassed = true;
+ var testPassedMsg = 'Pass';
+
+ // Constant data.
+ /** @type {Array<number>} */ var position = [
+ -1.0, -1.0, 0.0, 1.0,
+ -1.0, 1.0, 0.0, 1.0,
+ 1.0, -1.0, 0.0, 1.0,
+ 1.0, 1.0, 0.0, 1.0
+ ];
+ /** @type {Array<number>} */ var indices = [0, 1, 2, 2, 1, 3];
+
+ /** @type {number} */ var numVertices = 4;
+ /** @type {Array<number>} */ var in0Arr = [0, 0, 0, 0];
+ /** @type {Array<number>} */ var in1Arr = [0, 0, 0, 0];
+
+ /** @type {number} */ var mask = this.m_bits === 32 ? 0xffffffff : ((1 << this.m_bits) - 1);
+ /** @type {goog.TypedArray} */ var pixels = new Uint32Array(es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH * es3fShaderPrecisionTests.FRAMEBUFFER_HEIGHT * 4);
+ /** @type {Array<gluDrawUtil.VertexArrayBinding>} */ var vertexArrays = [];
+
+ /** @type {WebGLProgram} */ var prog = this.m_program.getProgram();
+
+ // \todo [2012-05-03 pyry] A bit hacky.
+ /** @type {boolean} */ var isMaxRangeA = this.m_rangeA[0] === 0 && this.m_rangeA[1] === 0xffffffff;
+ /** @type {boolean} */ var isMaxRangeB = this.m_rangeB[0] === 0 && this.m_rangeB[1] === 0xffffffff;
+
+ gl.useProgram(prog);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, this.m_framebuffer);
+
+ vertexArrays[0] = gluDrawUtil.newFloatVertexArrayBinding("a_position", 4, numVertices, 0, position);
+
+ // Compute values and reference.
+ for (var testNdx = 0; testNdx < this.m_numTestsPerIter; testNdx++) {
+ /** @type {number} */ var in0 = (isMaxRangeA ? Math.abs(this.m_rnd.getInt()) : (this.m_rangeA[0] + Math.abs(this.m_rnd.getInt()) % (this.m_rangeA[1] - this.m_rangeA[0] + 1))) & mask;
+ /** @type {number} */ var in1 = (isMaxRangeB ? Math.abs(this.m_rnd.getInt()) : (this.m_rangeB[0] + Math.abs(this.m_rnd.getInt()) % (this.m_rangeB[1] - this.m_rangeB[0] + 1))) & mask;
+ /** @type {number} */ var refOut = this.m_evalFunc(in0, in1) & mask;
+
+ bufferedLogToConsole("iter " + this.m_iterNdx + ", test " + testNdx + ": " +
+ + "in0 = " + in0 + ", in1 = " + in1 + ", ref out = " + refOut)
+
+ in0Arr = [in0, in0, in0, in0];
+ in1Arr = [in1, in1, in1, in1];
+ vertexArrays[1] = gluDrawUtil.newUint32VertexArrayBinding("a_in0", 1, numVertices, 0, in0Arr);
+ vertexArrays[2] = gluDrawUtil.newUint32VertexArrayBinding("a_in1", 1, numVertices, 0, in1Arr);
+
+ gluDrawUtil.draw(gl, prog, vertexArrays, gluDrawUtil.triangles(indices));
+
+ gl.readPixels(0, 0, es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH,
+ es3fShaderPrecisionTests.FRAMEBUFFER_HEIGHT, gl.RGBA_INTEGER, gl.UNSIGNED_INT, pixels);
+
+ // Compare pixels.
+ for (var y = 0; y < es3fShaderPrecisionTests.FRAMEBUFFER_HEIGHT; y++) {
+ for (var x = 0; x < es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH; x++) {
+ /** @type {number} */ var cmpOut = pixels[(y*es3fShaderPrecisionTests.FRAMEBUFFER_WIDTH + x) * 4];
+ /** @type {number} */ var cmpMasked = cmpOut & mask;
+
+ if (cmpMasked != refOut) {
+ bufferedLogToConsole("Comparison failed (at " + x + ", " + y + "): " + "got " + cmpOut)
+ testPassed = false;
+ testPassedMsg = 'Comparison failed';
+ }
+ }
+ }
+ }
+
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+
+ this.m_iterNdx += 1;
+ if (!testPassed) {
+ testFailedOptions(testPassedMsg, false);
+ return tcuTestCase.IterateResult.STOP;
+ } else if (testPassed && this.m_iterNdx < this.m_numIters) {
+ return tcuTestCase.IterateResult.CONTINUE;
+ } else {
+ testPassedOptions(testPassedMsg, true);
+ return tcuTestCase.IterateResult.STOP;
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fShaderPrecisionTests.ShaderPrecisionTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'precision', 'Shader precision requirements validation tests');
+ };
+
+ es3fShaderPrecisionTests.ShaderPrecisionTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fShaderPrecisionTests.ShaderPrecisionTests.prototype.constructor = es3fShaderPrecisionTests.ShaderPrecisionTests;
+
+ es3fShaderPrecisionTests.ShaderPrecisionTests.prototype.init = function() {
+ var testGroup = tcuTestCase.runner.testCases;
+ // Exp = Emax-2, Mantissa = 0
+ // /** @type {number} */ var minF32 = tcuFloat.newFloat32((1 << 31) | (0xfd << 23) | 0x0).getValue();
+ // /** @type {number} */ var maxF32 = tcuFloat.newFloat32((0 << 31) | (0xfd << 23) | 0x0).getValue();
+ // [dag] Workaround for float32 numbers
+ /** @type {number} */ var minF32 = new Float32Array(new Uint32Array([1<<31|0xfd<<23|0x0]).buffer)[0];
+ /** @type {number} */ var maxF32 = new Float32Array(new Uint32Array([0<<31|0xfd<<23|0x0]).buffer)[0];
+
+ // /** @type {number} */ var minF16 = tcuFloat.newFloat16(((1 << 15) | (0x1d << 10) | 0x0)).getValue();
+ // /** @type {number} */ var maxF16 = tcuFloat.newFloat16(((0 << 15) | (0x1d << 10) | 0x0)).getValue();
+ /** @type {number} */ var minF16 = -16384; //-1 << 14; // 1 << 15 | 0x1d | 0x0 == 0b1111010000000000; -1 * (2**(29-15)) * 1
+ /** @type {number} */ var maxF16 = 16384; //1 << 14; // 0 << 15 | 0x1d | 0x0 == 0b0111010000000000; +1 * (2**(29-15)) * 1
+
+ /** @type {Array<number>} */ var fullRange32F = [minF32, maxF32];
+ /** @type {Array<number>} */ var fullRange16F = [minF16, maxF16];
+ /** @type {Array<number>} */ var fullRange32I = [-2147483648, 2147483647]; // [0x80000000|0, 0x7fffffff|0]; // |0 to force the number as a 32-bit integer
+ /** @type {Array<number>} */ var fullRange16I = [minF16, maxF16 - 1]; //[-(1 << 15), (1 << 15) - 1]; // Added the negative sign to index 0
+ /** @type {Array<number>} */ var fullRange8I = [-128, 127]; //[-(1 << 7), (1 << 7) - 1]; // Added the negative sign to index 0
+ /** @type {Array<number>} */ var fullRange32U = [0, 0xffffffff];
+ /** @type {Array<number>} */ var fullRange16U = [0, 0xffff];
+ /** @type {Array<number>} */ var fullRange8U = [0, 0xff];
+
+ // \note Right now it is not programmatically verified that the results shouldn't end up being inf/nan but
+ // actual values used are ok.
+
+ /**
+ * @constructor
+ * @struct
+ * @param {string} name
+ * @param {string} op
+ * @param {es3fShaderPrecisionTests.EvalFunc} evalFunc
+ * @param {gluShaderUtil.precision} precision
+ * @param {Array<number>} rangeA
+ * @param {Array<number>} rangeB
+ */
+ var FloatCase = function(name, op, evalFunc, precision, rangeA, rangeB) {
+ /** @type {string} */ this.name = name;
+ /** @type {string} */ this.op = op;
+ /** @type {es3fShaderPrecisionTests.EvalFunc} */ this.evalFunc = evalFunc;
+ /** @type {gluShaderUtil.precision} */ this.precision = precision;
+ /** @type {Array<number>} */ this.rangeA = rangeA;
+ /** @type {Array<number>} */ this.rangeB = rangeB;
+ };
+
+ /** @type {Array<FloatCase>} */ var floatCases = [
+ new FloatCase('highp_add', 'in0 + in1', es3fShaderPrecisionTests.add, gluShaderUtil.precision.PRECISION_HIGHP, fullRange32F, fullRange32F),
+ new FloatCase('highp_sub', 'in0 - in1', es3fShaderPrecisionTests.sub, gluShaderUtil.precision.PRECISION_HIGHP, fullRange32F, fullRange32F),
+ new FloatCase('highp_mul', 'in0 * in1', es3fShaderPrecisionTests.mul, gluShaderUtil.precision.PRECISION_HIGHP, [-1e5, 1e5], [-1e5, 1e5]),
+ new FloatCase('highp_div', 'in0 / in1', es3fShaderPrecisionTests.div, gluShaderUtil.precision.PRECISION_HIGHP, [-1e5, 1e5], [-1e5, 1e5]),
+ new FloatCase('mediump_add', 'in0 + in1', es3fShaderPrecisionTests.add, gluShaderUtil.precision.PRECISION_MEDIUMP, fullRange16F, fullRange16F),
+ new FloatCase('mediump_sub', 'in0 - in1', es3fShaderPrecisionTests.sub, gluShaderUtil.precision.PRECISION_MEDIUMP, fullRange16F, fullRange16F),
+ new FloatCase('mediump_mul', 'in0 * in1', es3fShaderPrecisionTests.mul, gluShaderUtil.precision.PRECISION_MEDIUMP, [-1e2, 1e2], [-1e2, 1e2]),
+ new FloatCase('mediump_div', 'in0 / in1', es3fShaderPrecisionTests.div, gluShaderUtil.precision.PRECISION_MEDIUMP, [-1e2, 1e2], [-1e2, 1e2])
+ ];
+
+ /**
+ * @constructor
+ * @struct
+ * @param {string} name
+ * @param {string} op
+ * @param {es3fShaderPrecisionTests.EvalFunc} evalFunc
+ * @param {gluShaderUtil.precision} precision
+ * @param {number} bits
+ * @param {Array<number>} rangeA
+ * @param {Array<number>} rangeB
+ */
+ var IntCase = function(name, op, evalFunc, precision, bits, rangeA, rangeB) {
+ /** @type {string} */ this.name = name;
+ /** @type {string} */ this.op = op;
+ /** @type {es3fShaderPrecisionTests.EvalFunc} */ this.evalFunc = evalFunc;
+ /** @type {gluShaderUtil.precision} */ this.precision = precision;
+ /** @type {number} */ this.bits = bits;
+ /** @type {Array<number>} */ this.rangeA = rangeA;
+ /** @type {Array<number>} */ this.rangeB = rangeB;
+ };
+
+ /** @type {Array<IntCase>} */ var intCases = [
+ new IntCase('highp_add', 'in0 + in1', es3fShaderPrecisionTests.add, gluShaderUtil.precision.PRECISION_HIGHP, 32, fullRange32I, fullRange32I),
+ new IntCase('highp_sub', 'in0 - in1', es3fShaderPrecisionTests.sub, gluShaderUtil.precision.PRECISION_HIGHP, 32, fullRange32I, fullRange32I),
+ new IntCase('highp_mul', 'in0 * in1', es3fShaderPrecisionTests.mul32, gluShaderUtil.precision.PRECISION_HIGHP, 32, fullRange32I, fullRange32I),
+ new IntCase('highp_div', 'in0 / in1', es3fShaderPrecisionTests.div, gluShaderUtil.precision.PRECISION_HIGHP, 32, fullRange32I, [-10000, -1]),
+ new IntCase('mediump_add', 'in0 + in1', es3fShaderPrecisionTests.add, gluShaderUtil.precision.PRECISION_MEDIUMP, 16, fullRange16I, fullRange16I),
+ new IntCase('mediump_sub', 'in0 - in1', es3fShaderPrecisionTests.sub, gluShaderUtil.precision.PRECISION_MEDIUMP, 16, fullRange16I, fullRange16I),
+ new IntCase('mediump_mul', 'in0 * in1', es3fShaderPrecisionTests.mul, gluShaderUtil.precision.PRECISION_MEDIUMP, 16, fullRange16I, fullRange16I),
+ new IntCase('mediump_div', 'in0 / in1', es3fShaderPrecisionTests.div, gluShaderUtil.precision.PRECISION_MEDIUMP, 16, fullRange16I, [1, 1000]),
+ new IntCase('lowp_add', 'in0 + in1', es3fShaderPrecisionTests.add, gluShaderUtil.precision.PRECISION_LOWP, 8, fullRange8I, fullRange8I),
+ new IntCase('lowp_sub', 'in0 - in1', es3fShaderPrecisionTests.sub, gluShaderUtil.precision.PRECISION_LOWP, 8, fullRange8I, fullRange8I),
+ new IntCase('lowp_mul', 'in0 * in1', es3fShaderPrecisionTests.mul, gluShaderUtil.precision.PRECISION_LOWP, 8, fullRange8I, fullRange8I),
+ new IntCase('lowp_div', 'in0 / in1', es3fShaderPrecisionTests.div, gluShaderUtil.precision.PRECISION_LOWP, 8, fullRange8I, [-50, -1])
+ ];
+
+ /**
+ * @constructor
+ * @struct
+ * @param {string} name
+ * @param {string} op
+ * @param {es3fShaderPrecisionTests.EvalFunc} evalFunc
+ * @param {gluShaderUtil.precision} precision
+ * @param {number} bits
+ * @param {Array<number>} rangeA
+ * @param {Array<number>} rangeB
+ */
+ var UintCase = function(name, op, evalFunc, precision, bits, rangeA, rangeB) {
+ /** @type {string} */ this.name = name;
+ /** @type {string} */ this.op = op;
+ /** @type {es3fShaderPrecisionTests.EvalFunc} */ this.evalFunc = evalFunc;
+ /** @type {gluShaderUtil.precision} */ this.precision = precision;
+ /** @type {number} */ this.bits = bits;
+ /** @type {Array<number>} */ this.rangeA = rangeA;
+ /** @type {Array<number>} */ this.rangeB = rangeB;
+ };
+
+ /** @type {Array<UintCase>} */ var uintCases = [
+ new UintCase('highp_add', 'in0 + in1', es3fShaderPrecisionTests.add, gluShaderUtil.precision.PRECISION_HIGHP, 32, fullRange32U, fullRange32U),
+ new UintCase('highp_sub', 'in0 - in1', es3fShaderPrecisionTests.sub, gluShaderUtil.precision.PRECISION_HIGHP, 32, fullRange32U, fullRange32U),
+ new UintCase('highp_mul', 'in0 * in1', es3fShaderPrecisionTests.mul32, gluShaderUtil.precision.PRECISION_HIGHP, 32, fullRange32U, fullRange32U),
+ new UintCase('highp_div', 'in0 / in1', es3fShaderPrecisionTests.div, gluShaderUtil.precision.PRECISION_HIGHP, 32, fullRange32U, [1, 10000]),
+ new UintCase('mediump_add', 'in0 + in1', es3fShaderPrecisionTests.add, gluShaderUtil.precision.PRECISION_MEDIUMP, 16, fullRange16U, fullRange16U),
+ new UintCase('mediump_sub', 'in0 - in1', es3fShaderPrecisionTests.sub, gluShaderUtil.precision.PRECISION_MEDIUMP, 16, fullRange16U, fullRange16U),
+ new UintCase('mediump_mul', 'in0 * in1', es3fShaderPrecisionTests.mul, gluShaderUtil.precision.PRECISION_MEDIUMP, 16, fullRange16U, fullRange16U),
+ new UintCase('mediump_div', 'in0 / in1', es3fShaderPrecisionTests.div, gluShaderUtil.precision.PRECISION_MEDIUMP, 16, fullRange16U, [1, 1000]),
+ new UintCase('lowp_add', 'in0 + in1', es3fShaderPrecisionTests.add, gluShaderUtil.precision.PRECISION_LOWP, 8, fullRange8U, fullRange8U),
+ new UintCase('lowp_sub', 'in0 - in1', es3fShaderPrecisionTests.sub, gluShaderUtil.precision.PRECISION_LOWP, 8, fullRange8U, fullRange8U),
+ new UintCase('lowp_mul', 'in0 * in1', es3fShaderPrecisionTests.mul, gluShaderUtil.precision.PRECISION_LOWP, 8, fullRange8U, fullRange8U),
+ new UintCase('lowp_div', 'in0 / in1', es3fShaderPrecisionTests.div, gluShaderUtil.precision.PRECISION_LOWP, 8, fullRange8U, [1, 50])
+ ];
+
+ /** @type {tcuTestCase.DeqpTest} */ var floatGroup = tcuTestCase.newTest('float', 'Floating-point precision tests');
+ testGroup.addChild(floatGroup);
+ for (var ndx = 0; ndx < floatCases.length; ndx++) {
+ floatGroup.addChild(new es3fShaderPrecisionTests.ShaderFloatPrecisionCase(
+ floatCases[ndx].name + '_vertex', '', floatCases[ndx].op, floatCases[ndx].evalFunc,
+ floatCases[ndx].precision, floatCases[ndx].rangeA, floatCases[ndx].rangeB, true));
+ floatGroup.addChild(new es3fShaderPrecisionTests.ShaderFloatPrecisionCase(
+ floatCases[ndx].name + '_fragment', '', floatCases[ndx].op, floatCases[ndx].evalFunc,
+ floatCases[ndx].precision, floatCases[ndx].rangeA, floatCases[ndx].rangeB, false));
+ }
+
+ /** @type {tcuTestCase.DeqpTest} */ var intGroup = tcuTestCase.newTest('int', 'Integer precision tests');
+ testGroup.addChild(intGroup);
+ for (var ndx = 0; ndx < intCases.length; ndx++) {
+ intGroup.addChild(new es3fShaderPrecisionTests.ShaderIntPrecisionCase(
+ intCases[ndx].name + '_vertex', '', intCases[ndx].op, intCases[ndx].evalFunc,
+ intCases[ndx].precision, intCases[ndx].bits, intCases[ndx].rangeA, intCases[ndx].rangeB, true));
+ intGroup.addChild(new es3fShaderPrecisionTests.ShaderIntPrecisionCase(
+ intCases[ndx].name + '_fragment', '', intCases[ndx].op, intCases[ndx].evalFunc,
+ intCases[ndx].precision, intCases[ndx].bits, intCases[ndx].rangeA, intCases[ndx].rangeB, false));
+ }
+
+ /** @type {tcuTestCase.DeqpTest} */ var uintGroup = tcuTestCase.newTest('uint', 'Unsigned integer precision tests');
+ testGroup.addChild(uintGroup);
+ for (var ndx = 0; ndx < uintCases.length; ndx++) {
+ uintGroup.addChild(new es3fShaderPrecisionTests.ShaderUintPrecisionCase(
+ uintCases[ndx].name + '_vertex', '', uintCases[ndx].op, uintCases[ndx].evalFunc,
+ uintCases[ndx].precision, uintCases[ndx].bits, uintCases[ndx].rangeA, uintCases[ndx].rangeB, true));
+ uintGroup.addChild(new es3fShaderPrecisionTests.ShaderUintPrecisionCase(
+ uintCases[ndx].name + '_fragment', '', uintCases[ndx].op, uintCases[ndx].evalFunc,
+ uintCases[ndx].precision, uintCases[ndx].bits, uintCases[ndx].rangeA, uintCases[ndx].rangeB, false));
+ }
+ };
+
+ /**
+ * Run test
+ * @param {WebGL2RenderingContext} context
+ */
+ es3fShaderPrecisionTests.run = function(context, range) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fShaderPrecisionTests.ShaderPrecisionTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ if (range)
+ state.setRange(range);
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fShaderPrecisionTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderStateQueryTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderStateQueryTests.js
new file mode 100644
index 0000000000..1a2859f249
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderStateQueryTests.js
@@ -0,0 +1,2205 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fShaderStateQueryTests');
+goog.require('framework.common.tcuMatrix');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('functional.gles3.es3fApiCase');
+goog.require('modules.shared.glsStateQuery');
+
+goog.scope(function() {
+var es3fShaderStateQueryTests = functional.gles3.es3fShaderStateQueryTests;
+var tcuTestCase = framework.common.tcuTestCase;
+var glsStateQuery = modules.shared.glsStateQuery;
+var es3fApiCase = functional.gles3.es3fApiCase;
+var deRandom = framework.delibs.debase.deRandom;
+var tcuMatrix = framework.common.tcuMatrix;
+
+var setParentClass = function(child, parent) {
+ child.prototype = Object.create(parent.prototype);
+ child.prototype.constructor = child;
+};
+
+var commonTestVertSource = '#version 300 es\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = vec4(0.0);\n' +
+ '}\n';
+var commonTestFragSource = '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 fragColor;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' fragColor = vec4(0.0);\n' +
+ '}\n';
+
+var brokenShader = '#version 300 es\n' +
+ 'broken, this should not compile!\n' +
+ '\n';
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.ShaderTypeCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.ShaderTypeCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.ShaderTypeCase.prototype.test = function() {
+ var shaderTypes = [gl.VERTEX_SHADER, gl.FRAGMENT_SHADER];
+ for (var ndx = 0; ndx < shaderTypes.length; ++ndx) {
+ var shader = gl.createShader(shaderTypes[ndx]);
+ var result = glsStateQuery.verifyShader(shader, gl.SHADER_TYPE, shaderTypes[ndx]);
+ this.check(result, 'Incorrect shader type');
+ gl.deleteShader(shader);
+ }
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.ShaderCompileStatusCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.ShaderCompileStatusCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.ShaderCompileStatusCase.prototype.test = function() {
+ var result;
+ var shaderVert = gl.createShader(gl.VERTEX_SHADER);
+ var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER);
+
+ result = glsStateQuery.verifyShader(shaderVert, gl.COMPILE_STATUS, false);
+ this.check(result, 'Vertex shader compilation status should be false');
+ result = glsStateQuery.verifyShader(shaderFrag, gl.COMPILE_STATUS, false);
+ this.check(result, 'Fragment shader compilation status should be false');
+
+ gl.shaderSource(shaderVert, commonTestVertSource);
+ gl.shaderSource(shaderFrag, commonTestFragSource);
+
+ gl.compileShader(shaderVert);
+ gl.compileShader(shaderFrag);
+
+ result = glsStateQuery.verifyShader(shaderVert, gl.COMPILE_STATUS, true);
+ this.check(result, 'Vertex shader compilation status should be true');
+ result = glsStateQuery.verifyShader(shaderFrag, gl.COMPILE_STATUS, true);
+ this.check(result, 'Fragment shader compilation status should be true');
+
+ gl.deleteShader(shaderVert);
+ gl.deleteShader(shaderFrag);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.ShaderInfoLogCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.ShaderInfoLogCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.ShaderInfoLogCase.prototype.test = function() {
+ var shader = gl.createShader(gl.VERTEX_SHADER);
+ var log = gl.getShaderInfoLog(shader);
+ this.check(log === '');
+
+ gl.shaderSource(shader, brokenShader);
+ gl.compileShader(shader);
+
+ log = gl.getShaderInfoLog(shader);
+ this.check(log === null || typeof log === 'string');
+
+ gl.deleteShader(shader);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.ShaderSourceCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.ShaderSourceCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.ShaderSourceCase.prototype.test = function() {
+ var shader = gl.createShader(gl.VERTEX_SHADER);
+ this.check(gl.getShaderSource(shader) === '');
+
+ gl.shaderSource(shader, brokenShader);
+ this.check(gl.getShaderSource(shader) === brokenShader);
+
+ gl.deleteShader(shader);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.DeleteStatusCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.DeleteStatusCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.DeleteStatusCase.prototype.test = function() {
+ var shaderVert = gl.createShader(gl.VERTEX_SHADER);
+ var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER);
+
+ gl.shaderSource(shaderVert, commonTestVertSource);
+ gl.shaderSource(shaderFrag, commonTestFragSource);
+
+ gl.compileShader(shaderVert);
+ gl.compileShader(shaderFrag);
+
+ this.check(glsStateQuery.verifyShader(shaderVert, gl.COMPILE_STATUS, true));
+ this.check(glsStateQuery.verifyShader(shaderFrag, gl.COMPILE_STATUS, true));
+
+ var shaderProg = gl.createProgram();
+ gl.attachShader(shaderProg, shaderVert);
+ gl.attachShader(shaderProg, shaderFrag);
+ gl.linkProgram(shaderProg);
+
+ this.check(glsStateQuery.verifyProgram(shaderProg, gl.LINK_STATUS, true));
+
+ this.check(glsStateQuery.verifyShader(shaderVert, gl.DELETE_STATUS, false));
+ this.check(glsStateQuery.verifyShader(shaderFrag, gl.DELETE_STATUS, false));
+ this.check(glsStateQuery.verifyProgram(shaderProg, gl.DELETE_STATUS, false));
+
+ gl.useProgram(shaderProg);
+
+ gl.deleteShader(shaderVert);
+ gl.deleteShader(shaderFrag);
+ gl.deleteProgram(shaderProg);
+
+ this.check(glsStateQuery.verifyShader(shaderVert, gl.DELETE_STATUS, true));
+ this.check(glsStateQuery.verifyShader(shaderFrag, gl.DELETE_STATUS, true));
+ this.check(glsStateQuery.verifyProgram(shaderProg, gl.DELETE_STATUS, true));
+
+ gl.useProgram(null);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.CurrentVertexAttribInitialCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.CurrentVertexAttribInitialCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.CurrentVertexAttribInitialCase.prototype.test = function() {
+ var attribute_count = /** @type {number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS));
+ var initial = new Float32Array([0, 0, 0, 1]);
+ // initial
+
+ for (var index = 0; index < attribute_count; ++index) {
+ var attrib = gl.getVertexAttrib(index, gl.CURRENT_VERTEX_ATTRIB);
+ this.check(glsStateQuery.compare(attrib, initial), 'Initial attrib value should be [0, 0, 0, 1]');
+ }
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.CurrentVertexAttribFloatCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.CurrentVertexAttribFloatCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.CurrentVertexAttribFloatCase.prototype.test = function() {
+ var rnd = new deRandom.Random(0xabcdef);
+
+ var attribute_count = /** @type {number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS));
+
+ // test write float/read float
+
+ for (var index = 0; index < attribute_count; ++index) {
+ var x = rnd.getFloat(-64000, 64000);
+ var y = rnd.getFloat(-64000, 64000);
+ var z = rnd.getFloat(-64000, 64000);
+ var w = rnd.getFloat(-64000, 64000);
+
+ gl.vertexAttrib4f(index, x, y, z, w);
+ this.check(glsStateQuery.verifyCurrentVertexAttrib(index, new Float32Array([x, y, z, w])));
+ }
+ for (var index = 0; index < attribute_count; ++index) {
+ var x = rnd.getFloat(-64000, 64000);
+ var y = rnd.getFloat(-64000, 64000);
+ var z = rnd.getFloat(-64000, 64000);
+ var w = 1.0;
+
+ gl.vertexAttrib3f(index, x, y, z);
+ this.check(glsStateQuery.verifyCurrentVertexAttrib(index, new Float32Array([x, y, z, w])));
+ }
+ for (var index = 0; index < attribute_count; ++index) {
+ var x = rnd.getFloat(-64000, 64000);
+ var y = rnd.getFloat(-64000, 64000);
+ var z = 0.0;
+ var w = 1.0;
+
+ gl.vertexAttrib2f(index, x, y);
+ this.check(glsStateQuery.verifyCurrentVertexAttrib(index, new Float32Array([x, y, z, w])));
+ }
+ for (var index = 0; index < attribute_count; ++index) {
+ var x = rnd.getFloat(-64000, 64000);
+ var y = 0.0;
+ var z = 0.0;
+ var w = 1.0;
+
+ gl.vertexAttrib1f(index, x);
+ this.check(glsStateQuery.verifyCurrentVertexAttrib(index, new Float32Array([x, y, z, w])));
+ }
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.CurrentVertexAttribIntCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.CurrentVertexAttribIntCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.CurrentVertexAttribIntCase.prototype.test = function() {
+ var rnd = new deRandom.Random(0xabcdef);
+
+ var attribute_count = /** @type {number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS));
+
+ // test write float/read float
+
+ for (var index = 0; index < attribute_count; ++index) {
+ var x = rnd.getInt(-64000, 64000);
+ var y = rnd.getInt(-64000, 64000);
+ var z = rnd.getInt(-64000, 64000);
+ var w = rnd.getInt(-64000, 64000);
+
+ gl.vertexAttribI4i(index, x, y, z, w);
+ this.check(glsStateQuery.verifyCurrentVertexAttrib(index, new Int32Array([x, y, z, w])));
+ }
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.CurrentVertexAttribUintCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.CurrentVertexAttribUintCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.CurrentVertexAttribUintCase.prototype.test = function() {
+ var rnd = new deRandom.Random(0xabcdef);
+
+ var attribute_count = /** @type {number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS));
+
+ // test write float/read float
+
+ for (var index = 0; index < attribute_count; ++index) {
+ var x = rnd.getInt(0, 64000);
+ var y = rnd.getInt(0, 64000);
+ var z = rnd.getInt(0, 64000);
+ var w = rnd.getInt(0, 64000);
+
+ gl.vertexAttribI4ui(index, x, y, z, w);
+ this.check(glsStateQuery.verifyCurrentVertexAttrib(index, new Uint32Array([x, y, z, w])));
+ }
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.ProgramInfoLogCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.ProgramInfoLogCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.ProgramInfoLogCase.prototype.test = function() {
+ var shaderVert = gl.createShader(gl.VERTEX_SHADER);
+ var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER);
+
+ gl.shaderSource(shaderVert, brokenShader);
+ gl.compileShader(shaderVert);
+ gl.shaderSource(shaderFrag, brokenShader);
+ gl.compileShader(shaderFrag);
+
+ var program = gl.createProgram();
+ gl.attachShader(program, shaderVert);
+ gl.attachShader(program, shaderFrag);
+ gl.linkProgram(program);
+
+ var log = gl.getProgramInfoLog(program);
+ this.check(log === null || typeof log === 'string');
+
+ gl.deleteShader(shaderVert);
+ gl.deleteShader(shaderFrag);
+ gl.deleteProgram(program);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.ProgramValidateStatusCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.ProgramValidateStatusCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.ProgramValidateStatusCase.prototype.test = function() {
+ // test validate ok
+ var shaderVert = gl.createShader(gl.VERTEX_SHADER);
+ var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER);
+
+ gl.shaderSource(shaderVert, commonTestVertSource);
+ gl.shaderSource(shaderFrag, commonTestFragSource);
+
+ gl.compileShader(shaderVert);
+ gl.compileShader(shaderFrag);
+
+ var program = gl.createProgram();
+ gl.attachShader(program, shaderVert);
+ gl.attachShader(program, shaderFrag);
+ gl.linkProgram(program);
+
+ this.check(glsStateQuery.verifyShader(shaderVert, gl.COMPILE_STATUS, true));
+ this.check(glsStateQuery.verifyShader(shaderFrag, gl.COMPILE_STATUS, true));
+ this.check(glsStateQuery.verifyProgram(program, gl.LINK_STATUS, true));
+
+ gl.validateProgram(program);
+ this.check(glsStateQuery.verifyProgram(program, gl.VALIDATE_STATUS, true));
+
+ gl.deleteShader(shaderVert);
+ gl.deleteShader(shaderFrag);
+ gl.deleteProgram(program);
+
+ // test with broken shader
+ shaderVert = gl.createShader(gl.VERTEX_SHADER);
+ shaderFrag = gl.createShader(gl.FRAGMENT_SHADER);
+
+ gl.shaderSource(shaderVert, commonTestVertSource);
+ gl.shaderSource(shaderFrag, brokenShader);
+
+ gl.compileShader(shaderVert);
+ gl.compileShader(shaderFrag);
+
+ program = gl.createProgram();
+ gl.attachShader(program, shaderVert);
+ gl.attachShader(program, shaderFrag);
+ gl.linkProgram(program);
+
+ this.check(glsStateQuery.verifyShader(shaderVert, gl.COMPILE_STATUS, true));
+ this.check(glsStateQuery.verifyShader(shaderFrag, gl.COMPILE_STATUS, false));
+ this.check(glsStateQuery.verifyProgram(program, gl.LINK_STATUS, false));
+
+ gl.validateProgram(program);
+ this.check(glsStateQuery.verifyProgram(program, gl.VALIDATE_STATUS, false));
+
+ gl.deleteShader(shaderVert);
+ gl.deleteShader(shaderFrag);
+ gl.deleteProgram(program);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.ProgramAttachedShadersCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.ProgramAttachedShadersCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.ProgramAttachedShadersCase.prototype.test = function() {
+ var shaderVert = gl.createShader(gl.VERTEX_SHADER);
+ var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER);
+
+ gl.shaderSource(shaderVert, commonTestVertSource);
+ gl.shaderSource(shaderFrag, commonTestFragSource);
+
+ gl.compileShader(shaderVert);
+ gl.compileShader(shaderFrag);
+
+ // check ATTACHED_SHADERS
+
+ var program = gl.createProgram();
+ this.check(glsStateQuery.verifyProgram(program, gl.ATTACHED_SHADERS, 0));
+
+ gl.attachShader(program, shaderVert);
+ this.check(glsStateQuery.verifyProgram(program, gl.ATTACHED_SHADERS, 1));
+
+ gl.attachShader(program, shaderFrag);
+ this.check(glsStateQuery.verifyProgram(program, gl.ATTACHED_SHADERS, 2));
+
+ // check GetAttachedShaders
+ var shaders = gl.getAttachedShaders(program);
+ this.check(glsStateQuery.compare(shaders, [shaderVert, shaderFrag]));
+
+ gl.deleteShader(shaderVert);
+ gl.deleteShader(shaderFrag);
+ gl.deleteProgram(program);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.ProgramActiveUniformNameCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.ProgramActiveUniformNameCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.ProgramActiveUniformNameCase.prototype.test = function() {
+ var testVertSource =
+ '#version 300 es\n' +
+ 'uniform highp float uniformNameWithLength23;\n' +
+ 'uniform highp vec2 uniformVec2;\n' +
+ 'uniform highp mat4 uniformMat4;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = vec4(0.0) + vec4(uniformNameWithLength23) + vec4(uniformVec2.x) + vec4(uniformMat4[2][3]);\n' +
+ '}\n';
+ var testFragSource =
+ '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 fragColor;' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' fragColor = vec4(0.0);\n' +
+ '}\n';
+
+ var shaderVert = gl.createShader(gl.VERTEX_SHADER);
+ var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER);
+
+ gl.shaderSource(shaderVert, testVertSource);
+ gl.shaderSource(shaderFrag, testFragSource);
+
+ gl.compileShader(shaderVert);
+ gl.compileShader(shaderFrag);
+
+ var program = gl.createProgram();
+ gl.attachShader(program, shaderVert);
+ gl.attachShader(program, shaderFrag);
+ gl.linkProgram(program);
+
+ this.check(glsStateQuery.verifyProgram(program, gl.ACTIVE_UNIFORMS, 3));
+
+ var uniformNames = [
+ 'uniformNameWithLength23',
+ 'uniformVec2',
+ 'uniformMat4'
+ ];
+
+ var indices = gl.getUniformIndices(program, uniformNames);
+
+ // check names
+ for (var ndx = 0; ndx < uniformNames.length; ++ndx) {
+ var index = indices[ndx];
+ var uniform = gl.getActiveUniform(program, index);
+
+ this.check(glsStateQuery.compare(uniform.name, uniformNames[ndx]));
+ }
+
+ gl.deleteShader(shaderVert);
+ gl.deleteShader(shaderFrag);
+ gl.deleteProgram(program);
+
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.ProgramUniformCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.ProgramUniformCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.ProgramUniformCase.prototype.test = function() {
+ var uniformTypes = [
+ ['float', '', 'highp', '', 'uniformValue', gl.FLOAT, 1, false],
+ ['float[2]', '', 'highp', '', 'uniformValue[1]', gl.FLOAT, 2, false],
+ ['vec2', '', 'highp', '', 'uniformValue.x', gl.FLOAT_VEC2, 1, false],
+ ['vec3', '', 'highp', '', 'uniformValue.x', gl.FLOAT_VEC3, 1, false],
+ ['vec4', '', 'highp', '', 'uniformValue.x', gl.FLOAT_VEC4, 1, false],
+ ['int', '', 'highp', '', 'float(uniformValue)', gl.INT, 1, false],
+ ['ivec2', '', 'highp', '', 'float(uniformValue.x)', gl.INT_VEC2, 1, false],
+ ['ivec3', '', 'highp', '', 'float(uniformValue.x)', gl.INT_VEC3, 1, false],
+ ['ivec4', '', 'highp', '', 'float(uniformValue.x)', gl.INT_VEC4, 1, false],
+ ['uint', '', 'highp', '', 'float(uniformValue)', gl.UNSIGNED_INT, 1, false],
+ ['uvec2', '', 'highp', '', 'float(uniformValue.x)', gl.UNSIGNED_INT_VEC2, 1, false],
+ ['uvec3', '', 'highp', '', 'float(uniformValue.x)', gl.UNSIGNED_INT_VEC3, 1, false],
+ ['uvec4', '', 'highp', '', 'float(uniformValue.x)', gl.UNSIGNED_INT_VEC4, 1, false],
+ ['bool', '', '', '', 'float(uniformValue)', gl.BOOL, 1, false],
+ ['bvec2', '', '', '', 'float(uniformValue.x)', gl.BOOL_VEC2, 1, false],
+ ['bvec3', '', '', '', 'float(uniformValue.x)', gl.BOOL_VEC3, 1, false],
+ ['bvec4', '', '', '', 'float(uniformValue.x)', gl.BOOL_VEC4, 1, false],
+ ['mat2', '', 'highp', '', 'float(uniformValue[0][0])', gl.FLOAT_MAT2, 1, false],
+ ['mat3', '', 'highp', '', 'float(uniformValue[0][0])', gl.FLOAT_MAT3, 1, false],
+ ['mat4', '', 'highp', '', 'float(uniformValue[0][0])', gl.FLOAT_MAT4, 1, false],
+ ['mat2x3', '', 'highp', '', 'float(uniformValue[0][0])', gl.FLOAT_MAT2x3, 1, false],
+ ['mat2x4', '', 'highp', '', 'float(uniformValue[0][0])', gl.FLOAT_MAT2x4, 1, false],
+ ['mat3x2', '', 'highp', '', 'float(uniformValue[0][0])', gl.FLOAT_MAT3x2, 1, false],
+ ['mat3x4', '', 'highp', '', 'float(uniformValue[0][0])', gl.FLOAT_MAT3x4, 1, false],
+ ['mat4x2', '', 'highp', '', 'float(uniformValue[0][0])', gl.FLOAT_MAT4x2, 1, false],
+ ['mat4x3', '', 'highp', '', 'float(uniformValue[0][0])', gl.FLOAT_MAT4x3, 1, false],
+ ['sampler2D', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.SAMPLER_2D, 1, false],
+ ['sampler3D', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.SAMPLER_3D, 1, false],
+ ['samplerCube', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.SAMPLER_CUBE, 1, false],
+ ['sampler2DShadow', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.SAMPLER_2D_SHADOW, 1, false],
+ ['sampler2DArray', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.SAMPLER_2D_ARRAY, 1, false],
+ ['sampler2DArrayShadow', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.SAMPLER_2D_ARRAY_SHADOW, 1, false],
+ ['samplerCubeShadow', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.SAMPLER_CUBE_SHADOW, 1, false],
+ ['isampler2D', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.INT_SAMPLER_2D, 1, false],
+ ['isampler3D', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.INT_SAMPLER_3D, 1, false],
+ ['isamplerCube', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.INT_SAMPLER_CUBE, 1, false],
+ ['isampler2DArray', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.INT_SAMPLER_2D_ARRAY, 1, false],
+ ['usampler2D', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.UNSIGNED_INT_SAMPLER_2D, 1, false],
+ ['usampler3D', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.UNSIGNED_INT_SAMPLER_3D, 1, false],
+ ['usamplerCube', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.UNSIGNED_INT_SAMPLER_CUBE, 1, false],
+ ['usampler2DArray', '', 'highp', '', 'float(textureSize(uniformValue,0).r)', gl.UNSIGNED_INT_SAMPLER_2D_ARRAY, 1, false]
+ ];
+
+ var vertSource =
+ '#version 300 es\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = vec4(0.0);\n' +
+ '}\n';
+
+ var shaderVert = gl.createShader(gl.VERTEX_SHADER);
+ var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER);
+ var program = gl.createProgram();
+
+ gl.attachShader(program, shaderVert);
+ gl.attachShader(program, shaderFrag);
+
+ gl.shaderSource(shaderVert, vertSource);
+ gl.compileShader(shaderVert);
+
+ for (var ndx = 0; ndx < uniformTypes.length; ++ndx) {
+ var declaration = uniformTypes[ndx][0];
+ var postDeclaration = uniformTypes[ndx][1];
+ var precision = uniformTypes[ndx][2];
+ var layout = uniformTypes[ndx][3];
+ var getter = uniformTypes[ndx][4];
+ var type = uniformTypes[ndx][5];
+ var size = uniformTypes[ndx][6];
+ var isRowMajor = uniformTypes[ndx][7];
+ bufferedLogToConsole('Verify type of ' + declaration + ' variable' + postDeclaration);
+
+ // gen fragment shader
+
+ var frag = '';
+ frag += '#version 300 es\n';
+ frag += layout + 'uniform ' + precision + ' ' + declaration + ' uniformValue' + postDeclaration + ';\n';
+ frag += 'layout(location = 0) out mediump vec4 fragColor;\n';
+ frag += 'void main (void)\n';
+ frag += '{\n';
+ frag += ' fragColor = vec4(' + getter + ');\n';
+ frag += '}\n';
+
+ gl.shaderSource(shaderFrag, frag);
+
+ // compile & link
+
+ gl.compileShader(shaderFrag);
+ gl.linkProgram(program);
+
+ // test
+ if (this.check(glsStateQuery.verifyProgram(program, gl.LINK_STATUS, true), 'Program link fail' + gl.getProgramInfoLog(program))) {
+ var indices = gl.getUniformIndices(program, ['uniformValue']);
+ var info_type = gl.getActiveUniforms(program, indices, gl.UNIFORM_TYPE)[0];
+ var info_size = gl.getActiveUniforms(program, indices, gl.UNIFORM_SIZE)[0];
+ var info_is_row_major = gl.getActiveUniforms(program, indices, gl.UNIFORM_IS_ROW_MAJOR)[0];
+ this.check(glsStateQuery.compare(info_size, size));
+ this.check(glsStateQuery.compare(info_type, type));
+ this.check(glsStateQuery.compare(info_is_row_major, isRowMajor));
+ }
+ }
+
+ gl.deleteShader(shaderVert);
+ gl.deleteShader(shaderFrag);
+ gl.deleteProgram(program);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.ProgramActiveUniformBlocksCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.ProgramActiveUniformBlocksCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.ProgramActiveUniformBlocksCase.prototype.test = function() {
+ var testVertSource =
+ '#version 300 es\n' +
+ 'uniform longlongUniformBlockName {highp vec2 vector2;} longlongUniformInstanceName;\n' +
+ 'uniform shortUniformBlockName {highp vec2 vector2;highp vec4 vector4;} shortUniformInstanceName;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = shortUniformInstanceName.vector4 + vec4(longlongUniformInstanceName.vector2.x) + vec4(shortUniformInstanceName.vector2.x);\n' +
+ '}\n';
+ var testFragSource =
+ '#version 300 es\n' +
+ 'uniform longlongUniformBlockName {highp vec2 vector2;} longlongUniformInstanceName;\n' +
+ 'layout(location = 0) out mediump vec4 fragColor;' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' fragColor = vec4(longlongUniformInstanceName.vector2.y);\n' +
+ '}\n';
+
+ var shaderVert = gl.createShader(gl.VERTEX_SHADER);
+ var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER);
+
+ gl.shaderSource(shaderVert, testVertSource);
+ gl.shaderSource(shaderFrag, testFragSource);
+
+ gl.compileShader(shaderVert);
+ gl.compileShader(shaderFrag);
+
+ var program = gl.createProgram();
+ gl.attachShader(program, shaderVert);
+ gl.attachShader(program, shaderFrag);
+ gl.linkProgram(program);
+
+ this.check(glsStateQuery.verifyShader(shaderVert, gl.COMPILE_STATUS, true));
+ this.check(glsStateQuery.verifyShader(shaderFrag, gl.COMPILE_STATUS, true));
+ this.check(glsStateQuery.verifyProgram(program, gl.LINK_STATUS, true));
+
+ this.check(glsStateQuery.verifyProgram(program, gl.ACTIVE_UNIFORM_BLOCKS, 2));
+
+ var longlongUniformBlockIndex = gl.getUniformBlockIndex(program, 'longlongUniformBlockName');
+ var shortUniformBlockIndex = gl.getUniformBlockIndex(program, 'shortUniformBlockName');
+
+ var uniformNames = [
+ 'longlongUniformBlockName.vector2',
+ 'shortUniformBlockName.vector2',
+ 'shortUniformBlockName.vector4'
+ ];
+
+ // test UNIFORM_BLOCK_INDEX
+
+ var uniformIndices = gl.getUniformIndices(program, uniformNames);
+
+ var uniformsBlockIndices = gl.getActiveUniforms(program, uniformIndices, gl.UNIFORM_BLOCK_INDEX);
+ this.check(uniformsBlockIndices[0] == longlongUniformBlockIndex &&
+ uniformsBlockIndices[1] == shortUniformBlockIndex &&
+ uniformsBlockIndices[2] == shortUniformBlockIndex,
+ 'Expected [' + longlongUniformBlockIndex + ", " + shortUniformBlockIndex + ", " + shortUniformBlockIndex + ']; got ' +
+ uniformsBlockIndices[0] + ", " + uniformsBlockIndices[1] + ", " + uniformsBlockIndices[2] + "]");
+
+ // test UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER & UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER
+
+ this.check(glsStateQuery.verifyActiveUniformBlock(program, longlongUniformBlockIndex, gl.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER, true));
+ this.check(glsStateQuery.verifyActiveUniformBlock(program, longlongUniformBlockIndex, gl.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER, true));
+ this.check(glsStateQuery.verifyActiveUniformBlock(program, shortUniformBlockIndex, gl.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER, true));
+ this.check(glsStateQuery.verifyActiveUniformBlock(program, shortUniformBlockIndex, gl.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER, false));
+
+ // test UNIFORM_BLOCK_ACTIVE_UNIFORMS
+
+ this.check(glsStateQuery.verifyActiveUniformBlock(program, longlongUniformBlockIndex, gl.UNIFORM_BLOCK_ACTIVE_UNIFORMS, 1));
+ this.check(glsStateQuery.verifyActiveUniformBlock(program, shortUniformBlockIndex, gl.UNIFORM_BLOCK_ACTIVE_UNIFORMS, 2));
+
+ // test UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES
+
+ var shortUniformBlockIndices = gl.getActiveUniformBlockParameter(program, shortUniformBlockIndex, gl.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES);
+ this.check(shortUniformBlockIndices.length == 2, 'Expected 2 indices; got ' + shortUniformBlockIndices.length);
+
+ this.check(glsStateQuery.compare(shortUniformBlockIndices, new Uint32Array([uniformIndices[1], uniformIndices[2]])) ||
+ glsStateQuery.compare(shortUniformBlockIndices, new Uint32Array([uniformIndices[2], uniformIndices[1]])),
+ 'Expected { ' + uniformIndices[1] +', ' + uniformIndices[2] +
+ '}; got {' + shortUniformBlockIndices[0] + ', ' + shortUniformBlockIndices[1] + '}');
+
+ // check block names
+
+ var name = gl.getActiveUniformBlockName(program, longlongUniformBlockIndex);
+ this.check(name == "longlongUniformBlockName", 'Wrong uniform block name, expected longlongUniformBlockName; got ' + name);
+ name = gl.getActiveUniformBlockName(program, shortUniformBlockIndex)
+ this.check(name == "shortUniformBlockName", 'Wrong uniform block name, expected shortUniformBlockName; got ' + name);
+
+ gl.deleteShader(shaderVert);
+ gl.deleteShader(shaderFrag);
+ gl.deleteProgram(program);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.TransformFeedbackCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.TransformFeedbackCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.TransformFeedbackCase.prototype.test = function() {
+ var transformFeedbackTestVertSource =
+ '#version 300 es\n' +
+ 'out highp vec4 tfOutput2withLongName;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = vec4(0.0);\n' +
+ ' tfOutput2withLongName = vec4(0.0);\n' +
+ '}\n';
+ var transformFeedbackTestFragSource =
+ '#version 300 es\n' +
+ 'layout(location = 0) out highp vec4 fragColor;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' fragColor = vec4(0.0);\n' +
+ '}\n';
+
+ var shaderVert = gl.createShader(gl.VERTEX_SHADER);
+ var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER);
+ var shaderProg = gl.createProgram();
+
+ this.check(glsStateQuery.verifyProgram(shaderProg, gl.TRANSFORM_FEEDBACK_BUFFER_MODE, gl.INTERLEAVED_ATTRIBS));
+
+ gl.shaderSource(shaderVert, transformFeedbackTestVertSource);
+ gl.shaderSource(shaderFrag, transformFeedbackTestFragSource);
+
+ gl.compileShader(shaderVert);
+ gl.compileShader(shaderFrag);
+
+ this.check(glsStateQuery.verifyShader(shaderVert, gl.COMPILE_STATUS, true));
+ this.check(glsStateQuery.verifyShader(shaderFrag, gl.COMPILE_STATUS, true));
+
+ gl.attachShader(shaderProg, shaderVert);
+ gl.attachShader(shaderProg, shaderFrag);
+
+ // check TRANSFORM_FEEDBACK_BUFFER_MODE
+
+ var transform_feedback_outputs = ['gl_Position', 'tfOutput2withLongName'];
+ var bufferModes = [gl.SEPARATE_ATTRIBS, gl.INTERLEAVED_ATTRIBS];
+
+ for (var ndx = 0; ndx < bufferModes.length; ++ndx) {
+ gl.transformFeedbackVaryings(shaderProg, transform_feedback_outputs, bufferModes[ndx]);
+ gl.linkProgram(shaderProg);
+
+ this.check(glsStateQuery.verifyProgram(shaderProg, gl.LINK_STATUS, true));
+ this.check(glsStateQuery.verifyProgram(shaderProg, gl.TRANSFORM_FEEDBACK_BUFFER_MODE, bufferModes[ndx]));
+ }
+
+ // check varyings
+ var varyings = /** @type {number} */ (gl.getProgramParameter(shaderProg, gl.TRANSFORM_FEEDBACK_VARYINGS));
+ this.check(varyings === 2);
+
+ for (var index = 0; index < varyings; ++index) {
+ var info = gl.getTransformFeedbackVarying(shaderProg, index);
+ this.check(glsStateQuery.compare(info.type, gl.FLOAT_VEC4));
+ this.check(glsStateQuery.compare(info.size, 1));
+ this.check(glsStateQuery.compare(info.name, transform_feedback_outputs[index]));
+ }
+
+ gl.deleteShader(shaderVert);
+ gl.deleteShader(shaderFrag);
+ gl.deleteProgram(shaderProg);
+
+ // TODO(kbr): this test is failing and leaving an error in the GL
+ // state, causing later tests to fail. Clear the error state for
+ // the time being.
+ while (gl.getError() != gl.NO_ERROR) {}
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.ActiveAttributesCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.ActiveAttributesCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.ActiveAttributesCase.prototype.test = function() {
+ var testVertSource =
+ '#version 300 es\n' +
+ 'in highp vec2 longInputAttributeName;\n' +
+ 'in highp vec2 shortName;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = longInputAttributeName.yxxy + shortName.xyxy;\n' +
+ '}\n';
+ var testFragSource =
+ '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 fragColor;' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' fragColor = vec4(0.0);\n' +
+ '}\n';
+
+ var shaderVert = gl.createShader(gl.VERTEX_SHADER);
+ var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER);
+
+ gl.shaderSource(shaderVert, testVertSource);
+ gl.shaderSource(shaderFrag, testFragSource);
+
+ gl.compileShader(shaderVert);
+ gl.compileShader(shaderFrag);
+
+ var program = gl.createProgram();
+ gl.attachShader(program, shaderVert);
+ gl.attachShader(program, shaderFrag);
+ gl.linkProgram(program);
+
+ this.check(glsStateQuery.verifyProgram(program, gl.ACTIVE_ATTRIBUTES, 2));
+
+ var attribNames = [
+ 'longInputAttributeName',
+ 'shortName'
+ ];
+ // check names
+ for (var attributeNdx = 0; attributeNdx < 2; ++attributeNdx) {
+ var info = gl.getActiveAttrib(program, attributeNdx);
+ this.check(glsStateQuery.compare(info.name, attribNames[0]) || glsStateQuery.compare(info.name, attribNames[1]));
+ }
+
+ gl.deleteShader(shaderVert);
+ gl.deleteShader(shaderFrag);
+ gl.deleteProgram(program);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.VertexAttributeSizeCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.VertexAttributeSizeCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.VertexAttributeSizeCase.prototype.test = function() {
+ var pointers = [
+ // size test
+ [4, gl.FLOAT, 0, false, 0],
+ [3, gl.FLOAT, 0, false, 0],
+ [2, gl.FLOAT, 0, false, 0],
+ [1, gl.FLOAT, 0, false, 0],
+ [4, gl.INT, 0, false, 0],
+ [3, gl.INT, 0, false, 0],
+ [2, gl.INT, 0, false, 0],
+ [1, gl.INT, 0, false, 0]
+ ];
+
+ var buf = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buf);
+
+ // Test with default VAO
+
+ for (var ndx = 0; ndx < pointers.length; ++ndx) {
+ gl.vertexAttribPointer(0, pointers[ndx][0], pointers[ndx][1], pointers[ndx][3], pointers[ndx][2], pointers[ndx][4]);
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_SIZE, pointers[ndx][0]));
+ }
+
+ // Test with multiple VAOs
+ var vao0 = gl.createVertexArray();
+ var vao1 = gl.createVertexArray();
+
+ // initial
+ gl.bindVertexArray(vao0);
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_SIZE, 4));
+
+ // set vao 0 to some value
+ gl.vertexAttribPointer(0, pointers[0][0], pointers[0][1], pointers[0][3], pointers[0][2], 0);
+
+ // set vao 1 to some other value
+ gl.bindVertexArray(vao1);
+ gl.vertexAttribPointer(0, pointers[1][0], pointers[1][1], pointers[1][3], pointers[1][2], 0);
+
+ // verify vao 1 state
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_SIZE, pointers[1][0]));
+
+ // verify vao 0 state
+ gl.bindVertexArray(vao0);
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_SIZE, pointers[0][0]));
+
+ gl.deleteVertexArray(vao0);
+ gl.deleteVertexArray(vao1);
+ gl.deleteBuffer(buf);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.VertexAttributeTypeCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.VertexAttributeTypeCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.VertexAttributeTypeCase.prototype.test = function() {
+ var pointers = [
+ // type test
+ [1, gl.BYTE, 0, false, 0],
+ [1, gl.SHORT, 0, false, 0],
+ [1, gl.INT, 0, false, 0],
+ [1, gl.FLOAT, 0, false, 0],
+ [1, gl.HALF_FLOAT, 0, false, 0],
+ [1, gl.UNSIGNED_BYTE, 0, false, 0],
+ [1, gl.UNSIGNED_SHORT, 0, false, 0],
+ [1, gl.UNSIGNED_INT, 0, false, 0],
+ [4, gl.INT_2_10_10_10_REV, 0, false, 0],
+ [4, gl.UNSIGNED_INT_2_10_10_10_REV, 0, false, 0]
+ ];
+
+ var buf = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buf);
+
+ // Test with default VAO
+
+ for (var ndx = 0; ndx < pointers.length; ++ndx) {
+ gl.vertexAttribPointer(0, pointers[ndx][0], pointers[ndx][1], pointers[ndx][3], pointers[ndx][2], pointers[ndx][4]);
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_TYPE, pointers[ndx][1]));
+ }
+
+ var pointersI = [
+ [1, gl.BYTE, 0, false, 0],
+ [1, gl.SHORT, 0, false, 0],
+ [1, gl.INT, 0, false, 0],
+ [1, gl.UNSIGNED_BYTE, 0, false, 0],
+ [1, gl.UNSIGNED_SHORT, 0, false, 0],
+ [1, gl.UNSIGNED_INT, 0, false, 0]
+ ];
+
+ for (var ndx = 0; ndx < pointersI.length; ++ndx) {
+ gl.vertexAttribIPointer(0, pointersI[ndx][0], pointersI[ndx][1], pointersI[ndx][2], pointersI[ndx][4]);
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_TYPE, pointersI[ndx][1]));
+ }
+
+ // Test with multiple VAOs
+ var vao0 = gl.createVertexArray();
+ var vao1 = gl.createVertexArray();
+
+ // initial
+ gl.bindVertexArray(vao0);
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_TYPE, gl.FLOAT));
+
+ // set vao 0 to some value
+ gl.vertexAttribPointer(0, 1, gl.FLOAT, false, 0, 0);
+
+ // set vao 1 to some other value
+ gl.bindVertexArray(vao1);
+ gl.vertexAttribPointer(0, 1, gl.SHORT, false, 0, 0);
+
+ // verify vao 1 state
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_TYPE, gl.SHORT));
+
+ // verify vao 0 state
+ gl.bindVertexArray(vao0);
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_TYPE, gl.FLOAT));
+
+ gl.deleteVertexArray(vao0);
+ gl.deleteVertexArray(vao1);
+ gl.deleteBuffer(buf);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.VertexAttributeStrideCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.VertexAttributeStrideCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.VertexAttributeStrideCase.prototype.test = function() {
+ var pointers = [
+ [1, gl.FLOAT, 0, 0, gl.NO_ERROR],
+ [1, gl.FLOAT, 1, 0, gl.INVALID_OPERATION],
+ [1, gl.FLOAT, 4, 0, gl.NO_ERROR],
+ [1, gl.HALF_FLOAT, 0, 0, gl.NO_ERROR],
+ [1, gl.HALF_FLOAT, 1, 0, gl.INVALID_OPERATION],
+ [1, gl.HALF_FLOAT, 4, 0, gl.NO_ERROR]
+ ];
+
+ var buf = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buf);
+
+ // Test with default VAO
+
+ for (var ndx = 0; ndx < pointers.length; ++ndx) {
+ gl.vertexAttribPointer(0, pointers[ndx][0], pointers[ndx][1], false, pointers[ndx][2], pointers[ndx][3]);
+ this.expectError(pointers[ndx][4]);
+ if (pointers[ndx][4] == gl.NO_ERROR) {
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_STRIDE, pointers[ndx][2]));
+ }
+ }
+
+ var pointersI = [
+ [1, gl.INT, 0, 0, gl.NO_ERROR],
+ [1, gl.INT, 1, 0, gl.INVALID_OPERATION],
+ [1, gl.INT, 4, 0, gl.NO_ERROR],
+ [4, gl.UNSIGNED_BYTE, 0, 0, gl.NO_ERROR],
+ [4, gl.UNSIGNED_BYTE, 1, 0, gl.NO_ERROR],
+ [4, gl.UNSIGNED_BYTE, 4, 0, gl.NO_ERROR],
+ [2, gl.SHORT, 0, 0, gl.NO_ERROR],
+ [2, gl.SHORT, 1, 0, gl.INVALID_OPERATION],
+ [2, gl.SHORT, 4, 0, gl.NO_ERROR]
+ ];
+
+ for (var ndx = 0; ndx < pointersI.length; ++ndx) {
+ gl.vertexAttribIPointer(0, pointersI[ndx][0], pointersI[ndx][1], pointersI[ndx][2], pointersI[ndx][3]);
+ this.expectError(pointersI[ndx][4]);
+ if (pointersI[ndx][4] == gl.NO_ERROR) {
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_STRIDE, pointersI[ndx][2]));
+ }
+ }
+
+ // Test with multiple VAOs
+ var vao0 = gl.createVertexArray();
+ var vao1 = gl.createVertexArray();
+
+ // initial
+ gl.bindVertexArray(vao0);
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_STRIDE, 0));
+
+ // set vao 0 to some value
+ gl.vertexAttribPointer(0, 1, gl.FLOAT, false, 4, 0);
+
+ // set vao 1 to some other value
+ gl.bindVertexArray(vao1);
+ gl.vertexAttribPointer(0, 1, gl.SHORT, false, 8, 0);
+
+ // verify vao 1 state
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_STRIDE, 8));
+
+ // verify vao 0 state
+ gl.bindVertexArray(vao0);
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_STRIDE, 4));
+
+ gl.deleteVertexArray(vao0);
+ gl.deleteVertexArray(vao1);
+ gl.deleteBuffer(buf);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.VertexAttributeNormalizedCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.VertexAttributeNormalizedCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.VertexAttributeNormalizedCase.prototype.test = function() {
+ var pointers = [
+ // type test
+ [1, gl.BYTE, 0, false, 0],
+ [1, gl.SHORT, 0, false, 0],
+ [1, gl.INT, 0, false, 0],
+ [1, gl.FLOAT, 0, false, 0],
+ [1, gl.HALF_FLOAT, 0, false, 0],
+ [1, gl.UNSIGNED_BYTE, 0, false, 0],
+ [1, gl.UNSIGNED_SHORT, 0, false, 0],
+ [1, gl.UNSIGNED_INT, 0, false, 0],
+ [4, gl.INT_2_10_10_10_REV, 0, false, 0],
+ [4, gl.UNSIGNED_INT_2_10_10_10_REV, 0, false, 0],
+ [1, gl.BYTE, 0, true, 0],
+ [1, gl.SHORT, 0, true, 0],
+ [1, gl.INT, 0, true, 0],
+ [1, gl.FLOAT, 0, true, 0],
+ [1, gl.HALF_FLOAT, 0, true, 0],
+ [1, gl.UNSIGNED_BYTE, 0, true, 0],
+ [1, gl.UNSIGNED_SHORT, 0, true, 0],
+ [1, gl.UNSIGNED_INT, 0, true, 0],
+ [4, gl.INT_2_10_10_10_REV, 0, true, 0],
+ [4, gl.UNSIGNED_INT_2_10_10_10_REV, 0, true, 0]
+ ];
+
+ var buf = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buf);
+
+ // Test with default VAO
+
+ for (var ndx = 0; ndx < pointers.length; ++ndx) {
+ gl.vertexAttribPointer(0, pointers[ndx][0], pointers[ndx][1], pointers[ndx][3], pointers[ndx][2], pointers[ndx][4]);
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_NORMALIZED, pointers[ndx][3]));
+ }
+
+ var pointersI = [
+ [1, gl.BYTE, 0, false, 0],
+ [1, gl.SHORT, 0, false, 0],
+ [1, gl.INT, 0, false, 0],
+ [1, gl.UNSIGNED_BYTE, 0, false, 0],
+ [1, gl.UNSIGNED_SHORT, 0, false, 0],
+ [1, gl.UNSIGNED_INT, 0, false, 0]
+ ];
+
+ for (var ndx = 0; ndx < pointersI.length; ++ndx) {
+ gl.vertexAttribIPointer(0, pointersI[ndx][0], pointersI[ndx][1], pointersI[ndx][2], pointersI[ndx][4]);
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_NORMALIZED, false));
+ }
+
+ // Test with multiple VAOs
+ var vao0 = gl.createVertexArray();
+ var vao1 = gl.createVertexArray();
+
+ // initial
+ gl.bindVertexArray(vao0);
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_NORMALIZED, false));
+
+ // set vao 0 to some value
+ gl.vertexAttribPointer(0, 1, gl.INT, true, 0, 0);
+
+ // set vao 1 to some other value
+ gl.bindVertexArray(vao1);
+ gl.vertexAttribPointer(0, 1, gl.INT, false, 0, 0);
+
+ // verify vao 1 state
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_NORMALIZED, false));
+
+ // verify vao 0 state
+ gl.bindVertexArray(vao0);
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_NORMALIZED, true));
+
+ gl.deleteVertexArray(vao0);
+ gl.deleteVertexArray(vao1);
+ gl.deleteBuffer(buf);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.VertexAttributeIntegerCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.VertexAttributeIntegerCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.VertexAttributeIntegerCase.prototype.test = function() {
+ var pointers = [
+ // type test
+ [1, gl.BYTE, 0, false, 0],
+ [1, gl.SHORT, 0, false, 0],
+ [1, gl.INT, 0, false, 0],
+ [1, gl.FLOAT, 0, false, 0],
+ [1, gl.HALF_FLOAT, 0, false, 0],
+ [1, gl.UNSIGNED_BYTE, 0, false, 0],
+ [1, gl.UNSIGNED_SHORT, 0, false, 0],
+ [1, gl.UNSIGNED_INT, 0, false, 0],
+ [4, gl.INT_2_10_10_10_REV, 0, false, 0],
+ [4, gl.UNSIGNED_INT_2_10_10_10_REV, 0, false, 0]
+ ];
+
+ var buf = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buf);
+
+ // Test with default VAO
+
+ for (var ndx = 0; ndx < pointers.length; ++ndx) {
+ gl.vertexAttribPointer(0, pointers[ndx][0], pointers[ndx][1], pointers[ndx][3], pointers[ndx][2], pointers[ndx][4]);
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_INTEGER, false));
+ }
+
+ var pointersI = [
+ [1, gl.BYTE, 0, false, 0],
+ [1, gl.SHORT, 0, false, 0],
+ [1, gl.INT, 0, false, 0],
+ [1, gl.UNSIGNED_BYTE, 0, false, 0],
+ [1, gl.UNSIGNED_SHORT, 0, false, 0],
+ [1, gl.UNSIGNED_INT, 0, false, 0]
+ ];
+
+ for (var ndx = 0; ndx < pointersI.length; ++ndx) {
+ gl.vertexAttribIPointer(0, pointersI[ndx][0], pointersI[ndx][1], pointersI[ndx][2], pointersI[ndx][4]);
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_INTEGER, true));
+ }
+
+ // Test with multiple VAOs
+ var vao0 = gl.createVertexArray();
+ var vao1 = gl.createVertexArray();
+
+ // initial
+ gl.bindVertexArray(vao0);
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_INTEGER, false));
+
+ // set vao 0 to some value
+ gl.vertexAttribIPointer(0, 1, gl.INT, 0, 0);
+
+ // set vao 1 to some other value
+ gl.bindVertexArray(vao1);
+ gl.vertexAttribPointer(0, 1, gl.FLOAT, false, 0, 0);
+
+ // verify vao 1 state
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_INTEGER, false));
+
+ // verify vao 0 state
+ gl.bindVertexArray(vao0);
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_INTEGER, true));
+
+ gl.deleteVertexArray(vao0);
+ gl.deleteVertexArray(vao1);
+ gl.deleteBuffer(buf);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.VertexAttributeEnabledCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.VertexAttributeEnabledCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.VertexAttributeEnabledCase.prototype.test = function() {
+ // Test with default VAO
+
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_ENABLED, false));
+ gl.enableVertexAttribArray(0);
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_ENABLED, true));
+ gl.disableVertexAttribArray(0);
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_ENABLED, false));
+
+ // Test with multiple VAOs
+ var vao0 = gl.createVertexArray();
+ var vao1 = gl.createVertexArray();
+
+ // initial
+ gl.bindVertexArray(vao0);
+ // set vao 0 to some value
+ gl.enableVertexAttribArray(0);
+
+ // set vao 1 to some other value
+ gl.bindVertexArray(vao1);
+ gl.disableVertexAttribArray(0);
+
+ // verify vao 1 state
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_ENABLED, false));
+
+ // verify vao 0 state
+ gl.bindVertexArray(vao0);
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_ENABLED, true));
+
+ gl.deleteVertexArray(vao0);
+ gl.deleteVertexArray(vao1);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.VertexAttributeDivisorCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.VertexAttributeDivisorCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.VertexAttributeDivisorCase.prototype.test = function() {
+ // Test with default VAO
+
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_DIVISOR, 0));
+ gl.vertexAttribDivisor(0, 1);
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_DIVISOR, 1));
+ gl.vertexAttribDivisor(0, 5);
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_DIVISOR, 5));
+
+ // Test with multiple VAOs
+ var vao0 = gl.createVertexArray();
+ var vao1 = gl.createVertexArray();
+
+ // initial
+ gl.bindVertexArray(vao0);
+ // set vao 0 to some value
+ gl.vertexAttribDivisor(0, 1);
+
+ // set vao 1 to some other value
+ gl.bindVertexArray(vao1);
+ gl.vertexAttribDivisor(0, 5);
+
+ // verify vao 1 state
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_DIVISOR, 5));
+
+ // verify vao 0 state
+ gl.bindVertexArray(vao0);
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_DIVISOR, 1));
+
+ gl.deleteVertexArray(vao0);
+ gl.deleteVertexArray(vao1);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.VertexAttributeBufferBindingCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.VertexAttributeBufferBindingCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.VertexAttributeBufferBindingCase.prototype.test = function() {
+ // Test with default VAO
+
+ var buffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
+
+ gl.vertexAttribPointer(0, 4, gl.FLOAT, false, 0, 0);
+
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, buffer));
+
+ gl.deleteBuffer(buffer);
+
+ // Test with multiple VAOs
+ var vao0 = gl.createVertexArray();
+ var vao1 = gl.createVertexArray();
+ var buffer0 = gl.createBuffer();
+ var buffer1 = gl.createBuffer();
+
+ // initial
+ gl.bindVertexArray(vao0);
+ // set vao 0 to some value
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer0);
+ gl.vertexAttribPointer(0, 4, gl.FLOAT, false, 0, 0);
+
+ // set vao 1 to some other value
+ gl.bindVertexArray(vao1);
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer1);
+ gl.vertexAttribPointer(0, 4, gl.FLOAT, false, 0, 0);
+
+ // verify vao 1 state
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, buffer1));
+
+ // verify vao 0 state
+ gl.bindVertexArray(vao0);
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, buffer0));
+
+ gl.deleteVertexArray(vao0);
+ gl.deleteVertexArray(vao1);
+ gl.deleteBuffer(buffer0);
+ gl.deleteBuffer(buffer1);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.VertexAttributeOffsetCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.VertexAttributeOffsetCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.VertexAttributeOffsetCase.prototype.test = function() {
+ var pointers = [
+ [1, gl.BYTE, 0, false, 2 * 4],
+ [1, gl.SHORT, 0, false, 1 * 4],
+ [1, gl.INT, 0, false, 2 * 4],
+ [1, gl.FLOAT, 0, false, 0 * 4],
+ [1, gl.FLOAT, 0, false, 3 * 4],
+ [1, gl.FLOAT, 0, false, 2 * 4],
+ [1, gl.HALF_FLOAT, 0, false, 0 * 4],
+ [4, gl.HALF_FLOAT, 0, false, 1 * 4],
+ [4, gl.HALF_FLOAT, 0, false, 2 * 4]
+ ];
+
+ var buf = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buf);
+
+ // Test with default VAO
+
+ for (var ndx = 0; ndx < pointers.length; ++ndx) {
+ gl.vertexAttribPointer(0, pointers[ndx][0], pointers[ndx][1], pointers[ndx][3], pointers[ndx][2], pointers[ndx][4]);
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_POINTER, pointers[ndx][4]));
+ }
+
+ // Test with multiple VAOs
+ var vao0 = gl.createVertexArray();
+ var vao1 = gl.createVertexArray();
+
+ // initial
+ gl.bindVertexArray(vao0);
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_POINTER, 0));
+
+ // set vao 0 to some value
+ gl.vertexAttribPointer(0, 4, gl.FLOAT, false, 0, 8);
+
+ // set vao 1 to some other value
+ gl.bindVertexArray(vao1);
+ gl.vertexAttribPointer(0, 4, gl.FLOAT, false, 0, 4);
+
+ // verify vao 1 state
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_POINTER, 4));
+
+ // verify vao 0 state
+ gl.bindVertexArray(vao0);
+ this.check(glsStateQuery.verifyVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_POINTER, 8));
+
+ gl.deleteVertexArray(vao0);
+ gl.deleteVertexArray(vao1);
+ gl.deleteBuffer(buf);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.UniformValueFloatCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.UniformValueFloatCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.UniformValueFloatCase.prototype.test = function() {
+ var testVertSource =
+ '#version 300 es\n' +
+ 'uniform highp float floatUniform;\n' +
+ 'uniform highp vec2 float2Uniform;\n' +
+ 'uniform highp vec3 float3Uniform;\n' +
+ 'uniform highp vec4 float4Uniform;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = vec4(floatUniform + float2Uniform.x + float3Uniform.x + float4Uniform.x);\n' +
+ '}\n';
+ var testFragSource =
+ '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 fragColor;' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' fragColor = vec4(0.0);\n' +
+ '}\n';
+
+ var shaderVert = gl.createShader(gl.VERTEX_SHADER);
+ var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER);
+
+ gl.shaderSource(shaderVert, testVertSource);
+ gl.shaderSource(shaderFrag, testFragSource);
+
+ gl.compileShader(shaderVert);
+ gl.compileShader(shaderFrag);
+
+ var program = gl.createProgram();
+ gl.attachShader(program, shaderVert);
+ gl.attachShader(program, shaderFrag);
+ gl.linkProgram(program);
+ gl.useProgram(program);
+
+ var location;
+
+ location = gl.getUniformLocation(program, 'floatUniform');
+ gl.uniform1f(location, 1);
+ this.check(glsStateQuery.verifyUniform(program, location, 1));
+
+ location = gl.getUniformLocation(program, 'float2Uniform');
+ gl.uniform2f(location, 1, 2);
+ this.check(glsStateQuery.verifyUniform(program, location, new Float32Array([1, 2])));
+
+ location = gl.getUniformLocation(program, 'float3Uniform');
+ gl.uniform3f(location, 1, 2, 3);
+ this.check(glsStateQuery.verifyUniform(program, location, new Float32Array([1, 2, 3])));
+
+ location = gl.getUniformLocation(program, 'float4Uniform');
+ gl.uniform4f(location, 1, 2, 3, 4);
+ this.check(glsStateQuery.verifyUniform(program, location, new Float32Array([1, 2, 3, 4])));
+
+ gl.useProgram(null);
+ gl.deleteShader(shaderVert);
+ gl.deleteShader(shaderFrag);
+ gl.deleteProgram(program);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.UniformValueIntCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.UniformValueIntCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.UniformValueIntCase.prototype.test = function() {
+ var testVertSource =
+ '#version 300 es\n' +
+ 'uniform highp int intUniform;\n' +
+ 'uniform highp ivec2 int2Uniform;\n' +
+ 'uniform highp ivec3 int3Uniform;\n' +
+ 'uniform highp ivec4 int4Uniform;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = vec4(float(intUniform + int2Uniform.x + int3Uniform.x + int4Uniform.x));\n' +
+ '}\n';
+ var testFragSource =
+ '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 fragColor;' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' fragColor = vec4(0.0);\n' +
+ '}\n';
+
+ var shaderVert = gl.createShader(gl.VERTEX_SHADER);
+ var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER);
+
+ gl.shaderSource(shaderVert, testVertSource);
+ gl.shaderSource(shaderFrag, testFragSource);
+
+ gl.compileShader(shaderVert);
+ gl.compileShader(shaderFrag);
+
+ var program = gl.createProgram();
+ gl.attachShader(program, shaderVert);
+ gl.attachShader(program, shaderFrag);
+ gl.linkProgram(program);
+ gl.useProgram(program);
+
+ var location;
+
+ location = gl.getUniformLocation(program, 'intUniform');
+ gl.uniform1i(location, 1);
+ this.check(glsStateQuery.verifyUniform(program, location, 1));
+
+ location = gl.getUniformLocation(program, 'int2Uniform');
+ gl.uniform2i(location, 1, 2);
+ this.check(glsStateQuery.verifyUniform(program, location, new Int32Array([1, 2])));
+
+ location = gl.getUniformLocation(program, 'int3Uniform');
+ gl.uniform3i(location, 1, 2, 3);
+ this.check(glsStateQuery.verifyUniform(program, location, new Int32Array([1, 2, 3])));
+
+ location = gl.getUniformLocation(program, 'int4Uniform');
+ gl.uniform4i(location, 1, 2, 3, 4);
+ this.check(glsStateQuery.verifyUniform(program, location, new Int32Array([1, 2, 3, 4])));
+
+ gl.useProgram(null);
+ gl.deleteShader(shaderVert);
+ gl.deleteShader(shaderFrag);
+ gl.deleteProgram(program);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.UniformValueUintCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.UniformValueUintCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.UniformValueUintCase.prototype.test = function() {
+ var testVertSource =
+ '#version 300 es\n' +
+ 'uniform highp uint uintUniform;\n' +
+ 'uniform highp uvec2 uint2Uniform;\n' +
+ 'uniform highp uvec3 uint3Uniform;\n' +
+ 'uniform highp uvec4 uint4Uniform;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = vec4(float(uintUniform + uint2Uniform.x + uint3Uniform.x + uint4Uniform.x));\n' +
+ '}\n';
+ var testFragSource =
+ '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 fragColor;' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' fragColor = vec4(0.0);\n' +
+ '}\n';
+
+ var shaderVert = gl.createShader(gl.VERTEX_SHADER);
+ var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER);
+
+ gl.shaderSource(shaderVert, testVertSource);
+ gl.shaderSource(shaderFrag, testFragSource);
+
+ gl.compileShader(shaderVert);
+ gl.compileShader(shaderFrag);
+
+ var program = gl.createProgram();
+ gl.attachShader(program, shaderVert);
+ gl.attachShader(program, shaderFrag);
+ gl.linkProgram(program);
+ gl.useProgram(program);
+
+ var location;
+
+ location = gl.getUniformLocation(program, 'uintUniform');
+ gl.uniform1ui(location, 1);
+ this.check(glsStateQuery.verifyUniform(program, location, 1));
+
+ location = gl.getUniformLocation(program, 'uint2Uniform');
+ gl.uniform2ui(location, 1, 2);
+ this.check(glsStateQuery.verifyUniform(program, location, new Uint32Array([1, 2])));
+
+ location = gl.getUniformLocation(program, 'uint3Uniform');
+ gl.uniform3ui(location, 1, 2, 3);
+ this.check(glsStateQuery.verifyUniform(program, location, new Uint32Array([1, 2, 3])));
+
+ location = gl.getUniformLocation(program, 'uint4Uniform');
+ gl.uniform4ui(location, 1, 2, 3, 4);
+ this.check(glsStateQuery.verifyUniform(program, location, new Uint32Array([1, 2, 3, 4])));
+
+ gl.useProgram(null);
+ gl.deleteShader(shaderVert);
+ gl.deleteShader(shaderFrag);
+ gl.deleteProgram(program);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.UniformValueBooleanCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.UniformValueBooleanCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.UniformValueBooleanCase.prototype.test = function() {
+ var testVertSource =
+ '#version 300 es\n' +
+ 'uniform bool boolUniform;\n' +
+ 'uniform bvec2 bool2Uniform;\n' +
+ 'uniform bvec3 bool3Uniform;\n' +
+ 'uniform bvec4 bool4Uniform;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = vec4(float(boolUniform) + float(bool2Uniform.x) + float(bool3Uniform.x) + float(bool4Uniform.x));\n' +
+ '}\n';
+ var testFragSource =
+ '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 fragColor;' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' fragColor = vec4(0.0);\n' +
+ '}\n';
+
+ var shaderVert = gl.createShader(gl.VERTEX_SHADER);
+ var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER);
+
+ gl.shaderSource(shaderVert, testVertSource);
+ gl.shaderSource(shaderFrag, testFragSource);
+
+ gl.compileShader(shaderVert);
+ gl.compileShader(shaderFrag);
+
+ var program = gl.createProgram();
+ gl.attachShader(program, shaderVert);
+ gl.attachShader(program, shaderFrag);
+ gl.linkProgram(program);
+ gl.useProgram(program);
+
+ var location;
+
+ location = gl.getUniformLocation(program, 'boolUniform');
+ gl.uniform1i(location, 1);
+ this.check(glsStateQuery.verifyUniform(program, location, true));
+
+ location = gl.getUniformLocation(program, 'bool2Uniform');
+ gl.uniform2i(location, 1, 0);
+ this.check(glsStateQuery.verifyUniform(program, location, [true, false]));
+
+ location = gl.getUniformLocation(program, 'bool3Uniform');
+ gl.uniform3i(location, 1, 0, 1);
+ this.check(glsStateQuery.verifyUniform(program, location, [true, false, true]));
+
+ location = gl.getUniformLocation(program, 'bool4Uniform');
+ gl.uniform4i(location, 1, 0, 1, 0);
+ this.check(glsStateQuery.verifyUniform(program, location, [true, false, true, false]));
+
+ gl.useProgram(null);
+ gl.deleteShader(shaderVert);
+ gl.deleteShader(shaderFrag);
+ gl.deleteProgram(program);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.UniformValueSamplerCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.UniformValueSamplerCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.UniformValueSamplerCase.prototype.test = function() {
+ var testVertSource =
+ '#version 300 es\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = vec4(0.0);\n' +
+ '}\n';
+ var testFragSource =
+ '#version 300 es\n' +
+ 'uniform highp sampler2D uniformSampler;\n' +
+ 'layout(location = 0) out mediump vec4 fragColor;' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' fragColor = vec4(textureSize(uniformSampler, 0).x);\n' +
+ '}\n';
+
+ var shaderVert = gl.createShader(gl.VERTEX_SHADER);
+ var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER);
+
+ gl.shaderSource(shaderVert, testVertSource);
+ gl.shaderSource(shaderFrag, testFragSource);
+
+ gl.compileShader(shaderVert);
+ gl.compileShader(shaderFrag);
+
+ var program = gl.createProgram();
+ gl.attachShader(program, shaderVert);
+ gl.attachShader(program, shaderFrag);
+ gl.linkProgram(program);
+ gl.useProgram(program);
+
+ var location;
+
+ location = gl.getUniformLocation(program, 'uniformSampler');
+ gl.uniform1i(location, 1);
+ this.check(glsStateQuery.verifyUniform(program, location, 1));
+
+ gl.useProgram(null);
+ gl.deleteShader(shaderVert);
+ gl.deleteShader(shaderFrag);
+ gl.deleteProgram(program);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.UniformValueArrayCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.UniformValueArrayCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.UniformValueArrayCase.prototype.test = function() {
+ var testVertSource =
+ '#version 300 es\n' +
+ 'uniform highp float arrayUniform[5];' +
+ 'uniform highp vec2 array2Uniform[5];' +
+ 'uniform highp vec3 array3Uniform[5];' +
+ 'uniform highp vec4 array4Uniform[5];' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = \n' +
+ ' + vec4(arrayUniform[0] + arrayUniform[1] + arrayUniform[2] + arrayUniform[3] + arrayUniform[4])\n' +
+ ' + vec4(array2Uniform[0].x + array2Uniform[1].x + array2Uniform[2].x + array2Uniform[3].x + array2Uniform[4].x)\n' +
+ ' + vec4(array3Uniform[0].x + array3Uniform[1].x + array3Uniform[2].x + array3Uniform[3].x + array3Uniform[4].x)\n' +
+ ' + vec4(array4Uniform[0].x + array4Uniform[1].x + array4Uniform[2].x + array4Uniform[3].x + array4Uniform[4].x);\n' +
+ '}\n';
+ var testFragSource =
+ '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 fragColor;' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' fragColor = vec4(0.0);\n' +
+ '}\n';
+
+ var shaderVert = gl.createShader(gl.VERTEX_SHADER);
+ var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER);
+
+ gl.shaderSource(shaderVert, testVertSource);
+ gl.shaderSource(shaderFrag, testFragSource);
+
+ gl.compileShader(shaderVert);
+ gl.compileShader(shaderFrag);
+
+ var program = gl.createProgram();
+ gl.attachShader(program, shaderVert);
+ gl.attachShader(program, shaderFrag);
+ gl.linkProgram(program);
+ gl.useProgram(program);
+
+ var location;
+
+ var uniformValue = [
+ -1.0, 0.1, 4.0, 800.0,
+ 13.0, 55.0, 12.0, 91.0,
+ -55.1, 1.1, 98.0, 19.0,
+ 41.0, 65.0, 4.0, 12.2,
+ 95.0, 77.0, 32.0, 48.0
+ ];
+
+ location = gl.getUniformLocation(program, 'arrayUniform');
+ gl.uniform1fv(location, new Float32Array(uniformValue.slice(0, 5)));
+
+ this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'arrayUniform[0]'), uniformValue[0]));
+ this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'arrayUniform[1]'), uniformValue[1]));
+ this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'arrayUniform[2]'), uniformValue[2]));
+ this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'arrayUniform[3]'), uniformValue[3]));
+ this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'arrayUniform[4]'), uniformValue[4]));
+
+ location = gl.getUniformLocation(program, 'array2Uniform');
+ gl.uniform2fv(location, new Float32Array(uniformValue.slice(0, 10)));
+
+ this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array2Uniform[0]'), new Float32Array([uniformValue[2 * 0], uniformValue[(2 * 0) + 1]])));
+ this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array2Uniform[1]'), new Float32Array([uniformValue[2 * 1], uniformValue[(2 * 1) + 1]])));
+ this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array2Uniform[2]'), new Float32Array([uniformValue[2 * 2], uniformValue[(2 * 2) + 1]])));
+ this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array2Uniform[3]'), new Float32Array([uniformValue[2 * 3], uniformValue[(2 * 3) + 1]])));
+ this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array2Uniform[4]'), new Float32Array([uniformValue[2 * 4], uniformValue[(2 * 4) + 1]])));
+
+ location = gl.getUniformLocation(program, 'array3Uniform');
+ gl.uniform3fv(location, new Float32Array(uniformValue.slice(0, 15)));
+
+ this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array3Uniform[0]'), new Float32Array([uniformValue[3 * 0], uniformValue[(3 * 0) + 1], uniformValue[(3 * 0) + 2]])));
+ this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array3Uniform[1]'), new Float32Array([uniformValue[3 * 1], uniformValue[(3 * 1) + 1], uniformValue[(3 * 1) + 2]])));
+ this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array3Uniform[2]'), new Float32Array([uniformValue[3 * 2], uniformValue[(3 * 2) + 1], uniformValue[(3 * 2) + 2]])));
+ this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array3Uniform[3]'), new Float32Array([uniformValue[3 * 3], uniformValue[(3 * 3) + 1], uniformValue[(3 * 3) + 2]])));
+ this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array3Uniform[4]'), new Float32Array([uniformValue[3 * 4], uniformValue[(3 * 4) + 1], uniformValue[(3 * 4) + 2]])));
+
+ location = gl.getUniformLocation(program, 'array4Uniform');
+ gl.uniform4fv(location, new Float32Array(uniformValue));
+
+ this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array4Uniform[0]'), new Float32Array([uniformValue[4 * 0], uniformValue[(4 * 0) + 1], uniformValue[(4 * 0) + 2], uniformValue[(4 * 0) + 3]])));
+ this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array4Uniform[1]'), new Float32Array([uniformValue[4 * 1], uniformValue[(4 * 1) + 1], uniformValue[(4 * 1) + 2], uniformValue[(4 * 1) + 3]])));
+ this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array4Uniform[2]'), new Float32Array([uniformValue[4 * 2], uniformValue[(4 * 2) + 1], uniformValue[(4 * 2) + 2], uniformValue[(4 * 2) + 3]])));
+ this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array4Uniform[3]'), new Float32Array([uniformValue[4 * 3], uniformValue[(4 * 3) + 1], uniformValue[(4 * 3) + 2], uniformValue[(4 * 3) + 3]])));
+ this.check(glsStateQuery.verifyUniform(program, gl.getUniformLocation(program, 'array4Uniform[4]'), new Float32Array([uniformValue[4 * 4], uniformValue[(4 * 4) + 1], uniformValue[(4 * 4) + 2], uniformValue[(4 * 4) + 3]])));
+
+ gl.useProgram(null);
+ gl.deleteShader(shaderVert);
+ gl.deleteShader(shaderFrag);
+ gl.deleteProgram(program);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ */
+es3fShaderStateQueryTests.UniformValueMatrixCase = function(name, description) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+};
+
+setParentClass(es3fShaderStateQueryTests.UniformValueMatrixCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.UniformValueMatrixCase.prototype.test = function() {
+ var transpose = function(rows, cols, data) {
+ var matrix = tcuMatrix.matrixFromDataArray(rows, cols, data);
+ var result = [];
+ for (var col = 0; col < cols; col++)
+ result.push(matrix.getColumn(col));
+ return new Float32Array([].concat.apply([], result));
+ };
+
+ var testVertSource =
+ '#version 300 es\n' +
+ 'uniform highp mat2 mat2Uniform;' +
+ 'uniform highp mat3 mat3Uniform;' +
+ 'uniform highp mat4 mat4Uniform;' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = vec4(mat2Uniform[0][0] + mat3Uniform[0][0] + mat4Uniform[0][0]);\n' +
+ '}\n';
+ var testFragSource =
+ '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 fragColor;' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' fragColor = vec4(0.0);\n' +
+ '}\n';
+
+ var shaderVert = gl.createShader(gl.VERTEX_SHADER);
+ var shaderFrag = gl.createShader(gl.FRAGMENT_SHADER);
+
+ gl.shaderSource(shaderVert, testVertSource);
+ gl.shaderSource(shaderFrag, testFragSource);
+
+ gl.compileShader(shaderVert);
+ gl.compileShader(shaderFrag);
+
+ var program = gl.createProgram();
+ gl.attachShader(program, shaderVert);
+ gl.attachShader(program, shaderFrag);
+ gl.linkProgram(program);
+ gl.useProgram(program);
+
+ var location;
+
+ var matrixValues = [
+ -1.0, 0.1, 4.0, 800.0,
+ 13.0, 55.0, 12.0, 91.0,
+ -55.1, 1.1, 98.0, 19.0,
+ 41.0, 65.0, 4.0, 12.0
+ ];
+
+ // the values of the matrix are returned in column major order but they can be given in either order
+
+ location = gl.getUniformLocation(program, 'mat2Uniform');
+ var m2 = new Float32Array(matrixValues.slice(0, 2 * 2));
+ gl.uniformMatrix2fv(location, false, m2);
+ this.check(glsStateQuery.verifyUniform(program, location, m2));
+ gl.uniformMatrix2fv(location, true, m2);
+ this.check(glsStateQuery.verifyUniform(program, location, transpose(2, 2, m2)));
+
+ location = gl.getUniformLocation(program, 'mat3Uniform');
+ var m3 = new Float32Array(matrixValues.slice(0, 3 * 3));
+ gl.uniformMatrix3fv(location, false, m3);
+ this.check(glsStateQuery.verifyUniform(program, location, m3));
+ gl.uniformMatrix3fv(location, true, m3);
+ this.check(glsStateQuery.verifyUniform(program, location, transpose(3, 3, m3)));
+
+ location = gl.getUniformLocation(program, 'mat4Uniform');
+ var m4 = new Float32Array(matrixValues.slice(0, 4 * 4));
+ gl.uniformMatrix4fv(location, false, m4);
+ this.check(glsStateQuery.verifyUniform(program, location, m4));
+ gl.uniformMatrix4fv(location, true, m4);
+ this.check(glsStateQuery.verifyUniform(program, location, transpose(4, 4, m4)));
+
+ gl.useProgram(null);
+ gl.deleteShader(shaderVert);
+ gl.deleteShader(shaderFrag);
+ gl.deleteProgram(program);
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} shaderType
+ * @param {number} precisionType
+ */
+es3fShaderStateQueryTests.PrecisionFormatCase = function(name, description, shaderType, precisionType) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ this.m_shaderType = shaderType;
+ this.m_precisionType = precisionType;
+};
+
+setParentClass(es3fShaderStateQueryTests.PrecisionFormatCase, es3fApiCase.ApiCase);
+
+es3fShaderStateQueryTests.PrecisionFormatCase.prototype.test = function() {
+ var requirements = {};
+ requirements[gl.LOW_FLOAT] = [0, 0, 8];
+ requirements[gl.MEDIUM_FLOAT] = [13, 13, 10];
+ requirements[gl.HIGH_FLOAT] = [127, 127, 23];
+ requirements[gl.LOW_INT] = [8, 7, 0];
+ requirements[gl.MEDIUM_INT] = [15, 14, 0];
+ requirements[gl.HIGH_INT] = [31, 30, 0];
+
+
+ var expected = requirements[this.m_precisionType];
+ var result = gl.getShaderPrecisionFormat(this.m_shaderType, this.m_precisionType);
+
+ bufferedLogToConsole('Precision:' +
+ ' range min = ' + result.rangeMin +
+ ' range max = ' + result.rangeMax +
+ ' precision = ' + result.precision);
+
+ if (this.m_precisionType == gl.HIGH_FLOAT) {
+ // highp float must be IEEE 754 single
+
+ this.check(result.rangeMin == expected[0] ||
+ result.rangeMax == expected[1] ||
+ result.precision == expected[2],
+ 'Invalid precision format, expected:' +
+ ' range min = ' + expected[0] +
+ ' range max = ' + expected[1] +
+ ' precision = ' + expected[2]);
+ } else{
+ this.check(result.rangeMin >= expected[0] ||
+ result.rangeMax >= expected[1] ||
+ result.precision >= expected[2],
+ 'Invalid precision format, expected:' +
+ ' range min >= ' + expected[0] +
+ ' range max >= ' + expected[1] +
+ ' precision >= ' + expected[2]);
+ }
+};
+
+/**
+* @constructor
+* @extends {tcuTestCase.DeqpTest}
+*/
+es3fShaderStateQueryTests.ShaderStateQueryTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'shader', 'Shader State Query tests');
+};
+
+es3fShaderStateQueryTests.ShaderStateQueryTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+es3fShaderStateQueryTests.ShaderStateQueryTests.prototype.constructor = es3fShaderStateQueryTests.ShaderStateQueryTests;
+
+es3fShaderStateQueryTests.ShaderStateQueryTests.prototype.init = function() {
+ // shader
+ this.addChild(new es3fShaderStateQueryTests.ShaderTypeCase('shader_type', 'SHADER_TYPE'));
+ this.addChild(new es3fShaderStateQueryTests.ShaderCompileStatusCase('shader_compile_status', 'COMPILE_STATUS'));
+ this.addChild(new es3fShaderStateQueryTests.ShaderInfoLogCase('shader_info_log', 'INFO_LOG'));
+ this.addChild(new es3fShaderStateQueryTests.ShaderSourceCase('shader_source', 'SHADER_SOURCE'));
+
+ // shader and program
+ this.addChild(new es3fShaderStateQueryTests.DeleteStatusCase('delete_status', 'DELETE_STATUS'));
+
+ // // vertex-attrib
+ this.addChild(new es3fShaderStateQueryTests.CurrentVertexAttribInitialCase('current_vertex_attrib_initial', 'CURRENT_VERTEX_ATTRIB'));
+ this.addChild(new es3fShaderStateQueryTests.CurrentVertexAttribFloatCase('current_vertex_attrib_float', 'CURRENT_VERTEX_ATTRIB'));
+ this.addChild(new es3fShaderStateQueryTests.CurrentVertexAttribIntCase('current_vertex_attrib_int', 'CURRENT_VERTEX_ATTRIB'));
+ this.addChild(new es3fShaderStateQueryTests.CurrentVertexAttribUintCase('current_vertex_attrib_uint', 'CURRENT_VERTEX_ATTRIB'));
+
+ // // program
+ this.addChild(new es3fShaderStateQueryTests.ProgramInfoLogCase('program_info_log', 'INFO_LOG'));
+ this.addChild(new es3fShaderStateQueryTests.ProgramValidateStatusCase('program_validate_status', 'VALIDATE_STATUS'));
+ this.addChild(new es3fShaderStateQueryTests.ProgramAttachedShadersCase('program_attached_shaders', 'ATTACHED_SHADERS'));
+
+ this.addChild(new es3fShaderStateQueryTests.ProgramActiveUniformNameCase('program_active_uniform_name', 'ACTIVE_UNIFORMS'));
+ this.addChild(new es3fShaderStateQueryTests.ProgramUniformCase('program_active_uniform_types', 'UNIFORM_TYPE, UNIFORM_SIZE, and UNIFORM_IS_ROW_MAJOR'));
+ this.addChild(new es3fShaderStateQueryTests.ProgramActiveUniformBlocksCase ("program_active_uniform_blocks", "ACTIVE_UNIFORM_BLOCK_x"));
+
+ // transform feedback
+ this.addChild(new es3fShaderStateQueryTests.TransformFeedbackCase('transform_feedback', 'TRANSFORM_FEEDBACK_BUFFER_MODE, TRANSFORM_FEEDBACK_VARYINGS, TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH'));
+
+ // attribute related
+ this.addChild(new es3fShaderStateQueryTests.ActiveAttributesCase('active_attributes', 'ACTIVE_ATTRIBUTES and ACTIVE_ATTRIBUTE_MAX_LENGTH'));
+ this.addChild(new es3fShaderStateQueryTests.VertexAttributeSizeCase('vertex_attrib_size', 'VERTEX_ATTRIB_ARRAY_SIZE'));
+ this.addChild(new es3fShaderStateQueryTests.VertexAttributeTypeCase('vertex_attrib_type', 'VERTEX_ATTRIB_ARRAY_TYPE'));
+ this.addChild(new es3fShaderStateQueryTests.VertexAttributeStrideCase('vertex_attrib_stride', 'VERTEX_ATTRIB_ARRAY_STRIDE'));
+ this.addChild(new es3fShaderStateQueryTests.VertexAttributeNormalizedCase('vertex_attrib_normalized', 'VERTEX_ATTRIB_ARRAY_NORMALIZED'));
+ this.addChild(new es3fShaderStateQueryTests.VertexAttributeIntegerCase('vertex_attrib_integer', 'VERTEX_ATTRIB_ARRAY_INTEGER'));
+ this.addChild(new es3fShaderStateQueryTests.VertexAttributeEnabledCase('vertex_attrib_array_enabled', 'VERTEX_ATTRIB_ARRAY_ENABLED'));
+ this.addChild(new es3fShaderStateQueryTests.VertexAttributeDivisorCase('vertex_attrib_array_divisor', 'VERTEX_ATTRIB_ARRAY_DIVISOR'));
+ this.addChild(new es3fShaderStateQueryTests.VertexAttributeBufferBindingCase('vertex_attrib_array_buffer_binding', 'VERTEX_ATTRIB_ARRAY_BUFFER_BINDING'));
+ this.addChild(new es3fShaderStateQueryTests.VertexAttributeOffsetCase('vertex_attrib_offset', 'VERTEX_ATTRIB_ARRAY_POINTER'));
+
+ // uniform values
+ this.addChild(new es3fShaderStateQueryTests.UniformValueFloatCase('uniform_value_float', 'GetUniform*'));
+ this.addChild(new es3fShaderStateQueryTests.UniformValueIntCase('uniform_value_int', 'GetUniform*'));
+ this.addChild(new es3fShaderStateQueryTests.UniformValueUintCase('uniform_value_uint', 'GetUniform*'));
+ this.addChild(new es3fShaderStateQueryTests.UniformValueBooleanCase('uniform_value_boolean', 'GetUniform*'));
+ this.addChild(new es3fShaderStateQueryTests.UniformValueSamplerCase('uniform_value_sampler', 'GetUniform*'));
+ this.addChild(new es3fShaderStateQueryTests.UniformValueArrayCase('uniform_value_array', 'GetUniform*'));
+ this.addChild(new es3fShaderStateQueryTests.UniformValueMatrixCase('uniform_value_matrix', 'GetUniform*'));
+
+ // precision format query
+ this.addChild(new es3fShaderStateQueryTests.PrecisionFormatCase('precision_vertex_lowp_float', 'GetShaderPrecisionFormat', gl.VERTEX_SHADER, gl.LOW_FLOAT));
+ this.addChild(new es3fShaderStateQueryTests.PrecisionFormatCase('precision_vertex_mediump_float', 'GetShaderPrecisionFormat', gl.VERTEX_SHADER, gl.MEDIUM_FLOAT));
+ this.addChild(new es3fShaderStateQueryTests.PrecisionFormatCase('precision_vertex_highp_float', 'GetShaderPrecisionFormat', gl.VERTEX_SHADER, gl.HIGH_FLOAT));
+ this.addChild(new es3fShaderStateQueryTests.PrecisionFormatCase('precision_vertex_lowp_int', 'GetShaderPrecisionFormat', gl.VERTEX_SHADER, gl.LOW_INT));
+ this.addChild(new es3fShaderStateQueryTests.PrecisionFormatCase('precision_vertex_mediump_int', 'GetShaderPrecisionFormat', gl.VERTEX_SHADER, gl.MEDIUM_INT));
+ this.addChild(new es3fShaderStateQueryTests.PrecisionFormatCase('precision_vertex_highp_int', 'GetShaderPrecisionFormat', gl.VERTEX_SHADER, gl.HIGH_INT));
+ this.addChild(new es3fShaderStateQueryTests.PrecisionFormatCase('precision_fragment_lowp_float', 'GetShaderPrecisionFormat', gl.FRAGMENT_SHADER, gl.LOW_FLOAT));
+ this.addChild(new es3fShaderStateQueryTests.PrecisionFormatCase('precision_fragment_mediump_float', 'GetShaderPrecisionFormat', gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT));
+ this.addChild(new es3fShaderStateQueryTests.PrecisionFormatCase('precision_fragment_highp_float', 'GetShaderPrecisionFormat', gl.FRAGMENT_SHADER, gl.HIGH_FLOAT));
+ this.addChild(new es3fShaderStateQueryTests.PrecisionFormatCase('precision_fragment_lowp_int', 'GetShaderPrecisionFormat', gl.FRAGMENT_SHADER, gl.LOW_INT));
+ this.addChild(new es3fShaderStateQueryTests.PrecisionFormatCase('precision_fragment_mediump_int', 'GetShaderPrecisionFormat', gl.FRAGMENT_SHADER, gl.MEDIUM_INT));
+ this.addChild(new es3fShaderStateQueryTests.PrecisionFormatCase('precision_fragment_highp_int', 'GetShaderPrecisionFormat', gl.FRAGMENT_SHADER, gl.HIGH_INT));
+};
+
+/**
+* Run test
+* @param {WebGL2RenderingContext} context
+*/
+es3fShaderStateQueryTests.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fShaderStateQueryTests.ShaderStateQueryTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fShaderStateQueryTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderStructTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderStructTests.js
new file mode 100644
index 0000000000..3c23545d75
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderStructTests.js
@@ -0,0 +1,1957 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fShaderStructTests');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.delibs.debase.deMath');
+// goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluTexture');
+goog.require('modules.shared.glsShaderRenderCase');
+goog.require('framework.common.tcuStringTemplate');
+
+goog.scope(function() {
+ var es3fShaderStructTests = functional.gles3.es3fShaderStructTests;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var tcuTexture = framework.common.tcuTexture;
+ var tcuTextureUtil = framework.common.tcuTextureUtil;
+ var deMath = framework.delibs.debase.deMath;
+ // var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var glsShaderRenderCase = modules.shared.glsShaderRenderCase;
+ var gluTexture = framework.opengl.gluTexture;
+ var tcuStringTemplate = framework.common.tcuStringTemplate;
+
+ /** @typedef {function(WebGLProgram, Array<number>)} */
+ es3fShaderStructTests.SetupUniformsFunc;
+
+ /** @const {number} */ es3fShaderStructTests.TEXTURE_BRICK = 0;
+
+
+ /**
+ * @constructor
+ * @extends {glsShaderRenderCase.ShaderRenderCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {boolean} isVertexCase
+ * @param {boolean} usesTextures
+ * @param {glsShaderRenderCase.ShaderEvalFunc} evalFunc
+ * @param {?es3fShaderStructTests.SetupUniformsFunc} setupUniformsFunc
+ * @param {string} vertShaderSource
+ * @param {string} fragShaderSource
+ */
+ es3fShaderStructTests.ShaderStructCase = function(name, description, isVertexCase, usesTextures, evalFunc, setupUniformsFunc, vertShaderSource, fragShaderSource) {
+ glsShaderRenderCase.ShaderRenderCase.call(this, name, description, isVertexCase, evalFunc);
+ /** @type {?es3fShaderStructTests.SetupUniformsFunc} */ this.m_setupUniforms = setupUniformsFunc;
+ /** @type {boolean} */ this.m_usesTexture = usesTextures;
+ /** @type {gluTexture.Texture2D} */ this.m_brickTexture = null;
+ /** @type {string} */ this.m_vertShaderSource = vertShaderSource;
+ /** @type {string} */ this.m_fragShaderSource = fragShaderSource;
+ };
+
+ es3fShaderStructTests.ShaderStructCase.prototype = Object.create(glsShaderRenderCase.ShaderRenderCase.prototype);
+ es3fShaderStructTests.ShaderStructCase.prototype.constructor = es3fShaderStructTests.ShaderStructCase;
+
+ es3fShaderStructTests.ShaderStructCase.prototype.init = function() {
+ if (this.m_usesTexture) {
+ this.m_brickTexture = gluTexture.texture2DFromInternalFormat(gl, gl.RGBA8, 256, 256);
+ var ref = this.m_brickTexture.getRefTexture();
+ for (var i = 0 ; i < ref.getNumLevels(); i++) {
+ ref.allocLevel(i);
+ tcuTextureUtil.fillWithGrid(ref.getLevel(i), 8, [0.2, 0.7, 0.1, 1.0], [0.7, 0.1, 0.5, 0.8]);
+ }
+ this.m_brickTexture.upload();
+
+ this.m_textures.push(new glsShaderRenderCase.TextureBinding(
+ this.m_brickTexture,
+ new tcuTexture.Sampler(
+ tcuTexture.WrapMode.CLAMP_TO_EDGE,
+ tcuTexture.WrapMode.CLAMP_TO_EDGE,
+ tcuTexture.WrapMode.CLAMP_TO_EDGE,
+ tcuTexture.FilterMode.LINEAR,
+ tcuTexture.FilterMode.LINEAR)));
+
+ assertMsgOptions(this.m_textures.length === 1, 'Only one texture required', false, true);
+ }
+ this.postinit();
+ };
+
+ es3fShaderStructTests.ShaderStructCase.prototype.deinit = function() {
+ glsShaderRenderCase.ShaderRenderCase.prototype.deinit.call(this);
+ this.m_brickTexture = null;
+ };
+
+ /**
+ * @param {WebGLProgram} programID
+ * @param {Array<number>} constCoords
+ */
+ es3fShaderStructTests.ShaderStructCase.prototype.setupUniforms = function(programID, constCoords) {
+ glsShaderRenderCase.ShaderRenderCase.prototype.setupUniforms.call(this, programID, constCoords);
+ if (this.m_setupUniforms)
+ this.m_setupUniforms(programID, constCoords);
+ };
+
+ /**
+ * @param {string} name
+ * @param {string} description
+ * @param {boolean} isVertexCase
+ * @param {boolean} usesTextures
+ * @param {glsShaderRenderCase.ShaderEvalFunc} evalFunc
+ * @param {?es3fShaderStructTests.SetupUniformsFunc} setupUniforms
+ * @param {string} shaderSrc
+ */
+ es3fShaderStructTests.ShaderStructCase.createStructCase = function(name, description, isVertexCase, usesTextures, evalFunc, setupUniforms, shaderSrc) {
+ /** @type {string} */ var defaultVertSrc =
+ '#version 300 es\n' +
+ 'in highp vec4 a_position;\n' +
+ 'in highp vec4 a_coords;\n' +
+ 'out mediump vec4 v_coords;\n\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' v_coords = a_coords;\n' +
+ ' gl_Position = a_position;\n' +
+ '}\n';
+ /** @type {string} */ var defaultFragSrc =
+ '#version 300 es\n' +
+ 'in mediump vec4 v_color;\n' +
+ 'layout(location = 0) out mediump vec4 o_color;\n\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' o_color = v_color;\n' +
+ '}\n';
+
+ // Fill in specialization parameters.
+ var spParams = {};
+ if (isVertexCase) {
+ spParams["HEADER"] =
+ "#version 300 es\n" +
+ "in highp vec4 a_position;\n" +
+ "in highp vec4 a_coords;\n" +
+ "out mediump vec4 v_color;";
+ spParams["COORDS"] = "a_coords";
+ spParams["DST"] = "v_color";
+ spParams["ASSIGN_POS"] = "gl_Position = a_position;";
+ }
+ else {
+ spParams["HEADER"] =
+ "#version 300 es\n" +
+ "in mediump vec4 v_coords;\n" +
+ "layout(location = 0) out mediump vec4 o_color;";
+ spParams["COORDS"] = "v_coords";
+ spParams["DST"] = "o_color";
+ spParams["ASSIGN_POS"] = "";
+ }
+
+ if (isVertexCase)
+ return new es3fShaderStructTests.ShaderStructCase(name, description, isVertexCase, usesTextures, evalFunc, setupUniforms, tcuStringTemplate.specialize(shaderSrc, spParams), defaultFragSrc);
+ else
+ return new es3fShaderStructTests.ShaderStructCase(name, description, isVertexCase, usesTextures, evalFunc, setupUniforms, defaultVertSrc, tcuStringTemplate.specialize(shaderSrc, spParams));
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fShaderStructTests.LocalStructTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'local', 'Local structs');
+ this.makeExecutable();
+ };
+
+ es3fShaderStructTests.LocalStructTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fShaderStructTests.LocalStructTests.prototype.constructor = es3fShaderStructTests.LocalStructTests;
+
+ es3fShaderStructTests.LocalStructTests.prototype.init = function() {
+ var currentCtx = this;
+ function LocalStructCase(name, description, shaderSource, evalFunction) {
+ currentCtx.addChild(es3fShaderStructTests.ShaderStructCase.createStructCase(name + "_vertex", description, true, false, evalFunction, null, shaderSource));
+ currentCtx.addChild(es3fShaderStructTests.ShaderStructCase.createStructCase(name + "_fragment", description, false, false, evalFunction, null, shaderSource));
+ };
+
+ LocalStructCase('basic', 'Basic struct usage',
+ '${HEADER}\n' +
+ 'uniform int ui_one;\n' +
+ '\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' mediump vec3 b;\n' +
+ ' int c;\n' +
+ '};\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' S s = S(${COORDS}.x, vec3(0.0), ui_one);\n' +
+ ' s.b = ${COORDS}.yzw;\n' +
+ ' ${DST} = vec4(s.a, s.b.x, s.b.y, s.c);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}\n',
+ function(c) {
+ c.color[0] = c.coords[0];
+ c.color[1] = c.coords[1];
+ c.color[2] = c.coords[2];
+ });
+
+ LocalStructCase('nested', "Nested struct",
+ '${HEADER}\n' +
+ "uniform int ui_zero;\n" +
+ "uniform int ui_one;\n" +
+ "\n" +
+ "struct T {\n" +
+ " int a;\n" +
+ " mediump vec2 b;\n" +
+ "};\n" +
+ "struct S {\n" +
+ ' mediump float a;\n' +
+ ' T b;\n' +
+ ' int c;\n' +
+ '};\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' S s = S(${COORDS}.x, T(0, vec2(0.0)), ui_one);\n' +
+ ' s.b = T(ui_zero, ${COORDS}.yz);\n' +
+ ' ${DST} = vec4(s.a, s.b.b, s.b.a + s.c);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}\n',
+ function(c) {
+ c.color[0] = c.coords[0];
+ c.color[1] = c.coords[1];
+ c.color[2] = c.coords[2];
+ });
+
+ LocalStructCase('array_member', "Struct with array member",
+ '${HEADER}\n' +
+ 'uniform int ui_one;\n' +
+ '\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' mediump float b[3];\n' +
+ ' int c;\n' +
+ '};\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' S s;\n' +
+ ' s.a = ${COORDS}.w;\n' +
+ ' s.c = ui_one;\n' +
+ ' s.b[0] = ${COORDS}.z;\n' +
+ ' s.b[1] = ${COORDS}.y;\n' +
+ ' s.b[2] = ${COORDS}.x;\n' +
+ ' ${DST} = vec4(s.a, s.b[0], s.b[1], s.c);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}\n',
+ function(c) {
+ c.color[0] = c.coords[3];
+ c.color[1] = c.coords[2];
+ c.color[2] = c.coords[1];
+ });
+
+ LocalStructCase('array_member_dynamic_index', "Struct with array member, dynamic indexing",
+ '${HEADER}\n' +
+ 'uniform int ui_zero;\n' +
+ 'uniform int ui_one;\n' +
+ 'uniform int ui_two;\n' +
+ '\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' mediump float b[3];\n' +
+ ' int c;\n' +
+ '};\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' S s;\n' +
+ ' s.a = ${COORDS}.w;\n' +
+ ' s.c = ui_one;\n' +
+ ' s.b[0] = ${COORDS}.z;\n' +
+ ' s.b[1] = ${COORDS}.y;\n' +
+ ' s.b[2] = ${COORDS}.x;\n' +
+ ' ${DST} = vec4(s.b[ui_one], s.b[ui_zero], s.b[ui_two], s.c);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}\n',
+ function(c) {
+ c.color[0] = c.coords[1];
+ c.color[1] = c.coords[2];
+ c.color[2] = c.coords[0];
+ });
+
+ LocalStructCase('struct_array', "Struct array",
+ '${HEADER}\n' +
+ 'uniform int ui_zero;\n' +
+ 'uniform int ui_one;\n' +
+ 'uniform int ui_two;\n' +
+ '\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' mediump int b;\n' +
+ '};\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' S s[3];\n' +
+ ' s[0] = S(${COORDS}.x, ui_zero);\n' +
+ ' s[1].a = ${COORDS}.y;\n' +
+ ' s[1].b = ui_one;\n' +
+ ' s[2] = S(${COORDS}.z, ui_two);\n' +
+ ' ${DST} = vec4(s[2].a, s[1].a, s[0].a, s[2].b - s[1].b + s[0].b);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}\n',
+ function(c) {
+ c.color[0] = c.coords[2];
+ c.color[1] = c.coords[1];
+ c.color[2] = c.coords[0];
+ });
+
+ LocalStructCase('struct_array_dynamic_index', "Struct array with dynamic indexing",
+ '${HEADER}\n' +
+ 'uniform int ui_zero;\n' +
+ 'uniform int ui_one;\n' +
+ 'uniform int ui_two;\n' +
+ '\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' mediump int b;\n' +
+ '};\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' S s[3];\n' +
+ ' s[0] = S(${COORDS}.x, ui_zero);\n' +
+ ' s[1].a = ${COORDS}.y;\n' +
+ ' s[1].b = ui_one;\n' +
+ ' s[2] = S(${COORDS}.z, ui_two);\n' +
+ ' ${DST} = vec4(s[ui_two].a, s[ui_one].a, s[ui_zero].a, s[ui_two].b - s[ui_one].b + s[ui_zero].b);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}\n',
+ function(c) {
+ c.color[0] = c.coords[2];
+ c.color[1] = c.coords[1];
+ c.color[2] = c.coords[0];
+ });
+
+ LocalStructCase('nested_struct_array', "Nested struct array",
+ '${HEADER}\n' +
+ 'uniform int ui_zero;\n' +
+ 'uniform int ui_one;\n' +
+ 'uniform int ui_two;\n' +
+ 'uniform mediump float uf_two;\n' +
+ 'uniform mediump float uf_three;\n' +
+ 'uniform mediump float uf_four;\n' +
+ 'uniform mediump float uf_half;\n' +
+ 'uniform mediump float uf_third;\n' +
+ 'uniform mediump float uf_fourth;\n' +
+ '\n' +
+ 'struct T {\n' +
+ ' mediump float a;\n' +
+ ' mediump vec2 b[2];\n' +
+ '};\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' T b[3];\n' +
+ ' int c;\n' +
+ '};\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' S s[2];\n' +
+ '\n' +
+ ' // S[0]\n' +
+ ' s[0].a = ${COORDS}.x;\n' +
+ ' s[0].b[0].a = uf_half;\n' +
+ ' s[0].b[0].b[0] = ${COORDS}.xy;\n' +
+ ' s[0].b[0].b[1] = ${COORDS}.zw;\n' +
+ ' s[0].b[1].a = uf_third;\n' +
+ ' s[0].b[1].b[0] = ${COORDS}.zw;\n' +
+ ' s[0].b[1].b[1] = ${COORDS}.xy;\n' +
+ ' s[0].b[2].a = uf_fourth;\n' +
+ ' s[0].b[2].b[0] = ${COORDS}.xz;\n' +
+ ' s[0].b[2].b[1] = ${COORDS}.yw;\n' +
+ ' s[0].c = ui_zero;\n' +
+ '\n' +
+ ' // S[1]\n' +
+ ' s[1].a = ${COORDS}.w;\n' +
+ ' s[1].b[0].a = uf_two;\n' +
+ ' s[1].b[0].b[0] = ${COORDS}.xx;\n' +
+ ' s[1].b[0].b[1] = ${COORDS}.yy;\n' +
+ ' s[1].b[1].a = uf_three;\n' +
+ ' s[1].b[1].b[0] = ${COORDS}.zz;\n' +
+ ' s[1].b[1].b[1] = ${COORDS}.ww;\n' +
+ ' s[1].b[2].a = uf_four;\n' +
+ ' s[1].b[2].b[0] = ${COORDS}.yx;\n' +
+ ' s[1].b[2].b[1] = ${COORDS}.wz;\n' +
+ ' s[1].c = ui_one;\n' +
+ '\n' +
+ ' mediump float r = (s[0].b[1].b[0].x + s[1].b[2].b[1].y) * s[0].b[0].a; // (z + z) * 0.5\n' +
+ ' mediump float g = s[1].b[0].b[0].y * s[0].b[2].a * s[1].b[2].a; // x * 0.25 * 4\n' +
+ ' mediump float b = (s[0].b[2].b[1].y + s[0].b[1].b[0].y + s[1].a) * s[0].b[1].a; // (w + w + w) * 0.333\n' +
+ ' mediump float a = float(s[0].c) + s[1].b[2].a - s[1].b[1].a; // 0 + 4.0 - 3.0\n' +
+ ' ${DST} = vec4(r, g, b, a);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}\n',
+ function(c) {
+ c.color[0] = c.coords[2];
+ c.color[1] = c.coords[0];
+ c.color[2] = c.coords[3];
+ });
+
+ LocalStructCase('nested_struct_array_dynamic_index', "Nested struct array with dynamic indexing",
+ '${HEADER}\n' +
+ 'uniform int ui_zero;\n' +
+ 'uniform int ui_one;\n' +
+ 'uniform int ui_two;\n' +
+ 'uniform mediump float uf_two;\n' +
+ 'uniform mediump float uf_three;\n' +
+ 'uniform mediump float uf_four;\n' +
+ 'uniform mediump float uf_half;\n' +
+ 'uniform mediump float uf_third;\n' +
+ 'uniform mediump float uf_fourth;\n' +
+ '\n' +
+ 'struct T {\n' +
+ ' mediump float a;\n' +
+ ' mediump vec2 b[2];\n' +
+ '};\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' T b[3];\n' +
+ ' int c;\n' +
+ '};\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' S s[2];\n' +
+ '\n' +
+ ' // S[0]\n' +
+ ' s[0].a = ${COORDS}.x;\n' +
+ ' s[0].b[0].a = uf_half;\n' +
+ ' s[0].b[0].b[0] = ${COORDS}.xy;\n' +
+ ' s[0].b[0].b[1] = ${COORDS}.zw;\n' +
+ ' s[0].b[1].a = uf_third;\n' +
+ ' s[0].b[1].b[0] = ${COORDS}.zw;\n' +
+ ' s[0].b[1].b[1] = ${COORDS}.xy;\n' +
+ ' s[0].b[2].a = uf_fourth;\n' +
+ ' s[0].b[2].b[0] = ${COORDS}.xz;\n' +
+ ' s[0].b[2].b[1] = ${COORDS}.yw;\n' +
+ ' s[0].c = ui_zero;\n' +
+ '\n' +
+ ' // S[1]\n' +
+ ' s[1].a = ${COORDS}.w;\n' +
+ ' s[1].b[0].a = uf_two;\n' +
+ ' s[1].b[0].b[0] = ${COORDS}.xx;\n' +
+ ' s[1].b[0].b[1] = ${COORDS}.yy;\n' +
+ ' s[1].b[1].a = uf_three;\n' +
+ ' s[1].b[1].b[0] = ${COORDS}.zz;\n' +
+ ' s[1].b[1].b[1] = ${COORDS}.ww;\n' +
+ ' s[1].b[2].a = uf_four;\n' +
+ ' s[1].b[2].b[0] = ${COORDS}.yx;\n' +
+ ' s[1].b[2].b[1] = ${COORDS}.wz;\n' +
+ ' s[1].c = ui_one;\n' +
+ '\n' +
+ ' mediump float r = (s[0].b[ui_one].b[ui_one-1].x + s[ui_one].b[ui_two].b[ui_zero+1].y) * s[0].b[0].a; // (z + z) * 0.5\n' +
+ ' mediump float g = s[ui_two-1].b[ui_two-2].b[ui_zero].y * s[0].b[ui_two].a * s[ui_one].b[2].a; // x * 0.25 * 4\n' +
+ ' mediump float b = (s[ui_zero].b[ui_one+1].b[1].y + s[0].b[ui_one*ui_one].b[0].y + s[ui_one].a) * s[0].b[ui_two-ui_one].a; // (w + w + w) * 0.333\n' +
+ ' mediump float a = float(s[ui_zero].c) + s[ui_one-ui_zero].b[ui_two].a - s[ui_zero+ui_one].b[ui_two-ui_one].a; // 0 + 4.0 - 3.0\n' +
+ ' ${DST} = vec4(r, g, b, a);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}\n',
+ function(c) {
+ c.color[0] = c.coords[2];
+ c.color[1] = c.coords[0];
+ c.color[2] = c.coords[3];
+ });
+
+ LocalStructCase('parameter', "Struct as a function parameter",
+ '${HEADER}\n' +
+ 'uniform int ui_one;\n' +
+ '\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' mediump vec3 b;\n' +
+ ' int c;\n' +
+ '};\n' +
+ '\n' +
+ 'mediump vec4 myFunc (S s)\n' +
+ '{\n' +
+ ' return vec4(s.a, s.b.x, s.b.y, s.c);\n' +
+ '}\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' S s = S(${COORDS}.x, vec3(0.0), ui_one);\n' +
+ ' s.b = ${COORDS}.yzw;\n' +
+ ' ${DST} = myFunc(s);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}\n',
+ function(c) {
+ c.color[0] = c.coords[0];
+ c.color[1] = c.coords[1];
+ c.color[2] = c.coords[2];
+ });
+
+ LocalStructCase('parameter_nested', "Nested struct as a function parameter",
+ '${HEADER}\n' +
+ 'uniform int ui_zero;\n' +
+ 'uniform int ui_one;\n' +
+ '\n' +
+ 'struct T {\n' +
+ ' int a;\n' +
+ ' mediump vec2 b;\n' +
+ '};\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' T b;\n' +
+ ' int c;\n' +
+ '};\n' +
+ '\n' +
+ 'mediump vec4 myFunc (S s)\n' +
+ '{\n' +
+ ' return vec4(s.a, s.b.b, s.b.a + s.c);\n' +
+ '}\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' S s = S(${COORDS}.x, T(0, vec2(0.0)), ui_one);\n' +
+ ' s.b = T(ui_zero, ${COORDS}.yz);\n' +
+ ' ${DST} = myFunc(s);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}\n',
+ function(c) {
+ c.color[0] = c.coords[0];
+ c.color[1] = c.coords[1];
+ c.color[2] = c.coords[2];
+ });
+
+ LocalStructCase('return', "Struct as a return value",
+ '${HEADER}\n' +
+ 'uniform int ui_one;\n' +
+ '\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' mediump vec3 b;\n' +
+ ' int c;\n' +
+ '};\n' +
+ '\n' +
+ 'S myFunc (void)\n' +
+ '{\n' +
+ ' S s = S(${COORDS}.x, vec3(0.0), ui_one);\n' +
+ ' s.b = ${COORDS}.yzw;\n' +
+ ' return s;\n' +
+ '}\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' S s = myFunc();\n' +
+ ' ${DST} = vec4(s.a, s.b.x, s.b.y, s.c);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}\n',
+ function(c) {
+ c.color[0] = c.coords[0];
+ c.color[1] = c.coords[1];
+ c.color[2] = c.coords[2];
+ });
+
+ LocalStructCase('return_nested', "Nested struct",
+ '${HEADER}\n' +
+ 'uniform int ui_zero;\n' +
+ 'uniform int ui_one;\n' +
+ '\n' +
+ 'struct T {\n' +
+ ' int a;\n' +
+ ' mediump vec2 b;\n' +
+ '};\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' T b;\n' +
+ ' int c;\n' +
+ '};\n' +
+ '\n' +
+ 'S myFunc (void)\n' +
+ '{\n' +
+ ' S s = S(${COORDS}.x, T(0, vec2(0.0)), ui_one);\n' +
+ ' s.b = T(ui_zero, ${COORDS}.yz);\n' +
+ ' return s;\n' +
+ '}\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' S s = myFunc();\n' +
+ ' ${DST} = vec4(s.a, s.b.b, s.b.a + s.c);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}\n',
+ function(c) {
+ c.color[0] = c.coords[0];
+ c.color[1] = c.coords[1];
+ c.color[2] = c.coords[2];
+ });
+
+ LocalStructCase('conditional_assignment', "Conditional struct assignment",
+ '${HEADER}\n' +
+ 'uniform int ui_zero;\n' +
+ 'uniform int ui_one;\n' +
+ 'uniform mediump float uf_one;\n' +
+ '\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' mediump vec3 b;\n' +
+ ' int c;\n' +
+ '};\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' S s = S(${COORDS}.x, ${COORDS}.yzw, ui_zero);\n' +
+ ' if (uf_one > 0.0)\n' +
+ ' s = S(${COORDS}.w, ${COORDS}.zyx, ui_one);\n' +
+ ' ${DST} = vec4(s.a, s.b.xy, s.c);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}\n',
+ function(c) {
+ c.color[0] = c.coords[3];
+ c.color[1] = c.coords[2];
+ c.color[2] = c.coords[1];
+ });
+
+ LocalStructCase('loop_assignment', "Struct assignment in loop",
+ '${HEADER}\n' +
+ 'uniform int ui_zero;\n' +
+ 'uniform int ui_one;\n' +
+ '\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' mediump vec3 b;\n' +
+ ' int c;\n' +
+ '};\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' S s = S(${COORDS}.x, ${COORDS}.yzw, ui_zero);\n' +
+ ' for (int i = 0; i < 3; i++)\n' +
+ ' {\n' +
+ ' if (i == 1)\n' +
+ ' s = S(${COORDS}.w, ${COORDS}.zyx, ui_one);\n' +
+ ' }\n' +
+ ' ${DST} = vec4(s.a, s.b.xy, s.c);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}\n',
+ function(c) {
+ c.color[0] = c.coords[3];
+ c.color[1] = c.coords[2];
+ c.color[2] = c.coords[1];
+ });
+
+ LocalStructCase('dynamic_loop_assignment', "Struct assignment in loop",
+ '${HEADER}\n' +
+ 'uniform int ui_zero;\n' +
+ 'uniform int ui_one;\n' +
+ 'uniform int ui_three;\n' +
+ '\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' mediump vec3 b;\n' +
+ ' int c;\n' +
+ '};\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' S s = S(${COORDS}.x, ${COORDS}.yzw, ui_zero);\n' +
+ ' for (int i = 0; i < ui_three; i++)\n' +
+ ' {\n' +
+ ' if (i == ui_one)\n' +
+ ' s = S(${COORDS}.w, ${COORDS}.zyx, ui_one);\n' +
+ ' }\n' +
+ ' ${DST} = vec4(s.a, s.b.xy, s.c);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}\n',
+ function(c) {
+ c.color[0] = c.coords[3];
+ c.color[1] = c.coords[2];
+ c.color[2] = c.coords[1];
+ });
+
+ LocalStructCase('nested_conditional_assignment', "Conditional assignment of nested struct",
+ '${HEADER}\n' +
+ 'uniform int ui_zero;\n' +
+ 'uniform int ui_one;\n' +
+ 'uniform mediump float uf_one;\n' +
+ '\n' +
+ 'struct T {\n' +
+ ' int a;\n' +
+ ' mediump vec2 b;\n' +
+ '};\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' T b;\n' +
+ ' int c;\n' +
+ '};\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' S s = S(${COORDS}.x, T(ui_one, ${COORDS}.yz), ui_one);\n' +
+ ' if (uf_one > 0.0)\n' +
+ ' s.b = T(ui_zero, ${COORDS}.zw);\n' +
+ ' ${DST} = vec4(s.a, s.b.b, s.c - s.b.a);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}\n',
+ function(c) {
+ c.color[0] = c.coords[0];
+ c.color[1] = c.coords[2];
+ c.color[2] = c.coords[3];
+ });
+
+ LocalStructCase('nested_loop_assignment', "Nested struct assignment in loop",
+ '${HEADER}\n' +
+ 'uniform int ui_zero;\n' +
+ 'uniform int ui_one;\n' +
+ 'uniform mediump float uf_one;\n' +
+ '\n' +
+ 'struct T {\n' +
+ ' int a;\n' +
+ ' mediump vec2 b;\n' +
+ '};\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' T b;\n' +
+ ' int c;\n' +
+ '};\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' S s = S(${COORDS}.x, T(ui_one, ${COORDS}.yz), ui_one);\n' +
+ ' for (int i = 0; i < 3; i++)\n' +
+ ' {\n' +
+ ' if (i == 1)\n' +
+ ' s.b = T(ui_zero, ${COORDS}.zw);\n' +
+ ' }\n' +
+ ' ${DST} = vec4(s.a, s.b.b, s.c - s.b.a);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}\n',
+ function(c) {
+ c.color[0] = c.coords[0];
+ c.color[1] = c.coords[2];
+ c.color[2] = c.coords[3];
+ });
+
+ LocalStructCase('nested_dynamic_loop_assignment', "Nested struct assignment in dynamic loop",
+ '${HEADER}\n' +
+ 'uniform int ui_zero;\n' +
+ 'uniform int ui_one;\n' +
+ 'uniform int ui_three;\n' +
+ 'uniform mediump float uf_one;\n' +
+ '\n' +
+ 'struct T {\n' +
+ ' int a;\n' +
+ ' mediump vec2 b;\n' +
+ '};\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' T b;\n' +
+ ' int c;\n' +
+ '};\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' S s = S(${COORDS}.x, T(ui_one, ${COORDS}.yz), ui_one);\n' +
+ ' for (int i = 0; i < ui_three; i++)\n' +
+ ' {\n' +
+ ' if (i == ui_one)\n' +
+ ' s.b = T(ui_zero, ${COORDS}.zw);\n' +
+ ' }\n' +
+ ' ${DST} = vec4(s.a, s.b.b, s.c - s.b.a);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}\n',
+ function(c) {
+ c.color[0] = c.coords[0];
+ c.color[1] = c.coords[2];
+ c.color[2] = c.coords[3];
+ });
+
+ LocalStructCase('loop_struct_array', "Struct array usage in loop",
+ '${HEADER}\n' +
+ 'uniform int ui_zero;\n' +
+ 'uniform int ui_one;\n' +
+ 'uniform int ui_two;\n' +
+ '\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' mediump int b;\n' +
+ '};\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' S s[3];\n' +
+ ' s[0] = S(${COORDS}.x, ui_zero);\n' +
+ ' s[1].a = ${COORDS}.y;\n' +
+ ' s[1].b = -ui_one;\n' +
+ ' s[2] = S(${COORDS}.z, ui_two);\n' +
+ '\n' +
+ ' mediump float rgb[3];\n' +
+ ' int alpha = 0;\n' +
+ ' for (int i = 0; i < 3; i++)\n' +
+ ' {\n' +
+ ' rgb[i] = s[2-i].a;\n' +
+ ' alpha += s[i].b;\n' +
+ ' }\n' +
+ ' ${DST} = vec4(rgb[0], rgb[1], rgb[2], alpha);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}\n',
+ function(c) {
+ c.color[0] = c.coords[2];
+ c.color[1] = c.coords[1];
+ c.color[2] = c.coords[0];
+ });
+
+ LocalStructCase('loop_nested_struct_array', "Nested struct array usage in loop",
+ '${HEADER}\n' +
+ 'uniform int ui_zero;\n' +
+ 'uniform int ui_one;\n' +
+ 'uniform int ui_two;\n' +
+ 'uniform mediump float uf_two;\n' +
+ 'uniform mediump float uf_three;\n' +
+ 'uniform mediump float uf_four;\n' +
+ 'uniform mediump float uf_half;\n' +
+ 'uniform mediump float uf_third;\n' +
+ 'uniform mediump float uf_fourth;\n' +
+ 'uniform mediump float uf_sixth;\n' +
+ '\n' +
+ 'struct T {\n' +
+ ' mediump float a;\n' +
+ ' mediump vec2 b[2];\n' +
+ '};\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' T b[3];\n' +
+ ' int c;\n' +
+ '};\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' S s[2];\n' +
+ '\n' +
+ ' // S[0]\n' +
+ ' s[0].a = ${COORDS}.x;\n' +
+ ' s[0].b[0].a = uf_half;\n' +
+ ' s[0].b[0].b[0] = ${COORDS}.yx;\n' +
+ ' s[0].b[0].b[1] = ${COORDS}.zx;\n' +
+ ' s[0].b[1].a = uf_third;\n' +
+ ' s[0].b[1].b[0] = ${COORDS}.yy;\n' +
+ ' s[0].b[1].b[1] = ${COORDS}.wy;\n' +
+ ' s[0].b[2].a = uf_fourth;\n' +
+ ' s[0].b[2].b[0] = ${COORDS}.zx;\n' +
+ ' s[0].b[2].b[1] = ${COORDS}.zy;\n' +
+ ' s[0].c = ui_zero;\n' +
+ '\n' +
+ ' // S[1]\n' +
+ ' s[1].a = ${COORDS}.w;\n' +
+ ' s[1].b[0].a = uf_two;\n' +
+ ' s[1].b[0].b[0] = ${COORDS}.zx;\n' +
+ ' s[1].b[0].b[1] = ${COORDS}.zy;\n' +
+ ' s[1].b[1].a = uf_three;\n' +
+ ' s[1].b[1].b[0] = ${COORDS}.zz;\n' +
+ ' s[1].b[1].b[1] = ${COORDS}.ww;\n' +
+ ' s[1].b[2].a = uf_four;\n' +
+ ' s[1].b[2].b[0] = ${COORDS}.yx;\n' +
+ ' s[1].b[2].b[1] = ${COORDS}.wz;\n' +
+ ' s[1].c = ui_one;\n' +
+ '\n' +
+ ' mediump float r = 0.0; // (x*3 + y*3) / 6.0\n' +
+ ' mediump float g = 0.0; // (y*3 + z*3) / 6.0\n' +
+ ' mediump float b = 0.0; // (z*3 + w*3) / 6.0\n' +
+ ' mediump float a = 1.0;\n' +
+ ' for (int i = 0; i < 2; i++)\n' +
+ ' {\n' +
+ ' for (int j = 0; j < 3; j++)\n' +
+ ' {\n' +
+ ' r += s[0].b[j].b[i].y;\n' +
+ ' g += s[i].b[j].b[0].x;\n' +
+ ' b += s[i].b[j].b[1].x;\n' +
+ ' a *= s[i].b[j].a;\n' +
+ ' }\n' +
+ ' }\n' +
+ ' ${DST} = vec4(r*uf_sixth, g*uf_sixth, b*uf_sixth, a);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}\n',
+ function(c) {
+ c.color[0] = (c.coords[0] + c.coords[1]) * 0.5;
+ c.color[1] = (c.coords[1] + c.coords[2]) * 0.5;
+ c.color[2] = (c.coords[2] + c.coords[3]) * 0.5;
+ });
+
+ LocalStructCase('dynamic_loop_struct_array', "Struct array usage in dynamic loop",
+ '${HEADER}\n' +
+ 'uniform int ui_zero;\n' +
+ 'uniform int ui_one;\n' +
+ 'uniform int ui_two;\n' +
+ 'uniform int ui_three;\n' +
+ '\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' mediump int b;\n' +
+ '};\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' S s[3];\n' +
+ ' s[0] = S(${COORDS}.x, ui_zero);\n' +
+ ' s[1].a = ${COORDS}.y;\n' +
+ ' s[1].b = -ui_one;\n' +
+ ' s[2] = S(${COORDS}.z, ui_two);\n' +
+ '\n' +
+ ' mediump float rgb[3];\n' +
+ ' int alpha = 0;\n' +
+ ' for (int i = 0; i < ui_three; i++)\n' +
+ ' {\n' +
+ ' rgb[i] = s[2-i].a;\n' +
+ ' alpha += s[i].b;\n' +
+ ' }\n' +
+ ' ${DST} = vec4(rgb[0], rgb[1], rgb[2], alpha);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}\n',
+ function(c) {
+ c.color[0] = c.coords[2];
+ c.color[1] = c.coords[1];
+ c.color[2] = c.coords[0];
+ });
+
+ LocalStructCase('dynamic_loop_nested_struct_array', "Nested struct array usage in dynamic loop",
+ '${HEADER}\n' +
+ 'uniform int ui_zero;\n' +
+ 'uniform int ui_one;\n' +
+ 'uniform int ui_two;\n' +
+ 'uniform int ui_three;\n' +
+ 'uniform mediump float uf_two;\n' +
+ 'uniform mediump float uf_three;\n' +
+ 'uniform mediump float uf_four;\n' +
+ 'uniform mediump float uf_half;\n' +
+ 'uniform mediump float uf_third;\n' +
+ 'uniform mediump float uf_fourth;\n' +
+ 'uniform mediump float uf_sixth;\n' +
+ '\n' +
+ 'struct T {\n' +
+ ' mediump float a;\n' +
+ ' mediump vec2 b[2];\n' +
+ '};\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' T b[3];\n' +
+ ' int c;\n' +
+ '};\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' S s[2];\n' +
+ '\n' +
+ ' // S[0]\n' +
+ ' s[0].a = ${COORDS}.x;\n' +
+ ' s[0].b[0].a = uf_half;\n' +
+ ' s[0].b[0].b[0] = ${COORDS}.yx;\n' +
+ ' s[0].b[0].b[1] = ${COORDS}.zx;\n' +
+ ' s[0].b[1].a = uf_third;\n' +
+ ' s[0].b[1].b[0] = ${COORDS}.yy;\n' +
+ ' s[0].b[1].b[1] = ${COORDS}.wy;\n' +
+ ' s[0].b[2].a = uf_fourth;\n' +
+ ' s[0].b[2].b[0] = ${COORDS}.zx;\n' +
+ ' s[0].b[2].b[1] = ${COORDS}.zy;\n' +
+ ' s[0].c = ui_zero;\n' +
+ '\n' +
+ ' // S[1]\n' +
+ ' s[1].a = ${COORDS}.w;\n' +
+ ' s[1].b[0].a = uf_two;\n' +
+ ' s[1].b[0].b[0] = ${COORDS}.zx;\n' +
+ ' s[1].b[0].b[1] = ${COORDS}.zy;\n' +
+ ' s[1].b[1].a = uf_three;\n' +
+ ' s[1].b[1].b[0] = ${COORDS}.zz;\n' +
+ ' s[1].b[1].b[1] = ${COORDS}.ww;\n' +
+ ' s[1].b[2].a = uf_four;\n' +
+ ' s[1].b[2].b[0] = ${COORDS}.yx;\n' +
+ ' s[1].b[2].b[1] = ${COORDS}.wz;\n' +
+ ' s[1].c = ui_one;\n' +
+ '\n' +
+ ' mediump float r = 0.0; // (x*3 + y*3) / 6.0\n' +
+ ' mediump float g = 0.0; // (y*3 + z*3) / 6.0\n' +
+ ' mediump float b = 0.0; // (z*3 + w*3) / 6.0\n' +
+ ' mediump float a = 1.0;\n' +
+ ' for (int i = 0; i < ui_two; i++)\n' +
+ ' {\n' +
+ ' for (int j = 0; j < ui_three; j++)\n' +
+ ' {\n' +
+ ' r += s[0].b[j].b[i].y;\n' +
+ ' g += s[i].b[j].b[0].x;\n' +
+ ' b += s[i].b[j].b[1].x;\n' +
+ ' a *= s[i].b[j].a;\n' +
+ ' }\n' +
+ ' }\n' +
+ ' ${DST} = vec4(r*uf_sixth, g*uf_sixth, b*uf_sixth, a);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}\n',
+ function(c) {
+ c.color[0] = (c.coords[0] + c.coords[1]) * 0.5;
+ c.color[1] = (c.coords[1] + c.coords[2]) * 0.5;
+ c.color[2] = (c.coords[2] + c.coords[3]) * 0.5;
+ });
+
+ LocalStructCase('basic_equal', "Basic struct equality",
+ '${HEADER}\n' +
+ 'uniform int ui_one;\n' +
+ 'uniform int ui_two;\n' +
+ '\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' mediump vec3 b;\n' +
+ ' int c;\n' +
+ '};\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' S a = S(floor(${COORDS}.x), vec3(0.0, floor(${COORDS}.y), 2.3), ui_one);\n' +
+ ' S b = S(floor(${COORDS}.x+0.5), vec3(0.0, floor(${COORDS}.y), 2.3), ui_one);\n' +
+ ' S c = S(floor(${COORDS}.x), vec3(0.0, floor(${COORDS}.y+0.5), 2.3), ui_one);\n' +
+ ' S d = S(floor(${COORDS}.x), vec3(0.0, floor(${COORDS}.y), 2.3), ui_two);\n' +
+ ' ${DST} = vec4(0.0, 0.0, 0.0, 1.0);\n' +
+ ' if (a == b) ${DST}.x = 1.0;\n' +
+ ' if (a == c) ${DST}.y = 1.0;\n' +
+ ' if (a == d) ${DST}.z = 1.0;\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}\n',
+ function(c) {
+ if (Math.floor(c.coords[0]) === Math.floor(c.coords[0] + 0.5))
+ c.color[0] = 1.0;
+ if (Math.floor(c.coords[1]) === Math.floor(c.coords[1] + 0.5))
+ c.color[1] = 1.0;
+ });
+
+ LocalStructCase('basic_not_equal', "Basic struct equality",
+ '${HEADER}\n' +
+ 'uniform int ui_one;\n' +
+ 'uniform int ui_two;\n' +
+ '\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' mediump vec3 b;\n' +
+ ' int c;\n' +
+ '};\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' S a = S(floor(${COORDS}.x), vec3(0.0, floor(${COORDS}.y), 2.3), ui_one);\n' +
+ ' S b = S(floor(${COORDS}.x+0.5), vec3(0.0, floor(${COORDS}.y), 2.3), ui_one);\n' +
+ ' S c = S(floor(${COORDS}.x), vec3(0.0, floor(${COORDS}.y+0.5), 2.3), ui_one);\n' +
+ ' S d = S(floor(${COORDS}.x), vec3(0.0, floor(${COORDS}.y), 2.3), ui_two);\n' +
+ ' ${DST} = vec4(0.0, 0.0, 0.0, 1.0);\n' +
+ ' if (a != b) ${DST}.x = 1.0;\n' +
+ ' if (a != c) ${DST}.y = 1.0;\n' +
+ ' if (a != d) ${DST}.z = 1.0;\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}\n',
+ function(c) {
+ if (Math.floor(c.coords[0]) != Math.floor(c.coords[0] + 0.5))
+ c.color[0] = 1.0;
+ if (Math.floor(c.coords[1]) != Math.floor(c.coords[1] + 0.5))
+ c.color[1] = 1.0;
+ c.color[2] = 1.0;
+ });
+
+ LocalStructCase('nested_equal', "Nested struct struct equality",
+ '${HEADER}\n' +
+ 'uniform int ui_one;\n' +
+ 'uniform int ui_two;\n' +
+ '\n' +
+ 'struct T {\n' +
+ ' mediump vec3 a;\n' +
+ ' int b;\n' +
+ '};\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' T b;\n' +
+ ' int c;\n' +
+ '};\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' S a = S(floor(${COORDS}.x), T(vec3(0.0, floor(${COORDS}.y), 2.3), ui_one), 1);\n' +
+ ' S b = S(floor(${COORDS}.x+0.5), T(vec3(0.0, floor(${COORDS}.y), 2.3), ui_one), 1);\n' +
+ ' S c = S(floor(${COORDS}.x), T(vec3(0.0, floor(${COORDS}.y+0.5), 2.3), ui_one), 1);\n' +
+ ' S d = S(floor(${COORDS}.x), T(vec3(0.0, floor(${COORDS}.y), 2.3), ui_two), 1);\n' +
+ ' ${DST} = vec4(0.0, 0.0, 0.0, 1.0);\n' +
+ ' if (a == b) ${DST}.x = 1.0;\n' +
+ ' if (a == c) ${DST}.y = 1.0;\n' +
+ ' if (a == d) ${DST}.z = 1.0;\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}\n',
+ function(c) {
+ if (Math.floor(c.coords[0]) == Math.floor(c.coords[0] + 0.5))
+ c.color[0] = 1.0;
+ if (Math.floor(c.coords[1]) == Math.floor(c.coords[1] + 0.5))
+ c.color[1] = 1.0;
+ });
+
+ LocalStructCase('nested_not_equal', "Nested struct struct equality",
+ '${HEADER}\n' +
+ 'uniform int ui_one;\n' +
+ 'uniform int ui_two;\n' +
+ '\n' +
+ 'struct T {\n' +
+ ' mediump vec3 a;\n' +
+ ' int b;\n' +
+ '};\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' T b;\n' +
+ ' int c;\n' +
+ '};\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' S a = S(floor(${COORDS}.x), T(vec3(0.0, floor(${COORDS}.y), 2.3), ui_one), 1);\n' +
+ ' S b = S(floor(${COORDS}.x+0.5), T(vec3(0.0, floor(${COORDS}.y), 2.3), ui_one), 1);\n' +
+ ' S c = S(floor(${COORDS}.x), T(vec3(0.0, floor(${COORDS}.y+0.5), 2.3), ui_one), 1);\n' +
+ ' S d = S(floor(${COORDS}.x), T(vec3(0.0, floor(${COORDS}.y), 2.3), ui_two), 1);\n' +
+ ' ${DST} = vec4(0.0, 0.0, 0.0, 1.0);\n' +
+ ' if (a != b) ${DST}.x = 1.0;\n' +
+ ' if (a != c) ${DST}.y = 1.0;\n' +
+ ' if (a != d) ${DST}.z = 1.0;\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}\n',
+ function(c) {
+ if (Math.floor(c.coords[0]) != Math.floor(c.coords[0] + 0.5))
+ c.color[0] = 1.0;
+ if (Math.floor(c.coords[1]) != Math.floor(c.coords[1] + 0.5))
+ c.color[1] = 1.0;
+ c.color[2] = 1.0;
+ });
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fShaderStructTests.UniformStructTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'uniform', 'Uniform structs');
+ this.makeExecutable();
+ };
+
+ es3fShaderStructTests.UniformStructTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fShaderStructTests.UniformStructTests.prototype.constructor = es3fShaderStructTests.UniformStructTests;
+
+ /**
+ * @param {WebGLProgram} programID
+ * @param {string} name
+ * @param {Array<number>} vec
+ */
+ es3fShaderStructTests.setUniform2fv = function(programID, name, vec) {
+ /** @type {WebGLUniformLocation} */ var loc = gl.getUniformLocation(programID, name);
+ gl.uniform2fv(loc, vec);
+ };
+
+ /**
+ * @param {WebGLProgram} programID
+ * @param {string} name
+ * @param {Array<number>} vec
+ */
+ es3fShaderStructTests.setUniform3fv = function(programID, name, vec) {
+ /** @type {WebGLUniformLocation} */ var loc = gl.getUniformLocation(programID, name);
+ gl.uniform3fv(loc, vec);
+ };
+
+ /**
+ * @param {WebGLProgram} programID
+ * @param {string} name
+ * @param {number} value
+ */
+ es3fShaderStructTests.setUniform1i = function(programID, name, value) {
+ /** @type {WebGLUniformLocation} */ var loc = gl.getUniformLocation(programID, name);
+ gl.uniform1i(loc, value);
+ };
+
+ /**
+ * @param {WebGLProgram} programID
+ * @param {string} name
+ * @param {number} value
+ */
+ es3fShaderStructTests.setUniform1f = function(programID, name, value) {
+ /** @type {WebGLUniformLocation} */ var loc = gl.getUniformLocation(programID, name);
+ gl.uniform1f(loc, value);
+ };
+
+ /**
+ * @param {WebGLProgram} programID
+ * @param {string} name
+ * @param {Array<number>} vec
+ */
+ es3fShaderStructTests.setUniform1fv = function(programID, name, vec) {
+ /** @type {WebGLUniformLocation} */ var loc = gl.getUniformLocation(programID, name);
+ gl.uniform1fv(loc, vec);
+ };
+
+ es3fShaderStructTests.UniformStructTests.prototype.init = function() {
+ var currentCtx = this;
+ function UniformStructCase(name, description, textures, shaderSrc, setUniformsFunc, evalFunc) {
+ currentCtx.addChild(es3fShaderStructTests.ShaderStructCase.createStructCase(name + "_vertex", description, true, textures, evalFunc, setUniformsFunc, shaderSrc));
+ currentCtx.addChild(es3fShaderStructTests.ShaderStructCase.createStructCase(name + "_fragment", description, false, textures, evalFunc, setUniformsFunc, shaderSrc));
+ }
+
+ UniformStructCase('basic', "Basic struct usage", false,
+ '${HEADER}\n' +
+ 'uniform int ui_one;\n' +
+ '' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' mediump vec3 b;\n' +
+ ' int c;\n' +
+ '};\n' +
+ 'uniform S s;\n' +
+ '' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' ${DST} = vec4(s.a, s.b.x, s.b.y, s.c);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}',
+ function(programID, constCoords) {
+ es3fShaderStructTests.setUniform1f(programID, "s.a", constCoords[0]);
+ es3fShaderStructTests.setUniform3fv(programID, "s.b", deMath.swizzle(constCoords, [1, 2, 3]));
+ es3fShaderStructTests.setUniform1i(programID, "s.c", 1);
+ },
+ function(c) {
+ c.color[0] = c.constCoords[0];
+ c.color[1] = c.constCoords[1];
+ c.color[2] = c.constCoords[2];
+ });
+
+ UniformStructCase('nested', "Nested struct", false,
+ '${HEADER}\n' +
+ 'uniform int ui_zero;\n' +
+ 'uniform int ui_one;\n' +
+ '' +
+ 'struct T {\n' +
+ ' int a;\n' +
+ ' mediump vec2 b;\n' +
+ '};\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' T b;\n' +
+ ' int c;\n' +
+ '};\n' +
+ 'uniform S s;\n' +
+ '' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' ${DST} = vec4(s.a, s.b.b, s.b.a + s.c);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}',
+ function(programID, constCoords) {
+ es3fShaderStructTests.setUniform1f(programID, "s.a", constCoords[0]);
+ es3fShaderStructTests.setUniform1i(programID, "s.b.a", 0);
+ es3fShaderStructTests.setUniform2fv(programID, "s.b.b", deMath.swizzle(constCoords, [1,2]));
+ es3fShaderStructTests.setUniform1i(programID, "s.c", 1);
+ },
+ function(c) {
+ c.color[0] = c.constCoords[0];
+ c.color[1] = c.constCoords[1];
+ c.color[2] = c.constCoords[2];
+ });
+
+ UniformStructCase('array_member', "Struct with array member", false,
+ '${HEADER}\n' +
+ 'uniform int ui_one;\n' +
+ '' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' mediump float b[3];\n' +
+ ' int c;\n' +
+ '};\n' +
+ 'uniform S s;\n' +
+ '' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' ${DST} = vec4(s.a, s.b[0], s.b[1], s.c);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}',
+ function(programID, constCoords){
+ es3fShaderStructTests.setUniform1f(programID, "s.a", constCoords[3]);
+ es3fShaderStructTests.setUniform1i(programID, "s.c", 1);
+
+ /** @type {Array<number>} */ var b = [];
+ b[0] = constCoords[2];
+ b[1] = constCoords[1];
+ b[2] = constCoords[0];
+ es3fShaderStructTests.setUniform1fv(programID, "s.b", b);
+ },
+ function(c) {
+ c.color[0] = c.constCoords[3];
+ c.color[1] = c.constCoords[2];
+ c.color[2] = c.constCoords[1];
+ });
+
+ UniformStructCase('array_member_dynamic_index', "Struct with array member, dynamic indexing", false,
+ '${HEADER}\n' +
+ 'uniform int ui_zero;\n' +
+ 'uniform int ui_one;\n' +
+ 'uniform int ui_two;\n' +
+ '' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' mediump float b[3];\n' +
+ ' int c;\n' +
+ '};\n' +
+ 'uniform S s;\n' +
+ '' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' ${DST} = vec4(s.b[ui_one], s.b[ui_zero], s.b[ui_two], s.c);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}',
+ function(programID, constCoords) {
+ es3fShaderStructTests.setUniform1f(programID, "s.a", constCoords[3]);
+ es3fShaderStructTests.setUniform1i(programID, "s.c", 1);
+
+ /** @type {Array<number>} */ var b = [];
+ b[0] = constCoords[2];
+ b[1] = constCoords[1];
+ b[2] = constCoords[0];
+ es3fShaderStructTests.setUniform1fv(programID, "s.b", b);
+ },
+ function(c) {
+ c.color[0] = c.constCoords[1];
+ c.color[1] = c.constCoords[2];
+ c.color[2] = c.constCoords[0];
+ });
+
+ UniformStructCase('struct_array', "Struct array", false,
+ '${HEADER}\n' +
+ 'uniform int ui_zero;\n' +
+ 'uniform int ui_one;\n' +
+ 'uniform int ui_two;\n' +
+ '' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' mediump int b;\n' +
+ '};\n' +
+ 'uniform S s[3];\n' +
+ '' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' ${DST} = vec4(s[2].a, s[1].a, s[0].a, s[2].b - s[1].b + s[0].b);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}',
+ function(programID, constCoords) {
+ es3fShaderStructTests.setUniform1f(programID, "s[0].a", constCoords[0]);
+ es3fShaderStructTests.setUniform1i(programID, "s[0].b", 0);
+ es3fShaderStructTests.setUniform1f(programID, "s[1].a", constCoords[1]);
+ es3fShaderStructTests.setUniform1i(programID, "s[1].b", 1);
+ es3fShaderStructTests.setUniform1f(programID, "s[2].a", constCoords[2]);
+ es3fShaderStructTests.setUniform1i(programID, "s[2].b", 2);
+ },
+ function(c) {
+ c.color[0] = c.constCoords[2];
+ c.color[1] = c.constCoords[1];
+ c.color[2] = c.constCoords[0];
+ });
+
+ UniformStructCase('struct_array_dynamic_index', "Struct array with dynamic indexing", false,
+ '${HEADER}\n' +
+ 'uniform int ui_zero;\n' +
+ 'uniform int ui_one;\n' +
+ 'uniform int ui_two;\n' +
+ '' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' mediump int b;\n' +
+ '};\n' +
+ 'uniform S s[3];\n' +
+ '' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' ${DST} = vec4(s[ui_two].a, s[ui_one].a, s[ui_zero].a, s[ui_two].b - s[ui_one].b + s[ui_zero].b);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}',
+ function(programID, constCoords) {
+ es3fShaderStructTests.setUniform1f(programID, "s[0].a", constCoords[0]);
+ es3fShaderStructTests.setUniform1i(programID, "s[0].b", 0);
+ es3fShaderStructTests.setUniform1f(programID, "s[1].a", constCoords[1]);
+ es3fShaderStructTests.setUniform1i(programID, "s[1].b", 1);
+ es3fShaderStructTests.setUniform1f(programID, "s[2].a", constCoords[2]);
+ es3fShaderStructTests.setUniform1i(programID, "s[2].b", 2);
+ },
+ function(c) {
+ c.color[0] = c.constCoords[2];
+ c.color[1] = c.constCoords[1];
+ c.color[2] = c.constCoords[0];
+ });
+
+ UniformStructCase('nested_struct_array', "Nested struct array", false,
+ '${HEADER}\n' +
+ 'struct T {\n' +
+ ' mediump float a;\n' +
+ ' mediump vec2 b[2];\n' +
+ '};\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' T b[3];\n' +
+ ' int c;\n' +
+ '};\n' +
+ 'uniform S s[2];\n' +
+ '' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' mediump float r = (s[0].b[1].b[0].x + s[1].b[2].b[1].y) * s[0].b[0].a; // (z + z) * 0.5\n' +
+ ' mediump float g = s[1].b[0].b[0].y * s[0].b[2].a * s[1].b[2].a; // x * 0.25 * 4\n' +
+ ' mediump float b = (s[0].b[2].b[1].y + s[0].b[1].b[0].y + s[1].a) * s[0].b[1].a; // (w + w + w) * 0.333\n' +
+ ' mediump float a = float(s[0].c) + s[1].b[2].a - s[1].b[1].a; // 0 + 4.0 - 3.0\n' +
+ ' ${DST} = vec4(r, g, b, a);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}',
+ function(programID, constCoords) {
+ /** @type {Array<number>} */ var arr = [];
+
+ es3fShaderStructTests.setUniform1f(programID, "s[0].a", constCoords[0]);
+ arr = deMath.swizzle(constCoords, [0,1,2,3]);
+ es3fShaderStructTests.setUniform1f(programID, "s[0].b[0].a", 0.5);
+ es3fShaderStructTests.setUniform2fv(programID, "s[0].b[0].b", arr);
+ arr = deMath.swizzle(constCoords, [2,3,0,1]);
+ es3fShaderStructTests.setUniform1f(programID, "s[0].b[1].a", 1.0/3.0);
+ es3fShaderStructTests.setUniform2fv(programID, "s[0].b[1].b", arr);
+ arr = deMath.swizzle(constCoords, [0,2,1,3]);
+ es3fShaderStructTests.setUniform1f(programID, "s[0].b[2].a", 1.0/4.0);
+ es3fShaderStructTests.setUniform2fv(programID, "s[0].b[2].b", arr);
+ es3fShaderStructTests.setUniform1i(programID, "s[0].c", 0);
+
+ es3fShaderStructTests.setUniform1f(programID, "s[1].a", constCoords[3]);
+ arr = deMath.swizzle(constCoords, [0,0,1,1]);
+ es3fShaderStructTests.setUniform1f(programID, "s[1].b[0].a", 2.0);
+ es3fShaderStructTests.setUniform2fv(programID, "s[1].b[0].b", arr);
+ arr = deMath.swizzle(constCoords, [2,2,3,3]);
+ es3fShaderStructTests.setUniform1f(programID, "s[1].b[1].a", 3.0);
+ es3fShaderStructTests.setUniform2fv(programID, "s[1].b[1].b", arr);
+ arr = deMath.swizzle(constCoords, [1,0,3,2]);
+ es3fShaderStructTests.setUniform1f(programID, "s[1].b[2].a", 4.0);
+ es3fShaderStructTests.setUniform2fv(programID, "s[1].b[2].b", arr);
+ es3fShaderStructTests.setUniform1i(programID, "s[1].c", 1);
+ },
+ function(c) {
+ c.color[0] = c.constCoords[2];
+ c.color[1] = c.constCoords[0];
+ c.color[2] = c.constCoords[3];
+ });
+
+ UniformStructCase('nested_struct_array_dynamic_index', "Nested struct array with dynamic indexing", false,
+ '${HEADER}\n' +
+ 'uniform int ui_zero;\n' +
+ 'uniform int ui_one;\n' +
+ 'uniform int ui_two;\n' +
+ '' +
+ 'struct T {\n' +
+ ' mediump float a;\n' +
+ ' mediump vec2 b[2];\n' +
+ '};\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' T b[3];\n' +
+ ' int c;\n' +
+ '};\n' +
+ 'uniform S s[2];\n' +
+ '' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' mediump float r = (s[0].b[ui_one].b[ui_one-1].x + s[ui_one].b[ui_two].b[ui_zero+1].y) * s[0].b[0].a; // (z + z) * 0.5\n' +
+ ' mediump float g = s[ui_two-1].b[ui_two-2].b[ui_zero].y * s[0].b[ui_two].a * s[ui_one].b[2].a; // x * 0.25 * 4\n' +
+ ' mediump float b = (s[ui_zero].b[ui_one+1].b[1].y + s[0].b[ui_one*ui_one].b[0].y + s[ui_one].a) * s[0].b[ui_two-ui_one].a; // (w + w + w) * 0.333\n' +
+ ' mediump float a = float(s[ui_zero].c) + s[ui_one-ui_zero].b[ui_two].a - s[ui_zero+ui_one].b[ui_two-ui_one].a; // 0 + 4.0 - 3.0\n' +
+ ' ${DST} = vec4(r, g, b, a);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}',
+ function(programID, constCoords){
+ /** @type {Array<number>} */ var arr = [];
+
+ es3fShaderStructTests.setUniform1f(programID, "s[0].a", constCoords[0]);
+ arr = constCoords;
+ es3fShaderStructTests.setUniform1f(programID, "s[0].b[0].a", 0.5);
+ es3fShaderStructTests.setUniform2fv(programID, "s[0].b[0].b", arr);
+ arr = deMath.swizzle(constCoords, [2,3,0,1]);
+ es3fShaderStructTests.setUniform1f(programID, "s[0].b[1].a", 1.0/3.0);
+ es3fShaderStructTests.setUniform2fv(programID, "s[0].b[1].b", arr);
+ arr = deMath.swizzle(constCoords, [0,2,1,3]);
+ es3fShaderStructTests.setUniform1f(programID, "s[0].b[2].a", 1.0/4.0);
+ es3fShaderStructTests.setUniform2fv(programID, "s[0].b[2].b", arr);
+ es3fShaderStructTests.setUniform1i(programID, "s[0].c", 0);
+
+ es3fShaderStructTests.setUniform1f(programID, "s[1].a", constCoords[3]);
+ arr = deMath.swizzle(constCoords, [0,0,1,1]);
+ es3fShaderStructTests.setUniform1f(programID, "s[1].b[0].a", 2.0);
+ es3fShaderStructTests.setUniform2fv(programID, "s[1].b[0].b", arr);
+ arr = deMath.swizzle(constCoords, [2,2,3,3]);
+ es3fShaderStructTests.setUniform1f(programID, "s[1].b[1].a", 3.0);
+ es3fShaderStructTests.setUniform2fv(programID, "s[1].b[1].b", arr);
+ arr = deMath.swizzle(constCoords, [1,0,3,2]);
+ es3fShaderStructTests.setUniform1f(programID, "s[1].b[2].a", 4.0);
+ es3fShaderStructTests.setUniform2fv(programID, "s[1].b[2].b", arr);
+ es3fShaderStructTests.setUniform1i(programID, "s[1].c", 1);
+ },
+ function(c) {
+ c.color[0] = c.constCoords[2];
+ c.color[1] = c.constCoords[0];
+ c.color[2] = c.constCoords[3];
+ });
+
+ UniformStructCase('loop_struct_array', "Struct array usage in loop", false,
+ '${HEADER}\n' +
+ 'uniform int ui_zero;\n' +
+ 'uniform int ui_one;\n' +
+ 'uniform int ui_two;\n' +
+ '' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' mediump int b;\n' +
+ '};\n' +
+ 'uniform S s[3];\n' +
+ '' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' mediump float rgb[3];\n' +
+ ' int alpha = 0;\n' +
+ ' for (int i = 0; i < 3; i++)\n' +
+ ' {\n' +
+ ' rgb[i] = s[2-i].a;\n' +
+ ' alpha += s[i].b;\n' +
+ ' }\n' +
+ ' ${DST} = vec4(rgb[0], rgb[1], rgb[2], alpha);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}',
+ function(programID, constCoords) {
+ es3fShaderStructTests.setUniform1f(programID, "s[0].a", constCoords[0]);
+ es3fShaderStructTests.setUniform1i(programID, "s[0].b", 0);
+ es3fShaderStructTests.setUniform1f(programID, "s[1].a", constCoords[1]);
+ es3fShaderStructTests.setUniform1i(programID, "s[1].b", -1);
+ es3fShaderStructTests.setUniform1f(programID, "s[2].a", constCoords[2]);
+ es3fShaderStructTests.setUniform1i(programID, "s[2].b", 2);
+ },
+ function(c) {
+ c.color[0] = c.constCoords[2];
+ c.color[1] = c.constCoords[1];
+ c.color[2] = c.constCoords[0];
+ });
+
+ UniformStructCase('loop_nested_struct_array', "Nested struct array usage in loop", false,
+ '${HEADER}\n' +
+ 'uniform int ui_zero;\n' +
+ 'uniform int ui_one;\n' +
+ 'uniform int ui_two;\n' +
+ 'uniform mediump float uf_two;\n' +
+ 'uniform mediump float uf_three;\n' +
+ 'uniform mediump float uf_four;\n' +
+ 'uniform mediump float uf_half;\n' +
+ 'uniform mediump float uf_third;\n' +
+ 'uniform mediump float uf_fourth;\n' +
+ 'uniform mediump float uf_sixth;\n' +
+ '' +
+ 'struct T {\n' +
+ ' mediump float a;\n' +
+ ' mediump vec2 b[2];\n' +
+ '};\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' T b[3];\n' +
+ ' int c;\n' +
+ '};\n' +
+ 'uniform S s[2];\n' +
+ '' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' mediump float r = 0.0; // (x*3 + y*3) / 6.0\n' +
+ ' mediump float g = 0.0; // (y*3 + z*3) / 6.0\n' +
+ ' mediump float b = 0.0; // (z*3 + w*3) / 6.0\n' +
+ ' mediump float a = 1.0;\n' +
+ ' for (int i = 0; i < 2; i++)\n' +
+ ' {\n' +
+ ' for (int j = 0; j < 3; j++)\n' +
+ ' {\n' +
+ ' r += s[0].b[j].b[i].y;\n' +
+ ' g += s[i].b[j].b[0].x;\n' +
+ ' b += s[i].b[j].b[1].x;\n' +
+ ' a *= s[i].b[j].a;\n' +
+ ' }\n' +
+ ' }\n' +
+ ' ${DST} = vec4(r*uf_sixth, g*uf_sixth, b*uf_sixth, a);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}',
+ function(programID, constCoords) {
+ /** @type {Array<number>} */ var arr = [];
+
+ es3fShaderStructTests.setUniform1f(programID, "s[0].a", constCoords[0]);
+ arr = deMath.swizzle(constCoords, [1,0,2,0]);
+ es3fShaderStructTests.setUniform1f(programID, "s[0].b[0].a", 0.5);
+ es3fShaderStructTests.setUniform2fv(programID, "s[0].b[0].b", arr);
+ arr = deMath.swizzle(constCoords, [1,1,3,1]);
+ es3fShaderStructTests.setUniform1f(programID, "s[0].b[1].a", 1.0/3.0);
+ es3fShaderStructTests.setUniform2fv(programID, "s[0].b[1].b", arr);
+ arr = deMath.swizzle(constCoords, [2,1,2,1]);
+ es3fShaderStructTests.setUniform1f(programID, "s[0].b[2].a", 1.0/4.0);
+ es3fShaderStructTests.setUniform2fv(programID, "s[0].b[2].b", arr);
+ es3fShaderStructTests.setUniform1i(programID, "s[0].c", 0);
+
+ es3fShaderStructTests.setUniform1f(programID, "s[1].a", constCoords[3]);
+ arr = deMath.swizzle(constCoords, [2,0,2,1]);
+ es3fShaderStructTests.setUniform1f(programID, "s[1].b[0].a", 2.0);
+ es3fShaderStructTests.setUniform2fv(programID, "s[1].b[0].b", arr);
+ arr = deMath.swizzle(constCoords, [2,2,3,3]);
+ es3fShaderStructTests.setUniform1f(programID, "s[1].b[1].a", 3.0);
+ es3fShaderStructTests.setUniform2fv(programID, "s[1].b[1].b", arr);
+ arr = deMath.swizzle(constCoords, [1,0,3,2]);
+ es3fShaderStructTests.setUniform1f(programID, "s[1].b[2].a", 4.0);
+ es3fShaderStructTests.setUniform2fv(programID, "s[1].b[2].b", arr);
+ es3fShaderStructTests.setUniform1i(programID, "s[1].c", 1);
+ },
+ function(c) {
+ c.color[0] = (c.constCoords[0] + c.constCoords[1]) * 0.5;
+ c.color[1] = (c.constCoords[1] + c.constCoords[2]) * 0.5;
+ c.color[2] = (c.constCoords[2] + c.constCoords[3]) * 0.5;
+ });
+
+ UniformStructCase('dynamic_loop_struct_array', "Struct array usage in dynamic loop", false,
+ '${HEADER}\n' +
+ 'uniform int ui_zero;\n' +
+ 'uniform int ui_one;\n' +
+ 'uniform int ui_two;\n' +
+ 'uniform int ui_three;\n' +
+ '' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' mediump int b;\n' +
+ '};\n' +
+ 'uniform S s[3];\n' +
+ '' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' mediump float rgb[3];\n' +
+ ' int alpha = 0;\n' +
+ ' for (int i = 0; i < ui_three; i++)\n' +
+ ' {\n' +
+ ' rgb[i] = s[2-i].a;\n' +
+ ' alpha += s[i].b;\n' +
+ ' }\n' +
+ ' ${DST} = vec4(rgb[0], rgb[1], rgb[2], alpha);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}',
+ function(programID, constCoords) {
+ es3fShaderStructTests.setUniform1f(programID, "s[0].a", constCoords[0]);
+ es3fShaderStructTests.setUniform1i(programID, "s[0].b", 0);
+ es3fShaderStructTests.setUniform1f(programID, "s[1].a", constCoords[1]);
+ es3fShaderStructTests.setUniform1i(programID, "s[1].b", -1);
+ es3fShaderStructTests.setUniform1f(programID, "s[2].a", constCoords[2]);
+ es3fShaderStructTests.setUniform1i(programID, "s[2].b", 2);
+ },
+ function(c) {
+ c.color[0] = c.constCoords[2];
+ c.color[1] = c.constCoords[1];
+ c.color[2] = c.constCoords[0];
+ });
+
+ UniformStructCase('dynamic_loop_nested_struct_array', "Nested struct array usage in dynamic loop", false,
+ '${HEADER}\n' +
+ 'uniform int ui_zero;\n' +
+ 'uniform int ui_one;\n' +
+ 'uniform int ui_two;\n' +
+ 'uniform int ui_three;\n' +
+ 'uniform mediump float uf_two;\n' +
+ 'uniform mediump float uf_three;\n' +
+ 'uniform mediump float uf_four;\n' +
+ 'uniform mediump float uf_half;\n' +
+ 'uniform mediump float uf_third;\n' +
+ 'uniform mediump float uf_fourth;\n' +
+ 'uniform mediump float uf_sixth;\n' +
+ '' +
+ 'struct T {\n' +
+ ' mediump float a;\n' +
+ ' mediump vec2 b[2];\n' +
+ '};\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' T b[3];\n' +
+ ' int c;\n' +
+ '};\n' +
+ 'uniform S s[2];\n' +
+ '' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' mediump float r = 0.0; // (x*3 + y*3) / 6.0\n' +
+ ' mediump float g = 0.0; // (y*3 + z*3) / 6.0\n' +
+ ' mediump float b = 0.0; // (z*3 + w*3) / 6.0\n' +
+ ' mediump float a = 1.0;\n' +
+ ' for (int i = 0; i < ui_two; i++)\n' +
+ ' {\n' +
+ ' for (int j = 0; j < ui_three; j++)\n' +
+ ' {\n' +
+ ' r += s[0].b[j].b[i].y;\n' +
+ ' g += s[i].b[j].b[0].x;\n' +
+ ' b += s[i].b[j].b[1].x;\n' +
+ ' a *= s[i].b[j].a;\n' +
+ ' }\n' +
+ ' }\n' +
+ ' ${DST} = vec4(r*uf_sixth, g*uf_sixth, b*uf_sixth, a);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}',
+ function(programID, constCoords) {
+ /** @type {Array<number>} */ var arr = [];
+
+ es3fShaderStructTests.setUniform1f(programID, "s[0].a", constCoords[0]);
+ arr = deMath.swizzle(constCoords, [1,0,2,0]);
+ es3fShaderStructTests.setUniform1f(programID, "s[0].b[0].a", 0.5);
+ es3fShaderStructTests.setUniform2fv(programID, "s[0].b[0].b", arr);
+ arr = deMath.swizzle(constCoords, [1,1,3,1]);
+ es3fShaderStructTests.setUniform1f(programID, "s[0].b[1].a", 1.0/3.0);
+ es3fShaderStructTests.setUniform2fv(programID, "s[0].b[1].b", arr);
+ arr = deMath.swizzle(constCoords, [2,1,2,1]);
+ es3fShaderStructTests.setUniform1f(programID, "s[0].b[2].a", 1.0/4.0);
+ es3fShaderStructTests.setUniform2fv(programID, "s[0].b[2].b", arr);
+ es3fShaderStructTests.setUniform1i(programID, "s[0].c", 0);
+
+ es3fShaderStructTests.setUniform1f(programID, "s[1].a", constCoords[3]);
+ arr = deMath.swizzle(constCoords, [2,0,2,1]);
+ es3fShaderStructTests.setUniform1f(programID, "s[1].b[0].a", 2.0);
+ es3fShaderStructTests.setUniform2fv(programID, "s[1].b[0].b", arr);
+ arr = deMath.swizzle(constCoords, [2,2,3,3]);
+ es3fShaderStructTests.setUniform1f(programID, "s[1].b[1].a", 3.0);
+ es3fShaderStructTests.setUniform2fv(programID, "s[1].b[1].b", arr);
+ arr = deMath.swizzle(constCoords, [1,0,3,2]);
+ es3fShaderStructTests.setUniform1f(programID, "s[1].b[2].a", 4.0);
+ es3fShaderStructTests.setUniform2fv(programID, "s[1].b[2].b", arr);
+ es3fShaderStructTests.setUniform1i(programID, "s[1].c", 1);
+ },
+ function(c) {
+ c.color[0] = (c.constCoords[0] + c.constCoords[1]) * 0.5;
+ c.color[1] = (c.constCoords[1] + c.constCoords[2]) * 0.5;
+ c.color[2] = (c.constCoords[2] + c.constCoords[3]) * 0.5;
+ });
+
+ UniformStructCase('sampler', "Sampler in struct", true,
+ '${HEADER}\n' +
+ 'uniform int ui_one;\n' +
+ '' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' mediump vec3 b;\n' +
+ ' sampler2D c;\n' +
+ '};\n' +
+ 'uniform S s;\n' +
+ '' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' ${DST} = vec4(texture(s.c, ${COORDS}.xy * s.b.xy + s.b.z).rgb, s.a);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}',
+ function(programID, constCoords) {
+ es3fShaderStructTests.setUniform1f(programID, "s.a", 1.0);
+ es3fShaderStructTests.setUniform3fv(programID, "s.b", [0.25, 0.25, 0.5]);
+ es3fShaderStructTests.setUniform1i(programID, "s.c", 0);
+ },
+ function(c) {
+ var tex2d = c.texture2D(es3fShaderStructTests.TEXTURE_BRICK, deMath.addScalar(deMath.scale(deMath.swizzle(c.coords, [0,1]), 0.25), 0.5))
+
+ c.color[0] = tex2d[0];
+ c.color[1] = tex2d[1];
+ c.color[2] = tex2d[2];
+ });
+
+ UniformStructCase('sampler_nested', "Sampler in nested struct", true,
+ '${HEADER}\n' +
+ 'uniform int ui_zero;\n' +
+ 'uniform int ui_one;\n' +
+ '' +
+ 'struct T {\n' +
+ ' sampler2D a;\n' +
+ ' mediump vec2 b;\n' +
+ '};\n' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' T b;\n' +
+ ' int c;\n' +
+ '};\n' +
+ 'uniform S s;\n' +
+ '' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' ${DST} = vec4(texture(s.b.a, ${COORDS}.xy * s.b.b + s.a).rgb, s.c);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}',
+ function(programID, constCoords) {
+ es3fShaderStructTests.setUniform1f(programID, "s.a", 0.5);
+ es3fShaderStructTests.setUniform1i(programID, "s.b.a", 0);
+ es3fShaderStructTests.setUniform2fv(programID, "s.b.b", [0.25, 0.25]);
+ es3fShaderStructTests.setUniform1i(programID, "s.c", 1);
+ },
+ function(c) {
+ var tex2d = c.texture2D(es3fShaderStructTests.TEXTURE_BRICK, deMath.addScalar(deMath.scale(deMath.swizzle(c.coords, [0,1]), 0.25), 0.5));
+ c.color[0] = tex2d[0];
+ c.color[1] = tex2d[1];
+ c.color[2] = tex2d[2];
+ });
+
+ UniformStructCase('sampler_array', "Sampler in struct array", true,
+ '${HEADER}\n' +
+ 'uniform int ui_one;\n' +
+ '' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' mediump vec3 b;\n' +
+ ' sampler2D c;\n' +
+ '};\n' +
+ 'uniform S s[2];\n' +
+ '' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' ${DST} = vec4(texture(s[1].c, ${COORDS}.xy * s[0].b.xy + s[1].b.z).rgb, s[0].a);\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}',
+ function(programID, constCoords) {
+ es3fShaderStructTests.setUniform1f(programID, "s[0].a", 1.0);
+ es3fShaderStructTests.setUniform3fv(programID, "s[0].b", [0.25, 0.25, 0.25]);
+ es3fShaderStructTests.setUniform1i(programID, "s[0].c", 1);
+ es3fShaderStructTests.setUniform1f(programID, "s[1].a", 0.0);
+ es3fShaderStructTests.setUniform3fv(programID, "s[1].b", [0.5, 0.5, 0.5]);
+ es3fShaderStructTests.setUniform1i(programID, "s[1].c", 0);
+ },
+ function(c) {
+ var tex2d = c.texture2D(es3fShaderStructTests.TEXTURE_BRICK, deMath.addScalar(deMath.scale(deMath.swizzle(c.coords, [0,1]), 0.25), 0.5));
+ c.color[0] = tex2d[0];
+ c.color[1] = tex2d[1];
+ c.color[2] = tex2d[2];
+ });
+
+ UniformStructCase('equal', "Struct equality", false,
+ '${HEADER}\n' +
+ 'uniform mediump float uf_one;\n' +
+ 'uniform int ui_two;\n' +
+ '' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' mediump vec3 b;\n' +
+ ' int c;\n' +
+ '};\n' +
+ 'uniform S a;\n' +
+ 'uniform S b;\n' +
+ 'uniform S c;\n' +
+ '' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' S d = S(uf_one, vec3(0.0, floor(${COORDS}.y+1.0), 2.0), ui_two);\n' +
+ ' ${DST} = vec4(0.0, 0.0, 0.0, 1.0);\n' +
+ ' if (a == b) ${DST}.x = 1.0;\n' +
+ ' if (a == c) ${DST}.y = 1.0;\n' +
+ ' if (a == d) ${DST}.z = 1.0;\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}',
+ function(programID, constCoords) {
+ es3fShaderStructTests.setUniform1f(programID, "a.a", 1.0);
+ es3fShaderStructTests.setUniform3fv(programID, "a.b", [0.0, 1.0, 2.0]);
+ es3fShaderStructTests.setUniform1i(programID, "a.c", 2);
+ es3fShaderStructTests.setUniform1f(programID, "b.a", 1.0);
+ es3fShaderStructTests.setUniform3fv(programID, "b.b", [0.0, 1.0, 2.0]);
+ es3fShaderStructTests.setUniform1i(programID, "b.c", 2);
+ es3fShaderStructTests.setUniform1f(programID, "c.a", 1.0);
+ es3fShaderStructTests.setUniform3fv(programID, "c.b", [0.0, 1.1, 2.0]);
+ es3fShaderStructTests.setUniform1i(programID, "c.c", 2);
+ },
+ function(c) {
+ c.color[0] = 1.0;
+ c.color[1] = 0.0;
+ if (Math.floor(c.coords[1] + 1.0) == Math.floor(1.1))
+ c.color[2] = 1.0;
+ });
+
+ UniformStructCase('not_equal', "Struct equality", false,
+ '${HEADER}\n' +
+ 'uniform mediump float uf_one;\n' +
+ 'uniform int ui_two;\n' +
+ '' +
+ 'struct S {\n' +
+ ' mediump float a;\n' +
+ ' mediump vec3 b;\n' +
+ ' int c;\n' +
+ '};\n' +
+ 'uniform S a;\n' +
+ 'uniform S b;\n' +
+ 'uniform S c;\n' +
+ '' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' S d = S(uf_one, vec3(0.0, floor(${COORDS}.y+1.0), 2.0), ui_two);\n' +
+ ' ${DST} = vec4(0.0, 0.0, 0.0, 1.0);\n' +
+ ' if (a != b) ${DST}.x = 1.0;\n' +
+ ' if (a != c) ${DST}.y = 1.0;\n' +
+ ' if (a != d) ${DST}.z = 1.0;\n' +
+ ' ${ASSIGN_POS}\n' +
+ '}',
+ function(programID, constCoords) {
+ es3fShaderStructTests.setUniform1f(programID, "a.a", 1.0);
+ es3fShaderStructTests.setUniform3fv(programID, "a.b", [0.0, 1.0, 2.0]);
+ es3fShaderStructTests.setUniform1i(programID, "a.c", 2);
+ es3fShaderStructTests.setUniform1f(programID, "b.a", 1.0);
+ es3fShaderStructTests.setUniform3fv(programID, "b.b", [0.0, 1.0, 2.0]);
+ es3fShaderStructTests.setUniform1i(programID, "b.c", 2);
+ es3fShaderStructTests.setUniform1f(programID, "c.a", 1.0);
+ es3fShaderStructTests.setUniform3fv(programID, "c.b", [0.0, 1.1, 2.0]);
+ es3fShaderStructTests.setUniform1i(programID, "c.c", 2);
+ },
+ function(c) {
+ c.color[0] = 0.0;
+ c.color[1] = 1.0;
+ if (Math.floor(c.coords[1] + 1.0) != Math.floor(1.1))
+ c.color[2] = 1.0;
+ });
+
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fShaderStructTests.ShaderStructTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'struct', 'Struct Tests');
+ };
+
+ es3fShaderStructTests.ShaderStructTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fShaderStructTests.ShaderStructTests.prototype.constructor = es3fShaderStructTests.ShaderStructTests;
+
+ es3fShaderStructTests.ShaderStructTests.prototype.init = function() {
+ this.addChild(new es3fShaderStructTests.LocalStructTests());
+ this.addChild(new es3fShaderStructTests.UniformStructTests());
+ };
+
+ /**
+ * Run test
+ * @param {WebGL2RenderingContext} context
+ */
+ es3fShaderStructTests.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fShaderStructTests.ShaderStructTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+ try {
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fShaderStructTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderSwitchTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderSwitchTests.js
new file mode 100644
index 0000000000..27670f9d64
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderSwitchTests.js
@@ -0,0 +1,492 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fShaderSwitchTests');
+goog.require('framework.common.tcuStringTemplate');
+goog.require('framework.common.tcuTestCase');
+goog.require('modules.shared.glsShaderRenderCase');
+
+
+goog.scope(function() {
+ var es3fShaderSwitchTests = functional.gles3.es3fShaderSwitchTests;
+ var glsShaderRenderCase = modules.shared.glsShaderRenderCase;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var tcuStringTemplate = framework.common.tcuStringTemplate;
+
+ /**
+ * @constructor
+ * @extends {glsShaderRenderCase.ShaderRenderCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {boolean} isVertexCase
+ * @param {string} vtxSource
+ * @param {string} fragSource
+ * @param {glsShaderRenderCase.ShaderEvalFunc=} evalFunc
+ */
+ es3fShaderSwitchTests.ShaderSwitchCase = function(name, description, isVertexCase, vtxSource, fragSource, evalFunc) {
+ glsShaderRenderCase.ShaderRenderCase.call(this, name, description, isVertexCase, evalFunc);
+ /** @type {string} */ this.m_vertShaderSource = vtxSource;
+ /** @type {string} */ this.m_fragShaderSource = fragSource;
+ };
+
+ es3fShaderSwitchTests.ShaderSwitchCase.prototype = Object.create(glsShaderRenderCase.ShaderRenderCase.prototype);
+ es3fShaderSwitchTests.ShaderSwitchCase.prototype.constructor = es3fShaderSwitchTests.ShaderSwitchCase;
+
+ /**
+ * @enum {number}
+ */
+ es3fShaderSwitchTests.SwitchType = {
+ STATIC: 0,
+ UNIFORM: 1,
+ DYNAMIC: 2
+ };
+
+ /** @param {glsShaderRenderCase.ShaderEvalContext} evalCtx */
+ es3fShaderSwitchTests.evalSwitchStatic = function(evalCtx) {
+ evalCtx.color[0] = evalCtx.coords[1];
+ evalCtx.color[1] = evalCtx.coords[2];
+ evalCtx.color[2] = evalCtx.coords[3];
+ };
+
+ /** @param {glsShaderRenderCase.ShaderEvalContext} evalCtx */
+ es3fShaderSwitchTests.evalSwitchUniform = function(evalCtx) {
+ evalCtx.color[0] = evalCtx.coords[1];
+ evalCtx.color[1] = evalCtx.coords[2];
+ evalCtx.color[2] = evalCtx.coords[3];
+ };
+
+ /** @param {glsShaderRenderCase.ShaderEvalContext} evalCtx */
+ es3fShaderSwitchTests.evalSwitchDynamic = function(evalCtx) {
+ switch (Math.floor(evalCtx.coords[2]*1.5 + 2.0)) {
+ case 0:
+ evalCtx.color[0] = evalCtx.coords[0];
+ evalCtx.color[1] = evalCtx.coords[1];
+ evalCtx.color[2] = evalCtx.coords[2];
+ break;
+ case 1:
+ evalCtx.color[0] = evalCtx.coords[3];
+ evalCtx.color[1] = evalCtx.coords[2];
+ evalCtx.color[2] = evalCtx.coords[1];
+ break;
+ case 2:
+ evalCtx.color[0] = evalCtx.coords[1];
+ evalCtx.color[1] = evalCtx.coords[2];
+ evalCtx.color[2] = evalCtx.coords[3];
+ break;
+ case 3:
+ evalCtx.color[0] = evalCtx.coords[2];
+ evalCtx.color[1] = evalCtx.coords[1];
+ evalCtx.color[2] = evalCtx.coords[0];
+ break;
+ default:
+ evalCtx.color[0] = evalCtx.coords[0];
+ evalCtx.color[1] = evalCtx.coords[0];
+ evalCtx.color[2] = evalCtx.coords[0];
+ break;
+ }
+ };
+
+ /**
+ * @param {string} name
+ * @param {string} desc
+ * @param {es3fShaderSwitchTests.SwitchType} type
+ * @param {boolean} isVertex
+ * @param {string} switchBody
+ * @return {es3fShaderSwitchTests.ShaderSwitchCase}
+ */
+ es3fShaderSwitchTests.makeSwitchCase = function(name, desc, type, isVertex, switchBody) {
+ /** @type {string} */ var vtx = '';
+ /** @type {string} */ var frag = '';
+ /** @type {string} */ var op = '';
+
+ vtx += "#version 300 es\n" +
+ "in highp vec4 a_position;\n" +
+ "in highp vec4 a_coords;\n";
+ frag += "#version 300 es\n" +
+ "layout(location = 0) out mediump vec4 o_color;\n";
+
+ if (isVertex) {
+ vtx += "out mediump vec4 v_color;\n";
+ frag += "in mediump vec4 v_color;\n";
+ } else {
+ vtx += "out highp vec4 v_coords;\n";
+ frag += "in highp vec4 v_coords;\n";
+ }
+
+ if (type === es3fShaderSwitchTests.SwitchType.UNIFORM)
+ op += "uniform highp int ui_two;\n";
+
+ vtx += isVertex ? op : '';
+ frag += isVertex ? '' : op;
+ op = '';
+
+ vtx += "\n" +
+ "void main (void)\n" +
+ "{\n" +
+ " gl_Position = a_position;\n";
+ frag += "\n" +
+ "void main (void)\n" +
+ "{\n";
+
+ // Setup.
+ op += " highp vec4 coords = " + (isVertex ? "a_coords" : "v_coords") + ";\n";
+ op += " mediump vec3 res = vec3(0.0);\n\n";
+ vtx += isVertex ? op : '';
+ frag += isVertex ? '' : op;
+ op = '';
+
+ // Switch body.
+ var params = {};
+ params["CONDITION"] = type == es3fShaderSwitchTests.SwitchType.STATIC ? "2" :
+ type == es3fShaderSwitchTests.SwitchType.UNIFORM ? "ui_two" :
+ type == es3fShaderSwitchTests.SwitchType.DYNAMIC ? "int(floor(coords.z*1.5 + 2.0))" : "???";
+
+ op += tcuStringTemplate.specialize(switchBody, params);
+ op += "\n";
+
+ vtx += isVertex ? op : '';
+ frag += isVertex ? '' : op;
+ op = '';
+
+ if (isVertex) {
+ vtx += " v_color = vec4(res, 1.0);\n";
+ frag += " o_color = v_color;\n";
+ } else {
+ vtx += " v_coords = a_coords;\n";
+ frag += " o_color = vec4(res, 1.0);\n";
+ }
+
+ vtx += "}\n";
+ frag += "}\n";
+
+ return new es3fShaderSwitchTests.ShaderSwitchCase(name, desc, isVertex, vtx, frag,
+ type === es3fShaderSwitchTests.SwitchType.STATIC ? es3fShaderSwitchTests.evalSwitchStatic :
+ type === es3fShaderSwitchTests.SwitchType.UNIFORM ? es3fShaderSwitchTests.evalSwitchUniform :
+ type === es3fShaderSwitchTests.SwitchType.DYNAMIC ? es3fShaderSwitchTests.evalSwitchDynamic : undefined);
+ };
+
+ /**
+ * @param {tcuTestCase.DeqpTest} group
+ * @param {string} name
+ * @param {string} desc
+ * @param {string} switchBody
+ */
+ es3fShaderSwitchTests.makeSwitchCases = function(group, name, desc, switchBody) {
+ /** @type {Array<string>} */ var switchTypeNames = ["static", "uniform", "dynamic"];
+ for (var type in es3fShaderSwitchTests.SwitchType) {
+ group.addChild(es3fShaderSwitchTests.makeSwitchCase(name + "_" + switchTypeNames[es3fShaderSwitchTests.SwitchType[type]] + "_vertex", desc, es3fShaderSwitchTests.SwitchType[type], true, switchBody));
+ group.addChild(es3fShaderSwitchTests.makeSwitchCase(name + "_" + switchTypeNames[es3fShaderSwitchTests.SwitchType[type]] + "_fragment", desc, es3fShaderSwitchTests.SwitchType[type], false, switchBody));
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fShaderSwitchTests.ShaderSwitchTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'switch', 'Switch statement tests');
+ };
+
+ es3fShaderSwitchTests.ShaderSwitchTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fShaderSwitchTests.ShaderSwitchTests.prototype.constructor = es3fShaderSwitchTests.ShaderSwitchTests;
+
+ es3fShaderSwitchTests.ShaderSwitchTests.prototype.init = function() {
+ // Expected swizzles:
+ // 0: xyz
+ // 1: wzy
+ // 2: yzw
+ // 3: zyx
+ es3fShaderSwitchTests.makeSwitchCases(this, "basic", "Basic switch statement usage",
+ ' switch (${CONDITION})\n' +
+ ' {\n' +
+ ' case 0: res = coords.xyz; break;\n' +
+ ' case 1: res = coords.wzy; break;\n' +
+ ' case 2: res = coords.yzw; break;\n' +
+ ' case 3: res = coords.zyx; break;\n' +
+ ' }\n');
+
+ es3fShaderSwitchTests.makeSwitchCases(this, "const_expr_in_label", "Constant expression in label",
+ ' const int t = 2;\n' +
+ ' switch (${CONDITION})\n' +
+ ' {\n' +
+ ' case int(0.0): res = coords.xyz; break;\n' +
+ ' case 2-1: res = coords.wzy; break;\n' +
+ ' case 3&(1<<1): res = coords.yzw; break;\n' +
+ ' case t+1: res = coords.zyx; break;\n' +
+ ' }\n');
+
+ es3fShaderSwitchTests.makeSwitchCases(this, "default_label", "Default label usage",
+ ' switch (${CONDITION})\n' +
+ ' {\n' +
+ ' case 0: res = coords.xyz; break;\n' +
+ ' case 1: res = coords.wzy; break;\n' +
+ ' case 3: res = coords.zyx; break;\n' +
+ ' default: res = coords.yzw;\n' +
+ ' }\n');
+
+ es3fShaderSwitchTests.makeSwitchCases(this, "default_not_last", "Default label usage",
+ ' switch (${CONDITION})\n' +
+ ' {\n' +
+ ' case 0: res = coords.xyz; break;\n' +
+ ' default: res = coords.yzw; break;\n' +
+ ' case 1: res = coords.wzy; break;\n' +
+ ' case 3: res = coords.zyx; break;\n' +
+ ' }\n');
+
+ es3fShaderSwitchTests.makeSwitchCases(this, "no_default_label", "No match in switch without default label",
+ ' res = coords.yzw;\n\n' +
+ ' switch (${CONDITION})\n' +
+ ' {\n' +
+ ' case 0: res = coords.xyz; break;\n' +
+ ' case 1: res = coords.wzy; break;\n' +
+ ' case 3: res = coords.zyx; break;\n' +
+ ' }\n');
+
+ es3fShaderSwitchTests.makeSwitchCases(this, "fall_through", "Fall-through",
+ ' switch (${CONDITION})\n' +
+ ' {\n' +
+ ' case 0: res = coords.xyz; break;\n' +
+ ' case 1: res = coords.wzy; break;\n' +
+ ' case 2: coords = coords.yzwx;\n' +
+ ' case 4: res = vec3(coords); break;\n' +
+ ' case 3: res = coords.zyx; break;\n' +
+ ' }\n');
+
+ es3fShaderSwitchTests.makeSwitchCases(this, "fall_through_default", "Fall-through",
+ ' switch (${CONDITION})\n' +
+ ' {\n' +
+ ' case 0: res = coords.xyz; break;\n' +
+ ' case 1: res = coords.wzy; break;\n' +
+ ' case 3: res = coords.zyx; break;\n' +
+ ' case 2: coords = coords.yzwx;\n' +
+ ' default: res = vec3(coords);\n' +
+ ' }\n');
+
+ es3fShaderSwitchTests.makeSwitchCases(this, "conditional_fall_through", "Fall-through",
+ ' highp vec4 tmp = coords;\n' +
+ ' switch (${CONDITION})\n' +
+ ' {\n' +
+ ' case 0: res = coords.xyz; break;\n' +
+ ' case 1: res = coords.wzy; break;\n' +
+ ' case 2:\n' +
+ ' tmp = coords.yzwx;\n' +
+ ' case 3:\n' +
+ ' res = vec3(tmp);\n' +
+ ' if (${CONDITION} != 3)\n' +
+ ' break;\n' +
+ ' default: res = tmp.zyx; break;\n' +
+ ' }\n');
+
+ es3fShaderSwitchTests.makeSwitchCases(this, "conditional_fall_through_2", "Fall-through",
+ ' highp vec4 tmp = coords;\n' +
+ ' mediump int c = ${CONDITION};\n' +
+ ' switch (c)\n' +
+ ' {\n' +
+ ' case 0: res = coords.xyz; break;\n' +
+ ' case 1: res = coords.wzy; break;\n' +
+ ' case 2:\n' +
+ ' c += ${CONDITION};\n' +
+ ' tmp = coords.yzwx;\n' +
+ ' case 3:\n' +
+ ' res = vec3(tmp);\n' +
+ ' if (c == 4)\n' +
+ ' break;\n' +
+ ' default: res = tmp.zyx; break;\n' +
+ ' }\n');
+
+ es3fShaderSwitchTests.makeSwitchCases(this, "scope", "Basic switch statement usage",
+ ' switch (${CONDITION})\n' +
+ ' {\n' +
+ ' case 0: res = coords.xyz; break;\n' +
+ ' case 1: res = coords.wzy; break;\n' +
+ ' case 2:\n' +
+ ' {\n' +
+ ' mediump vec3 t = coords.yzw;\n' +
+ ' res = t;\n' +
+ ' break;\n' +
+ ' }\n' +
+ ' case 3: res = coords.zyx; break;\n' +
+ ' }\n');
+
+ es3fShaderSwitchTests.makeSwitchCases(this, "switch_in_if", "Switch in for loop",
+ ' if (${CONDITION} >= 0)\n' +
+ ' {\n' +
+ ' switch (${CONDITION})\n' +
+ ' {\n' +
+ ' case 0: res = coords.xyz; break;\n' +
+ ' case 1: res = coords.wzy; break;\n' +
+ ' case 2: res = coords.yzw; break;\n' +
+ ' case 3: res = coords.zyx; break;\n' +
+ ' }\n' +
+ ' }\n');
+
+ es3fShaderSwitchTests.makeSwitchCases(this, "switch_in_for_loop", "Switch in for loop",
+ ' for (int i = 0; i <= ${CONDITION}; i++)\n' +
+ ' {\n' +
+ ' switch (i)\n' +
+ ' {\n' +
+ ' case 0: res = coords.xyz; break;\n' +
+ ' case 1: res = coords.wzy; break;\n' +
+ ' case 2: res = coords.yzw; break;\n' +
+ ' case 3: res = coords.zyx; break;\n' +
+ ' }\n' +
+ ' }\n');
+
+ es3fShaderSwitchTests.makeSwitchCases(this, "switch_in_while_loop", "Switch in while loop",
+ ' int i = 0;\n' +
+ ' while (i <= ${CONDITION})\n' +
+ ' {\n' +
+ ' switch (i)\n' +
+ ' {\n' +
+ ' case 0: res = coords.xyz; break;\n' +
+ ' case 1: res = coords.wzy; break;\n' +
+ ' case 2: res = coords.yzw; break;\n' +
+ ' case 3: res = coords.zyx; break;\n' +
+ ' }\n' +
+ ' i += 1;\n' +
+ ' }\n');
+
+ es3fShaderSwitchTests.makeSwitchCases(this, "switch_in_do_while_loop", "Switch in do-while loop",
+ ' int i = 0;\n' +
+ ' do\n' +
+ ' {\n' +
+ ' switch (i)\n' +
+ ' {\n' +
+ ' case 0: res = coords.xyz; break;\n' +
+ ' case 1: res = coords.wzy; break;\n' +
+ ' case 2: res = coords.yzw; break;\n' +
+ ' case 3: res = coords.zyx; break;\n' +
+ ' }\n' +
+ ' i += 1;\n' +
+ ' } while (i <= ${CONDITION});\n');
+
+ es3fShaderSwitchTests.makeSwitchCases(this, "if_in_switch", "Basic switch statement usage",
+ ' switch (${CONDITION})\n' +
+ ' {\n' +
+ ' case 0: res = coords.xyz; break;\n' +
+ ' case 1: res = coords.wzy; break;\n' +
+ ' default:\n' +
+ ' if (${CONDITION} == 2)\n' +
+ ' res = coords.yzw;\n' +
+ ' else\n' +
+ ' res = coords.zyx;\n' +
+ ' break;\n' +
+ ' }\n');
+
+ es3fShaderSwitchTests.makeSwitchCases(this, "for_loop_in_switch", "Basic switch statement usage",
+ ' switch (${CONDITION})\n' +
+ ' {\n' +
+ ' case 0: res = coords.xyz; break;\n' +
+ ' case 1:\n' +
+ ' case 2:\n' +
+ ' {\n' +
+ ' highp vec3 t = coords.yzw;\n' +
+ ' for (int i = 0; i < ${CONDITION}; i++)\n' +
+ ' t = t.zyx;\n' +
+ ' res = t;\n' +
+ ' break;\n' +
+ ' }\n' +
+ ' default: res = coords.zyx; break;\n' +
+ ' }\n');
+
+ es3fShaderSwitchTests.makeSwitchCases(this, "while_loop_in_switch", "Basic switch statement usage",
+ ' switch (${CONDITION})\n' +
+ ' {\n' +
+ ' case 0: res = coords.xyz; break;\n' +
+ ' case 1:\n' +
+ ' case 2:\n' +
+ ' {\n' +
+ ' highp vec3 t = coords.yzw;\n' +
+ ' int i = 0;\n' +
+ ' while (i < ${CONDITION})\n' +
+ ' {\n' +
+ ' t = t.zyx;\n' +
+ ' i += 1;\n' +
+ ' }\n' +
+ ' res = t;\n' +
+ ' break;\n' +
+ ' }\n' +
+ ' default: res = coords.zyx; break;\n' +
+ ' }\n');
+
+ es3fShaderSwitchTests.makeSwitchCases(this, "do_while_loop_in_switch", "Basic switch statement usage",
+ ' switch (${CONDITION})\n' +
+ ' {\n' +
+ ' case 0: res = coords.xyz; break;\n' +
+ ' case 1:\n' +
+ ' case 2:\n' +
+ ' {\n' +
+ ' highp vec3 t = coords.yzw;\n' +
+ ' int i = 0;\n' +
+ ' do\n' +
+ ' {\n' +
+ ' t = t.zyx;\n' +
+ ' i += 1;\n' +
+ ' } while (i < ${CONDITION});\n' +
+ ' res = t;\n' +
+ ' break;\n' +
+ ' }\n' +
+ ' default: res = coords.zyx; break;\n' +
+ ' }\n');
+
+ es3fShaderSwitchTests.makeSwitchCases(this, "switch_in_switch", "Basic switch statement usage",
+ ' switch (${CONDITION})\n' +
+ ' {\n' +
+ ' case 0: res = coords.xyz; break;\n' +
+ ' case 1:\n' +
+ ' case 2:\n' +
+ ' switch (${CONDITION} - 1)\n' +
+ ' {\n' +
+ ' case 0: res = coords.wzy; break;\n' +
+ ' case 1: res = coords.yzw; break;\n' +
+ ' }\n' +
+ ' break;\n' +
+ ' default: res = coords.zyx; break;\n' +
+ '}\n');
+
+ // Negative cases.
+ // This is being tested somwhere else: data/gles3/shaders/switch.html
+ };
+
+ /**
+ * Run test
+ * @param {WebGL2RenderingContext} context
+ */
+ es3fShaderSwitchTests.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fShaderSwitchTests.ShaderSwitchTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+ try {
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fShaderSwitchTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderTextureFunctionTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderTextureFunctionTests.js
new file mode 100644
index 0000000000..b6386c96ed
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fShaderTextureFunctionTests.js
@@ -0,0 +1,2709 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fShaderTextureFunctionTests');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.opengl.gluTextureUtil');
+goog.require('framework.opengl.gluTexture');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.common.tcuMatrix');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('modules.shared.glsShaderRenderCase');
+
+goog.scope(function() {
+ var es3fShaderTextureFunctionTests = functional.gles3.es3fShaderTextureFunctionTests;
+ var deMath = framework.delibs.debase.deMath;
+ var tcuMatrix = framework.common.tcuMatrix;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var tcuSurface = framework.common.tcuSurface;
+ var tcuTexture = framework.common.tcuTexture;
+ var tcuTextureUtil = framework.common.tcuTextureUtil;
+ var gluTextureUtil = framework.opengl.gluTextureUtil;
+ var gluTexture = framework.opengl.gluTexture;
+ var gluShaderProgram = framework.opengl.gluShaderProgram;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var glsShaderRenderCase = modules.shared.glsShaderRenderCase;
+
+ let canvasWH = 256;
+ if (tcuTestCase.isQuickMode()) {
+ canvasWH = 32;
+ }
+
+ /**
+ * @enum
+ */
+ es3fShaderTextureFunctionTests.TexFunction = {
+ TEXTURE: 0, //!< texture(), textureOffset()
+ TEXTUREPROJ: 1, //!< textureProj(), textureProjOffset()
+ TEXTUREPROJ3: 2, //!< textureProj(sampler2D, vec3)
+ TEXTURELOD: 3, // ...
+ TEXTUREPROJLOD: 4,
+ TEXTUREPROJLOD3: 5, //!< textureProjLod(sampler2D, vec3)
+ TEXTUREGRAD: 6,
+ TEXTUREPROJGRAD: 7,
+ TEXTUREPROJGRAD3: 8, //!< textureProjGrad(sampler2D, vec3)
+ TEXELFETCH: 9
+ };
+
+ /**
+ * @param {gluShaderProgram.shaderType} shaderType
+ * @param {es3fShaderTextureFunctionTests.TexFunction} function_
+ * @return {boolean}
+ */
+ es3fShaderTextureFunctionTests.functionHasAutoLod = function(shaderType, function_) {
+ return shaderType === gluShaderProgram.shaderType.FRAGMENT &&
+ (function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTURE ||
+ function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ ||
+ function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3);
+ };
+
+ /**
+ * @param {es3fShaderTextureFunctionTests.TexFunction} function_
+ * @return {boolean}
+ */
+ es3fShaderTextureFunctionTests.functionHasProj = function(function_) {
+ return function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ ||
+ function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3 ||
+ function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD ||
+ function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD ||
+ function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD3 ||
+ function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD3;
+ };
+
+ /**
+ * @param {es3fShaderTextureFunctionTests.TexFunction} function_
+ * @return {boolean}
+ */
+ es3fShaderTextureFunctionTests.functionHasGrad = function(function_) {
+ return function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD ||
+ function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD ||
+ function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD3;
+ };
+
+ /**
+ * @param {es3fShaderTextureFunctionTests.TexFunction} function_
+ * @return {boolean}
+ */
+ es3fShaderTextureFunctionTests.functionHasLod = function(function_) {
+ return function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD ||
+ function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD ||
+ function_ === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD3 ||
+ function_ === es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH;
+ };
+
+ /**
+ * @struct
+ * @constructor
+ * @param {es3fShaderTextureFunctionTests.TexFunction} func
+ * @param {Array<number>} minCoord
+ * @param {Array<number>} maxCoord
+ * @param {boolean} useBias
+ * @param {number} minLodBias
+ * @param {number} maxLodBias
+ * @param {Array<number>} minDX For *Grad* functions
+ * @param {Array<number>} maxDX For *Grad* functions
+ * @param {Array<number>} minDY For *Grad* functions
+ * @param {Array<number>} maxDY For *Grad* functions
+ * @param {boolean} useOffset
+ * @param {Array<number>} offset
+ */
+ es3fShaderTextureFunctionTests.TextureLookupSpec = function(func, minCoord, maxCoord, useBias, minLodBias, maxLodBias, minDX, maxDX, minDY, maxDY, useOffset, offset) {
+ /** @type {es3fShaderTextureFunctionTests.TexFunction} */ this.func = func;
+ /** @type {Array<number>} */ this.minCoord = minCoord;
+ /** @type {Array<number>} */ this.maxCoord = maxCoord;
+ // Bias
+ /** @type {boolean} */ this.useBias = useBias;
+ // Bias or Lod for *Lod* functions
+ /** @type {number} */ this.minLodBias = minLodBias;
+ /** @type {number} */ this.maxLodBias = maxLodBias;
+ // For *Grad* functions
+ /** @type {Array<number>} */ this.minDX = minDX;
+ /** @type {Array<number>} */ this.maxDX = maxDX;
+ /** @type {Array<number>} */ this.minDY = minDY;
+ /** @type {Array<number>} */ this.maxDY = maxDY;
+ /** @type {boolean} */ this.useOffset = useOffset;
+ /** @type {Array<number>} */ this.offset = offset;
+ };
+
+ /**
+ * @enum
+ */
+ es3fShaderTextureFunctionTests.TextureType = {
+ TEXTURETYPE_2D: 0,
+ TEXTURETYPE_CUBE_MAP: 1,
+ TEXTURETYPE_2D_ARRAY: 2,
+ TEXTURETYPE_3D: 3
+ };
+
+ /**
+ * @struct
+ * @constructor
+ * @param {?es3fShaderTextureFunctionTests.TextureType} type
+ * @param {number} format
+ * @param {number} width
+ * @param {number} height
+ * @param {number} depth
+ * @param {number} numLevels
+ * @param {?tcuTexture.Sampler} sampler
+ */
+ es3fShaderTextureFunctionTests.TextureSpec = function(type, format, width, height, depth, numLevels, sampler) {
+ /** @type {?es3fShaderTextureFunctionTests.TextureType} */ this.type = type; //!< Texture type (2D, cubemap, ...)
+ /** @type {number} */ this.format = format; //!< Internal format.
+ /** @type {number} */ this.width = width;
+ /** @type {number} */ this.height = height;
+ /** @type {number} */ this.depth = depth;
+ /** @type {number} */ this.numLevels = numLevels;
+ /** @type {?tcuTexture.Sampler} */ this.sampler = sampler;
+ };
+
+ /**
+ * @struct
+ * @constructor
+ */
+ es3fShaderTextureFunctionTests.TexLookupParams = function() {
+ /** @type {number} */ this.lod = 0;
+ /** @type {Array<number>} */ this.offset = [0, 0, 0];
+ /** @type {Array<number>} */ this.scale = [1.0, 1.0, 1.0, 1.0];
+ /** @type {Array<number>} */ this.bias = [0.0, 0.0, 0.0, 0.0];
+ };
+
+ /**
+ * @enum
+ */
+ es3fShaderTextureFunctionTests.LodMode = {
+ EXACT: 0,
+ MIN_BOUND: 1,
+ MAX_BOUND: 2
+ };
+
+ /** @const {es3fShaderTextureFunctionTests.LodMode} */ es3fShaderTextureFunctionTests.DEFAULT_LOD_MODE = es3fShaderTextureFunctionTests.LodMode.EXACT;
+
+ /**
+ * @param {number} dudx
+ * @param {number} dvdx
+ * @param {number} dudy
+ * @param {number} dvdy
+ * @return {number}
+ */
+ es3fShaderTextureFunctionTests.computeLodFromDerivates_UV = function(dudx, dvdx, dudy, dvdy) {
+ /** @type {es3fShaderTextureFunctionTests.LodMode} */ var mode = es3fShaderTextureFunctionTests.DEFAULT_LOD_MODE;
+ /** @type {number} */ var p;
+
+ switch (mode) {
+ case es3fShaderTextureFunctionTests.LodMode.EXACT:
+ p = Math.max(Math.sqrt(dudx * dudx + dvdx * dvdx), Math.sqrt(dudy * dudy + dvdy * dvdy));
+ break;
+
+ case es3fShaderTextureFunctionTests.LodMode.MIN_BOUND:
+ case es3fShaderTextureFunctionTests.LodMode.MAX_BOUND:
+ /** @type {number} */ var mu = Math.max(Math.abs(dudx), Math.abs(dudy));
+ /** @type {number} */ var mv = Math.max(Math.abs(dvdx), Math.abs(dvdy));
+
+ p = mode === es3fShaderTextureFunctionTests.LodMode.MIN_BOUND ? Math.max(mu, mv) : mu + mv;
+ break;
+
+ default:
+ throw new Error('LOD_MODE not supported.');
+ }
+
+ return Math.log2(p);
+ };
+
+ /**
+ * @param {number} dudx
+ * @param {number} dvdx
+ * @param {number} dwdx
+ * @param {number} dudy
+ * @param {number} dvdy
+ * @param {number} dwdy
+ * @return {number}
+ */
+ es3fShaderTextureFunctionTests.computeLodFromDerivates_UVW = function(dudx, dvdx, dwdx, dudy, dvdy, dwdy) {
+ /** @type {es3fShaderTextureFunctionTests.LodMode} */ var mode = es3fShaderTextureFunctionTests.DEFAULT_LOD_MODE;
+ /** @type {number} */ var p;
+
+ switch (mode) {
+ case es3fShaderTextureFunctionTests.LodMode.EXACT:
+ p = Math.max(Math.sqrt(dudx * dudx + dvdx * dvdx + dwdx * dwdx), Math.sqrt(dudy * dudy + dvdy * dvdy + dwdy * dwdy));
+ break;
+
+ case es3fShaderTextureFunctionTests.LodMode.MIN_BOUND:
+ case es3fShaderTextureFunctionTests.LodMode.MAX_BOUND:
+ /** @type {number} */ var mu = Math.max(Math.abs(dudx), Math.abs(dudy));
+ /** @type {number} */ var mv = Math.max(Math.abs(dvdx), Math.abs(dvdy));
+ /** @type {number} */ var mw = Math.max(Math.abs(dwdx), Math.abs(dwdy));
+
+ p = mode === es3fShaderTextureFunctionTests.LodMode.MIN_BOUND ? Math.max(mu, mv, mw) : (mu + mv + mw);
+ break;
+
+ default:
+ throw new Error('LOD_MODE not supported.');
+ }
+
+ return Math.log2(p);
+ };
+
+ /**
+ * [dag] Wrapper function for computeLodFromDerivates_UV or computeLodFromDerivates_UVW
+ * @param {number} dudx
+ * @param {number} dvdx
+ * @param {number} dwdxOrdudy
+ * @param {number} dudyOrdvdy
+ * @param {number=} dvdy
+ * @param {number=} dwdy
+ * @return {number}
+ */
+ es3fShaderTextureFunctionTests.computeLodFromDerivates = function(dudx, dvdx, dwdxOrdudy, dudyOrdvdy, dvdy, dwdy) {
+ if (arguments.length === 4)
+ return es3fShaderTextureFunctionTests.computeLodFromDerivates_UV(dudx, dvdx, dwdxOrdudy, dudyOrdvdy);
+ else
+ return es3fShaderTextureFunctionTests.computeLodFromDerivates_UVW(dudx, dvdx, dwdxOrdudy, dudyOrdvdy, /** @type {number} */ (dvdy), /** @type {number} */ (dwdy));
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @return {number}
+ */
+ es3fShaderTextureFunctionTests.computeLodFromGrad2D = function(c) {
+ /** @type {number} */ var w = c.textures[0].tex2D.getWidth();
+ /** @type {number} */ var h = c.textures[0].tex2D.getHeight();
+ return es3fShaderTextureFunctionTests.computeLodFromDerivates(c.in_[1][0] * w, c.in_[1][1] * h, c.in_[2][0] * w, c.in_[2][1] * h);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @return {number}
+ */
+ es3fShaderTextureFunctionTests.computeLodFromGrad2DArray = function(c) {
+ /** @type {number} */ var w = c.textures[0].tex2DArray.getWidth();
+ /** @type {number} */ var h = c.textures[0].tex2DArray.getHeight();
+ return es3fShaderTextureFunctionTests.computeLodFromDerivates(c.in_[1][0] * w, c.in_[1][1] * h, c.in_[2][0] * w, c.in_[2][1] * h);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @return {number}
+ */
+ es3fShaderTextureFunctionTests.computeLodFromGrad3D = function(c) {
+ /** @type {number} */ var w = c.textures[0].tex3D.getWidth();
+ /** @type {number} */ var h = c.textures[0].tex3D.getHeight();
+ /** @type {number} */ var d = c.textures[0].tex3D.getDepth();
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @return {number}
+ */
+ es3fShaderTextureFunctionTests.computeLodFromGradCube = function(c) {
+ // \note Major axis is always -Z or +Z
+ /** @type {number} */ var m = Math.abs(c.in_[0][2]);
+ /** @type {number} */ var d = c.textures[0].texCube.getSize();
+ /** @type {number} */ var s = d / (2.0 * m);
+ /** @type {number} */ var t = d / (2.0 * m);
+ return es3fShaderTextureFunctionTests.computeLodFromDerivates(c.in_[1][0] * s, c.in_[1][1] * t, c.in_[2][0] * s, c.in_[2][1] * t);
+ };
+
+ /** @typedef {function(glsShaderRenderCase.ShaderEvalContext, es3fShaderTextureFunctionTests.TexLookupParams)} */ es3fShaderTextureFunctionTests.TexEvalFunc;
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {number} s
+ * @param {number} t
+ * @param {number} lod
+ * @return {Array<number>}
+ */
+ es3fShaderTextureFunctionTests.texture2D = function(c, s, t, lod) {
+ return c.textures[0].tex2D.getView().sample(c.textures[0].sampler, [s, t], lod);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {number} s
+ * @param {number} t
+ * @param {number} r
+ * @param {number} lod
+ * @return {Array<number>}
+ */
+ es3fShaderTextureFunctionTests.textureCube = function(c, s, t, r, lod) {
+ return c.textures[0].texCube.getView().sample(c.textures[0].sampler, [s, t, r], lod);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {number} s
+ * @param {number} t
+ * @param {number} r
+ * @param {number} lod
+ * @return {Array<number>}
+ */
+ es3fShaderTextureFunctionTests.texture2DArray = function(c, s, t, r, lod) {
+ return c.textures[0].tex2DArray.getView().sample(c.textures[0].sampler, [s, t, r], lod);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {number} s
+ * @param {number} t
+ * @param {number} r
+ * @param {number} lod
+ * @return {Array<number>}
+ */
+ es3fShaderTextureFunctionTests.texture3D = function(c, s, t, r, lod) {
+ return c.textures[0].tex3D.getView().sample(c.textures[0].sampler, [s, t, r], lod);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {number} ref
+ * @param {number} s
+ * @param {number} t
+ * @param {number} lod
+ * @return {number}
+ */
+ es3fShaderTextureFunctionTests.texture2DShadow = function(c, ref, s, t, lod) {
+ return c.textures[0].tex2D.getView().sampleCompare(c.textures[0].sampler, ref, [s, t], lod);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {number} ref
+ * @param {number} s
+ * @param {number} t
+ * @param {number} r
+ * @param {number} lod
+ * @return {number}
+ */
+ es3fShaderTextureFunctionTests.textureCubeShadow = function(c, ref, s, t, r, lod) {
+ return c.textures[0].texCube.getView().sampleCompare(c.textures[0].sampler, ref, [s, t, r], lod);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {number} ref
+ * @param {number} s
+ * @param {number} t
+ * @param {number} r
+ * @param {number} lod
+ * @return {number}
+ */
+ es3fShaderTextureFunctionTests.texture2DArrayShadow = function(c, ref, s, t, r, lod) {
+ return c.textures[0].tex2DArray.getView().sampleCompare(c.textures[0].sampler, ref, [s, t, r], lod);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {number} s
+ * @param {number} t
+ * @param {number} lod
+ * @param {Array<number>} offset
+ * @return {Array<number>}
+ */
+ es3fShaderTextureFunctionTests.texture2DOffset = function(c, s, t, lod, offset) {
+ return c.textures[0].tex2D.getView().sampleOffset(c.textures[0].sampler, [s, t], lod, offset);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {number} s
+ * @param {number} t
+ * @param {number} r
+ * @param {number} lod
+ * @param {Array<number>} offset
+ * @return {Array<number>}
+ */
+ es3fShaderTextureFunctionTests.texture2DArrayOffset = function(c, s, t, r, lod, offset) {
+ return c.textures[0].tex2DArray.getView().sampleOffset(c.textures[0].sampler, [s, t, r], lod, offset);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {number} s
+ * @param {number} t
+ * @param {number} r
+ * @param {number} lod
+ * @param {Array<number>} offset
+ * @return {Array<number>}
+ */
+ es3fShaderTextureFunctionTests.texture3DOffset = function(c, s, t, r, lod, offset) {
+ return c.textures[0].tex3D.getView().sampleOffset(c.textures[0].sampler, [s, t, r], lod, offset);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {number} ref
+ * @param {number} s
+ * @param {number} t
+ * @param {number} lod
+ * @param {Array<number>} offset
+ * @return {number}
+ */
+ es3fShaderTextureFunctionTests.texture2DShadowOffset = function(c, ref, s, t, lod, offset) {
+ return c.textures[0].tex2D.getView().sampleCompareOffset(c.textures[0].sampler, ref, [s, t], lod, offset);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {number} ref
+ * @param {number} s
+ * @param {number} t
+ * @param {number} r
+ * @param {number} lod
+ * @param {Array<number>} offset
+ * @return {number}
+ */
+ es3fShaderTextureFunctionTests.texture2DArrayShadowOffset = function(c, ref, s, t, r, lod, offset) {
+ return c.textures[0].tex2DArray.getView().sampleCompareOffset(c.textures[0].sampler, ref, [s, t, r], lod, offset);
+ };
+
+ // Eval functions.
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2D = function(c, p) {
+ c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2D(c, c.in_[0][0], c.in_[0][1], p.lod), p.scale), p.bias);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTextureCube = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DArray = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture3D = function(c, p) {
+ 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);
+ };
+
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DBias = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTextureCubeBias = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DArrayBias = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture3DBias = function(c, p) {
+ 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);
+ };
+
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DProj3 = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DProj3Bias = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DProj = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DProjBias = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture3DProj = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture3DProjBias = function(c, p) {
+ 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);
+ };
+
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DLod = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTextureCubeLod = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DArrayLod = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture3DLod = function(c, p) {
+ 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);
+ };
+
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DProjLod3 = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DProjLod = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture3DProjLod = function(c, p) {
+ 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);
+ };
+
+ // Offset variants
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DOffset = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DArrayOffset = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture3DOffset = function(c, p) {
+ 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);
+ };
+
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DOffsetBias = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DArrayOffsetBias = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture3DOffsetBias = function(c, p) {
+ 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);
+ };
+
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DLodOffset = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DArrayLodOffset = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture3DLodOffset = function(c, p) {
+ 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);
+ };
+
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DProj3Offset = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DProj3OffsetBias = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DProjOffset = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DProjOffsetBias = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture3DProjOffset = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture3DProjOffsetBias = function(c, p) {
+ 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);
+ };
+
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DProjLod3Offset = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DProjLodOffset = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture3DProjLodOffset = function(c, p) {
+ 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);
+ };
+
+ // Shadow variants
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DShadow = function(c, p) {
+ c.color[0] = es3fShaderTextureFunctionTests.texture2DShadow(c, c.in_[0][2], c.in_[0][0], c.in_[0][1], p.lod);
+ };
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DShadowBias = function(c, p) {
+ c.color[0] = es3fShaderTextureFunctionTests.texture2DShadow(c, c.in_[0][2], c.in_[0][0], c.in_[0][1], p.lod+c.in_[1][0]);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTextureCubeShadow = function(c, p) {
+ c.color[0] = es3fShaderTextureFunctionTests.textureCubeShadow(c, c.in_[0][3], c.in_[0][0], c.in_[0][1], c.in_[0][2], p.lod);
+ };
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTextureCubeShadowBias = function(c, p) {
+ 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]);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DArrayShadow = function(c, p) {
+ c.color[0] = es3fShaderTextureFunctionTests.texture2DArrayShadow(c, c.in_[0][3], c.in_[0][0], c.in_[0][1], c.in_[0][2], p.lod);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DShadowLod = function(c, p) {
+ c.color[0] = es3fShaderTextureFunctionTests.texture2DShadow(c, c.in_[0][2], c.in_[0][0], c.in_[0][1], c.in_[1][0]);
+ };
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DShadowLodOffset = function(c, p) {
+ 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]));
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DShadowProj = function(c, p) {
+ 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);
+ };
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DShadowProjBias = function(c, p) {
+ 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]);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DShadowProjLod = function(c, p) {
+ 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]);
+ };
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DShadowProjLodOffset = function(c, p) {
+ 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]));
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DShadowOffset = function(c, p) {
+ 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]));
+ };
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DShadowOffsetBias = function(c, p) {
+ 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]));
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DShadowProjOffset = function(c, p) {
+ 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]));
+ };
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DShadowProjOffsetBias = function(c, p) {
+ 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]));
+ };
+
+ // Gradient variarts
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DGrad = function(c, p) {
+ c.color = deMath.add(deMath.multiply(es3fShaderTextureFunctionTests.texture2D(c, c.in_[0][0], c.in_[0][1], es3fShaderTextureFunctionTests.computeLodFromGrad2D(c)), p.scale), p.bias);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTextureCubeGrad = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DArrayGrad = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture3DGrad = function(c, p) {
+ 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);
+ };
+
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DShadowGrad = function(c, p) {
+ c.color[0] = es3fShaderTextureFunctionTests.texture2DShadow(c, c.in_[0][2], c.in_[0][0], c.in_[0][1], es3fShaderTextureFunctionTests.computeLodFromGrad2D(c));
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTextureCubeShadowGrad = function(c, p) {
+ 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));
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DArrayShadowGrad = function(c, p) {
+ 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));
+ };
+
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DGradOffset = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DArrayGradOffset = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture3DGradOffset = function(c, p) {
+ 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);
+ };
+
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DShadowGradOffset = function(c, p) {
+ 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]));
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DArrayShadowGradOffset = function(c, p) {
+ 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]));
+ };
+
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DShadowProjGrad = function(c, p) {
+ 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));
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DShadowProjGradOffset = function(c, p) {
+ 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]));
+ };
+
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DProjGrad3 = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DProjGrad = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture3DProjGrad = function(c, p) {
+ 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);
+ };
+
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DProjGrad3Offset = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture2DProjGradOffset = function(c, p) {
+ 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);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexture3DProjGradOffset = function(c, p) {
+ 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);
+ };
+
+ // Texel fetch variants
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexelFetch2D = function(c, p) {
+ /** @type {number} */ var x = Math.trunc(c.in_[0][0]) + p.offset[0];
+ /** @type {number} */ var y = Math.trunc(c.in_[0][1]) + p.offset[1];
+ /** @type {number} */ var lod = Math.trunc(c.in_[1][0]);
+ c.color = deMath.add(deMath.multiply(c.textures[0].tex2D.getLevel(lod).getPixel(x, y), p.scale), p.bias);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexelFetch2DArray = function(c, p) {
+ /** @type {number} */ var x = Math.trunc(c.in_[0][0]) + p.offset[0];
+ /** @type {number} */ var y = Math.trunc(c.in_[0][1]) + p.offset[1];
+ /** @type {number} */ var l = Math.trunc(c.in_[0][2]);
+ /** @type {number} */ var lod = Math.trunc(c.in_[1][0]);
+ c.color = deMath.add(deMath.multiply(c.textures[0].tex2DArray.getLevel(lod).getPixel(x, y, l), p.scale), p.bias);
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} c
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} p
+ */
+ es3fShaderTextureFunctionTests.evalTexelFetch3D = function(c, p) {
+ /** @type {number} */ var x = Math.trunc(c.in_[0][0]) + p.offset[0];
+ /** @type {number} */ var y = Math.trunc(c.in_[0][1]) + p.offset[1];
+ /** @type {number} */ var z = Math.trunc(c.in_[0][2]) + p.offset[2];
+ /** @type {number} */ var lod = Math.trunc(c.in_[1][0]);
+ c.color = deMath.add(deMath.multiply(c.textures[0].tex3D.getLevel(lod).getPixel(x, y, z), p.scale), p.bias);
+ };
+
+ /**
+ * @constructor
+ * @extends {glsShaderRenderCase.ShaderEvaluator}
+ * @param {es3fShaderTextureFunctionTests.TexEvalFunc} evalFunc
+ * @param {es3fShaderTextureFunctionTests.TexLookupParams} lookupParams
+ */
+ es3fShaderTextureFunctionTests.TexLookupEvaluator = function(evalFunc, lookupParams) {
+ /** @type {es3fShaderTextureFunctionTests.TexEvalFunc} */ this.m_evalFunc = evalFunc;
+ /** @type {es3fShaderTextureFunctionTests.TexLookupParams} */ this.m_lookupParams = lookupParams;
+ };
+
+ es3fShaderTextureFunctionTests.TexLookupEvaluator.prototype = Object.create(glsShaderRenderCase.ShaderEvaluator.prototype);
+ es3fShaderTextureFunctionTests.TexLookupEvaluator.prototype.constructor = es3fShaderTextureFunctionTests.TexLookupEvaluator;
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} ctx
+ */
+ es3fShaderTextureFunctionTests.TexLookupEvaluator.prototype.evaluate = function(ctx) {
+ this.m_evalFunc(ctx, this.m_lookupParams);
+ };
+
+ /**
+ * @constructor
+ * @extends {glsShaderRenderCase.ShaderRenderCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {es3fShaderTextureFunctionTests.TextureLookupSpec} lookup
+ * @param {es3fShaderTextureFunctionTests.TextureSpec} texture
+ * @param {es3fShaderTextureFunctionTests.TexEvalFunc} evalFunc
+ * @param {boolean} isVertexCase
+ */
+ es3fShaderTextureFunctionTests.ShaderTextureFunctionCase = function(name, desc, lookup, texture, evalFunc, isVertexCase) {
+ glsShaderRenderCase.ShaderRenderCase.call(this, name, desc, isVertexCase);
+
+ /** @type {es3fShaderTextureFunctionTests.TextureLookupSpec} */ this.m_lookupSpec = lookup;
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ this.m_textureSpec = texture;
+ /** @type {es3fShaderTextureFunctionTests.TexLookupParams} */ this.m_lookupParams = new es3fShaderTextureFunctionTests.TexLookupParams();
+ /** @type {es3fShaderTextureFunctionTests.TexLookupEvaluator} */ this.m_evaluator = new es3fShaderTextureFunctionTests.TexLookupEvaluator(evalFunc, this.m_lookupParams);
+
+ /** @type {gluTexture.Texture2D} */ this.m_texture2D = null;
+ /** @type {gluTexture.TextureCube} */ this.m_textureCube = null;
+ /** @type {gluTexture.Texture2DArray} */ this.m_texture2DArray = null;
+ /** @type {gluTexture.Texture3D} */ this.m_texture3D = null;
+ };
+
+ es3fShaderTextureFunctionTests.ShaderTextureFunctionCase.prototype = Object.create(glsShaderRenderCase.ShaderRenderCase.prototype);
+ es3fShaderTextureFunctionTests.ShaderTextureFunctionCase.prototype.constructor = es3fShaderTextureFunctionTests.ShaderTextureFunctionCase;
+
+ es3fShaderTextureFunctionTests.ShaderTextureFunctionCase.prototype.init = function() {
+
+ // Base coord scale & bias
+ /** @type {(Array<number>|number)} */ var s = deMath.subtract(this.m_lookupSpec.maxCoord, this.m_lookupSpec.minCoord);
+ /** @type {(Array<number>|number)} */ var b = this.m_lookupSpec.minCoord;
+
+ /** @type {Array<number>} */ var baseCoordTrans = [
+ s[0], 0.0, 0.0, b[0],
+ 0.0, s[1], 0., b[1],
+ s[2]/2.0, -s[2]/2.0, 0.0, s[2]/2.0 + b[2],
+ -s[3]/2.0, s[3]/2.0, 0.0, s[3]/2.0 + b[3]
+ ];
+ this.m_userAttribTransforms.push(tcuMatrix.matrixFromArray(4, 4, baseCoordTrans));
+
+ /** @type {boolean} */ var hasLodBias = es3fShaderTextureFunctionTests.functionHasLod(this.m_lookupSpec.func) || this.m_lookupSpec.useBias;
+ /** @type {boolean} */ var isGrad = es3fShaderTextureFunctionTests.functionHasGrad(this.m_lookupSpec.func);
+ assertMsgOptions(!isGrad || !hasLodBias, 'Assert Error. expected: isGrad || hasLodBias === false', false, true);
+
+ if (hasLodBias) {
+ s = this.m_lookupSpec.maxLodBias - this.m_lookupSpec.minLodBias;
+ b = this.m_lookupSpec.minLodBias;
+ /** @type {Array<number>} */ var lodCoordTrans = [
+ s/2.0, s/2.0, 0.0, b,
+ 0.0, 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, 0.0
+ ];
+
+ this.m_userAttribTransforms.push(tcuMatrix.matrixFromArray(4, 4, lodCoordTrans));
+ }
+ else if (isGrad) {
+ /** @type {Array<number>} */ var sx = deMath.subtract(this.m_lookupSpec.maxDX, this.m_lookupSpec.minDX);
+ /** @type {Array<number>} */ var sy = deMath.subtract(this.m_lookupSpec.maxDY, this.m_lookupSpec.minDY);
+ /** @type {Array<number>} */ var gradDxTrans = [
+ sx[0]/2.0, sx[0]/2.0, 0.0, this.m_lookupSpec.minDX[0],
+ sx[1]/2.0, sx[1]/2.0, 0.0, this.m_lookupSpec.minDX[1],
+ sx[2]/2.0, sx[2]/2.0, 0.0, this.m_lookupSpec.minDX[2],
+ 0.0, 0.0, 0.0, 0.0
+ ];
+ /** @type {Array<number>} */ var gradDyTrans = [
+ -sy[0]/2.0, -sy[0]/2.0, 0.0, this.m_lookupSpec.maxDY[0],
+ -sy[1]/2.0, -sy[1]/2.0, 0.0, this.m_lookupSpec.maxDY[1],
+ -sy[2]/2.0, -sy[2]/2.0, 0.0, this.m_lookupSpec.maxDY[2],
+ 0.0, 0.0, 0.0, 0.0
+ ];
+
+ this.m_userAttribTransforms.push(tcuMatrix.matrixFromArray(4, 4, gradDxTrans));
+ this.m_userAttribTransforms.push(tcuMatrix.matrixFromArray(4, 4, gradDyTrans));
+ }
+
+ this.initShaderSources();
+ this.initTexture();
+
+ this.postinit();
+
+ };
+
+ es3fShaderTextureFunctionTests.ShaderTextureFunctionCase.prototype.initTexture = function() {
+ /** @type {Array<Array<number>>} */ var texCubeSwz = [
+ [0, 0, 1, 1],
+ [1, 1, 0, 0],
+ [0, 1, 0, 1],
+ [1, 0, 1, 0],
+ [0, 1, 1, 0],
+ [1, 0, 0, 1]
+ ];
+
+ assertMsgOptions(texCubeSwz.length === 6, 'Cube should have 6 faces.', false, true);
+
+ /** @type {number} */ var levelStep;
+ /** @type {Array<number>} */ var cScale;
+ /** @type {Array<number>} */ var cBias;
+ /** @type {number} */ var baseCellSize;
+
+ /** @type {number} */ var fA;
+ /** @type {number} */ var fB;
+ /** @type {Array<number>} */ var colorA;
+ /** @type {Array<number>} */ var colorB;
+
+ /** @type {number} */ var dudx;
+ /** @type {number} */ var dvdy;
+
+ /** @type {tcuTexture.TextureFormat} */ var texFmt = gluTextureUtil.mapGLInternalFormat(this.m_textureSpec.format);
+ /** @type {tcuTextureUtil.TextureFormatInfo} */ var fmtInfo = tcuTextureUtil.getTextureFormatInfo(texFmt);
+ /** @type {Array<number>} */ var viewportSize = this.getViewportSize();
+ /** @type {boolean} */ var isProj = es3fShaderTextureFunctionTests.functionHasProj(this.m_lookupSpec.func);
+ /** @type {boolean} */ var isAutoLod = es3fShaderTextureFunctionTests.functionHasAutoLod(
+ this.m_isVertexCase ? gluShaderProgram.shaderType.VERTEX : gluShaderProgram.shaderType.FRAGMENT,
+ this.m_lookupSpec.func); // LOD can vary significantly
+ /** @type {number} */ var proj = isProj ?
+ 1.0 / this.m_lookupSpec.minCoord[this.m_lookupSpec.func === es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3 ? 2 : 3] :
+ 1.0;
+
+ switch (this.m_textureSpec.type) {
+ case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D:
+ levelStep = isAutoLod ? 0.0 : 1.0 / Math.max(1, this.m_textureSpec.numLevels - 1);
+ cScale = deMath.subtract(fmtInfo.valueMax, fmtInfo.valueMin);
+ cBias = fmtInfo.valueMin;
+ baseCellSize = Math.min(this.m_textureSpec.width / 4, this.m_textureSpec.height / 4);
+
+ this.m_texture2D = gluTexture.texture2DFromInternalFormat(gl, this.m_textureSpec.format, this.m_textureSpec.width, this.m_textureSpec.height);
+ for (var level = 0; level < this.m_textureSpec.numLevels; level++) {
+ fA = level * levelStep;
+ fB = 1.0 - fA;
+ colorA = deMath.add(cBias, deMath.multiply(cScale, [fA, fB, fA, fB]));
+ colorB = deMath.add(cBias, deMath.multiply(cScale, [fB, fA, fB, fA]));
+
+ this.m_texture2D.getRefTexture().allocLevel(level);
+ tcuTextureUtil.fillWithGrid(this.m_texture2D.getRefTexture().getLevel(level), Math.max(1, baseCellSize >> level), colorA, colorB);
+ }
+ this.m_texture2D.upload();
+
+ // Compute LOD.
+ dudx = (this.m_lookupSpec.maxCoord[0] - this.m_lookupSpec.minCoord[0]) * proj * this.m_textureSpec.width / viewportSize[0];
+ dvdy = (this.m_lookupSpec.maxCoord[1] - this.m_lookupSpec.minCoord[1]) * proj * this.m_textureSpec.height / viewportSize[1];
+ this.m_lookupParams.lod = es3fShaderTextureFunctionTests.computeLodFromDerivates(dudx, 0.0, 0.0, dvdy);
+
+ // Append to texture list.
+ this.m_textures.push(new glsShaderRenderCase.TextureBinding(this.m_texture2D, this.m_textureSpec.sampler));
+ break;
+
+ case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP:
+ levelStep = isAutoLod ? 0.0 : 1.0 / Math.max(1, this.m_textureSpec.numLevels - 1);
+ cScale = deMath.subtract(fmtInfo.valueMax, fmtInfo.valueMin);
+ cBias = fmtInfo.valueMin;
+ /** @type {Array<number>} */ var cCorner = deMath.add(cBias, deMath.scale(cScale, 0.5));
+ baseCellSize = Math.min(this.m_textureSpec.width / 4, this.m_textureSpec.height / 4);
+
+ assertMsgOptions(this.m_textureSpec.width === this.m_textureSpec.height, 'Expected width === height', false, true);
+ this.m_textureCube = gluTexture.cubeFromInternalFormat(gl, this.m_textureSpec.format, this.m_textureSpec.width);
+ for (var level = 0; level < this.m_textureSpec.numLevels; level++) {
+ fA = level * levelStep;
+ fB = 1.0 - fA;
+ /** @type {Array<number>} */ var f = [fA, fB];
+
+ for (var face = 0; face < 6; face++) {
+ /** @type {Array<number>} */ var swzA = texCubeSwz[face];
+ /** @type {Array<number>} */ var swzB = deMath.subtract([1, 1, 1, 1], swzA);
+ colorA = deMath.add(cBias, deMath.multiply(cScale, deMath.swizzle(f, [swzA[0], swzA[1], swzA[2], swzA[3]])));
+ colorB = deMath.add(cBias, deMath.multiply(cScale, deMath.swizzle(f, [swzB[0], swzB[1], swzB[2], swzB[3]])));
+
+ this.m_textureCube.getRefTexture().allocLevel(face, level);
+
+ /** @type {tcuTexture.PixelBufferAccess} */ var access = this.m_textureCube.getRefTexture().getLevelFace(level, face);
+ /** @type {number} */ var lastPix = access.getWidth() - 1;
+
+ tcuTextureUtil.fillWithGrid(access, Math.max(1, baseCellSize >> level), colorA, colorB);
+
+ // Ensure all corners have identical colors in order to avoid dealing with ambiguous corner texel filtering
+ access.setPixel(cCorner, 0, 0);
+ access.setPixel(cCorner, 0, lastPix);
+ access.setPixel(cCorner, lastPix, 0);
+ access.setPixel(cCorner, lastPix, lastPix);
+ }
+ }
+ this.m_textureCube.upload();
+
+ // Compute LOD \note Assumes that only single side is accessed and R is constant major axis.
+ assertMsgOptions(Math.abs(this.m_lookupSpec.minCoord[2] - this.m_lookupSpec.maxCoord[2]) < 0.005, 'Expected abs(minCoord-maxCoord) < 0.005', false, true);
+ 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);
+ 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);
+
+ /** @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]);
+ /** @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]);
+ /** @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]);
+ dudx = (c10.s - c00.s) * this.m_textureSpec.width / viewportSize[0];
+ dvdy = (c01.t - c00.t) * this.m_textureSpec.height / viewportSize[1];
+
+ this.m_lookupParams.lod = es3fShaderTextureFunctionTests.computeLodFromDerivates(dudx, 0.0, 0.0, dvdy);
+
+ this.m_textures.push(new glsShaderRenderCase.TextureBinding(this.m_textureCube, this.m_textureSpec.sampler));
+ break;
+
+ case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY:
+ /** @type {number} */ var layerStep = 1.0 / this.m_textureSpec.depth;
+ levelStep = isAutoLod ? 0.0 : 1.0 / (Math.max(1, this.m_textureSpec.numLevels - 1) * this.m_textureSpec.depth);
+ cScale = deMath.subtract(fmtInfo.valueMax, fmtInfo.valueMin);
+ cBias = fmtInfo.valueMin;
+ baseCellSize = Math.min(this.m_textureSpec.width / 4, this.m_textureSpec.height / 4);
+
+ this.m_texture2DArray = gluTexture.texture2DArrayFromInternalFormat(gl,
+ this.m_textureSpec.format,
+ this.m_textureSpec.width,
+ this.m_textureSpec.height,
+ this.m_textureSpec.depth);
+
+ for (var level = 0; level < this.m_textureSpec.numLevels; level++) {
+ this.m_texture2DArray.getRefTexture().allocLevel(level);
+ /** @type {tcuTexture.PixelBufferAccess} */ var levelAccess = this.m_texture2DArray.getRefTexture().getLevel(level);
+
+ for (var layer = 0; layer < levelAccess.getDepth(); layer++) {
+ fA = layer * layerStep + level * levelStep;
+ fB = 1.0 - fA;
+ colorA = deMath.add(cBias, deMath.multiply(cScale, [fA, fB, fA, fB]));
+ colorB = deMath.add(cBias, deMath.multiply(cScale, [fB, fA, fB, fA]));
+
+ tcuTextureUtil.fillWithGrid(tcuTextureUtil.getSubregion(levelAccess, 0, 0, layer, levelAccess.getWidth(), levelAccess.getHeight(), 1), Math.max(1, baseCellSize >> level), colorA, colorB);
+ }
+ }
+ this.m_texture2DArray.upload();
+
+ // Compute LOD.
+ dudx = (this.m_lookupSpec.maxCoord[0] - this.m_lookupSpec.minCoord[0]) * proj * this.m_textureSpec.width / viewportSize[0];
+ dvdy = (this.m_lookupSpec.maxCoord[1] - this.m_lookupSpec.minCoord[1]) * proj * this.m_textureSpec.height / viewportSize[1];
+ this.m_lookupParams.lod = es3fShaderTextureFunctionTests.computeLodFromDerivates(dudx, 0.0, 0.0, dvdy);
+
+ // Append to texture list.
+ this.m_textures.push(new glsShaderRenderCase.TextureBinding(this.m_texture2DArray, this.m_textureSpec.sampler));
+ break;
+
+ case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D:
+ levelStep = isAutoLod ? 0.0 : 1.0 / Math.max(1, this.m_textureSpec.numLevels - 1);
+ cScale = deMath.subtract(fmtInfo.valueMax, fmtInfo.valueMin);
+ cBias = fmtInfo.valueMin;
+ baseCellSize = Math.min(this.m_textureSpec.width / 2, this.m_textureSpec.height / 2, this.m_textureSpec.depth / 2);
+
+ this.m_texture3D = gluTexture.texture3DFromInternalFormat(gl, this.m_textureSpec.format, this.m_textureSpec.width, this.m_textureSpec.height, this.m_textureSpec.depth);
+ for (var level = 0; level < this.m_textureSpec.numLevels; level++) {
+ fA = level * levelStep;
+ fB = 1.0 - fA;
+ colorA = deMath.add(cBias, deMath.multiply(cScale, [fA, fB, fA, fB]));
+ colorB = deMath.add(cBias, deMath.multiply(cScale, [fB, fA, fB, fA]));
+
+ this.m_texture3D.getRefTexture().allocLevel(level);
+ tcuTextureUtil.fillWithGrid(this.m_texture3D.getRefTexture().getLevel(level), Math.max(1, baseCellSize >> level), colorA, colorB);
+ }
+ this.m_texture3D.upload();
+
+ // Compute LOD.
+ dudx = (this.m_lookupSpec.maxCoord[0] - this.m_lookupSpec.minCoord[0]) * proj * this.m_textureSpec.width / viewportSize[0];
+ dvdy = (this.m_lookupSpec.maxCoord[1] - this.m_lookupSpec.minCoord[1]) * proj * this.m_textureSpec.height / viewportSize[1];
+ /** @type {number} */ var dwdx = (this.m_lookupSpec.maxCoord[2] - this.m_lookupSpec.minCoord[2]) * 0.5 * proj * this.m_textureSpec.depth / viewportSize[0];
+ /** @type {number} */ var dwdy = (this.m_lookupSpec.maxCoord[2] - this.m_lookupSpec.minCoord[2]) * 0.5 * proj * this.m_textureSpec.depth / viewportSize[1];
+ this.m_lookupParams.lod = es3fShaderTextureFunctionTests.computeLodFromDerivates(dudx, 0.0, dwdx, 0.0, dvdy, dwdy);
+
+ // Append to texture list.
+ this.m_textures.push(new glsShaderRenderCase.TextureBinding(this.m_texture3D, this.m_textureSpec.sampler));
+ break;
+
+ default:
+ throw new Error('Texture type not supported.');
+ }
+
+ // Set lookup scale & bias
+ this.m_lookupParams.scale = fmtInfo.lookupScale;
+ this.m_lookupParams.bias = fmtInfo.lookupBias;
+ this.m_lookupParams.offset = this.m_lookupSpec.offset;
+ };
+
+ es3fShaderTextureFunctionTests.ShaderTextureFunctionCase.prototype.initShaderSources = function() {
+ /** @type {es3fShaderTextureFunctionTests.TexFunction} */ var function_ = this.m_lookupSpec.func;
+ /** @type {boolean} */ var isVtxCase = this.m_isVertexCase;
+ /** @type {boolean} */ var isProj = es3fShaderTextureFunctionTests.functionHasProj(function_);
+ /** @type {boolean} */ var isGrad = es3fShaderTextureFunctionTests.functionHasGrad(function_);
+ /** @type {boolean} */ var isShadow = this.m_textureSpec.sampler.compare !== tcuTexture.CompareMode.COMPAREMODE_NONE;
+ /** @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);
+ /** @type {boolean} */ var isIntCoord = function_ === es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH;
+ /** @type {boolean} */ var hasLodBias = es3fShaderTextureFunctionTests.functionHasLod(this.m_lookupSpec.func) || this.m_lookupSpec.useBias;
+ /** @type {number} */ var texCoordComps = this.m_textureSpec.type === es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D ? 2 : 3;
+ /** @type {number} */ var extraCoordComps = (isProj ? (is2DProj4 ? 2 : 1) : 0) + (isShadow ? 1 : 0);
+ /** @type {gluShaderUtil.DataType} */ var coordType = gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.FLOAT, texCoordComps+extraCoordComps);
+ /** @type {gluShaderUtil.precision} */ var coordPrec = gluShaderUtil.precision.PRECISION_HIGHP;
+ /** @type {string} */ var coordTypeName = gluShaderUtil.getDataTypeName(coordType);
+ /** @type {string} */ var coordPrecName = gluShaderUtil.getPrecisionName(coordPrec);
+ /** @type {tcuTexture.TextureFormat} */ var texFmt = gluTextureUtil.mapGLInternalFormat(this.m_textureSpec.format);
+ /** @type {?gluShaderUtil.DataType} */ var samplerType = null;
+ /** @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;
+ /** @type {string} */ var gradTypeName = gluShaderUtil.getDataTypeName(gradType);
+ /** @type {string} */ var baseFuncName = '';
+
+ assertMsgOptions(!isGrad || !hasLodBias, 'Expected !isGrad || !hasLodBias', false, true);
+
+ switch (this.m_textureSpec.type) {
+ case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D:
+ samplerType = isShadow ? gluShaderUtil.DataType.SAMPLER_2D_SHADOW : gluTextureUtil.getSampler2DType(texFmt);
+ break;
+ case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP:
+ samplerType = isShadow ? gluShaderUtil.DataType.SAMPLER_CUBE_SHADOW : gluTextureUtil.getSamplerCubeType(texFmt);
+ break;
+ case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY:
+ samplerType = isShadow ? gluShaderUtil.DataType.SAMPLER_2D_ARRAY_SHADOW : gluTextureUtil.getSampler2DArrayType(texFmt);
+ break;
+ case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D:
+ assertMsgOptions(!isShadow, 'Expected !isShadow', false, true);
+ samplerType = gluTextureUtil.getSampler3DType(texFmt);
+ break;
+ default:
+ throw new Error('Unexpected type.');
+ }
+
+ switch (this.m_lookupSpec.func) {
+ case es3fShaderTextureFunctionTests.TexFunction.TEXTURE: baseFuncName = 'texture'; break;
+ case es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ: baseFuncName = 'textureProj'; break;
+ case es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJ3: baseFuncName = 'textureProj'; break;
+ case es3fShaderTextureFunctionTests.TexFunction.TEXTURELOD: baseFuncName = 'textureLod'; break;
+ case es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD: baseFuncName = 'textureProjLod'; break;
+ case es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJLOD3: baseFuncName = 'textureProjLod'; break;
+ case es3fShaderTextureFunctionTests.TexFunction.TEXTUREGRAD: baseFuncName = 'textureGrad'; break;
+ case es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD: baseFuncName = 'textureProjGrad'; break;
+ case es3fShaderTextureFunctionTests.TexFunction.TEXTUREPROJGRAD3: baseFuncName = 'textureProjGrad'; break;
+ case es3fShaderTextureFunctionTests.TexFunction.TEXELFETCH: baseFuncName = 'texelFetch'; break;
+ default:
+ throw new Error('Unexpected function.');
+ }
+
+ /** @type {string} */ var vert = '';
+ /** @type {string} */ var frag = '';
+ /** @type {string} */ var op = '';
+
+ vert += '#version 300 es\n' +
+ 'in highp vec4 a_position;\n' +
+ 'in ' + coordPrecName + ' ' + coordTypeName + ' a_in0;\n';
+
+ if (isGrad) {
+ vert += 'in ' + coordPrecName + ' ' + gradTypeName + ' a_in1;\n';
+ vert += 'in ' + coordPrecName + ' ' + gradTypeName + ' a_in2;\n';
+ }
+ else if (hasLodBias)
+ vert += 'in ' + coordPrecName + ' float a_in1;\n';
+
+ frag += '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 o_color;\n';
+
+ if (isVtxCase) {
+ vert += 'out mediump vec4 v_color;\n';
+ frag += 'in mediump vec4 v_color;\n';
+ }
+ else
+ {
+ vert += 'out ' + coordPrecName + ' ' + coordTypeName + ' v_texCoord;\n';
+ frag += 'in ' + coordPrecName + ' ' + coordTypeName + ' v_texCoord;\n';
+
+ if (isGrad) {
+ vert += 'out ' + coordPrecName + ' ' + gradTypeName + ' v_gradX;\n';
+ vert += 'out ' + coordPrecName + ' ' + gradTypeName + ' v_gradY;\n';
+ frag += 'in ' + coordPrecName + ' ' + gradTypeName + ' v_gradX;\n';
+ frag += 'in ' + coordPrecName + ' ' + gradTypeName + ' v_gradY;\n';
+ }
+
+ if (hasLodBias) {
+ vert += 'out ' + coordPrecName + ' float v_lodBias;\n';
+ frag += 'in ' + coordPrecName + ' float v_lodBias;\n';
+ }
+ }
+
+ // Uniforms
+ op += 'uniform highp ' + gluShaderUtil.getDataTypeName(samplerType) + ' u_sampler;\n' +
+ 'uniform highp vec4 u_scale;\n' +
+ 'uniform highp vec4 u_bias;\n';
+
+ vert += isVtxCase ? op : '';
+ frag += isVtxCase ? '' : op;
+ op = '';
+
+ vert += '\nvoid main()\n{\n' +
+ '\tgl_Position = a_position;\n';
+ frag += '\nvoid main()\n{\n';
+
+ if (isVtxCase)
+ vert += '\tv_color = ';
+ else
+ frag += '\to_color = ';
+
+ // Op.
+ /** @type {string} */ var texCoord = isVtxCase ? 'a_in0' : 'v_texCoord';
+ /** @type {string} */ var gradX = isVtxCase ? 'a_in1' : 'v_gradX';
+ /** @type {string} */ var gradY = isVtxCase ? 'a_in2' : 'v_gradY';
+ /** @type {string} */ var lodBias = isVtxCase ? 'a_in1' : 'v_lodBias';
+
+ op += 'vec4(' + baseFuncName;
+ if (this.m_lookupSpec.useOffset)
+ op += 'Offset';
+ op += '(u_sampler, ';
+
+ if (isIntCoord)
+ op += 'ivec' + (texCoordComps+extraCoordComps) + '(';
+
+ op += texCoord;
+
+ if (isIntCoord)
+ op += ')';
+
+ if (isGrad)
+ op += ', ' + gradX + ', ' + gradY;
+
+ if (es3fShaderTextureFunctionTests.functionHasLod(function_)) {
+ if (isIntCoord)
+ op += ', int(' + lodBias + ')';
+ else
+ op += ', ' + lodBias;
+ }
+
+ if (this.m_lookupSpec.useOffset) {
+ /** @type {number} */ var offsetComps = this.m_textureSpec.type === es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D ? 3 : 2;
+
+ op += ', ivec' + offsetComps + '(';
+ for (var ndx = 0; ndx < offsetComps; ndx++) {
+ if (ndx !== 0)
+ op += ', ';
+ op += this.m_lookupSpec.offset[ndx];
+ }
+ op += ')';
+ }
+
+ if (this.m_lookupSpec.useBias)
+ op += ', ' + lodBias;
+
+ op += ')';
+
+ if (isShadow)
+ op += ', 0.0, 0.0, 1.0)';
+ else
+ op += ')*u_scale + u_bias';
+
+ op += ';\n';
+
+ vert += isVtxCase ? op : '';
+ frag += isVtxCase ? '' : op;
+ op = '';
+
+ if (isVtxCase)
+ frag += '\to_color = v_color;\n';
+ else {
+ vert += '\tv_texCoord = a_in0;\n';
+
+ if (isGrad) {
+ vert += '\tv_gradX = a_in1;\n';
+ vert += '\tv_gradY = a_in2;\n';
+ }
+ else if (hasLodBias)
+ vert += '\tv_lodBias = a_in1;\n';
+ }
+
+ vert += '}\n';
+ frag += '}\n';
+
+ this.m_vertShaderSource = vert;
+ this.m_fragShaderSource = frag;
+ };
+
+ es3fShaderTextureFunctionTests.ShaderTextureFunctionCase.prototype.deinit = function() {
+ this.m_program = null;
+ this.m_texture2D = null;
+ this.m_textureCube = null;
+ this.m_texture2DArray = null;
+ this.m_texture3D = null;
+ };
+
+ /**
+ * @param {WebGLProgram} programID
+ * @param {Array<number>} constCoords
+ */
+ es3fShaderTextureFunctionTests.ShaderTextureFunctionCase.prototype.setupUniforms = function(programID, constCoords) {
+ gl.uniform1i(gl.getUniformLocation(programID, 'u_sampler'), 0);
+ gl.uniform4fv(gl.getUniformLocation(programID, 'u_scale'), this.m_lookupParams.scale);
+ gl.uniform4fv(gl.getUniformLocation(programID, 'u_bias'), this.m_lookupParams.bias);
+ };
+
+
+ /**
+ * @struct
+ * @constructor
+ * @param {Array<number>} textureSize
+ * @param {number} lod
+ * @param {number} lodBase
+ * @param {Array<number>} expectedSize
+ */
+ es3fShaderTextureFunctionTests.TestSize = function(textureSize, lod, lodBase, expectedSize) {
+ /** @type {Array<number>} */ this.textureSize = textureSize;
+ /** @type {number} */ this.lod = lod;
+ /** @type {number} */ this.lodBase = lodBase;
+ /** @type {Array<number>} */ this.expectedSize = expectedSize;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} desc
+ * @param {string} samplerType
+ * @param {es3fShaderTextureFunctionTests.TextureSpec} texture
+ * @param {boolean} isVertexCase
+ */
+ es3fShaderTextureFunctionTests.TextureSizeCase = function(name, desc, samplerType, texture, isVertexCase) {
+ tcuTestCase.DeqpTest.call(this, name, desc);
+ /** @type {string} */ this.m_samplerTypeStr = samplerType;
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ this.m_textureSpec = texture;
+ /** @type {boolean} */ this.m_isVertexCase = isVertexCase;
+ /** @type {boolean} */ this.m_has3DSize = texture.type === es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D || texture.type === es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY;
+ /** @type {?gluShaderProgram.ShaderProgram} */ this.m_program = null;
+ /** @type {number} */ this.m_iterationCounter = 0;
+ };
+
+ es3fShaderTextureFunctionTests.TextureSizeCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fShaderTextureFunctionTests.TextureSizeCase.prototype.constructor = es3fShaderTextureFunctionTests.TextureSizeCase;
+
+ es3fShaderTextureFunctionTests.TextureSizeCase.prototype.deinit = function() {
+ this.freeShader();
+ };
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fShaderTextureFunctionTests.TextureSizeCase.prototype.iterate = function() {
+ /** @type {number} */ var currentIteration = this.m_iterationCounter++;
+ /** @type {Array<es3fShaderTextureFunctionTests.TestSize>} */ var testSizes = [
+ new es3fShaderTextureFunctionTests.TestSize([1, 2, 1], 1, 0, [1, 1, 1]),
+ new es3fShaderTextureFunctionTests.TestSize([1, 2, 1], 0, 0, [1, 2, 1]),
+
+ new es3fShaderTextureFunctionTests.TestSize([1, 3, 2], 0, 0, [1, 3, 2]),
+ new es3fShaderTextureFunctionTests.TestSize([1, 3, 2], 1, 0, [1, 1, 1]),
+
+ new es3fShaderTextureFunctionTests.TestSize([100, 31, 18], 0, 0, [100, 31, 18]),
+ new es3fShaderTextureFunctionTests.TestSize([100, 31, 18], 1, 0, [50, 15, 9]),
+ new es3fShaderTextureFunctionTests.TestSize([100, 31, 18], 2, 0, [25, 7, 4]),
+ new es3fShaderTextureFunctionTests.TestSize([100, 31, 18], 3, 0, [12, 3, 2]),
+ new es3fShaderTextureFunctionTests.TestSize([100, 31, 18], 4, 0, [6, 1, 1]),
+ new es3fShaderTextureFunctionTests.TestSize([100, 31, 18], 5, 0, [3, 1, 1]),
+ new es3fShaderTextureFunctionTests.TestSize([100, 31, 18], 6, 0, [1, 1, 1]),
+
+ new es3fShaderTextureFunctionTests.TestSize([100, 128, 32], 0, 0, [100, 128, 32]),
+ new es3fShaderTextureFunctionTests.TestSize([100, 128, 32], 1, 0, [50, 64, 16]),
+ new es3fShaderTextureFunctionTests.TestSize([100, 128, 32], 2, 0, [25, 32, 8]),
+ new es3fShaderTextureFunctionTests.TestSize([100, 128, 32], 3, 0, [12, 16, 4]),
+ new es3fShaderTextureFunctionTests.TestSize([100, 128, 32], 4, 0, [6, 8, 2]),
+ new es3fShaderTextureFunctionTests.TestSize([100, 128, 32], 5, 0, [3, 4, 1]),
+ new es3fShaderTextureFunctionTests.TestSize([100, 128, 32], 6, 0, [1, 2, 1]),
+ new es3fShaderTextureFunctionTests.TestSize([100, 128, 32], 7, 0, [1, 1, 1]),
+
+ // pow 2
+ new es3fShaderTextureFunctionTests.TestSize([128, 64, 32], 0, 0, [128, 64, 32]),
+ new es3fShaderTextureFunctionTests.TestSize([128, 64, 32], 1, 0, [64, 32, 16]),
+ new es3fShaderTextureFunctionTests.TestSize([128, 64, 32], 2, 0, [32, 16, 8]),
+ new es3fShaderTextureFunctionTests.TestSize([128, 64, 32], 3, 0, [16, 8, 4]),
+ new es3fShaderTextureFunctionTests.TestSize([128, 64, 32], 4, 0, [8, 4, 2]),
+ new es3fShaderTextureFunctionTests.TestSize([128, 64, 32], 5, 0, [4, 2, 1]),
+ new es3fShaderTextureFunctionTests.TestSize([128, 64, 32], 6, 0, [2, 1, 1]),
+ new es3fShaderTextureFunctionTests.TestSize([128, 64, 32], 7, 0, [1, 1, 1]),
+
+ // w === h
+ new es3fShaderTextureFunctionTests.TestSize([1, 1, 1], 0, 0, [1, 1, 1]),
+ new es3fShaderTextureFunctionTests.TestSize([64, 64, 64], 0, 0, [64, 64, 64]),
+ new es3fShaderTextureFunctionTests.TestSize([64, 64, 64], 1, 0, [32, 32, 32]),
+ new es3fShaderTextureFunctionTests.TestSize([64, 64, 64], 2, 0, [16, 16, 16]),
+ new es3fShaderTextureFunctionTests.TestSize([64, 64, 64], 3, 0, [8, 8, 8]),
+ new es3fShaderTextureFunctionTests.TestSize([64, 64, 64], 4, 0, [4, 4, 4]),
+
+ // with lod base
+ new es3fShaderTextureFunctionTests.TestSize([100, 31, 18], 3, 1, [6, 1, 1]),
+ new es3fShaderTextureFunctionTests.TestSize([128, 64, 32], 3, 1, [8, 4, 2]),
+ new es3fShaderTextureFunctionTests.TestSize([64, 64, 64], 1, 1, [16, 16, 16])
+
+ ];
+ /** @type {number} */ var lastIterationIndex = testSizes.length + 1;
+
+ if (currentIteration === 0) {
+ return this.initShader() ? tcuTestCase.IterateResult.CONTINUE : tcuTestCase.IterateResult.STOP;
+ }
+ else if (currentIteration === lastIterationIndex) {
+ this.freeShader();
+ return tcuTestCase.IterateResult.STOP;
+ }
+ else {
+ if (!this.testTextureSize(testSizes[currentIteration - 1]))
+ testFailedOptions('Fail: Case ' + (currentIteration - 1) + ' Got unexpected texture size', false);
+ else
+ testPassedOptions('Pass', true);
+
+ return tcuTestCase.IterateResult.CONTINUE;
+ }
+ };
+
+ /**
+ * @return {boolean}
+ */
+ es3fShaderTextureFunctionTests.TextureSizeCase.prototype.initShader = function() {
+ /** @type {string} */ var vertSrc = this.genVertexShader();
+ /** @type {string} */ var fragSrc = this.genFragmentShader();
+
+ assertMsgOptions(this.m_program === null, 'Program should be null', false, true);
+ this.m_program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertSrc, fragSrc));
+
+ if (!this.m_program.isOk()) {
+ testFailedOptions('Fail: Shader failed', false);
+ return false;
+ }
+
+ return true;
+ };
+
+ es3fShaderTextureFunctionTests.TextureSizeCase.prototype.freeShader = function() {
+ this.m_program = null;
+ };
+
+ /**
+ * @param {es3fShaderTextureFunctionTests.TestSize} testSize
+ * @return {boolean}
+ */
+ es3fShaderTextureFunctionTests.TextureSizeCase.prototype.testTextureSize = function(testSize) {
+ /** @type {Array<number>} */ var triangle = [ // covers entire viewport
+ -1, -1, 0, 1, // was a 3x4 matrix
+ 4, -1, 0, 1,
+ -1, 4, 0, 1
+ ];
+
+ /** @type {number} */ var positionLoc = gl.getAttribLocation(this.m_program.getProgram(), 'a_position');
+ /** @type {WebGLUniformLocation} */ var samplerLoc = gl.getUniformLocation(this.m_program.getProgram(), 'u_sampler');
+ /** @type {WebGLUniformLocation} */ var sizeLoc = gl.getUniformLocation(this.m_program.getProgram(), 'u_texSize');
+ /** @type {WebGLUniformLocation} */ var lodLoc = gl.getUniformLocation(this.m_program.getProgram(), 'u_lod');
+ /** @type {number} */ var textureTarget = this.getGLTextureTarget();
+ /** @type {boolean} */ var isSquare = testSize.textureSize[0] === testSize.textureSize[1];
+ /** @type {boolean} */ var is2DLodValid = (testSize.textureSize[0] >> (testSize.lod + testSize.lodBase)) !== 0 || (testSize.textureSize[1] >> (testSize.lod + testSize.lodBase)) !== 0;
+ /** @type {boolean} */ var success = true;
+ /** @type {number} */ var errorValue;
+
+ // Skip incompatible cases
+ if (this.m_textureSpec.type === es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP && !isSquare)
+ return true;
+ if (this.m_textureSpec.type === es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D && !is2DLodValid)
+ return true;
+ if (this.m_textureSpec.type === es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY && !is2DLodValid)
+ return true;
+
+ // setup rendering
+ gl.useProgram(this.m_program.getProgram());
+ gl.uniform1i(samplerLoc, 0);
+ gl.clearColor(0.5, 0.5, 0.5, 1.0);
+ gl.viewport(0, 0, 1, 1);
+
+ /** @type {WebGLBuffer} */ var triangleGlBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, triangleGlBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangle), gl.STATIC_DRAW);
+
+ gl.vertexAttribPointer(positionLoc, 4, gl.FLOAT, false, 0, 0);
+ gl.enableVertexAttribArray(positionLoc);
+
+ // setup texture
+ /** @type {number} */ var maxLevel = testSize.lod + testSize.lodBase;
+ /** @type {number} */ var levels = maxLevel + 1;
+ /** @type {?WebGLTexture} */ var texId = null;
+
+ // gen texture
+ texId = gl.createTexture();
+ gl.bindTexture(textureTarget, texId);
+ gl.texParameteri(textureTarget, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ gl.texParameteri(textureTarget, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+ gl.texParameteri(textureTarget, gl.TEXTURE_BASE_LEVEL, testSize.lodBase);
+ gl.texParameteri(textureTarget, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE);
+
+ // set up texture
+
+ switch (this.m_textureSpec.type) {
+ case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D:
+ // bufferedLogToConsole('Testing image size ' + testSize.textureSize[0] + 'x' + testSize.textureSize[1] + 'x' + testSize.textureSize[2]);
+ // bufferedLogToConsole('Lod: ' + testSize.lod + ', base level: ' + testSize.lodBase);
+ // bufferedLogToConsole('Expecting: ' + testSize.expectedSize[0] + 'x' + testSize.expectedSize[1] + 'x' + testSize.expectedSize[2]);
+
+ gl.uniform3iv(sizeLoc, testSize.expectedSize);
+ gl.uniform1iv(lodLoc, [testSize.lod]);
+
+ gl.texStorage3D(textureTarget, levels, this.m_textureSpec.format, testSize.textureSize[0], testSize.textureSize[1], testSize.textureSize[2]);
+ break;
+
+ case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D:
+ case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP:
+ // bufferedLogToConsole('Testing image size ' + testSize.textureSize[0] + 'x' + testSize.textureSize[1]);
+ // bufferedLogToConsole('Lod: ' + testSize.lod + ', base level: ' + testSize.lodBase);
+ // bufferedLogToConsole('Expecting: ' + testSize.expectedSize[0] + 'x' + testSize.expectedSize[1]);
+
+ gl.uniform2iv(sizeLoc, testSize.expectedSize.slice(0,2));
+ gl.uniform1iv(lodLoc, [testSize.lod]);
+
+ gl.texStorage2D(textureTarget, levels, this.m_textureSpec.format, testSize.textureSize[0], testSize.textureSize[1]);
+ break;
+
+ case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY:
+ /** @type {Array<number>} */ var expectedSize = [testSize.expectedSize[0], testSize.expectedSize[1], testSize.textureSize[2]];
+
+ // bufferedLogToConsole('Testing image size ' + testSize.textureSize[0] + 'x' + testSize.textureSize[1] + ' with ' + testSize.textureSize[2] + ' layer(s)');
+ // bufferedLogToConsole('Lod: ' + testSize.lod + ', base level: ' + testSize.lodBase);
+ // bufferedLogToConsole('Expecting: ' + testSize.expectedSize[0] + 'x' + testSize.expectedSize[1] + ' and ' + testSize.textureSize[2] + ' layer(s)');
+
+ gl.uniform3iv(sizeLoc, expectedSize);
+ gl.uniform1iv(lodLoc, [testSize.lod]);
+
+ gl.texStorage3D(textureTarget, levels, this.m_textureSpec.format, testSize.textureSize[0], testSize.textureSize[1], testSize.textureSize[2]);
+ break;
+
+ default:
+ throw new Error('Type not supported');
+ }
+
+ // test
+ /** @type {number} */ var colorTolerance = 0.1;
+ /** @type {tcuSurface.Surface} */ var sample = new tcuSurface.Surface(1, 1);
+ /** @type {Array<number>} */ var outputColor;
+
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.drawArrays(gl.TRIANGLES, 0, 3);
+ gl.finish();
+
+ sample.readViewport(gl, [0, 0, 1, 1]);
+
+ outputColor = sample.getAccess().getPixel(0, 0);
+
+ if (outputColor[0] >= 1.0 - colorTolerance &&
+ outputColor[1] >= 1.0 - colorTolerance &&
+ outputColor[2] >= 1.0 - colorTolerance)
+ bufferedLogToConsole('Passed');
+ else {
+ // failure
+ bufferedLogToConsole('Failed');
+ success = false;
+ }
+
+ // free
+ gl.bindTexture(textureTarget, null);
+ gl.deleteTexture(texId);
+
+ gl.useProgram(null);
+
+ return success;
+ };
+
+ /**
+ * @return {string}
+ */
+ es3fShaderTextureFunctionTests.TextureSizeCase.prototype.genVertexShader = function() {
+ /** @type {string} */ var vert = '';
+ vert += '#version 300 es\n' +
+ 'in highp vec4 a_position;\n';
+
+ if (this.m_isVertexCase) {
+ vert += 'out mediump vec4 v_color;\n' +
+ 'uniform highp ' + this.m_samplerTypeStr + ' u_sampler;\n' +
+ 'uniform highp ivec' + (this.m_has3DSize ? 3 : 2) + ' u_texSize;\n' +
+ 'uniform highp int u_lod;\n';
+ }
+
+ vert += 'void main()\n{\n';
+
+ if (this.m_isVertexCase)
+ 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';
+
+ vert += ' gl_Position = a_position;\n' +
+ '}\n';
+
+ return vert;
+ };
+
+ /**
+ * @return {string}
+ */
+ es3fShaderTextureFunctionTests.TextureSizeCase.prototype.genFragmentShader = function() {
+ /** @type {string} */ var frag = '';
+
+ frag += '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 o_color;\n';
+
+ if (this.m_isVertexCase)
+ frag += 'in mediump vec4 v_color;\n';
+
+ if (!this.m_isVertexCase) {
+ frag += 'uniform highp ' + this.m_samplerTypeStr + ' u_sampler;\n' +
+ 'uniform highp ivec' + (this.m_has3DSize ? 3 : 2) + ' u_texSize;\n' +
+ 'uniform highp int u_lod;\n';
+ }
+
+ frag += 'void main()\n{\n';
+
+ if (!this.m_isVertexCase)
+ 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';
+ else
+ frag += ' o_color = v_color;\n';
+
+ frag += '}\n';
+
+ return frag;
+ };
+
+ /**
+ * @return {number}
+ */
+ es3fShaderTextureFunctionTests.TextureSizeCase.prototype.getGLTextureTarget = function() {
+ switch (this.m_textureSpec.type) {
+ case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D:
+ return gl.TEXTURE_2D;
+ case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP:
+ return gl.TEXTURE_CUBE_MAP;
+ case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY:
+ return gl.TEXTURE_2D_ARRAY;
+ case es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D:
+ return gl.TEXTURE_3D;
+ default:
+ throw new Error('Texture Type not supported.');
+ }
+ };
+
+ /** @typedef {Array<string, es3fShaderTextureFunctionTests.TextureLookupSpec, es3fShaderTextureFunctionTests.TextureSpec, es3fShaderTextureFunctionTests.EvalFunc, es3fShaderTextureFunctionTests.CaseFlags>} */ es3fShaderTextureFunctionTests.TestSpec;
+
+ /**
+ * @param {string} name
+ * @param {es3fShaderTextureFunctionTests.TexFunction} func
+ * @param {Array<number>} minCoord
+ * @param {Array<number>} maxCoord
+ * @param {boolean} useBias
+ * @param {number} minLodBias
+ * @param {number} maxLodBias
+ * @param {boolean} useOffset
+ * @param {Array<number>} offset
+ * @param {es3fShaderTextureFunctionTests.TextureSpec} texSpec
+ * @param {es3fShaderTextureFunctionTests.TexEvalFunc} evalFunc
+ * @param {es3fShaderTextureFunctionTests.CaseFlags} flags
+ * @return {es3fShaderTextureFunctionTests.TexFuncCaseSpec}
+ */
+ es3fShaderTextureFunctionTests.getCaseSpec = function(name, func, minCoord, maxCoord, useBias, minLodBias, maxLodBias, useOffset, offset, texSpec, evalFunc, flags) {
+ return new es3fShaderTextureFunctionTests.TexFuncCaseSpec(name,
+ 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),
+ texSpec,
+ evalFunc,
+ flags);
+ };
+
+ /**
+ * @param {string} name
+ * @param {es3fShaderTextureFunctionTests.TexFunction} func
+ * @param {Array<number>} minCoord
+ * @param {Array<number>} maxCoord
+ * @param {Array<number>} mindx
+ * @param {Array<number>} maxdx
+ * @param {Array<number>} mindy
+ * @param {Array<number>} maxdy
+ * @param {boolean} useOffset
+ * @param {Array<number>} offset
+ * @param {es3fShaderTextureFunctionTests.TextureSpec} texSpec
+ * @param {es3fShaderTextureFunctionTests.TexEvalFunc} evalFunc
+ * @param {es3fShaderTextureFunctionTests.CaseFlags} flags
+ * @return {es3fShaderTextureFunctionTests.TexFuncCaseSpec}
+ */
+ es3fShaderTextureFunctionTests.getGradCaseSpec = function(name, func, minCoord, maxCoord, mindx, maxdx, mindy, maxdy, useOffset, offset, texSpec, evalFunc, flags) {
+ return new es3fShaderTextureFunctionTests.TexFuncCaseSpec(name,
+ new es3fShaderTextureFunctionTests.TextureLookupSpec(func, minCoord, maxCoord, false, 0.0, 0.0, mindx, maxdx, mindy, maxdy, useOffset, offset),
+ texSpec,
+ evalFunc,
+ flags);
+ };
+
+ /**
+ * @enum {number}
+ */
+ es3fShaderTextureFunctionTests.CaseFlags = {
+ VERTEX: 1,
+ FRAGMENT: 2,
+ BOTH: 3
+ };
+
+ /**
+ * @struct
+ * @constructor
+ * @param {string} name
+ * @param {es3fShaderTextureFunctionTests.TextureLookupSpec} lookupSpec
+ * @param {es3fShaderTextureFunctionTests.TextureSpec} texSpec
+ * @param {es3fShaderTextureFunctionTests.TexEvalFunc} evalFunc
+ * @param {number} flags
+ */
+ es3fShaderTextureFunctionTests.TexFuncCaseSpec = function(name, lookupSpec, texSpec, evalFunc, flags) {
+ /** @type {string} */ this.name = name;
+ /** @type {es3fShaderTextureFunctionTests.TextureLookupSpec} */ this.lookupSpec = lookupSpec;
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ this.texSpec = texSpec;
+ /** @type {es3fShaderTextureFunctionTests.TexEvalFunc} */ this.evalFunc = evalFunc;
+ /** @type {number} */ this.flags = flags;
+ };
+
+ /**
+ * @param {tcuTestCase.DeqpTest} parent
+ * @param {string} groupName
+ * @param {string} groupDesc
+ * @param {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} cases
+ */
+ es3fShaderTextureFunctionTests.createCaseGroup = function(parent, groupName, groupDesc, cases) {
+ /** @type {tcuTestCase.DeqpTest} */ var group = tcuTestCase.newTest(groupName, groupDesc);
+ parent.addChild(group);
+
+ for (var ndx = 0; ndx < cases.length; ndx++) {
+ /** @type {string} */ var name = cases[ndx].name;
+ if (cases[ndx].flags & es3fShaderTextureFunctionTests.CaseFlags.VERTEX)
+ group.addChild(new es3fShaderTextureFunctionTests.ShaderTextureFunctionCase(name + '_vertex', '', cases[ndx].lookupSpec, cases[ndx].texSpec, cases[ndx].evalFunc, true));
+ if (cases[ndx].flags & es3fShaderTextureFunctionTests.CaseFlags.FRAGMENT)
+ group.addChild(new es3fShaderTextureFunctionTests.ShaderTextureFunctionCase(name + '_fragment', '', cases[ndx].lookupSpec, cases[ndx].texSpec, cases[ndx].evalFunc, false));
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fShaderTextureFunctionTests.ShaderTextureFunctionTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'texture_functions', 'Texture Access Function Tests');
+ };
+
+ es3fShaderTextureFunctionTests.ShaderTextureFunctionTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fShaderTextureFunctionTests.ShaderTextureFunctionTests.prototype.constructor = es3fShaderTextureFunctionTests.ShaderTextureFunctionTests;
+
+ es3fShaderTextureFunctionTests.ShaderTextureFunctionTests.prototype.init = function() {
+ // Samplers
+ /** @type {tcuTexture.Sampler} */ var samplerNearestNoMipmap = new tcuTexture.Sampler(tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL,
+ tcuTexture.FilterMode.NEAREST, tcuTexture.FilterMode.NEAREST,
+ 0.0 /* LOD threshold */, true /* normalized coords */, tcuTexture.CompareMode.COMPAREMODE_NONE,
+ 0 /* cmp channel */, [0.0, 0.0, 0.0, 0.0] /* border color */, true /* seamless cube map */);
+ /** @type {tcuTexture.Sampler} */ var samplerLinearNoMipmap = new tcuTexture.Sampler(tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL,
+ tcuTexture.FilterMode.LINEAR, tcuTexture.FilterMode.LINEAR,
+ 0.0 /* LOD threshold */, true /* normalized coords */, tcuTexture.CompareMode.COMPAREMODE_NONE,
+ 0 /* cmp channel */, [0.0, 0.0, 0.0, 0.0] /* border color */, true /* seamless cube map */);
+ /** @type {tcuTexture.Sampler} */ var samplerNearestMipmap = new tcuTexture.Sampler(tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL,
+ tcuTexture.FilterMode.NEAREST_MIPMAP_NEAREST, tcuTexture.FilterMode.NEAREST,
+ 0.0 /* LOD threshold */, true /* normalized coords */, tcuTexture.CompareMode.COMPAREMODE_NONE,
+ 0 /* cmp channel */, [0.0, 0.0, 0.0, 0.0] /* border color */, true /* seamless cube map */);
+ /** @type {tcuTexture.Sampler} */ var samplerLinearMipmap = new tcuTexture.Sampler(tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL,
+ tcuTexture.FilterMode.LINEAR_MIPMAP_NEAREST, tcuTexture.FilterMode.LINEAR,
+ 0.0 /* LOD threshold */, true /* normalized coords */, tcuTexture.CompareMode.COMPAREMODE_NONE,
+ 0 /* cmp channel */, [0.0, 0.0, 0.0, 0.0] /* border color */, true /* seamless cube map */);
+
+ /** @type {tcuTexture.Sampler} */ var samplerShadowNoMipmap = new tcuTexture.Sampler(tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL,
+ tcuTexture.FilterMode.NEAREST, tcuTexture.FilterMode.NEAREST,
+ 0.0 /* LOD threshold */, true /* normalized coords */, tcuTexture.CompareMode.COMPAREMODE_LESS,
+ 0 /* cmp channel */, [0.0, 0.0, 0.0, 0.0] /* border color */, true /* seamless cube map */);
+ /** @type {tcuTexture.Sampler} */ var samplerShadowMipmap = new tcuTexture.Sampler(tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL,
+ tcuTexture.FilterMode.NEAREST_MIPMAP_NEAREST, tcuTexture.FilterMode.NEAREST,
+ 0.0 /* LOD threshold */, true /* normalized coords */, tcuTexture.CompareMode.COMPAREMODE_LESS,
+ 0 /* cmp channel */, [0.0, 0.0, 0.0, 0.0] /* border color */, true /* seamless cube map */);
+
+ /** @type {tcuTexture.Sampler} */ var samplerTexelFetch = new tcuTexture.Sampler(tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL, tcuTexture.WrapMode.REPEAT_GL,
+ tcuTexture.FilterMode.NEAREST_MIPMAP_NEAREST, tcuTexture.FilterMode.NEAREST,
+ 0.0 /* LOD threshold */, false /* non-normalized coords */, tcuTexture.CompareMode.COMPAREMODE_NONE,
+ 0 /* cmp channel */, [0.0, 0.0, 0.0, 0.0] /* border color */, true /* seamless cube map */);
+
+ // Default textures.
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA8, 256, 256, 1, 1, samplerLinearNoMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA16F, 256, 256, 1, 1, samplerLinearNoMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA8I, 256, 256, 1, 1, samplerNearestNoMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA8UI, 256, 256, 1, 1, samplerNearestNoMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DMipmapFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA8, 256, 256, 1, 9, samplerLinearMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DMipmapFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA16F, 256, 256, 1, 9, samplerLinearMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DMipmapInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA8I, 256, 256, 1, 9, samplerNearestMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DMipmapUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA8UI, 256, 256, 1, 9, samplerNearestMipmap);
+
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DShadow = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.DEPTH_COMPONENT16, 256, 256, 1, 9, samplerShadowNoMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DMipmapShadow = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.DEPTH_COMPONENT16, 256, 256, 1, 9, samplerShadowMipmap);
+
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DTexelFetchFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA8, 256, 256, 1, 9, samplerTexelFetch);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DTexelFetchFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA16F, 256, 256, 1, 9, samplerTexelFetch);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DTexelFetchInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA8I, 256, 256, 1, 9, samplerTexelFetch);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DTexelFetchUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D, gl.RGBA8UI, 256, 256, 1, 9, samplerTexelFetch);
+
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.RGBA8, 256, 256, 1, 1, samplerLinearNoMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.RGBA16F, 256, 256, 1, 1, samplerLinearNoMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.RGBA8I, 256, 256, 1, 1, samplerNearestNoMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.RGBA8UI, 256, 256, 1, 1, samplerNearestNoMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeMipmapFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.RGBA8, 256, 256, 1, 9, samplerLinearMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeMipmapFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.RGBA16F, 128, 128, 1, 8, samplerLinearMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeMipmapInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.RGBA8I, 256, 256, 1, 9, samplerNearestMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeMipmapUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.RGBA8UI, 256, 256, 1, 9, samplerNearestMipmap);
+
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeShadow = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.DEPTH_COMPONENT16, 256, 256, 1, 1, samplerShadowNoMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var texCubeMipmapShadow = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_CUBE_MAP, gl.DEPTH_COMPONENT16, 256, 256, 1, 9, samplerShadowMipmap);
+
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA8, 128, 128, 4, 1, samplerLinearNoMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA16F, 128, 128, 4, 1, samplerLinearNoMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA8I, 128, 128, 4, 1, samplerNearestNoMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA8UI, 128, 128, 4, 1, samplerNearestNoMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayMipmapFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA8, 128, 128, 4, 8, samplerLinearMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayMipmapFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA16F, 128, 128, 4, 8, samplerLinearMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayMipmapInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA8I, 128, 128, 4, 8, samplerNearestMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayMipmapUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA8UI, 128, 128, 4, 8, samplerNearestMipmap);
+
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayShadow = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.DEPTH_COMPONENT16, 128, 128, 4, 1, samplerShadowNoMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayMipmapShadow = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.DEPTH_COMPONENT16, 128, 128, 4, 8, samplerShadowMipmap);
+
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayTexelFetchFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA8, 128, 128, 4, 8, samplerTexelFetch);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayTexelFetchFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA16F, 128, 128, 4, 8, samplerTexelFetch);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayTexelFetchInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA8I, 128, 128, 4, 8, samplerTexelFetch);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex2DArrayTexelFetchUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_2D_ARRAY, gl.RGBA8UI, 128, 128, 4, 8, samplerTexelFetch);
+
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA8, 64, 32, 32, 1, samplerLinearNoMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA16F, 64, 32, 32, 1, samplerLinearNoMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA8I, 64, 32, 32, 1, samplerNearestNoMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA8UI, 64, 32, 32, 1, samplerNearestNoMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DMipmapFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA8, 64, 32, 32, 7, samplerLinearMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DMipmapFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA16F, 64, 32, 32, 7, samplerLinearMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DMipmapInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA8I, 64, 32, 32, 7, samplerNearestMipmap);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DMipmapUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA8UI, 64, 32, 32, 7, samplerNearestMipmap);
+
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DTexelFetchFixed = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA8, 64, 32, 32, 7, samplerTexelFetch);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DTexelFetchFloat = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA16F, 64, 32, 32, 7, samplerTexelFetch);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DTexelFetchInt = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA8I, 64, 32, 32, 7, samplerTexelFetch);
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ var tex3DTexelFetchUint = new es3fShaderTextureFunctionTests.TextureSpec(es3fShaderTextureFunctionTests.TextureType.TEXTURETYPE_3D, gl.RGBA8UI, 64, 32, 32, 7, samplerTexelFetch);
+
+ var testGroup = tcuTestCase.runner.testCases;
+ // texture() cases
+ /** @type {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} */ var textureCases = [
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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)
+
+ // Not in spec.
+ // 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)
+ ];
+ es3fShaderTextureFunctionTests.createCaseGroup(this, 'texture', 'texture() Tests', textureCases);
+
+ // textureOffset() cases
+ // \note _bias variants are not using mipmap thanks to wide allowed range for LOD computation
+ /** @type {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} */ var textureOffsetCases = [
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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)
+ ];
+ es3fShaderTextureFunctionTests.createCaseGroup(this, 'textureoffset', 'textureOffset() Tests', textureOffsetCases);
+
+ // textureProj() cases
+ // \note Currently uses constant divider!
+ /** @type {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} */ var textureProjCases = [
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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)
+ ];
+ es3fShaderTextureFunctionTests.createCaseGroup(this, 'textureproj', 'textureProj() Tests', textureProjCases);
+
+ // textureProjOffset() cases
+ // \note Currently uses constant divider!
+ /** @type {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} */ var textureProjOffsetCases = [
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+
+ // NOTE: offset changed from [-8, 7, 0] in native dEQP to [7, -8, 0] per https://github.com/KhronosGroup/WebGL/issues/2033
+ 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),
+ 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),
+ 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)
+ ];
+ es3fShaderTextureFunctionTests.createCaseGroup(this, 'textureprojoffset', 'textureOffsetProj() Tests', textureProjOffsetCases);
+
+ // textureLod() cases
+ /** @type {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} */ var textureLodCases = [
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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)
+ ];
+ es3fShaderTextureFunctionTests.createCaseGroup(this, 'texturelod', 'textureLod() Tests', textureLodCases);
+
+ // textureLodOffset() cases
+ /** @type {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} */ var textureLodOffsetCases = [
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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)
+ ];
+ es3fShaderTextureFunctionTests.createCaseGroup(this, 'texturelodoffset', 'textureLodOffset() Tests', textureLodOffsetCases);
+
+ // textureProjLod() cases
+ /** @type {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} */ var textureProjLodCases = [
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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)
+ ];
+ es3fShaderTextureFunctionTests.createCaseGroup(this, 'textureprojlod', 'textureProjLod() Tests', textureProjLodCases);
+
+ // textureProjLodOffset() cases
+ /** @type {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} */ var textureProjLodOffsetCases = [
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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)
+ ];
+ es3fShaderTextureFunctionTests.createCaseGroup(this, 'textureprojlodoffset', 'textureProjLodOffset() Tests', textureProjLodOffsetCases);
+
+ // textureGrad() cases
+ // \note Only one of dudx, dudy, dvdx, dvdy is non-zero since spec allows approximating p from derivates by various methods.
+ /** @type {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} */ var textureGradCases = [
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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)
+ ];
+ es3fShaderTextureFunctionTests.createCaseGroup(this, 'texturegrad', 'textureGrad() Tests', textureGradCases);
+
+ // textureGradOffset() cases
+ /** @type {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} */ var textureGradOffsetCases = [
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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)
+ ];
+ es3fShaderTextureFunctionTests.createCaseGroup(this, 'texturegradoffset', 'textureGradOffset() Tests', textureGradOffsetCases);
+
+ // textureProjGrad() cases
+ /** @type {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} */ var textureProjGradCases = [
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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)
+ ];
+ es3fShaderTextureFunctionTests.createCaseGroup(this, 'textureprojgrad', 'textureProjGrad() Tests', textureProjGradCases);
+
+ // textureProjGradOffset() cases
+ /** @type {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} */ var textureProjGradOffsetCases = [
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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)
+ ];
+ es3fShaderTextureFunctionTests.createCaseGroup(this, 'textureprojgradoffset', 'textureProjGradOffset() Tests', textureProjGradOffsetCases);
+
+ // texelFetch() cases
+ // \note Level is constant across quad
+ /** @type {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} */ var texelFetchCases = [
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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)
+ ];
+ es3fShaderTextureFunctionTests.createCaseGroup(this, 'texelfetch', 'texelFetch() Tests', texelFetchCases);
+
+ // texelFetchOffset() cases
+ /** @type {Array<es3fShaderTextureFunctionTests.TexFuncCaseSpec>} */ var texelFetchOffsetCases = [
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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),
+
+ 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),
+ 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),
+ 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),
+ 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)
+ ];
+ es3fShaderTextureFunctionTests.createCaseGroup(this, 'texelfetchoffset', 'texelFetchOffset() Tests', texelFetchOffsetCases);
+
+ // textureSize() cases
+ /**
+ * @struct
+ * @constructor
+ * @param {string} name
+ * @param {string} samplerName
+ * @param {es3fShaderTextureFunctionTests.TextureSpec} textureSpec
+ */
+ var TextureSizeCaseSpec = function(name, samplerName, textureSpec) {
+ /** @type {string} */ this.name = name;
+ /** @type {string} */ this.samplerName = samplerName;
+ /** @type {es3fShaderTextureFunctionTests.TextureSpec} */ this.textureSpec = textureSpec;
+ };
+
+ /** @type {Array<TextureSizeCaseSpec>} */ var textureSizeCases = [
+ new TextureSizeCaseSpec('sampler2d_fixed', 'sampler2D', tex2DFixed),
+ new TextureSizeCaseSpec('sampler2d_float', 'sampler2D', tex2DFloat),
+ new TextureSizeCaseSpec('isampler2d', 'isampler2D', tex2DInt),
+ new TextureSizeCaseSpec('usampler2d', 'usampler2D', tex2DUint),
+ new TextureSizeCaseSpec('sampler2dshadow', 'sampler2DShadow', tex2DShadow),
+ new TextureSizeCaseSpec('sampler3d_fixed', 'sampler3D', tex3DFixed),
+ new TextureSizeCaseSpec('sampler3d_float', 'sampler3D', tex3DFloat),
+ new TextureSizeCaseSpec('isampler3d', 'isampler3D', tex3DInt),
+ new TextureSizeCaseSpec('usampler3d', 'usampler3D', tex3DUint),
+ new TextureSizeCaseSpec('samplercube_fixed', 'samplerCube', texCubeFixed),
+ new TextureSizeCaseSpec('samplercube_float', 'samplerCube', texCubeFloat),
+ new TextureSizeCaseSpec('isamplercube', 'isamplerCube', texCubeInt),
+ new TextureSizeCaseSpec('usamplercube', 'usamplerCube', texCubeUint),
+ new TextureSizeCaseSpec('samplercubeshadow', 'samplerCubeShadow', texCubeShadow),
+ new TextureSizeCaseSpec('sampler2darray_fixed', 'sampler2DArray', tex2DArrayFixed),
+ new TextureSizeCaseSpec('sampler2darray_float', 'sampler2DArray', tex2DArrayFloat),
+ new TextureSizeCaseSpec('isampler2darray', 'isampler2DArray', tex2DArrayInt),
+ new TextureSizeCaseSpec('usampler2darray', 'usampler2DArray', tex2DArrayUint),
+ new TextureSizeCaseSpec('sampler2darrayshadow', 'sampler2DArrayShadow', tex2DArrayShadow)
+ ];
+
+ /** @type {tcuTestCase.DeqpTest} */ var group = tcuTestCase.newTest('texturesize', 'textureSize() Tests');
+ testGroup.addChild(group);
+
+ for (var ndx = 0; ndx < textureSizeCases.length; ++ndx) {
+ group.addChild(new es3fShaderTextureFunctionTests.TextureSizeCase(textureSizeCases[ndx].name + '_vertex', '', textureSizeCases[ndx].samplerName, textureSizeCases[ndx].textureSpec, true));
+ group.addChild(new es3fShaderTextureFunctionTests.TextureSizeCase(textureSizeCases[ndx].name + '_fragment', '', textureSizeCases[ndx].samplerName, textureSizeCases[ndx].textureSpec, false));
+ }
+
+ };
+
+ /**
+ * Run test
+ * @param {WebGL2RenderingContext} context
+ * @param {Array<number>=} range Test range
+ */
+ es3fShaderTextureFunctionTests.run = function(context, range) {
+ gl = context;
+
+ const canvas = gl.canvas;
+ canvas.width = canvasWH;
+ canvas.height = canvasWH;
+
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fShaderTextureFunctionTests.ShaderTextureFunctionTests());
+ if (range)
+ state.setRange(range);
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fShaderTextureFunctionTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fStringQueryTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fStringQueryTests.js
new file mode 100644
index 0000000000..8e90ff576b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fStringQueryTests.js
@@ -0,0 +1,111 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fStringQueryTests');
+goog.require('framework.common.tcuTestCase');
+goog.require('functional.gles3.es3fApiCase');
+
+goog.scope(function() {
+ var es3fStringQueryTests = functional.gles3.es3fStringQueryTests;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var es3fApiCase = functional.gles3.es3fApiCase;
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fStringQueryTests.StringQueryTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'string', 'String Query tests');
+ };
+
+ es3fStringQueryTests.StringQueryTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fStringQueryTests.StringQueryTests.prototype.constructor = es3fStringQueryTests.StringQueryTests;
+
+ es3fStringQueryTests.StringQueryTests.prototype.init = function() {
+ this.addChild(new es3fApiCase.ApiCaseCallback('renderer', 'RENDERER', gl, function() {
+ var string = /** @type {string} */ (gl.getParameter(gl.RENDERER));
+ this.check(string !== null,
+ 'Got invalid string: ' + string);
+ }));
+
+ this.addChild(new es3fApiCase.ApiCaseCallback('vendor', 'VENDOR', gl, function() {
+ var string = /** @type {string} */ (gl.getParameter(gl.VENDOR));
+ this.check(string !== null,
+ 'Got invalid string: ' + string);
+ }));
+
+ this.addChild(new es3fApiCase.ApiCaseCallback('version', 'VERSION', gl, function() {
+ var string = /** @type {string} */ (gl.getParameter(gl.VERSION));
+ /** @type {string} */ var referenceString = 'WebGL 2.0';
+
+ this.check(string !== null && string.indexOf(referenceString) === 0,
+ 'Got invalid string prefix: ' + string + ' expected: ' + referenceString);
+ }));
+
+ this.addChild(new es3fApiCase.ApiCaseCallback('shading_language_version', 'SHADING_LANGUAGE_VERSION', gl, function() {
+ var string = /** @type {string} */ (gl.getParameter(gl.SHADING_LANGUAGE_VERSION));
+ /** @type {string} */ var referenceString = 'WebGL GLSL ES 3.00';
+
+ this.check(string !== null, 'Got invalid string');
+ this.check(string.indexOf(referenceString) === 0, 'Got invalid string prefix');
+ }));
+
+ this.addChild(new es3fApiCase.ApiCaseCallback('extensions', 'EXTENSIONS', gl, function() {
+ /** @type {Array<string>} */ var extensions = gl.getSupportedExtensions();
+ this.check(extensions !== null, 'Got invalid string');
+
+ // [dag] check that all extensions from gl.getSupportedExtensions() are found using gl.getExtension()
+ for (var i in extensions) {
+ /** @type {Object} */ var extension = gl.getExtension(extensions[i]);
+ this.check(extension !== null, 'Advertised extension ' + extensions[i] + ' not found');
+ }
+
+ // [dag] check that gl.getExtension() returns null for items not in gl.getSupportedExtensions()
+ this.check(gl.getExtension('Random_String') === null, 'Extension query methods are not consistent.');
+ }));
+
+ };
+
+ /**
+ * Run test
+ * @param {WebGL2RenderingContext} context
+ */
+ es3fStringQueryTests.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fStringQueryTests.StringQueryTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fStringQueryTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fSyncTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fSyncTests.js
new file mode 100644
index 0000000000..bd18845d9e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fSyncTests.js
@@ -0,0 +1,330 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fSyncTests');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.opengl.gluShaderProgram');
+
+goog.scope(function() {
+ var es3fSyncTests = functional.gles3.es3fSyncTests;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var deRandom = framework.delibs.debase.deRandom;
+ var gluShaderProgram = framework.opengl.gluShaderProgram;
+ var deString = framework.delibs.debase.deString;
+
+ /** @const {number} */ es3fSyncTests.NUM_CASE_ITERATIONS = 5;
+ /** @const {number} */ es3fSyncTests.MAX_VERIFY_WAIT = 5;
+
+ /**
+ * @enum
+ */
+ es3fSyncTests.WaitCommand = {
+ WAIT_SYNC: 1,
+ CLIENT_WAIT_SYNC: 2
+ };
+
+ /** @enum
+ */
+ es3fSyncTests.CaseOptions = {
+ FLUSH_BEFORE_WAIT: 1,
+ FINISH_BEFORE_WAIT: 2
+ };
+
+ /** @enum
+ */
+ es3fSyncTests.State = {
+ DRAW: 0,
+ VERIFY: 1,
+ FINISH: 2
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} numPrimitives
+ * @param {number} waitCommand
+ * @param {number} waitFlags
+ * @param {number} timeout
+ * @param {number} options
+ */
+ es3fSyncTests.FenceSyncCase = function(name, description, numPrimitives, waitCommand, waitFlags, timeout, options) {
+ tcuTestCase.DeqpTest.call(this, name, description);
+ /** @type {number} */ this.m_numPrimitives = numPrimitives;
+ /** @type {number} */ this.m_waitCommand = waitCommand;
+ /** @type {number} */ this.m_waitFlags = waitFlags;
+ /** @type {number} */ this.m_timeout = timeout;
+ /** @type {number} */ this.m_caseOptions = options;
+
+ /** @type {gluShaderProgram.ShaderProgram} */ this.m_program = null;
+ /** @type {WebGLSync} */ this.m_syncObject = null;
+ /** @type {number} */ this.m_iterNdx = 0;
+ /** @type {deRandom.Random} */ this.m_rnd = new deRandom.Random(deString.deStringHash(this.name));
+ /** @type {es3fSyncTests.State} */ this.m_state = es3fSyncTests.State.DRAW;
+ };
+
+ es3fSyncTests.FenceSyncCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fSyncTests.FenceSyncCase.prototype.constructor = es3fSyncTests.FenceSyncCase;
+
+ /**
+ * @param {number} numPrimitives
+ * @param {deRandom.Random} rnd
+ * @return {Array<number>}
+ */
+ es3fSyncTests.generateVertices = function(numPrimitives, rnd) {
+ /** @type {Array<number>} */ var dst = [];
+ /** @type {number} */ var numVertices = 3 * numPrimitives;
+
+ for (var i = 0; i < numVertices; i++) {
+ dst.push(rnd.getFloat(-1.0, 1.0)); // x
+ dst.push(rnd.getFloat(-1.0, 1.0)); // y
+ dst.push(rnd.getFloat(0.0, 1.0)); // z
+ dst.push(1.0); // w
+ }
+ return dst;
+ };
+
+ es3fSyncTests.FenceSyncCase.prototype.init = function() {
+ /** @type {string} */ var vertShaderSource = '#version 300 es\n' +
+ 'layout(location = 0) in mediump vec4 a_position;\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = a_position;\n' +
+ '}\n';
+
+ /** @type {string} */ var fragShaderSource = '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 o_color;\n' +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' o_color = vec4(0.25, 0.5, 0.75, 1.0);\n' +
+ '}\n';
+
+ assertMsgOptions(!this.m_program, 'Program should be null.', false, true);
+ this.m_program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertShaderSource, fragShaderSource));
+
+ if (!this.m_program.isOk())
+ throw new Error('Failed to compile shader program');
+ };
+
+ es3fSyncTests.FenceSyncCase.prototype.deinit = function() {
+ if (this.m_program)
+ this.m_program = null;
+
+ if (this.m_syncObject) {
+ gl.deleteSync(this.m_syncObject);
+ this.m_syncObject = null;
+ }
+ };
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fSyncTests.FenceSyncCase.prototype.draw = function() {
+ /** @type {Array<number>} */ var vertices = [];
+
+ /** @type {string} */ var header = 'Case iteration ' + (this.m_iterNdx + 1) + ' / ' + es3fSyncTests.NUM_CASE_ITERATIONS;
+ bufferedLogToConsole(header);
+
+ assertMsgOptions(this.m_program !== null, 'Expected program', false, true);
+ gl.useProgram(this.m_program.getProgram());
+ gl.enable(gl.DEPTH_TEST);
+ gl.clearColor(0.3, 0.3, 0.3, 1.0);
+ gl.clearDepth(1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+
+ // Generate vertices
+
+ gl.enableVertexAttribArray(0);
+ vertices = es3fSyncTests.generateVertices(this.m_numPrimitives, this.m_rnd);
+
+ /** @type {WebGLBuffer} */ var vertexGLBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexGLBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);
+ gl.vertexAttribPointer(0, 4, gl.FLOAT, false, 0, 0);
+
+ // Draw
+
+ gl.drawArrays(gl.TRIANGLES, 0, vertices.length / 4);
+ bufferedLogToConsole('Primitives drawn.');
+
+ // Create sync object
+
+ this.m_syncObject = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0);
+ bufferedLogToConsole('Sync object created');
+
+ if (this.m_caseOptions & es3fSyncTests.CaseOptions.FLUSH_BEFORE_WAIT)
+ gl.flush();
+ if (this.m_caseOptions & es3fSyncTests.CaseOptions.FINISH_BEFORE_WAIT)
+ gl.finish();
+ this.m_state = es3fSyncTests.State.VERIFY;
+ };
+
+
+ es3fSyncTests.FenceSyncCase.prototype.verify = function() {
+ /** @type {number} */ var waitValue = 0;
+ /** @type {boolean} */ var testOk = true;
+
+ // Wait for sync object
+ if (this.m_waitCommand & es3fSyncTests.WaitCommand.WAIT_SYNC) {
+ assertMsgOptions(this.m_timeout === gl.TIMEOUT_IGNORED, 'Expected TIMEOUT_IGNORED', false, true);
+ assertMsgOptions(this.m_waitFlags === 0, 'Expected waitFlags = 0', false, true);
+ gl.waitSync(this.m_syncObject, this.m_waitFlags, this.m_timeout);
+ bufferedLogToConsole('Wait command glWaitSync called with GL_TIMEOUT_IGNORED.');
+ }
+
+ if (this.m_waitCommand & es3fSyncTests.WaitCommand.CLIENT_WAIT_SYNC) {
+ waitValue = gl.clientWaitSync(this.m_syncObject, this.m_waitFlags, this.m_timeout);
+ bufferedLogToConsole('glClientWaitSync return value:');
+ switch (waitValue) {
+ case gl.ALREADY_SIGNALED:
+ bufferedLogToConsole('gl.ALREADY_SIGNALED');
+ break;
+ case gl.TIMEOUT_EXPIRED:
+ bufferedLogToConsole('gl.TIMEOUT_EXPIRED');
+ break;
+ case gl.CONDITION_SATISFIED:
+ bufferedLogToConsole('gl.CONDITION_SATISFIED');
+ break;
+ case gl.WAIT_FAILED:
+ bufferedLogToConsole('gl.WAIT_FAILED');
+ testOk = false;
+ break;
+ default:
+ bufferedLogToConsole('Illegal return value!');
+ }
+ }
+
+ gl.finish();
+
+ // Delete sync object
+
+ if (this.m_syncObject && testOk) {
+ gl.deleteSync(this.m_syncObject);
+ this.m_syncObject = null;
+ bufferedLogToConsole('Sync object deleted.');
+ }
+
+ // Evaluate test result
+
+ bufferedLogToConsole('Test result: ' + (testOk ? 'Passed!' : 'Failed!'));
+
+ if (!testOk) {
+ if (!this.m_verifyStart)
+ this.m_verifyStart = new Date();
+ else {
+ var current = new Date();
+ var elapsedTime = 0.001 * (current.getTime() - this.m_verifyStart.getTime());
+ if (elapsedTime > es3fSyncTests.MAX_VERIFY_WAIT) {
+ testFailedOptions('Fail', false);
+ this.m_state = es3fSyncTests.State.FINISH;
+ if (this.m_syncObject) {
+ gl.deleteSync(this.m_syncObject);
+ this.m_syncObject = null;
+ bufferedLogToConsole('Sync object deleted.');
+ }
+ }
+ }
+ } else {
+ bufferedLogToConsole('Sync objects created and deleted successfully.');
+ testPassedOptions('Pass', true);
+ this.m_state = (++this.m_iterNdx < es3fSyncTests.NUM_CASE_ITERATIONS) ? es3fSyncTests.State.DRAW : es3fSyncTests.State.FINISH;
+ }
+ };
+
+ es3fSyncTests.FenceSyncCase.prototype.iterate = function() {
+ switch (this.m_state) {
+ case es3fSyncTests.State.DRAW:
+ this.draw();
+ break;
+ case es3fSyncTests.State.VERIFY:
+ this.verify();
+ break;
+ case es3fSyncTests.State.FINISH:
+ return tcuTestCase.IterateResult.STOP;
+ default:
+ throw new Error('Invalid state: ' + this.m_state);
+ }
+
+ return tcuTestCase.IterateResult.CONTINUE;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fSyncTests.SyncTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'fence_sync', 'Fence Sync Tests');
+ };
+
+ es3fSyncTests.SyncTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fSyncTests.SyncTests.prototype.constructor = es3fSyncTests.SyncTests;
+
+ es3fSyncTests.SyncTests.prototype.init = function() {
+ // Fence sync tests.
+
+ this.addChild(new es3fSyncTests.FenceSyncCase('wait_sync_smalldraw', '', 10, es3fSyncTests.WaitCommand.WAIT_SYNC, 0, gl.TIMEOUT_IGNORED, 0));
+ this.addChild(new es3fSyncTests.FenceSyncCase('wait_sync_largedraw', '', 100000, es3fSyncTests.WaitCommand.WAIT_SYNC, 0, gl.TIMEOUT_IGNORED, 0));
+
+ this.addChild(new es3fSyncTests.FenceSyncCase('client_wait_sync_smalldraw', '', 10, es3fSyncTests.WaitCommand.CLIENT_WAIT_SYNC, 0, 0, 0));
+ this.addChild(new es3fSyncTests.FenceSyncCase('client_wait_sync_largedraw', '', 100000, es3fSyncTests.WaitCommand.CLIENT_WAIT_SYNC, 0, 0, 0));
+
+ // Originally the next two test cases' timeout is 10, but in WebGL2 that could be illegal.
+ var max = gl.getParameter(gl.MAX_CLIENT_WAIT_TIMEOUT_WEBGL) || 0;
+ this.addChild(new es3fSyncTests.FenceSyncCase('client_wait_sync_timeout_smalldraw', '', 10, es3fSyncTests.WaitCommand.CLIENT_WAIT_SYNC, 0, max, 0));
+ this.addChild(new es3fSyncTests.FenceSyncCase('client_wait_sync_timeout_largedraw', '', 100000, es3fSyncTests.WaitCommand.CLIENT_WAIT_SYNC, 0, max, 0));
+
+ this.addChild(new es3fSyncTests.FenceSyncCase('client_wait_sync_flush_auto', '', 100000, es3fSyncTests.WaitCommand.CLIENT_WAIT_SYNC, gl.SYNC_FLUSH_COMMANDS_BIT, 0, 0));
+ this.addChild(new es3fSyncTests.FenceSyncCase('client_wait_sync_flush_manual', '', 100000, es3fSyncTests.WaitCommand.CLIENT_WAIT_SYNC, 0, 0, es3fSyncTests.CaseOptions.FLUSH_BEFORE_WAIT));
+ this.addChild(new es3fSyncTests.FenceSyncCase('client_wait_sync_noflush', '', 100000, es3fSyncTests.WaitCommand.CLIENT_WAIT_SYNC, 0, 0, 0));
+ this.addChild(new es3fSyncTests.FenceSyncCase('client_wait_sync_finish', '', 100000, es3fSyncTests.WaitCommand.CLIENT_WAIT_SYNC, 0, 0, es3fSyncTests.CaseOptions.FINISH_BEFORE_WAIT));
+
+ };
+
+ /**
+ * Run test
+ * @param {WebGL2RenderingContext} context
+ */
+ es3fSyncTests.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fSyncTests.SyncTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fSyncTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureFilteringTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureFilteringTests.js
new file mode 100644
index 0000000000..45ff09a11c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureFilteringTests.js
@@ -0,0 +1,2282 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fTextureFilteringTests');
+goog.require('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuLogImage');
+goog.require('framework.common.tcuPixelFormat');
+goog.require('framework.common.tcuRGBA');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.common.tcuTexLookupVerifier');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluTexture');
+goog.require('framework.opengl.gluTextureUtil');
+goog.require('functional.gles3.es3fFboTestUtil');
+goog.require('modules.shared.glsTextureTestUtil');
+
+goog.scope(function() {
+
+ var es3fTextureFilteringTests = functional.gles3.es3fTextureFilteringTests;
+ var es3fFboTestUtil = functional.gles3.es3fFboTestUtil;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var gluTextureUtil = framework.opengl.gluTextureUtil;
+ var tcuImageCompare = framework.common.tcuImageCompare;
+ var tcuLogImage = framework.common.tcuLogImage;
+ var tcuPixelFormat = framework.common.tcuPixelFormat;
+ var tcuRGBA = framework.common.tcuRGBA;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var tcuTexLookupVerifier = framework.common.tcuTexLookupVerifier;
+ var tcuSurface = framework.common.tcuSurface;
+ var tcuTexture = framework.common.tcuTexture;
+ var tcuTextureUtil = framework.common.tcuTextureUtil;
+ var deMath = framework.delibs.debase.deMath;
+ var deString = framework.delibs.debase.deString;
+ var deRandom = framework.delibs.debase.deRandom;
+ var gluTexture = framework.opengl.gluTexture;
+ var glsTextureTestUtil = modules.shared.glsTextureTestUtil;
+
+ /** @type {WebGL2RenderingContext} */ var gl;
+
+ es3fTextureFilteringTests.version =
+ gluShaderUtil.getGLSLVersionString(gluShaderUtil.GLSLVersion.V300_ES);
+
+ let canvasWH = 256;
+ let viewportWH = 64;
+
+ if (tcuTestCase.isQuickMode()) {
+ canvasWH = 64;
+ viewportWH = 32;
+ }
+
+ const TEX2D_VIEWPORT_WIDTH = viewportWH;
+ const TEX2D_VIEWPORT_HEIGHT = viewportWH;
+ const TEX2D_MIN_VIEWPORT_WIDTH = viewportWH;
+ const TEX2D_MIN_VIEWPORT_HEIGHT = viewportWH;
+
+ const TEX3D_VIEWPORT_WIDTH = viewportWH;
+ const TEX3D_VIEWPORT_HEIGHT = viewportWH;
+ const TEX3D_MIN_VIEWPORT_WIDTH = viewportWH;
+ const TEX3D_MIN_VIEWPORT_HEIGHT = viewportWH;
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fTextureFilteringTests.TextureFilteringTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'filtering', 'Texture Filtering Tests');
+ };
+
+ es3fTextureFilteringTests.TextureFilteringTests.prototype =
+ Object.create(tcuTestCase.DeqpTest.prototype);
+
+ es3fTextureFilteringTests.TextureFilteringTests.prototype.constructor =
+ es3fTextureFilteringTests.TextureFilteringTests;
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} minFilter
+ * @param {number} magFilter
+ * @param {number} wrapS
+ * @param {number} wrapT
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ */
+ es3fTextureFilteringTests.Texture2DFilteringCase = function(
+ name, desc, minFilter, magFilter, wrapS, wrapT,
+ internalFormat, width, height
+ ) {
+ tcuTestCase.DeqpTest.call(this, name, desc);
+ this.m_minFilter = minFilter;
+ this.m_magFilter = magFilter;
+ this.m_wrapS = wrapS;
+ this.m_wrapT = wrapT;
+ this.m_internalFormat = internalFormat;
+ this.m_width = width;
+ this.m_height = height;
+ /** @type {glsTextureTestUtil.TextureRenderer} */
+ this.m_renderer = new glsTextureTestUtil.TextureRenderer(
+ es3fTextureFilteringTests.version,
+ gluShaderUtil.precision.PRECISION_HIGHP
+ );
+ this.m_caseNdx = 0;
+ /** @type {Array<gluTexture.Texture2D>} */ this.m_textures = [];
+ this.m_cases = [];
+ };
+
+ es3fTextureFilteringTests.Texture2DFilteringCase.prototype =
+ Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fTextureFilteringTests.Texture2DFilteringCase.prototype.constructor =
+ es3fTextureFilteringTests.Texture2DFilteringCase;
+
+ /**
+ * @constructor
+ * @param {gluTexture.Texture2D} tex_
+ * @param {Array<number>} minCoord_
+ * @param {Array<number>} maxCoord_
+ */
+ es3fTextureFilteringTests.Texture2DFilteringCase.FilterCase = function(
+ tex_, minCoord_, maxCoord_
+ ) {
+ this.texture = tex_;
+ this.minCoord = minCoord_;
+ this.maxCoord = maxCoord_;
+ };
+
+ /** @typedef {{texNdx: number, lodX: number,
+ * lodY: number, oX: number, oY: number}} */
+ es3fTextureFilteringTests.Cases;
+
+ /**
+ * init
+ */
+ es3fTextureFilteringTests.Texture2DFilteringCase.prototype.init =
+ function() {
+ try {
+ // Create 2 textures.
+ for (var ndx = 0; ndx < 2; ndx++)
+ this.m_textures.push(
+ gluTexture.texture2DFromInternalFormat(
+ gl, this.m_internalFormat,
+ this.m_width, this.m_height
+ )
+ );
+
+ var mipmaps = true;
+ var numLevels = mipmaps ? deMath.logToFloor(
+ Math.max(this.m_width, this.m_height)
+ ) + 1 : 1;
+
+ /** @type {tcuTextureUtil.TextureFormatInfo} */
+ var fmtInfo = tcuTextureUtil.getTextureFormatInfo(
+ this.m_textures[0].getRefTexture().getFormat()
+ );
+ /** @type {Array<number>} */ var cBias = fmtInfo.valueMin;
+ /** @type {Array<number>} */
+ var cScale = deMath.subtract(
+ fmtInfo.valueMax, fmtInfo.valueMin
+ );
+
+ // Fill first gradient texture.
+ for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) {
+ /** @type {Array<number>} */ var gMin = deMath.add(
+ deMath.multiply([0.0, 0.0, 0.0, 1.0], cScale), cBias
+ );
+ /** @type {Array<number>} */ var gMax = deMath.add(
+ deMath.multiply([1.0, 1.0, 1.0, 0.0], cScale), cBias
+ );
+
+ this.m_textures[0].getRefTexture().allocLevel(levelNdx);
+ tcuTextureUtil.fillWithComponentGradients(
+ this.m_textures[0].getRefTexture().getLevel(levelNdx),
+ gMin, gMax
+ );
+ }
+
+ // Fill second with grid texture.
+ for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) {
+ /** @type {number} */ var step = 0x00ffffff / numLevels;
+ /** @type {number} */ var rgb = step * levelNdx;
+ /** @type {number} */ var colorA = deMath.binaryOp(
+ 0xff000000, rgb, deMath.BinaryOp.OR
+ );
+ /** @type {number} */ var colorB = deMath.binaryOp(
+ 0xff000000, deMath.binaryNot(rgb), deMath.BinaryOp.OR
+ );
+
+ this.m_textures[1].getRefTexture().allocLevel(levelNdx);
+ tcuTextureUtil.fillWithGrid(
+ this.m_textures[1].getRefTexture().getLevel(levelNdx),
+ 4,
+ deMath.add(deMath.multiply(
+ tcuRGBA.newRGBAFromValue(colorA).toVec(), cScale),
+ cBias
+ ),
+ deMath.add(deMath.multiply(
+ tcuRGBA.newRGBAFromValue(colorB).toVec(), cScale),
+ cBias
+ )
+ );
+ }
+
+ // Upload.
+ for (var i = 0; i < this.m_textures.length; i++)
+ this.m_textures[i].upload();
+
+ // Compute cases.
+
+ /** @type {Array<es3fTextureFilteringTests.Cases>} */
+ var cases = [{
+ texNdx: 0, lodX: 1.6, lodY: 2.9, oX: -1.0, oY: -2.7
+ }, {
+ texNdx: 0, lodX: -2.0, lodY: -1.35, oX: -0.2, oY: 0.7
+ }, {
+ texNdx: 1, lodX: 0.14, lodY: 0.275, oX: -1.5, oY: -1.1
+ }, {
+ texNdx: 1, lodX: -0.92, lodY: -2.64, oX: 0.4, oY: -0.1
+ }
+ ];
+
+ var viewportW = Math.min(
+ TEX2D_VIEWPORT_WIDTH, gl.canvas.width
+ );
+ var viewportH = Math.min(
+ TEX2D_VIEWPORT_HEIGHT, gl.canvas.height
+ );
+
+ for (var caseNdx = 0; caseNdx < cases.length; caseNdx++) {
+ /** @type {number} */ var texNdx = deMath.clamp(
+ cases[caseNdx].texNdx, 0, this.m_textures.length - 1
+ );
+ /** @type {number} */ var lodX = cases[caseNdx].lodX;
+ /** @type {number} */ var lodY = cases[caseNdx].lodY;
+ /** @type {number} */ var oX = cases[caseNdx].oX;
+ /** @type {number} */ var oY = cases[caseNdx].oY;
+ /** @type {number} */ var sX = Math.exp(lodX * Math.log(2)) * viewportW /
+ this.m_textures[texNdx].getRefTexture().getWidth();
+ /** @type {number} */ var sY = Math.exp(lodY * Math.log(2)) * viewportH /
+ this.m_textures[texNdx].getRefTexture().getHeight();
+
+ this.m_cases.push(
+ new
+ es3fTextureFilteringTests.Texture2DFilteringCase.FilterCase(
+ this.m_textures[texNdx], [oX, oY], [oX + sX, oY + sY]
+ )
+ );
+ }
+
+ this.m_caseNdx = 0;
+ }
+ catch (e) {
+ // Clean up to save memory.
+ this.deinit();
+ throw e;
+ }
+ };
+
+ /**
+ * deinit
+ */
+ es3fTextureFilteringTests.Texture2DFilteringCase.prototype.deinit =
+ function() {
+ while (this.m_textures.length > 0) {
+ gl.deleteTexture(this.m_textures[0].getGLTexture());
+ this.m_textures.splice(0, 1);
+ }
+ };
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fTextureFilteringTests.Texture2DFilteringCase.prototype.iterate =
+ function() {
+ /** @type {glsTextureTestUtil.RandomViewport} */
+ var viewport = new glsTextureTestUtil.RandomViewport(
+ gl.canvas, TEX2D_VIEWPORT_WIDTH,
+ TEX2D_VIEWPORT_HEIGHT, deMath.binaryOp(
+ deString.deStringHash(this.fullName()),
+ deMath.deMathHash(this.m_caseNdx),
+ deMath.BinaryOp.XOR
+ )
+ );
+ /** @type {tcuTexture.TextureFormat} */
+ var texFmt = this.m_textures[0].getRefTexture().getFormat();
+
+ /** @type {tcuTextureUtil.TextureFormatInfo} */
+ var fmtInfo = tcuTextureUtil.getTextureFormatInfo(texFmt);
+ var curCase = this.m_cases[this.m_caseNdx];
+ bufferedLogToConsole('Test ' + this.m_caseNdx);
+ var refParams = new glsTextureTestUtil.ReferenceParams(
+ glsTextureTestUtil.textureType.TEXTURETYPE_2D
+ );
+ var rendered = new tcuSurface.Surface(viewport.width, viewport.height);
+ var texCoord = [0, 0];
+
+ if (viewport.width < TEX2D_MIN_VIEWPORT_WIDTH ||
+ viewport.height < TEX2D_MIN_VIEWPORT_HEIGHT)
+ throw new Error('Too small render target');
+
+ // Setup params for reference.
+ refParams.sampler = gluTextureUtil.mapGLSamplerWrapST(
+ this.m_wrapS, this.m_wrapT, this.m_minFilter, this.m_magFilter
+ );
+ refParams.samplerType = glsTextureTestUtil.getSamplerType(texFmt);
+ refParams.lodMode = glsTextureTestUtil.lodMode.EXACT;
+ refParams.colorBias = fmtInfo.lookupBias;
+ refParams.colorScale = fmtInfo.lookupScale;
+
+ // Compute texture coordinates.
+ bufferedLogToConsole(
+ 'Texture coordinates: ' + curCase.minCoord +
+ ' -> ' + curCase.maxCoord
+ );
+ texCoord = glsTextureTestUtil.computeQuadTexCoord2D(
+ curCase.minCoord, curCase.maxCoord
+ );
+
+ gl.bindTexture(gl.TEXTURE_2D, curCase.texture.getGLTexture());
+ gl.texParameteri(
+ gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, this.m_minFilter
+ );
+ gl.texParameteri(
+ gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, this.m_magFilter
+ );
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, this.m_wrapS);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, this.m_wrapT);
+
+ gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height);
+
+ this.m_renderer.renderQuad(0, texCoord, refParams);
+ rendered.readViewport(
+ gl, [viewport.x, viewport.y, viewport.width, viewport.height]
+ );
+
+ /** @type {boolean} */ var isNearestOnly =
+ this.m_minFilter == gl.NEAREST && this.m_magFilter == gl.NEAREST;
+ /** @type {tcuPixelFormat.PixelFormat} */
+ var pixelFormat = tcuPixelFormat.PixelFormatFromContext(gl);
+
+ //(iVec4)
+ var colorBits = deMath.max(
+ deMath.addScalar(
+ glsTextureTestUtil.getBitsVec(pixelFormat),
+ // 1 inaccurate bit if nearest only, 2 otherwise
+ -1 * (isNearestOnly ? 1 : 2)
+ ),
+ [0, 0, 0, 0]
+ );
+
+ /** @type {tcuTexLookupVerifier.LodPrecision} */
+ var lodPrecision = new tcuTexLookupVerifier.LodPrecision();
+ /** @type {tcuTexLookupVerifier.LookupPrecision} */
+ var lookupPrecision = new tcuTexLookupVerifier.LookupPrecision();
+
+ lodPrecision.derivateBits = 18;
+ lodPrecision.lodBits = 6;
+ lookupPrecision.colorThreshold = deMath.divide(
+ tcuTexLookupVerifier.computeFixedPointThreshold(colorBits),
+ refParams.colorScale
+ );
+ lookupPrecision.coordBits = [20, 20, 0];
+ lookupPrecision.uvwBits = [7, 7, 0];
+ lookupPrecision.colorMask =
+ glsTextureTestUtil.getCompareMask(pixelFormat);
+
+ var isHighQuality = glsTextureTestUtil.verifyTexture2DResult(
+ rendered.getAccess(), curCase.texture.getRefTexture(),
+ texCoord, refParams, lookupPrecision, lodPrecision, pixelFormat
+ );
+
+ if (!isHighQuality) {
+ // Evaluate against lower precision requirements.
+ lodPrecision.lodBits = 4;
+ lookupPrecision.uvwBits = [4, 4, 0];
+
+ bufferedLogToConsole('Warning: Verification against high ' +
+ 'precision requirements failed, trying with lower ' +
+ 'requirements.'
+ );
+
+ var isOk = glsTextureTestUtil.verifyTexture2DResult(
+ rendered.getAccess(), curCase.texture.getRefTexture(),
+ texCoord, refParams, lookupPrecision, lodPrecision,
+ pixelFormat
+ );
+
+ if (!isOk) {
+ bufferedLogToConsole(
+ 'ERROR: Verification against low ' +
+ 'precision requirements failed, failing test case.'
+ );
+ testFailedOptions('Image verification failed', false);
+ //In JS version, one mistake and you're out
+ return tcuTestCase.IterateResult.STOP;
+ } else
+ checkMessage(
+ false,
+ 'Low-quality filtering result in iteration no. ' +
+ this.m_caseNdx
+ );
+ }
+
+ this.m_caseNdx += 1;
+ if (this.m_caseNdx < this.m_cases.length)
+ return tcuTestCase.IterateResult.CONTINUE;
+
+ testPassed('Verified');
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} minFilter
+ * @param {number} magFilter
+ * @param {number} wrapS
+ * @param {number} wrapT
+ * @param {boolean} onlySampleFaceInterior
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ */
+ es3fTextureFilteringTests.TextureCubeFilteringCase = function(
+ name, desc, minFilter, magFilter, wrapS, wrapT, onlySampleFaceInterior,
+ internalFormat, width, height
+ ) {
+ tcuTestCase.DeqpTest.call(this, name, desc);
+ this.m_minFilter = minFilter;
+ this.m_magFilter = magFilter;
+ this.m_wrapS = wrapS;
+ this.m_wrapT = wrapT;
+ /** @type {boolean}*/
+ this.m_onlySampleFaceInterior = onlySampleFaceInterior;
+ this.m_internalFormat = internalFormat;
+ this.m_width = width;
+ this.m_height = height;
+ /** @type {glsTextureTestUtil.TextureRenderer} */
+ this.m_renderer = new glsTextureTestUtil.TextureRenderer(
+ es3fTextureFilteringTests.version,
+ gluShaderUtil.precision.PRECISION_HIGHP
+ );
+ this.m_caseNdx = 0;
+ /** @type {Array<gluTexture.TextureCube>} */ this.m_textures = [];
+ /** @type {Array<es3fTextureFilteringTests.
+ * TextureCubeFilteringCase.FilterCase>}
+ */
+ this.m_cases = [];
+ };
+
+ /**
+ * @constructor
+ * @param {gluTexture.TextureCube} tex_
+ * @param {Array<number>} bottomLeft_
+ * @param {Array<number>} topRight_
+ */
+ es3fTextureFilteringTests.TextureCubeFilteringCase.FilterCase = function(
+ tex_, bottomLeft_, topRight_
+ ) {
+ this.texture = tex_;
+ this.bottomLeft = bottomLeft_;
+ this.topRight = topRight_;
+ };
+
+ es3fTextureFilteringTests.TextureCubeFilteringCase.prototype =
+ Object.create(tcuTestCase.DeqpTest.prototype);
+
+ es3fTextureFilteringTests.TextureCubeFilteringCase.prototype.constructor =
+ es3fTextureFilteringTests.TextureCubeFilteringCase;
+
+ /**
+ * init
+ */
+ es3fTextureFilteringTests.TextureCubeFilteringCase.prototype.init =
+ function() {
+ try {
+ assertMsgOptions(
+ this.m_width == this.m_height, 'Texture has to be squared',
+ false, true
+ );
+ for (var ndx = 0; ndx < 2; ndx++)
+ this.m_textures.push(gluTexture.cubeFromInternalFormat(
+ gl, this.m_internalFormat, this.m_width
+ ));
+
+ var numLevels = deMath.logToFloor(
+ Math.max(this.m_width, this.m_height)
+ ) + 1;
+ /** @type {tcuTextureUtil.TextureFormatInfo} */
+ var fmtInfo = tcuTextureUtil.getTextureFormatInfo(
+ this.m_textures[0].getRefTexture().getFormat()
+ );
+ /** @type {Array<number>} */
+ var cBias = fmtInfo.valueMin;
+ /** @type {Array<number>} */
+ var cScale = deMath.subtract(
+ fmtInfo.valueMax, fmtInfo.valueMin
+ );
+
+ // Fill first with gradient texture.
+ /** @type {Array<Array<Array<number>>>}
+ * (array of 4 component vectors)
+ */
+ var gradients = [
+ [ // negative x
+ [0.0, 0.0, 0.0, 1.0], [1.0, 1.0, 1.0, 0.0]
+ ], [ // positive x
+ [0.5, 0.0, 0.0, 1.0], [1.0, 1.0, 1.0, 0.0]
+ ], [ // negative y
+ [0.0, 0.5, 0.0, 1.0], [1.0, 1.0, 1.0, 0.0]
+ ], [ // positive y
+ [0.0, 0.0, 0.5, 1.0], [1.0, 1.0, 1.0, 0.0]
+ ], [ // negative z
+ [0.0, 0.0, 0.0, 0.5], [1.0, 1.0, 1.0, 1.0]
+ ], [ // positive z
+ [0.5, 0.5, 0.5, 1.0], [1.0, 1.0, 1.0, 0.0]
+ ]
+ ];
+ for (var face = 0;
+ face < Object.keys(tcuTexture.CubeFace).length;
+ face++) {
+ for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) {
+ this.m_textures[0].getRefTexture().allocLevel(
+ face, levelNdx
+ );
+ tcuTextureUtil.fillWithComponentGradients(
+ this.m_textures[0].getRefTexture().getLevelFace(
+ levelNdx, face
+ ),
+ deMath.add(deMath.multiply(
+ gradients[face][0], cScale
+ ), cBias),
+ deMath.add(deMath.multiply(
+ gradients[face][1], cScale
+ ), cBias)
+ );
+ }
+ }
+
+ // Fill second with grid texture.
+ for (var face = 0;
+ face < Object.keys(tcuTexture.CubeFace).length;
+ face++) {
+ for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) {
+ var step = 0x00ffffff / (
+ numLevels * Object.keys(tcuTexture.CubeFace).length
+ );
+ var rgb = step * levelNdx * face;
+ /** @type {number} */ var colorA = deMath.binaryOp(
+ 0xff000000, rgb, deMath.BinaryOp.OR
+ );
+ /** @type {number} */ var colorB = deMath.binaryOp(
+ 0xff000000, deMath.binaryNot(rgb),
+ deMath.BinaryOp.OR
+ );
+
+ this.m_textures[1].getRefTexture().allocLevel(
+ face, levelNdx
+ );
+ tcuTextureUtil.fillWithGrid(
+ this.m_textures[1].getRefTexture().getLevelFace(
+ levelNdx, face
+ ), 4, deMath.add(
+ deMath.multiply(
+ tcuRGBA.newRGBAFromValue(colorA).toVec(),
+ cScale
+ ), cBias
+ ), deMath.add(
+ deMath.multiply(
+ tcuRGBA.newRGBAFromValue(colorB).toVec(),
+ cScale
+ ), cBias
+ )
+ );
+ }
+ }
+
+ // Upload.
+ for (var i = 0; i < this.m_textures.length; i++)
+ this.m_textures[i].upload();
+
+ // Compute cases
+ /** @type {gluTexture.TextureCube} */
+ var tex0 = this.m_textures[0];
+ /** @type {gluTexture.TextureCube} */
+ var tex1 = this.m_textures.length > 1 ? this.m_textures[1] : tex0;
+
+ if (this.m_onlySampleFaceInterior) {
+ // minification
+ this.m_cases.push(new es3fTextureFilteringTests.
+ TextureCubeFilteringCase.FilterCase(
+ tex0, [-0.8, -0.8], [0.8, 0.8]
+ ));
+ // magnification
+ this.m_cases.push(new es3fTextureFilteringTests.
+ TextureCubeFilteringCase.FilterCase(
+ tex0, [0.5, 0.65], [0.8, 0.8]
+ ));
+ // minification
+ this.m_cases.push(new es3fTextureFilteringTests.
+ TextureCubeFilteringCase.FilterCase(
+ tex1, [-0.8, -0.8], [0.8, 0.8]
+ ));
+ // magnification
+ this.m_cases.push(new es3fTextureFilteringTests.
+ TextureCubeFilteringCase.FilterCase(
+ tex1, [0.2, 0.2], [0.6, 0.5]
+ ));
+ } else {
+ // minification
+ if (gl.getParameter(gl.SAMPLES) == 0)
+ this.m_cases.push(
+ new es3fTextureFilteringTests.TextureCubeFilteringCase.
+ FilterCase(
+ tex0, [-1.25, -1.2], [1.2, 1.25]
+ )
+ );
+ // minification - w/ tweak to avoid hitting triangle
+ // edges with face switchpoint.
+ else
+ this.m_cases.push(
+ new es3fTextureFilteringTests.TextureCubeFilteringCase.
+ FilterCase(
+ tex0, [-1.19, -1.3], [1.1, 1.35]
+ )
+ );
+
+ // magnification
+ this.m_cases.push(
+ new es3fTextureFilteringTests.TextureCubeFilteringCase.
+ FilterCase(
+ tex0, [0.8, 0.8], [1.25, 1.20]
+ )
+ );
+ // minification
+ this.m_cases.push(
+ new es3fTextureFilteringTests.TextureCubeFilteringCase.
+ FilterCase(
+ tex1, [-1.19, -1.3], [1.1, 1.35]
+ )
+ );
+ // magnification
+ this.m_cases.push(
+ new es3fTextureFilteringTests.TextureCubeFilteringCase.
+ FilterCase(
+ tex1, [-1.2, -1.1], [-0.8, -0.8]
+ )
+ );
+ }
+
+ this.m_caseNdx = 0;
+ }
+ catch (e) {
+ // Clean up to save memory.
+ this.deinit();
+ throw e;
+ }
+ };
+
+ /**
+ * deinit
+ */
+ es3fTextureFilteringTests.TextureCubeFilteringCase.prototype.deinit =
+ function() {
+ while (this.m_textures.length > 0) {
+ gl.deleteTexture(this.m_textures[0].getGLTexture());
+ this.m_textures.splice(0, 1);
+ }
+ };
+
+ /**
+ * @param {tcuTexture.CubeFace} face
+ * @return {string}
+ */
+ es3fTextureFilteringTests.getFaceDesc = function(face) {
+ switch (face) {
+ case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X: return '-X';
+ case tcuTexture.CubeFace.CUBEFACE_POSITIVE_X: return '+X';
+ case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y: return '-Y';
+ case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y: return '+Y';
+ case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z: return '-Z';
+ case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z: return '+Z';
+ default:
+ throw new Error('Invalid cube face specified');
+ }
+ };
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fTextureFilteringTests.TextureCubeFilteringCase.prototype.iterate =
+ function() {
+ var viewportSize = 28;
+ /** @type {glsTextureTestUtil.RandomViewport} */
+ var viewport = new glsTextureTestUtil.RandomViewport(
+ gl.canvas, viewportSize,
+ viewportSize, deMath.binaryOp(
+ deString.deStringHash(this.fullName()),
+ deMath.deMathHash(this.m_caseNdx),
+ deMath.BinaryOp.XOR
+ )
+ );
+ bufferedLogToConsole('Test' + this.m_caseNdx);
+ /** @type {es3fTextureFilteringTests.
+ * TextureCubeFilteringCase.FilterCase}
+ */
+ var curCase = this.m_cases[this.m_caseNdx];
+ /** @type {tcuTexture.TextureFormat} */
+ var texFmt = curCase.texture.getRefTexture().getFormat();
+ /** @type {tcuTextureUtil.TextureFormatInfo} */
+ var fmtInfo = tcuTextureUtil.getTextureFormatInfo(texFmt);
+ /** @type {glsTextureTestUtil.ReferenceParams} */
+ var sampleParams = new glsTextureTestUtil.ReferenceParams(
+ glsTextureTestUtil.textureType.TEXTURETYPE_CUBE
+ );
+
+ if (viewport.width < viewportSize || viewport.height < viewportSize)
+ throw new Error('Too small render target');
+
+ // Setup texture
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, curCase.texture.getGLTexture());
+ gl.texParameteri(
+ gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, this.m_minFilter
+ );
+ gl.texParameteri(
+ gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, this.m_magFilter
+ );
+ gl.texParameteri(
+ gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, this.m_wrapS
+ );
+ gl.texParameteri(
+ gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, this.m_wrapT
+ );
+
+ // Other state
+ gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height);
+
+ // Params for reference computation.
+ sampleParams.sampler = gluTextureUtil.mapGLSamplerWrapST(
+ gl.CLAMP_TO_EDGE, gl.CLAMP_TO_EDGE,
+ this.m_minFilter, this.m_magFilter
+ );
+ sampleParams.sampler.seamlessCubeMap = true;
+ sampleParams.samplerType = glsTextureTestUtil.getSamplerType(texFmt);
+ sampleParams.colorBias = fmtInfo.lookupBias;
+ sampleParams.colorScale = fmtInfo.lookupScale;
+ sampleParams.lodMode = glsTextureTestUtil.lodMode.EXACT;
+
+ bufferedLogToConsole(
+ 'Coordinates: ' + curCase.bottomLeft + ' -> ' + curCase.topRight
+ );
+
+ for (var faceNdx = 0;
+ faceNdx < Object.keys(tcuTexture.CubeFace).length;
+ faceNdx++) {
+ var face = /** @type {tcuTexture.CubeFace} */ (faceNdx);
+ /** @type {tcuSurface.Surface} */
+ var result = new tcuSurface.Surface(
+ viewport.width, viewport.height
+ );
+ /** @type {Array<number>} */ var texCoord;
+
+ texCoord = glsTextureTestUtil.computeQuadTexCoordCubeFace(
+ face, curCase.bottomLeft, curCase.topRight
+ );
+
+ bufferedLogToConsole(
+ 'Face ' + es3fTextureFilteringTests.getFaceDesc(face)
+ );
+
+ // \todo Log texture coordinates.
+
+ this.m_renderer.renderQuad(0, texCoord, sampleParams);
+
+ result.readViewport(
+ gl, [viewport.x, viewport.y, viewport.width, viewport.height]
+ );
+
+ /** @type {boolean} */
+ var isNearestOnly = this.m_minFilter == gl.NEAREST &&
+ this.m_magFilter == gl.NEAREST;
+ /** @type {tcuPixelFormat.PixelFormat} */
+ var pixelFormat = tcuPixelFormat.PixelFormatFromContext(gl);
+
+ //(iVec4)
+ var colorBits = deMath.max(
+ deMath.addScalar(
+ glsTextureTestUtil.getBitsVec(pixelFormat),
+ // 1 inaccurate bit if nearest only, 2 otherwise
+ -1 * (isNearestOnly ? 1 : 2)
+ ),
+ [0, 0, 0, 0]
+ );
+ /** @type {tcuTexLookupVerifier.LodPrecision} */
+ var lodPrecision = new tcuTexLookupVerifier.LodPrecision();
+ /** @type {tcuTexLookupVerifier.LookupPrecision} */
+ var lookupPrecision = new tcuTexLookupVerifier.LookupPrecision();
+
+ lodPrecision.derivateBits = 10;
+ lodPrecision.lodBits = 5;
+ lookupPrecision.colorThreshold = deMath.divide(
+ tcuTexLookupVerifier.computeFixedPointThreshold(colorBits),
+ sampleParams.colorScale
+ );
+ lookupPrecision.coordBits = [10, 10, 10];
+ lookupPrecision.uvwBits = [6, 6, 0];
+ lookupPrecision.colorMask =
+ glsTextureTestUtil.getCompareMask(pixelFormat);
+
+ var isHighQuality = glsTextureTestUtil.verifyTextureCubeResult(
+ result.getAccess(), curCase.texture.getRefTexture(),
+ texCoord, sampleParams, lookupPrecision, lodPrecision,
+ pixelFormat
+ );
+
+
+ if (!isHighQuality) {
+ // Evaluate against lower precision requirements.
+ lodPrecision.lodBits = 2;
+ lookupPrecision.uvwBits = [3, 3, 0];
+
+ bufferedLogToConsole('Warning: Verification against high ' +
+ 'precision requirements failed, trying with lower ' +
+ 'requirements.');
+
+ var isOk = glsTextureTestUtil.verifyTextureCubeResult(
+ result.getAccess(), curCase.texture.getRefTexture(),
+ texCoord, sampleParams, lookupPrecision, lodPrecision,
+ pixelFormat
+ );
+
+ if (!isOk) {
+ bufferedLogToConsole('ERROR: Verification against low' +
+ 'precision requirements failed, failing test case.');
+ testFailedOptions('Image verification failed', false);
+ //In JS version, one mistake and you're out
+ return tcuTestCase.IterateResult.STOP;
+ } else
+ checkMessage(
+ false,
+ 'Low-quality filtering result in iteration no. ' +
+ this.m_caseNdx
+ );
+ }
+ }
+
+ this.m_caseNdx += 1;
+ if (this.m_caseNdx < this.m_cases.length)
+ return tcuTestCase.IterateResult.CONTINUE;
+
+ testPassed('Verified');
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ // 2D array filtering
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} minFilter
+ * @param {number} magFilter
+ * @param {number} wrapS
+ * @param {number} wrapT
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ * @param {number} numLayers
+ */
+ es3fTextureFilteringTests.Texture2DArrayFilteringCase = function(
+ name, desc, minFilter, magFilter, wrapS, wrapT,
+ internalFormat, width, height, numLayers
+ ) {
+ tcuTestCase.DeqpTest.call(this, name, desc);
+ this.m_minFilter = minFilter;
+ this.m_magFilter = magFilter;
+ this.m_wrapS = wrapS;
+ this.m_wrapT = wrapT;
+ this.m_internalFormat = internalFormat;
+ this.m_width = width;
+ this.m_height = height;
+ this.m_numLayers = numLayers;
+ this.m_gradientTex = null;
+ this.m_gridTex = null;
+ /** @type {glsTextureTestUtil.TextureRenderer} */
+ this.m_renderer = new glsTextureTestUtil.TextureRenderer(
+ es3fTextureFilteringTests.version,
+ gluShaderUtil.precision.PRECISION_HIGHP
+ );
+ this.m_textures = [];
+ this.m_caseNdx = 0;
+ this.m_cases = [];
+ };
+
+ es3fTextureFilteringTests.Texture2DArrayFilteringCase.prototype =
+ Object.create(tcuTestCase.DeqpTest.prototype);
+
+ es3fTextureFilteringTests.Texture2DArrayFilteringCase.prototype.
+ constructor = es3fTextureFilteringTests.Texture2DArrayFilteringCase;
+
+ /**
+ * @constructor
+ * @param {gluTexture.Texture2DArray} tex_
+ * @param {Array<number>} lod_
+ * @param {Array<number>} offset_
+ * @param {Array<number>} layerRange_
+ */
+ es3fTextureFilteringTests.Texture2DArrayFilteringCase.FilterCase =
+ function(
+ tex_, lod_, offset_, layerRange_
+ ) {
+ this.texture = tex_;
+ this.lod = lod_;
+ this.offset = offset_;
+ this.layerRange = layerRange_;
+ };
+
+ /*
+ * init
+ */
+ es3fTextureFilteringTests.Texture2DArrayFilteringCase.prototype.init =
+ function() {
+ try {
+ /** @type {tcuTexture.TextureFormat} */
+ var texFmt = gluTextureUtil.mapGLInternalFormat(
+ this.m_internalFormat
+ );
+ /** @type {tcuTextureUtil.TextureFormatInfo} */
+ var fmtInfo = tcuTextureUtil.getTextureFormatInfo(texFmt);
+ var cScale = deMath.subtract(
+ fmtInfo.valueMax, fmtInfo.valueMin
+ );
+ var cBias = fmtInfo.valueMin;
+ var numLevels = deMath.logToFloor(
+ Math.max(this.m_width, this.m_height)
+ ) + 1;
+
+ // Create textures.
+ this.m_gradientTex = gluTexture.texture2DArrayFromInternalFormat(
+ gl,
+ this.m_internalFormat, this.m_width,
+ this.m_height, this.m_numLayers
+ );
+
+ this.m_gridTex = gluTexture.texture2DArrayFromInternalFormat(
+ gl,
+ this.m_internalFormat, this.m_width,
+ this.m_height, this.m_numLayers
+ );
+
+ var levelSwz = [
+ [0, 1, 2, 3],
+ [2, 1, 3, 0],
+ [3, 0, 1, 2],
+ [1, 3, 2, 0]
+ ];
+
+ // Fill first gradient texture
+ // (gradient direction varies between layers).
+ for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) {
+ this.m_gradientTex.getRefTexture().allocLevel(levelNdx);
+
+ var levelBuf =
+ this.m_gradientTex.getRefTexture().getLevel(levelNdx);
+
+ for (var layerNdx = 0;
+ layerNdx < this.m_numLayers;
+ layerNdx++) {
+ var swz = levelSwz[layerNdx % levelSwz.length];
+ var gMin = deMath.add(deMath.multiply(deMath.swizzle(
+ [0.0, 0.0, 0.0, 1.0], [swz[0], swz[1], swz[2], swz[3]]
+ ), cScale), cBias);
+ var gMax = deMath.add(deMath.multiply(deMath.swizzle(
+ [1.0, 1.0, 1.0, 0.0], [swz[0], swz[1], swz[2], swz[3]]
+ ), cScale), cBias);
+
+ tcuTextureUtil.fillWithComponentGradients2D(
+ tcuTextureUtil.getSubregion(
+ levelBuf, 0, 0, layerNdx, levelBuf.getWidth(),
+ levelBuf.getHeight(), 1
+ ), gMin, gMax
+ );
+ }
+ }
+
+ // Fill second with grid texture (each layer has unique colors).
+ for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) {
+ this.m_gridTex.getRefTexture().allocLevel(levelNdx);
+
+ /** @type {tcuTexture.PixelBufferAccess} */ var levelBuf =
+ this.m_gridTex.getRefTexture().getLevel(levelNdx);
+
+ for (
+ var layerNdx = 0;
+ layerNdx < this.m_numLayers;
+ layerNdx++) {
+ var step = 0x00ffffff / (numLevels * this.m_numLayers - 1);
+ var rgb = step * (levelNdx + layerNdx * numLevels);
+ /** @type {number} */ var colorA = deMath.binaryOp(
+ 0xff000000, rgb, deMath.BinaryOp.OR
+ );
+ /** @type {number} */ var colorB = deMath.binaryOp(
+ 0xff000000, deMath.binaryNot(rgb), deMath.BinaryOp.OR
+ );
+
+ tcuTextureUtil.fillWithGrid(
+ tcuTextureUtil.getSubregion(
+ levelBuf, 0, 0, layerNdx, levelBuf.getWidth(),
+ levelBuf.getHeight(), 1
+ ), 4,
+ deMath.add(
+ deMath.multiply(
+ tcuRGBA.newRGBAFromValue(colorA).toVec(),
+ cScale
+ ), cBias
+ ),
+ deMath.add(
+ deMath.multiply(
+ tcuRGBA.newRGBAFromValue(colorB).toVec(),
+ cScale
+ ), cBias
+ )
+ );
+ }
+ }
+
+ // Upload.
+ this.m_gradientTex.upload();
+ this.m_gridTex.upload();
+
+ // Test cases
+ this.m_cases.push(
+ new es3fTextureFilteringTests.
+ Texture2DArrayFilteringCase.FilterCase(
+ this.m_gradientTex, [1.5, 2.8], [-1.0, -2.7],
+ [-0.5, this.m_numLayers + 0.5]
+ )
+ );
+ this.m_cases.push(
+ new es3fTextureFilteringTests.
+ Texture2DArrayFilteringCase.FilterCase(
+ this.m_gridTex, [0.2, 0.175], [-2.0, -3.7],
+ [-0.5, this.m_numLayers + 0.5]
+ )
+ );
+ this.m_cases.push(
+ new es3fTextureFilteringTests.
+ Texture2DArrayFilteringCase.FilterCase(
+ this.m_gridTex, [-0.8, -2.3], [0.2, -0.1],
+ [this.m_numLayers + 0.5, -0.5]
+ )
+ );
+
+ // Level rounding - only in single-sample configs as
+ // multisample configs may produce smooth transition at the middle.
+ if (gl.getParameter(gl.SAMPLES) == 0)
+ this.m_cases.push(
+ new es3fTextureFilteringTests.
+ Texture2DArrayFilteringCase.FilterCase(
+ this.m_gradientTex, [-2.0, -1.5], [-0.1, 0.9],
+ [1.50001, 1.49999]
+ )
+ );
+
+ this.m_caseNdx = 0;
+ }
+ catch (e) {
+ // Clean up to save memory.
+ this.deinit();
+ throw e;
+ }
+ };
+
+ /**
+ * deinit
+ */
+ es3fTextureFilteringTests.Texture2DArrayFilteringCase.prototype.deinit =
+ function() {
+ if (this.m_gradientTex)
+ gl.deleteTexture(this.m_gradientTex.getGLTexture());
+ if (this.m_gridTex)
+ gl.deleteTexture(this.m_gridTex.getGLTexture());
+
+ this.m_gradientTex = null;
+ this.m_gridTex = null;
+ };
+
+ /**
+ * iterate
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fTextureFilteringTests.Texture2DArrayFilteringCase.prototype.iterate =
+ function() {
+ /** @type {glsTextureTestUtil.RandomViewport} */
+ var viewport = new glsTextureTestUtil.RandomViewport(
+ gl.canvas, TEX3D_VIEWPORT_WIDTH,
+ TEX3D_VIEWPORT_HEIGHT, deMath.binaryOp(
+ deString.deStringHash(this.fullName()),
+ deMath.deMathHash(this.m_caseNdx),
+ deMath.BinaryOp.XOR
+ )
+ );
+
+ /** @type {es3fTextureFilteringTests.Texture2DArrayFilteringCase.
+ * FilterCase} */ var curCase = this.m_cases[this.m_caseNdx];
+
+ /** @type {tcuTexture.TextureFormat} */
+ var texFmt = curCase.texture.getRefTexture().getFormat();
+ /** @type {tcuTextureUtil.TextureFormatInfo} */
+ var fmtInfo = tcuTextureUtil.getTextureFormatInfo(texFmt);
+
+ bufferedLogToConsole('Test' + this.m_caseNdx);
+
+ /** @type {glsTextureTestUtil.ReferenceParams} */
+ var refParams = new glsTextureTestUtil.ReferenceParams(
+ glsTextureTestUtil.textureType.TEXTURETYPE_2D_ARRAY
+ );
+
+ /** @type {tcuSurface.Surface} */
+ var rendered = new tcuSurface.Surface(viewport.width, viewport.height);
+
+ if (viewport.width < TEX3D_MIN_VIEWPORT_WIDTH ||
+ viewport.height < TEX3D_MIN_VIEWPORT_HEIGHT)
+ throw new Error('Too small render target');
+
+ // Setup params for reference.
+ refParams.sampler = gluTextureUtil.mapGLSampler(
+ this.m_wrapS, this.m_wrapT, this.m_wrapT,
+ this.m_minFilter, this.m_magFilter
+ );
+ refParams.samplerType = glsTextureTestUtil.getSamplerType(texFmt);
+ refParams.lodMode = glsTextureTestUtil.lodMode.EXACT;
+ refParams.colorBias = fmtInfo.lookupBias;
+ refParams.colorScale = fmtInfo.lookupScale;
+
+ // Compute texture coordinates.
+ bufferedLogToConsole(
+ 'Approximate lod per axis = ' + curCase.lod +
+ ', offset = ' + curCase.offset
+ );
+
+ /** @type {number} */ var lodX = curCase.lod[0];
+ /** @type {number} */ var lodY = curCase.lod[1];
+ /** @type {number} */ var oX = curCase.offset[0];
+ /** @type {number} */ var oY = curCase.offset[1];
+ /** @type {number} */ var sX = Math.pow(2, lodX) * viewport.width /
+ this.m_gradientTex.getRefTexture().getWidth();
+ /** @type {number} */ var sY = Math.pow(2, lodY) * viewport.height /
+ this.m_gradientTex.getRefTexture().getHeight();
+ /** @type {number} */ var l0 = curCase.layerRange[0];
+ /** @type {number} */ var l1 = curCase.layerRange[1];
+
+ /** @type {Array<number>}*/
+ var texCoord = [
+ oX, oY, l0,
+ oX, oY + sY, l0 * 0.5 + l1 * 0.5,
+ oX + sX, oY, l0 * 0.5 + l1 * 0.5,
+ oX + sX, oY + sY, l1
+ ];
+
+ gl.bindTexture(gl.TEXTURE_2D_ARRAY, curCase.texture.getGLTexture());
+ gl.texParameteri(
+ gl.TEXTURE_2D_ARRAY, gl.TEXTURE_MIN_FILTER, this.m_minFilter
+ );
+ gl.texParameteri(
+ gl.TEXTURE_2D_ARRAY, gl.TEXTURE_MAG_FILTER, this.m_magFilter
+ );
+ gl.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_WRAP_S, this.m_wrapS);
+ gl.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_WRAP_T, this.m_wrapT);
+
+ gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height);
+ this.m_renderer.renderQuad(
+ 0, texCoord,
+ refParams
+ );
+ rendered.readViewport(
+ gl, [viewport.x, viewport.y, viewport.width, viewport.height]
+ );
+
+ /** @type {boolean} */
+ var isNearestOnly = this.m_minFilter == gl.NEAREST &&
+ this.m_magFilter == gl.NEAREST;
+ /** @type {tcuPixelFormat.PixelFormat} */
+ var pixelFormat = tcuPixelFormat.PixelFormatFromContext(gl);
+ //(iVec4)
+ var colorBits = deMath.max(
+ deMath.addScalar(
+ glsTextureTestUtil.getBitsVec(pixelFormat),
+ // 1 inaccurate bit if nearest only, 2 otherwise
+ -1 * (isNearestOnly ? 1 : 2)
+ ),
+ [0, 0, 0, 0]
+ );
+ /** @type {tcuTexLookupVerifier.LodPrecision} */
+ var lodPrecision = new tcuTexLookupVerifier.LodPrecision();
+ /** @type {tcuTexLookupVerifier.LookupPrecision} */
+ var lookupPrecision = new tcuTexLookupVerifier.LookupPrecision();
+
+ lodPrecision.derivateBits = 18;
+ lodPrecision.lodBits = 6;
+ lookupPrecision.colorThreshold = deMath.divide(
+ tcuTexLookupVerifier.computeFixedPointThreshold(colorBits),
+ refParams.colorScale
+ );
+ lookupPrecision.coordBits = [20, 20, 20];
+ lookupPrecision.uvwBits = [7, 7, 0];
+ lookupPrecision.colorMask =
+ glsTextureTestUtil.getCompareMask(pixelFormat);
+
+ var isHighQuality = glsTextureTestUtil.verifyTexture2DArrayResult(
+ rendered.getAccess(), curCase.texture.getRefTexture().getView(),
+ texCoord, refParams, lookupPrecision, lodPrecision, pixelFormat);
+
+ if (!isHighQuality) {
+ // Evaluate against lower precision requirements.
+ lodPrecision.lodBits = 3;
+ lookupPrecision.uvwBits = [3, 3, 0];
+
+ bufferedLogToConsole(
+ 'Warning: Verification against high ' +
+ 'precision requirements failed, ' +
+ 'trying with lower requirements.'
+ );
+
+ var isOk = glsTextureTestUtil.verifyTexture2DArrayResult(
+ rendered.getAccess(), curCase.texture.getRefTexture().getView(),
+ texCoord, refParams, lookupPrecision, lodPrecision, pixelFormat
+ );
+
+ if (!isOk) {
+ bufferedLogToConsole(
+ 'ERROR: Verification against low precision requirements ' +
+ 'failed, failing test case.'
+ );
+ testFailedOptions('Image verification failed', false);
+ //In JS version, one mistake and you're out
+ return tcuTestCase.IterateResult.STOP;
+ } else
+ checkMessage(
+ false,
+ 'Low-quality filtering result in iteration no. ' +
+ this.m_caseNdx
+ );
+ }
+
+ this.m_caseNdx += 1;
+ if (this.m_caseNdx < this.m_cases.length)
+ return tcuTestCase.IterateResult.CONTINUE;
+
+ testPassed('Verified');
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ // 3D filtering
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} minFilter
+ * @param {number} magFilter
+ * @param {number} wrapS
+ * @param {number} wrapT
+ * @param {number} wrapR
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ * @param {number} depth
+ */
+ es3fTextureFilteringTests.Texture3DFilteringCase = function(
+ name, desc, minFilter, magFilter, wrapS, wrapT, wrapR, internalFormat,
+ width, height, depth
+ ) {
+ tcuTestCase.DeqpTest.call(this, name, desc);
+ this.m_minFilter = minFilter;
+ this.m_magFilter = magFilter;
+ this.m_wrapS = wrapS;
+ this.m_wrapT = wrapT;
+ this.m_wrapR = wrapR;
+ this.m_internalFormat = internalFormat;
+ this.m_width = width;
+ this.m_height = height;
+ this.m_depth = depth;
+ this.m_gradientTex = null;
+ this.m_gridTex = null;
+ /** @type {glsTextureTestUtil.TextureRenderer} */
+ this.m_renderer = new glsTextureTestUtil.TextureRenderer(
+ es3fTextureFilteringTests.version,
+ gluShaderUtil.precision.PRECISION_HIGHP
+ );
+ this.m_caseNdx = 0;
+ this.m_cases = [];
+ };
+
+ es3fTextureFilteringTests.Texture3DFilteringCase.prototype =
+ Object.create(tcuTestCase.DeqpTest.prototype);
+
+ es3fTextureFilteringTests.Texture3DFilteringCase.prototype.constructor =
+ es3fTextureFilteringTests.Texture3DFilteringCase;
+
+ /**
+ * @constructor
+ * @param {gluTexture.Texture3D} tex_
+ * @param {Array<number>} lod_
+ * @param {Array<number>} offset_
+ */
+ es3fTextureFilteringTests.Texture3DFilteringCase.FilterCase = function(
+ tex_, lod_, offset_
+ ) {
+ this.texture = tex_;
+ this.lod = lod_;
+ this.offset = offset_;
+ };
+
+ /**
+ * init
+ */
+ es3fTextureFilteringTests.Texture3DFilteringCase.prototype.init = function(
+ ) {
+ try {
+ /** @type {tcuTexture.TextureFormat} */
+ var texFmt =
+ gluTextureUtil.mapGLInternalFormat(this.m_internalFormat);
+ /** @type {tcuTextureUtil.TextureFormatInfo} */
+ var fmtInfo = tcuTextureUtil.getTextureFormatInfo(texFmt);
+ var cScale = deMath.subtract(
+ fmtInfo.valueMax, fmtInfo.valueMin
+ );
+ var cBias = fmtInfo.valueMin;
+ var numLevels = deMath.logToFloor(
+ Math.max(Math.max(this.m_width, this.m_height), this.m_depth)
+ ) + 1;
+
+ // Create textures.
+ this.m_gradientTex = gluTexture.texture3DFromInternalFormat(
+ gl, this.m_internalFormat,
+ this.m_width, this.m_height, this.m_depth
+ );
+
+ this.m_gridTex = gluTexture.texture3DFromInternalFormat(
+ gl, this.m_internalFormat,
+ this.m_width, this.m_height, this.m_depth
+ );
+
+ // Fill first gradient texture.
+ for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) {
+ var gMin = deMath.add(
+ deMath.multiply([0.0, 0.0, 0.0, 1.0], cScale), cBias
+ );
+
+ var gMax = deMath.add(
+ deMath.multiply([1.0, 1.0, 1.0, 0.0], cScale), cBias
+ );
+
+ this.m_gradientTex.getRefTexture().allocLevel(levelNdx);
+ tcuTextureUtil.fillWithComponentGradients(
+ this.m_gradientTex.getRefTexture().getLevel(levelNdx),
+ gMin, gMax
+ );
+ }
+
+ // Fill second with grid texture.
+ for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) {
+ /** @type {number} */ var step = 0x00ffffff / numLevels;
+ /** @type {number} */ var rgb = step * levelNdx;
+ /** @type {number} */ var colorA = deMath.binaryOp(
+ 0xff000000, rgb, deMath.BinaryOp.OR
+ );
+ /** @type {number} */ var colorB = deMath.binaryOp(
+ 0xff000000, deMath.binaryNot(rgb), deMath.BinaryOp.OR
+ );
+
+ this.m_gridTex.getRefTexture().allocLevel(levelNdx);
+ tcuTextureUtil.fillWithGrid(
+ this.m_gridTex.getRefTexture().getLevel(levelNdx), 4,
+ deMath.add(
+ deMath.multiply(
+ tcuRGBA.newRGBAFromValue(colorA).toVec(),
+ cScale
+ ),
+ cBias
+ ),
+ deMath.add(
+ deMath.multiply(
+ tcuRGBA.newRGBAFromValue(colorB).toVec(),
+ cScale
+ ),
+ cBias
+ )
+ );
+ }
+
+ // Upload.
+ this.m_gradientTex.upload();
+ this.m_gridTex.upload();
+
+ // Test cases
+ this.m_cases.push(
+ new es3fTextureFilteringTests.Texture3DFilteringCase.FilterCase(
+ this.m_gradientTex, [1.5, 2.8, 1.0], [-1.0, -2.7, -2.275]
+ )
+ );
+ this.m_cases.push(
+ new es3fTextureFilteringTests.Texture3DFilteringCase.FilterCase(
+ this.m_gradientTex, [-2.0, -1.5, -1.8], [-0.1, 0.9, -0.25]
+ )
+ );
+ this.m_cases.push(
+ new es3fTextureFilteringTests.Texture3DFilteringCase.FilterCase(
+ this.m_gridTex, [0.2, 0.175, 0.3], [-2.0, -3.7, -1.825]
+ )
+ );
+ this.m_cases.push(
+ new es3fTextureFilteringTests.Texture3DFilteringCase.FilterCase(
+ this.m_gridTex, [-0.8, -2.3, -2.5], [0.2, -0.1, 1.325]
+ )
+ );
+
+ this.m_caseNdx = 0;
+ }
+ catch (e) {
+ // Clean up to save memory.
+ this.deinit();
+ throw e;
+ }
+ };
+
+ /**
+ * deinit
+ */
+ es3fTextureFilteringTests.Texture3DFilteringCase.prototype.deinit =
+ function() {
+ if (this.m_gradientTex)
+ gl.deleteTexture(this.m_gradientTex.getGLTexture());
+ if (this.m_gridTex)
+ gl.deleteTexture(this.m_gridTex.getGLTexture());
+
+ this.m_gradientTex = null;
+ this.m_gridTex = null;
+ };
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fTextureFilteringTests.Texture3DFilteringCase.prototype.iterate =
+ function() {
+ /** @type {glsTextureTestUtil.RandomViewport} */
+ var viewport = new glsTextureTestUtil.RandomViewport(
+ gl.canvas, TEX3D_VIEWPORT_WIDTH,
+ TEX3D_VIEWPORT_HEIGHT, deMath.binaryOp(
+ deString.deStringHash(this.fullName()),
+ deMath.deMathHash(this.m_caseNdx),
+ deMath.BinaryOp.XOR
+ )
+ );
+
+ /** @type {es3fTextureFilteringTests.Texture3DFilteringCase.FilterCase}
+ */ var curCase = this.m_cases[this.m_caseNdx];
+
+ /** @type {tcuTexture.TextureFormat} */
+ var texFmt = curCase.texture.getRefTexture().getFormat();
+ /** @type {tcuTextureUtil.TextureFormatInfo} */
+ var fmtInfo = tcuTextureUtil.getTextureFormatInfo(texFmt);
+
+ bufferedLogToConsole('Test' + this.m_caseNdx);
+ /** @type {glsTextureTestUtil.ReferenceParams} */
+ var refParams = new glsTextureTestUtil.ReferenceParams(
+ glsTextureTestUtil.textureType.TEXTURETYPE_3D
+ );
+
+ /** @type {tcuSurface.Surface} */
+ var rendered = new tcuSurface.Surface(viewport.width, viewport.height);
+ /** @type {Array<number>}*/
+ var texCoord = [];
+
+ if (viewport.width < TEX3D_MIN_VIEWPORT_WIDTH ||
+ viewport.height < TEX3D_MIN_VIEWPORT_HEIGHT)
+ throw new Error('Too small render target');
+
+ // Setup params for reference.
+ refParams.sampler = gluTextureUtil.mapGLSampler(
+ this.m_wrapS, this.m_wrapT, this.m_wrapR,
+ this.m_minFilter, this.m_magFilter
+ );
+
+ // Setup params for reference.
+ refParams.samplerType = glsTextureTestUtil.getSamplerType(texFmt);
+ refParams.lodMode = glsTextureTestUtil.lodMode.EXACT;
+ refParams.colorBias = fmtInfo.lookupBias;
+ refParams.colorScale = fmtInfo.lookupScale;
+
+ // Compute texture coordinates.
+ bufferedLogToConsole('Approximate lod per axis = ' + curCase.lod +
+ ', offset = ' + curCase.offset);
+
+ /** @type {number} */ var lodX = curCase.lod[0];
+ /** @type {number} */ var lodY = curCase.lod[1];
+ /** @type {number} */ var lodZ = curCase.lod[2];
+ /** @type {number} */ var oX = curCase.offset[0];
+ /** @type {number} */ var oY = curCase.offset[1];
+ /** @type {number} */ var oZ = curCase.offset[2];
+ /** @type {number} */ var sX = Math.pow(2, lodX) * viewport.width /
+ this.m_gradientTex.getRefTexture().getWidth();
+ /** @type {number} */ var sY = Math.pow(2, lodY) * viewport.height /
+ this.m_gradientTex.getRefTexture().getHeight();
+ /** @type {number} */ var sZ = Math.pow(2, lodZ) *
+ Math.max(viewport.width, viewport.height) /
+ this.m_gradientTex.getRefTexture().getDepth();
+
+ texCoord[0] = oX; texCoord[1] = oY; texCoord[2] = oZ;
+ texCoord[3] = oX; texCoord[4] = oY + sY; texCoord[5] = oZ + sZ * 0.5;
+ texCoord[6] = oX + sX; texCoord[7] = oY; texCoord[8] = oZ + sZ * 0.5;
+ texCoord[9] = oX + sX; texCoord[10] = oY + sY; texCoord[11] = oZ + sZ;
+
+ gl.bindTexture(gl.TEXTURE_3D, curCase.texture.getGLTexture());
+ gl.texParameteri(
+ gl.TEXTURE_3D, gl.TEXTURE_MIN_FILTER, this.m_minFilter
+ );
+ gl.texParameteri(
+ gl.TEXTURE_3D, gl.TEXTURE_MAG_FILTER, this.m_magFilter
+ );
+ gl.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_WRAP_S, this.m_wrapS);
+ gl.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_WRAP_T, this.m_wrapT);
+ gl.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_WRAP_R, this.m_wrapR);
+
+ gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height);
+ this.m_renderer.renderQuad(0, texCoord, refParams);
+ rendered.readViewport(
+ gl, [viewport.x, viewport.y, viewport.width, viewport.height]
+ );
+
+ var isNearestOnly = this.m_minFilter == gl.NEAREST &&
+ this.m_magFilter == gl.NEAREST;
+ /** @type {tcuPixelFormat.PixelFormat} */
+ var pixelFormat = tcuPixelFormat.PixelFormatFromContext(gl);
+ //(iVec4)
+ var colorBits = deMath.max(
+ deMath.addScalar(
+ glsTextureTestUtil.getBitsVec(pixelFormat),
+ // 1 inaccurate bit if nearest only, 2 otherwise
+ -1 * (isNearestOnly ? 1 : 2)
+ ),
+ [0, 0, 0, 0]
+ );
+ /** @type {tcuTexLookupVerifier.LodPrecision} */
+ var lodPrecision = new tcuTexLookupVerifier.LodPrecision();
+ /** @type {tcuTexLookupVerifier.LookupPrecision} */
+ var lookupPrecision = new tcuTexLookupVerifier.LookupPrecision();
+
+ lodPrecision.derivateBits = 18;
+ lodPrecision.lodBits = 6;
+ lookupPrecision.colorThreshold = deMath.divide(
+ tcuTexLookupVerifier.computeFixedPointThreshold(colorBits),
+ refParams.colorScale
+ );
+ lookupPrecision.coordBits = [20, 20, 20];
+ lookupPrecision.uvwBits = [7, 7, 7];
+ lookupPrecision.colorMask =
+ glsTextureTestUtil.getCompareMask(pixelFormat);
+
+ var isHighQuality = glsTextureTestUtil.verifyTexture3DResult(
+ rendered.getAccess(), curCase.texture.getRefTexture(),
+ texCoord, refParams, lookupPrecision, lodPrecision, pixelFormat
+ );
+
+ if (!isHighQuality) {
+ // Evaluate against lower precision requirements.
+ lodPrecision.lodBits = 4;
+ lookupPrecision.uvwBits = [4, 4, 4];
+
+ bufferedLogToConsole(
+ 'Warning: Verification against high precision ' +
+ 'requirements failed, trying with lower requirements.'
+ );
+
+ var isOk = glsTextureTestUtil.verifyTexture3DResult(
+ rendered.getAccess(), curCase.texture.getRefTexture(),
+ texCoord, refParams, lookupPrecision, lodPrecision, pixelFormat
+ );
+
+ if (!isOk) {
+ bufferedLogToConsole('ERROR: Verification against low ' +
+ 'precision requirements failed, failing test case.'
+ );
+ testFailedOptions('Image verification failed', false);
+ //In JS version, one mistake and you're out
+ return tcuTestCase.IterateResult.STOP;
+ } else
+ checkMessage(
+ false,
+ 'Low-quality filtering result in iteration no. ' +
+ this.m_caseNdx
+ );
+ }
+
+ this.m_caseNdx += 1;
+ if (this.m_caseNdx < this.m_cases.length)
+ return tcuTestCase.IterateResult.CONTINUE;
+
+ testPassed('Verified');
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /** @typedef {{name: string, mode: number}} */
+ es3fTextureFilteringTests.WrapMode;
+
+ /** @typedef {{name: string, mode: number}} */
+ es3fTextureFilteringTests.MinFilterMode;
+
+ /** @typedef {{name: string, mode: number}} */
+ es3fTextureFilteringTests.MagFilterModes;
+
+ /** @typedef {{width: number, height: number}} */
+ es3fTextureFilteringTests.Sizes2D;
+
+ /** @typedef {{width: number, height: number}} */
+ es3fTextureFilteringTests.SizesCube;
+
+ /** @typedef {{width: number, height: number, numLayers: number}} */
+ es3fTextureFilteringTests.Sizes2DArray;
+
+ /** @typedef {{width: number, height: number, depth: number}} */
+ es3fTextureFilteringTests.Sizes3D;
+
+ /** @typedef {{name: string, format: number}} */
+ es3fTextureFilteringTests.FilterableFormatsByType;
+
+ /**
+ * init
+ */
+ es3fTextureFilteringTests.TextureFilteringTests.prototype.init =
+ function() {
+ /** @type {Array<es3fTextureFilteringTests.WrapMode>} */
+ var wrapModes = [{
+ name: 'clamp', mode: gl.CLAMP_TO_EDGE
+ }, {
+ name: 'repeat', mode: gl.REPEAT
+ }, {
+ name: 'mirror', mode: gl.MIRRORED_REPEAT
+ }
+ ];
+
+ /** @type {Array<es3fTextureFilteringTests.MinFilterMode>} */
+ var minFilterModes = [{
+ name: 'nearest', mode: gl.NEAREST
+ }, {
+ name: 'linear', mode: gl.LINEAR
+ }, {
+ name: 'nearest_mipmap_nearest', mode: gl.NEAREST_MIPMAP_NEAREST
+ }, {
+ name: 'linear_mipmap_nearest', mode: gl.LINEAR_MIPMAP_NEAREST
+ }, {
+ name: 'nearest_mipmap_linear', mode: gl.NEAREST_MIPMAP_LINEAR
+ }, {
+ name: 'linear_mipmap_linear', mode: gl.LINEAR_MIPMAP_LINEAR
+ }
+ ];
+
+ /** @type {Array<es3fTextureFilteringTests.MagFilterModes>} */
+ var magFilterModes = [{
+ name: 'nearest', mode: gl.NEAREST
+ }, {
+ name: 'linear', mode: gl.LINEAR
+ }
+ ];
+
+ /** @type {Array<es3fTextureFilteringTests.Sizes2D>} */
+ var sizes2D = [{
+ width: 4, height: 8
+ }, {
+ width: 32, height: 64
+ }, {
+ width: 128, height: 128
+ }, {
+ width: 3, height: 7
+ }, {
+ width: 31, height: 55
+ }, {
+ width: 127, height: 99
+ }
+ ];
+
+ /** @type {Array<es3fTextureFilteringTests.SizesCube>} */
+ var sizesCube = [{
+ width: 8, height: 8
+ }, {
+ width: 64, height: 64
+ }, {
+ width: 128, height: 128
+ }, {
+ width: 7, height: 7
+ }, {
+ width: 63, height: 63
+ }
+ ];
+
+ /** @type {Array<es3fTextureFilteringTests.Sizes2DArray>} */
+ var sizes2DArray = [{
+ width: 4, height: 8, numLayers: 8
+ }, {
+ width: 32, height: 64, numLayers: 16
+ }, {
+ width: 128, height: 32, numLayers: 64
+ }, {
+ width: 3, height: 7, numLayers: 5
+ }, {
+ width: 63, height: 63, numLayers: 63
+ }
+ ];
+
+ /** @type {Array<es3fTextureFilteringTests.Sizes3D>} */
+ var sizes3D = [{
+ width: 4, height: 8, depth: 8
+ }, {
+ width: 32, height: 64, depth: 16
+ }, {
+ width: 128, height: 32, depth: 64
+ }, {
+ width: 3, height: 7, depth: 5
+ }, {
+ width: 63, height: 63, depth: 63
+ }
+ ];
+
+ /** @type {Array<es3fTextureFilteringTests.FilterableFormatsByType>} */
+ var filterableFormatsByType = [{
+ name: 'rgba16f', format: gl.RGBA16F
+ }, {
+ name: 'r11f_g11f_b10f', format: gl.R11F_G11F_B10F
+ }, {
+ name: 'rgb9_e5', format: gl.RGB9_E5
+ }, {
+ name: 'rgba8', format: gl.RGBA8
+ }, {
+ name: 'rgba8_snorm', format: gl.RGBA8_SNORM
+ }, {
+ name: 'rgb565', format: gl.RGB565
+ }, {
+ name: 'rgba4', format: gl.RGBA4
+ }, {
+ name: 'rgb5_a1', format: gl.RGB5_A1
+ }, {
+ name: 'srgb8_alpha8', format: gl.SRGB8_ALPHA8
+ }, {
+ name: 'rgb10_a2', format: gl.RGB10_A2
+ }
+ ];
+
+ // 2D texture filtering.
+
+ // Formats.
+ /** @type {tcuTestCase.DeqpTest} */
+ var formatsGroup;
+ for (var fmtNdx = 0;
+ fmtNdx < filterableFormatsByType.length;
+ fmtNdx++) {
+ formatsGroup = new tcuTestCase.DeqpTest(
+ '2d_formats', '2D Texture Formats');
+ this.addChild(formatsGroup);
+ for (var filterNdx = 0;
+ filterNdx < minFilterModes.length;
+ filterNdx++) {
+ /** @type {number} */
+ var minFilter = minFilterModes[filterNdx].mode;
+ /** @type {string} */
+ var filterName = minFilterModes[filterNdx].name;
+ /** @type {number} */
+ var format = filterableFormatsByType[fmtNdx].format;
+ /** @type {string} */
+ var formatName = filterableFormatsByType[fmtNdx].name;
+ var isMipmap = minFilter != gl.NEAREST &&
+ minFilter != gl.LINEAR;
+ /** @type {number} */
+ var magFilter = isMipmap ? gl.LINEAR : minFilter;
+ /** @type {string} */
+ var name = formatName + '_' + filterName;
+ /** @type {number} */
+ var wrapS = gl.REPEAT;
+ /** @type {number} */
+ var wrapT = gl.REPEAT;
+ /** @type {number} */ var width = 64;
+ /** @type {number} */ var height = 64;
+
+ formatsGroup.addChild(
+ new es3fTextureFilteringTests.Texture2DFilteringCase(
+ name, '', minFilter, magFilter, wrapS, wrapT,
+ format, width, height
+ )
+ );
+ }
+ }
+
+ // Sizes.
+ /** @type {tcuTestCase.DeqpTest} */
+ var sizesGroup;
+ for (var sizeNdx = 0; sizeNdx < sizes2D.length; sizeNdx++) {
+ sizesGroup = new tcuTestCase.DeqpTest(
+ '2d_sizes', '2D Texture Sizes');
+ this.addChild(sizesGroup);
+ for (var filterNdx = 0;
+ filterNdx < minFilterModes.length;
+ filterNdx++) {
+ minFilter = minFilterModes[filterNdx].mode;
+ filterName = minFilterModes[filterNdx].name;
+ format = gl.RGBA8;
+ isMipmap = minFilter != gl.NEAREST &&
+ minFilter != gl.LINEAR;
+ magFilter = isMipmap ? gl.LINEAR : minFilter;
+ wrapS = gl.REPEAT;
+ wrapT = gl.REPEAT;
+ width = sizes2D[sizeNdx].width;
+ height = sizes2D[sizeNdx].height;
+ name = '' + width + 'x' + height + '_' + filterName;
+
+ sizesGroup.addChild(
+ new es3fTextureFilteringTests.Texture2DFilteringCase(
+ name, '', minFilter, magFilter, wrapS, wrapT,
+ format, width, height
+ )
+ );
+ }
+ }
+
+ // Wrap modes.
+ /** @type {tcuTestCase.DeqpTest} */
+ var combinationsGroup;
+ for (var minFilterNdx = 0;
+ minFilterNdx < minFilterModes.length;
+ minFilterNdx++) {
+ combinationsGroup = new tcuTestCase.DeqpTest(
+ '2d_combinations', '2D Filter and wrap mode combinations');
+ this.addChild(combinationsGroup);
+ for (var magFilterNdx = 0;
+ magFilterNdx < magFilterModes.length;
+ magFilterNdx++) {
+ for (var wrapSNdx = 0;
+ wrapSNdx < wrapModes.length;
+ wrapSNdx++) {
+ for (var wrapTNdx = 0;
+ wrapTNdx < wrapModes.length;
+ wrapTNdx++) {
+ minFilter = minFilterModes[minFilterNdx].mode;
+ magFilter = magFilterModes[magFilterNdx].mode;
+ format = gl.RGBA8;
+ wrapS = wrapModes[wrapSNdx].mode;
+ wrapT = wrapModes[wrapTNdx].mode;
+ width = 63;
+ height = 57;
+ name = minFilterModes[minFilterNdx].name + '_' +
+ magFilterModes[magFilterNdx].name + '_' +
+ wrapModes[wrapSNdx].name + '_' +
+ wrapModes[wrapTNdx].name;
+
+ combinationsGroup.addChild(
+ new
+ es3fTextureFilteringTests.Texture2DFilteringCase(
+ name, '', minFilter, magFilter, wrapS, wrapT,
+ format, width, height
+ )
+ );
+ }
+ }
+ }
+ }
+
+ // Cube map texture filtering.
+
+ // Formats.
+ for (var fmtNdx = 0;
+ fmtNdx < filterableFormatsByType.length;
+ fmtNdx++) {
+ formatsGroup = new tcuTestCase.DeqpTest(
+ 'cube_formats', 'Cube Texture Formats');
+ this.addChild(formatsGroup);
+ for (var filterNdx = 0;
+ filterNdx < minFilterModes.length;
+ filterNdx++) {
+ minFilter = minFilterModes[filterNdx].mode;
+ filterName = minFilterModes[filterNdx].name;
+ format = filterableFormatsByType[fmtNdx].format;
+ formatName = filterableFormatsByType[fmtNdx].name;
+ isMipmap = minFilter != gl.NEAREST &&
+ minFilter != gl.LINEAR;
+ magFilter = isMipmap ? gl.LINEAR : minFilter;
+ name = formatName + '_' + filterName;
+ wrapS = gl.REPEAT;
+ wrapT = gl.REPEAT;
+ width = 64;
+ height = 64;
+
+ formatsGroup.addChild(
+ new es3fTextureFilteringTests.TextureCubeFilteringCase(
+ name, '', minFilter, magFilter, wrapS, wrapT,
+ false /* always sample exterior as well */,
+ format, width, height
+ )
+ );
+ }
+ }
+
+ // Sizes.
+ for (var sizeNdx = 0; sizeNdx < sizesCube.length; sizeNdx++) {
+ sizesGroup = new tcuTestCase.DeqpTest(
+ 'cube_sizes', 'Cube Texture Sizes');
+ this.addChild(sizesGroup);
+ for (var filterNdx = 0;
+ filterNdx < minFilterModes.length;
+ filterNdx++) {
+ minFilter = minFilterModes[filterNdx].mode;
+ filterName = minFilterModes[filterNdx].name;
+ var format = gl.RGBA8;
+ isMipmap = minFilter != gl.NEAREST &&
+ minFilter != gl.LINEAR;
+ magFilter = isMipmap ? gl.LINEAR : minFilter;
+ wrapS = gl.REPEAT;
+ wrapT = gl.REPEAT;
+ width = sizesCube[sizeNdx].width;
+ height = sizesCube[sizeNdx].height;
+ name = '' + width + 'x' + height + '_' + filterName;
+
+ sizesGroup.addChild(
+ new es3fTextureFilteringTests.TextureCubeFilteringCase(
+ name, '', minFilter, magFilter, wrapS, wrapT,
+ false, format, width, height
+ )
+ );
+ }
+ }
+
+ // Filter/wrap mode combinations.
+ for (var minFilterNdx = 0;
+ minFilterNdx < minFilterModes.length;
+ minFilterNdx++) {
+ combinationsGroup = new tcuTestCase.DeqpTest(
+ 'cube_combinations', 'Cube Filter and wrap mode combinations'
+ );
+ this.addChild(combinationsGroup);
+ for (var magFilterNdx = 0;
+ magFilterNdx < magFilterModes.length;
+ magFilterNdx++) {
+ for (var wrapSNdx = 0;
+ wrapSNdx < wrapModes.length;
+ wrapSNdx++) {
+ for (var wrapTNdx = 0;
+ wrapTNdx < wrapModes.length;
+ wrapTNdx++) {
+ minFilter = minFilterModes[minFilterNdx].mode;
+ magFilter = magFilterModes[magFilterNdx].mode;
+ format = gl.RGBA8;
+ wrapS = wrapModes[wrapSNdx].mode;
+ wrapT = wrapModes[wrapTNdx].mode;
+ width = 63;
+ height = 63;
+ name = minFilterModes[minFilterNdx].name + '_' +
+ magFilterModes[magFilterNdx].name + '_' +
+ wrapModes[wrapSNdx].name + '_' +
+ wrapModes[wrapTNdx].name;
+
+ combinationsGroup.addChild(
+ new es3fTextureFilteringTests.
+ TextureCubeFilteringCase(
+ name, '', minFilter, magFilter, wrapS, wrapT,
+ false, format, width, height
+ )
+ );
+ }
+ }
+ }
+ }
+
+ // Cases with no visible cube edges.
+ /** @type {tcuTestCase.DeqpTest} */
+ var onlyFaceInteriorGroup = new tcuTestCase.DeqpTest(
+ 'cube_no_edges_visible', "Don't sample anywhere near a face's edges"
+ );
+ this.addChild(onlyFaceInteriorGroup);
+
+ for (var isLinearI = 0; isLinearI <= 1; isLinearI++) {
+ var isLinear = isLinearI != 0;
+ var filter = isLinear ? gl.LINEAR : gl.NEAREST;
+
+ onlyFaceInteriorGroup.addChild(
+ new es3fTextureFilteringTests.TextureCubeFilteringCase(
+ isLinear ? 'linear' : 'nearest', '',
+ filter, filter, gl.REPEAT, gl.REPEAT,
+ true, gl.RGBA8, 63, 63
+ )
+ );
+ }
+
+ // Formats.
+ for (var fmtNdx = 0;
+ fmtNdx < filterableFormatsByType.length;
+ fmtNdx++) {
+ formatsGroup = new tcuTestCase.DeqpTest(
+ '2d_array_formats', '2D Array Texture Formats');
+ this.addChild(formatsGroup);
+ for (var filterNdx = 0;
+ filterNdx < minFilterModes.length;
+ filterNdx++) {
+ minFilter = minFilterModes[filterNdx].mode;
+ filterName = minFilterModes[filterNdx].name;
+ format = filterableFormatsByType[fmtNdx].format;
+ var formatName = filterableFormatsByType[fmtNdx].name;
+ isMipmap = minFilter != gl.NEAREST &&
+ minFilter != gl.LINEAR;
+ magFilter = isMipmap ? gl.LINEAR : minFilter;
+ name = formatName + '_' + filterName;
+ wrapS = gl.REPEAT;
+ wrapT = gl.REPEAT;
+ width = 128;
+ height = 128;
+ /** @type {number} */ var numLayers = 8;
+
+ formatsGroup.addChild(
+ new es3fTextureFilteringTests.Texture2DArrayFilteringCase(
+ name, '', minFilter, magFilter, wrapS, wrapT,
+ format, width, height, numLayers
+ )
+ );
+ }
+ }
+
+ // Sizes.
+ for (var sizeNdx = 0; sizeNdx < sizes2DArray.length; sizeNdx++) {
+ sizesGroup = new tcuTestCase.DeqpTest(
+ '2d_array_sizes', '2D Array Texture Sizes');
+ this.addChild(sizesGroup);
+ for (var filterNdx = 0;
+ filterNdx < minFilterModes.length;
+ filterNdx++) {
+ minFilter = minFilterModes[filterNdx].mode;
+ filterName = minFilterModes[filterNdx].name;
+ format = gl.RGBA8;
+ isMipmap = minFilter != gl.NEAREST &&
+ minFilter != gl.LINEAR;
+ magFilter = isMipmap ? gl.LINEAR : minFilter;
+ wrapS = gl.REPEAT;
+ wrapT = gl.REPEAT;
+ width = sizes2DArray[sizeNdx].width;
+ height = sizes2DArray[sizeNdx].height;
+ numLayers = sizes2DArray[sizeNdx].numLayers;
+ name = '' + width + 'x' + height + 'x' +
+ numLayers + '_' + filterName;
+
+ sizesGroup.addChild(
+ new es3fTextureFilteringTests.Texture2DArrayFilteringCase(
+ name, '', minFilter, magFilter, wrapS, wrapT,
+ format, width, height, numLayers
+ )
+ );
+ }
+ }
+
+ // Wrap modes.
+ for (var minFilterNdx = 0;
+ minFilterNdx < minFilterModes.length;
+ minFilterNdx++) {
+ combinationsGroup = new tcuTestCase.DeqpTest(
+ '2d_array_combinations',
+ '2D Array Filter and wrap mode combinations');
+ this.addChild(combinationsGroup);
+ for (var magFilterNdx = 0;
+ magFilterNdx < magFilterModes.length;
+ magFilterNdx++) {
+ for (var wrapSNdx = 0;
+ wrapSNdx < wrapModes.length;
+ wrapSNdx++) {
+ for (var wrapTNdx = 0;
+ wrapTNdx < wrapModes.length;
+ wrapTNdx++) {
+ minFilter = minFilterModes[minFilterNdx].mode;
+ magFilter = magFilterModes[magFilterNdx].mode;
+ format = gl.RGBA8;
+ wrapS = wrapModes[wrapSNdx].mode;
+ wrapT = wrapModes[wrapTNdx].mode;
+ width = 123;
+ height = 107;
+ numLayers = 7;
+ name = minFilterModes[minFilterNdx].name + '_' +
+ magFilterModes[magFilterNdx].name + '_' +
+ wrapModes[wrapSNdx].name + '_' +
+ wrapModes[wrapTNdx].name;
+
+ combinationsGroup.addChild(
+ new es3fTextureFilteringTests.
+ Texture2DArrayFilteringCase(
+ name, '', minFilter, magFilter,
+ wrapS, wrapT, format,
+ width, height, numLayers
+ )
+ );
+ }
+ }
+ }
+ }
+
+ // 3D texture filtering.
+
+ // Formats.
+ /** @type {number} */ var depth = 64;
+ for (var fmtNdx = 0;
+ fmtNdx < filterableFormatsByType.length;
+ fmtNdx++) {
+ formatsGroup = new tcuTestCase.DeqpTest(
+ '3d_formats', '3D Texture Formats');
+ this.addChild(formatsGroup);
+ for (var filterNdx = 0;
+ filterNdx < minFilterModes.length;
+ filterNdx++) {
+ minFilter = minFilterModes[filterNdx].mode;
+ filterName = minFilterModes[filterNdx].name;
+ format = filterableFormatsByType[fmtNdx].format;
+ formatName = filterableFormatsByType[fmtNdx].name;
+ isMipmap = minFilter != gl.NEAREST &&
+ minFilter != gl.LINEAR;
+ magFilter = isMipmap ? gl.LINEAR : minFilter;
+ name = formatName + '_' + filterName;
+ wrapS = gl.REPEAT;
+ wrapT = gl.REPEAT;
+ /** @type {number} */ var wrapR = gl.REPEAT;
+ width = 64;
+ height = 64;
+ depth = 64;
+
+ formatsGroup.addChild(
+ new es3fTextureFilteringTests.Texture3DFilteringCase(
+ name, '', minFilter, magFilter,
+ wrapS, wrapT, wrapR, format,
+ width, height, depth
+ )
+ );
+ }
+ }
+
+ // Sizes.
+ for (var sizeNdx = 0; sizeNdx < sizes3D.length; sizeNdx++) {
+ sizesGroup = new tcuTestCase.DeqpTest(
+ '3d_sizes', '3D Texture Sizes');
+ this.addChild(sizesGroup);
+ for (var filterNdx = 0;
+ filterNdx < minFilterModes.length;
+ filterNdx++) {
+ minFilter = minFilterModes[filterNdx].mode;
+ filterName = minFilterModes[filterNdx].name;
+ format = gl.RGBA8;
+ isMipmap =
+ minFilter != gl.NEAREST && minFilter != gl.LINEAR;
+ magFilter =
+ isMipmap ? gl.LINEAR : minFilter;
+ wrapS = gl.REPEAT;
+ wrapT = gl.REPEAT;
+ wrapR = gl.REPEAT;
+ width = sizes3D[sizeNdx].width;
+ height = sizes3D[sizeNdx].height;
+ depth = sizes3D[sizeNdx].depth;
+ name = '' + width + 'x' + height + 'x' + depth +
+ '_' + filterName;
+
+ sizesGroup.addChild(
+ new es3fTextureFilteringTests.Texture3DFilteringCase(
+ name, '', minFilter, magFilter,
+ wrapS, wrapT, wrapR, format,
+ width, height, depth
+ )
+ );
+ }
+ }
+
+ // Wrap modes.
+ for (var minFilterNdx = 0;
+ minFilterNdx < minFilterModes.length;
+ minFilterNdx++) {
+ for (var magFilterNdx = 0;
+ magFilterNdx < magFilterModes.length;
+ magFilterNdx++) {
+ for (var wrapSNdx = 0;
+ wrapSNdx < wrapModes.length;
+ wrapSNdx++) {
+ combinationsGroup = new tcuTestCase.DeqpTest(
+ '3d_combinations',
+ '3D Filter and wrap mode combinations');
+ this.addChild(combinationsGroup);
+ for (var wrapTNdx = 0;
+ wrapTNdx < wrapModes.length;
+ wrapTNdx++) {
+ for (var wrapRNdx = 0;
+ wrapRNdx < wrapModes.length;
+ wrapRNdx++) {
+ minFilter = minFilterModes[minFilterNdx].mode;
+ magFilter = magFilterModes[magFilterNdx].mode;
+ format = gl.RGBA8;
+ wrapS = wrapModes[wrapSNdx].mode;
+ wrapT = wrapModes[wrapTNdx].mode;
+ wrapR = wrapModes[wrapRNdx].mode;
+ width = 63;
+ height = 57;
+ depth = 67;
+ name = minFilterModes[minFilterNdx].name + '_' +
+ magFilterModes[magFilterNdx].name + '_' +
+ wrapModes[wrapSNdx].name + '_' +
+ wrapModes[wrapTNdx].name + '_' +
+ wrapModes[wrapRNdx].name;
+
+ combinationsGroup.addChild(
+ new
+ es3fTextureFilteringTests.
+ Texture3DFilteringCase(
+ name, '', minFilter, magFilter,
+ wrapS, wrapT, wrapR, format,
+ width, height, depth
+ )
+ );
+ }
+ }
+ }
+ }
+ }
+ };
+
+ /**
+ * Create and execute the test cases
+ * @param {WebGL2RenderingContext} context
+ * @param {Array<number>=} range Test range
+ */
+ es3fTextureFilteringTests.run = function(context, range) {
+ gl = context;
+
+ const canvas = gl.canvas;
+ canvas.width = canvasWH;
+ canvas.height = canvasWH;
+
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+
+ state.setRoot(new es3fTextureFilteringTests.TextureFilteringTests());
+ if (range)
+ state.setRange(range);
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureFormatTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureFormatTests.js
new file mode 100644
index 0000000000..7300225a8d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureFormatTests.js
@@ -0,0 +1,1185 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+'use strict';
+goog.provide('functional.gles3.es3fTextureFormatTests');
+goog.require('framework.common.tcuCompressedTexture');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluStrUtil');
+goog.require('framework.opengl.gluTexture');
+goog.require('framework.opengl.gluTextureUtil');
+goog.require('modules.shared.glsTextureTestUtil');
+
+goog.scope(function() {
+
+var es3fTextureFormatTests = functional.gles3.es3fTextureFormatTests;
+var gluShaderUtil = framework.opengl.gluShaderUtil;
+var deRandom = framework.delibs.debase.deRandom;
+var tcuTestCase = framework.common.tcuTestCase;
+var tcuSurface = framework.common.tcuSurface;
+var gluTexture = framework.opengl.gluTexture;
+var gluTextureUtil = framework.opengl.gluTextureUtil;
+var tcuTexture = framework.common.tcuTexture;
+var glsTextureTestUtil = modules.shared.glsTextureTestUtil;
+var tcuTextureUtil = framework.common.tcuTextureUtil;
+var gluStrUtil = framework.opengl.gluStrUtil;
+var deMath = framework.delibs.debase.deMath;
+var tcuCompressedTexture = framework.common.tcuCompressedTexture;
+
+/** @type {WebGL2RenderingContext} */ var gl;
+
+var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+};
+
+es3fTextureFormatTests.version = '300 es';
+
+es3fTextureFormatTests.testDescription = function() {
+ var test = tcuTestCase.runner.currentTest;
+ return test.description;
+};
+
+es3fTextureFormatTests.setParentClass = function(child, parent) {
+ child.prototype = Object.create(parent.prototype);
+ child.prototype.constructor = child;
+};
+
+/**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+es3fTextureFormatTests.Texture2DFormatCase = function(descriptor) {
+ tcuTestCase.DeqpTest.call(this, descriptor.name, descriptor.description);
+ this.m_format = descriptor.format;
+ this.m_dataType = descriptor.dataType;
+ this.m_width = descriptor.width;
+ this.m_height = descriptor.height;
+ this.m_renderer = new glsTextureTestUtil.TextureRenderer(es3fTextureFormatTests.version, gluShaderUtil.precision.PRECISION_HIGHP);
+};
+
+es3fTextureFormatTests.setParentClass(es3fTextureFormatTests.Texture2DFormatCase, tcuTestCase.DeqpTest);
+
+es3fTextureFormatTests.Texture2DFormatCase.prototype.init = function() {
+ /*tcu::TextureFormat*/ var fmt = this.m_dataType ? gluTextureUtil.mapGLTransferFormat(this.m_format, this.m_dataType) : gluTextureUtil.mapGLInternalFormat(this.m_format);
+ /*tcu::TextureFormatInfo*/ var spec = tcuTextureUtil.getTextureFormatInfo(fmt);
+ /* TODO : Port
+
+ std::ostringstream fmtName;
+
+ if (m_dataType)
+ fmtName << glu::getPixelFormatStr(m_format) << ", " << glu::getTypeStr(m_dataType);
+ else
+ fmtName << glu::getPixelFormatStr(m_format);
+
+ log << TestLog::Message << "2D texture, " << fmtName.str() << ", " << m_width << "x" << m_height
+ << ",\n fill with " << formatGradient(&spec.valueMin, &spec.valueMax) << " gradient"
+ << TestLog::EndMessage;
+ */
+
+ this.m_texture = this.m_dataType ?
+ gluTexture.texture2DFromFormat(gl, this.m_format, this.m_dataType, this.m_width, this.m_height) : // Implicit internal format.
+ gluTexture.texture2DFromInternalFormat(gl, this.m_format, this.m_width, this.m_height); // Explicit internal format.
+
+ // Fill level 0.
+ this.m_texture.getRefTexture().allocLevel(0);
+ tcuTextureUtil.fillWithComponentGradients(this.m_texture.getRefTexture().getLevel(0), spec.valueMin, spec.valueMax);
+};
+
+es3fTextureFormatTests.Texture2DFormatCase.prototype.deinit = function() {
+ /* TODO: Implement */
+};
+
+es3fTextureFormatTests.Texture2DFormatCase.prototype.iterate = function() {
+ /* TODO: Implement */
+
+ var viewport = new glsTextureTestUtil.RandomViewport(document.getElementById('canvas'), this.m_width, this.m_height/*, deStringHash(getName())*/);
+
+ /* tcu::Surface */ var renderedFrame = new tcuSurface.Surface(viewport.width, viewport.height);
+ /* tcu::Surface */ var referenceFrame = new tcuSurface.Surface(viewport.width, viewport.height);
+ /* TODO: Implement
+ // tcu::RGBA threshold = m_renderCtx.getRenderTarget().getPixelFormat().getColorThreshold() + tcu::RGBA(1,1,1,1);
+ */
+ var threshold = [3, 3, 3, 3];
+ var renderParams = new glsTextureTestUtil.ReferenceParams(glsTextureTestUtil.textureType.TEXTURETYPE_2D);
+
+ /* tcu::TextureFormatInfo*/ var spec = tcuTextureUtil.getTextureFormatInfo(this.m_texture.getRefTexture().getFormat());
+ /** @const */ var wrapS = gl.CLAMP_TO_EDGE;
+ /** @const */ var wrapT = gl.CLAMP_TO_EDGE;
+ /** @const */ var minFilter = gl.NEAREST;
+ /** @const */ var magFilter = gl.NEAREST;
+
+ renderParams.flags.log_programs = true;
+ renderParams.flags.log_uniforms = true;
+
+ renderParams.samplerType = glsTextureTestUtil.getSamplerType(this.m_texture.getRefTexture().getFormat());
+ renderParams.sampler = new tcuTexture.Sampler(tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE,
+ tcuTexture.FilterMode.NEAREST, tcuTexture.FilterMode.NEAREST);
+ renderParams.colorScale = spec.lookupScale;
+ renderParams.colorBias = spec.lookupBias;
+
+ var texCoord = glsTextureTestUtil.computeQuadTexCoord2D([0, 0], [1, 1]);
+
+ // log << TestLog::Message << "Texture parameters:"
+ // << "\n WRAP_S = " << glu::getTextureParameterValueStr(gl.TEXTURE_WRAP_S, wrapS)
+ // << "\n WRAP_T = " << glu::getTextureParameterValueStr(gl.TEXTURE_WRAP_T, wrapT)
+ // << "\n MIN_FILTER = " << glu::getTextureParameterValueStr(gl.TEXTURE_MIN_FILTER, minFilter)
+ // << "\n MAG_FILTER = " << glu::getTextureParameterValueStr(gl.TEXTURE_MAG_FILTER, magFilter)
+ // << TestLog::EndMessage;
+
+ // Setup base viewport.
+ gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height);
+
+ // Upload texture data to GL.
+ this.m_texture.upload();
+
+ // Bind to unit 0.
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(gl.TEXTURE_2D, this.m_texture.getGLTexture());
+
+ // Setup nearest neighbor filtering and clamp-to-edge.
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, wrapS);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, wrapT);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter);
+
+ // // Draw.
+ this.m_renderer.renderQuad(0, texCoord, renderParams);
+ renderedFrame.readViewport(gl, viewport);
+
+ // // Compute reference.
+ glsTextureTestUtil.sampleTexture2D(new glsTextureTestUtil.SurfaceAccess(referenceFrame, undefined /*m_renderCtx.getRenderTarget().getPixelFormat()*/),
+ this.m_texture.getRefTexture(), texCoord, renderParams);
+
+ // Compare and log.
+ var isOk = glsTextureTestUtil.compareImages(referenceFrame, renderedFrame, threshold);
+
+ assertMsgOptions(isOk, es3fTextureFormatTests.testDescription(), true, false);
+ return tcuTestCase.IterateResult.STOP;
+};
+
+/**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+es3fTextureFormatTests.TextureCubeFormatCase = function(descriptor) {
+ tcuTestCase.DeqpTest.call(this, descriptor.name, descriptor.description);
+ this.m_format = descriptor.format;
+ this.m_dataType = descriptor.dataType;
+ this.m_width = descriptor.width;
+ this.m_height = descriptor.height;
+ this.m_renderer = new glsTextureTestUtil.TextureRenderer(es3fTextureFormatTests.version, gluShaderUtil.precision.PRECISION_HIGHP);
+ DE_ASSERT(this.m_width == this.m_height);
+};
+
+es3fTextureFormatTests.setParentClass(es3fTextureFormatTests.TextureCubeFormatCase, tcuTestCase.DeqpTest);
+
+es3fTextureFormatTests.TextureCubeFormatCase.prototype.init = function() {
+ /*tcu::TextureFormat*/ var fmt = this.m_dataType ? gluTextureUtil.mapGLTransferFormat(this.m_format, this.m_dataType) : gluTextureUtil.mapGLInternalFormat(this.m_format);
+ /*tcu::TextureFormatInfo*/ var spec = tcuTextureUtil.getTextureFormatInfo(fmt);
+ /* TODO : Port
+
+ std::ostringstream fmtName;
+
+ if (m_dataType)
+ fmtName << glu::getPixelFormatStr(m_format) << ", " << glu::getTypeStr(m_dataType);
+ else
+ fmtName << glu::getPixelFormatStr(m_format);
+
+ log << TestLog::Message << "2D texture, " << fmtName.str() << ", " << m_width << "x" << m_height
+ << ",\n fill with " << formatGradient(&spec.valueMin, &spec.valueMax) << " gradient"
+ << TestLog::EndMessage;
+ */
+
+ this.m_texture = this.m_dataType ?
+ gluTexture.cubeFromFormat(gl, this.m_format, this.m_dataType, this.m_width) : // Implicit internal format.
+ gluTexture.cubeFromInternalFormat(gl, this.m_format, this.m_width); // Explicit internal format.
+
+ // Fill level 0.
+ for (var face in tcuTexture.CubeFace) {
+ var gMin = null;
+ var gMax = null;
+
+ switch (tcuTexture.CubeFace[face]) {
+ case 0: gMin = deMath.swizzle(spec.valueMin, [0, 1, 2, 3]); gMax = deMath.swizzle(spec.valueMax, [0, 1, 2, 3]); break;
+ case 1: gMin = deMath.swizzle(spec.valueMin, [2, 1, 0, 3]); gMax = deMath.swizzle(spec.valueMax, [2, 1, 0, 3]); break;
+ case 2: gMin = deMath.swizzle(spec.valueMin, [1, 2, 0, 3]); gMax = deMath.swizzle(spec.valueMax, [1, 2, 0, 3]); break;
+ case 3: gMin = deMath.swizzle(spec.valueMax, [0, 1, 2, 3]); gMax = deMath.swizzle(spec.valueMin, [0, 1, 2, 3]); break;
+ case 4: gMin = deMath.swizzle(spec.valueMax, [2, 1, 0, 3]); gMax = deMath.swizzle(spec.valueMin, [2, 1, 0, 3]); break;
+ case 5: gMin = deMath.swizzle(spec.valueMax, [1, 2, 0, 3]); gMax = deMath.swizzle(spec.valueMin, [1, 2, 0, 3]); break;
+ default:
+ DE_ASSERT(false);
+ }
+
+ this.m_texture.getRefTexture().allocLevel(tcuTexture.CubeFace[face], 0);
+ tcuTextureUtil.fillWithComponentGradients(this.m_texture.getRefTexture().getLevelFace(0, tcuTexture.CubeFace[face]), gMin, gMax);
+ }
+
+ this.m_texture.upload();
+ this.m_curFace = 0;
+ this.m_isOk = true;
+};
+
+es3fTextureFormatTests.TextureCubeFormatCase.prototype.testFace = function(face) {
+ /* TODO: Implement */
+
+ var viewport = new glsTextureTestUtil.RandomViewport(document.getElementById('canvas'), this.m_width, this.m_height/*, deStringHash(getName())*/);
+
+ /* tcu::Surface */ var renderedFrame = new tcuSurface.Surface(viewport.width, viewport.height);
+ /* tcu::Surface */ var referenceFrame = new tcuSurface.Surface(viewport.width, viewport.height);
+ /* TODO: Implement
+ // tcu::RGBA threshold = m_renderCtx.getRenderTarget().getPixelFormat().getColorThreshold() + tcu::RGBA(1,1,1,1);
+ */
+ var threshold = [3, 3, 3, 3];
+ var renderParams = new glsTextureTestUtil.ReferenceParams(glsTextureTestUtil.textureType.TEXTURETYPE_CUBE);
+
+ /* tcu::TextureFormatInfo*/ var spec = tcuTextureUtil.getTextureFormatInfo(this.m_texture.getRefTexture().getFormat());
+ /** @const */ var wrapS = gl.CLAMP_TO_EDGE;
+ /** @const */ var wrapT = gl.CLAMP_TO_EDGE;
+ /** @const */ var minFilter = gl.NEAREST;
+ /** @const */ var magFilter = gl.NEAREST;
+
+ renderParams.flags.log_programs = true;
+ renderParams.flags.log_uniforms = true;
+
+ renderParams.samplerType = glsTextureTestUtil.getSamplerType(this.m_texture.getRefTexture().getFormat());
+ renderParams.sampler = new tcuTexture.Sampler(tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE,
+ tcuTexture.FilterMode.NEAREST, tcuTexture.FilterMode.NEAREST);
+ renderParams.colorScale = spec.lookupScale;
+ renderParams.colorBias = spec.lookupBias;
+
+ // Log render info on first face.
+ if (face === tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X) {
+ renderParams.flags.log_programs = true;
+ renderParams.flags.log_uniforms = true;
+ }
+
+ var texCoord = glsTextureTestUtil.computeQuadTexCoordCube(face);
+
+ // log << TestLog::Message << "Texture parameters:"
+ // << "\n WRAP_S = " << glu::getTextureParameterValueStr(gl.TEXTURE_WRAP_S, wrapS)
+ // << "\n WRAP_T = " << glu::getTextureParameterValueStr(gl.TEXTURE_WRAP_T, wrapT)
+ // << "\n MIN_FILTER = " << glu::getTextureParameterValueStr(gl.TEXTURE_MIN_FILTER, minFilter)
+ // << "\n MAG_FILTER = " << glu::getTextureParameterValueStr(gl.TEXTURE_MAG_FILTER, magFilter)
+ // << TestLog::EndMessage;
+
+ // Setup base viewport.
+ gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height);
+
+ // Bind to unit 0.
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, this.m_texture.getGLTexture());
+
+ // Setup nearest neighbor filtering and clamp-to-edge.
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, wrapS);
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, wrapT);
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, minFilter);
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, magFilter);
+
+ // // Draw.
+ this.m_renderer.renderQuad(0, texCoord, renderParams);
+ renderedFrame.readViewport(gl, viewport);
+
+ // // Compute reference.
+ glsTextureTestUtil.sampleTextureCube(new glsTextureTestUtil.SurfaceAccess(referenceFrame, undefined /*m_renderCtx.getRenderTarget().getPixelFormat()*/),
+ this.m_texture.getRefTexture(), texCoord, renderParams);
+
+ // Compare and log.
+ var skipPixels = null;
+ if (renderParams.samplerType == glsTextureTestUtil.samplerType.SAMPLERTYPE_INT ||
+ renderParams.samplerType == glsTextureTestUtil.samplerType.SAMPLERTYPE_UINT) {
+ // Skip top right pixel due to Mac Intel driver bug.
+ // https://github.com/KhronosGroup/WebGL/issues/1819
+ skipPixels = [
+ [this.m_width - 1, this.m_height - 1]
+ ];
+ }
+ var isOk = glsTextureTestUtil.compareImages(referenceFrame, renderedFrame, threshold, skipPixels);
+
+ assertMsgOptions(isOk, 'Face: ' + this.m_curFace + ' ' + es3fTextureFormatTests.testDescription(), true, false);
+ return isOk;
+};
+
+es3fTextureFormatTests.TextureCubeFormatCase.prototype.iterate = function() {
+ debug('Testing face ' + this.m_curFace);
+ // Execute test for all faces.
+ if (!this.testFace(this.m_curFace))
+ this.m_isOk = false;
+
+ this.m_curFace += 1;
+
+ if (this.m_curFace < Object.keys(tcuTexture.CubeFace).length)
+ return tcuTestCase.IterateResult.CONTINUE;
+ else
+ return tcuTestCase.IterateResult.STOP;
+};
+
+/**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+es3fTextureFormatTests.Texture2DArrayFormatCase = function(descriptor) {
+ tcuTestCase.DeqpTest.call(this, descriptor.name, descriptor.description);
+ this.m_format = descriptor.format;
+ this.m_dataType = descriptor.dataType;
+ this.m_width = descriptor.width;
+ this.m_height = descriptor.height;
+ this.m_numLayers = descriptor.numLayers;
+ this.m_renderer = new glsTextureTestUtil.TextureRenderer(es3fTextureFormatTests.version, gluShaderUtil.precision.PRECISION_HIGHP);
+};
+
+es3fTextureFormatTests.setParentClass(es3fTextureFormatTests.Texture2DArrayFormatCase, tcuTestCase.DeqpTest);
+
+es3fTextureFormatTests.Texture2DArrayFormatCase.prototype.init = function() {
+ /*tcu::TextureFormat*/ var fmt = this.m_dataType ? gluTextureUtil.mapGLTransferFormat(this.m_format, this.m_dataType) : gluTextureUtil.mapGLInternalFormat(this.m_format);
+ /*tcu::TextureFormatInfo*/ var spec = tcuTextureUtil.getTextureFormatInfo(fmt);
+ /* TODO : Port
+
+ std::ostringstream fmtName;
+
+ if (m_dataType)
+ fmtName << glu::getPixelFormatStr(m_format) << ", " << glu::getTypeStr(m_dataType);
+ else
+ fmtName << glu::getPixelFormatStr(m_format);
+
+ log << TestLog::Message << "2D texture, " << fmtName.str() << ", " << m_width << "x" << m_height
+ << ",\n fill with " << formatGradient(&spec.valueMin, &spec.valueMax) << " gradient"
+ << TestLog::EndMessage;
+ */
+
+ this.m_texture = this.m_dataType ?
+ gluTexture.texture2DArrayFromFormat(gl, this.m_format, this.m_dataType, this.m_width, this.m_height, this.m_numLayers) : // Implicit internal format.
+ gluTexture.texture2DArrayFromInternalFormat(gl, this.m_format, this.m_width, this.m_height, this.m_numLayers); // Explicit internal format.
+
+ this.m_texture.getRefTexture().allocLevel(0);
+ tcuTextureUtil.fillWithComponentGradients(this.m_texture.getRefTexture().getLevel(0), spec.valueMin, spec.valueMax);
+
+ this.m_curLayer = 0;
+ this.m_isOk = true;
+};
+
+es3fTextureFormatTests.Texture2DArrayFormatCase.prototype.testLayer = function(layerNdx) {
+ /* TODO: Implement */
+
+ var viewport = new glsTextureTestUtil.RandomViewport(document.getElementById('canvas'), this.m_width, this.m_height/*, deStringHash(getName())*/);
+
+ /* tcu::Surface */ var renderedFrame = new tcuSurface.Surface(viewport.width, viewport.height);
+ /* tcu::Surface */ var referenceFrame = new tcuSurface.Surface(viewport.width, viewport.height);
+ /* TODO: Implement
+ // tcu::RGBA threshold = m_renderCtx.getRenderTarget().getPixelFormat().getColorThreshold() + tcu::RGBA(1,1,1,1);
+ */
+ var threshold = [3, 3, 3, 3];
+ var renderParams = new glsTextureTestUtil.ReferenceParams(glsTextureTestUtil.textureType.TEXTURETYPE_2D_ARRAY);
+
+ /* tcu::TextureFormatInfo*/ var spec = tcuTextureUtil.getTextureFormatInfo(this.m_texture.getRefTexture().getFormat());
+ /** @const */ var wrapS = gl.CLAMP_TO_EDGE;
+ /** @const */ var wrapT = gl.CLAMP_TO_EDGE;
+ /** @const */ var minFilter = gl.NEAREST;
+ /** @const */ var magFilter = gl.NEAREST;
+
+ renderParams.flags.log_programs = true;
+ renderParams.flags.log_uniforms = true;
+
+ renderParams.samplerType = glsTextureTestUtil.getSamplerType(this.m_texture.getRefTexture().getFormat());
+ renderParams.sampler = new tcuTexture.Sampler(tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE,
+ tcuTexture.FilterMode.NEAREST, tcuTexture.FilterMode.NEAREST);
+ renderParams.colorScale = spec.lookupScale;
+ renderParams.colorBias = spec.lookupBias;
+
+ var texCoord = glsTextureTestUtil.computeQuadTexCoord2DArray(layerNdx, [0, 0], [1, 1]);
+
+ // log << TestLog::Message << "Texture parameters:"
+ // << "\n WRAP_S = " << glu::getTextureParameterValueStr(gl.TEXTURE_WRAP_S, wrapS)
+ // << "\n WRAP_T = " << glu::getTextureParameterValueStr(gl.TEXTURE_WRAP_T, wrapT)
+ // << "\n MIN_FILTER = " << glu::getTextureParameterValueStr(gl.TEXTURE_MIN_FILTER, minFilter)
+ // << "\n MAG_FILTER = " << glu::getTextureParameterValueStr(gl.TEXTURE_MAG_FILTER, magFilter)
+ // << TestLog::EndMessage;
+
+ // Setup base viewport.
+ gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height);
+
+ this.m_texture.upload();
+
+ // Bind to unit 0.
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(gl.TEXTURE_2D_ARRAY, this.m_texture.getGLTexture());
+
+ // Setup nearest neighbor filtering and clamp-to-edge.
+ gl.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_WRAP_S, wrapS);
+ gl.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_WRAP_T, wrapT);
+ gl.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_MIN_FILTER, minFilter);
+ gl.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_MAG_FILTER, magFilter);
+
+ // // Draw.
+ this.m_renderer.renderQuad(0, texCoord, renderParams);
+ renderedFrame.readViewport(gl, viewport);
+
+ // // Compute reference.
+ glsTextureTestUtil.sampleTexture2DArray(new glsTextureTestUtil.SurfaceAccess(referenceFrame, undefined /*m_renderCtx.getRenderTarget().getPixelFormat()*/),
+ this.m_texture.getRefTexture().getView(), texCoord, renderParams);
+
+ // Compare and log.
+ var isOk = glsTextureTestUtil.compareImages(referenceFrame, renderedFrame, threshold);
+
+ assertMsgOptions(isOk, 'Layer: ' + this.m_curLayer + ' ' + es3fTextureFormatTests.testDescription(), true, false);
+ return isOk;
+};
+
+es3fTextureFormatTests.Texture2DArrayFormatCase.prototype.iterate = function() {
+ debug('Testing layer ' + this.m_curLayer);
+ // Execute test for all layers.
+ if (!this.testLayer(this.m_curLayer))
+ this.m_isOk = false;
+
+ this.m_curLayer += 1;
+
+ if (this.m_curLayer == this.m_numLayers)
+ return tcuTestCase.IterateResult.STOP;
+ else
+ return tcuTestCase.IterateResult.CONTINUE;
+};
+
+/**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+es3fTextureFormatTests.Texture3DFormatCase = function(descriptor) {
+ tcuTestCase.DeqpTest.call(this, descriptor.name, descriptor.description);
+ this.m_format = descriptor.format;
+ this.m_dataType = descriptor.dataType;
+ this.m_width = descriptor.width;
+ this.m_height = descriptor.height;
+ this.m_depth = descriptor.depth;
+ this.m_renderer = new glsTextureTestUtil.TextureRenderer(es3fTextureFormatTests.version, gluShaderUtil.precision.PRECISION_HIGHP);
+};
+
+es3fTextureFormatTests.setParentClass(es3fTextureFormatTests.Texture3DFormatCase, tcuTestCase.DeqpTest);
+
+es3fTextureFormatTests.Texture3DFormatCase.prototype.init = function() {
+ /*tcu::TextureFormat*/ var fmt = this.m_dataType ? gluTextureUtil.mapGLTransferFormat(this.m_format, this.m_dataType) : gluTextureUtil.mapGLInternalFormat(this.m_format);
+ /*tcu::TextureFormatInfo*/ var spec = tcuTextureUtil.getTextureFormatInfo(fmt);
+ /* TODO : Port
+
+ std::ostringstream fmtName;
+
+ if (m_dataType)
+ fmtName << glu::getPixelFormatStr(m_format) << ", " << glu::getTypeStr(m_dataType);
+ else
+ fmtName << glu::getPixelFormatStr(m_format);
+
+ log << TestLog::Message << "2D texture, " << fmtName.str() << ", " << m_width << "x" << m_height
+ << ",\n fill with " << formatGradient(&spec.valueMin, &spec.valueMax) << " gradient"
+ << TestLog::EndMessage;
+ */
+
+ this.m_texture = this.m_dataType ?
+ gluTexture.texture3DFromFormat(gl, this.m_format, this.m_dataType, this.m_width, this.m_height, this.m_depth) : // Implicit internal format.
+ gluTexture.texture3DFromInternalFormat(gl, this.m_format, this.m_width, this.m_height, this.m_depth); // Explicit internal format.
+
+ this.m_texture.getRefTexture().allocLevel(0);
+ tcuTextureUtil.fillWithComponentGradients(this.m_texture.getRefTexture().getLevel(0), spec.valueMin, spec.valueMax);
+
+ this.m_curSlice = 0;
+ this.m_isOk = true;
+};
+
+es3fTextureFormatTests.Texture3DFormatCase.prototype.testSlice = function(sliceNdx) {
+ /* TODO: Implement */
+
+ var viewport = new glsTextureTestUtil.RandomViewport(document.getElementById('canvas'), this.m_width, this.m_height/*, deStringHash(getName())*/);
+
+ /* tcu::Surface */ var renderedFrame = new tcuSurface.Surface(viewport.width, viewport.height);
+ /* tcu::Surface */ var referenceFrame = new tcuSurface.Surface(viewport.width, viewport.height);
+ /* TODO: Implement
+ // tcu::RGBA threshold = m_renderCtx.getRenderTarget().getPixelFormat().getColorThreshold() + tcu::RGBA(1,1,1,1);
+ */
+ var threshold = [3, 3, 3, 3];
+ var renderParams = new glsTextureTestUtil.ReferenceParams(glsTextureTestUtil.textureType.TEXTURETYPE_3D);
+
+ /* tcu::TextureFormatInfo*/ var spec = tcuTextureUtil.getTextureFormatInfo(this.m_texture.getRefTexture().getFormat());
+ var r = (sliceNdx + 0.5) / this.m_depth;
+ /** @const */ var wrapS = gl.CLAMP_TO_EDGE;
+ /** @const */ var wrapT = gl.CLAMP_TO_EDGE;
+ /** @const */ var minFilter = gl.NEAREST;
+ /** @const */ var magFilter = gl.NEAREST;
+
+ renderParams.flags.log_programs = true;
+ renderParams.flags.log_uniforms = true;
+
+ renderParams.samplerType = glsTextureTestUtil.getSamplerType(this.m_texture.getRefTexture().getFormat());
+ renderParams.sampler = new tcuTexture.Sampler(tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE,
+ tcuTexture.FilterMode.NEAREST, tcuTexture.FilterMode.NEAREST);
+ renderParams.colorScale = spec.lookupScale;
+ renderParams.colorBias = spec.lookupBias;
+
+ var texCoord = glsTextureTestUtil.computeQuadTexCoord3D([0, 0, r], [1, 1, r], [0, 1, 2]);
+
+ // log << TestLog::Message << "Texture parameters:"
+ // << "\n WRAP_S = " << glu::getTextureParameterValueStr(gl.TEXTURE_WRAP_S, wrapS)
+ // << "\n WRAP_T = " << glu::getTextureParameterValueStr(gl.TEXTURE_WRAP_T, wrapT)
+ // << "\n MIN_FILTER = " << glu::getTextureParameterValueStr(gl.TEXTURE_MIN_FILTER, minFilter)
+ // << "\n MAG_FILTER = " << glu::getTextureParameterValueStr(gl.TEXTURE_MAG_FILTER, magFilter)
+ // << TestLog::EndMessage;
+
+ // Setup base viewport.
+ gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height);
+
+ this.m_texture.upload();
+
+ // Bind to unit 0.
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(gl.TEXTURE_3D, this.m_texture.getGLTexture());
+
+ // Setup nearest neighbor filtering and clamp-to-edge.
+ gl.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_WRAP_S, wrapS);
+ gl.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_WRAP_T, wrapT);
+ gl.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_MIN_FILTER, minFilter);
+ gl.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_MAG_FILTER, magFilter);
+
+ // // Draw.
+ this.m_renderer.renderQuad(0, texCoord, renderParams);
+ renderedFrame.readViewport(gl, viewport);
+
+ // // Compute reference.
+ glsTextureTestUtil.sampleTexture3D(new glsTextureTestUtil.SurfaceAccess(referenceFrame, undefined /*m_renderCtx.getRenderTarget().getPixelFormat()*/),
+ this.m_texture.getRefTexture(), texCoord, renderParams);
+
+ // Compare and log.
+ var isOk = glsTextureTestUtil.compareImages(referenceFrame, renderedFrame, threshold);
+
+ assertMsgOptions(isOk, 'Slice: ' + this.m_curSlice + ' ' + es3fTextureFormatTests.testDescription(), true, false);
+ return isOk;
+};
+
+es3fTextureFormatTests.Texture3DFormatCase.prototype.iterate = function() {
+ debug('Testing slice ' + this.m_curSlice);
+ // Execute test for all layers.
+ if (!this.testSlice(this.m_curSlice))
+ this.m_isOk = false;
+
+ this.m_curSlice += 1;
+
+ if (this.m_curSlice >= this.m_depth)
+ return tcuTestCase.IterateResult.STOP;
+ else
+ return tcuTestCase.IterateResult.CONTINUE;
+};
+
+/**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+es3fTextureFormatTests.Compressed2DFormatCase = function(descriptor) {
+ tcuTestCase.DeqpTest.call(this, descriptor.name, descriptor.description);
+ this.m_format = descriptor.format;
+ this.m_dataType = descriptor.dataType;
+ this.m_width = descriptor.width;
+ this.m_height = descriptor.height;
+ this.m_renderer = new glsTextureTestUtil.TextureRenderer(es3fTextureFormatTests.version, gluShaderUtil.precision.PRECISION_HIGHP);
+};
+
+es3fTextureFormatTests.setParentClass(es3fTextureFormatTests.Compressed2DFormatCase, tcuTestCase.DeqpTest);
+
+es3fTextureFormatTests.Compressed2DFormatCase.prototype.init = function() {
+ var compressed = new tcuCompressedTexture.CompressedTexture(this.m_format, this.m_width, this.m_height);
+ var rand = new deRandom.Random(0);
+ for (var i = 0; i < compressed.m_data.length; i++) {
+ compressed.m_data[i] = rand.getInt(0, 255);
+ }
+ this.m_texture = gluTexture.compressed2DFromInternalFormat(gl, this.m_format, this.m_width, this.m_height, compressed);
+};
+
+es3fTextureFormatTests.Compressed2DFormatCase.prototype.deinit = function() {
+ /* TODO: Implement */
+};
+
+es3fTextureFormatTests.Compressed2DFormatCase.prototype.iterate = function() {
+ /* TODO: Implement */
+
+ var viewport = new glsTextureTestUtil.RandomViewport(document.getElementById('canvas'), this.m_width, this.m_height/*, deStringHash(getName())*/);
+
+ /* tcu::Surface */ var renderedFrame = new tcuSurface.Surface(viewport.width, viewport.height);
+ /* tcu::Surface */ var referenceFrame = new tcuSurface.Surface(viewport.width, viewport.height);
+ /* TODO: Implement
+ // tcu::RGBA threshold = m_renderCtx.getRenderTarget().getPixelFormat().getColorThreshold() + tcu::RGBA(1,1,1,1);
+ */
+ var threshold = [3, 3, 3, 3];
+ var renderParams = new glsTextureTestUtil.ReferenceParams(glsTextureTestUtil.textureType.TEXTURETYPE_2D);
+
+ /* tcu::TextureFormatInfo*/ var spec = tcuTextureUtil.getTextureFormatInfo(this.m_texture.getRefTexture().getFormat());
+ /** @const */ var wrapS = gl.CLAMP_TO_EDGE;
+ /** @const */ var wrapT = gl.CLAMP_TO_EDGE;
+ /** @const */ var minFilter = gl.NEAREST;
+ /** @const */ var magFilter = gl.NEAREST;
+
+ renderParams.flags.log_programs = true;
+ renderParams.flags.log_uniforms = true;
+
+ renderParams.samplerType = glsTextureTestUtil.getSamplerType(this.m_texture.getRefTexture().getFormat());
+ renderParams.sampler = new tcuTexture.Sampler(tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE,
+ tcuTexture.FilterMode.NEAREST, tcuTexture.FilterMode.NEAREST);
+ renderParams.colorScale = spec.lookupScale;
+ renderParams.colorBias = spec.lookupBias;
+
+ var texCoord = glsTextureTestUtil.computeQuadTexCoord2D([0, 0], [1, 1]);
+
+ // log << TestLog::Message << "Texture parameters:"
+ // << "\n WRAP_S = " << glu::getTextureParameterValueStr(gl.TEXTURE_WRAP_S, wrapS)
+ // << "\n WRAP_T = " << glu::getTextureParameterValueStr(gl.TEXTURE_WRAP_T, wrapT)
+ // << "\n MIN_FILTER = " << glu::getTextureParameterValueStr(gl.TEXTURE_MIN_FILTER, minFilter)
+ // << "\n MAG_FILTER = " << glu::getTextureParameterValueStr(gl.TEXTURE_MAG_FILTER, magFilter)
+ // << TestLog::EndMessage;
+
+ // Setup base viewport.
+ gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height);
+
+ // Bind to unit 0.
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(gl.TEXTURE_2D, this.m_texture.getGLTexture());
+
+ // Setup nearest neighbor filtering and clamp-to-edge.
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, wrapS);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, wrapT);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter);
+
+ // // Draw.
+ this.m_renderer.renderQuad(0, texCoord, renderParams);
+ renderedFrame.readViewport(gl, viewport);
+
+ // // Compute reference.
+ glsTextureTestUtil.sampleTexture2D(new glsTextureTestUtil.SurfaceAccess(referenceFrame, undefined /*m_renderCtx.getRenderTarget().getPixelFormat()*/),
+ this.m_texture.getRefTexture(), texCoord, renderParams);
+
+ // Compare and log.
+ var isOk = glsTextureTestUtil.compareImages(referenceFrame, renderedFrame, threshold);
+
+ assertMsgOptions(isOk, es3fTextureFormatTests.testDescription(), true, false);
+ return tcuTestCase.IterateResult.STOP;
+};
+
+/**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+es3fTextureFormatTests.CompressedCubeFormatCase = function(descriptor) {
+ tcuTestCase.DeqpTest.call(this, descriptor.name, descriptor.description);
+ this.m_format = descriptor.format;
+ this.m_dataType = descriptor.dataType;
+ this.m_width = descriptor.width;
+ this.m_height = descriptor.height;
+ this.m_renderer = new glsTextureTestUtil.TextureRenderer(es3fTextureFormatTests.version, gluShaderUtil.precision.PRECISION_HIGHP);
+ this.m_curFace = 0;
+ this.m_isOk = true;
+ DE_ASSERT(this.m_width == this.m_height);
+};
+
+es3fTextureFormatTests.setParentClass(es3fTextureFormatTests.CompressedCubeFormatCase, tcuTestCase.DeqpTest);
+
+es3fTextureFormatTests.CompressedCubeFormatCase.prototype.init = function() {
+ var compressed = new tcuCompressedTexture.CompressedTexture(this.m_format, this.m_width, this.m_height);
+ var rand = new deRandom.Random(0);
+ for (var i = 0; i < compressed.m_data.length; i++) {
+ compressed.m_data[i] = rand.getInt(0, 255);
+ }
+ this.m_texture = gluTexture.compressedCubeFromInternalFormat(gl, this.m_format, this.m_width, compressed);
+};
+
+es3fTextureFormatTests.CompressedCubeFormatCase.prototype.testFace = function(face) {
+ /* TODO: Implement */
+
+ var viewport = new glsTextureTestUtil.RandomViewport(document.getElementById('canvas'), this.m_width, this.m_height/*, deStringHash(getName())*/);
+
+ /* tcu::Surface */ var renderedFrame = new tcuSurface.Surface(viewport.width, viewport.height);
+ /* tcu::Surface */ var referenceFrame = new tcuSurface.Surface(viewport.width, viewport.height);
+ /* TODO: Implement
+ // tcu::RGBA threshold = m_renderCtx.getRenderTarget().getPixelFormat().getColorThreshold() + tcu::RGBA(1,1,1,1);
+ */
+ // Threshold high enough to cover numerical errors in software decoders on Windows and Mac. Threshold is 17 in native dEQP.
+ var threshold = [6, 6, 6, 6];
+ var renderParams = new glsTextureTestUtil.ReferenceParams(glsTextureTestUtil.textureType.TEXTURETYPE_CUBE);
+
+ /** @const */ var wrapS = gl.CLAMP_TO_EDGE;
+ /** @const */ var wrapT = gl.CLAMP_TO_EDGE;
+ /** @const */ var minFilter = gl.NEAREST;
+ /** @const */ var magFilter = gl.NEAREST;
+
+ renderParams.flags.log_programs = true;
+ renderParams.flags.log_uniforms = true;
+
+ renderParams.samplerType = glsTextureTestUtil.getSamplerType(this.m_texture.getRefTexture().getFormat());
+ renderParams.sampler = new tcuTexture.Sampler(tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE, tcuTexture.WrapMode.CLAMP_TO_EDGE,
+ tcuTexture.FilterMode.NEAREST, tcuTexture.FilterMode.NEAREST);
+
+ // Log render info on first face.
+ if (face === tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X) {
+ renderParams.flags.log_programs = true;
+ renderParams.flags.log_uniforms = true;
+ }
+
+ var texCoord = glsTextureTestUtil.computeQuadTexCoordCube(face);
+
+ // log << TestLog::Message << "Texture parameters:"
+ // << "\n WRAP_S = " << glu::getTextureParameterValueStr(gl.TEXTURE_WRAP_S, wrapS)
+ // << "\n WRAP_T = " << glu::getTextureParameterValueStr(gl.TEXTURE_WRAP_T, wrapT)
+ // << "\n MIN_FILTER = " << glu::getTextureParameterValueStr(gl.TEXTURE_MIN_FILTER, minFilter)
+ // << "\n MAG_FILTER = " << glu::getTextureParameterValueStr(gl.TEXTURE_MAG_FILTER, magFilter)
+ // << TestLog::EndMessage;
+
+ // Setup base viewport.
+ gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height);
+
+ // Bind to unit 0.
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, this.m_texture.getGLTexture());
+
+ // Setup nearest neighbor filtering and clamp-to-edge.
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, wrapS);
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, wrapT);
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, minFilter);
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, magFilter);
+
+ // // Draw.
+ this.m_renderer.renderQuad(0, texCoord, renderParams);
+ renderedFrame.readViewport(gl, viewport);
+
+ // // Compute reference.
+ glsTextureTestUtil.sampleTextureCube(new glsTextureTestUtil.SurfaceAccess(referenceFrame, undefined /*m_renderCtx.getRenderTarget().getPixelFormat()*/),
+ this.m_texture.getRefTexture(), texCoord, renderParams);
+
+ // Compare and log.
+ var isOk = glsTextureTestUtil.compareImages(referenceFrame, renderedFrame, threshold);
+
+ assertMsgOptions(isOk, 'Face: ' + this.m_curFace + ' ' + es3fTextureFormatTests.testDescription(), true, false);
+ return isOk;
+};
+
+es3fTextureFormatTests.CompressedCubeFormatCase.prototype.iterate = function() {
+ debug('Testing face ' + this.m_curFace);
+ // Execute test for all faces.
+ if (!this.testFace(this.m_curFace))
+ this.m_isOk = false;
+
+ this.m_curFace += 1;
+
+ if (this.m_curFace < Object.keys(tcuTexture.CubeFace).length)
+ return tcuTestCase.IterateResult.CONTINUE;
+ else
+ return tcuTestCase.IterateResult.STOP;
+};
+
+es3fTextureFormatTests.genTestCases = function() {
+ var state = tcuTestCase.runner;
+ state.setRoot(tcuTestCase.newTest('texture_format', 'Top level'));
+
+ var texFormats = [
+ ['alpha', gl.ALPHA, gl.UNSIGNED_BYTE],
+ ['luminance', gl.LUMINANCE, gl.UNSIGNED_BYTE],
+ ['luminance_alpha', gl.LUMINANCE_ALPHA, gl.UNSIGNED_BYTE],
+ ['rgb_unsigned_short_5_6_5', gl.RGB, gl.UNSIGNED_SHORT_5_6_5],
+ ['rgb_unsigned_byte', gl.RGB, gl.UNSIGNED_BYTE],
+ ['rgba_unsigned_short_4_4_4_4', gl.RGBA, gl.UNSIGNED_SHORT_4_4_4_4],
+ ['rgba_unsigned_short_5_5_5_1', gl.RGBA, gl.UNSIGNED_SHORT_5_5_5_1],
+ ['rgba_unsigned_byte', gl.RGBA, gl.UNSIGNED_BYTE]
+ ];
+
+ var unsized2DGroup = tcuTestCase.newTest('unsized', 'Unsized formats (2D, Cubemap)');
+ state.testCases.addChild(unsized2DGroup);
+ var unsized2DArrayGroup = tcuTestCase.newTest('unsized', 'Unsized formats (2D Array)');
+ state.testCases.addChild(unsized2DArrayGroup);
+ var unsized3DGroup = tcuTestCase.newTest('unsized', 'Unsized formats (3D)');
+ state.testCases.addChild(unsized3DGroup);
+
+ texFormats.forEach(function(elem) {
+ var format = elem[1];
+ var dataType = elem[2];
+ var nameBase = elem[0];
+ var descriptionBase = gluStrUtil.getPixelFormatName(format) + ', ' + gluStrUtil.getTypeName(dataType);
+ unsized2DGroup.addChild(new es3fTextureFormatTests.Texture2DFormatCase({
+ name: nameBase + '_2d_pot',
+ description: descriptionBase + ' gl.TEXTURE_2D',
+ format: format,
+ dataType: dataType,
+ width: 128,
+ height: 128
+ }));
+ unsized2DGroup.addChild(new es3fTextureFormatTests.Texture2DFormatCase({
+ name: nameBase + '_2d_npot',
+ description: descriptionBase + ' gl.TEXTURE_2D',
+ format: format,
+ dataType: dataType,
+ width: 63,
+ height: 112
+ }));
+ unsized2DGroup.addChild(new es3fTextureFormatTests.TextureCubeFormatCase({
+ name: nameBase + '_cube_pot',
+ description: descriptionBase + ' gl.TEXTURE_CUBE_MAP',
+ format: format,
+ dataType: dataType,
+ width: 64,
+ height: 64
+ }));
+ unsized2DGroup.addChild(new es3fTextureFormatTests.TextureCubeFormatCase({
+ name: nameBase + '_cube_npot',
+ description: descriptionBase + ' gl.TEXTURE_CUBE_MAP',
+ format: format,
+ dataType: dataType,
+ width: 57,
+ height: 57
+ }));
+ unsized2DArrayGroup.addChild(new es3fTextureFormatTests.Texture2DArrayFormatCase({
+ name: nameBase + '_2d_array_pot',
+ description: descriptionBase + ' gl.TEXTURE_2D_ARRAY',
+ format: format,
+ dataType: dataType,
+ width: 64,
+ height: 64,
+ numLayers: 8
+ }));
+ unsized2DArrayGroup.addChild(new es3fTextureFormatTests.Texture2DArrayFormatCase({
+ name: nameBase + '_2d_array_npot',
+ description: descriptionBase + ' gl.TEXTURE_2D_ARRAY',
+ format: format,
+ dataType: dataType,
+ width: 63,
+ height: 57,
+ numLayers: 7
+ }));
+ unsized3DGroup.addChild(new es3fTextureFormatTests.Texture3DFormatCase({
+ name: nameBase + '_3d_pot',
+ description: descriptionBase + ' gl.TEXTURE_3D',
+ format: format,
+ dataType: dataType,
+ width: 8,
+ height: 32,
+ depth: 16
+ }));
+ unsized3DGroup.addChild(new es3fTextureFormatTests.Texture3DFormatCase({
+ name: nameBase + '_3d_npot',
+ description: descriptionBase + ' gl.TEXTURE_3D',
+ format: format,
+ dataType: dataType,
+ width: 11,
+ height: 31,
+ depth: 7
+ }));
+ });
+
+ var sizedColorFormats = [
+ ['rgba32f', gl.RGBA32F],
+ ['rgba32i', gl.RGBA32I],
+ ['rgba32ui', gl.RGBA32UI],
+ ['rgba16f', gl.RGBA16F],
+ ['rgba16i', gl.RGBA16I],
+ ['rgba16ui', gl.RGBA16UI],
+ ['rgba8', gl.RGBA8],
+ ['rgba8i', gl.RGBA8I],
+ ['rgba8ui', gl.RGBA8UI],
+ ['srgb8_alpha8', gl.SRGB8_ALPHA8],
+ ['rgb10_a2', gl.RGB10_A2],
+ ['rgb10_a2ui', gl.RGB10_A2UI],
+ ['rgba4', gl.RGBA4],
+ ['rgb5_a1', gl.RGB5_A1],
+ ['rgba8_snorm', gl.RGBA8_SNORM],
+ ['rgb8', gl.RGB8],
+ ['rgb565', gl.RGB565],
+ ['r11f_g11f_b10f', gl.R11F_G11F_B10F],
+ ['rgb32f', gl.RGB32F],
+ ['rgb32i', gl.RGB32I],
+ ['rgb32ui', gl.RGB32UI],
+ ['rgb16f', gl.RGB16F],
+ ['rgb16i', gl.RGB16I],
+ ['rgb16ui', gl.RGB16UI],
+ ['rgb8_snorm', gl.RGB8_SNORM],
+ ['rgb8i', gl.RGB8I],
+ ['rgb8ui', gl.RGB8UI],
+ ['srgb8', gl.SRGB8],
+ ['rgb9_e5', gl.RGB9_E5],
+ ['rg32f', gl.RG32F],
+ ['rg32i', gl.RG32I],
+ ['rg32ui', gl.RG32UI],
+ ['rg16f', gl.RG16F],
+ ['rg16i', gl.RG16I],
+ ['rg16ui', gl.RG16UI],
+ ['rg8', gl.RG8],
+ ['rg8i', gl.RG8I],
+ ['rg8ui', gl.RG8UI],
+ ['rg8_snorm', gl.RG8_SNORM],
+ ['r32f', gl.R32F],
+ ['r32i', gl.R32I],
+ ['r32ui', gl.R32UI],
+ ['r16f', gl.R16F],
+ ['r16i', gl.R16I],
+ ['r16ui', gl.R16UI],
+ ['r8', gl.R8],
+ ['r8i', gl.R8I],
+ ['r8ui', gl.R8UI],
+ ['r8_snorm', gl.R8_SNORM]
+ ];
+
+ var splitSizedColorTests = 4;
+ var sizedColor2DPOTGroup = [];
+ for (var ii = 0; ii < splitSizedColorTests; ++ii) {
+ sizedColor2DPOTGroup.push(tcuTestCase.newTest('sized', 'Sized formats (2D POT)'));
+ state.testCases.addChild(sizedColor2DPOTGroup[ii]);
+ }
+ var sizedColor2DNPOTGroup = [];
+ for (var ii = 0; ii < splitSizedColorTests; ++ii) {
+ sizedColor2DNPOTGroup.push(tcuTestCase.newTest('sized', 'Sized formats (2D NPOT)'));
+ state.testCases.addChild(sizedColor2DNPOTGroup[ii]);
+ }
+ var sizedColorCubePOTGroup = [];
+ for (var ii = 0; ii < splitSizedColorTests; ++ii) {
+ sizedColorCubePOTGroup.push(tcuTestCase.newTest('sized', 'Sized formats (Cubemap POT)'));
+ state.testCases.addChild(sizedColorCubePOTGroup[ii]);
+ }
+ var sizedColorCubeNPOTGroup = [];
+ for (var ii = 0; ii < splitSizedColorTests; ++ii) {
+ sizedColorCubeNPOTGroup.push(tcuTestCase.newTest('sized', 'Sized formats (Cubemap NPOT)'));
+ state.testCases.addChild(sizedColorCubeNPOTGroup[ii]);
+ }
+ var sizedColor2DArrayPOTGroup = [];
+ for (var ii = 0; ii < splitSizedColorTests; ++ii) {
+ sizedColor2DArrayPOTGroup.push(tcuTestCase.newTest('sized', 'Sized formats (2D Array POT)'));
+ state.testCases.addChild(sizedColor2DArrayPOTGroup[ii]);
+ }
+ var sizedColor2DArrayNPOTGroup = [];
+ for (var ii = 0; ii < splitSizedColorTests; ++ii) {
+ sizedColor2DArrayNPOTGroup.push(tcuTestCase.newTest('sized', 'Sized formats (2D Array NPOT)'));
+ state.testCases.addChild(sizedColor2DArrayNPOTGroup[ii]);
+ }
+ var sizedColor3DPOTGroup = [];
+ for (var ii = 0; ii < splitSizedColorTests; ++ii) {
+ sizedColor3DPOTGroup.push(tcuTestCase.newTest('sized', 'Sized formats (3D POT)'));
+ state.testCases.addChild(sizedColor3DPOTGroup[ii]);
+ }
+ var sizedColor3DNPOTGroup = [];
+ for (var ii = 0; ii < splitSizedColorTests; ++ii) {
+ sizedColor3DNPOTGroup.push(tcuTestCase.newTest('sized', 'Sized formats (3D NPOT)'));
+ state.testCases.addChild(sizedColor3DNPOTGroup[ii]);
+ }
+
+ for (var ii = 0; ii < sizedColorFormats.length; ++ii) {
+ var internalFormat = sizedColorFormats[ii][1];
+ var nameBase = sizedColorFormats[ii][0];
+ var descriptionBase = gluStrUtil.getPixelFormatName(internalFormat);
+ sizedColor2DPOTGroup[ii % splitSizedColorTests].addChild(new es3fTextureFormatTests.Texture2DFormatCase({
+ name: nameBase + '_pot',
+ description: descriptionBase + ' gl.TEXTURE_2D',
+ format: internalFormat,
+ width: 128,
+ height: 128
+ }));
+ sizedColor2DNPOTGroup[ii % splitSizedColorTests].addChild(new es3fTextureFormatTests.Texture2DFormatCase({
+ name: nameBase + '_npot',
+ description: descriptionBase + ' gl.TEXTURE_2D',
+ format: internalFormat,
+ width: 63,
+ height: 112
+ }));
+ sizedColorCubePOTGroup[ii % splitSizedColorTests].addChild(new es3fTextureFormatTests.TextureCubeFormatCase({
+ name: nameBase + '_pot',
+ description: descriptionBase + ' gl.TEXTURE_CUBE_MAP',
+ format: internalFormat,
+ width: 64,
+ height: 64
+ }));
+ sizedColorCubeNPOTGroup[ii % splitSizedColorTests].addChild(new es3fTextureFormatTests.TextureCubeFormatCase({
+ name: nameBase + '_npot',
+ description: descriptionBase + ' gl.TEXTURE_CUBE_MAP',
+ format: internalFormat,
+ width: 57,
+ height: 57
+ }));
+ sizedColor2DArrayPOTGroup[ii % splitSizedColorTests].addChild(new es3fTextureFormatTests.Texture2DArrayFormatCase({
+ name: nameBase + '_pot',
+ description: descriptionBase + ' gl.TEXTURE_2D_ARRAY',
+ format: internalFormat,
+ width: 64,
+ height: 64,
+ numLayers: 8
+
+ }));
+ sizedColor2DArrayNPOTGroup[ii % splitSizedColorTests].addChild(new es3fTextureFormatTests.Texture2DArrayFormatCase({
+ name: nameBase + '_npot',
+ description: descriptionBase + ' gl.TEXTURE_2D_ARRAY',
+ format: internalFormat,
+ width: 63,
+ height: 57,
+ numLayers: 7
+ }));
+ sizedColor3DPOTGroup[ii % splitSizedColorTests].addChild(new es3fTextureFormatTests.Texture3DFormatCase({
+ name: nameBase + '_pot',
+ description: descriptionBase + ' gl.TEXTURE_3D',
+ format: internalFormat,
+ width: 8,
+ height: 32,
+ depth: 16
+ }));
+ sizedColor3DNPOTGroup[ii % splitSizedColorTests].addChild(new es3fTextureFormatTests.Texture3DFormatCase({
+ name: nameBase + '_npot',
+ description: descriptionBase + ' gl.TEXTURE_3D',
+ format: internalFormat,
+ width: 11,
+ height: 31,
+ depth: 7
+ }));
+ }
+
+ var sizedDepthStencilFormats = [
+ // Depth and stencil formats
+ ['depth_component32f', gl.DEPTH_COMPONENT32F],
+ ['depth_component24', gl.DEPTH_COMPONENT24],
+ ['depth_component16', gl.DEPTH_COMPONENT16],
+ // The following format is restricted in WebGL2.
+ // ['depth32f_stencil8', gl.DEPTH32F_STENCIL8],
+ ['depth24_stencil8', gl.DEPTH24_STENCIL8]
+ ];
+ var sizedDepthStencilGroup = tcuTestCase.newTest('sized', 'Sized formats (Depth Stencil)');
+ state.testCases.addChild(sizedDepthStencilGroup);
+ sizedDepthStencilFormats.forEach(function(elem) {
+ var internalFormat = elem[1];
+ var nameBase = elem[0];
+ var descriptionBase = gluStrUtil.getPixelFormatName(internalFormat);
+ sizedDepthStencilGroup.addChild(new es3fTextureFormatTests.Texture2DFormatCase({
+ name: nameBase + '_pot',
+ description: descriptionBase + ' gl.TEXTURE_2D',
+ format: internalFormat,
+ width: 128,
+ height: 128
+ }));
+ sizedDepthStencilGroup.addChild(new es3fTextureFormatTests.Texture2DFormatCase({
+ name: nameBase + '_npot',
+ description: descriptionBase + ' gl.TEXTURE_2D',
+ format: internalFormat,
+ width: 63,
+ height: 112
+ }));
+ sizedDepthStencilGroup.addChild(new es3fTextureFormatTests.TextureCubeFormatCase({
+ name: nameBase + '_pot',
+ description: descriptionBase + ' gl.TEXTURE_CUBE_MAP',
+ format: internalFormat,
+ width: 64,
+ height: 64
+ }));
+ sizedDepthStencilGroup.addChild(new es3fTextureFormatTests.TextureCubeFormatCase({
+ name: nameBase + '_npot',
+ description: descriptionBase + ' gl.TEXTURE_CUBE_MAP',
+ format: internalFormat,
+ width: 57,
+ height: 57
+ }));
+ sizedDepthStencilGroup.addChild(new es3fTextureFormatTests.Texture2DArrayFormatCase({
+ name: nameBase + '_pot',
+ description: descriptionBase + ' gl.TEXTURE_2D_ARRAY',
+ format: internalFormat,
+ width: 64,
+ height: 64,
+ numLayers: 8
+ }));
+ sizedDepthStencilGroup.addChild(new es3fTextureFormatTests.Texture2DArrayFormatCase({
+ name: nameBase + '_npot',
+ description: descriptionBase + ' gl.TEXTURE_2D_ARRAY',
+ format: internalFormat,
+ width: 63,
+ height: 57,
+ numLayers: 7
+ }));
+ });
+
+ var compressed2DGroup = tcuTestCase.newTest('compressed', 'Compressed formats (2D)');
+ state.testCases.addChild(compressed2DGroup);
+ var compressedCubeGroup = tcuTestCase.newTest('compressed', 'Compressed formats (Cubemap)');
+ state.testCases.addChild(compressedCubeGroup);
+ var etc2Formats = [
+ ['gl.COMPRESSED_R11_EAC', 'eac_r11', tcuCompressedTexture.Format.EAC_R11],
+ ['gl.COMPRESSED_SIGNED_R11_EAC', 'eac_signed_r11', tcuCompressedTexture.Format.EAC_SIGNED_R11],
+ ['gl.COMPRESSED_RG11_EAC', 'eac_rg11', tcuCompressedTexture.Format.EAC_RG11],
+ ['gl.COMPRESSED_SIGNED_RG11_EAC', 'eac_signed_rg11', tcuCompressedTexture.Format.EAC_SIGNED_RG11],
+ ['gl.COMPRESSED_RGB8_ETC2', 'etc2_rgb8', tcuCompressedTexture.Format.ETC2_RGB8],
+ ['gl.COMPRESSED_SRGB8_ETC2', 'etc2_srgb8', tcuCompressedTexture.Format.ETC2_SRGB8],
+ ['gl.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2', 'etc2_rgb8_punchthrough_alpha1', tcuCompressedTexture.Format.ETC2_RGB8_PUNCHTHROUGH_ALPHA1],
+ ['gl.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2', 'etc2_srgb8_punchthrough_alpha1', tcuCompressedTexture.Format.ETC2_SRGB8_PUNCHTHROUGH_ALPHA1],
+ ['gl.COMPRESSED_RGBA8_ETC2_EAC', 'etc2_eac_rgba8', tcuCompressedTexture.Format.ETC2_EAC_RGBA8],
+ ['gl.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC', 'etc2_eac_srgb8_alpha8', tcuCompressedTexture.Format.ETC2_EAC_SRGB8_ALPHA8]
+ ];
+ if (!gluTextureUtil.enableCompressedTextureETC()) {
+ debug('Skipping ETC2/EAC texture format tests: no support for WEBGL_compressed_texture_etc');
+ etc2Formats = [];
+ }
+ etc2Formats.forEach(function(elem) {
+ var nameBase = elem[1];
+ var descriptionBase = elem[0];
+ var format = elem[2];
+ compressed2DGroup.addChild(new es3fTextureFormatTests.Compressed2DFormatCase({
+ name: nameBase + '_2d_pot',
+ description: descriptionBase + ', gl.TEXTURE_2D',
+ format: format,
+ width: 128,
+ height: 64
+ }));
+ compressedCubeGroup.addChild(new es3fTextureFormatTests.CompressedCubeFormatCase({
+ name: nameBase + '_cube_pot',
+ description: descriptionBase + ', gl.TEXTURE_CUBE_MAP',
+ format: format,
+ width: 64,
+ height: 64
+ }));
+ compressed2DGroup.addChild(new es3fTextureFormatTests.Compressed2DFormatCase({
+ name: nameBase + '_2d_pot',
+ description: descriptionBase + ', gl.TEXTURE_2D',
+ format: format,
+ width: 128,
+ height: 64
+ }));
+ compressedCubeGroup.addChild(new es3fTextureFormatTests.CompressedCubeFormatCase({
+ name: nameBase + '_cube_npot',
+ description: descriptionBase + ', gl.TEXTURE_CUBE_MAP',
+ format: format,
+ width: 51,
+ height: 51
+ }));
+ });
+};
+
+/**
+ * Create and execute the test cases
+ */
+es3fTextureFormatTests.run = function(context, range) {
+ gl = context;
+ var state = tcuTestCase.runner;
+ try {
+ es3fTextureFormatTests.genTestCases();
+ if (range)
+ state.setRange(range);
+ state.runCallback(tcuTestCase.runTestCases);
+ } catch (err) {
+ bufferedLogToConsole(err);
+ state.terminate();
+ }
+
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureShadowTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureShadowTests.js
new file mode 100644
index 0000000000..c878228b23
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureShadowTests.js
@@ -0,0 +1,898 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+'use strict';
+goog.provide('functional.gles3.es3fTextureShadowTests');
+goog.require('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuLogImage');
+goog.require('framework.common.tcuPixelFormat');
+goog.require('framework.common.tcuRGBA');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.common.tcuTexCompareVerifier');
+goog.require('framework.common.tcuTexLookupVerifier');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.delibs.debase.deUtil');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluTexture');
+goog.require('framework.opengl.gluTextureUtil');
+goog.require('framework.referencerenderer.rrMultisamplePixelBufferAccess');
+goog.require('modules.shared.glsTextureTestUtil');
+
+goog.scope(function() {
+
+var es3fTextureShadowTests = functional.gles3.es3fTextureShadowTests;
+var tcuTestCase = framework.common.tcuTestCase;
+var glsTextureTestUtil = modules.shared.glsTextureTestUtil;
+var gluShaderUtil = framework.opengl.gluShaderUtil;
+var gluTexture = framework.opengl.gluTexture;
+var gluTextureUtil = framework.opengl.gluTextureUtil;
+var tcuTexture = framework.common.tcuTexture;
+var tcuImageCompare = framework.common.tcuImageCompare;
+var tcuLogImage = framework.common.tcuLogImage;
+var tcuTextureUtil = framework.common.tcuTextureUtil;
+var tcuRGBA = framework.common.tcuRGBA;
+var deMath = framework.delibs.debase.deMath;
+var tcuPixelFormat = framework.common.tcuPixelFormat;
+var tcuSurface = framework.common.tcuSurface;
+var tcuTexCompareVerifier = framework.common.tcuTexCompareVerifier;
+var tcuTexLookupVerifier = framework.common.tcuTexLookupVerifier;
+var rrMultisamplePixelBufferAccess = framework.referencerenderer.rrMultisamplePixelBufferAccess;
+var deString = framework.delibs.debase.deString;
+var deUtil = framework.delibs.debase.deUtil;
+
+ es3fTextureShadowTests.version = '300 es';
+
+ /** @const */ var VIEWPORT_WIDTH = 64;
+ /** @const */ var VIEWPORT_HEIGHT = 64;
+ /** @const */ var MIN_VIEWPORT_WIDTH = 64;
+ /** @const */ var MIN_VIEWPORT_HEIGHT = 64;
+
+ var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+ };
+
+ /**
+ * @param {tcuTexture.TextureFormat} format
+ * @return {boolean}
+ */
+ es3fTextureShadowTests.isFloatingPointDepthFormat = function(format) {
+ // Only two depth and depth-stencil formats are floating point
+ return (format.order == tcuTexture.ChannelOrder.D && format.type == tcuTexture.ChannelType.FLOAT) || (format.order == tcuTexture.ChannelOrder.DS && format.type == tcuTexture.ChannelType.FLOAT_UNSIGNED_INT_24_8_REV);
+ };
+
+ /**
+ * @param {tcuTexture.PixelBufferAccess} access
+ */
+ es3fTextureShadowTests.clampFloatingPointTexture = function(access) {
+ DE_ASSERT(es3fTextureShadowTests.isFloatingPointDepthFormat(access.getFormat()));
+ for (var z = 0; z < access.getDepth(); ++z)
+ for (var y = 0; y < access.getHeight(); ++y)
+ for (var x = 0; x < access.getWidth(); ++x)
+ access.setPixDepth(deMath.clamp(access.getPixDepth(x, y, z), 0.0, 1.0), x, y, z);
+ };
+
+ /**
+ * @param {tcuTexture.Texture2D|tcuTexture.Texture2DArray} target
+ */
+ es3fTextureShadowTests.clampFloatingPointTexture2D = function(target) {
+ for (var level = 0; level < target.getNumLevels(); ++level)
+ if (!target.isLevelEmpty(level))
+ es3fTextureShadowTests.clampFloatingPointTexture(target.getLevel(level));
+ };
+
+ /**
+ * @param {tcuTexture.TextureCube} target
+ */
+ es3fTextureShadowTests.clampFloatingPointTextureCube = function(target) {
+ for (var level = 0; level < target.getNumLevels(); ++level)
+ for (var face = tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X; face < Object.keys(tcuTexture.CubeFace).length; face++)
+ es3fTextureShadowTests.clampFloatingPointTexture(target.getLevelFace(level, face));
+ };
+
+ /**
+ * @param {?} textureType
+ * @param {tcuTexture.ConstPixelBufferAccess} result
+ * @param {tcuTexture.Texture2D|tcuTexture.Texture2DArray|tcuTexture.TextureCube} src
+ * @param {Array<number>} texCoord
+ * @param {glsTextureTestUtil.ReferenceParams} sampleParams
+ * @param {tcuTexCompareVerifier.TexComparePrecision} comparePrec
+ * @param {tcuTexLookupVerifier.LodPrecision} lodPrecision
+ * @param {tcuPixelFormat.PixelFormat} pixelFormat
+ */
+ es3fTextureShadowTests.verifyTexCompareResult = function(textureType, result, src, texCoord, sampleParams, comparePrec, lodPrecision, pixelFormat) {
+ var reference = new tcuSurface.Surface(result.getWidth(), result.getHeight());
+ var errorMask = new tcuSurface.Surface(result.getWidth(), result.getHeight());
+ var nonShadowThreshold = deMath.swizzle(tcuTexLookupVerifier.computeFixedPointThreshold(deMath.subtract(glsTextureTestUtil.getBitsVec(pixelFormat), [1, 1, 1, 1])), [1, 2, 3]);
+ var numFailedPixels;
+
+ if (es3fTextureShadowTests.isFloatingPointDepthFormat(src.getFormat())) {
+ var clampedSource = /*deUtil.clone(*/src/*)*/;
+
+ if (textureType == tcuTexture.Texture2D) {
+ es3fTextureShadowTests.clampFloatingPointTexture2D(/** @type {tcuTexture.Texture2D} */(clampedSource));
+ glsTextureTestUtil.sampleTexture2D(new glsTextureTestUtil.SurfaceAccess(reference, pixelFormat), /** @type {tcuTexture.Texture2DView} */ (clampedSource.getView()), texCoord, sampleParams);
+ // sample clamped values
+ numFailedPixels = glsTextureTestUtil.computeTextureCompareDiff2D(result, reference.getAccess(), errorMask.getAccess(), /** @type {tcuTexture.Texture2DView} */ (clampedSource.getView()), texCoord, sampleParams, comparePrec, lodPrecision, nonShadowThreshold);
+ } else if (textureType == tcuTexture.Texture2DArray) {
+ es3fTextureShadowTests.clampFloatingPointTexture2D(/** @type {tcuTexture.Texture2DArray} */(clampedSource));
+ glsTextureTestUtil.sampleTexture2DArray(new glsTextureTestUtil.SurfaceAccess(reference, pixelFormat), /** @type {tcuTexture.Texture2DArrayView} */ (clampedSource.getView()), texCoord, sampleParams);
+ // sample clamped values
+ numFailedPixels = glsTextureTestUtil.computeTextureCompareDiff2DArray(result, reference.getAccess(), errorMask.getAccess(), /** @type {tcuTexture.Texture2DArrayView} */ (clampedSource.getView()), texCoord, sampleParams, comparePrec, lodPrecision, nonShadowThreshold);
+ } else if (textureType == tcuTexture.TextureCube) {
+ es3fTextureShadowTests.clampFloatingPointTextureCube(/** @type {tcuTexture.TextureCube} */(clampedSource));
+ glsTextureTestUtil.sampleTextureCube(new glsTextureTestUtil.SurfaceAccess(reference, pixelFormat), /** @type {tcuTexture.TextureCubeView} */ (clampedSource.getView()), texCoord, sampleParams);
+ // sample clamped values
+ numFailedPixels = glsTextureTestUtil.computeTextureCompareDiffCube(result, reference.getAccess(), errorMask.getAccess(), /** @type {tcuTexture.TextureCubeView} */ (clampedSource.getView()), texCoord, sampleParams, comparePrec, lodPrecision, nonShadowThreshold);
+ } else
+ throw new Error('Invalid texture type');
+
+ } else {
+ if (textureType == tcuTexture.Texture2D) {
+ glsTextureTestUtil.sampleTexture2D(new glsTextureTestUtil.SurfaceAccess(reference, pixelFormat), /** @type {tcuTexture.Texture2DView} */ (src.getView()), texCoord, sampleParams);
+ // sample raw values (they are guaranteed to be in [0, 1] range as the format cannot represent any other values)
+ numFailedPixels = glsTextureTestUtil.computeTextureCompareDiff2D(result, reference.getAccess(), errorMask.getAccess(), /** @type {tcuTexture.Texture2DView} */ (src.getView()), texCoord, sampleParams, comparePrec, lodPrecision, nonShadowThreshold);
+ } else if (textureType == tcuTexture.Texture2DArray) {
+ glsTextureTestUtil.sampleTexture2DArray(new glsTextureTestUtil.SurfaceAccess(reference, pixelFormat), /** @type {tcuTexture.Texture2DArrayView} */ (src.getView()), texCoord, sampleParams);
+ // sample raw values (they are guaranteed to be in [0, 1] range as the format cannot represent any other values)
+ numFailedPixels = glsTextureTestUtil.computeTextureCompareDiff2DArray(result, reference.getAccess(), errorMask.getAccess(), /** @type {tcuTexture.Texture2DArrayView} */ (src.getView()), texCoord, sampleParams, comparePrec, lodPrecision, nonShadowThreshold);
+ } else if (textureType == tcuTexture.TextureCube) {
+ glsTextureTestUtil.sampleTextureCube(new glsTextureTestUtil.SurfaceAccess(reference, pixelFormat), /** @type {tcuTexture.TextureCubeView} */ (src.getView()), texCoord, sampleParams);
+ // sample raw values (they are guaranteed to be in [0, 1] range as the format cannot represent any other values)
+ numFailedPixels = glsTextureTestUtil.computeTextureCompareDiffCube(result, reference.getAccess(), errorMask.getAccess(), /** @type {tcuTexture.TextureCubeView} */ (src.getView()), texCoord, sampleParams, comparePrec, lodPrecision, nonShadowThreshold);
+ } else
+ throw new Error('Invalid texture type');
+ }
+
+ if (numFailedPixels > 0)
+ bufferedLogToConsole('ERROR: Result verification failed, got ' + numFailedPixels + ' invalid pixels!');
+
+ if (numFailedPixels > 0)
+ tcuImageCompare.displayImages(result, reference.getAccess(), errorMask.getAccess());
+ else
+ tcuLogImage.logImageWithInfo(result, 'Result');
+
+ return numFailedPixels == 0;
+
+ };
+
+ /**
+ * @constructor
+ * @param {string} name
+ * @param {number} format
+ * @struct
+ */
+ es3fTextureShadowTests.Format = function(name, format) {
+ /** @type {string} */ this.name = name;
+ /** @type {number} */ this.format = format;
+ };
+
+ /**
+ * @constructor
+ * @param {string} name
+ * @param {number} minFilter
+ * @param {number} magFilter
+ * @struct
+ */
+ es3fTextureShadowTests.Filter = function(name, minFilter, magFilter) {
+ /** @type {string} */ this.name = name;
+ /** @type {number} */ this.minFilter = minFilter;
+ /** @type {number} */ this.magFilter = magFilter;
+ };
+
+ /**
+ * @constructor
+ * @param {string} name
+ * @param {number} func
+ * @struct
+ */
+ es3fTextureShadowTests.CompareFunc = function(name, func) {
+ /** @type {string} */ this.name = name;
+ /** @type {number} */ this.func = func;
+ };
+
+ /**
+ * @constructor
+ * @param {number} texNdx
+ * @param {number} ref
+ * @param {number} lodX
+ * @param {number} lodY
+ * @param {number} oX
+ * @param {number} oY
+ * @struct
+ */
+ es3fTextureShadowTests.TestCase = function(texNdx, ref, lodX, lodY, oX, oY) {
+ /** @type {number} */ this.texNdx = texNdx;
+ /** @type {number} */ this.ref = ref;
+ /** @type {number} */ this.lodX = lodX;
+ /** @type {number} */ this.lodY = lodY;
+ /** @type {number} */ this.oX = oX
+ /** @type {number} */ this.oY = oY;
+ };
+
+ /**
+ * @constructor
+ * @param {?gluTexture.Texture2D|?gluTexture.TextureCube|?gluTexture.Texture2DArray} tex
+ * @param {number} ref
+ * @param {Array<number>} minCoord
+ * @param {Array<number>} maxCoord
+ * @struct
+ */
+ es3fTextureShadowTests.FilterCase = function(tex, ref, minCoord, maxCoord) {
+ /** @type {?gluTexture.Texture2D|?gluTexture.TextureCube|?gluTexture.Texture2DArray} */ this.texture = tex;
+ /** @type {Array<number>} */ this.minCoord = minCoord;
+ /** @type {Array<number>} */ this.maxCoord = maxCoord;
+ /** @type {number} */ this.ref = ref;
+ };
+
+ /**
+ * @constructor
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} minFilter
+ * @param {number} magFilter
+ * @param {number} wrapS
+ * @param {number} wrapT
+ * @param {number} format
+ * @param {number} width
+ * @param {number} height
+ * @param {number} compareFunc
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fTextureShadowTests.Texture2DShadowCase = function(name, desc, minFilter, magFilter, wrapS, wrapT, format, width, height, compareFunc) {
+ tcuTestCase.DeqpTest.call(this, name, desc);
+ this.m_minFilter = minFilter;
+ this.m_magFilter = magFilter;
+ this.m_wrapS = wrapS;
+ this.m_wrapT = wrapT;
+ this.m_format = format;
+ this.m_width = width;
+ this.m_height = height;
+ this.m_compareFunc = compareFunc;
+ this.m_renderer = new glsTextureTestUtil.TextureRenderer(es3fTextureShadowTests.version, gluShaderUtil.precision.PRECISION_HIGHP);
+ this.m_caseNdx = 0;
+ this.m_cases = [];
+ };
+
+ es3fTextureShadowTests.Texture2DShadowCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fTextureShadowTests.Texture2DShadowCase.prototype.constructor = es3fTextureShadowTests.Texture2DShadowCase;
+
+ es3fTextureShadowTests.Texture2DShadowCase.prototype.init = function() {
+
+ // Create 2 textures.
+ this.m_textures = [];
+ this.m_textures[0] = gluTexture.texture2DFromInternalFormat(gl, this.m_format, this.m_width, this.m_height);
+ this.m_textures[1] = gluTexture.texture2DFromInternalFormat(gl, this.m_format, this.m_width, this.m_height);
+
+ var numLevels = this.m_textures[0].getRefTexture().getNumLevels();
+
+ for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) {
+ this.m_textures[0].getRefTexture().allocLevel(levelNdx);
+ tcuTextureUtil.fillWithComponentGradients(this.m_textures[0].getRefTexture().getLevel(levelNdx), [-0.5, -0.5, -0.5, 2.0], [1, 1, 1, 0]);
+ }
+
+ for (levelNdx = 0; levelNdx < numLevels; levelNdx++) {
+ var step = 0x00ffffff / numLevels;
+ var rgb = step * levelNdx;
+ var colorA = 0xff000000 | rgb;
+ var colorB = 0xff000000 | ~rgb;
+
+ this.m_textures[1].getRefTexture().allocLevel(levelNdx);
+ tcuTextureUtil.fillWithGrid(this.m_textures[1].getRefTexture().getLevel(levelNdx), 4, tcuRGBA.newRGBAFromValue(colorA).toVec(), tcuRGBA.newRGBAFromValue(colorB).toVec());
+ }
+
+ for (var i = 0; i < this.m_textures.length; i++)
+ this.m_textures[i].upload();
+
+ var refInRangeUpper = (this.m_compareFunc == gl.EQUAL || this.m_compareFunc == gl.NOTEQUAL) ? 1.0 : 0.5;
+ var refInRangeLower = (this.m_compareFunc == gl.EQUAL || this.m_compareFunc == gl.NOTEQUAL) ? 0.0 : 0.5;
+
+ var refOutOfBoundsUpper = 1.1;
+ var refOutOfBoundsLower = -0.1;
+
+ numLevels = this.m_textures[0].getRefTexture().getNumLevels();
+
+ var cases = [];
+ cases.push(new es3fTextureShadowTests.TestCase(0, refInRangeUpper, 1.6, 2.9, -1.0, -2.7));
+ cases.push(new es3fTextureShadowTests.TestCase(0, refInRangeLower, -2.0, -1.35, -0.2, 0.7));
+ cases.push(new es3fTextureShadowTests.TestCase(1, refInRangeUpper, 0.14, 0.275, -1.5, -1.1));
+ cases.push(new es3fTextureShadowTests.TestCase(1, refInRangeLower, -0.92, -2.64, 0.4, -0.1));
+ cases.push(new es3fTextureShadowTests.TestCase(1, refOutOfBoundsUpper, -0.39, -0.52, 0.65, 0.87));
+ cases.push(new es3fTextureShadowTests.TestCase(1, refOutOfBoundsLower, -1.55, 0.65, 0.35, 0.91));
+
+ var viewportW = Math.min(VIEWPORT_WIDTH, gl.canvas.width);
+ var viewportH = Math.min(VIEWPORT_HEIGHT, gl.canvas.height);
+
+ for (var caseNdx = 0; caseNdx < cases.length; caseNdx++) {
+ var texNdx = deMath.clamp(cases[caseNdx].texNdx, 0, this.m_textures.length - 1);
+ var ref = cases[caseNdx].ref;
+ var lodX = cases[caseNdx].lodX;
+ var lodY = cases[caseNdx].lodY;
+ var oX = cases[caseNdx].oX;
+ var oY = cases[caseNdx].oY;
+ var sX = Math.exp(lodX * Math.log(2)) * viewportW / this.m_textures[texNdx].getRefTexture().getWidth();
+ var sY = Math.exp(lodY * Math.log(2)) * viewportH / this.m_textures[texNdx].getRefTexture().getHeight();
+
+ this.m_cases.push(new es3fTextureShadowTests.FilterCase(this.m_textures[texNdx], ref, [oX, oY], [oX + sX, oY + sY]));
+ }
+
+ this.m_caseNdx = 0;
+ };
+
+ es3fTextureShadowTests.Texture2DShadowCase.prototype.iterate = function() {
+
+ var viewport = new glsTextureTestUtil.RandomViewport(document.getElementById('canvas'), VIEWPORT_WIDTH, VIEWPORT_HEIGHT);
+ var curCase = this.m_cases[this.m_caseNdx];
+ var sampleParams = new glsTextureTestUtil.ReferenceParams(glsTextureTestUtil.textureType.TEXTURETYPE_2D);
+ var rendered = new tcuSurface.Surface(viewport.width, viewport.height);
+ var texCoord = [];
+
+ if (viewport.width < MIN_VIEWPORT_WIDTH || viewport.height < MIN_VIEWPORT_HEIGHT)
+ throw new Error('Too small render target');
+
+ // Setup params for reference.
+ sampleParams.sampler = gluTextureUtil.mapGLSampler(this.m_wrapS, this.m_wrapT, gl.CLAMP_TO_EDGE, this.m_minFilter, this.m_magFilter);
+ sampleParams.sampler.compare = gluTextureUtil.mapGLCompareFunc(this.m_compareFunc);
+ sampleParams.samplerType = glsTextureTestUtil.samplerType.SAMPLERTYPE_SHADOW;
+ sampleParams.lodMode = glsTextureTestUtil.lodMode.EXACT;
+ sampleParams.ref = curCase.ref;
+
+ bufferedLogToConsole('Compare reference value = ' + sampleParams.ref);
+
+ // Compute texture coordinates.
+ bufferedLogToConsole('Texture coordinates: ' + curCase.minCoord + ' -> ' + curCase.maxCoord);
+
+ texCoord = glsTextureTestUtil.computeQuadTexCoord2D(curCase.minCoord, curCase.maxCoord);
+
+ gl.bindTexture(gl.TEXTURE_2D, curCase.texture.getGLTexture());
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, this.m_minFilter);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, this.m_magFilter);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, this.m_wrapS);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, this.m_wrapT);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_FUNC, this.m_compareFunc);
+
+ gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height);
+ this.m_renderer.renderQuad(0, texCoord, sampleParams);
+ rendered.readViewport(gl, viewport);
+
+
+ var pixelFormat = new tcuPixelFormat.PixelFormat(8, 8, 8, 8);
+ var lodPrecision = new tcuTexLookupVerifier.LodPrecision(18, 6);
+ var texComparePrecision = new tcuTexCompareVerifier.TexComparePrecision([20, 20, 0], [7, 7, 0], 5, 16, pixelFormat.redBits - 1);
+
+ var isHighQuality = es3fTextureShadowTests.verifyTexCompareResult(tcuTexture.Texture2D, rendered.getAccess(), curCase.texture.getRefTexture(),
+ texCoord, sampleParams, texComparePrecision, lodPrecision, pixelFormat);
+
+ if (!isHighQuality) {
+ bufferedLogToConsole('Warning: Verification assuming high-quality PCF filtering failed.');
+
+ lodPrecision.lodBits = 4;
+ texComparePrecision.uvwBits = [4, 4, 0];
+ texComparePrecision.pcfBits = 0;
+
+ var isOk = es3fTextureShadowTests.verifyTexCompareResult(tcuTexture.Texture2D, rendered.getAccess(), curCase.texture.getRefTexture(),
+ texCoord, sampleParams, texComparePrecision, lodPrecision, pixelFormat);
+
+ if (!isOk) {
+ bufferedLogToConsole('ERROR: Verification against low precision requirements failed, failing test case.');
+ testFailedOptions('Image verification failed', false);
+ } else
+ testPassedOptions('Low-quality result', true);
+ } else
+ testPassedOptions('High-quality result', true);
+
+ this.m_caseNdx += 1;
+ return this.m_caseNdx < this.m_cases.length ? tcuTestCase.IterateResult.CONTINUE : tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} minFilter
+ * @param {number} magFilter
+ * @param {number} wrapS
+ * @param {number} wrapT
+ * @param {number} format
+ * @param {number} size
+ * @param {number} compareFunc
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fTextureShadowTests.TextureCubeShadowCase = function(name, desc, minFilter, magFilter, wrapS, wrapT, format, size, compareFunc) {
+ tcuTestCase.DeqpTest.call(this, name, desc);
+ this.m_minFilter = minFilter;
+ this.m_magFilter = magFilter;
+ this.m_wrapS = wrapS;
+ this.m_wrapT = wrapT;
+ this.m_format = format;
+ this.m_size = size;
+ this.m_compareFunc = compareFunc;
+ this.m_renderer = new glsTextureTestUtil.TextureRenderer(es3fTextureShadowTests.version, gluShaderUtil.precision.PRECISION_HIGHP);
+ this.m_caseNdx = 0;
+ this.m_cases = [];
+ };
+
+ es3fTextureShadowTests.TextureCubeShadowCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fTextureShadowTests.TextureCubeShadowCase.prototype.constructor = es3fTextureShadowTests.TextureCubeShadowCase;
+
+ es3fTextureShadowTests.TextureCubeShadowCase.prototype.init = function() {
+ DE_ASSERT(!this.m_gradientTex && !this.m_gridTex);
+
+ var numLevels = Math.floor(Math.log2(this.m_size)) + 1;
+ /** @type {tcuTexture.TextureFormat} */ var texFmt = gluTextureUtil.mapGLInternalFormat(this.m_format);
+ /** @type {tcuTextureUtil.TextureFormatInfo} */ var fmtInfo = tcuTextureUtil.getTextureFormatInfo(texFmt);
+ /** @type {Array<number>} */ var cBias = fmtInfo.valueMin;
+ /** @type {Array<number>} */ var cScale = deMath.subtract(fmtInfo.valueMax, fmtInfo.valueMin);
+
+ // Create textures.
+ this.m_gradientTex = gluTexture.cubeFromInternalFormat(gl, this.m_format, this.m_size);
+ this.m_gridTex = gluTexture.cubeFromInternalFormat(gl, this.m_format, this.m_size);
+
+ // Fill first with gradient texture.
+ var gradients = [[[-1.0, -1.0, -1.0, 2.0], [1.0, 1.0, 1.0, 0.0]], // negative x
+ [[0.0, -1.0, -1.0, 2.0], [1.0, 1.0, 1.0, 0.0]], // positive x
+ [[-1.0, 0.0, -1.0, 2.0], [1.0, 1.0, 1.0, 0.0]], // negative y
+ [[-1.0, -1.0, 0.0, 2.0], [1.0, 1.0, 1.0, 0.0]], // positive y
+ [[-1.0, -1.0, -1.0, 0.0], [1.0, 1.0, 1.0, 1.0]], // negative z
+ [[0.0, 0.0, 0.0, 2.0], [1.0, 1.0, 1.0, 0.0]]]; // positive z
+
+ for (var face in tcuTexture.CubeFace) {
+ for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) {
+ this.m_gradientTex.getRefTexture().allocLevel(tcuTexture.CubeFace[face], levelNdx);
+ tcuTextureUtil.fillWithComponentGradients(this.m_gradientTex.getRefTexture().getLevelFace(levelNdx, tcuTexture.CubeFace[face]), deMath.add(deMath.multiply(gradients[tcuTexture.CubeFace[face]][0], cScale), cBias), deMath.add(deMath.multiply(gradients[tcuTexture.CubeFace[face]][1], cScale), cBias));
+ }
+ }
+
+ // Fill second with grid texture.
+ for (var face in tcuTexture.CubeFace) {
+ for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) {
+ var step = 0x00ffffff / (numLevels * Object.keys(tcuTexture.CubeFace).length);
+ var rgb = step * levelNdx * face;
+ var colorA = 0xff000000 | rgb;
+ var colorB = 0xff000000 | ~rgb;
+
+ this.m_gridTex.getRefTexture().allocLevel(tcuTexture.CubeFace[face], levelNdx);
+ tcuTextureUtil.fillWithGrid(this.m_gridTex.getRefTexture().getLevelFace(levelNdx, tcuTexture.CubeFace[face]), 4, deMath.add(deMath.multiply(tcuRGBA.newRGBAFromValue(colorA).toVec(), cScale), cBias), deMath.add(deMath.multiply(tcuRGBA.newRGBAFromValue(colorB).toVec(), cScale), cBias));
+ }
+ }
+
+ // Upload.
+ this.m_gradientTex.upload();
+ this.m_gridTex.upload();
+
+ var refInRangeUpper = (this.m_compareFunc == gl.EQUAL || this.m_compareFunc == gl.NOTEQUAL) ? 1.0 : 0.5;
+ var refInRangeLower = (this.m_compareFunc == gl.EQUAL || this.m_compareFunc == gl.NOTEQUAL) ? 0.0 : 0.5;
+ var refOutOfBoundsUpper = 1.1;
+ var refOutOfBoundsLower = -0.1;
+ var singleSample = new rrMultisamplePixelBufferAccess.MultisamplePixelBufferAccess().getNumSamples() == 0;
+ //var singleSample = this.m_context.getRenderTarget().getNumSamples() == 0;
+
+ if (singleSample)
+ this.m_cases.push(new es3fTextureShadowTests.FilterCase(this.m_gradientTex, refInRangeUpper, [-1.25, -1.2], [1.2, 1.25])); // minification
+ else
+ this.m_cases.push(new es3fTextureShadowTests.FilterCase(this.m_gradientTex, refInRangeUpper, [-1.19, -1.3], [1.1, 1.35])); // minification - w/ tuned coordinates to avoid hitting triangle edges
+
+ this.m_cases.push(new es3fTextureShadowTests.FilterCase(this.m_gradientTex, refInRangeLower, [0.8, 0.8], [1.25, 1.20])); // magnification
+ this.m_cases.push(new es3fTextureShadowTests.FilterCase(this.m_gridTex, refInRangeUpper, [-1.19, -1.3], [1.1, 1.35])); // minification
+ this.m_cases.push(new es3fTextureShadowTests.FilterCase(this.m_gridTex, refInRangeLower, [-1.2, -1.1], [-0.8, -0.8])); // magnification
+ this.m_cases.push(new es3fTextureShadowTests.FilterCase(this.m_gridTex, refOutOfBoundsUpper, [-0.61, -0.1], [0.9, 1.18])); // reference value clamp, upper
+
+ if (singleSample)
+ this.m_cases.push(new es3fTextureShadowTests.FilterCase(this.m_gridTex, refOutOfBoundsLower, [-0.75, 1.0], [0.05, 0.75])); // reference value clamp, lower
+ else
+ this.m_cases.push(new es3fTextureShadowTests.FilterCase(this.m_gridTex, refOutOfBoundsLower, [-0.75, 1.0], [0.25, 0.75])); // reference value clamp, lower
+
+ this.m_caseNdx = 0;
+ };
+
+ es3fTextureShadowTests.TextureCubeShadowCase.prototype.iterate = function() {
+ var viewportSize = 28;
+ var viewport = new glsTextureTestUtil.RandomViewport(document.getElementById('canvas'), viewportSize, viewportSize, deString.deStringHash(this.fullName()) ^ deMath.deMathHash(this.m_caseNdx));
+ var curCase = this.m_cases[this.m_caseNdx];
+ var sampleParams = new glsTextureTestUtil.ReferenceParams(glsTextureTestUtil.textureType.TEXTURETYPE_CUBE);
+
+ if (viewport.width < viewportSize || viewport.height < viewportSize)
+ throw new Error('Too small render target');
+
+ // Setup texture
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, curCase.texture.getGLTexture());
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, this.m_minFilter);
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, this.m_magFilter);
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, this.m_wrapS);
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, this.m_wrapT);
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE);
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_FUNC, this.m_compareFunc);
+
+ // Other state
+ gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height);
+
+ // Params for reference computation.
+ sampleParams.sampler = gluTextureUtil.mapGLSampler(gl.CLAMP_TO_EDGE, gl.CLAMP_TO_EDGE, gl.CLAMP_TO_EDGE, this.m_minFilter, this.m_magFilter);
+ sampleParams.sampler.seamlessCubeMap = true;
+ sampleParams.sampler.compare = gluTextureUtil.mapGLCompareFunc(this.m_compareFunc);
+ sampleParams.samplerType = glsTextureTestUtil.samplerType.SAMPLERTYPE_SHADOW;
+ sampleParams.lodMode = glsTextureTestUtil.lodMode.EXACT;
+ sampleParams.ref = curCase.ref;
+
+ bufferedLogToConsole(
+ 'Compare reference value = ' + sampleParams.ref + '\n' +
+ 'Coordinates: ' + curCase.minCoord + ' -> ' + curCase.maxCoord);
+
+ for (var faceNdx in tcuTexture.CubeFace) {
+ var face = tcuTexture.CubeFace[faceNdx];
+ var result = new tcuSurface.Surface(viewport.width, viewport.height);
+ var texCoord = [];
+
+ texCoord = glsTextureTestUtil.computeQuadTexCoordCubeFace(face, curCase.minCoord, curCase.maxCoord);
+
+ this.m_renderer.renderQuad(0, texCoord, sampleParams);
+
+ result.readViewport(gl, viewport);
+
+ var pixelFormat = new tcuPixelFormat.PixelFormat(8, 8, 8, 8);
+ /** @type {tcuTexLookupVerifier.LodPrecision} */ var lodPrecision = new tcuTexLookupVerifier.LodPrecision(10, 5);
+ /** @type {tcuTexCompareVerifier.TexComparePrecision} */ var texComparePrecision = new tcuTexCompareVerifier.TexComparePrecision(
+ [10, 10, 10],
+ [6, 6, 0],
+ 5,
+ 16,
+ pixelFormat.redBits - 1
+ );
+
+ var isHighQuality = es3fTextureShadowTests.verifyTexCompareResult(tcuTexture.TextureCube, result.getAccess(), curCase.texture.getRefTexture(),
+ texCoord, sampleParams, texComparePrecision, lodPrecision, pixelFormat);
+
+ if (!isHighQuality) {
+ bufferedLogToConsole('Warning: Verification assuming high-quality PCF filtering failed.');
+
+ lodPrecision.lodBits = 4;
+ texComparePrecision.uvwBits = [4, 4, 0];
+ texComparePrecision.pcfBits = 0;
+
+ var isOk = es3fTextureShadowTests.verifyTexCompareResult(tcuTexture.TextureCube, result.getAccess(), curCase.texture.getRefTexture(),
+ texCoord, sampleParams, texComparePrecision, lodPrecision, pixelFormat);
+ if (!isOk) {
+ bufferedLogToConsole('ERROR: Verification against low precision requirements failed, failing test case.');
+ testFailedOptions('Image verification failed', false);
+ } else
+ testPassedOptions('Low-quality result', true);
+ }
+ else
+ testPassedOptions('High-quality result', true);
+ }
+
+ this.m_caseNdx += 1;
+ return this.m_caseNdx < this.m_cases.length ? tcuTestCase.IterateResult.CONTINUE : tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * Testure2DArrayShadowCase
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} minFilter
+ * @param {number} magFilter
+ * @param {number} wrapS
+ * @param {number} wrapT
+ * @param {number} format
+ * @param {number} width
+ * @param {number} height
+ * @param {number} numLayers
+ * @param {number} compareFunc
+ */
+ es3fTextureShadowTests.Texture2DArrayShadowCase = function(name, desc, minFilter, magFilter, wrapS, wrapT, format, width, height, numLayers, compareFunc) {
+ tcuTestCase.DeqpTest.call(this, name, desc);
+ /** @type {number} */ this.m_minFilter = minFilter;
+ /** @type {number} */ this.m_magFilter = magFilter;
+ /** @type {number} */ this.m_wrapS = wrapS;
+ /** @type {number} */ this.m_wrapT = wrapT;
+ /** @type {number} */ this.m_format = format;
+ /** @type {number} */ this.m_width = width;
+ /** @type {number} */ this.m_height = height;
+ /** @type {number} */ this.m_numLayers = numLayers;
+ /** @type {number} */ this.m_compareFunc = compareFunc;
+ /** @type {?gluTexture.Texture2DArray} */ this.m_gradientTex = null;
+ /** @type {?gluTexture.Texture2DArray} */ this.m_gridTex = null;
+ /** @type {glsTextureTestUtil.TextureRenderer} */ this.m_renderer = new glsTextureTestUtil.TextureRenderer(es3fTextureShadowTests.version, gluShaderUtil.precision.PRECISION_HIGHP);
+ /** @type {Array<es3fTextureShadowTests.FilterCase>} */ this.m_cases = [];
+ /** @type {number} */ this.m_caseNdx = 0;
+ };
+
+ es3fTextureShadowTests.Texture2DArrayShadowCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fTextureShadowTests.Texture2DArrayShadowCase.prototype.constructor = es3fTextureShadowTests.Texture2DArrayShadowCase;
+
+ /**
+ * init
+ */
+ es3fTextureShadowTests.Texture2DArrayShadowCase.prototype.init = function() {
+ /** @type {tcuTexture.TextureFormat} */ var texFmt = gluTextureUtil.mapGLInternalFormat(this.m_format);
+ /** @type {tcuTextureUtil.TextureFormatInfo} */ var fmtInfo = tcuTextureUtil.getTextureFormatInfo(texFmt);
+ /** @type {Array<number>}*/ var cScale = deMath.subtract(fmtInfo.valueMax, fmtInfo.valueMin);
+ /** @type {Array<number>}*/ var cBias = fmtInfo.valueMin;
+ /** @type {number}*/ var numLevels = deMath.logToFloor(Math.max(this.m_width, this.m_height)) + 1;
+
+ // Create textures.
+ this.m_gradientTex = gluTexture.texture2DArrayFromInternalFormat(gl, this.m_format, this.m_width, this.m_height, this.m_numLayers);
+ this.m_gridTex = gluTexture.texture2DArrayFromInternalFormat(gl, this.m_format, this.m_width, this.m_height, this.m_numLayers);
+
+ // Fill first gradient texture.
+ for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) {
+ /** @type {Array<number>}*/ var gMin = deMath.add(deMath.multiply([-0.5, -0.5, -0.5, 2.0], cScale), cBias);
+ /** @type {Array<number>}*/ var gMax = deMath.add(deMath.multiply([1.0, 1.0, 1.0, 0.0], cScale), cBias);
+
+ this.m_gradientTex.getRefTexture().allocLevel(levelNdx);
+ tcuTextureUtil.fillWithComponentGradients(
+ /** @type {tcuTexture.PixelBufferAccess} */ (this.m_gradientTex.getRefTexture().getLevel(levelNdx)), gMin, gMax);
+ }
+
+ // Fill second with grid texture.
+ for (var levelNdx = 0; levelNdx < numLevels; levelNdx++) {
+ /** @type {number}*/ var step = Math.floor(0x00ffffff / numLevels);
+ /** @type {number}*/ var rgb = step * levelNdx;
+ /** @type {number}*/ var colorA = deMath.binaryOp(0xff000000, rgb, deMath.BinaryOp.OR);
+ /** @type {number}*/ var colorB = deMath.binaryOp(0xff000000, deMath.binaryNot(rgb), deMath.BinaryOp.OR);
+
+ this.m_gridTex.getRefTexture().allocLevel(levelNdx);
+ tcuTextureUtil.fillWithGrid(
+ /** @type {tcuTexture.PixelBufferAccess} */ (this.m_gridTex.getRefTexture().getLevel(levelNdx)), 4,
+ deMath.add(deMath.multiply(tcuRGBA.newRGBAFromValue(colorA).toVec(), cScale), cBias),
+ deMath.add(deMath.multiply(tcuRGBA.newRGBAFromValue(colorB).toVec(), cScale), cBias)
+ );
+ }
+
+ // Upload.
+ this.m_gradientTex.upload();
+ this.m_gridTex.upload();
+
+ // Compute cases.
+ /** @type {number} */ var refInRangeUpper = (this.m_compareFunc == gl.EQUAL || this.m_compareFunc == gl.NOTEQUAL) ? 1.0 : 0.5;
+ /** @type {number} */ var refInRangeLower = (this.m_compareFunc == gl.EQUAL || this.m_compareFunc == gl.NOTEQUAL) ? 0.0 : 0.5;
+ /** @type {number} */ var refOutOfBoundsUpper = 1.1; // !< lookup function should clamp values to [0, 1] range
+ /** @type {number} */ var refOutOfBoundsLower = -0.1;
+
+ /** @type {Array<{texNdx: number, ref: number, lodX: number, lodY: number, oX: number, oY: number}>} */
+ var cases = [{ texNdx: 0, ref: refInRangeUpper, lodX: 1.6, lodY: 2.9, oX: -1.0, oY: -2.7 },{ texNdx: 0, ref: refInRangeLower, lodX: -2.0, lodY: -1.35, oX: -0.2, oY: 0.7 },{ texNdx: 1, ref: refInRangeUpper, lodX: 0.14, lodY: 0.275, oX: -1.5, oY: -1.1 },{ texNdx: 1, ref: refInRangeLower, lodX: -0.92, lodY: -2.64, oX: 0.4, oY: -0.1 },{ texNdx: 1, ref: refOutOfBoundsUpper, lodX: -0.49, lodY: -0.22, oX: 0.45, oY: 0.97 },{ texNdx: 1, ref: refOutOfBoundsLower, lodX: -0.85, lodY: 0.75, oX: 0.25, oY: 0.61 }
+ ];
+
+ var viewportW = Math.min(VIEWPORT_WIDTH, gl.canvas.width);
+ var viewportH = Math.min(VIEWPORT_HEIGHT, gl.canvas.height);
+
+ /** @type {number} */ var minLayer = -0.5;
+ /** @type {number} */ var maxLayer = this.m_numLayers;
+
+ for (var caseNdx = 0; caseNdx < cases.length; caseNdx++) {
+ var tex = cases[caseNdx].texNdx > 0 ? this.m_gridTex : this.m_gradientTex;
+ /** @type {number} */ var ref = cases[caseNdx].ref;
+ /** @type {number} */ var lodX = cases[caseNdx].lodX;
+ /** @type {number} */ var lodY = cases[caseNdx].lodY;
+ /** @type {number} */ var oX = cases[caseNdx].oX;
+ /** @type {number} */ var oY = cases[caseNdx].oY;
+ /** @type {number} */ var sX = Math.exp(lodX * Math.LN2) * viewportW / tex.getRefTexture().getWidth();
+ /** @type {number} */ var sY = Math.exp(lodY * Math.LN2) * viewportH / tex.getRefTexture().getHeight();
+
+ this.m_cases.push(new es3fTextureShadowTests.FilterCase(tex, ref, [oX, oY, minLayer], [oX + sX, oY + sY, maxLayer]));
+ }
+
+ this.m_caseNdx = 0;
+ };
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fTextureShadowTests.Texture2DArrayShadowCase.prototype.iterate = function() {
+ var viewport = new glsTextureTestUtil.RandomViewport(document.getElementById('canvas'), VIEWPORT_WIDTH, VIEWPORT_HEIGHT, deString.deStringHash(this.fullName()) ^ deMath.deMathHash(this.m_caseNdx));
+ var curCase = this.m_cases[this.m_caseNdx];
+ var sampleParams = new glsTextureTestUtil.ReferenceParams(glsTextureTestUtil.textureType.TEXTURETYPE_2D_ARRAY);
+ var rendered = new tcuSurface.Surface(viewport.width, viewport.height);
+ var texCoord = [];
+
+ texCoord = [curCase.minCoord[0], curCase.minCoord[1], curCase.minCoord[2],
+ curCase.minCoord[0], curCase.maxCoord[1], (curCase.minCoord[2] + curCase.maxCoord[2]) / 2.0,
+ curCase.maxCoord[0], curCase.minCoord[1], (curCase.minCoord[2] + curCase.maxCoord[2]) / 2.0,
+ curCase.maxCoord[0], curCase.maxCoord[1], curCase.maxCoord[2]];
+
+ if (viewport.width < MIN_VIEWPORT_WIDTH || viewport.height < MIN_VIEWPORT_HEIGHT)
+ throw new Error('Too small render target');
+
+ sampleParams.sampler = gluTextureUtil.mapGLSamplerWrapST(this.m_wrapS, this.m_wrapT, this.m_minFilter, this.m_magFilter);
+ sampleParams.sampler.compare = gluTextureUtil.mapGLCompareFunc(this.m_compareFunc);
+ sampleParams.samplerType = glsTextureTestUtil.samplerType.SAMPLERTYPE_SHADOW;
+ sampleParams.lodMode = glsTextureTestUtil.lodMode.EXACT;
+ sampleParams.ref = curCase.ref;
+
+ bufferedLogToConsole(
+ 'Compare reference value = ' + sampleParams.ref + '\n' +
+ 'Texture Coordinates: ' + curCase.minCoord + ' -> ' + curCase.maxCoord
+ );
+
+ gl.bindTexture(gl.TEXTURE_2D_ARRAY, curCase.texture.getGLTexture());
+ gl.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_MIN_FILTER, this.m_minFilter);
+ gl.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_MAG_FILTER, this.m_magFilter);
+ gl.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_WRAP_S, this.m_wrapS);
+ gl.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_WRAP_T, this.m_wrapT);
+ gl.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE);
+ gl.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_COMPARE_FUNC, this.m_compareFunc);
+
+ gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height);
+ this.m_renderer.renderQuad(0, texCoord, sampleParams);
+ rendered.readViewport(gl, viewport);
+
+ var pixelFormat = new tcuPixelFormat.PixelFormat(8, 8, 8, 8);
+ /** @type {tcuTexLookupVerifier.LodPrecision} */ var lodPrecision = new tcuTexLookupVerifier.LodPrecision(18, 6);
+ /** @type {tcuTexCompareVerifier.TexComparePrecision} */ var texComparePrecision = new tcuTexCompareVerifier.TexComparePrecision(
+ [20, 20, 20],
+ [7, 7, 7],
+ 5,
+ 16,
+ pixelFormat.redBits - 1
+ );
+
+ var isHighQuality = es3fTextureShadowTests.verifyTexCompareResult(tcuTexture.Texture2DArray, rendered.getAccess(), curCase.texture.getRefTexture(),
+ texCoord, sampleParams, texComparePrecision, lodPrecision, pixelFormat);
+
+ if (!isHighQuality) {
+ bufferedLogToConsole('Warning: Verification assuming high-quality PCF filtering failed');
+
+ lodPrecision.lodBits = 4;
+ texComparePrecision.uvwBits = [4, 4, 4];
+ texComparePrecision.pcfBits = 0;
+
+ var isOk = es3fTextureShadowTests.verifyTexCompareResult(tcuTexture.Texture2DArray, rendered.getAccess(), curCase.texture.getRefTexture(),
+ texCoord, sampleParams, texComparePrecision, lodPrecision, pixelFormat);
+
+ if (!isOk) {
+ bufferedLogToConsole('ERROR: Verification against low precision requirements failed, failing test case.');
+ testFailedOptions('Image verification failed', false);
+ } else
+ testPassedOptions('Low-quality result', true);
+ } else
+ testPassedOptions('High-quality result', true);
+
+ this.m_caseNdx += 1;
+ return this.m_caseNdx < this.m_cases.length ? tcuTestCase.IterateResult.CONTINUE : tcuTestCase.IterateResult.STOP;
+ };
+
+ es3fTextureShadowTests.init = function() {
+ /** @type {Array<es3fTextureShadowTests.Format>} */ var formats = [];
+ formats.push(new es3fTextureShadowTests.Format('depth_component16', gl.DEPTH_COMPONENT16));
+ formats.push(new es3fTextureShadowTests.Format('depth_component32f', gl.DEPTH_COMPONENT32F));
+ formats.push(new es3fTextureShadowTests.Format('depth24_stencil8', gl.DEPTH24_STENCIL8));
+
+ /** @type {Array<es3fTextureShadowTests.Filter>} */ var filters = [];
+ filters.push(new es3fTextureShadowTests.Filter('nearest', gl.NEAREST, gl.NEAREST));
+ filters.push(new es3fTextureShadowTests.Filter('linear', gl.LINEAR, gl.LINEAR));
+ filters.push(new es3fTextureShadowTests.Filter('nearest_mipmap_nearest', gl.NEAREST_MIPMAP_NEAREST, gl.LINEAR));
+ filters.push(new es3fTextureShadowTests.Filter('linear_mipmap_nearest', gl.LINEAR_MIPMAP_NEAREST, gl.LINEAR));
+ filters.push(new es3fTextureShadowTests.Filter('nearest_mipmap_linear', gl.NEAREST_MIPMAP_LINEAR, gl.LINEAR));
+ filters.push(new es3fTextureShadowTests.Filter('linear_mipmap_linear', gl.LINEAR_MIPMAP_LINEAR, gl.LINEAR));
+
+ /** @type {Array<es3fTextureShadowTests.CompareFunc>} */ var compareFuncs = [];
+ compareFuncs.push(new es3fTextureShadowTests.CompareFunc('less_or_equal', gl.LEQUAL));
+ compareFuncs.push(new es3fTextureShadowTests.CompareFunc('greater_or_equal', gl.GEQUAL));
+ compareFuncs.push(new es3fTextureShadowTests.CompareFunc('less', gl.LESS));
+ compareFuncs.push(new es3fTextureShadowTests.CompareFunc('greater', gl.GREATER));
+ compareFuncs.push(new es3fTextureShadowTests.CompareFunc('equal', gl.EQUAL));
+ compareFuncs.push(new es3fTextureShadowTests.CompareFunc('not_equal', gl.NOTEQUAL));
+ compareFuncs.push(new es3fTextureShadowTests.CompareFunc('always', gl.ALWAYS));
+ compareFuncs.push(new es3fTextureShadowTests.CompareFunc('never', gl.NEVER));
+
+ var state = tcuTestCase.runner;
+ /** @type {tcuTestCase.DeqpTest} */ var testGroup = state.testCases;
+
+ for (var filterNdx = 0; filterNdx < filters.length; filterNdx++) {
+ for (var compareNdx = 0; compareNdx < compareFuncs.length; compareNdx++) {
+ var filterGroup = tcuTestCase.newTest(
+ '2d.' + filters[filterNdx].name, '2D texture shadow lookup tests');
+ testGroup.addChild(filterGroup);
+
+ for (var formatNdx = 0; formatNdx < formats.length; formatNdx++) {
+ /** @type {number} */ var minFilter = filters[filterNdx].minFilter;
+ /** @type {number} */ var magFilter = filters[filterNdx].magFilter;
+ /** @type {number} */ var format = formats[formatNdx].format;
+ /** @type {number} */ var compareFunc = compareFuncs[compareNdx].func;
+ /** @type {number} */ var wrapS = gl.REPEAT;
+ /** @type {number} */ var wrapT = gl.REPEAT;
+ /** @type {number} */ var width = 32;
+ /** @type {number} */ var height = 64;
+ /** @type {string} */ var name = compareFuncs[compareNdx].name + '_' + formats[formatNdx].name;
+
+ filterGroup.addChild(new es3fTextureShadowTests.Texture2DShadowCase(name, '', minFilter, magFilter, wrapS, wrapT, format, width, height, compareFunc));
+ }
+ }
+ }
+
+ for (filterNdx = 0; filterNdx < filters.length; filterNdx++) {
+ for (compareNdx = 0; compareNdx < compareFuncs.length; compareNdx++) {
+ filterGroup = tcuTestCase.newTest(
+ 'cube.' + filters[filterNdx].name, 'Cube map texture shadow lookup tests');
+ testGroup.addChild(filterGroup);
+
+ for (formatNdx = 0; formatNdx < formats.length; formatNdx++) {
+ minFilter = filters[filterNdx].minFilter;
+ magFilter = filters[filterNdx].magFilter;
+ format = formats[formatNdx].format;
+ compareFunc = compareFuncs[compareNdx].func;
+ wrapS = gl.REPEAT;
+ wrapT = gl.REPEAT;
+ var size = 32;
+ name = compareFuncs[compareNdx].name + '_' + formats[formatNdx].name;
+
+ filterGroup.addChild(new es3fTextureShadowTests.TextureCubeShadowCase(name, '', minFilter, magFilter, wrapS, wrapT, format, size, compareFunc));
+ }
+ }
+ }
+
+ for (var filterNdx = 0; filterNdx < filters.length; filterNdx++) {
+ for (var compareNdx = 0; compareNdx < compareFuncs.length; compareNdx++) {
+ filterGroup = tcuTestCase.newTest(
+ '2d_array.' + filters[filterNdx].name, '2D texture array shadow lookup tests');
+ testGroup.addChild(filterGroup);
+
+ for (var formatNdx = 0; formatNdx < formats.length; formatNdx++) {
+ minFilter = filters[filterNdx].minFilter;
+ magFilter = filters[filterNdx].magFilter;
+ format = formats[formatNdx].format;
+ compareFunc = compareFuncs[compareNdx].func;
+ wrapS = gl.REPEAT;
+ wrapT = gl.REPEAT;
+ width = 32;
+ height = 64;
+ var numLayers = 8;
+ name = compareFuncs[compareNdx].name + '_' + formats[formatNdx].name;
+
+ filterGroup.addChild(new es3fTextureShadowTests.Texture2DArrayShadowCase(name, '', minFilter, magFilter, wrapS, wrapT, format, width, height, numLayers, compareFunc));
+ }
+ }
+ }
+ };
+
+ es3fTextureShadowTests.run = function(context, range) {
+ gl = context;
+ //Set up Test Root parameters
+ var testName = 'texture_shadow';
+ var testDescription = 'Texture Shadow Test';
+ var state = tcuTestCase.runner;
+
+ state.testName = testName;
+ state.testCases = tcuTestCase.newTest(testName, testDescription, null);
+
+ //Set up name and description of this test series.
+ setCurrentTestName(testName);
+ description(testDescription);
+
+ try {
+ //Create test cases
+ es3fTextureShadowTests.init();
+ if (range)
+ state.setRange(range);
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ bufferedLogToConsole(err);
+ tcuTestCase.runner.terminate();
+ }
+ };
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureSpecificationTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureSpecificationTests.js
new file mode 100644
index 0000000000..5ff5edc550
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureSpecificationTests.js
@@ -0,0 +1,7456 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fTextureSpecificationTests');
+goog.require('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuLogImage');
+goog.require('framework.common.tcuPixelFormat');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluTextureUtil');
+goog.require('framework.opengl.simplereference.sglrGLContext');
+goog.require('framework.opengl.simplereference.sglrReferenceContext');
+goog.require('framework.referencerenderer.rrUtil');
+goog.require('functional.gles3.es3fFboTestUtil');
+
+goog.scope(function() {
+ var es3fTextureSpecificationTests =
+ functional.gles3.es3fTextureSpecificationTests;
+ var tcuPixelFormat = framework.common.tcuPixelFormat;
+ var tcuImageCompare = framework.common.tcuImageCompare;
+ var tcuSurface = framework.common.tcuSurface;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var tcuTexture = framework.common.tcuTexture;
+ var tcuTextureUtil = framework.common.tcuTextureUtil;
+ var deMath = framework.delibs.debase.deMath;
+ var deRandom = framework.delibs.debase.deRandom;
+ var deString = framework.delibs.debase.deString;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var gluTextureUtil = framework.opengl.gluTextureUtil;
+ var sglrGLContext = framework.opengl.simplereference.sglrGLContext;
+ var sglrReferenceContext =
+ framework.opengl.simplereference.sglrReferenceContext;
+ var rrUtil = framework.referencerenderer.rrUtil;
+ var es3fFboTestUtil = functional.gles3.es3fFboTestUtil;
+ var tcuLogImage = framework.common.tcuLogImage;
+
+ /**
+ * @param {number} internalFormat
+ * @return {tcuTexture.TextureFormat}
+ */
+ es3fTextureSpecificationTests.mapGLUnsizedInternalFormat = function(
+ internalFormat
+ ) {
+ switch (internalFormat) {
+ case gl.ALPHA:
+ return new tcuTexture.TextureFormat(
+ tcuTexture.ChannelOrder.A,
+ tcuTexture.ChannelType.UNORM_INT8
+ );
+ case gl.LUMINANCE:
+ return new tcuTexture.TextureFormat(
+ tcuTexture.ChannelOrder.L,
+ tcuTexture.ChannelType.UNORM_INT8
+ );
+ case gl.LUMINANCE_ALPHA:
+ return new tcuTexture.TextureFormat(
+ tcuTexture.ChannelOrder.LA,
+ tcuTexture.ChannelType.UNORM_INT8
+ );
+ case gl.RGB:
+ return new tcuTexture.TextureFormat(
+ tcuTexture.ChannelOrder.RGB,
+ tcuTexture.ChannelType.UNORM_INT8
+ );
+ case gl.RGBA:
+ return new tcuTexture.TextureFormat(
+ tcuTexture.ChannelOrder.RGBA,
+ tcuTexture.ChannelType.UNORM_INT8
+ );
+ default:
+ throw new Error(
+ 'Can\'t map GL unsized internal format (' +
+ internalFormat.toString(16) + ') to texture format'
+ );
+ }
+ };
+
+ var VIEWPORT_WIDTH = 256;
+ var VIEWPORT_HEIGHT = 256;
+
+ /**
+ * @param {number} width
+ * @param {number} height
+ * @param {number=} depth
+ * @return {number}
+ */
+ es3fTextureSpecificationTests.maxLevelCount = function(
+ width, height, depth
+ ) {
+ depth = depth || 0;
+ return deMath.logToFloor(Math.max(width, Math.max(height, depth))) + 1;
+ };
+
+ /**
+ * @param {deRandom.Random} rnd
+ * @param {Array<number>} minVal
+ * @param {Array<number>} maxVal
+ * @param {number} size
+ * @return {Array<number>}
+ */
+ es3fTextureSpecificationTests.randomVector = function(
+ rnd, minVal, maxVal, size
+ ) {
+ var res = [];
+ for (var ndx = 0; ndx < size; ndx++)
+ res[ndx] = rnd.getFloat(minVal[ndx], maxVal[ndx]);
+ return res;
+ };
+
+ /**
+ * @param {tcuPixelFormat.PixelFormat} pixelFormat
+ * @param {tcuTexture.TextureFormat} textureFormat
+ * @return {Array<number>} (ivec4)
+ */
+ es3fTextureSpecificationTests.getPixelFormatCompareDepth = function(
+ pixelFormat, textureFormat
+ ) {
+ switch (textureFormat.order) {
+ case tcuTexture.ChannelOrder.L:
+ case tcuTexture.ChannelOrder.LA:
+ return [
+ pixelFormat.redBits, pixelFormat.redBits,
+ pixelFormat.redBits, pixelFormat.alphaBits
+ ];
+ default:
+ return [
+ pixelFormat.redBits, pixelFormat.greenBits,
+ pixelFormat.blueBits, pixelFormat.alphaBits
+ ];
+ }
+ };
+
+ /**
+ * @param {tcuPixelFormat.PixelFormat} pixelFormat
+ * @param {tcuTexture.TextureFormat} textureFormat
+ * @return {Array<number>} (uvec4)
+ */
+ es3fTextureSpecificationTests.computeCompareThreshold = function(
+ pixelFormat, textureFormat
+ ) {
+ /** @type {Array<number>} */
+ var texFormatBits = tcuTextureUtil.getTextureFormatBitDepth(
+ textureFormat
+ );
+ /** @type {Array<number>} */
+ var pixelFormatBits =
+ es3fTextureSpecificationTests.getPixelFormatCompareDepth(
+ pixelFormat, textureFormat
+ );
+ /** @type {Array<number>} */
+ var accurateFmtBits = deMath.min(pixelFormatBits, texFormatBits);
+ /** @type {Array<number>} */
+ var compareBits = deMath.addScalar(
+ tcuTextureUtil.select(
+ accurateFmtBits, [8, 8, 8, 8],
+ deMath.greaterThan(accurateFmtBits, [0, 0, 0, 0])
+ ), - 1
+ );
+
+ var result = [];
+ for (var i = 0; i < compareBits.length; i++)
+ result.push(1 << compareBits[i]);
+ return result;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} desc
+ * context
+ */
+ es3fTextureSpecificationTests.TextureSpecCase = function(name, desc) {
+ tcuTestCase.DeqpTest.call(this, name, desc);
+ /**
+ * @type {
+ * ?sglrGLContext.GLContext|sglrReferenceContext.ReferenceContext
+ * }
+ */
+ this.m_context = null;
+ };
+
+ es3fTextureSpecificationTests.TextureSpecCase.prototype = Object.create(
+ tcuTestCase.DeqpTest.prototype
+ );
+
+ es3fTextureSpecificationTests.TextureSpecCase.prototype.constructor =
+ es3fTextureSpecificationTests.TextureSpecCase;
+
+ /**
+ * deinit
+ */
+ es3fTextureSpecificationTests.TextureSpecCase.prototype.deinit =
+ function() {
+ gl.pixelStorei(gl.UNPACK_ALIGNMENT, 4);
+ gl.pixelStorei(gl.UNPACK_ROW_LENGTH, 0);
+ gl.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, 0);
+ gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, 0);
+ gl.pixelStorei(gl.UNPACK_SKIP_ROWS, 0);
+ gl.pixelStorei(gl.UNPACK_SKIP_IMAGES, 0);
+
+ gl.bindBuffer(gl.PIXEL_UNPACK_BUFFER, null);
+ }
+
+ /**
+ * createTexture - Needs to be overridden
+ */
+ es3fTextureSpecificationTests.TextureSpecCase.prototype.createTexture =
+ function() {
+ throw new Error('Must override');
+ };
+
+ /**
+ * verifyTexture - Needs to be overridden
+ * @param {sglrGLContext.GLContext} webgl2Context
+ * @param {sglrReferenceContext.ReferenceContext} refContext
+ * @return {boolean}
+ */
+ es3fTextureSpecificationTests.TextureSpecCase.prototype.verifyTexture =
+ function(
+ webgl2Context, refContext
+ ) {
+ throw new Error('Must override');
+ };
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fTextureSpecificationTests.TextureSpecCase.prototype.iterate = function() {
+ if (gl.canvas.width < VIEWPORT_WIDTH ||
+ gl.canvas.height < VIEWPORT_HEIGHT)
+ throw new Error('Too small viewport', '');
+
+ // Context size, and viewport for GLES3
+ var rnd = new deRandom.Random(deString.deStringHash(this.fullName()));
+ var width = Math.min(gl.canvas.width, VIEWPORT_WIDTH);
+ var height = Math.min(gl.canvas.height, VIEWPORT_HEIGHT);
+ var x = rnd.getInt(0, gl.canvas.width - width);
+ var y = rnd.getInt(0, gl.canvas.height - height);
+
+ // Contexts.
+ /** @type {sglrGLContext.GLContext} */
+ var webgl2Context = new sglrGLContext.GLContext(
+ gl, [x, y, width, height]
+ );
+
+ /** @type {sglrReferenceContext.ReferenceContextBuffers} */
+ var refBuffers = new sglrReferenceContext.ReferenceContextBuffers(
+ new tcuPixelFormat.PixelFormat(
+ 8, 8, 8, gl.getParameter(gl.ALPHA_BITS) ? 8 : 0
+ ), 0 /* depth */, 0 /* stencil */, width, height
+ );
+
+ /** @type {sglrReferenceContext.ReferenceContext} */
+ var refContext = new sglrReferenceContext.ReferenceContext(
+ new sglrReferenceContext.ReferenceContextLimits(gl),
+ refBuffers.getColorbuffer(), refBuffers.getDepthbuffer(),
+ refBuffers.getStencilbuffer()
+ );
+
+ // Clear color buffer.
+ for (var ndx = 0; ndx < 2; ndx++) {
+ this.m_context = ndx ? refContext : webgl2Context;
+ // C++ port uses (0.125, 0.25, 0.5, 1.0), but here we use (0, 0, 0, 0)
+ // in order to optimize the `clear' op in ReferenceContext.
+ this.m_context.clearColor(0, 0, 0, 0);
+ this.m_context.clear(
+ gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT |
+ gl.STENCIL_BUFFER_BIT
+ );
+ }
+
+ // Construct texture using both GLES3 and reference contexts.
+ for (var ndx = 0; ndx < 2; ndx++) {
+ this.m_context = ndx ? refContext : webgl2Context;
+ this.createTexture();
+ checkMessage(
+ this.m_context.getError() == gl.NO_ERROR,
+ 'Problem creating texture.'
+ );
+ }
+
+ // Verify results.
+ if (this.verifyTexture(webgl2Context, refContext))
+ testPassed();
+ else
+ testFailed('Verification failed');
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @param {tcuSurface.Surface} dst
+ * @param {
+ * ?WebGLProgram|
+ * framework.opengl.simplereference.sglrShaderProgram.ShaderProgram
+ * } program
+ * @param {number} width
+ * @param {number} height
+ */
+ es3fTextureSpecificationTests.TextureSpecCase.prototype.renderTex =
+ function(dst, program, width, height) {
+ var targetW = this.m_context.getWidth();
+ var targetH = this.m_context.getHeight();
+
+ var w = width / targetW;
+ var h = height / targetH;
+
+ rrUtil.drawQuad(
+ this.m_context, program, [-1.0, -1.0, 0.0],
+ [-1.0 + w * 2.0, -1.0 + h * 2.0, 0.0]
+ );
+
+ // Read pixels back.
+ dst.readViewport(this.m_context, [0, 0, width, height]);
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.TextureSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {tcuTexture.TextureFormat} format
+ * @param {number} width
+ * @param {number} height
+ * @param {number} numLevels
+ */
+ es3fTextureSpecificationTests.Texture2DSpecCase = function(
+ name, desc, format, width, height, numLevels
+ ) {
+ es3fTextureSpecificationTests.TextureSpecCase.call(this, name, desc);
+
+ this.m_texFormat = format;
+ this.m_texFormatInfo = tcuTextureUtil.getTextureFormatInfo(format);
+ this.m_width = width;
+ this.m_height = height;
+ this.m_numLevels = numLevels;
+ };
+
+ es3fTextureSpecificationTests.Texture2DSpecCase.prototype = Object.create(
+ es3fTextureSpecificationTests.TextureSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.Texture2DSpecCase.prototype.constructor =
+ es3fTextureSpecificationTests.Texture2DSpecCase;
+
+ /**
+ * @param {sglrGLContext.GLContext} webgl2Context
+ * @param {sglrReferenceContext.ReferenceContext} refContext
+ */
+ es3fTextureSpecificationTests.Texture2DSpecCase.prototype.verifyTexture =
+ function(
+ webgl2Context, refContext
+ ) {
+ /** @type {es3fFboTestUtil.Texture2DShader} */
+ var shader = new es3fFboTestUtil.Texture2DShader(
+ [gluTextureUtil.getSampler2DType(this.m_texFormat)],
+ gluShaderUtil.DataType.FLOAT_VEC4
+ );
+
+ var shaderIDgles = webgl2Context.createProgram(shader);
+ var shaderIDRef = refContext.createProgram(shader);
+
+ shader.setTexScaleBias(
+ 0, this.m_texFormatInfo.lookupScale,
+ this.m_texFormatInfo.lookupBias
+ );
+
+ // Set state.
+ for (var ndx = 0; ndx < 2; ndx++) {
+ var ctx = ndx ? refContext : webgl2Context;
+
+ this.m_context = ctx;
+
+ this.m_context.texParameteri(
+ gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST_MIPMAP_NEAREST
+ );
+ this.m_context.texParameteri(
+ gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST
+ );
+ this.m_context.texParameteri(
+ gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE
+ );
+ this.m_context.texParameteri(
+ gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE
+ );
+ this.m_context.texParameteri(
+ gl.TEXTURE_2D, gl.TEXTURE_MAX_LEVEL, this.m_numLevels - 1
+ );
+ }
+
+ for (var levelNdx = 0; levelNdx < this.m_numLevels; levelNdx++) {
+ var levelW = Math.max(1, this.m_width >> levelNdx);
+ var levelH = Math.max(1, this.m_height >> levelNdx);
+ /** @type {tcuSurface.Surface} */ var reference = new tcuSurface.Surface();
+ /** @type {tcuSurface.Surface} */ var result = new tcuSurface.Surface();
+
+ for (var ndx = 0; ndx < 2; ndx++) {
+ /** @type {tcuSurface.Surface} */
+ var dst = ndx ? reference : result;
+ var ctx = ndx ? refContext : webgl2Context;
+ var shaderID = ndx ? shaderIDRef : shaderIDgles;
+
+ this.m_context = ctx;
+ shader.setUniforms(ctx, shaderID);
+ this.renderTex(dst, shaderID, levelW, levelH);
+ }
+
+ var threshold =
+ es3fTextureSpecificationTests.computeCompareThreshold(
+ tcuPixelFormat.PixelFormatFromContext(gl), this.m_texFormat
+ );
+ var levelStr = levelNdx.toString();
+ var name = 'Level' + levelStr;
+ var desc = 'Level ' + levelStr;
+ var isOk = tcuImageCompare.intThresholdCompare(
+ name, desc, reference.getAccess(), result.getAccess(),
+ threshold, levelNdx == 0 ?
+ tcuImageCompare.CompareLogMode.RESULT :
+ tcuImageCompare.CompareLogMode.ON_ERROR
+ );
+
+ if (!isOk) {
+ testFailed('Image comparison failed');
+ return false;
+ } else {
+ // tcuLogImage.logImageWithInfo(result.getAccess(),'Comparison OK on level: ' + levelNdx);
+ }
+ }
+ return true;
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.TextureSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {tcuTexture.TextureFormat} format
+ * @param {number} size
+ * @param {number} numLevels
+ */
+ es3fTextureSpecificationTests.TextureCubeSpecCase = function(
+ name, desc, format, size, numLevels
+ ) {
+ es3fTextureSpecificationTests.TextureSpecCase.call(
+ this, name, desc
+ );
+ this.m_texFormat = format;
+ this.m_texFormatInfo = tcuTextureUtil.getTextureFormatInfo(format);
+ this.m_size = size;
+ this.m_numLevels = numLevels;
+ };
+
+ es3fTextureSpecificationTests.TextureCubeSpecCase.prototype =
+ Object.create(es3fTextureSpecificationTests.TextureSpecCase.prototype);
+
+ es3fTextureSpecificationTests.TextureCubeSpecCase.prototype.constructor =
+ es3fTextureSpecificationTests.TextureCubeSpecCase;
+
+ /**
+ * @param {sglrGLContext.GLContext} webgl2Context
+ * @param {sglrReferenceContext.ReferenceContext} refContext
+ */
+ es3fTextureSpecificationTests.TextureCubeSpecCase.prototype.verifyTexture =
+ function(
+ webgl2Context, refContext
+ ) {
+ /** @type {es3fFboTestUtil.TextureCubeShader} */
+ var shader = new es3fFboTestUtil.TextureCubeShader(
+ gluTextureUtil.getSamplerCubeType(this.m_texFormat),
+ gluShaderUtil.DataType.FLOAT_VEC4
+ );
+ var shaderIDgles = webgl2Context.createProgram(shader);
+ var shaderIDRef = refContext.createProgram(shader);
+
+ shader.setTexScaleBias(
+ this.m_texFormatInfo.lookupScale, this.m_texFormatInfo.lookupBias
+ );
+
+ // Set state.
+ for (var ndx = 0; ndx < 2; ndx++) {
+ var ctx = ndx ? refContext : webgl2Context;
+
+ this.m_context = ctx;
+
+ this.m_context.texParameteri(
+ gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER,
+ gl.NEAREST_MIPMAP_NEAREST
+ );
+ this.m_context.texParameteri(
+ gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER,
+ gl.NEAREST
+ );
+ this.m_context.texParameteri(
+ gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S,
+ gl.CLAMP_TO_EDGE
+ );
+ this.m_context.texParameteri(
+ gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T,
+ gl.CLAMP_TO_EDGE
+ );
+ this.m_context.texParameteri(
+ gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAX_LEVEL,
+ this.m_numLevels - 1
+ );
+ }
+
+ for (var levelNdx = 0; levelNdx < this.m_numLevels; levelNdx++) {
+ var levelSize = Math.max(1, this.m_size >> levelNdx);
+ var isOk = true;
+
+ for (var f in tcuTexture.CubeFace) {
+ var face = tcuTexture.CubeFace[f];
+ /** @type {tcuSurface.Surface} */
+ var reference = new tcuSurface.Surface();
+ /** @type {tcuSurface.Surface} */
+ var result = new tcuSurface.Surface();
+
+ if (levelSize <= 2)
+ continue; // Fuzzy compare doesn't work for images this small.
+
+ shader.setFace(face);
+
+ for (var ndx = 0; ndx < 2; ndx++) {
+ /** @type {tcuSurface.Surface} */
+ var dst = ndx ? reference : result;
+ ctx = ndx ? refContext : webgl2Context;
+ var shaderID = ndx ? shaderIDRef : shaderIDgles;
+
+ this.m_context = ctx;
+ shader.setUniforms(ctx, shaderID);
+ this.renderTex(dst, shaderID, levelSize, levelSize);
+ }
+
+ var threshold = 0.02;
+ var faceStr = face.toString();
+ var levelStr = levelNdx.toString();
+ var name = 'Level' + levelStr;
+ var desc = 'Level ' + levelStr + ', face ' + faceStr;
+ var isFaceOk = tcuImageCompare.fuzzyCompare(
+ name, desc, reference.getAccess(), result.getAccess(),
+ threshold, levelNdx == 0 ?
+ tcuImageCompare.CompareLogMode.RESULT :
+ tcuImageCompare.CompareLogMode.ON_ERROR
+ );
+
+ if (!isFaceOk) {
+ testFailed('Image comparison failed');
+ return false;
+ }
+ }
+
+ }
+ return true;
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.TextureSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {tcuTexture.TextureFormat} format
+ * @param {number} width
+ * @param {number} height
+ * @param {number} numLayers
+ * @param {number} numLevels
+ */
+ es3fTextureSpecificationTests.Texture2DArraySpecCase = function(
+ name, desc, format, width, height, numLayers, numLevels
+ ) {
+ es3fTextureSpecificationTests.TextureSpecCase.call(
+ this, name, desc
+ );
+ this.m_texFormat = format;
+ this.m_texFormatInfo = tcuTextureUtil.getTextureFormatInfo(format);
+ this.m_width = width;
+ this.m_height = height;
+ this.m_numLayers = numLayers;
+ this.m_numLevels = numLevels;
+ };
+
+ es3fTextureSpecificationTests.Texture2DArraySpecCase.prototype =
+ Object.create(es3fTextureSpecificationTests.TextureSpecCase.prototype);
+
+ es3fTextureSpecificationTests.Texture2DArraySpecCase.prototype.constructor =
+ es3fTextureSpecificationTests.Texture2DArraySpecCase;
+
+ /**
+ * @param {sglrGLContext.GLContext} webgl2Context
+ * @param {sglrReferenceContext.ReferenceContext} refContext
+ */
+ es3fTextureSpecificationTests.Texture2DArraySpecCase.prototype.verifyTexture =
+ function(
+ webgl2Context, refContext
+ ) {
+ /** @type {es3fFboTestUtil.Texture2DArrayShader} */
+ var shader = new es3fFboTestUtil.Texture2DArrayShader(
+ gluTextureUtil.getSampler2DArrayType(this.m_texFormat),
+ gluShaderUtil.DataType.FLOAT_VEC4
+ );
+ var shaderIDgles = webgl2Context.createProgram(shader);
+ var shaderIDRef = refContext.createProgram(shader);
+
+ shader.setTexScaleBias(
+ this.m_texFormatInfo.lookupScale, this.m_texFormatInfo.lookupBias
+ );
+
+ // Set state.
+ for (var ndx = 0; ndx < 2; ndx++) {
+ var ctx = ndx ? refContext : webgl2Context;
+
+ this.m_context = ctx;
+
+ this.m_context.texParameteri(
+ gl.TEXTURE_2D_ARRAY, gl.TEXTURE_MIN_FILTER,
+ gl.NEAREST_MIPMAP_NEAREST
+ );
+ this.m_context.texParameteri(
+ gl.TEXTURE_2D_ARRAY, gl.TEXTURE_MAG_FILTER,
+ gl.NEAREST
+ );
+ this.m_context.texParameteri(
+ gl.TEXTURE_2D_ARRAY, gl.TEXTURE_WRAP_S,
+ gl.CLAMP_TO_EDGE
+ );
+ this.m_context.texParameteri(
+ gl.TEXTURE_2D_ARRAY, gl.TEXTURE_WRAP_T,
+ gl.CLAMP_TO_EDGE
+ );
+ this.m_context.texParameteri(
+ gl.TEXTURE_2D_ARRAY, gl.TEXTURE_WRAP_R,
+ gl.CLAMP_TO_EDGE
+ );
+ this.m_context.texParameteri(
+ gl.TEXTURE_2D_ARRAY, gl.TEXTURE_MAX_LEVEL,
+ this.m_numLevels - 1
+ );
+ }
+
+ for (var layerNdx = 0; layerNdx < this.m_numLayers; layerNdx++) {
+ var layerOk = true;
+
+ shader.setLayer(layerNdx);
+ for (var levelNdx = 0; levelNdx < this.m_numLevels; levelNdx++) {
+ var levelW = Math.max(1, this.m_width >> levelNdx);
+ var levelH = Math.max(1, this.m_height >> levelNdx);
+
+ if (levelW == 1 || levelH == 1) {
+ // Rendering to texture of size x1 is problematic in referencerenderer
+ // due to its deviation from c++ code: crbug.com/613206
+ continue;
+ }
+ /** @type {tcuSurface.Surface} */
+ var reference = new tcuSurface.Surface();
+ /** @type {tcuSurface.Surface} */
+ var result = new tcuSurface.Surface();
+
+ var isOk = true;
+
+ for (var ndx = 0; ndx < 2; ndx++) {
+ /** @type {tcuSurface.Surface} */
+ var dst = ndx ? reference : result;
+ ctx = ndx ? refContext : webgl2Context;
+ var shaderID = ndx ? shaderIDRef : shaderIDgles;
+
+ this.m_context = ctx;
+ shader.setUniforms(ctx, shaderID);
+ this.renderTex(dst, shaderID, levelW, levelH);
+ }
+
+ var threshold =
+ es3fTextureSpecificationTests.computeCompareThreshold(
+ tcuPixelFormat.PixelFormatFromContext(gl), this.m_texFormat
+ );
+ var levelStr = levelNdx.toString();
+ var layerStr = layerNdx.toString();
+ var name = 'Layer' + layerStr + 'Level' + levelStr;
+ var desc = 'Layer ' + layerStr + ', Level ' + levelStr;
+ var depthOk = tcuImageCompare.intThresholdCompare(
+ name, desc, reference.getAccess(), result.getAccess(),
+ threshold, (levelNdx == 0 && layerNdx == 0) ?
+ tcuImageCompare.CompareLogMode.RESULT :
+ tcuImageCompare.CompareLogMode.ON_ERROR
+ );
+
+ if (!depthOk) {
+ testFailed('Image comparison failed');
+ return false;
+ }
+ }
+
+ }
+ return true;
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.TextureSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {tcuTexture.TextureFormat} format
+ * @param {number} width
+ * @param {number} height
+ * @param {number} depth
+ * @param {number} numLevels
+ */
+ es3fTextureSpecificationTests.Texture3DSpecCase = function(
+ name, desc, format, width, height, depth, numLevels
+ ) {
+ es3fTextureSpecificationTests.TextureSpecCase.call(
+ this, name, desc
+ );
+ this.m_texFormat = format;
+ this.m_texFormatInfo = tcuTextureUtil.getTextureFormatInfo(format);
+ this.m_width = width;
+ this.m_height = height;
+ this.m_depth = depth;
+ this.m_numLevels = numLevels;
+ };
+
+ es3fTextureSpecificationTests.Texture3DSpecCase.prototype =
+ Object.create(es3fTextureSpecificationTests.TextureSpecCase.prototype);
+
+ es3fTextureSpecificationTests.Texture3DSpecCase.prototype.constructor =
+ es3fTextureSpecificationTests.Texture3DSpecCase;
+
+ /**
+ * @param {sglrGLContext.GLContext} webgl2Context
+ * @param {sglrReferenceContext.ReferenceContext} refContext
+ */
+ es3fTextureSpecificationTests.Texture3DSpecCase.prototype.verifyTexture =
+ function(
+ webgl2Context, refContext
+ ) {
+ /** @type {es3fFboTestUtil.Texture3DShader} */
+ var shader = new es3fFboTestUtil.Texture3DShader(
+ gluTextureUtil.getSampler3D(this.m_texFormat),
+ gluShaderUtil.DataType.FLOAT_VEC4
+ );
+ var shaderIDgles = webgl2Context.createProgram(shader);
+ var shaderIDRef = refContext.createProgram(shader);
+
+ shader.setTexScaleBias(
+ this.m_texFormatInfo.lookupScale, this.m_texFormatInfo.lookupBias
+ );
+
+ // Set state.
+ for (var ndx = 0; ndx < 2; ndx++) {
+ var ctx = ndx ? refContext : webgl2Context;
+
+ this.m_context = ctx;
+
+ this.m_context.texParameteri(
+ gl.TEXTURE_3D, gl.TEXTURE_MIN_FILTER,
+ gl.NEAREST_MIPMAP_NEAREST
+ );
+ this.m_context.texParameteri(
+ gl.TEXTURE_3D, gl.TEXTURE_MAG_FILTER,
+ gl.NEAREST
+ );
+ this.m_context.texParameteri(
+ gl.TEXTURE_3D, gl.TEXTURE_WRAP_S,
+ gl.CLAMP_TO_EDGE
+ );
+ this.m_context.texParameteri(
+ gl.TEXTURE_3D, gl.TEXTURE_WRAP_T,
+ gl.CLAMP_TO_EDGE
+ );
+ this.m_context.texParameteri(
+ gl.TEXTURE_3D, gl.TEXTURE_WRAP_R,
+ gl.CLAMP_TO_EDGE
+ );
+ this.m_context.texParameteri(
+ gl.TEXTURE_3D, gl.TEXTURE_MAX_LEVEL,
+ this.m_numLevels - 1
+ );
+ }
+
+ for (var levelNdx = 0; levelNdx < this.m_numLevels; levelNdx++) {
+ var levelW = Math.max(1, this.m_width >> levelNdx);
+ var levelH = Math.max(1, this.m_height >> levelNdx);
+ var levelD = Math.max(1, this.m_depth >> levelNdx);
+ var levelOk = true;
+
+ if (levelW == 1 || levelH == 1) {
+ // Rendering to texture of size x1 is problematic in referencerenderer
+ // due to its deviation from c++ code: crbug.com/613206
+ continue;
+ }
+
+ for (var depth = 0; depth < levelD; depth++) {
+ /** @type {tcuSurface.Surface} */
+ var reference = new tcuSurface.Surface();
+ /** @type {tcuSurface.Surface} */
+ var result = new tcuSurface.Surface();
+
+ shader.setDepth((depth + 0.5) / levelD);
+
+ for (var ndx = 0; ndx < 2; ndx++) {
+ /** @type {tcuSurface.Surface} */
+ var dst = ndx ? reference : result;
+ ctx = ndx ? refContext : webgl2Context;
+ var shaderID = ndx ? shaderIDRef : shaderIDgles;
+
+ this.m_context = ctx;
+ shader.setUniforms(ctx, shaderID);
+ this.renderTex(dst, shaderID, levelW, levelH);
+ }
+
+ var threshold =
+ es3fTextureSpecificationTests.computeCompareThreshold(
+ tcuPixelFormat.PixelFormatFromContext(gl), this.m_texFormat
+ );
+ var levelStr = levelNdx.toString();
+ var sliceStr = depth.toString();
+ var name = 'Layer' + levelStr + 'Slice' + sliceStr;
+ var desc = 'Layer ' + levelStr + ', Slice ' + sliceStr;
+ var depthOk = tcuImageCompare.intThresholdCompare(
+ name, desc, reference.getAccess(), result.getAccess(),
+ threshold, (levelNdx == 0 && depth == 0) ?
+ tcuImageCompare.CompareLogMode.RESULT :
+ tcuImageCompare.CompareLogMode.ON_ERROR
+ );
+
+ if (!depthOk) {
+ testFailed('Image comparison failed');
+ return false;
+ }
+ }
+
+ }
+ return true;
+ };
+
+ // Basic TexImage2D() with 2D texture usage
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture2DSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} format
+ * @param {number} dataType
+ * @param {number} width
+ * @param {number} height
+ */
+ es3fTextureSpecificationTests.BasicTexImage2DCase = function(
+ name, desc, format, dataType, width, height
+ ) {
+ // Unsized internal format.
+ es3fTextureSpecificationTests.Texture2DSpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLTransferFormat(
+ format, dataType
+ ), width, height,
+ es3fTextureSpecificationTests.maxLevelCount(
+ width, height
+ )
+ );
+
+ this.m_internalFormat = format;
+ this.m_format = format;
+ this.m_dataType = dataType;
+ };
+
+ es3fTextureSpecificationTests.BasicTexImage2DCase.prototype = Object.create(
+ es3fTextureSpecificationTests.Texture2DSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.BasicTexImage2DCase.prototype.constructor =
+ es3fTextureSpecificationTests.BasicTexImage2DCase;
+
+ /**
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ * @return {es3fTextureSpecificationTests.BasicTexImage2DCase}
+ */
+ es3fTextureSpecificationTests.newBasicTexImage2DCaseInternal = function(
+ name, desc, internalFormat, width, height
+ ) {
+ // Sized internal format.
+ var fmt = gluTextureUtil.getTransferFormat(
+ gluTextureUtil.mapGLInternalFormat(internalFormat)
+ );
+ var testcase = new es3fTextureSpecificationTests.BasicTexImage2DCase(
+ name, desc, fmt.format, fmt.dataType, width, height
+ );
+ testcase.m_internalFormat = internalFormat;
+ return testcase;
+ };
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.BasicTexImage2DCase.prototype.createTexture =
+ function() {
+ var tex = null;
+ var levelData = new tcuTexture.TextureLevel(
+ this.m_texFormat, this.m_width, this.m_height
+ );
+ var rnd = new deRandom.Random(deString.deStringHash(this.fullName()));
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_2D, tex);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
+
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelW = Math.max(1, this.m_width >> ndx);
+ var levelH = Math.max(1, this.m_height >> ndx);
+ var gMin = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+ var gMax = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+
+ levelData.setSize(levelW, levelH);
+ tcuTextureUtil.fillWithComponentGradients(
+ levelData.getAccess(), gMin, gMax
+ );
+
+ this.m_context.texImage2D(
+ gl.TEXTURE_2D, ndx, this.m_internalFormat, levelW, levelH, 0,
+ this.m_format, this.m_dataType,
+ levelData.getAccess().getDataPtr()
+ );
+ }
+ };
+
+ // Basic TexImage2D() with cubemap usage
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.TextureCubeSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} format
+ * @param {number} dataType
+ * @param {number} size
+ */
+ es3fTextureSpecificationTests.BasicTexImageCubeCase = function(
+ name, desc, format, dataType, size
+ ) {
+ // Unsized internal format.
+ es3fTextureSpecificationTests.TextureCubeSpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLTransferFormat(
+ format, dataType
+ ), size, deMath.logToFloor(size) + 1
+ );
+
+ this.m_internalFormat = format;
+ this.m_format = format;
+ this.m_dataType = dataType;
+ };
+
+ es3fTextureSpecificationTests.BasicTexImageCubeCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.TextureCubeSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ BasicTexImageCubeCase.prototype.constructor =
+ es3fTextureSpecificationTests.BasicTexImageCubeCase;
+
+ /**
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} size
+ * @return {es3fTextureSpecificationTests.BasicTexImageCubeCase}
+ */
+ es3fTextureSpecificationTests.newBasicTexImageCubeCaseInternal = function(
+ name, desc, internalFormat, size
+ ) {
+ // Sized internal format.
+ var fmt = gluTextureUtil.getTransferFormat(
+ gluTextureUtil.mapGLInternalFormat(internalFormat)
+ );
+ var testcase = new es3fTextureSpecificationTests.BasicTexImageCubeCase(
+ name, desc, fmt.format, fmt.dataType, size
+ );
+ testcase.m_internalFormat = internalFormat;
+ return testcase;
+ };
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ BasicTexImageCubeCase.prototype.createTexture =
+ function() {
+ var tex = null;
+ var levelData = new tcuTexture.TextureLevel(
+ this.m_texFormat, this.m_size, this.m_size
+ );
+ var rnd = new deRandom.Random(deString.deStringHash(this.fullName()));
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_CUBE_MAP, tex);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
+
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelSize = Math.max(1, this.m_size >> ndx);
+
+ levelData.setSize(levelSize, levelSize);
+
+ for (var f in tcuTexture.CubeFace) {
+ var face = tcuTexture.CubeFace[f];
+ var gMin = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+ var gMax = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+
+ tcuTextureUtil.fillWithComponentGradients(
+ levelData.getAccess(), gMin, gMax
+ );
+
+ this.m_context.texImage2D(
+ es3fTextureSpecificationTests.s_cubeMapFaces[face],
+ ndx, this.m_internalFormat, levelSize, levelSize, 0,
+ this.m_format, this.m_dataType,
+ levelData.getAccess().getDataPtr()
+ );
+ }
+ }
+ };
+
+ // Basic TexImage3D() with 2D array texture usage
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture2DArraySpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ * @param {number} numLayers
+ */
+ es3fTextureSpecificationTests.BasicTexImage2DArrayCase = function(
+ name, desc, internalFormat, width, height, numLayers
+ ) {
+ es3fTextureSpecificationTests.Texture2DArraySpecCase.call(
+ this, name, desc,
+ gluTextureUtil.mapGLInternalFormat(internalFormat), width, height,
+ numLayers, es3fTextureSpecificationTests.maxLevelCount(
+ width, height
+ )
+ );
+
+ this.m_internalFormat = internalFormat;
+ };
+
+ es3fTextureSpecificationTests.BasicTexImage2DArrayCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.Texture2DArraySpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ BasicTexImage2DArrayCase.prototype.constructor =
+ es3fTextureSpecificationTests.BasicTexImage2DArrayCase;
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ BasicTexImage2DArrayCase.prototype.createTexture =
+ function() {
+ var tex = null;
+ var levelData = new tcuTexture.TextureLevel(
+ this.m_texFormat, this.m_width, this.m_height
+ );
+ var rnd = new deRandom.Random(deString.deStringHash(this.fullName()));
+ var transferFmt = gluTextureUtil.getTransferFormat(this.m_texFormat);
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_2D_ARRAY, tex);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
+
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelW = Math.max(1, this.m_width >> ndx);
+ var levelH = Math.max(1, this.m_height >> ndx);
+
+ var gMin = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+ var gMax = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+
+ levelData.setSize(levelW, levelH, this.m_numLayers);
+ tcuTextureUtil.fillWithComponentGradients(
+ levelData.getAccess(), gMin, gMax
+ );
+
+ this.m_context.texImage3D(
+ gl.TEXTURE_2D_ARRAY, ndx, this.m_internalFormat, levelW, levelH,
+ this.m_numLayers, 0, transferFmt.format,
+ transferFmt.dataType, levelData.getAccess().getDataPtr()
+ );
+ }
+ };
+
+ // Basic TexImage3D() with 3D texture usage
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture3DSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ * @param {number} depth
+ */
+ es3fTextureSpecificationTests.BasicTexImage3DCase = function(
+ name, desc, internalFormat, width, height, depth
+ ) {
+ es3fTextureSpecificationTests.Texture3DSpecCase.call(
+ this, name, desc,
+ gluTextureUtil.mapGLInternalFormat(internalFormat), width, height,
+ depth, es3fTextureSpecificationTests.maxLevelCount(
+ width, height, depth
+ )
+ );
+
+ this.m_internalFormat = internalFormat;
+ };
+
+ es3fTextureSpecificationTests.BasicTexImage3DCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.Texture3DSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ BasicTexImage3DCase.prototype.constructor =
+ es3fTextureSpecificationTests.BasicTexImage3DCase;
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ BasicTexImage3DCase.prototype.createTexture =
+ function() {
+ var tex = null;
+ var levelData = new tcuTexture.TextureLevel(
+ this.m_texFormat, this.m_width, this.m_height
+ );
+ var rnd = new deRandom.Random(deString.deStringHash(this.fullName()));
+ var transferFmt = gluTextureUtil.getTransferFormat(this.m_texFormat);
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_3D, tex);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
+
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelW = Math.max(1, this.m_width >> ndx);
+ var levelH = Math.max(1, this.m_height >> ndx);
+ var levelD = Math.max(1, this.m_depth >> ndx);
+
+ var gMin = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+ var gMax = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+
+ levelData.setSize(levelW, levelH, levelD);
+ tcuTextureUtil.fillWithComponentGradients(
+ levelData.getAccess(), gMin, gMax
+ );
+
+ this.m_context.texImage3D(
+ gl.TEXTURE_3D, ndx, this.m_internalFormat, levelW, levelH,
+ levelD, 0, transferFmt.format, transferFmt.dataType,
+ levelData.getAccess().getDataPtr()
+ );
+ }
+ };
+
+ // Randomized 2D texture specification using TexImage2D
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture2DSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} format
+ * @param {number} dataType
+ * @param {number} width
+ * @param {number} height
+ */
+ es3fTextureSpecificationTests.RandomOrderTexImage2DCase = function(
+ name, desc, format, dataType, width, height
+ ) {
+ // Unsized internal format.
+ es3fTextureSpecificationTests.Texture2DSpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLTransferFormat(
+ format, dataType
+ ), width, height,
+ es3fTextureSpecificationTests.maxLevelCount(
+ width, height
+ )
+ );
+
+ this.m_internalFormat = format;
+ this.m_format = format;
+ this.m_dataType = dataType;
+ };
+
+ es3fTextureSpecificationTests.RandomOrderTexImage2DCase.prototype = Object.create(
+ es3fTextureSpecificationTests.Texture2DSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ RandomOrderTexImage2DCase.prototype.constructor =
+ es3fTextureSpecificationTests.RandomOrderTexImage2DCase;
+
+ /**
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ * @return {es3fTextureSpecificationTests.RandomOrderTexImage2DCase}
+ */
+ es3fTextureSpecificationTests.newRandomOrderTexImage2DCaseInternal =
+ function(name, desc, internalFormat, width, height) {
+ // Sized internal format.
+ var fmt = gluTextureUtil.getTransferFormat(
+ gluTextureUtil.mapGLInternalFormat(internalFormat)
+ );
+ var testcase = new es3fTextureSpecificationTests.RandomOrderTexImage2DCase(
+ name, desc, fmt.format, fmt.dataType, width, height
+ );
+ testcase.m_internalFormat = internalFormat;
+ return testcase;
+ };
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ RandomOrderTexImage2DCase.prototype.createTexture = function() {
+ var tex = null;
+ var levelData = new tcuTexture.TextureLevel(
+ this.m_texFormat, this.m_width, this.m_height
+ );
+ var rnd = new deRandom.Random(deString.deStringHash(this.fullName()));
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_2D, tex);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
+
+ var levels = [];
+ for (var i = 0; i < this.m_numLevels; i++)
+ levels[i] = i;
+ levels = rnd.shuffle(levels);
+
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelNdx = levels[ndx];
+ var levelW = Math.max(1, this.m_width >> levelNdx);
+ var levelH = Math.max(1, this.m_height >> levelNdx);
+ var gMin = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+ var gMax = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+
+ levelData.setSize(levelW, levelH);
+ tcuTextureUtil.fillWithComponentGradients(
+ levelData.getAccess(), gMin, gMax
+ );
+
+ this.m_context.texImage2D(
+ gl.TEXTURE_2D, levelNdx, this.m_internalFormat, levelW, levelH, 0,
+ this.m_format, this.m_dataType,
+ levelData.getAccess().getDataPtr()
+ );
+ }
+ };
+
+ // Randomized cubemap texture specification using TexImage2D
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.TextureCubeSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} format
+ * @param {number} dataType
+ * @param {number} size
+ */
+ es3fTextureSpecificationTests.RandomOrderTexImageCubeCase = function(
+ name, desc, format, dataType, size
+ ) {
+ // Unsized internal format.
+ es3fTextureSpecificationTests.TextureCubeSpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLTransferFormat(
+ format, dataType
+ ), size, deMath.logToFloor(size) + 1
+ );
+
+ this.m_internalFormat = format;
+ this.m_format = format;
+ this.m_dataType = dataType;
+ };
+
+ es3fTextureSpecificationTests.RandomOrderTexImageCubeCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.TextureCubeSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ RandomOrderTexImageCubeCase.prototype.constructor =
+ es3fTextureSpecificationTests.RandomOrderTexImageCubeCase;
+
+ /**
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} size
+ * @return {es3fTextureSpecificationTests.RandomOrderTexImageCubeCase}
+ */
+ es3fTextureSpecificationTests.newRandomOrderTexImageCubeCaseInternal =
+ function(name, desc, internalFormat, size) {
+ // Sized internal format.
+ var fmt = gluTextureUtil.getTransferFormat(
+ gluTextureUtil.mapGLInternalFormat(internalFormat)
+ );
+ var testcase = new es3fTextureSpecificationTests.RandomOrderTexImageCubeCase(
+ name, desc, fmt.format, fmt.dataType, size
+ );
+ testcase.m_internalFormat = internalFormat;
+ return testcase;
+ };
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ RandomOrderTexImageCubeCase.prototype.createTexture =
+ function() {
+ var tex = null;
+ var levelData = new tcuTexture.TextureLevel(
+ this.m_texFormat, this.m_size, this.m_size
+ );
+ var rnd = new deRandom.Random(deString.deStringHash(this.fullName()));
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_CUBE_MAP, tex);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
+
+ // Level-face pairs.
+ var images = [];
+
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++)
+ for (var f in tcuTexture.CubeFace) {
+ var face = tcuTexture.CubeFace[f];
+ images[ndx * 6 + face] = {ndx: ndx, face: face};
+ }
+
+ images = rnd.shuffle(images);
+
+ for (var ndx = 0; ndx < images.length; ndx++) {
+ var levelNdx = images[ndx].ndx;
+ /** @type {framework.common.tcuTexture.CubeFace} */
+ var face = images[ndx].face;
+ var levelSize = Math.max(1, this.m_size >> levelNdx);
+
+ var gMin = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+ var gMax = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+
+ levelData.setSize(levelSize, levelSize);
+ tcuTextureUtil.fillWithComponentGradients(
+ levelData.getAccess(), gMin, gMax
+ );
+
+ this.m_context.texImage2D(
+ es3fTextureSpecificationTests.s_cubeMapFaces[face],
+ levelNdx, this.m_internalFormat, levelSize, levelSize, 0,
+ this.m_format, this.m_dataType,
+ levelData.getAccess().getDataPtr()
+ );
+ }
+ };
+
+ // TexImage2D() unpack alignment case.
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture2DSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} format
+ * @param {number} dataType
+ * @param {number} width
+ * @param {number} height
+ * @param {number} numLevels
+ * @param {number} alignment
+ */
+ es3fTextureSpecificationTests.TexImage2DAlignCase = function(
+ name, desc, format, dataType, width, height, numLevels, alignment
+ ) {
+ // Unsized internal format.
+ es3fTextureSpecificationTests.Texture2DSpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLTransferFormat(
+ format, dataType
+ ), width, height, numLevels
+ );
+
+ this.m_internalFormat = format;
+ this.m_format = format;
+ this.m_dataType = dataType;
+ this.m_alignment = alignment;
+ };
+
+ es3fTextureSpecificationTests.TexImage2DAlignCase.prototype = Object.create(
+ es3fTextureSpecificationTests.Texture2DSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ TexImage2DAlignCase.prototype.constructor =
+ es3fTextureSpecificationTests.TexImage2DAlignCase;
+
+ /**
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ * @param {number} numLevels
+ * @param {number} alignment
+ * @return {es3fTextureSpecificationTests.TexImage2DAlignCase}
+ */
+ es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal = function(
+ name, desc, internalFormat, width, height, numLevels, alignment
+ ) {
+ // Sized internal format.
+ var fmt = gluTextureUtil.getTransferFormat(
+ gluTextureUtil.mapGLInternalFormat(internalFormat)
+ );
+ var testcase = new es3fTextureSpecificationTests.TexImage2DAlignCase(
+ name, desc, fmt.format, fmt.dataType,
+ width, height, numLevels, alignment
+ );
+ testcase.m_internalFormat = internalFormat;
+ return testcase;
+ };
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.TexImage2DAlignCase.prototype.createTexture =
+ function() {
+ var tex = null;
+ /** @type {ArrayBuffer} */ var data;
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_2D, tex);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment);
+
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelW = Math.max(1, this.m_width >> ndx);
+ var levelH = Math.max(1, this.m_height >> ndx);
+ var colorA = deMath.add(
+ deMath.multiply(
+ [1.0, 0.0, 0.0, 1.0],
+ deMath.subtract(
+ this.m_texFormatInfo.valueMax,
+ this.m_texFormatInfo.valueMin
+ )
+ ), this.m_texFormatInfo.valueMin
+ );
+ var colorB = deMath.add(
+ deMath.multiply(
+ [0.0, 1.0, 0.0, 1.0],
+ deMath.subtract(
+ this.m_texFormatInfo.valueMax,
+ this.m_texFormatInfo.valueMin
+ )
+ ), this.m_texFormatInfo.valueMin
+ );
+
+ var rowPitch = deMath.deAlign32(
+ levelW * this.m_texFormat.getPixelSize(), this.m_alignment
+ );
+ var cellSize = Math.max(1, Math.min(levelW >> 2, levelH >> 2));
+ data = new ArrayBuffer(rowPitch * levelH);
+ var access = new tcuTexture.PixelBufferAccess({format: this.m_texFormat, width: levelW,
+ height: levelH, rowPitch: rowPitch, data: data}
+ );
+ tcuTextureUtil.fillWithGrid(access, cellSize, colorA, colorB
+ );
+
+ this.m_context.texImage2D(
+ gl.TEXTURE_2D, ndx, this.m_internalFormat, levelW, levelH, 0,
+ this.m_format, this.m_dataType,
+ access.getDataPtr()
+ );
+ }
+ };
+
+ // TexImageCube unpack alignment case.
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.TextureCubeSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} format
+ * @param {number} dataType
+ * @param {number} size
+ * @param {number} numLevels
+ * @param {number} alignment
+ */
+ es3fTextureSpecificationTests.TexImageCubeAlignCase = function(
+ name, desc, format, dataType, size, numLevels, alignment
+ ) {
+ // Unsized internal format.
+ es3fTextureSpecificationTests.TextureCubeSpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLTransferFormat(
+ format, dataType
+ ), size, numLevels
+ );
+
+ this.m_internalFormat = format;
+ this.m_format = format;
+ this.m_dataType = dataType;
+ this.m_alignment = alignment;
+ };
+
+ es3fTextureSpecificationTests.TexImageCubeAlignCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.TextureCubeSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ TexImageCubeAlignCase.prototype.constructor =
+ es3fTextureSpecificationTests.TexImageCubeAlignCase;
+
+ /**
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} size
+ * @param {number} numLevels
+ * @param {number} alignment
+ * @return {es3fTextureSpecificationTests.TexImageCubeAlignCase}
+ */
+ es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal =
+ function(name, desc, internalFormat, size, numLevels, alignment) {
+ // Sized internal format.
+ var fmt = gluTextureUtil.getTransferFormat(
+ gluTextureUtil.mapGLInternalFormat(internalFormat)
+ );
+ var testcase = new es3fTextureSpecificationTests.TexImageCubeAlignCase(
+ name, desc, fmt.format, fmt.dataType, size, numLevels, alignment
+ );
+ testcase.m_internalFormat = internalFormat;
+ return testcase;
+ };
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ TexImageCubeAlignCase.prototype.createTexture =
+ function() {
+ var tex = null;
+ var rnd = new deRandom.Random(deString.deStringHash(this.fullName()));
+ /** @type {ArrayBuffer} */ var data;
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_CUBE_MAP, tex);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment);
+
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelSize = Math.max(1, this.m_size >> ndx);
+ var cellSize = Math.max(1, levelSize >> 2);
+ var rowPitch = deMath.deAlign32(
+ this.m_texFormat.getPixelSize() * levelSize, this.m_alignment
+ );
+ var colorA = deMath.add(deMath.multiply(
+ [1.0, 0.0, 0.0, 1.0], deMath.subtract(
+ this.m_texFormatInfo.valueMax, this.m_texFormatInfo.valueMin
+ )), this.m_texFormatInfo.valueMin
+ );
+ var colorB = deMath.add(deMath.multiply(
+ [0.0, 1.0, 0.0, 1.0], deMath.subtract(
+ this.m_texFormatInfo.valueMax, this.m_texFormatInfo.valueMin
+ )), this.m_texFormatInfo.valueMin
+ );
+
+ data = new ArrayBuffer(rowPitch * levelSize);
+ var access = new tcuTexture.PixelBufferAccess({format: this.m_texFormat, width: levelSize,
+ height: levelSize, rowPitch: rowPitch, data: data}
+ );
+ tcuTextureUtil.fillWithGrid(access, cellSize, colorA, colorB
+ );
+
+ for (var f in tcuTexture.CubeFace) {
+ var face = tcuTexture.CubeFace[f];
+ this.m_context.texImage2D(
+ es3fTextureSpecificationTests.s_cubeMapFaces[face],
+ ndx, this.m_internalFormat, levelSize, levelSize, 0,
+ this.m_format, this.m_dataType,
+ access.getDataPtr()
+ );
+ }
+ }
+ };
+
+ // TexImage2D() unpack parameters case.
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture2DSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ * @param {number} rowLength
+ * @param {number} skipRows
+ * @param {number} skipPixels
+ * @param {number} alignment
+ */
+ es3fTextureSpecificationTests.TexImage2DParamsCase = function(
+ name, desc, internalFormat, width, height, rowLength, skipRows,
+ skipPixels, alignment
+ ) {
+ es3fTextureSpecificationTests.Texture2DSpecCase.call(
+ this, name, desc,
+ gluTextureUtil.mapGLInternalFormat(internalFormat),
+ width, height, 1
+ );
+ this.m_internalFormat = internalFormat;
+ this.m_rowLength = rowLength;
+ this.m_skipRows = skipRows;
+ this.m_skipPixels = skipPixels;
+ this.m_alignment = alignment;
+ };
+
+ es3fTextureSpecificationTests.TexImage2DParamsCase.prototype =
+ Object.create(es3fTextureSpecificationTests.Texture2DSpecCase.prototype);
+
+ es3fTextureSpecificationTests.TexImage2DParamsCase.prototype.constructor =
+ es3fTextureSpecificationTests.TexImage2DParamsCase;
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.TexImage2DParamsCase.prototype.createTexture =
+ function() {
+ var transferFmt = gluTextureUtil.getTransferFormat(this.m_texFormat);
+ var pixelSize = this.m_texFormat.getPixelSize();
+ var rowLength = this.m_rowLength > 0 ? this.m_rowLength : this.m_width;
+ var rowPitch = deMath.deAlign32(rowLength * pixelSize, this.m_alignment);
+ var height = this.m_height + this.m_skipRows;
+ var tex = null;
+ /** @type {ArrayBuffer} */ var data;
+
+ assertMsgOptions(
+ this.m_numLevels == 1, 'Number of levels different to 1',
+ false, true
+ );
+
+ // Fill data with grid.
+ data = new ArrayBuffer(rowPitch * height + this.m_skipPixels * pixelSize);
+
+ var cScale = deMath.subtract(
+ this.m_texFormatInfo.valueMax, this.m_texFormatInfo.valueMin
+ );
+ var cBias = this.m_texFormatInfo.valueMin;
+ var colorA = deMath.add(
+ deMath.multiply(
+ [1.0, 0.0, 0.0, 1.0], cScale
+ ), cBias
+ );
+ var colorB = deMath.add(
+ deMath.multiply(
+ [0.0, 1.0, 0.0, 1.0], cScale
+ ), cBias
+ );
+
+ var accessWithOffset = new tcuTexture.PixelBufferAccess({
+ format: this.m_texFormat,
+ width: this.m_width,
+ height: this.m_height,
+ rowPitch: rowPitch,
+ data: data,
+ offset: this.m_skipRows * rowPitch + this.m_skipPixels * pixelSize
+ });
+ tcuTextureUtil.fillWithGrid(accessWithOffset, 4, colorA, colorB
+ );
+ var access = new tcuTexture.PixelBufferAccess({
+ format: this.m_texFormat,
+ width: this.m_width,
+ height: this.m_height,
+ rowPitch: rowPitch,
+ data: data,
+ });
+
+ this.m_context.pixelStorei(gl.UNPACK_ROW_LENGTH, this.m_rowLength);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_ROWS, this.m_skipRows);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_PIXELS, this.m_skipPixels);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment);
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_2D, tex);
+ this.m_context.texImage2D(
+ gl.TEXTURE_2D, 0, this.m_internalFormat,
+ this.m_width, this.m_height, 0,
+ transferFmt.format, transferFmt.dataType, access.getDataPtr()
+ );
+ };
+
+ // TexImage3D() unpack parameters case.
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture3DSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ * @param {number} depth
+ * @param {number} imageHeight
+ * @param {number} rowLength
+ * @param {number} skipImages
+ * @param {number} skipRows
+ * @param {number} skipPixels
+ * @param {number} alignment
+ */
+ es3fTextureSpecificationTests.TexImage3DParamsCase = function(
+ name, desc, internalFormat, width, height, depth, imageHeight,
+ rowLength, skipImages, skipRows, skipPixels, alignment
+ ) {
+ es3fTextureSpecificationTests.Texture3DSpecCase.call(
+ this, name, desc,
+ gluTextureUtil.mapGLInternalFormat(internalFormat),
+ width, height, depth, 1
+ );
+
+ this.m_internalFormat = internalFormat;
+ this.m_imageHeight = imageHeight;
+ this.m_rowLength = rowLength;
+ this.m_skipImages = skipImages;
+ this.m_skipRows = skipRows;
+ this.m_skipPixels = skipPixels;
+ this.m_alignment = alignment;
+ };
+
+ es3fTextureSpecificationTests.TexImage3DParamsCase.prototype =
+ Object.create(es3fTextureSpecificationTests.Texture3DSpecCase.prototype);
+
+ es3fTextureSpecificationTests.TexImage3DParamsCase.prototype.constructor =
+ es3fTextureSpecificationTests.Texture3DSpecCase;
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.TexImage3DParamsCase.prototype.createTexture =
+ function() {
+ var transferFmt = gluTextureUtil.getTransferFormat(this.m_texFormat);
+ var pixelSize = this.m_texFormat.getPixelSize();
+ var rowLength = this.m_rowLength > 0 ? this.m_rowLength : this.m_width;
+ var rowPitch = deMath.deAlign32(rowLength * pixelSize, this.m_alignment);
+ var imageHeight = this.m_imageHeight > 0 ?
+ this.m_imageHeight : this.m_height;
+ var slicePitch = imageHeight * rowPitch;
+
+ var tex = null;
+ /** @type {ArrayBuffer} */ var data;
+
+ assertMsgOptions(
+ this.m_numLevels == 1, 'Number of levels different to 1',
+ false, true
+ );
+
+ // Fill data with grid.
+ data = new ArrayBuffer(slicePitch * (this.m_depth + this.m_skipImages) +
+ this.m_skipRows * rowPitch + this.m_skipPixels * pixelSize);
+
+ var cScale = deMath.subtract(
+ this.m_texFormatInfo.valueMax, this.m_texFormatInfo.valueMin
+ );
+ var cBias = this.m_texFormatInfo.valueMin;
+ var colorA = deMath.add(
+ deMath.multiply(
+ [1.0, 0.0, 0.0, 1.0], cScale
+ ), cBias
+ );
+ var colorB = deMath.add(
+ deMath.multiply(
+ [0.0, 1.0, 0.0, 1.0], cScale
+ ), cBias
+ );
+
+ var accessWithOffset = new tcuTexture.PixelBufferAccess({
+ format: this.m_texFormat,
+ width: this.m_width,
+ height: this.m_height,
+ depth: this.m_depth,
+ rowPitch: rowPitch,
+ slicePitch: slicePitch,
+ data: data,
+ offset: this.m_skipImages * slicePitch + this.m_skipRows * rowPitch + this.m_skipPixels * pixelSize
+ });
+ var access = new tcuTexture.PixelBufferAccess({
+ format: this.m_texFormat,
+ width: this.m_width,
+ height: this.m_height,
+ depth: this.m_depth,
+ rowPitch: rowPitch,
+ slicePitch: slicePitch,
+ data: data
+ });
+ tcuTextureUtil.fillWithGrid(
+ accessWithOffset, 4, colorA, colorB
+ );
+
+ this.m_context.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, this.m_imageHeight);
+ this.m_context.pixelStorei(gl.UNPACK_ROW_LENGTH, this.m_rowLength);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_IMAGES, this.m_skipImages);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_ROWS, this.m_skipRows);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_PIXELS, this.m_skipPixels);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment);
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_3D, tex);
+ this.m_context.texImage3D(
+ gl.TEXTURE_3D, 0, this.m_internalFormat,
+ this.m_width, this.m_height, this.m_depth, 0,
+ transferFmt.format, transferFmt.dataType, access.getDataPtr()
+ );
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture2DSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} format
+ * @param {number} dataType
+ * @param {number} width
+ * @param {number} height
+ */
+ es3fTextureSpecificationTests.BasicTexSubImage2DCase = function(
+ name, desc, format, dataType, width, height
+ ) {
+ es3fTextureSpecificationTests.Texture2DSpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLTransferFormat(
+ format, dataType
+ ), width, height, es3fTextureSpecificationTests.maxLevelCount(
+ width, height
+ )
+ );
+
+ this.m_format = format;
+ this.m_internalFormat = format;
+ this.m_dataType = dataType;
+ };
+
+ es3fTextureSpecificationTests.BasicTexSubImage2DCase.prototype =
+ Object.create(es3fTextureSpecificationTests.Texture2DSpecCase.prototype);
+
+ es3fTextureSpecificationTests.BasicTexSubImage2DCase.prototype.constructor =
+ es3fTextureSpecificationTests.BasicTexSubImage2DCase;
+
+ /**
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ * @return {es3fTextureSpecificationTests.BasicTexSubImage2DCase}
+ */
+ es3fTextureSpecificationTests.newBasicTexSubImage2DCaseInternal =
+ function(name, desc, internalFormat, width, height) {
+ // Sized internal format.
+ var fmt = gluTextureUtil.getTransferFormat(
+ gluTextureUtil.mapGLInternalFormat(internalFormat)
+ );
+ var testcase = new es3fTextureSpecificationTests.BasicTexSubImage2DCase(
+ name, desc, fmt.format, fmt.dataType, width, height
+ );
+ testcase.m_internalFormat = internalFormat;
+ return testcase;
+ };
+
+ /**
+ */
+ es3fTextureSpecificationTests.
+ BasicTexSubImage2DCase.prototype.createTexture = function() {
+ var tex = null;
+ var data = new tcuTexture.TextureLevel(
+ this.m_texFormat, this.m_width, this.m_height
+ );
+ var rnd = new deRandom.Random(deString.deStringHash(this.fullName()));
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_2D, tex);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
+
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelW = Math.max(1, this.m_width >> ndx);
+ var levelH = Math.max(1, this.m_height >> ndx);
+ var gMin = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+ var gMax = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+
+ data.setSize(levelW, levelH);
+ tcuTextureUtil.fillWithComponentGradients(
+ data.getAccess(), gMin, gMax
+ );
+
+ this.m_context.texImage2D(
+ gl.TEXTURE_2D, ndx, this.m_internalFormat, levelW, levelH, 0,
+ this.m_format, this.m_dataType,
+ data.getAccess().getDataPtr()
+ );
+ }
+
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelW = Math.max(1, this.m_width >> ndx);
+ var levelH = Math.max(1, this.m_height >> ndx);
+
+ var w = rnd.getInt(1, levelW);
+ var h = rnd.getInt(1, levelH);
+ var x = rnd.getInt(0, levelW - w);
+ var y = rnd.getInt(0, levelH - h);
+
+ var colorA = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+ var colorB = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+ var cellSize = rnd.getInt(2, 16);
+
+ data.setSize(w, h);
+ tcuTextureUtil.fillWithGrid(
+ data.getAccess(), cellSize, colorA, colorB
+ );
+
+ this.m_context.texSubImage2D(
+ gl.TEXTURE_2D, ndx, x, y, w, h, this.m_format, this.m_dataType,
+ data.getAccess().getDataPtr()
+ );
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.TextureCubeSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} format
+ * @param {number} dataType
+ * @param {number} size
+ */
+ es3fTextureSpecificationTests.BasicTexSubImageCubeCase = function(
+ name, desc, format, dataType, size
+ ) {
+ es3fTextureSpecificationTests.TextureCubeSpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLTransferFormat(
+ format, dataType
+ ), size, deMath.logToFloor(size) + 1
+ );
+
+ this.m_internalFormat = format;
+ this.m_format = format;
+ this.m_dataType = dataType;
+ };
+
+ es3fTextureSpecificationTests.BasicTexSubImageCubeCase.prototype =
+ Object.create(es3fTextureSpecificationTests.TextureCubeSpecCase.prototype);
+
+ es3fTextureSpecificationTests.
+ BasicTexSubImageCubeCase.prototype.constructor =
+ es3fTextureSpecificationTests.BasicTexSubImageCubeCase;
+
+ /**
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} size
+ */
+ es3fTextureSpecificationTests.newBasicTexSubImageCubeCaseInternal =
+ function(name, desc, internalFormat, size) {
+ // Sized internal format.
+ var fmt = gluTextureUtil.getTransferFormat(
+ gluTextureUtil.mapGLInternalFormat(internalFormat)
+ );
+ var testcase =
+ new es3fTextureSpecificationTests.BasicTexSubImageCubeCase(
+ name, desc, fmt.format, fmt.dataType,
+ size);
+ testcase.m_internalFormat = internalFormat;
+ return testcase;
+ };
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ BasicTexSubImageCubeCase.prototype.createTexture = function() {
+ var tex = null;
+ var data = new tcuTexture.TextureLevel(
+ this.m_texFormat, this.m_size, this.m_size
+ );
+ var rnd = new deRandom.Random(deString.deStringHash(this.fullName()));
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_CUBE_MAP, tex);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
+
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelSize = Math.max(1, this.m_size >> ndx);
+ data.setSize(levelSize, levelSize);
+
+ for (var face = /** @type {tcuTexture.CubeFace} */ (0);
+ face < es3fTextureSpecificationTests.s_cubeMapFaces.length;
+ face++) {
+ var gMin = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+ var gMax = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+
+ tcuTextureUtil.fillWithComponentGradients(
+ data.getAccess(), gMin, gMax
+ );
+
+ this.m_context.texImage2D(
+ es3fTextureSpecificationTests.s_cubeMapFaces[face], ndx,
+ this.m_internalFormat, levelSize, levelSize, 0,
+ this.m_format, this.m_dataType,
+ data.getAccess().getDataPtr()
+ );
+ }
+ }
+
+ // Re-specify parts of each face and level.
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelSize = Math.max(1, this.m_size >> ndx);
+
+ for (var f in tcuTexture.CubeFace) {
+ var face = tcuTexture.CubeFace[f];
+
+ var w = rnd.getInt(1, levelSize);
+ var h = rnd.getInt(1, levelSize);
+ var x = rnd.getInt(0, levelSize - w);
+ var y = rnd.getInt(0, levelSize - h);
+
+ var colorA = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+ var colorB = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+ var cellSize = rnd.getInt(2, 16);
+
+ data.setSize(w, h);
+ tcuTextureUtil.fillWithGrid(
+ data.getAccess(), cellSize, colorA, colorB
+ );
+
+ this.m_context.texSubImage2D(
+ es3fTextureSpecificationTests.s_cubeMapFaces[face],
+ ndx, x, y, w, h, this.m_format,
+ this.m_dataType, data.getAccess().getDataPtr()
+ );
+ }
+ }
+ };
+
+ // TexSubImage2D() unpack parameters case.
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture2DSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ * @param {number} subX
+ * @param {number} subY
+ * @param {number} subW
+ * @param {number} subH
+ * @param {number} rowLength
+ * @param {number} skipRows
+ * @param {number} skipPixels
+ * @param {number} alignment
+ */
+ es3fTextureSpecificationTests.TexSubImage2DParamsCase = function(
+ name, desc, internalFormat, width, height, subX, subY, subW, subH,
+ rowLength, skipRows, skipPixels, alignment
+ ) {
+ es3fTextureSpecificationTests.Texture2DSpecCase.call(
+ this, name, desc,
+ gluTextureUtil.mapGLInternalFormat(internalFormat),
+ width, height, 1
+ );
+ this.m_internalFormat = internalFormat;
+ this.m_subX = subX;
+ this.m_subY = subY;
+ this.m_subW = subW;
+ this.m_subH = subH;
+ this.m_rowLength = rowLength;
+ this.m_skipRows = skipRows;
+ this.m_skipPixels = skipPixels;
+ this.m_alignment = alignment;
+ };
+
+ es3fTextureSpecificationTests.TexSubImage2DParamsCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.Texture2DSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ TexSubImage2DParamsCase.prototype.constructor =
+ es3fTextureSpecificationTests.TexSubImage2DParamsCase;
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ TexSubImage2DParamsCase.prototype.createTexture = function() {
+ var transferFmt = gluTextureUtil.getTransferFormat(this.m_texFormat);
+ var pixelSize = this.m_texFormat.getPixelSize();
+ var tex = null;
+ /** @type {ArrayBuffer} */ var data;
+
+ assertMsgOptions(
+ this.m_numLevels == 1, 'Number of levels different to 1',
+ false, true
+ );
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_2D, tex);
+
+ // First fill texture with gradient.
+ data = new ArrayBuffer(
+ deMath.deAlign32(this.m_width * pixelSize, 4) * this.m_height
+ );
+ var access = new tcuTexture.PixelBufferAccess({
+ format: this.m_texFormat,
+ width: this.m_width,
+ height: this.m_height,
+ rowPitch: deMath.deAlign32(this.m_width * pixelSize, 4),
+ data: data
+ });
+ tcuTextureUtil.fillWithComponentGradients(access, this.m_texFormatInfo.valueMin, this.m_texFormatInfo.valueMax
+ );
+ this.m_context.texImage2D(
+ gl.TEXTURE_2D, 0, this.m_internalFormat, this.m_width,
+ this.m_height, 0, transferFmt.format, transferFmt.dataType,
+ access.getDataPtr()
+ );
+
+ // Fill data with grid.
+ var rowLength = this.m_rowLength > 0 ? this.m_rowLength : this.m_subW;
+ var rowPitch = deMath.deAlign32(rowLength * pixelSize, this.m_alignment);
+ var height = this.m_subH + this.m_skipRows;
+ var cScale = deMath.subtract(
+ this.m_texFormatInfo.valueMax, this.m_texFormatInfo.valueMin
+ );
+ var cBias = this.m_texFormatInfo.valueMin;
+ var colorA = deMath.add(
+ deMath.multiply(
+ [1.0, 0.0, 0.0, 1.0], cScale
+ ), cBias
+ );
+ var colorB = deMath.add(
+ deMath.multiply(
+ [0.0, 1.0, 0.0, 1.0], cScale
+ ), cBias
+ );
+
+ data = new ArrayBuffer(rowPitch * height + this.m_skipPixels * pixelSize);
+ tcuTextureUtil.fillWithGrid(
+ new tcuTexture.PixelBufferAccess({
+ format: this.m_texFormat,
+ width: this.m_subW,
+ height: this.m_subH,
+ rowPitch: rowPitch,
+ data: data,
+ offset: this.m_skipRows * rowPitch + this.m_skipPixels * pixelSize
+ }) ,
+ 4, colorA, colorB
+ );
+
+ access = new tcuTexture.PixelBufferAccess({
+ format: this.m_texFormat,
+ width: this.m_subW,
+ height: this.m_subH,
+ rowPitch: rowPitch,
+ data: data
+ });
+ this.m_context.pixelStorei(gl.UNPACK_ROW_LENGTH, this.m_rowLength);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_ROWS, this.m_skipRows);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_PIXELS, this.m_skipPixels);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment);
+ this.m_context.texSubImage2D(
+ gl.TEXTURE_2D, 0, this.m_subX, this.m_subY,
+ this.m_subW, this.m_subH,
+ transferFmt.format, transferFmt.dataType,
+ access.getDataPtr()
+ );
+ };
+
+ // Basic TexSubImage3D() with 3D texture usage
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture3DSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ * @param {number} depth
+ */
+ es3fTextureSpecificationTests.BasicTexSubImage3DCase = function(
+ name, desc, internalFormat, width, height, depth
+ ) {
+ es3fTextureSpecificationTests.Texture3DSpecCase.call(
+ this, name, desc,
+ gluTextureUtil.mapGLInternalFormat(internalFormat),
+ width, height, depth, es3fTextureSpecificationTests.maxLevelCount(
+ width, height, depth
+ )
+ );
+
+ this.m_internalFormat = internalFormat;
+ };
+
+ es3fTextureSpecificationTests.BasicTexSubImage3DCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.Texture3DSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.BasicTexSubImage3DCase.prototype.constructor =
+ es3fTextureSpecificationTests.BasicTexSubImage3DCase;
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ BasicTexSubImage3DCase.prototype.createTexture = function() {
+ var tex = null;
+ var data = new tcuTexture.TextureLevel(
+ this.m_texFormat, this.m_width, this.m_height
+ );
+ var rnd = new deRandom.Random(deString.deStringHash(this.fullName()));
+ var transferFmt = gluTextureUtil.getTransferFormat(this.m_texFormat);
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_3D, tex);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
+
+ // First specify full texture.
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelW = Math.max(1, this.m_width >> ndx);
+ var levelH = Math.max(1, this.m_height >> ndx);
+ var levelD = Math.max(1, this.m_depth >> ndx);
+
+ var gMin = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+ var gMax = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+
+ data.setSize(levelW, levelH, levelD);
+ tcuTextureUtil.fillWithComponentGradients(
+ data.getAccess(), gMin, gMax
+ );
+
+ this.m_context.texImage3D(
+ gl.TEXTURE_3D, ndx, this.m_internalFormat, levelW, levelH,
+ levelD, 0, transferFmt.format, transferFmt.dataType,
+ data.getAccess().getDataPtr()
+ );
+ }
+
+ // Re-specify parts of each level.
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelW = Math.max(1, this.m_width >> ndx);
+ var levelH = Math.max(1, this.m_height >> ndx);
+ var levelD = Math.max(1, this.m_depth >> ndx);
+
+ var w = rnd.getInt(1, levelW);
+ var h = rnd.getInt(1, levelH);
+ var d = rnd.getInt(1, levelD);
+ var x = rnd.getInt(0, levelW - w);
+ var y = rnd.getInt(0, levelH - h);
+ var z = rnd.getInt(0, levelD - d);
+
+ var colorA = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+ var colorB = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+ var cellSize = rnd.getInt(2, 16);
+
+ data.setSize(w, h, d);
+ tcuTextureUtil.fillWithGrid(
+ data.getAccess(), cellSize, colorA, colorB
+ );
+
+ this.m_context.texSubImage3D(
+ gl.TEXTURE_3D, ndx, x, y, z, w, h, d,
+ transferFmt.format, transferFmt.dataType,
+ data.getAccess().getDataPtr()
+ );
+ }
+ };
+
+ // TexSubImage2D() to texture initialized with empty data
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture2DSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} format
+ * @param {number} dataType
+ * @param {number} width
+ * @param {number} height
+ */
+ es3fTextureSpecificationTests.TexSubImage2DEmptyTexCase = function(
+ name, desc, format, dataType, width, height
+ ) {
+ es3fTextureSpecificationTests.Texture2DSpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLTransferFormat(
+ format, dataType
+ ), width, height, es3fTextureSpecificationTests.maxLevelCount(
+ width, height
+ )
+ );
+
+ this.m_format = format;
+ this.m_internalFormat = format;
+ this.m_dataType = dataType;
+ };
+
+ es3fTextureSpecificationTests.TexSubImage2DEmptyTexCase.prototype =
+ Object.create(es3fTextureSpecificationTests.Texture2DSpecCase.prototype);
+
+ es3fTextureSpecificationTests.
+ TexSubImage2DEmptyTexCase.prototype.constructor =
+ es3fTextureSpecificationTests.TexSubImage2DEmptyTexCase;
+
+ /**
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ */
+ es3fTextureSpecificationTests.newTexSubImage2DEmptyTexCaseInternal =
+ function(name, desc, internalFormat, width, height) {
+ // Sized internal format.
+ var fmt = gluTextureUtil.getTransferFormat(
+ gluTextureUtil.mapGLInternalFormat(internalFormat)
+ );
+ var testcase =
+ new es3fTextureSpecificationTests.TexSubImage2DEmptyTexCase(
+ name, desc, fmt.format, fmt.dataType, width, height
+ );
+ testcase.m_internalFormat = internalFormat;
+ return testcase;
+ };
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ TexSubImage2DEmptyTexCase.prototype.createTexture = function() {
+ var tex = null;
+ var data = new tcuTexture.TextureLevel(
+ this.m_texFormat, this.m_width, this.m_height
+ );
+ var rnd = new deRandom.Random(deString.deStringHash(this.fullName()));
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_2D, tex);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
+
+ // First allocate storage for each level.
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelW = Math.max(1, this.m_width >> ndx);
+ var levelH = Math.max(1, this.m_height >> ndx);
+
+ this.m_context.texImage2D(
+ gl.TEXTURE_2D, ndx, this.m_internalFormat, levelW, levelH, 0,
+ this.m_format, this.m_dataType,
+ null
+ );
+ }
+
+ // Specify pixel data to all levels using glTexSubImage2D()
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelW = Math.max(1, this.m_width >> ndx);
+ var levelH = Math.max(1, this.m_height >> ndx);
+ var gMin = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+ var gMax = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+
+ data.setSize(levelW, levelH);
+ tcuTextureUtil.fillWithComponentGradients(
+ data.getAccess(), gMin, gMax
+ );
+
+ this.m_context.texSubImage2D(
+ gl.TEXTURE_2D, ndx, 0, 0, levelW, levelH,
+ this.m_format, this.m_dataType,
+ data.getAccess().getDataPtr()
+ );
+ }
+ };
+
+ // TexSubImage2D() to empty cubemap texture
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.TextureCubeSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} format
+ * @param {number} dataType
+ * @param {number} size
+ */
+ es3fTextureSpecificationTests.TexSubImageCubeEmptyTexCase = function(
+ name, desc, format, dataType, size
+ ) {
+ // Unsized internal format.
+ es3fTextureSpecificationTests.TextureCubeSpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLTransferFormat(
+ format, dataType
+ ), size, deMath.logToFloor(size) + 1
+ );
+
+ this.m_internalFormat = format;
+ this.m_format = format;
+ this.m_dataType = dataType;
+ };
+
+ es3fTextureSpecificationTests.TexSubImageCubeEmptyTexCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.TextureCubeSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ TexSubImageCubeEmptyTexCase.prototype.constructor =
+ es3fTextureSpecificationTests.TexSubImageCubeEmptyTexCase;
+
+ /**
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} size
+ * @return {es3fTextureSpecificationTests.TexSubImageCubeEmptyTexCase}
+ */
+ es3fTextureSpecificationTests.newTexSubImageCubeEmptyTexCaseInternal =
+ function(name, desc, internalFormat, size) {
+ // Sized internal format.
+ var fmt = gluTextureUtil.getTransferFormat(
+ gluTextureUtil.mapGLInternalFormat(internalFormat)
+ );
+ var testcase =
+ new es3fTextureSpecificationTests.TexSubImageCubeEmptyTexCase(
+ name, desc, fmt.format, fmt.dataType, size
+ );
+ testcase.m_internalFormat = internalFormat;
+ return testcase;
+ };
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ TexSubImageCubeEmptyTexCase.prototype.createTexture =
+ function() {
+ var tex = null;
+ var data = new tcuTexture.TextureLevel(
+ this.m_texFormat, this.m_size, this.m_size
+ );
+ var rnd = new deRandom.Random(deString.deStringHash(this.fullName()));
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_CUBE_MAP, tex);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
+
+ // Specify storage for each level.
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelSize = Math.max(1, this.m_size >> ndx);
+
+ for (var f in tcuTexture.CubeFace) {
+ var face = tcuTexture.CubeFace[f];
+ this.m_context.texImage2D(
+ es3fTextureSpecificationTests.s_cubeMapFaces[face],
+ ndx, this.m_internalFormat, levelSize, levelSize, 0,
+ this.m_format, this.m_dataType,
+ null
+ );
+ }
+ }
+
+ // Specify data using glTexSubImage2D()
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelSize = Math.max(1, this.m_size >> ndx);
+
+ data.setSize(levelSize, levelSize);
+
+ for (var f in tcuTexture.CubeFace) {
+ var face = tcuTexture.CubeFace[f];
+ var gMin = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+ var gMax = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+
+ tcuTextureUtil.fillWithComponentGradients(
+ data.getAccess(), gMin, gMax
+ );
+
+ this.m_context.texSubImage2D(
+ es3fTextureSpecificationTests.s_cubeMapFaces[face],
+ ndx, 0, 0, levelSize, levelSize, this.m_format,
+ this.m_dataType, data.getAccess().getDataPtr()
+ );
+ }
+ }
+ };
+
+ // TexSubImage2D() unpack alignment with 2D texture
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture2DSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} format
+ * @param {number} dataType
+ * @param {number} width
+ * @param {number} height
+ * @param {number} subX
+ * @param {number} subY
+ * @param {number} subW
+ * @param {number} subH
+ * @param {number} alignment
+ */
+ es3fTextureSpecificationTests.TexSubImage2DAlignCase = function(
+ name, desc, format, dataType, width, height, subX, subY, subW, subH,
+ alignment
+ ) {
+ // Unsized internal format.
+ es3fTextureSpecificationTests.Texture2DSpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLTransferFormat(
+ format, dataType
+ ), width, height, 1
+ );
+
+ this.m_internalFormat = format;
+ this.m_format = format;
+ this.m_dataType = dataType;
+ this.m_subX = subX;
+ this.m_subY = subY;
+ this.m_subW = subW;
+ this.m_subH = subH;
+ this.m_alignment = alignment;
+ };
+
+ es3fTextureSpecificationTests.TexSubImage2DAlignCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.Texture2DSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ TexSubImage2DAlignCase.prototype.constructor =
+ es3fTextureSpecificationTests.TexSubImage2DAlignCase;
+
+ /**
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ * @param {number} subX
+ * @param {number} subY
+ * @param {number} subW
+ * @param {number} subH
+ * @param {number} alignment
+ * @return {es3fTextureSpecificationTests.TexSubImage2DAlignCase}
+ */
+ es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal = function(
+ name, desc, internalFormat, width, height, subX, subY, subW, subH,
+ alignment
+ ) {
+ // Sized internal format.
+ var fmt = gluTextureUtil.getTransferFormat(
+ gluTextureUtil.mapGLInternalFormat(internalFormat)
+ );
+ var testcase = new es3fTextureSpecificationTests.TexSubImage2DAlignCase(
+ name, desc, fmt.format, fmt.dataType,
+ width, height, subX, subY, subW, subH, alignment
+ );
+ testcase.m_internalFormat = internalFormat;
+ return testcase;
+ };
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ TexSubImage2DAlignCase.prototype.createTexture = function() {
+ var tex = null;
+ /** @type {ArrayBuffer} */ var data;
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_2D, tex);
+
+ // Specify base level.
+ data = new ArrayBuffer(this.m_texFormat.getPixelSize() *
+ this.m_width * this.m_height
+ );
+ var access = new tcuTexture.PixelBufferAccess({
+ format: this.m_texFormat,
+ width: this.m_width,
+ height: this.m_height,
+ data: data
+ });
+ tcuTextureUtil.fillWithComponentGradients(access, [0, 0, 0, 0], [1, 1, 1, 1]);
+
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
+ this.m_context.texImage2D(gl.TEXTURE_2D, 0, this.m_internalFormat,
+ this.m_width, this.m_height, 0, this.m_format, this.m_dataType,
+ access.getDataPtr()
+ );
+
+ // Re-specify subrectangle.
+ var rowPitch = deMath.deAlign32(
+ this.m_texFormat.getPixelSize() * this.m_subW, this.m_alignment
+ );
+ data = new ArrayBuffer(rowPitch * this.m_subH);
+ access = new tcuTexture.PixelBufferAccess({
+ format: this.m_texFormat,
+ width: this.m_subW,
+ height: this.m_subH,
+ rowPitch: rowPitch,
+ data: data
+ });
+ tcuTextureUtil.fillWithGrid(access, 4, [1, 0, 0, 1], [0, 1, 0, 1]
+ );
+
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment);
+ this.m_context.texSubImage2D(
+ gl.TEXTURE_2D, 0, this.m_subX, this.m_subY, this.m_subW,
+ this.m_subH, this.m_format, this.m_dataType, access.getDataPtr()
+ );
+ };
+
+ // TexSubImage2D() unpack alignment with cubemap texture
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.TextureCubeSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} format
+ * @param {number} dataType
+ * @param {number} size
+ * @param {number} subX
+ * @param {number} subY
+ * @param {number} subW
+ * @param {number} subH
+ * @param {number} alignment
+ */
+ es3fTextureSpecificationTests.TexSubImageCubeAlignCase = function(
+ name, desc, format, dataType, size, subX, subY, subW, subH, alignment
+ ) {
+ // Unsized internal format.
+ es3fTextureSpecificationTests.TextureCubeSpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLTransferFormat(
+ format, dataType
+ ), size, 1
+ );
+
+ this.m_internalFormat = format;
+ this.m_format = format;
+ this.m_dataType = dataType;
+ this.m_subX = subX;
+ this.m_subY = subY;
+ this.m_subW = subW;
+ this.m_subH = subH;
+ this.m_alignment = alignment;
+ };
+
+ es3fTextureSpecificationTests.TexSubImageCubeAlignCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.TextureCubeSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ TexSubImageCubeAlignCase.prototype.constructor =
+ es3fTextureSpecificationTests.TexSubImageCubeAlignCase;
+
+ /**
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} size
+ * @param {number} subX
+ * @param {number} subY
+ * @param {number} subW
+ * @param {number} subH
+ * @param {number} alignment
+ * @return {es3fTextureSpecificationTests.TexSubImageCubeAlignCase}
+ */
+ es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal =
+ function(
+ name, desc, internalFormat, size,
+ subX, subY, subW, subH, alignment
+ ) {
+ // Sized internal format.
+ var fmt = gluTextureUtil.getTransferFormat(
+ gluTextureUtil.mapGLInternalFormat(internalFormat)
+ );
+ var testcase =
+ new es3fTextureSpecificationTests.TexSubImageCubeAlignCase(
+ name, desc, fmt.format, fmt.dataType, size,
+ subX, subY, subW, subH, alignment
+ );
+ testcase.m_internalFormat = internalFormat;
+ return testcase;
+ };
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ TexSubImageCubeAlignCase.prototype.createTexture =
+ function() {
+ var tex = null;
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_CUBE_MAP, tex);
+
+ var data = new ArrayBuffer(this.m_texFormat.getPixelSize() * this.m_size * this.m_size);
+ var access = new tcuTexture.PixelBufferAccess({
+ format: this.m_texFormat,
+ width: this.m_size,
+ height: this.m_size,
+ data: data
+ });
+ tcuTextureUtil.fillWithComponentGradients(access, [0, 0, 0, 0], [1, 1, 1, 1]
+ );
+
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
+ for (var f in tcuTexture.CubeFace) {
+ var face = tcuTexture.CubeFace[f];
+ this.m_context.texImage2D(
+ es3fTextureSpecificationTests.s_cubeMapFaces[face],
+ 0, this.m_internalFormat, this.m_size, this.m_size, 0,
+ this.m_format, this.m_dataType,
+ access.getDataPtr()
+ );
+ }
+
+ // Re-specify subrectangle.
+ var rowPitch = deMath.deAlign32(
+ this.m_texFormat.getPixelSize() * this.m_subW, this.m_alignment
+ );
+ data = new ArrayBuffer(rowPitch * this.m_subH);
+ access = new tcuTexture.PixelBufferAccess({
+ format: this.m_texFormat,
+ width: this.m_subW,
+ height: this.m_subH,
+ rowPitch: rowPitch,
+ data: data
+ });
+ tcuTextureUtil.fillWithGrid(access, 4, [1, 0, 0, 1], [0, 1, 0, 1]
+ );
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment);
+ for (var f in tcuTexture.CubeFace) {
+ var face = tcuTexture.CubeFace[f];
+ this.m_context.texSubImage2D(
+ es3fTextureSpecificationTests.s_cubeMapFaces[face],
+ 0, this.m_subX, this.m_subY, this.m_subW, this.m_subH,
+ this.m_format, this.m_dataType, access.getDataPtr()
+ );
+ }
+ };
+
+ // TexSubImage3D() unpack parameters case.
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture3DSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ * @param {number} depth
+ * @param {number} subX ,
+ * @param {number} subY ,
+ * @param {number} subZ ,
+ * @param {number} subW ,
+ * @param {number} subH ,
+ * @param {number} subD ,
+ * @param {number} imageHeight ,
+ * @param {number} rowLength ,
+ * @param {number} skipImages ,
+ * @param {number} skipRows ,
+ * @param {number} skipPixels ,
+ * @param {number} alignment
+ */
+ es3fTextureSpecificationTests.TexSubImage3DParamsCase = function(
+ name, desc, internalFormat, width, height, depth,
+ subX, subY, subZ, subW, subH, subD,
+ imageHeight, rowLength, skipImages, skipRows, skipPixels, alignment
+ ) {
+ es3fTextureSpecificationTests.Texture3DSpecCase.call(
+ this, name, desc,
+ gluTextureUtil.mapGLInternalFormat(internalFormat),
+ width, height, depth, 1
+ );
+
+ this.m_internalFormat = internalFormat;
+ this.m_subX = subX;
+ this.m_subY = subY;
+ this.m_subZ = subZ;
+ this.m_subW = subW;
+ this.m_subH = subH;
+ this.m_subD = subD;
+ this.m_imageHeight = imageHeight;
+ this.m_rowLength = rowLength;
+ this.m_skipImages = skipImages;
+ this.m_skipRows = skipRows;
+ this.m_skipPixels = skipPixels;
+ this.m_alignment = alignment;
+ };
+
+ es3fTextureSpecificationTests.TexSubImage3DParamsCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.Texture3DSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ TexSubImage3DParamsCase.prototype.constructor =
+ es3fTextureSpecificationTests.TexSubImage3DParamsCase;
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ TexSubImage3DParamsCase.prototype.createTexture = function() {
+ var transferFmt = gluTextureUtil.getTransferFormat(this.m_texFormat);
+ var pixelSize = this.m_texFormat.getPixelSize();
+ var tex = null;
+ var rowPitch = deMath.deAlign32(pixelSize * this.m_width, 4);
+ var slicePitch = rowPitch * this.m_height;
+ assertMsgOptions(
+ this.m_numLevels == 1, 'Numbel of levels different than 1',
+ false, true
+ );
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_3D, tex);
+
+ // Fill with gradient.
+
+ var data = new ArrayBuffer(slicePitch * this.m_depth);
+ var access = new tcuTexture.PixelBufferAccess({
+ format: this.m_texFormat,
+ width: this.m_width,
+ height: this.m_height,
+ depth: this.m_depth,
+ rowPitch: rowPitch,
+ slicePitch: slicePitch,
+ data: data
+ });
+ tcuTextureUtil.fillWithComponentGradients(access, this.m_texFormatInfo.valueMin, this.m_texFormatInfo.valueMax);
+
+ this.m_context.texImage3D(
+ gl.TEXTURE_3D, 0, this.m_internalFormat, this.m_width,
+ this.m_height, this.m_depth, 0, transferFmt.format,
+ transferFmt.dataType, access.getDataPtr()
+ );
+
+ // Fill data with grid.
+ var rowLength = this.m_rowLength > 0 ? this.m_rowLength : this.m_subW;
+ rowPitch = deMath.deAlign32(rowLength * pixelSize, this.m_alignment);
+ var imageHeight = this.m_imageHeight > 0 ? this.m_imageHeight : this.m_subH;
+ slicePitch = imageHeight * rowPitch;
+ var cScale = deMath.subtract(this.m_texFormatInfo.valueMax, this.m_texFormatInfo.valueMin);
+ var cBias = this.m_texFormatInfo.valueMin;
+ var colorA = deMath.add(
+ deMath.multiply([1.0, 0.0, 0.0, 1.0], cScale), cBias
+ );
+ var colorB = deMath.add(
+ deMath.multiply([0.0, 1.0, 0.0, 1.0], cScale), cBias
+ );
+
+ data = new ArrayBuffer(slicePitch * (this.m_depth + this.m_skipImages) +
+ this.m_skipRows * rowPitch + this.m_skipPixels * pixelSize);
+ var accessWithOffset = new tcuTexture.PixelBufferAccess({
+ format: this.m_texFormat,
+ width: this.m_subW,
+ height: this.m_subH,
+ depth: this.m_subD,
+ rowPitch: rowPitch,
+ slicePitch: slicePitch,
+ data: data,
+ offset: this.m_skipImages * slicePitch + this.m_skipRows * rowPitch + this.m_skipPixels * pixelSize
+ });
+ access = new tcuTexture.PixelBufferAccess({
+ format: this.m_texFormat,
+ width: this.m_subW,
+ height: this.m_subH,
+ depth: this.m_subD,
+ rowPitch: rowPitch,
+ slicePitch: slicePitch,
+ data: data
+ });
+ tcuTextureUtil.fillWithGrid(accessWithOffset, 4, colorA, colorB);
+
+ this.m_context.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, this.m_imageHeight);
+ this.m_context.pixelStorei(gl.UNPACK_ROW_LENGTH, this.m_rowLength);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_IMAGES, this.m_skipImages);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_ROWS, this.m_skipRows);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_PIXELS, this.m_skipPixels);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment);
+ this.m_context.texSubImage3D(
+ gl.TEXTURE_3D, 0, this.m_subX, this.m_subY, this.m_subZ,
+ this.m_subW, this.m_subH, this.m_subD,
+ transferFmt.format, transferFmt.dataType, access.getDataPtr()
+ );
+ };
+
+ // Basic CopyTexImage2D() with 2D texture usage
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture2DSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ */
+ es3fTextureSpecificationTests.BasicCopyTexImage2DCase = function(
+ name, desc, internalFormat, width, height
+ ) {
+ es3fTextureSpecificationTests.Texture2DSpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLTransferFormat(
+ internalFormat, gl.UNSIGNED_BYTE
+ ), width, height, es3fTextureSpecificationTests.maxLevelCount(
+ width, height
+ )
+ );
+
+ this.m_internalFormat = internalFormat;
+ };
+
+ es3fTextureSpecificationTests.BasicCopyTexImage2DCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.Texture2DSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ BasicCopyTexImage2DCase.prototype.constructor =
+ es3fTextureSpecificationTests.BasicCopyTexImage2DCase;
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ BasicCopyTexImage2DCase.prototype.createTexture = function() {
+ var pixelFormat = tcuPixelFormat.PixelFormatFromContext(gl);
+ var targetHasRGB = pixelFormat.redBits > 0 &&
+ pixelFormat.greenBits > 0 &&
+ pixelFormat.blueBits > 0;
+ var targetHasAlpha = pixelFormat.alphaBits > 0;
+ var fmt = es3fTextureSpecificationTests.mapGLUnsizedInternalFormat(
+ this.m_internalFormat
+ );
+ var texHasRGB = fmt.order != tcuTexture.ChannelOrder.A;
+ var texHasAlpha = fmt.order == tcuTexture.ChannelOrder.RGBA ||
+ fmt.order == tcuTexture.ChannelOrder.LA ||
+ fmt.order == tcuTexture.ChannelOrder.A;
+ var tex = null;
+ var rnd = new deRandom.Random(deString.deStringHash(this.fullName()));
+ /** @type {es3fFboTestUtil.GradientShader} */
+ var shader = new es3fFboTestUtil.GradientShader(
+ gluShaderUtil.DataType.FLOAT_VEC4
+ );
+ var shaderID = this.m_context.createProgram(shader);
+
+ if ((texHasRGB && !targetHasRGB) || (texHasAlpha && !targetHasAlpha))
+ throw new Error(
+ 'Copying from current framebuffer is not supported'
+ );
+
+ // Fill render target with gradient.
+ shader.setGradient(
+ this.m_context, shaderID, [0, 0, 0, 0], [1, 1, 1, 1]
+ );
+ rrUtil.drawQuad(
+ this.m_context, shaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]
+ );
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_2D, tex);
+
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelW = Math.max(1, this.m_width >> ndx);
+ var levelH = Math.max(1, this.m_height >> ndx);
+ var x = rnd.getInt(0, this.m_width - levelW);
+ var y = rnd.getInt(0, this.m_height - levelH);
+
+ this.m_context.copyTexImage2D(
+ gl.TEXTURE_2D, ndx, this.m_internalFormat, x, y,
+ levelW, levelH, 0
+ );
+ }
+ };
+
+ // Basic CopyTexImage2D() with cubemap usage
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.TextureCubeSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} size
+ */
+ es3fTextureSpecificationTests.BasicCopyTexImageCubeCase = function(
+ name, desc, internalFormat, size
+ ) {
+ es3fTextureSpecificationTests.TextureCubeSpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLTransferFormat(
+ internalFormat, gl.UNSIGNED_BYTE
+ ), size, deMath.logToFloor(size) + 1
+ );
+
+ this.m_internalFormat = internalFormat;
+ };
+
+ es3fTextureSpecificationTests.BasicCopyTexImageCubeCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.TextureCubeSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ BasicCopyTexImageCubeCase.prototype.constructor =
+ es3fTextureSpecificationTests.BasicCopyTexImageCubeCase;
+
+ es3fTextureSpecificationTests.
+ BasicCopyTexImageCubeCase.prototype.createTexture = function() {
+ var pixelFormat = tcuPixelFormat.PixelFormatFromContext(gl);
+ var targetHasRGB = pixelFormat.redBits > 0 &&
+ pixelFormat.greenBits > 0 &&
+ pixelFormat.blueBits > 0;
+ var targetHasAlpha = pixelFormat.alphaBits > 0;
+ var fmt = es3fTextureSpecificationTests.mapGLUnsizedInternalFormat(
+ this.m_internalFormat
+ );
+ var texHasRGB = fmt.order != tcuTexture.ChannelOrder.A;
+ var texHasAlpha = fmt.order == tcuTexture.ChannelOrder.RGBA ||
+ fmt.order == tcuTexture.ChannelOrder.LA ||
+ fmt.order == tcuTexture.ChannelOrder.A;
+ var tex = null;
+ var rnd = new deRandom.Random(deString.deStringHash(this.fullName()));
+ /** @type {es3fFboTestUtil.GradientShader} */
+ var shader = new es3fFboTestUtil.GradientShader(
+ gluShaderUtil.DataType.FLOAT_VEC4
+ );
+ var shaderID = this.m_context.createProgram(shader);
+
+ if ((texHasRGB && !targetHasRGB) || (texHasAlpha && !targetHasAlpha))
+ throw new Error(
+ 'Copying from current framebuffer is not supported'
+ );
+
+ // Fill render target with gradient.
+ shader.setGradient(
+ this.m_context, shaderID, [0, 0, 0, 0], [1, 1, 1, 1]
+ );
+ rrUtil.drawQuad(
+ this.m_context, shaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]
+ );
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_CUBE_MAP, tex);
+
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelSize = Math.max(1, this.m_size >> ndx);
+
+ for (var f in tcuTexture.CubeFace) {
+ var face = tcuTexture.CubeFace[f];
+ var x = rnd.getInt(0, this.m_size - levelSize);
+ var y = rnd.getInt(0, this.m_size - levelSize);
+
+ this.m_context.copyTexImage2D(
+ es3fTextureSpecificationTests.s_cubeMapFaces[face], ndx,
+ this.m_internalFormat, x, y, levelSize, levelSize, 0
+ );
+ }
+ }
+ };
+
+ // Basic CopyTexSubImage2D() with 2D texture usage
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture2DSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} format
+ * @param {number} dataType
+ * @param {number} width
+ * @param {number} height
+ */
+ es3fTextureSpecificationTests.BasicCopyTexSubImage2DCase = function(
+ name, desc, format, dataType, width, height
+ ) {
+ es3fTextureSpecificationTests.Texture2DSpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLTransferFormat(
+ format, dataType
+ ), width, height, es3fTextureSpecificationTests.maxLevelCount(
+ width, height
+ )
+ );
+
+ this.m_format = format;
+ this.m_dataType = dataType;
+ };
+
+ es3fTextureSpecificationTests.BasicCopyTexSubImage2DCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.Texture2DSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ BasicCopyTexSubImage2DCase.prototype.constructor =
+ es3fTextureSpecificationTests.BasicCopyTexSubImage2DCase;
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ BasicCopyTexSubImage2DCase.prototype.createTexture = function() {
+ var pixelFormat = tcuPixelFormat.PixelFormatFromContext(gl);
+ var targetHasRGB = pixelFormat.redBits > 0 &&
+ pixelFormat.greenBits > 0 &&
+ pixelFormat.blueBits > 0;
+ var targetHasAlpha = pixelFormat.alphaBits > 0;
+ var fmt = gluTextureUtil.mapGLTransferFormat(
+ this.m_format, this.m_dataType
+ );
+ var texHasRGB = fmt.order != tcuTexture.ChannelOrder.A;
+ var texHasAlpha = fmt.order == tcuTexture.ChannelOrder.RGBA ||
+ fmt.order == tcuTexture.ChannelOrder.LA ||
+ fmt.order == tcuTexture.ChannelOrder.A;
+ var tex = null;
+ var rnd = new deRandom.Random(deString.deStringHash(this.fullName()));
+ /** @type {es3fFboTestUtil.GradientShader} */
+ var shader = new es3fFboTestUtil.GradientShader(
+ gluShaderUtil.DataType.FLOAT_VEC4
+ );
+ var shaderID = this.m_context.createProgram(shader);
+
+ if ((texHasRGB && !targetHasRGB) || (texHasAlpha && !targetHasAlpha))
+ throw new Error(
+ 'Copying from current framebuffer is not supported'
+ );
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_2D, tex);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
+
+ // First specify full texture.
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelW = Math.max(1, this.m_width >> ndx);
+ var levelH = Math.max(1, this.m_height >> ndx);
+
+ var colorA = es3fTextureSpecificationTests.randomVector(
+ rnd, [0, 0, 0, 0], [1, 1, 1, 1], 4
+ );
+ var colorB = es3fTextureSpecificationTests.randomVector(
+ rnd, [0, 0, 0, 0], [1, 1, 1, 1], 4
+ );
+ var cellSize = rnd.getInt(2, 16);
+
+ var data = new tcuTexture.TextureLevel(fmt, levelW, levelH);
+ tcuTextureUtil.fillWithGrid(
+ data.getAccess(), cellSize, colorA, colorB
+ );
+
+ this.m_context.texImage2D(
+ gl.TEXTURE_2D, ndx, this.m_format, levelW, levelH, 0, this.m_format, this.m_dataType, data.getAccess().getDataPtr()
+ );
+ }
+
+ // Fill render target with gradient.
+ shader.setGradient(
+ this.m_context, shaderID, [0, 0, 0, 0], [1, 1, 1, 1]
+ );
+ rrUtil.drawQuad(
+ this.m_context, shaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]
+ );
+
+ // Re-specify parts of each level.
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelW = Math.max(1, this.m_width >> ndx);
+ var levelH = Math.max(1, this.m_height >> ndx);
+
+ var w = rnd.getInt(1, levelW);
+ var h = rnd.getInt(1, levelH);
+ var xo = rnd.getInt(0, levelW - w);
+ var yo = rnd.getInt(0, levelH - h);
+
+ var x = rnd.getInt(0, this.m_width - w);
+ var y = rnd.getInt(0, this.m_height - h);
+
+ this.m_context.copyTexSubImage2D(
+ gl.TEXTURE_2D, ndx, xo, yo, x, y, w, h
+ );
+ }
+ };
+
+ // Basic CopyTexSubImage2D() with cubemap usage
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.TextureCubeSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} format
+ * @param {number} dataType
+ * @param {number} size
+ */
+ es3fTextureSpecificationTests.BasicCopyTexSubImageCubeCase = function(
+ name, desc, format, dataType, size
+ ) {
+ es3fTextureSpecificationTests.TextureCubeSpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLTransferFormat(
+ format, dataType
+ ), size, deMath.logToFloor(size) + 1
+ );
+
+ this.m_format = format;
+ this.m_dataType = dataType;
+ };
+
+ es3fTextureSpecificationTests.BasicCopyTexSubImageCubeCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.TextureCubeSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ BasicCopyTexSubImageCubeCase.prototype.constructor =
+ es3fTextureSpecificationTests.BasicCopyTexSubImageCubeCase;
+
+ es3fTextureSpecificationTests.
+ BasicCopyTexSubImageCubeCase.prototype.createTexture = function() {
+ var pixelFormat = tcuPixelFormat.PixelFormatFromContext(gl);
+ var targetHasRGB = pixelFormat.redBits > 0 &&
+ pixelFormat.greenBits > 0 &&
+ pixelFormat.blueBits > 0;
+ var targetHasAlpha = pixelFormat.alphaBits > 0;
+ var fmt = gluTextureUtil.mapGLTransferFormat(this.m_format, this.m_dataType);
+ var texHasRGB = fmt.order != tcuTexture.ChannelOrder.A;
+ var texHasAlpha = fmt.order == tcuTexture.ChannelOrder.RGBA ||
+ fmt.order == tcuTexture.ChannelOrder.LA ||
+ fmt.order == tcuTexture.ChannelOrder.A;
+ var tex = null;
+ var rnd = new deRandom.Random(deString.deStringHash(this.fullName()));
+ /** @type {es3fFboTestUtil.GradientShader} */
+ var shader = new es3fFboTestUtil.GradientShader(
+ gluShaderUtil.DataType.FLOAT_VEC4
+ );
+ var shaderID = this.m_context.createProgram(shader);
+
+ if ((texHasRGB && !targetHasRGB) || (texHasAlpha && !targetHasAlpha))
+ throw new Error(
+ 'Copying from current framebuffer is not supported'
+ );
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_CUBE_MAP, tex);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
+
+ var data = new tcuTexture.TextureLevel(fmt);
+
+ // First specify full texture.
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelSize = Math.max(1, this.m_size >> ndx);
+
+ data.setSize(levelSize, levelSize);
+
+ for (var f in tcuTexture.CubeFace) {
+ var face = tcuTexture.CubeFace[f];
+ var colorA = es3fTextureSpecificationTests.randomVector(
+ rnd, [0, 0, 0, 0], [1, 1, 1, 1], 4
+ );
+ var colorB = es3fTextureSpecificationTests.randomVector(
+ rnd, [0, 0, 0, 0], [1, 1, 1, 1], 4
+ );
+ var cellSize = rnd.getInt(2, 16);
+
+ tcuTextureUtil.fillWithGrid(
+ data.getAccess(), cellSize, colorA, colorB
+ );
+
+ this.m_context.texImage2D(
+ es3fTextureSpecificationTests.s_cubeMapFaces[face],
+ ndx, this.m_format, levelSize, levelSize, 0, this.m_format,
+ this.m_dataType, data.getAccess().getDataPtr()
+ );
+ }
+ }
+
+ // Fill render target with gradient.
+ shader.setGradient(
+ this.m_context, shaderID, [0, 0, 0, 0], [1, 1, 1, 1]
+ );
+ rrUtil.drawQuad(
+ this.m_context, shaderID, [-1.0, -1.0, 0.0], [1.0, 1.0, 0.0]
+ );
+
+ // Re-specify parts of each face and level.
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelSize = Math.max(1, this.m_size >> ndx);
+
+ for (var f in es3fTextureSpecificationTests.s_cubeMapFaces) {
+ var w = rnd.getInt(1, levelSize);
+ var h = rnd.getInt(1, levelSize);
+ var xo = rnd.getInt(0, levelSize - w);
+ var yo = rnd.getInt(0, levelSize - h);
+
+ var x = rnd.getInt(0, this.m_size - w);
+ var y = rnd.getInt(0, this.m_size - h);
+
+ this.m_context.copyTexSubImage2D(
+ es3fTextureSpecificationTests.s_cubeMapFaces[f],
+ ndx, xo, yo, x, y, w, h
+ );
+ }
+ }
+ };
+
+ // Basic glTexStorage2D() with 2D texture usage
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture2DSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ * @param {number} numLevels
+ */
+ es3fTextureSpecificationTests.BasicTexStorage2DCase = function(
+ name, desc, internalFormat, width, height, numLevels
+ ) {
+ es3fTextureSpecificationTests.Texture2DSpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLInternalFormat(
+ internalFormat
+ ), width, height, numLevels
+ );
+
+ this.m_internalFormat = internalFormat;
+ };
+
+ es3fTextureSpecificationTests.BasicTexStorage2DCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.Texture2DSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.BasicTexStorage2DCase.prototype.constructor =
+ es3fTextureSpecificationTests.BasicTexStorage2DCase;
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ BasicTexStorage2DCase.prototype.createTexture = function() {
+ var fmt = gluTextureUtil.mapGLInternalFormat(this.m_internalFormat);
+ var transferFmt = gluTextureUtil.getTransferFormat(fmt);
+ var tex = null;
+ var levelData = new tcuTexture.TextureLevel(
+ fmt, this.m_width, this.m_height
+ );
+ var rnd = new deRandom.Random(deString.deStringHash(this.fullName()));
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_2D, tex);
+ this.m_context.texStorage2D(
+ gl.TEXTURE_2D, this.m_numLevels, this.m_internalFormat,
+ this.m_width, this.m_height
+ );
+
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
+
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelW = Math.max(1, this.m_width >> ndx);
+ var levelH = Math.max(1, this.m_height >> ndx);
+ var gMin = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+ var gMax = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+
+ levelData.setSize(levelW, levelH);
+ tcuTextureUtil.fillWithComponentGradients(
+ levelData.getAccess(), gMin, gMax
+ );
+
+ this.m_context.texSubImage2D(
+ gl.TEXTURE_2D, ndx, 0, 0, levelW, levelH,
+ transferFmt.format, transferFmt.dataType,
+ levelData.getAccess().getDataPtr()
+ );
+ }
+ };
+
+ // Basic glTexStorage2D() with cubemap usage
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.TextureCubeSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} size
+ * @param {number} numLevels
+ */
+ es3fTextureSpecificationTests.BasicTexStorageCubeCase = function(
+ name, desc, internalFormat, size, numLevels
+ ) {
+ es3fTextureSpecificationTests.TextureCubeSpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLInternalFormat(
+ internalFormat
+ ), size, numLevels
+ );
+
+ this.m_internalFormat = internalFormat;
+ };
+
+ es3fTextureSpecificationTests.BasicTexStorageCubeCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.TextureCubeSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.BasicTexStorageCubeCase.prototype.constructor =
+ es3fTextureSpecificationTests.BasicTexStorageCubeCase;
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.BasicTexStorageCubeCase.prototype.createTexture = function() {
+ var fmt = gluTextureUtil.mapGLInternalFormat(this.m_internalFormat);
+ var transferFmt = gluTextureUtil.getTransferFormat(fmt);
+ var tex = null;
+ var levelData = new tcuTexture.TextureLevel(
+ fmt, this.m_size, this.m_size
+ );
+ var rnd = new deRandom.Random(deString.deStringHash(this.fullName()));
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_CUBE_MAP, tex);
+ this.m_context.texStorage2D(
+ gl.TEXTURE_CUBE_MAP, this.m_numLevels, this.m_internalFormat,
+ this.m_size, this.m_size
+ );
+
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
+
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelSize = Math.max(1, this.m_size >> ndx);
+
+ levelData.setSize(levelSize, levelSize);
+
+ for (var f in tcuTexture.CubeFace) {
+ var face = tcuTexture.CubeFace[f];
+ var gMin = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+ var gMax = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+
+ tcuTextureUtil.fillWithComponentGradients(
+ levelData.getAccess(), gMin, gMax
+ );
+
+ this.m_context.texSubImage2D(
+ es3fTextureSpecificationTests.s_cubeMapFaces[face],
+ ndx, 0, 0, levelSize, levelSize,
+ transferFmt.format, transferFmt.dataType,
+ levelData.getAccess().getDataPtr()
+ );
+ }
+ }
+ };
+
+ // Basic glTexStorage3D() with 2D array texture usage
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture2DArraySpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ * @param {number} numLayers
+ * @param {number} numLevels
+ */
+ es3fTextureSpecificationTests.BasicTexStorage2DArrayCase = function(
+ name, desc, internalFormat, width, height, numLayers, numLevels
+ ) {
+ es3fTextureSpecificationTests.Texture2DArraySpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLInternalFormat(
+ internalFormat
+ ), width, height, numLayers, numLevels
+ );
+ this.m_internalFormat = internalFormat;
+ };
+
+ es3fTextureSpecificationTests.BasicTexStorage2DArrayCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.Texture2DArraySpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ BasicTexStorage2DArrayCase.prototype.constructor =
+ es3fTextureSpecificationTests.BasicTexStorage2DArrayCase;
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.BasicTexStorage2DArrayCase.prototype.createTexture = function() {
+ var tex = null;
+ var levelData = new tcuTexture.TextureLevel(
+ this.m_texFormat, this.m_width, this.m_height
+ );
+ var rnd = new deRandom.Random(deString.deStringHash(this.fullName()));
+ var transferFmt = gluTextureUtil.getTransferFormat(
+ this.m_texFormat
+ );
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_2D_ARRAY, tex);
+ this.m_context.texStorage3D(
+ gl.TEXTURE_2D_ARRAY, this.m_numLevels, this.m_internalFormat,
+ this.m_width, this.m_height, this.m_numLayers
+ );
+
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
+
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelW = Math.max(1, this.m_width >> ndx);
+ var levelH = Math.max(1, this.m_height >> ndx);
+ var gMin = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+ var gMax = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+
+ levelData.setSize(levelW, levelH, this.m_numLayers);
+ tcuTextureUtil.fillWithComponentGradients(
+ levelData.getAccess(), gMin, gMax
+ );
+
+ this.m_context.texSubImage3D(
+ gl.TEXTURE_2D_ARRAY, ndx, 0, 0, 0, levelW, levelH,
+ this.m_numLayers, transferFmt.format, transferFmt.dataType,
+ levelData.getAccess().getDataPtr()
+ );
+ }
+ };
+
+ // Basic TexStorage3D() with 3D texture usage
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture3DSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ * @param {number} depth
+ * @param {number} numLevels
+ */
+ es3fTextureSpecificationTests.BasicTexStorage3DCase = function(
+ name, desc, internalFormat, width, height, depth, numLevels
+ ) {
+ es3fTextureSpecificationTests.Texture3DSpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLInternalFormat(
+ internalFormat
+ ), width, height, depth, numLevels
+ );
+
+ this.m_internalFormat = internalFormat;
+ };
+
+ es3fTextureSpecificationTests.BasicTexStorage3DCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.Texture3DSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ BasicTexStorage3DCase.prototype.constructor =
+ es3fTextureSpecificationTests.BasicTexStorage3DCase;
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ BasicTexStorage3DCase.prototype.createTexture = function() {
+ var tex = null;
+ var levelData = new tcuTexture.TextureLevel(
+ this.m_texFormat, this.m_width, this.m_height
+ );
+ var rnd = new deRandom.Random(deString.deStringHash(this.fullName()));
+ var transferFmt = gluTextureUtil.getTransferFormat(
+ this.m_texFormat
+ );
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_3D, tex);
+ this.m_context.texStorage3D(
+ gl.TEXTURE_3D, this.m_numLevels, this.m_internalFormat,
+ this.m_width, this.m_height, this.m_depth
+ );
+
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
+
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelW = Math.max(1, this.m_width >> ndx);
+ var levelH = Math.max(1, this.m_height >> ndx);
+ var levelD = Math.max(1, this.m_depth >> ndx);
+ var gMin = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+ var gMax = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+
+ levelData.setSize(levelW, levelH, levelD);
+ tcuTextureUtil.fillWithComponentGradients(
+ levelData.getAccess(), gMin, gMax
+ );
+
+ this.m_context.texSubImage3D(
+ gl.TEXTURE_3D, ndx, 0, 0, 0, levelW, levelH,
+ levelD, transferFmt.format, transferFmt.dataType,
+ levelData.getAccess().getDataPtr()
+ );
+ }
+ };
+
+ // Pixel buffer object cases.
+
+ // TexImage2D() from pixel buffer object.
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture2DSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ * @param {number} rowLength
+ * @param {number} skipRows
+ * @param {number} skipPixels
+ * @param {number} alignment
+ * @param {number} offset
+ */
+ es3fTextureSpecificationTests.TexImage2DBufferCase = function(
+ name, desc, internalFormat, width, height, rowLength,
+ skipRows, skipPixels, alignment, offset
+ ) {
+ es3fTextureSpecificationTests.Texture2DSpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLInternalFormat(
+ internalFormat
+ ), width, height, 1
+ );
+
+ this.m_internalFormat = internalFormat;
+ this.m_rowLength = rowLength;
+ this.m_skipRows = skipRows;
+ this.m_skipPixels = skipPixels;
+ this.m_alignment = alignment;
+ this.m_offset = offset;
+ };
+
+ es3fTextureSpecificationTests.TexImage2DBufferCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.Texture2DSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ TexImage2DBufferCase.prototype.constructor =
+ es3fTextureSpecificationTests.TexImage2DBufferCase;
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.TexImage2DBufferCase.prototype.createTexture =
+ function() {
+ var transferFmt = gluTextureUtil.getTransferFormat(this.m_texFormat);
+ var pixelSize = this.m_texFormat.getPixelSize();
+ var rowLength = this.m_rowLength > 0 ?
+ this.m_rowLength :
+ this.m_width + this.m_skipPixels;
+ var rowPitch = deMath.deAlign32(
+ rowLength * pixelSize, this.m_alignment
+ );
+ var height = this.m_height + this.m_skipRows;
+ var buf = null;
+ var tex = null;
+ var data = new ArrayBuffer(rowPitch * height + this.m_skipPixels * pixelSize + this.m_offset);
+
+ assertMsgOptions(
+ this.m_numLevels == 1, 'Number of levels different than 1',
+ false, true
+ );
+
+ // Fill data with grid.
+ var cScale = deMath.subtract(this.m_texFormatInfo.valueMax, this.m_texFormatInfo.valueMin);
+ var cBias = this.m_texFormatInfo.valueMin;
+ var colorA = deMath.add(
+ deMath.multiply([1.0, 0.0, 0.0, 1.0], cScale), cBias
+ );
+ var colorB = deMath.add(
+ deMath.multiply([0.0, 1.0, 0.0, 1.0], cScale), cBias
+ );
+
+ var access = new tcuTexture.PixelBufferAccess({
+ format: this.m_texFormat,
+ width: this.m_width,
+ height: this.m_height,
+ rowPitch: rowPitch,
+ data: data,
+ offset: this.m_skipRows * rowPitch + this.m_skipPixels * pixelSize + this.m_offset
+ });
+ tcuTextureUtil.fillWithGrid(access, 4, colorA, colorB);
+
+ // Create buffer and upload.
+ buf = this.m_context.createBuffer();
+ this.m_context.bindBuffer(gl.PIXEL_UNPACK_BUFFER, buf);
+ this.m_context.bufferData(gl.PIXEL_UNPACK_BUFFER, data, gl.STATIC_DRAW
+ );
+
+ this.m_context.pixelStorei(gl.UNPACK_ROW_LENGTH, this.m_rowLength);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_ROWS, this.m_skipRows);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_PIXELS, this.m_skipPixels);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment);
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_2D, tex);
+ this.m_context.texImage2D(gl.TEXTURE_2D, 0, this.m_internalFormat,
+ this.m_width, this.m_height, 0, transferFmt.format, transferFmt.dataType,
+ this.m_offset
+ );
+ };
+
+ // TexImage2D() cubemap from pixel buffer object case
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.TextureCubeSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} size
+ * @param {number} rowLength
+ * @param {number} skipRows
+ * @param {number} skipPixels
+ * @param {number} alignment
+ * @param {number} offset
+ */
+ es3fTextureSpecificationTests.TexImageCubeBufferCase = function(
+ name, desc, internalFormat, size, rowLength, skipRows, skipPixels,
+ alignment, offset
+ ) {
+ es3fTextureSpecificationTests.TextureCubeSpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLInternalFormat(
+ internalFormat
+ ), size, 1
+ );
+
+ this.m_internalFormat = internalFormat;
+ this.m_rowLength = rowLength;
+ this.m_skipRows = skipRows;
+ this.m_skipPixels = skipPixels;
+ this.m_alignment = alignment;
+ this.m_offset = offset;
+ };
+
+ es3fTextureSpecificationTests.TexImageCubeBufferCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.TextureCubeSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ TexImageCubeBufferCase.prototype.constructor =
+ es3fTextureSpecificationTests.TexImageCubeBufferCase;
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ TexImageCubeBufferCase.prototype.createTexture = function() {
+ var rnd = new deRandom.Random(deString.deStringHash(this.fullName()));
+ var tex = null;
+ var fmt = gluTextureUtil.getTransferFormat(this.m_texFormat);
+ var pixelSize = this.m_texFormat.getPixelSize();
+ var rowLength = this.m_rowLength > 0 ?
+ this.m_rowLength : this.m_size + this.m_skipPixels;
+ var rowPitch = deMath.deAlign32(
+ rowLength * pixelSize, this.m_alignment
+ );
+ var height = this.m_size + this.m_skipRows;
+
+ var data = new ArrayBuffer(rowPitch * height + this.m_skipPixels * pixelSize + this.m_offset);
+ var access = new tcuTexture.PixelBufferAccess({
+ format: this.m_texFormat,
+ width: this.m_size,
+ height: this.m_size,
+ rowPitch: rowPitch,
+ data: data,
+ offset: this.m_skipRows * rowPitch + this.m_skipPixels * pixelSize + this.m_offset
+ });
+
+ assertMsgOptions(
+ this.m_numLevels == 1, 'Number of levels is different than 1',
+ false, true
+ );
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_CUBE_MAP, tex);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
+
+ for (var f in tcuTexture.CubeFace) {
+ var face = tcuTexture.CubeFace[f];
+ var buf = null;
+
+ var gMin = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+ var gMax = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+
+ tcuTextureUtil.fillWithComponentGradients(access, gMin, gMax);
+
+ // Create buffer and upload.
+ buf = this.m_context.createBuffer();
+ this.m_context.bindBuffer(gl.PIXEL_UNPACK_BUFFER, buf);
+ this.m_context.bufferData(gl.PIXEL_UNPACK_BUFFER, data, gl.STATIC_DRAW);
+
+ this.m_context.pixelStorei(gl.UNPACK_ROW_LENGTH, this.m_rowLength);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_ROWS, this.m_skipRows);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_PIXELS, this.m_skipPixels);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment);
+
+ this.m_context.texImage2D(
+ es3fTextureSpecificationTests.s_cubeMapFaces[face], 0,
+ this.m_internalFormat, this.m_size, this.m_size, 0, fmt.format,
+ fmt.dataType, this.m_offset);
+ }
+ };
+
+ // TexImage3D() 2D array from pixel buffer object.
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture2DArraySpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ * @param {number} depth
+ * @param {number} imageHeight
+ * @param {number} rowLength
+ * @param {number} skipImages
+ * @param {number} skipRows
+ * @param {number} skipPixels
+ * @param {number} alignment
+ * @param {number} offset
+ */
+ es3fTextureSpecificationTests.TexImage2DArrayBufferCase = function(
+ name, desc, internalFormat, width, height, depth, imageHeight,
+ rowLength, skipImages, skipRows, skipPixels, alignment, offset
+ ) {
+ es3fTextureSpecificationTests.Texture2DArraySpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLInternalFormat(
+ internalFormat
+ ), width, height, depth, 1
+ );
+
+ this.m_internalFormat = internalFormat;
+ this.m_imageHeight = imageHeight;
+ this.m_rowLength = rowLength;
+ this.m_skipImages = skipImages;
+ this.m_skipRows = skipRows;
+ this.m_skipPixels = skipPixels;
+ this.m_alignment = alignment;
+ this.m_offset = offset;
+ };
+
+ es3fTextureSpecificationTests.TexImage2DArrayBufferCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.Texture2DArraySpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ TexImage2DArrayBufferCase.prototype.constructor =
+ es3fTextureSpecificationTests.TexImage2DArrayBufferCase;
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ TexImage2DArrayBufferCase.prototype.createTexture = function() {
+ var transferFmt = gluTextureUtil.getTransferFormat(
+ this.m_texFormat
+ );
+ var pixelSize = this.m_texFormat.getPixelSize();
+ var rowLength = this.m_rowLength > 0 ? this.m_rowLength : this.m_width;
+ var rowPitch = deMath.deAlign32(
+ rowLength * pixelSize, this.m_alignment
+ );
+ var imageHeight = this.m_imageHeight > 0 ?
+ this.m_imageHeight : this.m_height;
+ var slicePitch = imageHeight * rowPitch;
+ var tex = null;
+ var buf = null;
+ var data = new ArrayBuffer(
+ slicePitch * (this.m_numLayers + this.m_skipImages) +
+ this.m_skipRows * rowPitch + this.m_skipPixels * pixelSize + this.m_offset
+ );
+
+ assertMsgOptions(
+ this.m_numLevels == 1, 'Number of levels is different than 1',
+ false, true
+ );
+
+ // Fill data with grid.
+ var cScale = deMath.subtract(this.m_texFormatInfo.valueMax, this.m_texFormatInfo.valueMin);
+ var cBias = this.m_texFormatInfo.valueMin;
+ var colorA = deMath.add(
+ deMath.multiply([1.0, 0.0, 0.0, 1.0], cScale), cBias
+ );
+ var colorB = deMath.add(
+ deMath.multiply([0.0, 1.0, 0.0, 1.0], cScale), cBias
+ );
+
+ var access = new tcuTexture.PixelBufferAccess({
+ format: this.m_texFormat,
+ width: this.m_width,
+ height: this.m_height,
+ depth: this.m_numLayers,
+ rowPitch: rowPitch,
+ slicePitch: slicePitch,
+ data: data,
+ offset: this.m_skipImages * slicePitch +
+ this.m_skipRows * rowPitch +
+ this.m_skipPixels * pixelSize +
+ this.m_offset
+ });
+ tcuTextureUtil.fillWithGrid(access, 4, colorA, colorB);
+
+ // Create buffer and upload.
+ buf = this.m_context.createBuffer();
+ this.m_context.bindBuffer(gl.PIXEL_UNPACK_BUFFER, buf);
+ this.m_context.bufferData(gl.PIXEL_UNPACK_BUFFER, data, gl.STATIC_DRAW);
+
+ this.m_context.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, this.m_imageHeight);
+ this.m_context.pixelStorei(gl.UNPACK_ROW_LENGTH, this.m_rowLength);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_IMAGES, this.m_skipImages);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_ROWS, this.m_skipRows);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_PIXELS, this.m_skipPixels);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment);
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_2D_ARRAY, tex);
+ this.m_context.texImage3D(
+ gl.TEXTURE_2D_ARRAY, 0, this.m_internalFormat, this.m_width,
+ this.m_height, this.m_numLayers, 0, transferFmt.format,
+ transferFmt.dataType, this.m_offset
+ );
+ };
+
+ // TexImage3D() from pixel buffer object.
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture3DSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ * @param {number} depth
+ * @param {number} imageHeight
+ * @param {number} rowLength
+ * @param {number} skipImages
+ * @param {number} skipRows
+ * @param {number} skipPixels
+ * @param {number} alignment
+ * @param {number} offset
+ */
+ es3fTextureSpecificationTests.TexImage3DBufferCase = function(
+ name, desc, internalFormat, width, height, depth, imageHeight,
+ rowLength, skipImages, skipRows, skipPixels, alignment, offset
+ ) {
+ es3fTextureSpecificationTests.Texture3DSpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLInternalFormat(
+ internalFormat
+ ), width, height, depth, 1
+ );
+
+ this.m_internalFormat = internalFormat;
+ this.m_imageHeight = imageHeight;
+ this.m_rowLength = rowLength;
+ this.m_skipImages = skipImages;
+ this.m_skipRows = skipRows;
+ this.m_skipPixels = skipPixels;
+ this.m_alignment = alignment;
+ this.m_offset = offset;
+ };
+
+ es3fTextureSpecificationTests.TexImage3DBufferCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.Texture3DSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ TexImage3DBufferCase.prototype.constructor =
+ es3fTextureSpecificationTests.TexImage3DBufferCase;
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ TexImage3DBufferCase.prototype.createTexture = function() {
+ var transferFmt = gluTextureUtil.getTransferFormat(
+ this.m_texFormat
+ );
+ var pixelSize = this.m_texFormat.getPixelSize();
+ var rowLength = this.m_rowLength > 0 ? this.m_rowLength : this.m_width;
+ var rowPitch = deMath.deAlign32(
+ rowLength * pixelSize, this.m_alignment
+ );
+ var imageHeight = this.m_imageHeight > 0 ?
+ this.m_imageHeight : this.m_height;
+ var slicePitch = imageHeight * rowPitch;
+ var tex = null;
+ var buf = null;
+ var data = new ArrayBuffer(
+ slicePitch * (this.m_depth + this.m_skipImages) +
+ rowPitch * this.m_skipRows + pixelSize * this.m_skipPixels + this.m_offset
+ );
+
+ assertMsgOptions(
+ this.m_numLevels == 1, 'Number of levels is different than 1',
+ false, true
+ );
+
+ // Fill data with grid.
+ var cScale = deMath.subtract(this.m_texFormatInfo.valueMax, this.m_texFormatInfo.valueMin);
+ var cBias = this.m_texFormatInfo.valueMin;
+ var colorA = deMath.add(
+ deMath.multiply([1.0, 0.0, 0.0, 1.0], cScale), cBias
+ );
+ var colorB = deMath.add(
+ deMath.multiply([0.0, 1.0, 0.0, 1.0], cScale), cBias
+ );
+
+ var access = new tcuTexture.PixelBufferAccess({
+ format: this.m_texFormat,
+ width: this.m_width,
+ height: this.m_height,
+ depth: this.m_depth,
+ rowPitch: rowPitch,
+ slicePitch: slicePitch,
+ data: data,
+ offset: this.m_skipImages * slicePitch +
+ this.m_skipRows * rowPitch +
+ this.m_skipPixels * pixelSize +
+ this.m_offset
+ });
+ tcuTextureUtil.fillWithGrid(access, 4, colorA, colorB);
+
+ // Create buffer and upload.
+ buf = this.m_context.createBuffer();
+ this.m_context.bindBuffer(gl.PIXEL_UNPACK_BUFFER, buf);
+ this.m_context.bufferData(gl.PIXEL_UNPACK_BUFFER, data, gl.STATIC_DRAW);
+
+ this.m_context.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, this.m_imageHeight);
+ this.m_context.pixelStorei(gl.UNPACK_ROW_LENGTH, this.m_rowLength);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_IMAGES, this.m_skipImages);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_ROWS, this.m_skipRows);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_PIXELS, this.m_skipPixels);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment);
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_3D, tex);
+ this.m_context.texImage3D(
+ gl.TEXTURE_3D, 0, this.m_internalFormat, this.m_width,
+ this.m_height, this.m_depth, 0, transferFmt.format,
+ transferFmt.dataType, this.m_offset
+ );
+ };
+
+ // TexSubImage2D() PBO case.
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture2DSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ * @param {number} subX
+ * @param {number} subY
+ * @param {number} subW
+ * @param {number} subH
+ * @param {number} rowLength
+ * @param {number} skipRows
+ * @param {number} skipPixels
+ * @param {number} alignment
+ * @param {number} offset
+ */
+ es3fTextureSpecificationTests.TexSubImage2DBufferCase = function(
+ name, desc, internalFormat, width, height, subX, subY, subW, subH,
+ rowLength, skipRows, skipPixels, alignment, offset
+ ) {
+ es3fTextureSpecificationTests.Texture2DSpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLInternalFormat(
+ internalFormat
+ ), width, height, 1
+ );
+ this.m_internalFormat = internalFormat;
+ this.m_subX = subX;
+ this.m_subY = subY;
+ this.m_subW = subW;
+ this.m_subH = subH;
+ this.m_rowLength = rowLength;
+ this.m_skipRows = skipRows;
+ this.m_skipPixels = skipPixels;
+ this.m_alignment = alignment;
+ this.m_offset = offset;
+ };
+
+ es3fTextureSpecificationTests.TexSubImage2DBufferCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.Texture2DSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ TexSubImage2DBufferCase.prototype.constructor =
+ es3fTextureSpecificationTests.TexSubImage2DBufferCase;
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ TexSubImage2DBufferCase.prototype.createTexture = function() {
+ var transferFmt = gluTextureUtil.getTransferFormat(
+ this.m_texFormat
+ );
+ var pixelSize = this.m_texFormat.getPixelSize();
+ var tex = null;
+ var buf = null;
+ var data = new ArrayBuffer(
+ deMath.deAlign32(this.m_width * pixelSize, 4) * this.m_height
+ );
+
+ assertMsgOptions(
+ this.m_numLevels == 1, 'Number of levels is different than 1',
+ false, true
+ );
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_2D, tex);
+
+ var access = new tcuTexture.PixelBufferAccess({
+ format: this.m_texFormat,
+ width: this.m_width,
+ height: this.m_height,
+ rowPitch: deMath.deAlign32(this.m_width * pixelSize, 4),
+ data: data
+ });
+ // First fill texture with gradient.
+ tcuTextureUtil.fillWithComponentGradients(access, this.m_texFormatInfo.valueMin, this.m_texFormatInfo.valueMax);
+ this.m_context.texImage2D(
+ gl.TEXTURE_2D, 0, this.m_internalFormat,
+ this.m_width, this.m_height, 0, transferFmt.format,
+ transferFmt.dataType, access.getDataPtr()
+ );
+
+ // Fill data with grid.
+ var rowLength = this.m_rowLength > 0 ? this.m_rowLength : this.m_subW;
+ var rowPitch = deMath.deAlign32(
+ rowLength * pixelSize, this.m_alignment
+ );
+ var height = this.m_subH + this.m_skipRows;
+ var cScale = deMath.subtract(this.m_texFormatInfo.valueMax, this.m_texFormatInfo.valueMin);
+ var cBias = this.m_texFormatInfo.valueMin;
+ var colorA = deMath.add(
+ deMath.multiply([1.0, 0.0, 0.0, 1.0], cScale), cBias
+ );
+ var colorB = deMath.add(
+ deMath.multiply([0.0, 1.0, 0.0, 1.0], cScale), cBias
+ );
+
+ access = new tcuTexture.PixelBufferAccess({
+ format: this.m_texFormat,
+ width: this.m_subW,
+ height: this.m_subH,
+ rowPitch: rowPitch,
+ data: new ArrayBuffer(rowPitch * height + this.m_offset),
+ offset: this.m_skipRows * rowPitch +
+ this.m_skipPixels * pixelSize +
+ this.m_offset
+ });
+ tcuTextureUtil.fillWithGrid(access, 4, colorA, colorB);
+
+ buf = this.m_context.createBuffer();
+ this.m_context.bindBuffer(gl.PIXEL_UNPACK_BUFFER, buf);
+ this.m_context.bufferData(gl.PIXEL_UNPACK_BUFFER, access.getBuffer(), gl.STATIC_DRAW);
+
+ this.m_context.pixelStorei(gl.UNPACK_ROW_LENGTH, this.m_rowLength);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_ROWS, this.m_skipRows);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_PIXELS, this.m_skipPixels);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment);
+
+ this.m_context.texSubImage2D(
+ gl.TEXTURE_2D, 0, this.m_subX, this.m_subY,
+ this.m_subW, this.m_subH, transferFmt.format,
+ transferFmt.dataType, this.m_offset
+ );
+ };
+
+ // TexSubImage2D() cubemap PBO case.
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.TextureCubeSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} size
+ * @param {number} subX
+ * @param {number} subY
+ * @param {number} subW
+ * @param {number} subH
+ * @param {number} rowLength
+ * @param {number} skipRows
+ * @param {number} skipPixels
+ * @param {number} alignment
+ * @param {number} offset
+ */
+ es3fTextureSpecificationTests.TexSubImageCubeBufferCase = function(
+ name, desc, internalFormat, size, subX, subY, subW, subH, rowLength,
+ skipRows, skipPixels, alignment, offset
+ ) {
+ es3fTextureSpecificationTests.TextureCubeSpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLInternalFormat(
+ internalFormat
+ ), size, 1
+ );
+
+ this.m_internalFormat = internalFormat;
+ this.m_subX = subX;
+ this.m_subY = subY;
+ this.m_subW = subW;
+ this.m_subH = subH;
+ this.m_rowLength = rowLength;
+ this.m_skipRows = skipRows;
+ this.m_skipPixels = skipPixels;
+ this.m_alignment = alignment;
+ this.m_offset = offset;
+ };
+
+ es3fTextureSpecificationTests.TexSubImageCubeBufferCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.TextureCubeSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ TexSubImageCubeBufferCase.prototype.constructor =
+ es3fTextureSpecificationTests.TexSubImageCubeBufferCase;
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ TexSubImageCubeBufferCase.prototype.createTexture = function() {
+ var rnd = new deRandom.Random(deString.deStringHash(this.fullName()));
+ var transferFmt = gluTextureUtil.getTransferFormat(
+ this.m_texFormat
+ );
+ var pixelSize = this.m_texFormat.getPixelSize();
+ var tex = null;
+ var buf = null;
+ var data = new ArrayBuffer(
+ deMath.deAlign32(this.m_size * pixelSize, 4) * this.m_size
+ );
+ var access = new tcuTexture.PixelBufferAccess({
+ format: this.m_texFormat,
+ width: this.m_size,
+ height: this.m_size,
+ rowPitch: deMath.deAlign32(this.m_size * pixelSize, 4),
+ data: data
+ });
+ assertMsgOptions(
+ this.m_numLevels == 1, 'Number of levels is different than 1',
+ false, true
+ );
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_CUBE_MAP, tex);
+
+ // Fill faces with different gradients.
+
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
+
+ for (var f in tcuTexture.CubeFace) {
+ var face = tcuTexture.CubeFace[f];
+ var gMin = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+ var gMax = es3fTextureSpecificationTests.randomVector(
+ rnd, this.m_texFormatInfo.valueMin,
+ this.m_texFormatInfo.valueMax, 4
+ );
+
+ tcuTextureUtil.fillWithComponentGradients(access, gMin, gMax);
+
+ this.m_context.texImage2D(
+ es3fTextureSpecificationTests.s_cubeMapFaces[face], 0,
+ this.m_internalFormat, this.m_size, this.m_size, 0,
+ transferFmt.format, transferFmt.dataType,
+ access.getDataPtr()
+ );
+ }
+
+ // Fill data with grid.
+ var rowLength = this.m_rowLength > 0 ? this.m_rowLength : this.m_subW;
+ var rowPitch = deMath.deAlign32(
+ rowLength * pixelSize, this.m_alignment
+ );
+ var height = this.m_subH + this.m_skipRows;
+ var cScale = deMath.subtract(this.m_texFormatInfo.valueMax, this.m_texFormatInfo.valueMin);
+ var cBias = this.m_texFormatInfo.valueMin;
+ var colorA = deMath.add(
+ deMath.multiply([1.0, 0.0, 0.0, 1.0], cScale), cBias
+ );
+ var colorB = deMath.add(
+ deMath.multiply([0.0, 1.0, 0.0, 1.0], cScale), cBias
+ );
+
+ data = new ArrayBuffer(rowPitch * height + this.m_skipPixels * pixelSize + this.m_offset);
+ var accessSub = new tcuTexture.PixelBufferAccess({
+ format: this.m_texFormat,
+ width: this.m_subW,
+ height: this.m_subH,
+ rowPitch: rowPitch,
+ data: data,
+ offset: this.m_skipRows * rowPitch +
+ this.m_skipPixels * pixelSize +
+ this.m_offset
+ });
+ tcuTextureUtil.fillWithGrid(accessSub, 4, colorA, colorB);
+
+ buf = this.m_context.createBuffer();
+ this.m_context.bindBuffer(gl.PIXEL_UNPACK_BUFFER, buf);
+ this.m_context.bufferData(
+ gl.PIXEL_UNPACK_BUFFER, data, gl.STATIC_DRAW
+ );
+
+ this.m_context.pixelStorei(gl.UNPACK_ROW_LENGTH, this.m_rowLength);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_ROWS, this.m_skipRows);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_PIXELS, this.m_skipPixels);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment);
+
+ for (var f in tcuTexture.CubeFace) {
+ var face = tcuTexture.CubeFace[f];
+ this.m_context.texSubImage2D(
+ es3fTextureSpecificationTests.s_cubeMapFaces[face], 0,
+ this.m_subX, this.m_subY, this.m_subW, this.m_subH,
+ transferFmt.format, transferFmt.dataType, this.m_offset
+ );
+ }
+ };
+
+ // TexSubImage3D() 2D array PBO case.
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture2DArraySpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ * @param {number} depth
+ * @param {number} subX
+ * @param {number} subY
+ * @param {number} subZ
+ * @param {number} subW
+ * @param {number} subH
+ * @param {number} subD
+ * @param {number} imageHeight
+ * @param {number} rowLength
+ * @param {number} skipImages
+ * @param {number} skipRows
+ * @param {number} skipPixels
+ * @param {number} alignment
+ * @param {number} offset
+ */
+ es3fTextureSpecificationTests.TexSubImage2DArrayBufferCase = function(
+ name, desc, internalFormat, width, height, depth, subX, subY, subZ,
+ subW, subH, subD, imageHeight, rowLength, skipImages, skipRows,
+ skipPixels, alignment, offset
+ ) {
+ es3fTextureSpecificationTests.Texture2DArraySpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLInternalFormat(
+ internalFormat
+ ), width, height, depth, 1
+ );
+ this.m_internalFormat = internalFormat;
+ this.m_subX = subX;
+ this.m_subY = subY;
+ this.m_subZ = subZ;
+ this.m_subW = subW;
+ this.m_subH = subH;
+ this.m_subD = subD;
+ this.m_imageHeight = imageHeight;
+ this.m_rowLength = rowLength;
+ this.m_skipImages = skipImages;
+ this.m_skipRows = skipRows;
+ this.m_skipPixels = skipPixels;
+ this.m_alignment = alignment;
+ this.m_offset = offset;
+ };
+
+ es3fTextureSpecificationTests.TexSubImage2DArrayBufferCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.Texture2DArraySpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ TexSubImage2DArrayBufferCase.prototype.constructor =
+ es3fTextureSpecificationTests.TexSubImage2DArrayBufferCase;
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ TexSubImage2DArrayBufferCase.prototype.createTexture = function() {
+ var transferFmt = gluTextureUtil.getTransferFormat(
+ this.m_texFormat
+ );
+ var pixelSize = this.m_texFormat.getPixelSize();
+ var tex = null;
+ var buf = null;
+ /** @type {ArrayBuffer} */ var data;
+
+ assertMsgOptions(
+ this.m_numLevels == 1, 'Number of levels is different than 1',
+ false, true
+ );
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_2D_ARRAY, tex);
+
+ // Fill with gradient.
+ var rowPitch = deMath.deAlign32(pixelSize * this.m_width, 4);
+ var slicePitch = rowPitch * this.m_height;
+
+ data = new ArrayBuffer(slicePitch * this.m_numLayers);
+ var access = new tcuTexture.PixelBufferAccess({
+ format: this.m_texFormat,
+ width: this.m_width,
+ height: this.m_height,
+ depth: this.m_numLayers,
+ rowPitch: rowPitch,
+ slicePitch: slicePitch,
+ data: data
+ });
+ tcuTextureUtil.fillWithComponentGradients(access, this.m_texFormatInfo.valueMin, this.m_texFormatInfo.valueMax
+ );
+
+ this.m_context.texImage3D(gl.TEXTURE_2D_ARRAY, 0, this.m_internalFormat, this.m_width, this.m_height,
+ this.m_numLayers, 0, transferFmt.format, transferFmt.dataType, access.getDataPtr());
+
+ // Fill data with grid.
+ var rowLength = this.m_rowLength > 0 ? this.m_rowLength : this.m_subW;
+ rowPitch = deMath.deAlign32(
+ rowLength * pixelSize, this.m_alignment
+ );
+ var height = this.m_subH + this.m_skipRows;
+ var cScale = deMath.subtract(this.m_texFormatInfo.valueMax, this.m_texFormatInfo.valueMin);
+
+ var cBias = this.m_texFormatInfo.valueMin;
+ var colorA = deMath.add(
+ deMath.multiply([1.0, 0.0, 0.0, 1.0], cScale), cBias
+ );
+ var colorB = deMath.add(
+ deMath.multiply([0.0, 1.0, 0.0, 1.0], cScale), cBias
+ );
+
+ var accessSub = new tcuTexture.PixelBufferAccess({
+ format: this.m_texFormat,
+ width: this.m_subW,
+ height: this.m_subH,
+ rowPitch: rowPitch,
+ data: new ArrayBuffer(rowPitch * height + this.m_offset),
+ offset: this.m_skipRows * rowPitch +
+ this.m_skipPixels * pixelSize +
+ this.m_offset
+ });
+ tcuTextureUtil.fillWithGrid(accessSub, 4, colorA, colorB);
+
+ buf = this.m_context.createBuffer();
+ this.m_context.bindBuffer(gl.PIXEL_UNPACK_BUFFER, buf);
+ this.m_context.bufferData(
+ gl.PIXEL_UNPACK_BUFFER, accessSub.getBuffer(), gl.STATIC_DRAW
+ );
+
+ this.m_context.pixelStorei(gl.UNPACK_ROW_LENGTH, this.m_rowLength);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_ROWS, this.m_skipRows);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_PIXELS, this.m_skipPixels);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment);
+ };
+
+ // TexSubImage3D() PBO case.
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture3DSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} width
+ * @param {number} height
+ * @param {number} depth
+ * @param {number} subX
+ * @param {number} subY
+ * @param {number} subZ
+ * @param {number} subW
+ * @param {number} subH
+ * @param {number} subD
+ * @param {number} imageHeight
+ * @param {number} rowLength
+ * @param {number} skipImages
+ * @param {number} skipRows
+ * @param {number} skipPixels
+ * @param {number} alignment
+ * @param {number} offset
+ */
+ es3fTextureSpecificationTests.TexSubImage3DBufferCase = function(
+ name, desc, internalFormat, width, height, depth, subX, subY, subZ,
+ subW, subH, subD, imageHeight, rowLength, skipImages, skipRows,
+ skipPixels, alignment, offset
+ ) {
+ es3fTextureSpecificationTests.Texture3DSpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLInternalFormat(
+ internalFormat
+ ), width, height, depth, 1
+ );
+
+ this.m_internalFormat = internalFormat;
+ this.m_subX = subX;
+ this.m_subY = subY;
+ this.m_subZ = subZ;
+ this.m_subW = subW;
+ this.m_subH = subH;
+ this.m_subD = subD;
+ this.m_imageHeight = imageHeight;
+ this.m_rowLength = rowLength;
+ this.m_skipImages = skipImages;
+ this.m_skipRows = skipRows;
+ this.m_skipPixels = skipPixels;
+ this.m_alignment = alignment;
+ this.m_offset = offset;
+ };
+
+ es3fTextureSpecificationTests.TexSubImage3DBufferCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.Texture3DSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ TexSubImage3DBufferCase.prototype.constructor =
+ es3fTextureSpecificationTests.TexSubImage3DBufferCase;
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ TexSubImage3DBufferCase.prototype.createTexture = function() {
+ var transferFmt = gluTextureUtil.getTransferFormat(
+ this.m_texFormat
+ );
+ var pixelSize = this.m_texFormat.getPixelSize();
+ var tex = null;
+ var buf = null;
+ /** @type {ArrayBuffer} */ var data;
+
+ assertMsgOptions(
+ this.m_numLevels == 1, 'Number of levels is different than 1',
+ false, true
+ );
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_3D, tex);
+
+ // Fill with gradient.
+ var rowPitch = deMath.deAlign32(pixelSize * this.m_width, 4);
+ var slicePitch = rowPitch * this.m_height;
+
+ data = new ArrayBuffer(slicePitch * this.m_depth);
+ var access = new tcuTexture.PixelBufferAccess({
+ format: this.m_texFormat,
+ width: this.m_width,
+ height: this.m_height,
+ depth: this.m_depth,
+ rowPitch: rowPitch,
+ slicePitch: slicePitch,
+ data: data});
+ tcuTextureUtil.fillWithComponentGradients(access, this.m_texFormatInfo.valueMin, this.m_texFormatInfo.valueMax
+ );
+
+ this.m_context.texImage3D(
+ gl.TEXTURE_3D, 0, this.m_internalFormat, this.m_width,
+ this.m_height, this.m_depth, 0, transferFmt.format,
+ transferFmt.dataType, access.getDataPtr()
+ );
+
+ // Fill data with grid.
+ var rowLength = this.m_rowLength > 0 ? this.m_rowLength : this.m_subW;
+ rowPitch = deMath.deAlign32(
+ rowLength * pixelSize, this.m_alignment
+ );
+ var imageHeight = this.m_imageHeight > 0 ?
+ this.m_imageHeight : this.m_subH;
+ slicePitch = imageHeight * rowPitch;
+ var cScale = deMath.subtract(this.m_texFormatInfo.valueMax, this.m_texFormatInfo.valueMin);
+ var cBias = this.m_texFormatInfo.valueMin;
+ var colorA = deMath.add(
+ deMath.multiply([1.0, 0.0, 0.0, 1.0], cScale), cBias
+ );
+ var colorB = deMath.add(
+ deMath.multiply([0.0, 1.0, 0.0, 1.0], cScale), cBias
+ );
+
+ data = new ArrayBuffer(slicePitch * (this.m_subD + this.m_skipImages) +
+ rowPitch * this.m_skipRows + pixelSize * this.m_skipPixels + this.m_offset);
+ var accessSub = new tcuTexture.PixelBufferAccess({
+ format: this.m_texFormat,
+ width: this.m_subW,
+ height: this.m_subH,
+ depth: this.m_subD,
+ rowPitch: rowPitch,
+ slicePitch: slicePitch,
+ data: data,
+ offset: this.m_skipImages * slicePitch +
+ this.m_skipRows * rowPitch +
+ this.m_skipPixels * pixelSize +
+ this.m_offset
+ });
+ tcuTextureUtil.fillWithGrid(accessSub, 4, colorA, colorB
+ );
+
+ buf = this.m_context.createBuffer();
+ this.m_context.bindBuffer(gl.PIXEL_UNPACK_BUFFER, buf);
+ this.m_context.bufferData(
+ gl.PIXEL_UNPACK_BUFFER, data, gl.STATIC_DRAW
+ );
+
+ this.m_context.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, this.m_imageHeight);
+ this.m_context.pixelStorei(gl.UNPACK_ROW_LENGTH, this.m_rowLength);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_IMAGES, this.m_skipImages);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_ROWS, this.m_skipRows);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_PIXELS, this.m_skipPixels);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, this.m_alignment);
+ this.m_context.texSubImage3D(
+ gl.TEXTURE_3D, 0, this.m_subX, this.m_subY, this.m_subZ,
+ this.m_subW, this.m_subH, this.m_subD, transferFmt.format,
+ transferFmt.dataType, this.m_offset
+ );
+ };
+
+ // TexImage2D() depth case.
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture2DSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} imageWidth
+ * @param {number} imageHeight
+ */
+ es3fTextureSpecificationTests.TexImage2DDepthCase = function(
+ name, desc, internalFormat, imageWidth, imageHeight
+ ) {
+ es3fTextureSpecificationTests.Texture2DSpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLInternalFormat(
+ internalFormat
+ ), imageWidth, imageHeight,
+ es3fTextureSpecificationTests.maxLevelCount(
+ imageWidth, imageHeight
+ )
+ );
+
+ this.m_internalFormat = internalFormat;
+ // we are interested in the behavior near [-2, 2], map it to visible range [0, 1]
+ this.m_texFormatInfo.lookupBias = [0.25, 0.0, 0.0, 1.0];
+ this.m_texFormatInfo.lookupScale = [0.5, 1.0, 1.0, 0.0];
+ };
+
+ es3fTextureSpecificationTests.TexImage2DDepthCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.Texture2DSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ TexImage2DDepthCase.prototype.constructor =
+ es3fTextureSpecificationTests.TexImage2DDepthCase;
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.TexImage2DDepthCase.prototype.createTexture =
+ function() {
+ var fmt = gluTextureUtil.getTransferFormat(this.m_texFormat);
+ var tex = null;
+ var levelData = new tcuTexture.TextureLevel(
+ this.m_texFormat, this.m_width, this.m_height
+ );
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_2D, tex);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
+
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelW = Math.max(1, this.m_width >> ndx);
+ var levelH = Math.max(1, this.m_height >> ndx);
+ var gMin = [-1.5, -2.0, 1.7, -1.5];
+ var gMax = [2.0, 1.5, -1.0, 2.0];
+
+ levelData.setSize(levelW, levelH);
+ tcuTextureUtil.fillWithComponentGradients(
+ levelData.getAccess(), gMin, gMax
+ );
+
+ this.m_context.texImage2D(
+ gl.TEXTURE_2D, ndx, this.m_internalFormat, levelW, levelH, 0,
+ fmt.format, fmt.dataType, levelData.getAccess().getDataPtr()
+ );
+ }
+ };
+
+ // TexImage3D() depth case.
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture2DArraySpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} imageWidth
+ * @param {number} imageHeight
+ * @param {number} numLayers
+ */
+ es3fTextureSpecificationTests.TexImage2DArrayDepthCase = function(
+ name, desc, internalFormat, imageWidth, imageHeight, numLayers
+ ) {
+ es3fTextureSpecificationTests.Texture2DArraySpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLInternalFormat(
+ internalFormat
+ ), imageWidth, imageHeight, numLayers,
+ es3fTextureSpecificationTests.maxLevelCount(
+ imageWidth, imageHeight
+ )
+ );
+
+ this.m_internalFormat = internalFormat;
+ // we are interested in the behavior near [-2, 2], map it to visible range [0, 1]
+ this.m_texFormatInfo.lookupBias = [0.25, 0.0, 0.0, 1.0];
+ this.m_texFormatInfo.lookupScale = [0.5, 1.0, 1.0, 0.0];
+ };
+
+ es3fTextureSpecificationTests.TexImage2DArrayDepthCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.Texture2DArraySpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ TexImage2DArrayDepthCase.prototype.constructor =
+ es3fTextureSpecificationTests.TexImage2DArrayDepthCase;
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ TexImage2DArrayDepthCase.prototype.createTexture = function() {
+ var fmt = gluTextureUtil.getTransferFormat(this.m_texFormat);
+ var tex = null;
+ var levelData = new tcuTexture.TextureLevel(
+ this.m_texFormat, this.m_width, this.m_height
+ );
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_2D_ARRAY, tex);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
+
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelW = Math.max(1, this.m_width >> ndx);
+ var levelH = Math.max(1, this.m_height >> ndx);
+ var gMin = [-1.5, -2.0, 1.7, -1.5];
+ var gMax = [2.0, 1.5, -1.0, 2.0];
+
+ levelData.setSize(levelW, levelH, this.m_numLayers);
+ tcuTextureUtil.fillWithComponentGradients(
+ levelData.getAccess(), gMin, gMax
+ );
+
+ this.m_context.texImage3D(
+ gl.TEXTURE_2D_ARRAY, ndx, this.m_internalFormat, levelW, levelH,
+ this.m_numLayers, 0, fmt.format, fmt.dataType,
+ levelData.getAccess().getDataPtr()
+ );
+ }
+ };
+
+ // TexSubImage2D() depth case.
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture2DSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} imageWidth
+ * @param {number} imageHeight
+ */
+ es3fTextureSpecificationTests.TexSubImage2DDepthCase = function(
+ name, desc, internalFormat, imageWidth, imageHeight
+ ) {
+ es3fTextureSpecificationTests.Texture2DSpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLInternalFormat(
+ internalFormat
+ ), imageWidth, imageHeight,
+ es3fTextureSpecificationTests.maxLevelCount(
+ imageWidth, imageHeight
+ )
+ );
+
+ this.m_internalFormat = internalFormat;
+ // we are interested in the behavior near [-2, 2], map it to visible range [0, 1]
+ this.m_texFormatInfo.lookupBias = [0.25, 0.0, 0.0, 1.0];
+ this.m_texFormatInfo.lookupScale = [0.5, 1.0, 1.0, 0.0];
+ };
+
+ es3fTextureSpecificationTests.TexSubImage2DDepthCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.Texture2DSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ TexSubImage2DDepthCase.prototype.constructor =
+ es3fTextureSpecificationTests.TexSubImage2DDepthCase;
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ TexSubImage2DDepthCase.prototype.createTexture = function() {
+ var fmt = gluTextureUtil.getTransferFormat(this.m_texFormat);
+ var rnd = new deRandom.Random(deString.deStringHash(this.fullName()));
+ var tex = null;
+ var levelData = new tcuTexture.TextureLevel(
+ this.m_texFormat, this.m_width, this.m_height
+ );
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_2D, tex);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
+
+ // First specify full texture.
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelW = Math.max(1, this.m_width >> ndx);
+ var levelH = Math.max(1, this.m_height >> ndx);
+ var gMin = [-1.5, -2.0, 1.7, -1.5];
+ var gMax = [2.0, 1.5, -1.0, 2.0];
+
+ levelData.setSize(levelW, levelH);
+ tcuTextureUtil.fillWithComponentGradients(
+ levelData.getAccess(), gMin, gMax
+ );
+
+ this.m_context.texImage2D(
+ gl.TEXTURE_2D, ndx, this.m_internalFormat, levelW, levelH, 0,
+ fmt.format, fmt.dataType, levelData.getAccess().getDataPtr()
+ );
+ }
+
+ // Re-specify parts of each level.
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelW = Math.max(1, this.m_width >> ndx);
+ var levelH = Math.max(1, this.m_height >> ndx);
+
+ var w = rnd.getInt(1, levelW);
+ var h = rnd.getInt(1, levelH);
+ var x = rnd.getInt(0, levelW - w);
+ var y = rnd.getInt(0, levelH - h);
+
+ var colorA = [2.0, 1.5, -1.0, 2.0];
+ var colorB = [-1.5, -2.0, 1.7, -1.5];
+ var cellSize = rnd.getInt(2, 16);
+
+ levelData.setSize(w, h);
+ tcuTextureUtil.fillWithGrid(
+ levelData.getAccess(), cellSize, colorA, colorB
+ );
+
+ this.m_context.texSubImage2D(
+ gl.TEXTURE_2D, ndx, x, y, w, h, fmt.format, fmt.dataType,
+ levelData.getAccess().getDataPtr()
+ );
+ }
+ };
+
+ // TexSubImage3D() depth case.
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture2DArraySpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} imageWidth
+ * @param {number} imageHeight
+ * @param {number} numLayers
+ */
+ es3fTextureSpecificationTests.TexSubImage2DArrayDepthCase = function(
+ name, desc, internalFormat, imageWidth, imageHeight, numLayers
+ ) {
+ es3fTextureSpecificationTests.Texture2DArraySpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLInternalFormat(
+ internalFormat
+ ), imageWidth, imageHeight, numLayers,
+ es3fTextureSpecificationTests.maxLevelCount(
+ imageWidth, imageHeight
+ )
+ );
+
+ this.m_internalFormat = internalFormat;
+ // we are interested in the behavior near [-2, 2], map it to visible range [0, 1]
+ this.m_texFormatInfo.lookupBias = [0.25, 0.0, 0.0, 1.0];
+ this.m_texFormatInfo.lookupScale = [0.5, 1.0, 1.0, 0.0];
+ };
+
+ es3fTextureSpecificationTests.TexSubImage2DArrayDepthCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.Texture2DArraySpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ TexSubImage2DArrayDepthCase.prototype.constructor =
+ es3fTextureSpecificationTests.TexSubImage2DArrayDepthCase;
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ TexSubImage2DArrayDepthCase.prototype.createTexture = function() {
+ var fmt = gluTextureUtil.getTransferFormat(this.m_texFormat);
+ var rnd = new deRandom.Random(deString.deStringHash(this.fullName()));
+ var tex = null;
+ var levelData = new tcuTexture.TextureLevel(
+ this.m_texFormat, this.m_width, this.m_height
+ );
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_2D_ARRAY, tex);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
+
+ // First specify full texture.
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelW = Math.max(1, this.m_width >> ndx);
+ var levelH = Math.max(1, this.m_height >> ndx);
+ var gMin = [-1.5, -2.0, 1.7, -1.5];
+ var gMax = [2.0, 1.5, -1.0, 2.0];
+
+ levelData.setSize(levelW, levelH, this.m_numLayers);
+ tcuTextureUtil.fillWithComponentGradients(
+ levelData.getAccess(), gMin, gMax
+ );
+ this.m_context.texImage3D(
+ gl.TEXTURE_2D_ARRAY, ndx, this.m_internalFormat, levelW, levelH,
+ this.m_numLayers, 0, fmt.format, fmt.dataType,
+ levelData.getAccess().getDataPtr()
+ );
+ }
+
+ // Re-specify parts of each level.
+ for (var ndx = 0; ndx < this.m_numLevels; ndx++) {
+ var levelW = Math.max(1, this.m_width >> ndx);
+ var levelH = Math.max(1, this.m_height >> ndx);
+
+ var w = rnd.getInt(1, levelW);
+ var h = rnd.getInt(1, levelH);
+ var d = rnd.getInt(1, this.m_numLayers);
+ var x = rnd.getInt(0, levelW - w);
+ var y = rnd.getInt(0, levelH - h);
+ var z = rnd.getInt(0, this.m_numLayers - d);
+
+ var colorA = [2.0, 1.5, -1.0, 2.0];
+ var colorB = [-1.5, -2.0, 1.7, -1.5];
+ var cellSize = rnd.getInt(2, 16);
+
+ levelData.setSize(w, h, d);
+ tcuTextureUtil.fillWithGrid(
+ levelData.getAccess(), cellSize, colorA, colorB
+ );
+
+ this.m_context.texSubImage3D(
+ gl.TEXTURE_2D_ARRAY, ndx, x, y, z, w, h, d, fmt.format,
+ fmt.dataType, levelData.getAccess().getDataPtr()
+ );
+ }
+ };
+
+ // TexImage2D() depth case with pbo.
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture2DSpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} imageWidth
+ * @param {number} imageHeight
+ */
+ es3fTextureSpecificationTests.TexImage2DDepthBufferCase = function(
+ name, desc, internalFormat, imageWidth, imageHeight
+ ) {
+ es3fTextureSpecificationTests.Texture2DSpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLInternalFormat(
+ internalFormat
+ ), imageWidth, imageHeight, 1
+ );
+
+ this.m_internalFormat = internalFormat;
+ // we are interested in the behavior near [-2, 2], map it to visible range [0, 1]
+ this.m_texFormatInfo.lookupBias = [0.25, 0.0, 0.0, 1.0];
+ this.m_texFormatInfo.lookupScale = [0.5, 1.0, 1.0, 0.0];
+ };
+
+ es3fTextureSpecificationTests.TexImage2DDepthBufferCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.Texture2DSpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ TexImage2DDepthBufferCase.prototype.constructor =
+ es3fTextureSpecificationTests.TexImage2DDepthBufferCase;
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ TexImage2DDepthBufferCase.prototype.createTexture = function() {
+ var transferFmt = gluTextureUtil.getTransferFormat(this.m_texFormat);
+ var pixelSize = this.m_texFormat.getPixelSize();
+ var rowLength = this.m_width;
+ var alignment = 4;
+ var rowPitch = deMath.deAlign32(rowLength * pixelSize, alignment);
+ var height = this.m_height;
+ var buf = null;
+ var tex = null;
+ var data = new ArrayBuffer(rowPitch * height);
+
+ assertMsgOptions(
+ this.m_numLevels == 1, 'Number of levels is different than 1',
+ false, true
+ );
+
+ // Fill data with gradient
+ var gMin = [-1.5, -2.0, 1.7, -1.5];
+ var gMax = [2.0, 1.5, -1.0, 2.0];
+
+ var access = new tcuTexture.PixelBufferAccess({
+ format: this.m_texFormat,
+ width: this.m_width,
+ height: this.m_height,
+ rowPitch: rowPitch,
+ data: data
+ });
+ tcuTextureUtil.fillWithComponentGradients(access, gMin, gMax);
+
+ // Create buffer and upload.
+ buf = this.m_context.createBuffer();
+ this.m_context.bindBuffer(gl.PIXEL_UNPACK_BUFFER, buf);
+ this.m_context.bufferData(
+ gl.PIXEL_UNPACK_BUFFER, access.getBuffer(), gl.STATIC_DRAW
+ );
+
+ this.m_context.pixelStorei(gl.UNPACK_ROW_LENGTH, rowLength);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_ROWS, 0);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_PIXELS, 0);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, alignment);
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_2D, tex);
+ this.m_context.texImage2D(
+ gl.TEXTURE_2D, 0, this.m_internalFormat, this.m_width,
+ this.m_height, 0, transferFmt.format, transferFmt.dataType, 0
+ );
+ this.m_context.deleteBuffer(buf);
+ };
+
+ // TexImage3D() depth case with pbo.
+ /**
+ * @constructor
+ * @extends {es3fTextureSpecificationTests.Texture2DArraySpecCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} internalFormat
+ * @param {number} imageWidth
+ * @param {number} imageHeight
+ */
+ es3fTextureSpecificationTests.TexImage2DArrayDepthBufferCase = function(
+ name, desc, internalFormat, imageWidth, imageHeight, numLayers
+ ) {
+ es3fTextureSpecificationTests.Texture2DArraySpecCase.call(
+ this, name, desc, gluTextureUtil.mapGLInternalFormat(
+ internalFormat
+ ), imageWidth, imageHeight, numLayers, 1
+ );
+
+ this.m_internalFormat = internalFormat;
+ // we are interested in the behavior near [-2, 2], map it to visible range [0, 1]
+ this.m_texFormatInfo.lookupBias = [0.25, 0.0, 0.0, 1.0];
+ this.m_texFormatInfo.lookupScale = [0.5, 1.0, 1.0, 0.0];
+ };
+
+ es3fTextureSpecificationTests.TexImage2DArrayDepthBufferCase.prototype =
+ Object.create(
+ es3fTextureSpecificationTests.Texture2DArraySpecCase.prototype
+ );
+
+ es3fTextureSpecificationTests.
+ TexImage2DArrayDepthBufferCase.prototype.constructor =
+ es3fTextureSpecificationTests.TexImage2DArrayDepthBufferCase;
+
+ /**
+ * createTexture
+ */
+ es3fTextureSpecificationTests.
+ TexImage2DArrayDepthBufferCase.prototype.createTexture = function() {
+ var transferFmt = gluTextureUtil.getTransferFormat(this.m_texFormat);
+ var pixelSize = this.m_texFormat.getPixelSize();
+ var rowLength = this.m_width;
+ var alignment = 4;
+ var rowPitch = deMath.deAlign32(rowLength * pixelSize, alignment);
+ var imageHeight = this.m_height;
+ var slicePitch = imageHeight * rowPitch;
+ var tex = null;
+ var buf = null;
+ var data = new ArrayBuffer(slicePitch * this.m_numLayers);
+
+ assertMsgOptions(
+ this.m_numLevels == 1, 'Number of levels is different than 1',
+ false, true
+ );
+
+ // Fill data with gradient
+ var gMin = [-1.5, -2.0, 1.7, -1.5];
+ var gMax = [2.0, 1.5, -1.0, 2.0];
+
+ var access = new tcuTexture.PixelBufferAccess({
+ format: this.m_texFormat,
+ width: this.m_width,
+ height: this.m_height,
+ depth: this.m_numLayers,
+ rowPitch: rowPitch,
+ slicePitch: slicePitch,
+ data: data
+ });
+ tcuTextureUtil.fillWithComponentGradients(access, gMin, gMax);
+
+ buf = this.m_context.createBuffer();
+ this.m_context.bindBuffer(gl.PIXEL_UNPACK_BUFFER, buf);
+ this.m_context.bufferData(
+ gl.PIXEL_UNPACK_BUFFER, access.getBuffer(), gl.STATIC_DRAW
+ );
+
+ this.m_context.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, rowLength);
+ this.m_context.pixelStorei(gl.UNPACK_ROW_LENGTH, rowLength);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_IMAGES, 0);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_ROWS, 0);
+ this.m_context.pixelStorei(gl.UNPACK_SKIP_PIXELS, 0);
+ this.m_context.pixelStorei(gl.UNPACK_ALIGNMENT, alignment);
+
+ tex = this.m_context.createTexture();
+ this.m_context.bindTexture(gl.TEXTURE_2D_ARRAY, tex);
+ this.m_context.texImage3D(
+ gl.TEXTURE_2D_ARRAY, 0, this.m_internalFormat, this.m_width,
+ this.m_height, this.m_numLayers, 0, transferFmt.format,
+ transferFmt.dataType, 0
+ );
+ this.m_context.deleteBuffer(buf);
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fTextureSpecificationTests.TextureSpecificationTests = function() {
+ tcuTestCase.DeqpTest.call(
+ this, 'specification', 'Texture Specification Tests'
+ );
+ };
+
+ es3fTextureSpecificationTests.TextureSpecificationTests.prototype =
+ Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fTextureSpecificationTests.TextureSpecificationTests.prototype.constructor =
+ es3fTextureSpecificationTests.TextureSpecificationTests;
+
+ es3fTextureSpecificationTests.TextureSpecificationTests.prototype.init = function() {
+ /**
+ * @type {Array<number>}
+ */
+ es3fTextureSpecificationTests.s_cubeMapFaces = [
+ gl.TEXTURE_CUBE_MAP_NEGATIVE_X,
+ gl.TEXTURE_CUBE_MAP_POSITIVE_X,
+ gl.TEXTURE_CUBE_MAP_NEGATIVE_Y,
+ gl.TEXTURE_CUBE_MAP_POSITIVE_Y,
+ gl.TEXTURE_CUBE_MAP_NEGATIVE_Z,
+ gl.TEXTURE_CUBE_MAP_POSITIVE_Z
+ ];
+
+ /** @type {Array<{name: string, format: number, dataType: number}>} */
+ var unsizedFormats = [{
+ name: 'alpha_unsigned_byte',
+ format: gl.ALPHA,
+ dataType: gl.UNSIGNED_BYTE
+ }, {
+ name: 'luminance_unsigned_byte',
+ format: gl.LUMINANCE,
+ dataType: gl.UNSIGNED_BYTE
+ }, {
+ name: 'luminance_alpha_unsigned_byte',
+ format: gl.LUMINANCE_ALPHA,
+ dataType: gl.UNSIGNED_BYTE
+ }, {
+ name: 'rgb_unsigned_short_5_6_5',
+ format: gl.RGB,
+ dataType: gl.UNSIGNED_SHORT_5_6_5
+ }, {
+ name: 'rgb_unsigned_byte',
+ format: gl.RGB,
+ dataType: gl.UNSIGNED_BYTE
+ }, {
+ name: 'rgba_unsigned_short_4_4_4_4',
+ format: gl.RGBA,
+ dataType: gl.UNSIGNED_SHORT_4_4_4_4
+ }, {
+ name: 'rgba_unsigned_short_5_5_5_1',
+ format: gl.RGBA,
+ dataType: gl.UNSIGNED_SHORT_5_5_5_1
+ }, {
+ name: 'rgba_unsigned_byte',
+ format: gl.RGBA,
+ dataType: gl.UNSIGNED_BYTE
+ }
+ ];
+
+ /** @type {Array<{name: string, internalFormat: number}>} */
+ var colorFormats = [{
+ name: 'rgba32f', internalFormat: gl.RGBA32F
+ }, {
+ name: 'rgba32i', internalFormat: gl.RGBA32I
+ }, {
+ name: 'rgba32ui', internalFormat: gl.RGBA32UI
+ }, {
+ name: 'rgba16f', internalFormat: gl.RGBA16F
+ }, {
+ name: 'rgba16i', internalFormat: gl.RGBA16I
+ }, {
+ name: 'rgba16ui', internalFormat: gl.RGBA16UI
+ }, {
+ name: 'rgba8', internalFormat: gl.RGBA8
+ }, {
+ name: 'rgba8i', internalFormat: gl.RGBA8I
+ }, {
+ name: 'rgba8ui', internalFormat: gl.RGBA8UI
+ }, {
+ name: 'srgb8_alpha8', internalFormat: gl.SRGB8_ALPHA8
+ }, {
+ name: 'rgb10_a2', internalFormat: gl.RGB10_A2
+ }, {
+ name: 'rgb10_a2ui', internalFormat: gl.RGB10_A2UI
+ }, {
+ name: 'rgba4', internalFormat: gl.RGBA4
+ }, {
+ name: 'rgb5_a1', internalFormat: gl.RGB5_A1
+ }, {
+ name: 'rgba8_snorm', internalFormat: gl.RGBA8_SNORM
+ }, {
+ name: 'rgb8', internalFormat: gl.RGB8
+ }, {
+ name: 'rgb565', internalFormat: gl.RGB565
+ }, {
+ name: 'r11f_g11f_b10f', internalFormat: gl.R11F_G11F_B10F
+ }, {
+ name: 'rgb32f', internalFormat: gl.RGB32F
+ }, {
+ name: 'rgb32i', internalFormat: gl.RGB32I
+ }, {
+ name: 'rgb32ui', internalFormat: gl.RGB32UI
+ }, {
+ name: 'rgb16f', internalFormat: gl.RGB16F
+ }, {
+ name: 'rgb16i', internalFormat: gl.RGB16I
+ }, {
+ name: 'rgb16ui', internalFormat: gl.RGB16UI
+ }, {
+ name: 'rgb8_snorm', internalFormat: gl.RGB8_SNORM
+ }, {
+ name: 'rgb8i', internalFormat: gl.RGB8I
+ }, {
+ name: 'rgb8ui', internalFormat: gl.RGB8UI
+ }, {
+ name: 'srgb8', internalFormat: gl.SRGB8
+ }, {
+ name: 'rgb9_e5', internalFormat: gl.RGB9_E5
+ }, {
+ name: 'rg32f', internalFormat: gl.RG32F
+ }, {
+ name: 'rg32i', internalFormat: gl.RG32I
+ }, {
+ name: 'rg32ui', internalFormat: gl.RG32UI
+ }, {
+ name: 'rg16f', internalFormat: gl.RG16F
+ }, {
+ name: 'rg16i', internalFormat: gl.RG16I
+ }, {
+ name: 'rg16ui', internalFormat: gl.RG16UI
+ }, {
+ name: 'rg8', internalFormat: gl.RG8
+ }, {
+ name: 'rg8i', internalFormat: gl.RG8I
+ }, {
+ name: 'rg8ui', internalFormat: gl.RG8UI
+ }, {
+ name: 'rg8_snorm', internalFormat: gl.RG8_SNORM
+ }, {
+ name: 'r32f', internalFormat: gl.R32F
+ }, {
+ name: 'r32i', internalFormat: gl.R32I
+ }, {
+ name: 'r32ui', internalFormat: gl.R32UI
+ }, {
+ name: 'r16f', internalFormat: gl.R16F
+ }, {
+ name: 'r16i', internalFormat: gl.R16I
+ }, {
+ name: 'r16ui', internalFormat: gl.R16UI
+ }, {
+ name: 'r8', internalFormat: gl.R8
+ }, {
+ name: 'r8i', internalFormat: gl.R8I
+ }, {
+ name: 'r8ui', internalFormat: gl.R8UI
+ }, {
+ name: 'r8_snorm', internalFormat: gl.R8_SNORM
+ }
+ ];
+
+ // Depth and stencil formats
+ /** @type {Array<{name: string, internalFormat: number}>} */
+ var depthStencilFormats = [{
+ name: 'depth_component32f',
+ internalFormat: gl.DEPTH_COMPONENT32F
+ }, {
+ name: 'depth_component24',
+ internalFormat: gl.DEPTH_COMPONENT24
+ }, {
+ name: 'depth_component16',
+ internalFormat: gl.DEPTH_COMPONENT16
+ }, {
+ name: 'depth32f_stencil8',
+ internalFormat: gl.DEPTH32F_STENCIL8
+ }, {
+ name: 'depth24_stencil8',
+ internalFormat: gl.DEPTH24_STENCIL8
+ }
+ ];
+
+ // Basic TexImage2D usage.
+ var splitBasicTex2D = 2, splitBasicTexCube = 5;
+ /** @type {Array<{tcuTestCase.DeqpTest}>} */
+ var basicTexImageGroup2D = [];
+ for (var ii = 0; ii < splitBasicTex2D; ++ii) {
+ basicTexImageGroup2D.push(
+ new tcuTestCase.DeqpTest('basic_teximage2d', 'Basic glTexImage2D() usage')
+ );
+ this.addChild(basicTexImageGroup2D[ii]);
+ }
+ /** @type {Array<{tcuTestCase.DeqpTest}>} */
+ var basicTexImageGroupCube = [];
+ for (var ii = 0; ii < splitBasicTexCube; ++ii) {
+ basicTexImageGroupCube.push(
+ new tcuTestCase.DeqpTest('basic_teximage2d', 'Basic glTexImage2D() usage')
+ );
+ this.addChild(basicTexImageGroupCube[ii]);
+ }
+ for (var formatNdx = 0; formatNdx < colorFormats.length; formatNdx++) {
+ /** @type {string} */
+ var fmtName = colorFormats[formatNdx].name;
+ /** @type {number} */
+ var format = colorFormats[formatNdx].internalFormat;
+ /** @type {number} */
+ var tex2DWidth = 64;
+ /** @type {number} */
+ var tex2DHeight = 128;
+ /** @type {number} */
+ var texCubeSize = 64;
+
+ basicTexImageGroup2D[formatNdx % splitBasicTex2D].addChild(
+ es3fTextureSpecificationTests.newBasicTexImage2DCaseInternal(
+ fmtName + '_2d', '', format, tex2DWidth, tex2DHeight
+ )
+ );
+ basicTexImageGroupCube[formatNdx % splitBasicTexCube].addChild(
+ es3fTextureSpecificationTests.newBasicTexImageCubeCaseInternal(
+ fmtName + '_cube', '', format, texCubeSize
+ )
+ );
+ }
+
+ // Randomized TexImage2D order.
+ /** @type {tcuTestCase.DeqpTest} */
+ var randomTexImageGroup = new tcuTestCase.DeqpTest(
+ 'random_teximage2d', 'Randomized glTexImage2D() usage'
+ );
+ this.addChild(randomTexImageGroup);
+ var rnd = new deRandom.Random(9);
+
+ // 2D cases.
+ for (var ndx = 0; ndx < 10; ndx++) {
+ var formatNdx = rnd.getInt(0, colorFormats.length - 1);
+ var width = 1 << rnd.getInt(2, 8);
+ var height = 1 << rnd.getInt(2, 8);
+
+ randomTexImageGroup.addChild(
+ es3fTextureSpecificationTests.newRandomOrderTexImage2DCaseInternal(
+ '2d.' + colorFormats[formatNdx].name, '',
+ colorFormats[formatNdx].internalFormat, width, height
+ )
+ );
+ }
+
+ // Cubemap cases.
+ randomTexImageGroup = new tcuTestCase.DeqpTest(
+ 'random_teximage2d', 'Randomized glTexImage2D() usage'
+ );
+ this.addChild(randomTexImageGroup);
+
+ for (var ndx = 0; ndx < 10; ndx++) {
+ formatNdx = rnd.getInt(0, colorFormats.length - 1);
+ /** @type {number} */ var size = 1 << rnd.getInt(2, 8);
+
+ randomTexImageGroup.addChild(
+ es3fTextureSpecificationTests.newRandomOrderTexImageCubeCaseInternal(
+ 'cube.' + colorFormats[formatNdx].name, '',
+ colorFormats[formatNdx].internalFormat, size
+ )
+ );
+ }
+
+ // TexImage2D unpack alignment.
+ /** @type {tcuTestCase.DeqpTest} */
+ var alignGroup = new tcuTestCase.DeqpTest(
+ 'teximage2d_align', 'glTexImage2D() unpack alignment tests'
+ );
+ this.addChild(alignGroup);
+
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal(
+ '2d_r8_4_8', '', gl.R8, 4, 8, 4, 8
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal(
+ '2d_r8_63_1', '', gl.R8, 63, 30, 1, 1
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal(
+ '2d_r8_63_2', '', gl.R8, 63, 30, 1, 2
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal(
+ '2d_r8_63_4', '', gl.R8, 63, 30, 1, 4
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal(
+ '2d_r8_63_8', '', gl.R8, 63, 30, 1, 8
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal(
+ '2d_rgba4_51_1', '', gl.RGBA4, 51, 30, 1, 1
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal(
+ '2d_rgba4_51_2', '', gl.RGBA4, 51, 30, 1, 2
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal(
+ '2d_rgba4_51_4', '', gl.RGBA4, 51, 30, 1, 4
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal(
+ '2d_rgba4_51_8', '', gl.RGBA4, 51, 30, 1, 8
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal(
+ '2d_rgb8_39_1', '', gl.RGB8, 39, 43, 1, 1
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal(
+ '2d_rgb8_39_2', '', gl.RGB8, 39, 43, 1, 2
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal(
+ '2d_rgb8_39_4', '', gl.RGB8, 39, 43, 1, 4
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal(
+ '2d_rgb8_39_8', '', gl.RGB8, 39, 43, 1, 8
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal(
+ '2d_rgba8_47_1', '', gl.RGBA8, 47, 27, 1, 1
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal(
+ '2d_rgba8_47_2', '', gl.RGBA8, 47, 27, 1, 2
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal(
+ '2d_rgba8_47_4', '', gl.RGBA8, 47, 27, 1, 4
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImage2DAlignCaseInternal(
+ '2d_rgba8_47_8', '', gl.RGBA8, 47, 27, 1, 8
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal(
+ 'cube_r8_4_8', '', gl.R8, 4, 3, 8
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal(
+ 'cube_r8_63_1', '', gl.R8, 63, 1, 1
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal(
+ 'cube_r8_63_2', '', gl.R8, 63, 1, 2
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal(
+ 'cube_r8_63_4', '', gl.R8, 63, 1, 4
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal(
+ 'cube_r8_63_8', '', gl.R8, 63, 1, 8
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal(
+ 'cube_rgba4_51_1', '', gl.RGBA4, 51, 1, 1
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal(
+ 'cube_rgba4_51_2', '', gl.RGBA4, 51, 1, 2
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal(
+ 'cube_rgba4_51_4', '', gl.RGBA4, 51, 1, 4
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal(
+ 'cube_rgba4_51_8', '', gl.RGBA4, 51, 1, 8
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal(
+ 'cube_rgb8_39_1', '', gl.RGB8, 39, 1, 1
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal(
+ 'cube_rgb8_39_2', '', gl.RGB8, 39, 1, 2
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal(
+ 'cube_rgb8_39_4', '', gl.RGB8, 39, 1, 4
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal(
+ 'cube_rgb8_39_8', '', gl.RGB8, 39, 1, 8
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal(
+ 'cube_rgba8_47_1', '', gl.RGBA8, 47, 1, 1
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal(
+ 'cube_rgba8_47_2', '', gl.RGBA8, 47, 1, 2
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal(
+ 'cube_rgba8_47_4', '', gl.RGBA8, 47, 1, 4
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexImageCubeAlignCaseInternal(
+ 'cube_rgba8_47_8', '', gl.RGBA8, 47, 1, 8
+ )
+ );
+
+ // glTexImage2D() unpack parameter cases.
+ /** @type {tcuTestCase.DeqpTest} */
+ var paramGroup = new tcuTestCase.DeqpTest(
+ 'teximage2d_unpack_params',
+ 'glTexImage2D() pixel transfer mode cases'
+ );
+ this.addChild(paramGroup);
+
+ var cases = [{
+ name: 'rgb8_alignment', format: gl.RGB8, width: 31,
+ height: 30, rowLength: 0, skipRows: 0, skipPixels: 0,
+ alignment: 2
+ }, {
+ name: 'rgb8_row_length', format: gl.RGB8, width: 31,
+ height: 30, rowLength: 50, skipRows: 0, skipPixels: 0,
+ alignment: 4
+ }, {
+ name: 'rgb8_skip_rows', format: gl.RGB8, width: 31,
+ height: 30, rowLength: 0, skipRows: 3, skipPixels: 0,
+ alignment: 4
+ }, {
+ name: 'rgb8_skip_pixels', format: gl.RGB8, width: 31,
+ height: 30, rowLength: 36, skipRows: 0, skipPixels: 5,
+ alignment: 4
+ }, {
+ name: 'r8_complex1', format: gl.R8, width: 31,
+ height: 30, rowLength: 64, skipRows: 1, skipPixels: 3,
+ alignment: 1
+ }, {
+ name: 'r8_complex2', format: gl.R8, width: 31,
+ height: 30, rowLength: 64, skipRows: 1, skipPixels: 3,
+ alignment: 2
+ }, {
+ name: 'r8_complex3', format: gl.R8, width: 31,
+ height: 30, rowLength: 64, skipRows: 1, skipPixels: 3,
+ alignment: 4
+ }, {
+ name: 'r8_complex4', format: gl.R8, width: 31,
+ height: 30, rowLength: 64, skipRows: 1, skipPixels: 3,
+ alignment: 8
+ }, {
+ name: 'rgba8_complex1', format: gl.RGBA8, width: 56,
+ height: 61, rowLength: 69, skipRows: 0, skipPixels: 0,
+ alignment: 8
+ }, {
+ name: 'rgba8_complex2', format: gl.RGBA8, width: 56,
+ height: 61, rowLength: 69, skipRows: 0, skipPixels: 7,
+ alignment: 8
+ }, {
+ name: 'rgba8_complex3', format: gl.RGBA8, width: 56,
+ height: 61, rowLength: 69, skipRows: 3, skipPixels: 0,
+ alignment: 8
+ }, {
+ name: 'rgba8_complex4', format: gl.RGBA8, width: 56,
+ height: 61, rowLength: 69, skipRows: 3, skipPixels: 7,
+ alignment: 8
+ }, {
+ name: 'rgba32f_complex', format: gl.RGBA32F, width: 19,
+ height: 10, rowLength: 27, skipRows: 1, skipPixels: 7,
+ alignment: 8
+ }
+ ];
+
+ for (var ndx = 0; ndx < cases.length; ndx++)
+ paramGroup.addChild(
+ new es3fTextureSpecificationTests.TexImage2DParamsCase(
+ cases[ndx].name, '', cases[ndx].format, cases[ndx].width,
+ cases[ndx].height, cases[ndx].rowLength,
+ cases[ndx].skipRows, cases[ndx].skipPixels,
+ cases[ndx].alignment
+ )
+ );
+
+ // glTexImage2D() pbo cases.
+ var splitPboTex2D = 2, splitPboTexCube = 5;
+ /** @type {Array<{tcuTestCase.DeqpTest}>} */ var pboGroup2D = [];
+ for (var ii = 0; ii < splitPboTex2D; ++ii) {
+ pboGroup2D.push(new tcuTestCase.DeqpTest('teximage2d_pbo', 'glTexImage2D() from PBO'));
+ this.addChild(pboGroup2D[ii]);
+ }
+ /** @type {Array<{tcuTestCase.DeqpTest}>} */ var pboGroupCube = [];
+ for (var ii = 0; ii < splitPboTexCube; ++ii) {
+ pboGroupCube.push(new tcuTestCase.DeqpTest('teximage2d_pbo', 'glTexImage2D() from PBO'));
+ this.addChild(pboGroupCube[ii]);
+ }
+ for (var formatNdx = 0; formatNdx < colorFormats.length; formatNdx++) {
+ fmtName = colorFormats[formatNdx].name;
+ format = colorFormats[formatNdx].internalFormat;
+ tex2DWidth = 65;
+ tex2DHeight = 37;
+ texCubeSize = 64;
+
+ pboGroup2D[formatNdx % splitPboTex2D].addChild(
+ new es3fTextureSpecificationTests.TexImage2DBufferCase(
+ fmtName + '_2d', '', format,
+ tex2DWidth, tex2DHeight, 0, 0, 0, 4, 0
+ )
+ );
+ pboGroupCube[formatNdx % splitPboTexCube].addChild(
+ new es3fTextureSpecificationTests.TexImageCubeBufferCase(
+ fmtName + '_cube', '', format,
+ texCubeSize, 0, 0, 0, 4, 0
+ )
+ );
+ }
+
+ // Parameter cases
+ var pboGroupParams = new tcuTestCase.DeqpTest(
+ 'teximage2d_pbo', 'glTexImage2D() from PBO'
+ );
+ this.addChild(pboGroupParams);
+ /**
+ * @type {Array<{name: string, format: number, width: number,
+ * height: number, rowLength: number, skipRows: number,
+ * skipPixels: number, alignment: number, offset: number}>}
+ */
+ var parameterCases = [{
+ name: 'rgb8_offset', format: gl.RGB8, width: 31,
+ height: 30, rowLength: 0, skipRows: 0, skipPixels: 0,
+ alignment: 4, offset: 67
+ }, {
+ name: 'rgb8_alignment', format: gl.RGB8, width: 31,
+ height: 30, rowLength: 0, skipRows: 0, skipPixels: 0,
+ alignment: 2, offset: 0
+ }, {
+ name: 'rgb8_row_length', format: gl.RGB8, width: 31,
+ height: 30, rowLength: 50, skipRows: 0, skipPixels: 0,
+ alignment: 4, offset: 0
+ }, {
+ name: 'rgb8_skip_rows', format: gl.RGB8, width: 31,
+ height: 30, rowLength: 0, skipRows: 3, skipPixels: 0,
+ alignment: 4, offset: 0
+ }, {
+ name: 'rgb8_skip_pixels', format: gl.RGB8, width: 31,
+ height: 30, rowLength: 36, skipRows: 0, skipPixels: 5,
+ alignment: 4, offset: 0
+ }
+ ];
+ for (var ndx = 0; ndx < parameterCases.length; ndx++) {
+ pboGroupParams.addChild(
+ new es3fTextureSpecificationTests.TexImage2DBufferCase(
+ parameterCases[ndx].name + '_2d', '',
+ parameterCases[ndx].format, parameterCases[ndx].width,
+ parameterCases[ndx].height, parameterCases[ndx].rowLength,
+ parameterCases[ndx].skipRows,
+ parameterCases[ndx].skipPixels,
+ parameterCases[ndx].alignment,
+ parameterCases[ndx].offset
+ )
+ );
+ pboGroupParams.addChild(
+ new es3fTextureSpecificationTests.TexImageCubeBufferCase(
+ parameterCases[ndx].name + '_cube', '',
+ parameterCases[ndx].format, parameterCases[ndx].width,
+ parameterCases[ndx].rowLength, parameterCases[ndx].skipRows,
+ parameterCases[ndx].skipPixels,
+ parameterCases[ndx].alignment, parameterCases[ndx].offset
+ )
+ );
+ }
+
+ // glTexImage2D() depth cases.
+ /** @type {tcuTestCase.DeqpTest} */
+ var shadow2dGroup = new tcuTestCase.DeqpTest(
+ 'teximage2d_depth',
+ 'glTexImage2D() with depth or depth/stencil format'
+ );
+ this.addChild(shadow2dGroup);
+
+ for (var ndx = 0; ndx < depthStencilFormats.length; ndx++) {
+ // WebGL 2 specific constraint.
+ if (depthStencilFormats[ndx].internalFormat == gl.DEPTH32F_STENCIL8)
+ continue;
+ var tex2DWidth = 64;
+ var tex2DHeight = 128;
+
+ shadow2dGroup.addChild(
+ new es3fTextureSpecificationTests.TexImage2DDepthCase(
+ depthStencilFormats[ndx].name, '',
+ depthStencilFormats[ndx].internalFormat,
+ tex2DWidth, tex2DHeight
+ )
+ );
+ }
+
+ // glTexImage2D() depth cases with pbo.
+ shadow2dGroup = new tcuTestCase.DeqpTest(
+ 'teximage2d_depth_pbo',
+ 'glTexImage2D() with depth or depth/stencil format with pbo'
+ );
+ this.addChild(shadow2dGroup);
+
+ for (var ndx = 0; ndx < depthStencilFormats.length; ndx++) {
+ tex2DWidth = 64;
+ tex2DHeight = 128;
+
+ shadow2dGroup.addChild(
+ new es3fTextureSpecificationTests.TexImage2DDepthBufferCase(
+ depthStencilFormats[ndx].name, '',
+ depthStencilFormats[ndx].internalFormat,
+ tex2DWidth, tex2DHeight
+ )
+ );
+ }
+
+ // Basic TexSubImage2D usage.
+ splitBasicTex2D = 3;
+ splitBasicTexCube = 5;
+ /** @type {Array<{tcuTestCase.DeqpTest}>} */
+ var basicTexSubImageGroup2D = [];
+ for (var ii = 0; ii < splitBasicTex2D; ++ii) {
+ basicTexSubImageGroup2D.push(
+ new tcuTestCase.DeqpTest('basic_texsubimage2d', 'Basic glTexSubImage2D() usage')
+ );
+ this.addChild(basicTexSubImageGroup2D[ii]);
+ }
+ /** @type {Array<{tcuTestCase.DeqpTest}>} */
+ var basicTexSubImageGroupCube = [];
+ for (var ii = 0; ii < splitBasicTexCube; ++ii) {
+ basicTexSubImageGroupCube.push(
+ new tcuTestCase.DeqpTest('basic_texsubimage2d', 'Basic glTexSubImage2D() usage')
+ );
+ this.addChild(basicTexSubImageGroupCube[ii]);
+ }
+ for (var formatNdx = 0; formatNdx < colorFormats.length; formatNdx++) {
+ fmtName = colorFormats[formatNdx].name;
+ format = colorFormats[formatNdx].internalFormat;
+ tex2DWidth = 64;
+ tex2DHeight = 128;
+ texCubeSize = 64;
+
+ basicTexSubImageGroup2D[formatNdx % splitBasicTex2D].addChild(
+ es3fTextureSpecificationTests.newBasicTexSubImage2DCaseInternal(
+ fmtName + '_2d', '', format, tex2DWidth, tex2DHeight
+ )
+ );
+ basicTexSubImageGroupCube[formatNdx % splitBasicTexCube].addChild(
+ es3fTextureSpecificationTests.newBasicTexImageCubeCaseInternal(
+ fmtName + '_cube', '', format, texCubeSize
+ )
+ );
+ }
+
+ // TexSubImage2D to empty texture.
+ /** @type {tcuTestCase.DeqpTest} */
+ var texSubImageEmptyTexGroup = new tcuTestCase.DeqpTest(
+ 'texsubimage2d_empty_tex',
+ 'glTexSubImage2D() to texture that has storage but no data'
+ );
+ this.addChild(texSubImageEmptyTexGroup);
+ for (var formatNdx = 0; formatNdx < unsizedFormats.length; formatNdx++) {
+ fmtName = unsizedFormats[formatNdx].name;
+ format = unsizedFormats[formatNdx].format;
+ /** @type {number} */
+ var dataType = unsizedFormats[formatNdx].dataType;
+ tex2DWidth = 64;
+ tex2DHeight = 32;
+ texCubeSize = 32;
+
+ texSubImageEmptyTexGroup.addChild(
+ new es3fTextureSpecificationTests.TexSubImage2DEmptyTexCase(
+ fmtName + '_2d', '', format, dataType, tex2DWidth, tex2DHeight
+ )
+ );
+ texSubImageEmptyTexGroup.addChild(
+ new es3fTextureSpecificationTests.TexSubImageCubeEmptyTexCase(
+ fmtName + '_cube', '', format, dataType, texCubeSize
+ )
+ );
+ }
+
+ // TexSubImage2D alignment cases.
+ alignGroup = new tcuTestCase.DeqpTest(
+ 'texsubimage2d_align', 'glTexSubImage2D() unpack alignment tests'
+ );
+ this.addChild(alignGroup);
+
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal(
+ '2d_r8_1_1', '', gl.R8, 64, 64, 13, 17, 1, 6, 1
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal(
+ '2d_r8_1_2', '', gl.R8, 64, 64, 13, 17, 1, 6, 2
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal(
+ '2d_r8_1_4', '', gl.R8, 64, 64, 13, 17, 1, 6, 4
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal(
+ '2d_r8_1_8', '', gl.R8, 64, 64, 13, 17, 1, 6, 8
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal(
+ '2d_r8_63_1', '', gl.R8, 64, 64, 1, 9, 63, 30, 1
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal(
+ '2d_r8_63_2', '', gl.R8, 64, 64, 1, 9, 63, 30, 2
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal(
+ '2d_r8_63_4', '', gl.R8, 64, 64, 1, 9, 63, 30, 4
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal(
+ '2d_r8_63_8', '', gl.R8, 64, 64, 1, 9, 63, 30, 8
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal(
+ '2d_rgba4_51_1', '', gl.RGBA4, 64, 64, 7, 29, 51, 30, 1
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal(
+ '2d_rgba4_51_2', '', gl.RGBA4, 64, 64, 7, 29, 51, 30, 2
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal(
+ '2d_rgba4_51_4', '', gl.RGBA4, 64, 64, 7, 29, 51, 30, 4
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal(
+ '2d_rgba4_51_8', '', gl.RGBA4, 64, 64, 7, 29, 51, 30, 8
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal(
+ '2d_rgb8_39_1', '', gl.RGB8, 64, 64, 11, 8, 39, 43, 1
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal(
+ '2d_rgb8_39_2', '', gl.RGB8, 64, 64, 11, 8, 39, 43, 2
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal(
+ '2d_rgb8_39_4', '', gl.RGB8, 64, 64, 11, 8, 39, 43, 4
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal(
+ '2d_rgb8_39_8', '', gl.RGB8, 64, 64, 11, 8, 39, 43, 8
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal(
+ '2d_rgba8_47_1', '', gl.RGBA8, 64, 64, 10, 1, 47, 27, 1
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal(
+ '2d_rgba8_47_2', '', gl.RGBA8, 64, 64, 10, 1, 47, 27, 2
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal(
+ '2d_rgba8_47_4', '', gl.RGBA8, 64, 64, 10, 1, 47, 27, 4
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImage2DAlignCaseInternal(
+ '2d_rgba8_47_8', '', gl.RGBA8, 64, 64, 10, 1, 47, 27, 8
+ )
+ );
+
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal(
+ 'cube_r8_1_1', '', gl.R8, 64, 13, 17, 1, 6, 1
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal(
+ 'cube_r8_1_2', '', gl.R8, 64, 13, 17, 1, 6, 2
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal(
+ 'cube_r8_1_4', '', gl.R8, 64, 13, 17, 1, 6, 4
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal(
+ 'cube_r8_1_8', '', gl.R8, 64, 13, 17, 1, 6, 8
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal(
+ 'cube_r8_63_1', '', gl.R8, 64, 1, 9, 63, 30, 1
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal(
+ 'cube_r8_63_2', '', gl.R8, 64, 1, 9, 63, 30, 2
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal(
+ 'cube_r8_63_4', '', gl.R8, 64, 1, 9, 63, 30, 4
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal(
+ 'cube_r8_63_8', '', gl.R8, 64, 1, 9, 63, 30, 8
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal(
+ 'cube_rgba4_51_1', '', gl.RGBA4, 64, 7, 29, 51, 30, 1
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal(
+ 'cube_rgba4_51_2', '', gl.RGBA4, 64, 7, 29, 51, 30, 2
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal(
+ 'cube_rgba4_51_4', '', gl.RGBA4, 64, 7, 29, 51, 30, 4
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal(
+ 'cube_rgba4_51_8', '', gl.RGBA4, 64, 7, 29, 51, 30, 8
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal(
+ 'cube_rgb8_39_1', '', gl.RGB8, 64, 11, 8, 39, 43, 1
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal(
+ 'cube_rgb8_39_2', '', gl.RGB8, 64, 11, 8, 39, 43, 2
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal(
+ 'cube_rgb8_39_4', '', gl.RGB8, 64, 11, 8, 39, 43, 4
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal(
+ 'cube_rgb8_39_8', '', gl.RGB8, 64, 11, 8, 39, 43, 8
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal(
+ 'cube_rgba8_47_1', '', gl.RGBA8, 64, 10, 1, 47, 27, 1
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal(
+ 'cube_rgba8_47_2', '', gl.RGBA8, 64, 10, 1, 47, 27, 2
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal(
+ 'cube_rgba8_47_4', '', gl.RGBA8, 64, 10, 1, 47, 27, 4
+ )
+ );
+ alignGroup.addChild(
+ es3fTextureSpecificationTests.newTexSubImageCubeAlignCaseInternal(
+ 'cube_rgba8_47_8', '', gl.RGBA8, 64, 10, 1, 47, 27, 8
+ )
+ );
+
+ // glTexSubImage2D() pixel transfer mode cases.
+ paramGroup = new tcuTestCase.DeqpTest(
+ 'texsubimage2d_unpack_params',
+ 'glTexSubImage2D() pixel transfer mode cases'
+ );
+ this.addChild(paramGroup);
+
+ cases = [{
+ name: 'rgb8_alignment', format: gl.RGB8, width: 54,
+ height: 60, subX: 11, subY: 7, subW: 31, subH: 30,
+ rowLength: 0, skipRows: 0, skipPixels: 0, alignment: 2
+ }, {
+ name: 'rgb8_row_length', format: gl.RGB8, width: 54,
+ height: 60, subX: 11, subY: 7, subW: 31, subH: 30,
+ rowLength: 50, skipRows: 0, skipPixels: 0, alignment: 4
+ }, {
+ name: 'rgb8_skip_rows', format: gl.RGB8, width: 54,
+ height: 60, subX: 11, subY: 7, subW: 31, subH: 30,
+ rowLength: 0, skipRows: 3, skipPixels: 0, alignment: 4
+ }, {
+ name: 'rgb8_skip_pixels', format: gl.RGB8, width: 54,
+ height: 60, subX: 11, subY: 7, subW: 31, subH: 30,
+ rowLength: 36, skipRows: 0, skipPixels: 5, alignment: 4
+ }, {
+ name: 'r8_complex1', format: gl.R8, width: 54,
+ height: 60, subX: 11, subY: 7, subW: 31, subH: 30,
+ rowLength: 64, skipRows: 1, skipPixels: 3, alignment: 1
+ }, {
+ name: 'r8_complex2', format: gl.R8, width: 54,
+ height: 60, subX: 11, subY: 7, subW: 31, subH: 30,
+ rowLength: 64, skipRows: 1, skipPixels: 3, alignment: 2
+ }, {
+ name: 'r8_complex3', format: gl.R8, width: 54,
+ height: 60, subX: 11, subY: 7, subW: 31, subH: 30,
+ rowLength: 64, skipRows: 1, skipPixels: 3, alignment: 4
+ }, {
+ name: 'r8_complex4', format: gl.R8, width: 54,
+ height: 60, subX: 11, subY: 7, subW: 31, subH: 30,
+ rowLength: 64, skipRows: 1, skipPixels: 3, alignment: 8
+ }, {
+ name: 'rgba8_complex1', format: gl.RGBA8, width: 92,
+ height: 84, subX: 13, subY: 19, subW: 56, subH: 61,
+ rowLength: 69, skipRows: 0, skipPixels: 0, alignment: 8
+ }, {
+ name: 'rgba8_complex2', format: gl.RGBA8, width: 92,
+ height: 84, subX: 13, subY: 19, subW: 56, subH: 61,
+ rowLength: 69, skipRows: 0, skipPixels: 7, alignment: 8
+ }, {
+ name: 'rgba8_complex3', format: gl.RGBA8, width: 92,
+ height: 84, subX: 13, subY: 19, subW: 56, subH: 61,
+ rowLength: 69, skipRows: 3, skipPixels: 0, alignment: 8
+ }, {
+ name: 'rgba8_complex4', format: gl.RGBA8, width: 92,
+ height: 84, subX: 13, subY: 19, subW: 56, subH: 61,
+ rowLength: 69, skipRows: 3, skipPixels: 7, alignment: 8
+ }, {
+ name: 'rgba32f_complex', format: gl.RGBA32F, width: 92,
+ height: 84, subX: 13, subY: 19, subW: 56, subH: 61,
+ rowLength: 69, skipRows: 3, skipPixels: 7, alignment: 8
+ }
+ ];
+
+ for (var ndx = 0; ndx < cases.length; ndx++)
+ paramGroup.addChild(
+ new es3fTextureSpecificationTests.TexSubImage2DParamsCase(
+ cases[ndx].name, '', cases[ndx].format, cases[ndx].width,
+ cases[ndx].height, cases[ndx].subX, cases[ndx].subY,
+ cases[ndx].subW, cases[ndx].subH, cases[ndx].rowLength,
+ cases[ndx].skipRows, cases[ndx].skipPixels,
+ cases[ndx].alignment
+ )
+ );
+
+ // glTexSubImage2D() PBO cases.
+ splitPboTex2D = 2;
+ splitPboTexCube = 5;
+ pboGroup2D = [];
+ for (var ii = 0; ii < splitPboTex2D; ++ii) {
+ pboGroup2D.push(new tcuTestCase.DeqpTest(
+ 'texsubimage2d_pbo',
+ 'glTexSubImage2D() pixel buffer object tests'
+ ));
+ this.addChild(pboGroup2D[ii]);
+ }
+ pboGroupCube = [];
+ for (var ii = 0; ii < splitPboTexCube; ++ii) {
+ pboGroupCube.push(new tcuTestCase.DeqpTest(
+ 'texsubimage2d_pbo',
+ 'glTexSubImage2D() pixel buffer object tests'
+ ));
+ this.addChild(pboGroupCube[ii]);
+ }
+
+ for (var ndx = 0; ndx < colorFormats.length; ndx++) {
+ pboGroup2D[ndx % splitPboTex2D].addChild(
+ new es3fTextureSpecificationTests.TexSubImage2DBufferCase(
+ colorFormats[ndx].name + '_2d', '',
+ colorFormats[ndx].internalFormat,
+ 54, // Width
+ 60, // Height
+ 11, // Sub X
+ 7, // Sub Y
+ 31, // Sub W
+ 30, // Sub H
+ 0, // Row len
+ 0, // Skip rows
+ 0, // Skip pixels
+ 4, // Alignment
+ 0 /* offset */
+ )
+ );
+ pboGroupCube[ndx % splitPboTexCube].addChild(
+ new es3fTextureSpecificationTests.TexSubImageCubeBufferCase(
+ colorFormats[ndx].name + '_cube', '',
+ colorFormats[ndx].internalFormat,
+ 64, // Size
+ 11, // Sub X
+ 7, // Sub Y
+ 31, // Sub W
+ 30, // Sub H
+ 0, // Row len
+ 0, // Skip rows
+ 0, // Skip pixels
+ 4, // Alignment
+ 0 /* offset */
+ )
+ );
+ }
+
+ pboGroupParams = new tcuTestCase.DeqpTest(
+ 'texsubimage2d_pbo',
+ 'glTexSubImage2D() pixel buffer object tests'
+ );
+ this.addChild(pboGroupParams);
+ /** @type {Array<{name: string, format: number, width: number,
+ * height: number, subX: number, subY: number,
+ * subW: number, subH: number, rowLength: number, skipRows: number,
+ * skipPixels: number, alignment: number, offset: number}>}
+ */
+ var paramCases = [{
+ name: 'rgb8_offset', format: gl.RGB8, width: 54,
+ height: 60, subX: 11, subY: 7, subW: 31, subH: 30,
+ rowLength: 0, skipRows: 0, skipPixels: 0,
+ alignment: 4, offset: 67
+ }, {
+ name: 'rgb8_alignment', format: gl.RGB8, width: 54,
+ height: 60, subX: 11, subY: 7, subW: 31, subH: 30,
+ rowLength: 0, skipRows: 0, skipPixels: 0,
+ alignment: 2, offset: 0
+ }, {
+ name: 'rgb8_row_length', format: gl.RGB8, width: 54,
+ height: 60, subX: 11, subY: 7, subW: 31, subH: 30,
+ rowLength: 50, skipRows: 0, skipPixels: 0,
+ alignment: 4, offset: 0
+ }, {
+ name: 'rgb8_skip_rows', format: gl.RGB8, width: 54,
+ height: 60, subX: 11, subY: 7, subW: 31, subH: 30,
+ rowLength: 0, skipRows: 3, skipPixels: 0,
+ alignment: 4, offset: 0
+ }, {
+ name: 'rgb8_skip_pixels', format: gl.RGB8, width: 54,
+ height: 60, subX: 11, subY: 7, subW: 31, subH: 30,
+ rowLength: 36, skipRows: 0, skipPixels: 5,
+ alignment: 4, offset: 0
+ }
+ ];
+
+ for (var ndx = 0; ndx < paramCases.length; ndx++) {
+ pboGroupParams.addChild(
+ new es3fTextureSpecificationTests.TexSubImage2DBufferCase(
+ paramCases[ndx].name + '_2d', '',
+ paramCases[ndx].format,
+ paramCases[ndx].width,
+ paramCases[ndx].height,
+ paramCases[ndx].subX,
+ paramCases[ndx].subY,
+ paramCases[ndx].subW,
+ paramCases[ndx].subH,
+ paramCases[ndx].rowLength,
+ paramCases[ndx].skipRows,
+ paramCases[ndx].skipPixels,
+ paramCases[ndx].alignment,
+ paramCases[ndx].offset));
+ pboGroupParams.addChild(
+ new es3fTextureSpecificationTests.TexSubImageCubeBufferCase(
+ paramCases[ndx].name + '_cube', '',
+ paramCases[ndx].format,
+ paramCases[ndx].width,
+ paramCases[ndx].subX,
+ paramCases[ndx].subY,
+ paramCases[ndx].subW,
+ paramCases[ndx].subH,
+ paramCases[ndx].rowLength,
+ paramCases[ndx].skipRows,
+ paramCases[ndx].skipPixels,
+ paramCases[ndx].alignment,
+ paramCases[ndx].offset
+ )
+ );
+ }
+
+ // glTexSubImage2D() depth cases.
+ shadow2dGroup = new tcuTestCase.DeqpTest(
+ 'texsubimage2d_depth',
+ 'glTexSubImage2D() with depth or depth/stencil format'
+ );
+ this.addChild(shadow2dGroup);
+
+ for (var ndx = 0; ndx < depthStencilFormats.length; ndx++) {
+ // WebGL 2 specific constraint.
+ if (depthStencilFormats[ndx].internalFormat == gl.DEPTH32F_STENCIL8)
+ continue;
+ tex2DWidth = 64;
+ tex2DHeight = 32;
+
+ shadow2dGroup.addChild(
+ new es3fTextureSpecificationTests.TexSubImage2DDepthCase(
+ depthStencilFormats[ndx].name, '',
+ depthStencilFormats[ndx].internalFormat,
+ tex2DWidth, tex2DHeight
+ )
+ );
+ }
+
+ // Basic glCopyTexImage2D() cases
+ /** @type {tcuTestCase.DeqpTest} */
+ var copyTexImageGroup = new tcuTestCase.DeqpTest(
+ 'basic_copyteximage2d', 'Basic glCopyTexImage2D() usage'
+ );
+ this.addChild(copyTexImageGroup);
+
+ copyTexImageGroup.addChild(
+ new es3fTextureSpecificationTests.BasicCopyTexImage2DCase(
+ '2d_alpha', '', gl.ALPHA, 128, 64
+ )
+ );
+ copyTexImageGroup.addChild(
+ new es3fTextureSpecificationTests.BasicCopyTexImage2DCase(
+ '2d_luminance', '', gl.LUMINANCE, 128, 64
+ )
+ );
+ copyTexImageGroup.addChild(
+ new es3fTextureSpecificationTests.BasicCopyTexImage2DCase(
+ '2d_luminance_alpha', '', gl.LUMINANCE_ALPHA, 128, 64
+ )
+ );
+ copyTexImageGroup.addChild(
+ new es3fTextureSpecificationTests.BasicCopyTexImage2DCase(
+ '2d_rgb', '', gl.RGB, 128, 64
+ )
+ );
+ copyTexImageGroup.addChild(
+ new es3fTextureSpecificationTests.BasicCopyTexImage2DCase(
+ '2d_rgba', '', gl.RGBA, 128, 64
+ )
+ );
+
+ copyTexImageGroup.addChild(
+ new es3fTextureSpecificationTests.BasicCopyTexImageCubeCase(
+ 'cube_alpha', '', gl.ALPHA, 64
+ )
+ );
+ copyTexImageGroup.addChild(
+ new es3fTextureSpecificationTests.BasicCopyTexImageCubeCase(
+ 'cube_luminance', '', gl.LUMINANCE, 64
+ )
+ );
+ copyTexImageGroup.addChild(
+ new es3fTextureSpecificationTests.BasicCopyTexImageCubeCase(
+ 'cube_luminance_alpha', '', gl.LUMINANCE_ALPHA, 64
+ )
+ );
+ copyTexImageGroup.addChild(
+ new es3fTextureSpecificationTests.BasicCopyTexImageCubeCase(
+ 'cube_rgb', '', gl.RGB, 64
+ )
+ );
+ copyTexImageGroup.addChild(
+ new es3fTextureSpecificationTests.BasicCopyTexImageCubeCase(
+ 'cube_rgba', '', gl.RGBA, 64
+ )
+ );
+
+ // Basic glCopyTexSubImage2D() cases
+ /** @type {tcuTestCase.DeqpTest} */
+ var copyTexSubImageGroup = new tcuTestCase.DeqpTest(
+ 'basic_copytexsubimage2d', 'Basic glCopyTexSubImage2D() usage'
+ );
+ this.addChild(copyTexSubImageGroup);
+
+ copyTexSubImageGroup.addChild(
+ new es3fTextureSpecificationTests.BasicCopyTexSubImage2DCase(
+ '2d_alpha', '', gl.ALPHA, gl.UNSIGNED_BYTE, 128, 64
+ )
+ );
+ copyTexSubImageGroup.addChild(
+ new es3fTextureSpecificationTests.BasicCopyTexSubImage2DCase(
+ '2d_luminance', '', gl.LUMINANCE, gl.UNSIGNED_BYTE, 128, 64
+ )
+ );
+ copyTexSubImageGroup.addChild(
+ new es3fTextureSpecificationTests.BasicCopyTexSubImage2DCase(
+ '2d_luminance_alpha', '', gl.LUMINANCE_ALPHA, gl.UNSIGNED_BYTE, 128, 64
+ )
+ );
+ copyTexSubImageGroup.addChild(
+ new es3fTextureSpecificationTests.BasicCopyTexSubImage2DCase(
+ '2d_rgb', '', gl.RGB, gl.UNSIGNED_BYTE, 128, 64
+ )
+ );
+ copyTexSubImageGroup.addChild(
+ new es3fTextureSpecificationTests.BasicCopyTexSubImage2DCase(
+ '2d_rgba', '', gl.RGBA, gl.UNSIGNED_BYTE, 128, 64
+ )
+ );
+
+ copyTexSubImageGroup.addChild(
+ new es3fTextureSpecificationTests.BasicCopyTexSubImageCubeCase(
+ 'cube_alpha', '', gl.ALPHA, gl.UNSIGNED_BYTE, 64
+ )
+ );
+ copyTexSubImageGroup.addChild(
+ new es3fTextureSpecificationTests.BasicCopyTexSubImageCubeCase(
+ 'cube_luminance', '', gl.LUMINANCE, gl.UNSIGNED_BYTE, 64
+ )
+ );
+ copyTexSubImageGroup.addChild(
+ new es3fTextureSpecificationTests.BasicCopyTexSubImageCubeCase(
+ 'cube_luminance_alpha', '', gl.LUMINANCE_ALPHA, gl.UNSIGNED_BYTE, 64
+ )
+ );
+ copyTexSubImageGroup.addChild(
+ new es3fTextureSpecificationTests.BasicCopyTexSubImageCubeCase(
+ 'cube_rgb', '', gl.RGB, gl.UNSIGNED_BYTE, 64
+ )
+ );
+ copyTexSubImageGroup.addChild(
+ new es3fTextureSpecificationTests.BasicCopyTexSubImageCubeCase(
+ 'cube_rgba', '', gl.RGBA, gl.UNSIGNED_BYTE, 64
+ )
+ );
+
+ // Basic TexImage3D usage.
+ var splitBasicTex2DArray = 3, splitBasicTex3D = 5;
+ /** @type {Array<{tcuTestCase.DeqpTest}>} */
+ var basicTexImageGroup2DArray = [];
+ for (var ii = 0; ii < splitBasicTex2DArray; ++ii) {
+ basicTexImageGroup2DArray.push(
+ new tcuTestCase.DeqpTest('basic_teximage3d', 'Basic glTexImage3D() usage')
+ );
+ this.addChild(basicTexImageGroup2DArray[ii]);
+ }
+ /** @type {Array<{tcuTestCase.DeqpTest}>} */
+ var basicTexImageGroup3D = [];
+ for (var ii = 0; ii < splitBasicTex3D; ++ii) {
+ basicTexImageGroup3D.push(
+ new tcuTestCase.DeqpTest('basic_teximage3d', 'Basic glTexImage3D() usage')
+ );
+ this.addChild(basicTexImageGroup3D[ii]);
+ }
+ for (var formatNdx = 0; formatNdx < colorFormats.length; formatNdx++) {
+ fmtName = colorFormats[formatNdx].name;
+ format = colorFormats[formatNdx].internalFormat;
+ /** @type {number} */ var tex2DArrayWidth = 57;
+ /** @type {number} */ var tex2DArrayHeight = 44;
+ /** @type {number} */ var tex2DArrayLevels = 5;
+ /** @type {number} */ var tex3DWidth = 63;
+ /** @type {number} */ var tex3DHeight = 29;
+ /** @type {number} */ var tex3DDepth = 11;
+
+ basicTexImageGroup2DArray[formatNdx % splitBasicTex2DArray].addChild(
+ new es3fTextureSpecificationTests.BasicTexImage2DArrayCase(
+ fmtName + '_2d_array', '', format,
+ tex2DArrayWidth, tex2DArrayHeight, tex2DArrayLevels
+ )
+ );
+ basicTexImageGroup3D[formatNdx % splitBasicTex3D].addChild(
+ new es3fTextureSpecificationTests.BasicTexImage3DCase(
+ fmtName + '_3d', '', format,
+ tex3DWidth, tex3DHeight, tex3DDepth
+ )
+ );
+ }
+
+ // glTexImage3D() unpack params cases.
+ paramGroup = new tcuTestCase.DeqpTest(
+ 'teximage3d_unpack_params', 'glTexImage3D() unpack parameters'
+ );
+ this.addChild(paramGroup);
+
+ cases = [{
+ name: 'rgb8_image_height', format: gl.RGB8, width: 23,
+ height: 19, depth: 8, imageHeight: 26, rowLength: 0,
+ skipImages: 0, skipRows: 0, skipPixels: 0, alignment: 4
+ }, {
+ name: 'rgb8_row_length', format: gl.RGB8, width: 23,
+ height: 19, depth: 8, imageHeight: 0, rowLength: 27,
+ skipImages: 0, skipRows: 0, skipPixels: 0, alignment: 4
+ }, {
+ name: 'rgb8_skip_images', format: gl.RGB8, width: 23,
+ height: 19, depth: 8, imageHeight: 0, rowLength: 0,
+ skipImages: 3, skipRows: 0, skipPixels: 0, alignment: 4
+ }, {
+ name: 'rgb8_skip_rows', format: gl.RGB8, width: 23,
+ height: 19, depth: 8, imageHeight: 22, rowLength: 0,
+ skipImages: 0, skipRows: 3, skipPixels: 0, alignment: 4
+ }, {
+ name: 'rgb8_skip_pixels', format: gl.RGB8, width: 23,
+ height: 19, depth: 8, imageHeight: 0, rowLength: 25,
+ skipImages: 0, skipRows: 0, skipPixels: 2, alignment: 4
+ }, {
+ name: 'r8_complex1', format: gl.R8, width: 13,
+ height: 17, depth: 11, imageHeight: 23, rowLength: 15,
+ skipImages: 2, skipRows: 3, skipPixels: 1, alignment: 1
+ }, {
+ name: 'r8_complex2', format: gl.R8, width: 13,
+ height: 17, depth: 11, imageHeight: 23, rowLength: 15,
+ skipImages: 2, skipRows: 3, skipPixels: 1, alignment: 2
+ }, {
+ name: 'r8_complex3', format: gl.R8, width: 13,
+ height: 17, depth: 11, imageHeight: 23, rowLength: 15,
+ skipImages: 2, skipRows: 3, skipPixels: 1, alignment: 4
+ }, {
+ name: 'r8_complex4', format: gl.R8, width: 13,
+ height: 17, depth: 11, imageHeight: 23, rowLength: 15,
+ skipImages: 2, skipRows: 3, skipPixels: 1, alignment: 8
+ }, {
+ name: 'rgba8_complex1', format: gl.RGBA8, width: 11,
+ height: 20, depth: 8, imageHeight: 25, rowLength: 14,
+ skipImages: 0, skipRows: 0, skipPixels: 0, alignment: 8
+ }, {
+ name: 'rgba8_complex2', format: gl.RGBA8, width: 11,
+ height: 20, depth: 8, imageHeight: 25, rowLength: 14,
+ skipImages: 0, skipRows: 2, skipPixels: 0, alignment: 8
+ }, {
+ name: 'rgba8_complex3', format: gl.RGBA8, width: 11,
+ height: 20, depth: 8, imageHeight: 25, rowLength: 14,
+ skipImages: 0, skipRows: 0, skipPixels: 3, alignment: 8
+ }, {
+ name: 'rgba8_complex4', format: gl.RGBA8, width: 11,
+ height: 20, depth: 8, imageHeight: 25, rowLength: 14,
+ skipImages: 0, skipRows: 2, skipPixels: 3, alignment: 8
+ }, {
+ name: 'rgba32f_complex', format: gl.RGBA32F, width: 11,
+ height: 20, depth: 8, imageHeight: 25, rowLength: 14,
+ skipImages: 0, skipRows: 2, skipPixels: 3, alignment: 8
+ }
+ ];
+
+ for (var ndx = 0; ndx < cases.length; ndx++)
+ paramGroup.addChild(
+ new es3fTextureSpecificationTests.TexImage3DParamsCase(
+ cases[ndx].name, '', cases[ndx].format, cases[ndx].width,
+ cases[ndx].height, cases[ndx].depth, cases[ndx].imageHeight,
+ cases[ndx].rowLength, cases[ndx].skipImages,
+ cases[ndx].skipRows, cases[ndx].skipPixels,
+ cases[ndx].alignment
+ )
+ );
+
+ // glTexImage3D() pbo cases.
+ var splitTex2DArray = 2, splitTex3D = 2;
+ /** @type {Array<{tcuTestCase.DeqpTest}>} */ var pboGroup2DArray = [];
+ for (var ii = 0; ii < splitTex2DArray; ++ii) {
+ pboGroup2DArray.push(
+ new tcuTestCase.DeqpTest('teximage3d_pbo', 'glTexImage3D() from PBO')
+ );
+ this.addChild(pboGroup2DArray[ii]);
+ }
+ /** @type {Array<{tcuTestCase.DeqpTest}>} */ var pboGroup3D = [];
+ for (var ii = 0; ii < splitTex3D; ++ii) {
+ pboGroup3D.push(
+ new tcuTestCase.DeqpTest('teximage3d_pbo', 'glTexImage3D() from PBO')
+ );
+ this.addChild(pboGroup3D[ii]);
+ }
+
+ for (var formatNdx = 0; formatNdx < colorFormats.length; formatNdx++) {
+ fmtName = colorFormats[formatNdx].name;
+ format = colorFormats[formatNdx].internalFormat;
+ tex3DWidth = 11;
+ tex3DHeight = 20;
+ tex3DDepth = 8;
+
+ pboGroup2DArray[formatNdx % splitTex2DArray].addChild(
+ new es3fTextureSpecificationTests.TexImage2DArrayBufferCase(
+ fmtName + '_2d_array', '', format, tex3DWidth, tex3DHeight,
+ tex3DDepth, 0, 0, 0, 0, 0, 4, 0
+ )
+ );
+ pboGroup3D[formatNdx % splitTex3D].addChild(
+ new es3fTextureSpecificationTests.TexImage3DBufferCase(
+ fmtName + '_3d', '', format, tex3DWidth, tex3DHeight,
+ tex3DDepth, 0, 0, 0, 0, 0, 4, 0
+ )
+ );
+ }
+
+ // Parameter cases
+ parameterCases = [{
+ name: 'rgb8_offset', format: gl.RGB8, width: 23,
+ height: 19, depth: 8, imageHeight: 0, rowLength: 0,
+ skipImages: 0, skipRows: 0, skipPixels: 0, alignment: 1,
+ offset: 67
+ }, {
+ name: 'rgb8_alignment', format: gl.RGB8, width: 23,
+ height: 19, depth: 8, imageHeight: 0, rowLength: 0,
+ skipImages: 0, skipRows: 0, skipPixels: 0, alignment: 2,
+ offset: 0
+ }, {
+ name: 'rgb8_image_height', format: gl.RGB8, width: 23,
+ height: 19, depth: 8, imageHeight: 26, rowLength: 0,
+ skipImages: 0, skipRows: 0, skipPixels: 0, alignment: 4,
+ offset: 0
+ }, {
+ name: 'rgb8_row_length', format: gl.RGB8, width: 23,
+ height: 19, depth: 8, imageHeight: 0, rowLength: 27,
+ skipImages: 0, skipRows: 0, skipPixels: 0, alignment: 4,
+ offset: 0
+ }, {
+ name: 'rgb8_skip_images', format: gl.RGB8, width: 23,
+ height: 19, depth: 8, imageHeight: 0, rowLength: 0,
+ skipImages: 3, skipRows: 0, skipPixels: 0, alignment: 4,
+ offset: 0
+ }, {
+ name: 'rgb8_skip_rows', format: gl.RGB8, width: 23,
+ height: 19, depth: 8, imageHeight: 22, rowLength: 0,
+ skipImages: 0, skipRows: 3, skipPixels: 0, alignment: 4,
+ offset: 0
+ }, {
+ name: 'rgb8_skip_pixels', format: gl.RGB8, width: 23,
+ height: 19, depth: 8, imageHeight: 0, rowLength: 25,
+ skipImages: 0, skipRows: 0, skipPixels: 2, alignment: 4,
+ offset: 0
+ }
+ ];
+
+ pboGroupParams = new tcuTestCase.DeqpTest('teximage3d_pbo', 'glTexImage3D() from PBO');
+ this.addChild(pboGroupParams);
+ for (var ndx = 0; ndx < parameterCases.length; ndx++) {
+ pboGroupParams.addChild(
+ new es3fTextureSpecificationTests.TexImage2DArrayBufferCase(
+ parameterCases[ndx].name + '_2d_array', '',
+ parameterCases[ndx].format, parameterCases[ndx].width,
+ parameterCases[ndx].height, parameterCases[ndx].depth,
+ parameterCases[ndx].imageHeight,
+ parameterCases[ndx].rowLength,
+ parameterCases[ndx].skipImages,
+ parameterCases[ndx].skipRows,
+ parameterCases[ndx].skipPixels,
+ parameterCases[ndx].alignment, parameterCases[ndx].offset
+ )
+ );
+ pboGroupParams.addChild(
+ new es3fTextureSpecificationTests.TexImage3DBufferCase(
+ parameterCases[ndx].name + '_3d', '',
+ parameterCases[ndx].format, parameterCases[ndx].width,
+ parameterCases[ndx].height, parameterCases[ndx].depth,
+ parameterCases[ndx].imageHeight,
+ parameterCases[ndx].rowLength,
+ parameterCases[ndx].skipImages,
+ parameterCases[ndx].skipRows,
+ parameterCases[ndx].skipPixels,
+ parameterCases[ndx].alignment, parameterCases[ndx].offset
+ )
+ );
+ }
+
+ // glTexImage3D() depth cases.
+ /** @type {tcuTestCase.DeqpTest} */
+ var shadow3dGroup = new tcuTestCase.DeqpTest(
+ 'teximage3d_depth',
+ 'glTexImage3D() with depth or depth/stencil format'
+ );
+ this.addChild(shadow3dGroup);
+
+ for (var ndx = 0; ndx < depthStencilFormats.length; ndx++) {
+ // WebGL 2 specific constraint.
+ if (depthStencilFormats[ndx].internalFormat == gl.DEPTH32F_STENCIL8)
+ continue;
+ tex3DWidth = 32;
+ tex3DHeight = 64;
+ tex3DDepth = 8;
+
+ shadow3dGroup.addChild(
+ new es3fTextureSpecificationTests.TexImage2DArrayDepthCase(
+ depthStencilFormats[ndx].name + '_2d_array', '',
+ depthStencilFormats[ndx].internalFormat,
+ tex3DWidth, tex3DHeight, tex3DDepth
+ )
+ );
+ }
+
+ // glTexImage3D() depth cases with pbo.
+ shadow3dGroup = new tcuTestCase.DeqpTest(
+ 'teximage3d_depth_pbo',
+ 'glTexImage3D() with depth or depth/stencil format with pbo'
+ );
+ this.addChild(shadow3dGroup);
+
+ for (var ndx = 0; ndx < depthStencilFormats.length; ndx++) {
+ tex3DWidth = 32;
+ tex3DHeight = 64;
+ tex3DDepth = 8;
+
+ shadow3dGroup.addChild(
+ new es3fTextureSpecificationTests.TexImage2DArrayDepthBufferCase(
+ depthStencilFormats[ndx].name + '_2d_array', '',
+ depthStencilFormats[ndx].internalFormat,
+ tex3DWidth, tex3DHeight, tex3DDepth
+ )
+ );
+ }
+
+ // Basic TexSubImage3D usage.
+ splitTex3D = 5;
+ /** @type {Array<{tcuTestCase.DeqpTest}>} */ var basicTexSubImageGroup = [];
+ for (var ii = 0; ii < splitTex3D; ++ii) {
+ basicTexSubImageGroup.push(
+ new tcuTestCase.DeqpTest('basic_texsubimage3d', 'Basic glTexSubImage3D() usage')
+ );
+ this.addChild(basicTexSubImageGroup[ii]);
+ }
+
+ for (var formatNdx = 0; formatNdx < colorFormats.length; formatNdx++) {
+ fmtName = colorFormats[formatNdx].name;
+ format = colorFormats[formatNdx].internalFormat;
+ tex3DWidth = 32;
+ tex3DHeight = 64;
+ tex3DDepth = 8;
+
+ basicTexSubImageGroup[formatNdx % splitTex3D].addChild(
+ new es3fTextureSpecificationTests.BasicTexSubImage3DCase(
+ fmtName + '_3d', '', format,
+ tex3DWidth, tex3DHeight, tex3DDepth
+ )
+ );
+ }
+
+ // glTexSubImage3D() unpack params cases.
+ paramGroup = new tcuTestCase.DeqpTest(
+ 'texsubimage3d_unpack_params', 'glTexSubImage3D() unpack parameters'
+ );
+ this.addChild(paramGroup);
+
+ /** @type {Array<{name: string, format: number, width: number,
+ * height: number, depth: number, subX: number, subY: number,
+ * subZ: number, subW: number, subH: number, subD: number,
+ * imageHeight: number, rowLength: number, skipImages: number,
+ * skipRows: number, skipPixels: number, alignment: number}>}
+ */
+ var casesSubImage3D = [{
+ name: 'rgb8_image_height', format: gl.RGB8, width: 26,
+ height: 25, depth: 10, subX: 1, subY: 2, subZ: 1, subW: 23,
+ subH: 19, subD: 8, imageHeight: 26, rowLength: 0,
+ skipImages: 0, skipRows: 0, skipPixels: 0, alignment: 4
+ }, {
+ name: 'rgb8_row_length', format: gl.RGB8, width: 26,
+ height: 25, depth: 10, subX: 1, subY: 2, subZ: 1, subW: 23,
+ subH: 19, subD: 8, imageHeight: 0, rowLength: 27,
+ skipImages: 0, skipRows: 0, skipPixels: 0, alignment: 4
+ }, {
+ name: 'rgb8_skip_images', format: gl.RGB8, width: 26,
+ height: 25, depth: 10, subX: 1, subY: 2, subZ: 1, subW: 23,
+ subH: 19, subD: 8, imageHeight: 0, rowLength: 0,
+ skipImages: 3, skipRows: 0, skipPixels: 0, alignment: 4
+ }, {
+ name: 'rgb8_skip_rows', format: gl.RGB8, width: 26,
+ height: 25, depth: 10, subX: 1, subY: 2, subZ: 1, subW: 23,
+ subH: 19, subD: 8, imageHeight: 22, rowLength: 0,
+ skipImages: 0, skipRows: 3, skipPixels: 0, alignment: 4
+ }, {
+ name: 'rgb8_skip_pixels', format: gl.RGB8, width: 26,
+ height: 25, depth: 10, subX: 1, subY: 2, subZ: 1, subW: 23,
+ subH: 19, subD: 8, imageHeight: 0, rowLength: 25,
+ skipImages: 0, skipRows: 0, skipPixels: 2, alignment: 4
+ }, {
+ name: 'r8_complex1', format: gl.R8, width: 15,
+ height: 20, depth: 11, subX: 1, subY: 1, subZ: 0, subW: 13,
+ subH: 17, subD: 11, imageHeight: 23, rowLength: 15,
+ skipImages: 2, skipRows: 3, skipPixels: 1, alignment: 1
+ }, {
+ name: 'r8_complex2', format: gl.R8, width: 15,
+ height: 20, depth: 11, subX: 1, subY: 1, subZ: 0, subW: 13,
+ subH: 17, subD: 11, imageHeight: 23, rowLength: 15,
+ skipImages: 2, skipRows: 3, skipPixels: 1, alignment: 2
+ }, {
+ name: 'r8_complex3', format: gl.R8, width: 15,
+ height: 20, depth: 11, subX: 1, subY: 1, subZ: 0, subW: 13,
+ subH: 17, subD: 11, imageHeight: 23, rowLength: 15,
+ skipImages: 2, skipRows: 3, skipPixels: 1, alignment: 4
+ }, {
+ name: 'r8_complex4', format: gl.R8, width: 15,
+ height: 20, depth: 11, subX: 1, subY: 1, subZ: 0, subW: 13,
+ subH: 17, subD: 11, imageHeight: 23, rowLength: 15,
+ skipImages: 2, skipRows: 3, skipPixels: 1, alignment: 8
+ }, {
+ name: 'rgba8_complex1', format: gl.RGBA8, width: 15,
+ height: 25, depth: 10, subX: 0, subY: 5, subZ: 1, subW: 11,
+ subH: 20, subD: 8, imageHeight: 25, rowLength: 14,
+ skipImages: 0, skipRows: 0, skipPixels: 0, alignment: 8
+ }, {
+ name: 'rgba8_complex2', format: gl.RGBA8, width: 15,
+ height: 25, depth: 10, subX: 0, subY: 5, subZ: 1, subW: 11,
+ subH: 20, subD: 8, imageHeight: 25, rowLength: 14,
+ skipImages: 0, skipRows: 2, skipPixels: 0, alignment: 8
+ }, {
+ name: 'rgba8_complex3', format: gl.RGBA8, width: 15,
+ height: 25, depth: 10, subX: 0, subY: 5, subZ: 1, subW: 11,
+ subH: 20, subD: 8, imageHeight: 25, rowLength: 14,
+ skipImages: 0, skipRows: 0, skipPixels: 3, alignment: 8
+ }, {
+ name: 'rgba8_complex4', format: gl.RGBA8, width: 15,
+ height: 25, depth: 10, subX: 0, subY: 5, subZ: 1, subW: 11,
+ subH: 20, subD: 8, imageHeight: 25, rowLength: 14,
+ skipImages: 0, skipRows: 2, skipPixels: 3, alignment: 8
+ }, {
+ name: 'rgba32f_complex', format: gl.RGBA32F, width: 15,
+ height: 25, depth: 10, subX: 0, subY: 5, subZ: 1, subW: 11,
+ subH: 20, subD: 8, imageHeight: 25, rowLength: 14,
+ skipImages: 0, skipRows: 2, skipPixels: 3, alignment: 8
+ }
+ ];
+
+ for (var ndx = 0; ndx < casesSubImage3D.length; ndx++)
+ paramGroup.addChild(
+ new es3fTextureSpecificationTests.TexSubImage3DParamsCase(
+ casesSubImage3D[ndx].name, '', casesSubImage3D[ndx].format,
+ casesSubImage3D[ndx].width, casesSubImage3D[ndx].height, casesSubImage3D[ndx].depth,
+ casesSubImage3D[ndx].subX, casesSubImage3D[ndx].subY, casesSubImage3D[ndx].subZ,
+ casesSubImage3D[ndx].subW, casesSubImage3D[ndx].subH, casesSubImage3D[ndx].subD,
+ casesSubImage3D[ndx].imageHeight, casesSubImage3D[ndx].rowLength,
+ casesSubImage3D[ndx].skipImages, casesSubImage3D[ndx].skipRows,
+ casesSubImage3D[ndx].skipPixels, casesSubImage3D[ndx].alignment
+ )
+ );
+
+ // glTexSubImage3D() PBO cases.
+ splitTex2DArray = 2;
+ pboGroup2DArray = [];
+ for (var ii = 0; ii < splitTex2DArray; ++ii) {
+ pboGroup2DArray.push(
+ new tcuTestCase.DeqpTest('texsubimage3d_pbo', 'glTexSubImage3D() pixel buffer object tests')
+ );
+ this.addChild(pboGroup2DArray[ii]);
+ }
+
+ splitTex3D = 2;
+ pboGroup3D = [];
+ for (var ii = 0; ii < splitTex3D; ++ii) {
+ pboGroup3D.push(
+ new tcuTestCase.DeqpTest('texsubimage3d_pbo', 'glTexSubImage3D() pixel buffer object tests')
+ );
+ this.addChild(pboGroup3D[ii]);
+ }
+
+ for (var ndx = 0; ndx < colorFormats.length; ndx++) {
+ pboGroup2DArray[ndx % splitTex2DArray].addChild(
+ new es3fTextureSpecificationTests.TexSubImage2DArrayBufferCase(
+ colorFormats[ndx].name + '_2d_array', '',
+ colorFormats[ndx].internalFormat,
+ 26, // Width
+ 25, // Height
+ 10, // Depth
+ 1, // Sub X
+ 2, // Sub Y
+ 0, // Sub Z
+ 23, // Sub W
+ 19, // Sub H
+ 8, // Sub D
+ 0, // Image height
+ 0, // Row length
+ 0, // Skip images
+ 0, // Skip rows
+ 0, // Skip pixels
+ 4, // Alignment
+ 0 // offset
+ )
+ );
+ pboGroup3D[ndx % splitTex3D].addChild(
+ new es3fTextureSpecificationTests.TexSubImage3DBufferCase(
+ colorFormats[ndx].name + '_3d', '',
+ colorFormats[ndx].internalFormat,
+ 26, // Width
+ 25, // Height
+ 10, // Depth
+ 1, // Sub X
+ 2, // Sub Y
+ 0, // Sub Z
+ 23, // Sub W
+ 19, // Sub H
+ 8, // Sub D
+ 0, // Image height
+ 0, // Row length
+ 0, // Skip images
+ 0, // Skip rows
+ 0, // Skip pixels
+ 4, // Alignment
+ 0 // offset
+ )
+ );
+ }
+
+ paramCases = [{
+ name: 'rgb8_offset', format: gl.RGB8, width: 26,
+ height: 25, depth: 10, subX: 1, subY: 2, subZ: 1, subW: 23,
+ subH: 19, subD: 8, imageHeight: 0, rowLength: 0, skipImages: 0,
+ skipRows: 0, skipPixels: 0, alignment: 4, offset: 67
+ }, {
+ name: 'rgb8_image_height', format: gl.RGB8, width: 26,
+ height: 25, depth: 10, subX: 1, subY: 2, subZ: 1, subW: 23,
+ subH: 19, subD: 8, imageHeight: 26, rowLength: 0, skipImages: 0,
+ skipRows: 0, skipPixels: 0, alignment: 4, offset: 0
+ }, {
+ name: 'rgb8_row_length', format: gl.RGB8, width: 26,
+ height: 25, depth: 10, subX: 1, subY: 2, subZ: 1, subW: 23,
+ subH: 19, subD: 8, imageHeight: 0, rowLength: 27, skipImages: 0,
+ skipRows: 0, skipPixels: 0, alignment: 4, offset: 0
+ }, {
+ name: 'rgb8_skip_images', format: gl.RGB8, width: 26,
+ height: 25, depth: 10, subX: 1, subY: 2, subZ: 1, subW: 23,
+ subH: 19, subD: 8, imageHeight: 0, rowLength: 0, skipImages: 3,
+ skipRows: 0, skipPixels: 0, alignment: 4, offset: 0
+ }, {
+ name: 'rgb8_skip_rows', format: gl.RGB8, width: 26,
+ height: 25, depth: 10, subX: 1, subY: 2, subZ: 1, subW: 23,
+ subH: 19, subD: 8, imageHeight: 22, rowLength: 0, skipImages: 0,
+ skipRows: 3, skipPixels: 0, alignment: 4, offset: 0
+ }, {
+ name: 'rgb8_skip_pixels', format: gl.RGB8, width: 26,
+ height: 25, depth: 10, subX: 1, subY: 2, subZ: 1, subW: 23,
+ subH: 19, subD: 8, imageHeight: 0, rowLength: 25, skipImages: 0,
+ skipRows: 0, skipPixels: 2, alignment: 4, offset: 0
+ }
+ ];
+
+ pboGroupParams = new tcuTestCase.DeqpTest(
+ 'texsubimage3d_pbo', 'glTexSubImage3D() pixel buffer object tests'
+ );
+ this.addChild(pboGroupParams);
+
+ for (var ndx = 0; ndx < paramCases.length; ndx++) {
+ pboGroupParams.addChild(
+ new es3fTextureSpecificationTests.TexSubImage2DArrayBufferCase(
+ paramCases[ndx].name + '_2d_array', '',
+ paramCases[ndx].format, paramCases[ndx].width,
+ paramCases[ndx].height, paramCases[ndx].depth,
+ paramCases[ndx].subX, paramCases[ndx].subY,
+ paramCases[ndx].subZ, paramCases[ndx].subW,
+ paramCases[ndx].subH, paramCases[ndx].subD,
+ paramCases[ndx].imageHeight, paramCases[ndx].rowLength,
+ paramCases[ndx].skipImages, paramCases[ndx].skipRows,
+ paramCases[ndx].skipPixels, paramCases[ndx].alignment,
+ paramCases[ndx].offset
+ )
+ );
+ pboGroupParams.addChild(
+ new es3fTextureSpecificationTests.TexSubImage3DBufferCase(
+ paramCases[ndx].name + '_3d', '',
+ paramCases[ndx].format, paramCases[ndx].width,
+ paramCases[ndx].height, paramCases[ndx].depth,
+ paramCases[ndx].subX, paramCases[ndx].subY,
+ paramCases[ndx].subZ, paramCases[ndx].subW,
+ paramCases[ndx].subH, paramCases[ndx].subD,
+ paramCases[ndx].imageHeight, paramCases[ndx].rowLength,
+ paramCases[ndx].skipImages, paramCases[ndx].skipRows,
+ paramCases[ndx].skipPixels, paramCases[ndx].alignment,
+ paramCases[ndx].offset
+ )
+ );
+ }
+
+ // glTexSubImage3D() depth cases.
+ shadow3dGroup = new tcuTestCase.DeqpTest(
+ 'texsubimage3d_depth',
+ 'glTexSubImage3D() with depth or depth/stencil format'
+ );
+ this.addChild(shadow3dGroup);
+
+ for (var ndx = 0; ndx < depthStencilFormats.length; ndx++) {
+ // WebGL 2 specific constraint.
+ if (depthStencilFormats[ndx].internalFormat == gl.DEPTH32F_STENCIL8)
+ continue;
+ tex2DArrayWidth = 57;
+ tex2DArrayHeight = 44;
+ tex2DArrayLevels = 5;
+
+ shadow3dGroup.addChild(
+ new es3fTextureSpecificationTests.TexSubImage2DArrayDepthCase(
+ depthStencilFormats[ndx].name + '_2d_array', '',
+ depthStencilFormats[ndx].internalFormat, tex2DArrayWidth,
+ tex2DArrayHeight, tex2DArrayLevels
+ )
+ );
+ }
+
+ // glTexStorage2D() cases.
+
+ // Color formats
+ var splitStorage2D = 3, splitStorageCube = 5;
+ /** @type {Array<{tcuTestCase.DeqpTest}>} */ var colorFormatGroup2D = [];
+ for (var ii = 0; ii < splitStorage2D; ++ii) {
+ colorFormatGroup2D.push(
+ new tcuTestCase.DeqpTest('texstorage2d.format', 'glTexStorage2D() with all formats')
+ );
+ this.addChild(colorFormatGroup2D[ii]);
+ }
+ /** @type {Array<{tcuTestCase.DeqpTest}>} */ var colorFormatGroupCube = [];
+ for (var ii = 0; ii < splitStorageCube; ++ii) {
+ colorFormatGroupCube.push(
+ new tcuTestCase.DeqpTest('texstorage2d.format', 'glTexStorage2D() with all formats')
+ );
+ this.addChild(colorFormatGroupCube[ii]);
+ }
+
+ for (var formatNdx = 0; formatNdx < colorFormats.length; formatNdx++) {
+ fmtName = colorFormats[formatNdx].name;
+ /** @type {number} */ var internalFormat = colorFormats[formatNdx].internalFormat;
+ var tex2DWidth = 117;
+ var tex2DHeight = 97;
+ var tex2DLevels = es3fTextureSpecificationTests.maxLevelCount(tex2DWidth, tex2DHeight);
+ /** @type {number} */ var cubeSize = 57;
+ /** @type {number} */
+ var cubeLevels = es3fTextureSpecificationTests.maxLevelCount(
+ cubeSize, cubeSize
+ );
+
+ colorFormatGroup2D[formatNdx % splitStorage2D].addChild(
+ new es3fTextureSpecificationTests.BasicTexStorage2DCase(
+ fmtName + '_2d', '', internalFormat,
+ tex2DWidth, tex2DHeight, tex2DLevels
+ )
+ );
+ colorFormatGroupCube[formatNdx % splitStorageCube].addChild(
+ new es3fTextureSpecificationTests.BasicTexStorageCubeCase(
+ fmtName + '_cube', '', internalFormat, cubeSize, cubeLevels
+ )
+ );
+ }
+
+ // Depth / stencil formats.
+ /** @type {tcuTestCase.DeqpTest} */
+ var storageGroup = new tcuTestCase.DeqpTest(
+ 'texstorage2d.format',
+ 'glTexStorage2D() with all formats'
+ );
+ this.addChild(storageGroup);
+
+ for (var formatNdx = 0; formatNdx < depthStencilFormats.length; formatNdx++) {
+ fmtName = depthStencilFormats[formatNdx].name;
+ internalFormat = depthStencilFormats[formatNdx].internalFormat;
+ // WebGL 2 specific constraint.
+ if (internalFormat == gl.DEPTH32F_STENCIL8)
+ continue;
+
+ tex2DWidth = 117;
+ tex2DHeight = 97;
+ tex2DLevels = es3fTextureSpecificationTests.maxLevelCount(
+ tex2DWidth, tex2DHeight
+ );
+ cubeSize = 57;
+ cubeLevels = es3fTextureSpecificationTests.maxLevelCount(
+ cubeSize, cubeSize
+ );
+
+ storageGroup.addChild(
+ new es3fTextureSpecificationTests.BasicTexStorage2DCase(
+ fmtName + '_2d', '', internalFormat,
+ tex2DWidth, tex2DHeight, tex2DLevels
+ )
+ );
+ storageGroup.addChild(
+ new es3fTextureSpecificationTests.BasicTexStorageCubeCase(
+ fmtName + '_cube', '', internalFormat, cubeSize, cubeLevels
+ )
+ );
+ }
+
+ // Sizes.
+ storageGroup = new tcuTestCase.DeqpTest(
+ 'texstorage2d.size',
+ 'glTexStorage2D() with various sizes'
+ );
+ this.addChild(storageGroup);
+
+ // W H L
+ /** @type {Array<{width: number, height: number, levels: number}>} */
+ var tex2DSizes = [{
+ width: 1, height: 1, levels: 1
+ }, {
+ width: 2, height: 2, levels: 2
+ }, {
+ width: 64, height: 32, levels: 7
+ }, {
+ width: 32, height: 64, levels: 4
+ }, {
+ width: 57, height: 63, levels: 1
+ }, {
+ width: 57, height: 63, levels: 2
+ }, {
+ width: 57, height: 63, levels: 6
+ }
+ ];
+
+ // S L
+ /** @type {Array<{sizes: number, levels: number}>} */
+ var cubeSizes = [{
+ sizes: 1, levels: 1
+ }, {
+ sizes: 2, levels: 2
+ }, {
+ sizes: 57, levels: 1
+ }, {
+ sizes: 57, levels: 2
+ }, {
+ sizes: 57, levels: 6
+ }, {
+ sizes: 64, levels: 4
+ }, {
+ sizes: 64, levels: 7
+ }
+ ];
+
+ for (var ndx = 0; ndx < tex2DSizes.length; ndx++) {
+ format = gl.RGBA8;
+ /** @type {number} */ var width = tex2DSizes[ndx].width;
+ /** @type {number} */ var height = tex2DSizes[ndx].height;
+ /** @type {number} */ var levels = tex2DSizes[ndx].levels;
+ /** @type {string} */
+ var name = '2d_' + width + 'x' + height + '_' + levels + '_levels';
+
+ storageGroup.addChild(
+ new es3fTextureSpecificationTests.BasicTexStorage2DCase(
+ name, '', format, width, height, levels
+ )
+ );
+ }
+
+ for (var ndx = 0; ndx < cubeSizes.length; ndx++) {
+ format = gl.RGBA8;
+ size = cubeSizes[ndx].sizes;
+ levels = cubeSizes[ndx].levels;
+ name = 'cube_' + size + 'x' + size + '_' + levels + '_levels';
+
+ storageGroup.addChild(
+ new es3fTextureSpecificationTests.BasicTexStorageCubeCase(
+ name, '', format, size, levels
+ )
+ );
+ }
+
+ // glTexStorage3D() cases.
+
+ // Color formats.
+ var splitStorage2DArray = 3, splitStorage3D = 4;
+ /** @type {Array<{tcuTestCase.DeqpTest}>} */ var colorFormatGroup2DArray = [];
+ for (var ii = 0; ii < splitStorage2DArray; ++ii) {
+ colorFormatGroup2DArray.push(
+ new tcuTestCase.DeqpTest('texstorage3d.format', 'glTexStorage3D() with all formats')
+ );
+ this.addChild(colorFormatGroup2DArray[ii]);
+ }
+ /** @type {Array<{tcuTestCase.DeqpTest}>} */ var colorFormatGroup3D = [];
+ for (var ii = 0; ii < splitStorage3D; ++ii) {
+ colorFormatGroup3D.push(
+ new tcuTestCase.DeqpTest('texstorage3d.format', 'glTexStorage3D() with all formats')
+ );
+ this.addChild(colorFormatGroup3D[ii]);
+ }
+
+ // Color formats.
+ for (var formatNdx = 0; formatNdx < colorFormats.length; formatNdx++) {
+ fmtName = colorFormats[formatNdx].name;
+ internalFormat = colorFormats[formatNdx].internalFormat;
+ tex2DArrayWidth = 57;
+ tex2DArrayHeight = 13;
+ var tex2DArrayLayers = 7;
+ tex2DArrayLevels = es3fTextureSpecificationTests.maxLevelCount(
+ tex2DArrayWidth, tex2DArrayHeight
+ );
+ tex3DWidth = 59;
+ tex3DHeight = 37;
+ tex3DDepth = 11;
+ var tex3DLevels = es3fTextureSpecificationTests.maxLevelCount(
+ tex3DWidth, tex3DHeight, tex3DDepth
+ );
+
+ colorFormatGroup2DArray[formatNdx % splitStorage2DArray].addChild(
+ new es3fTextureSpecificationTests.BasicTexStorage2DArrayCase(
+ fmtName + '_2d_array', '', internalFormat, tex2DArrayWidth,
+ tex2DArrayHeight, tex2DArrayLayers, tex2DArrayLevels
+ )
+ );
+ colorFormatGroup3D[formatNdx % splitStorage3D].addChild(
+ new es3fTextureSpecificationTests.BasicTexStorage3DCase(
+ fmtName + '_3d', '', internalFormat, tex3DWidth,
+ tex3DHeight, tex3DDepth, tex3DLevels
+ )
+ );
+ }
+
+ storageGroup = new tcuTestCase.DeqpTest(
+ 'texstorage3d.format',
+ 'glTexStorage3D() with all formats'
+ );
+ this.addChild(storageGroup);
+
+ // Depth/stencil formats (only 2D texture array is supported).
+ for (var formatNdx = 0;
+ formatNdx < depthStencilFormats.length;
+ formatNdx++) {
+ fmtName = depthStencilFormats[formatNdx].name;
+ internalFormat = depthStencilFormats[formatNdx].internalFormat;
+ // WebGL 2 specific constraint.
+ if (internalFormat == gl.DEPTH32F_STENCIL8)
+ continue;
+
+ tex2DArrayWidth = 57;
+ tex2DArrayHeight = 13;
+ tex2DArrayLayers = 7;
+ tex2DArrayLevels = es3fTextureSpecificationTests.maxLevelCount(
+ tex2DArrayWidth, tex2DArrayHeight
+ );
+
+ storageGroup.addChild(
+ new es3fTextureSpecificationTests.BasicTexStorage2DArrayCase(
+ fmtName + '_2d_array', '', internalFormat, tex2DArrayWidth,
+ tex2DArrayHeight, tex2DArrayLayers, tex2DArrayLevels
+ )
+ );
+ }
+
+ // Sizes.
+ // W H La Le
+ /**
+ * @type {Array<{width: number, height: number,
+ * layers: number, levels: number}>}
+ */
+ var tex2DArraySizes = [{
+ width: 1, height: 1, layers: 1, levels: 1
+ }, {
+ width: 2, height: 2, layers: 2, levels: 2
+ }, {
+ width: 64, height: 32, layers: 3, levels: 7
+ }, {
+ width: 32, height: 64, layers: 3, levels: 4
+ }, {
+ width: 57, height: 63, layers: 5, levels: 1
+ }, {
+ width: 57, height: 63, layers: 5, levels: 2
+ }, {
+ width: 57, height: 63, layers: 5, levels: 6
+ }
+ ];
+
+ // W H D L
+ /**
+ * @type {Array<{width: number, height: number,
+ * depth: number, levels: number}>}
+ */
+ var tex3DSizes = [{
+ width: 1, height: 1, depth: 1, levels: 1
+ }, {
+ width: 2, height: 2, depth: 2, levels: 2
+ }, {
+ width: 64, height: 32, depth: 16, levels: 7
+ }, {
+ width: 32, height: 64, depth: 16, levels: 4
+ }, {
+ width: 32, height: 16, depth: 64, levels: 4
+ }, {
+ width: 57, height: 63, depth: 11, levels: 1
+ }, {
+ width: 57, height: 63, depth: 11, levels: 2
+ }, {
+ width: 57, height: 63, depth: 11, levels: 6
+ }
+ ];
+
+ storageGroup = new tcuTestCase.DeqpTest(
+ 'texstorage3d.size', 'glTexStorage3D() with various sizes'
+ );
+ this.addChild(storageGroup);
+
+ for (var ndx = 0; ndx < tex2DArraySizes.length; ndx++) {
+ format = gl.RGBA8;
+ width = tex2DArraySizes[ndx].width;
+ height = tex2DArraySizes[ndx].height;
+ /** @type {number} */ var layers = tex2DArraySizes[ndx].layers;
+ levels = tex2DArraySizes[ndx].levels;
+ name = '2d_array_' + width + 'x' + height + 'x' +
+ layers + '_' + levels + '_levels';
+
+ storageGroup.addChild(
+ new es3fTextureSpecificationTests.BasicTexStorage2DArrayCase(
+ name, '', format, width, height, layers, levels
+ )
+ );
+ }
+
+ for (var ndx = 0; ndx < tex3DSizes.length; ndx++) {
+ format = gl.RGBA8;
+ width = tex3DSizes[ndx].width;
+ height = tex3DSizes[ndx].height;
+ var depth = tex3DSizes[ndx].depth;
+ levels = tex3DSizes[ndx].levels;
+ name = '3d_' + width + 'x' + height + 'x' +
+ depth + '_' + levels + '_levels';
+
+ storageGroup.addChild(
+ new es3fTextureSpecificationTests.BasicTexStorage3DCase(
+ name, '', format, width, height, depth, levels
+ )
+ );
+ }
+ };
+
+ /**
+ * Run test
+ * @param {WebGL2RenderingContext} context
+ * @param {Array<number>=} range Test range
+ */
+ es3fTextureSpecificationTests.run = function(context, range) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fTextureSpecificationTests.TextureSpecificationTests());
+ if (range)
+ state.setRange(range);
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fTextureSpecificationTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureStateQuery.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureStateQuery.js
new file mode 100644
index 0000000000..ab1f4d6bb9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureStateQuery.js
@@ -0,0 +1,376 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fTextureStateQuery');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('functional.gles3.es3fApiCase');
+goog.require('modules.shared.glsStateQuery');
+
+goog.scope(function() {
+var es3fTextureStateQuery = functional.gles3.es3fTextureStateQuery;
+var tcuTestCase = framework.common.tcuTestCase;
+var glsStateQuery = modules.shared.glsStateQuery;
+var es3fApiCase = functional.gles3.es3fApiCase;
+var deRandom = framework.delibs.debase.deRandom;
+
+var setParentClass = function(child, parent) {
+ child.prototype = Object.create(parent.prototype);
+ child.prototype.constructor = child;
+};
+
+/**
+ * @constructor
+ * @extends {es3fApiCase.ApiCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} textureTarget
+ */
+es3fTextureStateQuery.TextureCase = function(name, description, textureTarget) {
+ es3fApiCase.ApiCase.call(this, name, description, gl);
+ /** @type {WebGLTexture} */ this.m_texture;
+ this.m_textureTarget = textureTarget;
+};
+
+setParentClass(es3fTextureStateQuery.TextureCase, es3fApiCase.ApiCase);
+
+es3fTextureStateQuery.TextureCase.prototype.testTexture = function() {
+ throw new Error('Virtual function. Please override.');
+};
+
+es3fTextureStateQuery.TextureCase.prototype.test = function() {
+ this.m_texture = gl.createTexture();
+ gl.bindTexture(this.m_textureTarget, this.m_texture);
+
+ this.testTexture();
+
+ gl.bindTexture(this.m_textureTarget, null);
+ gl.deleteTexture(this.m_texture);
+};
+
+/**
+ * @constructor
+ * @extends {es3fTextureStateQuery.TextureCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} textureTarget
+ */
+es3fTextureStateQuery.IsTextureCase = function(name, description, textureTarget) {
+ es3fTextureStateQuery.TextureCase.call(this, name, description, textureTarget);
+};
+
+setParentClass(es3fTextureStateQuery.IsTextureCase, es3fTextureStateQuery.TextureCase);
+
+es3fTextureStateQuery.IsTextureCase.prototype.testTexture = function() {
+ this.check(glsStateQuery.compare(gl.isTexture(this.m_texture), true), 'gl.isTexture() should have returned true');
+};
+
+/**
+ * @constructor
+ * @extends {es3fTextureStateQuery.TextureCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} textureTarget
+ * @param {number} valueName
+ * @param {number} initialValue
+ * @param {Array<number>} valueRange
+ */
+es3fTextureStateQuery.TextureParamCase = function(name, description, textureTarget, valueName, initialValue, valueRange) {
+ es3fTextureStateQuery.TextureCase.call(this, name, description, textureTarget);
+ this.m_valueName = valueName;
+ this.m_initialValue = initialValue;
+ this.m_valueRange = valueRange;
+};
+
+setParentClass(es3fTextureStateQuery.TextureParamCase, es3fTextureStateQuery.TextureCase);
+
+es3fTextureStateQuery.TextureParamCase.prototype.testTexture = function() {
+ this.check(glsStateQuery.verifyTexture(this.m_textureTarget, this.m_valueName, this.m_initialValue));
+
+ for (var ndx = 0; ndx < this.m_valueRange.length; ++ndx) {
+ gl.texParameteri(this.m_textureTarget, this.m_valueName, this.m_valueRange[ndx]);
+
+ this.check(glsStateQuery.verifyTexture(this.m_textureTarget, this.m_valueName, this.m_valueRange[ndx]));
+ }
+
+ //check unit conversions with float
+
+ for (var ndx = 0; ndx < this.m_valueRange.length; ++ndx) {
+ gl.texParameterf(this.m_textureTarget, this.m_valueName, this.m_valueRange[ndx]);
+
+ this.check(glsStateQuery.verifyTexture(this.m_textureTarget, this.m_valueName, this.m_valueRange[ndx]));
+ }
+};
+
+/**
+ * @constructor
+ * @extends {es3fTextureStateQuery.TextureCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} textureTarget
+ * @param {number} lodTarget
+ * @param {number} initialValue
+ */
+es3fTextureStateQuery.TextureLODCase = function(name, description, textureTarget, lodTarget, initialValue) {
+ es3fTextureStateQuery.TextureCase.call(this, name, description, textureTarget);
+ this.m_lodTarget = lodTarget;
+ this.m_initialValue = initialValue;
+};
+
+setParentClass(es3fTextureStateQuery.TextureLODCase, es3fTextureStateQuery.TextureCase);
+
+es3fTextureStateQuery.TextureLODCase.prototype.testTexture = function() {
+ var rnd = new deRandom.Random(0xabcdef);
+
+ this.check(glsStateQuery.verifyTexture(this.m_textureTarget, this.m_lodTarget, this.m_initialValue));
+
+ var numIterations = 60;
+ for (var ndx = 0; ndx < numIterations; ++ndx) {
+ var ref = rnd.getFloat(-64000, 64000);
+
+ gl.texParameterf(this.m_textureTarget, this.m_lodTarget, ref);
+
+ this.check(glsStateQuery.verifyTexture(this.m_textureTarget, this.m_lodTarget, ref));
+ }
+
+ // check unit conversions with int
+
+ for (var ndx = 0; ndx < numIterations; ++ndx) {
+ var ref = rnd.getInt(-64000, 64000);
+
+ gl.texParameteri(this.m_textureTarget, this.m_lodTarget, ref);
+
+ this.check(glsStateQuery.verifyTexture(this.m_textureTarget, this.m_lodTarget, ref));
+ }
+};
+
+/**
+ * @constructor
+ * @extends {es3fTextureStateQuery.TextureCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} textureTarget
+ * @param {number} levelTarget
+ * @param {number} initialValue
+ */
+es3fTextureStateQuery.TextureLevelCase = function(name, description, textureTarget, levelTarget, initialValue) {
+ es3fTextureStateQuery.TextureCase.call(this, name, description, textureTarget);
+ this.m_levelTarget = levelTarget;
+ this.m_initialValue = initialValue;
+};
+
+setParentClass(es3fTextureStateQuery.TextureLevelCase, es3fTextureStateQuery.TextureCase);
+
+es3fTextureStateQuery.TextureLevelCase.prototype.testTexture = function() {
+ var rnd = new deRandom.Random(0xabcdef);
+
+ this.check(glsStateQuery.verifyTexture(this.m_textureTarget, this.m_levelTarget, this.m_initialValue));
+
+ var numIterations = 60;
+ for (var ndx = 0; ndx < numIterations; ++ndx) {
+ var ref = rnd.getInt(0, 64000);
+
+ gl.texParameteri(this.m_textureTarget, this.m_levelTarget, ref);
+
+ this.check(glsStateQuery.verifyTexture(this.m_textureTarget, this.m_levelTarget, ref));
+ }
+
+ // check unit conversions with float
+ var nonSignificantOffsets = [-0.45, -0.25, 0, 0.45]; // offsets O so that for any integers z in Z, o in O roundToClosestInt(z+o)==z
+
+ for (var ndx = 0; ndx < numIterations; ++ndx) {
+ var ref = rnd.getInt(0, 64000);
+
+ for (var i = 0; i < nonSignificantOffsets.length; i++) {
+ gl.texParameterf(this.m_textureTarget, this.m_levelTarget, ref + nonSignificantOffsets[i]);
+ this.check(glsStateQuery.verifyTexture(this.m_textureTarget, this.m_levelTarget, ref));
+ }
+ }
+};
+
+/**
+ * @constructor
+ * @extends {es3fTextureStateQuery.TextureCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} textureTarget
+ */
+es3fTextureStateQuery.TextureImmutableLevelsCase = function(name, description, textureTarget) {
+ es3fTextureStateQuery.TextureCase.call(this, name, description, textureTarget);
+};
+
+setParentClass(es3fTextureStateQuery.TextureImmutableLevelsCase, es3fTextureStateQuery.TextureCase);
+
+es3fTextureStateQuery.TextureImmutableLevelsCase.prototype.testTexture = function() {
+ this.check(glsStateQuery.verifyTexture(this.m_textureTarget, gl.TEXTURE_IMMUTABLE_LEVELS, 0));
+ for (var level = 1; level <= 8; ++level) {
+ var textureID = gl.createTexture();
+ gl.bindTexture(this.m_textureTarget, textureID);
+
+ if (this.m_textureTarget == gl.TEXTURE_2D_ARRAY || this.m_textureTarget == gl.TEXTURE_3D)
+ gl.texStorage3D(this.m_textureTarget, level, gl.RGB8, 256, 256, 256);
+ else
+ gl.texStorage2D(this.m_textureTarget, level, gl.RGB8, 256, 256);
+
+ this.check(glsStateQuery.verifyTexture(this.m_textureTarget, gl.TEXTURE_IMMUTABLE_LEVELS, level));
+ gl.deleteTexture(textureID);
+ }
+};
+
+/**
+ * @constructor
+ * @extends {es3fTextureStateQuery.TextureCase}
+ * @param {string} name
+ * @param {string} description
+ * @param {number} textureTarget
+ */
+es3fTextureStateQuery.TextureImmutableFormatCase = function(name, description, textureTarget) {
+ es3fTextureStateQuery.TextureCase.call(this, name, description, textureTarget);
+};
+
+setParentClass(es3fTextureStateQuery.TextureImmutableFormatCase, es3fTextureStateQuery.TextureCase);
+
+es3fTextureStateQuery.TextureImmutableFormatCase.prototype.testTexture = function() {
+ this.check(glsStateQuery.verifyTexture(this.m_textureTarget, gl.TEXTURE_IMMUTABLE_LEVELS, 0));
+ var testSingleFormat = function(format) {
+ var textureID = gl.createTexture();
+ gl.bindTexture(this.m_textureTarget, textureID);
+
+ if (this.m_textureTarget == gl.TEXTURE_2D_ARRAY || this.m_textureTarget == gl.TEXTURE_3D)
+ gl.texStorage3D(this.m_textureTarget, 1, format, 32, 32, 32);
+ else
+ gl.texStorage2D(this.m_textureTarget, 1, format, 32, 32);
+
+ this.check(glsStateQuery.verifyTexture(this.m_textureTarget, gl.TEXTURE_IMMUTABLE_FORMAT, 1));
+ gl.deleteTexture(textureID);
+ };
+
+ var formats = [
+ gl.RGBA32I, gl.RGBA32UI, gl.RGBA16I, gl.RGBA16UI, gl.RGBA8, gl.RGBA8I,
+ gl.RGBA8UI, gl.SRGB8_ALPHA8, gl.RGB10_A2, gl.RGB10_A2UI, gl.RGBA4,
+ gl.RGB5_A1, gl.RGB8, gl.RGB565, gl.RG32I, gl.RG32UI, gl.RG16I, gl.RG16UI,
+ gl.RG8, gl.RG8I, gl.RG8UI, gl.R32I, gl.R32UI, gl.R16I, gl.R16UI, gl.R8,
+ gl.R8I, gl.R8UI,
+
+ gl.RGBA32F, gl.RGBA16F, gl.RGBA8_SNORM, gl.RGB32F,
+ gl.RGB32I, gl.RGB32UI, gl.RGB16F, gl.RGB16I, gl.RGB16UI, gl.RGB8_SNORM,
+ gl.RGB8I, gl.RGB8UI, gl.SRGB8, gl.R11F_G11F_B10F, gl.RGB9_E5, gl.RG32F,
+ gl.RG16F, gl.RG8_SNORM, gl.R32F, gl.R16F, gl.R8_SNORM
+ ];
+
+ var non3dFormats = [
+ gl.DEPTH_COMPONENT32F, gl.DEPTH_COMPONENT24, gl.DEPTH_COMPONENT16,
+ gl.DEPTH32F_STENCIL8, gl.DEPTH24_STENCIL8
+ ];
+
+ for (var formatNdx = 0; formatNdx < formats.length; ++formatNdx)
+ testSingleFormat.bind(this, formats[formatNdx]);
+
+ if (this.m_textureTarget != gl.TEXTURE_3D)
+ for (var formatNdx = 0; formatNdx < non3dFormats.length; ++formatNdx)
+ testSingleFormat.bind(this, non3dFormats[formatNdx]);
+};
+
+/**
+* @constructor
+* @extends {tcuTestCase.DeqpTest}
+*/
+es3fTextureStateQuery.TextureStateQuery = function() {
+ tcuTestCase.DeqpTest.call(this, 'texture', 'Texture State Query tests');
+};
+
+es3fTextureStateQuery.TextureStateQuery.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+es3fTextureStateQuery.TextureStateQuery.prototype.constructor = es3fTextureStateQuery.TextureStateQuery;
+
+es3fTextureStateQuery.TextureStateQuery.prototype.init = function() {
+ var textureTargets = [
+ ['texture_2d', gl.TEXTURE_2D],
+ ['texture_3d', gl.TEXTURE_3D],
+ ['texture_2d_array', gl.TEXTURE_2D_ARRAY],
+ ['texture_cube_map', gl.TEXTURE_CUBE_MAP]
+ ];
+
+ var state = this;
+ var wrapValues = [gl.CLAMP_TO_EDGE, gl.REPEAT, gl.MIRRORED_REPEAT];
+ var magValues = [gl.NEAREST, gl.LINEAR];
+ var minValues = [gl.NEAREST, gl.LINEAR, gl.NEAREST_MIPMAP_NEAREST, gl.NEAREST_MIPMAP_LINEAR, gl.LINEAR_MIPMAP_NEAREST, gl.LINEAR_MIPMAP_LINEAR];
+ var modes = [gl.COMPARE_REF_TO_TEXTURE, gl.NONE];
+ var compareFuncs = [gl.LEQUAL, gl.GEQUAL, gl.LESS, gl.GREATER, gl.EQUAL, gl.NOTEQUAL, gl.ALWAYS, gl.NEVER];
+ textureTargets.forEach(function(elem) {
+ var name = elem[0];
+ var target = elem[1];
+ state.addChild(new es3fTextureStateQuery.IsTextureCase(name + '_is_texture', 'IsTexture', target));
+ state.addChild(new es3fTextureStateQuery.TextureParamCase(name + '_texture_wrap_s' , 'TEXTURE_WRAP_S',
+ target, gl.TEXTURE_WRAP_S, gl.REPEAT, wrapValues));
+ if (target == gl.TEXTURE_2D ||
+ target == gl.TEXTURE_3D ||
+ target == gl.TEXTURE_CUBE_MAP)
+ state.addChild(new es3fTextureStateQuery.TextureParamCase(name + '_texture_wrap_t' , 'TEXTURE_WRAP_T',
+ target, gl.TEXTURE_WRAP_T, gl.REPEAT, wrapValues));
+
+ if (target == gl.TEXTURE_3D)
+ state.addChild(new es3fTextureStateQuery.TextureParamCase(name + '_texture_wrap_r' , 'TEXTURE_WRAP_R',
+ target, gl.TEXTURE_WRAP_R, gl.REPEAT, wrapValues));
+
+ state.addChild(new es3fTextureStateQuery.TextureParamCase(name + '_texture_mag_filter' , 'TEXTURE_MAG_FILTER',
+ target, gl.TEXTURE_MAG_FILTER, gl.LINEAR, magValues));
+ state.addChild(new es3fTextureStateQuery.TextureParamCase(name + '_texture_min_filter' , 'TEXTURE_MIN_FILTER',
+ target, gl.TEXTURE_MIN_FILTER, gl.NEAREST_MIPMAP_LINEAR, minValues));
+ state.addChild(new es3fTextureStateQuery.TextureLODCase(name + '_texture_min_lod' , 'TEXTURE_MIN_LOD', target, gl.TEXTURE_MIN_LOD, -1000));
+ state.addChild(new es3fTextureStateQuery.TextureLODCase(name + '_texture_max_lod' , 'TEXTURE_MAX_LOD', target, gl.TEXTURE_MAX_LOD, 1000));
+ state.addChild(new es3fTextureStateQuery.TextureLevelCase(name + '_texture_base_level' , 'TEXTURE_BASE_LEVEL', target, gl.TEXTURE_BASE_LEVEL, 0));
+ state.addChild(new es3fTextureStateQuery.TextureLevelCase(name + '_texture_max_level' , 'TEXTURE_MAX_LEVEL', target, gl.TEXTURE_MAX_LEVEL, 1000));
+
+ state.addChild(new es3fTextureStateQuery.TextureParamCase(name + '_texture_compare_mode' , 'TEXTURE_COMPARE_MODE',
+ target, gl.TEXTURE_COMPARE_MODE, gl.NONE, modes));
+ state.addChild(new es3fTextureStateQuery.TextureParamCase(name + '_texture_compare_func' , 'TEXTURE_COMPARE_FUNC',
+ target, gl.TEXTURE_COMPARE_FUNC, gl.LEQUAL, compareFuncs));
+
+ state.addChild(new es3fTextureStateQuery.TextureImmutableLevelsCase(name + '_texture_immutable_levels', 'TEXTURE_IMMUTABLE_LEVELS', target));
+ state.addChild(new es3fTextureStateQuery.TextureImmutableFormatCase(name + '_texture_immutable_format', 'TEXTURE_IMMUTABLE_FORMAT', target));
+ });
+};
+
+/**
+* Run test
+* @param {WebGL2RenderingContext} context
+*/
+es3fTextureStateQuery.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fTextureStateQuery.TextureStateQuery());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fTextureStateQuery.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureWrapTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureWrapTests.js
new file mode 100644
index 0000000000..a6d6e96d14
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTextureWrapTests.js
@@ -0,0 +1,434 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fTextureWrapTests');
+goog.require('framework.common.tcuCompressedTexture');
+goog.require('framework.common.tcuPixelFormat');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.common.tcuTexLookupVerifier');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluTexture');
+goog.require('framework.opengl.gluTextureUtil');
+goog.require('modules.shared.glsTextureTestUtil');
+
+goog.scope(function() {
+ /** @type {?WebGL2RenderingContext} */ var gl;
+
+ var es3fTextureWrapTests = functional.gles3.es3fTextureWrapTests;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var gluTexture = framework.opengl.gluTexture;
+ var gluTextureUtil = framework.opengl.gluTextureUtil;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var glsTextureTestUtil = modules.shared.glsTextureTestUtil;
+ var tcuCompressedTexture = framework.common.tcuCompressedTexture;
+ var deRandom = framework.delibs.debase.deRandom;
+ var deMath = framework.delibs.debase.deMath;
+ var tcuPixelFormat = framework.common.tcuPixelFormat;
+ var tcuSurface = framework.common.tcuSurface;
+ var tcuTexLookupVerifier = framework.common.tcuTexLookupVerifier;
+ var tcuTexture = framework.common.tcuTexture;
+ var tcuTextureUtil = framework.common.tcuTextureUtil;
+ var deString = framework.delibs.debase.deString;
+
+ /**
+ * @enum {number}
+ */
+ var Viewport = {
+ WIDTH: 256,
+ HEIGHT: 256
+ };
+
+ /**
+ * @constructor
+ * @param {Array<number>=} bl
+ * @param {Array<number>=} tr
+ */
+ es3fTextureWrapTests.Case = function(bl, tr) {
+ /** @type {?Array<number>} */ this.bottomLeft = bl || null;
+ /** @type {?Array<number>} */ this.topRight = tr || null;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} description
+ * @param {?tcuCompressedTexture.Format} compressedFormat
+ * @param {number} wrapS
+ * @param {number} wrapT
+ * @param {number} minFilter
+ * @param {number} magFilter
+ * @param {number} width
+ * @param {number} height
+ */
+ es3fTextureWrapTests.TextureWrapCase = function(name, description, compressedFormat, wrapS, wrapT, minFilter, magFilter, width, height) {
+ tcuTestCase.DeqpTest.call(this, name, description);
+ /** @type {number} */ this.m_format = gl.NONE;
+ /** @type {number} */ this.m_dataType = gl.NONE;
+ /** @type {?tcuCompressedTexture.Format} */ this.m_compressedFormat = compressedFormat;
+ /** @type {number} */ this.m_wrapS = wrapS;
+ /** @type {number} */ this.m_wrapT = wrapT;
+ /** @type {number} */ this.m_minFilter = minFilter;
+ /** @type {number} */ this.m_magFilter = magFilter;
+ /** @type {number} */ this.m_width = width;
+ /** @type {number} */ this.m_height = height;
+ /** @type {Array<es3fTextureWrapTests.Case>} */ this.m_cases = [];
+ /** @type {number} */ this.m_caseNdx = 0;
+ /** @type {gluTexture.Texture2D} */ this.m_texture = null;
+ /** @type {glsTextureTestUtil.TextureRenderer} */
+ this.m_renderer = new glsTextureTestUtil.TextureRenderer(gluShaderUtil.getGLSLVersionString(gluShaderUtil.GLSLVersion.V300_ES), gluShaderUtil.precision.PRECISION_MEDIUMP);
+ };
+
+ es3fTextureWrapTests.TextureWrapCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+
+ /** Copy the constructor */
+ es3fTextureWrapTests.TextureWrapCase.prototype.constructor = es3fTextureWrapTests.TextureWrapCase;
+
+ /**
+ * @param {string} name
+ * @param {string} description
+ * @param {number} format
+ * @param {number} dataType
+ * @param {number} wrapS
+ * @param {number} wrapT
+ * @param {number} minFilter
+ * @param {number} magFilter
+ * @param {number} width
+ * @param {number} height
+ * @return {es3fTextureWrapTests.TextureWrapCase}
+ */
+ es3fTextureWrapTests.textureWrapCaseFromFormat = function(name, description, format, dataType, wrapS, wrapT, minFilter, magFilter, width, height) {
+ var texWrapCase = new es3fTextureWrapTests.TextureWrapCase(name, description, null, wrapS, wrapT, minFilter, magFilter, width, height);
+ texWrapCase.m_format = gl.RGBA;
+ texWrapCase.m_dataType = gl.UNSIGNED_BYTE;
+ return texWrapCase;
+ };
+
+ /**
+ */
+ es3fTextureWrapTests.TextureWrapCase.prototype.init = function() {
+ if (this.m_compressedFormat !== null) {
+ // Generate compressed texture.
+
+ assertMsgOptions(this.m_format == gl.NONE && this.m_dataType == gl.NONE, 'init/compressedFormat', false, true);
+ if (tcuCompressedTexture.isEtcFormat(this.m_compressedFormat)) {
+ // Create ETC texture. Any content is valid.
+
+ /** @type {tcuCompressedTexture.CompressedTexture}*/
+ var compressedTexture = new tcuCompressedTexture.CompressedTexture(this.m_compressedFormat, this.m_width, this.m_height);
+ /** @type {number} */ var dataSize = compressedTexture.getDataSize();
+ /** @type {goog.NumberArray} */ var data = compressedTexture.getData();
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name));
+
+ for (var i = 0; i < dataSize; i++)
+ data[i] = rnd.getFloat() & 0xff;
+
+ this.m_texture = gluTexture.texture2DFromCompressedTexture(gl, 1, [compressedTexture]);
+ } else
+ throw new Error('Only ETC2 and EAC are supported.');
+ } else{
+ this.m_texture = gluTexture.texture2DFromFormat(gl, this.m_format, this.m_dataType, this.m_width, this.m_height);
+
+ // Fill level 0.
+ this.m_texture.getRefTexture().allocLevel(0);
+ tcuTextureUtil.fillWithComponentGradients(this.m_texture.getRefTexture().getLevel(0), [-0.5, -0.5, -0.5, 2.0], [1.0, 1.0, 1.0, 0.0]);
+
+ this.m_texture.upload();
+ }
+
+ // Sub-cases.
+
+ this.m_cases.push(new es3fTextureWrapTests.Case([-1.5, -3.0], [1.5, 2.5]));
+ this.m_cases.push(new es3fTextureWrapTests.Case([-0.5, 0.75], [0.25, 1.25]));
+ assertMsgOptions(this.m_caseNdx == 0, 'm_caseNdx != 0', false, true);
+ };
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fTextureWrapTests.TextureWrapCase.prototype.iterate = function() {
+ /** @type {glsTextureTestUtil.RandomViewport} */ var viewport = new glsTextureTestUtil.RandomViewport(gl.canvas, Viewport.WIDTH, Viewport.HEIGHT, deString.deStringHash(this.name) + this.m_caseNdx);
+ /** @type {tcuSurface.Surface} */ var renderedFrame = new tcuSurface.Surface(viewport.width, viewport.height);
+ /** @type {tcuSurface.Surface} */ var referenceFrame = new tcuSurface.Surface(viewport.width, viewport.height);
+ /** @type {glsTextureTestUtil.ReferenceParams} */ var refParams = new glsTextureTestUtil.ReferenceParams(glsTextureTestUtil.textureType.TEXTURETYPE_2D);
+ /** @type {tcuTexture.TextureFormat} */ var texFormat = this.m_texture.getRefTexture().getFormat();
+ /** @type {Array<number>} */ var texCoord;
+ /** @type {tcuTextureUtil.TextureFormatInfo} */ var texFormatInfo = tcuTextureUtil.getTextureFormatInfo(texFormat);
+ /** @type {boolean} */ var useDefaultColorScaleAndBias = true;
+
+ // Bind to unit 0.
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(gl.TEXTURE_2D, this.m_texture.getGLTexture());
+
+ // Setup filtering and wrap modes.
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, this.m_wrapS);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, this.m_wrapT);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, this.m_minFilter);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, this.m_magFilter);
+
+ // Parameters for reference images.
+ refParams.sampler = gluTextureUtil.mapGLSamplerWrapST(this.m_wrapS, this.m_wrapT, this.m_minFilter, this.m_magFilter);
+ refParams.lodMode = glsTextureTestUtil.lodMode.EXACT;
+ refParams.samplerType = glsTextureTestUtil.getSamplerType(this.m_texture.getRefTexture().getFormat());
+ refParams.colorScale = useDefaultColorScaleAndBias ? texFormatInfo.lookupScale : [1.0, 1.0, 1.0, 1.0];
+ refParams.colorBias = useDefaultColorScaleAndBias ? texFormatInfo.lookupBias : [0, 0, 0, 0];
+
+ gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height);
+ texCoord = glsTextureTestUtil.computeQuadTexCoord2D(this.m_cases[this.m_caseNdx].bottomLeft, this.m_cases[this.m_caseNdx].topRight);
+ this.m_renderer.renderQuad(0, texCoord, refParams);
+
+ // gluPixelTransfer.readPixels(viewport.x, viewport.y, renderedFrame.getAccess());
+ /** @type {number} */ var pixelSize = renderedFrame.getAccess().getFormat().getPixelSize();
+ /** @type {number} */ var param = deMath.deIsPowerOfTwo32(pixelSize) ? Math.min(pixelSize, 8) : 1;
+
+ gl.pixelStorei(gl.PACK_ALIGNMENT, param);
+ /** @type {gluTextureUtil.TransferFormat} */ var format = gluTextureUtil.getTransferFormat(renderedFrame.getAccess().getFormat());
+
+ renderedFrame.readViewport(gl, viewport);
+
+ // const tcu::ScopedLogSection section (log, string("Test") + de::toString(m_caseNdx), string("Test ") + de::toString(m_caseNdx));
+ /** @type {boolean} */ var isNearestOnly = this.m_minFilter == gl.NEAREST && this.m_magFilter == gl.NEAREST;
+ /** @type {boolean} */ var isSRGB = texFormat.order == tcuTexture.ChannelOrder.sRGB || texFormat.order == tcuTexture.ChannelOrder.sRGBA;
+ /** @type {tcuPixelFormat.PixelFormat} */ var pixelFormat = new tcuPixelFormat.PixelFormat(8, 8, 8, 8);
+ /** @type {Array<number>} */ var colorBits = deMath.max(deMath.subtract(glsTextureTestUtil.getBitsVec(pixelFormat), (isNearestOnly && !isSRGB ? [1, 1, 1, 1] : [2, 2, 2, 2])), [0, 0, 0, 0]);
+ /** @type {tcuTexLookupVerifier.LodPrecision} */ var lodPrecision = new tcuTexLookupVerifier.LodPrecision(18, 5);
+ /** @type {tcuTexLookupVerifier.LookupPrecision} */
+ var lookupPrecision = new tcuTexLookupVerifier.LookupPrecision(
+ [20, 20, 0],
+ [5, 5, 0],
+ deMath.divide(tcuTexLookupVerifier.computeFixedPointThreshold(colorBits), refParams.colorScale),
+ glsTextureTestUtil.getCompareMask(pixelFormat)
+ );
+
+ // log << TestLog::Message << "Note: lookup coordinates: bottom-left " << m_cases[m_caseNdx].bottomLeft << ", top-right " << m_cases[m_caseNdx].topRight << TestLog::EndMessage;
+
+ /** @type {boolean} */ var isOk = glsTextureTestUtil.verifyTexture2DResult(renderedFrame.getAccess(), this.m_texture.getRefTexture(), texCoord, refParams, lookupPrecision, lodPrecision, pixelFormat);
+
+ if (!isOk)
+ testFailedOptions('Case ' + this.m_caseNdx + ': verifyTexture2DResult is false', false);
+ else
+ testPassedOptions('Case ' + this.m_caseNdx + ': OK', true);
+
+ this.m_caseNdx++;
+
+ return this.m_caseNdx < this.m_cases.length ? tcuTestCase.IterateResult.CONTINUE : tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * Initialize test
+ */
+ es3fTextureWrapTests.init = function() {
+ var testGroup = tcuTestCase.runner.testCases;
+ /** @type {string} */ var name;
+ /**
+ * @constructor
+ * @struct
+ * @param {string} name
+ * @param {number} mode
+ */
+ var WrapMode = function(name, mode) {
+ /** @type {string} */ this.name = name;
+ /** @type {number} */ this.mode = mode;
+ };
+
+ /** @type {Array<WrapMode>} */ var wrapModes = [
+ new WrapMode('clamp', gl.CLAMP_TO_EDGE),
+ new WrapMode('repeat', gl.REPEAT),
+ new WrapMode('mirror', gl.MIRRORED_REPEAT)
+ ];
+
+ /**
+ * @constructor
+ * @struct
+ * @param {string} name
+ * @param {number} mode
+ */
+ var FilteringMode = function(name, mode) {
+ /** @type {string} */ this.name = name;
+ /** @type {number} */ this.mode = mode;
+ };
+
+ /** @type {Array<FilteringMode>} */ var filteringModes = [
+ new FilteringMode('nearest', gl.NEAREST),
+ new FilteringMode('linear', gl.LINEAR)
+ ];
+
+ /* Begin RGBA8 Cases */
+ /**
+ * @constructor
+ * @struct
+ * @param {string} name
+ * @param {number} width
+ * @param {number} height
+ */
+ var Rgba8Size = function(name, width, height) {
+ /** @type {string} */ this.name = name;
+ /** @type {number} */ this.width = width;
+ /** @type {number} */ this.height = height;
+ };
+
+ /** @type {Array<Rgba8Size>} */ var rgba8Sizes = [
+ new Rgba8Size('pot', 64, 128),
+ new Rgba8Size('npot', 63, 112)
+ ];
+
+ for (var size = 0; size < rgba8Sizes.length; size++) {
+ /** @type {tcuTestCase.DeqpTest} */ var rgba8Group = tcuTestCase.newTest('rgba8', '');
+ testGroup.addChild(rgba8Group);
+ for (var wrapS = 0; wrapS < wrapModes.length; wrapS++) {
+ for (var wrapT = 0; wrapT < wrapModes.length; wrapT++) {
+ for (var filter = 0; filter < filteringModes.length; filter++) {
+ name = [
+ wrapModes[wrapS].name,
+ wrapModes[wrapT].name,
+ filteringModes[filter].name,
+ rgba8Sizes[size].name
+ ].join('_');
+
+ rgba8Group.addChild(es3fTextureWrapTests.textureWrapCaseFromFormat(
+ name, '',
+ gl.RGBA, gl.UNSIGNED_BYTE,
+ wrapModes[wrapS].mode,
+ wrapModes[wrapT].mode,
+ filteringModes[filter].mode, filteringModes[filter].mode,
+ rgba8Sizes[size].width, rgba8Sizes[size].height
+ ));
+ }
+ }
+ }
+ }
+ /* End RGBA8 Cases */
+
+ /* Begin ETC-2 (and EAC) cases */
+ /**
+ * @constructor
+ * @struct
+ * @param {string} name
+ * @param {tcuCompressedTexture.Format} format
+ */
+ var Etc2Format = function(name, format) {
+ /** @type {string} */ this.name = name;
+ /** @type {tcuCompressedTexture.Format} */ this.format = format;
+ };
+
+ var etc2Formats = [
+ new Etc2Format('eac_r11', tcuCompressedTexture.Format.EAC_R11),
+ new Etc2Format('eac_signed_r11', tcuCompressedTexture.Format.EAC_SIGNED_R11),
+ new Etc2Format('eac_rg11', tcuCompressedTexture.Format.EAC_RG11),
+ new Etc2Format('eac_signed_rg11', tcuCompressedTexture.Format.EAC_SIGNED_RG11),
+ new Etc2Format('etc2_rgb8', tcuCompressedTexture.Format.ETC2_RGB8),
+ new Etc2Format('etc2_srgb8', tcuCompressedTexture.Format.ETC2_SRGB8),
+ new Etc2Format('etc2_rgb8_punchthrough_alpha1', tcuCompressedTexture.Format.ETC2_RGB8_PUNCHTHROUGH_ALPHA1),
+ new Etc2Format('etc2_srgb8_punchthrough_alpha1', tcuCompressedTexture.Format.ETC2_SRGB8_PUNCHTHROUGH_ALPHA1),
+ new Etc2Format('etc2_eac_rgba8', tcuCompressedTexture.Format.ETC2_EAC_RGBA8),
+ new Etc2Format('etc2_eac_srgb8_alpha8', tcuCompressedTexture.Format.ETC2_EAC_SRGB8_ALPHA8)
+ ];
+ if (!gluTextureUtil.enableCompressedTextureETC()) {
+ debug('Skipping ETC2/EAC texture format tests: no support for WEBGL_compressed_texture_etc');
+ etc2Formats = [];
+ }
+
+ /**
+ * @constructor
+ * @struct
+ * @param {string} name
+ * @param {number} width
+ * @param {number} height
+ */
+ var Etc2Size = function(name, width, height) {
+ /** @type {string} */ this.name = name;
+ /** @type {number} */ this.width = width;
+ /** @type {number} */ this.height = height;
+ };
+
+ /** @type {Array<Etc2Size>} */ var etc2Sizes = [
+ new Etc2Size('pot', 64, 128),
+ new Etc2Size('npot', 123, 107)
+ ];
+
+ for (var formatNdx = 0; formatNdx < etc2Formats.length; formatNdx++) {
+ for (var size = 0; size < etc2Sizes.length; size++) {
+ /** @type {tcuTestCase.DeqpTest} */ var formatGroup = tcuTestCase.newTest(etc2Formats[formatNdx].name, '');
+ testGroup.addChild(formatGroup);
+ for (var wrapS = 0; wrapS < wrapModes.length; wrapS++) {
+ for (var wrapT = 0; wrapT < wrapModes.length; wrapT++) {
+ for (var filter = 0; filter < filteringModes.length; filter++) {
+ name = [
+ wrapModes[wrapS].name,
+ wrapModes[wrapT].name,
+ filteringModes[filter].name,
+ etc2Sizes[size].name
+ ].join('_');
+
+ formatGroup.addChild(new es3fTextureWrapTests.TextureWrapCase(
+ name, '',
+ etc2Formats[formatNdx].format,
+ wrapModes[wrapS].mode,
+ wrapModes[wrapT].mode,
+ filteringModes[filter].mode, filteringModes[filter].mode,
+ etc2Sizes[size].width, etc2Sizes[size].height
+ ));
+ }
+ }
+ }
+ }
+ }
+ };
+
+ /**
+ * Run test
+ * @param {WebGL2RenderingContext} context
+ */
+ es3fTextureWrapTests.run = function(context, range) {
+ gl = context;
+ //Set up Test Root parameters
+ var testName = 'texture_wrap';
+ var testDescription = 'Texture Wrap Tests';
+ var state = tcuTestCase.runner;
+
+ state.testName = testName;
+ state.setRoot(tcuTestCase.newTest(testName, testDescription, null));
+
+ //Set up name and description of this test series.
+ setCurrentTestName(testName);
+ description(testDescription);
+
+ try {
+ //Create test cases
+ es3fTextureWrapTests.init();
+ if (range)
+ state.setRange(range);
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fTextureWrapTests.run tests', false);
+ state.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTransformFeedbackTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTransformFeedbackTests.js
new file mode 100644
index 0000000000..5beae6985d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fTransformFeedbackTests.js
@@ -0,0 +1,1914 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fTransformFeedbackTests');
+goog.require('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.opengl.gluDrawUtil');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluVarType');
+goog.require('framework.opengl.gluVarTypeUtil');
+
+goog.scope(function() {
+
+ var es3fTransformFeedbackTests = functional.gles3.es3fTransformFeedbackTests;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var gluDrawUtil = framework.opengl.gluDrawUtil;
+ var gluVarType = framework.opengl.gluVarType;
+ var gluVarTypeUtil = framework.opengl.gluVarTypeUtil;
+ var gluShaderProgram = framework.opengl.gluShaderProgram;
+ var deRandom = framework.delibs.debase.deRandom;
+ var deMath = framework.delibs.debase.deMath;
+ var deString = framework.delibs.debase.deString;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var tcuSurface = framework.common.tcuSurface;
+ var tcuImageCompare = framework.common.tcuImageCompare;
+
+ /** @type {WebGL2RenderingContext} */ var gl;
+
+ var setParentClass = function(child, parent) {
+ child.prototype = Object.create(parent.prototype);
+ child.prototype.constructor = child;
+ };
+
+ /**
+ * @enum
+ */
+ es3fTransformFeedbackTests.State = {
+ DRAW: 0,
+ VERIFY: 1,
+ FINISH: 2
+ };
+
+ /* Maximum time to wait for query result (in seconds) */
+ /** @const */ es3fTransformFeedbackTests.MAX_VERIFY_WAIT = 5;
+
+ /** @const @type {number} */ es3fTransformFeedbackTests.VIEWPORT_WIDTH = 128;
+ /** @const @type {number} */ es3fTransformFeedbackTests.VIEWPORT_HEIGHT = 128;
+ /** @const @type {number} */ es3fTransformFeedbackTests.BUFFER_GUARD_MULTIPLIER = 2;
+
+ /**
+ * Enums for es3fTransformFeedbackTests.interpolation
+ * @enum {number}
+ */
+ es3fTransformFeedbackTests.interpolation = {
+ SMOOTH: 0,
+ FLAT: 1,
+ CENTROID: 2
+
+ };
+
+ /**
+ * Returns es3fTransformFeedbackTests.interpolation name: smooth, flat or centroid
+ * @param {number} interpol es3fTransformFeedbackTests.interpolation enum value
+ * @return {string}
+ */
+ es3fTransformFeedbackTests.getInterpolationName = function(interpol) {
+
+ switch (interpol) {
+ case es3fTransformFeedbackTests.interpolation.SMOOTH: return 'smooth';
+ case es3fTransformFeedbackTests.interpolation.FLAT: return 'flat';
+ case es3fTransformFeedbackTests.interpolation.CENTROID: return 'centroid';
+ default:
+ throw new Error('Unrecognized es3fTransformFeedbackTests.interpolation name ' + interpol);
+ }
+
+ };
+
+ /**
+ * @struct
+ * @param {string} name
+ * @param {gluVarType.VarType} type
+ * @param {number} interpolation
+ * @constructor
+ */
+ es3fTransformFeedbackTests.Varying = function(name, type, interpolation) {
+ this.name = name;
+ this.type = type;
+ this.interpolation = interpolation;
+ };
+
+ /** es3fTransformFeedbackTests.findAttributeNameEquals
+ * Replaces original implementation of "VaryingNameEquals" and "AttributeNameEquals" in the C++ version
+ * Returns an es3fTransformFeedbackTests.Attribute or es3fTransformFeedbackTests.Varying object which matches its name with the passed string value in the function
+ * @param {(Array<es3fTransformFeedbackTests.Attribute> | Array<es3fTransformFeedbackTests.Varying>)} array
+ * @param {string} name
+ * @return { (es3fTransformFeedbackTests.Attribute | es3fTransformFeedbackTests.Varying | null)}
+ */
+ es3fTransformFeedbackTests.findAttributeNameEquals = function(array, name) {
+ for (var pos = 0; pos < array.length; pos++) {
+ if (array[pos].name === name) {
+ return array[pos];
+ }
+ }
+ return null;
+ };
+
+ /**
+ * @struct
+ * @param {string} name
+ * @param {gluVarType.VarType} type
+ * @param {number} offset
+ * @constructor
+ */
+ es3fTransformFeedbackTests.Attribute = function(name, type, offset) {
+ this.name = name;
+ this.type = type;
+ this.offset = offset;
+ };
+
+ /**
+ * Constructs an es3fTransformFeedbackTests.Output object
+ * @constructor
+ */
+ es3fTransformFeedbackTests.Output = function() {
+ /** @type {number} */ this.bufferNdx = 0;
+ /** @type {number} */ this.offset = 0;
+ /** @type {string} */ this.name;
+ /** @type {gluVarType.VarType} */ this.type = null;
+ /** @type {Array<es3fTransformFeedbackTests.Attribute>} */ this.inputs = [];
+ };
+
+ /**
+ * Constructs an object type es3fTransformFeedbackTests.DrawCall.
+ * Contains the number of elements as well as whether the Transform Feedback is enabled or not.
+ * @struct
+ * @param {number} numElements
+ * @param {boolean} tfEnabled is Transform Feedback enabled or not
+ * @constructor
+ */
+ es3fTransformFeedbackTests.DrawCall = function(numElements, tfEnabled) {
+ this.numElements = numElements;
+ this.transformFeedbackEnabled = tfEnabled;
+ };
+
+ /**
+ * @constructor
+ */
+ es3fTransformFeedbackTests.ProgramSpec = function() {
+
+ /** @type {Array<gluVarType.StructType>} */ var m_structs = [];
+ /** @type {Array<es3fTransformFeedbackTests.Varying>} */ var m_varyings = [];
+ /** @type {Array<string>} */ var m_transformFeedbackVaryings = [];
+
+ this.createStruct = function(name) {
+ var struct = gluVarType.newStructType(name);
+ m_structs.push(struct);
+ return struct;
+ };
+
+ this.addVarying = function(name, type, interp) {
+ m_varyings.push(new es3fTransformFeedbackTests.Varying(name, type, interp));
+ };
+
+ this.addTransformFeedbackVarying = function(name) {
+ m_transformFeedbackVaryings.push(name);
+ };
+
+ this.getStructs = function() {
+ return m_structs;
+ };
+ this.getVaryings = function() {
+ return m_varyings;
+ };
+ this.getTransformFeedbackVaryings = function() {
+ return m_transformFeedbackVaryings;
+ };
+
+ this.isPointSizeUsed = function() {
+ for (var i = 0; i < m_transformFeedbackVaryings.length; ++i) {
+ if (m_transformFeedbackVaryings[i] == 'gl_PointSize') return true;
+ }
+ return false;
+ };
+
+ };
+
+ /** Returns if the program is supported or not
+ * @param {es3fTransformFeedbackTests.ProgramSpec} spec
+ * @param {number} tfMode
+ * @return {boolean}
+ */
+ es3fTransformFeedbackTests.isProgramSupported = function(spec, tfMode) {
+ var maxVertexAttribs = Number(gl.getParameter(gl.MAX_VERTEX_ATTRIBS));
+ var maxTfInterleavedComponents = Number(gl.getParameter(gl.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS));
+ var maxTfSeparateAttribs = Number(gl.getParameter(gl.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS));
+ var maxTfSeparateComponents = Number(gl.getParameter(gl.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS));
+
+ // Check vertex attribs.
+ /** @type {number} */ var totalVertexAttribs = (
+ 1 /* a_position */ + (spec.isPointSizeUsed() ? 1 : 0)
+ );
+
+ for (var i = 0; i < spec.getVaryings().length; ++i) {
+ for (var v_iter = new gluVarTypeUtil.VectorTypeIterator(spec.getVaryings()[i].type); !v_iter.end(); v_iter.next()) {
+ totalVertexAttribs += 1;
+ }
+ }
+
+ if (totalVertexAttribs > maxVertexAttribs)
+ return false; // Vertex attribute es3fTransformFeedbackTests.count exceeded.
+
+ // check varyings
+ /** @type {number} */ var totalTfComponents = 0;
+ /** @type {number} */ var totalTfAttribs = 0;
+ /** @type {Object.<number, number>} */ var presetNumComponents = {
+ gl_Position: 4,
+ gl_PointSize: 1
+ };
+ for (var i = 0; i < spec.getTransformFeedbackVaryings().length; ++i) {
+ var name = spec.getTransformFeedbackVaryings()[i];
+ var numComponents = 0;
+
+ if (typeof(presetNumComponents[name]) != 'undefined') {
+ numComponents = presetNumComponents[name];
+ } else {
+ var varName = gluVarTypeUtil.parseVariableName(name);
+ // find the varying called varName
+ /** @type {es3fTransformFeedbackTests.Varying} */ var varying = (function(varyings) {
+ for (var i = 0; i < varyings.length; ++i) {
+ if (varyings[i].name == varName) {
+ return varyings[i];
+ }
+ }
+ return null;
+ }(spec.getVaryings()));
+
+ // glu::TypeComponentVector
+ var varPath = gluVarTypeUtil.parseTypePath(name, varying.type);
+ numComponents = gluVarTypeUtil.getVarType(varying.type, varPath).getScalarSize();
+ }
+
+ if (tfMode == gl.SEPARATE_ATTRIBS && numComponents > maxTfSeparateComponents)
+ return false; // Per-attribute component es3fTransformFeedbackTests.count exceeded.
+
+ totalTfComponents += numComponents;
+ totalTfAttribs += 1;
+ }
+
+ if (tfMode == gl.SEPARATE_ATTRIBS && totalTfAttribs > maxTfSeparateAttribs)
+ return false;
+
+ if (tfMode == gl.INTERLEAVED_ATTRIBS && totalTfComponents > maxTfInterleavedComponents)
+ return false;
+
+ return true;
+
+ };
+
+ /**
+ * @param {string} varyingName
+ * @param {Array<gluVarTypeUtil.VarTypeComponent>} path
+ * @return {string}
+ */
+ es3fTransformFeedbackTests.getAttributeName = function(varyingName, path) {
+ /** @type {string} */ var str = 'a_' + varyingName.substr(/^v_/.test(varyingName) ? 2 : 0);
+
+ for (var i = 0; i < path.length; ++i) {
+ /** @type {string} */ var prefix;
+
+ switch (path[i].type) {
+ case gluVarTypeUtil.VarTypeComponent.s_Type.STRUCT_MEMBER: prefix = '_m'; break;
+ case gluVarTypeUtil.VarTypeComponent.s_Type.ARRAY_ELEMENT: prefix = '_e'; break;
+ case gluVarTypeUtil.VarTypeComponent.s_Type.MATRIX_COLUMN: prefix = '_c'; break;
+ case gluVarTypeUtil.VarTypeComponent.s_Type.VECTOR_COMPONENT: prefix = '_s'; break;
+ default:
+ throw new Error('invalid type in the component path.');
+ }
+ str += prefix + path[i].index;
+ }
+ return str;
+ };
+
+ /**
+ * original definition:
+ * static void es3fTransformFeedbackTests.genShaderSources (const es3fTransformFeedbackTests.ProgramSpec& spec, std::string& vertSource, std::string& fragSource, bool pointSizeRequired)
+ * in place of the std::string references, this function returns those params in an object
+ *
+ * @param {es3fTransformFeedbackTests.ProgramSpec} spec
+ * @param {boolean} pointSizeRequired
+ * @return {Object.<string, string>}
+ */
+ es3fTransformFeedbackTests.genShaderSources = function(spec, pointSizeRequired) {
+
+ var vtx = { str: null };
+ var frag = { str: null };
+ var addPointSize = spec.isPointSizeUsed();
+
+ vtx.str = '#version 300 es\n' +
+ 'in highp vec4 a_position;\n';
+ frag.str = '#version 300 es\n' +
+ 'layout(location = 0) out mediump vec4 o_color;\n' +
+ 'uniform highp vec4 u_scale;\n' +
+ 'uniform highp vec4 u_bias;\n';
+ //vtx.str = 'attribute highp vec4 a_position;\n';
+ //frag.str = 'uniform highp vec4 u_scale;\n' +
+ // 'uniform highp vec4 u_bias;\n';
+
+ if (addPointSize) {
+ vtx.str += 'in highp float a_pointSize;\n';
+ //vtx.str += 'attribute highp float a_pointSize;\n';
+ }
+
+ // Declare attributes.
+ for (var i = 0; i < spec.getVaryings().length; ++i) {
+
+ /** @type {string} */ var name = spec.getVaryings()[i].name;
+ /** @type {gluVarType.VarType} */ var type = spec.getVaryings()[i].type;
+
+ for (var vecIter = new gluVarTypeUtil.VectorTypeIterator(type); !vecIter.end(); vecIter.next()) {
+
+ /** @type {gluVarType.VarType} */
+ var attribType = gluVarTypeUtil.getVarType(type, vecIter.getPath());
+
+ /** @type {string} */
+ var attribName = es3fTransformFeedbackTests.getAttributeName(name, vecIter.getPath());
+ vtx.str += 'in ' + gluVarType.declareVariable(attribType, attribName) + ';\n';
+
+ }
+ }
+
+ // Declare varyings.
+ for (var ndx = 0; ndx < 2; ++ndx) {
+ var inout = ndx ? 'in' : 'out';
+ var shader = ndx ? frag : vtx;
+
+ for (var i = 0; i < spec.getStructs().length; ++i) {
+ var struct = spec.getStructs()[i];
+ if (struct.hasTypeName()) {
+ shader.str += gluVarType.declareStructType(struct) + ';\n';
+ }
+ }
+
+ /** @type {Array<es3fTransformFeedbackTests.Varying>} */ var varyings = spec.getVaryings();
+ for (var i = 0; i < varyings.length; ++i) {
+ var varying = varyings[i];
+ shader.str += es3fTransformFeedbackTests.getInterpolationName(varying.interpolation) +
+ ' ' + inout + ' ' +
+ gluVarType.declareVariable(varying.type, varying.name) +
+ ';\n';
+ }
+ }
+
+ vtx.str += '\nvoid main (void)\n {\n' +
+ '\tgl_Position = a_position;\n';
+ frag.str += '\nvoid main (void)\n {\n' +
+ '\thighp vec4 res = vec4(0.0);\n';
+
+ if (addPointSize) {
+ vtx.str += '\tgl_PointSize = a_pointSize;\n';
+ } else if (pointSizeRequired) {
+ vtx.str += '\tgl_PointSize = 1.0;\n';
+ }
+
+ for (var i = 0; i < spec.getVaryings().length; ++i) {
+ var name = spec.getVaryings()[i].name;
+ var type = spec.getVaryings()[i].type;
+
+ for (var vecIter = new gluVarTypeUtil.VectorTypeIterator(type); !vecIter.end(); vecIter.next()) {
+ /** @type {gluVarType.VarType} */var subType = gluVarTypeUtil.getVarType(type, vecIter.getPath());
+ var attribName = es3fTransformFeedbackTests.getAttributeName(name, vecIter.getPath());
+
+ if (!(
+ subType.isBasicType() &&
+ gluShaderUtil.isDataTypeScalarOrVector(subType.getBasicType())
+ )) throw new Error('Not a scalar or vector.');
+
+ // Vertex: assign from attribute.
+ vtx.str += '\t' + name + vecIter.toString() + ' = ' + attribName + ';\n';
+
+ // Fragment: add to res variable.
+ var scalarSize = gluShaderUtil.getDataTypeScalarSize(subType.getBasicType());
+
+ frag.str += '\tres += ';
+ if (scalarSize == 1) frag.str += 'vec4(' + name + vecIter.toString() + ')';
+ else if (scalarSize == 2) frag.str += 'vec2(' + name + vecIter.toString() + ').xxyy';
+ else if (scalarSize == 3) frag.str += 'vec3(' + name + vecIter.toString() + ').xyzx';
+ else if (scalarSize == 4) frag.str += 'vec4(' + name + vecIter.toString() + ')';
+
+ frag.str += ';\n';
+ }
+ }
+
+ frag.str += '\to_color = res * u_scale + u_bias;\n}\n';
+ //frag.str += '\tgl_FragColor = res * u_scale + u_bias;\n}\n';
+ vtx.str += '}\n';
+
+ return {
+ vertSource: vtx.str,
+ fragSource: frag.str
+ };
+ };
+
+ /**
+ * Returns a Shader program
+ * @param {es3fTransformFeedbackTests.ProgramSpec} spec
+ * @param {number} bufferMode
+ * @param {gluDrawUtil.primitiveType} primitiveType GLenum that specifies what kind of primitive is
+ * @return {gluShaderProgram.ShaderProgram}
+ */
+ es3fTransformFeedbackTests.createVertexCaptureProgram = function(spec, bufferMode, primitiveType) {
+
+ /** @type {Object.<string, string>} */ var source = es3fTransformFeedbackTests.genShaderSources(spec, primitiveType === gluDrawUtil.primitiveType.POINTS /* Is point size required? */);
+
+ var programSources = new gluShaderProgram.ProgramSources();
+ programSources.add(new gluShaderProgram.VertexSource(source.vertSource))
+ .add(new gluShaderProgram.FragmentSource(source.fragSource))
+ .add(new gluShaderProgram.TransformFeedbackVaryings(spec.getTransformFeedbackVaryings()))
+ .add(new gluShaderProgram.TransformFeedbackMode(bufferMode));
+
+ return new gluShaderProgram.ShaderProgram(gl, programSources);
+
+ };
+
+ /**
+ * @param {Array<es3fTransformFeedbackTests.Attribute>} attributes
+ * @param {Array<es3fTransformFeedbackTests.Varying>} varyings
+ * @param {boolean} usePointSize
+ * @return {number} input stride
+ */
+ es3fTransformFeedbackTests.computeInputLayout = function(attributes, varyings, usePointSize) {
+
+ var inputStride = 0;
+
+ // Add position
+ var dataTypeVec4 = gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT_VEC4, gluShaderUtil.precision.PRECISION_HIGHP);
+ attributes.push(new es3fTransformFeedbackTests.Attribute('a_position', dataTypeVec4, inputStride));
+ inputStride += 4 * 4; /*sizeof(deUint32)*/
+
+ if (usePointSize) {
+ var dataTypeFloat = gluVarType.newTypeBasic(gluShaderUtil.DataType.FLOAT, gluShaderUtil.precision.PRECISION_HIGHP);
+ attributes.push(new es3fTransformFeedbackTests.Attribute('a_pointSize', dataTypeFloat, inputStride));
+ inputStride += 1 * 4; /*sizeof(deUint32)*/
+ }
+
+ for (var i = 0; i < varyings.length; i++) {
+ for (var vecIter = new gluVarTypeUtil.VectorTypeIterator(varyings[i].type); !vecIter.end(); vecIter.next()) {
+ var type = vecIter.getType(); // originally getType() in getVarType() within gluVARTypeUtil.hpp.
+ var name = es3fTransformFeedbackTests.getAttributeName(varyings[i].name, vecIter.getPath());
+
+ attributes.push(new es3fTransformFeedbackTests.Attribute(name, type, inputStride));
+ inputStride += gluShaderUtil.getDataTypeScalarSize(type.getBasicType()) * 4; /*sizeof(deUint32)*/
+ }
+ }
+
+ return inputStride;
+ };
+
+ /**
+ * @param {Array<es3fTransformFeedbackTests.Output>} transformFeedbackOutputs
+ * @param {Array<es3fTransformFeedbackTests.Attribute>} attributes
+ * @param {Array<es3fTransformFeedbackTests.Varying>} varyings
+ * @param {Array<string>} transformFeedbackVaryings
+ * @param {number} bufferMode
+ */
+ es3fTransformFeedbackTests.computeTransformFeedbackOutputs = function(transformFeedbackOutputs, attributes, varyings, transformFeedbackVaryings, bufferMode) {
+
+ /** @type {number} */ var accumulatedSize = 0;
+
+ // transformFeedbackOutputs.resize(transformFeedbackVaryings.size());
+ for (var varNdx = 0; varNdx < transformFeedbackVaryings.length; varNdx++) {
+ /** @type {string} */ var name = transformFeedbackVaryings[varNdx];
+ /** @type {number} */ var bufNdx = (bufferMode === gl.SEPARATE_ATTRIBS ? varNdx : 0);
+ /** @type {number} */ var offset = (bufferMode === gl.SEPARATE_ATTRIBS ? 0 : accumulatedSize);
+ /** @type {es3fTransformFeedbackTests.Output} */ var output = new es3fTransformFeedbackTests.Output();
+
+ output.name = name;
+ output.bufferNdx = bufNdx;
+ output.offset = offset;
+
+ if (name === 'gl_Position') {
+ var posIn = es3fTransformFeedbackTests.findAttributeNameEquals(attributes, 'a_position');
+ output.type = posIn.type;
+ output.inputs.push(posIn);
+ } else if (name === 'gl_PointSize') {
+ var sizeIn = es3fTransformFeedbackTests.findAttributeNameEquals(attributes, 'a_pointSize');
+ output.type = sizeIn.type;
+ output.inputs.push(sizeIn);
+ } else {
+ var varName = gluVarTypeUtil.parseVariableName(name);
+ var varying = es3fTransformFeedbackTests.findAttributeNameEquals(varyings, varName);
+
+ var varPath = gluVarTypeUtil.parseTypePath(name, varying.type);
+ output.type = gluVarTypeUtil.getVarType(varying.type, varPath);
+
+ // Add all vectorized attributes as inputs.
+ for (var iter = new gluVarTypeUtil.VectorTypeIterator(output.type); !iter.end(); iter.next()) {
+ var fullpath = varPath.concat(iter.getPath());
+ var attribName = es3fTransformFeedbackTests.getAttributeName(varName, fullpath);
+ var attrib = es3fTransformFeedbackTests.findAttributeNameEquals(attributes, attribName);
+ output.inputs.push(attrib);
+ }
+ }
+ transformFeedbackOutputs.push(output);
+ accumulatedSize += output.type.getScalarSize() * 4; /*sizeof(deUint32)*/
+ }
+ };
+
+ /**
+ * @param {es3fTransformFeedbackTests.Attribute} attrib
+ * @param {ArrayBuffer} buffer
+ * @param {number} stride
+ * @param {number} numElements
+ * @param {deRandom.Random} rnd
+ */
+ es3fTransformFeedbackTests.genAttributeData = function(attrib, buffer, stride, numElements, rnd) {
+
+ /** @type {number} */ var elementSize = 4; /*sizeof(deUint32)*/
+ /** @type {boolean} */ var isFloat = gluShaderUtil.isDataTypeFloatOrVec(attrib.type.getBasicType());
+ /** @type {boolean} */ var isInt = gluShaderUtil.isDataTypeIntOrIVec(attrib.type.getBasicType());
+ /** @type {boolean} */ var isUint = gluShaderUtil.isDataTypeUintOrUVec(attrib.type.getBasicType());
+
+ /** @type {gluShaderUtil.precision} */ var precision = attrib.type.getPrecision();
+
+ /** @type {number} */ var numComps = gluShaderUtil.getDataTypeScalarSize(attrib.type.getBasicType());
+
+ for (var elemNdx = 0; elemNdx < numElements; elemNdx++) {
+ for (var compNdx = 0; compNdx < numComps; compNdx++) {
+ /** @type {number} */ var offset = attrib.offset + elemNdx * stride + compNdx * elementSize;
+ if (isFloat) {
+ var pos = new Float32Array(buffer, offset, 1);
+ switch (precision) {
+ case gluShaderUtil.precision.PRECISION_LOWP: pos[0] = 0.25 * rnd.getInt(0, 4); break;
+ case gluShaderUtil.precision.PRECISION_MEDIUMP: pos[0] = rnd.getFloat(-1e3, 1e3); break;
+ case gluShaderUtil.precision.PRECISION_HIGHP: pos[0] = rnd.getFloat(-1e5, 1e5); break;
+ default: throw new Error('Unknown precision: ' + precision);
+ }
+ } else if (isInt) {
+ var pos = new Int32Array(buffer, offset, 1);
+ switch (precision) {
+ case gluShaderUtil.precision.PRECISION_LOWP: pos[0] = rnd.getInt(-128, 127); break;
+ case gluShaderUtil.precision.PRECISION_MEDIUMP: pos[0] = rnd.getInt(-32768, 32767); break;
+ case gluShaderUtil.precision.PRECISION_HIGHP: pos[0] = rnd.getInt(); break;
+ default: throw new Error('Unknown precision: ' + precision);
+ }
+ } else if (isUint) {
+ var pos = new Uint32Array(buffer, offset, 1);
+ switch (precision) {
+ case gluShaderUtil.precision.PRECISION_LOWP: pos[0] = rnd.getInt(0, 255); break;
+ case gluShaderUtil.precision.PRECISION_MEDIUMP: pos[0] = rnd.getInt(0, 65535); break;
+ case gluShaderUtil.precision.PRECISION_HIGHP: pos[0] = Math.abs(rnd.getInt()); break;
+ default: throw new Error('Unknown precision: ' + precision);
+ }
+ }
+ }
+ }
+ };
+
+ /**
+ * @param {Array<es3fTransformFeedbackTests.Attribute>} attributes
+ * @param {number} numInputs
+ * @param {number} inputStride
+ * @param {deRandom.Random} rnd
+ * @return {ArrayBuffer}
+ */
+ es3fTransformFeedbackTests.genInputData = function(attributes, numInputs, inputStride, rnd) {
+ var buffer = new ArrayBuffer(numInputs * inputStride);
+
+ var position = es3fTransformFeedbackTests.findAttributeNameEquals(attributes, 'a_position');
+ if (!position)
+ throw new Error('Position attribute not found.');
+
+ for (var ndx = 0; ndx < numInputs; ndx++) {
+ var pos = new Float32Array(buffer, position.offset + inputStride * ndx, 4);
+ pos[0] = rnd.getFloat(-1.2, 1.2);
+ pos[1] = rnd.getFloat(-1.2, 1.2);
+ pos[2] = rnd.getFloat(-1.2, 1.2);
+ pos[3] = rnd.getFloat(0.1, 2.0);
+ }
+
+ var pointSizePos = es3fTransformFeedbackTests.findAttributeNameEquals(attributes, 'a_pointSize');
+ if (pointSizePos) {
+ for (var ndx = 0; ndx < numInputs; ndx++) {
+ var pos = new Float32Array(buffer, pointSizePos.offset + inputStride * ndx, 1);
+ pos[0] = rnd.getFloat(1, 8);
+ }
+ }
+
+ // Random data for rest of components.
+ for (var i = 0; i < attributes.length; i++) {
+ if (attributes[i].name != 'a_position' && attributes[i].name != 'a_pointSize')
+ es3fTransformFeedbackTests.genAttributeData(attributes[i], buffer, inputStride, numInputs, rnd);
+ }
+
+ return buffer;
+ };
+
+ /**
+ * Returns the number of outputs with the es3fTransformFeedbackTests.count for the Primitives in the Transform Feedback.
+ * @param {gluDrawUtil.primitiveType} primitiveType GLenum that specifies what kind of primitive is
+ * @param {number} numElements
+ * @return {number}
+ */
+ es3fTransformFeedbackTests.getTransformFeedbackOutputCount = function(primitiveType, numElements) {
+
+ switch (primitiveType) {
+ case gluDrawUtil.primitiveType.TRIANGLES: return numElements - numElements % 3;
+ case gluDrawUtil.primitiveType.TRIANGLE_STRIP: return Math.max(0, numElements - 2) * 3;
+ case gluDrawUtil.primitiveType.TRIANGLE_FAN: return Math.max(0, numElements - 2) * 3;
+ case gluDrawUtil.primitiveType.LINES: return numElements - numElements % 2;
+ case gluDrawUtil.primitiveType.LINE_STRIP: return Math.max(0, numElements - 1) * 2;
+ case gluDrawUtil.primitiveType.LINE_LOOP: return numElements > 1 ? numElements * 2 : 0;
+ case gluDrawUtil.primitiveType.POINTS: return numElements;
+ default:
+ throw new Error('Unrecognized primitiveType ' + primitiveType);
+ }
+
+ };
+
+ /**
+ * Returns a number with the es3fTransformFeedbackTests.count for the Primitives in the Transform Feedback.
+ * @param {gluDrawUtil.primitiveType} primitiveType GLenum that specifies what kind of primitive is
+ * @param {number} numElements
+ * @return {number}
+ */
+ es3fTransformFeedbackTests.getTransformFeedbackPrimitiveCount = function(primitiveType, numElements) {
+
+ switch (primitiveType) {
+ case gluDrawUtil.primitiveType.TRIANGLES: return Math.floor(numElements / 3);
+ case gluDrawUtil.primitiveType.TRIANGLE_STRIP: return Math.max(0, numElements - 2);
+ case gluDrawUtil.primitiveType.TRIANGLE_FAN: return Math.max(0, numElements - 2);
+ case gluDrawUtil.primitiveType.LINES: return Math.floor(numElements / 2);
+ case gluDrawUtil.primitiveType.LINE_STRIP: return Math.max(0, numElements - 1);
+ case gluDrawUtil.primitiveType.LINE_LOOP: return numElements > 1 ? numElements : 0;
+ case gluDrawUtil.primitiveType.POINTS: return numElements;
+ default:
+ throw new Error('Unrecognized primitiveType ' + primitiveType);
+ }
+
+ };
+
+ /**
+ * Returns the type of Primitive Mode: Triangles for all Triangle Primitive's type and same for Line and Points.
+ * @param {gluDrawUtil.primitiveType} primitiveType GLenum that specifies what kind of primitive is
+ * @return {number} primitiveType
+ */
+ es3fTransformFeedbackTests.getTransformFeedbackPrimitiveMode = function(primitiveType) {
+
+ switch (primitiveType) {
+ case gluDrawUtil.primitiveType.TRIANGLES:
+ case gluDrawUtil.primitiveType.TRIANGLE_STRIP:
+ case gluDrawUtil.primitiveType.TRIANGLE_FAN:
+ return gl.TRIANGLES;
+
+ case gluDrawUtil.primitiveType.LINES:
+ case gluDrawUtil.primitiveType.LINE_STRIP:
+ case gluDrawUtil.primitiveType.LINE_LOOP:
+ return gl.LINES;
+
+ case gluDrawUtil.primitiveType.POINTS:
+ return gl.POINTS;
+
+ default:
+ throw new Error('Unrecognized primitiveType ' + primitiveType);
+ }
+
+ };
+
+ /**
+ * Returns the attribute index for a certain primitive type.
+ * @param {gluDrawUtil.primitiveType} primitiveType GLenum that specifies what kind of primitive is
+ * @param {number} numInputs
+ * @param {number} outNdx
+ * @return {number}
+ */
+ es3fTransformFeedbackTests.getAttributeIndex = function(primitiveType, numInputs, outNdx) {
+
+ switch (primitiveType) {
+
+ case gluDrawUtil.primitiveType.TRIANGLES: return outNdx;
+ case gluDrawUtil.primitiveType.LINES: return outNdx;
+ case gluDrawUtil.primitiveType.POINTS: return outNdx;
+
+ case gluDrawUtil.primitiveType.TRIANGLE_STRIP: {
+ /** @type {number} */ var triNdx = outNdx / 3;
+ /** @type {number} */ var vtxNdx = outNdx % 3;
+ return (triNdx % 2 != 0 && vtxNdx < 2) ? (triNdx + 1 - vtxNdx) : (triNdx + vtxNdx);
+ }
+
+ case gluDrawUtil.primitiveType.TRIANGLE_FAN:
+ return (outNdx % 3 != 0) ? (outNdx / 3 + outNdx % 3) : 0;
+
+ case gluDrawUtil.primitiveType.LINE_STRIP:
+ return outNdx / 2 + outNdx % 2;
+
+ case gluDrawUtil.primitiveType.LINE_LOOP: {
+ var inNdx = outNdx / 2 + outNdx % 2;
+ return inNdx < numInputs ? inNdx : 0;
+ }
+
+ default:
+ throw new Error('Unrecognized primitiveType ' + primitiveType);
+ }
+
+ };
+
+ /**
+ * @param {gluDrawUtil.primitiveType} primitiveType type number in gluDrawUtil.primitiveType
+ * @param {es3fTransformFeedbackTests.Output} output
+ * @param {number} numInputs
+ * @param {Object} buffers
+ * @return {boolean} isOk
+ */
+ es3fTransformFeedbackTests.compareTransformFeedbackOutput = function(primitiveType, output, numInputs, buffers) {
+ /** @type {boolean} */ var isOk = true;
+ /** @type {number} */ var outOffset = output.offset;
+
+ for (var attrNdx = 0; attrNdx < output.inputs.length; attrNdx++) {
+ /** @type {es3fTransformFeedbackTests.Attribute} */ var attribute = output.inputs[attrNdx];
+ /** @type {gluShaderUtil.DataType} */ var type = attribute.type.getBasicType();
+ /** @type {number} */ var numComponents = gluShaderUtil.getDataTypeScalarSize(type);
+
+ /** @type {gluShaderUtil.precision} */ var precision = attribute.type.getPrecision();
+
+ /** @type {string} */ var scalarType = gluShaderUtil.getDataTypeScalarType(type);
+ /** @type {number} */ var numOutputs = es3fTransformFeedbackTests.getTransformFeedbackOutputCount(primitiveType, numInputs);
+
+ for (var outNdx = 0; outNdx < numOutputs; outNdx++) {
+ /** @type {number} */ var inNdx = es3fTransformFeedbackTests.getAttributeIndex(primitiveType, numInputs, outNdx);
+
+ for (var compNdx = 0; compNdx < numComponents; compNdx++) {
+ /** @type {boolean} */ var isEqual = false;
+
+ if (scalarType === 'float') {
+ var outBuffer = new Float32Array(buffers.output.buffer, buffers.output.offset + buffers.output.stride * outNdx + outOffset + compNdx * 4, 1);
+ var inBuffer = new Float32Array(buffers.input.buffer, buffers.input.offset + buffers.input.stride * inNdx + attribute.offset + compNdx * 4, 1);
+ var difInOut = inBuffer[0] - outBuffer[0];
+ /* TODO: Original code used ULP comparison for highp and mediump precision. This could cause failures. */
+ switch (precision) {
+ case gluShaderUtil.precision.PRECISION_HIGHP: {
+ isEqual = Math.abs(difInOut) < 0.1;
+ break;
+ }
+
+ case gluShaderUtil.precision.PRECISION_MEDIUMP: {
+ isEqual = Math.abs(difInOut) < 0.1;
+ break;
+ }
+
+ case gluShaderUtil.precision.PRECISION_LOWP: {
+ isEqual = Math.abs(difInOut) < 0.1;
+ break;
+ }
+ default:
+ throw new Error('Unknown precision: ' + precision);
+ }
+ } else {
+ var outBuffer = new Uint32Array(buffers.output.buffer, buffers.output.offset + buffers.output.stride * outNdx + outOffset + compNdx * 4, 1);
+ var inBuffer = new Uint32Array(buffers.input.buffer, buffers.input.offset + buffers.input.stride * inNdx + attribute.offset + compNdx * 4, 1);
+ isEqual = (inBuffer[0] == outBuffer[0]); // Bit-exact match required for integer types.
+ }
+
+ if (!isEqual) {
+ bufferedLogToConsole('Mismatch in ' + output.name + ' (' + attribute.name + '), output = ' + outNdx + ', input = ' + inNdx + ', component = ' + compNdx);
+ isOk = false;
+ break;
+ }
+ }
+
+ if (!isOk)
+ break;
+ }
+
+ if (!isOk)
+ break;
+
+ outOffset += numComponents * 4; /*sizeof(deUint32)*/
+ }
+
+ return isOk;
+ };
+
+ /**
+ * Returns (for all the draw calls) the type of Primitive Mode, as it calls "es3fTransformFeedbackTests.getTransformFeedbackPrimitiveCount".
+ * @param {gluDrawUtil.primitiveType} primitiveType GLenum that specifies what kind of primitive is
+ * @param {Array<es3fTransformFeedbackTests.DrawCall>} array Object.<number, boolean>
+ * @return {number} primCount
+ */
+ es3fTransformFeedbackTests.computeTransformFeedbackPrimitiveCount = function(primitiveType, array) {
+
+ /** @type {number} */ var primCount = 0;
+
+ for (var i = 0; i < array.length; ++ i) {
+
+ if (array[i].transformFeedbackEnabled)
+ primCount += es3fTransformFeedbackTests.getTransformFeedbackPrimitiveCount(primitiveType, array[i].numElements);
+ }
+
+ return primCount;
+ };
+
+ /**
+ * @param {number} target
+ * @param {number} bufferSize
+ * @param {number} guardSize
+ */
+ es3fTransformFeedbackTests.writeBufferGuard = function(target, bufferSize, guardSize) {
+ var buffer = new ArrayBuffer(guardSize);
+ var view = new Uint8Array(buffer);
+ for (var i = 0; i < guardSize; ++i) view[i] = 0xcd;
+ gl.bufferSubData(target, bufferSize, buffer);
+ };
+
+ /**
+ * Verifies guard
+ * @param {ArrayBuffer} buffer
+ * @param {number} start
+ * @return {boolean}
+ */
+ es3fTransformFeedbackTests.verifyGuard = function(buffer, start) {
+ start = start || 0;
+ var view = new Uint8Array(buffer, start);
+ for (var i = 0; i < view.length; i++) {
+ if (view[i] != 0xcd)
+ return false;
+ }
+ return true;
+ };
+
+ /**
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} bufferMode
+ * @param {gluDrawUtil.primitiveType} primitiveType GLenum that specifies what kind of primitive is
+ * @constructor
+ */
+ es3fTransformFeedbackTests.TransformFeedbackCase = function(name, desc, bufferMode, primitiveType) {
+ tcuTestCase.DeqpTest.call(this, name, desc);
+ this.m_bufferMode = bufferMode;
+ this.m_primitiveType = primitiveType;
+ this.m_progSpec = new es3fTransformFeedbackTests.ProgramSpec();
+
+ // Derived from es3fTransformFeedbackTests.ProgramSpec in es3fTransformFeedbackTests.init()
+ this.m_inputStride = 0;
+ this.m_attributes = []; // vector<es3fTransformFeedbackTests.Attribute>
+ this.m_transformFeedbackOutputs = []; // vector<es3fTransformFeedbackTests.Output>
+ this.m_bufferStrides = []; // vector<int>
+
+ // GL state.
+ this.m_program = null; // glu::ShaderProgram
+ this.m_transformFeedback = null; // glu::TransformFeedback
+ this.m_outputBuffers = []; // vector<deUint32>
+
+ this.m_iterNdx = 0; // int
+ this.m_testPassed = true;
+ // State machine
+ this.m_state = es3fTransformFeedbackTests.State.DRAW;
+ this.m_verifyStart = null;
+
+ this.m_frameWithTf = null;
+ this.m_frameWithoutTf = null;
+
+ this.m_viewportW = 0;
+ this.m_viewportH = 0;
+ this.m_viewportX = 0;
+ this.m_viewportY = 0;
+
+ this.m_primitiveQuery = null;
+ this.m_outputsOk = true;
+
+ };
+
+ setParentClass(es3fTransformFeedbackTests.TransformFeedbackCase, tcuTestCase.DeqpTest);
+
+ es3fTransformFeedbackTests.TransformFeedbackCase.prototype.createVerificationResult = function(retry, result) {
+ return { retry: retry, result: result };
+ }
+
+ es3fTransformFeedbackTests.TransformFeedbackCase.prototype.dumpShaderText = function() {
+ var dbgext = gl.getExtension('WEBGL_debug_shaders');
+ for (var ii = 0; ii < this.m_program.shaders.length; ++ii) {
+ debug('Shader source ' + ii + ' before translation:')
+ debug(this.m_program.shaders[ii].info.source);
+ debug('');
+ debug('Shader source ' + ii + ' after translation:');
+ debug(dbgext.getTranslatedShaderSource(this.m_program.shaders[ii].shader));
+ }
+ };
+
+ es3fTransformFeedbackTests.TransformFeedbackCase.prototype.init = function() {
+ this.m_program = es3fTransformFeedbackTests.createVertexCaptureProgram(
+ this.m_progSpec,
+ this.m_bufferMode,
+ this.m_primitiveType
+ );
+
+ if (!this.m_program.isOk()) {
+ // this.dumpShaderText();
+
+ var linkFail = this.m_program.shadersOK &&
+ !this.m_program.getProgramInfo().linkOk;
+
+ if (linkFail) {
+ if (!es3fTransformFeedbackTests.isProgramSupported(this.m_progSpec, this.m_bufferMode)) {
+ var msg = 'Not Supported. Implementation limits exceeded.';
+ checkMessage(false, msg);
+ throw new TestFailedException(msg);
+ } else if (es3fTransformFeedbackTests.hasArraysInTFVaryings(this.m_progSpec)) {
+ msg = 'Capturing arrays is not supported (undefined in specification)';
+ checkMessage(false, msg);
+ throw new TestFailedException(msg);
+ } else {
+ throw new Error('Link failed: ' + this.m_program.getProgramInfo().infoLog);
+ }
+ } else {
+ throw new Error('Compile failed');
+ }
+ } else {
+ // debug('Program is ' +
+ // (gl.getProgramParameter(this.m_program.getProgram(), gl.LINK_STATUS) ? 'linked' : 'not linked'));
+ // this.dumpShaderText();
+ }
+
+// bufferedLogToConsole('Transform feedback varyings: ' + tcu.formatArray(this.m_progSpec.getTransformFeedbackVaryings()));
+ bufferedLogToConsole('Transform feedback varyings: ' + this.m_progSpec.getTransformFeedbackVaryings());
+
+ // Print out transform feedback points reported by GL.
+ // bufferedLogToConsole('Transform feedback varyings reported by compiler:');
+ //logTransformFeedbackVaryings(log, gl, this.m_program.getProgram());
+
+ // Compute input specification.
+ this.m_inputStride = es3fTransformFeedbackTests.computeInputLayout(this.m_attributes, this.m_progSpec.getVaryings(), this.m_progSpec.isPointSizeUsed());
+
+ // Build list of varyings used in transform feedback.
+ es3fTransformFeedbackTests.computeTransformFeedbackOutputs(
+ this.m_transformFeedbackOutputs,
+ this.m_attributes,
+ this.m_progSpec.getVaryings(),
+ this.m_progSpec.getTransformFeedbackVaryings(),
+ this.m_bufferMode
+ );
+ if (!this.m_transformFeedbackOutputs.length) {
+ throw new Error('transformFeedbackOutputs cannot be empty.');
+ }
+
+ if (this.m_bufferMode == gl.SEPARATE_ATTRIBS) {
+ for (var i = 0; i < this.m_transformFeedbackOutputs.length; ++i) {
+ this.m_bufferStrides.push(this.m_transformFeedbackOutputs[i].type.getScalarSize() * 4 /*sizeof(deUint32)*/);
+ }
+ } else {
+ var totalSize = 0;
+ for (var i = 0; i < this.m_transformFeedbackOutputs.length; ++i) {
+ totalSize += this.m_transformFeedbackOutputs[i].type.getScalarSize() * 4 /*sizeof(deUint32)*/;
+ }
+ this.m_bufferStrides.push(totalSize);
+ }
+
+ this.m_outputBuffers.length = this.m_bufferStrides.length;
+ for (var i = 0; i < this.m_outputBuffers.length; i++)
+ this.m_outputBuffers[i] = gl.createBuffer();
+
+ this.m_transformFeedback = gl.createTransformFeedback();
+
+ this.m_iterNdx = 0;
+// this.m_testCtx.setTestResult(QP_TEST_RESULT_PASS, 'Pass');
+
+ };
+
+ es3fTransformFeedbackTests.TransformFeedbackCase.prototype.deinit = function() {
+ for (var i = 0; i < this.m_outputBuffers.length; i++)
+ gl.deleteBuffer(this.m_outputBuffers[i]);
+
+ // delete this.m_transformFeedback;
+ this.m_transformFeedback = null;
+
+ // delete this.m_program;
+ this.m_program = null;
+
+ // Clean up state.
+ this.m_attributes = [];
+ this.m_transformFeedbackOutputs = [];
+ this.m_bufferStrides = [];
+ this.m_inputStride = 0;
+
+ };
+
+ es3fTransformFeedbackTests.TransformFeedbackCase.prototype.iterate = function() {
+ var s = es3fTransformFeedbackTests.TransformFeedbackCase.s_iterate;
+ var numIterations = s.iterations.length;
+ var seed = deMath.deMathHash(this.m_iterNdx);
+ switch(this.m_state) {
+ case es3fTransformFeedbackTests.State.DRAW:
+ bufferedLogToConsole('Testing ' +
+ s.testCases[s.iterations[this.m_iterNdx]].length +
+ ' draw calls, (element es3fTransformFeedbackTests.count, TF state): ' +
+ s.testCases[s.iterations[this.m_iterNdx]]
+ );
+ this.draw(s.testCases[s.iterations[this.m_iterNdx]], seed);
+ this.m_state = es3fTransformFeedbackTests.State.VERIFY;
+ break;
+ case es3fTransformFeedbackTests.State.VERIFY:
+ var verifyResult = this.verify(s.testCases[s.iterations[this.m_iterNdx]]);
+ if (verifyResult.retry) {
+ break;
+ }
+ this.m_testPassed = verifyResult.result;
+ this.m_iterNdx += 1;
+ if (this.m_testPassed && this.m_iterNdx < numIterations) {
+ this.m_state = es3fTransformFeedbackTests.State.DRAW;
+ break;
+ }
+ // Fall through
+ case es3fTransformFeedbackTests.State.FINISH:
+ if (!this.m_testPassed) testFailedOptions('Result comparison failed for iteration ' + s.iterations[this.m_iterNdx - 1], false);
+ else testPassedOptions('Result comparison succeeded', true);
+ return tcuTestCase.IterateResult.STOP;
+ }
+
+ return tcuTestCase.IterateResult.CONTINUE;
+
+ };
+
+ es3fTransformFeedbackTests.TransformFeedbackCase.prototype.draw = function(calls, seed) {
+ var _min = function(x, y) { return x < y ? x : y; };
+
+ var rnd = new deRandom.Random(seed);
+ var numInputs = 0;
+ var numOutputs = 0;
+ var width = gl.drawingBufferWidth;
+ var height = gl.drawingBufferHeight;
+ this.m_viewportW = _min(es3fTransformFeedbackTests.VIEWPORT_WIDTH, width);
+ this.m_viewportH = _min(es3fTransformFeedbackTests.VIEWPORT_HEIGHT, height);
+ this.m_viewportX = rnd.getInt(0, width - this.m_viewportW);
+ this.m_viewportY = rnd.getInt(0, height - this.m_viewportH);
+ this.m_frameWithTf = new tcuSurface.Surface(this.m_viewportW, this.m_viewportH); // tcu::Surface
+ this.m_frameWithoutTf = new tcuSurface.Surface(this.m_viewportW, this.m_viewportH); // tcu::Surface
+ this.m_primitiveQuery = gl.createQuery();
+ this.m_outputsOk = true;
+
+ // Compute totals.
+ for (var i = 0; i < calls.length; ++i) {
+ var call = calls[i];
+ numInputs += call.numElements;
+ numOutputs += call.transformFeedbackEnabled ? es3fTransformFeedbackTests.getTransformFeedbackOutputCount(this.m_primitiveType, call.numElements) : 0;
+ }
+
+ // Input data.
+ var inputData = es3fTransformFeedbackTests.genInputData(this.m_attributes, numInputs, this.m_inputStride, rnd);
+
+ gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, this.m_transformFeedback);
+
+ // Allocate storage for transform feedback output buffers and bind to targets.
+ for (var bufNdx = 0; bufNdx < this.m_outputBuffers.length; ++bufNdx) {
+ var buffer = this.m_outputBuffers[bufNdx]; // deUint32
+ var stride = this.m_bufferStrides[bufNdx]; // int
+ var target = bufNdx; // int
+ var size = stride * numOutputs; // int
+ var guardSize = stride * es3fTransformFeedbackTests.BUFFER_GUARD_MULTIPLIER; // int
+ var usage = gl.DYNAMIC_READ; // const deUint32
+
+ gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, buffer);
+ gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, size + guardSize, usage);
+ es3fTransformFeedbackTests.writeBufferGuard(gl.TRANSFORM_FEEDBACK_BUFFER, size, guardSize);
+
+ // \todo [2012-07-30 pyry] glBindBufferRange()?
+ gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, target, buffer);
+ }
+
+ var attribBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, attribBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, inputData, gl.STATIC_DRAW);
+
+ // Setup attributes.
+ for (var i = 0; i < this.m_attributes.length; ++i) {
+ var attrib = this.m_attributes[i];
+ var loc = gl.getAttribLocation(this.m_program.getProgram(), attrib.name);
+ /** @type {string} */
+ var scalarType = gluShaderUtil.getDataTypeScalarType(attrib.type.getBasicType());
+ /** @type {number} */
+ var numComponents = gluShaderUtil.getDataTypeScalarSize(attrib.type.getBasicType());
+
+ if (loc >= 0) {
+ gl.enableVertexAttribArray(loc);
+ switch (scalarType) {
+ case 'float':
+ gl.vertexAttribPointer(loc, numComponents, gl.FLOAT, false, this.m_inputStride, attrib.offset); break;
+ case 'int':
+ gl.vertexAttribIPointer(loc, numComponents, gl.INT, this.m_inputStride, attrib.offset); break;
+ case 'uint':
+ gl.vertexAttribIPointer(loc, numComponents, gl.UNSIGNED_INT, this.m_inputStride, attrib.offset); break;
+ }
+ }
+ }
+
+ // Setup viewport.
+ gl.viewport(this.m_viewportX, this.m_viewportY, this.m_viewportW, this.m_viewportH);
+
+ // Setup program.
+ gl.useProgram(this.m_program.getProgram());
+
+ gl.uniform4fv(
+ gl.getUniformLocation(this.m_program.getProgram(), 'u_scale'),
+ [0.01, 0.01, 0.01, 0.01]
+ );
+ gl.uniform4fv(
+ gl.getUniformLocation(this.m_program.getProgram(), 'u_bias'),
+ [0.5, 0.5, 0.5, 0.5]
+ );
+
+ // Enable query.
+ gl.beginQuery(gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, this.m_primitiveQuery);
+
+ // Draw
+ var offset = 0;
+ var tfEnabled = true;
+
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ var tfPrimitiveMode = es3fTransformFeedbackTests.getTransformFeedbackPrimitiveMode(this.m_primitiveType);
+ gl.beginTransformFeedback(tfPrimitiveMode);
+
+ for (var i = 0; i < calls.length; ++i) {
+ var call = calls[i];
+
+ // Pause or resume transform feedback if necessary.
+ if (call.transformFeedbackEnabled != tfEnabled) {
+ if (call.transformFeedbackEnabled)
+ gl.resumeTransformFeedback();
+ else
+ gl.pauseTransformFeedback();
+ tfEnabled = call.transformFeedbackEnabled;
+ }
+
+ gl.drawArrays(gluDrawUtil.getPrimitiveGLType(gl, this.m_primitiveType), offset, call.numElements);
+ offset += call.numElements;
+ }
+
+ // Resume feedback before finishing it.
+ if (!tfEnabled)
+ gl.resumeTransformFeedback();
+
+ gl.endTransformFeedback();
+
+ gl.endQuery(gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN);
+
+ // Check and log query status right after submit
+ var query = this.m_primitiveQuery;
+
+ var available = gl.getQueryParameter(query, gl.QUERY_RESULT_AVAILABLE);
+
+ if (available) {
+ this.m_testPassed = false;
+ this.m_state = es3fTransformFeedbackTests.State.FINISH;
+ testFailedOptions('Transform feedback query result must not be available the same frame as they are issued.', true);
+ }
+
+ // Compare result buffers.
+ for (var bufferNdx = 0; bufferNdx < this.m_outputBuffers.length; ++bufferNdx) {
+ var stride = this.m_bufferStrides[bufferNdx]; // int
+ var size = stride * numOutputs; // int
+ var guardSize = stride * es3fTransformFeedbackTests.BUFFER_GUARD_MULTIPLIER; // int
+ var buffer = new ArrayBuffer(size + guardSize); // const void*
+
+ // Bind buffer for reading.
+ gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, this.m_outputBuffers[bufferNdx]);
+
+ gl.getBufferSubData(gl.TRANSFORM_FEEDBACK_BUFFER, 0, new Uint8Array(buffer));
+
+ // Verify all output variables that are written to this buffer.
+ for (var i = 0; i < this.m_transformFeedbackOutputs.length; ++i) {
+ var out = this.m_transformFeedbackOutputs[i];
+
+ if (out.bufferNdx != bufferNdx)
+ continue;
+
+ var inputOffset = 0;
+ var outputOffset = 0;
+
+ // Process all draw calls and check ones with transform feedback enabled
+ for (var callNdx = 0; callNdx < calls.length; ++callNdx) {
+ var call = calls[callNdx];
+
+ if (call.transformFeedbackEnabled) {
+ var inputPtr = inputData[0] + inputOffset * this.m_inputStride; // const deUint8*
+ var outputPtr = outputOffset * stride; // const deUint8*
+
+ if (!es3fTransformFeedbackTests.compareTransformFeedbackOutput(this.m_primitiveType, out, call.numElements, {
+ input: {
+ buffer: inputData,
+ offset: inputOffset * this.m_inputStride,
+ stride: this.m_inputStride
+ },
+ output: {
+ buffer: buffer,
+ offset: outputOffset * stride,
+ stride: stride
+ }
+ })) {
+ this.m_outputsOk = false;
+ break;
+ }
+ }
+
+ inputOffset += call.numElements;
+ outputOffset += call.transformFeedbackEnabled ? es3fTransformFeedbackTests.getTransformFeedbackOutputCount(this.m_primitiveType, call.numElements) : 0;
+ }
+ }
+
+ // Verify guardband.
+ if (!es3fTransformFeedbackTests.verifyGuard(buffer, size)) {
+ bufferedLogToConsole('Error: Transform feedback buffer overrun detected');
+ this.m_outputsOk = false;
+ }
+ }
+ };
+
+ es3fTransformFeedbackTests.TransformFeedbackCase.prototype.verify = function(calls) {
+ // Check status after mapping buffers.
+ var mustBeReady = this.m_outputBuffers.length > 0; // Mapping buffer forces synchronization. // const bool
+ var expectedCount = es3fTransformFeedbackTests.computeTransformFeedbackPrimitiveCount(this.m_primitiveType, calls); // const int
+ var available = /** @type {boolean} */ (gl.getQueryParameter(this.m_primitiveQuery, gl.QUERY_RESULT_AVAILABLE));
+ var verify_offset = 0;
+ var queryOk = true;
+ if (!available) {
+ if (!this.m_verifyStart)
+ this.m_verifyStart = new Date();
+ else {
+ var current = new Date();
+ var elapsedTime = 0.001 * (current.getTime() - this.m_verifyStart.getTime());
+ if (elapsedTime > es3fTransformFeedbackTests.MAX_VERIFY_WAIT) {
+ testFailed('Query result not available after ' + elapsedTime + ' seconds.');
+ this.m_state = es3fTransformFeedbackTests.State.FINISH;
+ return this.createVerificationResult(false, false);
+ }
+ }
+ return this.createVerificationResult(true, false);
+ }
+
+ var numPrimitives = /** @type {number} */ (gl.getQueryParameter(this.m_primitiveQuery, gl.QUERY_RESULT));
+
+ if (!mustBeReady && available == false)
+ bufferedLogToConsole('ERROR: gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN result not available after mapping buffers!');
+
+ bufferedLogToConsole('gl.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = ' + numPrimitives);
+
+ if (numPrimitives != expectedCount) {
+ queryOk = false;
+ bufferedLogToConsole('ERROR: Expected ' + expectedCount + ' primitives!');
+ }
+
+ // Clear transform feedback state.
+ gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, null);
+ for (var bufNdx = 0; bufNdx < this.m_outputBuffers.length; ++bufNdx) {
+ gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, null);
+ gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, bufNdx, null);
+ }
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+
+ // Read back rendered image.
+ this.m_frameWithTf.readViewport(gl, [this.m_viewportX, this.m_viewportY, this.m_viewportW, this.m_viewportH]);
+
+ // Render without transform feedback.
+
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ for (var i = 0; i < calls.length; ++i) {
+ var call = calls[i];
+ gl.drawArrays(gluDrawUtil.getPrimitiveGLType(gl, this.m_primitiveType), verify_offset, call.numElements);
+ verify_offset += call.numElements;
+ }
+ this.m_frameWithoutTf.readViewport(gl, [this.m_viewportX, this.m_viewportY, this.m_viewportW, this.m_viewportH]);
+
+ // Compare images with and without transform feedback.
+ var imagesOk = tcuImageCompare.pixelThresholdCompare('Result', 'Image comparison result', this.m_frameWithoutTf, this.m_frameWithTf, [1, 1, 1, 1], tcuImageCompare.CompareLogMode.ON_ERROR);
+
+ if (imagesOk)
+ bufferedLogToConsole('Rendering result comparison between TF enabled and TF disabled passed.');
+ else
+ bufferedLogToConsole('ERROR: Rendering result comparison between TF enabled and TF disabled failed!');
+
+ return this.createVerificationResult(false, this.m_outputsOk && imagesOk && queryOk);
+
+ };
+
+ es3fTransformFeedbackTests.dc = function(numElements, tfEnabled) {
+ return new es3fTransformFeedbackTests.DrawCall(numElements, tfEnabled);
+ };
+
+ // static data
+ es3fTransformFeedbackTests.TransformFeedbackCase.s_iterate = {
+
+ testCases: {
+ elemCount1: [es3fTransformFeedbackTests.dc(1, true)],
+ elemCount2: [es3fTransformFeedbackTests.dc(2, true)],
+ elemCount3: [es3fTransformFeedbackTests.dc(3, true)],
+ elemCount4: [es3fTransformFeedbackTests.dc(4, true)],
+ elemCount123: [es3fTransformFeedbackTests.dc(123, true)],
+ basicPause1: [es3fTransformFeedbackTests.dc(64, true), es3fTransformFeedbackTests.dc(64, false), es3fTransformFeedbackTests.dc(64, true)],
+ basicPause2: [es3fTransformFeedbackTests.dc(13, true), es3fTransformFeedbackTests.dc(5, true), es3fTransformFeedbackTests.dc(17, false),
+ es3fTransformFeedbackTests.dc(3, true), es3fTransformFeedbackTests.dc(7, false)],
+ startPaused: [es3fTransformFeedbackTests.dc(123, false), es3fTransformFeedbackTests.dc(123, true)],
+ random1: [es3fTransformFeedbackTests.dc(65, true), es3fTransformFeedbackTests.dc(135, false), es3fTransformFeedbackTests.dc(74, true),
+ es3fTransformFeedbackTests.dc(16, false), es3fTransformFeedbackTests.dc(226, false), es3fTransformFeedbackTests.dc(9, true),
+ es3fTransformFeedbackTests.dc(174, false)],
+ random2: [es3fTransformFeedbackTests.dc(217, true), es3fTransformFeedbackTests.dc(171, true), es3fTransformFeedbackTests.dc(147, true),
+ es3fTransformFeedbackTests.dc(152, false), es3fTransformFeedbackTests.dc(55, true)]
+ },
+ iterations: [
+ 'elemCount1', 'elemCount2', 'elemCount3', 'elemCount4', 'elemCount123',
+ 'basicPause1', 'basicPause2', 'startPaused',
+ 'random1', 'random2'
+ ]
+ };
+
+ es3fTransformFeedbackTests.hasArraysInTFVaryings = function(spec) {
+
+ for (var i = 0; i < spec.getTransformFeedbackVaryings().length; ++i) {
+ var tfVar = spec.getTransformFeedbackVaryings()[i];
+ var varName = gluVarTypeUtil.parseVariableName(tfVar);
+
+ var attr = es3fTransformFeedbackTests.findAttributeNameEquals(spec.getVaryings(), varName);
+ if (attr && attr.type.isArrayType())
+ return true;
+ }
+ return false;
+
+ };
+
+ /** es3fTransformFeedbackTests.PositionCase
+ * @extends {es3fTransformFeedbackTests.TransformFeedbackCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} bufferMode
+ * @param {gluDrawUtil.primitiveType} primitiveType GLenum that specifies what kind of primitive is
+ * @constructor
+ */
+ es3fTransformFeedbackTests.PositionCase = function(name, desc, bufferMode, primitiveType) {
+ es3fTransformFeedbackTests.TransformFeedbackCase.call(this, name, desc, bufferMode, primitiveType);
+ this.m_progSpec.addTransformFeedbackVarying('gl_Position');
+ };
+
+ setParentClass(es3fTransformFeedbackTests.PositionCase, es3fTransformFeedbackTests.TransformFeedbackCase);
+
+ /** es3fTransformFeedbackTests.PointSizeCase
+ * @extends {es3fTransformFeedbackTests.TransformFeedbackCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} bufferMode
+ * @param {gluDrawUtil.primitiveType} primitiveType GLenum that specifies what kind of primitive is
+ * @constructor
+ */
+ es3fTransformFeedbackTests.PointSizeCase = function(name, desc, bufferMode, primitiveType) {
+ es3fTransformFeedbackTests.TransformFeedbackCase.call(this, name, desc, bufferMode, primitiveType);
+ this.m_progSpec.addTransformFeedbackVarying('gl_PointSize');
+
+ };
+
+ setParentClass(es3fTransformFeedbackTests.PointSizeCase, es3fTransformFeedbackTests.TransformFeedbackCase);
+
+ /** es3fTransformFeedbackTests.BasicTypeCase
+ * @extends {es3fTransformFeedbackTests.TransformFeedbackCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} bufferMode
+ * @param {gluDrawUtil.primitiveType} primitiveType GLenum that specifies what kind of primitive is
+ * @param {gluShaderUtil.DataType} type
+ * @param {gluShaderUtil.precision} precision
+ * @param {es3fTransformFeedbackTests.interpolation} interpolation enum number in this javascript
+ * @constructor
+ */
+ es3fTransformFeedbackTests.BasicTypeCase = function(name, desc, bufferMode, primitiveType, type, precision, interpolation) {
+ es3fTransformFeedbackTests.TransformFeedbackCase.call(this, name, desc, bufferMode, primitiveType);
+
+ this.m_progSpec.addVarying('v_varA', gluVarType.newTypeBasic(type, precision), interpolation);
+ this.m_progSpec.addVarying('v_varB', gluVarType.newTypeBasic(type, precision), interpolation);
+
+ this.m_progSpec.addTransformFeedbackVarying('v_varA');
+ this.m_progSpec.addTransformFeedbackVarying('v_varB');
+
+ };
+
+ setParentClass(es3fTransformFeedbackTests.BasicTypeCase, es3fTransformFeedbackTests.TransformFeedbackCase);
+
+ /** es3fTransformFeedbackTests.BasicArrayCase
+ * @extends {es3fTransformFeedbackTests.TransformFeedbackCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} bufferMode
+ * @param {gluDrawUtil.primitiveType} primitiveType GLenum that specifies what kind of primitive is
+ * @param {gluShaderUtil.DataType} type
+ * @param {gluShaderUtil.precision} precision
+ * @param {es3fTransformFeedbackTests.interpolation} interpolation enum number in this javascript
+ * @constructor
+ */
+ es3fTransformFeedbackTests.BasicArrayCase = function(name, desc, bufferMode, primitiveType, type, precision, interpolation) {
+ es3fTransformFeedbackTests.TransformFeedbackCase.call(this, name, desc, bufferMode, primitiveType);
+
+ if (gluShaderUtil.isDataTypeMatrix(type) || this.m_bufferMode === gl.SEPARATE_ATTRIBS) {
+ // note For matrix types we need to use reduced array sizes or otherwise we will exceed maximum attribute (16)
+ // or transform feedback component es3fTransformFeedbackTests.count (64).
+ // On separate attribs mode maximum component es3fTransformFeedbackTests.count per varying is 4.
+ this.m_progSpec.addVarying('v_varA', gluVarType.newTypeArray(gluVarType.newTypeBasic(type, precision), 1), interpolation);
+ this.m_progSpec.addVarying('v_varB', gluVarType.newTypeArray(gluVarType.newTypeBasic(type, precision), 2), interpolation);
+ } else {
+ this.m_progSpec.addVarying('v_varA', gluVarType.newTypeArray(gluVarType.newTypeBasic(type, precision), 3), interpolation);
+ this.m_progSpec.addVarying('v_varB', gluVarType.newTypeArray(gluVarType.newTypeBasic(type, precision), 4), interpolation);
+ }
+
+ this.m_progSpec.addTransformFeedbackVarying('v_varA');
+ this.m_progSpec.addTransformFeedbackVarying('v_varB');
+
+ };
+
+ setParentClass(es3fTransformFeedbackTests.BasicArrayCase, es3fTransformFeedbackTests.TransformFeedbackCase);
+
+ /** es3fTransformFeedbackTests.ArrayElementCase
+ * @extends {es3fTransformFeedbackTests.TransformFeedbackCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} bufferMode
+ * @param {gluDrawUtil.primitiveType} primitiveType GLenum that specifies what kind of primitive is
+ * @param {gluShaderUtil.DataType} type
+ * @param {gluShaderUtil.precision} precision
+ * @param {es3fTransformFeedbackTests.interpolation} interpolation enum number in this javascript
+ * @constructor
+ */
+ es3fTransformFeedbackTests.ArrayElementCase = function(name, desc, bufferMode, primitiveType, type, precision, interpolation) {
+
+ es3fTransformFeedbackTests.TransformFeedbackCase.call(this, name, desc, bufferMode, primitiveType);
+
+ this.m_progSpec.addVarying('v_varA', gluVarType.newTypeArray(gluVarType.newTypeBasic(type, precision), 3), interpolation);
+ this.m_progSpec.addVarying('v_varB', gluVarType.newTypeArray(gluVarType.newTypeBasic(type, precision), 4), interpolation);
+
+ this.m_progSpec.addTransformFeedbackVarying('v_varA[1]');
+ this.m_progSpec.addTransformFeedbackVarying('v_varB[0]');
+ this.m_progSpec.addTransformFeedbackVarying('v_varB[3]');
+
+ };
+
+ setParentClass(es3fTransformFeedbackTests.ArrayElementCase, es3fTransformFeedbackTests.TransformFeedbackCase);
+
+ /** es3fTransformFeedbackTests.RandomCase
+ * @extends {es3fTransformFeedbackTests.TransformFeedbackCase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} bufferMode
+ * @param {gluDrawUtil.primitiveType} primitiveType GLenum that specifies what kind of primitive is
+ * @param {number} seed
+ * @constructor
+ */
+ es3fTransformFeedbackTests.RandomCase = function(name, desc, bufferMode, primitiveType, seed) {
+ es3fTransformFeedbackTests.TransformFeedbackCase.call(this, name, desc, bufferMode, primitiveType);
+
+ };
+
+ setParentClass(es3fTransformFeedbackTests.RandomCase, es3fTransformFeedbackTests.TransformFeedbackCase);
+
+ es3fTransformFeedbackTests.RandomCase.prototype.init = function() {
+
+ /** @type {number} */
+ var seed = /*deString.deStringHash(getName()) ^ */ deMath.deMathHash(this.m_iterNdx);
+
+ /** @type {Array<gluShaderUtil.DataType>} */
+ var typeCandidates = [
+ gluShaderUtil.DataType.FLOAT,
+ gluShaderUtil.DataType.FLOAT_VEC2,
+ gluShaderUtil.DataType.FLOAT_VEC3,
+ gluShaderUtil.DataType.FLOAT_VEC4,
+ gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT_VEC2,
+ gluShaderUtil.DataType.INT_VEC3,
+ gluShaderUtil.DataType.INT_VEC4,
+ gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT_VEC2,
+ gluShaderUtil.DataType.UINT_VEC3,
+ gluShaderUtil.DataType.UINT_VEC4,
+
+ gluShaderUtil.DataType.FLOAT_MAT2,
+ gluShaderUtil.DataType.FLOAT_MAT2X3,
+ gluShaderUtil.DataType.FLOAT_MAT2X4,
+
+ gluShaderUtil.DataType.FLOAT_MAT3X2,
+ gluShaderUtil.DataType.FLOAT_MAT3,
+ gluShaderUtil.DataType.FLOAT_MAT3X4,
+
+ gluShaderUtil.DataType.FLOAT_MAT4X2,
+ gluShaderUtil.DataType.FLOAT_MAT4X3,
+ gluShaderUtil.DataType.FLOAT_MAT4
+ ];
+
+ /** @type {Array<gluShaderUtil.precision>} */
+ var precisions = [
+ gluShaderUtil.precision.PRECISION_LOWP,
+ gluShaderUtil.precision.PRECISION_MEDIUMP,
+ gluShaderUtil.precision.PRECISION_HIGHP
+ ];
+
+ var interpModes = [{name: 'smooth', interp: es3fTransformFeedbackTests.interpolation.SMOOTH}, {name: 'flat', interp: es3fTransformFeedbackTests.interpolation.FLAT}, {name: 'centroid', interp: es3fTransformFeedbackTests.interpolation.CENTROID}
+ ];
+
+ /** @type {number} */ var maxAttributeVectors = 16;
+ //** @type {number} */ var maxTransformFeedbackComponents = 64; // note It is enough to limit attribute set size.
+ /** @type {boolean} */ var isSeparateMode = (this.m_bufferMode === gl.SEPARATE_ATTRIBS);
+ /** @type {number} */ var maxTransformFeedbackVars = isSeparateMode ? 4 : maxAttributeVectors;
+ /** @type {number} */ var arrayWeight = 0.3;
+ /** @type {number} */ var positionWeight = 0.7;
+ /** @type {number} */ var pointSizeWeight = 0.1;
+ /** @type {number} */ var captureFullArrayWeight = 0.5;
+
+ /** @type {deRandom.Random} */
+ var rnd = new deRandom.Random(seed);
+ /** @type {boolean} */ var usePosition = rnd.getFloat() < positionWeight;
+ /** @type {boolean} */ var usePointSize = rnd.getFloat() < pointSizeWeight;
+ /** @type {number} */ var numAttribVectorsToUse = rnd.getInt(
+ 1, maxAttributeVectors - 1/*position*/ - (usePointSize ? 1 : 0)
+ );
+
+ /** @type {number} */ var numAttributeVectors = 0;
+ /** @type {number} */ var varNdx = 0;
+
+ // Generate varyings.
+ while (numAttributeVectors < numAttribVectorsToUse) {
+ /** @type {number} */
+ var maxVecs = isSeparateMode ? Math.min(2 /*at most 2*mat2*/, numAttribVectorsToUse - numAttributeVectors) : numAttribVectorsToUse - numAttributeVectors;
+ /** @type {gluShaderUtil.DataType} */
+ var begin = typeCandidates[0];
+ /** @type {number} */
+ var endCandidates = begin + (
+ maxVecs >= 4 ? 21 : (
+ maxVecs >= 3 ? 18 : (
+ maxVecs >= 2 ? (isSeparateMode ? 13 : 15) : 12
+ )
+ )
+ );
+ /** @type {gluShaderUtil.DataType} */
+ var end = typeCandidates[endCandidates];
+
+ /** @type {gluShaderUtil.DataType} */
+ var type = rnd.choose(typeCandidates)[0];
+
+ /** @type {gluShaderUtil.precision} */
+ var precision = rnd.choose(precisions)[0];
+
+ /** @type {es3fTransformFeedbackTests.interpolation} */
+ var interp = (type === gluShaderUtil.DataType.FLOAT) ?
+ rnd.choose(interpModes)[0].interp :
+ es3fTransformFeedbackTests.interpolation.FLAT;
+
+ /** @type {number} */
+ var numVecs = gluShaderUtil.isDataTypeMatrix(type) ? gluShaderUtil.getDataTypeMatrixNumColumns(type) : 1;
+ /** @type {number} */
+ var numComps = gluShaderUtil.getDataTypeScalarSize(type);
+ /** @type {number} */
+ var maxArrayLen = Math.max(1, isSeparateMode ? (4 / numComps) : (maxVecs / numVecs));
+ /** @type {boolean} */
+ var useArray = rnd.getFloat() < arrayWeight;
+ /** @type {number} */
+ var arrayLen = useArray ? rnd.getInt(1, maxArrayLen) : 1;
+ /** @type {string} */
+ var name = 'v_var' + varNdx;
+
+ if (useArray)
+ this.m_progSpec.addVarying(name, gluVarType.newTypeArray(gluVarType.newTypeBasic(type, precision), arrayLen), interp);
+ else
+ this.m_progSpec.addVarying(name, gluVarType.newTypeBasic(type, precision), interp);
+
+ numAttributeVectors += arrayLen * numVecs;
+ varNdx += 1;
+ }
+
+ // Generate transform feedback candidate set.
+ /** @type {Array<string>} */ var tfCandidates = [];
+
+ if (usePosition) tfCandidates.push('gl_Position');
+ if (usePointSize) tfCandidates.push('gl_PointSize');
+
+ for (var ndx = 0; ndx < varNdx; ndx++) {
+ /** @type {es3fTransformFeedbackTests.Varying} */
+ var varying = this.m_progSpec.getVaryings()[ndx];
+
+ if (varying.type.isArrayType()) {
+ /** @type {boolean} */
+ var captureFull = rnd.getFloat() < captureFullArrayWeight;
+
+ if (captureFull) {
+ tfCandidates.push(varying.name);
+ } else {
+ /** @type {number} */
+ var numElem = varying.type.getArraySize();
+ for (var elemNdx = 0; elemNdx < numElem; elemNdx++)
+ tfCandidates.push(varying.name + '[' + elemNdx + ']');
+ }
+ } else
+ tfCandidates.push(varying.name);
+ }
+
+ // Pick random selection.
+ var tfVaryings = [];
+ rnd.choose(tfCandidates, tfVaryings, Math.min(tfCandidates.length, maxTransformFeedbackVars));
+ rnd.shuffle(tfVaryings);
+ for (var i = 0; i < tfVaryings.length; i++)
+ this.m_progSpec.addTransformFeedbackVarying(tfVaryings[i]);
+
+ es3fTransformFeedbackTests.TransformFeedbackCase.prototype.init.call(this);
+
+ };
+
+ /**
+ * Creates the test in order to be executed
+ **/
+ es3fTransformFeedbackTests.init = function() {
+
+ /** @const @type {tcuTestCase.DeqpTest} */
+ var testGroup = tcuTestCase.runner.testCases;
+
+ var bufferModes = [{name: 'separate', mode: gl.SEPARATE_ATTRIBS}, {name: 'interleaved', mode: gl.INTERLEAVED_ATTRIBS}
+ ];
+
+ var primitiveTypes = [{name: 'points', type: gluDrawUtil.primitiveType.POINTS}, {name: 'lines', type: gluDrawUtil.primitiveType.LINES}, {name: 'triangles', type: gluDrawUtil.primitiveType.TRIANGLES}
+ ];
+
+ /** @type {Array<gluShaderUtil.DataType>} */
+ var basicTypes = [
+ gluShaderUtil.DataType.FLOAT,
+ gluShaderUtil.DataType.FLOAT_VEC2,
+ gluShaderUtil.DataType.FLOAT_VEC3,
+ gluShaderUtil.DataType.FLOAT_VEC4,
+ gluShaderUtil.DataType.FLOAT_MAT2,
+ gluShaderUtil.DataType.FLOAT_MAT2X3,
+ gluShaderUtil.DataType.FLOAT_MAT2X4,
+ gluShaderUtil.DataType.FLOAT_MAT3X2,
+ gluShaderUtil.DataType.FLOAT_MAT3,
+ gluShaderUtil.DataType.FLOAT_MAT3X4,
+ gluShaderUtil.DataType.FLOAT_MAT4X2,
+ gluShaderUtil.DataType.FLOAT_MAT4X3,
+ gluShaderUtil.DataType.FLOAT_MAT4,
+ gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT_VEC2,
+ gluShaderUtil.DataType.INT_VEC3,
+ gluShaderUtil.DataType.INT_VEC4,
+ gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT_VEC2,
+ gluShaderUtil.DataType.UINT_VEC3,
+ gluShaderUtil.DataType.UINT_VEC4
+ ];
+
+ /** @type {Array<gluShaderUtil.precision>} */
+ var precisions = [
+
+ gluShaderUtil.precision.PRECISION_LOWP,
+ gluShaderUtil.precision.PRECISION_MEDIUMP,
+ gluShaderUtil.precision.PRECISION_HIGHP
+
+ // glsUBC.UniformFlags.PRECISION_LOW,
+ // glsUBC.UniformFlags.PRECISION_MEDIUM,
+ // glsUBC.UniformFlags.PRECISION_HIGH
+ ];
+
+ var interpModes = [{name: 'smooth', interp: es3fTransformFeedbackTests.interpolation.SMOOTH}, {name: 'flat', interp: es3fTransformFeedbackTests.interpolation.FLAT}, {name: 'centroid', interp: es3fTransformFeedbackTests.interpolation.CENTROID}
+ ];
+
+ // .position
+ /** @type {tcuTestCase.DeqpTest} */
+ var positionGroup = tcuTestCase.newTest('position', 'gl_Position capture using transform feedback');
+ testGroup.addChild(positionGroup);
+
+ for (var primitiveType = 0; primitiveType < primitiveTypes.length; primitiveType++) {
+ for (var bufferMode = 0; bufferMode < bufferModes.length; bufferMode++) {
+ /** @type {string} */
+ var name = primitiveTypes[primitiveType].name + '_' + bufferModes[bufferMode].name;
+
+ positionGroup.addChild(new es3fTransformFeedbackTests.PositionCase(
+ name,
+ '',
+ bufferModes[bufferMode].mode,
+ primitiveTypes[primitiveType].type
+ ));
+ }
+ }
+
+ // .point_size
+ /** @type {tcuTestCase.DeqpTest} */ var pointSizeGroup = tcuTestCase.newTest('point_size', 'gl_PointSize capture using transform feedback');
+ testGroup.addChild(pointSizeGroup);
+
+ for (var primitiveType = 0; primitiveType < primitiveTypes.length; primitiveType++) {
+ for (var bufferMode = 0; bufferMode < bufferModes.length; bufferMode++) {
+ var name = primitiveTypes[primitiveType].name + '_' + bufferModes[bufferMode].name;
+
+ pointSizeGroup.addChild(new es3fTransformFeedbackTests.PointSizeCase(
+ name,
+ '',
+ bufferModes[bufferMode].mode,
+ primitiveTypes[primitiveType].type
+ ));
+ }
+ }
+
+ // .basic_type
+ for (var bufferModeNdx = 0; bufferModeNdx < bufferModes.length; bufferModeNdx++) {
+ /** @type {number} */
+ var bufferMode = bufferModes[bufferModeNdx].mode;
+ for (var primitiveTypeNdx = 0; primitiveTypeNdx < primitiveTypes.length; primitiveTypeNdx++) {
+ /** @type {tcuTestCase.DeqpTest} */
+ var primitiveGroup = tcuTestCase.newTest(
+ 'basic_types.' + bufferModes[bufferModeNdx].name + '.' + primitiveTypes[primitiveTypeNdx].name,
+ 'Basic types in transform feedback');
+ /** @type {number} */
+ var primitiveType = primitiveTypes[primitiveTypeNdx].type;
+ testGroup.addChild(primitiveGroup);
+
+ for (var typeNdx = 0; typeNdx < basicTypes.length; typeNdx++) {
+ /** @type {gluShaderUtil.DataType} */
+ var type = basicTypes[typeNdx];
+ /** @type {boolean} */
+ var isFloat = gluShaderUtil.getDataTypeScalarType(type) == gluShaderUtil.DataType.FLOAT;
+
+ for (var precNdx = 0; precNdx < precisions.length; precNdx++) {
+ /** @type {gluShaderUtil.precision} */
+ var precision = precisions[precNdx];
+ var name = gluShaderUtil.getPrecisionName(precision) + '_' + gluShaderUtil.getDataTypeName(type);
+
+ primitiveGroup.addChild(new es3fTransformFeedbackTests.BasicTypeCase(
+ name,
+ '',
+ bufferMode,
+ primitiveType,
+ type,
+ precision,
+ isFloat ? es3fTransformFeedbackTests.interpolation.SMOOTH : es3fTransformFeedbackTests.interpolation.FLAT
+ ));
+ }
+ }
+ }
+ }
+
+ // .array
+ for (var bufferModeNdx = 0; bufferModeNdx < bufferModes.length; bufferModeNdx++) {
+ var bufferMode = bufferModes[bufferModeNdx].mode;
+ for (var primitiveTypeNdx = 0; primitiveTypeNdx < primitiveTypes.length; primitiveTypeNdx++) {
+ var primitiveGroup = tcuTestCase.newTest(
+ 'array.' + bufferModes[bufferModeNdx].name + '.' + primitiveTypes[primitiveTypeNdx].name,
+ 'Capturing whole array in TF');
+ /** @type {number} */
+ var primitiveType = primitiveTypes[primitiveTypeNdx].type;
+ testGroup.addChild(primitiveGroup);
+
+ for (var typeNdx = 0; typeNdx < basicTypes.length; typeNdx++) {
+ var type = basicTypes[typeNdx];
+ var isFloat = gluShaderUtil.getDataTypeScalarType(type) == gluShaderUtil.DataType.FLOAT;
+
+ for (var precNdx = 0; precNdx < precisions.length; precNdx++) {
+ var precision = precisions[precNdx];
+ var name = gluShaderUtil.getPrecisionName(precision) + '_' + gluShaderUtil.getDataTypeName(type);
+
+ primitiveGroup.addChild(new es3fTransformFeedbackTests.BasicArrayCase(
+ name,
+ '',
+ bufferMode,
+ primitiveType,
+ type,
+ precision,
+ isFloat ? es3fTransformFeedbackTests.interpolation.SMOOTH : es3fTransformFeedbackTests.interpolation.FLAT
+ ));
+ }
+ }
+ }
+ }
+
+ // .array_element
+ for (var bufferModeNdx = 0; bufferModeNdx < bufferModes.length; bufferModeNdx++) {
+ var bufferMode = bufferModes[bufferModeNdx].mode;
+ for (var primitiveTypeNdx = 0; primitiveTypeNdx < primitiveTypes.length; primitiveTypeNdx++) {
+ var primitiveGroup = tcuTestCase.newTest(
+ 'array_element.' + bufferModes[bufferModeNdx].name + '.' + primitiveTypes[primitiveTypeNdx].name,
+ 'Capturing single array element in TF');
+ var primitiveType = primitiveTypes[primitiveTypeNdx].type;
+ testGroup.addChild(primitiveGroup);
+
+ for (var typeNdx = 0; typeNdx < basicTypes.length; typeNdx++) {
+ var type = basicTypes[typeNdx];
+ var isFloat = gluShaderUtil.getDataTypeScalarType(type) == gluShaderUtil.DataType.FLOAT;
+
+ for (var precNdx = 0; precNdx < precisions.length; precNdx++) {
+ var precision = precisions[precNdx];
+ var name = gluShaderUtil.getPrecisionName(precision) + '_' + gluShaderUtil.getDataTypeName(type);
+
+ primitiveGroup.addChild(new es3fTransformFeedbackTests.ArrayElementCase(
+ name,
+ '',
+ bufferMode,
+ primitiveType,
+ type,
+ precision,
+ isFloat ? es3fTransformFeedbackTests.interpolation.SMOOTH : es3fTransformFeedbackTests.interpolation.FLAT
+ ));
+ }
+ }
+ }
+ }
+
+ // .interpolation
+ for (var modeNdx = 0; modeNdx < interpModes.length; modeNdx++) {
+ var interp = interpModes[modeNdx].interp;
+ var modeGroup = tcuTestCase.newTest(
+ 'interpolation.' + interpModes[modeNdx].name,
+ 'Different interpolation modes in transform feedback varyings');
+ testGroup.addChild(modeGroup);
+
+ for (var precNdx = 0; precNdx < precisions.length; precNdx++) {
+ var precision = precisions[precNdx];
+
+ for (var primitiveType = 0; primitiveType < primitiveTypes.length; primitiveType++) {
+ for (var bufferMode = 0; bufferMode < bufferModes.length; bufferMode++) {
+ var name = (
+ gluShaderUtil.getPrecisionName(precision) +
+ '_vec4_' + primitiveTypes[primitiveType].name +
+ '_' + bufferModes[bufferMode].name
+ );
+
+ modeGroup.addChild(new es3fTransformFeedbackTests.BasicTypeCase(
+ name,
+ '',
+ bufferModes[bufferMode].mode,
+ primitiveTypes[primitiveType].type,
+ gluShaderUtil.DataType.FLOAT_VEC4,
+ precision,
+ interp
+ ));
+ }
+ }
+ }
+ }
+
+ // .random
+ for (var bufferModeNdx = 0; bufferModeNdx < bufferModes.length; bufferModeNdx++) {
+ /** @type {number} */
+ var bufferMode = bufferModes[bufferModeNdx].mode;
+ for (var primitiveTypeNdx = 0; primitiveTypeNdx < primitiveTypes.length; primitiveTypeNdx++) {
+ var primitiveGroup = tcuTestCase.newTest(
+ 'random.' + bufferModes[bufferModeNdx].name + '.' + primitiveTypes[primitiveTypeNdx].name,
+ 'Randomized transform feedback cases');
+ /** @type {number} */
+ var primitiveType = primitiveTypes[primitiveTypeNdx].type;
+ testGroup.addChild(primitiveGroup);
+
+ for (var ndx = 0; ndx < 10; ndx++) {
+ /** @type {number} */
+ var seed = deMath.deMathHash(bufferMode) ^ deMath.deMathHash(primitiveType) ^ deMath.deMathHash(ndx);
+
+ primitiveGroup.addChild(new es3fTransformFeedbackTests.RandomCase(
+ (ndx + 1).toString(),
+ '',
+ bufferMode,
+ primitiveType,
+ seed
+ ));
+ }
+ }
+ }
+
+ };
+
+ /**
+ * Create and execute the test cases
+ */
+ es3fTransformFeedbackTests.run = function(context, range) {
+ gl = context;
+ var testName = 'transform_feedback';
+ var testDescription = 'Transform Feedback Tests';
+ var state = tcuTestCase.runner;
+
+ state.testName = testName;
+ state.testCases = tcuTestCase.newTest(testName, testDescription, null);
+
+ //Set up name and description of this test series.
+ setCurrentTestName(testName);
+ description(testDescription);
+ try {
+ es3fTransformFeedbackTests.init();
+ if (range)
+ state.setRange(range);
+ tcuTestCase.runTestCases();
+ } catch (err) {
+ bufferedLogToConsole(err);
+ tcuTestCase.runner.terminate();
+ }
+
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fUniformApiTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fUniformApiTests.js
new file mode 100644
index 0000000000..59e50f1fc9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fUniformApiTests.js
@@ -0,0 +1,3203 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fUniformApiTests');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.opengl.gluDrawUtil');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluTexture');
+goog.require('framework.opengl.gluVarType');
+
+goog.scope(function() {
+
+ var es3fUniformApiTests = functional.gles3.es3fUniformApiTests;
+ var gluDrawUtil = framework.opengl.gluDrawUtil;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var gluShaderProgram = framework.opengl.gluShaderProgram;
+ var gluTexture = framework.opengl.gluTexture;
+ var gluVarType = framework.opengl.gluVarType;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var tcuSurface = framework.common.tcuSurface;
+ var tcuTexture = framework.common.tcuTexture;
+ var deMath = framework.delibs.debase.deMath;
+ var deString = framework.delibs.debase.deString;
+ var deRandom = framework.delibs.debase.deRandom;
+
+ /** @type {WebGL2RenderingContext} */ var gl;
+
+ /** @typedef {function(gluShaderUtil.DataType): boolean} */
+ es3fUniformApiTests.dataTypePredicate;
+
+ /** @type {number} */ es3fUniformApiTests.MAX_RENDER_WIDTH = 32;
+ /** @type {number} */ es3fUniformApiTests.MAX_RENDER_HEIGHT = 32;
+ /** @type {number} */ es3fUniformApiTests.MAX_NUM_SAMPLER_UNIFORMS = 16;
+
+ /** @type {Array<gluShaderUtil.DataType>} */ es3fUniformApiTests.s_testDataTypes = [
+ gluShaderUtil.DataType.FLOAT,
+ gluShaderUtil.DataType.FLOAT_VEC2,
+ gluShaderUtil.DataType.FLOAT_VEC3,
+ gluShaderUtil.DataType.FLOAT_VEC4,
+ gluShaderUtil.DataType.FLOAT_MAT2,
+ gluShaderUtil.DataType.FLOAT_MAT2X3,
+ gluShaderUtil.DataType.FLOAT_MAT2X4,
+ gluShaderUtil.DataType.FLOAT_MAT3X2,
+ gluShaderUtil.DataType.FLOAT_MAT3,
+ gluShaderUtil.DataType.FLOAT_MAT3X4,
+ gluShaderUtil.DataType.FLOAT_MAT4X2,
+ gluShaderUtil.DataType.FLOAT_MAT4X3,
+ gluShaderUtil.DataType.FLOAT_MAT4,
+
+ gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT_VEC2,
+ gluShaderUtil.DataType.INT_VEC3,
+ gluShaderUtil.DataType.INT_VEC4,
+
+ gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT_VEC2,
+ gluShaderUtil.DataType.UINT_VEC3,
+ gluShaderUtil.DataType.UINT_VEC4,
+
+ gluShaderUtil.DataType.BOOL,
+ gluShaderUtil.DataType.BOOL_VEC2,
+ gluShaderUtil.DataType.BOOL_VEC3,
+ gluShaderUtil.DataType.BOOL_VEC4,
+
+ gluShaderUtil.DataType.SAMPLER_2D,
+ gluShaderUtil.DataType.SAMPLER_CUBE
+ // \note We don't test all sampler types here.
+ ];
+
+ /**
+ * Returns a substring from the beginning to the last occurence of the
+ * specified character
+ * @param {string} str The string in which to search
+ * @param {string} c A single character
+ * @return {string}
+ */
+ es3fUniformApiTests.beforeLast = function(str, c) {
+ return str.substring(0, str.lastIndexOf(c));
+ };
+
+ /**
+ * es3fUniformApiTests.fillWithColor
+ * @param {tcuTexture.PixelBufferAccess} access ,
+ * @param {Array<number>} color Array of four color components.
+ */
+ es3fUniformApiTests.fillWithColor = function(access, color) {
+ for (var z = 0; z < access.getDepth(); z++)
+ for (var y = 0; y < access.getHeight(); y++)
+ for (var x = 0; x < access.getWidth(); x++)
+ access.setPixel(color, x, y, z);
+ };
+
+ /**
+ * @param {gluShaderUtil.DataType} type
+ * @return {number}
+ */
+ es3fUniformApiTests.getSamplerNumLookupDimensions = function(type) {
+ switch (type) {
+ case gluShaderUtil.DataType.SAMPLER_2D:
+ case gluShaderUtil.DataType.INT_SAMPLER_2D:
+ case gluShaderUtil.DataType.UINT_SAMPLER_2D:
+ return 2;
+
+ case gluShaderUtil.DataType.SAMPLER_3D:
+ case gluShaderUtil.DataType.INT_SAMPLER_3D:
+ case gluShaderUtil.DataType.UINT_SAMPLER_3D:
+ case gluShaderUtil.DataType.SAMPLER_2D_SHADOW:
+ case gluShaderUtil.DataType.SAMPLER_2D_ARRAY:
+ case gluShaderUtil.DataType.INT_SAMPLER_2D_ARRAY:
+ case gluShaderUtil.DataType.UINT_SAMPLER_2D_ARRAY:
+ case gluShaderUtil.DataType.SAMPLER_CUBE:
+ case gluShaderUtil.DataType.INT_SAMPLER_CUBE:
+ case gluShaderUtil.DataType.UINT_SAMPLER_CUBE:
+ return 3;
+
+ case gluShaderUtil.DataType.SAMPLER_CUBE_SHADOW:
+ case gluShaderUtil.DataType.SAMPLER_2D_ARRAY_SHADOW:
+ return 4;
+
+ default:
+ throw new Error('es3fUniformApiTests.getSamplerNumLookupDimensions - Invalid type');
+ }
+ };
+
+ /**
+ * @param {gluShaderUtil.DataType} type
+ * @return {gluShaderUtil.DataType}
+ */
+ es3fUniformApiTests.getSamplerLookupReturnType = function(type) {
+ switch (type) {
+ case gluShaderUtil.DataType.SAMPLER_2D:
+ case gluShaderUtil.DataType.SAMPLER_CUBE:
+ case gluShaderUtil.DataType.SAMPLER_2D_ARRAY:
+ case gluShaderUtil.DataType.SAMPLER_3D:
+ return gluShaderUtil.DataType.FLOAT_VEC4;
+
+ case gluShaderUtil.DataType.UINT_SAMPLER_2D:
+ case gluShaderUtil.DataType.UINT_SAMPLER_CUBE:
+ case gluShaderUtil.DataType.UINT_SAMPLER_2D_ARRAY:
+ case gluShaderUtil.DataType.UINT_SAMPLER_3D:
+ return gluShaderUtil.DataType.UINT_VEC4;
+
+ case gluShaderUtil.DataType.INT_SAMPLER_2D:
+ case gluShaderUtil.DataType.INT_SAMPLER_CUBE:
+ case gluShaderUtil.DataType.INT_SAMPLER_2D_ARRAY:
+ case gluShaderUtil.DataType.INT_SAMPLER_3D:
+ return gluShaderUtil.DataType.INT_VEC4;
+
+ case gluShaderUtil.DataType.SAMPLER_2D_SHADOW:
+ case gluShaderUtil.DataType.SAMPLER_CUBE_SHADOW:
+ case gluShaderUtil.DataType.SAMPLER_2D_ARRAY_SHADOW:
+ return gluShaderUtil.DataType.FLOAT;
+
+ default:
+ throw new Error('es3fUniformApiTests.getSamplerLookupReturnType - Invalid type');
+ }
+ };
+
+ /**
+ * @param {gluShaderUtil.DataType} T DataType to compare the type. Used to be a template param
+ * @param {gluShaderUtil.DataType} t
+ * @return {boolean}
+ */
+ es3fUniformApiTests.dataTypeEquals = function(T, t) {
+ return t == T;
+ };
+
+ /**
+ * @param {number} N Row number. Used to be a template parameter
+ * @param {gluShaderUtil.DataType} t
+ * @return {boolean}
+ */
+ es3fUniformApiTests.dataTypeIsMatrixWithNRows = function(N, t) {
+ return gluShaderUtil.isDataTypeMatrix(t) && gluShaderUtil.getDataTypeMatrixNumRows(t) == N;
+ };
+
+ /**
+ * @param {gluVarType.VarType} type
+ * @param {es3fUniformApiTests.dataTypePredicate} predicate
+ * @return {boolean}
+ */
+ es3fUniformApiTests.typeContainsMatchingBasicType = function(type, predicate) {
+ if (type.isBasicType())
+ return predicate(type.getBasicType());
+ else if (type.isArrayType())
+ return es3fUniformApiTests.typeContainsMatchingBasicType(type.getElementType(), predicate);
+ else {
+ assertMsgOptions(type.isStructType(), 'es3fUniformApiTests.typeContainsMatchingBasicType - not a struct type', false, true);
+ /** @type {gluVarType.StructType} */ var structType = type.getStruct();
+ for (var i = 0; i < structType.getSize(); i++)
+ if (es3fUniformApiTests.typeContainsMatchingBasicType(structType.getMember(i).getType(), predicate))
+ return true;
+ return false;
+ }
+ };
+
+ /**
+ * @param {Array<gluShaderUtil.DataType>} dst
+ * @param {gluVarType.VarType} type
+ */
+ es3fUniformApiTests.getDistinctSamplerTypes = function(dst, type) {
+ if (type.isBasicType()) {
+ /** @type {gluShaderUtil.DataType} */ var basicType = type.getBasicType();
+ if (gluShaderUtil.isDataTypeSampler(basicType) && dst.indexOf(basicType) == -1)
+ dst.push(basicType);
+ } else if (type.isArrayType())
+ es3fUniformApiTests.getDistinctSamplerTypes(dst, type.getElementType());
+ else {
+ assertMsgOptions(type.isStructType(), 'es3fUniformApiTests.getDistinctSamplerTypes - not a struct type', false, true);
+ /** @type {gluVarType.StructType} */ var structType = type.getStruct();
+ for (var i = 0; i < structType.getSize(); i++)
+ es3fUniformApiTests.getDistinctSamplerTypes(dst, structType.getMember(i).getType());
+ }
+ };
+
+ /**
+ * @param {gluVarType.VarType} type
+ * @return {number}
+ */
+ es3fUniformApiTests.getNumSamplersInType = function(type) {
+ if (type.isBasicType())
+ return gluShaderUtil.isDataTypeSampler(type.getBasicType()) ? 1 : 0;
+ else if (type.isArrayType())
+ return es3fUniformApiTests.getNumSamplersInType(type.getElementType()) * type.getArraySize();
+ else {
+ assertMsgOptions(type.isStructType(), 'es3fUniformApiTests.getNumSamplersInType - not a struct type', false, true);
+ /** @type {gluVarType.StructType} */ var structType = type.getStruct();
+ /** @type {number} */ var sum = 0;
+ for (var i = 0; i < structType.getSize(); i++)
+ sum += es3fUniformApiTests.getNumSamplersInType(structType.getMember(i).getType());
+ return sum;
+ }
+ };
+
+ /** @typedef { {type: gluVarType.VarType, ndx: number}} */
+ es3fUniformApiTests.VarTypeWithIndex;
+
+ /**
+ * @param {number} maxDepth
+ * @param {number} curStructIdx Out parameter, instead returning it in the VarTypeWithIndex structure.
+ * @param {Array<gluVarType.StructType>} structTypesDst
+ * @param {deRandom.Random} rnd
+ * @return {es3fUniformApiTests.VarTypeWithIndex}
+ */
+ es3fUniformApiTests.generateRandomType = function(maxDepth, curStructIdx, structTypesDst, rnd) {
+ /** @type {boolean} */ var isStruct = maxDepth > 0 && rnd.getFloat() < 0.2;
+ /** @type {boolean} */ var isArray = rnd.getFloat() < 0.3;
+
+ if (isStruct) {
+ /** @type {number} */ var numMembers = rnd.getInt(1, 5);
+ /** @type {gluVarType.StructType} */ var structType = gluVarType.newStructType('structType' + curStructIdx++);
+
+ for (var i = 0; i < numMembers; i++) {
+ /** @type {es3fUniformApiTests.VarTypeWithIndex} */ var typeWithIndex = es3fUniformApiTests.generateRandomType(maxDepth - 1, curStructIdx, structTypesDst, rnd);
+ curStructIdx = typeWithIndex.ndx;
+ structType.addMember('m' + i, typeWithIndex.type);
+ }
+
+ structTypesDst.push(structType);
+ return (isArray ? {
+ type: gluVarType.newTypeArray(gluVarType.newTypeStruct(structType), rnd.getInt(1, 5)),
+ ndx: curStructIdx
+ }
+ : {
+ type: gluVarType.newTypeStruct(structType),
+ ndx: curStructIdx
+ });
+ } else {
+ /** @type {gluShaderUtil.DataType} */ var basicType = es3fUniformApiTests.s_testDataTypes[rnd.getInt(0, es3fUniformApiTests.s_testDataTypes.length - 1)];
+ /** @type {gluShaderUtil.precision} */ var precision;
+ if (!gluShaderUtil.isDataTypeBoolOrBVec(basicType))
+ precision = gluShaderUtil.precision.PRECISION_MEDIUMP;
+ return (isArray ? {
+ type: gluVarType.newTypeArray(gluVarType.newTypeBasic(basicType, precision), rnd.getInt(1, 5)),
+ ndx: curStructIdx
+ }
+ : {
+ type: gluVarType.newTypeBasic(basicType, precision),
+ ndx: curStructIdx
+ });
+ }
+ };
+
+ /**
+ * es3fUniformApiTests.SamplerV structure
+ * @constructor
+ */
+ es3fUniformApiTests.SamplerV = function() {
+ this.samplerV = {
+ /** @type {number} */ unit: 0,
+ /** @type {Array<number>} */ fillColor: []
+ };
+ };
+
+ /**
+ * es3fUniformApiTests.VarValue class. may contain different types.
+ * @constructor
+ */
+ es3fUniformApiTests.VarValue = function() {
+ /** @type {gluShaderUtil.DataType} */ this.type;
+ /** @type {Array<number | boolean> | es3fUniformApiTests.SamplerV} */ this.val = [];
+ };
+
+ /**
+ * @enum {number}
+ */
+ es3fUniformApiTests.CaseShaderType = {
+ VERTEX: 0,
+ FRAGMENT: 1,
+ BOTH: 2
+ };
+
+ /**
+ * es3fUniformApiTests.Uniform struct.
+ * @param {string} name_
+ * @param {gluVarType.VarType} type_
+ * @constructor
+ */
+ es3fUniformApiTests.Uniform = function(name_, type_) {
+ /** @type {string} */ this.name = name_;
+ /** @type {gluVarType.VarType} */ this.type = type_;
+ };
+
+ // A set of uniforms, along with related struct types.
+ /**
+ * class es3fUniformApiTests.UniformCollection
+ * @constructor
+ */
+ es3fUniformApiTests.UniformCollection = function() {
+ /** @type {Array<es3fUniformApiTests.Uniform>} */ this.m_uniforms = [];
+ /** @type {Array<gluVarType.StructType>} */ this.m_structTypes = [];
+ };
+
+ /**
+ * @return {number}
+ */
+ es3fUniformApiTests.UniformCollection.prototype.getNumUniforms = function() {return this.m_uniforms.length;};
+
+ /**
+ * @return {number}
+ */
+ es3fUniformApiTests.UniformCollection.prototype.getNumStructTypes = function() {return this.m_structTypes.length;};
+
+ /**
+ * @param {number} ndx
+ * @return {es3fUniformApiTests.Uniform}
+ */
+ es3fUniformApiTests.UniformCollection.prototype.getUniform = function(ndx) {return this.m_uniforms[ndx];};
+
+ /**
+ * @param {number} ndx
+ * @return {gluVarType.StructType}
+ */
+ es3fUniformApiTests.UniformCollection.prototype.getStructType = function(ndx) {return this.m_structTypes[ndx];};
+
+ /**
+ * @param {es3fUniformApiTests.Uniform} uniform
+ */
+ es3fUniformApiTests.UniformCollection.prototype.addUniform = function(uniform) {this.m_uniforms.push(uniform);};
+
+ /**
+ * @param {gluVarType.StructType} type
+ */
+ es3fUniformApiTests.UniformCollection.prototype.addStructType = function(type) {this.m_structTypes.push(type);};
+
+ // Add the contents of m_uniforms and m_structTypes to receiver, and remove them from this one.
+ // \note receiver takes ownership of the struct types.
+ /**
+ * @param {es3fUniformApiTests.UniformCollection} receiver
+ */
+ es3fUniformApiTests.UniformCollection.prototype.moveContents = function(receiver) {
+ for (var i = 0; i < this.m_uniforms.length; i++)
+ receiver.addUniform(this.m_uniforms[i]);
+ this.m_uniforms.length = 0;
+
+ for (var i = 0; i < this.m_structTypes.length; i++)
+ receiver.addStructType(this.m_structTypes[i]);
+ this.m_structTypes.length = 0;
+ };
+
+ /**
+ * @param {es3fUniformApiTests.dataTypePredicate} predicate
+ * @return {boolean}
+ */
+ es3fUniformApiTests.UniformCollection.prototype.containsMatchingBasicType = function(predicate) {
+ for (var i = 0; i < this.m_uniforms.length; i++)
+ if (es3fUniformApiTests.typeContainsMatchingBasicType(this.m_uniforms[i].type, predicate))
+ return true;
+ return false;
+ };
+
+ /**
+ * @return {Array<gluShaderUtil.DataType>}
+ */
+ es3fUniformApiTests.UniformCollection.prototype.getSamplerTypes = function() {
+ /** @type {Array<gluShaderUtil.DataType>} */ var samplerTypes = [];
+ for (var i = 0; i < this.m_uniforms.length; i++)
+ es3fUniformApiTests.getDistinctSamplerTypes(samplerTypes, this.m_uniforms[i].type);
+ return samplerTypes;
+ };
+
+ /**
+ * @return {boolean}
+ */
+ es3fUniformApiTests.UniformCollection.prototype.containsSeveralSamplerTypes = function() {
+ return this.getSamplerTypes().length > 1;
+ };
+
+ /**
+ * @return {number}
+ */
+ es3fUniformApiTests.UniformCollection.prototype.getNumSamplers = function() {
+ var sum = 0;
+ for (var i = 0; i < this.m_uniforms.length; i++)
+ sum += es3fUniformApiTests.getNumSamplersInType(this.m_uniforms[i].type);
+ return sum;
+ };
+
+ /**
+ * @param {gluShaderUtil.DataType} type
+ * @param {string=} nameSuffix
+ * @return {es3fUniformApiTests.UniformCollection}
+ */
+ es3fUniformApiTests.UniformCollection.basic = function(type, nameSuffix) {
+ if (nameSuffix === undefined) nameSuffix = '';
+ /** @type {es3fUniformApiTests.UniformCollection} */ var res = new es3fUniformApiTests.UniformCollection();
+ /** @type {gluShaderUtil.precision} */ var prec;
+ if (!gluShaderUtil.isDataTypeBoolOrBVec(type))
+ prec = gluShaderUtil.precision.PRECISION_MEDIUMP;
+ res.m_uniforms.push(new es3fUniformApiTests.Uniform('u_var' + nameSuffix, gluVarType.newTypeBasic(type, prec)));
+ return res;
+ };
+
+ /**
+ * @param {gluShaderUtil.DataType} type
+ * @param {string=} nameSuffix
+ * @return {es3fUniformApiTests.UniformCollection}
+ */
+ es3fUniformApiTests.UniformCollection.basicArray = function(type, nameSuffix) {
+ if (nameSuffix === undefined) nameSuffix = '';
+ /** @type {es3fUniformApiTests.UniformCollection} */ var res = new es3fUniformApiTests.UniformCollection();
+ /** @type {gluShaderUtil.precision} */ var prec;
+ if (!gluShaderUtil.isDataTypeBoolOrBVec(type))
+ prec = gluShaderUtil.precision.PRECISION_MEDIUMP;
+ res.m_uniforms.push(new es3fUniformApiTests.Uniform('u_var' + nameSuffix, gluVarType.newTypeArray(gluVarType.newTypeBasic(type, prec), 3)));
+ return res;
+ };
+
+ /**
+ * @param {gluShaderUtil.DataType} type0
+ * @param {gluShaderUtil.DataType} type1
+ * @param {boolean} containsArrays
+ * @param {string=} nameSuffix
+ * @return {es3fUniformApiTests.UniformCollection}
+ */
+ es3fUniformApiTests.UniformCollection.basicStruct = function(type0, type1, containsArrays, nameSuffix) {
+ if (nameSuffix === undefined) nameSuffix = '';
+ /** @type {es3fUniformApiTests.UniformCollection} */ var res = new es3fUniformApiTests.UniformCollection();
+ /** @type {gluShaderUtil.precision} */ var prec0;
+ if (!gluShaderUtil.isDataTypeBoolOrBVec(type0))
+ prec0 = gluShaderUtil.precision.PRECISION_MEDIUMP;
+ /** @type {gluShaderUtil.precision} */ var prec1;
+ if (!gluShaderUtil.isDataTypeBoolOrBVec(type1))
+ prec1 = gluShaderUtil.precision.PRECISION_MEDIUMP;
+
+ /** @type {gluVarType.StructType} */ var structType = gluVarType.newStructType('structType' + nameSuffix);
+ structType.addMember('m0', gluVarType.newTypeBasic(type0, prec0));
+ structType.addMember('m1', gluVarType.newTypeBasic(type1, prec1));
+ if (containsArrays) {
+ structType.addMember('m2', gluVarType.newTypeArray(gluVarType.newTypeBasic(type0, prec0), 3));
+ structType.addMember('m3', gluVarType.newTypeArray(gluVarType.newTypeBasic(type1, prec1), 3));
+ }
+
+ res.addStructType(structType);
+ res.addUniform(new es3fUniformApiTests.Uniform('u_var' + nameSuffix, gluVarType.newTypeStruct(structType)));
+
+ return res;
+ };
+
+ /**
+ * @param {gluShaderUtil.DataType} type0
+ * @param {gluShaderUtil.DataType} type1
+ * @param {boolean} containsArrays
+ * @param {string=} nameSuffix
+ * @return {es3fUniformApiTests.UniformCollection}
+ */
+ es3fUniformApiTests.UniformCollection.structInArray = function(type0, type1, containsArrays, nameSuffix) {
+ if (nameSuffix === undefined) nameSuffix = '';
+ /** @type {es3fUniformApiTests.UniformCollection} */ var res = es3fUniformApiTests.UniformCollection.basicStruct(type0, type1, containsArrays, nameSuffix);
+ res.getUniform(0).type = gluVarType.newTypeArray(res.getUniform(0).type, 3);
+ return res;
+ };
+
+ /**
+ * @param {gluShaderUtil.DataType} type0
+ * @param {gluShaderUtil.DataType} type1
+ * @param {string=} nameSuffix
+ * @return {es3fUniformApiTests.UniformCollection}
+ */
+ es3fUniformApiTests.UniformCollection.nestedArraysStructs = function(type0, type1, nameSuffix) {
+ if (nameSuffix === undefined) nameSuffix = '';
+ /** @type {es3fUniformApiTests.UniformCollection} */ var res = new es3fUniformApiTests.UniformCollection();
+ /** @type {gluShaderUtil.precision} */ var prec0;
+ if (!gluShaderUtil.isDataTypeBoolOrBVec(type0))
+ prec0 = gluShaderUtil.precision.PRECISION_MEDIUMP;
+ /** @type {gluShaderUtil.precision} */ var prec1;
+ if (!gluShaderUtil.isDataTypeBoolOrBVec(type1))
+ prec1 = gluShaderUtil.precision.PRECISION_MEDIUMP;
+ /** @type {gluVarType.StructType} */ var structType = gluVarType.newStructType('structType' + nameSuffix);
+ /** @type {gluVarType.StructType} */ var subStructType = gluVarType.newStructType('subStructType' + nameSuffix);
+ /** @type {gluVarType.StructType} */ var subSubStructType = gluVarType.newStructType('subSubStructType' + nameSuffix);
+
+ subSubStructType.addMember('mss0', gluVarType.newTypeBasic(type0, prec0));
+ subSubStructType.addMember('mss1', gluVarType.newTypeBasic(type1, prec1));
+
+ subStructType.addMember('ms0', gluVarType.newTypeBasic(type1, prec1));
+ subStructType.addMember('ms1', gluVarType.newTypeArray(gluVarType.newTypeBasic(type0, prec0), 2));
+ subStructType.addMember('ms2', gluVarType.newTypeArray(gluVarType.newTypeStruct(subSubStructType), 2));
+
+ structType.addMember('m0', gluVarType.newTypeBasic(type0, prec0));
+ structType.addMember('m1', gluVarType.newTypeStruct(subStructType));
+ structType.addMember('m2', gluVarType.newTypeBasic(type1, prec1));
+
+ res.addStructType(subSubStructType);
+ res.addStructType(subStructType);
+ res.addStructType(structType);
+
+ res.addUniform(new es3fUniformApiTests.Uniform('u_var' + nameSuffix, gluVarType.newTypeStruct(structType)));
+
+ return res;
+ };
+
+ /**
+ * @param {string=} nameSuffix
+ * @return {es3fUniformApiTests.UniformCollection}
+ */
+ es3fUniformApiTests.UniformCollection.multipleBasic = function(nameSuffix) {
+ if (nameSuffix === undefined) nameSuffix = '';
+ /** @type {Array<gluShaderUtil.DataType>} */ var types = [gluShaderUtil.DataType.FLOAT, gluShaderUtil.DataType.INT_VEC3, gluShaderUtil.DataType.UINT_VEC4, gluShaderUtil.DataType.FLOAT_MAT3, gluShaderUtil.DataType.BOOL_VEC2];
+ /** @type {es3fUniformApiTests.UniformCollection} */ var res = new es3fUniformApiTests.UniformCollection();
+
+ for (var i = 0; i < types.length; i++) {
+ /** @type {es3fUniformApiTests.UniformCollection} */ var sub = es3fUniformApiTests.UniformCollection.basic(types[i], '_' + i + nameSuffix);
+ sub.moveContents(res);
+ }
+
+ return res;
+ };
+
+ /**
+ * @param {string=} nameSuffix
+ * @return {es3fUniformApiTests.UniformCollection}
+ */
+ es3fUniformApiTests.UniformCollection.multipleBasicArray = function(nameSuffix) {
+ if (nameSuffix === undefined) nameSuffix = '';
+ /** @type {Array<gluShaderUtil.DataType>} */ var types = [gluShaderUtil.DataType.FLOAT, gluShaderUtil.DataType.INT_VEC3, gluShaderUtil.DataType.BOOL_VEC2];
+ /** @type {es3fUniformApiTests.UniformCollection} */ var res = new es3fUniformApiTests.UniformCollection();
+
+ for (var i = 0; i < types.length; i++) {
+ /** @type {es3fUniformApiTests.UniformCollection} */ var sub = es3fUniformApiTests.UniformCollection.basicArray(types[i], '_' + i + nameSuffix);
+ sub.moveContents(res);
+ }
+
+ return res;
+ };
+
+ /**
+ * @param {string=} nameSuffix
+ * @return {es3fUniformApiTests.UniformCollection}
+ */
+ es3fUniformApiTests.UniformCollection.multipleNestedArraysStructs = function(nameSuffix) {
+ if (nameSuffix === undefined) nameSuffix = '';
+ /** @type {Array<gluShaderUtil.DataType>} */ var types0 = [gluShaderUtil.DataType.FLOAT, gluShaderUtil.DataType.INT, gluShaderUtil.DataType.BOOL_VEC4];
+ /** @type {Array<gluShaderUtil.DataType>} */ var types1 = [gluShaderUtil.DataType.FLOAT_VEC4, gluShaderUtil.DataType.INT_VEC4, gluShaderUtil.DataType.BOOL];
+ /** @type {es3fUniformApiTests.UniformCollection} */ var res = new es3fUniformApiTests.UniformCollection();
+
+ assertMsgOptions(types0.length == types1.length, 'es3fUniformApiTests.UniformCollection.multipleNestedArraysStructs - lengths are not the same', false, true);
+
+ for (var i = 0; i < types0.length; i++) {
+ /** @type {es3fUniformApiTests.UniformCollection} */ var sub = es3fUniformApiTests.UniformCollection.nestedArraysStructs(types0[i], types1[i], '_' + i + nameSuffix);
+ sub.moveContents(res);
+ }
+
+ return res;
+ };
+
+ /**
+ * @param {number} seed
+ * @return {es3fUniformApiTests.UniformCollection}
+ */
+ es3fUniformApiTests.UniformCollection.random = function(seed) {
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(seed);
+ /** @type {number} */ var numUniforms = rnd.getInt(1, 5);
+ /** @type {number} */ var structIdx = 0;
+ /** @type {es3fUniformApiTests.UniformCollection} */ var res = new es3fUniformApiTests.UniformCollection();
+
+ for (var i = 0; i < numUniforms; i++) {
+ /** @type {Array<gluVarType.StructType>} */ var structTypes = [];
+ /** @type {es3fUniformApiTests.Uniform} */ var uniform = new es3fUniformApiTests.Uniform('u_var' + i, new gluVarType.VarType());
+
+ // \note Discard uniforms that would cause number of samplers to exceed es3fUniformApiTests.MAX_NUM_SAMPLER_UNIFORMS.
+ do {
+ var temp = es3fUniformApiTests.generateRandomType(3, structIdx, structTypes, rnd);
+ structIdx = temp.ndx;
+ uniform.type = temp.type;
+ } while (res.getNumSamplers() + es3fUniformApiTests.getNumSamplersInType(uniform.type) > es3fUniformApiTests.MAX_NUM_SAMPLER_UNIFORMS);
+
+ res.addUniform(uniform);
+ for (var j = 0; j < structTypes.length; j++)
+ res.addStructType(structTypes[j]);
+ }
+
+ return res;
+ };
+
+ /**
+ * @param {es3fUniformApiTests.VarValue} sampler
+ * @return {es3fUniformApiTests.VarValue}
+ */
+ es3fUniformApiTests.getSamplerFillValue = function(sampler) {
+ assertMsgOptions(gluShaderUtil.isDataTypeSampler(sampler.type), 'es3fUniformApiTests.getSamplerFillValue - not a sampler type', false, true);
+
+ /** @type {es3fUniformApiTests.VarValue} */ var result = new es3fUniformApiTests.VarValue();
+ result.type = es3fUniformApiTests.getSamplerLookupReturnType(sampler.type);
+
+ switch (result.type) {
+ case gluShaderUtil.DataType.FLOAT_VEC4:
+ for (var i = 0; i < 4; i++)
+ result.val[i] = sampler.val.samplerV.fillColor[i];
+ break;
+ case gluShaderUtil.DataType.UINT_VEC4:
+ for (var i = 0; i < 4; i++)
+ result.val[i] = sampler.val.samplerV.fillColor[i];
+ break;
+ case gluShaderUtil.DataType.INT_VEC4:
+ for (var i = 0; i < 4; i++)
+ result.val[i] = sampler.val.samplerV.fillColor[i];
+ break;
+ case gluShaderUtil.DataType.FLOAT:
+ result.val[0] = sampler.val.samplerV.fillColor[0];
+ break;
+ default:
+ throw new Error('es3fUniformApiTests.getSamplerFillValue - Invalid type');
+ }
+
+ return result;
+ };
+
+ /**
+ * @param {es3fUniformApiTests.VarValue} sampler
+ * @return {es3fUniformApiTests.VarValue}
+ */
+ es3fUniformApiTests.getSamplerUnitValue = function(sampler) {
+ assertMsgOptions(gluShaderUtil.isDataTypeSampler(sampler.type), 'es3fUniformApiTests.getSamplerUnitValue - not a sampler type', false, true);
+
+ /** @type {es3fUniformApiTests.VarValue} */ var result = new es3fUniformApiTests.VarValue();
+ result.type = gluShaderUtil.DataType.INT;
+ result.val[0] = sampler.val.samplerV.unit;
+
+ return result;
+ };
+
+ /**
+ * @param {gluShaderUtil.DataType} original
+ * @return {gluShaderUtil.DataType}
+ */
+ es3fUniformApiTests.getDataTypeTransposedMatrix = function(original) {
+ return gluShaderUtil.getDataTypeMatrix(gluShaderUtil.getDataTypeMatrixNumRows(original), gluShaderUtil.getDataTypeMatrixNumColumns(original));
+ };
+
+ /**
+ * @param {es3fUniformApiTests.VarValue} original
+ * @return {es3fUniformApiTests.VarValue}
+ */
+ es3fUniformApiTests.getTransposeMatrix = function(original) {
+ assertMsgOptions(gluShaderUtil.isDataTypeMatrix(original.type), 'es3fUniformApiTests.getTransposeMatrix - not a matrix', false, true);
+
+ /** @type {number} */ var rows = gluShaderUtil.getDataTypeMatrixNumRows(original.type);
+ /** @type {number} */ var cols = gluShaderUtil.getDataTypeMatrixNumColumns(original.type);
+ /** @type {es3fUniformApiTests.VarValue} */ var result = new es3fUniformApiTests.VarValue();
+ result.type = es3fUniformApiTests.getDataTypeTransposedMatrix(original.type);
+
+ for (var i = 0; i < rows; i++)
+ for (var j = 0; j < cols; j++)
+ result.val[i * cols + j] = original.val[j * rows + i];
+
+ return result;
+ };
+
+ /**
+ * @param {es3fUniformApiTests.VarValue} value
+ * @return {string}
+ */
+ es3fUniformApiTests.shaderVarValueStr = function(value) {
+ /** @type {number} */ var numElems = gluShaderUtil.getDataTypeScalarSize(value.type);
+ /** @type {string} */ var result = '';
+
+ if (numElems > 1)
+ result += gluShaderUtil.getDataTypeName(value.type) + '(';
+
+ for (var i = 0; i < numElems; i++) {
+ if (i > 0)
+ result += ', ';
+
+ if (gluShaderUtil.isDataTypeFloatOrVec(value.type) || gluShaderUtil.isDataTypeMatrix(value.type))
+ result += value.val[i].toFixed(2);
+ else if (gluShaderUtil.isDataTypeIntOrIVec((value.type)))
+ result += value.val[i];
+ else if (gluShaderUtil.isDataTypeUintOrUVec((value.type)))
+ result += value.val[i] + 'u';
+ else if (gluShaderUtil.isDataTypeBoolOrBVec((value.type)))
+ result += value.val[i] ? 'true' : 'false';
+ else if (gluShaderUtil.isDataTypeSampler((value.type)))
+ result += es3fUniformApiTests.shaderVarValueStr(es3fUniformApiTests.getSamplerFillValue(value));
+ else
+ throw new Error('es3fUniformApiTests.shaderVarValueStr - invalid type');
+ }
+
+ if (numElems > 1)
+ result += ')';
+
+ return result;
+ };
+
+ /**
+ * @param {es3fUniformApiTests.VarValue} value
+ * @return {string}
+ */
+ es3fUniformApiTests.apiVarValueStr = function(value) {
+ /** @type {number} */ var numElems = gluShaderUtil.getDataTypeScalarSize(value.type);
+ /** @type {string} */ var result = '';
+
+ if (numElems > 1)
+ result += '(';
+
+ for (var i = 0; i < numElems; i++) {
+ if (i > 0)
+ result += ', ';
+
+ if (gluShaderUtil.isDataTypeFloatOrVec(value.type) || gluShaderUtil.isDataTypeMatrix(value.type))
+ result += value.val[i].toFixed(2);
+ else if (gluShaderUtil.isDataTypeIntOrIVec(value.type) ||
+ gluShaderUtil.isDataTypeUintOrUVec(value.type))
+ result += value.val[i];
+ else if (gluShaderUtil.isDataTypeBoolOrBVec(value.type))
+ result += value.val[i] ? 'true' : 'false';
+ else if (gluShaderUtil.isDataTypeSampler(value.type))
+ result += value.val.samplerV.unit;
+ else
+ throw new Error('es3fUniformApiTests.apiVarValueStr - Invalid type');
+ }
+
+ if (numElems > 1)
+ result += ')';
+
+ return result;
+ };
+
+ // samplerUnit used if type is a sampler type. \note Samplers' unit numbers are not randomized.
+ /**
+ * @param {gluShaderUtil.DataType} type
+ * @param {deRandom.Random} rnd
+ * @param {number=} samplerUnit
+ * @return {es3fUniformApiTests.VarValue}
+ */
+ es3fUniformApiTests.generateRandomVarValue = function(type, rnd, samplerUnit) {
+ if (samplerUnit === undefined) samplerUnit = -1;
+ /** @type {number} */ var numElems = gluShaderUtil.getDataTypeScalarSize(type);
+ /** @type {es3fUniformApiTests.VarValue} */ var result = new es3fUniformApiTests.VarValue();
+ result.type = type;
+
+ assertMsgOptions(
+ (samplerUnit >= 0) == (gluShaderUtil.isDataTypeSampler(type)),
+ 'es3fUniformApiTests.generateRandomVarValue - sampler units do not match type', false, true
+ );
+
+ if (gluShaderUtil.isDataTypeFloatOrVec(type) || gluShaderUtil.isDataTypeMatrix(type)) {
+ for (var i = 0; i < numElems; i++)
+ result.val[i] = rnd.getFloat(-10.0, 10.0);
+ } else if (gluShaderUtil.isDataTypeIntOrIVec(type)) {
+ for (var i = 0; i < numElems; i++)
+ result.val[i] = rnd.getInt(-10, 10);
+ } else if (gluShaderUtil.isDataTypeUintOrUVec(type)) {
+ for (var i = 0; i < numElems; i++)
+ result.val[i] = rnd.getInt(0, 10);
+ } else if (gluShaderUtil.isDataTypeBoolOrBVec(type)) {
+ for (var i = 0; i < numElems; i++)
+ result.val[i] = rnd.getBool();
+ } else if (gluShaderUtil.isDataTypeSampler(type)) {
+ /** @type {gluShaderUtil.DataType} */ var texResultType = es3fUniformApiTests.getSamplerLookupReturnType(type);
+ /** @type {gluShaderUtil.DataType} */ var texResultScalarType = gluShaderUtil.getDataTypeScalarTypeAsDataType(texResultType);
+ /** @type {number} */ var texResultNumDims = gluShaderUtil.getDataTypeScalarSize(texResultType);
+
+ result.val = new es3fUniformApiTests.SamplerV();
+ result.val.samplerV.unit = samplerUnit;
+
+ for (var i = 0; i < texResultNumDims; i++) {
+ switch (texResultScalarType) {
+ case gluShaderUtil.DataType.FLOAT: result.val.samplerV.fillColor[i] = rnd.getFloat(0.0, 1.0); break;
+ case gluShaderUtil.DataType.INT: result.val.samplerV.fillColor[i] = rnd.getInt(-10, 10); break;
+ case gluShaderUtil.DataType.UINT: result.val.samplerV.fillColor[i] = rnd.getInt(0, 10); break;
+ default:
+ throw new Error('es3fUniformApiTests.generateRandomVarValue - Invalid scalar type');
+ }
+ }
+ } else
+ throw new Error('es3fUniformApiTests.generateRandomVarValue - Invalid type');
+
+ return result;
+ };
+
+ /**
+ * @param {gluShaderUtil.DataType} type
+ * @return {es3fUniformApiTests.VarValue}
+ */
+ es3fUniformApiTests.generateZeroVarValue = function(type) {
+ /** @type {number} */ var numElems = gluShaderUtil.getDataTypeScalarSize(type);
+ /** @type {es3fUniformApiTests.VarValue} */ var result = new es3fUniformApiTests.VarValue();
+ result.type = type;
+
+ if (gluShaderUtil.isDataTypeFloatOrVec(type) || gluShaderUtil.isDataTypeMatrix(type)) {
+ for (var i = 0; i < numElems; i++)
+ result.val[i] = 0.0;
+ } else if (gluShaderUtil.isDataTypeIntOrIVec(type)) {
+ for (var i = 0; i < numElems; i++)
+ result.val[i] = 0;
+ } else if (gluShaderUtil.isDataTypeUintOrUVec(type)) {
+ for (var i = 0; i < numElems; i++)
+ result.val[i] = 0;
+ } else if (gluShaderUtil.isDataTypeBoolOrBVec(type)) {
+ for (var i = 0; i < numElems; i++)
+ result.val[i] = false;
+ } else if (gluShaderUtil.isDataTypeSampler(type)) {
+ /** @type {gluShaderUtil.DataType} */ var texResultType = es3fUniformApiTests.getSamplerLookupReturnType(type);
+ /** @type {gluShaderUtil.DataType} */ var texResultScalarType = gluShaderUtil.getDataTypeScalarTypeAsDataType(texResultType);
+ /** @type {number} */ var texResultNumDims = gluShaderUtil.getDataTypeScalarSize(texResultType);
+
+ result.val = new es3fUniformApiTests.SamplerV();
+ result.val.samplerV.unit = 0;
+
+ for (var i = 0; i < texResultNumDims; i++) {
+ switch (texResultScalarType) {
+ case gluShaderUtil.DataType.FLOAT: result.val.samplerV.fillColor[i] = 0.12 * i; break;
+ case gluShaderUtil.DataType.INT: result.val.samplerV.fillColor[i] = -2 + i; break;
+ case gluShaderUtil.DataType.UINT: result.val.samplerV.fillColor[i] = 4 + i; break;
+ default:
+ throw new Error('es3fUniformApiTests.generateZeroVarValue - Invalid scalar type');
+ }
+ }
+ } else
+ throw new Error('es3fUniformApiTests.generateZeroVarValue - Invalid type');
+
+ return result;
+ };
+
+ /**
+ * @param {es3fUniformApiTests.VarValue} a
+ * @param {es3fUniformApiTests.VarValue} b
+ * @return {boolean}
+ */
+ es3fUniformApiTests.apiVarValueEquals = function(a, b) {
+ /** @type {number} */ var size = gluShaderUtil.getDataTypeScalarSize(a.type);
+ /** @type {number} */ var floatThreshold = 0.05;
+
+ assertMsgOptions(a.type == b.type, 'es3fUniformApiTests.apiVarValueEquals - types are different', false, true);
+
+ if (gluShaderUtil.isDataTypeFloatOrVec(a.type) || gluShaderUtil.isDataTypeMatrix(a.type)) {
+ for (var i = 0; i < size; i++)
+ if (Math.abs(a.val[i] - b.val[i]) >= floatThreshold)
+ return false;
+ } else if (gluShaderUtil.isDataTypeIntOrIVec(a.type)) {
+ for (var i = 0; i < size; i++)
+ if (a.val[i] != b.val[i])
+ return false;
+ } else if (gluShaderUtil.isDataTypeUintOrUVec(a.type)) {
+ for (var i = 0; i < size; i++)
+ if (a.val[i] != b.val[i])
+ return false;
+ } else if (gluShaderUtil.isDataTypeBoolOrBVec(a.type)) {
+ for (var i = 0; i < size; i++)
+ if (a.val[i] != b.val[i])
+ return false;
+ } else if (gluShaderUtil.isDataTypeSampler(a.type)) {
+ if (a.val.samplerV.unit != b.val.samplerV.unit)
+ return false;
+ } else
+ throw new Error('es3fUniformApiTests.apiVarValueEquals - Invalid type');
+
+ return true;
+ };
+
+ /**
+ * @param {es3fUniformApiTests.VarValue} boolValue
+ * @param {gluShaderUtil.DataType} targetScalarType
+ * @param {deRandom.Random} rnd
+ * @return {es3fUniformApiTests.VarValue}
+ */
+ es3fUniformApiTests.getRandomBoolRepresentation = function(boolValue, targetScalarType, rnd) {
+ assertMsgOptions(
+ gluShaderUtil.isDataTypeBoolOrBVec(boolValue.type),
+ 'es3fUniformApiTests.getRandomBoolRepresentation - Data type not boolean or boolean vector',
+ false,
+ true
+ );
+
+ /** @type {number} */ var size = gluShaderUtil.getDataTypeScalarSize(boolValue.type);
+ /** @type {gluShaderUtil.DataType} */ var targetType = size == 1 ? targetScalarType : gluShaderUtil.getDataTypeVector(targetScalarType, size);
+ /** @type {es3fUniformApiTests.VarValue} */ var result = new es3fUniformApiTests.VarValue();
+ result.type = targetType;
+
+ switch (targetScalarType) {
+ case gluShaderUtil.DataType.INT:
+ for (var i = 0; i < size; i++) {
+ if (boolValue.val[i]) {
+ result.val[i] = rnd.getInt(-10, 10);
+ if (result.val[i] == 0)
+ result.val[i] = 1;
+ } else
+ result.val[i] = 0;
+ }
+ break;
+
+ case gluShaderUtil.DataType.UINT:
+ for (var i = 0; i < size; i++) {
+ if (boolValue.val[i])
+ result.val[i] = rnd.getInt(1, 10);
+ else
+ result.val[i] = 0;
+ }
+ break;
+
+ case gluShaderUtil.DataType.FLOAT:
+ for (var i = 0; i < size; i++) {
+ if (boolValue.val[i]) {
+ result.val[i] = rnd.getFloat(-10.0, 10.0);
+ if (result.val[i] == 0.0)
+ result.val[i] = 1.0;
+ } else
+ result.val[i] = 0;
+ }
+ break;
+
+ default:
+ throw new Error('es3fUniformApiTests.getRandomBoolRepresentation - Invalid type');
+ }
+
+ return result;
+ };
+
+ /**
+ * @param {es3fUniformApiTests.CaseShaderType} type
+ * @return {?string}
+ */
+ es3fUniformApiTests.getCaseShaderTypeName = function(type) {
+ switch (type) {
+ case es3fUniformApiTests.CaseShaderType.VERTEX: return 'vertex';
+ case es3fUniformApiTests.CaseShaderType.FRAGMENT: return 'fragment';
+ case es3fUniformApiTests.CaseShaderType.BOTH: return 'both';
+ default:
+ throw new Error('es3fUniformApiTests.getCaseShaderTypeName - Invalid shader type');
+ }
+ };
+
+ /**
+ * @param {number} seed
+ * @return {number}
+ */
+ es3fUniformApiTests.randomCaseShaderType = function(seed) {
+ return (new deRandom.Random(seed)).getInt(0, Object.keys(es3fUniformApiTests.CaseShaderType).length - 1);
+ };
+
+ //es3fUniformApiTests.UniformCase definitions
+
+ /**
+ * es3fUniformApiTests.Feature - Implemented as a function to create an object without unwanted properties.
+ * @constructor
+ */
+ es3fUniformApiTests.Feature = function() {
+ // ARRAYUSAGE_ONLY_MIDDLE_INDEX: only middle index of each array is used in shader. If not given, use all indices.
+ this.ARRAYUSAGE_ONLY_MIDDLE_INDEX = false;
+
+ // UNIFORMFUNC_VALUE: use pass-by-value versions of uniform assignment funcs, e.g. glUniform1f(), where possible. If not given, use pass-by-pointer versions.
+ this.UNIFORMFUNC_VALUE = false;
+
+ // MATRIXMODE_ROWMAJOR: pass matrices to GL in row major form. If not given, use column major.
+ this.MATRIXMODE_ROWMAJOR = false;
+
+ // ARRAYASSIGN: how basic-type arrays are assigned with glUniform*(). If none given, assign each element of an array separately.
+ this.ARRAYASSIGN_FULL = false; //!< Assign all elements of an array with one glUniform*().
+ this.ARRAYASSIGN_BLOCKS_OF_TWO = false; //!< Assign two elements per one glUniform*().
+
+ // UNIFORMUSAGE_EVERY_OTHER: use about half of the uniforms. If not given, use all uniforms (except that some array indices may be omitted according to ARRAYUSAGE).
+ this.UNIFORMUSAGE_EVERY_OTHER = false;
+
+ // BOOLEANAPITYPE: type used to pass booleans to and from GL api. If none given, use float.
+ this.BOOLEANAPITYPE_INT = false;
+ this.BOOLEANAPITYPE_UINT = false;
+
+ // UNIFORMVALUE_ZERO: use zero-valued uniforms. If not given, use random uniform values.
+ this.UNIFORMVALUE_ZERO = false;
+
+ // ARRAY_FIRST_ELEM_NAME_NO_INDEX: in certain API functions, when referring to the first element of an array, use just the array name without [0] at the end.
+ this.ARRAY_FIRST_ELEM_NAME_NO_INDEX = false;
+ };
+
+ // A basic uniform is a uniform (possibly struct or array member) whose type is a basic type (e.g. float, ivec4, sampler2d).
+ /**
+ * @constructor
+ * @param {string} name_
+ * @param {gluShaderUtil.DataType} type_
+ * @param {boolean} isUsedInShader_
+ * @param {es3fUniformApiTests.VarValue} finalValue_
+ * @param {string=} rootName_
+ * @param {number=} elemNdx_
+ * @param {number=} rootSize_
+ */
+ es3fUniformApiTests.BasicUniform = function(name_, type_, isUsedInShader_, finalValue_, rootName_, elemNdx_, rootSize_) {
+ /** @type {string} */ this.name = name_;
+ /** @type {gluShaderUtil.DataType} */ this.type = type_;
+ /** @type {boolean} */ this.isUsedInShader = isUsedInShader_;
+ /** @type {es3fUniformApiTests.VarValue} */ this.finalValue = finalValue_; //!< The value we ultimately want to set for this uniform.
+
+ /** @type {string} */ this.rootName = rootName_ === undefined ? name_ : rootName_; //!< If this is a member of a basic-typed array, rootName is the name of that array with "[0]" appended. Otherwise it equals name.
+ /** @type {number} */ this.elemNdx = elemNdx_ === undefined ? -1 : elemNdx_; //!< If this is a member of a basic-typed array, elemNdx is the index in that array. Otherwise -1.
+ /** @type {number} */ this.rootSize = rootSize_ === undefined ? 1 : rootSize_; //!< If this is a member of a basic-typed array, rootSize is the size of that array. Otherwise 1.
+ };
+
+ /**
+ * @param {Array<es3fUniformApiTests.BasicUniform>} vec
+ * @param {string} name
+ * @return {es3fUniformApiTests.BasicUniform}
+ */
+ es3fUniformApiTests.BasicUniform.findWithName = function(vec, name) {
+ for (var i = 0; i < vec.length; i++) {
+ if (vec[i].name == name)
+ return vec[i];
+ }
+ return null;
+ };
+
+ // Reference values for info that is expected to be reported by glGetActiveUniform() or glGetActiveUniforms().
+ /**
+ * @constructor
+ * @param {string} name_
+ * @param {gluShaderUtil.DataType} type_
+ * @param {boolean} used
+ */
+ es3fUniformApiTests.BasicUniformReportRef = function(name_, type_, used) {
+ /** @type {string} */ this.name = name_;
+ // \note minSize and maxSize are for arrays and can be distinct since implementations are allowed, but not required, to trim the inactive end indices of arrays.
+ /** @type {number} */ this.minSize = 1;
+ /** @type {number} */ this.maxSize = 1;
+ /** @type {gluShaderUtil.DataType} */ this.type = type_;
+ /** @type {boolean} */ this.isUsedInShader = used;
+ };
+
+ /**
+ * To be used after constructor
+ * @param {number} minS
+ * @param {number} maxS
+ * @return {es3fUniformApiTests.BasicUniformReportRef}
+ */
+ es3fUniformApiTests.BasicUniformReportRef.prototype.constructor_A = function(minS, maxS) {
+ this.minSize = minS;
+ this.maxSize = maxS;
+
+ assertMsgOptions(
+ this.minSize <= this.maxSize,
+ 'es3fUniformApiTests.BasicUniformReportRef.prototype.constructor_A - min size not smaller or equal than max size',
+ false,
+ true
+ );
+
+ return this;
+ };
+
+ // Info that is actually reported by glGetActiveUniform() or glGetActiveUniforms().
+ /**
+ * @constructor
+ * @param {string} name_
+ * @param {number} nameLength_
+ * @param {number} size_
+ * @param {gluShaderUtil.DataType} type_
+ * @param {number} index_
+ */
+ es3fUniformApiTests.BasicUniformReportGL = function(name_, nameLength_, size_, type_, index_) {
+ this.name = name_;
+ this.nameLength = nameLength_;
+ this.size = size_;
+ this.type = type_;
+ this.index = index_;
+ };
+
+ /**
+ * @param {Array<es3fUniformApiTests.BasicUniformReportGL>} vec
+ * @param {string} name
+ * @return {es3fUniformApiTests.BasicUniformReportGL}
+ */
+ es3fUniformApiTests.BasicUniformReportGL.findWithName = function(vec, name) {
+ for (var i = 0; i < vec.length; i++) {
+ if (vec[i].name == name)
+ return vec[i];
+ }
+ return null;
+ };
+
+ /**
+ * es3fUniformApiTests.UniformCase class, inherits from TestCase class
+ * @constructor
+ * @param {string} name
+ * @param {string} description
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fUniformApiTests.UniformCase = function(name, description) { // \note Randomizes caseType, uniformCollection and features.
+ tcuTestCase.DeqpTest.call(this, name, description);
+
+ /** @type {es3fUniformApiTests.Feature} */ this.m_features;
+ /** @type {es3fUniformApiTests.UniformCollection} (SharedPtr) */ this.m_uniformCollection;
+
+ /** @type {number} */ this.m_caseShaderType = 0;
+
+ /** @type {Array<gluTexture.Texture2D>} */ this.m_textures2d = [];
+ /** @type {Array<gluTexture.TextureCube>} */ this.m_texturesCube = [];
+ /** @type {Array<number>} */ this.m_filledTextureUnits = [];
+ };
+
+ es3fUniformApiTests.UniformCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ /** es3fUniformApiTests.UniformCase prototype restore */
+ es3fUniformApiTests.UniformCase.prototype.constructor = es3fUniformApiTests.UniformCase;
+
+ /**
+ * es3fUniformApiTests.UniformCase newC. Creates a es3fUniformApiTests.UniformCase. Use after constructor.
+ * @param {number} seed
+ * @return {es3fUniformApiTests.UniformCase}
+ */
+ es3fUniformApiTests.UniformCase.prototype.newC = function(seed) {
+ this.m_features = this.randomFeatures(seed);
+ this.m_uniformCollection = es3fUniformApiTests.UniformCollection.random(seed);
+ this.m_caseShaderType = es3fUniformApiTests.randomCaseShaderType(seed);
+
+ return this;
+ };
+
+ /**
+ * es3fUniformApiTests.UniformCase new_B (static). Creates a es3fUniformApiTests.UniformCase
+ * @param {string} name
+ * @param {string} description
+ * @param {number} seed
+ * @return {es3fUniformApiTests.UniformCase}
+ */
+ es3fUniformApiTests.UniformCase.new_C = function(name, description, seed) {
+ var uniformCase = new es3fUniformApiTests.UniformCase(name, description).newC(seed);
+
+ return uniformCase;
+ };
+
+ /**
+ * es3fUniformApiTests.UniformCase new_B. Creates a es3fUniformApiTests.UniformCase. Use after constructor.
+ * @param {es3fUniformApiTests.CaseShaderType} caseShaderType
+ * @param {es3fUniformApiTests.UniformCollection} uniformCollection (SharedPtr)
+ * @param {es3fUniformApiTests.Feature} features
+ * @return {es3fUniformApiTests.UniformCase}
+ */
+ es3fUniformApiTests.UniformCase.prototype.newB = function(caseShaderType, uniformCollection, features) {
+ this.m_caseShaderType = caseShaderType;
+ this.m_uniformCollection = uniformCollection;
+ this.m_features = features;
+
+ return this;
+ };
+
+ /**
+ * es3fUniformApiTests.UniformCase new_B (static). Creates a es3fUniformApiTests.UniformCase
+ * @param {string} name
+ * @param {string} description
+ * @param {es3fUniformApiTests.CaseShaderType} caseShaderType
+ * @param {es3fUniformApiTests.UniformCollection} uniformCollection (SharedPtr)
+ * @param {es3fUniformApiTests.Feature} features
+ * @return {es3fUniformApiTests.UniformCase}
+ */
+ es3fUniformApiTests.UniformCase.new_B = function(name, description, caseShaderType, uniformCollection, features) {
+ var uniformCase = new es3fUniformApiTests.UniformCase(name, description).newB(caseShaderType, uniformCollection, features);
+
+ return uniformCase;
+ };
+
+ /**
+ * es3fUniformApiTests.UniformCase new_A. Creates a es3fUniformApiTests.UniformCase. Use after constructor.
+ * @param {es3fUniformApiTests.CaseShaderType} caseShaderType
+ * @param {es3fUniformApiTests.UniformCollection} uniformCollection (SharedPtr)
+ * @return {es3fUniformApiTests.UniformCase}
+ */
+ es3fUniformApiTests.UniformCase.prototype.newA = function(caseShaderType, uniformCollection) {
+ this.m_caseShaderType = caseShaderType;
+ this.m_uniformCollection = uniformCollection;
+ this.m_features = null;
+
+ return this;
+ };
+
+ /**
+ * es3fUniformApiTests.UniformCase new_A (static). Creates a es3fUniformApiTests.UniformCase
+ * @param {string} name
+ * @param {string} description
+ * @param {es3fUniformApiTests.CaseShaderType} caseShaderType
+ * @param {es3fUniformApiTests.UniformCollection} uniformCollection (SharedPtr)
+ * @return {es3fUniformApiTests.UniformCase}
+ */
+ es3fUniformApiTests.UniformCase.new_A = function(name, description, caseShaderType, uniformCollection) {
+ var uniformCase = new es3fUniformApiTests.UniformCase(name, description).newA(caseShaderType, uniformCollection);
+
+ return uniformCase;
+ };
+
+ /**
+ * @param {number} seed
+ * @return {es3fUniformApiTests.Feature}
+ */
+ es3fUniformApiTests.UniformCase.prototype.randomFeatures = function(seed) {
+ /** @type {es3fUniformApiTests.Feature} */ var result = new es3fUniformApiTests.Feature();
+
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(seed);
+
+ result.ARRAYUSAGE_ONLY_MIDDLE_INDEX = rnd.getBool();
+ result.UNIFORMFUNC_VALUE = rnd.getBool();
+ result.MATRIXMODE_ROWMAJOR = rnd.getBool();
+ result.ARRAYASSIGN_FULL = rnd.getBool();
+ result.ARRAYASSIGN_BLOCKS_OF_TWO = !result.ARRAYASSIGN_FULL;
+ result.UNIFORMUSAGE_EVERY_OTHER = rnd.getBool();
+ result.BOOLEANAPITYPE_INT = rnd.getBool();
+ result.BOOLEANAPITYPE_UINT = !result.BOOLEANAPITYPE_INT;
+ result.UNIFORMVALUE_ZERO = rnd.getBool();
+
+ return result;
+ };
+
+ /**
+ * Initialize the es3fUniformApiTests.UniformCase
+ */
+ es3fUniformApiTests.UniformCase.prototype.init = function() {
+ /** @type {number} */ var numSamplerUniforms = this.m_uniformCollection.getNumSamplers();
+ /** @type {number} */ var vertexTexUnitsRequired = this.m_caseShaderType != es3fUniformApiTests.CaseShaderType.FRAGMENT ? numSamplerUniforms : 0;
+ /** @type {number} */ var fragmentTexUnitsRequired = this.m_caseShaderType != es3fUniformApiTests.CaseShaderType.VERTEX ? numSamplerUniforms : 0;
+ /** @type {number} */ var combinedTexUnitsRequired = vertexTexUnitsRequired + fragmentTexUnitsRequired;
+ var vertexTexUnitsSupported = /** @type {number} */ (gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS));
+ var fragmentTexUnitsSupported = /** @type {number} */ (gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS));
+ var combinedTexUnitsSupported = /** @type {number} */ (gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS));
+
+ assertMsgOptions(
+ numSamplerUniforms <= es3fUniformApiTests.MAX_NUM_SAMPLER_UNIFORMS,
+ 'es3fUniformApiTests.UniformCase.prototype.init - sampler uniforms exceed MAX_NUM_SAMPLER_UNIFORMS',
+ false,
+ true
+ );
+
+ if (vertexTexUnitsRequired > vertexTexUnitsSupported)
+ testFailedOptions('' + vertexTexUnitsRequired + ' vertex texture units required, ' + vertexTexUnitsSupported + ' supported', true);
+ if (fragmentTexUnitsRequired > fragmentTexUnitsSupported)
+ testFailedOptions('' + fragmentTexUnitsRequired + ' fragment texture units required, ' + fragmentTexUnitsSupported + ' supported', true);
+ if (combinedTexUnitsRequired > combinedTexUnitsSupported)
+ testFailedOptions('' + combinedTexUnitsRequired + ' combined texture units required, ' + combinedTexUnitsSupported + ' supported', true);
+ };
+
+ /**
+ * @param {Array<es3fUniformApiTests.BasicUniform>} basicUniformsDst
+ * @param {Array<es3fUniformApiTests.BasicUniformReportRef>} basicUniformReportsDst
+ * @param {gluVarType.VarType} varType
+ * @param {string} varName
+ * @param {boolean} isParentActive
+ * @param {number} samplerUnitCounter
+ * @param {deRandom.Random} rnd
+ * @return {number} Used to be output parameter. Sampler unit count
+ */
+ es3fUniformApiTests.UniformCase.prototype.generateBasicUniforms = function(basicUniformsDst, basicUniformReportsDst, varType, varName, isParentActive, samplerUnitCounter, rnd) {
+ /** @type {es3fUniformApiTests.VarValue} */ var value;
+
+ if (varType.isBasicType()) {
+ /** @type {boolean} */ var isActive = isParentActive && (this.m_features.UNIFORMUSAGE_EVERY_OTHER ? basicUniformsDst.length % 2 == 0 : true);
+ /** @type {gluShaderUtil.DataType} */ var type = varType.getBasicType();
+ value = this.m_features.UNIFORMVALUE_ZERO ? es3fUniformApiTests.generateZeroVarValue(type) :
+ gluShaderUtil.isDataTypeSampler(type) ? es3fUniformApiTests.generateRandomVarValue(type, rnd, samplerUnitCounter++) :
+ es3fUniformApiTests.generateRandomVarValue(varType.getBasicType(), rnd);
+
+ basicUniformsDst.push(new es3fUniformApiTests.BasicUniform(varName, varType.getBasicType(), isActive, value));
+ basicUniformReportsDst.push(new es3fUniformApiTests.BasicUniformReportRef(varName, varType.getBasicType(), isActive));
+ } else if (varType.isArrayType()) {
+ /** @type {number} */ var size = varType.getArraySize();
+ /** @type {string} */ var arrayRootName = '' + varName + '[0]';
+ /** @type {Array<boolean>} */ var isElemActive = [];
+
+ for (var elemNdx = 0; elemNdx < varType.getArraySize(); elemNdx++) {
+ /** @type {string} */ var indexedName = '' + varName + '[' + elemNdx + ']';
+ /** @type {boolean} */ var isCurElemActive = isParentActive &&
+ (this.m_features.UNIFORMUSAGE_EVERY_OTHER ? basicUniformsDst.length % 2 == 0 : true) &&
+ (this.m_features.ARRAYUSAGE_ONLY_MIDDLE_INDEX ? elemNdx == Math.floor(size / 2) : true);
+
+ isElemActive.push(isCurElemActive);
+
+ if (varType.getElementType().isBasicType()) {
+ // \note We don't want separate entries in basicUniformReportsDst for elements of basic-type arrays.
+ /** @type {gluShaderUtil.DataType} */ var elemBasicType = varType.getElementType().getBasicType();
+ value = this.m_features.UNIFORMVALUE_ZERO ? es3fUniformApiTests.generateZeroVarValue(elemBasicType) :
+ gluShaderUtil.isDataTypeSampler(elemBasicType) ? es3fUniformApiTests.generateRandomVarValue(elemBasicType, rnd, samplerUnitCounter++) :
+ es3fUniformApiTests.generateRandomVarValue(elemBasicType, rnd);
+
+ basicUniformsDst.push(new es3fUniformApiTests.BasicUniform(indexedName, elemBasicType, isCurElemActive, value, arrayRootName, elemNdx, size));
+ } else
+ samplerUnitCounter = this.generateBasicUniforms(basicUniformsDst, basicUniformReportsDst, varType.getElementType(), indexedName, isCurElemActive, samplerUnitCounter, rnd);
+ }
+
+ if (varType.getElementType().isBasicType()) {
+ /** @type {number} */ var minSize;
+ for (minSize = varType.getArraySize(); minSize > 0 && !isElemActive[minSize - 1]; minSize--) {}
+
+ basicUniformReportsDst.push(new es3fUniformApiTests.BasicUniformReportRef(arrayRootName, varType.getElementType().getBasicType(), isParentActive && minSize > 0).constructor_A(minSize, size));
+ }
+ } else {
+ assertMsgOptions(
+ varType.isStructType(),
+ 'es3fUniformApiTests.UniformCase.prototype.generateBasicUniforms - not a struct type',
+ false,
+ true
+ );
+
+ /** @type {gluVarType.StructType} */ var structType = varType.getStruct();
+
+ for (var i = 0; i < structType.getSize(); i++) {
+ /** @type {gluVarType.StructMember} */ var member = structType.getMember(i);
+ /** @type {string} */ var memberFullName = '' + varName + '.' + member.getName();
+
+ samplerUnitCounter = this.generateBasicUniforms(basicUniformsDst, basicUniformReportsDst, member.getType(), memberFullName, isParentActive, samplerUnitCounter, rnd);
+ }
+ }
+
+ return samplerUnitCounter;
+ };
+
+ /**
+ * @param {string} dst
+ * @return {string}
+ */
+ es3fUniformApiTests.UniformCase.prototype.writeUniformDefinitions = function(dst) {
+ for (var i = 0; i < this.m_uniformCollection.getNumStructTypes(); i++)
+ dst += gluVarType.declareStructType(this.m_uniformCollection.getStructType(i), 0) + ';\n';
+
+ for (var i = 0; i < this.m_uniformCollection.getNumUniforms(); i++)
+ dst += 'uniform ' + gluVarType.declareVariable(this.m_uniformCollection.getUniform(i).type, this.m_uniformCollection.getUniform(i).name, 0) + ';\n';
+
+ dst += '\n';
+
+ var compareFuncs = [{
+ requiringTypes: [gluShaderUtil.isDataTypeFloatOrVec, gluShaderUtil.isDataTypeMatrix],
+ definition: 'mediump float compare_float (mediump float a, mediump float b) { return abs(a - b) < 0.05 ? 1.0 : 0.0; }'
+ },{
+ requiringTypes: [
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.FLOAT_VEC2, t);},
+ function(t) {return es3fUniformApiTests.dataTypeIsMatrixWithNRows(2, t);}
+ ],
+ definition: 'mediump float compare_vec2 (mediump vec2 a, mediump vec2 b) { return compare_float(a.x, b.x)*compare_float(a.y, b.y); }'
+ },{
+ requiringTypes: [
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.FLOAT_VEC3, t);},
+ function(t) {return es3fUniformApiTests.dataTypeIsMatrixWithNRows(3, t);}
+ ],
+ definition: 'mediump float compare_vec3 (mediump vec3 a, mediump vec3 b) { return compare_float(a.x, b.x)*compare_float(a.y, b.y)*compare_float(a.z, b.z); }'
+ },{
+ requiringTypes: [
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.FLOAT_VEC4, t);},
+ function(t) {return es3fUniformApiTests.dataTypeIsMatrixWithNRows(4, t);}],
+ definition: 'mediump float compare_vec4 (mediump vec4 a, mediump vec4 b) { return compare_float(a.x, b.x)*compare_float(a.y, b.y)*compare_float(a.z, b.z)*compare_float(a.w, b.w); }'
+ },{
+ requiringTypes: [
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.FLOAT_MAT2, t);},
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);}
+ ],
+ definition: 'mediump float compare_mat2 (mediump mat2 a, mediump mat2 b) { return compare_vec2(a[0], b[0])*compare_vec2(a[1], b[1]); }'
+ },{
+ requiringTypes: [
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.FLOAT_MAT2X3, t);},
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);}
+ ],
+ definition: 'mediump float compare_mat2x3 (mediump mat2x3 a, mediump mat2x3 b) { return compare_vec3(a[0], b[0])*compare_vec3(a[1], b[1]); }'
+ },{
+ requiringTypes: [
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.FLOAT_MAT2X4, t);},
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);}
+ ],
+ definition: 'mediump float compare_mat2x4 (mediump mat2x4 a, mediump mat2x4 b) { return compare_vec4(a[0], b[0])*compare_vec4(a[1], b[1]); }'
+ },{
+ requiringTypes: [
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.FLOAT_MAT3X2, t);},
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);}
+ ],
+ definition: 'mediump float compare_mat3x2 (mediump mat3x2 a, mediump mat3x2 b) { return compare_vec2(a[0], b[0])*compare_vec2(a[1], b[1])*compare_vec2(a[2], b[2]); }'
+ },{
+ requiringTypes: [
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.FLOAT_MAT3, t);},
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);}
+ ],
+ definition: 'mediump float compare_mat3 (mediump mat3 a, mediump mat3 b) { return compare_vec3(a[0], b[0])*compare_vec3(a[1], b[1])*compare_vec3(a[2], b[2]); }'
+ },{
+ requiringTypes: [
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.FLOAT_MAT3X4, t);},
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);}
+ ],
+ definition: 'mediump float compare_mat3x4 (mediump mat3x4 a, mediump mat3x4 b) { return compare_vec4(a[0], b[0])*compare_vec4(a[1], b[1])*compare_vec4(a[2], b[2]); }'
+ },{
+ requiringTypes: [
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.FLOAT_MAT4X2, t);},
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);}
+ ],
+ definition: 'mediump float compare_mat4x2 (mediump mat4x2 a, mediump mat4x2 b) { return compare_vec2(a[0], b[0])*compare_vec2(a[1], b[1])*compare_vec2(a[2], b[2])*compare_vec2(a[3], b[3]); }'
+ },{
+ requiringTypes: [
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.FLOAT_MAT4X3, t);},
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);}
+ ],
+ definition: 'mediump float compare_mat4x3 (mediump mat4x3 a, mediump mat4x3 b) { return compare_vec3(a[0], b[0])*compare_vec3(a[1], b[1])*compare_vec3(a[2], b[2])*compare_vec3(a[3], b[3]); }'
+ },{
+ requiringTypes: [
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.FLOAT_MAT4, t);},
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);}
+ ],
+ definition: 'mediump float compare_mat4 (mediump mat4 a, mediump mat4 b) { return compare_vec4(a[0], b[0])*compare_vec4(a[1], b[1])*compare_vec4(a[2], b[2])*compare_vec4(a[3], b[3]); }'
+ },{
+ requiringTypes: [
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INT, t);},
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);}
+ ],
+ definition: 'mediump float compare_int (mediump int a, mediump int b) { return a == b ? 1.0 : 0.0; }'
+ },{
+ requiringTypes: [
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INT_VEC2, t);},
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);}
+ ],
+ definition: 'mediump float compare_ivec2 (mediump ivec2 a, mediump ivec2 b) { return a == b ? 1.0 : 0.0; }'
+ },{
+ requiringTypes: [
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INT_VEC3, t);},
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);}
+ ],
+ definition: 'mediump float compare_ivec3 (mediump ivec3 a, mediump ivec3 b) { return a == b ? 1.0 : 0.0; }'
+ },{
+ requiringTypes: [
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INT_VEC4, t);},
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);}
+ ],
+ definition: 'mediump float compare_ivec4 (mediump ivec4 a, mediump ivec4 b) { return a == b ? 1.0 : 0.0; }'
+ },{
+ requiringTypes: [
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.UINT, t);},
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);}
+ ],
+ definition: 'mediump float compare_uint (mediump uint a, mediump uint b) { return a == b ? 1.0 : 0.0; }'
+ },{
+ requiringTypes: [
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.UINT_VEC2, t);},
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);}
+ ],
+ definition: 'mediump float compare_uvec2 (mediump uvec2 a, mediump uvec2 b) { return a == b ? 1.0 : 0.0; }'
+ },{
+ requiringTypes: [
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.UINT_VEC3, t);},
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);}
+ ],
+ definition: 'mediump float compare_uvec3 (mediump uvec3 a, mediump uvec3 b) { return a == b ? 1.0 : 0.0; }'
+ },{
+ requiringTypes: [
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.UINT_VEC4, t);},
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);}
+ ],
+ definition: 'mediump float compare_uvec4 (mediump uvec4 a, mediump uvec4 b) { return a == b ? 1.0 : 0.0; }'
+ },{
+ requiringTypes: [
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.BOOL, t);},
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);}
+ ],
+ definition: 'mediump float compare_bool (bool a, bool b) { return a == b ? 1.0 : 0.0; }'
+ },{
+ requiringTypes: [
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.BOOL_VEC2, t);},
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);}
+ ],
+ definition: 'mediump float compare_bvec2 (bvec2 a, bvec2 b) { return a == b ? 1.0 : 0.0; }'
+ },{
+ requiringTypes: [
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.BOOL_VEC3, t);},
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);}
+ ],
+ definition: 'mediump float compare_bvec3 (bvec3 a, bvec3 b) { return a == b ? 1.0 : 0.0; }'
+ },{
+ requiringTypes: [
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.BOOL_VEC4, t);},
+ function(t) {return es3fUniformApiTests.dataTypeEquals(gluShaderUtil.DataType.INVALID, t);}
+ ],
+ definition: 'mediump float compare_bvec4 (bvec4 a, bvec4 b) { return a == b ? 1.0 : 0.0; }'
+ }
+ ];
+
+ /** @type {Array<gluShaderUtil.DataType>} */ var samplerTypes = this.m_uniformCollection.getSamplerTypes();
+
+ for (var compFuncNdx = 0; compFuncNdx < compareFuncs.length; compFuncNdx++) {
+ /** @type {Array<es3fUniformApiTests.dataTypePredicate>} */ var typeReq = compareFuncs[compFuncNdx].requiringTypes;
+ /** @type {boolean} */ var containsTypeSampler = false;
+
+ for (var i = 0; i < samplerTypes.length; i++) {
+ if (gluShaderUtil.isDataTypeSampler(samplerTypes[i])) {
+ /** @type {gluShaderUtil.DataType} */ var retType = es3fUniformApiTests.getSamplerLookupReturnType(samplerTypes[i]);
+ if (typeReq[0](retType) || typeReq[1](retType)) {
+ containsTypeSampler = true;
+ break;
+ }
+ }
+ }
+
+ if (containsTypeSampler || this.m_uniformCollection.containsMatchingBasicType(typeReq[0]) || this.m_uniformCollection.containsMatchingBasicType(typeReq[1]))
+ dst += compareFuncs[compFuncNdx].definition + '\n';
+ }
+
+ return dst;
+ };
+
+ /**
+ * @param {string} dst
+ * @param {es3fUniformApiTests.BasicUniform} uniform
+ * @return {string} Used to write the string in the output parameter
+ */
+ es3fUniformApiTests.UniformCase.prototype.writeUniformCompareExpr = function(dst, uniform) {
+ if (gluShaderUtil.isDataTypeSampler(uniform.type))
+ dst += 'compare_' + gluShaderUtil.getDataTypeName(es3fUniformApiTests.getSamplerLookupReturnType(uniform.type)) + '(texture(' + uniform.name + ', vec' + es3fUniformApiTests.getSamplerNumLookupDimensions(uniform.type) + '(0.0))'; //WebGL2.0
+ else
+ dst += 'compare_' + gluShaderUtil.getDataTypeName(uniform.type) + '(' + uniform.name;
+
+ dst += ', ' + es3fUniformApiTests.shaderVarValueStr(uniform.finalValue) + ')';
+
+ return dst;
+ };
+
+ /**
+ * @param {string} dst
+ * @param {Array<es3fUniformApiTests.BasicUniform>} basicUniforms
+ * @param {string} variableName
+ * @return {string} Used to write the string in the output parameter
+ */
+ es3fUniformApiTests.UniformCase.prototype.writeUniformComparisons = function(dst, basicUniforms, variableName) {
+ for (var i = 0; i < basicUniforms.length; i++) {
+ /** @type {es3fUniformApiTests.BasicUniform} */ var unif = basicUniforms[i];
+
+ if (unif.isUsedInShader) {
+ dst += '\t' + variableName + ' *= ';
+ dst = this.writeUniformCompareExpr(dst, basicUniforms[i]);
+ dst += ';\n';
+ } else
+ dst += '\t// UNUSED: ' + basicUniforms[i].name + '\n';
+ }
+
+ return dst;
+ };
+
+ /**
+ * @param {Array<es3fUniformApiTests.BasicUniform>} basicUniforms
+ * @return {string}
+ */
+ es3fUniformApiTests.UniformCase.prototype.generateVertexSource = function(basicUniforms) {
+ /** @type {boolean} */ var isVertexCase = this.m_caseShaderType == es3fUniformApiTests.CaseShaderType.VERTEX || this.m_caseShaderType == es3fUniformApiTests.CaseShaderType.BOTH;
+ /** @type {string} */ var result = '';
+
+ result += '#version 300 es\n' +
+ 'in highp vec4 a_position;\n' +
+ 'out mediump float v_vtxOut;\n' +
+ '\n';
+
+ if (isVertexCase)
+ result = this.writeUniformDefinitions(result);
+
+ result += '\n' +
+ 'void main (void)\n' +
+ ' {\n' +
+ ' gl_Position = a_position;\n' +
+ ' v_vtxOut = 1.0;\n';
+
+ if (isVertexCase)
+ result = this.writeUniformComparisons(result, basicUniforms, 'v_vtxOut');
+
+ result += '}\n';
+
+ return result;
+ };
+
+ /**
+ * @param {Array<es3fUniformApiTests.BasicUniform>} basicUniforms
+ * @return {string}
+ */
+ es3fUniformApiTests.UniformCase.prototype.generateFragmentSource = function(basicUniforms) {
+ /**@type {boolean} */ var isFragmentCase = this.m_caseShaderType == es3fUniformApiTests.CaseShaderType.FRAGMENT || this.m_caseShaderType == es3fUniformApiTests.CaseShaderType.BOTH;
+ /**@type {string} */ var result = '';
+
+ result += '#version 300 es\n' +
+ 'in mediump float v_vtxOut;\n' +
+ '\n';
+
+ if (isFragmentCase)
+ result = this.writeUniformDefinitions(result);
+
+ result += '\n' +
+ 'layout(location = 0) out mediump vec4 dEQP_FragColor;\n' +
+ '\n' +
+ 'void main (void)\n' +
+ ' {\n' +
+ ' mediump float result = v_vtxOut;\n';
+
+ if (isFragmentCase)
+ result = this.writeUniformComparisons(result, basicUniforms, 'result');
+
+ result += ' dEQP_FragColor = vec4(result, result, result, 1.0);\n' +
+ '}\n';
+
+ return result;
+ };
+
+ /**
+ * @param {es3fUniformApiTests.VarValue} value
+ */
+ es3fUniformApiTests.UniformCase.prototype.setupTexture = function(value) {
+ // \note No handling for samplers other than 2D or cube.
+
+ assertMsgOptions(
+ es3fUniformApiTests.getSamplerLookupReturnType(value.type) == gluShaderUtil.DataType.FLOAT_VEC4,
+ 'es3fUniformApiTests.UniformCase.prototype.setupTexture - sampler return type should be vec4f', false, true
+ );
+
+ /** @type {number} */ var width = 32;
+ /** @type {number} */ var height = 32;
+ /** @type {Array<number>} */ var color = value.val.samplerV.fillColor;
+ /** @type {tcuTexture.TextureCube} */ var refTexture;
+ /** @type {gluTexture.TextureCube} */ var texture;
+
+ if (value.type == gluShaderUtil.DataType.SAMPLER_2D) {
+ texture = gluTexture.texture2DFromFormat(gl, gl.RGBA, gl.UNSIGNED_BYTE, width, height);
+ refTexture = texture.getRefTexture();
+ this.m_textures2d.push(texture);
+
+ refTexture.allocLevel(0);
+ es3fUniformApiTests.fillWithColor(refTexture.getLevel(0), color);
+
+ gl.activeTexture(gl.TEXTURE0 + value.val.samplerV.unit);
+ this.m_filledTextureUnits.push(value.val.samplerV.unit);
+ texture.upload();
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+ } else if (value.type == gluShaderUtil.DataType.SAMPLER_CUBE) {
+ assertMsgOptions(width == height, 'es3fUniformApiTests.UniformCase.prototype.setupTexture - non square texture', false, true);
+
+ texture = gluTexture.cubeFromFormat(gl, gl.RGBA, gl.UNSIGNED_BYTE, width);
+ refTexture = texture.getRefTexture();
+ this.m_texturesCube.push(texture);
+
+ for (var face in tcuTexture.CubeFace) {
+ refTexture.allocLevel(tcuTexture.CubeFace[face], 0);
+ es3fUniformApiTests.fillWithColor(refTexture.getLevelFace(0, tcuTexture.CubeFace[face]), color);
+ }
+
+ gl.activeTexture(gl.TEXTURE0 + value.val.samplerV.unit);
+ this.m_filledTextureUnits.push(value.val.samplerV.unit);
+ texture.upload();
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+ } else
+ throw new Error('es3fUniformApiTests.UniformCase.prototype.setupTexture - Invalid sampler type');
+ };
+
+ /**
+ * @param {Array<es3fUniformApiTests.BasicUniformReportGL>} basicUniformReportsDst
+ * @param {Array<es3fUniformApiTests.BasicUniformReportRef>} basicUniformReportsRef
+ * @param {WebGLProgram} programGL
+ * @return {boolean}
+ */
+ es3fUniformApiTests.UniformCase.prototype.getActiveUniformsOneByOne = function(basicUniformReportsDst, basicUniformReportsRef, programGL) {
+ /** @type {WebGLProgram} */ var numActiveUniforms;
+ /** @type {boolean} */ var success = true;
+
+ numActiveUniforms = /** @type {WebGLProgram} */ (gl.getProgramParameter(programGL, gl.ACTIVE_UNIFORMS));
+ bufferedLogToConsole('// Number of active uniforms reported: ' + numActiveUniforms);
+
+ for (var unifNdx = 0; unifNdx < numActiveUniforms; unifNdx++) {
+ /** @type {number} (GLint)*/ var reportedSize = -1;
+ /** @type {number} (GLenum)*/ var reportedTypeGL = gl.NONE;
+ /** @type {gluShaderUtil.DataType} */ var reportedType;
+ /** @type {string} */ var reportedNameStr;
+ /** @type {WebGLActiveInfo} */ var activeInfo;
+
+ activeInfo = gl.getActiveUniform(programGL, unifNdx);
+
+ reportedNameStr = activeInfo.name;
+ reportedTypeGL = activeInfo.type;
+ reportedSize = activeInfo.size;
+
+ reportedType = gluShaderUtil.getDataTypeFromGLType(reportedTypeGL);
+
+ checkMessage(reportedType !== undefined, 'Invalid uniform type');
+
+ bufferedLogToConsole('// Got name = ' + reportedNameStr + ', size = ' + reportedSize + ', type = ' + gluShaderUtil.getDataTypeName(reportedType));
+
+ // Ignore built-in uniforms.
+ if (reportedNameStr.indexOf('gl_') == -1) {
+ /** @type {number} */ var referenceNdx;
+ for (referenceNdx = 0; referenceNdx < basicUniformReportsRef.length; referenceNdx++) {
+ if (basicUniformReportsRef[referenceNdx].name == reportedNameStr)
+ break;
+ }
+
+ if (referenceNdx >= basicUniformReportsRef.length) {
+ bufferedLogToConsole('// FAILURE: invalid non-built-in uniform name reported');
+ success = false;
+ } else {
+ /** @type {es3fUniformApiTests.BasicUniformReportRef} */ var reference = basicUniformReportsRef[referenceNdx];
+
+ assertMsgOptions(
+ reference.type !== undefined,
+ 'es3fUniformApiTests.UniformCase.prototype.getActiveUniformsOneByOne - type is undefined',
+ false,
+ true
+ );
+ assertMsgOptions(
+ reference.minSize >= 1 || (reference.minSize == 0 && !reference.isUsedInShader),
+ 'es3fUniformApiTests.UniformCase.prototype.getActiveUniformsOneByOne - uniform min size does not match usage in shader',
+ false,
+ true
+ );
+ assertMsgOptions(
+ reference.minSize <= reference.maxSize,
+ 'es3fUniformApiTests.UniformCase.prototype.getActiveUniformsOneByOne - uniform min size bigger than max size',
+ false,
+ true
+ );
+
+ if (es3fUniformApiTests.BasicUniformReportGL.findWithName(basicUniformReportsDst, reportedNameStr) !== null) {
+ bufferedLogToConsole('// FAILURE: same uniform name reported twice');
+ success = false;
+ }
+
+ basicUniformReportsDst.push(new es3fUniformApiTests.BasicUniformReportGL(reportedNameStr, reportedNameStr.length, reportedSize, reportedType, unifNdx));
+
+ if (reportedType != reference.type) {
+ bufferedLogToConsole('// FAILURE: wrong type reported, should be ' + gluShaderUtil.getDataTypeName(reference.type));
+ success = false;
+ }
+ if (reportedSize < reference.minSize || reportedSize > reference.maxSize) {
+ bufferedLogToConsole('// FAILURE: wrong size reported, should be ' +
+ (reference.minSize == reference.maxSize ? reference.minSize : 'in the range [' + reference.minSize + ', ' + reference.maxSize + ']'));
+
+ success = false;
+ }
+ }
+ }
+ }
+
+ for (var i = 0; i < basicUniformReportsRef.length; i++) {
+ /** @type {es3fUniformApiTests.BasicUniformReportRef} */ var expected = basicUniformReportsRef[i];
+ if (expected.isUsedInShader && es3fUniformApiTests.BasicUniformReportGL.findWithName(basicUniformReportsDst, expected.name) === null) {
+ bufferedLogToConsole('// FAILURE: uniform with name ' + expected.name + ' was not reported by GL');
+ success = false;
+ }
+ }
+
+ return success;
+ };
+
+ /**
+ * @param {Array<es3fUniformApiTests.BasicUniformReportGL>} basicUniformReportsDst
+ * @param {Array<es3fUniformApiTests.BasicUniformReportRef>} basicUniformReportsRef
+ * @param {WebGLProgram} programGL
+ * @return {boolean}
+ */
+ es3fUniformApiTests.UniformCase.prototype.getActiveUniforms = function(basicUniformReportsDst, basicUniformReportsRef, programGL) {
+ /** @type {Array<string>} */ var queryNames = new Array(basicUniformReportsRef.length);
+ /** @type {Array<string>} */ var queryNamesC = new Array(basicUniformReportsRef.length);
+ /** @type {Array<number>} (GLuint) */ var uniformIndices = new Array(basicUniformReportsRef.length);
+ /** @type {Array<number>} */ var validUniformIndices = []; // This shall have the same contents, and in same order, as uniformIndices, but with gl.INVALID_INDEX entries removed.
+ /** @type {boolean} */ var success = true;
+
+ for (var i = 0; i < basicUniformReportsRef.length; i++) {
+ /** @type {string} */ var name = basicUniformReportsRef[i].name;
+ queryNames[i] = this.m_features.ARRAY_FIRST_ELEM_NAME_NO_INDEX && name[name.length - 1] == ']' ? es3fUniformApiTests.beforeLast(name, '[') : name;
+ queryNamesC[i] = queryNames[i];
+ }
+
+ uniformIndices = gl.getUniformIndices(programGL, queryNamesC);
+
+ for (var i = 0; i < uniformIndices.length; i++) {
+ if (uniformIndices[i] != gl.INVALID_INDEX)
+ validUniformIndices.push(uniformIndices[i]);
+ else {
+ if (basicUniformReportsRef[i].isUsedInShader) {
+ bufferedLogToConsole('// FAILURE: uniform with name ' + basicUniformReportsRef[i].name + ' received gl.INVALID_INDEX');
+ success = false;
+ }
+ }
+ }
+
+ if (validUniformIndices.length > 0) {
+ /** @type {Array<string>} */ var uniformNameBuf = new Array(validUniformIndices.length);
+ /** @type {Array<number>} (GLint) */ var uniformSizeBuf = new Array(validUniformIndices.length);
+ /** @type {Array<number>} (GLint) */ var uniformTypeBuf = new Array(validUniformIndices.length);
+
+ uniformSizeBuf = gl.getActiveUniforms(programGL, validUniformIndices, gl.UNIFORM_SIZE);
+ uniformTypeBuf = gl.getActiveUniforms(programGL, validUniformIndices, gl.UNIFORM_TYPE);
+
+ /** @type {number} */ var validNdx = -1; // Keeps the corresponding index to validUniformIndices while unifNdx is the index to uniformIndices.
+ for (var unifNdx = 0; unifNdx < uniformIndices.length; unifNdx++) {
+ if (uniformIndices[unifNdx] == gl.INVALID_INDEX)
+ continue;
+
+ validNdx++;
+
+ /** @type {es3fUniformApiTests.BasicUniformReportRef} */ var reference = basicUniformReportsRef[unifNdx];
+ /** @type {number} */ var reportedIndex = validUniformIndices[validNdx];
+ /** @type {number} */ var reportedNameLength = reference.name.length;
+ /** @type {number} */ var reportedSize = uniformSizeBuf[validNdx];
+ /** @type {gluShaderUtil.DataType} */ var reportedType = gluShaderUtil.getDataTypeFromGLType(uniformTypeBuf[validNdx]);
+ /** @type {string} */ var reportedNameStr = reference.name;
+
+ bufferedLogToConsole('// Got name size = ' + reportedSize +
+ ', type = ' + gluShaderUtil.getDataTypeName(reportedType) +
+ ' for the uniform at index ' + reportedIndex + ' (' + reference.name + ')');
+
+ assertMsgOptions(
+ reference.type !== undefined,
+ 'es3fUniformApiTests.UniformCase.prototype.getActiveUniforms - type is undefined',
+ false,
+ true
+ );
+ assertMsgOptions(
+ reference.minSize >= 1 || (reference.minSize == 0 && !reference.isUsedInShader),
+ 'es3fUniformApiTests.UniformCase.prototype.getActiveUniforms - uniform min size does not match usage in shader',
+ false,
+ true
+ );
+ assertMsgOptions(
+ reference.minSize <= reference.maxSize,
+ 'es3fUniformApiTests.UniformCase.prototype.getActiveUniforms - uniform min size bigger than max size',
+ false,
+ true
+ );
+
+ if (es3fUniformApiTests.BasicUniformReportGL.findWithName(basicUniformReportsDst, reportedNameStr) !== null) {
+ bufferedLogToConsole('// FAILURE: same uniform name reported twice');
+ success = false;
+ }
+ basicUniformReportsDst.push(new es3fUniformApiTests.BasicUniformReportGL(reference.name, reportedNameLength, reportedSize, reportedType, reportedIndex));
+
+ if (reportedType != reference.type) {
+ bufferedLogToConsole('// FAILURE: wrong type reported, should be ' + gluShaderUtil.getDataTypeName(reference.type));
+ success = false;
+ }
+
+ if (reportedSize < reference.minSize || reportedSize > reference.maxSize) {
+ bufferedLogToConsole('// FAILURE: wrong size reported, should be ' +
+ (reference.minSize == reference.maxSize ? reference.minSize : 'in the range [' + reference.minSize + ', ' + reference.maxSize + ']'));
+
+ success = false;
+ }
+ }
+ }
+
+ return success;
+ };
+
+ /**
+ * @param {Array<es3fUniformApiTests.BasicUniformReportGL>} uniformResults
+ * @param {Array<es3fUniformApiTests.BasicUniformReportGL>} uniformsResults
+ * @return {boolean}
+ */
+ es3fUniformApiTests.UniformCase.prototype.uniformVsUniformsComparison = function(uniformResults, uniformsResults) {
+ /** @type {boolean} */ var success = true;
+ /** @type {es3fUniformApiTests.BasicUniformReportGL} */ var uniformsResult;
+
+ for (var uniformResultNdx = 0; uniformResultNdx < uniformResults.length; uniformResultNdx++) {
+ /** @type {es3fUniformApiTests.BasicUniformReportGL} */ var uniformResult = uniformResults[uniformResultNdx];
+ /** @type {string} */ var uniformName = uniformResult.name;
+ uniformsResult = es3fUniformApiTests.BasicUniformReportGL.findWithName(uniformsResults, uniformName);
+
+ if (uniformsResult !== null) {
+ bufferedLogToConsole('// Checking uniform ' + uniformName);
+
+ if (uniformResult.index != uniformsResult.index) {
+ bufferedLogToConsole('// FAILURE: glGetActiveUniform() and glGetUniformIndices() gave different indices for uniform ' + uniformName);
+ success = false;
+ }
+ if (uniformResult.nameLength != uniformsResult.nameLength) {
+ bufferedLogToConsole('// FAILURE: glGetActiveUniform() and glGetActiveUniforms() gave incompatible name lengths for uniform ' + uniformName);
+ success = false;
+ }
+ if (uniformResult.size != uniformsResult.size) {
+ bufferedLogToConsole('// FAILURE: glGetActiveUniform() and glGetActiveUniforms() gave different sizes for uniform ' + uniformName);
+ success = false;
+ }
+ if (uniformResult.type != uniformsResult.type) {
+ bufferedLogToConsole('// FAILURE: glGetActiveUniform() and glGetActiveUniforms() gave different types for uniform ' + uniformName);
+ success = false;
+ }
+ } else {
+ bufferedLogToConsole('// FAILURE: uniform ' + uniformName + ' was reported active by glGetActiveUniform() but not by glGetUniformIndices()');
+ success = false;
+ }
+ }
+
+ for (var uniformsResultNdx = 0; uniformsResultNdx < uniformsResults.length; uniformsResultNdx++) {
+ uniformsResult = uniformsResults[uniformsResultNdx];
+ /** @type {string} */ var uniformsName = uniformsResult.name;
+ /** @type {es3fUniformApiTests.BasicUniformReportGL} */ var uniformsResultIt = es3fUniformApiTests.BasicUniformReportGL.findWithName(uniformsResults, uniformsName);
+
+ if (uniformsResultIt === null) {
+ bufferedLogToConsole('// FAILURE: uniform ' + uniformsName + ' was reported active by glGetUniformIndices() but not by glGetActiveUniform()');
+ success = false;
+ }
+ }
+
+ return success;
+ };
+
+ /**
+ * @param {Array<es3fUniformApiTests.VarValue>} valuesDst
+ * @param {Array<es3fUniformApiTests.BasicUniform>} basicUniforms
+ * @param {WebGLProgram} programGL
+ * @return {boolean}
+ */
+ es3fUniformApiTests.UniformCase.prototype.getUniforms = function(valuesDst, basicUniforms, programGL) {
+ /** @type {boolean} */ var success = true;
+
+ for (var unifNdx = 0; unifNdx < basicUniforms.length; unifNdx++) {
+ /** @type {es3fUniformApiTests.BasicUniform} */ var uniform = basicUniforms[unifNdx];
+ /** @type {string} */ var queryName = this.m_features.ARRAY_FIRST_ELEM_NAME_NO_INDEX && uniform.elemNdx == 0 ? es3fUniformApiTests.beforeLast(uniform.name, '[') : uniform.name;
+ /** @type {WebGLUniformLocation} */ var location = gl.getUniformLocation(programGL, queryName);
+ /** @type {number} */ var size = gluShaderUtil.getDataTypeScalarSize(uniform.type);
+ /** @type {es3fUniformApiTests.VarValue} */ var value = new es3fUniformApiTests.VarValue();
+
+ if (!location) {
+ value.type = gluShaderUtil.DataType.INVALID;
+ valuesDst.push(value);
+ if (uniform.isUsedInShader) {
+ bufferedLogToConsole('// FAILURE: ' + uniform.name + ' was used in shader, but has location -1');
+ success = false;
+ }
+ continue;
+ }
+
+ value.type = uniform.type;
+
+ var result = /** @type {number} */ (gl.getUniform(programGL, location));
+
+ if (gluShaderUtil.isDataTypeSampler(uniform.type)) {
+ value.val = new es3fUniformApiTests.SamplerV();
+ value.val.samplerV.unit = result;
+ } else
+ value.val = /** @type {Array<number>} */ (result.length === undefined ? [result] : result);
+
+ valuesDst.push(value);
+
+ bufferedLogToConsole('// Got ' + uniform.name + ' value ' + es3fUniformApiTests.apiVarValueStr(value));
+ }
+
+ return success;
+ };
+
+ /**
+ * @param {Array<es3fUniformApiTests.VarValue>} values
+ * @param {Array<es3fUniformApiTests.BasicUniform>} basicUniforms
+ * @return {boolean}
+ */
+ es3fUniformApiTests.UniformCase.prototype.checkUniformDefaultValues = function(values, basicUniforms) {
+ /** @type {boolean} */ var success = true;
+
+ assertMsgOptions(
+ values.length == basicUniforms.length,
+ 'es3fUniformApiTests.UniformCase.prototype.checkUniformDefaultValues - lengths do not match',
+ false,
+ true
+ );
+
+ for (var unifNdx = 0; unifNdx < basicUniforms.length; unifNdx++) {
+ /** @type {es3fUniformApiTests.BasicUniform} */ var uniform = basicUniforms[unifNdx];
+ /** @type {es3fUniformApiTests.VarValue} */ var unifValue = values[unifNdx];
+ /** @type {number} */ var valSize = gluShaderUtil.getDataTypeScalarSize(uniform.type);
+
+ bufferedLogToConsole('// Checking uniform ' + uniform.name);
+
+ if (unifValue.type == gluShaderUtil.DataType.INVALID) // This happens when glGetUniformLocation() returned -1.
+ continue;
+
+ var CHECK_UNIFORM = function(ZERO) {
+ do {
+ for (var i = 0; i < valSize; i++) {
+ if (unifValue.val[i] != ZERO) {
+ bufferedLogToConsole('// FAILURE: uniform ' + uniform.name + ' has non-zero initial value');
+ success = false;
+ }
+ }
+ } while (false);
+ };
+
+ if (gluShaderUtil.isDataTypeFloatOrVec(uniform.type) || gluShaderUtil.isDataTypeMatrix(uniform.type))
+ CHECK_UNIFORM(0.0);
+ else if (gluShaderUtil.isDataTypeIntOrIVec(uniform.type))
+ CHECK_UNIFORM(0);
+ else if (gluShaderUtil.isDataTypeUintOrUVec(uniform.type))
+ CHECK_UNIFORM(0);
+ else if (gluShaderUtil.isDataTypeBoolOrBVec(uniform.type))
+ CHECK_UNIFORM(false);
+ else if (gluShaderUtil.isDataTypeSampler(uniform.type)) {
+ if (unifValue.val.samplerV.unit != 0) {
+ bufferedLogToConsole('// FAILURE: uniform ' + uniform.name + ' has non-zero initial value');
+ success = false;
+ }
+ } else
+ throw new Error('es3fUniformApiTests.UniformCase.prototype.checkUniformDefaultValues - invalid uniform type');
+ }
+
+ return success;
+ };
+
+ /**
+ * @param {Array<es3fUniformApiTests.BasicUniform>} basicUniforms
+ * @param {WebGLProgram} programGL
+ * @param {deRandom.Random} rnd
+ */
+ es3fUniformApiTests.UniformCase.prototype.assignUniforms = function(basicUniforms, programGL, rnd) {
+ /** @type {boolean} */ var transpose = false; //No support to transpose uniform matrices in WebGL, must always be false. (this.m_features.MATRIXMODE_ROWMAJOR) != 0;
+ /** @type {boolean} (GLboolean) */ var transposeGL = transpose;
+ /** @type {gluShaderUtil.DataType} */ var boolApiType = this.m_features.BOOLEANAPITYPE_INT ? gluShaderUtil.DataType.INT :
+ this.m_features.BOOLEANAPITYPE_UINT ? gluShaderUtil.DataType.UINT :
+ gluShaderUtil.DataType.FLOAT;
+
+ for (var unifNdx = 0; unifNdx < basicUniforms.length; unifNdx++) {
+ /** @type {es3fUniformApiTests.BasicUniform} */ var uniform = basicUniforms[unifNdx];
+ /** @type {boolean} */ var isArrayMember = uniform.elemNdx >= 0;
+ /** @type {string} */ var queryName = this.m_features.ARRAY_FIRST_ELEM_NAME_NO_INDEX && uniform.elemNdx == 0 ? es3fUniformApiTests.beforeLast(uniform.name, '[') : uniform.name;
+ /** @type {number} */ var numValuesToAssign = !isArrayMember ? 1 :
+ this.m_features.ARRAYASSIGN_FULL ? (uniform.elemNdx == 0 ? uniform.rootSize : 0) :
+ this.m_features.ARRAYASSIGN_BLOCKS_OF_TWO ? (uniform.elemNdx % 2 == 0 ? 2 : 0) :
+ /* Default: assign array elements separately */ 1;
+
+ assertMsgOptions(
+ numValuesToAssign >= 0,
+ 'es3fUniformApiTests.UniformCase.prototype.assignUniforms - number of values to assign not a positive integer',
+ false,
+ true
+ );
+ assertMsgOptions(
+ numValuesToAssign == 1 || isArrayMember,
+ 'es3fUniformApiTests.UniformCase.prototype.assignUniforms - not an array member and number of values to assign not 1',
+ false,
+ true
+ );
+
+ if (numValuesToAssign == 0) {
+ bufferedLogToConsole('// es3fUniformApiTests.Uniform ' + uniform.name + ' is covered by another glUniform*v() call to the same array');
+ continue;
+ }
+
+ /** @type {WebGLUniformLocation} */ var location = gl.getUniformLocation(programGL, queryName);
+ /** @type {number} */ var typeSize = gluShaderUtil.getDataTypeScalarSize(uniform.type);
+ /** @type {boolean} */ var assignByValue = this.m_features.UNIFORMFUNC_VALUE && !gluShaderUtil.isDataTypeMatrix(uniform.type) && numValuesToAssign == 1;
+ /** @type {Array<es3fUniformApiTests.VarValue>} */ var valuesToAssign = [];
+ /** @type {Array<number>} */ var buffer;
+
+ for (var i = 0; i < numValuesToAssign; i++) {
+ /** @type {string} */ var curName = isArrayMember ? es3fUniformApiTests.beforeLast(uniform.rootName, '[') + '[' + (uniform.elemNdx + i) + ']' : uniform.name;
+ /** @type {es3fUniformApiTests.VarValue} */ var unifValue = new es3fUniformApiTests.VarValue();
+
+ if (isArrayMember) {
+ /** @type {es3fUniformApiTests.BasicUniform} */ var elemUnif = es3fUniformApiTests.BasicUniform.findWithName(basicUniforms, curName);
+ if (elemUnif === null)
+ continue;
+ unifValue = elemUnif.finalValue;
+ } else
+ unifValue = uniform.finalValue;
+
+ /** @type {es3fUniformApiTests.VarValue} */ var apiValue = gluShaderUtil.isDataTypeBoolOrBVec(unifValue.type) ? es3fUniformApiTests.getRandomBoolRepresentation(unifValue, boolApiType, rnd) :
+ gluShaderUtil.isDataTypeSampler(unifValue.type) ? es3fUniformApiTests.getSamplerUnitValue(unifValue) :
+ unifValue;
+
+ valuesToAssign.push(gluShaderUtil.isDataTypeMatrix(apiValue.type) && transpose ? es3fUniformApiTests.getTransposeMatrix(apiValue) : apiValue);
+
+ if (gluShaderUtil.isDataTypeBoolOrBVec(uniform.type))
+ bufferedLogToConsole('// Using type ' + gluShaderUtil.getDataTypeName(boolApiType) + ' to set boolean value ' + es3fUniformApiTests.apiVarValueStr(unifValue) + ' for ' + curName);
+ else if (gluShaderUtil.isDataTypeSampler(uniform.type))
+ bufferedLogToConsole('// Texture for the sampler uniform ' + curName + ' will be filled with color ' + es3fUniformApiTests.apiVarValueStr(es3fUniformApiTests.getSamplerFillValue(uniform.finalValue)));
+ }
+
+ assertMsgOptions(
+ valuesToAssign.length > 0,
+ 'es3fUniformApiTests.UniformCase.prototype.assignUniforms - values quantity less than one',
+ false,
+ true
+ );
+
+ if (gluShaderUtil.isDataTypeFloatOrVec(valuesToAssign[0].type)) {
+ if (assignByValue) {
+ switch (typeSize) {
+ case 1: gl.uniform1f(location, valuesToAssign[0].val[0]); break;
+ case 2: gl.uniform2f(location, valuesToAssign[0].val[0], valuesToAssign[0].val[1]); break;
+ case 3: gl.uniform3f(location, valuesToAssign[0].val[0], valuesToAssign[0].val[1], valuesToAssign[0].val[2]); break;
+ case 4: gl.uniform4f(location, valuesToAssign[0].val[0], valuesToAssign[0].val[1], valuesToAssign[0].val[2], valuesToAssign[0].val[3]); break;
+ default:
+ throw new Error('es3fUniformApiTests.UniformCase.prototype.assignUniforms - Invalid type size');
+ }
+ } else {
+ buffer = new Array(valuesToAssign.length * typeSize);
+ for (var i = 0; i < buffer.length; i++)
+ buffer[i] = valuesToAssign[Math.floor(i / typeSize)].val[i % typeSize];
+
+ switch (typeSize) {
+ case 1: gl.uniform1fv(location, buffer); break;
+ case 2: gl.uniform2fv(location, buffer); break;
+ case 3: gl.uniform3fv(location, buffer); break;
+ case 4: gl.uniform4fv(location, buffer); break;
+ default:
+ throw new Error('es3fUniformApiTests.UniformCase.prototype.assignUniforms - Invalid type size');
+ }
+ }
+ } else if (gluShaderUtil.isDataTypeMatrix(valuesToAssign[0].type)) {
+ assertMsgOptions(
+ !assignByValue,
+ 'es3fUniformApiTests.UniformCase.prototype.assignUniforms - assigning by value in matrix type',
+ false, true
+ );
+
+ buffer = new Array(valuesToAssign.length * typeSize);
+ for (var i = 0; i < buffer.length; i++)
+ buffer[i] = valuesToAssign[Math.floor(i / typeSize)].val[i % typeSize];
+
+ switch (uniform.type) {
+ case gluShaderUtil.DataType.FLOAT_MAT2: gl.uniformMatrix2fv(location, transposeGL, new Float32Array(buffer)); break;
+ case gluShaderUtil.DataType.FLOAT_MAT3: gl.uniformMatrix3fv(location, transposeGL, new Float32Array(buffer)); break;
+ case gluShaderUtil.DataType.FLOAT_MAT4: gl.uniformMatrix4fv(location, transposeGL, new Float32Array(buffer)); break;
+ case gluShaderUtil.DataType.FLOAT_MAT2X3: gl.uniformMatrix2x3fv(location, transposeGL, new Float32Array(buffer)); break;
+ case gluShaderUtil.DataType.FLOAT_MAT2X4: gl.uniformMatrix2x4fv(location, transposeGL, new Float32Array(buffer)); break;
+ case gluShaderUtil.DataType.FLOAT_MAT3X2: gl.uniformMatrix3x2fv(location, transposeGL, new Float32Array(buffer)); break;
+ case gluShaderUtil.DataType.FLOAT_MAT3X4: gl.uniformMatrix3x4fv(location, transposeGL, new Float32Array(buffer)); break;
+ case gluShaderUtil.DataType.FLOAT_MAT4X2: gl.uniformMatrix4x2fv(location, transposeGL, new Float32Array(buffer)); break;
+ case gluShaderUtil.DataType.FLOAT_MAT4X3: gl.uniformMatrix4x3fv(location, transposeGL, new Float32Array(buffer)); break;
+ default:
+ throw new Error('es3fUniformApiTests.UniformCase.prototype.assignUniforms - Invalid uniform type');
+ }
+ } else if (gluShaderUtil.isDataTypeIntOrIVec(valuesToAssign[0].type)) {
+ if (assignByValue) {
+ switch (typeSize) {
+ case 1: gl.uniform1i(location, valuesToAssign[0].val[0]); break;
+ case 2: gl.uniform2i(location, valuesToAssign[0].val[0], valuesToAssign[0].val[1]); break;
+ case 3: gl.uniform3i(location, valuesToAssign[0].val[0], valuesToAssign[0].val[1], valuesToAssign[0].val[2]); break;
+ case 4: gl.uniform4i(location, valuesToAssign[0].val[0], valuesToAssign[0].val[1], valuesToAssign[0].val[2], valuesToAssign[0].val[3]); break;
+ default:
+ throw new Error('es3fUniformApiTests.UniformCase.prototype.assignUniforms - Invalid type size');
+ }
+ } else {
+ buffer = new Array(valuesToAssign.length * typeSize);
+ for (var i = 0; i < buffer.length; i++)
+ buffer[i] = valuesToAssign[Math.floor(i / typeSize)].val[i % typeSize];
+
+ switch (typeSize) {
+ case 1: gl.uniform1iv(location, buffer); break;
+ case 2: gl.uniform2iv(location, buffer); break;
+ case 3: gl.uniform3iv(location, buffer); break;
+ case 4: gl.uniform4iv(location, buffer); break;
+ default:
+ throw new Error('es3fUniformApiTests.UniformCase.prototype.assignUniforms - Invalid type size');
+ }
+ }
+ } else if (gluShaderUtil.isDataTypeUintOrUVec(valuesToAssign[0].type)) {
+ if (assignByValue) {
+ switch (typeSize) {
+ case 1: gl.uniform1ui(location, valuesToAssign[0].val[0]); break;
+ case 2: gl.uniform2ui(location, valuesToAssign[0].val[0], valuesToAssign[0].val[1]); break;
+ case 3: gl.uniform3ui(location, valuesToAssign[0].val[0], valuesToAssign[0].val[1], valuesToAssign[0].val[2]); break;
+ case 4: gl.uniform4ui(location, valuesToAssign[0].val[0], valuesToAssign[0].val[1], valuesToAssign[0].val[2], valuesToAssign[0].val[3]); break;
+ default:
+ throw new Error('es3fUniformApiTests.UniformCase.prototype.assignUniforms - Invalid type size');
+ }
+ } else {
+ buffer = new Array(valuesToAssign.length * typeSize);
+ for (var i = 0; i < buffer.length; i++)
+ buffer[i] = valuesToAssign[Math.floor(i / typeSize)].val[i % typeSize];
+
+ switch (typeSize) {
+ case 1: gl.uniform1uiv(location, buffer); break;
+ case 2: gl.uniform2uiv(location, buffer); break;
+ case 3: gl.uniform3uiv(location, buffer); break;
+ case 4: gl.uniform4uiv(location, buffer); break;
+ default:
+ throw new Error('es3fUniformApiTests.UniformCase.prototype.assignUniforms - Invalid type size');
+ }
+ }
+ } else if (gluShaderUtil.isDataTypeSampler(valuesToAssign[0].type)) {
+ if (assignByValue)
+ gl.uniform1i(location, uniform.finalValue.val.samplerV.unit);
+ else {
+ var unit = /** @type {Array<number>} */ (uniform.finalValue.val);
+ gl.uniform1iv(location, unit);
+ }
+ } else
+ throw new Error('es3fUniformApiTests.UniformCase.prototype.assignUniforms - Invalid uniform type');
+ }
+ };
+
+ /**
+ * @param {Array<es3fUniformApiTests.VarValue>} values
+ * @param {Array<es3fUniformApiTests.BasicUniform>} basicUniforms
+ * @return {boolean}
+ */
+ es3fUniformApiTests.UniformCase.prototype.compareUniformValues = function(values, basicUniforms) {
+ /** @type {boolean} */ var success = true;
+
+ for (var unifNdx = 0; unifNdx < basicUniforms.length; unifNdx++) {
+ /** @type {es3fUniformApiTests.BasicUniform} */ var uniform = basicUniforms[unifNdx];
+ /** @type {es3fUniformApiTests.VarValue} */ var unifValue = values[unifNdx];
+
+ bufferedLogToConsole('// Checking uniform ' + uniform.name);
+
+ if (unifValue.type == gluShaderUtil.DataType.INVALID) // This happens when glGetUniformLocation() returned -1.
+ continue;
+
+ if (!es3fUniformApiTests.apiVarValueEquals(unifValue, uniform.finalValue)) {
+ bufferedLogToConsole('// FAILURE: value obtained with glGetUniform*() for uniform ' + uniform.name + ' differs from value set with glUniform*()');
+ success = false;
+ }
+ }
+
+ return success;
+ };
+
+ /** @const @type {number} */ es3fUniformApiTests.VIEWPORT_WIDTH = 128;
+ /** @const @type {number} */ es3fUniformApiTests.VIEWPORT_HEIGHT = 128;
+
+ /**
+ * @param {Array<es3fUniformApiTests.BasicUniform>} basicUniforms
+ * @param {gluShaderProgram.ShaderProgram} program
+ * @param {deRandom.Random} rnd
+ * @return {boolean}
+ */
+ es3fUniformApiTests.UniformCase.prototype.renderTest = function(basicUniforms, program, rnd) {
+ //const tcu::RenderTarget& renderTarget = m_context.getRenderTarget();
+ /** @const */ var viewportW = Math.min(gl.canvas.width, es3fUniformApiTests.VIEWPORT_WIDTH);
+ /** @const */ var viewportH = Math.min(gl.canvas.height, es3fUniformApiTests.VIEWPORT_HEIGHT);
+ /** @const */ var viewportX = rnd.getInt(0, gl.canvas.width - viewportW);
+ /** @const */ var viewportY = rnd.getInt(0, gl.canvas.height - viewportH);
+ /** @type {tcuSurface.Surface} */ var renderedImg = new tcuSurface.Surface(viewportW, viewportH);
+
+ // Assert that no two samplers of different types have the same texture unit - this is an error in GL.
+ for (var i = 0; i < basicUniforms.length; i++) {
+ if (gluShaderUtil.isDataTypeSampler(basicUniforms[i].type)) {
+ for (var j = 0; j < i; j++) {
+ if (gluShaderUtil.isDataTypeSampler(basicUniforms[j].type) && basicUniforms[i].type != basicUniforms[j].type)
+ assertMsgOptions(
+ basicUniforms[i].finalValue.val.samplerV.unit != basicUniforms[j].finalValue.val.samplerV.unit,
+ 'es3fUniformApiTests.UniformCase.prototype.renderTest - sampler units have the same texture unit',
+ false, true
+ );
+ }
+ }
+ }
+
+ for (var i = 0; i < basicUniforms.length; i++) {
+ if (gluShaderUtil.isDataTypeSampler(basicUniforms[i].type) && this.m_filledTextureUnits.indexOf(basicUniforms[i].finalValue.val) == -1) {
+ bufferedLogToConsole('// Filling texture at unit ' + es3fUniformApiTests.apiVarValueStr(basicUniforms[i].finalValue) + ' with color ' + es3fUniformApiTests.shaderVarValueStr(basicUniforms[i].finalValue));
+ this.setupTexture(basicUniforms[i].finalValue);
+ }
+ }
+
+ gl.viewport(viewportX, viewportY, viewportW, viewportH);
+
+ /** @type {Float32Array} */ var position = new Float32Array([
+ -1.0, -1.0, 0.0, 1.0,
+ -1.0, 1.0, 0.0, 1.0,
+ 1.0, -1.0, 0.0, 1.0,
+ 1.0, 1.0, 0.0, 1.0
+ ]);
+
+ /** @type {Uint16Array} */
+ var indices = new Uint16Array([0, 1, 2, 2, 1, 3]);
+
+ /** @type {number} */ var posLoc = gl.getAttribLocation(program.getProgram(), 'a_position');
+ gl.enableVertexAttribArray(posLoc);
+
+ var gl_position_buffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, gl_position_buffer);
+ gl.bufferData(gl.ARRAY_BUFFER, position, gl.STATIC_DRAW);
+ gl.vertexAttribPointer(posLoc, 4, gl.FLOAT, false, 0, 0);
+
+ var gl_index_buffer = gl.createBuffer();
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, gl_index_buffer);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW);
+
+ gl.drawElements(gl.TRIANGLES, indices.length, gl.UNSIGNED_SHORT, 0);
+
+ renderedImg.readViewport(gl, [viewportX, viewportY, viewportW, viewportH]);
+
+ /** @type {number} */ var numFailedPixels = 0;
+ var whitePixel = new gluDrawUtil.Pixel([255.0, 255.0, 255.0, 255.0]);
+ for (var y = 0; y < renderedImg.getHeight(); y++) {
+ for (var x = 0; x < renderedImg.getWidth(); x++) {
+ var currentPixel = new gluDrawUtil.Pixel(renderedImg.getPixel(x, y));
+ if (!whitePixel.equals(currentPixel))
+ numFailedPixels += 1;
+ }
+ }
+
+ if (numFailedPixels > 0) {
+ //TODO: log << TestLog::Image("RenderedImage", "Rendered image", renderedImg);
+ bufferedLogToConsole('FAILURE: image comparison failed, got ' + numFailedPixels + ' non-white pixels');
+ return false;
+ } else {
+ bufferedLogToConsole('Success: got all-white pixels (all uniforms have correct values)');
+ return true;
+ }
+ };
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ es3fUniformApiTests.UniformCase.prototype.iterate = function() {
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name) ^ deRandom.getBaseSeed());
+ /** @type {Array<es3fUniformApiTests.BasicUniform>} */ var basicUniforms = [];
+ /** @type {Array<es3fUniformApiTests.BasicUniformReportRef>} */ var basicUniformReportsRef = [];
+
+ /** @type {number} */ var samplerUnitCounter = 0;
+ for (var i = 0; i < this.m_uniformCollection.getNumUniforms(); i++)
+ samplerUnitCounter = this.generateBasicUniforms(basicUniforms, basicUniformReportsRef, this.m_uniformCollection.getUniform(i).type, this.m_uniformCollection.getUniform(i).name, true, samplerUnitCounter, rnd);
+
+ /** @type {string} */ var vertexSource = this.generateVertexSource(basicUniforms);
+ /** @type {string} */ var fragmentSource = this.generateFragmentSource(basicUniforms);
+ /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertexSource, fragmentSource));
+
+ bufferedLogToConsole(program.getProgramInfo().infoLog);
+
+ if (!program.isOk()) {
+ testFailedOptions('Compile failed', false);
+ return tcuTestCase.IterateResult.STOP;
+ }
+
+ gl.useProgram(program.getProgram());
+
+ /** @type {boolean} */ var success = this.test(basicUniforms, basicUniformReportsRef, program, rnd);
+ assertMsgOptions(success, '', true, false);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @enum {number}
+ */
+ es3fUniformApiTests.CaseType = {
+ UNIFORM: 0, //!< Check info returned by glGetActiveUniform().
+ INDICES_UNIFORMSIV: 1, //!< Check info returned by glGetUniformIndices() + glGetActiveUniforms(). TODO: Check 'IV' part
+ CONSISTENCY: 2 //!< Query info with both above methods, and check consistency.
+ };
+
+ /**
+ * es3fUniformApiTests.UniformInfoQueryCase class
+ * @constructor
+ * @param {string} name
+ * @param {string} description
+ * @param {es3fUniformApiTests.CaseShaderType} shaderType
+ * @param {es3fUniformApiTests.UniformCollection} uniformCollection
+ * @param {es3fUniformApiTests.CaseType} caseType
+ * @param {es3fUniformApiTests.Feature} additionalFeatures
+ * @extends {es3fUniformApiTests.UniformCase}
+ */
+ es3fUniformApiTests.UniformInfoQueryCase = function(name, description, shaderType, uniformCollection, caseType, additionalFeatures) {
+ es3fUniformApiTests.UniformCase.call(this, name, description);
+ this.newB(shaderType, uniformCollection, additionalFeatures);
+ /** @type {es3fUniformApiTests.CaseType} */ this.m_caseType = caseType;
+ };
+
+ es3fUniformApiTests.UniformInfoQueryCase.prototype = Object.create(es3fUniformApiTests.UniformCase.prototype);
+ /** Constructor restore */
+ es3fUniformApiTests.UniformInfoQueryCase.prototype.constructor = es3fUniformApiTests.UniformInfoQueryCase;
+
+ /**
+ * @param {es3fUniformApiTests.CaseType} caseType
+ * @return {?string}
+ */
+ es3fUniformApiTests.UniformInfoQueryCase.getCaseTypeName = function(caseType) {
+ switch (caseType) {
+ case es3fUniformApiTests.CaseType.UNIFORM: return 'active_uniform';
+ case es3fUniformApiTests.CaseType.INDICES_UNIFORMSIV: return 'indices_active_uniformsiv';
+ case es3fUniformApiTests.CaseType.CONSISTENCY: return 'consistency';
+ default:
+ throw new Error('Invalid type');
+ }
+ };
+
+ /**
+ * @param {es3fUniformApiTests.CaseType} caseType
+ * @return {?string}
+ */
+ es3fUniformApiTests.UniformInfoQueryCase.getCaseTypeDescription = function(caseType) {
+ switch (caseType) {
+ case es3fUniformApiTests.CaseType.UNIFORM: return 'Test glGetActiveUniform()';
+ case es3fUniformApiTests.CaseType.INDICES_UNIFORMSIV: return 'Test glGetUniformIndices() along with glGetActiveUniforms()';
+ case es3fUniformApiTests.CaseType.CONSISTENCY: return 'Check consistency between results from glGetActiveUniform() and glGetUniformIndices() + glGetActiveUniforms()';
+ default:
+ throw new Error('Invalid type');
+ }
+ };
+
+ // \note Although this is only used in UniformApiTest::es3fUniformApiTests.init, it needs to be defined here as it's used as a template argument.
+ /**
+ * @constructor
+ * @param {?string} name
+ * @param {es3fUniformApiTests.UniformCollection} uniformCollection_
+ */
+ es3fUniformApiTests.UniformCollectionCase = function(name, uniformCollection_) {
+ /** @type {string} */ this.namePrefix = name ? name + '_' : '';
+ /** @type {es3fUniformApiTests.UniformCollection} (SharedPtr) */ this.uniformCollection = uniformCollection_;
+ };
+
+ /**
+ * @param {Array<es3fUniformApiTests.BasicUniform>} basicUniforms
+ * @param {Array<es3fUniformApiTests.BasicUniformReportRef>} basicUniformReportsRef
+ * @param {gluShaderProgram.ShaderProgram} program
+ * @param {deRandom.Random} rnd
+ * @return {boolean}
+ */
+ es3fUniformApiTests.UniformInfoQueryCase.prototype.test = function(basicUniforms, basicUniformReportsRef, program, rnd) {
+ /** @type {WebGLProgram} */ var programGL = program.getProgram();
+ /** @type {Array<es3fUniformApiTests.BasicUniformReportGL>} */ var basicUniformReportsUniform = [];
+ /** @type {Array<es3fUniformApiTests.BasicUniformReportGL>} */ var basicUniformReportsUniforms = [];
+ /** @type {boolean} */ var success;
+
+ if (this.m_caseType == es3fUniformApiTests.CaseType.UNIFORM || this.m_caseType == es3fUniformApiTests.CaseType.CONSISTENCY) {
+ success = false;
+
+ //TODO:: const ScopedLogSection section(log, "InfoGetActiveUniform", "es3fUniformApiTests.Uniform information queries with glGetActiveUniform()");
+ success = this.getActiveUniformsOneByOne(basicUniformReportsUniform, basicUniformReportsRef, programGL);
+
+ if (!success) {
+ if (this.m_caseType == es3fUniformApiTests.CaseType.UNIFORM)
+ return false;
+ else {
+ assertMsgOptions(
+ this.m_caseType == es3fUniformApiTests.CaseType.CONSISTENCY,
+ 'es3fUniformApiTests.UniformInfoQueryCase.prototype.test - case type is not consistency',
+ false,
+ true
+ );
+ bufferedLogToConsole('// Note: this is a consistency case, so ignoring above failure(s)');
+ }
+ }
+ }
+
+ if (this.m_caseType == es3fUniformApiTests.CaseType.INDICES_UNIFORMSIV || this.m_caseType == es3fUniformApiTests.CaseType.CONSISTENCY) {
+ success = false;
+
+ //TODO: const ScopedLogSection section(log, "InfoGetActiveUniforms", "es3fUniformApiTests.Uniform information queries with glGetUniformIndices() and glGetActiveUniforms()");
+ success = this.getActiveUniforms(basicUniformReportsUniforms, basicUniformReportsRef, programGL);
+
+ if (!success) {
+ if (this.m_caseType == es3fUniformApiTests.CaseType.INDICES_UNIFORMSIV)
+ return false;
+ else {
+ assertMsgOptions(
+ this.m_caseType == es3fUniformApiTests.CaseType.CONSISTENCY,
+ 'es3fUniformApiTests.UniformInfoQueryCase.prototype.test - case type is not consistency',
+ false,
+ true
+ );
+ bufferedLogToConsole('// Note: this is a consistency case, so ignoring above failure(s)');
+ }
+ }
+ }
+
+ if (this.m_caseType == es3fUniformApiTests.CaseType.CONSISTENCY) {
+ success = false;
+
+ //TODO: const ScopedLogSection section(log, "CompareUniformVsUniforms", "Comparison of results from glGetActiveUniform() and glGetActiveUniforms()");
+ success = this.uniformVsUniformsComparison(basicUniformReportsUniform, basicUniformReportsUniforms);
+
+ if (!success)
+ return false;
+ }
+
+ return true;
+ };
+
+ /**
+ * @enum {number}
+ */
+ es3fUniformApiTests.ValueToCheck = {
+ INITIAL: 0, //!< Verify the initial values of the uniforms (i.e. check that they're zero).
+ ASSIGNED: 1 //!< Assign values to uniforms with glUniform*(), and check those.
+ };
+
+ /**
+ * @enum {number}
+ */
+ es3fUniformApiTests.CheckMethod = {
+ GET_UNIFORM: 0, //!< Check values with glGetUniform*().
+ RENDER: 1 //!< Check values by rendering with the value-checking shader.
+ };
+
+ /**
+ * @enum {number}
+ */
+ es3fUniformApiTests.AssignMethod = {
+ POINTER: 0,
+ VALUE: 1
+ };
+
+ /**
+ * es3fUniformApiTests.UniformValueCase test class
+ * @constructor
+ * @param {string} name
+ * @param {string} description
+ * @param {es3fUniformApiTests.CaseShaderType} shaderType
+ * @param {es3fUniformApiTests.UniformCollection} uniformCollection (SharedPtr)
+ * @param {es3fUniformApiTests.ValueToCheck} valueToCheck
+ * @param {es3fUniformApiTests.CheckMethod} checkMethod
+ * @param {?es3fUniformApiTests.AssignMethod} assignMethod
+ * @param {es3fUniformApiTests.Feature} additionalFeatures
+ * @extends {es3fUniformApiTests.UniformCase}
+ */
+ es3fUniformApiTests.UniformValueCase = function(name, description, shaderType, uniformCollection, valueToCheck, checkMethod, assignMethod, additionalFeatures) {
+ es3fUniformApiTests.UniformCase.call(this, name, description);
+
+ additionalFeatures.UNIFORMVALUE_ZERO |= valueToCheck == es3fUniformApiTests.ValueToCheck.INITIAL;
+ additionalFeatures.UNIFORMFUNC_VALUE |= assignMethod == es3fUniformApiTests.AssignMethod.VALUE;
+ this.newB(shaderType, uniformCollection, additionalFeatures);
+
+ this.m_valueToCheck = valueToCheck;
+ this.m_checkMethod = checkMethod;
+
+ assertMsgOptions(
+ !(assignMethod === undefined && valueToCheck == es3fUniformApiTests.ValueToCheck.ASSIGNED),
+ 'es3fUniformApiTests.UniformValueCase - assign method is undefined when value to check requires it',
+ false,
+ true
+ );
+ };
+
+ es3fUniformApiTests.UniformValueCase.prototype = Object.create(es3fUniformApiTests.UniformCase.prototype);
+ /** Constructor restore */
+ es3fUniformApiTests.UniformValueCase.prototype.constructor = es3fUniformApiTests.UniformValueCase;
+
+ /**
+ * @param {es3fUniformApiTests.ValueToCheck} valueToCheck
+ * @return {?string}
+ */
+ es3fUniformApiTests.UniformValueCase.getValueToCheckName = function(valueToCheck) {
+ switch (valueToCheck) {
+ case es3fUniformApiTests.ValueToCheck.INITIAL: return 'initial';
+ case es3fUniformApiTests.ValueToCheck.ASSIGNED: return 'assigned';
+ default: throw new Error('es3fUniformApiTests.UniformValueCase.getValueToCheckName - Invalid value to check option');
+ }
+ };
+
+ /**
+ * @param {es3fUniformApiTests.ValueToCheck} valueToCheck
+ * @return {?string}
+ */
+ es3fUniformApiTests.UniformValueCase.getValueToCheckDescription = function(valueToCheck) {
+ switch (valueToCheck) {
+ case es3fUniformApiTests.ValueToCheck.INITIAL: return 'Check initial uniform values (zeros)';
+ case es3fUniformApiTests.ValueToCheck.ASSIGNED: return 'Check assigned uniform values';
+ default: throw new Error('es3fUniformApiTests.UniformValueCase.getValueToCheckDescription - Invalid value to check option');
+ }
+ };
+
+ /**
+ * @param {es3fUniformApiTests.CheckMethod} checkMethod
+ * @return {?string}
+ */
+ es3fUniformApiTests.UniformValueCase.getCheckMethodName = function(checkMethod) {
+ switch (checkMethod) {
+ case es3fUniformApiTests.CheckMethod.GET_UNIFORM: return 'get_uniform';
+ case es3fUniformApiTests.CheckMethod.RENDER: return 'render';
+ default: throw new Error('es3fUniformApiTests.UniformValueCase.getCheckMethodName - Invalid check method');
+ }
+ };
+
+ /**
+ * @param {es3fUniformApiTests.CheckMethod} checkMethod
+ * @return {?string}
+ */
+ es3fUniformApiTests.UniformValueCase.getCheckMethodDescription = function(checkMethod) {
+ switch (checkMethod) {
+ case es3fUniformApiTests.CheckMethod.GET_UNIFORM: return 'Verify values with glGetUniform*()';
+ case es3fUniformApiTests.CheckMethod.RENDER: return 'Verify values by rendering';
+ default: throw new Error('es3fUniformApiTests.UniformValueCase.getCheckMethodDescription - Invalid check method');
+ }
+ };
+
+ /**
+ * @param {es3fUniformApiTests.AssignMethod} assignMethod
+ * @return {?string}
+ */
+ es3fUniformApiTests.UniformValueCase.getAssignMethodName = function(assignMethod) {
+ switch (assignMethod) {
+ case es3fUniformApiTests.AssignMethod.POINTER: return 'by_pointer';
+ case es3fUniformApiTests.AssignMethod.VALUE: return 'by_value';
+ default: throw new Error('es3fUniformApiTests.UniformValueCase.getAssignMethodName - Invalid assign method');
+ }
+ };
+
+ /**
+ * @param {es3fUniformApiTests.AssignMethod} assignMethod
+ * @return {?string}
+ */
+ es3fUniformApiTests.UniformValueCase.getAssignMethodDescription = function(assignMethod) {
+ switch (assignMethod) {
+ case es3fUniformApiTests.AssignMethod.POINTER: return 'Assign values by-pointer';
+ case es3fUniformApiTests.AssignMethod.VALUE: return 'Assign values by-value';
+ default: throw new Error('es3fUniformApiTests.UniformValueCase.getAssignMethodDescription - Invalid assign method');
+ }
+ };
+
+ /**
+ * es3fUniformApiTests.UniformValueCase test function
+ * @param {Array<es3fUniformApiTests.BasicUniform>} basicUniforms
+ * @param {Array<es3fUniformApiTests.BasicUniformReportRef>} basicUniformReportsRef
+ * @param {gluShaderProgram.ShaderProgram} program
+ * @param {deRandom.Random} rnd
+ * @return {boolean}
+ */
+ es3fUniformApiTests.UniformValueCase.prototype.test = function(basicUniforms, basicUniformReportsRef, program, rnd) {
+ /** @type {WebGLProgram} */ var programGL = program.getProgram();
+
+ if (this.m_valueToCheck == es3fUniformApiTests.ValueToCheck.ASSIGNED) {
+ //TODO: const ScopedLogSection section(log, "UniformAssign", "es3fUniformApiTests.Uniform value assignments");
+ this.assignUniforms(basicUniforms, programGL, rnd);
+ } else
+ assertMsgOptions(
+ this.m_valueToCheck == es3fUniformApiTests.ValueToCheck.INITIAL,
+ 'es3fUniformApiTests.UniformValueCase.prototype.test - value to check not initial',
+ false, true
+ );
+
+ /** @type {boolean}*/ var success;
+
+ if (this.m_checkMethod == es3fUniformApiTests.CheckMethod.GET_UNIFORM) {
+ /** @type {Array<es3fUniformApiTests.VarValue>} */ var values = [];
+
+ //TODO: const ScopedLogSection section(log, "GetUniforms", "es3fUniformApiTests.Uniform value query");
+ success = this.getUniforms(values, basicUniforms, program.getProgram());
+
+ if (!success)
+ return false;
+
+ if (this.m_valueToCheck == es3fUniformApiTests.ValueToCheck.ASSIGNED) {
+ //TODO: const ScopedLogSection section(log, "ValueCheck", "Verify that the reported values match the assigned values");
+ success = this.compareUniformValues(values, basicUniforms);
+
+ if (!success)
+ return false;
+ } else {
+ assertMsgOptions(
+ this.m_valueToCheck == es3fUniformApiTests.ValueToCheck.INITIAL,
+ 'es3fUniformApiTests.UniformValueCase.prototype.test - value to check not initial',
+ false, true
+ );
+
+ //TODO: const ScopedLogSection section(log, "ValueCheck", "Verify that the uniforms have correct initial values (zeros)");
+ success = this.checkUniformDefaultValues(values, basicUniforms);
+
+ if (!success)
+ return false;
+ }
+ } else {
+ assertMsgOptions(
+ this.m_checkMethod == es3fUniformApiTests.CheckMethod.RENDER,
+ 'es3fUniformApiTests.UniformValueCase.prototype.test - check method different than RENDER',
+ false, true
+ );
+
+ //TODO: const ScopedLogSection section(log, "RenderTest", "Render test");
+ success = this.renderTest(basicUniforms, program, rnd);
+
+ if (!success)
+ return false;
+ }
+
+ return true;
+ };
+
+ /**
+ * es3fUniformApiTests.RandomUniformCase test class
+ * @constructor
+ * @param {string} name
+ * @param {string} description
+ * @param {number} seed
+ * @extends {es3fUniformApiTests.UniformCase}
+ */
+ es3fUniformApiTests.RandomUniformCase = function(name, description, seed) {
+ es3fUniformApiTests.UniformCase.call(this, name, description);
+ this.newC(seed ^ deRandom.getBaseSeed());
+ };
+
+ es3fUniformApiTests.RandomUniformCase.prototype = Object.create(es3fUniformApiTests.UniformCase.prototype);
+ /** Constructor restore */
+ es3fUniformApiTests.RandomUniformCase.prototype.constructor = es3fUniformApiTests.RandomUniformCase;
+
+ /**
+ * @param {Array<es3fUniformApiTests.BasicUniform>} basicUniforms
+ * @param {Array<es3fUniformApiTests.BasicUniformReportRef>} basicUniformReportsRef
+ * @param {gluShaderProgram.ShaderProgram} program
+ * @param {deRandom.Random} rnd
+ * @return {boolean}
+ */
+ es3fUniformApiTests.RandomUniformCase.prototype.test = function(basicUniforms, basicUniformReportsRef, program, rnd) {
+ // \note Different sampler types may not be bound to same unit when rendering.
+ /** @type {boolean}*/ var renderingPossible = !this.m_features.UNIFORMVALUE_ZERO || !this.m_uniformCollection.containsSeveralSamplerTypes();
+
+ /** @type {boolean} */ var performGetActiveUniforms = rnd.getBool();
+ /** @type {boolean} */ var performGetActiveUniformsiv = rnd.getBool();
+ /** @type {boolean} */ var performUniformVsUniformsivComparison = performGetActiveUniforms && performGetActiveUniformsiv && rnd.getBool();
+ /** @type {boolean} */ var performGetUniforms = rnd.getBool();
+ /** @type {boolean} */ var performCheckUniformDefaultValues = performGetUniforms && rnd.getBool();
+ /** @type {boolean} */ var performAssignUniforms = rnd.getBool();
+ /** @type {boolean} */ var performCompareUniformValues = performGetUniforms && performAssignUniforms && rnd.getBool();
+ /** @type {boolean} */ var performRenderTest = renderingPossible && performAssignUniforms && rnd.getBool();
+ /** @type {WebGLProgram} */ var programGL = program.getProgram();
+
+ if (!(performGetActiveUniforms || performGetActiveUniformsiv || performUniformVsUniformsivComparison || performGetUniforms || performCheckUniformDefaultValues || performAssignUniforms || performCompareUniformValues || performRenderTest))
+ performGetActiveUniforms = true; // Do something at least.
+
+ var PERFORM_AND_CHECK = function(CALL, SECTION_NAME, SECTION_DESCRIPTION) {
+ //TODO: const ScopedLogSection section(log, (SECTION_NAME), (SECTION_DESCRIPTION));
+ /** @type {boolean} */ var success = CALL();
+ if (!success)
+ return false;
+ };
+
+ /** @type {Array<es3fUniformApiTests.BasicUniformReportGL>} */ var reportsUniform = [];
+ /** @type {Array<es3fUniformApiTests.BasicUniformReportGL>} */ var reportsUniformsiv = [];
+
+ var current = this; //To use "this" in anonymous function.
+
+ if (performGetActiveUniforms)
+ PERFORM_AND_CHECK(function() {current.getActiveUniformsOneByOne(reportsUniform, basicUniformReportsRef, programGL);}, 'InfoGetActiveUniform', 'es3fUniformApiTests.Uniform information queries with glGetActiveUniform()');
+
+ if (performGetActiveUniformsiv)
+ PERFORM_AND_CHECK(function() {current.getActiveUniforms(reportsUniformsiv, basicUniformReportsRef, programGL);}, 'InfoGetActiveUniformsiv', 'es3fUniformApiTests.Uniform information queries with glGetIndices() and glGetActiveUniformsiv()');
+
+ if (performUniformVsUniformsivComparison)
+ PERFORM_AND_CHECK(function() {current.uniformVsUniformsComparison(reportsUniform, reportsUniformsiv);}, 'CompareUniformVsUniformsiv', 'Comparison of results from glGetActiveUniform() and glGetActiveUniformsiv()');
+
+ /** @type {Array<es3fUniformApiTests.VarValue>} */ var uniformDefaultValues = [];
+
+ if (performGetUniforms)
+ PERFORM_AND_CHECK(function() {current.getUniforms(uniformDefaultValues, basicUniforms, programGL);}, 'GetUniformDefaults', 'es3fUniformApiTests.Uniform default value query');
+
+ if (performCheckUniformDefaultValues)
+ PERFORM_AND_CHECK(function() {current.checkUniformDefaultValues(uniformDefaultValues, basicUniforms);}, 'DefaultValueCheck', 'Verify that the uniforms have correct initial values (zeros)');
+
+ /** @type {Array<es3fUniformApiTests.VarValue>} */ var uniformValues = [];
+
+ if (performAssignUniforms) {
+ //TODO: const ScopedLogSection section(log, "UniformAssign", "es3fUniformApiTests.Uniform value assignments");
+ this.assignUniforms(basicUniforms, programGL, rnd);
+ }
+
+ if (performCompareUniformValues) {
+ PERFORM_AND_CHECK(function() {current.getUniforms(uniformValues, basicUniforms, programGL);}, 'GetUniforms', 'es3fUniformApiTests.Uniform value query');
+ PERFORM_AND_CHECK(function() {current.compareUniformValues(uniformValues, basicUniforms);}, 'ValueCheck', 'Verify that the reported values match the assigned values');
+ }
+
+ if (performRenderTest)
+ PERFORM_AND_CHECK(function() {current.renderTest(basicUniforms, program, rnd);}, 'RenderTest', 'Render test');
+
+ return true;
+ };
+
+ /**
+ * Initializes the tests to be performed.
+ */
+ es3fUniformApiTests.init = function() {
+ var state = tcuTestCase.runner;
+ var testGroup = state.testCases;
+
+ // Generate sets of UniformCollections that are used by several cases.
+ /**
+ * @enum
+ */
+ var UniformCollections = {
+ BASIC: 0,
+ BASIC_ARRAY: 1,
+ BASIC_STRUCT: 2,
+ STRUCT_IN_ARRAY: 3,
+ ARRAY_IN_STRUCT: 4,
+ NESTED_STRUCTS_ARRAYS: 5,
+ MULTIPLE_BASIC: 6,
+ MULTIPLE_BASIC_ARRAY: 7,
+ MULTIPLE_NESTED_STRUCTS_ARRAYS: 8
+ };
+
+ /**
+ * @constructor
+ */
+ var UniformCollectionGroup = function() {
+ /** @type {string} */ this.name = '';
+ /** @type {Array<es3fUniformApiTests.UniformCollectionCase>} */ this.cases = [];
+ };
+
+ /** @type {Array<UniformCollectionGroup>} */ var defaultUniformCollections = new Array(Object.keys(UniformCollections).length);
+
+ /** @type {string} */ var name;
+
+ //Initialize
+ for (var i = 0; i < defaultUniformCollections.length; i++) defaultUniformCollections[i] = new UniformCollectionGroup();
+
+ defaultUniformCollections[UniformCollections.BASIC].name = 'basic';
+ defaultUniformCollections[UniformCollections.BASIC_ARRAY].name = 'basic_array';
+ defaultUniformCollections[UniformCollections.BASIC_STRUCT].name = 'basic_struct';
+ defaultUniformCollections[UniformCollections.STRUCT_IN_ARRAY].name = 'struct_in_array';
+ defaultUniformCollections[UniformCollections.ARRAY_IN_STRUCT].name = 'array_in_struct';
+ defaultUniformCollections[UniformCollections.NESTED_STRUCTS_ARRAYS].name = 'nested_structs_arrays';
+ defaultUniformCollections[UniformCollections.MULTIPLE_BASIC].name = 'multiple_basic';
+ defaultUniformCollections[UniformCollections.MULTIPLE_BASIC_ARRAY].name = 'multiple_basic_array';
+ defaultUniformCollections[UniformCollections.MULTIPLE_NESTED_STRUCTS_ARRAYS].name = 'multiple_nested_structs_arrays';
+
+ for (var dataTypeNdx = 0; dataTypeNdx < es3fUniformApiTests.s_testDataTypes.length; dataTypeNdx++) {
+ /** @type {gluShaderUtil.DataType} */ var dataType = es3fUniformApiTests.s_testDataTypes[dataTypeNdx];
+ /** @type {string} */ var typeName = gluShaderUtil.getDataTypeName(dataType);
+
+ defaultUniformCollections[UniformCollections.BASIC].cases.push(new es3fUniformApiTests.UniformCollectionCase(typeName, es3fUniformApiTests.UniformCollection.basic(dataType)));
+
+ if (gluShaderUtil.isDataTypeScalar(dataType) ||
+ (gluShaderUtil.isDataTypeVector(dataType) && gluShaderUtil.getDataTypeScalarSize(dataType) == 4) ||
+ dataType == gluShaderUtil.DataType.FLOAT_MAT4 ||
+ dataType == gluShaderUtil.DataType.SAMPLER_2D)
+ defaultUniformCollections[UniformCollections.BASIC_ARRAY].cases.push(new es3fUniformApiTests.UniformCollectionCase(typeName, es3fUniformApiTests.UniformCollection.basicArray(dataType)));
+
+ if (gluShaderUtil.isDataTypeScalar(dataType) ||
+ dataType == gluShaderUtil.DataType.FLOAT_MAT4 ||
+ dataType == gluShaderUtil.DataType.SAMPLER_2D) {
+ /** @type {gluShaderUtil.DataType} */ var secondDataType;
+ if (gluShaderUtil.isDataTypeScalar(dataType))
+ secondDataType = gluShaderUtil.getDataTypeVector(dataType, 4);
+ else if (dataType == gluShaderUtil.DataType.FLOAT_MAT4)
+ secondDataType = gluShaderUtil.DataType.FLOAT_MAT2;
+ else if (dataType == gluShaderUtil.DataType.SAMPLER_2D)
+ secondDataType = gluShaderUtil.DataType.SAMPLER_CUBE;
+
+ assertMsgOptions(
+ secondDataType !== undefined,
+ 'es3fUniformApiTests.init - second data type undefined',
+ false, true
+ );
+
+ /** @type {string} */ var secondTypeName = gluShaderUtil.getDataTypeName(secondDataType);
+ name = typeName + '_' + secondTypeName;
+
+ defaultUniformCollections[UniformCollections.BASIC_STRUCT].cases.push(new es3fUniformApiTests.UniformCollectionCase(name, es3fUniformApiTests.UniformCollection.basicStruct(dataType, secondDataType, false)));
+ defaultUniformCollections[UniformCollections.ARRAY_IN_STRUCT].cases.push(new es3fUniformApiTests.UniformCollectionCase(name, es3fUniformApiTests.UniformCollection.basicStruct(dataType, secondDataType, true)));
+ defaultUniformCollections[UniformCollections.STRUCT_IN_ARRAY].cases.push(new es3fUniformApiTests.UniformCollectionCase(name, es3fUniformApiTests.UniformCollection.structInArray(dataType, secondDataType, false)));
+ defaultUniformCollections[UniformCollections.NESTED_STRUCTS_ARRAYS].cases.push(new es3fUniformApiTests.UniformCollectionCase(name, es3fUniformApiTests.UniformCollection.nestedArraysStructs(dataType, secondDataType)));
+ }
+ }
+ defaultUniformCollections[UniformCollections.MULTIPLE_BASIC].cases.push(new es3fUniformApiTests.UniformCollectionCase(null, es3fUniformApiTests.UniformCollection.multipleBasic()));
+ defaultUniformCollections[UniformCollections.MULTIPLE_BASIC_ARRAY].cases.push(new es3fUniformApiTests.UniformCollectionCase(null, es3fUniformApiTests.UniformCollection.multipleBasicArray()));
+ defaultUniformCollections[UniformCollections.MULTIPLE_NESTED_STRUCTS_ARRAYS].cases.push(new es3fUniformApiTests.UniformCollectionCase(null, es3fUniformApiTests.UniformCollection.multipleNestedArraysStructs()));
+
+ // Info-query cases (check info returned by e.g. glGetActiveUniforms()).
+
+ // info_query
+ /** @type {tcuTestCase.DeqpTest} */
+ var infoQueryGroup = tcuTestCase.newTest('info_query', 'Test uniform info querying functions');
+ testGroup.addChild(infoQueryGroup);
+
+ /** @type {UniformCollectionGroup} */ var collectionGroup;
+ /** @type {es3fUniformApiTests.UniformCollectionCase} */ var collectionCase;
+ /** @type {es3fUniformApiTests.UniformCollection} (SharedPtr) */ var uniformCollection;
+ /** @type {es3fUniformApiTests.Feature} */ var features;
+ /** @type {tcuTestCase.DeqpTest} */ var collectionTestGroup;
+ /** @type {string} */ var collName;
+ /** @type {es3fUniformApiTests.CheckMethod} */ var checkMethod;
+ /** @type {tcuTestCase.DeqpTest} */ var checkMethodGroup;
+ /** @type {string} */ var collectionGroupName;
+ /** @type {boolean} */ var containsBooleans;
+ /** @type {boolean} */ var varyBoolApiType;
+ /** @type {number} */ var numBoolVariations;
+ /** @type {es3fUniformApiTests.Feature} */ var booleanTypeFeat;
+ /** @type {string} */ var booleanTypeName;
+ /** @type {tcuTestCase.DeqpTest} */ var unusedUniformsGroup;
+
+ /** @type {Array<string>} */ var shaderTypes = Object.keys(es3fUniformApiTests.CaseShaderType);
+
+ for (var caseTypeI in es3fUniformApiTests.CaseType) {
+ /** @type {es3fUniformApiTests.CaseType} */ var caseType = es3fUniformApiTests.CaseType[caseTypeI];
+ /** @type {tcuTestCase.DeqpTest} */
+ var caseTypeGroup = tcuTestCase.newTest(es3fUniformApiTests.UniformInfoQueryCase.getCaseTypeName(caseType), es3fUniformApiTests.UniformInfoQueryCase.getCaseTypeDescription(caseType));
+ infoQueryGroup.addChild(caseTypeGroup);
+
+ for (var collectionGroupNdx = 0; collectionGroupNdx < Object.keys(UniformCollections).length; collectionGroupNdx++) {
+ var numArrayFirstElemNameCases = caseType == es3fUniformApiTests.CaseType.INDICES_UNIFORMSIV && collectionGroupNdx == UniformCollections.BASIC_ARRAY ? 2 : 1;
+
+ for (var referToFirstArrayElemWithoutIndexI = 0; referToFirstArrayElemWithoutIndexI < numArrayFirstElemNameCases; referToFirstArrayElemWithoutIndexI++) {
+ collectionGroup = defaultUniformCollections[collectionGroupNdx];
+ collectionGroupName = collectionGroup.name + (referToFirstArrayElemWithoutIndexI == 0 ? '' : '_first_elem_without_brackets');
+ collectionTestGroup = tcuTestCase.newTest(collectionGroupName, '');
+ caseTypeGroup.addChild(collectionTestGroup);
+
+ for (var collectionNdx = 0; collectionNdx < collectionGroup.cases.length; collectionNdx++) {
+ collectionCase = collectionGroup.cases[collectionNdx];
+
+ for (var i = 0; i < shaderTypes.length; i++) {
+ name = collectionCase.namePrefix + es3fUniformApiTests.getCaseShaderTypeName(es3fUniformApiTests.CaseShaderType[shaderTypes[i]]);
+ uniformCollection = collectionCase.uniformCollection;
+
+ features = new es3fUniformApiTests.Feature();
+ features.ARRAY_FIRST_ELEM_NAME_NO_INDEX = referToFirstArrayElemWithoutIndexI != 0;
+
+ collectionTestGroup.addChild(new es3fUniformApiTests.UniformInfoQueryCase(name, '', es3fUniformApiTests.CaseShaderType[shaderTypes[i]], uniformCollection, caseType, features));
+ }
+ }
+ }
+ }
+
+ // Info-querying cases when unused uniforms are present.
+
+ unusedUniformsGroup = tcuTestCase.newTest('unused_uniforms', 'Test with unused uniforms');
+ caseTypeGroup.addChild(unusedUniformsGroup);
+
+ collectionGroup = defaultUniformCollections[UniformCollections.ARRAY_IN_STRUCT];
+
+ for (var collectionNdx = 0; collectionNdx < collectionGroup.cases.length; collectionNdx++) {
+ collectionCase = collectionGroup.cases[collectionNdx];
+ collName = collectionCase.namePrefix;
+ uniformCollection = collectionCase.uniformCollection;
+
+ for (var i = 0; i < shaderTypes.length; i++) {
+ name = collName + es3fUniformApiTests.getCaseShaderTypeName(es3fUniformApiTests.CaseShaderType[shaderTypes[i]]);
+
+ features = new es3fUniformApiTests.Feature();
+ features.UNIFORMUSAGE_EVERY_OTHER = true;
+ features.ARRAYUSAGE_ONLY_MIDDLE_INDEX = true;
+
+ unusedUniformsGroup.addChild(new es3fUniformApiTests.UniformInfoQueryCase(name, '', es3fUniformApiTests.CaseShaderType[shaderTypes[i]], uniformCollection, caseType, features));
+ }
+ }
+ }
+
+ // Cases testing uniform values.
+
+ // Cases checking uniforms' initial values (all must be zeros), with glGetUniform*() or by rendering.
+
+ /** @type {tcuTestCase.DeqpTest} */ var initialValuesGroup = tcuTestCase.newTest(
+ 'value.' + es3fUniformApiTests.UniformValueCase.getValueToCheckName(es3fUniformApiTests.ValueToCheck.INITIAL),
+ es3fUniformApiTests.UniformValueCase.getValueToCheckDescription(es3fUniformApiTests.ValueToCheck.INITIAL));
+ testGroup.addChild(initialValuesGroup);
+
+ for (var checkMethodI in es3fUniformApiTests.CheckMethod) {
+ checkMethod = es3fUniformApiTests.CheckMethod[checkMethodI];
+ checkMethodGroup = tcuTestCase.newTest(es3fUniformApiTests.UniformValueCase.getCheckMethodName(checkMethod), es3fUniformApiTests.UniformValueCase.getCheckMethodDescription(checkMethod));
+ initialValuesGroup.addChild(checkMethodGroup);
+
+ for (var collectionGroupNdx = 0; collectionGroupNdx < Object.keys(UniformCollections).length; collectionGroupNdx++) {
+ collectionGroup = defaultUniformCollections[collectionGroupNdx];
+ collectionTestGroup = tcuTestCase.newTest(collectionGroup.name, '');
+ checkMethodGroup.addChild(collectionTestGroup);
+
+ for (var collectionNdx = 0; collectionNdx < collectionGroup.cases.length; collectionNdx++) {
+ collectionCase = collectionGroup.cases[collectionNdx];
+ collName = collectionCase.namePrefix;
+ uniformCollection = collectionCase.uniformCollection;
+ containsBooleans = uniformCollection.containsMatchingBasicType(gluShaderUtil.isDataTypeBoolOrBVec);
+ varyBoolApiType = checkMethod == es3fUniformApiTests.CheckMethod.GET_UNIFORM && containsBooleans &&
+ (collectionGroupNdx == UniformCollections.BASIC || collectionGroupNdx == UniformCollections.BASIC_ARRAY);
+ numBoolVariations = varyBoolApiType ? 3 : 1;
+
+ if (checkMethod == es3fUniformApiTests.CheckMethod.RENDER && uniformCollection.containsSeveralSamplerTypes())
+ continue; // \note Samplers' initial API values (i.e. their texture units) are 0, and no two samplers of different types shall have same unit when rendering.
+
+ for (var booleanTypeI = 0; booleanTypeI < numBoolVariations; booleanTypeI++) {
+ booleanTypeFeat = new es3fUniformApiTests.Feature();
+ booleanTypeFeat.BOOLEANAPITYPE_INT = booleanTypeI == 1;
+ booleanTypeFeat.BOOLEANAPITYPE_UINT = booleanTypeI == 2;
+
+ booleanTypeName = booleanTypeI == 1 ? 'int' :
+ booleanTypeI == 2 ? 'uint' :
+ 'float';
+ /** @type {string} */ var nameWithApiType = varyBoolApiType ? collName + 'api_' + booleanTypeName + '_' : collName;
+
+ for (var i = 0; i < shaderTypes.length; i++) {
+ name = nameWithApiType + es3fUniformApiTests.getCaseShaderTypeName(es3fUniformApiTests.CaseShaderType[shaderTypes[i]]);
+ collectionTestGroup.addChild(new es3fUniformApiTests.UniformValueCase(name, '', es3fUniformApiTests.CaseShaderType[shaderTypes[i]], uniformCollection,
+ es3fUniformApiTests.ValueToCheck.INITIAL, checkMethod, null, booleanTypeFeat));
+ }
+ }
+ }
+ }
+ }
+
+ // Cases that first assign values to each uniform, then check the values with glGetUniform*() or by rendering.
+
+ /** @type {tcuTestCase.DeqpTest} */ var assignedValuesGroup = tcuTestCase.newTest(
+ 'value.' + es3fUniformApiTests.UniformValueCase.getValueToCheckName(es3fUniformApiTests.ValueToCheck.ASSIGNED),
+ es3fUniformApiTests.UniformValueCase.getValueToCheckDescription(es3fUniformApiTests.ValueToCheck.ASSIGNED));
+ testGroup.addChild(assignedValuesGroup);
+
+ for (var assignMethodI in es3fUniformApiTests.AssignMethod) {
+ /** @type {es3fUniformApiTests.AssignMethod} */ var assignMethod = es3fUniformApiTests.AssignMethod[assignMethodI];
+ /** @type {tcuTestCase.DeqpTest} */ var assignMethodGroup = tcuTestCase.newTest(es3fUniformApiTests.UniformValueCase.getAssignMethodName(assignMethod), es3fUniformApiTests.UniformValueCase.getAssignMethodDescription(assignMethod));
+ assignedValuesGroup.addChild(assignMethodGroup);
+
+ for (var checkMethodI in es3fUniformApiTests.CheckMethod) {
+ checkMethod = es3fUniformApiTests.CheckMethod[checkMethodI];
+ checkMethodGroup = tcuTestCase.newTest(es3fUniformApiTests.UniformValueCase.getCheckMethodName(checkMethod), es3fUniformApiTests.UniformValueCase.getCheckMethodDescription(checkMethod));
+ assignMethodGroup.addChild(checkMethodGroup);
+
+ for (var collectionGroupNdx = 0; collectionGroupNdx < Object.keys(UniformCollections).length; collectionGroupNdx++) {
+ /** @type {number} */ var numArrayFirstElemNameCases = checkMethod == es3fUniformApiTests.CheckMethod.GET_UNIFORM && collectionGroupNdx == UniformCollections.BASIC_ARRAY ? 2 : 1;
+
+ for (var referToFirstArrayElemWithoutIndexI = 0; referToFirstArrayElemWithoutIndexI < numArrayFirstElemNameCases; referToFirstArrayElemWithoutIndexI++) {
+ collectionGroup = defaultUniformCollections[collectionGroupNdx];
+ collectionGroupName = collectionGroup.name + (referToFirstArrayElemWithoutIndexI == 0 ? '' : '_first_elem_without_brackets');
+ collectionTestGroup = tcuTestCase.newTest(collectionGroupName, '');
+ checkMethodGroup.addChild(collectionTestGroup);
+
+ for (var collectionNdx = 0; collectionNdx < collectionGroup.cases.length; collectionNdx++) {
+ collectionCase = collectionGroup.cases[collectionNdx];
+ collName = collectionCase.namePrefix;
+ uniformCollection = collectionCase.uniformCollection;
+ containsBooleans = uniformCollection.containsMatchingBasicType(gluShaderUtil.isDataTypeBoolOrBVec);
+ varyBoolApiType = checkMethod == es3fUniformApiTests.CheckMethod.GET_UNIFORM && containsBooleans &&
+ (collectionGroupNdx == UniformCollections.BASIC || collectionGroupNdx == UniformCollections.BASIC_ARRAY);
+ numBoolVariations = varyBoolApiType ? 3 : 1;
+ /** @type {boolean} */ var containsMatrices = uniformCollection.containsMatchingBasicType(gluShaderUtil.isDataTypeMatrix);
+ /** @type {boolean} */ var varyMatrixMode = containsMatrices &&
+ (collectionGroupNdx == UniformCollections.BASIC || collectionGroupNdx == UniformCollections.BASIC_ARRAY);
+ /** @type {number} */ var numMatVariations = varyMatrixMode ? 2 : 1;
+
+ if (containsMatrices && assignMethod != es3fUniformApiTests.AssignMethod.POINTER)
+ continue;
+
+ for (var booleanTypeI = 0; booleanTypeI < numBoolVariations; booleanTypeI++) {
+ booleanTypeFeat = new es3fUniformApiTests.Feature();
+ booleanTypeFeat.BOOLEANAPITYPE_INT = booleanTypeI == 1;
+ booleanTypeFeat.BOOLEANAPITYPE_UINT = booleanTypeI == 2;
+
+ booleanTypeName = booleanTypeI == 1 ? 'int' :
+ booleanTypeI == 2 ? 'uint' :
+ 'float';
+ /** @type {string} */ var nameWithBoolType = varyBoolApiType ? collName + 'api_' + booleanTypeName + '_' : collName;
+
+ for (var matrixTypeI = 0; matrixTypeI < numMatVariations; matrixTypeI++) {
+ /** @type {string} */ var nameWithMatrixType = nameWithBoolType + (matrixTypeI == 1 ? 'row_major_' : '');
+
+ for (var i = 0; i < shaderTypes.length; i++) {
+ name = nameWithMatrixType + es3fUniformApiTests.getCaseShaderTypeName(es3fUniformApiTests.CaseShaderType[shaderTypes[i]]);
+
+ booleanTypeFeat.ARRAY_FIRST_ELEM_NAME_NO_INDEX = referToFirstArrayElemWithoutIndexI != 0;
+ booleanTypeFeat.MATRIXMODE_ROWMAJOR = matrixTypeI == 1;
+
+ collectionTestGroup.addChild(new es3fUniformApiTests.UniformValueCase(name, '', es3fUniformApiTests.CaseShaderType[shaderTypes[i]], uniformCollection,
+ es3fUniformApiTests.ValueToCheck.ASSIGNED, checkMethod, assignMethod, booleanTypeFeat));
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // Cases assign multiple basic-array elements with one glUniform*v() (i.e. the count parameter is bigger than 1).
+
+ /** @type {es3fUniformApiTests.Feature} */ var arrayAssignFullMode = new es3fUniformApiTests.Feature();
+ arrayAssignFullMode.ARRAYASSIGN_FULL = true;
+
+ /** @type {es3fUniformApiTests.Feature} */ var arrayAssignBlocksOfTwo = new es3fUniformApiTests.Feature();
+ arrayAssignFullMode.ARRAYASSIGN_BLOCKS_OF_TWO = true;
+
+ var arrayAssignGroups =
+ [{arrayAssignMode: arrayAssignFullMode, name: 'basic_array_assign_full', description: 'Assign entire basic-type arrays per glUniform*v() call'}, {arrayAssignMode: arrayAssignBlocksOfTwo, name: 'basic_array_assign_partial', description: 'Assign two elements of a basic-type array per glUniform*v() call'}
+ ];
+
+ for (var arrayAssignGroupNdx = 0; arrayAssignGroupNdx < arrayAssignGroups.length; arrayAssignGroupNdx++) {
+ /** @type {es3fUniformApiTests.Feature} */ var arrayAssignMode = arrayAssignGroups[arrayAssignGroupNdx].arrayAssignMode;
+ /** @type {string} */ var groupName = arrayAssignGroups[arrayAssignGroupNdx].name;
+ /** @type {string} */ var groupDesc = arrayAssignGroups[arrayAssignGroupNdx].description;
+
+ /** @type {tcuTestCase.DeqpTest} */ var curArrayAssignGroup = tcuTestCase.newTest(groupName, groupDesc);
+ assignedValuesGroup.addChild(curArrayAssignGroup);
+
+ /** @type {Array<number>} */ var basicArrayCollectionGroups = [UniformCollections.BASIC_ARRAY, UniformCollections.ARRAY_IN_STRUCT, UniformCollections.MULTIPLE_BASIC_ARRAY];
+
+ for (var collectionGroupNdx = 0; collectionGroupNdx < basicArrayCollectionGroups.length; collectionGroupNdx++) {
+ collectionGroup = defaultUniformCollections[basicArrayCollectionGroups[collectionGroupNdx]];
+ collectionTestGroup = tcuTestCase.newTest(collectionGroup.name, '');
+ curArrayAssignGroup.addChild(collectionTestGroup);
+
+ for (var collectionNdx = 0; collectionNdx < collectionGroup.cases.length; collectionNdx++) {
+ collectionCase = collectionGroup.cases[collectionNdx];
+ collName = collectionCase.namePrefix;
+ uniformCollection = collectionCase.uniformCollection;
+
+ for (var i = 0; i < shaderTypes.length; i++) {
+ name = collName + es3fUniformApiTests.getCaseShaderTypeName(es3fUniformApiTests.CaseShaderType[shaderTypes[i]]);
+ collectionTestGroup.addChild(new es3fUniformApiTests.UniformValueCase(name, '', es3fUniformApiTests.CaseShaderType[shaderTypes[i]], uniformCollection,
+ es3fUniformApiTests.ValueToCheck.ASSIGNED, es3fUniformApiTests.CheckMethod.GET_UNIFORM, es3fUniformApiTests.AssignMethod.POINTER,
+ arrayAssignMode));
+ }
+ }
+ }
+ }
+
+ // Value checking cases when unused uniforms are present.
+
+ unusedUniformsGroup = tcuTestCase.newTest('unused_uniforms', 'Test with unused uniforms');
+ assignedValuesGroup.addChild(unusedUniformsGroup);
+
+ collectionGroup = defaultUniformCollections[UniformCollections.ARRAY_IN_STRUCT];
+
+ for (var collectionNdx = 0; collectionNdx < collectionGroup.cases.length; collectionNdx++) {
+ collectionCase = collectionGroup.cases[collectionNdx];
+ collName = collectionCase.namePrefix;
+ uniformCollection = collectionCase.uniformCollection;
+
+ for (var i = 0; i < shaderTypes.length; i++) {
+ name = collName + es3fUniformApiTests.getCaseShaderTypeName(es3fUniformApiTests.CaseShaderType[shaderTypes[i]]);
+
+ features = new es3fUniformApiTests.Feature();
+ features.ARRAYUSAGE_ONLY_MIDDLE_INDEX = true;
+ features.UNIFORMUSAGE_EVERY_OTHER = true;
+
+ unusedUniformsGroup.addChild(new es3fUniformApiTests.UniformValueCase(name, '', es3fUniformApiTests.CaseShaderType[shaderTypes[i]], uniformCollection,
+ es3fUniformApiTests.ValueToCheck.ASSIGNED, es3fUniformApiTests.CheckMethod.GET_UNIFORM, es3fUniformApiTests.AssignMethod.POINTER,
+ features));
+ }
+ }
+
+ // Random cases.
+
+ /** @type {number} */ var numRandomCases = 100;
+ /** @type {tcuTestCase.DeqpTest} */ var randomGroup = tcuTestCase.newTest('random', 'Random cases');
+ testGroup.addChild(randomGroup);
+
+ for (var ndx = 0; ndx < numRandomCases; ndx++)
+ randomGroup.addChild(new es3fUniformApiTests.RandomUniformCase('' + ndx, '', ndx));
+ };
+
+ /**
+ * Create and execute the test cases
+ * @param {WebGL2RenderingContext} context
+ */
+ es3fUniformApiTests.run = function(context, range) {
+ gl = context;
+ //Set up Test Root parameters
+ var testName = 'uniform_api';
+ var testDescription = 'es3fUniformApiTests.Uniform API Tests';
+ var state = tcuTestCase.runner;
+
+ state.testName = testName;
+ state.testCases = tcuTestCase.newTest(testName, testDescription, null);
+
+ //Set up name and description of this test series.
+ setCurrentTestName(testName);
+ description(testDescription);
+
+ try {
+ //Create test cases
+ es3fUniformApiTests.init();
+ if (range)
+ state.setRange(range);
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fUniformApiTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fUniformBlockTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fUniformBlockTests.js
new file mode 100644
index 0000000000..91a90fdc64
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fUniformBlockTests.js
@@ -0,0 +1,748 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fUniformBlockTests');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('modules.shared.glsRandomUniformBlockCase');
+goog.require('modules.shared.glsUniformBlockCase');
+
+goog.scope(function() {
+
+ var es3fUniformBlockTests = functional.gles3.es3fUniformBlockTests;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var glsUniformBlockCase = modules.shared.glsUniformBlockCase;
+ var glsRandomUniformBlockCase = modules.shared.glsRandomUniformBlockCase;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var deMath = framework.delibs.debase.deMath;
+ var deRandom = framework.delibs.debase.deRandom;
+
+ /**
+ * es3fUniformBlockTests.createRandomCaseGroup
+ * @param {tcuTestCase.DeqpTest} parentGroup
+ * @param {string} groupName
+ * @param {string} description
+ * @param {glsUniformBlockCase.BufferMode} bufferMode
+ * @param {number} features
+ * @param {number} numCases
+ * @param {number} baseSeed
+ */
+ es3fUniformBlockTests.createRandomCaseGroup = function(parentGroup, groupName, description, bufferMode, features, numCases, baseSeed) {
+ /** @type {tcuTestCase.DeqpTest} */
+ var group = tcuTestCase.newTest(groupName, description);
+ parentGroup.addChild(group);
+
+ baseSeed += deRandom.getBaseSeed();
+
+ for (var ndx = 0; ndx < numCases; ndx++)
+ group.addChild(new glsRandomUniformBlockCase.RandomUniformBlockCase('' + ndx, '', bufferMode, features, ndx + baseSeed));
+ };
+
+ /**
+ * es3fUniformBlockTests.BlockBasicTypeCase constructor
+ * @param {string} name The name of the test
+ * @param {string} description The description of the test
+ * @param {glsUniformBlockCase.VarType} type The type of the block
+ * @param {number} layoutFlags
+ * @param {number} numInstances
+ * @constructor
+ * @extends {glsUniformBlockCase.UniformBlockCase}
+ */
+ es3fUniformBlockTests.BlockBasicTypeCase = function(name, description, type, layoutFlags, numInstances) {
+ glsUniformBlockCase.UniformBlockCase.call(this, name, description, glsUniformBlockCase.BufferMode.BUFFERMODE_PER_BLOCK);
+ /** @type {glsUniformBlockCase.UniformBlock}*/ var block = this.m_interface.allocBlock('Block');
+ block.addUniform(new glsUniformBlockCase.Uniform('var', type, 0));
+ block.setFlags(layoutFlags);
+
+ if (numInstances > 0) {
+ block.setArraySize(numInstances);
+ block.setInstanceName('block');
+ }
+ };
+
+ es3fUniformBlockTests.BlockBasicTypeCase.prototype = Object.create(glsUniformBlockCase.UniformBlockCase.prototype);
+ es3fUniformBlockTests.BlockBasicTypeCase.prototype.constructor = es3fUniformBlockTests.BlockBasicTypeCase;
+
+ /**
+ * es3fUniformBlockTests.createBlockBasicTypeCases
+ * @param {tcuTestCase.DeqpTest} group
+ * @param {string} name
+ * @param {glsUniformBlockCase.VarType} type
+ * @param {number} layoutFlags
+ * @param {number=} numInstances
+ */
+ es3fUniformBlockTests.createBlockBasicTypeCases = function(group, name, type, layoutFlags, numInstances) {
+ numInstances = (numInstances === undefined) ? 0 : numInstances;
+ group.addChild(new es3fUniformBlockTests.BlockBasicTypeCase(name + '_vertex', '', type, layoutFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX, numInstances));
+ group.addChild(new es3fUniformBlockTests.BlockBasicTypeCase(name + '_fragment', '', type, layoutFlags | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, numInstances));
+
+ //alert(group.spec[0].m_instance);
+ if (!(layoutFlags & glsUniformBlockCase.UniformFlags.LAYOUT_PACKED))
+ group.addChild(new es3fUniformBlockTests.BlockBasicTypeCase(name + '_both', '', type, layoutFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, numInstances));
+ };
+
+ /**
+ * es3fUniformBlockTests.BlockSingleStructCase constructor
+ * @param {string} name The name of the test
+ * @param {string} description The description of the test
+ * @param {number} layoutFlags
+ * @param {glsUniformBlockCase.BufferMode} bufferMode
+ * @param {number} numInstances
+ * @constructor
+ * @extends {glsUniformBlockCase.UniformBlockCase}
+ */
+ es3fUniformBlockTests.BlockSingleStructCase = function(name, description, layoutFlags, bufferMode, numInstances) {
+ glsUniformBlockCase.UniformBlockCase.call(this, name, description, bufferMode);
+ this.m_layoutFlags = layoutFlags;
+ this.m_numInstances = numInstances;
+ };
+
+ es3fUniformBlockTests.BlockSingleStructCase.prototype = Object.create(glsUniformBlockCase.UniformBlockCase.prototype);
+ es3fUniformBlockTests.BlockSingleStructCase.prototype.constructor = es3fUniformBlockTests.BlockSingleStructCase;
+
+ es3fUniformBlockTests.BlockSingleStructCase.prototype.init = function() {
+ /**@type {glsUniformBlockCase.StructType}*/ var typeS = this.m_interface.allocStruct('S');
+ typeS.addMember('a', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.INT_VEC3, glsUniformBlockCase.UniformFlags.PRECISION_HIGH), glsUniformBlockCase.UniformFlags.UNUSED_BOTH); // First member is unused.
+ typeS.addMember('b', glsUniformBlockCase.newVarTypeArray(glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_MAT3, glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM), 4));
+ typeS.addMember('c', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_VEC4, glsUniformBlockCase.UniformFlags.PRECISION_HIGH));
+
+ /** @type {glsUniformBlockCase.UniformBlock} */ var block = this.m_interface.allocBlock('Block');
+ block.addUniform(new glsUniformBlockCase.Uniform('s', glsUniformBlockCase.newVarTypeStruct(typeS), 0));
+ block.setFlags(this.m_layoutFlags);
+
+ if (this.m_numInstances > 0) {
+ block.setInstanceName('block');
+ block.setArraySize(this.m_numInstances);
+ }
+ };
+
+ /**
+ * es3fUniformBlockTests.BlockSingleStructArrayCase constructor
+ * @param {string} name The name of the test
+ * @param {string} description The description of the test
+ * @param {number} layoutFlags
+ * @param {glsUniformBlockCase.BufferMode} bufferMode
+ * @param {number} numInstances
+ * @constructor
+ * @extends {glsUniformBlockCase.UniformBlockCase}
+ */
+ es3fUniformBlockTests.BlockSingleStructArrayCase = function(name, description, layoutFlags, bufferMode, numInstances) {
+ glsUniformBlockCase.UniformBlockCase.call(this, name, description, bufferMode);
+ this.m_layoutFlags = layoutFlags;
+ this.m_numInstances = numInstances;
+ };
+
+ es3fUniformBlockTests.BlockSingleStructArrayCase.prototype = Object.create(glsUniformBlockCase.UniformBlockCase.prototype);
+ es3fUniformBlockTests.BlockSingleStructArrayCase.prototype.constructor = es3fUniformBlockTests.BlockSingleStructArrayCase;
+
+ es3fUniformBlockTests.BlockSingleStructArrayCase.prototype.init = function() {
+ /**@type {glsUniformBlockCase.StructType}*/ var typeS = this.m_interface.allocStruct('S');
+ typeS.addMember('a', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.INT_VEC3, glsUniformBlockCase.UniformFlags.PRECISION_HIGH), glsUniformBlockCase.UniformFlags.UNUSED_BOTH); // First member is unused.
+ typeS.addMember('b', glsUniformBlockCase.newVarTypeArray(glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_MAT3, glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM), 4));
+ typeS.addMember('c', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_VEC4, glsUniformBlockCase.UniformFlags.PRECISION_HIGH));
+
+ /** @type {glsUniformBlockCase.UniformBlock} */ var block = this.m_interface.allocBlock('Block');
+ block.addUniform(new glsUniformBlockCase.Uniform('u', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.UINT, glsUniformBlockCase.UniformFlags.PRECISION_LOW)));
+ block.addUniform(new glsUniformBlockCase.Uniform('s', glsUniformBlockCase.newVarTypeArray(glsUniformBlockCase.newVarTypeStruct(typeS), 3)));
+ block.addUniform(new glsUniformBlockCase.Uniform('v', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_VEC4, glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM)));
+ block.setFlags(this.m_layoutFlags);
+
+ if (this.m_numInstances > 0) {
+ block.setInstanceName('block');
+ block.setArraySize(this.m_numInstances);
+ }
+ };
+
+ /**
+ * es3fUniformBlockTests.BlockSingleNestedStructCase constructor
+ * @param {string} name The name of the test
+ * @param {string} description The description of the test
+ * @param {number} layoutFlags
+ * @param {glsUniformBlockCase.BufferMode} bufferMode
+ * @param {number} numInstances
+ * @constructor
+ * @extends {glsUniformBlockCase.UniformBlockCase}
+ */
+ es3fUniformBlockTests.BlockSingleNestedStructCase = function(name, description, layoutFlags, bufferMode, numInstances) {
+ glsUniformBlockCase.UniformBlockCase.call(this, name, description, bufferMode);
+ this.m_layoutFlags = layoutFlags;
+ this.m_numInstances = numInstances;
+ };
+
+ es3fUniformBlockTests.BlockSingleNestedStructCase.prototype = Object.create(glsUniformBlockCase.UniformBlockCase.prototype);
+ es3fUniformBlockTests.BlockSingleNestedStructCase.prototype.constructor = es3fUniformBlockTests.BlockSingleNestedStructCase;
+
+ es3fUniformBlockTests.BlockSingleNestedStructCase.prototype.init = function() {
+ /**@type {glsUniformBlockCase.StructType}*/ var typeS = this.m_interface.allocStruct('S');
+ typeS.addMember('a', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.INT_VEC3, glsUniformBlockCase.UniformFlags.PRECISION_HIGH));
+ typeS.addMember('b', glsUniformBlockCase.newVarTypeArray(glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_MAT3, glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM), 4));
+ typeS.addMember('c', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_VEC4, glsUniformBlockCase.UniformFlags.PRECISION_HIGH), glsUniformBlockCase.UniformFlags.UNUSED_BOTH);
+
+ /**@type {glsUniformBlockCase.StructType}*/ var typeT = this.m_interface.allocStruct('T');
+ typeT.addMember('a', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_MAT3, glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM));
+ typeT.addMember('b', glsUniformBlockCase.newVarTypeStruct(typeS));
+
+ /** @type {glsUniformBlockCase.UniformBlock} */ var block = this.m_interface.allocBlock('Block');
+ block.addUniform(new glsUniformBlockCase.Uniform('s', glsUniformBlockCase.newVarTypeStruct(typeS), 0));
+ block.addUniform(new glsUniformBlockCase.Uniform('v', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_VEC2, glsUniformBlockCase.UniformFlags.PRECISION_LOW), glsUniformBlockCase.UniformFlags.UNUSED_BOTH));
+ block.addUniform(new glsUniformBlockCase.Uniform('t', glsUniformBlockCase.newVarTypeStruct(typeT), 0));
+ block.addUniform(new glsUniformBlockCase.Uniform('u', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.UINT, glsUniformBlockCase.UniformFlags.PRECISION_HIGH), 0));
+ block.setFlags(this.m_layoutFlags);
+
+ if (this.m_numInstances > 0) {
+ block.setInstanceName('block');
+ block.setArraySize(this.m_numInstances);
+ }
+ };
+
+ /**
+ * es3fUniformBlockTests.BlockSingleNestedStructArrayCase constructor
+ * @param {string} name The name of the test
+ * @param {string} description The description of the test
+ * @param {number} layoutFlags
+ * @param {glsUniformBlockCase.BufferMode} bufferMode
+ * @param {number} numInstances
+ * @constructor
+ * @extends {glsUniformBlockCase.UniformBlockCase}
+ */
+ es3fUniformBlockTests.BlockSingleNestedStructArrayCase = function(name, description, layoutFlags, bufferMode, numInstances) {
+ glsUniformBlockCase.UniformBlockCase.call(this, name, description, bufferMode);
+ this.m_layoutFlags = layoutFlags;
+ this.m_numInstances = numInstances;
+ };
+
+ es3fUniformBlockTests.BlockSingleNestedStructArrayCase.prototype = Object.create(glsUniformBlockCase.UniformBlockCase.prototype);
+ es3fUniformBlockTests.BlockSingleNestedStructArrayCase.prototype.constructor = es3fUniformBlockTests.BlockSingleNestedStructArrayCase;
+
+ es3fUniformBlockTests.BlockSingleNestedStructArrayCase.prototype.init = function() {
+ /**@type {glsUniformBlockCase.StructType}*/ var typeS = this.m_interface.allocStruct('S');
+ typeS.addMember('a', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.INT_VEC3, glsUniformBlockCase.UniformFlags.PRECISION_HIGH));
+ typeS.addMember('b', glsUniformBlockCase.newVarTypeArray(glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.INT_VEC2, glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM), 4));
+ typeS.addMember('c', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_VEC4, glsUniformBlockCase.UniformFlags.PRECISION_HIGH), glsUniformBlockCase.UniformFlags.UNUSED_BOTH);
+
+ /**@type {glsUniformBlockCase.StructType}*/ var typeT = this.m_interface.allocStruct('T');
+ typeT.addMember('a', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_MAT3, glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM));
+ typeT.addMember('b', glsUniformBlockCase.newVarTypeArray(glsUniformBlockCase.newVarTypeStruct(typeS), 3));
+
+ /** @type {glsUniformBlockCase.UniformBlock} */ var block = this.m_interface.allocBlock('Block');
+ block.addUniform(new glsUniformBlockCase.Uniform('s', glsUniformBlockCase.newVarTypeStruct(typeS), 0));
+ block.addUniform(new glsUniformBlockCase.Uniform('v', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_VEC2, glsUniformBlockCase.UniformFlags.PRECISION_LOW), glsUniformBlockCase.UniformFlags.UNUSED_BOTH));
+ block.addUniform(new glsUniformBlockCase.Uniform('t', glsUniformBlockCase.newVarTypeArray(glsUniformBlockCase.newVarTypeStruct(typeT), 2), 0));
+ block.addUniform(new glsUniformBlockCase.Uniform('u', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.UINT, glsUniformBlockCase.UniformFlags.PRECISION_HIGH), 0));
+ block.setFlags(this.m_layoutFlags);
+
+ if (this.m_numInstances > 0) {
+ block.setInstanceName('block');
+ block.setArraySize(this.m_numInstances);
+ }
+ };
+
+ /**
+ * es3fUniformBlockTests.BlockMultiBasicTypesCase constructor
+ * @param {string} name The name of the test
+ * @param {string} description The description of the test
+ * @param {number} flagsA
+ * @param {number} flagsB
+ * @param {glsUniformBlockCase.BufferMode} bufferMode
+ * @param {number} numInstances
+ * @constructor
+ * @extends {glsUniformBlockCase.UniformBlockCase}
+ */
+ es3fUniformBlockTests.BlockMultiBasicTypesCase = function(name, description, flagsA, flagsB, bufferMode, numInstances) {
+ glsUniformBlockCase.UniformBlockCase.call(this, name, description, bufferMode);
+ this.m_flagsA = flagsA;
+ this.m_flagsB = flagsB;
+ this.m_numInstances = numInstances;
+ };
+
+ es3fUniformBlockTests.BlockMultiBasicTypesCase.prototype = Object.create(glsUniformBlockCase.UniformBlockCase.prototype);
+ es3fUniformBlockTests.BlockMultiBasicTypesCase.prototype.constructor = es3fUniformBlockTests.BlockMultiBasicTypesCase;
+
+ es3fUniformBlockTests.BlockMultiBasicTypesCase.prototype.init = function() {
+ /** @type {glsUniformBlockCase.UniformBlock} */ var blockA = this.m_interface.allocBlock('BlockA');
+ blockA.addUniform(new glsUniformBlockCase.Uniform('a', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT, glsUniformBlockCase.UniformFlags.PRECISION_HIGH)));
+ blockA.addUniform(new glsUniformBlockCase.Uniform('b', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.UINT_VEC3, glsUniformBlockCase.UniformFlags.PRECISION_LOW), glsUniformBlockCase.UniformFlags.UNUSED_BOTH));
+ blockA.addUniform(new glsUniformBlockCase.Uniform('c', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_MAT2, glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM)));
+ blockA.setInstanceName('blockA');
+ blockA.setFlags(this.m_flagsA);
+
+ /** @type {glsUniformBlockCase.UniformBlock} */ var blockB = this.m_interface.allocBlock('BlockB');
+ blockB.addUniform(new glsUniformBlockCase.Uniform('a', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_MAT3, glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM)));
+ blockB.addUniform(new glsUniformBlockCase.Uniform('b', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.INT_VEC2, glsUniformBlockCase.UniformFlags.PRECISION_LOW)));
+ blockB.addUniform(new glsUniformBlockCase.Uniform('c', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_VEC4, glsUniformBlockCase.UniformFlags.PRECISION_HIGH), glsUniformBlockCase.UniformFlags.UNUSED_BOTH));
+ blockB.addUniform(new glsUniformBlockCase.Uniform('d', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.BOOL, 0)));
+ blockB.setInstanceName('blockB');
+ blockB.setFlags(this.m_flagsB);
+
+ if (this.m_numInstances > 0) {
+ blockA.setArraySize(this.m_numInstances);
+ blockB.setArraySize(this.m_numInstances);
+ }
+ };
+
+ /**
+ * es3fUniformBlockTests.BlockMultiNestedStructCase constructor
+ * @param {string} name The name of the test
+ * @param {string} description The description of the test
+ * @param {number} flagsA
+ * @param {number} flagsB
+ * @param {glsUniformBlockCase.BufferMode} bufferMode
+ * @param {number} numInstances
+ * @constructor
+ * @extends {glsUniformBlockCase.UniformBlockCase}
+ */
+ es3fUniformBlockTests.BlockMultiNestedStructCase = function(name, description, flagsA, flagsB, bufferMode, numInstances) {
+ glsUniformBlockCase.UniformBlockCase.call(this, name, description, bufferMode);
+ this.m_flagsA = flagsA;
+ this.m_flagsB = flagsB;
+ this.m_numInstances = numInstances;
+ };
+
+ es3fUniformBlockTests.BlockMultiNestedStructCase.prototype = Object.create(glsUniformBlockCase.UniformBlockCase.prototype);
+ es3fUniformBlockTests.BlockMultiNestedStructCase.prototype.constructor = es3fUniformBlockTests.BlockMultiNestedStructCase;
+
+ es3fUniformBlockTests.BlockMultiNestedStructCase.prototype.init = function() {
+ /**@type {glsUniformBlockCase.StructType}*/ var typeS = this.m_interface.allocStruct('S');
+ typeS.addMember('a', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_MAT3, glsUniformBlockCase.UniformFlags.PRECISION_LOW));
+ typeS.addMember('b', glsUniformBlockCase.newVarTypeArray(glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.INT_VEC2, glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM), 4));
+ typeS.addMember('c', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_VEC4, glsUniformBlockCase.UniformFlags.PRECISION_HIGH));
+
+ /**@type {glsUniformBlockCase.StructType}*/ var typeT = this.m_interface.allocStruct('T');
+ typeT.addMember('a', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.UINT, glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM), glsUniformBlockCase.UniformFlags.UNUSED_BOTH);
+ typeT.addMember('b', glsUniformBlockCase.newVarTypeStruct(typeS));
+ typeT.addMember('c', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.BOOL_VEC4, 0));
+
+ /** @type {glsUniformBlockCase.UniformBlock} */ var blockA = this.m_interface.allocBlock('BlockA');
+ blockA.addUniform(new glsUniformBlockCase.Uniform('a', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT, glsUniformBlockCase.UniformFlags.PRECISION_HIGH)));
+ blockA.addUniform(new glsUniformBlockCase.Uniform('b', glsUniformBlockCase.newVarTypeStruct(typeS)));
+ blockA.addUniform(new glsUniformBlockCase.Uniform('c', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.UINT_VEC3, glsUniformBlockCase.UniformFlags.PRECISION_LOW), glsUniformBlockCase.UniformFlags.UNUSED_BOTH));
+ blockA.setInstanceName('blockA');
+ blockA.setFlags(this.m_flagsA);
+
+ /** @type {glsUniformBlockCase.UniformBlock} */ var blockB = this.m_interface.allocBlock('BlockB');
+ blockB.addUniform(new glsUniformBlockCase.Uniform('a', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.FLOAT_MAT2, glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM)));
+ blockB.addUniform(new glsUniformBlockCase.Uniform('b', glsUniformBlockCase.newVarTypeStruct(typeT)));
+ blockB.addUniform(new glsUniformBlockCase.Uniform('c', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.BOOL_VEC4, 0), glsUniformBlockCase.UniformFlags.UNUSED_BOTH));
+ blockB.addUniform(new glsUniformBlockCase.Uniform('d', glsUniformBlockCase.newVarTypeBasic(gluShaderUtil.DataType.BOOL, 0)));
+ blockB.setInstanceName('blockB');
+ blockB.setFlags(this.m_flagsB);
+
+ if (this.m_numInstances > 0) {
+ blockA.setArraySize(this.m_numInstances);
+ blockB.setArraySize(this.m_numInstances);
+ }
+ };
+
+ /**
+ * Creates the test hierarchy to be executed.
+ **/
+ es3fUniformBlockTests.init = function() {
+ /** @const @type {tcuTestCase.DeqpTest} */ var testGroup = tcuTestCase.runner.testCases;
+
+ /** @type {Array<gluShaderUtil.DataType>} */
+ var basicTypes = [
+ gluShaderUtil.DataType.FLOAT,
+ gluShaderUtil.DataType.FLOAT_VEC2,
+ gluShaderUtil.DataType.FLOAT_VEC3,
+ gluShaderUtil.DataType.FLOAT_VEC4,
+ gluShaderUtil.DataType.INT,
+ gluShaderUtil.DataType.INT_VEC2,
+ gluShaderUtil.DataType.INT_VEC3,
+ gluShaderUtil.DataType.INT_VEC4,
+ gluShaderUtil.DataType.UINT,
+ gluShaderUtil.DataType.UINT_VEC2,
+ gluShaderUtil.DataType.UINT_VEC3,
+ gluShaderUtil.DataType.UINT_VEC4,
+ gluShaderUtil.DataType.BOOL,
+ gluShaderUtil.DataType.BOOL_VEC2,
+ gluShaderUtil.DataType.BOOL_VEC3,
+ gluShaderUtil.DataType.BOOL_VEC4,
+ gluShaderUtil.DataType.FLOAT_MAT2,
+ gluShaderUtil.DataType.FLOAT_MAT3,
+ gluShaderUtil.DataType.FLOAT_MAT4,
+ gluShaderUtil.DataType.FLOAT_MAT2X3,
+ gluShaderUtil.DataType.FLOAT_MAT2X4,
+ gluShaderUtil.DataType.FLOAT_MAT3X2,
+ gluShaderUtil.DataType.FLOAT_MAT3X4,
+ gluShaderUtil.DataType.FLOAT_MAT4X2,
+ gluShaderUtil.DataType.FLOAT_MAT4X3
+ ];
+
+ /** @type {Array<Object.<string, glsUniformBlockCase.UniformFlags>>} */
+ var precisionFlags = [{ name: 'lowp', flags: glsUniformBlockCase.UniformFlags.PRECISION_LOW }, { name: 'mediump', flags: glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM }, { name: 'highp', flags: glsUniformBlockCase.UniformFlags.PRECISION_HIGH }
+ ];
+
+ /** @type {Array<Object.<string, glsUniformBlockCase.UniformFlags>>} */
+ var layoutFlags = [ /* { name: 'shared', flags: glsUniformBlockCase.UniformFlags.LAYOUT_SHARED }, */
+ /* { name: 'packed', flags: glsUniformBlockCase.UniformFlags.LAYOUT_PACKED }, */ { name: 'std140', flags: glsUniformBlockCase.UniformFlags.LAYOUT_STD140 }
+ ];
+
+ /** @type {Array<Object.<string, glsUniformBlockCase.UniformFlags>>} */
+ var matrixFlags = [{ name: 'row_major', flags: glsUniformBlockCase.UniformFlags.LAYOUT_ROW_MAJOR }, { name: 'column_major', flags: glsUniformBlockCase.UniformFlags.LAYOUT_COLUMN_MAJOR }
+ ];
+
+ /** @type {Array<Object.<string, glsUniformBlockCase.UniformFlags>>} */
+ var bufferModes = [{ name: 'per_block_buffer', mode: glsUniformBlockCase.BufferMode.BUFFERMODE_PER_BLOCK }, { name: 'single_buffer', mode: glsUniformBlockCase.BufferMode.BUFFERMODE_SINGLE }
+ ];
+
+ // ubo.single_basic_type
+ /** @type {tcuTestCase.DeqpTest} */
+ var singleBasicTypeGroup = tcuTestCase.newTest('single_basic_type', 'Single basic variable in single buffer');
+
+ testGroup.addChild(singleBasicTypeGroup);
+
+ /** @type {tcuTestCase.DeqpTest} */
+ var layoutGroup;
+ /** @type {gluShaderUtil.DataType} */
+ var type;
+ /** @type {string} */
+ var typeName;
+ /** @type {tcuTestCase.DeqpTest} */
+ var modeGroup;
+ /** @type {string} */
+ var baseName;
+ /** @type {number} */
+ var baseFlags;
+
+ for (var layoutFlagNdx = 0; layoutFlagNdx < layoutFlags.length; layoutFlagNdx++) {
+
+ layoutGroup = tcuTestCase.newTest(layoutFlags[layoutFlagNdx].name, '', null);
+ singleBasicTypeGroup.addChild(layoutGroup);
+
+ for (var basicTypeNdx = 0; basicTypeNdx < basicTypes.length; basicTypeNdx++) {
+ type = basicTypes[basicTypeNdx];
+ typeName = gluShaderUtil.getDataTypeName(type);
+
+ if (gluShaderUtil.isDataTypeBoolOrBVec(type))
+ es3fUniformBlockTests.createBlockBasicTypeCases(layoutGroup, typeName, glsUniformBlockCase.newVarTypeBasic(type, 0), layoutFlags[layoutFlagNdx].flags);
+ else {
+ for (var precNdx = 0; precNdx < precisionFlags.length; precNdx++)
+ es3fUniformBlockTests.createBlockBasicTypeCases(layoutGroup, precisionFlags[precNdx].name + '_' + typeName,
+ glsUniformBlockCase.newVarTypeBasic(type, precisionFlags[precNdx].flags), layoutFlags[layoutFlagNdx].flags);
+ }
+
+ if (gluShaderUtil.isDataTypeMatrix(type)) {
+ for (var matFlagNdx = 0; matFlagNdx < matrixFlags.length; matFlagNdx++) {
+ for (var precNdx = 0; precNdx < precisionFlags.length; precNdx++)
+ es3fUniformBlockTests.createBlockBasicTypeCases(layoutGroup, matrixFlags[matFlagNdx].name + '_' + precisionFlags[precNdx].name + '_' + typeName,
+ glsUniformBlockCase.newVarTypeBasic(type, precisionFlags[precNdx].flags), layoutFlags[layoutFlagNdx].flags | matrixFlags[matFlagNdx].flags);
+ }
+ }
+ }
+ }
+ bufferedLogToConsole('ubo.single_basic_type: Tests created');
+
+ // ubo.single_basic_array
+ /** @type {tcuTestCase.DeqpTest} */
+ var singleBasicArrayGroup = tcuTestCase.newTest('single_basic_array', 'Single basic array variable in single buffer');
+ testGroup.addChild(singleBasicArrayGroup);
+
+ for (var layoutFlagNdx = 0; layoutFlagNdx < layoutFlags.length; layoutFlagNdx++) {
+ layoutGroup = tcuTestCase.newTest(layoutFlags[layoutFlagNdx].name, '', null);
+ singleBasicArrayGroup.addChild(layoutGroup);
+
+ for (var basicTypeNdx = 0; basicTypeNdx < basicTypes.length; basicTypeNdx++) {
+ type = basicTypes[basicTypeNdx];
+ typeName = gluShaderUtil.getDataTypeName(type);
+ /** @type {number} */ var arraySize = 3;
+
+ es3fUniformBlockTests.createBlockBasicTypeCases(layoutGroup, typeName,
+ glsUniformBlockCase.newVarTypeArray(glsUniformBlockCase.newVarTypeBasic(type, gluShaderUtil.isDataTypeBoolOrBVec(type) ? 0 : glsUniformBlockCase.UniformFlags.PRECISION_HIGH), arraySize),
+ layoutFlags[layoutFlagNdx].flags);
+
+ if (gluShaderUtil.isDataTypeMatrix(type)) {
+ for (var matFlagNdx = 0; matFlagNdx < matrixFlags.length; matFlagNdx++)
+ es3fUniformBlockTests.createBlockBasicTypeCases(layoutGroup, matrixFlags[matFlagNdx].name + '_' + typeName,
+ glsUniformBlockCase.newVarTypeArray(glsUniformBlockCase.newVarTypeBasic(type, glsUniformBlockCase.UniformFlags.PRECISION_HIGH), arraySize),
+ layoutFlags[layoutFlagNdx].flags | matrixFlags[matFlagNdx].flags);
+ }
+ }
+ }
+ bufferedLogToConsole('ubo.single_basic_array: Tests created');
+
+ // ubo.single_struct
+ /** @type {tcuTestCase.DeqpTest} */
+ var singleStructGroup = tcuTestCase.newTest('single_struct', 'Single struct in uniform block');
+ testGroup.addChild(singleStructGroup);
+
+ for (var modeNdx = 0; modeNdx < bufferModes.length; modeNdx++) {
+ modeGroup = tcuTestCase.newTest(bufferModes[modeNdx].name, '');
+ singleStructGroup.addChild(modeGroup);
+
+ for (var layoutFlagNdx = 0; layoutFlagNdx < layoutFlags.length; layoutFlagNdx++) {
+ for (var isArray = 0; isArray < 2; isArray++) {
+ baseName = layoutFlags[layoutFlagNdx].name;
+ baseFlags = layoutFlags[layoutFlagNdx].flags;
+
+ if (bufferModes[modeNdx].mode == glsUniformBlockCase.BufferMode.BUFFERMODE_SINGLE && isArray == 0)
+ continue; // Doesn't make sense to add this variant.
+
+ if (isArray)
+ baseName += '_instance_array';
+
+ modeGroup.addChild(new es3fUniformBlockTests.BlockSingleStructCase(baseName + '_vertex', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX, bufferModes[modeNdx].mode, isArray ? 3 : 0));
+ modeGroup.addChild(new es3fUniformBlockTests.BlockSingleStructCase(baseName + '_fragment', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, bufferModes[modeNdx].mode, isArray ? 3 : 0));
+
+ if (!(baseFlags & glsUniformBlockCase.UniformFlags.LAYOUT_PACKED))
+ modeGroup.addChild(new es3fUniformBlockTests.BlockSingleStructCase(baseName + '_both', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, bufferModes[modeNdx].mode, isArray ? 3 : 0));
+ }
+ }
+ }
+ bufferedLogToConsole('ubo.single_struct: Tests created');
+
+ // ubo.single_struct_array
+ /** @type {tcuTestCase.DeqpTest} */
+ var singleStructArrayGroup = tcuTestCase.newTest('single_struct_array', 'Struct array in one uniform block');
+ testGroup.addChild(singleStructArrayGroup);
+
+ for (var modeNdx = 0; modeNdx < bufferModes.length; modeNdx++) {
+ modeGroup = tcuTestCase.newTest(bufferModes[modeNdx].name, '');
+ singleStructArrayGroup.addChild(modeGroup);
+
+ for (var layoutFlagNdx = 0; layoutFlagNdx < layoutFlags.length; layoutFlagNdx++) {
+ for (var isArray = 0; isArray < 2; isArray++) {
+ baseName = layoutFlags[layoutFlagNdx].name;
+ baseFlags = layoutFlags[layoutFlagNdx].flags;
+
+ if (bufferModes[modeNdx].mode == glsUniformBlockCase.BufferMode.BUFFERMODE_SINGLE && isArray == 0)
+ continue; // Doesn't make sense to add this variant.
+
+ if (isArray)
+ baseName += '_instance_array';
+
+ modeGroup.addChild(new es3fUniformBlockTests.BlockSingleStructArrayCase(baseName + '_vertex', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX, bufferModes[modeNdx].mode, isArray ? 3 : 0));
+ modeGroup.addChild(new es3fUniformBlockTests.BlockSingleStructArrayCase(baseName + '_fragment', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, bufferModes[modeNdx].mode, isArray ? 3 : 0));
+
+ if (!(baseFlags & glsUniformBlockCase.UniformFlags.LAYOUT_PACKED))
+ modeGroup.addChild(new es3fUniformBlockTests.BlockSingleStructArrayCase(baseName + '_both', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, bufferModes[modeNdx].mode, isArray ? 3 : 0));
+ }
+ }
+ }
+ bufferedLogToConsole('ubo.single_struct_array: Tests created');
+
+ // ubo.single_nested_struct
+ /** @type {tcuTestCase.DeqpTest} */
+ var singleNestedStructGroup = tcuTestCase.newTest('single_nested_struct', 'Nested struct in one uniform block');
+ testGroup.addChild(singleNestedStructGroup);
+
+ for (var modeNdx = 0; modeNdx < bufferModes.length; modeNdx++) {
+ modeGroup = tcuTestCase.newTest(bufferModes[modeNdx].name, '');
+ singleNestedStructGroup.addChild(modeGroup);
+
+ for (var layoutFlagNdx = 0; layoutFlagNdx < layoutFlags.length; layoutFlagNdx++) {
+ for (var isArray = 0; isArray < 2; isArray++) {
+ baseName = layoutFlags[layoutFlagNdx].name;
+ baseFlags = layoutFlags[layoutFlagNdx].flags;
+
+ if (bufferModes[modeNdx].mode == glsUniformBlockCase.BufferMode.BUFFERMODE_SINGLE && isArray == 0)
+ continue; // Doesn't make sense to add this variant.
+
+ if (isArray)
+ baseName += '_instance_array';
+
+ modeGroup.addChild(new es3fUniformBlockTests.BlockSingleNestedStructCase(baseName + '_vertex', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX, bufferModes[modeNdx].mode, isArray ? 3 : 0));
+ modeGroup.addChild(new es3fUniformBlockTests.BlockSingleNestedStructCase(baseName + '_fragment', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, bufferModes[modeNdx].mode, isArray ? 3 : 0));
+
+ if (!(baseFlags & glsUniformBlockCase.UniformFlags.LAYOUT_PACKED))
+ modeGroup.addChild(new es3fUniformBlockTests.BlockSingleNestedStructCase(baseName + '_both', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, bufferModes[modeNdx].mode, isArray ? 3 : 0));
+ }
+ }
+ }
+ bufferedLogToConsole('ubo.single_nested_struct: Tests created');
+
+ // ubo.single_nested_struct_array
+ /** @type {tcuTestCase.DeqpTest} */
+ var singleNestedStructArrayGroup = tcuTestCase.newTest('single_nested_struct_array', 'Nested struct array in one uniform block');
+ testGroup.addChild(singleNestedStructArrayGroup);
+
+ for (var modeNdx = 0; modeNdx < bufferModes.length; modeNdx++) {
+ modeGroup = tcuTestCase.newTest(bufferModes[modeNdx].name, '');
+ singleNestedStructArrayGroup.addChild(modeGroup);
+
+ for (var layoutFlagNdx = 0; layoutFlagNdx < layoutFlags.length; layoutFlagNdx++) {
+ for (var isArray = 0; isArray < 2; isArray++) {
+ baseName = layoutFlags[layoutFlagNdx].name;
+ baseFlags = layoutFlags[layoutFlagNdx].flags;
+
+ if (bufferModes[modeNdx].mode == glsUniformBlockCase.BufferMode.BUFFERMODE_SINGLE && isArray == 0)
+ continue; // Doesn't make sense to add this variant.
+
+ if (isArray)
+ baseName += '_instance_array';
+
+ modeGroup.addChild(new es3fUniformBlockTests.BlockSingleNestedStructArrayCase(baseName + '_vertex', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX, bufferModes[modeNdx].mode, isArray ? 3 : 0));
+ modeGroup.addChild(new es3fUniformBlockTests.BlockSingleNestedStructArrayCase(baseName + '_fragment', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, bufferModes[modeNdx].mode, isArray ? 3 : 0));
+
+ if (!(baseFlags & glsUniformBlockCase.UniformFlags.LAYOUT_PACKED))
+ modeGroup.addChild(new es3fUniformBlockTests.BlockSingleNestedStructArrayCase(baseName + '_both', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, bufferModes[modeNdx].mode, isArray ? 3 : 0));
+ }
+ }
+ }
+ bufferedLogToConsole('ubo.single_nested_struct_array: Tests created');
+
+ // ubo.instance_array_basic_type
+ /** @type {tcuTestCase.DeqpTest} */
+ var instanceArrayBasicTypeGroup = tcuTestCase.newTest('instance_array_basic_type', 'Single basic variable in instance array');
+ testGroup.addChild(instanceArrayBasicTypeGroup);
+
+ for (var layoutFlagNdx = 0; layoutFlagNdx < layoutFlags.length; layoutFlagNdx++) {
+ layoutGroup = tcuTestCase.newTest(layoutFlags[layoutFlagNdx].name, '');
+ instanceArrayBasicTypeGroup.addChild(layoutGroup);
+
+ for (var basicTypeNdx = 0; basicTypeNdx < basicTypes.length; basicTypeNdx++) {
+ type = basicTypes[basicTypeNdx];
+ typeName = gluShaderUtil.getDataTypeName(type);
+ /** @type {number} */ var numInstances = 3;
+
+ es3fUniformBlockTests.createBlockBasicTypeCases(layoutGroup, typeName,
+ glsUniformBlockCase.newVarTypeBasic(type, gluShaderUtil.isDataTypeBoolOrBVec(type) ? 0 : glsUniformBlockCase.UniformFlags.PRECISION_HIGH),
+ layoutFlags[layoutFlagNdx].flags, numInstances);
+
+ if (gluShaderUtil.isDataTypeMatrix(type)) {
+ for (var matFlagNdx = 0; matFlagNdx < matrixFlags.length; matFlagNdx++)
+ es3fUniformBlockTests.createBlockBasicTypeCases(layoutGroup, matrixFlags[matFlagNdx].name + '_' + typeName,
+ glsUniformBlockCase.newVarTypeBasic(type, glsUniformBlockCase.UniformFlags.PRECISION_HIGH), layoutFlags[layoutFlagNdx].flags | matrixFlags[matFlagNdx].flags,
+ numInstances);
+ }
+ }
+ }
+ bufferedLogToConsole('ubo.instance_array_basic_type: Tests created');
+
+ // ubo.multi_basic_types
+ /** @type {tcuTestCase.DeqpTest} */
+ var multiBasicTypesGroup = tcuTestCase.newTest('multi_basic_types', 'Multiple buffers with basic types');
+ testGroup.addChild(multiBasicTypesGroup);
+
+ for (var modeNdx = 0; modeNdx < bufferModes.length; modeNdx++) {
+ modeGroup = tcuTestCase.newTest(bufferModes[modeNdx].name, '');
+ multiBasicTypesGroup.addChild(modeGroup);
+
+ for (var layoutFlagNdx = 0; layoutFlagNdx < layoutFlags.length; layoutFlagNdx++) {
+ for (var isArray = 0; isArray < 2; isArray++) {
+ baseName = layoutFlags[layoutFlagNdx].name;
+ baseFlags = layoutFlags[layoutFlagNdx].flags;
+
+ if (isArray)
+ baseName += '_instance_array';
+
+ modeGroup.addChild(new es3fUniformBlockTests.BlockMultiBasicTypesCase(baseName + '_vertex', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX, baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX, bufferModes[modeNdx].mode, isArray ? 3 : 0));
+ modeGroup.addChild(new es3fUniformBlockTests.BlockMultiBasicTypesCase(baseName + '_fragment', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, bufferModes[modeNdx].mode, isArray ? 3 : 0));
+
+ if (!(baseFlags & glsUniformBlockCase.UniformFlags.LAYOUT_PACKED))
+ modeGroup.addChild(new es3fUniformBlockTests.BlockMultiBasicTypesCase(baseName + '_both', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, bufferModes[modeNdx].mode, isArray ? 3 : 0));
+
+ modeGroup.addChild(new es3fUniformBlockTests.BlockMultiBasicTypesCase(baseName + '_mixed', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX, baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, bufferModes[modeNdx].mode, isArray ? 3 : 0));
+ }
+ }
+ }
+ bufferedLogToConsole('ubo.multi_basic_types: Tests created');
+
+ // ubo.multi_nested_struct
+ /** @type {tcuTestCase.DeqpTest} */
+ var multiNestedStructGroup = tcuTestCase.newTest('multi_nested_struct', 'Multiple buffers with basic types');
+ testGroup.addChild(multiNestedStructGroup);
+
+ for (var modeNdx = 0; modeNdx < bufferModes.length; modeNdx++) {
+ modeGroup = tcuTestCase.newTest(bufferModes[modeNdx].name, '');
+ multiNestedStructGroup.addChild(modeGroup);
+
+ for (var layoutFlagNdx = 0; layoutFlagNdx < layoutFlags.length; layoutFlagNdx++) {
+ for (var isArray = 0; isArray < 2; isArray++) {
+ baseName = layoutFlags[layoutFlagNdx].name;
+ baseFlags = layoutFlags[layoutFlagNdx].flags;
+
+ if (isArray)
+ baseName += '_instance_array';
+
+ modeGroup.addChild(new es3fUniformBlockTests.BlockMultiNestedStructCase(baseName + '_vertex', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX, baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX, bufferModes[modeNdx].mode, isArray ? 3 : 0));
+ modeGroup.addChild(new es3fUniformBlockTests.BlockMultiNestedStructCase(baseName + '_fragment', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, bufferModes[modeNdx].mode, isArray ? 3 : 0));
+
+ if (!(baseFlags & glsUniformBlockCase.UniformFlags.LAYOUT_PACKED))
+ modeGroup.addChild(new es3fUniformBlockTests.BlockMultiNestedStructCase(baseName + '_both', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, bufferModes[modeNdx].mode, isArray ? 3 : 0));
+
+ modeGroup.addChild(new es3fUniformBlockTests.BlockMultiNestedStructCase(baseName + '_mixed', '', baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_VERTEX, baseFlags | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT, bufferModes[modeNdx].mode, isArray ? 3 : 0));
+ }
+ }
+ }
+ bufferedLogToConsole('ubo.multi_nested_struct: Tests created');
+
+ /* ubo.random */
+ /** @type {number} */ var allShaders = glsRandomUniformBlockCase.FeatureBits.FEATURE_VERTEX_BLOCKS | glsRandomUniformBlockCase.FeatureBits.FEATURE_FRAGMENT_BLOCKS | glsRandomUniformBlockCase.FeatureBits.FEATURE_SHARED_BLOCKS;
+ /** @type {number} */ var allLayouts = glsRandomUniformBlockCase.FeatureBits.FEATURE_STD140_LAYOUT;
+ /** @type {number} */ var allBasicTypes = glsRandomUniformBlockCase.FeatureBits.FEATURE_VECTORS | glsRandomUniformBlockCase.FeatureBits.FEATURE_MATRICES;
+ /** @type {number} */ var unused = glsRandomUniformBlockCase.FeatureBits.FEATURE_UNUSED_MEMBERS | glsRandomUniformBlockCase.FeatureBits.FEATURE_UNUSED_UNIFORMS;
+ /** @type {number} */ var matFlags = glsRandomUniformBlockCase.FeatureBits.FEATURE_MATRIX_LAYOUT;
+ /** @type {number} */ var allFeatures = (~glsRandomUniformBlockCase.FeatureBits.FEATURE_ARRAYS_OF_ARRAYS & 0xFFFF);
+
+ /** @type {tcuTestCase.DeqpTest} */
+ var randomGroup = tcuTestCase.newTest('random', 'Random Uniform Block cases');
+ testGroup.addChild(randomGroup);
+
+ // Basic types.
+ es3fUniformBlockTests.createRandomCaseGroup(randomGroup, 'scalar_types', 'Scalar types only, per-block buffers', glsUniformBlockCase.BufferMode.BUFFERMODE_PER_BLOCK, allShaders | allLayouts | unused, 25, 0);
+ es3fUniformBlockTests.createRandomCaseGroup(randomGroup, 'vector_types', 'Scalar and vector types only, per-block buffers', glsUniformBlockCase.BufferMode.BUFFERMODE_PER_BLOCK, allShaders | allLayouts | unused | glsRandomUniformBlockCase.FeatureBits.FEATURE_VECTORS, 25, 25);
+ es3fUniformBlockTests.createRandomCaseGroup(randomGroup, 'basic_types', 'All basic types, per-block buffers', glsUniformBlockCase.BufferMode.BUFFERMODE_PER_BLOCK, allShaders | allLayouts | unused | allBasicTypes | matFlags, 25, 50);
+ es3fUniformBlockTests.createRandomCaseGroup(randomGroup, 'basic_arrays', 'Arrays, per-block buffers', glsUniformBlockCase.BufferMode.BUFFERMODE_PER_BLOCK, allShaders | allLayouts | unused | allBasicTypes | matFlags | glsRandomUniformBlockCase.FeatureBits.FEATURE_ARRAYS, 25, 50);
+
+ es3fUniformBlockTests.createRandomCaseGroup(randomGroup, 'basic_instance_arrays', 'Basic instance arrays, per-block buffers', glsUniformBlockCase.BufferMode.BUFFERMODE_PER_BLOCK, allShaders | allLayouts | unused | allBasicTypes | matFlags | glsRandomUniformBlockCase.FeatureBits.FEATURE_INSTANCE_ARRAYS, 25, 75);
+ es3fUniformBlockTests.createRandomCaseGroup(randomGroup, 'nested_structs', 'Nested structs, per-block buffers', glsUniformBlockCase.BufferMode.BUFFERMODE_PER_BLOCK, allShaders | allLayouts | unused | allBasicTypes | matFlags | glsRandomUniformBlockCase.FeatureBits.FEATURE_STRUCTS, 25, 100);
+ es3fUniformBlockTests.createRandomCaseGroup(randomGroup, 'nested_structs_arrays', 'Nested structs, arrays, per-block buffers', glsUniformBlockCase.BufferMode.BUFFERMODE_PER_BLOCK, allShaders | allLayouts | unused | allBasicTypes | matFlags | glsRandomUniformBlockCase.FeatureBits.FEATURE_STRUCTS | glsRandomUniformBlockCase.FeatureBits.FEATURE_ARRAYS, 25, 150);
+ es3fUniformBlockTests.createRandomCaseGroup(randomGroup, 'nested_structs_instance_arrays', 'Nested structs, instance arrays, per-block buffers', glsUniformBlockCase.BufferMode.BUFFERMODE_PER_BLOCK, allShaders | allLayouts | unused | allBasicTypes | matFlags | glsRandomUniformBlockCase.FeatureBits.FEATURE_STRUCTS | glsRandomUniformBlockCase.FeatureBits.FEATURE_INSTANCE_ARRAYS, 25, 125);
+ es3fUniformBlockTests.createRandomCaseGroup(randomGroup, 'nested_structs_arrays_instance_arrays', 'Nested structs, instance arrays, per-block buffers', glsUniformBlockCase.BufferMode.BUFFERMODE_PER_BLOCK, allShaders | allLayouts | unused | allBasicTypes | matFlags | glsRandomUniformBlockCase.FeatureBits.FEATURE_STRUCTS | glsRandomUniformBlockCase.FeatureBits.FEATURE_ARRAYS | glsRandomUniformBlockCase.FeatureBits.FEATURE_INSTANCE_ARRAYS, 25, 175);
+
+ // Disabled: WebGL does not support shared or packed uniform buffers.
+ //es3fUniformBlockTests.createRandomCaseGroup(randomGroup, 'all_per_block_buffers', 'All random features, per-block buffers', glsUniformBlockCase.BufferMode.BUFFERMODE_PER_BLOCK, allFeatures, 50, 200);
+ //es3fUniformBlockTests.createRandomCaseGroup(randomGroup, 'all_shared_buffer', 'All random features, shared buffer', glsUniformBlockCase.BufferMode.BUFFERMODE_SINGLE, allFeatures, 50, 250);
+ bufferedLogToConsole('ubo.random: Tests created');
+ };
+
+ /**
+ * Create and execute the test cases
+ */
+ es3fUniformBlockTests.run = function(range) {
+ //Set up Test Root parameters
+ var testName = 'ubo';
+ var testDescription = 'Uniform Block Tests';
+ var state = tcuTestCase.runner;
+
+ state.setRoot(tcuTestCase.newTest(testName, testDescription, null));
+
+ //Set up name and description of this test series.
+ setCurrentTestName(testName);
+ description(testDescription);
+
+ try {
+ //Create test cases
+ es3fUniformBlockTests.init();
+ if (range)
+ state.setRange(range);
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fUniformBlockTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fVertexArrayObjectTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fVertexArrayObjectTests.js
new file mode 100644
index 0000000000..6ee46995ca
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fVertexArrayObjectTests.js
@@ -0,0 +1,875 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fVertexArrayObjectTests');
+goog.require('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.delibs.debase.deUtil');
+goog.require('framework.opengl.gluShaderProgram');
+
+goog.scope(function() {
+var es3fVertexArrayObjectTests = functional.gles3.es3fVertexArrayObjectTests;
+var tcuTestCase = framework.common.tcuTestCase;
+var deRandom = framework.delibs.debase.deRandom;
+var deString = framework.delibs.debase.deString;
+var gluShaderProgram = framework.opengl.gluShaderProgram;
+var tcuSurface = framework.common.tcuSurface;
+var tcuImageCompare = framework.common.tcuImageCompare;
+var deUtil = framework.delibs.debase.deUtil;
+
+/**
+ * @constructor
+ */
+es3fVertexArrayObjectTests.Attribute = function() {
+ this.enabled = false;
+ this.size = 1;
+ this.stride = 0;
+ this.type = gl.FLOAT;
+ this.integer = false;
+ this.divisor = 0;
+ this.offset = 0;
+ this.normalized = false;
+ this.bufferNdx = 0;
+};
+
+/**
+ * @constructor
+ * @struct
+ */
+es3fVertexArrayObjectTests.VertexArrayState = function() {
+ this.attributes = [];
+ this.elementArrayBuffer = 0;
+};
+
+/**
+ * @constructor
+ * @struct
+ */
+es3fVertexArrayObjectTests.BufferSpec = function(count, size, componentCount, stride, offset, type, intRangeMin, intRangeMax, floatRangeMin, floatRangeMax) {
+ this.count = count;
+ this.size = size;
+ this.componentCount = componentCount;
+ this.stride = stride;
+ this.offset = offset;
+
+ this.type = type;
+
+ this.intRangeMin = intRangeMin;
+ this.intRangeMax = intRangeMax;
+
+ this.floatRangeMin = floatRangeMin;
+ this.floatRangeMax = floatRangeMax;
+};
+
+/**
+ * @constructor
+ */
+es3fVertexArrayObjectTests.Spec = function() {
+ this.count = -1;
+ this.instances = -1;
+ this.useDrawElements = false;
+ this.indexType = gl.NONE;
+ this.indexOffset = -1;
+ this.indexRangeMin = -1;
+ this.indexRangeMax = -1;
+ this.indexCount = -1;
+ this.buffers = [];
+};
+
+/**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {es3fVertexArrayObjectTests.Spec} spec
+ * @param {string} name
+ * @param {string} description
+ */
+es3fVertexArrayObjectTests.VertexArrayObjectTest = function(spec, name, description) {
+ tcuTestCase.DeqpTest.call(this, name, description);
+ this.m_spec = spec;
+ this.m_random = new deRandom.Random(deString.deStringHash(name));
+ /** @type Array<WebGLBuffer>} */ this.m_buffers = [];
+ // mapping 0 -> null object
+ this.m_buffers.push(null);
+};
+
+es3fVertexArrayObjectTests.VertexArrayObjectTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+es3fVertexArrayObjectTests.VertexArrayObjectTest.prototype.constructor = es3fVertexArrayObjectTests.VertexArrayObjectTest;
+
+es3fVertexArrayObjectTests.VertexArrayObjectTest.prototype.init = function() {
+ this.m_vaoProgram = this.createProgram(this.m_spec.vao);
+ // m_log << tcu::TestLog::Message << "Program used with Vertex Array Object" << tcu::TestLog::EndMessage;
+ // m_log << *m_vaoProgram;
+ this.m_stateProgram = this.createProgram(this.m_spec.state);
+ // m_log << tcu::TestLog::Message << "Program used with Vertex Array State" << tcu::TestLog::EndMessage;
+ // m_log << *m_stateProgram;
+
+ if (!this.m_vaoProgram.isOk() || !this.m_stateProgram.isOk())
+ testFailedOptions('Failed to compile shaders', true);
+};
+
+/**
+ * @param {number} target GL target
+ * @param {number} index Index of the buffer to bind
+ */
+es3fVertexArrayObjectTests.VertexArrayObjectTest.prototype.bindBuffer = function(target, index) {
+ if (typeof this.m_buffers[index] === 'undefined') {
+ var data = this.createRandomBufferData(this.m_spec.buffers[index - 1]);
+ var buffer = gl.createBuffer();
+ this.m_buffers[index] = buffer;
+
+ gl.bindBuffer(target, buffer);
+ gl.bufferData(target, data, gl.DYNAMIC_DRAW);
+ gl.bindBuffer(target, null);
+ }
+
+ gl.bindBuffer(target, this.m_buffers[index]);
+};
+
+/**
+ * @param {es3fVertexArrayObjectTests.BufferSpec} buffer
+ */
+es3fVertexArrayObjectTests.VertexArrayObjectTest.prototype.createRandomBufferData = function(buffer) {
+ var typedArray;
+ switch (buffer.type) {
+ case gl.FLOAT: typedArray = Float32Array; break;
+ case gl.INT: typedArray = Int32Array; break;
+ case gl.UNSIGNED_INT: typedArray = Uint32Array; break;
+ case gl.SHORT: typedArray = Int16Array; break;
+ case gl.UNSIGNED_SHORT: typedArray = Uint16Array; break;
+ case gl.BYTE: typedArray = Int8Array; break;
+ case gl.UNSIGNED_BYTE: typedArray = Uint8Array; break;
+ default:
+ throw new Error('Invalid type: ' + buffer.type);
+ }
+
+ var raw = new ArrayBuffer(buffer.size);
+ var stride;
+
+ if (buffer.stride != 0) {
+ stride = buffer.stride;
+ } else {
+ switch (buffer.type) {
+ case gl.FLOAT: stride = buffer.componentCount * 4; break;
+ case gl.INT: stride = buffer.componentCount * 4; break;
+ case gl.UNSIGNED_INT: stride = buffer.componentCount * 4; break;
+ case gl.SHORT: stride = buffer.componentCount * 2; break;
+ case gl.UNSIGNED_SHORT: stride = buffer.componentCount * 2; break;
+ case gl.BYTE: stride = buffer.componentCount * 1; break;
+ case gl.UNSIGNED_BYTE: stride = buffer.componentCount * 1; break;
+ }
+ }
+
+ var offset = 0;
+
+ for (var pos = 0; pos < buffer.count; pos++) {
+ var data = new typedArray(raw, offset, buffer.componentCount);
+ for (var componentNdx = 0; componentNdx < buffer.componentCount; componentNdx++) {
+ switch (buffer.type) {
+ case gl.FLOAT: {
+ data[componentNdx] = this.m_random.getFloat(buffer.floatRangeMin, buffer.floatRangeMax);
+ break;
+ }
+ default: {
+ data[componentNdx] = this.m_random.getInt(buffer.intRangeMin, buffer.intRangeMax);
+ }
+ }
+ }
+
+ offset += stride;
+ }
+
+ return new typedArray(raw);
+};
+
+/**
+ * @param {es3fVertexArrayObjectTests.VertexArrayState} state
+ */
+es3fVertexArrayObjectTests.VertexArrayObjectTest.prototype.createProgram = function(state) {
+ var vtx = '';
+ var value = '';
+
+ vtx += '#version 300 es\n';
+
+ for (var attribNdx = 0; attribNdx < state.attributes.length; attribNdx++) {
+ if (state.attributes[attribNdx].integer)
+ vtx += 'layout(location = ' + attribNdx + ') in mediump ivec4 a_attrib' + attribNdx + ';\n';
+ else
+ vtx += 'layout(location = ' + attribNdx + ') in mediump vec4 a_attrib' + attribNdx + ';\n';
+
+ if (state.attributes[attribNdx].integer) {
+ var scale = 0.0;
+
+ // TODO: Should it be state.attributes[attribNdx].type?
+ switch (state.attributes[attribNdx].type) {
+ case gl.SHORT: scale = (1.0 / ((1 << 14) - 1)); break;
+ case gl.UNSIGNED_SHORT: scale = (1.0 / ((1 << 15) - 1)); break;
+ case gl.INT: scale = (1.0 / ((1 << 30) - 1)); break;
+ case gl.UNSIGNED_INT: scale = (1.0 / ((1 << 31) - 1)); break;
+ case gl.BYTE: scale = (1.0 / ((1 << 6) - 1)); break;
+ case gl.UNSIGNED_BYTE: scale = (1.0 / ((1 << 7) - 1)); break;
+
+ default:
+ throw new Error('Invalid type: ' + state.attributes[0].type);
+ }
+ value += (attribNdx != 0 ? ' + ' : '') + scale + ' * vec4(a_attrib' + attribNdx + ')';
+ } else if (state.attributes[attribNdx].type != gl.FLOAT && !state.attributes[attribNdx].normalized) {
+ var scale = 0.0;
+
+ switch (state.attributes[attribNdx].type) {
+ case gl.SHORT: scale = (0.5 / ((1 << 14) - 1)); break;
+ case gl.UNSIGNED_SHORT: scale = (0.5 / ((1 << 15) - 1)); break;
+ case gl.INT: scale = (0.5 / ((1 << 30) - 1)); break;
+ case gl.UNSIGNED_INT: scale = (0.5 / ((1 << 31) - 1)); break;
+ case gl.BYTE: scale = (0.5 / ((1 << 6) - 1)); break;
+ case gl.UNSIGNED_BYTE: scale = (0.5 / ((1 << 7) - 1)); break;
+
+ default:
+ throw new Error('Invalid type: ' + state.attributes[0].type);
+ }
+ value += (attribNdx != 0 ? ' + ' : '') + scale + ' * a_attrib' + attribNdx;
+ } else
+ value += (attribNdx != 0 ? ' + ' : '') + 'a_attrib' + attribNdx;
+ }
+
+ vtx +=
+ 'out mediump vec4 v_value;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ '\tv_value = ' + value + ';\n';
+
+ if (state.attributes[0].integer) {
+ var scale = 0.0;
+
+ switch (state.attributes[0].type) {
+ case gl.SHORT: scale = (1.0 / ((1 << 14) - 1)); break;
+ case gl.UNSIGNED_SHORT: scale = (1.0 / ((1 << 15) - 1)); break;
+ case gl.INT: scale = (1.0 / ((1 << 30) - 1)); break;
+ case gl.UNSIGNED_INT: scale = (1.0 / ((1 << 31) - 1)); break;
+ case gl.BYTE: scale = (1.0 / ((1 << 6) - 1)); break;
+ case gl.UNSIGNED_BYTE: scale = (1.0 / ((1 << 7) - 1)); break;
+
+ default:
+ throw new Error('Invalid type: ' + state.attributes[0].type);
+ }
+
+ vtx +=
+ '\tgl_Position = vec4(' + scale + ' * ' + 'vec3(a_attrib0.xyz), 1.0);\n' +
+ '}';
+ } else {
+ if (state.attributes[0].normalized || state.attributes[0].type == gl.FLOAT) {
+ vtx +=
+ '\tgl_Position = vec4(a_attrib0.xyz, 1.0);\n' +
+ '}';
+ } else {
+ var scale = 0.0;
+
+ switch (state.attributes[0].type) {
+ case gl.SHORT: scale = (1.0 / ((1 << 14) - 1)); break;
+ case gl.UNSIGNED_SHORT: scale = (1.0 / ((1 << 15) - 1)); break;
+ case gl.INT: scale = (1.0 / ((1 << 30) - 1)); break;
+ case gl.UNSIGNED_INT: scale = (1.0 / ((1 << 31) - 1)); break;
+ case gl.BYTE: scale = (1.0 / ((1 << 6) - 1)); break;
+ case gl.UNSIGNED_BYTE: scale = (1.0 / ((1 << 7) - 1)); break;
+
+ default:
+ throw new Error('Invalid type: ' + state.attributes[0].type);
+ }
+
+ scale *= 0.5;
+
+ vtx +=
+ '\tgl_Position = vec4(' + scale + ' * ' + 'a_attrib0.xyz, 1.0);\n' +
+ '}';
+ }
+ }
+
+ var fragmentShader =
+ '#version 300 es\n' +
+ 'in mediump vec4 v_value;\n' +
+ 'layout(location = 0) out mediump vec4 fragColor;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ '\tfragColor = vec4(v_value.xyz, 1.0);\n' +
+ '}';
+
+ return new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vtx, fragmentShader));
+};
+
+/**
+ * @param {es3fVertexArrayObjectTests.VertexArrayState} state
+ */
+es3fVertexArrayObjectTests.VertexArrayObjectTest.prototype.setState = function(state) {
+ this.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, state.elementArrayBuffer);
+
+ for (var attribNdx = 0; attribNdx < state.attributes.length; attribNdx++) {
+ this.bindBuffer(gl.ARRAY_BUFFER, state.attributes[attribNdx].bufferNdx);
+ if (state.attributes[attribNdx].enabled)
+ gl.enableVertexAttribArray(attribNdx);
+ else
+ gl.disableVertexAttribArray(attribNdx);
+
+ if (state.attributes[attribNdx].integer)
+ gl.vertexAttribIPointer(attribNdx, state.attributes[attribNdx].size, state.attributes[attribNdx].type, state.attributes[attribNdx].stride, state.attributes[attribNdx].offset);
+ else
+ gl.vertexAttribPointer(attribNdx, state.attributes[attribNdx].size, state.attributes[attribNdx].type, state.attributes[attribNdx].normalized, state.attributes[attribNdx].stride, state.attributes[attribNdx].offset);
+
+ gl.vertexAttribDivisor(attribNdx, state.attributes[attribNdx].divisor);
+ }
+};
+
+/**
+ * @param {es3fVertexArrayObjectTests.VertexArrayState} state
+ */
+es3fVertexArrayObjectTests.VertexArrayObjectTest.prototype.makeDrawCall = function(state) {
+ gl.clearColor(0.7, 0.7, 0.7, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ var spec = this.m_spec;
+
+ if (spec.useDrawElements) {
+ if (spec.instances == 0)
+ gl.drawElements(gl.TRIANGLES, spec.count, spec.indexType, spec.indexOffset);
+ else
+ gl.drawElementsInstanced(gl.TRIANGLES, spec.count, spec.indexType, spec.indexOffset, spec.instances);
+ } else {
+ if (spec.instances == 0)
+ gl.drawArrays(gl.TRIANGLES, 0, spec.count);
+ else
+ gl.drawArraysInstanced(gl.TRIANGLES, 0, spec.count, spec.instances);
+ }
+};
+
+/**
+ * @param {tcuSurface.Surface} vaoResult
+ * @param {tcuSurface.Surface} defaultResult
+ */
+es3fVertexArrayObjectTests.VertexArrayObjectTest.prototype.render = function(vaoResult, defaultResult) {
+ var vao = gl.createVertexArray();
+
+ gl.bindVertexArray(vao);
+ this.setState(this.m_spec.vao);
+ gl.bindVertexArray(null);
+
+ this.setState(this.m_spec.state);
+
+ gl.bindVertexArray(vao);
+ gl.useProgram(this.m_vaoProgram.getProgram());
+ this.makeDrawCall(this.m_spec.vao);
+ vaoResult.readViewport();
+ this.setState(this.m_spec.vao);
+ gl.bindVertexArray(null);
+
+ gl.useProgram(this.m_stateProgram.getProgram());
+ this.makeDrawCall(this.m_spec.state);
+ defaultResult.readViewport();
+
+ gl.deleteVertexArray(vao);
+};
+
+/**
+ * @param {tcuSurface.Surface} vaoRef
+ * @param {tcuSurface.Surface} defaultRef
+ */
+es3fVertexArrayObjectTests.VertexArrayObjectTest.prototype.genReferences = function(vaoRef, defaultRef) {
+ this.setState(this.m_spec.vao);
+ gl.useProgram(this.m_vaoProgram.getProgram());
+ this.makeDrawCall(this.m_spec.vao);
+ vaoRef.readViewport();
+
+ this.setState(this.m_spec.state);
+ gl.useProgram(this.m_stateProgram.getProgram());
+ this.makeDrawCall(this.m_spec.state);
+ defaultRef.readViewport();
+};
+
+es3fVertexArrayObjectTests.VertexArrayObjectTest.prototype.iterate = function() {
+ var vaoReference = new tcuSurface.Surface();
+ var stateReference = new tcuSurface.Surface();
+ var vaoResult = new tcuSurface.Surface();
+ var stateResult = new tcuSurface.Surface();
+
+ var isOk;
+
+ // logVertexArrayState(m_log, m_spec.vao, "Vertex Array Object State");
+ // logVertexArrayState(m_log, m_spec.state, "OpenGL Vertex Array State");
+ this.genReferences(stateReference, vaoReference);
+ this.render(stateResult, vaoResult);
+
+ isOk = tcuImageCompare.pixelThresholdCompare('Results', 'Comparison result from rendering with Vertex Array State', stateReference, stateResult, [0, 0, 0, 0]);
+ isOk = isOk && tcuImageCompare.pixelThresholdCompare('Results', 'Comparison result from rendering with Vertex Array Object', vaoReference, vaoResult, [0, 0, 0, 0]);
+
+ if (!isOk)
+ testFailedOptions('Result comparison failed', false);
+ else
+ testPassedOptions('Pass', true);
+
+ return tcuTestCase.IterateResult.STOP;
+};
+
+/**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+es3fVertexArrayObjectTests.VertexArrayObjectTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'vertex_array_objects', 'Vertex array object test cases');
+};
+
+es3fVertexArrayObjectTests.VertexArrayObjectTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+es3fVertexArrayObjectTests.VertexArrayObjectTests.prototype.constructor = es3fVertexArrayObjectTests.VertexArrayObjectTests;
+
+es3fVertexArrayObjectTests.VertexArrayObjectTests.prototype.init = function() {
+ var floatCoordBuffer48_1 = new es3fVertexArrayObjectTests.BufferSpec(48, 384, 2, 0, 0, gl.FLOAT, 0, 0, -1.0, 1.0);
+ var floatCoordBuffer48_2 = new es3fVertexArrayObjectTests.BufferSpec(48, 384, 2, 0, 0, gl.FLOAT, 0, 0, -1.0, 1.0);
+
+ var shortCoordBuffer48 = new es3fVertexArrayObjectTests.BufferSpec(48, 192, 2, 0, 0, gl.SHORT, -32768, 32768, 0.0, 0.0);
+
+ var spec;
+ var state;
+ // Different buffer
+ spec = new es3fVertexArrayObjectTests.Spec();
+
+ state = new es3fVertexArrayObjectTests.VertexArrayState();
+
+ state.attributes.push(new es3fVertexArrayObjectTests.Attribute());
+
+ state.attributes[0].enabled = true;
+ state.attributes[0].size = 2;
+ state.attributes[0].stride = 0;
+ state.attributes[0].type = gl.FLOAT;
+ state.attributes[0].integer = false;
+ state.attributes[0].divisor = 0;
+ state.attributes[0].offset = 0;
+ state.attributes[0].normalized = false;
+
+ state.elementArrayBuffer = 0;
+
+ spec.buffers.push(floatCoordBuffer48_1);
+ spec.buffers.push(floatCoordBuffer48_2);
+
+ spec.useDrawElements = false;
+ spec.instances = 0;
+ spec.count = 48;
+ spec.vao = state;
+ spec.state = deUtil.clone(state);
+ spec.indexOffset = 0;
+ spec.indexRangeMin = 0;
+ spec.indexRangeMax = 0;
+ spec.indexType = gl.NONE;
+ spec.indexCount = 0;
+
+ spec.state.attributes[0].bufferNdx = 1;
+ spec.vao.attributes[0].bufferNdx = 2;
+ this.addChild(new es3fVertexArrayObjectTests.VertexArrayObjectTest(spec, 'diff_buffer', 'diff_buffer'));
+
+ // Different size
+ spec = new es3fVertexArrayObjectTests.Spec();
+
+ state = new es3fVertexArrayObjectTests.VertexArrayState();
+
+ state.attributes.push(new es3fVertexArrayObjectTests.Attribute());
+
+ state.attributes[0].enabled = true;
+ state.attributes[0].size = 2;
+ state.attributes[0].stride = 0;
+ state.attributes[0].type = gl.FLOAT;
+ state.attributes[0].integer = false;
+ state.attributes[0].divisor = 0;
+ state.attributes[0].offset = 0;
+ state.attributes[0].normalized = false;
+ state.attributes[0].bufferNdx = 1;
+
+ state.elementArrayBuffer = 0;
+
+ spec.buffers.push(floatCoordBuffer48_1);
+
+ spec.useDrawElements = false;
+ spec.instances = 0;
+ spec.count = 24;
+ spec.vao = state;
+ spec.state = deUtil.clone(state);
+ spec.indexOffset = 0;
+ spec.indexRangeMin = 0;
+ spec.indexRangeMax = 0;
+ spec.indexType = gl.NONE;
+ spec.indexCount = 0;
+
+ spec.state.attributes[0].size = 2;
+ spec.vao.attributes[0].size = 3;
+ this.addChild(new es3fVertexArrayObjectTests.VertexArrayObjectTest(spec, 'diff_size', 'diff_size'));
+
+ // Different stride
+ spec = new es3fVertexArrayObjectTests.Spec();
+
+ state = new es3fVertexArrayObjectTests.VertexArrayState();
+
+ state.attributes.push(new es3fVertexArrayObjectTests.Attribute());
+
+ state.attributes[0].enabled = true;
+ state.attributes[0].size = 2;
+ state.attributes[0].stride = 0;
+ state.attributes[0].type = gl.SHORT;
+ state.attributes[0].integer = false;
+ state.attributes[0].divisor = 0;
+ state.attributes[0].offset = 0;
+ state.attributes[0].normalized = true;
+ state.attributes[0].bufferNdx = 1;
+
+ state.elementArrayBuffer = 0;
+
+ spec.buffers.push(shortCoordBuffer48);
+
+ spec.useDrawElements = false;
+ spec.instances = 0;
+ spec.count = 24;
+ spec.vao = state;
+ spec.state = deUtil.clone(state);
+ spec.indexOffset = 0;
+ spec.indexRangeMin = 0;
+ spec.indexRangeMax = 0;
+ spec.indexType = gl.NONE;
+ spec.indexCount = 0;
+
+ spec.vao.attributes[0].stride = 2;
+ spec.state.attributes[0].stride = 4;
+ this.addChild(new es3fVertexArrayObjectTests.VertexArrayObjectTest(spec, 'diff_stride', 'diff_stride'));
+
+ // Different types
+ spec = new es3fVertexArrayObjectTests.Spec();
+
+ state = new es3fVertexArrayObjectTests.VertexArrayState();
+
+ state.attributes.push(new es3fVertexArrayObjectTests.Attribute());
+
+ state.attributes[0].enabled = true;
+ state.attributes[0].size = 2;
+ state.attributes[0].stride = 0;
+ state.attributes[0].type = gl.SHORT;
+ state.attributes[0].integer = false;
+ state.attributes[0].divisor = 0;
+ state.attributes[0].offset = 0;
+ state.attributes[0].normalized = true;
+ state.attributes[0].bufferNdx = 1;
+
+ state.elementArrayBuffer = 0;
+
+ spec.buffers.push(shortCoordBuffer48);
+
+ spec.useDrawElements = false;
+ spec.instances = 0;
+ spec.count = 24;
+ spec.vao = state;
+ spec.state = deUtil.clone(state);
+ spec.indexOffset = 0;
+ spec.indexRangeMin = 0;
+ spec.indexRangeMax = 0;
+ spec.indexType = gl.NONE;
+ spec.indexCount = 0;
+
+ spec.vao.attributes[0].type = gl.SHORT;
+ spec.state.attributes[0].type = gl.BYTE;
+ this.addChild(new es3fVertexArrayObjectTests.VertexArrayObjectTest(spec, 'diff_type', 'diff_type'));
+
+ // Different "integer"
+ spec = new es3fVertexArrayObjectTests.Spec();
+
+ state = new es3fVertexArrayObjectTests.VertexArrayState();
+
+ state.attributes.push(new es3fVertexArrayObjectTests.Attribute());
+
+ state.attributes[0].enabled = true;
+ state.attributes[0].size = 2;
+ state.attributes[0].stride = 0;
+ state.attributes[0].type = gl.BYTE;
+ state.attributes[0].integer = true;
+ state.attributes[0].divisor = 0;
+ state.attributes[0].offset = 0;
+ state.attributes[0].normalized = false;
+ state.attributes[0].bufferNdx = 1;
+
+ state.elementArrayBuffer = 0;
+
+ spec.buffers.push(shortCoordBuffer48);
+
+ spec.useDrawElements = false;
+ spec.count = 24;
+ spec.vao = state;
+ spec.state = deUtil.clone(state);
+ spec.instances = 0;
+ spec.indexOffset = 0;
+ spec.indexRangeMin = 0;
+ spec.indexRangeMax = 0;
+ spec.indexType = gl.NONE;
+ spec.indexCount = 0;
+
+ spec.state.attributes[0].integer = false;
+ spec.vao.attributes[0].integer = true;
+ this.addChild(new es3fVertexArrayObjectTests.VertexArrayObjectTest(spec, 'diff_integer', 'diff_integer'));
+
+ // Different divisor
+ spec = new es3fVertexArrayObjectTests.Spec();
+
+ state = new es3fVertexArrayObjectTests.VertexArrayState();
+
+ state.attributes.push(new es3fVertexArrayObjectTests.Attribute());
+ state.attributes.push(new es3fVertexArrayObjectTests.Attribute());
+
+ state.attributes[0].enabled = true;
+ state.attributes[0].size = 2;
+ state.attributes[0].stride = 0;
+ state.attributes[0].type = gl.SHORT;
+ state.attributes[0].integer = false;
+ state.attributes[0].divisor = 0;
+ state.attributes[0].offset = 0;
+ state.attributes[0].normalized = true;
+ state.attributes[0].bufferNdx = 1;
+
+ state.attributes[1].enabled = true;
+ state.attributes[1].size = 4;
+ state.attributes[1].stride = 0;
+ state.attributes[1].type = gl.FLOAT;
+ state.attributes[1].integer = false;
+ state.attributes[1].divisor = 0;
+ state.attributes[1].offset = 0;
+ state.attributes[1].normalized = false;
+ state.attributes[1].bufferNdx = 2;
+
+ state.elementArrayBuffer = 0;
+
+ spec.buffers.push(shortCoordBuffer48);
+ spec.buffers.push(floatCoordBuffer48_1);
+
+ spec.useDrawElements = false;
+ spec.instances = 10;
+ spec.count = 12;
+ spec.vao = state;
+ spec.state = deUtil.clone(state);
+ spec.indexOffset = 0;
+ spec.indexRangeMin = 0;
+ spec.indexRangeMax = 0;
+ spec.indexType = gl.NONE;
+ spec.indexCount = 0;
+
+ spec.vao.attributes[1].divisor = 3;
+ spec.state.attributes[1].divisor = 2;
+
+ this.addChild(new es3fVertexArrayObjectTests.VertexArrayObjectTest(spec, 'diff_divisor', 'diff_divisor'));
+
+ // Different offset
+ spec = new es3fVertexArrayObjectTests.Spec();
+
+ state = new es3fVertexArrayObjectTests.VertexArrayState();
+
+ state.attributes.push(new es3fVertexArrayObjectTests.Attribute());
+
+ state.attributes[0].enabled = true;
+ state.attributes[0].size = 2;
+ state.attributes[0].stride = 0;
+ state.attributes[0].type = gl.SHORT;
+ state.attributes[0].integer = false;
+ state.attributes[0].divisor = 0;
+ state.attributes[0].offset = 0;
+ state.attributes[0].normalized = true;
+ state.attributes[0].bufferNdx = 1;
+
+ state.elementArrayBuffer = 0;
+
+ spec.buffers.push(shortCoordBuffer48);
+
+ spec.useDrawElements = false;
+ spec.instances = 0;
+ spec.count = 24;
+ spec.vao = state;
+ spec.state = deUtil.clone(state);
+ spec.indexOffset = 0;
+ spec.indexRangeMin = 0;
+ spec.indexRangeMax = 0;
+ spec.indexType = gl.NONE;
+ spec.indexCount = 0;
+
+ spec.vao.attributes[0].offset = 2;
+ spec.state.attributes[0].offset = 4;
+ this.addChild(new es3fVertexArrayObjectTests.VertexArrayObjectTest(spec, 'diff_offset', 'diff_offset'));
+
+ // Different normalize
+ spec = new es3fVertexArrayObjectTests.Spec();
+
+ state = new es3fVertexArrayObjectTests.VertexArrayState();
+
+ state.attributes.push(new es3fVertexArrayObjectTests.Attribute());
+
+ state.attributes[0].enabled = true;
+ state.attributes[0].size = 2;
+ state.attributes[0].stride = 0;
+ state.attributes[0].type = gl.SHORT;
+ state.attributes[0].integer = false;
+ state.attributes[0].divisor = 0;
+ state.attributes[0].offset = 0;
+ state.attributes[0].normalized = true;
+ state.attributes[0].bufferNdx = 1;
+
+ state.elementArrayBuffer = 0;
+
+ spec.buffers.push(shortCoordBuffer48);
+
+ spec.useDrawElements = false;
+ spec.instances = 0;
+ spec.count = 48;
+ spec.vao = state;
+ spec.state = deUtil.clone(state);
+ spec.indexOffset = 0;
+ spec.indexRangeMin = 0;
+ spec.indexRangeMax = 0;
+ spec.indexType = gl.NONE;
+ spec.indexCount = 0;
+
+ spec.vao.attributes[0].normalized = true;
+ spec.state.attributes[0].normalized = false;
+ this.addChild(new es3fVertexArrayObjectTests.VertexArrayObjectTest(spec, 'diff_normalize', 'diff_normalize'));
+
+ // DrawElements with buffer
+ spec = new es3fVertexArrayObjectTests.Spec();
+
+ state = new es3fVertexArrayObjectTests.VertexArrayState();
+
+ state.attributes.push(new es3fVertexArrayObjectTests.Attribute());
+
+ state.attributes[0].enabled = true;
+ state.attributes[0].size = 2;
+ state.attributes[0].stride = 0;
+ state.attributes[0].type = gl.FLOAT;
+ state.attributes[0].integer = false;
+ state.attributes[0].divisor = 0;
+ state.attributes[0].offset = 0;
+ state.attributes[0].normalized = true;
+ state.attributes[0].bufferNdx = 1;
+
+ state.elementArrayBuffer = 0;
+
+ spec.buffers.push(floatCoordBuffer48_1);
+
+ var indexBuffer = new es3fVertexArrayObjectTests.BufferSpec(24, 192, 1, 0, 0, gl.UNSIGNED_SHORT, 0, 47, 0.0, 0.0);
+ spec.buffers.push(indexBuffer);
+ spec.buffers.push(indexBuffer);
+
+ spec.useDrawElements = true;
+ spec.count = 24;
+ spec.vao = state;
+ spec.state = deUtil.clone(state);
+ spec.instances = 0;
+ spec.indexOffset = 0;
+ spec.indexRangeMin = 0;
+ spec.indexRangeMax = 48;
+ spec.indexType = gl.UNSIGNED_SHORT;
+ spec.indexCount = 24;
+
+ spec.state.elementArrayBuffer = 3;
+ spec.vao.elementArrayBuffer = 2;
+ this.addChild(new es3fVertexArrayObjectTests.VertexArrayObjectTest(spec, 'diff_indices', 'diff_indices'));
+
+ var attribCount = /** @type {number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS));
+ var random = new deRandom.Random(attribCount);
+ spec = new es3fVertexArrayObjectTests.Spec();
+
+ state = new es3fVertexArrayObjectTests.VertexArrayState();
+
+ spec.useDrawElements = false;
+ spec.instances = 0;
+ spec.count = 24;
+ spec.vao = state;
+ spec.state = deUtil.clone(state);
+ spec.indexOffset = 0;
+ spec.indexRangeMin = 0;
+ spec.indexRangeMax = 0;
+ spec.indexType = gl.NONE;
+ spec.indexCount = 0;
+ spec.vao.elementArrayBuffer = 0;
+ spec.state.elementArrayBuffer = 0;
+
+ // Use all attributes
+ for (var attribNdx = 0; attribNdx < attribCount; attribNdx++) {
+ spec.buffers.push(shortCoordBuffer48);
+
+ spec.state.attributes.push(new es3fVertexArrayObjectTests.Attribute());
+ spec.state.attributes[attribNdx].enabled = (random.getInt(0, 4) == 0) ? false : true;
+ spec.state.attributes[attribNdx].size = random.getInt(2, 4);
+ spec.state.attributes[attribNdx].stride = 2 * random.getInt(1, 3);
+ spec.state.attributes[attribNdx].type = gl.SHORT;
+ spec.state.attributes[attribNdx].integer = random.getBool();
+ spec.state.attributes[attribNdx].divisor = random.getInt(0, 1);
+ spec.state.attributes[attribNdx].offset = 2 * random.getInt(0, 2);
+ spec.state.attributes[attribNdx].normalized = random.getBool();
+ spec.state.attributes[attribNdx].bufferNdx = attribNdx + 1;
+
+ if (attribNdx == 0) {
+ spec.state.attributes[attribNdx].divisor = 0;
+ spec.state.attributes[attribNdx].enabled = true;
+ spec.state.attributes[attribNdx].size = 2;
+ }
+
+ spec.vao.attributes.push(new es3fVertexArrayObjectTests.Attribute());
+ spec.vao.attributes[attribNdx].enabled = (random.getInt(0, 4) == 0) ? false : true;
+ spec.vao.attributes[attribNdx].size = random.getInt(2, 4);
+ spec.vao.attributes[attribNdx].stride = 2 * random.getInt(1, 3);
+ spec.vao.attributes[attribNdx].type = gl.SHORT;
+ spec.vao.attributes[attribNdx].integer = random.getBool();
+ spec.vao.attributes[attribNdx].divisor = random.getInt(0, 1);
+ spec.vao.attributes[attribNdx].offset = 2 * random.getInt(0, 2);
+ spec.vao.attributes[attribNdx].normalized = random.getBool();
+ spec.vao.attributes[attribNdx].bufferNdx = attribCount - attribNdx;
+
+ if (attribNdx == 0) {
+ spec.vao.attributes[attribNdx].divisor = 0;
+ spec.vao.attributes[attribNdx].enabled = true;
+ spec.vao.attributes[attribNdx].size = 2;
+ }
+
+ }
+ this.addChild(new es3fVertexArrayObjectTests.VertexArrayObjectTest(spec, 'all_attributes', 'all_attributes'));
+
+};
+
+/**
+ * Run test
+ * @param {WebGL2RenderingContext} context
+ */
+es3fVertexArrayObjectTests.run = function(context) {
+ gl = context;
+ //Set up Test Root parameters
+ var state = tcuTestCase.runner;
+ state.setRoot(new es3fVertexArrayObjectTests.VertexArrayObjectTests());
+
+ //Set up name and description of this test series.
+ setCurrentTestName(state.testCases.fullName());
+ description(state.testCases.getDescription());
+
+ try {
+ //Run test cases
+ tcuTestCase.runTestCases();
+ }
+ catch (err) {
+ testFailedOptions('Failed to es3fVertexArrayObjectTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fVertexArrayTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fVertexArrayTests.js
new file mode 100644
index 0000000000..ccfd343313
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/es3fVertexArrayTests.js
@@ -0,0 +1,1103 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('functional.gles3.es3fVertexArrayTests');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.delibs.debase.deUtil');
+goog.require('framework.opengl.gluDrawUtil');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluTexture');
+goog.require('framework.opengl.gluVarType');
+goog.require('modules.shared.glsVertexArrayTests');
+
+goog.scope(function() {
+
+ var es3fVertexArrayTests = functional.gles3.es3fVertexArrayTests;
+ var gluDrawUtil = framework.opengl.gluDrawUtil;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var gluShaderProgram = framework.opengl.gluShaderProgram;
+ var gluTexture = framework.opengl.gluTexture;
+ var gluVarType = framework.opengl.gluVarType;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var tcuSurface = framework.common.tcuSurface;
+ var tcuTexture = framework.common.tcuTexture;
+ var deMath = framework.delibs.debase.deMath;
+ var deString = framework.delibs.debase.deString;
+ var deRandom = framework.delibs.debase.deRandom;
+ var deUtil = framework.delibs.debase.deUtil;
+ var glsVertexArrayTests = modules.shared.glsVertexArrayTests;
+
+ var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+ };
+
+ /**
+ * es3fVertexArrayTests.SingleVertexArrayUsageGroup
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {glsVertexArrayTests.deArray.Usage} usage
+ */
+ es3fVertexArrayTests.SingleVertexArrayUsageGroup = function(usage) {
+ tcuTestCase.DeqpTest.call(
+ this,
+ "single_attribute.usages." + glsVertexArrayTests.deArray.usageTypeToString(usage),
+ glsVertexArrayTests.deArray.usageTypeToString(usage)
+ );
+ this.makeExecutable();
+ this.m_usage = usage;
+ };
+
+ es3fVertexArrayTests.SingleVertexArrayUsageGroup.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fVertexArrayTests.SingleVertexArrayUsageGroup.prototype.constructor = es3fVertexArrayTests.SingleVertexArrayUsageGroup;
+
+ /**
+ * init
+ */
+ es3fVertexArrayTests.SingleVertexArrayUsageGroup.prototype.init = function() {
+ /** @type {Array<number>} */ var counts = [1, 256];
+ /** @type {Array<number>} */ var strides = [0, -1, 17, 32]; // Treat negative value as sizeof input. Same as 0, but done outside of GL.
+ /** @type {Array<glsVertexArrayTests.deArray.InputType>} */ var inputTypes = [
+ glsVertexArrayTests.deArray.InputType.FLOAT,
+ /*glsVertexArrayTests.deArray.InputType.FIXED,*/
+ glsVertexArrayTests.deArray.InputType.SHORT,
+ glsVertexArrayTests.deArray.InputType.BYTE
+ ];
+
+ for (var inputTypeNdx = 0; inputTypeNdx < inputTypes.length; inputTypeNdx++) {
+ for (var countNdx = 0; countNdx < counts.length; countNdx++) {
+ for (var strideNdx = 0; strideNdx < strides.length; strideNdx++) {
+ /** @type {number} */ var stride = (strides[strideNdx] < 0 ? glsVertexArrayTests.deArray.inputTypeSize(inputTypes[inputTypeNdx]) * 2 : strides[strideNdx]);
+ /** @type {boolean} */ var aligned = (stride % glsVertexArrayTests.deArray.inputTypeSize(inputTypes[inputTypeNdx])) == 0;
+ /** @type {string} */ var name = 'stride' + stride + '_' + glsVertexArrayTests.deArray.inputTypeToString(inputTypes[inputTypeNdx]) + '_quads' + counts[countNdx];
+
+ var arraySpec = new glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec(
+ inputTypes[inputTypeNdx],
+ glsVertexArrayTests.deArray.OutputType.VEC2,
+ glsVertexArrayTests.deArray.Storage.BUFFER,
+ this.m_usage,
+ 2,
+ 0,
+ stride,
+ false,
+ glsVertexArrayTests.GLValue.getMinValue(inputTypes[inputTypeNdx]),
+ glsVertexArrayTests.GLValue.getMaxValue(inputTypes[inputTypeNdx])
+ );
+
+ var spec = new glsVertexArrayTests.MultiVertexArrayTest.Spec();
+ spec.primitive = glsVertexArrayTests.deArray.Primitive.TRIANGLES;
+ spec.drawCount = counts[countNdx];
+ spec.first = 0;
+ spec.arrays.push(arraySpec);
+
+ if (aligned)
+ this.addChild(
+ new glsVertexArrayTests.MultiVertexArrayTest(
+ spec, name, name
+ )
+ );
+ }
+ }
+ }
+ };
+
+ /**
+ * es3fVertexArrayTests.SingleVertexArrayStrideGroup
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {glsVertexArrayTests.deArray.InputType} type
+ */
+ es3fVertexArrayTests.SingleVertexArrayStrideGroup = function(type) {
+ tcuTestCase.DeqpTest.call(this, glsVertexArrayTests.deArray.inputTypeToString(type), glsVertexArrayTests.deArray.inputTypeToString(type));
+ this.makeExecutable();
+ this.m_type = type;
+ };
+
+ es3fVertexArrayTests.SingleVertexArrayStrideGroup.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fVertexArrayTests.SingleVertexArrayStrideGroup.prototype.constructor = es3fVertexArrayTests.SingleVertexArrayStrideGroup;
+
+ /**
+ * init
+ */
+ es3fVertexArrayTests.SingleVertexArrayStrideGroup.prototype.init = function() {
+ /** @type {Array<glsVertexArrayTests.deArray.Storage>} */ var storages = [
+ // User storage not supported in WebGL - glsVertexArrayTests.deArray.Storage.USER,
+ glsVertexArrayTests.deArray.Storage.BUFFER
+ ];
+ var counts = [1, 256];
+ var strides = [/*0,*/ -1, 17, 32]; // Treat negative value as sizeof input. Same as 0, but done outside of GL.
+
+ for (var storageNdx = 0; storageNdx < storages.length; storageNdx++) {
+ for (var componentCount = 2; componentCount < 5; componentCount++) {
+ for (var countNdx = 0; countNdx < counts.length; countNdx++) {
+ for (var strideNdx = 0; strideNdx < strides.length; strideNdx++) {
+ /** @type {boolean} */ var packed = this.m_type == glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10 || this.m_type == glsVertexArrayTests.deArray.InputType.INT_2_10_10_10;
+ /** @type {number} */ var stride = (strides[strideNdx] < 0) ? ((packed) ? (16) : (glsVertexArrayTests.deArray.inputTypeSize(this.m_type) * componentCount)) : (strides[strideNdx]);
+ /** @type {number} */ var alignment = (packed) ? (glsVertexArrayTests.deArray.inputTypeSize(this.m_type) * componentCount) : (glsVertexArrayTests.deArray.inputTypeSize(this.m_type));
+ /** @type {boolean} */ var bufferUnaligned = (storages[storageNdx] == glsVertexArrayTests.deArray.Storage.BUFFER) && (stride % alignment) != 0;
+
+ /** @type {string} */ var name = glsVertexArrayTests.deArray.storageToString(storages[storageNdx]) + '_stride' + stride + '_components' + componentCount + '_quads' + counts[countNdx];
+
+ if ((this.m_type == glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10 ||
+ this.m_type == glsVertexArrayTests.deArray.InputType.INT_2_10_10_10) && componentCount != 4)
+ continue;
+
+ /** @type {glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec} */ var arraySpec = new glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec(
+ this.m_type,
+ glsVertexArrayTests.deArray.OutputType.VEC4,
+ storages[storageNdx],
+ glsVertexArrayTests.deArray.Usage.DYNAMIC_DRAW,
+ componentCount,
+ 0,
+ stride,
+ false,
+ glsVertexArrayTests.GLValue.getMinValue(this.m_type),
+ glsVertexArrayTests.GLValue.getMaxValue(this.m_type)
+ );
+
+ var spec = new glsVertexArrayTests.MultiVertexArrayTest.Spec();
+
+ spec.primitive = glsVertexArrayTests.deArray.Primitive.TRIANGLES;
+ spec.drawCount = counts[countNdx];
+ spec.first = 0;
+ spec.arrays.push(arraySpec);
+
+ if (!bufferUnaligned)
+ this.addChild(
+ new glsVertexArrayTests.MultiVertexArrayTest(
+ spec, name, name
+ )
+ );
+ }
+ }
+ }
+ }
+ };
+
+ /**
+ * es3fVertexArrayTests.SingleVertexArrayStrideTests
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fVertexArrayTests.SingleVertexArrayStrideTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'single_attribute.strides', 'Single stride vertex atribute');
+ this.makeExecutable();
+ };
+
+ es3fVertexArrayTests.SingleVertexArrayStrideTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fVertexArrayTests.SingleVertexArrayStrideTests.prototype.constructor = es3fVertexArrayTests.SingleVertexArrayStrideTests;
+
+ es3fVertexArrayTests.SingleVertexArrayStrideTests.prototype.init = function() {
+ /** @type {Array<glsVertexArrayTests.deArray.InputType>} */ var inputTypes = [
+ glsVertexArrayTests.deArray.InputType.FLOAT,
+ glsVertexArrayTests.deArray.InputType.SHORT,
+ glsVertexArrayTests.deArray.InputType.BYTE,
+ /*glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT,
+ glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE,
+ glsVertexArrayTests.deArray.InputType.FIXED,*/
+ glsVertexArrayTests.deArray.InputType.INT_2_10_10_10
+ ];
+
+ for (var inputTypeNdx = 0; inputTypeNdx < inputTypes.length; inputTypeNdx++)
+ this.addChild(
+ new es3fVertexArrayTests.SingleVertexArrayStrideGroup(
+ inputTypes[inputTypeNdx]
+ )
+ );
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {glsVertexArrayTests.deArray.InputType} type
+ */
+ es3fVertexArrayTests.SingleVertexArrayFirstGroup = function(type) {
+ tcuTestCase.DeqpTest.call(
+ this,
+ glsVertexArrayTests.deArray.inputTypeToString(type),
+ glsVertexArrayTests.deArray.inputTypeToString(type)
+ );
+ this.makeExecutable();
+
+ this.m_type = type;
+ };
+
+ es3fVertexArrayTests.SingleVertexArrayFirstGroup.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fVertexArrayTests.SingleVertexArrayFirstGroup.prototype.constructor = es3fVertexArrayTests.SingleVertexArrayFirstGroup;
+
+ /**
+ * init
+ */
+ es3fVertexArrayTests.SingleVertexArrayFirstGroup.prototype.init = function() {
+ var counts = [5, 256];
+ var firsts = [6, 24];
+ var offsets = [1, 16, 17];
+ var strides = [/*0,*/ -1, 17, 32]; // Tread negative value as sizeof input. Same as 0, but done outside of GL.
+
+ for (var offsetNdx = 0; offsetNdx < offsets.length; offsetNdx++) {
+ for (var countNdx = 0; countNdx < counts.length; countNdx++) {
+ for (var strideNdx = 0; strideNdx < strides.length; strideNdx++) {
+ for (var firstNdx = 0; firstNdx < firsts.length; firstNdx++) {
+ var packed = this.m_type == glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10 ||
+ this.m_type == glsVertexArrayTests.deArray.InputType.INT_2_10_10_10;
+ var componentCount = packed ? 4 : 2;
+ var stride = strides[strideNdx] < 0 ?
+ (packed ? 8 : (glsVertexArrayTests.deArray.inputTypeSize(this.m_type) * componentCount)) :
+ (strides[strideNdx]);
+ var alignment = packed ?
+ (glsVertexArrayTests.deArray.inputTypeSize(this.m_type) * componentCount) :
+ (glsVertexArrayTests.deArray.inputTypeSize(this.m_type));
+ var aligned = ((stride % alignment) == 0) &&
+ ((offsets[offsetNdx] % alignment) == 0);
+ var name = 'first' + firsts[firstNdx] + '_offset' + offsets[offsetNdx] + '_stride' + stride + '_quads' + counts[countNdx];
+
+ var arraySpec = new glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec(
+ this.m_type,
+ glsVertexArrayTests.deArray.OutputType.VEC2,
+ glsVertexArrayTests.deArray.Storage.BUFFER,
+ glsVertexArrayTests.deArray.Usage.DYNAMIC_DRAW,
+ componentCount,
+ offsets[offsetNdx],
+ stride,
+ false,
+ glsVertexArrayTests.GLValue.getMinValue(this.m_type),
+ glsVertexArrayTests.GLValue.getMaxValue(this.m_type)
+ );
+
+ var spec = new glsVertexArrayTests.MultiVertexArrayTest.Spec();
+ spec.primitive = glsVertexArrayTests.deArray.Primitive.TRIANGLES;
+ spec.drawCount = counts[countNdx];
+ spec.first = firsts[firstNdx];
+ spec.arrays.push(arraySpec);
+
+ if (aligned)
+ this.addChild(
+ new glsVertexArrayTests.MultiVertexArrayTest(
+ spec, name, name
+ )
+ );
+ }
+ }
+ }
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fVertexArrayTests.SingleVertexArrayFirstTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'single_attribute.first', 'Single vertex attribute, different first values to drawArrays');
+ this.makeExecutable();
+ };
+
+ es3fVertexArrayTests.SingleVertexArrayFirstTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fVertexArrayTests.SingleVertexArrayFirstTests.prototype.constructor = es3fVertexArrayTests.SingleVertexArrayFirstTests;
+
+ /**
+ * init
+ */
+ es3fVertexArrayTests.SingleVertexArrayFirstTests.prototype.init = function() {
+ // Test offset with different input types, component counts and storage, Usage(?)
+ var inputTypes = [
+ glsVertexArrayTests.deArray.InputType.FLOAT,
+ glsVertexArrayTests.deArray.InputType.BYTE,
+ glsVertexArrayTests.deArray.InputType.INT_2_10_10_10
+ ];
+
+ for (var inputTypeNdx = 0; inputTypeNdx < inputTypes.length; inputTypeNdx++) {
+ this.addChild(
+ new es3fVertexArrayTests.SingleVertexArrayFirstGroup(
+ inputTypes[inputTypeNdx]
+ )
+ );
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {glsVertexArrayTests.deArray.InputType} type
+ */
+ es3fVertexArrayTests.SingleVertexArrayOffsetGroup = function(type) {
+ tcuTestCase.DeqpTest.call(
+ this,
+ glsVertexArrayTests.deArray.inputTypeToString(type),
+ glsVertexArrayTests.deArray.inputTypeToString(type)
+ );
+ this.makeExecutable();
+ this.m_type = type;
+ };
+
+ es3fVertexArrayTests.SingleVertexArrayOffsetGroup.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fVertexArrayTests.SingleVertexArrayOffsetGroup.prototype.constructor = es3fVertexArrayTests.SingleVertexArrayOffsetGroup;
+
+ /**
+ * init
+ */
+ es3fVertexArrayTests.SingleVertexArrayOffsetGroup.prototype.init = function() {
+ var counts = [1, 256];
+ var offsets = [1, 4, 17, 32];
+ var strides = [/*0,*/ -1, 17, 32]; // Tread negative value as sizeof input. Same as 0, but done outside of GL.
+
+ for (var offsetNdx = 0; offsetNdx < offsets.length; offsetNdx++) {
+ for (var countNdx = 0; countNdx < counts.length; countNdx++) {
+ for (var strideNdx = 0; strideNdx < strides.length; strideNdx++) {
+ var packed = this.m_type == glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10 ||
+ this.m_type == glsVertexArrayTests.deArray.InputType.INT_2_10_10_10;
+ var componentCount = packed ? 4 : 2;
+ var stride = (
+ strides[strideNdx] < 0 ?
+ glsVertexArrayTests.deArray.inputTypeSize(
+ this.m_type
+ ) * componentCount :
+ strides[strideNdx]
+ );
+ var alignment = packed ?
+ glsVertexArrayTests.deArray.inputTypeSize(this.m_type) * componentCount :
+ glsVertexArrayTests.deArray.inputTypeSize(this.m_type);
+
+ var aligned = ((stride % alignment) == 0) &&
+ ((offsets[offsetNdx] % alignment) == 0);
+ var name = 'offset' + offsets[offsetNdx] +
+ '_stride' + stride + '_quads' +
+ counts[countNdx];
+
+ /** @type {glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec} */ var arraySpec = new glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec(
+ this.m_type,
+ glsVertexArrayTests.deArray.OutputType.VEC2,
+ glsVertexArrayTests.deArray.Storage.BUFFER,
+ glsVertexArrayTests.deArray.Usage.DYNAMIC_DRAW,
+ componentCount,
+ offsets[offsetNdx],
+ stride,
+ false,
+ glsVertexArrayTests.GLValue.getMinValue(this.m_type),
+ glsVertexArrayTests.GLValue.getMaxValue(this.m_type)
+ );
+
+ var spec = new glsVertexArrayTests.MultiVertexArrayTest.Spec();
+ spec.primitive = glsVertexArrayTests.deArray.Primitive.TRIANGLES;
+ spec.drawCount = counts[countNdx];
+ spec.first = 0;
+ spec.arrays.push(arraySpec);
+
+ if (aligned)
+ this.addChild(
+ new glsVertexArrayTests.MultiVertexArrayTest(
+ spec, name, name
+ )
+ );
+ }
+ }
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fVertexArrayTests.SingleVertexArrayOffsetTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'single_attribute.offset', 'Single vertex atribute offset element');
+ this.makeExecutable();
+ };
+
+ es3fVertexArrayTests.SingleVertexArrayOffsetTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fVertexArrayTests.SingleVertexArrayOffsetTests.prototype.constructor = es3fVertexArrayTests.SingleVertexArrayOffsetTests;
+
+ /**
+ * init
+ */
+ es3fVertexArrayTests.SingleVertexArrayOffsetTests.prototype.init = function() {
+ // Test offset with different input types, component counts and storage, Usage(?)
+ var inputTypes = [
+ glsVertexArrayTests.deArray.InputType.FLOAT,
+ glsVertexArrayTests.deArray.InputType.BYTE,
+ glsVertexArrayTests.deArray.InputType.INT_2_10_10_10
+ ];
+
+ for (var inputTypeNdx = 0; inputTypeNdx < inputTypes.length; inputTypeNdx++) {
+ this.addChild(
+ new es3fVertexArrayTests.SingleVertexArrayOffsetGroup(
+ inputTypes[inputTypeNdx]
+ )
+ );
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {glsVertexArrayTests.deArray.InputType} type
+ */
+ es3fVertexArrayTests.SingleVertexArrayNormalizeGroup = function(type) {
+ tcuTestCase.DeqpTest.call(
+ this,
+ glsVertexArrayTests.deArray.inputTypeToString(type),
+ glsVertexArrayTests.deArray.inputTypeToString(type)
+ );
+ this.makeExecutable();
+ this.m_type = type;
+ };
+
+ es3fVertexArrayTests.SingleVertexArrayNormalizeGroup.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fVertexArrayTests.SingleVertexArrayNormalizeGroup.prototype.constructor = es3fVertexArrayTests.SingleVertexArrayNormalizeGroup;
+
+ /**
+ * init for SingleVertexArrayNormalizeGroup
+ */
+ es3fVertexArrayTests.SingleVertexArrayNormalizeGroup.prototype.init = function() {
+ var counts = [1, 256];
+
+ for (var componentCount = 2; componentCount < 5; componentCount++) {
+ for (var countNdx = 0; countNdx < counts.length; countNdx++) {
+ if (
+ (
+ this.m_type == glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10 ||
+ this.m_type == glsVertexArrayTests.deArray.InputType.INT_2_10_10_10
+ ) && componentCount != 4
+ )
+ continue;
+
+ var name = 'components' + componentCount.toString() + '_quads' + counts[countNdx].toString();
+
+ var arraySpec = new glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec(
+ this.m_type,
+ glsVertexArrayTests.deArray.OutputType.VEC4,
+ glsVertexArrayTests.deArray.Storage.BUFFER, //No USER Storage support in WebGL2
+ glsVertexArrayTests.deArray.Usage.DYNAMIC_DRAW,
+ componentCount,
+ 0,
+ 0,
+ true,
+ glsVertexArrayTests.GLValue.getMinValue(this.m_type),
+ glsVertexArrayTests.GLValue.getMaxValue(this.m_type)
+ );
+
+ var spec = new glsVertexArrayTests.MultiVertexArrayTest.Spec();
+ spec.primitive = glsVertexArrayTests.deArray.Primitive.TRIANGLES;
+ spec.drawCount = counts[countNdx];
+ spec.first = 0;
+ spec.arrays.push(arraySpec);
+
+ this.addChild(
+ new glsVertexArrayTests.MultiVertexArrayTest(
+ spec, name, name
+ )
+ );
+ }
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fVertexArrayTests.SingleVertexArrayNormalizeTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'single_attribute.normalize', 'Single normalize vertex atribute');
+ this.makeExecutable();
+ };
+
+ es3fVertexArrayTests.SingleVertexArrayNormalizeTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fVertexArrayTests.SingleVertexArrayNormalizeTests.prototype.constructor = es3fVertexArrayTests.SingleVertexArrayNormalizeTests;
+
+ /**
+ * init
+ */
+ es3fVertexArrayTests.SingleVertexArrayNormalizeTests.prototype.init = function() {
+ // Test normalization with different input types, component counts and storage
+ /** @type {Array<glsVertexArrayTests.deArray.InputType>} */ var inputTypes = [
+ glsVertexArrayTests.deArray.InputType.FLOAT,
+ glsVertexArrayTests.deArray.InputType.SHORT,
+ glsVertexArrayTests.deArray.InputType.BYTE,
+ glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT,
+ glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE,
+ //glsVertexArrayTests.deArray.InputType.FIXED,
+ glsVertexArrayTests.deArray.InputType.UNSIGNED_INT,
+ glsVertexArrayTests.deArray.InputType.INT,
+ glsVertexArrayTests.deArray.InputType.HALF,
+ glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10,
+ glsVertexArrayTests.deArray.InputType.INT_2_10_10_10
+ ];
+
+ for (var inputTypeNdx = 0; inputTypeNdx < inputTypes.length; inputTypeNdx++) {
+ this.addChild(
+ new es3fVertexArrayTests.SingleVertexArrayNormalizeGroup(
+ inputTypes[inputTypeNdx]
+ )
+ );
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {glsVertexArrayTests.deArray.InputType} type
+ */
+ es3fVertexArrayTests.SingleVertexArrayOutputTypeGroup = function(type) {
+ tcuTestCase.DeqpTest.call(
+ this,
+ "single_attribute.output_types." + glsVertexArrayTests.deArray.inputTypeToString(type),
+ glsVertexArrayTests.deArray.inputTypeToString(type)
+ );
+ this.makeExecutable();
+ this.m_type = type;
+ };
+
+ es3fVertexArrayTests.SingleVertexArrayOutputTypeGroup.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fVertexArrayTests.SingleVertexArrayOutputTypeGroup.prototype.constructor = es3fVertexArrayTests.SingleVertexArrayOutputTypeGroup;
+
+ es3fVertexArrayTests.SingleVertexArrayOutputTypeGroup.prototype.init = function() {
+ var outputTypes = [
+ glsVertexArrayTests.deArray.OutputType.VEC2,
+ glsVertexArrayTests.deArray.OutputType.VEC3,
+ glsVertexArrayTests.deArray.OutputType.VEC4,
+ glsVertexArrayTests.deArray.OutputType.IVEC2,
+ glsVertexArrayTests.deArray.OutputType.IVEC3,
+ glsVertexArrayTests.deArray.OutputType.IVEC4,
+ glsVertexArrayTests.deArray.OutputType.UVEC2,
+ glsVertexArrayTests.deArray.OutputType.UVEC3,
+ glsVertexArrayTests.deArray.OutputType.UVEC4
+ ];
+ var storages = [glsVertexArrayTests.deArray.Storage.BUFFER]; //No USER storage support in WebGL2
+ var counts = [1, 256];
+
+ for (var outputTypeNdx = 0; outputTypeNdx < outputTypes.length; outputTypeNdx++) {
+ for (var storageNdx = 0; storageNdx < storages.length; storageNdx++) {
+ for (var componentCount = 2; componentCount < 5; componentCount++) {
+ for (var countNdx = 0; countNdx < counts.length; countNdx++) {
+ var name = 'components' + componentCount + '_' +
+ glsVertexArrayTests.deArray.outputTypeToString(
+ outputTypes[outputTypeNdx]
+ ) +
+ '_quads' + counts[countNdx];
+
+ var inputIsSignedInteger =
+ this.m_type == glsVertexArrayTests.deArray.InputType.INT ||
+ this.m_type == glsVertexArrayTests.deArray.InputType.SHORT ||
+ this.m_type == glsVertexArrayTests.deArray.InputType.BYTE;
+
+ var inputIsUnignedInteger =
+ this.m_type == glsVertexArrayTests.deArray.InputType.UNSIGNED_INT ||
+ this.m_type == glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT ||
+ this.m_type == glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE;
+
+ var outputIsSignedInteger =
+ outputTypes[outputTypeNdx] == glsVertexArrayTests.deArray.OutputType.IVEC2 ||
+ outputTypes[outputTypeNdx] == glsVertexArrayTests.deArray.OutputType.IVEC3 ||
+ outputTypes[outputTypeNdx] == glsVertexArrayTests.deArray.OutputType.IVEC4;
+
+ var outputIsUnsignedInteger =
+ outputTypes[outputTypeNdx] == glsVertexArrayTests.deArray.OutputType.UVEC2 ||
+ outputTypes[outputTypeNdx] == glsVertexArrayTests.deArray.OutputType.UVEC3 ||
+ outputTypes[outputTypeNdx] == glsVertexArrayTests.deArray.OutputType.UVEC4;
+
+ // If input type is float type and output type is int type skip
+ if ((this.m_type == glsVertexArrayTests.deArray.InputType.FLOAT ||
+ this.m_type == glsVertexArrayTests.deArray.InputType.HALF) &&
+ (outputTypes[outputTypeNdx] >= glsVertexArrayTests.deArray.OutputType.INT))
+ continue;
+
+ if ((this.m_type == glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10 ||
+ this.m_type == glsVertexArrayTests.deArray.InputType.INT_2_10_10_10) &&
+ (outputTypes[outputTypeNdx] >= glsVertexArrayTests.deArray.OutputType.INT))
+ continue;
+
+ if ((this.m_type == glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10 ||
+ this.m_type == glsVertexArrayTests.deArray.InputType.INT_2_10_10_10) &&
+ componentCount != 4)
+ continue;
+
+ // Loading signed data as unsigned causes undefined values and vice versa
+ if (inputIsSignedInteger && outputIsUnsignedInteger)
+ continue;
+ if (inputIsUnignedInteger && outputIsSignedInteger)
+ continue;
+
+ var arraySpec = new glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec(
+ this.m_type,
+ outputTypes[outputTypeNdx],
+ storages[storageNdx],
+ glsVertexArrayTests.deArray.Usage.DYNAMIC_DRAW,
+ componentCount,
+ 0,
+ 0,
+ false,
+ glsVertexArrayTests.GLValue.getMinValue(this.m_type),
+ glsVertexArrayTests.GLValue.getMaxValue(this.m_type)
+ );
+
+ var spec = new glsVertexArrayTests.MultiVertexArrayTest.Spec();
+ spec.primitive = glsVertexArrayTests.deArray.Primitive.TRIANGLES;
+ spec.drawCount = counts[countNdx];
+ spec.first = 0;
+ spec.arrays.push(arraySpec);
+
+ this.addChild(
+ new glsVertexArrayTests.MultiVertexArrayTest(
+ spec, name, name
+ )
+ );
+ }
+ }
+ }
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fVertexArrayTests.MultiVertexArrayCountTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'multiple_attributes.attribute_count', 'Attribute counts');
+ this.makeExecutable();
+ };
+
+ es3fVertexArrayTests.MultiVertexArrayCountTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fVertexArrayTests.MultiVertexArrayCountTests.prototype.constructor = es3fVertexArrayTests.MultiVertexArrayCountTests;
+
+ /**
+ * @param {glsVertexArrayTests.MultiVertexArrayTest.Spec} spec
+ * @return {string}
+ */
+ es3fVertexArrayTests.MultiVertexArrayCountTests.prototype.getTestName = function(spec) {
+ var name = '';
+ name += spec.arrays.length;
+
+ return name;
+ };
+
+ es3fVertexArrayTests.MultiVertexArrayCountTests.prototype.init = function() {
+ // Test attribute counts
+ var arrayCounts = [2, 3, 4, 5, 6, 7, 8];
+
+ for (var arrayCountNdx = 0; arrayCountNdx < arrayCounts.length; arrayCountNdx++) {
+ var spec = new glsVertexArrayTests.MultiVertexArrayTest.Spec();
+
+ spec.primitive = glsVertexArrayTests.deArray.Primitive.TRIANGLES;
+ spec.drawCount = 256;
+ spec.first = 0;
+
+ for (var arrayNdx = 0; arrayNdx < arrayCounts[arrayCountNdx]; arrayNdx++) {
+ var arraySpec = new glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec(
+ glsVertexArrayTests.deArray.InputType.FLOAT,
+ glsVertexArrayTests.deArray.OutputType.VEC2,
+ glsVertexArrayTests.deArray.Storage.BUFFER, // No USER storage support in WebGL2
+ glsVertexArrayTests.deArray.Usage.DYNAMIC_DRAW,
+ 2,
+ 0,
+ 0,
+ false,
+ glsVertexArrayTests.GLValue.getMinValue(glsVertexArrayTests.deArray.InputType.FLOAT),
+ glsVertexArrayTests.GLValue.getMaxValue(glsVertexArrayTests.deArray.InputType.FLOAT)
+ );
+ spec.arrays.push(arraySpec);
+ }
+
+ var name = this.getTestName(spec);
+ var desc = this.getTestName(spec);
+
+ this.addChild(
+ new glsVertexArrayTests.MultiVertexArrayTest(
+ spec, name, desc
+ )
+ );
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fVertexArrayTests.MultiVertexArrayStorageTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'multiple_attributes.storage', 'Attribute storages');
+ this.makeExecutable();
+ };
+
+ es3fVertexArrayTests.MultiVertexArrayStorageTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fVertexArrayTests.MultiVertexArrayStorageTests.prototype.constructor = es3fVertexArrayTests.MultiVertexArrayStorageTests;
+
+ /**
+ * @param {glsVertexArrayTests.MultiVertexArrayTest.Spec} spec
+ * @return {string}
+ */
+ es3fVertexArrayTests.MultiVertexArrayStorageTests.prototype.getTestName = function(spec) {
+ var name = '';
+ name += spec.arrays.length;
+
+ for (var arrayNdx = 0; arrayNdx < spec.arrays.length; arrayNdx++)
+ name += '_' + glsVertexArrayTests.deArray.storageToString(spec.arrays[arrayNdx].storage);
+
+ return name;
+ };
+
+ /**
+ * @param {glsVertexArrayTests.MultiVertexArrayTest.Spec} spec
+ * @param {number} depth
+ */
+ es3fVertexArrayTests.MultiVertexArrayStorageTests.prototype.addStorageCases = function(spec, depth) {
+ if (depth == 0) {
+ // Skip trivial case, used elsewhere
+ var ok = false;
+ for (var arrayNdx = 0; arrayNdx < spec.arrays.length; arrayNdx++) {
+ if (spec.arrays[arrayNdx].storage != glsVertexArrayTests.deArray.Storage.USER) {
+ ok = true;
+ break;
+ }
+ }
+
+ if (!ok)
+ return;
+
+ var name = this.getTestName(spec);
+ var desc = this.getTestName(spec);
+
+ this.addChild(
+ new glsVertexArrayTests.MultiVertexArrayTest(
+ spec, name, desc
+ )
+ );
+ return;
+ }
+
+ var storages = [
+ //glsVertexArrayTests.deArray.Storage.USER, Not supported in WebGL 2.0
+ glsVertexArrayTests.deArray.Storage.BUFFER
+ ];
+
+ for (var storageNdx = 0; storageNdx < storages.length; storageNdx++) {
+ var arraySpec = new glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec(
+ glsVertexArrayTests.deArray.InputType.FLOAT,
+ glsVertexArrayTests.deArray.OutputType.VEC2,
+ storages[storageNdx],
+ glsVertexArrayTests.deArray.Usage.DYNAMIC_DRAW,
+ 2,
+ 0,
+ 0,
+ false,
+ glsVertexArrayTests.GLValue.getMinValue(glsVertexArrayTests.deArray.InputType.FLOAT),
+ glsVertexArrayTests.GLValue.getMaxValue(glsVertexArrayTests.deArray.InputType.FLOAT)
+ );
+
+ var _spec = spec;
+ _spec.arrays.push(arraySpec);
+ this.addStorageCases(_spec, depth - 1);
+ }
+ };
+
+ /**
+ * init
+ */
+ es3fVertexArrayTests.MultiVertexArrayStorageTests.prototype.init = function() {
+ // Test different storages
+ var arrayCounts = [3];
+
+ var spec = new glsVertexArrayTests.MultiVertexArrayTest.Spec();
+
+ spec.primitive = glsVertexArrayTests.deArray.Primitive.TRIANGLES;
+ spec.drawCount = 256;
+ spec.first = 0;
+
+ for (var arrayCountNdx = 0; arrayCountNdx < arrayCounts.length; arrayCountNdx++)
+ this.addStorageCases(spec, arrayCounts[arrayCountNdx]);
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fVertexArrayTests.MultiVertexArrayStrideTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'multiple_attributes.stride', 'Strides');
+ this.makeExecutable();
+ };
+
+ es3fVertexArrayTests.MultiVertexArrayStrideTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fVertexArrayTests.MultiVertexArrayStrideTests.prototype.constructor = es3fVertexArrayTests.MultiVertexArrayStrideTests;
+
+ /**
+ * @param {glsVertexArrayTests.MultiVertexArrayTest.Spec} spec
+ * @return {string}
+ */
+ es3fVertexArrayTests.MultiVertexArrayStrideTests.prototype.getTestName = function(spec) {
+ var name = '';
+
+ name += spec.arrays.length;
+
+ for (var arrayNdx = 0; arrayNdx < spec.arrays.length; arrayNdx++) {
+ name += '_' +
+ glsVertexArrayTests.deArray.inputTypeToString(spec.arrays[arrayNdx].inputType) +
+ spec.arrays[arrayNdx].componentCount + '_' +
+ spec.arrays[arrayNdx].stride;
+ }
+
+ return name;
+ };
+
+ /**
+ * init
+ */
+ es3fVertexArrayTests.MultiVertexArrayStrideTests.prototype.init = function() {
+ // Test different strides, with multiple arrays, input types??
+ var arrayCounts = [3];
+
+ var spec = new glsVertexArrayTests.MultiVertexArrayTest.Spec();
+
+ spec.primitive = glsVertexArrayTests.deArray.Primitive.TRIANGLES;
+ spec.drawCount = 256;
+ spec.first = 0;
+
+ for (var arrayCountNdx = 0; arrayCountNdx < arrayCounts.length; arrayCountNdx++)
+ this.addStrideCases(spec, arrayCounts[arrayCountNdx]);
+ };
+
+ /**
+ * @param {glsVertexArrayTests.MultiVertexArrayTest.Spec} spec
+ * @param {number} depth
+ */
+ es3fVertexArrayTests.MultiVertexArrayStrideTests.prototype.addStrideCases = function(spec, depth) {
+ if (depth == 0) {
+ var name = this.getTestName(spec);
+ var desc = this.getTestName(spec);
+ this.addChild(
+ new glsVertexArrayTests.MultiVertexArrayTest(
+ spec, name, desc
+ )
+ );
+ return;
+ }
+
+ var strides = [0, -1, 17, 32];
+ var inputType = glsVertexArrayTests.deArray.InputType.FLOAT;
+
+ for (var strideNdx = 0; strideNdx < strides.length; strideNdx++) {
+ var componentCount = 2;
+ var stride = strides[strideNdx] >= 0 ? strides[strideNdx] : componentCount * glsVertexArrayTests.deArray.inputTypeSize(glsVertexArrayTests.deArray.InputType.FLOAT);
+ var arraySpec = new glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec(
+ inputType,
+ glsVertexArrayTests.deArray.OutputType.VEC2,
+ glsVertexArrayTests.deArray.Storage.BUFFER, //USER storage not supported in WebGL 2.0
+ glsVertexArrayTests.deArray.Usage.DYNAMIC_DRAW,
+ componentCount,
+ 0,
+ stride,
+ false,
+ glsVertexArrayTests.GLValue.getMinValue(glsVertexArrayTests.deArray.InputType.FLOAT),
+ glsVertexArrayTests.GLValue.getMaxValue(glsVertexArrayTests.deArray.InputType.FLOAT)
+ );
+
+ /** @type {boolean} */ var aligned = (stride % glsVertexArrayTests.deArray.inputTypeSize(inputType)) == 0;
+ if (aligned) {
+ var _spec = /** @type {glsVertexArrayTests.MultiVertexArrayTest.Spec} */ (deUtil.clone(spec)); //To assign spec by value;
+ _spec.arrays.push(arraySpec);
+ this.addStrideCases(_spec, depth - 1);
+ }
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fVertexArrayTests.MultiVertexArrayOutputTests = function() {
+ tcuTestCase.DeqpTest.call(this, 'multiple_attributes.input_types', 'input types');
+ this.makeExecutable();
+ };
+
+ es3fVertexArrayTests.MultiVertexArrayOutputTests.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fVertexArrayTests.MultiVertexArrayOutputTests.prototype.constructor = es3fVertexArrayTests.MultiVertexArrayOutputTests;
+
+ /**
+ * @param {glsVertexArrayTests.MultiVertexArrayTest.Spec} spec
+ * @return {string}
+ */
+ es3fVertexArrayTests.MultiVertexArrayOutputTests.prototype.getTestName = function(spec) {
+ var name = '';
+
+ name += spec.arrays.length;
+
+ for (var arrayNdx = 0; arrayNdx < spec.arrays.length; arrayNdx++) {
+ name += '_' +
+ glsVertexArrayTests.deArray.inputTypeToString(spec.arrays[arrayNdx].inputType) +
+ spec.arrays[arrayNdx].componentCount + '_' +
+ glsVertexArrayTests.deArray.outputTypeToString(spec.arrays[arrayNdx].outputType);
+ }
+
+ return name;
+ };
+
+ /**
+ * init
+ */
+ es3fVertexArrayTests.MultiVertexArrayOutputTests.prototype.init = function() {
+ // Test different input types, with multiple arrays
+ var arrayCounts = [3];
+
+ var spec = new glsVertexArrayTests.MultiVertexArrayTest.Spec();
+
+ spec.primitive = glsVertexArrayTests.deArray.Primitive.TRIANGLES;
+ spec.drawCount = 256;
+ spec.first = 0;
+
+ for (var arrayCountNdx = 0; arrayCountNdx < arrayCounts.length; arrayCountNdx++)
+ this.addInputTypeCases(spec, arrayCounts[arrayCountNdx]);
+ };
+
+ /**
+ * @param {glsVertexArrayTests.MultiVertexArrayTest.Spec} spec
+ * @param {number} depth
+ */
+ es3fVertexArrayTests.MultiVertexArrayOutputTests.prototype.addInputTypeCases = function(spec, depth) {
+ if (depth == 0) {
+ var name = this.getTestName(spec);
+ var desc = this.getTestName(spec);
+ this.addChild(
+ new glsVertexArrayTests.MultiVertexArrayTest(
+ spec, name, desc
+ )
+ );
+ return;
+ }
+
+ var inputTypes = [
+ glsVertexArrayTests.deArray.InputType.BYTE,
+ glsVertexArrayTests.deArray.InputType.SHORT,
+ glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE,
+ glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT
+ ];
+
+ for (var inputTypeNdx = 0; inputTypeNdx < inputTypes.length; inputTypeNdx++) {
+ var arraySpec = new glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec(
+ inputTypes[inputTypeNdx],
+ glsVertexArrayTests.deArray.OutputType.VEC2,
+ glsVertexArrayTests.deArray.Storage.BUFFER, //USER storage not supported in WebGL 2.0
+ glsVertexArrayTests.deArray.Usage.DYNAMIC_DRAW,
+ 2,
+ 0,
+ 0,
+ false,
+ glsVertexArrayTests.GLValue.getMinValue(inputTypes[inputTypeNdx]),
+ glsVertexArrayTests.GLValue.getMaxValue(inputTypes[inputTypeNdx])
+ );
+
+ var _spec = /** @type {glsVertexArrayTests.MultiVertexArrayTest.Spec} */ (deUtil.clone(spec));
+ _spec.arrays.push(arraySpec);
+ this.addInputTypeCases(_spec, depth - 1);
+ }
+ };
+
+ /**
+ * es3fVertexArrayTests.VertexArrayTestGroup
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ es3fVertexArrayTests.VertexArrayTestGroup = function() {
+ tcuTestCase.DeqpTest.call(this, 'vertex_arrays', 'Vertex array and array tests');
+ this.makeExecutable();
+ };
+
+ es3fVertexArrayTests.VertexArrayTestGroup.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ es3fVertexArrayTests.VertexArrayTestGroup.prototype.constructor = es3fVertexArrayTests.VertexArrayTestGroup;
+
+ /**
+ * init
+ */
+ es3fVertexArrayTests.VertexArrayTestGroup.prototype.init = function() {
+ this.addChild(new es3fVertexArrayTests.SingleVertexArrayStrideTests());
+ this.addChild(new es3fVertexArrayTests.SingleVertexArrayNormalizeTests());
+
+ // Test output types with different input types, component counts and storage, Usage?, Precision?, float?
+ var inputTypes = [
+ glsVertexArrayTests.deArray.InputType.FLOAT,
+ glsVertexArrayTests.deArray.InputType.SHORT,
+ glsVertexArrayTests.deArray.InputType.BYTE,
+ glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT,
+ glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE,
+ glsVertexArrayTests.deArray.InputType.UNSIGNED_INT,
+ glsVertexArrayTests.deArray.InputType.INT,
+ glsVertexArrayTests.deArray.InputType.HALF,
+ glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10,
+ glsVertexArrayTests.deArray.InputType.INT_2_10_10_10
+ ];
+ for (var inputTypeNdx = 0; inputTypeNdx < inputTypes.length; inputTypeNdx++) {
+ this.addChild(new es3fVertexArrayTests.SingleVertexArrayOutputTypeGroup(inputTypes[inputTypeNdx]));
+ }
+
+ /** @type {Array<glsVertexArrayTests.deArray.Usage>} */ var usages = [
+ glsVertexArrayTests.deArray.Usage.STATIC_DRAW,
+ glsVertexArrayTests.deArray.Usage.STREAM_DRAW,
+ glsVertexArrayTests.deArray.Usage.DYNAMIC_DRAW,
+ glsVertexArrayTests.deArray.Usage.STATIC_COPY,
+ glsVertexArrayTests.deArray.Usage.STREAM_COPY,
+ glsVertexArrayTests.deArray.Usage.DYNAMIC_COPY,
+ glsVertexArrayTests.deArray.Usage.STATIC_READ,
+ glsVertexArrayTests.deArray.Usage.STREAM_READ,
+ glsVertexArrayTests.deArray.Usage.DYNAMIC_READ
+ ];
+ for (var usageNdx = 0; usageNdx < usages.length; usageNdx++) {
+ this.addChild(new es3fVertexArrayTests.SingleVertexArrayUsageGroup(usages[usageNdx]));
+ }
+
+ this.addChild(new es3fVertexArrayTests.SingleVertexArrayOffsetTests());
+ this.addChild(new es3fVertexArrayTests.SingleVertexArrayFirstTests());
+
+ this.addChild(new es3fVertexArrayTests.MultiVertexArrayCountTests());
+ this.addChild(new es3fVertexArrayTests.MultiVertexArrayStorageTests());
+ this.addChild(new es3fVertexArrayTests.MultiVertexArrayStrideTests());
+ this.addChild(new es3fVertexArrayTests.MultiVertexArrayOutputTests());
+ };
+
+ /**
+ * Create and execute the test cases
+ * @param {WebGL2RenderingContext} context
+ */
+ es3fVertexArrayTests.run = function(context, range) {
+ gl = context;
+ //Set up root Test
+ var state = tcuTestCase.runner;
+
+ var test = new es3fVertexArrayTests.VertexArrayTestGroup();
+ var testName = test.fullName();
+ var testDescription = test.getDescription();
+ state.testCases = test;
+ state.testName = testName;
+
+ //Set up name and description of this test series.
+ setCurrentTestName(testName);
+ description(testDescription);
+
+ try {
+ if (range)
+ state.setRange(range);
+ //Run test cases
+ tcuTestCase.runTestCases();
+ } catch (err) {
+ testFailedOptions('Failed to es3fVertexArrayTests.run tests', false);
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer.html
new file mode 100644
index 0000000000..7908636028
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer.html
@@ -0,0 +1,32 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Color Buffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboColorbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContextWithWrapperThatThrowsOnGLError('canvas', null, 2);
+
+
+ try {
+ functional.gles3.es3fFboColorbufferTests.run(gl);
+ }
+ catch(err)
+ {
+ bufferedLogToConsole(err);
+ }
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/00_test_list.txt
new file mode 100644
index 0000000000..d6d590a077
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/00_test_list.txt
@@ -0,0 +1,26 @@
+clear.html
+tex2d_00.html
+tex2d_01.html
+tex2d_02.html
+tex2d_03.html
+tex2d_04.html
+tex2d_05.html
+texcube_00.html
+texcube_01.html
+texcube_02.html
+texcube_03.html
+texcube_04.html
+texcube_05.html
+tex2darray_00.html
+tex2darray_01.html
+tex2darray_02.html
+tex2darray_03.html
+tex2darray_04.html
+tex2darray_05.html
+tex3d_00.html
+tex3d_01.html
+tex3d_02.html
+tex3d_03.html
+tex3d_04.html
+tex3d_05.html
+blend.html \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/blend.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/blend.html
new file mode 100644
index 0000000000..4826cf0cb7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/blend.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fbocolorbuffer_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Color Buffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboColorbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+var ext = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboColorbufferTests.run(gl, [25, 26]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/clear.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/clear.html
new file mode 100644
index 0000000000..f431afb364
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/clear.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fbocolorbuffer_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Color Buffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboColorbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+var ext = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboColorbufferTests.run(gl, [0, 1]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/fbocolorbuffer_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/fbocolorbuffer_test_generator.py
new file mode 100644
index 0000000000..9307b8d3f4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/fbocolorbuffer_test_generator.py
@@ -0,0 +1,116 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2019 The Khronos Group Inc.
+# Use of this source code is governed by an MIT-style license that can be
+# found in the LICENSE.txt file.
+
+"""
+ Generator for fbocolorbuffer* tests.
+ This file needs to be run in its folder.
+"""
+
+import sys
+
+_DO_NOT_EDIT_WARNING = """<!--
+
+This file is auto-generated from fbocolorbuffer_test_generator.py
+DO NOT EDIT!
+
+-->
+
+"""
+
+_HTML_TEMPLATE = """<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Color Buffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboColorbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+var ext = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboColorbufferTests.run(gl, [%(start)s, %(end)s]);
+</script>
+</body>
+</html>
+"""
+
+_GROUPS = [
+ 'clear',
+ 'tex2d',
+ 'texcube',
+ 'tex2darray',
+ 'tex3d',
+ 'blend',
+]
+
+_GROUP_TEST_COUNTS = [
+ 1,
+ 6,
+ 6,
+ 6,
+ 6,
+ 1
+]
+
+def GenerateFilename(group, count, index):
+ """Generate test filename."""
+ filename = group
+ assert index >= 0 and index < count
+ if count > 1:
+ index_str = str(index)
+ if index < 10:
+ index_str = "0" + index_str
+ filename += "_" + index_str
+ filename += ".html"
+ return filename
+
+def WriteTest(filename, start, end):
+ """Write one test."""
+ file = open(filename, "wb")
+ file.write(_DO_NOT_EDIT_WARNING)
+ file.write(_HTML_TEMPLATE % {
+ 'start': start,
+ 'end': end
+ })
+ file.close
+
+def GenerateTests():
+ """Generate all tests."""
+ assert len(_GROUPS) == len(_GROUP_TEST_COUNTS)
+ test_index = 0
+ filelist = []
+ for ii in range(len(_GROUPS)):
+ group = _GROUPS[ii]
+ count = _GROUP_TEST_COUNTS[ii]
+ for index in range(count):
+ filename = GenerateFilename(group, count, index)
+ filelist.append(filename)
+ WriteTest(filename, test_index, test_index + 1)
+ test_index += 1
+ return filelist
+
+def GenerateTestList(filelist):
+ file = open("00_test_list.txt", "wb")
+ file.write('\n'.join(filelist))
+ file.close
+
+def main(argv):
+ """This is the main function."""
+ filelist = GenerateTests()
+ GenerateTestList(filelist)
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_00.html
new file mode 100644
index 0000000000..b9918b2dd7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_00.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fbocolorbuffer_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Color Buffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboColorbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+var ext = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboColorbufferTests.run(gl, [1, 2]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_01.html
new file mode 100644
index 0000000000..653f89e2a9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_01.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fbocolorbuffer_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Color Buffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboColorbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+var ext = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboColorbufferTests.run(gl, [2, 3]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_02.html
new file mode 100644
index 0000000000..2e955cb8f0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_02.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fbocolorbuffer_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Color Buffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboColorbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+var ext = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboColorbufferTests.run(gl, [3, 4]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_03.html
new file mode 100644
index 0000000000..993108e86f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_03.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fbocolorbuffer_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Color Buffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboColorbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+var ext = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboColorbufferTests.run(gl, [4, 5]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_04.html
new file mode 100644
index 0000000000..d7f5b2782f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_04.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fbocolorbuffer_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Color Buffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboColorbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+var ext = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboColorbufferTests.run(gl, [5, 6]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_05.html
new file mode 100644
index 0000000000..1d8bdcbaab
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2d_05.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fbocolorbuffer_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Color Buffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboColorbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+var ext = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboColorbufferTests.run(gl, [6, 7]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_00.html
new file mode 100644
index 0000000000..5e42f0021c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_00.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fbocolorbuffer_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Color Buffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboColorbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+var ext = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboColorbufferTests.run(gl, [13, 14]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_01.html
new file mode 100644
index 0000000000..e01cee3b22
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_01.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fbocolorbuffer_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Color Buffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboColorbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+var ext = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboColorbufferTests.run(gl, [14, 15]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_02.html
new file mode 100644
index 0000000000..2f9dd6061c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_02.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fbocolorbuffer_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Color Buffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboColorbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+var ext = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboColorbufferTests.run(gl, [15, 16]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_03.html
new file mode 100644
index 0000000000..0f9b76857e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_03.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fbocolorbuffer_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Color Buffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboColorbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+var ext = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboColorbufferTests.run(gl, [16, 17]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_04.html
new file mode 100644
index 0000000000..82ef5b6cf7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_04.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fbocolorbuffer_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Color Buffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboColorbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+var ext = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboColorbufferTests.run(gl, [17, 18]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_05.html
new file mode 100644
index 0000000000..28668bd635
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex2darray_05.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fbocolorbuffer_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Color Buffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboColorbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+var ext = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboColorbufferTests.run(gl, [18, 19]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_00.html
new file mode 100644
index 0000000000..98c04df0e7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_00.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fbocolorbuffer_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Color Buffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboColorbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+var ext = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboColorbufferTests.run(gl, [19, 20]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_01.html
new file mode 100644
index 0000000000..adb01c169e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_01.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fbocolorbuffer_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Color Buffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboColorbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+var ext = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboColorbufferTests.run(gl, [20, 21]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_02.html
new file mode 100644
index 0000000000..87a7e291e9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_02.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fbocolorbuffer_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Color Buffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboColorbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+var ext = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboColorbufferTests.run(gl, [21, 22]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_03.html
new file mode 100644
index 0000000000..b7f7f18d8f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_03.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fbocolorbuffer_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Color Buffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboColorbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+var ext = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboColorbufferTests.run(gl, [22, 23]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_04.html
new file mode 100644
index 0000000000..a0a4473857
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_04.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fbocolorbuffer_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Color Buffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboColorbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+var ext = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboColorbufferTests.run(gl, [23, 24]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_05.html
new file mode 100644
index 0000000000..91ce46cc33
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/tex3d_05.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fbocolorbuffer_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Color Buffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboColorbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+var ext = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboColorbufferTests.run(gl, [24, 25]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_00.html
new file mode 100644
index 0000000000..0ff04bee2d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_00.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fbocolorbuffer_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Color Buffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboColorbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+var ext = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboColorbufferTests.run(gl, [7, 8]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_01.html
new file mode 100644
index 0000000000..38512eb0ac
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_01.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fbocolorbuffer_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Color Buffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboColorbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+var ext = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboColorbufferTests.run(gl, [8, 9]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_02.html
new file mode 100644
index 0000000000..2cf3fa750e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_02.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fbocolorbuffer_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Color Buffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboColorbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+var ext = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboColorbufferTests.run(gl, [9, 10]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_03.html
new file mode 100644
index 0000000000..2e55800859
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_03.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fbocolorbuffer_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Color Buffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboColorbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+var ext = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboColorbufferTests.run(gl, [10, 11]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_04.html
new file mode 100644
index 0000000000..9602acaf25
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_04.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fbocolorbuffer_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Color Buffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboColorbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+var ext = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboColorbufferTests.run(gl, [11, 12]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_05.html
new file mode 100644
index 0000000000..a77a1bd248
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/texcube_05.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fbocolorbuffer_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Color Buffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboColorbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+var ext = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboColorbufferTests.run(gl, [12, 13]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocompleteness.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocompleteness.html
new file mode 100644
index 0000000000..40dc055543
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocompleteness.html
@@ -0,0 +1,32 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Completeness Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboCompletenessTests');</script>
+<script>goog.require('modules.shared.glsFboUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+
+ var wtu = WebGLTestUtils;
+ var gl = wtu.create3DContext('canvas', null, 2);
+
+ try {
+ functional.gles3.es3fFboCompletenessTests.initGlDependents(gl);
+ functional.gles3.es3fFboCompletenessTests.run(gl);
+ }
+ catch(err) {
+ bufferedLogToConsole(err);
+ }
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbodepthbuffer.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbodepthbuffer.html
new file mode 100644
index 0000000000..e74b8285c0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbodepthbuffer.html
@@ -0,0 +1,32 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Depthbuffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboDepthbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContextWithWrapperThatThrowsOnGLError('canvas', null, 2);
+
+
+ try {
+ functional.gles3.es3fFboDepthbufferTests.run(gl);
+ }
+ catch(err)
+ {
+ bufferedLogToConsole(err);
+ }
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/00_test_list.txt
new file mode 100644
index 0000000000..189ebc1d17
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/00_test_list.txt
@@ -0,0 +1,7 @@
+default.html
+whole.html
+sub.html
+format_00.html
+format_01.html
+format_02.html
+target.html \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/default.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/default.html
new file mode 100644
index 0000000000..ea07a5f6db
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/default.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fboinvalidate_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Invalidate Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboInvalidateTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="128" height="128"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {stencil: true}, 2);
+var extention = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboInvalidateTests.run(gl, [0, 1]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/fboinvalidate_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/fboinvalidate_test_generator.py
new file mode 100644
index 0000000000..ddb7efa091
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/fboinvalidate_test_generator.py
@@ -0,0 +1,114 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2019 The Khronos Group Inc.
+# Use of this source code is governed by an MIT-style license that can be
+# found in the LICENSE.txt file.
+
+"""
+ Generator for fboinvalidate* tests.
+ This file needs to be run in its folder.
+"""
+
+import sys
+
+_DO_NOT_EDIT_WARNING = """<!--
+
+This file is auto-generated from fboinvalidate_test_generator.py
+DO NOT EDIT!
+
+-->
+
+"""
+
+_HTML_TEMPLATE = """<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Invalidate Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboInvalidateTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="128" height="128"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {stencil: true}, 2);
+var extention = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboInvalidateTests.run(gl, [%(start)s, %(end)s]);
+</script>
+</body>
+</html>
+"""
+
+_GROUPS = [
+ 'default',
+ 'whole',
+ 'sub',
+ 'format',
+ 'target',
+]
+
+_GROUP_TEST_COUNTS = [
+ 1,
+ 1,
+ 1,
+ 3,
+ 1
+]
+
+def GenerateFilename(group, count, index):
+ """Generate test filename."""
+ filename = group
+ assert index >= 0 and index < count
+ if count > 1:
+ index_str = str(index)
+ if index < 10:
+ index_str = "0" + index_str
+ filename += "_" + index_str
+ filename += ".html"
+ return filename
+
+def WriteTest(filename, start, end):
+ """Write one test."""
+ file = open(filename, "wb")
+ file.write(_DO_NOT_EDIT_WARNING)
+ file.write(_HTML_TEMPLATE % {
+ 'start': start,
+ 'end': end
+ })
+ file.close
+
+def GenerateTests():
+ """Generate all tests."""
+ assert len(_GROUPS) == len(_GROUP_TEST_COUNTS)
+ test_index = 0
+ filelist = []
+ for ii in range(len(_GROUPS)):
+ group = _GROUPS[ii]
+ count = _GROUP_TEST_COUNTS[ii]
+ for index in range(count):
+ filename = GenerateFilename(group, count, index)
+ filelist.append(filename)
+ WriteTest(filename, test_index, test_index + 1)
+ test_index += 1
+ return filelist
+
+def GenerateTestList(filelist):
+ file = open("00_test_list.txt", "wb")
+ file.write('\n'.join(filelist))
+ file.close
+
+def main(argv):
+ """This is the main function."""
+ filelist = GenerateTests()
+ GenerateTestList(filelist)
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/format_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/format_00.html
new file mode 100644
index 0000000000..50a4fad63d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/format_00.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fboinvalidate_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Invalidate Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboInvalidateTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="128" height="128"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {stencil: true}, 2);
+var extention = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboInvalidateTests.run(gl, [3, 4]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/format_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/format_01.html
new file mode 100644
index 0000000000..2a130faadb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/format_01.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fboinvalidate_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Invalidate Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboInvalidateTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="128" height="128"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {stencil: true}, 2);
+var extention = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboInvalidateTests.run(gl, [4, 5]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/format_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/format_02.html
new file mode 100644
index 0000000000..7aecfbf1a5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/format_02.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fboinvalidate_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Invalidate Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboInvalidateTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="128" height="128"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {stencil: true}, 2);
+var extention = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboInvalidateTests.run(gl, [5, 6]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/sub.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/sub.html
new file mode 100644
index 0000000000..0a883c0c44
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/sub.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fboinvalidate_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Invalidate Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboInvalidateTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="128" height="128"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {stencil: true}, 2);
+var extention = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboInvalidateTests.run(gl, [2, 3]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/target.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/target.html
new file mode 100644
index 0000000000..e36c335d4f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/target.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fboinvalidate_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Invalidate Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboInvalidateTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="128" height="128"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {stencil: true}, 2);
+var extention = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboInvalidateTests.run(gl, [6, 7]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/whole.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/whole.html
new file mode 100644
index 0000000000..2792fa7652
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/whole.html
@@ -0,0 +1,32 @@
+<!--
+
+This file is auto-generated from fboinvalidate_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL FBO Invalidate Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboInvalidateTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="128" height="128"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {stencil: true}, 2);
+var extention = gl.getExtension('EXT_color_buffer_float');
+
+functional.gles3.es3fFboInvalidateTests.run(gl, [1, 2]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbomultisample.2_samples.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbomultisample.2_samples.html
new file mode 100644
index 0000000000..1de885749a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbomultisample.2_samples.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Fbo Multisample Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboMultisampleTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="119" height="131"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFboMultisampleTests.run(gl, [0, 1]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbomultisample.4_samples.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbomultisample.4_samples.html
new file mode 100644
index 0000000000..5e8d75c691
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbomultisample.4_samples.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Fbo Multisample Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboMultisampleTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="119" height="131"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFboMultisampleTests.run(gl, [1, 2]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbomultisample.8_samples.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbomultisample.8_samples.html
new file mode 100644
index 0000000000..c1fb9e70f2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbomultisample.8_samples.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Fbo Multisample Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboMultisampleTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="119" height="131"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFboMultisampleTests.run(gl, [2, 3]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/00_test_list.txt
new file mode 100644
index 0000000000..65e66c8949
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/00_test_list.txt
@@ -0,0 +1,18 @@
+stencil_clear.html
+shared_colorbuffer_clear.html
+shared_colorbuffer_00.html
+shared_colorbuffer_01.html
+shared_colorbuffer_02.html
+shared_depth_stencil.html
+resize_00.html
+resize_01.html
+resize_02.html
+resize_03.html
+recreate_color_00.html
+recreate_color_01.html
+recreate_color_02.html
+recreate_color_03.html
+recreate_color_04.html
+recreate_color_05.html
+recreate_color_06.html
+recreate_depth_stencil.html \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/fborender_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/fborender_test_generator.py
new file mode 100644
index 0000000000..a1065d4629
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/fborender_test_generator.py
@@ -0,0 +1,117 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2019 The Khronos Group Inc.
+# Use of this source code is governed by an MIT-style license that can be
+# found in the LICENSE.txt file.
+
+"""
+ Generator for fborender* tests.
+ This file needs to be run in its folder.
+"""
+
+import sys
+
+_DO_NOT_EDIT_WARNING = """<!--
+
+This file is auto-generated from fborender_test_generator.py
+DO NOT EDIT!
+
+-->
+
+"""
+
+_HTML_TEMPLATE = """<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Render Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboRenderTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="128"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFboRenderTest.run(gl, [%(start)s, %(end)s]);
+</script>
+</body>
+</html>
+"""
+
+_GROUPS = [
+ 'stencil_clear',
+ 'shared_colorbuffer_clear',
+ 'shared_colorbuffer',
+ 'shared_depth_stencil',
+ 'resize',
+ 'recreate_color',
+ 'recreate_depth_stencil'
+]
+
+_GROUP_TEST_COUNTS = [
+ 1,
+ 1,
+ 3,
+ 1,
+ 4,
+ 7,
+ 1
+]
+
+def GenerateFilename(group, count, index):
+ """Generate test filename."""
+ filename = group
+ assert index >= 0 and index < count
+ if count > 1:
+ index_str = str(index)
+ if index < 10:
+ index_str = "0" + index_str
+ filename += "_" + index_str
+ filename += ".html"
+ return filename
+
+def WriteTest(filename, start, end):
+ """Write one test."""
+ file = open(filename, "wb")
+ file.write(_DO_NOT_EDIT_WARNING)
+ file.write(_HTML_TEMPLATE % {
+ 'start': start,
+ 'end': end
+ })
+ file.close
+
+def GenerateTests():
+ """Generate all tests."""
+ assert len(_GROUPS) == len(_GROUP_TEST_COUNTS)
+ test_index = 0
+ filelist = []
+ for ii in range(len(_GROUPS)):
+ group = _GROUPS[ii]
+ count = _GROUP_TEST_COUNTS[ii]
+ for index in range(count):
+ filename = GenerateFilename(group, count, index)
+ filelist.append(filename)
+ WriteTest(filename, test_index, test_index + 1)
+ test_index += 1
+ return filelist
+
+def GenerateTestList(filelist):
+ file = open("00_test_list.txt", "wb")
+ file.write('\n'.join(filelist))
+ file.close
+
+def main(argv):
+ """This is the main function."""
+ filelist = GenerateTests()
+ GenerateTestList(filelist)
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_00.html
new file mode 100644
index 0000000000..e318ee0e6e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from fborender_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Render Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboRenderTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="128"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFboRenderTest.run(gl, [10, 11]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_01.html
new file mode 100644
index 0000000000..9fb93d4863
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from fborender_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Render Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboRenderTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="128"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFboRenderTest.run(gl, [11, 12]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_02.html
new file mode 100644
index 0000000000..08076ed79b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from fborender_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Render Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboRenderTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="128"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFboRenderTest.run(gl, [12, 13]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_03.html
new file mode 100644
index 0000000000..3c72f2bcab
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from fborender_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Render Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboRenderTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="128"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFboRenderTest.run(gl, [13, 14]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_04.html
new file mode 100644
index 0000000000..1007e8c749
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_04.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from fborender_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Render Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboRenderTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="128"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFboRenderTest.run(gl, [14, 15]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_05.html
new file mode 100644
index 0000000000..1ec97a5912
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_05.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from fborender_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Render Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboRenderTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="128"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFboRenderTest.run(gl, [15, 16]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_06.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_06.html
new file mode 100644
index 0000000000..51ab8dec97
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_color_06.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from fborender_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Render Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboRenderTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="128"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFboRenderTest.run(gl, [16, 17]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_depth_stencil.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_depth_stencil.html
new file mode 100644
index 0000000000..0e4ca74e54
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/recreate_depth_stencil.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from fborender_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Render Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboRenderTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="128"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFboRenderTest.run(gl, [17, 18]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_00.html
new file mode 100644
index 0000000000..5d9bab23f2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from fborender_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Render Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboRenderTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="128"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFboRenderTest.run(gl, [6, 7]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_01.html
new file mode 100644
index 0000000000..94cb09653c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from fborender_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Render Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboRenderTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="128"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFboRenderTest.run(gl, [7, 8]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_02.html
new file mode 100644
index 0000000000..c1f4c13616
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from fborender_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Render Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboRenderTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="128"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFboRenderTest.run(gl, [8, 9]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_03.html
new file mode 100644
index 0000000000..4a6e2c81d7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/resize_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from fborender_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Render Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboRenderTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="128"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFboRenderTest.run(gl, [9, 10]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_00.html
new file mode 100644
index 0000000000..54004f2d7c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from fborender_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Render Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboRenderTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="128"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFboRenderTest.run(gl, [2, 3]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_01.html
new file mode 100644
index 0000000000..b3ac79efbc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from fborender_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Render Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboRenderTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="128"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFboRenderTest.run(gl, [3, 4]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_02.html
new file mode 100644
index 0000000000..2f85029b1f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from fborender_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Render Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboRenderTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="128"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFboRenderTest.run(gl, [4, 5]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_clear.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_clear.html
new file mode 100644
index 0000000000..69a46744ca
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_colorbuffer_clear.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from fborender_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Render Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboRenderTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="128"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFboRenderTest.run(gl, [1, 2]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_depth_stencil.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_depth_stencil.html
new file mode 100644
index 0000000000..ff5c626431
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/shared_depth_stencil.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from fborender_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Render Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboRenderTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="128"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFboRenderTest.run(gl, [5, 6]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/stencil_clear.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/stencil_clear.html
new file mode 100644
index 0000000000..59c0819fe6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/stencil_clear.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from fborender_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Render Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboRenderTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="128"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFboRenderTest.run(gl, [0, 1]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbostatequery.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbostatequery.html
new file mode 100644
index 0000000000..95cc36b6a1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbostatequery.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Fbo State Query Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboStateQueryTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFboStateQueryTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbostencilbuffer.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbostencilbuffer.html
new file mode 100644
index 0000000000..251acc57dd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbostencilbuffer.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Fbo Stencilbuffer Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFboStencilbufferTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFboStencilbufferTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/floatstatequery.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/floatstatequery.html
new file mode 100644
index 0000000000..1fd326939e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/floatstatequery.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Float State Query Tests Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFloatStateQueryTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFloatStateQueryTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragdepth.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragdepth.html
new file mode 100644
index 0000000000..31ee874ae3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragdepth.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Frag Depth Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFragDepthTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFragDepthTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/00_test_list.txt
new file mode 100644
index 0000000000..8a410f6506
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/00_test_list.txt
@@ -0,0 +1,11 @@
+basic.float.html
+basic.fixed.html
+basic.int.html
+basic.uint.html
+array.float.html
+array.fixed.html
+array.int.html
+array.uint.html
+random_00.html
+random_01.html
+random_02.html \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.fixed.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.fixed.html
new file mode 100644
index 0000000000..ab4c17aec6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.fixed.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from fragmentoutput_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Fragment Output Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFragmentOutputTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFragmentOutputTests.run(gl, [5, 6]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.float.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.float.html
new file mode 100644
index 0000000000..474fe78eec
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.float.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from fragmentoutput_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Fragment Output Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFragmentOutputTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFragmentOutputTests.run(gl, [4, 5]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.int.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.int.html
new file mode 100644
index 0000000000..f100e804b6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.int.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from fragmentoutput_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Fragment Output Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFragmentOutputTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFragmentOutputTests.run(gl, [6, 7]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.uint.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.uint.html
new file mode 100644
index 0000000000..fb3e5d96a6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/array.uint.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from fragmentoutput_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Fragment Output Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFragmentOutputTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFragmentOutputTests.run(gl, [7, 8]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.fixed.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.fixed.html
new file mode 100644
index 0000000000..e58eda69c8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.fixed.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from fragmentoutput_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Fragment Output Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFragmentOutputTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFragmentOutputTests.run(gl, [1, 2]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.float.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.float.html
new file mode 100644
index 0000000000..b0fe9a2fff
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.float.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from fragmentoutput_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Fragment Output Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFragmentOutputTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFragmentOutputTests.run(gl, [0, 1]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.int.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.int.html
new file mode 100644
index 0000000000..871d8d0151
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.int.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from fragmentoutput_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Fragment Output Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFragmentOutputTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFragmentOutputTests.run(gl, [2, 3]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.uint.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.uint.html
new file mode 100644
index 0000000000..915aa90d9e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/basic.uint.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from fragmentoutput_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Fragment Output Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFragmentOutputTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFragmentOutputTests.run(gl, [3, 4]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/fragmentoutput_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/fragmentoutput_test_generator.py
new file mode 100644
index 0000000000..5f7ea66d23
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/fragmentoutput_test_generator.py
@@ -0,0 +1,93 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2019 The Khronos Group Inc.
+# Use of this source code is governed by an MIT-style license that can be
+# found in the LICENSE.txt file.
+
+"""
+ Generator for fragmentoutput* tests.
+ This file needs to be run in its folder.
+"""
+
+import sys
+
+_DO_NOT_EDIT_WARNING = """<!--
+
+This file is auto-generated from fragmentoutput_test_generator.py
+DO NOT EDIT!
+
+-->
+
+"""
+
+_HTML_TEMPLATE = """<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Fragment Output Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFragmentOutputTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFragmentOutputTests.run(gl, [%(start)s, %(end)s]);
+</script>
+</body>
+</html>
+"""
+
+_GROUPS = [
+ 'basic.float',
+ 'basic.fixed',
+ 'basic.int',
+ 'basic.uint',
+ 'array.float',
+ 'array.fixed',
+ 'array.int',
+ 'array.uint',
+ 'random_00',
+ 'random_01',
+ 'random_02'
+]
+
+def WriteTest(filename, start, end):
+ """Write one test."""
+ file = open(filename, "wb")
+ file.write(_DO_NOT_EDIT_WARNING)
+ file.write(_HTML_TEMPLATE % {
+ 'start': start,
+ 'end': end
+ })
+ file.close
+
+def GenerateTests():
+ """Generate all tests."""
+ filelist = []
+ for ii in range(len(_GROUPS)):
+ filename = _GROUPS[ii] + '.html'
+ filelist.append(filename)
+ WriteTest(filename, ii, ii + 1)
+ return filelist
+
+def GenerateTestList(filelist):
+ file = open("00_test_list.txt", "wb")
+ file.write('\n'.join(filelist))
+ file.close
+
+def main(argv):
+ """This is the main function."""
+ filelist = GenerateTests()
+ GenerateTestList(filelist)
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/random_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/random_00.html
new file mode 100644
index 0000000000..d592e2f114
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/random_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from fragmentoutput_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Fragment Output Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFragmentOutputTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFragmentOutputTests.run(gl, [8, 9]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/random_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/random_01.html
new file mode 100644
index 0000000000..4e62689ce0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/random_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from fragmentoutput_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Fragment Output Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFragmentOutputTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFragmentOutputTests.run(gl, [9, 10]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/random_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/random_02.html
new file mode 100644
index 0000000000..3bcf9c5442
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/random_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from fragmentoutput_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Fragment Output Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFragmentOutputTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFragmentOutputTests.run(gl, [10, 11]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/00_test_list.txt
new file mode 100644
index 0000000000..6aeeaf64ab
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/00_test_list.txt
@@ -0,0 +1,50 @@
+rect_00.html
+rect_01.html
+rect_02.html
+rect_03.html
+rect_04.html
+rect_05.html
+rect_06.html
+conversion_00.html
+conversion_01.html
+conversion_02.html
+conversion_03.html
+conversion_04.html
+conversion_05.html
+conversion_06.html
+conversion_07.html
+conversion_08.html
+conversion_09.html
+conversion_10.html
+conversion_11.html
+conversion_12.html
+conversion_13.html
+conversion_14.html
+conversion_15.html
+conversion_16.html
+conversion_17.html
+conversion_18.html
+conversion_19.html
+conversion_20.html
+conversion_21.html
+conversion_22.html
+conversion_23.html
+conversion_24.html
+conversion_25.html
+conversion_26.html
+conversion_27.html
+conversion_28.html
+conversion_29.html
+conversion_30.html
+conversion_31.html
+conversion_32.html
+conversion_33.html
+conversion_34.html
+depth_stencil.html
+default_framebuffer_00.html
+default_framebuffer_01.html
+default_framebuffer_02.html
+default_framebuffer_03.html
+default_framebuffer_04.html
+default_framebuffer_05.html
+default_framebuffer_06.html \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_00.html
new file mode 100644
index 0000000000..6124a65698
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [7, 8]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_01.html
new file mode 100644
index 0000000000..d0389725fb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [8, 9]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_02.html
new file mode 100644
index 0000000000..cebfd04d06
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [9, 10]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_03.html
new file mode 100644
index 0000000000..2539865a9a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [10, 11]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_04.html
new file mode 100644
index 0000000000..d98f9268d6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_04.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [11, 12]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_05.html
new file mode 100644
index 0000000000..6045c4a870
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_05.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [12, 13]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_06.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_06.html
new file mode 100644
index 0000000000..f851a73d5c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_06.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [13, 14]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_07.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_07.html
new file mode 100644
index 0000000000..900c2c1567
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_07.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [14, 15]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_08.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_08.html
new file mode 100644
index 0000000000..f9ea2cce4f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_08.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [15, 16]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_09.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_09.html
new file mode 100644
index 0000000000..f20d4bea67
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_09.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [16, 17]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_10.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_10.html
new file mode 100644
index 0000000000..1f15f08f1e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_10.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [17, 18]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_11.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_11.html
new file mode 100644
index 0000000000..9a8a2760c2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_11.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [18, 19]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_12.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_12.html
new file mode 100644
index 0000000000..d4954fb187
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_12.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [19, 20]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_13.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_13.html
new file mode 100644
index 0000000000..a68d778d84
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_13.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [20, 21]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_14.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_14.html
new file mode 100644
index 0000000000..5fbc4b1c68
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_14.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [21, 22]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_15.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_15.html
new file mode 100644
index 0000000000..0b31db5a2a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_15.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [22, 23]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_16.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_16.html
new file mode 100644
index 0000000000..31de2fb37e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_16.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [23, 24]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_17.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_17.html
new file mode 100644
index 0000000000..85939968f6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_17.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [24, 25]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_18.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_18.html
new file mode 100644
index 0000000000..303b1f9d22
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_18.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [25, 26]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_19.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_19.html
new file mode 100644
index 0000000000..4ca74e4ae1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_19.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [26, 27]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_20.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_20.html
new file mode 100644
index 0000000000..13dfe1137c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_20.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [27, 28]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_21.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_21.html
new file mode 100644
index 0000000000..717bcbbcce
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_21.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [28, 29]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_22.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_22.html
new file mode 100644
index 0000000000..8bf21f9e3b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_22.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [29, 30]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_23.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_23.html
new file mode 100644
index 0000000000..7238bdb419
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_23.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [30, 31]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_24.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_24.html
new file mode 100644
index 0000000000..2e7313a664
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_24.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [31, 32]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_25.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_25.html
new file mode 100644
index 0000000000..053dd4be5f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_25.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [32, 33]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_26.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_26.html
new file mode 100644
index 0000000000..c7f79eca6f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_26.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [33, 34]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_27.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_27.html
new file mode 100644
index 0000000000..f8c41645f7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_27.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [34, 35]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_28.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_28.html
new file mode 100644
index 0000000000..2222bb7f30
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_28.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [35, 36]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_29.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_29.html
new file mode 100644
index 0000000000..51d29810cd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_29.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [36, 37]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_30.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_30.html
new file mode 100644
index 0000000000..eae41bfcc6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_30.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [37, 38]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_31.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_31.html
new file mode 100644
index 0000000000..55e96090e3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_31.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [38, 39]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_32.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_32.html
new file mode 100644
index 0000000000..2ddd49fce8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_32.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [39, 40]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_33.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_33.html
new file mode 100644
index 0000000000..83a32646ae
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_33.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [40, 41]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_34.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_34.html
new file mode 100644
index 0000000000..062cb7f3ca
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/conversion_34.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [41, 42]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_00.html
new file mode 100644
index 0000000000..749c9bff5b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [43, 44]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_01.html
new file mode 100644
index 0000000000..42cf9a6471
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [44, 45]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_02.html
new file mode 100644
index 0000000000..3789b97c6c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [45, 46]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_03.html
new file mode 100644
index 0000000000..f1b0252daa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [46, 47]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_04.html
new file mode 100644
index 0000000000..60562a9998
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_04.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [47, 48]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_05.html
new file mode 100644
index 0000000000..7bd5c7db54
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_05.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [48, 49]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_06.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_06.html
new file mode 100644
index 0000000000..74645cf2c1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/default_framebuffer_06.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [49, 50]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/depth_stencil.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/depth_stencil.html
new file mode 100644
index 0000000000..fb09d67f70
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/depth_stencil.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [42, 43]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/frambufferblit_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/frambufferblit_test_generator.py
new file mode 100644
index 0000000000..5e347a0ca1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/frambufferblit_test_generator.py
@@ -0,0 +1,111 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2019 The Khronos Group Inc.
+# Use of this source code is governed by an MIT-style license that can be
+# found in the LICENSE.txt file.
+
+"""
+ Generator for framebufferblit* tests.
+ This file needs to be run in its folder.
+"""
+
+import sys
+
+_DO_NOT_EDIT_WARNING = """<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+"""
+
+_HTML_TEMPLATE = """<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [%(start)s, %(end)s]);
+</script>
+</body>
+</html>
+"""
+
+_GROUPS = [
+ 'rect',
+ 'conversion',
+ 'depth_stencil',
+ 'default_framebuffer',
+]
+
+_GROUP_TEST_COUNTS = [
+ 7,
+ 35,
+ 1,
+ 7
+]
+
+def GenerateFilename(group, count, index):
+ """Generate test filename."""
+ filename = group
+ assert index >= 0 and index < count
+ if count > 1:
+ index_str = str(index)
+ if index < 10:
+ index_str = "0" + index_str
+ filename += "_" + index_str
+ filename += ".html"
+ return filename
+
+def WriteTest(filename, start, end):
+ """Write one test."""
+ file = open(filename, "wb")
+ file.write(_DO_NOT_EDIT_WARNING)
+ file.write(_HTML_TEMPLATE % {
+ 'start': start,
+ 'end': end
+ })
+ file.close
+
+def GenerateTests():
+ """Generate all tests."""
+ assert len(_GROUPS) == len(_GROUP_TEST_COUNTS)
+ test_index = 0
+ filelist = []
+ for ii in range(len(_GROUPS)):
+ group = _GROUPS[ii]
+ count = _GROUP_TEST_COUNTS[ii]
+ for index in range(count):
+ filename = GenerateFilename(group, count, index)
+ filelist.append(filename)
+ WriteTest(filename, test_index, test_index + 1)
+ test_index += 1
+ return filelist
+
+def GenerateTestList(filelist):
+ file = open("00_test_list.txt", "wb")
+ file.write('\n'.join(filelist))
+ file.close
+
+def main(argv):
+ """This is the main function."""
+ filelist = GenerateTests()
+ GenerateTestList(filelist)
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_00.html
new file mode 100644
index 0000000000..c0076c02ea
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [0, 1]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_01.html
new file mode 100644
index 0000000000..d2a53cedcf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [1, 2]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_02.html
new file mode 100644
index 0000000000..b73eb396d6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [2, 3]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_03.html
new file mode 100644
index 0000000000..86971ca0f0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [3, 4]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_04.html
new file mode 100644
index 0000000000..c9239f32f3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_04.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [4, 5]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_05.html
new file mode 100644
index 0000000000..b40353a15c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_05.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [5, 6]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_06.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_06.html
new file mode 100644
index 0000000000..8fb90dda48
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/rect_06.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from framebufferblit_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Framebuffer Blit Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fFramebufferBlitTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="200"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fFramebufferBlitTests.run(gl, [6, 7]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/indexedstatequery.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/indexedstatequery.html
new file mode 100644
index 0000000000..ee57dcb183
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/indexedstatequery.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Indexed Integer Values Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fIndexedStateQueryTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fIndexedStateQueryTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/instancedrendering.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/instancedrendering.html
new file mode 100644
index 0000000000..6de0a016c4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/instancedrendering.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Instanced Rendering Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fInstancedRenderingTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fInstancedRenderingTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/integerstatequery.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/integerstatequery.html
new file mode 100644
index 0000000000..610ddf9888
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/integerstatequery.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Integer Values Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fIntegerStateQueryTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fIntegerStateQueryTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/internalformatquery.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/internalformatquery.html
new file mode 100644
index 0000000000..765dede408
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/internalformatquery.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Internalformat query tests Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fInternalFormatQueryTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fInternalFormatQueryTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/lifetime.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/lifetime.html
new file mode 100644
index 0000000000..7cf80807e0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/lifetime.html
@@ -0,0 +1,34 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Lifetime Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fLifetimeTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+testName = 'lifetime';
+setCurrentTestName(testName);
+description("Functional test: " + testName + ".");
+
+var wtu = WebGLTestUtils;
+/** @type {WebGL2RenderingContext} */ var gl = wtu.create3DContext('canvas', null, 2);
+
+ try{
+ functional.gles3.es3fLifetimeTests.run(gl);
+ }
+ catch(err)
+ {
+ bufferedLogToConsole(err);
+ }
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/multisample/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/multisample/00_test_list.txt
new file mode 100644
index 0000000000..6c5e238d0d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/multisample/00_test_list.txt
@@ -0,0 +1,6 @@
+# This file is auto-generated from multisample_test_generator.py
+# DO NOT EDIT!
+default_fbo.html
+fbo_4_samples.html
+fbo_8_samples.html
+fbo_max_samples.html \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/multisample/default_fbo.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/multisample/default_fbo.html
new file mode 100644
index 0000000000..71d3f06bf9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/multisample/default_fbo.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from multisample_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Multisample Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fMultisampleTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fMultisampleTests.run(gl, [0, 1]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/multisample/fbo_4_samples.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/multisample/fbo_4_samples.html
new file mode 100644
index 0000000000..c021f57ba9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/multisample/fbo_4_samples.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from multisample_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Multisample Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fMultisampleTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fMultisampleTests.run(gl, [1, 2]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/multisample/fbo_8_samples.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/multisample/fbo_8_samples.html
new file mode 100644
index 0000000000..adca5aeafe
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/multisample/fbo_8_samples.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from multisample_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Multisample Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fMultisampleTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fMultisampleTests.run(gl, [2, 3]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/multisample/fbo_max_samples.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/multisample/fbo_max_samples.html
new file mode 100644
index 0000000000..32c75c721f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/multisample/fbo_max_samples.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from multisample_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Multisample Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fMultisampleTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fMultisampleTests.run(gl, [3, 4]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/multisample/multisample_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/multisample/multisample_test_generator.py
new file mode 100755
index 0000000000..2107a572f0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/multisample/multisample_test_generator.py
@@ -0,0 +1,98 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2021 The Khronos Group Inc.
+# Use of this source code is governed by an MIT-style license that can be
+# found in the LICENSE.txt file.
+
+"""
+ Generator for multisample* tests.
+ This file needs to be run in its folder.
+"""
+
+import sys
+
+_DO_NOT_EDIT_WARNING = """<!--
+
+This file is auto-generated from multisample_test_generator.py
+DO NOT EDIT!
+
+-->
+
+"""
+
+_DO_NOT_EDIT_TEST_LIST_WARNING = """# This file is auto-generated from multisample_test_generator.py
+# DO NOT EDIT!
+"""
+
+_HTML_TEMPLATE = """<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Multisample Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fMultisampleTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fMultisampleTests.run(gl, [%(start)s, %(end)s]);
+</script>
+</body>
+</html>
+"""
+
+# Note: must match CaseType in es3fMultisampleTests.js.
+_GROUPS = [
+ 'default_fbo',
+ 'fbo_4_samples',
+ 'fbo_8_samples',
+ 'fbo_max_samples',
+]
+
+def GenerateFilename(group):
+ """Generate test filename."""
+ filename = group
+ filename += ".html"
+ return filename
+
+def WriteTest(filename, start, end):
+ """Write one test."""
+ file = open(filename, "wb")
+ file.write(_DO_NOT_EDIT_WARNING)
+ file.write(_HTML_TEMPLATE % {
+ 'start': start,
+ 'end': end
+ })
+ file.close
+
+def GenerateTests():
+ """Generate all tests."""
+ filelist = []
+ for ii in range(len(_GROUPS)):
+ filename = GenerateFilename(_GROUPS[ii])
+ filelist.append(filename)
+ WriteTest(filename, ii, ii + 1)
+ return filelist
+
+def GenerateTestList(filelist):
+ file = open("00_test_list.txt", "wb")
+ file.write(_DO_NOT_EDIT_TEST_LIST_WARNING)
+ file.write('\n'.join(filelist))
+ file.close
+
+def main(argv):
+ """This is the main function."""
+ filelist = GenerateTests()
+ GenerateTestList(filelist)
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativebufferapi.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativebufferapi.html
new file mode 100644
index 0000000000..f754359818
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativebufferapi.html
@@ -0,0 +1,30 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Negative Buffer API Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fNegativeBufferApiTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+
+ var wtu = WebGLTestUtils;
+ var gl = wtu.create3DContext('canvas', null, 2);
+
+ try {
+ functional.gles3.es3fNegativeBufferApiTests.run(gl);
+ }
+ catch(err) {
+ bufferedLogToConsole(err);
+ }
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativefragmentapi.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativefragmentapi.html
new file mode 100644
index 0000000000..91de0c29c2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativefragmentapi.html
@@ -0,0 +1,23 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Negative Fragment API Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fNegativeFragmentApiTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fNegativeFragmentApiTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativeshaderapi.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativeshaderapi.html
new file mode 100644
index 0000000000..a1d9fc66eb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativeshaderapi.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Negative Shader API Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fNegativeShaderApiTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fNegativeShaderApiTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativestateapi.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativestateapi.html
new file mode 100644
index 0000000000..d54090eaf8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativestateapi.html
@@ -0,0 +1,23 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Negative State API Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fNegativeStateApiTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fNegativeStateApiTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativetextureapi.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativetextureapi.html
new file mode 100644
index 0000000000..dd61480039
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativetextureapi.html
@@ -0,0 +1,30 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Negative Texture API Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fNegativeTextureApiTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+
+ var wtu = WebGLTestUtils;
+ var gl = wtu.create3DContext('canvas', null, 2);
+
+ try {
+ functional.gles3.es3fNegativeTextureApiTests.run(gl);
+ }
+ catch(err) {
+ bufferedLogToConsole(err);
+ }
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativevertexarrayapi.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativevertexarrayapi.html
new file mode 100644
index 0000000000..c93514cb85
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/negativevertexarrayapi.html
@@ -0,0 +1,30 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Negative Vertex Array API Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fNegativeVertexArrayApiTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+
+ var wtu = WebGLTestUtils;
+ var gl = wtu.create3DContext('canvas', null, 2);
+
+ try {
+ functional.gles3.es3fNegativeVertexArrayApiTests.run(gl);
+ }
+ catch(err) {
+ bufferedLogToConsole(err);
+ }
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/occlusionquery_conservative.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/occlusionquery_conservative.html
new file mode 100644
index 0000000000..d05abc128f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/occlusionquery_conservative.html
@@ -0,0 +1,26 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Occlusion Query Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fOcclusionQueryTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {stencil: true, preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fOcclusionQueryTests.run(gl, [31, 62]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/occlusionquery_strict.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/occlusionquery_strict.html
new file mode 100644
index 0000000000..bc04e961ce
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/occlusionquery_strict.html
@@ -0,0 +1,26 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Occlusion Query Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fOcclusionQueryTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {stencil: true, preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fOcclusionQueryTests.run(gl, [0, 31]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/pixelbufferobject.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/pixelbufferobject.html
new file mode 100644
index 0000000000..1d9dd317de
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/pixelbufferobject.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Pixel Buffer Object Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fPixelBufferObjectTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fPixelBufferObjectTest.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/00.html
new file mode 100644
index 0000000000..46ea49ed22
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from primitiverestart_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Primitive Restart Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fPrimitiveRestartTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fPrimitiveRestartTests.run(gl, [0, 1]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/00_test_list.txt
new file mode 100644
index 0000000000..6812378afe
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/00_test_list.txt
@@ -0,0 +1,8 @@
+00.html
+01.html
+02.html
+03.html
+04.html
+05.html
+06.html
+07.html \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/01.html
new file mode 100644
index 0000000000..59c6331b63
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from primitiverestart_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Primitive Restart Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fPrimitiveRestartTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fPrimitiveRestartTests.run(gl, [1, 2]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/02.html
new file mode 100644
index 0000000000..5552f59172
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from primitiverestart_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Primitive Restart Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fPrimitiveRestartTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fPrimitiveRestartTests.run(gl, [2, 3]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/03.html
new file mode 100644
index 0000000000..c6b5fb2b9c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from primitiverestart_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Primitive Restart Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fPrimitiveRestartTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fPrimitiveRestartTests.run(gl, [3, 4]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/04.html
new file mode 100644
index 0000000000..e7354067a6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/04.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from primitiverestart_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Primitive Restart Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fPrimitiveRestartTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fPrimitiveRestartTests.run(gl, [4, 5]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/05.html
new file mode 100644
index 0000000000..4ed0938d0b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/05.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from primitiverestart_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Primitive Restart Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fPrimitiveRestartTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fPrimitiveRestartTests.run(gl, [5, 6]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/06.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/06.html
new file mode 100644
index 0000000000..ed4039877b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/06.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from primitiverestart_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Primitive Restart Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fPrimitiveRestartTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fPrimitiveRestartTests.run(gl, [6, 7]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/07.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/07.html
new file mode 100644
index 0000000000..bf8b47fb25
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/07.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from primitiverestart_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Primitive Restart Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fPrimitiveRestartTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fPrimitiveRestartTests.run(gl, [7, 8]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/primitiverestart_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/primitiverestart_test_generator.py
new file mode 100644
index 0000000000..8eaf5ce245
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/primitiverestart_test_generator.py
@@ -0,0 +1,84 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2019 The Khronos Group Inc.
+# Use of this source code is governed by an MIT-style license that can be
+# found in the LICENSE.txt file.
+
+"""
+ Generator for primitiverestart* tests.
+ This file needs to be run in its folder.
+"""
+
+import sys
+
+_DO_NOT_EDIT_WARNING = """<!--
+
+This file is auto-generated from primitiverestart_test_generator.py
+DO NOT EDIT!
+
+-->
+
+"""
+
+_HTML_TEMPLATE = """<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Primitive Restart Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fPrimitiveRestartTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fPrimitiveRestartTests.run(gl, [%(start)s, %(end)s]);
+</script>
+</body>
+</html>
+"""
+
+_NUM_TESTS = 8
+
+def WriteTest(filename, start, end):
+ """Write one test."""
+ file = open(filename, "wb")
+ file.write(_DO_NOT_EDIT_WARNING)
+ file.write(_HTML_TEMPLATE % {
+ 'start': start,
+ 'end': end
+ })
+ file.close
+
+def GenerateTests():
+ """Generate all tests."""
+ filelist = []
+ for ii in range(_NUM_TESTS):
+ index_str = str(ii)
+ if ii < 10:
+ index_str = "0" + index_str
+ filename = index_str + '.html'
+ filelist.append(filename)
+ WriteTest(filename, ii, ii + 1)
+ return filelist
+
+def GenerateTestList(filelist):
+ file = open("00_test_list.txt", "wb")
+ file.write('\n'.join(filelist))
+ file.close
+
+def main(argv):
+ """This is the main function."""
+ filelist = GenerateTests()
+ GenerateTestList(filelist)
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/rasterizerdiscard.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/rasterizerdiscard.html
new file mode 100644
index 0000000000..185a233404
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/rasterizerdiscard.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Rasterizer Discard Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fRasterizerDiscardTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {stencil: true}, 2);
+
+functional.gles3.es3fRasterizerDiscardTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/rbostatequery.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/rbostatequery.html
new file mode 100644
index 0000000000..bd11632053
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/rbostatequery.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Rbo State Query Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fRboStateQueryTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fRboStateQueryTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/readpixel.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/readpixel.html
new file mode 100644
index 0000000000..bbe1167f49
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/readpixel.html
@@ -0,0 +1,26 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL ReadPixel Tests Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fReadPixelTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fReadPixelTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/samplerobject.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/samplerobject.html
new file mode 100644
index 0000000000..6f9187657a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/samplerobject.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Sampler Object Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fSamplerObjectTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fSamplerObjectTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/samplerstatequery.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/samplerstatequery.html
new file mode 100644
index 0000000000..c78debef2e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/samplerstatequery.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Sampler State Query Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fSamplerStateQueryTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fSamplerStateQueryTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderapi.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderapi.html
new file mode 100644
index 0000000000..d33e78148e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderapi.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader API Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderApiTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderApiTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderbuiltinvar.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderbuiltinvar.html
new file mode 100644
index 0000000000..f8a7be22e1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderbuiltinvar.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Built-in Var Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderBuiltinVarTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fShaderBuiltinVarTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadercommonfunction.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadercommonfunction.html
new file mode 100644
index 0000000000..0dbad257fa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadercommonfunction.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Common Function Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderCommonFunctionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderCommonFunctionTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderderivate_dfdx.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderderivate_dfdx.html
new file mode 100644
index 0000000000..4c2c679ef4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderderivate_dfdx.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Derivate Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderDerivateTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderDerivateTests.run(gl, [0, 1]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderderivate_dfdy.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderderivate_dfdy.html
new file mode 100644
index 0000000000..27a2da3ac1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderderivate_dfdy.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Derivate Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderDerivateTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderDerivateTests.run(gl, [1, 2]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderderivate_fwidth.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderderivate_fwidth.html
new file mode 100644
index 0000000000..bb8b90f913
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderderivate_fwidth.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Derivate Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderDerivateTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderDerivateTests.run(gl, [2, 3]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/00_test_list.txt
new file mode 100644
index 0000000000..da4d02b37d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/00_test_list.txt
@@ -0,0 +1,9 @@
+varying.html
+uniform.html
+tmp.html
+vec2.html
+vec3.html
+vec4.html
+mat_00.html
+mat_01.html
+mat_02.html \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/mat_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/mat_00.html
new file mode 100644
index 0000000000..2cd7e98fa2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/mat_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shaderindexing_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Indexing Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderIndexingTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderIndexingTests.run(gl, [6, 7]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/mat_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/mat_01.html
new file mode 100644
index 0000000000..ee6c322e31
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/mat_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shaderindexing_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Indexing Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderIndexingTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderIndexingTests.run(gl, [7, 8]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/mat_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/mat_02.html
new file mode 100644
index 0000000000..debdc57c2e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/mat_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shaderindexing_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Indexing Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderIndexingTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderIndexingTests.run(gl, [8, 9]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/shaderindexing_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/shaderindexing_test_generator.py
new file mode 100644
index 0000000000..beaace3469
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/shaderindexing_test_generator.py
@@ -0,0 +1,97 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2019 The Khronos Group Inc.
+# Use of this source code is governed by an MIT-style license that can be
+# found in the LICENSE.txt file.
+
+"""
+ Generator for shaderindexing* tests.
+ This file needs to be run in its folder.
+"""
+
+import sys
+
+_DO_NOT_EDIT_WARNING = """<!--
+
+This file is auto-generated from shaderindexing_test_generator.py
+DO NOT EDIT!
+
+-->
+
+"""
+
+_HTML_TEMPLATE = """<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Indexing Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderIndexingTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderIndexingTests.run(gl, [%(start)s, %(end)s]);
+</script>
+</body>
+</html>
+"""
+
+_GROUPS = [
+ 'varying',
+ 'uniform',
+ 'tmp',
+ 'vec2',
+ 'vec3',
+ 'vec4',
+ 'mat_00',
+ 'mat_01',
+ 'mat_02',
+]
+
+def GenerateFilename(group):
+ """Generate test filename."""
+ filename = group
+ filename += ".html"
+ return filename
+
+def WriteTest(filename, start, end):
+ """Write one test."""
+ file = open(filename, "wb")
+ file.write(_DO_NOT_EDIT_WARNING)
+ file.write(_HTML_TEMPLATE % {
+ 'start': start,
+ 'end': end
+ })
+ file.close
+
+def GenerateTests():
+ """Generate all tests."""
+ filelist = []
+ for ii in range(len(_GROUPS)):
+ filename = GenerateFilename(_GROUPS[ii])
+ filelist.append(filename)
+ WriteTest(filename, ii, ii + 1)
+ return filelist
+
+def GenerateTestList(filelist):
+ file = open("00_test_list.txt", "wb")
+ file.write('\n'.join(filelist))
+ file.close
+
+def main(argv):
+ """This is the main function."""
+ filelist = GenerateTests()
+ GenerateTestList(filelist)
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/tmp.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/tmp.html
new file mode 100644
index 0000000000..679a8884f8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/tmp.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shaderindexing_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Indexing Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderIndexingTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderIndexingTests.run(gl, [2, 3]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/uniform.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/uniform.html
new file mode 100644
index 0000000000..7c86a6f185
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/uniform.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shaderindexing_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Indexing Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderIndexingTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderIndexingTests.run(gl, [1, 2]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/varying.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/varying.html
new file mode 100644
index 0000000000..eea9c022f8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/varying.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shaderindexing_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Indexing Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderIndexingTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderIndexingTests.run(gl, [0, 1]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/vec2.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/vec2.html
new file mode 100644
index 0000000000..d2c80c1c4e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/vec2.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shaderindexing_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Indexing Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderIndexingTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderIndexingTests.run(gl, [3, 4]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/vec3.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/vec3.html
new file mode 100644
index 0000000000..aaabf027a3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/vec3.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shaderindexing_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Indexing Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderIndexingTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderIndexingTests.run(gl, [4, 5]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/vec4.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/vec4.html
new file mode 100644
index 0000000000..a896e726b4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/vec4.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shaderindexing_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Indexing Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderIndexingTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderIndexingTests.run(gl, [5, 6]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderloop_do_while.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderloop_do_while.html
new file mode 100644
index 0000000000..6b57433852
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderloop_do_while.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Loop Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderLoopTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderLoopTests.run(gl, [2, 3]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderloop_for.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderloop_for.html
new file mode 100644
index 0000000000..a2c5095c91
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderloop_for.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Loop Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderLoopTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderLoopTests.run(gl, [0, 1]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderloop_while.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderloop_while.html
new file mode 100644
index 0000000000..fac36651cb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderloop_while.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Loop Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderLoopTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderLoopTests.run(gl, [1, 2]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/00_test_list.txt
new file mode 100644
index 0000000000..dd0bb5a550
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/00_test_list.txt
@@ -0,0 +1,33 @@
+add_const.html
+add_uniform.html
+add_dynamic.html
+sub_const.html
+sub_uniform.html
+sub_dynamic.html
+mul_const_lowp.html
+mul_const_mediump.html
+mul_const_highp.html
+mul_uniform_lowp.html
+mul_uniform_mediump.html
+mul_uniform_highp.html
+mul_dynamic_lowp.html
+mul_dynamic_mediump.html
+mul_dynamic_highp.html
+div_const.html
+div_uniform.html
+div_dynamic.html
+matrixcompmult.html
+outerproduct.html
+transpose.html
+determinant.html
+inverse.html
+unary_addition.html
+negation.html
+pre_increment.html
+pre_decrement.html
+post_increment.html
+post_decrement.html
+add_assign.html
+sub_assign.html
+mul_assign.html
+div_assign.html \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_assign.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_assign.html
new file mode 100644
index 0000000000..bb70e4d681
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_assign.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [29, 30]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_const.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_const.html
new file mode 100644
index 0000000000..bf15cb29ab
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_const.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [0, 1]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_dynamic.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_dynamic.html
new file mode 100644
index 0000000000..3deeb287aa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_dynamic.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [2, 3]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_uniform.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_uniform.html
new file mode 100644
index 0000000000..bf459f6c6c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/add_uniform.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [1, 2]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/determinant.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/determinant.html
new file mode 100644
index 0000000000..5b885f8322
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/determinant.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [21, 22]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_assign.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_assign.html
new file mode 100644
index 0000000000..2d913df799
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_assign.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [32, 33]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_const.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_const.html
new file mode 100644
index 0000000000..a958d75036
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_const.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [15, 16]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_dynamic.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_dynamic.html
new file mode 100644
index 0000000000..623c9a9bc0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_dynamic.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [17, 18]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_uniform.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_uniform.html
new file mode 100644
index 0000000000..4c77847c95
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/div_uniform.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [16, 17]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/inverse.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/inverse.html
new file mode 100644
index 0000000000..c14a19e2c9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/inverse.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [22, 23]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/matrixcompmult.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/matrixcompmult.html
new file mode 100644
index 0000000000..eab68d362a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/matrixcompmult.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [18, 19]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_assign.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_assign.html
new file mode 100644
index 0000000000..771a1556b6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_assign.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [31, 32]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_const_highp.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_const_highp.html
new file mode 100644
index 0000000000..80ff18f77a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_const_highp.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [8, 9]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_const_lowp.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_const_lowp.html
new file mode 100644
index 0000000000..40559ebf7a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_const_lowp.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [6, 7]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_const_mediump.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_const_mediump.html
new file mode 100644
index 0000000000..21efaef930
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_const_mediump.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [7, 8]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_dynamic_highp.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_dynamic_highp.html
new file mode 100644
index 0000000000..e3b57badd9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_dynamic_highp.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [14, 15]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_dynamic_lowp.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_dynamic_lowp.html
new file mode 100644
index 0000000000..d1d3ce1068
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_dynamic_lowp.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [12, 13]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_dynamic_mediump.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_dynamic_mediump.html
new file mode 100644
index 0000000000..bf95faf774
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_dynamic_mediump.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [13, 14]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_uniform_highp.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_uniform_highp.html
new file mode 100644
index 0000000000..713d7d21ac
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_uniform_highp.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [11, 12]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_uniform_lowp.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_uniform_lowp.html
new file mode 100644
index 0000000000..8da434cd2b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_uniform_lowp.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [9, 10]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_uniform_mediump.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_uniform_mediump.html
new file mode 100644
index 0000000000..91f022cb45
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/mul_uniform_mediump.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [10, 11]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/negation.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/negation.html
new file mode 100644
index 0000000000..da0fdb831f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/negation.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [24, 25]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/outerproduct.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/outerproduct.html
new file mode 100644
index 0000000000..1e3a5bb56a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/outerproduct.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [19, 20]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/post_decrement.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/post_decrement.html
new file mode 100644
index 0000000000..8a5f7bd46f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/post_decrement.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [28, 29]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/post_increment.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/post_increment.html
new file mode 100644
index 0000000000..a379fdb882
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/post_increment.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [27, 28]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/pre_decrement.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/pre_decrement.html
new file mode 100644
index 0000000000..3921fb697f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/pre_decrement.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [26, 27]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/pre_increment.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/pre_increment.html
new file mode 100644
index 0000000000..ac06ee71b1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/pre_increment.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [25, 26]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/shadermatrix_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/shadermatrix_test_generator.py
new file mode 100644
index 0000000000..1cf1889c52
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/shadermatrix_test_generator.py
@@ -0,0 +1,121 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2019 The Khronos Group Inc.
+# Use of this source code is governed by an MIT-style license that can be
+# found in the LICENSE.txt file.
+
+"""
+ Generator for shadermatrix* tests.
+ This file needs to be run in its folder.
+"""
+
+import sys
+
+_DO_NOT_EDIT_WARNING = """<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+"""
+
+_HTML_TEMPLATE = """<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [%(start)s, %(end)s]);
+</script>
+</body>
+</html>
+"""
+
+_GROUPS = [
+ 'add_const',
+ 'add_uniform',
+ 'add_dynamic',
+ 'sub_const',
+ 'sub_uniform',
+ 'sub_dynamic',
+ 'mul_const_lowp',
+ 'mul_const_mediump',
+ 'mul_const_highp',
+ 'mul_uniform_lowp',
+ 'mul_uniform_mediump',
+ 'mul_uniform_highp',
+ 'mul_dynamic_lowp',
+ 'mul_dynamic_mediump',
+ 'mul_dynamic_highp',
+ 'div_const',
+ 'div_uniform',
+ 'div_dynamic',
+ 'matrixcompmult',
+ 'outerproduct',
+ 'transpose',
+ 'determinant',
+ 'inverse',
+ 'unary_addition',
+ 'negation',
+ 'pre_increment',
+ 'pre_decrement',
+ 'post_increment',
+ 'post_decrement',
+ 'add_assign',
+ 'sub_assign',
+ 'mul_assign',
+ 'div_assign',
+]
+
+def GenerateFilename(group):
+ """Generate test filename."""
+ filename = group
+ filename += ".html"
+ return filename
+
+def WriteTest(filename, start, end):
+ """Write one test."""
+ file = open(filename, "wb")
+ file.write(_DO_NOT_EDIT_WARNING)
+ file.write(_HTML_TEMPLATE % {
+ 'start': start,
+ 'end': end
+ })
+ file.close
+
+def GenerateTests():
+ """Generate all tests."""
+ filelist = []
+ for ii in range(len(_GROUPS)):
+ filename = GenerateFilename(_GROUPS[ii])
+ filelist.append(filename)
+ WriteTest(filename, ii, ii + 1)
+ return filelist
+
+def GenerateTestList(filelist):
+ file = open("00_test_list.txt", "wb")
+ file.write('\n'.join(filelist))
+ file.close
+
+def main(argv):
+ """This is the main function."""
+ filelist = GenerateTests()
+ GenerateTestList(filelist)
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_assign.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_assign.html
new file mode 100644
index 0000000000..79bf1fd344
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_assign.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [30, 31]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_const.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_const.html
new file mode 100644
index 0000000000..f574f6126b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_const.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [3, 4]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_dynamic.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_dynamic.html
new file mode 100644
index 0000000000..4408df4743
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_dynamic.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [5, 6]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_uniform.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_uniform.html
new file mode 100644
index 0000000000..5d7c293d0c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/sub_uniform.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [4, 5]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/transpose.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/transpose.html
new file mode 100644
index 0000000000..52465410fd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/transpose.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [20, 21]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/unary_addition.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/unary_addition.html
new file mode 100644
index 0000000000..1bcb526ebb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/unary_addition.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadermatrix_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Matrix Test</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderMatrixTest');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderMatrixTest.run(gl, [23, 24]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/00_test_list.txt
new file mode 100644
index 0000000000..1c197d6b8e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/00_test_list.txt
@@ -0,0 +1,37 @@
+unary_operator_00.html
+unary_operator_01.html
+unary_operator_02.html
+binary_operator_00.html
+binary_operator_01.html
+binary_operator_02.html
+binary_operator_03.html
+binary_operator_04.html
+binary_operator_05.html
+binary_operator_06.html
+binary_operator_07.html
+binary_operator_08.html
+binary_operator_09.html
+binary_operator_10.html
+binary_operator_11.html
+binary_operator_12.html
+binary_operator_13.html
+binary_operator_14.html
+binary_operator_15.html
+angle_and_trigonometry_00.html
+angle_and_trigonometry_01.html
+angle_and_trigonometry_02.html
+angle_and_trigonometry_03.html
+exponential.html
+common_functions_00.html
+common_functions_01.html
+common_functions_02.html
+common_functions_03.html
+common_functions_04.html
+common_functions_05.html
+common_functions_06.html
+geometric.html
+float_compare.html
+int_compare.html
+bool_compare.html
+selection.html
+sequence.html \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_00.html
new file mode 100644
index 0000000000..04d3c3c26e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_00.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [19, 20]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_01.html
new file mode 100644
index 0000000000..a342a007be
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_01.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [20, 21]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_02.html
new file mode 100644
index 0000000000..a7273c649a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_02.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [21, 22]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_03.html
new file mode 100644
index 0000000000..6ca3ef247f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/angle_and_trigonometry_03.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [22, 23]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_00.html
new file mode 100644
index 0000000000..35fb8043c3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_00.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [3, 4]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_01.html
new file mode 100644
index 0000000000..3740edea2c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_01.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [4, 5]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_02.html
new file mode 100644
index 0000000000..1834fec65a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_02.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [5, 6]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_03.html
new file mode 100644
index 0000000000..d4b3afca33
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_03.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [6, 7]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_04.html
new file mode 100644
index 0000000000..bcc0d964da
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_04.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [7, 8]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_05.html
new file mode 100644
index 0000000000..6f5a189327
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_05.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [8, 9]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_06.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_06.html
new file mode 100644
index 0000000000..f5f2c1d8a3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_06.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [9, 10]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_07.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_07.html
new file mode 100644
index 0000000000..eb5933dc1b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_07.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [10, 11]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_08.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_08.html
new file mode 100644
index 0000000000..4a5726c562
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_08.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [11, 12]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_09.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_09.html
new file mode 100644
index 0000000000..c64fd1d6c8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_09.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [12, 13]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_10.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_10.html
new file mode 100644
index 0000000000..16bc768646
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_10.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [13, 14]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_11.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_11.html
new file mode 100644
index 0000000000..98a66ffe9b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_11.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [14, 15]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_12.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_12.html
new file mode 100644
index 0000000000..c463b6ff30
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_12.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [15, 16]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_13.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_13.html
new file mode 100644
index 0000000000..8caa497062
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_13.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [16, 17]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_14.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_14.html
new file mode 100644
index 0000000000..245db50eef
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_14.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [17, 18]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_15.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_15.html
new file mode 100644
index 0000000000..d11b9aae53
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/binary_operator_15.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [18, 19]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/bool_compare.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/bool_compare.html
new file mode 100644
index 0000000000..d8dbfc65b8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/bool_compare.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [34, 35]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions_00.html
new file mode 100644
index 0000000000..f814bad597
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions_00.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [24, 25]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions_01.html
new file mode 100644
index 0000000000..1c2ce0f407
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions_01.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [25, 26]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions_02.html
new file mode 100644
index 0000000000..2b81002870
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions_02.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [26, 27]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions_03.html
new file mode 100644
index 0000000000..8818deae4e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions_03.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [27, 28]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions_04.html
new file mode 100644
index 0000000000..bbd4bbc68e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions_04.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [28, 29]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions_05.html
new file mode 100644
index 0000000000..b9ea2cc1d6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions_05.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [29, 30]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions_06.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions_06.html
new file mode 100644
index 0000000000..e818da471a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/common_functions_06.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [30, 31]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/exponential.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/exponential.html
new file mode 100644
index 0000000000..849f44f9c8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/exponential.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [23, 24]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/float_compare.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/float_compare.html
new file mode 100644
index 0000000000..3510f51f9a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/float_compare.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [32, 33]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/geometric.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/geometric.html
new file mode 100644
index 0000000000..20ba764dec
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/geometric.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [31, 32]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/int_compare.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/int_compare.html
new file mode 100644
index 0000000000..50a4222e86
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/int_compare.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [33, 34]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/selection.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/selection.html
new file mode 100644
index 0000000000..dfea42d3a4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/selection.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [35, 36]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/sequence.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/sequence.html
new file mode 100644
index 0000000000..e1b61ed4a4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/sequence.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [36, 37]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/shaderoperator_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/shaderoperator_test_generator.py
new file mode 100644
index 0000000000..cdf21b0371
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/shaderoperator_test_generator.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2019 The Khronos Group Inc.
+# Use of this source code is governed by an MIT-style license that can be
+# found in the LICENSE.txt file.
+
+"""
+ Generator for shaderoperator* tests.
+ This file needs to be run in its folder.
+"""
+
+import sys
+
+_DO_NOT_EDIT_WARNING = """<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+"""
+
+_HTML_TEMPLATE = """<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [%(start)s, %(end)s]);
+</script>
+</body>
+</html>
+"""
+
+_GROUPS = [
+ 'unary_operator_00',
+ 'unary_operator_01',
+ 'unary_operator_02',
+ 'binary_operator_00',
+ 'binary_operator_01',
+ 'binary_operator_02',
+ 'binary_operator_03',
+ 'binary_operator_04',
+ 'binary_operator_05',
+ 'binary_operator_06',
+ 'binary_operator_07',
+ 'binary_operator_08',
+ 'binary_operator_09',
+ 'binary_operator_10',
+ 'binary_operator_11',
+ 'binary_operator_12',
+ 'binary_operator_13',
+ 'binary_operator_14',
+ 'binary_operator_15',
+ 'angle_and_trigonometry_00',
+ 'angle_and_trigonometry_01',
+ 'angle_and_trigonometry_02',
+ 'angle_and_trigonometry_03',
+ 'exponential',
+ 'common_functions_00',
+ 'common_functions_01',
+ 'common_functions_02',
+ 'common_functions_03',
+ 'common_functions_04',
+ 'common_functions_05',
+ 'common_functions_06',
+ 'geometric',
+ 'float_compare',
+ 'int_compare',
+ 'bool_compare',
+ 'selection',
+ 'sequence',
+]
+
+def GenerateFilename(group):
+ """Generate test filename."""
+ filename = group
+ filename += ".html"
+ return filename
+
+def WriteTest(filename, start, end):
+ """Write one test."""
+ file = open(filename, "wb")
+ file.write(_DO_NOT_EDIT_WARNING)
+ file.write(_HTML_TEMPLATE % {
+ 'start': start,
+ 'end': end
+ })
+ file.close
+
+def GenerateTests():
+ """Generate all tests."""
+ filelist = []
+ for ii in range(len(_GROUPS)):
+ filename = GenerateFilename(_GROUPS[ii])
+ filelist.append(filename)
+ WriteTest(filename, ii, ii + 1)
+ return filelist
+
+def GenerateTestList(filelist):
+ file = open("00_test_list.txt", "wb")
+ file.write('\n'.join(filelist))
+ file.close
+
+def main(argv):
+ """This is the main function."""
+ filelist = GenerateTests()
+ GenerateTestList(filelist)
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/unary_operator_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/unary_operator_00.html
new file mode 100644
index 0000000000..8e80bcd623
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/unary_operator_00.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [0, 1]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/unary_operator_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/unary_operator_01.html
new file mode 100644
index 0000000000..3dfee32749
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/unary_operator_01.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [1, 2]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/unary_operator_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/unary_operator_02.html
new file mode 100644
index 0000000000..1b8c5e5e03
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/unary_operator_02.html
@@ -0,0 +1,33 @@
+<!--
+
+This file is auto-generated from shaderoperator_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Operator Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderOperatorTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderOperatorTests.run(gl, [2, 3]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderpackingfunction.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderpackingfunction.html
new file mode 100644
index 0000000000..a07e9b1d81
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderpackingfunction.html
@@ -0,0 +1,26 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Packing Function Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>
+goog.require('functional.gles3.es3fShaderPackingFunctionTests');
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderPackingFunctionTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderprecision_float.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderprecision_float.html
new file mode 100644
index 0000000000..ef78733716
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderprecision_float.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderPrecisionTests.run(gl, [0, 1]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderprecision_int.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderprecision_int.html
new file mode 100644
index 0000000000..ec659017cf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderprecision_int.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderPrecisionTests.run(gl, [1, 2]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderprecision_uint.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderprecision_uint.html
new file mode 100644
index 0000000000..3097ed7b19
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderprecision_uint.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Precision Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderPrecisionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderPrecisionTests.run(gl, [2, 3]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderstatequery.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderstatequery.html
new file mode 100644
index 0000000000..325bb0bf25
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderstatequery.html
@@ -0,0 +1,31 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader State Query Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderStateQueryTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+ try {
+ functional.gles3.es3fShaderStateQueryTests.run(gl);
+ }
+ catch(err)
+ {
+ bufferedLogToConsole(err);
+ }
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderstruct.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderstruct.html
new file mode 100644
index 0000000000..e510ceb2d5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderstruct.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Struct Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderStructTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderStructTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderswitch.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderswitch.html
new file mode 100644
index 0000000000..714f9044d4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderswitch.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Switch Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderSwitchTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderSwitchTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/00_test_list.txt
new file mode 100644
index 0000000000..13a12534db
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/00_test_list.txt
@@ -0,0 +1,15 @@
+texture.html
+textureoffset.html
+textureproj.html
+textureprojoffset.html
+texturelod.html
+texturelodoffset.html
+textureprojlod.html
+textureprojlodoffset.html
+texturegrad.html
+texturegradoffset.html
+textureprojgrad.html
+textureprojgradoffset.html
+texelfetch.html
+texelfetchoffset.html
+texturesize.html \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/shadertexturefunction_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/shadertexturefunction_test_generator.py
new file mode 100644
index 0000000000..3b63359d7f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/shadertexturefunction_test_generator.py
@@ -0,0 +1,103 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2019 The Khronos Group Inc.
+# Use of this source code is governed by an MIT-style license that can be
+# found in the LICENSE.txt file.
+
+"""
+ Generator for shadertexturefunction* tests.
+ This file needs to be run in its folder.
+"""
+
+import sys
+
+_DO_NOT_EDIT_WARNING = """<!--
+
+This file is auto-generated from shadertexturefunction_test_generator.py
+DO NOT EDIT!
+
+-->
+
+"""
+
+_HTML_TEMPLATE = """<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Texture Function Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderTextureFunctionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderTextureFunctionTests.run(gl, [%(start)s, %(end)s]);
+</script>
+</body>
+</html>
+"""
+
+_GROUPS = [
+ 'texture',
+ 'textureoffset',
+ 'textureproj',
+ 'textureprojoffset',
+ 'texturelod',
+ 'texturelodoffset',
+ 'textureprojlod',
+ 'textureprojlodoffset',
+ 'texturegrad',
+ 'texturegradoffset',
+ 'textureprojgrad',
+ 'textureprojgradoffset',
+ 'texelfetch',
+ 'texelfetchoffset',
+ 'texturesize'
+]
+
+def GenerateFilename(group):
+ """Generate test filename."""
+ filename = group
+ filename += ".html"
+ return filename
+
+def WriteTest(filename, start, end):
+ """Write one test."""
+ file = open(filename, "wb")
+ file.write(_DO_NOT_EDIT_WARNING)
+ file.write(_HTML_TEMPLATE % {
+ 'start': start,
+ 'end': end
+ })
+ file.close
+
+def GenerateTests():
+ """Generate all tests."""
+ filelist = []
+ for ii in range(len(_GROUPS)):
+ filename = GenerateFilename(_GROUPS[ii])
+ filelist.append(filename)
+ WriteTest(filename, ii, ii + 1)
+ return filelist
+
+def GenerateTestList(filelist):
+ file = open("00_test_list.txt", "wb")
+ file.write('\n'.join(filelist))
+ file.close
+
+def main(argv):
+ """This is the main function."""
+ filelist = GenerateTests()
+ GenerateTestList(filelist)
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texelfetch.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texelfetch.html
new file mode 100644
index 0000000000..6787012d51
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texelfetch.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadertexturefunction_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Texture Function Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderTextureFunctionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderTextureFunctionTests.run(gl, [12, 13]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texelfetchoffset.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texelfetchoffset.html
new file mode 100644
index 0000000000..1d2e0de506
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texelfetchoffset.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadertexturefunction_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Texture Function Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderTextureFunctionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderTextureFunctionTests.run(gl, [13, 14]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texture.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texture.html
new file mode 100644
index 0000000000..f5668b4d9d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texture.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadertexturefunction_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Texture Function Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderTextureFunctionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderTextureFunctionTests.run(gl, [0, 1]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturegrad.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturegrad.html
new file mode 100644
index 0000000000..7ef3d92104
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturegrad.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadertexturefunction_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Texture Function Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderTextureFunctionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderTextureFunctionTests.run(gl, [8, 9]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturegradoffset.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturegradoffset.html
new file mode 100644
index 0000000000..c016084bf9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturegradoffset.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadertexturefunction_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Texture Function Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderTextureFunctionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderTextureFunctionTests.run(gl, [9, 10]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturelod.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturelod.html
new file mode 100644
index 0000000000..928bade495
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturelod.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadertexturefunction_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Texture Function Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderTextureFunctionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderTextureFunctionTests.run(gl, [4, 5]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturelodoffset.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturelodoffset.html
new file mode 100644
index 0000000000..23792c3d83
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturelodoffset.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadertexturefunction_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Texture Function Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderTextureFunctionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderTextureFunctionTests.run(gl, [5, 6]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureoffset.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureoffset.html
new file mode 100644
index 0000000000..61b9c6affa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureoffset.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadertexturefunction_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Texture Function Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderTextureFunctionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderTextureFunctionTests.run(gl, [1, 2]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureproj.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureproj.html
new file mode 100644
index 0000000000..676c7cde0c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureproj.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadertexturefunction_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Texture Function Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderTextureFunctionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderTextureFunctionTests.run(gl, [2, 3]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojgrad.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojgrad.html
new file mode 100644
index 0000000000..c68978abbb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojgrad.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadertexturefunction_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Texture Function Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderTextureFunctionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderTextureFunctionTests.run(gl, [10, 11]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojgradoffset.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojgradoffset.html
new file mode 100644
index 0000000000..d2165e4f87
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojgradoffset.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadertexturefunction_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Texture Function Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderTextureFunctionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderTextureFunctionTests.run(gl, [11, 12]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojlod.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojlod.html
new file mode 100644
index 0000000000..fe0fc76b2a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojlod.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadertexturefunction_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Texture Function Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderTextureFunctionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderTextureFunctionTests.run(gl, [6, 7]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojlodoffset.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojlodoffset.html
new file mode 100644
index 0000000000..a8d9760ab8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojlodoffset.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadertexturefunction_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Texture Function Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderTextureFunctionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderTextureFunctionTests.run(gl, [7, 8]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojoffset.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojoffset.html
new file mode 100644
index 0000000000..3b383a72da
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/textureprojoffset.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadertexturefunction_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Texture Function Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderTextureFunctionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderTextureFunctionTests.run(gl, [3, 4]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturesize.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturesize.html
new file mode 100644
index 0000000000..245a285b51
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/texturesize.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from shadertexturefunction_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Shader Texture Function Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fShaderTextureFunctionTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fShaderTextureFunctionTests.run(gl, [14, 15]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/stringquery.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/stringquery.html
new file mode 100644
index 0000000000..79045db515
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/stringquery.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL String Query Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fStringQueryTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fStringQueryTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/sync.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/sync.html
new file mode 100644
index 0000000000..7d4c09f053
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/sync.html
@@ -0,0 +1,32 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Fence Sync Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fSyncTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+
+ try {
+ functional.gles3.es3fSyncTests.run(gl);
+ }
+ catch(err)
+ {
+ bufferedLogToConsole(err);
+ }
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/00_test_list.txt
new file mode 100644
index 0000000000..b446b8d6da
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/00_test_list.txt
@@ -0,0 +1,116 @@
+2d_formats_00.html
+2d_formats_01.html
+2d_formats_02.html
+2d_formats_03.html
+2d_formats_04.html
+2d_formats_05.html
+2d_formats_06.html
+2d_formats_07.html
+2d_formats_08.html
+2d_formats_09.html
+2d_sizes_00.html
+2d_sizes_01.html
+2d_sizes_02.html
+2d_sizes_03.html
+2d_sizes_04.html
+2d_sizes_05.html
+2d_combinations_00.html
+2d_combinations_01.html
+2d_combinations_02.html
+2d_combinations_03.html
+2d_combinations_04.html
+2d_combinations_05.html
+cube_formats_00.html
+cube_formats_01.html
+cube_formats_02.html
+cube_formats_03.html
+cube_formats_04.html
+cube_formats_05.html
+cube_formats_06.html
+cube_formats_07.html
+cube_formats_08.html
+cube_formats_09.html
+cube_sizes_00.html
+cube_sizes_01.html
+cube_sizes_02.html
+cube_sizes_03.html
+cube_sizes_04.html
+cube_combinations_00.html
+cube_combinations_01.html
+cube_combinations_02.html
+cube_combinations_03.html
+cube_combinations_04.html
+cube_combinations_05.html
+cube_no_edges_visible.html
+2d_array_formats_00.html
+2d_array_formats_01.html
+2d_array_formats_02.html
+2d_array_formats_03.html
+2d_array_formats_04.html
+2d_array_formats_05.html
+2d_array_formats_06.html
+2d_array_formats_07.html
+2d_array_formats_08.html
+2d_array_formats_09.html
+2d_array_sizes_00.html
+2d_array_sizes_01.html
+2d_array_sizes_02.html
+2d_array_sizes_03.html
+2d_array_sizes_04.html
+2d_array_combinations_00.html
+2d_array_combinations_01.html
+2d_array_combinations_02.html
+2d_array_combinations_03.html
+2d_array_combinations_04.html
+2d_array_combinations_05.html
+3d_formats_00.html
+3d_formats_01.html
+3d_formats_02.html
+3d_formats_03.html
+3d_formats_04.html
+3d_formats_05.html
+3d_formats_06.html
+3d_formats_07.html
+3d_formats_08.html
+3d_formats_09.html
+3d_sizes_00.html
+3d_sizes_01.html
+3d_sizes_02.html
+3d_sizes_03.html
+3d_sizes_04.html
+3d_combinations_00.html
+3d_combinations_01.html
+3d_combinations_02.html
+3d_combinations_03.html
+3d_combinations_04.html
+3d_combinations_05.html
+3d_combinations_06.html
+3d_combinations_07.html
+3d_combinations_08.html
+3d_combinations_09.html
+3d_combinations_10.html
+3d_combinations_11.html
+3d_combinations_12.html
+3d_combinations_13.html
+3d_combinations_14.html
+3d_combinations_15.html
+3d_combinations_16.html
+3d_combinations_17.html
+3d_combinations_18.html
+3d_combinations_19.html
+3d_combinations_20.html
+3d_combinations_21.html
+3d_combinations_22.html
+3d_combinations_23.html
+3d_combinations_24.html
+3d_combinations_25.html
+3d_combinations_26.html
+3d_combinations_27.html
+3d_combinations_28.html
+3d_combinations_29.html
+3d_combinations_30.html
+3d_combinations_31.html
+3d_combinations_32.html
+3d_combinations_33.html
+3d_combinations_34.html
+3d_combinations_35.html \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_00.html
new file mode 100644
index 0000000000..629813355b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [59, 60]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_01.html
new file mode 100644
index 0000000000..1fd04cdb6e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [60, 61]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_02.html
new file mode 100644
index 0000000000..63f3826d5e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [61, 62]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_03.html
new file mode 100644
index 0000000000..efe23d2a7d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [62, 63]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_04.html
new file mode 100644
index 0000000000..5fd151fb17
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_04.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [63, 64]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_05.html
new file mode 100644
index 0000000000..d6e8d71d18
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_combinations_05.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [64, 65]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_00.html
new file mode 100644
index 0000000000..7c822b2f57
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [44, 45]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_01.html
new file mode 100644
index 0000000000..adc218a46d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [45, 46]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_02.html
new file mode 100644
index 0000000000..afb3b67375
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [46, 47]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_03.html
new file mode 100644
index 0000000000..03acb11a19
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [47, 48]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_04.html
new file mode 100644
index 0000000000..b16f7e9ed2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_04.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [48, 49]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_05.html
new file mode 100644
index 0000000000..cafc3bd48d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_05.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [49, 50]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_06.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_06.html
new file mode 100644
index 0000000000..ce5e168b98
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_06.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [50, 51]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_07.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_07.html
new file mode 100644
index 0000000000..d4b59de12a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_07.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [51, 52]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_08.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_08.html
new file mode 100644
index 0000000000..121f0f74e8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_08.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [52, 53]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_09.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_09.html
new file mode 100644
index 0000000000..f306f70d80
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_formats_09.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [53, 54]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_00.html
new file mode 100644
index 0000000000..ce7c08c57b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [54, 55]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_01.html
new file mode 100644
index 0000000000..c83ad21fc3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [55, 56]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_02.html
new file mode 100644
index 0000000000..5c930d71c0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [56, 57]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_03.html
new file mode 100644
index 0000000000..e131614e10
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [57, 58]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_04.html
new file mode 100644
index 0000000000..651e97d04b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_array_sizes_04.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [58, 59]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_00.html
new file mode 100644
index 0000000000..b594c81df2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [16, 17]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_01.html
new file mode 100644
index 0000000000..f875ddc124
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [17, 18]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_02.html
new file mode 100644
index 0000000000..51150be084
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [18, 19]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_03.html
new file mode 100644
index 0000000000..e22d0d44d9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [19, 20]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_04.html
new file mode 100644
index 0000000000..e94ffc04f6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_04.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [20, 21]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_05.html
new file mode 100644
index 0000000000..429ae6e3e1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_combinations_05.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [21, 22]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_00.html
new file mode 100644
index 0000000000..4b58c6f787
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [0, 1]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_01.html
new file mode 100644
index 0000000000..ef0d419d3a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [1, 2]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_02.html
new file mode 100644
index 0000000000..f670313845
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [2, 3]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_03.html
new file mode 100644
index 0000000000..fc10d2db75
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [3, 4]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_04.html
new file mode 100644
index 0000000000..95227c1dd4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_04.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [4, 5]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_05.html
new file mode 100644
index 0000000000..0397fbf6b2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_05.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [5, 6]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_06.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_06.html
new file mode 100644
index 0000000000..7eb40d1433
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_06.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [6, 7]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_07.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_07.html
new file mode 100644
index 0000000000..a236ac7c5c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_07.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [7, 8]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_08.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_08.html
new file mode 100644
index 0000000000..8a29fe723c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_08.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [8, 9]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_09.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_09.html
new file mode 100644
index 0000000000..4ae8227647
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_formats_09.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [9, 10]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_00.html
new file mode 100644
index 0000000000..8d2e2d736a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [10, 11]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_01.html
new file mode 100644
index 0000000000..87bc3f9a6a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [11, 12]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_02.html
new file mode 100644
index 0000000000..b4a9c90102
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [12, 13]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_03.html
new file mode 100644
index 0000000000..3831e58a2e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [13, 14]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_04.html
new file mode 100644
index 0000000000..77ce5f6b12
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_04.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [14, 15]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_05.html
new file mode 100644
index 0000000000..64f1b65a2f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/2d_sizes_05.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [15, 16]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_00.html
new file mode 100644
index 0000000000..e833feff80
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [80, 81]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_01.html
new file mode 100644
index 0000000000..141193d5ec
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [81, 82]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_02.html
new file mode 100644
index 0000000000..4913ab35eb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [82, 83]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_03.html
new file mode 100644
index 0000000000..b60af0ea21
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [83, 84]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_04.html
new file mode 100644
index 0000000000..5e4892249a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_04.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [84, 85]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_05.html
new file mode 100644
index 0000000000..d87584684f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_05.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [85, 86]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_06.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_06.html
new file mode 100644
index 0000000000..b1c2c808cb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_06.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [86, 87]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_07.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_07.html
new file mode 100644
index 0000000000..79a2be951b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_07.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [87, 88]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_08.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_08.html
new file mode 100644
index 0000000000..c32a25ab79
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_08.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [88, 89]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_09.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_09.html
new file mode 100644
index 0000000000..aa4c3c50d0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_09.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [89, 90]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_10.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_10.html
new file mode 100644
index 0000000000..3872150b75
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_10.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [90, 91]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_11.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_11.html
new file mode 100644
index 0000000000..30763a2ea7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_11.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [91, 92]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_12.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_12.html
new file mode 100644
index 0000000000..f252f529e4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_12.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [92, 93]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_13.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_13.html
new file mode 100644
index 0000000000..6c3e9b135e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_13.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [93, 94]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_14.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_14.html
new file mode 100644
index 0000000000..b4cb0d7573
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_14.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [94, 95]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_15.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_15.html
new file mode 100644
index 0000000000..2c4590dd41
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_15.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [95, 96]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_16.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_16.html
new file mode 100644
index 0000000000..c0838fc3f6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_16.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [96, 97]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_17.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_17.html
new file mode 100644
index 0000000000..48e924daae
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_17.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [97, 98]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_18.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_18.html
new file mode 100644
index 0000000000..9cd79ceb5b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_18.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [98, 99]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_19.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_19.html
new file mode 100644
index 0000000000..e224822c62
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_19.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [99, 100]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_20.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_20.html
new file mode 100644
index 0000000000..2c959a811a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_20.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [100, 101]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_21.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_21.html
new file mode 100644
index 0000000000..78c6f0a3d6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_21.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [101, 102]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_22.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_22.html
new file mode 100644
index 0000000000..9980e3a3a9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_22.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [102, 103]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_23.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_23.html
new file mode 100644
index 0000000000..08c647aff0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_23.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [103, 104]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_24.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_24.html
new file mode 100644
index 0000000000..fe81630d42
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_24.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [104, 105]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_25.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_25.html
new file mode 100644
index 0000000000..aa0cff3737
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_25.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [105, 106]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_26.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_26.html
new file mode 100644
index 0000000000..a3423dcbc4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_26.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [106, 107]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_27.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_27.html
new file mode 100644
index 0000000000..071c36672e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_27.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [107, 108]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_28.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_28.html
new file mode 100644
index 0000000000..07d17edcf4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_28.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [108, 109]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_29.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_29.html
new file mode 100644
index 0000000000..cd7f63e14c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_29.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [109, 110]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_30.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_30.html
new file mode 100644
index 0000000000..56988bd046
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_30.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [110, 111]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_31.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_31.html
new file mode 100644
index 0000000000..286ace3917
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_31.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [111, 112]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_32.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_32.html
new file mode 100644
index 0000000000..1ba0ae432b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_32.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [112, 113]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_33.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_33.html
new file mode 100644
index 0000000000..19cb29fb4a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_33.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [113, 114]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_34.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_34.html
new file mode 100644
index 0000000000..5afb122414
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_34.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [114, 115]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_35.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_35.html
new file mode 100644
index 0000000000..1411f68e0f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_combinations_35.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [115, 116]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_00.html
new file mode 100644
index 0000000000..1b41ca237d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [65, 66]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_01.html
new file mode 100644
index 0000000000..c8059f7e39
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [66, 67]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_02.html
new file mode 100644
index 0000000000..6529aec830
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [67, 68]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_03.html
new file mode 100644
index 0000000000..249860cee7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [68, 69]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_04.html
new file mode 100644
index 0000000000..0bb0aab1ac
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_04.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [69, 70]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_05.html
new file mode 100644
index 0000000000..dba6d0f666
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_05.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [70, 71]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_06.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_06.html
new file mode 100644
index 0000000000..df06c3c1e4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_06.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [71, 72]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_07.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_07.html
new file mode 100644
index 0000000000..827ceba0c8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_07.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [72, 73]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_08.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_08.html
new file mode 100644
index 0000000000..695d317ecb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_08.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [73, 74]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_09.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_09.html
new file mode 100644
index 0000000000..72e7b41419
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_formats_09.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [74, 75]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_00.html
new file mode 100644
index 0000000000..7ff8170258
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [75, 76]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_01.html
new file mode 100644
index 0000000000..6263ae9413
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [76, 77]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_02.html
new file mode 100644
index 0000000000..17e7a30c55
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [77, 78]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_03.html
new file mode 100644
index 0000000000..c888db7145
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [78, 79]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_04.html
new file mode 100644
index 0000000000..d1f4a5f869
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/3d_sizes_04.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [79, 80]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_00.html
new file mode 100644
index 0000000000..21e59eea02
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [37, 38]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_01.html
new file mode 100644
index 0000000000..9833f0f84e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [38, 39]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_02.html
new file mode 100644
index 0000000000..8fc0017864
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [39, 40]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_03.html
new file mode 100644
index 0000000000..f80bc00d80
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [40, 41]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_04.html
new file mode 100644
index 0000000000..2d69ac867b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_04.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [41, 42]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_05.html
new file mode 100644
index 0000000000..ea6bbb755c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_combinations_05.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [42, 43]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_00.html
new file mode 100644
index 0000000000..e228874f75
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [22, 23]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_01.html
new file mode 100644
index 0000000000..f9c966e680
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [23, 24]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_02.html
new file mode 100644
index 0000000000..bf9c256bed
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [24, 25]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_03.html
new file mode 100644
index 0000000000..d3f78a46cd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [25, 26]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_04.html
new file mode 100644
index 0000000000..eb07dea652
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_04.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [26, 27]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_05.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_05.html
new file mode 100644
index 0000000000..d7ccb2c171
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_05.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [27, 28]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_06.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_06.html
new file mode 100644
index 0000000000..1496707baa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_06.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [28, 29]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_07.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_07.html
new file mode 100644
index 0000000000..2683e71ea6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_07.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [29, 30]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_08.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_08.html
new file mode 100644
index 0000000000..d69dcfae64
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_08.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [30, 31]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_09.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_09.html
new file mode 100644
index 0000000000..f34e51e8f4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_formats_09.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [31, 32]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_no_edges_visible.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_no_edges_visible.html
new file mode 100644
index 0000000000..531df3bb98
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_no_edges_visible.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [43, 44]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_00.html
new file mode 100644
index 0000000000..4e4fe4dfa4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [32, 33]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_01.html
new file mode 100644
index 0000000000..a4db3fc04c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [33, 34]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_02.html
new file mode 100644
index 0000000000..cf7ac7644d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [34, 35]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_03.html
new file mode 100644
index 0000000000..6b8d94c51f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [35, 36]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_04.html
new file mode 100644
index 0000000000..b1260c751f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/cube_sizes_04.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [36, 37]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/texturefiltering_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/texturefiltering_test_generator.py
new file mode 100644
index 0000000000..0b6064c8ca
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/texturefiltering_test_generator.py
@@ -0,0 +1,138 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2019 The Khronos Group Inc.
+# Use of this source code is governed by an MIT-style license that can be
+# found in the LICENSE.txt file.
+
+"""
+ Generator for texturefilter* tests.
+ This file needs to be run in its folder.
+"""
+
+import sys
+
+_DO_NOT_EDIT_WARNING = """<!--
+
+This file is auto-generated from texturefiltering_test_generator.py
+DO NOT EDIT!
+
+-->
+
+"""
+
+_HTML_TEMPLATE = """<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Filtering Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFilteringTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFilteringTests.run(gl, [%(start)s, %(end)s]);
+</script>
+</body>
+</html>
+"""
+
+_FILTERABLE_FORMAT_COUNT = 10
+_SIZE_2D_COUNT = 6
+_SIZE_CUBE_COUNT = 5
+_SIZE_2D_ARRAY_COUNT = 5
+_SIZE_3D_COUNT = 5
+_MIN_FILTER_MODE_COUNT = 6
+_MAG_FILTER_MODE_COUNT = 2
+_WRAP_MODE_COUNT = 3
+
+_GROUPS = [
+ '2d_formats',
+ '2d_sizes',
+ '2d_combinations',
+ 'cube_formats',
+ 'cube_sizes',
+ 'cube_combinations',
+ 'cube_no_edges_visible',
+ '2d_array_formats',
+ '2d_array_sizes',
+ '2d_array_combinations',
+ '3d_formats',
+ '3d_sizes',
+ '3d_combinations'
+]
+
+_GROUP_TEST_COUNTS = [
+ _FILTERABLE_FORMAT_COUNT, # 2d_formats
+ _SIZE_2D_COUNT, # 2d_sizes
+ _MIN_FILTER_MODE_COUNT, # 2d_combinations
+ _FILTERABLE_FORMAT_COUNT, # cube_formats
+ _SIZE_CUBE_COUNT, # cube_sizes
+ _MIN_FILTER_MODE_COUNT, # cube_combinations
+ 1, # cube_no_edges_visible
+ _FILTERABLE_FORMAT_COUNT, # 2d_array_formats
+ _SIZE_2D_ARRAY_COUNT, # 2d_array_sizes
+ _MIN_FILTER_MODE_COUNT, # 2d_array_combinations
+ _FILTERABLE_FORMAT_COUNT, # 3d_formats
+ _SIZE_3D_COUNT, # 3d_sizes,
+ _MIN_FILTER_MODE_COUNT * _MAG_FILTER_MODE_COUNT * _WRAP_MODE_COUNT, # 3d_combinations
+]
+
+def GenerateFilename(group, count, index):
+ """Generate test filename."""
+ assert index >= 0 and index < count
+ filename = group
+ if count > 1:
+ index_str = str(index)
+ if index < 10:
+ index_str = "0" + index_str
+ filename += "_" + index_str
+ filename += ".html"
+ return filename
+
+def WriteTest(filename, start, end):
+ """Write one test."""
+ file = open(filename, "wb")
+ file.write(_DO_NOT_EDIT_WARNING)
+ file.write(_HTML_TEMPLATE % {
+ 'start': start,
+ 'end': end
+ })
+ file.close
+
+def GenerateTests():
+ """Generate all tests."""
+ assert len(_GROUPS) == len(_GROUP_TEST_COUNTS)
+ test_index = 0
+ filelist = []
+ for ii in range(len(_GROUPS)):
+ group = _GROUPS[ii]
+ count = _GROUP_TEST_COUNTS[ii]
+ for index in range(count):
+ filename = GenerateFilename(group, count, index)
+ filelist.append(filename)
+ WriteTest(filename, test_index, test_index + 1)
+ test_index += 1
+ return filelist
+
+def GenerateTestList(filelist):
+ file = open("00_test_list.txt", "wb")
+ file.write('\n'.join(filelist))
+ file.close
+
+def main(argv):
+ """This is the main function."""
+ filelist = GenerateTests()
+ GenerateTestList(filelist)
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/00_test_list.txt
new file mode 100644
index 0000000000..cbd63eb92d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/00_test_list.txt
@@ -0,0 +1,38 @@
+unsized_2d.html
+unsized_2d_array.html
+unsized_3d.html
+sized_color_2d_pot_00.html
+sized_color_2d_pot_01.html
+sized_color_2d_pot_02.html
+sized_color_2d_pot_03.html
+sized_color_2d_npot_00.html
+sized_color_2d_npot_01.html
+sized_color_2d_npot_02.html
+sized_color_2d_npot_03.html
+sized_color_cube_pot_00.html
+sized_color_cube_pot_01.html
+sized_color_cube_pot_02.html
+sized_color_cube_pot_03.html
+sized_color_cube_npot_00.html
+sized_color_cube_npot_01.html
+sized_color_cube_npot_02.html
+sized_color_cube_npot_03.html
+sized_color_2d_array_pot_00.html
+sized_color_2d_array_pot_01.html
+sized_color_2d_array_pot_02.html
+sized_color_2d_array_pot_03.html
+sized_color_2d_array_npot_00.html
+sized_color_2d_array_npot_01.html
+sized_color_2d_array_npot_02.html
+sized_color_2d_array_npot_03.html
+sized_color_3d_pot_00.html
+sized_color_3d_pot_01.html
+sized_color_3d_pot_02.html
+sized_color_3d_pot_03.html
+sized_color_3d_npot_00.html
+sized_color_3d_npot_01.html
+sized_color_3d_npot_02.html
+sized_color_3d_npot_03.html
+sized_depth_stencil.html
+compressed_2d.html
+compressed_cube.html \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/compressed_2d.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/compressed_2d.html
new file mode 100644
index 0000000000..8f104f0ffc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/compressed_2d.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [36, 37]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/compressed_cube.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/compressed_cube.html
new file mode 100644
index 0000000000..39e7f2055e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/compressed_cube.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [37, 38]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_00.html
new file mode 100644
index 0000000000..c0867d87a1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [23, 24]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_01.html
new file mode 100644
index 0000000000..8f143eaf74
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [24, 25]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_02.html
new file mode 100644
index 0000000000..92a8b2c98e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [25, 26]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_03.html
new file mode 100644
index 0000000000..55fea6907d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_npot_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [26, 27]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_00.html
new file mode 100644
index 0000000000..975fb089b9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [19, 20]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_01.html
new file mode 100644
index 0000000000..11267669c1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [20, 21]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_02.html
new file mode 100644
index 0000000000..26190a4f79
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [21, 22]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_03.html
new file mode 100644
index 0000000000..6d42808253
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_array_pot_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [22, 23]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_00.html
new file mode 100644
index 0000000000..c0cea16d87
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [7, 8]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_01.html
new file mode 100644
index 0000000000..ca38325a3c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [8, 9]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_02.html
new file mode 100644
index 0000000000..04c3e0fbcf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [9, 10]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_03.html
new file mode 100644
index 0000000000..e63de3ae2f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_npot_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [10, 11]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_00.html
new file mode 100644
index 0000000000..d880ac7196
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [3, 4]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_01.html
new file mode 100644
index 0000000000..e65f1f851e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [4, 5]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_02.html
new file mode 100644
index 0000000000..64d4715d2f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [5, 6]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_03.html
new file mode 100644
index 0000000000..67140d7f79
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_2d_pot_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [6, 7]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_00.html
new file mode 100644
index 0000000000..4b1eed3a10
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [31, 32]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_01.html
new file mode 100644
index 0000000000..9adf66b652
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [32, 33]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_02.html
new file mode 100644
index 0000000000..6f6dd722e3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [33, 34]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_03.html
new file mode 100644
index 0000000000..8d2f6ed044
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_npot_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [34, 35]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_00.html
new file mode 100644
index 0000000000..c1d3dedd38
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [27, 28]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_01.html
new file mode 100644
index 0000000000..e33bb5ea91
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [28, 29]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_02.html
new file mode 100644
index 0000000000..f28f2589dd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [29, 30]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_03.html
new file mode 100644
index 0000000000..a6028c9290
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_3d_pot_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [30, 31]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_00.html
new file mode 100644
index 0000000000..1e6403f3f4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [15, 16]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_01.html
new file mode 100644
index 0000000000..9b79dd1932
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [16, 17]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_02.html
new file mode 100644
index 0000000000..d3bfde6336
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [17, 18]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_03.html
new file mode 100644
index 0000000000..7a9f7b3618
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_npot_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [18, 19]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_00.html
new file mode 100644
index 0000000000..9f88f7e572
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [11, 12]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_01.html
new file mode 100644
index 0000000000..6f24c6d8eb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [12, 13]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_02.html
new file mode 100644
index 0000000000..3ce93d65a6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [13, 14]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_03.html
new file mode 100644
index 0000000000..fcbf8d6493
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_color_cube_pot_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [14, 15]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_depth_stencil.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_depth_stencil.html
new file mode 100644
index 0000000000..bca1fbfbc9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/sized_depth_stencil.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [35, 36]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/textureformat_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/textureformat_test_generator.py
new file mode 100644
index 0000000000..ba20f04899
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/textureformat_test_generator.py
@@ -0,0 +1,126 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2019 The Khronos Group Inc.
+# Use of this source code is governed by an MIT-style license that can be
+# found in the LICENSE.txt file.
+
+"""
+ Generator for textureformat* tests.
+ This file needs to be run in its folder.
+"""
+
+import sys
+
+_DO_NOT_EDIT_WARNING = """<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+"""
+
+_HTML_TEMPLATE = """<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [%(start)s, %(end)s]);
+</script>
+</body>
+</html>
+"""
+
+_GROUPS = [
+ 'unsized_2d',
+ 'unsized_2d_array',
+ 'unsized_3d',
+ 'sized_color_2d_pot_00',
+ 'sized_color_2d_pot_01',
+ 'sized_color_2d_pot_02',
+ 'sized_color_2d_pot_03',
+ 'sized_color_2d_npot_00',
+ 'sized_color_2d_npot_01',
+ 'sized_color_2d_npot_02',
+ 'sized_color_2d_npot_03',
+ 'sized_color_cube_pot_00',
+ 'sized_color_cube_pot_01',
+ 'sized_color_cube_pot_02',
+ 'sized_color_cube_pot_03',
+ 'sized_color_cube_npot_00',
+ 'sized_color_cube_npot_01',
+ 'sized_color_cube_npot_02',
+ 'sized_color_cube_npot_03',
+ 'sized_color_2d_array_pot_00',
+ 'sized_color_2d_array_pot_01',
+ 'sized_color_2d_array_pot_02',
+ 'sized_color_2d_array_pot_03',
+ 'sized_color_2d_array_npot_00',
+ 'sized_color_2d_array_npot_01',
+ 'sized_color_2d_array_npot_02',
+ 'sized_color_2d_array_npot_03',
+ 'sized_color_3d_pot_00',
+ 'sized_color_3d_pot_01',
+ 'sized_color_3d_pot_02',
+ 'sized_color_3d_pot_03',
+ 'sized_color_3d_npot_00',
+ 'sized_color_3d_npot_01',
+ 'sized_color_3d_npot_02',
+ 'sized_color_3d_npot_03',
+ 'sized_depth_stencil',
+ 'compressed_2d',
+ 'compressed_cube',
+]
+
+def GenerateFilename(group):
+ """Generate test filename."""
+ filename = group
+ filename += ".html"
+ return filename
+
+def WriteTest(filename, start, end):
+ """Write one test."""
+ file = open(filename, "wb")
+ file.write(_DO_NOT_EDIT_WARNING)
+ file.write(_HTML_TEMPLATE % {
+ 'start': start,
+ 'end': end
+ })
+ file.close
+
+def GenerateTests():
+ """Generate all tests."""
+ filelist = []
+ for ii in range(len(_GROUPS)):
+ filename = GenerateFilename(_GROUPS[ii])
+ filelist.append(filename)
+ WriteTest(filename, ii, ii + 1)
+ return filelist
+
+def GenerateTestList(filelist):
+ file = open("00_test_list.txt", "wb")
+ file.write('\n'.join(filelist))
+ file.close
+
+def main(argv):
+ """This is the main function."""
+ filelist = GenerateTests()
+ GenerateTestList(filelist)
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/unsized_2d.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/unsized_2d.html
new file mode 100644
index 0000000000..447e4387f9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/unsized_2d.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [0, 1]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/unsized_2d_array.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/unsized_2d_array.html
new file mode 100644
index 0000000000..6eaeb451e2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/unsized_2d_array.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [1, 2]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/unsized_3d.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/unsized_3d.html
new file mode 100644
index 0000000000..8fe25fde1a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/unsized_3d.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureformat_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureFormatTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="300" height="300"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureFormatTests.run(gl, [2, 3]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/00_test_list.txt
new file mode 100644
index 0000000000..48498b565e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/00_test_list.txt
@@ -0,0 +1,144 @@
+2d_nearest_less_or_equal.html
+2d_nearest_greater_or_equal.html
+2d_nearest_less.html
+2d_nearest_greater.html
+2d_nearest_equal.html
+2d_nearest_not_equal.html
+2d_nearest_always.html
+2d_nearest_never.html
+2d_linear_less_or_equal.html
+2d_linear_greater_or_equal.html
+2d_linear_less.html
+2d_linear_greater.html
+2d_linear_equal.html
+2d_linear_not_equal.html
+2d_linear_always.html
+2d_linear_never.html
+2d_nearest_mipmap_nearest_less_or_equal.html
+2d_nearest_mipmap_nearest_greater_or_equal.html
+2d_nearest_mipmap_nearest_less.html
+2d_nearest_mipmap_nearest_greater.html
+2d_nearest_mipmap_nearest_equal.html
+2d_nearest_mipmap_nearest_not_equal.html
+2d_nearest_mipmap_nearest_always.html
+2d_nearest_mipmap_nearest_never.html
+2d_linear_mipmap_nearest_less_or_equal.html
+2d_linear_mipmap_nearest_greater_or_equal.html
+2d_linear_mipmap_nearest_less.html
+2d_linear_mipmap_nearest_greater.html
+2d_linear_mipmap_nearest_equal.html
+2d_linear_mipmap_nearest_not_equal.html
+2d_linear_mipmap_nearest_always.html
+2d_linear_mipmap_nearest_never.html
+2d_nearest_mipmap_linear_less_or_equal.html
+2d_nearest_mipmap_linear_greater_or_equal.html
+2d_nearest_mipmap_linear_less.html
+2d_nearest_mipmap_linear_greater.html
+2d_nearest_mipmap_linear_equal.html
+2d_nearest_mipmap_linear_not_equal.html
+2d_nearest_mipmap_linear_always.html
+2d_nearest_mipmap_linear_never.html
+2d_linear_mipmap_linear_less_or_equal.html
+2d_linear_mipmap_linear_greater_or_equal.html
+2d_linear_mipmap_linear_less.html
+2d_linear_mipmap_linear_greater.html
+2d_linear_mipmap_linear_equal.html
+2d_linear_mipmap_linear_not_equal.html
+2d_linear_mipmap_linear_always.html
+2d_linear_mipmap_linear_never.html
+cube_nearest_less_or_equal.html
+cube_nearest_greater_or_equal.html
+cube_nearest_less.html
+cube_nearest_greater.html
+cube_nearest_equal.html
+cube_nearest_not_equal.html
+cube_nearest_always.html
+cube_nearest_never.html
+cube_linear_less_or_equal.html
+cube_linear_greater_or_equal.html
+cube_linear_less.html
+cube_linear_greater.html
+cube_linear_equal.html
+cube_linear_not_equal.html
+cube_linear_always.html
+cube_linear_never.html
+cube_nearest_mipmap_nearest_less_or_equal.html
+cube_nearest_mipmap_nearest_greater_or_equal.html
+cube_nearest_mipmap_nearest_less.html
+cube_nearest_mipmap_nearest_greater.html
+cube_nearest_mipmap_nearest_equal.html
+cube_nearest_mipmap_nearest_not_equal.html
+cube_nearest_mipmap_nearest_always.html
+cube_nearest_mipmap_nearest_never.html
+cube_linear_mipmap_nearest_less_or_equal.html
+cube_linear_mipmap_nearest_greater_or_equal.html
+cube_linear_mipmap_nearest_less.html
+cube_linear_mipmap_nearest_greater.html
+cube_linear_mipmap_nearest_equal.html
+cube_linear_mipmap_nearest_not_equal.html
+cube_linear_mipmap_nearest_always.html
+cube_linear_mipmap_nearest_never.html
+cube_nearest_mipmap_linear_less_or_equal.html
+cube_nearest_mipmap_linear_greater_or_equal.html
+cube_nearest_mipmap_linear_less.html
+cube_nearest_mipmap_linear_greater.html
+cube_nearest_mipmap_linear_equal.html
+cube_nearest_mipmap_linear_not_equal.html
+cube_nearest_mipmap_linear_always.html
+cube_nearest_mipmap_linear_never.html
+cube_linear_mipmap_linear_less_or_equal.html
+cube_linear_mipmap_linear_greater_or_equal.html
+cube_linear_mipmap_linear_less.html
+cube_linear_mipmap_linear_greater.html
+cube_linear_mipmap_linear_equal.html
+cube_linear_mipmap_linear_not_equal.html
+cube_linear_mipmap_linear_always.html
+cube_linear_mipmap_linear_never.html
+2d_array_nearest_less_or_equal.html
+2d_array_nearest_greater_or_equal.html
+2d_array_nearest_less.html
+2d_array_nearest_greater.html
+2d_array_nearest_equal.html
+2d_array_nearest_not_equal.html
+2d_array_nearest_always.html
+2d_array_nearest_never.html
+2d_array_linear_less_or_equal.html
+2d_array_linear_greater_or_equal.html
+2d_array_linear_less.html
+2d_array_linear_greater.html
+2d_array_linear_equal.html
+2d_array_linear_not_equal.html
+2d_array_linear_always.html
+2d_array_linear_never.html
+2d_array_nearest_mipmap_nearest_less_or_equal.html
+2d_array_nearest_mipmap_nearest_greater_or_equal.html
+2d_array_nearest_mipmap_nearest_less.html
+2d_array_nearest_mipmap_nearest_greater.html
+2d_array_nearest_mipmap_nearest_equal.html
+2d_array_nearest_mipmap_nearest_not_equal.html
+2d_array_nearest_mipmap_nearest_always.html
+2d_array_nearest_mipmap_nearest_never.html
+2d_array_linear_mipmap_nearest_less_or_equal.html
+2d_array_linear_mipmap_nearest_greater_or_equal.html
+2d_array_linear_mipmap_nearest_less.html
+2d_array_linear_mipmap_nearest_greater.html
+2d_array_linear_mipmap_nearest_equal.html
+2d_array_linear_mipmap_nearest_not_equal.html
+2d_array_linear_mipmap_nearest_always.html
+2d_array_linear_mipmap_nearest_never.html
+2d_array_nearest_mipmap_linear_less_or_equal.html
+2d_array_nearest_mipmap_linear_greater_or_equal.html
+2d_array_nearest_mipmap_linear_less.html
+2d_array_nearest_mipmap_linear_greater.html
+2d_array_nearest_mipmap_linear_equal.html
+2d_array_nearest_mipmap_linear_not_equal.html
+2d_array_nearest_mipmap_linear_always.html
+2d_array_nearest_mipmap_linear_never.html
+2d_array_linear_mipmap_linear_less_or_equal.html
+2d_array_linear_mipmap_linear_greater_or_equal.html
+2d_array_linear_mipmap_linear_less.html
+2d_array_linear_mipmap_linear_greater.html
+2d_array_linear_mipmap_linear_equal.html
+2d_array_linear_mipmap_linear_not_equal.html
+2d_array_linear_mipmap_linear_always.html
+2d_array_linear_mipmap_linear_never.html \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_always.html
new file mode 100644
index 0000000000..683a50a80c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_always.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [110, 111]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_equal.html
new file mode 100644
index 0000000000..9031d2180d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [108, 109]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_greater.html
new file mode 100644
index 0000000000..9ef3900ea1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_greater.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [107, 108]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_greater_or_equal.html
new file mode 100644
index 0000000000..51914257e5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_greater_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [105, 106]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_less.html
new file mode 100644
index 0000000000..924315e72f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_less.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [106, 107]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_less_or_equal.html
new file mode 100644
index 0000000000..877f3ae810
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_less_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [104, 105]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_always.html
new file mode 100644
index 0000000000..0495e7e3b0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_always.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [142, 143]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_equal.html
new file mode 100644
index 0000000000..c40fceded9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [140, 141]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_greater.html
new file mode 100644
index 0000000000..b813379c3f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_greater.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [139, 140]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_greater_or_equal.html
new file mode 100644
index 0000000000..01b90b1316
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_greater_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [137, 138]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_less.html
new file mode 100644
index 0000000000..ea6d12246a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_less.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [138, 139]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_less_or_equal.html
new file mode 100644
index 0000000000..da5c45dc87
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_less_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [136, 137]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_never.html
new file mode 100644
index 0000000000..6c7177d4eb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_never.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [143, 144]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_not_equal.html
new file mode 100644
index 0000000000..ece2898683
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_linear_not_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [141, 142]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_always.html
new file mode 100644
index 0000000000..d9ce0da356
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_always.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [126, 127]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_equal.html
new file mode 100644
index 0000000000..969dd028ed
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [124, 125]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_greater.html
new file mode 100644
index 0000000000..e6cdc2aba7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_greater.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [123, 124]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_greater_or_equal.html
new file mode 100644
index 0000000000..8f3ab4a2a8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_greater_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [121, 122]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_less.html
new file mode 100644
index 0000000000..12cbf4d71d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_less.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [122, 123]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_less_or_equal.html
new file mode 100644
index 0000000000..aa16ca2d03
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_less_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [120, 121]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_never.html
new file mode 100644
index 0000000000..ff8c6b4e7f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_never.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [127, 128]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_not_equal.html
new file mode 100644
index 0000000000..b12597025a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_mipmap_nearest_not_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [125, 126]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_never.html
new file mode 100644
index 0000000000..aaf630f95e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_never.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [111, 112]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_not_equal.html
new file mode 100644
index 0000000000..b5f37b7a24
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_linear_not_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [109, 110]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_always.html
new file mode 100644
index 0000000000..87e30ba530
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_always.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [102, 103]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_equal.html
new file mode 100644
index 0000000000..0121ae0c6f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [100, 101]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_greater.html
new file mode 100644
index 0000000000..a407700531
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_greater.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [99, 100]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_greater_or_equal.html
new file mode 100644
index 0000000000..2b838e0da0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_greater_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [97, 98]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_less.html
new file mode 100644
index 0000000000..b5e56cdc35
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_less.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [98, 99]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_less_or_equal.html
new file mode 100644
index 0000000000..3980fcd889
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_less_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [96, 97]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_always.html
new file mode 100644
index 0000000000..fe782c37a1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_always.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [134, 135]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_equal.html
new file mode 100644
index 0000000000..57838d838e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [132, 133]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_greater.html
new file mode 100644
index 0000000000..ac85fd057d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_greater.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [131, 132]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_greater_or_equal.html
new file mode 100644
index 0000000000..17074cb881
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_greater_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [129, 130]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_less.html
new file mode 100644
index 0000000000..849a0787c2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_less.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [130, 131]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_less_or_equal.html
new file mode 100644
index 0000000000..4ed680906e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_less_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [128, 129]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_never.html
new file mode 100644
index 0000000000..484b3b7a37
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_never.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [135, 136]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_not_equal.html
new file mode 100644
index 0000000000..7611bba2b3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_linear_not_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [133, 134]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_always.html
new file mode 100644
index 0000000000..e80d611a21
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_always.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [118, 119]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_equal.html
new file mode 100644
index 0000000000..0c8af699cf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [116, 117]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_greater.html
new file mode 100644
index 0000000000..58d3f537f0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_greater.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [115, 116]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_greater_or_equal.html
new file mode 100644
index 0000000000..26a3ca0c7f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_greater_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [113, 114]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_less.html
new file mode 100644
index 0000000000..fc9895c7c0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_less.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [114, 115]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_less_or_equal.html
new file mode 100644
index 0000000000..82f5381db4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_less_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [112, 113]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_never.html
new file mode 100644
index 0000000000..2959de11e8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_never.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [119, 120]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_not_equal.html
new file mode 100644
index 0000000000..d2d2a1657d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_mipmap_nearest_not_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [117, 118]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_never.html
new file mode 100644
index 0000000000..970b393e8f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_never.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [103, 104]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_not_equal.html
new file mode 100644
index 0000000000..cc52419bb6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_array_nearest_not_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [101, 102]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_always.html
new file mode 100644
index 0000000000..0c072e4e9a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_always.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [14, 15]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_equal.html
new file mode 100644
index 0000000000..1c358069a5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [12, 13]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_greater.html
new file mode 100644
index 0000000000..65109bfc8c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_greater.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [11, 12]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_greater_or_equal.html
new file mode 100644
index 0000000000..b9065cde43
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_greater_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [9, 10]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_less.html
new file mode 100644
index 0000000000..d4d98b914b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_less.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [10, 11]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_less_or_equal.html
new file mode 100644
index 0000000000..e0d4c1584f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_less_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [8, 9]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_always.html
new file mode 100644
index 0000000000..a71e2d2e48
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_always.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [46, 47]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_equal.html
new file mode 100644
index 0000000000..03e604163a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [44, 45]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_greater.html
new file mode 100644
index 0000000000..e0e163e2eb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_greater.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [43, 44]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_greater_or_equal.html
new file mode 100644
index 0000000000..7498d0b29d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_greater_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [41, 42]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_less.html
new file mode 100644
index 0000000000..8c9c018e5a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_less.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [42, 43]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_less_or_equal.html
new file mode 100644
index 0000000000..0e23db2efb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_less_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [40, 41]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_never.html
new file mode 100644
index 0000000000..519746474a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_never.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [47, 48]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_not_equal.html
new file mode 100644
index 0000000000..53a9c44a7f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_linear_not_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [45, 46]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_always.html
new file mode 100644
index 0000000000..879a5eec9c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_always.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [30, 31]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_equal.html
new file mode 100644
index 0000000000..6ddfb4a88c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [28, 29]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_greater.html
new file mode 100644
index 0000000000..89f48e479c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_greater.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [27, 28]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_greater_or_equal.html
new file mode 100644
index 0000000000..79962393e1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_greater_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [25, 26]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_less.html
new file mode 100644
index 0000000000..f2207075cd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_less.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [26, 27]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_less_or_equal.html
new file mode 100644
index 0000000000..a600187ebe
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_less_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [24, 25]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_never.html
new file mode 100644
index 0000000000..1d499f8c73
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_never.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [31, 32]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_not_equal.html
new file mode 100644
index 0000000000..522a65e41d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_mipmap_nearest_not_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [29, 30]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_never.html
new file mode 100644
index 0000000000..b7368c2759
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_never.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [15, 16]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_not_equal.html
new file mode 100644
index 0000000000..490692b4d4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_linear_not_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [13, 14]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_always.html
new file mode 100644
index 0000000000..d811685f8e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_always.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [6, 7]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_equal.html
new file mode 100644
index 0000000000..f6574fe35c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [4, 5]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_greater.html
new file mode 100644
index 0000000000..1b6df673ae
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_greater.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [3, 4]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_greater_or_equal.html
new file mode 100644
index 0000000000..064388f636
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_greater_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [1, 2]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_less.html
new file mode 100644
index 0000000000..1efa1a01a5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_less.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [2, 3]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_less_or_equal.html
new file mode 100644
index 0000000000..10196bf59f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_less_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [0, 1]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_always.html
new file mode 100644
index 0000000000..c799aa9ff7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_always.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [38, 39]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_equal.html
new file mode 100644
index 0000000000..cd0dd6a1d8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [36, 37]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_greater.html
new file mode 100644
index 0000000000..5bd98c0677
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_greater.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [35, 36]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_greater_or_equal.html
new file mode 100644
index 0000000000..dee22dc3e7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_greater_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [33, 34]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_less.html
new file mode 100644
index 0000000000..8b954a55a7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_less.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [34, 35]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_less_or_equal.html
new file mode 100644
index 0000000000..b6eb41c0ea
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_less_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [32, 33]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_never.html
new file mode 100644
index 0000000000..be55dd6c41
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_never.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [39, 40]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_not_equal.html
new file mode 100644
index 0000000000..996cb8a393
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_linear_not_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [37, 38]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_always.html
new file mode 100644
index 0000000000..1eef513bef
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_always.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [22, 23]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_equal.html
new file mode 100644
index 0000000000..793c544c6f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [20, 21]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_greater.html
new file mode 100644
index 0000000000..426e431255
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_greater.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [19, 20]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_greater_or_equal.html
new file mode 100644
index 0000000000..4eca9eb327
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_greater_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [17, 18]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_less.html
new file mode 100644
index 0000000000..a4324c2447
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_less.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [18, 19]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_less_or_equal.html
new file mode 100644
index 0000000000..b63b148823
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_less_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [16, 17]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_never.html
new file mode 100644
index 0000000000..5e74f10bb2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_never.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [23, 24]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_not_equal.html
new file mode 100644
index 0000000000..804b2e3ae9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_mipmap_nearest_not_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [21, 22]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_never.html
new file mode 100644
index 0000000000..de447dac45
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_never.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [7, 8]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_not_equal.html
new file mode 100644
index 0000000000..fa8977bf91
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/2d_nearest_not_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [5, 6]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_always.html
new file mode 100644
index 0000000000..846d6ee7e4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_always.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [62, 63]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_equal.html
new file mode 100644
index 0000000000..829e0977f7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [60, 61]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_greater.html
new file mode 100644
index 0000000000..1035f86428
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_greater.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [59, 60]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_greater_or_equal.html
new file mode 100644
index 0000000000..e287605818
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_greater_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [57, 58]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_less.html
new file mode 100644
index 0000000000..cae8affb2b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_less.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [58, 59]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_less_or_equal.html
new file mode 100644
index 0000000000..c7ad559722
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_less_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [56, 57]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_always.html
new file mode 100644
index 0000000000..6bc8a946df
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_always.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [94, 95]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_equal.html
new file mode 100644
index 0000000000..c3cc8ca0e9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [92, 93]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_greater.html
new file mode 100644
index 0000000000..0294b65acb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_greater.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [91, 92]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_greater_or_equal.html
new file mode 100644
index 0000000000..d19866502b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_greater_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [89, 90]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_less.html
new file mode 100644
index 0000000000..4d3c98cb08
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_less.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [90, 91]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_less_or_equal.html
new file mode 100644
index 0000000000..2972d989a1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_less_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [88, 89]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_never.html
new file mode 100644
index 0000000000..7015dec4fb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_never.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [95, 96]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_not_equal.html
new file mode 100644
index 0000000000..d67b0d5f7f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_linear_not_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [93, 94]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_always.html
new file mode 100644
index 0000000000..a22b92d412
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_always.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [78, 79]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_equal.html
new file mode 100644
index 0000000000..2102e56dcb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [76, 77]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_greater.html
new file mode 100644
index 0000000000..80ed0e3b41
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_greater.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [75, 76]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_greater_or_equal.html
new file mode 100644
index 0000000000..e590f76bb8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_greater_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [73, 74]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_less.html
new file mode 100644
index 0000000000..63d99bd97f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_less.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [74, 75]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_less_or_equal.html
new file mode 100644
index 0000000000..53bdba5ff5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_less_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [72, 73]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_never.html
new file mode 100644
index 0000000000..fffe6fe452
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_never.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [79, 80]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_not_equal.html
new file mode 100644
index 0000000000..1ddeb39d91
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_mipmap_nearest_not_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [77, 78]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_never.html
new file mode 100644
index 0000000000..b96321fe1b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_never.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [63, 64]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_not_equal.html
new file mode 100644
index 0000000000..0c663cdaf1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_linear_not_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [61, 62]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_always.html
new file mode 100644
index 0000000000..de25c5ef0b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_always.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [54, 55]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_equal.html
new file mode 100644
index 0000000000..6a76cb062a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [52, 53]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_greater.html
new file mode 100644
index 0000000000..d5fa0b62d6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_greater.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [51, 52]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_greater_or_equal.html
new file mode 100644
index 0000000000..b7e7085da2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_greater_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [49, 50]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_less.html
new file mode 100644
index 0000000000..47c4b34d17
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_less.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [50, 51]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_less_or_equal.html
new file mode 100644
index 0000000000..1c9f005c0a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_less_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [48, 49]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_always.html
new file mode 100644
index 0000000000..14af11c511
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_always.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [86, 87]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_equal.html
new file mode 100644
index 0000000000..96c1e1d586
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [84, 85]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_greater.html
new file mode 100644
index 0000000000..f7e1087a86
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_greater.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [83, 84]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_greater_or_equal.html
new file mode 100644
index 0000000000..be1773c2e2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_greater_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [81, 82]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_less.html
new file mode 100644
index 0000000000..e4aa08d139
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_less.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [82, 83]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_less_or_equal.html
new file mode 100644
index 0000000000..fe6705c20a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_less_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [80, 81]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_never.html
new file mode 100644
index 0000000000..34bc00816d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_never.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [87, 88]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_not_equal.html
new file mode 100644
index 0000000000..8d7a900a77
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_linear_not_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [85, 86]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_always.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_always.html
new file mode 100644
index 0000000000..610869e06a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_always.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [70, 71]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_equal.html
new file mode 100644
index 0000000000..59a878d1d0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [68, 69]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_greater.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_greater.html
new file mode 100644
index 0000000000..dc788bc5f0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_greater.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [67, 68]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_greater_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_greater_or_equal.html
new file mode 100644
index 0000000000..e7e86e9cc0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_greater_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [65, 66]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_less.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_less.html
new file mode 100644
index 0000000000..cdb64a95ed
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_less.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [66, 67]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_less_or_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_less_or_equal.html
new file mode 100644
index 0000000000..26b6db723f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_less_or_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [64, 65]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_never.html
new file mode 100644
index 0000000000..8d71e5859f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_never.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [71, 72]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_not_equal.html
new file mode 100644
index 0000000000..6e681695fc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_mipmap_nearest_not_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [69, 70]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_never.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_never.html
new file mode 100644
index 0000000000..15d5b531f0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_never.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [55, 56]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_not_equal.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_not_equal.html
new file mode 100644
index 0000000000..3a3a41ddb3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/cube_nearest_not_equal.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [53, 54]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/textureshadow_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/textureshadow_test_generator.py
new file mode 100644
index 0000000000..4ead80de86
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/textureshadow_test_generator.py
@@ -0,0 +1,116 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2019 The Khronos Group Inc.
+# Use of this source code is governed by an MIT-style license that can be
+# found in the LICENSE.txt file.
+
+"""
+ Generator for textureformat* tests.
+ This file needs to be run in its folder.
+"""
+
+import sys
+
+_DO_NOT_EDIT_WARNING = """<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+"""
+
+_HTML_TEMPLATE = """<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Shadow Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureShadowTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureShadowTests.run(gl, [%(start)s, %(end)s]);
+</script>
+</body>
+</html>
+"""
+
+_TARGETS = [
+ '2d',
+ 'cube',
+ '2d_array',
+]
+
+_FILTERS = [
+ 'nearest',
+ 'linear',
+ 'nearest_mipmap_nearest',
+ 'linear_mipmap_nearest',
+ 'nearest_mipmap_linear',
+ 'linear_mipmap_linear',
+]
+
+_COMPARE_FUNCS = [
+ 'less_or_equal',
+ 'greater_or_equal',
+ 'less',
+ 'greater',
+ 'equal',
+ 'not_equal',
+ 'always',
+ 'never',
+]
+
+def GenerateFilename(group):
+ """Generate test filename."""
+ filename = group
+ filename += ".html"
+ return filename
+
+def WriteTest(filename, start, end):
+ """Write one test."""
+ file = open(filename, "wb")
+ file.write(_DO_NOT_EDIT_WARNING)
+ file.write(_HTML_TEMPLATE % {
+ 'start': start,
+ 'end': end
+ })
+ file.close
+
+def GenerateTests():
+ """Generate all tests."""
+ filelist = []
+ ii = 0
+ for iTarget in range(len(_TARGETS)):
+ for iFilter in range(len(_FILTERS)):
+ for iFunc in range(len(_COMPARE_FUNCS)):
+ item = _TARGETS[iTarget] + '_' + _FILTERS[iFilter] + '_' + _COMPARE_FUNCS[iFunc]
+ filename = GenerateFilename(item)
+ filelist.append(filename)
+ WriteTest(filename, ii, ii + 1)
+ ii = ii + 1
+ return filelist
+
+def GenerateTestList(filelist):
+ file = open("00_test_list.txt", "wb")
+ file.write('\n'.join(filelist))
+ file.close
+
+def main(argv):
+ """This is the main function."""
+ filelist = GenerateTests()
+ GenerateTestList(filelist)
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/00_test_list.txt
new file mode 100644
index 0000000000..b3f8275d99
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/00_test_list.txt
@@ -0,0 +1,90 @@
+basic_teximage2d_2d_00.html
+basic_teximage2d_2d_01.html
+basic_teximage2d_cube_00.html
+basic_teximage2d_cube_01.html
+basic_teximage2d_cube_02.html
+basic_teximage2d_cube_03.html
+basic_teximage2d_cube_04.html
+random_teximage2d_2d.html
+random_teximage2d_cube.html
+teximage2d_align.html
+teximage2d_unpack_params.html
+teximage2d_pbo_2d_00.html
+teximage2d_pbo_2d_01.html
+teximage2d_pbo_cube_00.html
+teximage2d_pbo_cube_01.html
+teximage2d_pbo_cube_02.html
+teximage2d_pbo_cube_03.html
+teximage2d_pbo_cube_04.html
+teximage2d_pbo_params.html
+teximage2d_depth.html
+teximage2d_depth_pbo.html
+basic_texsubimage2d_2d_00.html
+basic_texsubimage2d_2d_01.html
+basic_texsubimage2d_2d_02.html
+basic_texsubimage2d_cube_00.html
+basic_texsubimage2d_cube_01.html
+basic_texsubimage2d_cube_02.html
+basic_texsubimage2d_cube_03.html
+basic_texsubimage2d_cube_04.html
+texsubimage2d_empty_tex.html
+texsubimage2d_align.html
+texsubimage2d_unpack_params.html
+texsubimage2d_pbo_2d_00.html
+texsubimage2d_pbo_2d_01.html
+texsubimage2d_pbo_cube_00.html
+texsubimage2d_pbo_cube_01.html
+texsubimage2d_pbo_cube_02.html
+texsubimage2d_pbo_cube_03.html
+texsubimage2d_pbo_cube_04.html
+texsubimage2d_pbo_params.html
+texsubimage2d_depth.html
+basic_copyteximage2d.html
+basic_copytexsubimage2d.html
+basic_teximage3d_2d_array_00.html
+basic_teximage3d_2d_array_01.html
+basic_teximage3d_2d_array_02.html
+basic_teximage3d_3d_00.html
+basic_teximage3d_3d_01.html
+basic_teximage3d_3d_02.html
+basic_teximage3d_3d_03.html
+basic_teximage3d_3d_04.html
+teximage3d_unpack_params.html
+teximage3d_pbo_2d_array_00.html
+teximage3d_pbo_2d_array_01.html
+teximage3d_pbo_3d_00.html
+teximage3d_pbo_3d_01.html
+teximage3d_pbo_params.html
+teximage3d_depth.html
+teximage3d_depth_pbo.html
+basic_texsubimage3d_00.html
+basic_texsubimage3d_01.html
+basic_texsubimage3d_02.html
+basic_texsubimage3d_03.html
+basic_texsubimage3d_04.html
+texsubimage3d_unpack_params.html
+texsubimage3d_pbo_2d_array_00.html
+texsubimage3d_pbo_2d_array_01.html
+texsubimage3d_pbo_3d_00.html
+texsubimage3d_pbo_3d_01.html
+texsubimage3d_pbo_params.html
+texsubimage3d_depth.html
+texstorage2d_format_2d_00.html
+texstorage2d_format_2d_01.html
+texstorage2d_format_2d_02.html
+texstorage2d_format_cube_00.html
+texstorage2d_format_cube_01.html
+texstorage2d_format_cube_02.html
+texstorage2d_format_cube_03.html
+texstorage2d_format_cube_04.html
+texstorage2d_format_depth_stencil.html
+texstorage2d_format_size.html
+texstorage3d_format_2d_array_00.html
+texstorage3d_format_2d_array_01.html
+texstorage3d_format_2d_array_02.html
+texstorage3d_format_3d_00.html
+texstorage3d_format_3d_01.html
+texstorage3d_format_3d_02.html
+texstorage3d_format_3d_03.html
+texstorage3d_format_depth_stencil.html
+texstorage3d_format_size.html \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_copyteximage2d.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_copyteximage2d.html
new file mode 100644
index 0000000000..8ad04f6a33
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_copyteximage2d.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [41, 42]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_copytexsubimage2d.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_copytexsubimage2d.html
new file mode 100644
index 0000000000..01832d5e8f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_copytexsubimage2d.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [42, 43]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_2d_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_2d_00.html
new file mode 100644
index 0000000000..25a3941fd4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_2d_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [0, 1]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_2d_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_2d_01.html
new file mode 100644
index 0000000000..7258bb0f2c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_2d_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [1, 2]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_00.html
new file mode 100644
index 0000000000..a0b44fa064
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [2, 3]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_01.html
new file mode 100644
index 0000000000..1d59fd011e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [3, 4]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_02.html
new file mode 100644
index 0000000000..01fbabc0bd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [4, 5]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_03.html
new file mode 100644
index 0000000000..c1f662fb71
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [5, 6]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_04.html
new file mode 100644
index 0000000000..1c0cbda645
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage2d_cube_04.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [6, 7]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_2d_array_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_2d_array_00.html
new file mode 100644
index 0000000000..04f5f82a89
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_2d_array_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [43, 44]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_2d_array_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_2d_array_01.html
new file mode 100644
index 0000000000..fe6dbec66c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_2d_array_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [44, 45]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_2d_array_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_2d_array_02.html
new file mode 100644
index 0000000000..b33f5c0dc9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_2d_array_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [45, 46]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_00.html
new file mode 100644
index 0000000000..330a980b9e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [46, 47]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_01.html
new file mode 100644
index 0000000000..ebe8449990
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [47, 48]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_02.html
new file mode 100644
index 0000000000..941e6d3689
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [48, 49]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_03.html
new file mode 100644
index 0000000000..49bd666589
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [49, 50]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_04.html
new file mode 100644
index 0000000000..b35f582c31
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_teximage3d_3d_04.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [50, 51]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_2d_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_2d_00.html
new file mode 100644
index 0000000000..2c9ab82a97
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_2d_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [21, 22]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_2d_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_2d_01.html
new file mode 100644
index 0000000000..1ce8c4ed69
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_2d_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [22, 23]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_2d_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_2d_02.html
new file mode 100644
index 0000000000..ab339cc79e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_2d_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [23, 24]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_00.html
new file mode 100644
index 0000000000..5152b59266
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [24, 25]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_01.html
new file mode 100644
index 0000000000..519387bf4c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [25, 26]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_02.html
new file mode 100644
index 0000000000..f2d88d3094
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [26, 27]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_03.html
new file mode 100644
index 0000000000..e32a550b44
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [27, 28]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_04.html
new file mode 100644
index 0000000000..263e5da5d1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage2d_cube_04.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [28, 29]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_00.html
new file mode 100644
index 0000000000..c418c167b8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [59, 60]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_01.html
new file mode 100644
index 0000000000..f24c56e383
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [60, 61]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_02.html
new file mode 100644
index 0000000000..8d761c9391
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [61, 62]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_03.html
new file mode 100644
index 0000000000..f04cd395a8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [62, 63]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_04.html
new file mode 100644
index 0000000000..036df5fe25
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/basic_texsubimage3d_04.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [63, 64]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/random_teximage2d_2d.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/random_teximage2d_2d.html
new file mode 100644
index 0000000000..d166152cea
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/random_teximage2d_2d.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [7, 8]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/random_teximage2d_cube.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/random_teximage2d_cube.html
new file mode 100644
index 0000000000..b7fcc77142
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/random_teximage2d_cube.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [8, 9]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_align.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_align.html
new file mode 100644
index 0000000000..bf844178ff
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_align.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [9, 10]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_depth.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_depth.html
new file mode 100644
index 0000000000..6b2e31b76e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_depth.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [19, 20]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_depth_pbo.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_depth_pbo.html
new file mode 100644
index 0000000000..0ccf52ba1b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_depth_pbo.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [20, 21]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_2d_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_2d_00.html
new file mode 100644
index 0000000000..4df9f6a0d4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_2d_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [11, 12]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_2d_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_2d_01.html
new file mode 100644
index 0000000000..26f503dbb1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_2d_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [12, 13]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_00.html
new file mode 100644
index 0000000000..c0b7ce461e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [13, 14]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_01.html
new file mode 100644
index 0000000000..24e3ebb47a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [14, 15]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_02.html
new file mode 100644
index 0000000000..76f74ebf99
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [15, 16]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_03.html
new file mode 100644
index 0000000000..cfc63dcf44
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [16, 17]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_04.html
new file mode 100644
index 0000000000..5f26f61bb0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_cube_04.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [17, 18]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_params.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_params.html
new file mode 100644
index 0000000000..cb4c7b87a0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_pbo_params.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [18, 19]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_unpack_params.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_unpack_params.html
new file mode 100644
index 0000000000..43fdf383a0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage2d_unpack_params.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [10, 11]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_depth.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_depth.html
new file mode 100644
index 0000000000..a6a6691a87
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_depth.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [57, 58]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_depth_pbo.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_depth_pbo.html
new file mode 100644
index 0000000000..d8ec29d395
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_depth_pbo.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [58, 59]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_2d_array_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_2d_array_00.html
new file mode 100644
index 0000000000..2b963af9b5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_2d_array_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [52, 53]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_2d_array_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_2d_array_01.html
new file mode 100644
index 0000000000..4a3c9e3175
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_2d_array_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [53, 54]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_3d_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_3d_00.html
new file mode 100644
index 0000000000..472621dc96
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_3d_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [54, 55]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_3d_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_3d_01.html
new file mode 100644
index 0000000000..4275a1c0b1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_3d_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [55, 56]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_params.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_params.html
new file mode 100644
index 0000000000..213bc831d2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_pbo_params.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [56, 57]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_unpack_params.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_unpack_params.html
new file mode 100644
index 0000000000..9bfd6c2157
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/teximage3d_unpack_params.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [51, 52]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_2d_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_2d_00.html
new file mode 100644
index 0000000000..dfa571683b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_2d_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [71, 72]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_2d_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_2d_01.html
new file mode 100644
index 0000000000..d764993f39
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_2d_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [72, 73]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_2d_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_2d_02.html
new file mode 100644
index 0000000000..53077e684b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_2d_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [73, 74]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_00.html
new file mode 100644
index 0000000000..f8a4c6c8a4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [74, 75]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_01.html
new file mode 100644
index 0000000000..d56154d30b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [75, 76]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_02.html
new file mode 100644
index 0000000000..c575c39d6e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [76, 77]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_03.html
new file mode 100644
index 0000000000..8b4a767530
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [77, 78]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_04.html
new file mode 100644
index 0000000000..2e9aa10486
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_cube_04.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [78, 79]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_depth_stencil.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_depth_stencil.html
new file mode 100644
index 0000000000..e2454c4475
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_depth_stencil.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [79, 80]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_size.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_size.html
new file mode 100644
index 0000000000..0d7bb7c009
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage2d_format_size.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [80, 81]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_2d_array_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_2d_array_00.html
new file mode 100644
index 0000000000..b7792d85b5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_2d_array_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [81, 82]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_2d_array_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_2d_array_01.html
new file mode 100644
index 0000000000..de3140514e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_2d_array_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [82, 83]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_2d_array_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_2d_array_02.html
new file mode 100644
index 0000000000..831b7ba386
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_2d_array_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [83, 84]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_00.html
new file mode 100644
index 0000000000..a4bfad50ff
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [84, 85]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_01.html
new file mode 100644
index 0000000000..1673ca1811
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [85, 86]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_02.html
new file mode 100644
index 0000000000..cad658becf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [86, 87]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_03.html
new file mode 100644
index 0000000000..dee4ae0bf5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_3d_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [87, 88]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_depth_stencil.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_depth_stencil.html
new file mode 100644
index 0000000000..2a10ac2a94
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_depth_stencil.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [88, 89]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_size.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_size.html
new file mode 100644
index 0000000000..b681d83071
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texstorage3d_format_size.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [89, 90]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_align.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_align.html
new file mode 100644
index 0000000000..990098d190
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_align.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [30, 31]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_depth.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_depth.html
new file mode 100644
index 0000000000..33194ec150
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_depth.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [40, 41]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_empty_tex.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_empty_tex.html
new file mode 100644
index 0000000000..3da5eed58c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_empty_tex.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [29, 30]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_2d_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_2d_00.html
new file mode 100644
index 0000000000..94391c252a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_2d_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [32, 33]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_2d_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_2d_01.html
new file mode 100644
index 0000000000..906c70917e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_2d_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [33, 34]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_00.html
new file mode 100644
index 0000000000..c96d0952c5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [34, 35]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_01.html
new file mode 100644
index 0000000000..3fd841c5cc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [35, 36]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_02.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_02.html
new file mode 100644
index 0000000000..b62a2a1579
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_02.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [36, 37]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_03.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_03.html
new file mode 100644
index 0000000000..eb6ab351b7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_03.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [37, 38]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_04.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_04.html
new file mode 100644
index 0000000000..717d84018a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_cube_04.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [38, 39]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_params.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_params.html
new file mode 100644
index 0000000000..b6e1027e0b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_pbo_params.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [39, 40]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_unpack_params.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_unpack_params.html
new file mode 100644
index 0000000000..0e341e798b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage2d_unpack_params.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [31, 32]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_depth.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_depth.html
new file mode 100644
index 0000000000..9635f1e9c8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_depth.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [70, 71]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_2d_array_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_2d_array_00.html
new file mode 100644
index 0000000000..68443fffc2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_2d_array_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [65, 66]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_2d_array_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_2d_array_01.html
new file mode 100644
index 0000000000..b578192827
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_2d_array_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [66, 67]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_3d_00.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_3d_00.html
new file mode 100644
index 0000000000..b5adb604a0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_3d_00.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [67, 68]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_3d_01.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_3d_01.html
new file mode 100644
index 0000000000..8bff387e75
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_3d_01.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [68, 69]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_params.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_params.html
new file mode 100644
index 0000000000..cb4311db14
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_pbo_params.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [69, 70]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_unpack_params.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_unpack_params.html
new file mode 100644
index 0000000000..3f3f7242f0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texsubimage3d_unpack_params.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [64, 65]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texturespecification_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texturespecification_test_generator.py
new file mode 100644
index 0000000000..04fd403b98
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texturespecification_test_generator.py
@@ -0,0 +1,178 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2019 The Khronos Group Inc.
+# Use of this source code is governed by an MIT-style license that can be
+# found in the LICENSE.txt file.
+
+"""
+ Generator for texturespecification* tests.
+ This file needs to be run in its folder.
+"""
+
+import sys
+
+_DO_NOT_EDIT_WARNING = """<!--
+
+This file is auto-generated from texturespecification_test_generator.py
+DO NOT EDIT!
+
+-->
+
+"""
+
+_HTML_TEMPLATE = """<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureSpecificationTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureSpecificationTests.run(gl, [%(start)s, %(end)s]);
+</script>
+</body>
+</html>
+"""
+
+_GROUPS = [
+ 'basic_teximage2d_2d_00',
+ 'basic_teximage2d_2d_01',
+ 'basic_teximage2d_cube_00',
+ 'basic_teximage2d_cube_01',
+ 'basic_teximage2d_cube_02',
+ 'basic_teximage2d_cube_03',
+ 'basic_teximage2d_cube_04',
+ 'random_teximage2d_2d',
+ 'random_teximage2d_cube',
+ 'teximage2d_align',
+ 'teximage2d_unpack_params',
+ 'teximage2d_pbo_2d_00',
+ 'teximage2d_pbo_2d_01',
+ 'teximage2d_pbo_cube_00',
+ 'teximage2d_pbo_cube_01',
+ 'teximage2d_pbo_cube_02',
+ 'teximage2d_pbo_cube_03',
+ 'teximage2d_pbo_cube_04',
+ 'teximage2d_pbo_params',
+ 'teximage2d_depth',
+ 'teximage2d_depth_pbo',
+ 'basic_texsubimage2d_2d_00',
+ 'basic_texsubimage2d_2d_01',
+ 'basic_texsubimage2d_2d_02',
+ 'basic_texsubimage2d_cube_00',
+ 'basic_texsubimage2d_cube_01',
+ 'basic_texsubimage2d_cube_02',
+ 'basic_texsubimage2d_cube_03',
+ 'basic_texsubimage2d_cube_04',
+ 'texsubimage2d_empty_tex',
+ 'texsubimage2d_align',
+ 'texsubimage2d_unpack_params',
+ 'texsubimage2d_pbo_2d_00',
+ 'texsubimage2d_pbo_2d_01',
+ 'texsubimage2d_pbo_cube_00',
+ 'texsubimage2d_pbo_cube_01',
+ 'texsubimage2d_pbo_cube_02',
+ 'texsubimage2d_pbo_cube_03',
+ 'texsubimage2d_pbo_cube_04',
+ 'texsubimage2d_pbo_params',
+ 'texsubimage2d_depth',
+ 'basic_copyteximage2d',
+ 'basic_copytexsubimage2d',
+ 'basic_teximage3d_2d_array_00',
+ 'basic_teximage3d_2d_array_01',
+ 'basic_teximage3d_2d_array_02',
+ 'basic_teximage3d_3d_00',
+ 'basic_teximage3d_3d_01',
+ 'basic_teximage3d_3d_02',
+ 'basic_teximage3d_3d_03',
+ 'basic_teximage3d_3d_04',
+ 'teximage3d_unpack_params',
+ 'teximage3d_pbo_2d_array_00',
+ 'teximage3d_pbo_2d_array_01',
+ 'teximage3d_pbo_3d_00',
+ 'teximage3d_pbo_3d_01',
+ 'teximage3d_pbo_params',
+ 'teximage3d_depth',
+ 'teximage3d_depth_pbo',
+ 'basic_texsubimage3d_00',
+ 'basic_texsubimage3d_01',
+ 'basic_texsubimage3d_02',
+ 'basic_texsubimage3d_03',
+ 'basic_texsubimage3d_04',
+ 'texsubimage3d_unpack_params',
+ 'texsubimage3d_pbo_2d_array_00',
+ 'texsubimage3d_pbo_2d_array_01',
+ 'texsubimage3d_pbo_3d_00',
+ 'texsubimage3d_pbo_3d_01',
+ 'texsubimage3d_pbo_params',
+ 'texsubimage3d_depth',
+ 'texstorage2d_format_2d_00',
+ 'texstorage2d_format_2d_01',
+ 'texstorage2d_format_2d_02',
+ 'texstorage2d_format_cube_00',
+ 'texstorage2d_format_cube_01',
+ 'texstorage2d_format_cube_02',
+ 'texstorage2d_format_cube_03',
+ 'texstorage2d_format_cube_04',
+ 'texstorage2d_format_depth_stencil',
+ 'texstorage2d_format_size',
+ 'texstorage3d_format_2d_array_00',
+ 'texstorage3d_format_2d_array_01',
+ 'texstorage3d_format_2d_array_02',
+ 'texstorage3d_format_3d_00',
+ 'texstorage3d_format_3d_01',
+ 'texstorage3d_format_3d_02',
+ 'texstorage3d_format_3d_03',
+ 'texstorage3d_format_depth_stencil',
+ 'texstorage3d_format_size',
+]
+
+def GenerateFilename(group):
+ """Generate test filename."""
+ filename = group
+ filename += ".html"
+ return filename
+
+def WriteTest(filename, start, end):
+ """Write one test."""
+ file = open(filename, "wb")
+ file.write(_DO_NOT_EDIT_WARNING)
+ file.write(_HTML_TEMPLATE % {
+ 'start': start,
+ 'end': end
+ })
+ file.close
+
+def GenerateTests():
+ """Generate all tests."""
+ filelist = []
+ for ii in range(len(_GROUPS)):
+ filename = GenerateFilename(_GROUPS[ii])
+ filelist.append(filename)
+ WriteTest(filename, ii, ii + 1)
+ return filelist
+
+def GenerateTestList(filelist):
+ file = open("00_test_list.txt", "wb")
+ file.write('\n'.join(filelist))
+ file.close
+
+def main(argv):
+ """This is the main function."""
+ filelist = GenerateTests()
+ GenerateTestList(filelist)
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturestatequery.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturestatequery.html
new file mode 100644
index 0000000000..2b6600bee2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturestatequery.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture State Query Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureStateQuery');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureStateQuery.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap.html
new file mode 100644
index 0000000000..fb19852595
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Wrap Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureWrapTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureWrapTests.run(gl, [2, 3]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/00_test_list.txt
new file mode 100644
index 0000000000..7e3a90712b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/00_test_list.txt
@@ -0,0 +1,22 @@
+rgba8_pot.html
+rgba8_npot.html
+eac_r11_pot.html
+eac_r11_npot.html
+eac_signed_r11_pot.html
+eac_signed_r11_npot.html
+eac_rg11_pot.html
+eac_rg11_npot.html
+eac_signed_rg11_pot.html
+eac_signed_rg11_npot.html
+etc2_rgb8_pot.html
+etc2_rgb8_npot.html
+etc2_srgb8_pot.html
+etc2_srgb8_npot.html
+etc2_rgb8_punchthrough_alpha1_pot.html
+etc2_rgb8_punchthrough_alpha1_npot.html
+etc2_srgb8_punchthrough_alpha1_pot.html
+etc2_srgb8_punchthrough_alpha1_npot.html
+etc2_eac_rgba8_pot.html
+etc2_eac_rgba8_npot.html
+etc2_eac_srgb8_alpha8_pot.html
+etc2_eac_srgb8_alpha8_npot.html \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_r11_npot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_r11_npot.html
new file mode 100644
index 0000000000..a3cbe500a7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_r11_npot.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturewrap_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureWrapTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureWrapTests.run(gl, [3, 4]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_r11_pot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_r11_pot.html
new file mode 100644
index 0000000000..6c51aa998a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_r11_pot.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturewrap_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureWrapTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureWrapTests.run(gl, [2, 3]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_rg11_npot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_rg11_npot.html
new file mode 100644
index 0000000000..0a1ae8f924
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_rg11_npot.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturewrap_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureWrapTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureWrapTests.run(gl, [7, 8]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_rg11_pot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_rg11_pot.html
new file mode 100644
index 0000000000..9d4bf2c3ce
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_rg11_pot.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturewrap_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureWrapTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureWrapTests.run(gl, [6, 7]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_r11_npot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_r11_npot.html
new file mode 100644
index 0000000000..c7aeca4798
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_r11_npot.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturewrap_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureWrapTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureWrapTests.run(gl, [5, 6]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_r11_pot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_r11_pot.html
new file mode 100644
index 0000000000..0cb75e22e2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_r11_pot.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturewrap_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureWrapTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureWrapTests.run(gl, [4, 5]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_rg11_npot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_rg11_npot.html
new file mode 100644
index 0000000000..6905c76775
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_rg11_npot.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturewrap_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureWrapTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureWrapTests.run(gl, [9, 10]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_rg11_pot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_rg11_pot.html
new file mode 100644
index 0000000000..83f3a8b536
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/eac_signed_rg11_pot.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturewrap_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureWrapTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureWrapTests.run(gl, [8, 9]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_rgba8_npot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_rgba8_npot.html
new file mode 100644
index 0000000000..c3ab4caa48
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_rgba8_npot.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturewrap_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureWrapTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureWrapTests.run(gl, [19, 20]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_rgba8_pot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_rgba8_pot.html
new file mode 100644
index 0000000000..86d1dcd030
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_rgba8_pot.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturewrap_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureWrapTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureWrapTests.run(gl, [18, 19]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_srgb8_alpha8_npot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_srgb8_alpha8_npot.html
new file mode 100644
index 0000000000..25c6bebb04
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_srgb8_alpha8_npot.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturewrap_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureWrapTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureWrapTests.run(gl, [21, 22]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_srgb8_alpha8_pot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_srgb8_alpha8_pot.html
new file mode 100644
index 0000000000..8ffef8a6ec
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_eac_srgb8_alpha8_pot.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturewrap_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureWrapTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureWrapTests.run(gl, [20, 21]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_npot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_npot.html
new file mode 100644
index 0000000000..c69e8adb3f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_npot.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturewrap_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureWrapTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureWrapTests.run(gl, [11, 12]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_pot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_pot.html
new file mode 100644
index 0000000000..79cc6398ff
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_pot.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturewrap_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureWrapTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureWrapTests.run(gl, [10, 11]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_punchthrough_alpha1_npot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_punchthrough_alpha1_npot.html
new file mode 100644
index 0000000000..09d8c01167
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_punchthrough_alpha1_npot.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturewrap_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureWrapTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureWrapTests.run(gl, [15, 16]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_punchthrough_alpha1_pot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_punchthrough_alpha1_pot.html
new file mode 100644
index 0000000000..07b5cf209d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_rgb8_punchthrough_alpha1_pot.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturewrap_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureWrapTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureWrapTests.run(gl, [14, 15]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_npot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_npot.html
new file mode 100644
index 0000000000..d2cb034ccd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_npot.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturewrap_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureWrapTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureWrapTests.run(gl, [13, 14]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_pot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_pot.html
new file mode 100644
index 0000000000..6f124f0489
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_pot.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturewrap_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureWrapTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureWrapTests.run(gl, [12, 13]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_punchthrough_alpha1_npot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_punchthrough_alpha1_npot.html
new file mode 100644
index 0000000000..e6d38338be
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_punchthrough_alpha1_npot.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturewrap_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureWrapTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureWrapTests.run(gl, [17, 18]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_punchthrough_alpha1_pot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_punchthrough_alpha1_pot.html
new file mode 100644
index 0000000000..27af094ed2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/etc2_srgb8_punchthrough_alpha1_pot.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturewrap_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureWrapTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureWrapTests.run(gl, [16, 17]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/rgba8_npot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/rgba8_npot.html
new file mode 100644
index 0000000000..c05a40607b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/rgba8_npot.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturewrap_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureWrapTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureWrapTests.run(gl, [1, 2]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/rgba8_pot.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/rgba8_pot.html
new file mode 100644
index 0000000000..eeb9b4639d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/rgba8_pot.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from texturewrap_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureWrapTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureWrapTests.run(gl, [0, 1]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/texturewrap_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/texturewrap_test_generator.py
new file mode 100644
index 0000000000..112c39958d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/texturewrap_test_generator.py
@@ -0,0 +1,110 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2019 The Khronos Group Inc.
+# Use of this source code is governed by an MIT-style license that can be
+# found in the LICENSE.txt file.
+
+"""
+ Generator for textureformat* tests.
+ This file needs to be run in its folder.
+"""
+
+import sys
+
+_DO_NOT_EDIT_WARNING = """<!--
+
+This file is auto-generated from texturewrap_test_generator.py
+DO NOT EDIT!
+
+-->
+
+"""
+
+_HTML_TEMPLATE = """<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Texture Specification Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTextureWrapTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fTextureWrapTests.run(gl, [%(start)s, %(end)s]);
+</script>
+</body>
+</html>
+"""
+
+_GROUPS = [
+ 'rgba8_pot',
+ 'rgba8_npot',
+ 'eac_r11_pot',
+ 'eac_r11_npot',
+ 'eac_signed_r11_pot',
+ 'eac_signed_r11_npot',
+ 'eac_rg11_pot',
+ 'eac_rg11_npot',
+ 'eac_signed_rg11_pot',
+ 'eac_signed_rg11_npot',
+ 'etc2_rgb8_pot',
+ 'etc2_rgb8_npot',
+ 'etc2_srgb8_pot',
+ 'etc2_srgb8_npot',
+ 'etc2_rgb8_punchthrough_alpha1_pot',
+ 'etc2_rgb8_punchthrough_alpha1_npot',
+ 'etc2_srgb8_punchthrough_alpha1_pot',
+ 'etc2_srgb8_punchthrough_alpha1_npot',
+ 'etc2_eac_rgba8_pot',
+ 'etc2_eac_rgba8_npot',
+ 'etc2_eac_srgb8_alpha8_pot',
+ 'etc2_eac_srgb8_alpha8_npot',
+]
+
+def GenerateFilename(group):
+ """Generate test filename."""
+ filename = group
+ filename += ".html"
+ return filename
+
+def WriteTest(filename, start, end):
+ """Write one test."""
+ file = open(filename, "wb")
+ file.write(_DO_NOT_EDIT_WARNING)
+ file.write(_HTML_TEMPLATE % {
+ 'start': start,
+ 'end': end
+ })
+ file.close
+
+def GenerateTests():
+ """Generate all tests."""
+ filelist = []
+ for ii in range(len(_GROUPS)):
+ filename = GenerateFilename(_GROUPS[ii])
+ filelist.append(filename)
+ WriteTest(filename, ii, ii + 1)
+ return filelist
+
+def GenerateTestList(filelist):
+ file = open("00_test_list.txt", "wb")
+ file.write('\n'.join(filelist))
+ file.close
+
+def main(argv):
+ """This is the main function."""
+ filelist = GenerateTests()
+ GenerateTestList(filelist)
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/00_test_list.txt
new file mode 100644
index 0000000000..79daefed54
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/00_test_list.txt
@@ -0,0 +1,29 @@
+position.html
+point_size.html
+basic_types_separate_points.html
+basic_types_separate_lines.html
+basic_types_separate_triangles.html
+basic_types_interleaved_points.html
+basic_types_interleaved_lines.html
+basic_types_interleaved_triangles.html
+array_separate_points.html
+array_separate_lines.html
+array_separate_triangles.html
+array_interleaved_points.html
+array_interleaved_lines.html
+array_interleaved_triangles.html
+array_element_separate_points.html
+array_element_separate_lines.html
+array_element_separate_triangles.html
+array_element_interleaved_points.html
+array_element_interleaved_lines.html
+array_element_interleaved_triangles.html
+interpolation_smooth.html
+interpolation_flat.html
+interpolation_centroid.html
+random_separate_points.html
+random_separate_lines.html
+random_separate_triangles.html
+random_interleaved_points.html
+random_interleaved_lines.html
+random_interleaved_triangles.html \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_interleaved_lines.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_interleaved_lines.html
new file mode 100644
index 0000000000..3bf5e0cb2d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_interleaved_lines.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [18, 19]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_interleaved_points.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_interleaved_points.html
new file mode 100644
index 0000000000..4adc875438
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_interleaved_points.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [17, 18]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_interleaved_triangles.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_interleaved_triangles.html
new file mode 100644
index 0000000000..5fbdf00bc3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_interleaved_triangles.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [19, 20]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_separate_lines.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_separate_lines.html
new file mode 100644
index 0000000000..37667c6b22
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_separate_lines.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [15, 16]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_separate_points.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_separate_points.html
new file mode 100644
index 0000000000..f92dd2551e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_separate_points.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [14, 15]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_separate_triangles.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_separate_triangles.html
new file mode 100644
index 0000000000..4bf5cf9590
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_element_separate_triangles.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [16, 17]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_interleaved_lines.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_interleaved_lines.html
new file mode 100644
index 0000000000..534b088d35
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_interleaved_lines.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [12, 13]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_interleaved_points.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_interleaved_points.html
new file mode 100644
index 0000000000..fa08538f2b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_interleaved_points.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [11, 12]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_interleaved_triangles.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_interleaved_triangles.html
new file mode 100644
index 0000000000..5fea527b76
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_interleaved_triangles.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [13, 14]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_separate_lines.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_separate_lines.html
new file mode 100644
index 0000000000..092e6e003f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_separate_lines.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [9, 10]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_separate_points.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_separate_points.html
new file mode 100644
index 0000000000..c8a7ad95cb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_separate_points.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [8, 9]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_separate_triangles.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_separate_triangles.html
new file mode 100644
index 0000000000..79d4b7450d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/array_separate_triangles.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [10, 11]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_interleaved_lines.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_interleaved_lines.html
new file mode 100644
index 0000000000..66653a97b7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_interleaved_lines.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [6, 7]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_interleaved_points.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_interleaved_points.html
new file mode 100644
index 0000000000..ed753da5a9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_interleaved_points.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [5, 6]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_interleaved_triangles.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_interleaved_triangles.html
new file mode 100644
index 0000000000..fc1f239126
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_interleaved_triangles.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [7, 8]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_separate_lines.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_separate_lines.html
new file mode 100644
index 0000000000..191655141e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_separate_lines.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [3, 4]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_separate_points.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_separate_points.html
new file mode 100644
index 0000000000..64be415928
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_separate_points.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [2, 3]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_separate_triangles.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_separate_triangles.html
new file mode 100644
index 0000000000..1d73630fb3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/basic_types_separate_triangles.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [4, 5]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/interpolation_centroid.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/interpolation_centroid.html
new file mode 100644
index 0000000000..ebceb16db2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/interpolation_centroid.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [22, 23]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/interpolation_flat.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/interpolation_flat.html
new file mode 100644
index 0000000000..5a3529867d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/interpolation_flat.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [21, 22]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/interpolation_smooth.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/interpolation_smooth.html
new file mode 100644
index 0000000000..39464ee263
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/interpolation_smooth.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [20, 21]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/point_size.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/point_size.html
new file mode 100644
index 0000000000..b6391bff6b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/point_size.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [1, 2]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/position.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/position.html
new file mode 100644
index 0000000000..6b4dc6f0ee
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/position.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [0, 1]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_interleaved_lines.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_interleaved_lines.html
new file mode 100644
index 0000000000..7f63bfdcf7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_interleaved_lines.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [27, 28]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_interleaved_points.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_interleaved_points.html
new file mode 100644
index 0000000000..039029c0a9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_interleaved_points.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [26, 27]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_interleaved_triangles.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_interleaved_triangles.html
new file mode 100644
index 0000000000..57798a4356
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_interleaved_triangles.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [28, 29]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_separate_lines.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_separate_lines.html
new file mode 100644
index 0000000000..66bfea802f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_separate_lines.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [24, 25]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_separate_points.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_separate_points.html
new file mode 100644
index 0000000000..3cd6f520ae
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_separate_points.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [23, 24]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_separate_triangles.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_separate_triangles.html
new file mode 100644
index 0000000000..ab221ef053
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/random_separate_triangles.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [25, 26]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/transformfeedback_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/transformfeedback_test_generator.py
new file mode 100644
index 0000000000..cf89cb1cab
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/transformfeedback_test_generator.py
@@ -0,0 +1,118 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2019 The Khronos Group Inc.
+# Use of this source code is governed by an MIT-style license that can be
+# found in the LICENSE.txt file.
+
+"""
+ Generator for textureformat* tests.
+ This file needs to be run in its folder.
+"""
+
+import sys
+
+_DO_NOT_EDIT_WARNING = """<!--
+
+This file is auto-generated from textureshadow_test_generator.py
+DO NOT EDIT!
+
+-->
+
+"""
+
+_HTML_TEMPLATE = """<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Transform Feedback Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fTransformFeedbackTests');</script>
+<script>goog.require('framework.opengl.gluVarTypeUtil');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="320" height="240"></canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', {preserveDrawingBuffer: true}, 2);
+
+functional.gles3.es3fTransformFeedbackTests.run(gl, [%(start)s, %(end)s]);
+</script>
+</body>
+</html>
+"""
+
+_GROUPS = [
+ 'position',
+ 'point_size',
+ 'basic_types_separate_points',
+ 'basic_types_separate_lines',
+ 'basic_types_separate_triangles',
+ 'basic_types_interleaved_points',
+ 'basic_types_interleaved_lines',
+ 'basic_types_interleaved_triangles',
+ 'array_separate_points',
+ 'array_separate_lines',
+ 'array_separate_triangles',
+ 'array_interleaved_points',
+ 'array_interleaved_lines',
+ 'array_interleaved_triangles',
+ 'array_element_separate_points',
+ 'array_element_separate_lines',
+ 'array_element_separate_triangles',
+ 'array_element_interleaved_points',
+ 'array_element_interleaved_lines',
+ 'array_element_interleaved_triangles',
+ 'interpolation_smooth',
+ 'interpolation_flat',
+ 'interpolation_centroid',
+ 'random_separate_points',
+ 'random_separate_lines',
+ 'random_separate_triangles',
+ 'random_interleaved_points',
+ 'random_interleaved_lines',
+ 'random_interleaved_triangles'
+]
+
+def GenerateFilename(group):
+ """Generate test filename."""
+ filename = group
+ filename += ".html"
+ return filename
+
+def WriteTest(filename, start, end):
+ """Write one test."""
+ file = open(filename, "wb")
+ file.write(_DO_NOT_EDIT_WARNING)
+ file.write(_HTML_TEMPLATE % {
+ 'start': start,
+ 'end': end
+ })
+ file.close
+
+def GenerateTests():
+ """Generate all tests."""
+ filelist = []
+ for i in xrange(len(_GROUPS)):
+ groupname = _GROUPS[i]
+ filename = GenerateFilename(groupname)
+ filelist.append(filename)
+ WriteTest(filename, i, i+1)
+ return filelist
+
+def GenerateTestList(filelist):
+ file = open("00_test_list.txt", "wb")
+ file.write('\n'.join(filelist))
+ file.close
+
+def main(argv):
+ """This is the main function."""
+ filelist = GenerateTests()
+ GenerateTestList(filelist)
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi.html
new file mode 100644
index 0000000000..7ab136f5f6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Uniform API Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fUniformApiTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fUniformApiTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/00_test_list.txt
new file mode 100644
index 0000000000..98735207bf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/00_test_list.txt
@@ -0,0 +1,4 @@
+info_query.html
+value_initial.html
+value_assigned.html
+random.html \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/info_query.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/info_query.html
new file mode 100644
index 0000000000..cb777e875f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/info_query.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from uniformapi_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Uniform API Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fUniformApiTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fUniformApiTests.run(gl, [0, 1]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/random.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/random.html
new file mode 100644
index 0000000000..69a20c6d4b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/random.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from uniformapi_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Uniform API Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fUniformApiTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fUniformApiTests.run(gl, [3, 4]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/uniformapi_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/uniformapi_test_generator.py
new file mode 100644
index 0000000000..2092c562d2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/uniformapi_test_generator.py
@@ -0,0 +1,92 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2019 The Khronos Group Inc.
+# Use of this source code is governed by an MIT-style license that can be
+# found in the LICENSE.txt file.
+
+"""
+ Generator for uniformapi* tests.
+ This file needs to be run in its folder.
+"""
+
+import sys
+
+_DO_NOT_EDIT_WARNING = """<!--
+
+This file is auto-generated from uniformapi_test_generator.py
+DO NOT EDIT!
+
+-->
+
+"""
+
+_HTML_TEMPLATE = """<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Uniform API Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fUniformApiTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fUniformApiTests.run(gl, [%(start)s, %(end)s]);
+</script>
+</body>
+</html>
+"""
+
+_GROUPS = [
+ 'info_query',
+ 'value_initial',
+ 'value_assigned',
+ 'random',
+]
+
+def GenerateFilename(group):
+ """Generate test filename."""
+ filename = group
+ filename += ".html"
+ return filename
+
+def WriteTest(filename, start, end):
+ """Write one test."""
+ file = open(filename, "wb")
+ file.write(_DO_NOT_EDIT_WARNING)
+ file.write(_HTML_TEMPLATE % {
+ 'start': start,
+ 'end': end
+ })
+ file.close
+
+def GenerateTests():
+ """Generate all tests."""
+ filelist = []
+ for ii in range(len(_GROUPS)):
+ filename = GenerateFilename(_GROUPS[ii])
+ filelist.append(filename)
+ WriteTest(filename, ii, ii + 1)
+ return filelist
+
+def GenerateTestList(filelist):
+ file = open("00_test_list.txt", "wb")
+ file.write('\n'.join(filelist))
+ file.close
+
+def main(argv):
+ """This is the main function."""
+ filelist = GenerateTests()
+ GenerateTestList(filelist)
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/value_assigned.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/value_assigned.html
new file mode 100644
index 0000000000..9cce796e6b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/value_assigned.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from uniformapi_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Uniform API Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fUniformApiTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fUniformApiTests.run(gl, [2, 3]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/value_initial.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/value_initial.html
new file mode 100644
index 0000000000..0244c70cd9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/value_initial.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from uniformapi_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Uniform API Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fUniformApiTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fUniformApiTests.run(gl, [1, 2]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/00_test_list.txt
new file mode 100644
index 0000000000..dd35e89981
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/00_test_list.txt
@@ -0,0 +1,10 @@
+single_basic_type.html
+single_basic_array.html
+single_struct.html
+single_struct_array.html
+single_nested_struct.html
+single_nested_struct_array.html
+instance_array_basic_type.html
+multi_basic_types.html
+multi_nested_struct.html
+random.html \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/instance_array_basic_type.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/instance_array_basic_type.html
new file mode 100644
index 0000000000..8b768722b4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/instance_array_basic_type.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from uniformbuffers_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Uniform Block Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fUniformBlockTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fUniformBlockTests.run([6, 7]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/multi_basic_types.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/multi_basic_types.html
new file mode 100644
index 0000000000..205e276ff7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/multi_basic_types.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from uniformbuffers_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Uniform Block Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fUniformBlockTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fUniformBlockTests.run([7, 8]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/multi_nested_struct.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/multi_nested_struct.html
new file mode 100644
index 0000000000..115256955e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/multi_nested_struct.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from uniformbuffers_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Uniform Block Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fUniformBlockTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fUniformBlockTests.run([8, 9]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/random.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/random.html
new file mode 100644
index 0000000000..a1d1bf6858
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/random.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from uniformbuffers_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Uniform Block Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fUniformBlockTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fUniformBlockTests.run([9, 10]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_basic_array.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_basic_array.html
new file mode 100644
index 0000000000..3458c3918b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_basic_array.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from uniformbuffers_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Uniform Block Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fUniformBlockTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fUniformBlockTests.run([1, 2]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_basic_type.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_basic_type.html
new file mode 100644
index 0000000000..a0ebbed798
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_basic_type.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from uniformbuffers_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Uniform Block Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fUniformBlockTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fUniformBlockTests.run([0, 1]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_nested_struct.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_nested_struct.html
new file mode 100644
index 0000000000..7a33d8731a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_nested_struct.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from uniformbuffers_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Uniform Block Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fUniformBlockTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fUniformBlockTests.run([4, 5]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_nested_struct_array.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_nested_struct_array.html
new file mode 100644
index 0000000000..006fdf9cd3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_nested_struct_array.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from uniformbuffers_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Uniform Block Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fUniformBlockTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fUniformBlockTests.run([5, 6]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_struct.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_struct.html
new file mode 100644
index 0000000000..4977f64919
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_struct.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from uniformbuffers_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Uniform Block Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fUniformBlockTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fUniformBlockTests.run([2, 3]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_struct_array.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_struct_array.html
new file mode 100644
index 0000000000..cb39bbfec5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/single_struct_array.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from uniformbuffers_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Uniform Block Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fUniformBlockTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fUniformBlockTests.run([3, 4]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/uniformbuffers_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/uniformbuffers_test_generator.py
new file mode 100644
index 0000000000..dbf97f7ff8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/uniformbuffers_test_generator.py
@@ -0,0 +1,98 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2019 The Khronos Group Inc.
+# Use of this source code is governed by an MIT-style license that can be
+# found in the LICENSE.txt file.
+
+"""
+ Generator for uniformbuffers* tests.
+ This file needs to be run in its folder.
+"""
+
+import sys
+
+_DO_NOT_EDIT_WARNING = """<!--
+
+This file is auto-generated from uniformbuffers_test_generator.py
+DO NOT EDIT!
+
+-->
+
+"""
+
+_HTML_TEMPLATE = """<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Uniform Block Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fUniformBlockTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fUniformBlockTests.run([%(start)s, %(end)s]);
+</script>
+</body>
+</html>
+"""
+
+_GROUPS = [
+ 'single_basic_type',
+ 'single_basic_array',
+ 'single_struct',
+ 'single_struct_array',
+ 'single_nested_struct',
+ 'single_nested_struct_array',
+ 'instance_array_basic_type',
+ 'multi_basic_types',
+ 'multi_nested_struct',
+ 'random',
+]
+
+def GenerateFilename(group):
+ """Generate test filename."""
+ filename = group
+ filename += ".html"
+ return filename
+
+def WriteTest(filename, start, end):
+ """Write one test."""
+ file = open(filename, "wb")
+ file.write(_DO_NOT_EDIT_WARNING)
+ file.write(_HTML_TEMPLATE % {
+ 'start': start,
+ 'end': end
+ })
+ file.close
+
+def GenerateTests():
+ """Generate all tests."""
+ filelist = []
+ for ii in range(len(_GROUPS)):
+ filename = GenerateFilename(_GROUPS[ii])
+ filelist.append(filename)
+ WriteTest(filename, ii, ii + 1)
+ return filelist
+
+def GenerateTestList(filelist):
+ file = open("00_test_list.txt", "wb")
+ file.write('\n'.join(filelist))
+ file.close
+
+def main(argv):
+ """This is the main function."""
+ filelist = GenerateTests()
+ GenerateTestList(filelist)
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrayobject.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrayobject.html
new file mode 100644
index 0000000000..e6888b059e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrayobject.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Vertex Array Object Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../closure-library/closure/goog/base.js"></script>
+<script src="../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fVertexArrayObjectTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fVertexArrayObjectTests.run(gl);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/00_test_list.txt
new file mode 100644
index 0000000000..f06de02f82
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/00_test_list.txt
@@ -0,0 +1,27 @@
+single_attribute.stride.html
+single_attribute.normalize.html
+single_attribute.output_type.float.html
+single_attribute.output_type.short.html
+single_attribute.output_type.byte.html
+single_attribute.output_type.unsigned_short.html
+single_attribute.output_type.unsigned_byte.html
+single_attribute.output_type.unsigned_int.html
+single_attribute.output_type.int.html
+single_attribute.output_type.half.html
+single_attribute.output_type.unsigned_int_2_10_10_10.html
+single_attribute.output_type.int_2_10_10_10.html
+single_attribute.usage.static_draw.html
+single_attribute.usage.stream_draw.html
+single_attribute.usage.dynamic_draw.html
+single_attribute.usage.static_copy.html
+single_attribute.usage.stream_copy.html
+single_attribute.usage.dynamic_copy.html
+single_attribute.usage.static_read.html
+single_attribute.usage.stream_read.html
+single_attribute.usage.dynamic_read.html
+single_attribute.offset.html
+single_attribute.first.html
+multiple_attributes.count.html
+multiple_attributes.storage.html
+multiple_attributes.stride.html
+multiple_attributes.output.html \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.count.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.count.html
new file mode 100644
index 0000000000..be380c95ee
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.count.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from vertexarrays_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Vertex Arrays Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fVertexArrayTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fVertexArrayTests.run(gl, [23, 24]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.output.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.output.html
new file mode 100644
index 0000000000..37ff4a8420
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.output.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from vertexarrays_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Vertex Arrays Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fVertexArrayTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fVertexArrayTests.run(gl, [26, 27]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.storage.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.storage.html
new file mode 100644
index 0000000000..2dda458009
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.storage.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from vertexarrays_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Vertex Arrays Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fVertexArrayTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fVertexArrayTests.run(gl, [24, 25]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.stride.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.stride.html
new file mode 100644
index 0000000000..8913a2d93f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/multiple_attributes.stride.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from vertexarrays_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Vertex Arrays Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fVertexArrayTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fVertexArrayTests.run(gl, [25, 26]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.first.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.first.html
new file mode 100644
index 0000000000..dd2b1a23b7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.first.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from vertexarrays_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Vertex Arrays Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fVertexArrayTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fVertexArrayTests.run(gl, [22, 23]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.normalize.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.normalize.html
new file mode 100644
index 0000000000..c92890a97c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.normalize.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from vertexarrays_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Vertex Arrays Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fVertexArrayTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fVertexArrayTests.run(gl, [1, 2]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.offset.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.offset.html
new file mode 100644
index 0000000000..6b9286c1ab
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.offset.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from vertexarrays_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Vertex Arrays Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fVertexArrayTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fVertexArrayTests.run(gl, [21, 22]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.byte.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.byte.html
new file mode 100644
index 0000000000..0babde2587
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.byte.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from vertexarrays_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Vertex Arrays Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fVertexArrayTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fVertexArrayTests.run(gl, [4, 5]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.float.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.float.html
new file mode 100644
index 0000000000..a4cd67561b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.float.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from vertexarrays_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Vertex Arrays Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fVertexArrayTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fVertexArrayTests.run(gl, [2, 3]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.half.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.half.html
new file mode 100644
index 0000000000..95740244a7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.half.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from vertexarrays_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Vertex Arrays Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fVertexArrayTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fVertexArrayTests.run(gl, [9, 10]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.int.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.int.html
new file mode 100644
index 0000000000..ec3f4903c1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.int.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from vertexarrays_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Vertex Arrays Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fVertexArrayTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fVertexArrayTests.run(gl, [8, 9]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.int_2_10_10_10.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.int_2_10_10_10.html
new file mode 100644
index 0000000000..95eff6d999
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.int_2_10_10_10.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from vertexarrays_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Vertex Arrays Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fVertexArrayTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fVertexArrayTests.run(gl, [11, 12]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.short.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.short.html
new file mode 100644
index 0000000000..ff6cbffa9f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.short.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from vertexarrays_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Vertex Arrays Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fVertexArrayTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fVertexArrayTests.run(gl, [3, 4]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_byte.html
new file mode 100644
index 0000000000..1ef3deb9d5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_byte.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from vertexarrays_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Vertex Arrays Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fVertexArrayTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fVertexArrayTests.run(gl, [6, 7]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_int.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_int.html
new file mode 100644
index 0000000000..efff6a628e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_int.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from vertexarrays_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Vertex Arrays Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fVertexArrayTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fVertexArrayTests.run(gl, [7, 8]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_int_2_10_10_10.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_int_2_10_10_10.html
new file mode 100644
index 0000000000..9b90ae1ed7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_int_2_10_10_10.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from vertexarrays_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Vertex Arrays Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fVertexArrayTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fVertexArrayTests.run(gl, [10, 11]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_short.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_short.html
new file mode 100644
index 0000000000..bf56c355ac
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.output_type.unsigned_short.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from vertexarrays_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Vertex Arrays Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fVertexArrayTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fVertexArrayTests.run(gl, [5, 6]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.stride.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.stride.html
new file mode 100644
index 0000000000..46bd9e2036
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.stride.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from vertexarrays_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Vertex Arrays Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fVertexArrayTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fVertexArrayTests.run(gl, [0, 1]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.dynamic_copy.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.dynamic_copy.html
new file mode 100644
index 0000000000..347834c74c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.dynamic_copy.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from vertexarrays_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Vertex Arrays Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fVertexArrayTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fVertexArrayTests.run(gl, [17, 18]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.dynamic_draw.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.dynamic_draw.html
new file mode 100644
index 0000000000..dab5982daf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.dynamic_draw.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from vertexarrays_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Vertex Arrays Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fVertexArrayTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fVertexArrayTests.run(gl, [14, 15]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.dynamic_read.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.dynamic_read.html
new file mode 100644
index 0000000000..8d868ce6a1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.dynamic_read.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from vertexarrays_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Vertex Arrays Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fVertexArrayTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fVertexArrayTests.run(gl, [20, 21]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.static_copy.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.static_copy.html
new file mode 100644
index 0000000000..0c1c286164
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.static_copy.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from vertexarrays_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Vertex Arrays Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fVertexArrayTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fVertexArrayTests.run(gl, [15, 16]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.static_draw.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.static_draw.html
new file mode 100644
index 0000000000..eb3bb61265
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.static_draw.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from vertexarrays_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Vertex Arrays Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fVertexArrayTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fVertexArrayTests.run(gl, [12, 13]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.static_read.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.static_read.html
new file mode 100644
index 0000000000..bfed3a9bfa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.static_read.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from vertexarrays_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Vertex Arrays Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fVertexArrayTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fVertexArrayTests.run(gl, [18, 19]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.stream_copy.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.stream_copy.html
new file mode 100644
index 0000000000..f7c63d107f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.stream_copy.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from vertexarrays_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Vertex Arrays Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fVertexArrayTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fVertexArrayTests.run(gl, [16, 17]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.stream_draw.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.stream_draw.html
new file mode 100644
index 0000000000..238ce5e14e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.stream_draw.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from vertexarrays_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Vertex Arrays Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fVertexArrayTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fVertexArrayTests.run(gl, [13, 14]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.stream_read.html b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.stream_read.html
new file mode 100644
index 0000000000..6dd2a736c6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/single_attribute.usage.stream_read.html
@@ -0,0 +1,31 @@
+<!--
+
+This file is auto-generated from vertexarrays_test_generator.py
+DO NOT EDIT!
+
+-->
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Vertex Arrays Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fVertexArrayTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fVertexArrayTests.run(gl, [19, 20]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/vertexarrays_test_generator.py b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/vertexarrays_test_generator.py
new file mode 100644
index 0000000000..de781ccafc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/vertexarrays_test_generator.py
@@ -0,0 +1,110 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2019 The Khronos Group Inc.
+# Use of this source code is governed by an MIT-style license that can be
+# found in the LICENSE.txt file.
+
+"""
+ Generator for vertexarrays* tests.
+ This file needs to be run in its folder.
+"""
+
+import sys
+
+_DO_NOT_EDIT_WARNING = """<!--
+
+This file is auto-generated from vertexarrays_test_generator.py
+DO NOT EDIT!
+
+-->
+
+"""
+
+_HTML_TEMPLATE = """<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>WebGL Vertex Arrays Conformance Tests</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css"/>
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+
+<script src="../../../../closure-library/closure/goog/base.js"></script>
+<script src="../../../deqp-deps.js"></script>
+<script>goog.require('functional.gles3.es3fVertexArrayTests');</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="200" height="100"> </canvas>
+<script>
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('canvas', null, 2);
+
+functional.gles3.es3fVertexArrayTests.run(gl, [%(start)s, %(end)s]);
+</script>
+</body>
+</html>
+"""
+
+_GROUPS = [
+ 'single_attribute.stride',
+ 'single_attribute.normalize',
+ 'single_attribute.output_type.float',
+ 'single_attribute.output_type.short',
+ 'single_attribute.output_type.byte',
+ 'single_attribute.output_type.unsigned_short',
+ 'single_attribute.output_type.unsigned_byte',
+ 'single_attribute.output_type.unsigned_int',
+ 'single_attribute.output_type.int',
+ 'single_attribute.output_type.half',
+ 'single_attribute.output_type.unsigned_int_2_10_10_10',
+ 'single_attribute.output_type.int_2_10_10_10',
+ 'single_attribute.usage.static_draw',
+ 'single_attribute.usage.stream_draw',
+ 'single_attribute.usage.dynamic_draw',
+ 'single_attribute.usage.static_copy',
+ 'single_attribute.usage.stream_copy',
+ 'single_attribute.usage.dynamic_copy',
+ 'single_attribute.usage.static_read',
+ 'single_attribute.usage.stream_read',
+ 'single_attribute.usage.dynamic_read',
+ 'single_attribute.offset',
+ 'single_attribute.first',
+ 'multiple_attributes.count',
+ 'multiple_attributes.storage',
+ 'multiple_attributes.stride',
+ 'multiple_attributes.output',
+]
+
+def WriteTest(filename, start, end):
+ """Write one test."""
+ file = open(filename, "wb")
+ file.write(_DO_NOT_EDIT_WARNING)
+ file.write(_HTML_TEMPLATE % {
+ 'start': start,
+ 'end': end
+ })
+ file.close
+
+def GenerateTests():
+ """Generate all tests."""
+ filelist = []
+ ii = 0
+ for ii in range(len(_GROUPS)):
+ filename = _GROUPS[ii] + ".html"
+ filelist.append(filename)
+ WriteTest(filename, ii, ii + 1)
+ return filelist
+
+def GenerateTestList(filelist):
+ file = open("00_test_list.txt", "wb")
+ file.write('\n'.join(filelist))
+ file.close
+
+def main(argv):
+ """This is the main function."""
+ filelist = GenerateTests()
+ GenerateTestList(filelist)
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/genHTMLfromTest.py b/dom/canvas/test/webgl-conf/checkout/deqp/genHTMLfromTest.py
new file mode 100644
index 0000000000..47ad28ccc9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/genHTMLfromTest.py
@@ -0,0 +1,43 @@
+import os
+import re
+
+# Generate an HTML file for each .test file in the current directory
+#
+
+TEST_LIST_FILE = '00_test_list.txt';
+TEMPLATE = 'template.html';
+
+def genHTML(template, test):
+ contents = re.sub('___TEST_NAME___', "'" + test + "'", template);
+ filename = test + '.html';
+ print "Generating " + filename;
+ with open(test + '.html', 'w') as f:
+ f.write(contents);
+ return filename;
+
+
+def process_test_files(template):
+ generated = [];
+ files = os.listdir(os.getcwd());
+ for file in files:
+ found = re.search('(^[^.].*)\.test$', file);
+ if found:
+ generated.append(genHTML(template,found.group(1)));
+ return generated;
+
+def readTemplate():
+ contents = None;
+ with open(TEMPLATE, 'r') as f:
+ contents = f.read();
+ return contents;
+
+
+template = readTemplate();
+if (template):
+ test_list = process_test_files(template);
+ print "Generating " + TEST_LIST_FILE;
+ with open(TEST_LIST_FILE, 'w') as f:
+ for item in test_list:
+ f.write(item + '\n');
+else:
+ print "Couldn't find template file: " + TEMPLATE;
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsAttributeLocationTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsAttributeLocationTests.js
new file mode 100644
index 0000000000..5ba033ffc0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsAttributeLocationTests.js
@@ -0,0 +1,1477 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL (ES) Module
+ * -----------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief Attribute location tests
+ *//*--------------------------------------------------------------------*/
+
+'use strict';
+goog.provide('modules.shared.glsAttributeLocationTests');
+goog.require('framework.common.tcuStringTemplate');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.opengl.gluShaderUtil');
+
+goog.scope(function() {
+
+ var glsAttributeLocationTests = modules.shared.glsAttributeLocationTests;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var tcuStringTemplate = framework.common.tcuStringTemplate;
+
+ /**
+ * @param {Array<number>} bindings
+ * @param {string} attrib
+ * @return {number}
+ */
+ glsAttributeLocationTests.getBoundLocation = function(bindings, attrib) {
+ return (bindings[attrib] === undefined ? glsAttributeLocationTests.LocationEnum.UNDEF : bindings[attrib]);
+ };
+
+ /**
+ * @param {Array<glsAttributeLocationTests.Attribute>} attributes
+ * @param {Array<number>} bindings
+ * @return {boolean}
+ */
+ glsAttributeLocationTests.hasAttributeAliasing = function(attributes, bindings) {
+ /** @type {Array<boolean>} */ var reservedSpaces = [];
+
+ /** @type {number} */ var location;
+ /** @type {number} */ var size;
+
+ for (var attribNdx = 0; attribNdx < attributes.length; attribNdx++) {
+ location = glsAttributeLocationTests.getBoundLocation(bindings, attributes[attribNdx].getName());
+ size = attributes[attribNdx].getType().getLocationSize();
+
+ if (location != glsAttributeLocationTests.LocationEnum.UNDEF) {
+
+ for (var i = 0; i < size; i++) {
+ if (reservedSpaces[location + i])
+ return true;
+ reservedSpaces[location + i] = true;
+ }
+ }
+ }
+
+ return false;
+ };
+
+ /**
+ * @return {number}
+ */
+ glsAttributeLocationTests.getMaxAttributeLocations = function() {
+ /** @type {number} */ var maxAttribs;
+ maxAttribs = /** @type {number} */ (gl.getParameter(gl.MAX_VERTEX_ATTRIBS));
+ return maxAttribs;
+ };
+
+ /**
+ * @param {Array<glsAttributeLocationTests.Attribute>} attributes
+ * @return {string}
+ */
+ glsAttributeLocationTests.generateAttributeDefinitions = function(attributes) {
+ /** @type {string} */ var src = '';
+
+ for (var i = 0; i < attributes.length; i++) {
+ if (attributes[i].getLayoutLocation() != glsAttributeLocationTests.LocationEnum.UNDEF)
+ src += ('layout(location = ' + attributes[i].getLayoutLocation() + ') ');
+
+ src += '${VTX_INPUT} mediump ';
+ src += (attributes[i].getType().getName() + ' ');
+ src += attributes[i].getName();
+ src += (attributes[i].getArraySize() != glsAttributeLocationTests.ArrayEnum.NOT ?
+ '[' + attributes[i].getArraySize() + ']' : '');
+ src += ';\n';
+ }
+
+ return src;
+ };
+
+ /**
+ * @param {Array<glsAttributeLocationTests.Attribute>} attributes
+ * @return {string}
+ */
+ glsAttributeLocationTests.generateConditionUniformDefinitions = function(attributes) {
+ /** @type {string} */ var src = '';
+ /** @type {Array<string>} */ var conditions = [];
+
+ for (var i = 0; i < attributes.length; i++) {
+ if (attributes[i].getCondition().notEquals(glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.NEVER)) &&
+ attributes[i].getCondition().notEquals(glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS)))
+ if (conditions.indexOf(attributes[i].getCondition().getName()) == -1)
+ conditions.push(attributes[i].getCondition().getName());
+ }
+
+ for (var i = 0; i < conditions.length; i++)
+ src += ('uniform mediump float u_' + conditions[i] + ';\n');
+
+ return src;
+ };
+
+ /**
+ * @param {glsAttributeLocationTests.Attribute} attrib
+ * @param {number=} id
+ * @return {string}
+ */
+ glsAttributeLocationTests.generateToVec4Expression = function(attrib, id) {
+ /** @type {string} */ var src = '';
+ id = id === undefined ? -1 : id;
+
+ /** @type {string} */
+ var variableName = (attrib.getName() + (attrib.getArraySize() != glsAttributeLocationTests.ArrayEnum.NOT ? '[' + id + ']' : ''));
+
+ switch (attrib.getType().getGLTypeEnum()) {
+ case gl.INT_VEC2:
+ case gl.UNSIGNED_INT_VEC2:
+ case gl.FLOAT_VEC2:
+ src += ('vec4(' + variableName + '.xy, ' + variableName + '.yx)');
+ break;
+
+ case gl.INT_VEC3:
+ case gl.UNSIGNED_INT_VEC3:
+ case gl.FLOAT_VEC3:
+ src += ('vec4(' + variableName + '.xyz, ' + variableName + '.x)');
+ break;
+
+ default:
+ src += ('vec4(' + variableName + ')');
+ break;
+ }
+
+ return src;
+ };
+
+ /**
+ * @param {Array<glsAttributeLocationTests.Attribute>} attributes
+ * @return {string}
+ */
+ glsAttributeLocationTests.generateOutputCode = function(attributes) {
+ /** @type {string} */ var src = '';
+
+ for (var i = 0; i < attributes.length; i++) {
+ if (attributes[i].getCondition().equals(glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.NEVER))) {
+ src += '\tif (0 != 0)\n\t{\n';
+
+ if (attributes[i].getArraySize() == glsAttributeLocationTests.ArrayEnum.NOT)
+ src += ('\t\tcolor += ' + glsAttributeLocationTests.generateToVec4Expression(attributes[i]) + ';\n');
+ else {
+ for (var j = 0; j < attributes[i].getArraySize(); i++)
+ src += ('\t\tcolor += ' + glsAttributeLocationTests.generateToVec4Expression(attributes[i], j) + ';\n');
+ }
+
+ src += '\t}\n';
+ } else if (attributes[i].getCondition().equals(glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS))) {
+ if (attributes[i].getArraySize() == glsAttributeLocationTests.ArrayEnum.NOT)
+ src += ('\tcolor += ' + glsAttributeLocationTests.generateToVec4Expression(attributes[i]) + ';\n');
+ else {
+ for (var j = 0; j < attributes[i].getArraySize(); j++)
+ src += ('\tcolor += ' + glsAttributeLocationTests.generateToVec4Expression(attributes[i], j) + ';\n');
+ }
+ } else {
+ src += ('\tif (u_' + attributes[i].getCondition().getName() + (attributes[i].getCondition().getNegate() ? ' != ' : ' == ') + '0.0)\n');
+ src += '\t{\n';
+
+ if (attributes[i].getArraySize() == glsAttributeLocationTests.ArrayEnum.NOT)
+ src += ('\t\tcolor += ' + glsAttributeLocationTests.generateToVec4Expression(attributes[i]) + ';\n');
+ else {
+ for (var j = 0; j < attributes[i].getArraySize(); i++)
+ src += ('\t\tcolor += ' + glsAttributeLocationTests.generateToVec4Expression(attributes[i], j) + ';\n');
+ }
+
+ src += '\t}\n';
+ }
+ }
+
+ return src;
+ };
+
+ /**
+ * @param {Array<glsAttributeLocationTests.Attribute>} attributes
+ * @return {string}
+ */
+ glsAttributeLocationTests.generateVertexShaderTemplate = function(attributes) {
+ /** @type {string} */ var src = '';
+
+ src = '${VERSION}\n' +
+ '${VTX_OUTPUT} mediump vec4 v_color;\n' +
+ glsAttributeLocationTests.generateAttributeDefinitions(attributes) +
+ '\n' +
+ glsAttributeLocationTests.generateConditionUniformDefinitions(attributes) +
+ '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ '\tmediump vec4 color = vec4(0.0);\n' +
+ '\n' +
+ glsAttributeLocationTests.generateOutputCode(attributes) +
+ '\n' +
+ '\tv_color = color;\n' +
+ '\tgl_Position = color;\n' +
+ '}\n';
+
+ return src;
+ };
+
+ /**
+ * @param {Array<glsAttributeLocationTests.Attribute>} attributes
+ * @param {boolean} attributeAliasing
+ * @return {string}
+ */
+ glsAttributeLocationTests.createVertexShaderSource = function(attributes, attributeAliasing) {
+ // \note On GLES only GLSL #version 100 supports aliasing
+ /** @type {gluShaderUtil.GLSLVersion} */ var glslVersion = gluShaderUtil.getGLSLVersion(gl);
+ glslVersion = attributeAliasing ? gluShaderUtil.GLSLVersion.V100_ES : glslVersion;
+ /** @type {boolean} */ var usesInOutQualifiers = gluShaderUtil.glslVersionUsesInOutQualifiers(glslVersion);
+ /** @type {string} */ var vertexShaderTemplate = glsAttributeLocationTests.generateVertexShaderTemplate(attributes);
+
+ /** @type {Array<string>} */ var parameters = [];
+
+ parameters['VERSION'] = gluShaderUtil.getGLSLVersionDeclaration(glslVersion);
+ parameters['VTX_OUTPUT'] = usesInOutQualifiers ? 'out' : 'varying';
+ parameters['VTX_INPUT'] = usesInOutQualifiers ? 'in' : 'attribute';
+ parameters['FRAG_INPUT'] = usesInOutQualifiers ? 'in' : 'varying';
+ parameters['FRAG_OUTPUT_VAR'] = usesInOutQualifiers ? 'dEQP_FragColor' : 'gl_FragColor';
+ parameters['FRAG_OUTPUT_DECLARATION'] = usesInOutQualifiers ? 'layout(location=0) out mediump vec4 dEQP_FragColor;' : '';
+
+ return tcuStringTemplate.specialize(vertexShaderTemplate, parameters);
+ };
+
+ /**
+ * @param {boolean} attributeAliasing
+ * @return {string}
+ */
+ glsAttributeLocationTests.createFragmentShaderSource = function(attributeAliasing) {
+ /** @type {string} */ var fragmentShaderSource = '';
+ fragmentShaderSource = '${VERSION}\n' +
+ '${FRAG_OUTPUT_DECLARATION}\n' +
+ '${FRAG_INPUT} mediump vec4 v_color;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ '\t${FRAG_OUTPUT_VAR} = v_color;\n' +
+ '}\n';
+
+ // \note On GLES only GLSL #version 100 supports aliasing
+ /** @type {gluShaderUtil.GLSLVersion} */ var glslVersion = gluShaderUtil.getGLSLVersion(gl);
+ glslVersion = attributeAliasing ? gluShaderUtil.GLSLVersion.V100_ES : glslVersion;
+ /** @type {boolean} */ var usesInOutQualifiers = gluShaderUtil.glslVersionUsesInOutQualifiers(glslVersion);
+
+ /** @type {Array<string>} */ var parameters = [];
+
+ parameters['VERSION'] = gluShaderUtil.getGLSLVersionDeclaration(glslVersion);
+ parameters['VTX_OUTPUT'] = usesInOutQualifiers ? 'out' : 'varying';
+ parameters['VTX_INPUT'] = usesInOutQualifiers ? 'in' : 'attribute';
+ parameters['FRAG_INPUT'] = usesInOutQualifiers ? 'in' : 'varying';
+ parameters['FRAG_OUTPUT_VAR'] = usesInOutQualifiers ? 'dEQP_FragColor' : 'gl_FragColor';
+ parameters['FRAG_OUTPUT_DECLARATION'] = usesInOutQualifiers ? 'layout(location=0) out mediump vec4 dEQP_FragColor;' : '';
+
+ return tcuStringTemplate.specialize(fragmentShaderSource, parameters);
+ };
+
+ glsAttributeLocationTests.logProgram = function(program) {
+ var programLinkOk = /** @type {boolean} */ (gl.getProgramParameter(program, gl.LINK_STATUS));
+ /**@type{string} */ var programInfoLog = gl.getProgramInfoLog(program);
+ /**@type{string} */ var log = 'Program Link Info: ' + programInfoLog +
+ 'Link result: ' + (programLinkOk ? 'Ok' : 'Fail');
+
+ bufferedLogToConsole(log);
+ };
+
+ glsAttributeLocationTests.logAttributes = function(attributes) {
+ /**@type{string} */ var log;
+ for (var i = 0; i < attributes.length; i++) {
+
+ log = 'Type: ' + attributes[i].getType().getName() +
+ ', Name: ' + attributes[i].getName() +
+ (attributes[i].getLayoutLocation() != glsAttributeLocationTests.LocationEnum.UNDEF ? ', Layout location ' + attributes[i].getLayoutLocation() : '');
+
+ bufferedLogToConsole(log);
+ }
+ };
+
+ /**
+ * @param {string} vertexShaderSource
+ * @param {string} vertexShaderInfoLog
+ * @param {boolean} vertexCompileOk
+ * @param {string} fragmentShaderSource
+ * @param {string} fragmentShaderInfoLog
+ * @param {boolean} fragmentCompileOk
+ */
+ glsAttributeLocationTests.logShaders = function(vertexShaderSource, vertexShaderInfoLog, vertexCompileOk, fragmentShaderSource, fragmentShaderInfoLog, fragmentCompileOk) {
+
+ /**@type{string} */ var log;
+ log = '\nVertex Shader Info: ' +
+ vertexShaderSource +
+ '\nInfo Log: ' +
+ vertexShaderInfoLog +
+ '\nCompilation result: ' + (vertexCompileOk ? 'Ok' : 'Failed') +
+
+ '\nFragment Shader Info: ' +
+ fragmentShaderSource +
+ '\nInfo Log: ' +
+ fragmentShaderInfoLog +
+ '\nCompilation result: ' + (fragmentCompileOk ? 'Ok' : 'Failed');
+
+ bufferedLogToConsole(log);
+ };
+
+ /**
+ * @param {WebGLProgram} program
+ * @param {Array<glsAttributeLocationTests.Attribute>} attributes
+ * @return {boolean}
+ */
+ glsAttributeLocationTests.checkActiveAttribQuery = function(program, attributes) {
+ /** @type {number} */ var activeAttribCount = 0;
+ /** @type {Array<string>} */ var activeAttributes = [];
+ /** @type {boolean} */ var isOk = true;
+ /** @type {string} */ var log;
+
+ activeAttribCount = /** @type {number} */ (gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES));
+
+ /** @type {glsAttributeLocationTests.Attribute} */ var attrib;
+ /** @type {boolean} */ var isActive;
+ /** @type {WebGLActiveInfo} */ var activeInfo;
+
+ for (var activeAttribNdx = 0; activeAttribNdx < activeAttribCount; activeAttribNdx++) {
+
+ activeInfo = gl.getActiveAttrib(program, activeAttribNdx);
+
+ log = 'glGetActiveAttrib(program' +
+ '\nindex= ' + activeAttribNdx +
+ '\nsize= ' + activeInfo.size +
+ '\ntype= ' + activeInfo.type +
+ '\nname= ' + activeInfo.name;
+
+ bufferedLogToConsole(log);
+
+ /** @type {boolean} */ var found = false;
+
+ for (var attribNdx = 0; attribNdx < attributes.length; attribNdx++) {
+ attrib = attributes[attribNdx];
+
+ if (attrib.getName() == activeInfo.name) {
+ if (activeInfo.type != attrib.getType().getGLTypeEnum()) {
+
+ log = 'Error: Wrong type ' + attrib.getType().getGLTypeEnum() +
+ ' expected= ' + activeInfo.type;
+ bufferedLogToConsole(log);
+
+ isOk = false;
+ }
+
+ if (attrib.getArraySize() == glsAttributeLocationTests.ArrayEnum.NOT) {
+ if (activeInfo.size != 1) {
+
+ bufferedLogToConsole('Error: Wrong size ' + activeInfo.size + ' expected 1');
+ isOk = false;
+ }
+ } else {
+ if (activeInfo.size != attrib.getArraySize()) {
+ bufferedLogToConsole('Error: Wrong size ' + activeInfo.size + ' expected ' + attrib.getArraySize());
+
+ isOk = false;
+ }
+ }
+
+ found = true;
+ break;
+ }
+ }
+
+ if (!found) {
+ log = 'Error: Unknown attribute ' + activeInfo.name + ' returned= by glGetActiveAttrib().';
+ bufferedLogToConsole(log);
+
+ isOk = false;
+ }
+
+ activeAttributes.push(activeInfo.name);
+ }
+
+ for (var attribNdx = 0; attribNdx < attributes.length; attribNdx++) {
+ attrib = attributes[attribNdx];
+ isActive = attrib.getCondition().notEquals(glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.NEVER));
+
+ if (isActive) {
+ if (activeAttributes.indexOf(attrib.getName()) == -1) {
+
+ bufferedLogToConsole('Error: Active attribute ' + attrib.getName() + 'wasn\'t returned by glGetActiveAttrib().');
+ isOk = false;
+ }
+ } else {
+ if (activeAttributes[attrib.getName()] === undefined)
+ bufferedLogToConsole('Note: Inactive attribute ' + attrib.getName() + 'was returned by glGetActiveAttrib().');
+ }
+ }
+
+ return isOk;
+ };
+
+ /**
+ * @param {WebGLProgram} program
+ * @param {Array<glsAttributeLocationTests.Attribute>} attributes
+ * @param {Array<number>} bindings
+ * @return {boolean}
+ */
+ glsAttributeLocationTests.checkAttribLocationQuery = function(program, attributes, bindings) {
+ /** @type {boolean} */ var isOk = true;
+ /** @type {string} */ var log;
+
+ for (var attribNdx = 0; attribNdx < attributes.length; attribNdx++) {
+ /** @type {glsAttributeLocationTests.Attribute} */ var attrib = attributes[attribNdx];
+ /** @type {number} */ var expectedLocation = (attrib.getLayoutLocation() != glsAttributeLocationTests.LocationEnum.UNDEF ? attrib.getLayoutLocation() : glsAttributeLocationTests.getBoundLocation(bindings, attrib.getName()));
+ var location = /** @type {number} */ (gl.getAttribLocation(program, attrib.getName()));
+
+ if (attrib.getCondition().equals(glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.NEVER)) && location != -1)
+ bufferedLogToConsole('Note: Inactive attribute with location.');
+
+ if (attrib.getCondition().notEquals(glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.NEVER)) && expectedLocation != glsAttributeLocationTests.LocationEnum.UNDEF && expectedLocation != location)
+ bufferedLogToConsole('Error: Invalid attribute location.');
+
+ isOk = (attrib.getCondition().equals(glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.NEVER)) || expectedLocation == glsAttributeLocationTests.LocationEnum.UNDEF || expectedLocation == location);
+ }
+
+ return isOk;
+ };
+
+ /**
+ * @param {WebGLProgram} program
+ * @param {Array<glsAttributeLocationTests.Attribute>} attributes
+ * @param {Array<number>} bindings
+ * @return {boolean}
+ */
+ glsAttributeLocationTests.checkQuery = function(program, attributes, bindings) {
+ /** @type {boolean} */ var isOk = glsAttributeLocationTests.checkActiveAttribQuery(program, attributes);
+
+ if (!glsAttributeLocationTests.checkAttribLocationQuery(program, attributes, bindings))
+ isOk = false;
+
+ return isOk;
+ };
+
+ /**
+ * @param {WebGLProgram} program
+ * @param {Array<glsAttributeLocationTests.Attribute>} attributes
+ * @param {boolean} attributeAliasing
+ * @return {Object}
+ */
+ glsAttributeLocationTests.createAndAttachShaders = function(program, attributes, attributeAliasing) {
+ /** @type {string} */ var vertexShaderSource = glsAttributeLocationTests.createVertexShaderSource(attributes, attributeAliasing);
+ /** @type {string} */ var fragmentShaderSource = glsAttributeLocationTests.createFragmentShaderSource(attributeAliasing);
+
+ /** @type {WebGLShader} */ var vertexShader = gl.createShader(gl.VERTEX_SHADER);
+ /** @type {WebGLShader} */ var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);
+
+ gl.shaderSource(vertexShader, vertexShaderSource);
+ gl.shaderSource(fragmentShader, fragmentShaderSource);
+
+ gl.compileShader(vertexShader);
+ gl.compileShader(fragmentShader);
+
+ gl.attachShader(program, vertexShader);
+ gl.attachShader(program, fragmentShader);
+
+ var vertexShaderCompileOk = /** @type {boolean} */ (gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS));
+ var fragmentShaderCompileOk = /** @type {boolean} */ (gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS));
+
+ // log shaders
+ glsAttributeLocationTests.logShaders(vertexShaderSource, gl.getShaderInfoLog(vertexShader),
+ vertexShaderCompileOk,
+ fragmentShaderSource, gl.getShaderInfoLog(fragmentShader),
+ fragmentShaderCompileOk);
+
+ assertMsgOptions(vertexShaderCompileOk, 'vertex Shader compile failed', false, true);
+ assertMsgOptions(fragmentShaderCompileOk, 'fragment Shader compile failed', false, true);
+
+ gl.deleteShader(vertexShader);
+ gl.deleteShader(fragmentShader);
+
+ return {first: vertexShader, second: fragmentShader};
+
+ };
+
+ /**
+ * @param {WebGLProgram} program
+ * @param {Array<glsAttributeLocationTests.Bind>} binds
+ */
+ glsAttributeLocationTests.bindAttributes = function(program, binds) {
+ for (var i = 0; i < binds.length; i++) {
+ bufferedLogToConsole('Bind attribute: ' + binds[i].getAttributeName() + ' to ' + binds[i].getLocation());
+ gl.bindAttribLocation(program, binds[i].getLocation(), binds[i].getAttributeName());
+ }
+ };
+
+ /**
+ * @param {glsAttributeLocationTests.AttribType} type
+ * @param {number=} arraySize
+ * @return {string}
+ */
+ glsAttributeLocationTests.generateTestName = function(type, arraySize) {
+ return type.getName() + (arraySize != glsAttributeLocationTests.ArrayEnum.NOT ? '_array_' + arraySize : '');
+ };
+
+ /**
+ * @constructor
+ * @param {string} name
+ * @param {number} locationSize
+ * @param {number} typeEnum
+ */
+ glsAttributeLocationTests.AttribType = function(name, locationSize, typeEnum) {
+ /** @type {string} */ this.m_name = name;
+ /** @type {number} */ this.m_locationSize = locationSize;
+ /** @type {number} */ this.m_glTypeEnum = typeEnum;
+ };
+
+ /**
+ * @return {string}
+ */
+ glsAttributeLocationTests.AttribType.prototype.getName = function() {
+ return this.m_name;
+ };
+
+ /**
+ * @return {number}
+ */
+ glsAttributeLocationTests.AttribType.prototype.getLocationSize = function() {
+ return this.m_locationSize;
+ };
+
+ /**
+ * @return {number}
+ */
+ glsAttributeLocationTests.AttribType.prototype.getGLTypeEnum = function() {
+ return this.m_glTypeEnum;
+ };
+
+ /**
+ * @enum {number}
+ */
+ glsAttributeLocationTests.ConstCond = {
+ ALWAYS: 0,
+ NEVER: 1
+ };
+
+ /**
+ * @constructor
+ * @param {string} name
+ * @param {boolean=} negate
+ */
+ glsAttributeLocationTests.Cond = function(name, negate) {
+ /** @type {boolean} */ this.m_negate = negate === undefined ? false : negate;
+ /** @type {string} */ this.m_name = name;
+ };
+
+ /**
+ * @param {glsAttributeLocationTests.ConstCond} cond
+ * @return {glsAttributeLocationTests.Cond}
+ */
+ glsAttributeLocationTests.NewCondWithEnum = function(cond) {
+ var condObj = new glsAttributeLocationTests.Cond('', false);
+ condObj.m_name = '__always__';
+ condObj.m_negate = (cond != glsAttributeLocationTests.ConstCond.NEVER);
+
+ return condObj;
+ };
+
+ /**
+ * @param {glsAttributeLocationTests.Cond} other
+ * @return {boolean}
+ */
+ glsAttributeLocationTests.Cond.prototype.equals = function(other) {
+ return (this.m_negate == other.m_negate && this.m_name == other.m_name);
+ };
+
+ /**
+ * @param {glsAttributeLocationTests.Cond} other
+ * @return {boolean}
+ */
+ glsAttributeLocationTests.Cond.prototype.notEquals = function(other) {
+ return (!this.equals(other));
+ };
+
+ /**
+ * @return {string}
+ */
+ glsAttributeLocationTests.Cond.prototype.getName = function() {
+ return this.m_name;
+ };
+
+ /**
+ * @return {boolean}
+ */
+ glsAttributeLocationTests.Cond.prototype.getNegate = function() {
+ return this.m_negate;
+ };
+
+ /**
+ * @enum {number}
+ */
+ glsAttributeLocationTests.LocationEnum = {
+ UNDEF: -1
+ };
+
+ /**
+ * @enum {number}
+ */
+ glsAttributeLocationTests.ArrayEnum = {
+ NOT: -1
+ };
+
+ /**
+ * @constructor
+ * @param {glsAttributeLocationTests.AttribType} type
+ * @param {string} name
+ * @param {number=} layoutLocation
+ * @param {glsAttributeLocationTests.Cond=} cond
+ * @param {number=} arraySize
+ */
+ glsAttributeLocationTests.Attribute = function(type, name, layoutLocation, cond, arraySize) {
+ /** @type {glsAttributeLocationTests.AttribType} */ this.m_type = type;
+ /** @type {string} */ this.m_name = name;
+ /** @type {number} */ this.m_layoutLocation = layoutLocation === undefined ? glsAttributeLocationTests.LocationEnum.UNDEF : layoutLocation;
+ /** @type {glsAttributeLocationTests.Cond} */ this.m_cond = cond === undefined ?
+ glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS) : cond;
+ /** @type {number} */ this.m_arraySize = arraySize === undefined ? glsAttributeLocationTests.ArrayEnum.NOT : arraySize;
+ };
+
+ /**
+ * @return {glsAttributeLocationTests.AttribType}
+ */
+ glsAttributeLocationTests.Attribute.prototype.getType = function() {
+ return this.m_type;
+ };
+
+ /**
+ * @return {string}
+ */
+ glsAttributeLocationTests.Attribute.prototype.getName = function() {
+ return this.m_name;
+ };
+
+ /**
+ * @return {number}
+ */
+ glsAttributeLocationTests.Attribute.prototype.getLayoutLocation = function() {
+ return this.m_layoutLocation;
+ };
+
+ /**
+ * @return {glsAttributeLocationTests.Cond}
+ */
+ glsAttributeLocationTests.Attribute.prototype.getCondition = function() {
+ return this.m_cond;
+ };
+
+ /**
+ * @return {number}
+ */
+ glsAttributeLocationTests.Attribute.prototype.getArraySize = function() {
+ return this.m_arraySize;
+ };
+
+ /**
+ * @constructor
+ * @param {string} attribute
+ * @param {number} location
+ */
+ glsAttributeLocationTests.Bind = function(attribute, location) {
+ /** @type {string} */ this.m_attribute = attribute;
+ /** @type {number} */ this.m_location = location;
+ };
+
+ /**
+ * @return {string}
+ */
+ glsAttributeLocationTests.Bind.prototype.getAttributeName = function() {
+ return this.m_attribute;
+ };
+
+ /**
+ * @return {number}
+ */
+ glsAttributeLocationTests.Bind.prototype.getLocation = function() {
+ return this.m_location;
+ };
+
+ /**
+ * @param {Array<glsAttributeLocationTests.Attribute>} attributes
+ * @param {Array<glsAttributeLocationTests.Bind>} preAttachBind
+ * @param {Array<glsAttributeLocationTests.Bind>} preLinkBind
+ * @param {Array<glsAttributeLocationTests.Bind>} postLinkBind
+ * @param {boolean} relink
+ * @param {boolean=} reattach
+ * @param {Array<glsAttributeLocationTests.Attribute>=} reattachAttributes
+ */
+ glsAttributeLocationTests.runTest = function(attributes, preAttachBind, preLinkBind, postLinkBind, relink, reattach, reattachAttributes) {
+ reattach = reattach === undefined ? false : reattach;
+ reattachAttributes = reattachAttributes === undefined ? [] : reattachAttributes;
+
+ try {
+ /** @type {boolean} */ var isOk = true;
+ /** @type {Array<number>} */ var activeBindings = [];
+
+ for (var bindNdx = 0; bindNdx < preAttachBind.length; bindNdx++)
+ activeBindings[preAttachBind[bindNdx].getAttributeName()] = preAttachBind[bindNdx].getLocation();
+
+ for (var bindNdx = 0; bindNdx < preLinkBind.length; bindNdx++)
+ activeBindings[preLinkBind[bindNdx].getAttributeName()] = preLinkBind[bindNdx].getLocation();
+
+ glsAttributeLocationTests.logAttributes(attributes);
+
+ /** @type {WebGLProgram} */ var program = gl.createProgram();
+
+ if (!preAttachBind.length == 0)
+ glsAttributeLocationTests.bindAttributes(program, preAttachBind);
+
+ /** @type {*} */ var shaders = glsAttributeLocationTests.createAndAttachShaders(program, attributes, glsAttributeLocationTests.hasAttributeAliasing(attributes, activeBindings));
+
+ if (!preLinkBind.length == 0)
+ glsAttributeLocationTests.bindAttributes(program, preLinkBind);
+
+ gl.linkProgram(program);
+
+ assertMsgOptions(gl.getProgramParameter(program, gl.LINK_STATUS) == true, 'link program failed', false, true);
+
+ glsAttributeLocationTests.logProgram(program);
+
+ if (!glsAttributeLocationTests.checkQuery(program, attributes, activeBindings))
+ isOk = false;
+
+ if (!postLinkBind.length == 0) {
+ glsAttributeLocationTests.bindAttributes(program, postLinkBind);
+
+ if (!glsAttributeLocationTests.checkQuery(program, attributes, activeBindings))
+ isOk = false;
+ }
+
+ if (relink) {
+ gl.linkProgram(program);
+
+ assertMsgOptions(gl.getProgramParameter(program, gl.LINK_STATUS) == true, 'link program failed', false, true);
+
+ glsAttributeLocationTests.logProgram(program);
+
+ for (var bindNdx = 0; bindNdx < postLinkBind.length; bindNdx++)
+ activeBindings[postLinkBind[bindNdx].getAttributeName()] = postLinkBind[bindNdx].getLocation();
+
+ if (!glsAttributeLocationTests.checkQuery(program, attributes, activeBindings))
+ isOk = false;
+ }
+
+ if (reattach) {
+ gl.detachShader(program, shaders.first);
+ gl.detachShader(program, shaders.second);
+
+ glsAttributeLocationTests.createAndAttachShaders(program, reattachAttributes, glsAttributeLocationTests.hasAttributeAliasing(reattachAttributes, activeBindings));
+
+ gl.linkProgram(program);
+
+ assertMsgOptions(gl.getProgramParameter(program, gl.LINK_STATUS) == true, 'link program failed', false, true);
+
+ glsAttributeLocationTests.logProgram(program);
+
+ if (!glsAttributeLocationTests.checkQuery(program, reattachAttributes, activeBindings))
+ isOk = false;
+ }
+
+ gl.deleteProgram(program);
+
+ assertMsgOptions(isOk, '', true, true);
+
+ } catch (e) {
+ if (program)
+ gl.deleteProgram(program);
+
+ throw e;
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {glsAttributeLocationTests.AttribType} type
+ * @param {number=} arraySize
+ */
+ glsAttributeLocationTests.BindAttributeTest = function(type, arraySize) {
+ /** @type {number} */ this.m_arraySize = arraySize === undefined ? glsAttributeLocationTests.ArrayEnum.NOT : arraySize;
+ /** @type {glsAttributeLocationTests.AttribType} */ this.m_type = type;
+ tcuTestCase.DeqpTest.call(this, glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize), glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize));
+ };
+
+ glsAttributeLocationTests.BindAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ glsAttributeLocationTests.BindAttributeTest.prototype.constructor = glsAttributeLocationTests.BindAttributeTest;
+
+ glsAttributeLocationTests.BindAttributeTest.prototype.iterate = function() {
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var noBindings = [];
+
+ /** @type {Array<glsAttributeLocationTests.Attribute>} */ var attributes = [];
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var bindings = [];
+
+ attributes.push(new glsAttributeLocationTests.Attribute(this.m_type, 'a_0', glsAttributeLocationTests.LocationEnum.UNDEF, glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS), this.m_arraySize));
+ bindings.push(new glsAttributeLocationTests.Bind('a_0', 3));
+
+ glsAttributeLocationTests.runTest(attributes, noBindings, bindings, noBindings, false);
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {glsAttributeLocationTests.AttribType} type
+ * @param {number=} arraySize
+ */
+ glsAttributeLocationTests.BindMaxAttributesTest = function(type, arraySize) {
+ /** @type {number} */ this.m_arraySize = arraySize === undefined ? glsAttributeLocationTests.ArrayEnum.NOT : arraySize;
+ /** @type {glsAttributeLocationTests.AttribType} */ this.m_type = type;
+ tcuTestCase.DeqpTest.call(this, glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize), glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize));
+ };
+
+ glsAttributeLocationTests.BindMaxAttributesTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ glsAttributeLocationTests.BindMaxAttributesTest.prototype.constructor = glsAttributeLocationTests.BindMaxAttributesTest;
+
+ glsAttributeLocationTests.BindMaxAttributesTest.prototype.iterate = function() {
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var noBindings = [];
+ /** @type {number} */ var maxAttributes = glsAttributeLocationTests.getMaxAttributeLocations();
+ /** @type {number} */ var arrayElementCount = (this.m_arraySize != glsAttributeLocationTests.ArrayEnum.NOT ? this.m_arraySize : 1);
+
+ /** @type {Array<glsAttributeLocationTests.Attribute>} */ var attributes = [];
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var bindings = [];
+ /** @type {number} */ var ndx = 0;
+
+ bufferedLogToConsole('MAX_VERTEX_ATTRIBS: ' + maxAttributes);
+
+ for (var loc = maxAttributes - (arrayElementCount * this.m_type.getLocationSize()); loc >= 0; loc -= (arrayElementCount * this.m_type.getLocationSize())) {
+ attributes.push(new glsAttributeLocationTests.Attribute(this.m_type, 'a_' + ndx, glsAttributeLocationTests.LocationEnum.UNDEF, glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS), this.m_arraySize));
+ bindings.push(new glsAttributeLocationTests.Bind('a_' + ndx, loc));
+ ndx++;
+ }
+
+ glsAttributeLocationTests.runTest(attributes, noBindings, bindings, noBindings, false);
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {glsAttributeLocationTests.AttribType} type
+ * @param {number=} arraySize
+ */
+ glsAttributeLocationTests.BindHoleAttributeTest = function(type, arraySize) {
+ /** @type {number} */ this.m_arraySize = arraySize === undefined ? glsAttributeLocationTests.ArrayEnum.NOT : arraySize;
+ /** @type {glsAttributeLocationTests.AttribType} */ this.m_type = type;
+ tcuTestCase.DeqpTest.call(this, glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize), glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize));
+ };
+
+ glsAttributeLocationTests.BindHoleAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ glsAttributeLocationTests.BindHoleAttributeTest.prototype.constructor = glsAttributeLocationTests.BindHoleAttributeTest;
+
+ glsAttributeLocationTests.BindHoleAttributeTest.prototype.iterate = function() {
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var noBindings = [];
+ /** @type {number} */ var maxAttributes = glsAttributeLocationTests.getMaxAttributeLocations();
+ /** @type {glsAttributeLocationTests.AttribType} */ var vec4 = new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4);
+ /** @type {number} */ var arrayElementCount = (this.m_arraySize != glsAttributeLocationTests.ArrayEnum.NOT ? this.m_arraySize : 1);
+
+ /** @type {Array<glsAttributeLocationTests.Attribute>} */ var attributes = [];
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var bindings = [];
+
+ attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_0'));
+ bindings.push(new glsAttributeLocationTests.Bind('a_0', 0));
+
+ attributes.push(new glsAttributeLocationTests.Attribute(this.m_type, 'a_1', glsAttributeLocationTests.LocationEnum.UNDEF, glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS), this.m_arraySize));
+
+ /** @type {number} */ var ndx = 2;
+ for (var loc = 1 + this.m_type.getLocationSize() * arrayElementCount; loc < maxAttributes; loc++) {
+ attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_' + ndx));
+ bindings.push(new glsAttributeLocationTests.Bind('a_' + ndx, loc));
+
+ ndx++;
+ }
+
+ glsAttributeLocationTests.runTest(attributes, noBindings, bindings, noBindings, false);
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ glsAttributeLocationTests.PreAttachBindAttributeTest = function() {
+ tcuTestCase.DeqpTest.call(this, 'pre_attach', 'pre_attach');
+ };
+
+ glsAttributeLocationTests.PreAttachBindAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ glsAttributeLocationTests.PreAttachBindAttributeTest.prototype.constructor = glsAttributeLocationTests.PreAttachBindAttributeTest;
+
+ glsAttributeLocationTests.PreAttachBindAttributeTest.prototype.iterate = function() {
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var noBindings = [];
+ /** @type {number} */ var maxAttributes = glsAttributeLocationTests.getMaxAttributeLocations();
+
+ /** @type {Array<glsAttributeLocationTests.Attribute>} */ var attributes = [];
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var bindings = [];
+ /** @type {number} */ var ndx = 0;
+
+ attributes.push(new glsAttributeLocationTests.Attribute(new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4), 'a_0'));
+ bindings.push(new glsAttributeLocationTests.Bind('a_0', 3));
+
+ glsAttributeLocationTests.runTest(attributes, bindings, noBindings, noBindings, false);
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ glsAttributeLocationTests.PreLinkBindAttributeTest = function() {
+ tcuTestCase.DeqpTest.call(this, 'pre_link', 'pre_link');
+ };
+
+ glsAttributeLocationTests.PreLinkBindAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ glsAttributeLocationTests.PreLinkBindAttributeTest.prototype.constructor = glsAttributeLocationTests.PreLinkBindAttributeTest;
+
+ glsAttributeLocationTests.PreLinkBindAttributeTest.prototype.iterate = function() {
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var noBindings = [];
+
+ /** @type {Array<glsAttributeLocationTests.Attribute>} */ var attributes = [];
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var bindings = [];
+ /** @type {number} */ var ndx = 0;
+
+ attributes.push(new glsAttributeLocationTests.Attribute(new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4), 'a_0'));
+ bindings.push(new glsAttributeLocationTests.Bind('a_0', 3));
+
+ glsAttributeLocationTests.runTest(attributes, bindings, noBindings, noBindings, false);
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ glsAttributeLocationTests.PostLinkBindAttributeTest = function() {
+ tcuTestCase.DeqpTest.call(this, 'post_link', 'post_link');
+ };
+
+ glsAttributeLocationTests.PostLinkBindAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ glsAttributeLocationTests.PostLinkBindAttributeTest.prototype.constructor = glsAttributeLocationTests.PostLinkBindAttributeTest;
+
+ glsAttributeLocationTests.PostLinkBindAttributeTest.prototype.iterate = function() {
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var noBindings = [];
+
+ /** @type {Array<glsAttributeLocationTests.Attribute>} */ var attributes = [];
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var bindings = [];
+
+ attributes.push(new glsAttributeLocationTests.Attribute(new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4), 'a_0'));
+ bindings.push(new glsAttributeLocationTests.Bind('a_0', 3));
+
+ glsAttributeLocationTests.runTest(attributes, noBindings, noBindings, bindings, false);
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ glsAttributeLocationTests.BindReattachAttributeTest = function() {
+ tcuTestCase.DeqpTest.call(this, 'reattach', 'reattach');
+ };
+
+ glsAttributeLocationTests.BindReattachAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ glsAttributeLocationTests.BindReattachAttributeTest.prototype.constructor = glsAttributeLocationTests.BindReattachAttributeTest;
+
+ glsAttributeLocationTests.BindReattachAttributeTest.prototype.iterate = function() {
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var noBindings = [];
+ /** @type {glsAttributeLocationTests.AttribType} */ var vec4 = new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4);
+ /** @type {glsAttributeLocationTests.AttribType} */ var vec2 = new glsAttributeLocationTests.AttribType('vec2', 1, gl.FLOAT_VEC2);
+
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var bindings = [];
+ /** @type {Array<glsAttributeLocationTests.Attribute>} */ var attributes = [];
+ /** @type {Array<glsAttributeLocationTests.Attribute>} */ var reattachAttributes = [];
+
+ attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_0'));
+ bindings.push(new glsAttributeLocationTests.Bind('a_0', 1));
+ bindings.push(new glsAttributeLocationTests.Bind('a_1', 1));
+
+ reattachAttributes.push(new glsAttributeLocationTests.Attribute(vec2, 'a_1'));
+
+ glsAttributeLocationTests.runTest(attributes, noBindings, bindings, noBindings, false, true, reattachAttributes);
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {glsAttributeLocationTests.AttribType} type
+ * @param {number=} arraySize
+ */
+ glsAttributeLocationTests.LocationAttributeTest = function(type, arraySize) {
+ /** @type {number} */ this.m_arraySize = arraySize === undefined ? glsAttributeLocationTests.ArrayEnum.NOT : arraySize;
+ /** @type {glsAttributeLocationTests.AttribType} */ this.m_type = type;
+ tcuTestCase.DeqpTest.call(this, glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize), glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize));
+ };
+
+ glsAttributeLocationTests.LocationAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ glsAttributeLocationTests.LocationAttributeTest.prototype.constructor = glsAttributeLocationTests.LocationAttributeTest;
+
+ glsAttributeLocationTests.LocationAttributeTest.prototype.iterate = function() {
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var noBindings = [];
+ /** @type {Array<glsAttributeLocationTests.Attribute>} */ var attributes = [];
+
+ attributes.push(new glsAttributeLocationTests.Attribute(this.m_type, 'a_0', 3, glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS), this.m_arraySize));
+
+ glsAttributeLocationTests.runTest(attributes, noBindings, noBindings, noBindings, false);
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {glsAttributeLocationTests.AttribType} type
+ * @param {number=} arraySize
+ */
+ glsAttributeLocationTests.LocationMaxAttributesTest = function(type, arraySize) {
+ /** @type {number} */ this.m_arraySize = arraySize === undefined ? glsAttributeLocationTests.ArrayEnum.NOT : arraySize;
+ /** @type {glsAttributeLocationTests.AttribType} */ this.m_type = type;
+ tcuTestCase.DeqpTest.call(this, glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize), glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize));
+ };
+
+ glsAttributeLocationTests.LocationMaxAttributesTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ glsAttributeLocationTests.LocationMaxAttributesTest.prototype.constructor = glsAttributeLocationTests.LocationMaxAttributesTest;
+
+ glsAttributeLocationTests.LocationMaxAttributesTest.prototype.iterate = function() {
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var noBindings = [];
+ /** @type {number} */ var maxAttributes = glsAttributeLocationTests.getMaxAttributeLocations();
+ /** @type {number} */ var arrayElementCount = (this.m_arraySize != glsAttributeLocationTests.ArrayEnum.NOT ? this.m_arraySize : 1);
+
+ /** @type {Array<glsAttributeLocationTests.Attribute>} */ var attributes = [];
+ /** @type {number} */ var ndx = 0;
+
+ bufferedLogToConsole('MAX_VERTEX_ATTRIBS: ' + maxAttributes);
+
+ for (var loc = maxAttributes - (arrayElementCount * this.m_type.getLocationSize()); loc >= 0; loc -= (arrayElementCount * this.m_type.getLocationSize())) {
+ attributes.push(new glsAttributeLocationTests.Attribute(this.m_type, 'a_' + ndx, loc, glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS), this.m_arraySize));
+ ndx++;
+ }
+
+ glsAttributeLocationTests.runTest(attributes, noBindings, noBindings, noBindings, false);
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {glsAttributeLocationTests.AttribType} type
+ * @param {number=} arraySize
+ */
+ glsAttributeLocationTests.LocationHoleAttributeTest = function(type, arraySize) {
+ /** @type {number} */ this.m_arraySize = arraySize === undefined ? glsAttributeLocationTests.ArrayEnum.NOT : arraySize;
+ /** @type {glsAttributeLocationTests.AttribType} */ this.m_type = type;
+ tcuTestCase.DeqpTest.call(this, glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize), glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize));
+ };
+
+ glsAttributeLocationTests.LocationHoleAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ glsAttributeLocationTests.LocationHoleAttributeTest.prototype.constructor = glsAttributeLocationTests.LocationHoleAttributeTest;
+
+ glsAttributeLocationTests.LocationHoleAttributeTest.prototype.iterate = function() {
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var noBindings = [];
+ /** @type {number} */ var maxAttributes = glsAttributeLocationTests.getMaxAttributeLocations();
+ /** @type {glsAttributeLocationTests.AttribType} */ var vec4 = new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4);
+ /** @type {number} */ var arrayElementCount = (this.m_arraySize != glsAttributeLocationTests.ArrayEnum.NOT ? this.m_arraySize : 1);
+
+ /** @type {Array<glsAttributeLocationTests.Attribute>} */ var attributes = [];
+
+ attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_0', 0));
+
+ attributes.push(new glsAttributeLocationTests.Attribute(this.m_type, 'a_1', glsAttributeLocationTests.LocationEnum.UNDEF, glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS), this.m_arraySize));
+
+ /** @type {number} */ var ndx = 2;
+ for (var loc = 1 + this.m_type.getLocationSize() * arrayElementCount; loc < maxAttributes; loc++) {
+ attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_' + ndx, loc));
+ ndx++;
+ }
+
+ glsAttributeLocationTests.runTest(attributes, noBindings, noBindings, noBindings, false);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {glsAttributeLocationTests.AttribType} type
+ * @param {number=} arraySize
+ */
+ glsAttributeLocationTests.MixedAttributeTest = function(type, arraySize) {
+ /** @type {glsAttributeLocationTests.AttribType} */ this.m_type = type;
+ /** @type {number} */ this.m_arraySize = arraySize === undefined ? glsAttributeLocationTests.ArrayEnum.NOT : arraySize;
+ tcuTestCase.DeqpTest.call(this, glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize), glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize));
+ };
+
+ glsAttributeLocationTests.MixedAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ glsAttributeLocationTests.MixedAttributeTest.prototype.constructor = glsAttributeLocationTests.MixedAttributeTest;
+
+ glsAttributeLocationTests.MixedAttributeTest.prototype.iterate = function() {
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var noBindings = [];
+
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var bindings = [];
+ /** @type {Array<glsAttributeLocationTests.Attribute>} */ var attributes = [];
+
+ attributes.push(new glsAttributeLocationTests.Attribute(this.m_type, 'a_0', 3, glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS), this.m_arraySize));
+ bindings.push(new glsAttributeLocationTests.Bind('a_0', 4));
+
+ glsAttributeLocationTests.runTest(attributes, noBindings, bindings, noBindings, false);
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {glsAttributeLocationTests.AttribType} type
+ * @param {number=} arraySize
+ */
+ glsAttributeLocationTests.MixedMaxAttributesTest = function(type, arraySize) {
+ /** @type {glsAttributeLocationTests.AttribType} */ this.m_type = type;
+ /** @type {number} */ this.m_arraySize = arraySize === undefined ? glsAttributeLocationTests.ArrayEnum.NOT : arraySize;
+ tcuTestCase.DeqpTest.call(this, glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize), glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize));
+ };
+
+ glsAttributeLocationTests.MixedMaxAttributesTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ glsAttributeLocationTests.MixedMaxAttributesTest.prototype.constructor = glsAttributeLocationTests.MixedMaxAttributesTest;
+
+ glsAttributeLocationTests.MixedMaxAttributesTest.prototype.iterate = function() {
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var noBindings = [];
+ /** @type {number} */ var maxAttributes = glsAttributeLocationTests.getMaxAttributeLocations();
+ /** @type {number} */ var arrayElementCount = (this.m_arraySize != glsAttributeLocationTests.ArrayEnum.NOT ? this.m_arraySize : 1);
+
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var bindings = [];
+ /** @type {Array<glsAttributeLocationTests.Attribute>} */ var attributes = [];
+ /** @type {number} */ var ndx = 0;
+
+ bufferedLogToConsole('MAX_VERTEX_ATTRIBS: ' + maxAttributes);
+
+ for (var loc = maxAttributes - (arrayElementCount * this.m_type.getLocationSize()); loc >= 0; loc -= (arrayElementCount * this.m_type.getLocationSize())) {
+ if ((ndx % 2) != 0)
+ attributes.push(new glsAttributeLocationTests.Attribute(this.m_type, 'a_' + ndx, loc, glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS), this.m_arraySize));
+ else {
+ attributes.push(new glsAttributeLocationTests.Attribute(this.m_type, 'a_' + ndx, glsAttributeLocationTests.LocationEnum.UNDEF, glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS), this.m_arraySize));
+ bindings.push(new glsAttributeLocationTests.Bind('a_' + ndx, loc));
+ }
+ ndx++;
+ }
+
+ glsAttributeLocationTests.runTest(attributes, noBindings, bindings, noBindings, false);
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {glsAttributeLocationTests.AttribType} type
+ * @param {number=} arraySize
+ */
+ glsAttributeLocationTests.MixedHoleAttributeTest = function(type, arraySize) {
+ /** @type {glsAttributeLocationTests.AttribType} */ this.m_type = type;
+ /** @type {number} */ this.m_arraySize = arraySize === undefined ? glsAttributeLocationTests.ArrayEnum.NOT : arraySize;
+ tcuTestCase.DeqpTest.call(this, glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize), glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize));
+ };
+
+ glsAttributeLocationTests.MixedHoleAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ glsAttributeLocationTests.MixedHoleAttributeTest.prototype.constructor = glsAttributeLocationTests.MixedHoleAttributeTest;
+
+ glsAttributeLocationTests.MixedHoleAttributeTest.prototype.iterate = function() {
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var noBindings = [];
+ /** @type {number} */ var maxAttributes = glsAttributeLocationTests.getMaxAttributeLocations();
+ /** @type {glsAttributeLocationTests.AttribType} */ var vec4 = new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4);
+ /** @type {number} */ var arrayElementCount = (this.m_arraySize != glsAttributeLocationTests.ArrayEnum.NOT ? this.m_arraySize : 1);
+
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var bindings = [];
+ /** @type {Array<glsAttributeLocationTests.Attribute>} */ var attributes = [];
+
+ attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_0'));
+ bindings.push(new glsAttributeLocationTests.Bind('a_0', 0));
+
+ attributes.push(new glsAttributeLocationTests.Attribute(this.m_type, 'a_1', glsAttributeLocationTests.LocationEnum.UNDEF, glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS), this.m_arraySize));
+
+ /** @type {number} */ var ndx = 2;
+ for (var loc = 1 + this.m_type.getLocationSize() * arrayElementCount; loc < maxAttributes; loc++) {
+ if ((ndx % 2) != 0)
+ attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_' + ndx, loc));
+ else {
+ attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_' + ndx, loc));
+ bindings.push(new glsAttributeLocationTests.Bind('a_' + ndx, loc));
+ }
+ ndx++;
+ }
+
+ glsAttributeLocationTests.runTest(attributes, noBindings, bindings, noBindings, false);
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ glsAttributeLocationTests.BindRelinkAttributeTest = function() {
+ tcuTestCase.DeqpTest.call(this, 'relink', 'relink');
+ };
+
+ glsAttributeLocationTests.BindRelinkAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ glsAttributeLocationTests.BindRelinkAttributeTest.prototype.constructor = glsAttributeLocationTests.BindRelinkAttributeTest;
+
+ glsAttributeLocationTests.BindRelinkAttributeTest.prototype.iterate = function() {
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var noBindings = [];
+ /** @type {glsAttributeLocationTests.AttribType} */ var vec4 = new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4);
+
+ /** @type {Array<glsAttributeLocationTests.Attribute>} */ var attributes = [];
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var preLinkBindings = [];
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var postLinkBindings = [];
+
+ attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_0'));
+ attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_1'));
+
+ preLinkBindings.push(new glsAttributeLocationTests.Bind('a_0', 3));
+ preLinkBindings.push(new glsAttributeLocationTests.Bind('a_0', 5));
+
+ postLinkBindings.push(new glsAttributeLocationTests.Bind('a_0', 6));
+
+ glsAttributeLocationTests.runTest(attributes, noBindings, preLinkBindings, postLinkBindings, true);
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {glsAttributeLocationTests.AttribType} type
+ * @param {number=} arraySize
+ */
+ glsAttributeLocationTests.BindRelinkHoleAttributeTest = function(type, arraySize) {
+ /** @type {glsAttributeLocationTests.AttribType} */ this.m_type = type;
+ /** @type {number} */ this.m_arraySize = arraySize === undefined ? glsAttributeLocationTests.ArrayEnum.NOT : arraySize;
+ tcuTestCase.DeqpTest.call(this, glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize), glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize));
+ };
+
+ glsAttributeLocationTests.BindRelinkHoleAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ glsAttributeLocationTests.BindRelinkHoleAttributeTest.prototype.constructor = glsAttributeLocationTests.BindRelinkHoleAttributeTest;
+
+ glsAttributeLocationTests.BindRelinkHoleAttributeTest.prototype.iterate = function() {
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var noBindings = [];
+ /** @type {number} */ var maxAttributes = glsAttributeLocationTests.getMaxAttributeLocations();
+ /** @type {glsAttributeLocationTests.AttribType} */ var vec4 = new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4);
+ /** @type {number} */ var arrayElementCount = (this.m_arraySize != glsAttributeLocationTests.ArrayEnum.NOT ? this.m_arraySize : 1);
+
+ /** @type {Array<glsAttributeLocationTests.Attribute>} */ var attributes = [];
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var preLinkBindings = [];
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var postLinkBindings = [];
+
+ attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_0'));
+ preLinkBindings.push(new glsAttributeLocationTests.Bind('a_0', 0));
+
+ attributes.push(new glsAttributeLocationTests.Attribute(this.m_type, 'a_1', glsAttributeLocationTests.LocationEnum.UNDEF, glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS), this.m_arraySize));
+
+ /** @type {number} */ var ndx = 2;
+ for (var loc = 1 + this.m_type.getLocationSize() * arrayElementCount; loc < maxAttributes; loc++) {
+ attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_' + ndx));
+ preLinkBindings.push(new glsAttributeLocationTests.Bind('a_' + ndx, loc));
+
+ ndx++;
+ }
+
+ postLinkBindings.push(new glsAttributeLocationTests.Bind('a_2', 1));
+
+ glsAttributeLocationTests.runTest(attributes, noBindings, preLinkBindings, postLinkBindings, true);
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {glsAttributeLocationTests.AttribType} type
+ * @param {number=} arraySize
+ */
+ glsAttributeLocationTests.MixedRelinkHoleAttributeTest = function(type, arraySize) {
+ /** @type {glsAttributeLocationTests.AttribType} */ this.m_type = type;
+ /** @type {number} */ this.m_arraySize = arraySize === undefined ? glsAttributeLocationTests.ArrayEnum.NOT : arraySize;
+ tcuTestCase.DeqpTest.call(this, glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize), glsAttributeLocationTests.generateTestName(this.m_type, this.m_arraySize));
+ };
+
+ glsAttributeLocationTests.MixedRelinkHoleAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ glsAttributeLocationTests.MixedRelinkHoleAttributeTest.prototype.constructor = glsAttributeLocationTests.MixedRelinkHoleAttributeTest;
+
+ glsAttributeLocationTests.MixedRelinkHoleAttributeTest.prototype.iterate = function() {
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var noBindings = [];
+ /** @type {number} */ var maxAttributes = glsAttributeLocationTests.getMaxAttributeLocations();
+ /** @type {glsAttributeLocationTests.AttribType} */ var vec4 = new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4);
+ /** @type {number} */ var arrayElementCount = (this.m_arraySize != glsAttributeLocationTests.ArrayEnum.NOT ? this.m_arraySize : 1);
+
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var preLinkBindings = [];
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var postLinkBindings = [];
+ /** @type {Array<glsAttributeLocationTests.Attribute>} */ var attributes = [];
+
+ attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_0'));
+ preLinkBindings.push(new glsAttributeLocationTests.Bind('a_0', 0));
+
+ attributes.push(new glsAttributeLocationTests.Attribute(this.m_type, 'a_1', glsAttributeLocationTests.LocationEnum.UNDEF, glsAttributeLocationTests.NewCondWithEnum(glsAttributeLocationTests.ConstCond.ALWAYS), this.m_arraySize));
+
+ /** @type {number} */ var ndx = 2;
+ for (var loc = 1 + this.m_type.getLocationSize() * arrayElementCount; loc < maxAttributes; loc++) {
+ if ((ndx % 2) != 0)
+ attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_' + ndx, loc));
+ else {
+ attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_' + ndx));
+ preLinkBindings.push(new glsAttributeLocationTests.Bind('a_' + ndx, loc));
+
+ }
+ ndx++;
+ }
+
+ postLinkBindings.push(new glsAttributeLocationTests.Bind('a_2', 1));
+
+ glsAttributeLocationTests.runTest(attributes, noBindings, preLinkBindings, postLinkBindings, true);
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ glsAttributeLocationTests.PreAttachMixedAttributeTest = function() {
+ tcuTestCase.DeqpTest.call(this, 'pre_attach', 'pre_attach');
+ };
+
+ glsAttributeLocationTests.PreAttachMixedAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ glsAttributeLocationTests.PreAttachMixedAttributeTest.prototype.constructor = glsAttributeLocationTests.PreAttachMixedAttributeTest;
+
+ glsAttributeLocationTests.PreAttachMixedAttributeTest.prototype.iterate = function() {
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var noBindings = [];
+
+ /** @type {Array<glsAttributeLocationTests.Attribute>} */ var attributes = [];
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var bindings = [];
+
+ attributes.push(new glsAttributeLocationTests.Attribute(new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4), 'a_0', 1));
+ bindings.push(new glsAttributeLocationTests.Bind('a_0', 3));
+
+ glsAttributeLocationTests.runTest(attributes, bindings, noBindings, noBindings, false);
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ glsAttributeLocationTests.PreLinkMixedAttributeTest = function() {
+ tcuTestCase.DeqpTest.call(this, 'pre_link', 'pre_link');
+ };
+
+ glsAttributeLocationTests.PreLinkMixedAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ glsAttributeLocationTests.PreLinkMixedAttributeTest.prototype.constructor = glsAttributeLocationTests.PreLinkMixedAttributeTest;
+
+ glsAttributeLocationTests.PreLinkMixedAttributeTest.prototype.iterate = function() {
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var noBindings = [];
+
+ /** @type {Array<glsAttributeLocationTests.Attribute>} */ var attributes = [];
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var bindings = [];
+
+ attributes.push(new glsAttributeLocationTests.Attribute(new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4), 'a_0', 1));
+ bindings.push(new glsAttributeLocationTests.Bind('a_0', 3));
+
+ glsAttributeLocationTests.runTest(attributes, noBindings, bindings, noBindings, false);
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ glsAttributeLocationTests.PostLinkMixedAttributeTest = function() {
+ tcuTestCase.DeqpTest.call(this, 'post_link', 'post_link');
+ };
+
+ glsAttributeLocationTests.PostLinkMixedAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ glsAttributeLocationTests.PostLinkMixedAttributeTest.prototype.constructor = glsAttributeLocationTests.PostLinkMixedAttributeTest;
+
+ glsAttributeLocationTests.PostLinkMixedAttributeTest.prototype.iterate = function() {
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var noBindings = [];
+
+ /** @type {Array<glsAttributeLocationTests.Attribute>} */ var attributes = [];
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var bindings = [];
+
+ attributes.push(new glsAttributeLocationTests.Attribute(new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4), 'a_0', 1));
+ bindings.push(new glsAttributeLocationTests.Bind('a_0', 3));
+
+ glsAttributeLocationTests.runTest(attributes, noBindings, noBindings, bindings, false);
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ glsAttributeLocationTests.MixedReattachAttributeTest = function() {
+ tcuTestCase.DeqpTest.call(this, 'reattach', 'reattach');
+ };
+
+ glsAttributeLocationTests.MixedReattachAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ glsAttributeLocationTests.MixedReattachAttributeTest.prototype.constructor = glsAttributeLocationTests.MixedReattachAttributeTest;
+
+ glsAttributeLocationTests.MixedReattachAttributeTest.prototype.iterate = function() {
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var noBindings = [];
+ /** @type {glsAttributeLocationTests.AttribType} */ var vec4 = new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4);
+ /** @type {glsAttributeLocationTests.AttribType} */ var vec2 = new glsAttributeLocationTests.AttribType('vec2', 1, gl.FLOAT_VEC2);
+
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var bindings = [];
+ /** @type {Array<glsAttributeLocationTests.Attribute>} */ var attributes = [];
+ /** @type {Array<glsAttributeLocationTests.Attribute>} */ var reattachAttributes = [];
+
+ attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_0', 2));
+ bindings.push(new glsAttributeLocationTests.Bind('a_0', 1));
+ bindings.push(new glsAttributeLocationTests.Bind('a_1', 1));
+
+ reattachAttributes.push(new glsAttributeLocationTests.Attribute(vec2, 'a_1'));
+
+ glsAttributeLocationTests.runTest(attributes, noBindings, bindings, noBindings, false, true, reattachAttributes);
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+ glsAttributeLocationTests.MixedRelinkAttributeTest = function() {
+ tcuTestCase.DeqpTest.call(this, 'relink', 'relink');
+ };
+
+ glsAttributeLocationTests.MixedRelinkAttributeTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ glsAttributeLocationTests.MixedRelinkAttributeTest.prototype.constructor = glsAttributeLocationTests.MixedRelinkAttributeTest;
+
+ glsAttributeLocationTests.MixedRelinkAttributeTest.prototype.iterate = function() {
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var noBindings = [];
+ /** @type {glsAttributeLocationTests.AttribType} */ var vec4 = new glsAttributeLocationTests.AttribType('vec4', 1, gl.FLOAT_VEC4);
+
+ /** @type {Array<glsAttributeLocationTests.Attribute>} */ var attributes = [];
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var preLinkBindings = [];
+ /** @type {Array<glsAttributeLocationTests.Bind>} */ var postLinkBindings = [];
+
+ attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_0', 1));
+ attributes.push(new glsAttributeLocationTests.Attribute(vec4, 'a_1'));
+
+ preLinkBindings.push(new glsAttributeLocationTests.Bind('a_0', 3));
+ preLinkBindings.push(new glsAttributeLocationTests.Bind('a_0', 5));
+
+ postLinkBindings.push(new glsAttributeLocationTests.Bind('a_0', 6));
+
+ glsAttributeLocationTests.runTest(attributes, noBindings, preLinkBindings, postLinkBindings, true);
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsBufferTestUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsBufferTestUtil.js
new file mode 100644
index 0000000000..446782b4b6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsBufferTestUtil.js
@@ -0,0 +1,1068 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('modules.shared.glsBufferTestUtil');
+goog.require('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuRGBA');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.delibs.debase.deUtil');
+goog.require('framework.opengl.gluDrawUtil');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('framework.opengl.gluShaderUtil');
+
+goog.scope(function() {
+
+ var glsBufferTestUtil = modules.shared.glsBufferTestUtil;
+ var tcuImageCompare = framework.common.tcuImageCompare;
+ var tcuRGBA = framework.common.tcuRGBA;
+ var tcuSurface = framework.common.tcuSurface;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var tcuTexture = framework.common.tcuTexture;
+ var gluShaderProgram = framework.opengl.gluShaderProgram;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var gluDrawUtil = framework.opengl.gluDrawUtil;
+ var deUtil = framework.delibs.debase.deUtil;
+ var deMath = framework.delibs.debase.deMath;
+ var deRandom = framework.delibs.debase.deRandom;
+ var deString = framework.delibs.debase.deString;
+
+ glsBufferTestUtil.VERIFY_QUAD_SIZE = 8; //!< Quad size in VertexArrayVerifier
+ glsBufferTestUtil.MAX_LINES_PER_INDEX_ARRAY_DRAW = 128; //!< Maximum number of lines per one draw in IndexArrayVerifier
+ glsBufferTestUtil.INDEX_ARRAY_DRAW_VIEWPORT_WIDTH = 128;
+ glsBufferTestUtil.INDEX_ARRAY_DRAW_VIEWPORT_HEIGHT = 128;
+
+ // Helper functions.
+
+ /**
+ * @param {Uint8Array} ptr
+ * @param {number} numBytes
+ * @param {number} seed
+ */
+ glsBufferTestUtil.fillWithRandomBytes = function(ptr, numBytes, seed) {
+ var rnd = new deRandom.Random(seed);
+ for (var left = numBytes; left > 0; left--)
+ ptr[left - 1] = rnd.getInt();
+ };
+
+ /**
+ * @param {Uint8Array} resPtr
+ * @param {Uint8Array} refPtr
+ * @param {number} numBytes
+ * @return {boolean}
+ */
+ glsBufferTestUtil.compareByteArrays = function(resPtr, refPtr, numBytes) {
+ var isOk = true;
+ var maxSpanLen = 8;
+ var maxDiffSpans = 4;
+ var numDiffSpans = 0;
+ var diffSpanStart = -1;
+ var ndx = 0;
+
+ var log = 'Verification result: ';
+
+ for (; ndx < numBytes; ndx++) {
+ if (resPtr[ndx] != refPtr[ndx]) {
+ if (diffSpanStart < 0)
+ diffSpanStart = ndx;
+
+ isOk = false;
+ } else if (diffSpanStart >= 0) {
+ if (numDiffSpans < maxDiffSpans) {
+ var len = ndx - diffSpanStart;
+ var printLen = Math.min(len, maxSpanLen);
+
+ log += len + ' byte difference at offset ' + diffSpanStart + '\n' +
+ ' expected ' + refPtr.subarray(diffSpanStart, diffSpanStart + printLen) +
+ ' got ' + resPtr.subarray(diffSpanStart, diffSpanStart + printLen);
+ } else
+ log += '(output too long, truncated)';
+
+ numDiffSpans += 1;
+ diffSpanStart = -1;
+ }
+ }
+
+ if (diffSpanStart >= 0) {
+ if (numDiffSpans < maxDiffSpans) {
+ var len = ndx - diffSpanStart;
+ var printLen = Math.min(len, maxSpanLen);
+
+ log += len + ' byte difference at offset ' + diffSpanStart + '\n' +
+ ' expected ' + refPtr.subarray(diffSpanStart, diffSpanStart + printLen) +
+ ' got ' + resPtr.subarray(diffSpanStart, diffSpanStart + printLen);
+ } else
+ log += '(output too long, truncated)';
+ }
+
+ log += (isOk ? 'Verification passed.' : 'Verification FAILED!');
+
+ bufferedLogToConsole(log);
+
+ return isOk;
+ };
+
+ /**
+ * @param {number} target
+ * @return {string}
+ */
+ glsBufferTestUtil.getBufferTargetName = function(target) {
+ switch (target) {
+ case gl.ARRAY_BUFFER: return 'array';
+ case gl.COPY_READ_BUFFER: return 'copy_read';
+ case gl.COPY_WRITE_BUFFER: return 'copy_write';
+ case gl.ELEMENT_ARRAY_BUFFER: return 'element_array';
+ case gl.PIXEL_PACK_BUFFER: return 'pixel_pack';
+ case gl.PIXEL_UNPACK_BUFFER: return 'pixel_unpack';
+ //case gl.TEXTURE_BUFFER: return "texture"; //TODO: Unimplemented in WebGL 2. Remove?
+ case gl.TRANSFORM_FEEDBACK_BUFFER: return 'transform_feedback';
+ case gl.UNIFORM_BUFFER: return 'uniform';
+ default:
+ throw new Error('Invalid buffer target');
+ }
+ };
+
+ /**
+ * @param {number} hint
+ * @return {string}
+ */
+ glsBufferTestUtil.getUsageHintName = function(hint) {
+ switch (hint) {
+ case gl.STREAM_DRAW: return 'stream_draw';
+ case gl.STREAM_READ: return 'stream_read';
+ case gl.STREAM_COPY: return 'stream_copy';
+ case gl.STATIC_DRAW: return 'static_draw';
+ case gl.STATIC_READ: return 'static_read';
+ case gl.STATIC_COPY: return 'static_copy';
+ case gl.DYNAMIC_DRAW: return 'dynamic_draw';
+ case gl.DYNAMIC_READ: return 'dynamic_read';
+ case gl.DYNAMIC_COPY: return 'dynamic_copy';
+ default:
+ throw new Error('Invalid buffer usage hint');
+ }
+ };
+
+ // Base class for buffer cases.
+ // BufferCase
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} description
+ */
+ glsBufferTestUtil.BufferCase = function(name, description) {
+ tcuTestCase.DeqpTest.call(this, name, description);
+ /** @type {Array<WebGLBuffer>} */ this.m_allocatedBuffers = [];
+ };
+
+ glsBufferTestUtil.BufferCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ glsBufferTestUtil.BufferCase.prototype.constructor = glsBufferTestUtil.BufferCase;
+
+ /**
+ * init
+ */
+ glsBufferTestUtil.BufferCase.prototype.init = function() {};
+
+ /**
+ * deinit
+ */
+ glsBufferTestUtil.BufferCase.prototype.deinit = function() {
+ for (var ndx = 0; ndx < this.m_allocatedBuffers.length; ndx++)
+ this.deleteBuffer(this.m_allocatedBuffers[ndx]);
+ };
+
+ /**
+ * @return {WebGLBuffer}
+ */
+ glsBufferTestUtil.BufferCase.prototype.genBuffer = function() {
+ var buf = 0;
+ buf = gl.createBuffer();
+ if (buf != 0) {
+ try {
+ deUtil.dePushUniqueToArray(this.m_allocatedBuffers, buf);
+ }
+ catch (err) {
+ gl.deleteBuffer(buf);
+ throw err;
+ }
+ }
+ return buf;
+ };
+
+ /**
+ * @param {WebGLBuffer} buffer
+ */
+ glsBufferTestUtil.BufferCase.prototype.deleteBuffer = function(buffer) {
+ gl.deleteBuffer(buffer);
+ this.m_allocatedBuffers.splice(this.m_allocatedBuffers.indexOf(buffer), 1);
+ };
+
+ glsBufferTestUtil.BufferCase.prototype.checkError = function() {
+ /** @type {number} */ var err = gl.getError();
+ if (err != gl.NO_ERROR)
+ throw new TestFailedException('Got ' + WebGLTestUtils.glEnumToString(gl, err));
+ };
+
+ // Reference buffer.
+
+ /**
+ * @constructor
+ */
+ glsBufferTestUtil.ReferenceBuffer = function() {
+ /** @type {ArrayBuffer} */ this.m_data;
+ };
+
+ /**
+ * @param {number=} offset
+ * @return {Uint8Array}
+ */
+ glsBufferTestUtil.ReferenceBuffer.prototype.getPtr = function(offset) {
+ offset = offset ? offset : 0; return new Uint8Array(this.m_data, offset);
+ };
+
+ /**
+ * @param {number} numBytes
+ */
+ glsBufferTestUtil.ReferenceBuffer.prototype.setSize = function(numBytes) {
+ this.m_data = new ArrayBuffer(numBytes);
+ };
+
+ /**
+ * @param {number} numBytes
+ * @param {Uint8Array} bytes
+ */
+ glsBufferTestUtil.ReferenceBuffer.prototype.setData = function(numBytes, bytes) {
+ this.setSize(numBytes);
+ var dst = new Uint8Array(this.m_data);
+ dst.set(bytes.subarray(numBytes));
+ };
+
+ /**
+ * @param {number} offset
+ * @param {number} numBytes
+ * @param {Uint8Array} bytes
+ */
+ glsBufferTestUtil.ReferenceBuffer.prototype.setSubData = function(offset, numBytes, bytes) {
+ assertMsgOptions(deMath.deInBounds32(offset, 0, this.m_data.byteLength) && deMath.deInRange32(offset + numBytes, offset, this.m_data.byteLength),
+ 'Parameters not in buffer bounds or range', false, true);
+ var dst = new Uint8Array(this.m_data, offset);
+ dst.set(bytes.subarray(offset, offset + numBytes));
+ };
+
+ // Buffer writer system.
+
+ /**
+ * @enum {number}
+ */
+ glsBufferTestUtil.WriteType = {
+ BUFFER_SUB_DATA: 0,
+ BUFFER_WRITE_MAP: 1,
+ TRANSFORM_FEEDBACK: 2,
+ PIXEL_PACK: 3
+ };
+
+ /**
+ * @param {glsBufferTestUtil.WriteType} write
+ * @return {string}
+ */
+ glsBufferTestUtil.getWriteTypeDescription = function(write) {
+ /** @type {Array<string>} */ var s_desc = [
+ 'gl.bufferSubData()',
+ 'gl.mapBufferRange()',
+ 'transform feedback',
+ 'gl.readPixels() into PBO binding'
+ ];
+ return /** @type {string} */ (deUtil.getArrayElement(s_desc, write));
+ };
+
+ // BufferWriterBase
+
+ /**
+ * @constructor
+ */
+ glsBufferTestUtil.BufferWriterBase = function() {};
+
+ /**
+ * //Meant to be overriden
+ * @return {number}
+ */
+ glsBufferTestUtil.BufferWriterBase.prototype.getMinSize = function() { throw new Error('Must be overriden'); };
+
+ /**
+ * //Meant to be overriden
+ * @return {number}
+ */
+ glsBufferTestUtil.BufferWriterBase.prototype.getAlignment = function() { throw new Error('Must be overriden'); };
+
+ /**
+ * //Meant to be overriden
+ * @param {WebGLBuffer} buffer
+ * @param {number} offset
+ * @param {number} numBytes
+ * @param {Uint8Array} bytes
+ */
+ glsBufferTestUtil.BufferWriterBase.prototype.writeNoTarget = function(buffer, offset, numBytes, bytes) { throw new Error('Must be overriden'); };
+
+ /**
+ * @param {WebGLBuffer} buffer
+ * @param {number} offset
+ * @param {number} numBytes
+ * @param {Uint8Array} bytes
+ * @param {number} targetHint
+ */
+ glsBufferTestUtil.BufferWriterBase.prototype.write = function(buffer, offset, numBytes, bytes, targetHint) {
+ this.writeNoTarget(buffer, offset, numBytes, bytes);
+ };
+
+ // BufferWriter
+
+ /**
+ * @constructor
+ * @param {glsBufferTestUtil.WriteType} writeType
+ */
+ glsBufferTestUtil.BufferWriter = function(writeType) {
+ /** @type {glsBufferTestUtil.BufferWriterBase} */ this.m_writer = null;
+ switch (writeType) {
+ case glsBufferTestUtil.WriteType.BUFFER_SUB_DATA: this.m_writer = new glsBufferTestUtil.BufferSubDataWriter(); break;
+ default:
+ testFailed('Unsupported writer');
+ }
+ };
+
+ /**
+ * @return {number}
+ */
+ glsBufferTestUtil.BufferWriter.prototype.getMinSize = function() {return this.m_writer.getMinSize();};
+
+ /**
+ * @return {number}
+ */
+ glsBufferTestUtil.BufferWriter.prototype.getAlignment = function() {return this.m_writer.getAlignment();};
+
+ /**
+ * @param {WebGLBuffer} buffer
+ * @param {number} offset
+ * @param {number} numBytes
+ * @param {Uint8Array} bytes
+ */
+ glsBufferTestUtil.BufferWriter.prototype.writeNoTarget = function(buffer, offset, numBytes, bytes) {
+ assertMsgOptions(numBytes >= this.getMinSize(), 'Number of bytes to write is smaller than the minimum size.', false, true);
+ assertMsgOptions(offset % this.getAlignment() == 0, 'Offset is not aligned.', false, true);
+ assertMsgOptions((offset + numBytes) % this.getAlignment() == 0, 'Buffer segment is not aligned', false, true);
+ return this.m_writer.writeNoTarget(buffer, offset, numBytes, bytes);
+ };
+
+ /**
+ * @param {WebGLBuffer} buffer
+ * @param {number} offset
+ * @param {number} numBytes
+ * @param {Uint8Array} bytes
+ * @param {number} targetHint
+ */
+ glsBufferTestUtil.BufferWriter.prototype.write = function(buffer, offset, numBytes, bytes, targetHint) {
+ assertMsgOptions(numBytes >= this.getMinSize(), 'Number of bytes to write is smaller than the minimum size.', false, true);
+ assertMsgOptions(offset % this.getAlignment() == 0, 'Offset is not aligned.', false, true);
+ assertMsgOptions((offset + numBytes) % this.getAlignment() == 0, 'Buffer segment is not aligned', false, true);
+ return this.m_writer.write(buffer, offset, numBytes, bytes, targetHint);
+ };
+
+ // BufferSubDataWriter
+
+ /**
+ * @constructor
+ * @extends {glsBufferTestUtil.BufferWriterBase}
+ */
+ glsBufferTestUtil.BufferSubDataWriter = function() {
+ glsBufferTestUtil.BufferWriterBase.call(this);
+ };
+
+ glsBufferTestUtil.BufferSubDataWriter.prototype = Object.create(glsBufferTestUtil.BufferWriterBase.prototype);
+ glsBufferTestUtil.BufferSubDataWriter.prototype.constructor = glsBufferTestUtil.BufferSubDataWriter;
+
+ /**
+ * @return {number}
+ */
+ glsBufferTestUtil.BufferSubDataWriter.prototype.getMinSize = function() { return 1; };
+
+ /**
+ * @return {number}
+ */
+ glsBufferTestUtil.BufferSubDataWriter.prototype.getAlignment = function() { return 1; };
+
+ /**
+ * @param {WebGLBuffer} buffer
+ * @param {number} offset
+ * @param {number} numBytes
+ * @param {Uint8Array} bytes
+ */
+ glsBufferTestUtil.BufferSubDataWriter.prototype.writeNoTarget = function(buffer, offset, numBytes, bytes) {
+ this.write(buffer, offset, numBytes, bytes, gl.ARRAY_BUFFER);
+ };
+
+ /**
+ * @param {WebGLBuffer} buffer
+ * @param {number} offset
+ * @param {number} numBytes
+ * @param {Uint8Array} bytes
+ * @param {number} target
+ */
+ glsBufferTestUtil.BufferSubDataWriter.prototype.write = function(buffer, offset, numBytes, bytes, target) {
+ gl.bindBuffer(target, buffer);
+ gl.bufferSubData(target, offset, bytes);
+ gl.bindBuffer(target, null);
+ };
+
+ // Buffer verifier system.
+
+ /**
+ * @enum {number}
+ */
+ glsBufferTestUtil.VerifyType = {
+ AS_VERTEX_ARRAY: 0,
+ AS_INDEX_ARRAY: 1,
+ AS_UNIFORM_BUFFER: 2,
+ AS_PIXEL_UNPACK_BUFFER: 3,
+ BUFFER_READ_MAP: 4
+ };
+
+ /**
+ * @param {glsBufferTestUtil.VerifyType} verify
+ * @return {string}
+ */
+ glsBufferTestUtil.getVerifyTypeDescription = function(verify) {
+ /** @type {Array<string>} */ var s_desc =
+ [
+ 'rendering as vertex data',
+ 'rendering as index data',
+ 'reading in shader as uniform buffer data',
+ 'using as PBO and uploading to texture',
+ 'reading back using glMapBufferRange()'
+ ];
+
+ return /** @type {string} */ (deUtil.getArrayElement(s_desc, verify));
+ };
+
+ /**
+ * @constructor
+ */
+ glsBufferTestUtil.BufferVerifierBase = function() {};
+
+ /**
+ * //Meant to be overriden
+ * @return {number}
+ */
+ glsBufferTestUtil.BufferVerifierBase.prototype.getMinSize = function() { throw new Error('Must be overriden'); };
+
+ /**
+ * //Meant to be overriden
+ * @return {number}
+ */
+ glsBufferTestUtil.BufferVerifierBase.prototype.getAlignment = function() { throw new Error('Must be overriden'); };
+
+ /**
+ * @param {WebGLBuffer} buffer
+ * @param {Uint8Array} reference
+ * @param {number} offset
+ * @param {number} numBytes
+ * @return {boolean}
+ */
+ glsBufferTestUtil.BufferVerifierBase.prototype.verifyNoTarget = function(buffer, reference, offset, numBytes) {
+ throw new Error('Must be overriden');
+ };
+
+ /**
+ * //Meant to be overriden
+ * @param {WebGLBuffer} buffer
+ * @param {Uint8Array} reference
+ * @param {number} offset
+ * @param {number} numBytes
+ * @param {number} targetHint
+ * @return {boolean}
+ */
+ glsBufferTestUtil.BufferVerifierBase.prototype.verify = function(buffer, reference, offset, numBytes, targetHint) {
+ //In WebGL 2, ELEMENT_ARRAY_BUFFER and TRANSFORM_FEEDBACK_BUFFER cannot be rebound to a different
+ //type of buffer, so, let's copy their data to an ARRAY BUFFER and pass that one instead to be verified.
+ var wasReadBufferCreated = false;
+ try {
+ if (targetHint == gl.ELEMENT_ARRAY_BUFFER || targetHint == gl.TRANSFORM_FEEDBACK_BUFFER) {
+ var readBuffer = new Uint8Array(offset + numBytes);
+ gl.getBufferSubData(targetHint, 0, readBuffer);
+ buffer = gl.createBuffer();
+
+ wasReadBufferCreated = true;
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
+ gl.bufferData(gl.ARRAY_BUFFER, readBuffer, gl.STATIC_DRAW);
+ }
+
+ var result = this.verifyNoTarget(buffer, reference, offset, numBytes);
+
+ if (wasReadBufferCreated)
+ gl.deleteBuffer(buffer);
+
+ return result;
+ } catch (err) {
+ if (wasReadBufferCreated)
+ gl.deleteBuffer(buffer);
+ throw err;
+ }
+ };
+
+ // BufferVerifier
+
+ /**
+ * @constructor
+ * @param {glsBufferTestUtil.VerifyType} verifyType
+ */
+ glsBufferTestUtil.BufferVerifier = function(verifyType) {
+ /** @type {glsBufferTestUtil.BufferVerifierBase} */ this.m_verifier = null;
+ switch (verifyType) {
+ case glsBufferTestUtil.VerifyType.AS_VERTEX_ARRAY: this.m_verifier = new glsBufferTestUtil.VertexArrayVerifier(); break;
+ case glsBufferTestUtil.VerifyType.AS_INDEX_ARRAY: this.m_verifier = new glsBufferTestUtil.IndexArrayVerifier(); break;
+ default:
+ testFailed('Unsupported verifier type');
+ }
+ };
+
+ /**
+ * @return {number}
+ */
+ glsBufferTestUtil.BufferVerifier.prototype.getMinSize = function() { return this.m_verifier.getMinSize(); };
+
+ /**
+ * @return {number}
+ */
+ glsBufferTestUtil.BufferVerifier.prototype.getAlignment = function() { return this.m_verifier.getAlignment(); };
+
+ /**
+ * @param {WebGLBuffer} buffer
+ * @param {Uint8Array} reference
+ * @param {number} numBytes
+ * @return {boolean}
+ */
+ glsBufferTestUtil.BufferVerifier.prototype.verifyNoTarget = function(buffer, reference, offset, numBytes) {
+ assertMsgOptions(numBytes >= this.getMinSize(), 'Number of bytes to write is smaller than the minimum size.', false, true);
+ assertMsgOptions(offset % this.getAlignment() == 0, 'Offset is not aligned.', false, true);
+ assertMsgOptions((offset + numBytes) % this.getAlignment() == 0, 'Buffer segment is not aligned', false, true);
+ return this.m_verifier.verifyNoTarget(buffer, reference, offset, numBytes);
+ };
+
+ /**
+ * @param {WebGLBuffer} buffer
+ * @param {Uint8Array} reference
+ * @param {number} offset
+ * @param {number} numBytes
+ * @param {number} targetHint
+ * @return {boolean}
+ */
+ glsBufferTestUtil.BufferVerifier.prototype.verify = function(buffer, reference, offset, numBytes, targetHint) {
+ assertMsgOptions(numBytes >= this.getMinSize(), 'Number of bytes to write is smaller than the minimum size.', false, true);
+ assertMsgOptions(offset % this.getAlignment() == 0, 'Offset is not aligned.', false, true);
+ assertMsgOptions((offset + numBytes) % this.getAlignment() == 0, 'Buffer segment is not aligned', false, true);
+ return this.m_verifier.verify(buffer, reference, offset, numBytes, targetHint);
+ };
+
+ // VertexArrayVerifier
+
+ /**
+ * @constructor
+ * @extends {glsBufferTestUtil.BufferVerifierBase}
+ */
+ glsBufferTestUtil.VertexArrayVerifier = function() {
+ glsBufferTestUtil.BufferVerifierBase.call(this);
+ /** @type {gluShaderProgram.ShaderProgram} */ this.m_program = null;
+ this.m_posLoc = 0;
+ this.m_byteVecLoc = 0;
+ /** @type {WebGLVertexArrayObject} */ this.m_vao = null;
+
+ /** @type {gluShaderUtil.GLSLVersion} */ var glslVersion = gluShaderUtil.getGLSLVersion(gl);
+
+ assertMsgOptions(gluShaderUtil.isGLSLVersionSupported(gl, glslVersion), 'Unsupported GLSL version', false, true);
+
+ this.m_program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(
+ gluShaderUtil.getGLSLVersionDeclaration(glslVersion) + '\n' +
+ 'in highp vec2 a_position;\n' +
+ 'in mediump vec3 a_byteVec;\n' +
+ 'out mediump vec3 v_byteVec;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = vec4(a_position, 0.0, 1.0);\n' +
+ ' v_byteVec = a_byteVec;\n' +
+ '}\n',
+
+ gluShaderUtil.getGLSLVersionDeclaration(glslVersion) + '\n' +
+ 'in mediump vec3 v_byteVec;\n' +
+ 'layout(location = 0) out mediump vec4 o_color;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' o_color = vec4(v_byteVec, 1.0);\n' +
+ '}\n'
+ ));
+
+ if (!this.m_program.isOk()) {
+ testFailed('Compile failed');
+ }
+
+ this.m_posLoc = gl.getAttribLocation(this.m_program.getProgram(), 'a_position');
+ this.m_byteVecLoc = gl.getAttribLocation(this.m_program.getProgram(), 'a_byteVec');
+
+ this.m_vao = gl.createVertexArray();
+ this.m_positionBuf = gl.createBuffer();
+ this.m_indexBuf = gl.createBuffer();
+ };
+
+ glsBufferTestUtil.VertexArrayVerifier.prototype = Object.create(glsBufferTestUtil.BufferVerifierBase.prototype);
+ glsBufferTestUtil.VertexArrayVerifier.prototype.constructor = glsBufferTestUtil.VertexArrayVerifier;
+
+ /**
+ * @return {number}
+ */
+ glsBufferTestUtil.VertexArrayVerifier.prototype.getMinSize = function() { return 3 * 4; };
+
+ /**
+ * @return {number}
+ */
+ glsBufferTestUtil.VertexArrayVerifier.prototype.getAlignment = function() { return 1; };
+
+ /**
+ * deinit
+ */
+ glsBufferTestUtil.VertexArrayVerifier.prototype.deinit = function() {
+ if (this.m_vao) gl.deleteVertexArray(this.m_vao);
+ if (this.m_positionBuf) gl.deleteBuffer(this.m_positionBuf);
+ if (this.m_indexBuf) gl.deleteBuffer(this.m_indexBuf);
+ };
+
+ /**
+ * @param {number} gridSizeX
+ * @param {number} gridSizeY
+ * @return {Array<number>}
+ */
+ glsBufferTestUtil.computePositions = function(gridSizeX, gridSizeY) {
+ var positions = [];
+
+ for (var y = 0; y < gridSizeY; y++)
+ for (var x = 0; x < gridSizeX; x++) {
+ /** @type {number} */ var sx0 = (x + 0) / gridSizeX;
+ /** @type {number} */ var sy0 = (y + 0) / gridSizeY;
+ /** @type {number} */ var sx1 = (x + 1) / gridSizeX;
+ /** @type {number} */ var sy1 = (y + 1) / gridSizeY;
+ /** @type {number} */ var fx0 = 2.0 * sx0 - 1.0;
+ /** @type {number} */ var fy0 = 2.0 * sy0 - 1.0;
+ /** @type {number} */ var fx1 = 2.0 * sx1 - 1.0;
+ /** @type {number} */ var fy1 = 2.0 * sy1 - 1.0;
+ /** @type {number} */ var baseNdx = (y * gridSizeX + x) * 8;
+
+ positions[baseNdx + 0] = fx0; positions[baseNdx + 1] = fy0;
+ positions[baseNdx + 2] = fx0; positions[baseNdx + 3] = fy1;
+ positions[baseNdx + 4] = fx1; positions[baseNdx + 5] = fy0;
+ positions[baseNdx + 6] = fx1; positions[baseNdx + 7] = fy1;
+ }
+
+ return positions;
+ };
+
+ /**
+ * @param {number} gridSizeX
+ * @param {number} gridSizeY
+ * @return {Uint16Array}
+ */
+ glsBufferTestUtil.computeIndices = function(gridSizeX, gridSizeY) {
+ var indices = new Uint16Array(3 * 2 * gridSizeX * gridSizeY);
+
+ for (var quadNdx = 0; quadNdx < gridSizeX * gridSizeY; quadNdx++) {
+ /** @type {number} */ var v00 = quadNdx * 4 + 0;
+ /** @type {number} */ var v01 = quadNdx * 4 + 1;
+ /** @type {number} */ var v10 = quadNdx * 4 + 2;
+ /** @type {number} */ var v11 = quadNdx * 4 + 3;
+
+ assertMsgOptions(v11 < (1 << 16), 'Vertex index value won\'t fit into a 16-bit number', false, true);
+
+ indices[quadNdx * 6 + 0] = v10;
+ indices[quadNdx * 6 + 1] = v00;
+ indices[quadNdx * 6 + 2] = v01;
+
+ indices[quadNdx * 6 + 3] = v10;
+ indices[quadNdx * 6 + 4] = v01;
+ indices[quadNdx * 6 + 5] = v11;
+ }
+
+ return indices;
+ };
+
+ /**
+ * @param {Uint8Array} ptr
+ * @param {number} vtxNdx
+ * @return {Array<number>}
+ */
+ glsBufferTestUtil.fetchVtxColor = function(ptr, vtxNdx) {
+ return new tcuRGBA.RGBA([
+ ptr[vtxNdx * 3 + 0],
+ ptr[vtxNdx * 3 + 1],
+ ptr[vtxNdx * 3 + 2],
+ 255]).toVec();
+ };
+
+ /**
+ * @param {tcuSurface.Surface} dst
+ * @param {number} numQuads
+ * @param {number} rowLength
+ * @param {Uint8Array} inPtr
+ */
+ glsBufferTestUtil.renderQuadGridReference = function(dst, numQuads, rowLength, inPtr) {
+ dst.setSize(rowLength * glsBufferTestUtil.VERIFY_QUAD_SIZE, (Math.floor(numQuads / rowLength) + (numQuads % rowLength != 0 ? 1 : 0)) * glsBufferTestUtil.VERIFY_QUAD_SIZE);
+
+ /** @type {tcuTexture.PixelBufferAccess} */ var dstAccess = dst.getAccess();
+ dstAccess.clear([0, 0, 0, 1.0]);
+
+ for (var quadNdx = 0; quadNdx < numQuads; quadNdx++) {
+ /** @type {number} */ var x0 = (quadNdx % rowLength) * glsBufferTestUtil.VERIFY_QUAD_SIZE;
+ /** @type {number} */ var y0 = Math.floor(quadNdx / rowLength) * glsBufferTestUtil.VERIFY_QUAD_SIZE;
+ /** @type {Array<number>} */ var v00 = glsBufferTestUtil.fetchVtxColor(inPtr, quadNdx * 4 + 0);
+ /** @type {Array<number>} */ var v10 = glsBufferTestUtil.fetchVtxColor(inPtr, quadNdx * 4 + 1);
+ /** @type {Array<number>} */ var v01 = glsBufferTestUtil.fetchVtxColor(inPtr, quadNdx * 4 + 2);
+ /** @type {Array<number>} */ var v11 = glsBufferTestUtil.fetchVtxColor(inPtr, quadNdx * 4 + 3);
+
+ for (var y = 0; y < glsBufferTestUtil.VERIFY_QUAD_SIZE; y++)
+ for (var x = 0; x < glsBufferTestUtil.VERIFY_QUAD_SIZE; x++) {
+ /** @type {number} */ var fx = (x + 0.5) / glsBufferTestUtil.VERIFY_QUAD_SIZE;
+ /** @type {number} */ var fy = (y + 0.5) / glsBufferTestUtil.VERIFY_QUAD_SIZE;
+
+ /** @type {boolean} */ var tri = fx + fy <= 1.0;
+ /** @type {number} */ var tx = tri ? fx : (1.0 - fx);
+ /** @type {number} */ var ty = tri ? fy : (1.0 - fy);
+ /** @type {Array<number>} */ var t0 = tri ? v00 : v11;
+ /** @type {Array<number>} */ var t1 = tri ? v01 : v10;
+ /** @type {Array<number>} */ var t2 = tri ? v10 : v01;
+ /** @type {Array<number>} */ var color = deMath.add(
+ deMath.add(t0, deMath.scale(deMath.subtract(t1, t0), tx)),
+ deMath.scale(deMath.subtract(t2, t0), ty)
+ );
+
+ dstAccess.setPixel(color, x0 + x, y0 + y);
+ }
+ }
+ };
+
+ /**
+ * @param {WebGLBuffer} buffer
+ * @param {Uint8Array} refPtr
+ * @param {number} offset
+ * @param {number} numBytes
+ * @return {boolean}
+ */
+ glsBufferTestUtil.VertexArrayVerifier.prototype.verifyNoTarget = function(buffer, refPtr, offset, numBytes) {
+ var numBytesInVtx = 3;
+ var numBytesInQuad = numBytesInVtx * 4;
+ var maxQuadsX = Math.min(128, Math.floor(gl.drawingBufferWidth / glsBufferTestUtil.VERIFY_QUAD_SIZE));
+ var maxQuadsY = Math.min(128, Math.floor(gl.drawingBufferHeight / glsBufferTestUtil.VERIFY_QUAD_SIZE));
+ var maxQuadsPerBatch = maxQuadsX * maxQuadsY;
+ var numVerified = 0;
+ var program = this.m_program.getProgram();
+ /** @type {tcuRGBA.RGBA} */ var threshold = /*TODO: renderTarget.getPixelFormat().getColorThreshold() + tcu::RGBA(3,3,3,3);*/ new tcuRGBA.RGBA([3, 3, 3, 3]);
+ var isOk = true;
+
+ /** @type {Array<number>} */ var positions = [];
+ /** @type {Uint16Array} */var indices;
+
+ /** @type {tcuSurface.Surface} */ var rendered = new tcuSurface.Surface();
+ /** @type {tcuSurface.Surface} */ var reference = new tcuSurface.Surface();
+
+ // Can't render full quad with smaller buffers.
+ assertMsgOptions(numBytes >= numBytesInQuad, 'Number of bytes must be bigger than number of bytes per quad', false, true);
+
+ positions = glsBufferTestUtil.computePositions(maxQuadsX, maxQuadsY);
+ indices = glsBufferTestUtil.computeIndices(maxQuadsX, maxQuadsY);
+
+ // Reset buffer bindings.
+ gl.bindBuffer(gl.PIXEL_PACK_BUFFER, null);
+
+ // Setup rendering state.
+ gl.viewport(0, 0, maxQuadsX * glsBufferTestUtil.VERIFY_QUAD_SIZE, maxQuadsY * glsBufferTestUtil.VERIFY_QUAD_SIZE);
+ gl.clearColor(0.0, 0.0, 0.0, 1.0);
+ gl.useProgram(program);
+ gl.bindVertexArray(this.m_vao);
+
+ // Upload positions
+ gl.bindBuffer(gl.ARRAY_BUFFER, this.m_positionBuf);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(this.m_posLoc);
+ gl.vertexAttribPointer(this.m_posLoc, 2, gl.FLOAT, false, 0, 0);
+
+ // Upload indices
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.m_indexBuf);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(indices), gl.STATIC_DRAW);
+
+ gl.enableVertexAttribArray(this.m_byteVecLoc);
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
+
+ while (numVerified < numBytes) {
+ /** @type {number} */ var numRemaining = numBytes - numVerified;
+ var isLeftoverBatch = numRemaining < numBytesInQuad;
+ /** @type {number} */ var numBytesToVerify = isLeftoverBatch ? numBytesInQuad : Math.min(maxQuadsPerBatch * numBytesInQuad, numRemaining - numRemaining % numBytesInQuad);
+ /** @type {number} */ var curOffset = isLeftoverBatch ? (numBytes - numBytesInQuad) : numVerified;
+ /** @type {number} */ var numQuads = Math.floor(numBytesToVerify / numBytesInQuad);
+ /** @type {number} */ var numCols = Math.min(maxQuadsX, numQuads);
+ /** @type {number} */ var numRows = Math.floor(numQuads / maxQuadsX) + (numQuads % maxQuadsX != 0 ? 1 : 0);
+ /** @type {string} */ var imageSetDesc = 'Bytes ' + (offset + curOffset) + ' to ' + (offset + curOffset + numBytesToVerify - 1);
+
+ assertMsgOptions(numBytesToVerify > 0 && numBytesToVerify % numBytesInQuad == 0, 'Bytes to verify must be greater than zero and must be a multiple of the bytes per quad', false, true);
+ assertMsgOptions(deMath.deInBounds32(curOffset, 0, numBytes), 'Offset out of bounds', false, true);
+ assertMsgOptions(deMath.deInRange32(curOffset + numBytesToVerify, curOffset, numBytes), 'Range of bytes to verify outside of bounds', false, true);
+
+ // Render batch.
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.vertexAttribPointer(this.m_byteVecLoc, 3, gl.UNSIGNED_BYTE, true, 0, offset + curOffset);
+ gl.drawElements(gl.TRIANGLES, numQuads * 6, gl.UNSIGNED_SHORT, 0);
+
+ glsBufferTestUtil.renderQuadGridReference(reference, numQuads, numCols, refPtr.subarray(offset + curOffset));
+
+ rendered.setSize(numCols * glsBufferTestUtil.VERIFY_QUAD_SIZE, numRows * glsBufferTestUtil.VERIFY_QUAD_SIZE);
+ rendered.readViewport(gl, [0, 0, numCols * glsBufferTestUtil.VERIFY_QUAD_SIZE, numRows * glsBufferTestUtil.VERIFY_QUAD_SIZE]);
+
+ if (!tcuImageCompare.pixelThresholdCompare('RenderResult', imageSetDesc, reference, rendered, threshold.toIVec(), tcuImageCompare.CompareLogMode.RESULT)) {
+ isOk = false;
+ break;
+ }
+
+ numVerified += isLeftoverBatch ? numRemaining : numBytesToVerify;
+ }
+
+ gl.bindVertexArray(null);
+
+ return isOk;
+ };
+
+ // IndexArrayVerifier
+
+ /**
+ * @constructor
+ * @extends {glsBufferTestUtil.BufferVerifierBase}
+ */
+ glsBufferTestUtil.IndexArrayVerifier = function() {
+ glsBufferTestUtil.BufferVerifierBase.call(this);
+
+ this.m_program = null;
+ this.m_posLoc = 0;
+ this.m_colorLoc = 0;
+
+ /** @type {gluShaderUtil.GLSLVersion} */ var glslVersion = gluShaderUtil.GLSLVersion.V300_ES;
+
+ assertMsgOptions(gluShaderUtil.isGLSLVersionSupported(gl, glslVersion), 'GLSL version not supported', false, true);
+
+ this.m_program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(
+ gluShaderUtil.getGLSLVersionDeclaration(glslVersion) + '\n' +
+ 'in highp vec2 a_position;\n' +
+ 'in mediump vec3 a_color;\n' +
+ 'out mediump vec3 v_color;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = vec4(a_position, 0.0, 1.0);\n' +
+ ' v_color = a_color;\n' +
+ '}\n',
+
+ gluShaderUtil.getGLSLVersionDeclaration(glslVersion) + '\n' +
+ 'in mediump vec3 v_color;\n' +
+ 'layout(location = 0) out mediump vec4 o_color;\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' o_color = vec4(v_color, 1.0);\n' +
+ '}\n'));
+
+ if (!this.m_program.isOk()) {
+ testFailed('Compile failed');
+ }
+
+ this.m_posLoc = gl.getAttribLocation(this.m_program.getProgram(), 'a_position');
+ this.m_colorLoc = gl.getAttribLocation(this.m_program.getProgram(), 'a_color');
+
+ this.m_vao = gl.createVertexArray();
+ this.m_positionBuf = gl.createBuffer();
+ this.m_colorBuf = gl.createBuffer();
+ };
+
+ glsBufferTestUtil.IndexArrayVerifier.prototype = Object.create(glsBufferTestUtil.BufferVerifierBase.prototype);
+ glsBufferTestUtil.IndexArrayVerifier.prototype.constructor = glsBufferTestUtil.IndexArrayVerifier;
+
+ /**
+ * deinit
+ */
+ glsBufferTestUtil.IndexArrayVerifier.prototype.deinit = function() {
+ if (this.m_vao) gl.deleteVertexArray(this.m_vao);
+ if (this.m_positionBuf) gl.deleteBuffer(this.m_positionBuf);
+ if (this.m_colorBuf) gl.deleteBuffer(this.m_colorBuf);
+ };
+
+ /**
+ * @return {Array<number>}
+ */
+ glsBufferTestUtil.computeIndexVerifierPositions = function() {
+ var numPosX = 16;
+ var numPosY = 16;
+
+ var dst = [];
+
+ for (var y = 0; y < numPosY; y++) {
+ for (var x = 0; x < numPosX; x++) {
+ var xf = x / (numPosX - 1);
+ var yf = y / (numPosY - 1);
+
+ var offset = 2 * (y * numPosX + x);
+ dst[offset] = 2.0 * xf - 1.0;
+ dst[offset + 1] = 2.0 * yf - 1.0;
+ }
+ }
+
+ return dst;
+ };
+
+ /**
+ * @return {Array<number>}
+ */
+ glsBufferTestUtil.computeIndexVerifierColors = function() {
+ /** @type {number} */ var numColors = 256;
+ /** @type {number} */ var minVal = 0.1;
+ /** @type {number} */ var maxVal = 0.5;
+ var rnd = new deRandom.Random(0xabc231);
+
+ var dst = [];
+
+ for (var i = 0; i < numColors; ++i) {
+ dst[3 * i] = rnd.getFloat(minVal, maxVal);
+ dst[3 * i + 1] = rnd.getFloat(minVal, maxVal);
+ dst[3 * i + 2] = rnd.getFloat(minVal, maxVal);
+ }
+
+ return dst;
+ };
+
+ /**
+ * @param {Array<number>} dst
+ * @param {Array<number>} src
+ * @param {Uint8Array} indices
+ * @param {number} numIndices
+ */
+ glsBufferTestUtil.execVertexFetch = function(dst, src, indices, numIndices) {
+ for (var i = 0; i < numIndices; ++i)
+ dst[i] = src[indices[i]];
+ };
+
+ /**
+ * @param {WebGLBuffer} buffer
+ * @param {Uint8Array} refPtr
+ * @param {number} offset
+ * @param {number} numBytes
+ * @return {boolean}
+ */
+ glsBufferTestUtil.IndexArrayVerifier.prototype.verify = function(buffer, refPtr, offset, numBytes) {
+ var viewportW = Math.min(glsBufferTestUtil.INDEX_ARRAY_DRAW_VIEWPORT_WIDTH, gl.drawingBufferWidth);
+ var viewportH = Math.min(glsBufferTestUtil.INDEX_ARRAY_DRAW_VIEWPORT_HEIGHT, gl.drawingBufferHeight);
+ var minBytesPerBatch = 2;
+ /** @type {tcuRGBA.RGBA} */ var threshold = new tcuRGBA.RGBA([0, 0, 0, 0]);
+
+ var positions = [];
+ var colors = [];
+
+ var fetchedPos = [];
+ var fetchedColor = [];
+
+ /** @type {tcuSurface.Surface} */ var indexBufferImg = new tcuSurface.Surface(viewportW, viewportH);
+ /** @type {tcuSurface.Surface} */ var referenceImg = new tcuSurface.Surface(viewportW, viewportH);
+
+ var numVerified = 0;
+ var isOk = true;
+
+ positions = glsBufferTestUtil.computeIndexVerifierPositions();
+ colors = glsBufferTestUtil.computeIndexVerifierColors();
+
+ // Reset buffer bindings.
+ gl.bindVertexArray(this.m_vao);
+ gl.bindBuffer(gl.PIXEL_PACK_BUFFER, null);
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer);
+
+ // Setup rendering state.
+ gl.viewport(0, 0, viewportW, viewportH);
+ gl.clearColor(0.0, 0.0, 0.0, 1.0);
+ gl.useProgram(this.m_program.getProgram());
+ gl.enableVertexAttribArray(this.m_posLoc);
+ gl.enableVertexAttribArray(this.m_colorLoc);
+ gl.enable(gl.BLEND);
+ gl.blendFunc(gl.ONE, gl.ONE);
+ gl.blendEquation(gl.FUNC_ADD);
+
+ while (numVerified < numBytes) {
+ var numRemaining = numBytes - numVerified;
+ var isLeftoverBatch = numRemaining < minBytesPerBatch;
+ var numBytesToVerify = isLeftoverBatch ? minBytesPerBatch : Math.min(glsBufferTestUtil.MAX_LINES_PER_INDEX_ARRAY_DRAW + 1, numRemaining);
+ var curOffset = isLeftoverBatch ? (numBytes - minBytesPerBatch) : numVerified;
+ /** @type {string} */ var imageSetDesc = 'Bytes ' + (offset + curOffset) + ' to ' + (offset + curOffset + numBytesToVerify - 1);
+
+ // Step 1: Render using index buffer.
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, this.m_positionBuf);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STREAM_DRAW);
+ gl.vertexAttribPointer(this.m_posLoc, 2, gl.FLOAT, false, 0, 0);
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, this.m_colorBuf);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STREAM_DRAW);
+ gl.vertexAttribPointer(this.m_colorLoc, 3, gl.FLOAT, false, 0, 0);
+
+ gl.drawElements(gl.LINE_STRIP, numBytesToVerify, gl.UNSIGNED_BYTE, offset + curOffset);
+ indexBufferImg.readViewport(gl);
+
+ // Step 2: Do manual fetch and render without index buffer.
+ glsBufferTestUtil.execVertexFetch(fetchedPos, positions, refPtr.subarray(offset + curOffset), numBytesToVerify);
+ glsBufferTestUtil.execVertexFetch(fetchedColor, colors, refPtr.subarray(offset + curOffset), numBytesToVerify);
+
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, this.m_positionBuf);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(fetchedPos), gl.STREAM_DRAW);
+ gl.vertexAttribPointer(this.m_posLoc, 2, gl.FLOAT, false, 0, 0);
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, this.m_colorBuf);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(fetchedColor), gl.STREAM_DRAW);
+ gl.vertexAttribPointer(this.m_colorLoc, 3, gl.FLOAT, false, 0, 0);
+
+ gl.drawArrays(gl.LINE_STRIP, 0, numBytesToVerify);
+ referenceImg.readViewport(gl, [0, 0, viewportW, viewportH]);
+
+ if (!tcuImageCompare.pixelThresholdCompare('RenderResult', imageSetDesc, referenceImg, indexBufferImg, threshold.toIVec(), tcuImageCompare.CompareLogMode.RESULT)) {
+ isOk = false;
+ break;
+ }
+
+ numVerified += isLeftoverBatch ? numRemaining : numBytesToVerify;
+ }
+
+ gl.bindVertexArray(null);
+
+ return isOk;
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsBuiltinPrecisionTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsBuiltinPrecisionTests.js
new file mode 100644
index 0000000000..4dc3be70f3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsBuiltinPrecisionTests.js
@@ -0,0 +1,5415 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('modules.shared.glsBuiltinPrecisionTests');
+goog.require('framework.common.tcuFloatFormat');
+goog.require('framework.common.tcuInterval');
+goog.require('framework.common.tcuMatrix');
+goog.require('framework.common.tcuMatrixUtil');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deUtil');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluVarType');
+goog.require('framework.opengl.simplereference.sglrGLContext');
+goog.require('modules.shared.glsBuiltinPrecisionTestsUnitTests');
+goog.require('modules.shared.glsShaderExecUtil');
+
+goog.scope(function() {
+
+ var glsBuiltinPrecisionTests = modules.shared.glsBuiltinPrecisionTests;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var gluShaderProgram = framework.opengl.gluShaderProgram;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var tcuInterval = framework.common.tcuInterval;
+ var tcuFloatFormat = framework.common.tcuFloatFormat;
+ var deRandom = framework.delibs.debase.deRandom;
+ var glsShaderExecUtil = modules.shared.glsShaderExecUtil;
+ var sglrGLContext = framework.opengl.simplereference.sglrGLContext;
+ var deMath = framework.delibs.debase.deMath;
+ var deUtil = framework.delibs.debase.deUtil;
+ var gluVarType = framework.opengl.gluVarType;
+ var tcuMatrix = framework.common.tcuMatrix;
+ var tcuMatrixUtil = framework.common.tcuMatrixUtil;
+ var ref = modules.shared.glsBuiltinPrecisionTestsUnitTests.cppreference;
+ var referenceComparison = modules.shared.glsBuiltinPrecisionTestsUnitTests.referenceComparison;
+
+ var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+ };
+
+var setParentClass = function(child, parent) {
+ child.prototype = Object.create(parent.prototype);
+ child.prototype.constructor = child;
+};
+
+ /** @typedef {(tcuInterval.Interval|Array<tcuInterval.Interval>|tcuMatrix.Matrix)} */
+ glsBuiltinPrecisionTests.Intervals;
+
+ /** @typedef {(number|Array<number>|tcuMatrix.Matrix)} */
+ glsBuiltinPrecisionTests.Value;
+
+ /** @typedef {(string)} */
+ glsBuiltinPrecisionTests.Typename;
+
+ //Change to true for WebGL unit testing
+ var enableUnittests = false;
+
+ /**
+ * @param {number} value
+ * @return {boolean}
+ */
+ glsBuiltinPrecisionTests.isFloat = function(value) {
+ return value % 1 !== 0;
+ };
+
+ /**
+ * @constructor
+ * @param {string} R
+ * @param {string=} P0
+ * @param {string=} P1
+ * @param {string=} P2
+ * @param {string=} P3
+ */
+ glsBuiltinPrecisionTests.Signature = function(R, P0, P1, P2, P3) {
+ this.Ret = R;
+ this.Arg0 = P0 === undefined ? 'void' : P0;
+ this.Arg1 = P1 === undefined ? 'void' : P1;
+ this.Arg2 = P2 === undefined ? 'void' : P2;
+ this.Arg3 = P3 === undefined ? 'void' : P3;
+ };
+
+ /** @typedef {Array<glsBuiltinPrecisionTests.FuncBase>} */
+ glsBuiltinPrecisionTests.FuncSet;
+
+ /**
+ * @constructor
+ * @template T
+ * @param {T} A0
+ * @param {T} A1
+ * @param {T} A2
+ * @param {T} A3
+ */
+ glsBuiltinPrecisionTests.Tuple4 = function(A0, A1, A2, A3) {
+ this.a = A0;
+ this.b = A1;
+ this.c = A2;
+ this.d = A3;
+ };
+
+ /**
+ * @typedef {!glsBuiltinPrecisionTests.Tuple4<string>}
+ */
+ glsBuiltinPrecisionTests.ParamNames;
+
+ /**
+ * Returns true for all other types except Void
+ * @param {string} typename
+ */
+ glsBuiltinPrecisionTests.isTypeValid = function(typename) {
+ if (typename === 'void')
+ return false;
+ return true;
+ };
+
+ /**
+ * Returns true for all other types except Void
+ * @param {*} In
+ * @return {number}
+ */
+ glsBuiltinPrecisionTests.numInputs = function(In) {
+ return (!glsBuiltinPrecisionTests.isTypeValid(In.In0) ? 0 :
+ !glsBuiltinPrecisionTests.isTypeValid(In.In1) ? 1 :
+ !glsBuiltinPrecisionTests.isTypeValid(In.In2) ? 2 :
+ !glsBuiltinPrecisionTests.isTypeValid(In.In3) ? 3 :
+ 4);
+ };
+
+ /**
+ * Returns true for all other types except Void
+ * @param {*} Out
+ * @return {number}
+ */
+ glsBuiltinPrecisionTests.numOutputs = function(Out) {
+ return (!glsBuiltinPrecisionTests.isTypeValid(Out.Out0) ? 0 :
+ !glsBuiltinPrecisionTests.isTypeValid(Out.Out1) ? 1 :
+ 2);
+ };
+
+ /**
+ * @constructor
+ * @param {glsBuiltinPrecisionTests.Typename=} In0_
+ * @param {glsBuiltinPrecisionTests.Typename=} In1_
+ * @param {glsBuiltinPrecisionTests.Typename=} In2_
+ * @param {glsBuiltinPrecisionTests.Typename=} In3_
+ */
+ glsBuiltinPrecisionTests.InTypes = function(In0_, In1_, In2_, In3_) {
+ this.In0 = In0_ === undefined ? 'void' : In0_;
+ this.In1 = In1_ === undefined ? 'void' : In1_;
+ this.In2 = In2_ === undefined ? 'void' : In2_;
+ this.In3 = In3_ === undefined ? 'void' : In3_;
+ };
+
+ /**
+ * @constructor
+ * @param {glsBuiltinPrecisionTests.Typename=} Out0_
+ * @param {glsBuiltinPrecisionTests.Typename=} Out1_
+ */
+ glsBuiltinPrecisionTests.OutTypes = function(Out0_, Out1_) {
+ this.Out0 = Out0_ === undefined ? 'void' : Out0_;
+ this.Out1 = Out1_ === undefined ? 'void' : Out1_;
+ };
+
+ /**
+ * @constructor
+ */
+ glsBuiltinPrecisionTests.Environment = function() {
+ /** @type {Object} */ this.m_map = {};
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.Variable} variable
+ * @param {*} value
+ */
+ glsBuiltinPrecisionTests.Environment.prototype.bind = function(variable, value) {
+ this.m_map[variable.getName()] = value;
+ };
+
+ /**
+ * @param {*} variable
+ * @return {glsBuiltinPrecisionTests.Intervals}
+ */
+ glsBuiltinPrecisionTests.Environment.prototype.lookup = function(variable) {
+ if (variable instanceof glsBuiltinPrecisionTests.Variable)
+ return this.m_map[variable.getName()];
+
+ throw new Error('Invalid lookup input: ' + variable);
+ };
+
+ /**
+ * @constructor
+ * @param {tcuFloatFormat.FloatFormat} format_
+ * @param {gluShaderUtil.precision} floatPrecision_
+ * @param {glsBuiltinPrecisionTests.Environment} env_
+ * @param {number=} callDepth_
+ */
+ glsBuiltinPrecisionTests.EvalContext = function(format_, floatPrecision_, env_, callDepth_) {
+ this.format = format_;
+ this.floatPrecision = floatPrecision_;
+ this.env = env_;
+ this.callDepth = callDepth_ === undefined ? 0 : callDepth_;
+ };
+
+ /**
+ * @param {string} typename typename
+ * @param {tcuFloatFormat.FloatFormat} fmt
+ * @param {glsBuiltinPrecisionTests.Intervals} value
+ * @return {glsBuiltinPrecisionTests.Intervals}
+ */
+ glsBuiltinPrecisionTests.convert = function(typename, fmt, value) {
+ var traits = glsBuiltinPrecisionTests.Traits.traitsFactory(typename);
+
+ if (value instanceof Array) {
+ var ret = [];
+ for (var i = 0; i < value.length; i++)
+ ret.push(traits.doConvert(fmt, value[i]));
+ return ret;
+ }
+
+ if (value instanceof tcuMatrix.Matrix) {
+ var ret = new tcuMatrix.Matrix(value.rows, value.cols);
+ for (var i = 0; i < value.rows; i++)
+ for (var j = 0; j < value.cols; j++)
+ ret.set(i, j, traits.doConvert(fmt, value.get(i, j)));
+ return ret;
+ }
+
+ return traits.doConvert(fmt, value);
+ };
+
+ /**
+ * Returns true if every element of `ival` contains the corresponding element of `value`.
+ * @param {string} typename typename
+ * @param {glsBuiltinPrecisionTests.Intervals} ival
+ * @param {*} value
+ * @return {boolean}
+ */
+ glsBuiltinPrecisionTests.contains = function(typename, ival, value) {
+ var traits = glsBuiltinPrecisionTests.Traits.traitsFactory(typename);
+ var contains = true;
+
+ if (value instanceof Array) {
+ for (var i = 0; i < value.length; i++)
+ contains &= traits.doContains(ival[i], value[i]);
+ return contains;
+ }
+
+ if (value instanceof tcuMatrix.Matrix) {
+ for (var i = 0; i < value.rows; i++)
+ for (var j = 0; j < value.cols; j++)
+ contains &= traits.doContains(ival.get(i, j), value.get(i, j));
+ return contains;
+ }
+
+ return traits.doContains(ival, value);
+ };
+
+ /**
+ * @param {string} typename typename
+ * @param {glsBuiltinPrecisionTests.Intervals} ival0
+ * @param {glsBuiltinPrecisionTests.Intervals} ival1
+ * @return {glsBuiltinPrecisionTests.Intervals}
+ */
+ glsBuiltinPrecisionTests.union = function(typename, ival0, ival1) {
+ var traits = glsBuiltinPrecisionTests.Traits.traitsFactory(typename);
+
+ if (ival0 instanceof Array) {
+ var ret = [];
+ for (var i = 0; i < ival0.length; i++)
+ ret.push(traits.doUnion(ival0[i], ival1[i]));
+ return ret;
+ }
+
+ if (ival0 instanceof tcuMatrix.Matrix) {
+ var ret = new tcuMatrix.Matrix(ival0.rows, ival0.cols);
+ for (var i = 0; i < ival0.rows; i++)
+ for (var j = 0; j < ival0.cols; j++)
+ ret.set(i, j, traits.doUnion(ival0.get(i, j), ival1.get(i, j)));
+ return ret;
+ }
+
+ return traits.doUnion(ival0, ival1);
+ };
+
+ /**
+ * @param {string} typename
+ * @constructor
+ */
+ glsBuiltinPrecisionTests.Traits = function(typename) {
+ this.typename = typename;
+ this.rows = 1;
+ this.cols = 1;
+ };
+
+ glsBuiltinPrecisionTests.Traits.prototype.isScalar = function() {
+ return this.rows == 1 && this.cols == 1;
+ };
+
+ glsBuiltinPrecisionTests.Traits.prototype.isVector = function() {
+ return this.rows > 0 && this.cols == 1;
+ };
+
+ glsBuiltinPrecisionTests.Traits.prototype.isMatrix = function() {
+ return this.rows > 0 && this.cols > 1;
+ };
+
+ /**
+ * @param {string=} typename
+ */
+ glsBuiltinPrecisionTests.Traits.traitsFactory = function(typename) {
+ switch (typename) {
+ case 'boolean' : return new glsBuiltinPrecisionTests.TraitsBool();
+ case 'float' : case 'vec2' : case 'vec3' : case 'vec4' :
+ case 'mat2' : case 'mat2x3' : case 'mat2x4' :
+ case 'mat3x2' : case 'mat3' : case 'mat3x4' :
+ case 'mat4x2' : case 'mat4x3' : case 'mat4' :
+ return new glsBuiltinPrecisionTests.TraitsFloat(typename);
+ case 'int' : return new glsBuiltinPrecisionTests.TraitsInt();
+ case 'void' : return new glsBuiltinPrecisionTests.TraitsVoid();
+ default:
+ throw new Error('Invalid typename:' + typename);
+ }
+ };
+
+ glsBuiltinPrecisionTests.round = function(typename, fmt, value) {
+ var traits = glsBuiltinPrecisionTests.Traits.traitsFactory(typename);
+
+ if (value instanceof Array) {
+ var ret = [];
+ for (var i = 0; i < value.length; i++)
+ ret.push(traits.doRound(fmt, value[i]));
+ return ret;
+ }
+
+ if (value instanceof tcuMatrix.Matrix) {
+ var ret = new tcuMatrix.Matrix(value.rows, value.cols);
+ for (var i = 0; i < value.rows; i++)
+ for (var j = 0; j < value.cols; j++)
+ ret.set(i, j, traits.doRound(fmt, value.get(i, j)));
+ return ret;
+ }
+
+ return traits.doRound(fmt, value);
+ };
+
+ /**
+ * cast the input typed array to correct type
+ * @param {string} typename
+ * @param {goog.TypedArray} input
+ * @return {goog.TypedArray}
+ */
+ glsBuiltinPrecisionTests.cast = function(typename, input) {
+ var traits = glsBuiltinPrecisionTests.Traits.traitsFactory(typename);
+ return traits.doCast(input);
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.Traits}
+ */
+ glsBuiltinPrecisionTests.TraitsVoid = function() {
+ glsBuiltinPrecisionTests.Traits.call(this, 'void');
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.TraitsVoid, glsBuiltinPrecisionTests.Traits);
+
+ /**
+ * @param {*} value
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.TraitsVoid.prototype.doMakeIVal = function(value) {
+ return new tcuInterval.Interval();
+ };
+
+ /**
+ * @param {*} value1
+ * @param {*} value2
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.TraitsVoid.prototype.doUnion = function(value1, value2) {
+ return new tcuInterval.Interval();
+ };
+
+ /**
+ * @param {*} value
+ * @return {boolean}
+ */
+ glsBuiltinPrecisionTests.TraitsVoid.prototype.doContains = function(value) {
+ return true;
+ };
+
+ /**
+ * @param {tcuFloatFormat.FloatFormat} fmt
+ * @param {tcuInterval.Interval} ival
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.TraitsVoid.prototype.doConvert = function(fmt, ival) {
+ return new tcuInterval.Interval();
+ };
+
+ /**
+ * @param {tcuFloatFormat.FloatFormat} fmt
+ * @param {*} ival
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.TraitsVoid.prototype.doRound = function(fmt, ival) {
+ return new tcuInterval.Interval();
+ };
+
+ /**
+ * @param {tcuFloatFormat.FloatFormat} fmt
+ * @param {*} ival
+ */
+ glsBuiltinPrecisionTests.TraitsVoid.prototype.doPrintIVal = function(fmt, ival) {
+ return '()';
+ };
+
+ /**
+ * @param {tcuFloatFormat.FloatFormat} fmt
+ * @param {*} value
+ */
+ glsBuiltinPrecisionTests.TraitsVoid.prototype.doPrintValue = function(fmt, value) {
+ return '()';
+ };
+
+ glsBuiltinPrecisionTests.dataTypeSize = function(detailedType) {
+ var size = [1, 1];
+ switch (detailedType) {
+ case 'vec2' : size[0] = 2; break;
+ case 'vec3' : size[0] = 3; break;
+ case 'vec4' : size[0] = 4; break;
+ case 'mat2' : size = [2 , 2]; break;
+ case 'mat2x3' : size = [3 , 2]; break;
+ case 'mat2x4' : size = [4 , 2]; break;
+
+ case 'mat3x2' : size = [2 , 3]; break;
+ case 'mat3' : size = [3 , 3]; break;
+ case 'mat3x4' : size = [4 , 3]; break;
+
+ case 'mat4x2' : size = [2 , 4]; break;
+ case 'mat4x3' : size = [3 , 4]; break;
+ case 'mat4' : size = [4 , 4]; break;
+ }
+ return size;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.Traits}
+ * @param {string} typename
+ * @param {string=} detailedType
+ */
+ glsBuiltinPrecisionTests.ScalarTraits = function(typename, detailedType) {
+ glsBuiltinPrecisionTests.Traits.call(this, typename);
+ var size = glsBuiltinPrecisionTests.dataTypeSize(detailedType);
+ this.rows = size[0];
+ this.cols = size[1];
+
+ /** type{tcuInterval.Interval} */ this.iVal;
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.ScalarTraits, glsBuiltinPrecisionTests.Traits);
+
+ glsBuiltinPrecisionTests.ScalarTraits.prototype = Object.create(glsBuiltinPrecisionTests.Traits.prototype);
+ glsBuiltinPrecisionTests.ScalarTraits.prototype.constructor = glsBuiltinPrecisionTests.ScalarTraits;
+
+ /**
+ * @param {*} value
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.ScalarTraits.prototype.doMakeIVal = function(value) {
+ // Thankfully all scalar types have a well-defined conversion to `double`,
+ // hence Interval can represent their ranges without problems.
+ return new tcuInterval.Interval(/** @type {number} */ (value));
+ };
+
+ /**
+ * @param {tcuInterval.Interval} a
+ * @param {tcuInterval.Interval} b
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.ScalarTraits.prototype.doUnion = function(a, b) {
+ return a.operatorOrBinary(b);
+ };
+
+ /**
+ * @param {tcuInterval.Interval} a
+ * @param {number} value
+ * @return {boolean}
+ */
+ glsBuiltinPrecisionTests.ScalarTraits.prototype.doContains = function(a, value) {
+ return a.contains(new tcuInterval.Interval(value));
+ };
+
+ /**
+ * @param {tcuFloatFormat.FloatFormat} fmt
+ * @param {tcuInterval.Interval} ival
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.ScalarTraits.prototype.doConvert = function(fmt, ival) {
+ return fmt.convert(ival);
+ };
+
+ /**
+ * @param {tcuFloatFormat.FloatFormat} fmt
+ * @param {number} value
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.ScalarTraits.prototype.doRound = function(fmt, value) {
+ return fmt.roundOut(new tcuInterval.Interval(value), false);//TODO cast to double
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.ScalarTraits}
+ * @param {string} detailedType
+ */
+ glsBuiltinPrecisionTests.TraitsFloat = function(detailedType) {
+ glsBuiltinPrecisionTests.ScalarTraits.call(this, 'float', detailedType);
+ };
+
+ glsBuiltinPrecisionTests.TraitsFloat.prototype = Object.create(glsBuiltinPrecisionTests.ScalarTraits.prototype);
+ glsBuiltinPrecisionTests.TraitsFloat.prototype.constructor = glsBuiltinPrecisionTests.TraitsFloat;
+
+ /**
+ * @param {tcuFloatFormat.FloatFormat} fmt
+ * @param {tcuInterval.Interval} ival
+ */
+ glsBuiltinPrecisionTests.TraitsFloat.prototype.doPrintIVal = function(fmt, ival) {
+ return fmt.intervalToHex(ival);
+ };
+
+ /**
+ * @param {goog.TypedArray} input
+ * @return {goog.TypedArray}
+ */
+ glsBuiltinPrecisionTests.TraitsFloat.prototype.doCast = function(input) {
+ return new Float32Array(input.buffer);
+ };
+
+ /**
+ * @param {tcuFloatFormat.FloatFormat} fmt
+ * @param {number} value
+ */
+ glsBuiltinPrecisionTests.TraitsFloat.prototype.doPrintValue = function(fmt, value) {
+ return fmt.floatToHex(value);
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.ScalarTraits}
+ */
+ glsBuiltinPrecisionTests.TraitsBool = function() {
+ glsBuiltinPrecisionTests.ScalarTraits.call(this, 'boolean');
+ };
+
+ glsBuiltinPrecisionTests.TraitsBool.prototype = Object.create(glsBuiltinPrecisionTests.ScalarTraits.prototype);
+ glsBuiltinPrecisionTests.TraitsBool.prototype.constructor = glsBuiltinPrecisionTests.TraitsBool;
+
+ /**
+ * @param {tcuFloatFormat.FloatFormat} fmt
+ * @param {tcuInterval.Interval} ival
+ */
+ glsBuiltinPrecisionTests.TraitsBool.prototype.doPrintIVal = function(fmt, ival) {
+ /** type{string} */ var os = '{';
+ var ifalse = new tcuInterval.Interval(0);
+ var itrue = new tcuInterval.Interval(1);
+ if (ival.contains(ifalse))
+ os += 'false';
+ if (ival.contains(ifalse) && ival.contains(itrue))
+ os += ', ';
+ if (ival.contains(itrue))
+ os += 'true';
+ os += '}';
+ return os;
+ };
+
+ /**
+ * @param {tcuFloatFormat.FloatFormat} fmt
+ * @param {boolean} value
+ */
+ glsBuiltinPrecisionTests.TraitsBool.prototype.doPrintValue = function(fmt, value) {
+ return value ? 'true' : 'false';
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.ScalarTraits}
+ */
+ glsBuiltinPrecisionTests.TraitsInt = function() {
+ glsBuiltinPrecisionTests.ScalarTraits.call(this, 'int');
+ };
+
+ glsBuiltinPrecisionTests.TraitsInt.prototype = Object.create(glsBuiltinPrecisionTests.ScalarTraits.prototype);
+ glsBuiltinPrecisionTests.TraitsInt.prototype.constructor = glsBuiltinPrecisionTests.TraitsInt;
+
+ /**
+ * @param {tcuFloatFormat.FloatFormat} fmt
+ * @param {tcuInterval.Interval} ival
+ */
+ glsBuiltinPrecisionTests.TraitsInt.prototype.doPrintIVal = function(fmt, ival) {
+ return '[' + (ival.lo()) + ', ' + (ival.hi()) + ']';
+ };
+
+ /**
+ * @param {tcuFloatFormat.FloatFormat} fmt
+ * @param {number} value
+ */
+ glsBuiltinPrecisionTests.TraitsInt.prototype.doPrintValue = function(fmt, value) {
+ return value.toString(10);
+ };
+
+ /**
+ * @constructor
+ */
+ glsBuiltinPrecisionTests.Statement = function() {
+
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ */
+ glsBuiltinPrecisionTests.Statement.prototype.execute = function(ctx) {
+ this.doExecute(ctx);
+ };
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.Statement.prototype.print = function() {
+ return this.doPrint();
+ };
+
+ glsBuiltinPrecisionTests.Statement.prototype.toString = function() {
+ return this.print();
+ };
+
+ /**
+ * Output the functions that this expression refers to
+ * @param {glsBuiltinPrecisionTests.FuncSet} dst
+ *
+ */
+ glsBuiltinPrecisionTests.Statement.prototype.getUsedFuncs = function(dst) {
+ this.doGetUsedFuncs(dst);
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ */
+ glsBuiltinPrecisionTests.Statement.prototype.doExecute = function(ctx) {
+ throw new Error('Virtual function. Please override.');
+ };
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.Statement.prototype.doPrint = function() {
+ throw new Error('Virtual function. Please override.');
+ };
+
+ /**
+ * Output the functions that this expression refers to
+ * @param {glsBuiltinPrecisionTests.FuncSet} dst
+ *
+ */
+ glsBuiltinPrecisionTests.Statement.prototype.doGetUsedFuncs = function(dst) {
+ throw new Error('Virtual function. Please override.');
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.Statement}
+ * @param {glsBuiltinPrecisionTests.Variable} variable
+ * @param {glsBuiltinPrecisionTests.Expr} value
+ * @param {boolean} isDeclaration
+ */
+ glsBuiltinPrecisionTests.VariableStatement = function(variable, value, isDeclaration) {
+ this.m_variable = variable;
+ this.m_value = value;
+ this.m_isDeclaration = isDeclaration;
+
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.VariableStatement, glsBuiltinPrecisionTests.Statement);
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ */
+ glsBuiltinPrecisionTests.VariableStatement.prototype.doExecute = function(ctx) {
+ ctx.env.bind(this.m_variable, this.m_value.evaluate(ctx));
+ };
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.VariableStatement.prototype.doPrint = function() {
+ var v = this.m_variable;
+ var os = '';
+ if (this.m_isDeclaration)
+ os += gluVarType.declareVariable(gluVarType.getVarTypeOf(v.typename),
+ v.getName());
+ else
+ os += v.getName();
+
+ os += ' = ' + this.m_value.printExpr() + ';\n';
+
+ return os;
+ };
+
+ /**
+ * Output the functions that this expression refers to
+ * @param {glsBuiltinPrecisionTests.FuncSet} dst
+ *
+ */
+ glsBuiltinPrecisionTests.VariableStatement.prototype.doGetUsedFuncs = function(dst) {
+ this.m_value.getUsedFuncs(dst);
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.Variable} variable
+ * @param {glsBuiltinPrecisionTests.Expr} definiens
+ * @return {glsBuiltinPrecisionTests.VariableStatement}
+ */
+ glsBuiltinPrecisionTests.variableDeclaration = function(variable, definiens) {
+ return new glsBuiltinPrecisionTests.VariableStatement(variable, definiens, true);
+ };
+
+ /**
+ * @param {string} typename
+ * @param {string} name
+ * @param {glsBuiltinPrecisionTests.ExpandContext} ctx
+ * @param {glsBuiltinPrecisionTests.Expr} expr
+ * @return {glsBuiltinPrecisionTests.Variable}
+ */
+ glsBuiltinPrecisionTests.bindExpression = function(typename, name, ctx, expr) {
+ var variable = ctx.genSym(typename, name);
+ ctx.addStatement(glsBuiltinPrecisionTests.variableDeclaration(variable, expr));
+ return variable;
+ };
+
+ /**
+ * Common base class for all expressions regardless of their type.
+ * @constructor
+ */
+ glsBuiltinPrecisionTests.ExprBase = function() {};
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.ExprBase.prototype.printExpr = function() {
+ return this.doPrintExpr();
+ };
+
+ glsBuiltinPrecisionTests.ExprBase.prototype.toString = function() {
+ return this.printExpr();
+ };
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.ExprBase.prototype.doPrintExpr = function() {
+ throw new Error('Virtual function. Please override.');
+ };
+
+ /**
+ * Output the functions that this expression refers to
+ * @param {glsBuiltinPrecisionTests.FuncSet} dst
+ *
+ */
+ glsBuiltinPrecisionTests.ExprBase.prototype.getUsedFuncs = function(/*FuncSet&*/ dst) {
+ this.doGetUsedFuncs(dst);
+ };
+
+ /**
+ * Output the functions that this expression refers to
+ * @param {glsBuiltinPrecisionTests.FuncSet} dst
+ *
+ */
+ glsBuiltinPrecisionTests.ExprBase.prototype.doGetUsedFuncs = function(/*FuncSet&*/ dst) {
+ throw new Error('Virtual function. Please override.');
+ };
+
+ /**
+ * Type-specific operations for an expression representing type typename.
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.ExprBase}
+ * @param {glsBuiltinPrecisionTests.Typename} typename
+ */
+ glsBuiltinPrecisionTests.Expr = function(typename) {
+ glsBuiltinPrecisionTests.ExprBase.call(this);
+ this.typename = typename;
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Expr, glsBuiltinPrecisionTests.ExprBase);
+
+ /**
+ * Type-specific operations for an expression representing type typename.
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ */
+ glsBuiltinPrecisionTests.Expr.prototype.evaluate = function(ctx) {
+ return this.doEvaluate(ctx);
+ };
+
+ /**
+ * Type-specific operations for an expression representing type typename.
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ */
+ glsBuiltinPrecisionTests.Expr.prototype.doEvaluate = function(ctx) {
+ throw new Error('Virtual function. Please override.');
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.Expr}
+ * @param {glsBuiltinPrecisionTests.Typename} typename
+ * @param {string=} name
+ */
+ glsBuiltinPrecisionTests.Variable = function(typename, name) {
+ glsBuiltinPrecisionTests.Expr.call(this, typename);
+ /** @type {string} */ this.m_name = name || '<undefined>';
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Variable, glsBuiltinPrecisionTests.Expr);
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.Variable.prototype.getName = function() {
+ return this.m_name;
+ };
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.Variable.prototype.doPrintExpr = function() {
+ return this.m_name;
+ };
+
+ glsBuiltinPrecisionTests.Variable.prototype.toString = function() {
+ return this.doPrintExpr();
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @return {*}
+ */
+ glsBuiltinPrecisionTests.Variable.prototype.doEvaluate = function(ctx) {
+ return ctx.env.lookup(this);
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.Variable}
+ * @param {*=} t
+ */
+ glsBuiltinPrecisionTests.Void = function(t) {
+ glsBuiltinPrecisionTests.Variable.call(this, 'void');
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Void, glsBuiltinPrecisionTests.Variable);
+
+ glsBuiltinPrecisionTests.Void.prototype.doEvaluate = function(ctx) {
+ return undefined;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.Variable}
+ * @param {number} value
+ */
+ glsBuiltinPrecisionTests.Constant = function(value) {
+ glsBuiltinPrecisionTests.Variable.call(this, 'float');
+ this.m_value = value;
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Constant, glsBuiltinPrecisionTests.Variable);
+
+ glsBuiltinPrecisionTests.Constant.prototype.doEvaluate = function(ctx) {
+ return new tcuInterval.Interval(this.m_value);
+ };
+
+ /**
+ * @constructor
+ * @param {*} typename
+ */
+ glsBuiltinPrecisionTests.DefaultSampling = function(typename) {
+ this.typename = typename;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.Expr}
+ * @param {glsBuiltinPrecisionTests.Variable} vector
+ * @param {number} index
+ */
+ glsBuiltinPrecisionTests.VectorVariable = function(vector, index) {
+ glsBuiltinPrecisionTests.Expr.call(this, vector.typename);
+ this.m_vector = vector;
+ this.m_index = index;
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.VectorVariable, glsBuiltinPrecisionTests.Expr);
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.VectorVariable.prototype.doEvaluate = function(ctx) {
+ var tmp = this.m_vector.doEvaluate(ctx);
+ return tmp[this.m_index];
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.Expr}
+ * @param {glsBuiltinPrecisionTests.Variable} matrix
+ * @param {number} row
+ * @param {number} col
+ */
+ glsBuiltinPrecisionTests.MatrixVariable = function(matrix, row, col) {
+ glsBuiltinPrecisionTests.Expr.call(this, matrix.typename);
+ this.m_matrix = matrix;
+ this.m_row = row;
+ this.m_col = col;
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.MatrixVariable, glsBuiltinPrecisionTests.Expr);
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.MatrixVariable.prototype.doEvaluate = function(ctx) {
+ var tmp = this.m_matrix.doEvaluate(ctx);
+ return tmp.get(this.m_row, this.m_col);
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.Expr}
+ * @param {glsBuiltinPrecisionTests.Typename} typename
+ * @param {glsBuiltinPrecisionTests.Func} func
+ * @param {glsBuiltinPrecisionTests.Expr=} arg0
+ * @param {glsBuiltinPrecisionTests.Expr=} arg1
+ * @param {glsBuiltinPrecisionTests.Expr=} arg2
+ * @param {glsBuiltinPrecisionTests.Expr=} arg3
+ */
+ glsBuiltinPrecisionTests.Apply = function(typename, func, arg0, arg1, arg2, arg3) {
+ glsBuiltinPrecisionTests.Expr.call(this, typename);
+ this.m_func = func;
+ /** @type {glsBuiltinPrecisionTests.Tuple4} */ this.m_args;
+ if (arg0 instanceof glsBuiltinPrecisionTests.Tuple4)
+ this.m_args = /** @type {glsBuiltinPrecisionTests.Tuple4} */ (arg0);
+ else {
+ this.m_args = new glsBuiltinPrecisionTests.Tuple4(arg0 || new glsBuiltinPrecisionTests.Void(),
+ arg1 || new glsBuiltinPrecisionTests.Void(),
+ arg2 || new glsBuiltinPrecisionTests.Void(),
+ arg3 || new glsBuiltinPrecisionTests.Void());
+ }
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Apply, glsBuiltinPrecisionTests.Expr);
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.Apply.prototype.doPrintExpr = function() {
+ var args = [this.m_args.a, this.m_args.b, this.m_args.c, this.m_args.d];
+ return this.m_func.print(args);
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @return {glsBuiltinPrecisionTests.Intervals}
+ */
+ glsBuiltinPrecisionTests.Apply.prototype.doEvaluate = function(ctx) {
+ var debug = false;
+
+ if (debug) {
+ glsBuiltinPrecisionTests.Apply.prototype.doEvaluate.level = glsBuiltinPrecisionTests.Apply.prototype.doEvaluate.level || 0;
+ var level = glsBuiltinPrecisionTests.Apply.prototype.doEvaluate.level;
+ glsBuiltinPrecisionTests.Apply.prototype.doEvaluate.level++;
+ var name = this.m_func.constructor.toString();
+ name = name.replace(/[\s\S]*glsBuiltinPrecisionTests\./m, '').replace(/\.call[\s\S]*/m, '');
+ if (this.m_func.getName)
+ name += ' ' + this.m_func.getName();
+ console.log('<' + level + '> Function ' + name);
+ }
+
+ var a = this.m_args.a.evaluate(ctx);
+ var b = this.m_args.b.evaluate(ctx);
+ var c = this.m_args.c.evaluate(ctx);
+ var d = this.m_args.d.evaluate(ctx);
+ var retVal = this.m_func.applyFunction(ctx, a, b, c, d);
+
+ if (debug) {
+ console.log('<' + level + '> a: ' + a);
+ console.log('<' + level + '> b: ' + b);
+ console.log('<' + level + '> returning: ' + retVal);
+ glsBuiltinPrecisionTests.Apply.prototype.doEvaluate.level--;
+ }
+ return retVal;
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.Func} func
+ * @param {glsBuiltinPrecisionTests.Expr=} arg0
+ * @param {glsBuiltinPrecisionTests.Expr=} arg1
+ * @param {glsBuiltinPrecisionTests.Expr=} arg2
+ * @param {glsBuiltinPrecisionTests.Expr=} arg3
+ */
+ var app = function(func, arg0, arg1, arg2, arg3) {
+ return new glsBuiltinPrecisionTests.Apply('float', func, arg0, arg1, arg2, arg3);
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.FuncSet} dst
+ */
+ glsBuiltinPrecisionTests.Apply.prototype.doGetUsedFuncs = function(dst) {
+ this.m_func.getUsedFuncs(dst);
+ this.m_args.a.getUsedFuncs(dst);
+ this.m_args.b.getUsedFuncs(dst);
+ this.m_args.c.getUsedFuncs(dst);
+ this.m_args.d.getUsedFuncs(dst);
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.Apply}
+ * @param {glsBuiltinPrecisionTests.Func} func
+ * @param {glsBuiltinPrecisionTests.Expr=} arg0
+ * @param {glsBuiltinPrecisionTests.Expr=} arg1
+ * @param {glsBuiltinPrecisionTests.Expr=} arg2
+ * @param {glsBuiltinPrecisionTests.Expr=} arg3
+ */
+ glsBuiltinPrecisionTests.ApplyScalar = function(func, arg0, arg1, arg2, arg3) {
+ glsBuiltinPrecisionTests.Apply.call(this, 'float', func, arg0, arg1, arg2, arg3);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.ApplyScalar, glsBuiltinPrecisionTests.Apply);
+
+ glsBuiltinPrecisionTests.ApplyScalar.prototype.doEvaluate = function(ctx) {
+ var debug = false;
+
+ if (debug) {
+ glsBuiltinPrecisionTests.ApplyScalar.prototype.doEvaluate.level = glsBuiltinPrecisionTests.ApplyScalar.prototype.doEvaluate.level || 0;
+ var level = glsBuiltinPrecisionTests.ApplyScalar.prototype.doEvaluate.level;
+ glsBuiltinPrecisionTests.ApplyScalar.prototype.doEvaluate.level++;
+ var name = this.m_func.constructor.toString();
+ name = name.replace(/[\s\S]*glsBuiltinPrecisionTests\./m, '').replace(/\.call[\s\S]*/m, '');
+ if (this.m_func.getName)
+ name += ' ' + this.m_func.getName();
+ console.log('scalar<' + level + '> Function ' + name);
+ }
+
+ var a = this.m_args.a.evaluate(ctx);
+ var b = this.m_args.b.evaluate(ctx);
+ var c = this.m_args.c.evaluate(ctx);
+ var d = this.m_args.d.evaluate(ctx);
+ if (a instanceof Array) {
+ var ret = [];
+ for (var i = 0; i < a.length; i++) {
+ var p0 = a instanceof Array ? a[i] : a;
+ var p1 = b instanceof Array ? b[i] : b;
+ var p2 = c instanceof Array ? c[i] : c;
+ var p3 = d instanceof Array ? d[i] : d;
+ ret.push(this.m_func.applyFunction(ctx, p0, p1, p2, p3));
+ }
+ return ret;
+ }
+
+ var retVal = this.m_func.applyFunction(ctx, a, b, c, d);
+
+ if (debug) {
+ console.log('scalar<' + level + '> a: ' + a);
+ console.log('scalar<' + level + '> b: ' + b);
+ console.log('scalar<' + level + '> return1: ' + ret);
+ console.log('scalar<' + level + '> return2: ' + retVal);
+ glsBuiltinPrecisionTests.Apply.prototype.doEvaluate.level--;
+ }
+
+ return retVal;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.Apply}
+ */
+ glsBuiltinPrecisionTests.ApplyVar = function(typename, func, arg0, arg1, arg2, arg3) {
+ glsBuiltinPrecisionTests.Apply.call(this, typename, func, arg0, arg1, arg2, arg3);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.ApplyVar, glsBuiltinPrecisionTests.Apply);
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @return {glsBuiltinPrecisionTests.Intervals}
+ */
+ glsBuiltinPrecisionTests.ApplyVar.prototype.doEvaluate = function(ctx) {
+ return this.m_func.applyFunction(ctx,
+ ctx.env.lookup(this.m_args.a), ctx.env.lookup(this.m_args.b),
+ ctx.env.lookup(this.m_args.c), ctx.env.lookup(this.m_args.d),
+ [this.m_args.a.getName(), this.m_args.b.getName(),
+ this.m_args.c.getName(), this.m_args.d.getName()]);
+ };
+
+ /**
+ * @constructor
+ */
+ glsBuiltinPrecisionTests.FuncBase = function() {};
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.FuncBase.prototype.getName = function() {
+ return '';
+ };
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.FuncBase.prototype.getRequiredExtension = function() {
+ return '';
+ };
+
+ /**
+ * @param {Array<glsBuiltinPrecisionTests.ExprBase>} args
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.FuncBase.prototype.print = function(args) {
+ return '';
+ };
+
+ /**
+ * Index of output parameter, or -1 if none of the parameters is output.
+ * @return {number}
+ */
+ glsBuiltinPrecisionTests.FuncBase.prototype.getOutParamIndex = function() {
+ return -1;
+ };
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.FuncBase.prototype.printDefinition = function() {
+ return this.doPrintDefinition();
+ };
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.FuncBase.prototype.doPrintDefinition = function() {
+ throw new Error('Virtual function. Please override.');
+ };
+
+ /**
+ * typedef set<const FuncBase*> FuncSet;
+ * @param {glsBuiltinPrecisionTests.FuncSet} dst
+ */
+ glsBuiltinPrecisionTests.FuncBase.prototype.getUsedFuncs = function(dst) {
+ this.doGetUsedFuncs(dst);
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.FuncSet} dst
+ */
+ glsBuiltinPrecisionTests.FuncBase.prototype.doGetUsedFuncs = function(dst) {};
+
+ /*************************************/
+ /**
+ * \brief Function objects.
+ *
+ * Each Func object represents a GLSL function. It can be applied to interval
+ * arguments, and it returns the an interval that is a conservative
+ * approximation of the image of the GLSL function over the argument
+ * intervals. That is, it is given a set of possible arguments and it returns
+ * the set of possible values.
+ *
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.FuncBase}
+ * @param {glsBuiltinPrecisionTests.Signature} Sig_ template <typename Sig_>
+ */
+ glsBuiltinPrecisionTests.Func = function(Sig_) {
+ glsBuiltinPrecisionTests.FuncBase.call(this);
+ this.Sig = Sig_;
+ this.Ret = this.Sig.Ret;
+ this.Arg0 = this.Sig.Arg0;
+ this.Arg1 = this.Sig.Arg1;
+ this.Arg2 = this.Sig.Arg2;
+ this.Arg3 = this.Sig.Arg3;
+ };
+
+ glsBuiltinPrecisionTests.Func.prototype = Object.create(glsBuiltinPrecisionTests.FuncBase.prototype);
+ glsBuiltinPrecisionTests.Func.prototype.constructor = glsBuiltinPrecisionTests.Func;
+
+ /**
+ * @param {Array<glsBuiltinPrecisionTests.ExprBase>} args
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.Func.prototype.print = function(args) {
+ return this.doPrint(args);
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @param {glsBuiltinPrecisionTests.Intervals=} Iarg0
+ * @param {glsBuiltinPrecisionTests.Intervals=} Iarg1
+ * @param {glsBuiltinPrecisionTests.Intervals=} Iarg2
+ * @param {glsBuiltinPrecisionTests.Intervals=} Iarg3
+ * @return {glsBuiltinPrecisionTests.Intervals}
+ */
+ glsBuiltinPrecisionTests.Func.prototype.applyFunction = function(ctx, Iarg0, Iarg1, Iarg2, Iarg3, variablenames) {
+ return this.applyArgs(ctx, new glsBuiltinPrecisionTests.Tuple4(Iarg0, Iarg1, Iarg2, Iarg3), variablenames);
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @param {glsBuiltinPrecisionTests.Tuple4} args
+ * @return {glsBuiltinPrecisionTests.Intervals}
+ */
+ glsBuiltinPrecisionTests.Func.prototype.applyArgs = function(ctx, args, variablenames) {
+ return this.doApply(ctx, args, variablenames);
+ };
+
+ /**
+ * @return {glsBuiltinPrecisionTests.ParamNames}
+ */
+ glsBuiltinPrecisionTests.Func.prototype.getParamNames = function() {
+ return this.doGetParamNames();
+ };
+
+ /**
+ * @param {Array<glsBuiltinPrecisionTests.ExprBase>} args
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.Func.prototype.doPrint = function(args) {
+ /** type{string} */ var os = this.getName() + '(';
+
+ // TODO: fix the generics
+ for (var i = 0; i < args.length; i++)
+ if (glsBuiltinPrecisionTests.isTypeValid(args[i].typename)) {
+ if (i != 0)
+ os += ', ';
+ os += args[i];
+ }
+
+ os += ')';
+
+ return os;
+ };
+
+ /**
+ * @return {glsBuiltinPrecisionTests.ParamNames} args
+ */
+ glsBuiltinPrecisionTests.Func.prototype.doGetParamNames = function() {
+ /** @type {glsBuiltinPrecisionTests.ParamNames} */ var names = new glsBuiltinPrecisionTests.Tuple4('a', 'b', 'c', 'd');
+ return names;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.Func}
+ * @param {glsBuiltinPrecisionTests.Signature} Sig template <typename Sig>
+ *
+ */
+ glsBuiltinPrecisionTests.PrimitiveFunc = function(Sig) {
+ glsBuiltinPrecisionTests.Func.call(this, Sig);
+ this.Ret = Sig.Ret;
+ };
+
+ glsBuiltinPrecisionTests.PrimitiveFunc.prototype = Object.create(glsBuiltinPrecisionTests.Func.prototype);
+ glsBuiltinPrecisionTests.PrimitiveFunc.prototype.constructor = glsBuiltinPrecisionTests.PrimitiveFunc;
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.PrimitiveFunc}
+ * @param {string} typename
+ *
+ */
+ glsBuiltinPrecisionTests.Cond = function(typename) {
+ var sig = new glsBuiltinPrecisionTests.Signature(typename, 'boolean', typename, typename);
+ glsBuiltinPrecisionTests.PrimitiveFunc.call(this, sig);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Cond, glsBuiltinPrecisionTests.PrimitiveFunc);
+
+ glsBuiltinPrecisionTests.Cond.prototype.getName = function() {
+ return '_cond';
+ };
+
+ glsBuiltinPrecisionTests.Cond.prototype.doPrint = function(args) {
+ var str = '(' + args[0] + ' ? ' + args[1] + ' : ' + args[2] + ')';
+ return str;
+ };
+
+ glsBuiltinPrecisionTests.Cond.prototype.doApply = function(ctx, iargs) {
+ var ret;
+ if (glsBuiltinPrecisionTests.contains(this.Sig.Arg0, iargs.a, 1))
+ ret = iargs.b;
+ if (glsBuiltinPrecisionTests.contains(this.Sig.Arg0, iargs.a, 0)) {
+ if (ret)
+ ret = glsBuiltinPrecisionTests.union(this.Sig.Ret, ret, iargs.c);
+ else
+ ret = iargs.c;
+ }
+ if (ret)
+ return ret;
+ return new tcuInterval.Interval();
+ };
+
+ /**
+ * If multipleInputs is false, GenVec duplicates first input to proper size
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.PrimitiveFunc}
+ * @param {number} size
+ * @param {boolean=} multipleInputs
+ */
+ glsBuiltinPrecisionTests.GenVec = function(size, multipleInputs) {
+ var vecName = glsBuiltinPrecisionTests.sizeToName(size);
+ var p = [
+ size >= 1 ? 'float' : undefined,
+ size >= 2 ? 'float' : undefined,
+ size >= 3 ? 'float' : undefined,
+ size >= 4 ? 'float' : undefined
+ ];
+ var sig = new glsBuiltinPrecisionTests.Signature(vecName, p[0], p[1], p[2], p[3]);
+ glsBuiltinPrecisionTests.PrimitiveFunc.call(this, sig);
+ this.size = size;
+ this.vecName = vecName;
+ this.multipleInputs = multipleInputs || false;
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.GenVec, glsBuiltinPrecisionTests.PrimitiveFunc);
+
+ glsBuiltinPrecisionTests.GenVec.prototype.getName = function() {
+ return this.vecName;
+ };
+
+ glsBuiltinPrecisionTests.GenVec.prototype.doApply = function(ctx, iargs) {
+ if (this.size == 1)
+ return iargs.a;
+
+ var ret = this.multipleInputs ?
+ [iargs.a, iargs.b, iargs.c, iargs.d] :
+ [iargs.a, iargs.a, iargs.a, iargs.a];
+
+ return ret.slice(0, this.size);
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.PrimitiveFunc}
+ * @param {number} rows
+ * @param {number} cols
+ */
+ glsBuiltinPrecisionTests.GenMat = function(rows, cols) {
+ var name = glsBuiltinPrecisionTests.dataTypeNameOfMatrix('float', rows, cols);
+ var vecName = glsBuiltinPrecisionTests.sizeToName(rows);
+ var p = [
+ cols >= 1 ? vecName : undefined,
+ cols >= 2 ? vecName : undefined,
+ cols >= 3 ? vecName : undefined,
+ cols >= 4 ? vecName : undefined
+ ];
+ var sig = new glsBuiltinPrecisionTests.Signature(name, p[0], p[1], p[2], p[3]);
+ glsBuiltinPrecisionTests.PrimitiveFunc.call(this, sig);
+ this.rows = rows;
+ this.cols = cols;
+ this.name = name;
+ this.vecName = vecName;
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.GenMat, glsBuiltinPrecisionTests.PrimitiveFunc);
+
+ glsBuiltinPrecisionTests.GenMat.prototype.getName = function() {
+ return this.name;
+ };
+
+ glsBuiltinPrecisionTests.GenMat.prototype.doApply = function(ctx, iargs) {
+ var ret = new tcuMatrix.Matrix(this.rows, this.cols);
+ var inputs = [iargs.a, iargs.b, iargs.c, iargs.d];
+
+ for (var i = 0; i < this.rows; i++)
+ for (var j = 0; j < this.cols; j++)
+ ret.set(i, j, inputs[j][i]);
+ return ret;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.PrimitiveFunc}
+ * @param {string} typename
+ *
+ */
+ glsBuiltinPrecisionTests.CompareOperator = function(typename) {
+ var sig = new glsBuiltinPrecisionTests.Signature('boolean', typename, typename);
+ glsBuiltinPrecisionTests.PrimitiveFunc.call(this, sig);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.CompareOperator, glsBuiltinPrecisionTests.PrimitiveFunc);
+
+ glsBuiltinPrecisionTests.CompareOperator.prototype.doPrint = function(args) {
+ var str = '(' + args[0] + this.getSymbol() + args[1] + ')';
+ return str;
+ };
+
+ glsBuiltinPrecisionTests.CompareOperator.prototype.doApply = function(ctx, iargs) {
+ var arg0 = iargs.a;
+ var arg1 = iargs.b;
+
+ var ret = new tcuInterval.Interval();
+
+ if (this.canSucceed(arg0, arg1))
+ ret = new tcuInterval.Interval(1);
+ if (this.canFail(arg0, arg1))
+ ret.operatorOrAssignBinary(new tcuInterval.Interval(0));
+
+ return ret;
+ };
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.CompareOperator.prototype.getSymbol = function() {
+ throw new Error('Virtual function. Please override.');
+ };
+
+ /**
+ * @param {tcuInterval.Interval} arg0
+ * @param {tcuInterval.Interval} arg1
+ * @return {boolean}
+ */
+ glsBuiltinPrecisionTests.CompareOperator.prototype.canSucceed = function(arg0, arg1) {
+ throw new Error('Virtual function. Please override.');
+ };
+ /**
+ * @param {tcuInterval.Interval} arg0
+ * @param {tcuInterval.Interval} arg1
+ * @return {boolean}
+ */
+ glsBuiltinPrecisionTests.CompareOperator.prototype.canFail = function(arg0, arg1) {
+ throw new Error('Virtual function. Please override.');
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.CompareOperator}
+ * @param {string} typename
+ *
+ */
+ glsBuiltinPrecisionTests.LessThan = function(typename) {
+ glsBuiltinPrecisionTests.CompareOperator.call(this, typename);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.LessThan, glsBuiltinPrecisionTests.CompareOperator);
+
+ glsBuiltinPrecisionTests.LessThan.prototype.getSymbol = function() {
+ return '<';
+ };
+
+ glsBuiltinPrecisionTests.LessThan.prototype.canSucceed = function(a, b) {
+ return (a.lo() < b.hi());
+ };
+
+ glsBuiltinPrecisionTests.LessThan.prototype.canFail = function(a, b) {
+ return !(a.hi() < b.lo());
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.PrimitiveFunc}
+ *
+ */
+ glsBuiltinPrecisionTests.FloatFunc1 = function() {
+ var sig = new glsBuiltinPrecisionTests.Signature('float', 'float');
+ glsBuiltinPrecisionTests.PrimitiveFunc.call(this, sig);
+ };
+
+ glsBuiltinPrecisionTests.FloatFunc1.prototype = Object.create(glsBuiltinPrecisionTests.PrimitiveFunc.prototype);
+ glsBuiltinPrecisionTests.FloatFunc1.prototype.constructor = glsBuiltinPrecisionTests.FloatFunc1;
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @param {glsBuiltinPrecisionTests.Tuple4} iargs
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.FloatFunc1.prototype.doApply = function(ctx, iargs) {
+ var a = /** @type {tcuInterval.Interval} */ (iargs.a);
+ return this.applyMonotone(ctx, a);
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @param {tcuInterval.Interval} iarg0
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.FloatFunc1.prototype.applyMonotone = function(ctx, iarg0) {
+ /** @type {tcuInterval.Interval} */ var ret = new tcuInterval.Interval();
+
+ /**
+ * @param {number=} x
+ * @param {number=} y
+ * @return {tcuInterval.Interval}
+ */
+ var body = function(x, y) {
+ x = x || 0;
+ return this.applyPoint(ctx, x);
+ };
+ ret = tcuInterval.applyMonotone1(iarg0, body.bind(this));
+
+ ret.operatorOrAssignBinary(this.innerExtrema(ctx, iarg0));
+
+ ret.operatorAndAssignBinary(this.getCodomain().operatorOrBinary(new tcuInterval.Interval(NaN)));
+
+ return ctx.format.convert(ret);
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @param {tcuInterval.Interval} iargs
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.FloatFunc1.prototype.innerExtrema = function(ctx, iargs) {
+ return new tcuInterval.Interval(); // empty interval, i.e. no extrema
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @param {number} arg0
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.FloatFunc1.prototype.applyPoint = function(ctx, arg0) {
+ var exact = this.applyExact(arg0);
+ var prec = this.precision(ctx, exact, arg0);
+
+ var a = new tcuInterval.Interval(exact);
+ var b = tcuInterval.withNumbers(-prec, prec);
+ return tcuInterval.Interval.operatorSum(a, b);
+ };
+
+ /**
+ * @param {number} x
+ * @return {number}
+ */
+ glsBuiltinPrecisionTests.FloatFunc1.prototype.applyExact = function(x) {
+ throw new Error('Internal error. Cannot apply');
+ };
+
+ /**
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.FloatFunc1.prototype.getCodomain = function() {
+ return tcuInterval.unbounded(true);
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @param {number} x
+ * @param {number} y
+ * @return {number}
+ */
+ glsBuiltinPrecisionTests.FloatFunc1.prototype.precision = function(ctx, x, y) {
+ return 0;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.FloatFunc1}
+ */
+ glsBuiltinPrecisionTests.Negate = function() {
+ glsBuiltinPrecisionTests.FloatFunc1.call(this);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Negate, glsBuiltinPrecisionTests.FloatFunc1);
+
+ glsBuiltinPrecisionTests.Negate.prototype.getName = function() {
+ return '_negate';
+ };
+
+ glsBuiltinPrecisionTests.Negate.prototype.doPrint = function(args) {
+ return '-' + args[0];
+ };
+
+ glsBuiltinPrecisionTests.Negate.prototype.precision = function(ctx, ret, x) {
+ return 0;
+ };
+ glsBuiltinPrecisionTests.Negate.prototype.applyExact = function(x) {
+ return -x;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.FloatFunc1}
+ */
+ glsBuiltinPrecisionTests.InverseSqrt = function() {
+ glsBuiltinPrecisionTests.FloatFunc1.call(this);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.InverseSqrt, glsBuiltinPrecisionTests.FloatFunc1);
+
+ glsBuiltinPrecisionTests.InverseSqrt.prototype.getName = function() {
+ return 'inversesqrt';
+ };
+
+ glsBuiltinPrecisionTests.InverseSqrt.prototype.precision = function(ctx, ret, x) {
+ if (x <= 0)
+ return NaN;
+ return ctx.format.ulp(ret, 2.0);
+ };
+
+ glsBuiltinPrecisionTests.InverseSqrt.prototype.applyExact = function(x) {
+ return 1 / Math.sqrt(x);
+ };
+
+ glsBuiltinPrecisionTests.InverseSqrt.prototype.getCodomain = function() {
+ return tcuInterval.withNumbers(0, Infinity);
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.FloatFunc1}
+ */
+ glsBuiltinPrecisionTests.Round = function() {
+ glsBuiltinPrecisionTests.FloatFunc1.call(this);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Round, glsBuiltinPrecisionTests.FloatFunc1);
+
+ glsBuiltinPrecisionTests.Round.prototype.getName = function() {
+ return 'round';
+ };
+
+ glsBuiltinPrecisionTests.Round.prototype.precision = function(ctx, ret, x) {
+ return 0;
+ };
+
+ glsBuiltinPrecisionTests.Round.prototype.applyPoint = function(ctx, x) {
+ var truncated = Math.trunc(x);
+ var fract = x - truncated;
+ var ret = new tcuInterval.Interval();
+
+ // When x is inf or -inf, truncated would be inf or -inf too. Then fract
+ // would be NaN (inf - inf). While in native c code, it would be 0 (inf) or -0 (-inf).
+ // This behavior in JS differs from that in native c code.
+ if (Math.abs(fract) <= 0.5 || isNaN(fract))
+ ret.operatorOrAssignBinary(new tcuInterval.Interval(truncated));
+ if (Math.abs(fract) >= 0.5)
+ ret.operatorOrAssignBinary(new tcuInterval.Interval(truncated + deMath.deSign(fract)));
+
+ return ret;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.FloatFunc1}
+ * @param {string} name
+ * @param {tcuInterval.DoubleFunc1} func
+ */
+ glsBuiltinPrecisionTests.CFloatFunc1 = function(name, func) {
+ glsBuiltinPrecisionTests.FloatFunc1.call(this);
+ /** @type {string} */ this.m_name = name;
+ /** @type {tcuInterval.DoubleFunc1} */this.m_func = func;
+ };
+
+ glsBuiltinPrecisionTests.CFloatFunc1.prototype = Object.create(glsBuiltinPrecisionTests.FloatFunc1.prototype);
+ glsBuiltinPrecisionTests.CFloatFunc1.prototype.constructor = glsBuiltinPrecisionTests.CFloatFunc1;
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.CFloatFunc1.prototype.getName = function() {
+ return this.m_name;
+ };
+
+ /**
+ * @param {number} x
+ * @return {number}
+ */
+ glsBuiltinPrecisionTests.CFloatFunc1.prototype.applyExact = function(x) {
+ return this.m_func(x);
+ };
+
+ /**
+ * PrimitiveFunc<Signature<float, float, float> >
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.PrimitiveFunc}
+ */
+ glsBuiltinPrecisionTests.FloatFunc2 = function() {
+ /** @type {glsBuiltinPrecisionTests.Signature} */ var Sig = new glsBuiltinPrecisionTests.Signature('float', 'float', 'float');
+ glsBuiltinPrecisionTests.PrimitiveFunc.call(this, Sig);
+ };
+
+ glsBuiltinPrecisionTests.FloatFunc2.prototype = Object.create(glsBuiltinPrecisionTests.PrimitiveFunc.prototype);
+ glsBuiltinPrecisionTests.FloatFunc2.prototype.constructor = glsBuiltinPrecisionTests.FloatFunc2;
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @param {glsBuiltinPrecisionTests.Tuple4} iargs
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.FloatFunc2.prototype.doApply = function(ctx, iargs) {
+ var a = /** @type {tcuInterval.Interval} */ (iargs.a);
+ var b = /** @type {tcuInterval.Interval} */ (iargs.b);
+ return this.applyMonotone(ctx, a, b);
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @param {tcuInterval.Interval} xi
+ * @param {tcuInterval.Interval} yi
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.FloatFunc2.prototype.applyMonotone = function(ctx, xi, yi) {
+ /** @type {tcuInterval.Interval} */ var ret = new tcuInterval.Interval();
+
+ /**
+ * @param {number=} x
+ * @param {number=} y
+ * @return {tcuInterval.Interval}
+ */
+ var body = function(x, y) {
+ x = x || 0;
+ y = y || 0;
+ return this.applyPoint(ctx, x, y);
+ };
+ ret = tcuInterval.applyMonotone2(xi, yi, body.bind(this));
+
+ ret.operatorOrAssignBinary(this.innerExtrema(ctx, xi, yi));
+
+ ret.operatorAndAssignBinary(this.getCodomain().operatorOrBinary(new tcuInterval.Interval(NaN)));
+
+ return ctx.format.convert(ret);
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @param {tcuInterval.Interval} xi
+ * @param {tcuInterval.Interval} yi
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.FloatFunc2.prototype.innerExtrema = function(ctx, xi, yi) {
+ return new tcuInterval.Interval(); // empty interval, i.e. no extrema
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @param {number} x
+ * @param {number} y
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.FloatFunc2.prototype.applyPoint = function(ctx, x, y) {
+ /** @type {number} */ var exact = this.applyExact(x, y);
+ var prec = this.precision(ctx, exact, x, y);
+
+ var a = new tcuInterval.Interval(exact);
+ var b = tcuInterval.withNumbers(-prec, prec);
+ return tcuInterval.Interval.operatorSum(a, b);
+ };
+
+ /**
+ * @param {number} x
+ * @param {number} y
+ * @return {number}
+ */
+ glsBuiltinPrecisionTests.FloatFunc2.prototype.applyExact = function(x, y) {
+ throw new Error('Virtual function. Please override');
+ };
+
+ /**
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.FloatFunc2.prototype.getCodomain = function() {
+ return tcuInterval.unbounded(true);
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @param {number} ret
+ * @param {number} x
+ * @param {number} y
+ * @return {number}
+ */
+ glsBuiltinPrecisionTests.FloatFunc2.prototype.precision = function(ctx, ret, x, y) {
+ throw new Error('Virtual function. Please override');
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.FloatFunc2}
+ * @param {string} name
+ * @param {tcuInterval.DoubleFunc2} func
+ */
+ glsBuiltinPrecisionTests.CFloatFunc2 = function(name, func) {
+ glsBuiltinPrecisionTests.FloatFunc2.call(this);
+ /** @type {string} */ this.m_name = name;
+ /** @type {tcuInterval.DoubleFunc2} */ this.m_func = func;
+ };
+
+ glsBuiltinPrecisionTests.CFloatFunc2.prototype = Object.create(glsBuiltinPrecisionTests.FloatFunc2.prototype);
+ glsBuiltinPrecisionTests.CFloatFunc2.prototype.constructor = glsBuiltinPrecisionTests.CFloatFunc2;
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.CFloatFunc2.prototype.getName = function() {
+ return this.m_name;
+ };
+
+ /**
+ * @param {number} x
+ * @param {number} y
+ * @return {number}
+ */
+ glsBuiltinPrecisionTests.CFloatFunc2.prototype.applyExact = function(x, y) {
+ return this.m_func(x, y);
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.FloatFunc2}
+ */
+ glsBuiltinPrecisionTests.InfixOperator = function() {
+ glsBuiltinPrecisionTests.FloatFunc2.call(this);
+ };
+
+ glsBuiltinPrecisionTests.InfixOperator.prototype = Object.create(glsBuiltinPrecisionTests.FloatFunc2.prototype);
+ glsBuiltinPrecisionTests.InfixOperator.prototype.constructor = glsBuiltinPrecisionTests.InfixOperator;
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.InfixOperator.prototype.getSymbol = function() {
+ glsBuiltinPrecisionTests.FloatFunc2.call(this);
+ return '';
+ };
+
+ /**
+ * @param {Array<glsBuiltinPrecisionTests.ExprBase>} args
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.InfixOperator.prototype.doPrint = function(args) {
+ return '(' + args[0] + ' ' + this.getSymbol() + ' ' + args[1] + ')';
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @param {number} x
+ * @param {number} y
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.InfixOperator.prototype.applyPoint = function(ctx, x, y) {
+ /** @type {number} */ var exact = this.applyExact(x, y);
+
+ // Allow either representable number on both sides of the exact value,
+ // but require exactly representable values to be preserved.
+ return ctx.format.roundOut(new tcuInterval.Interval(exact), isFinite(x) && isFinite(y));
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @param {number} x
+ * @param {number} y
+ * @param {number} z
+ * @return {number}
+ */
+ glsBuiltinPrecisionTests.InfixOperator.prototype.precision = function(ctx, x, y, z) {
+ return 0;
+ };
+
+ /**
+ * Signature<float, float, float, float>
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.PrimitiveFunc}
+ */
+ glsBuiltinPrecisionTests.FloatFunc3 = function() {
+ /** @type {glsBuiltinPrecisionTests.Signature} */ var sig = new glsBuiltinPrecisionTests.Signature('float', 'float', 'float', 'float');
+ glsBuiltinPrecisionTests.PrimitiveFunc.call(this, sig);
+ };
+
+ glsBuiltinPrecisionTests.FloatFunc3.prototype = Object.create(glsBuiltinPrecisionTests.PrimitiveFunc.prototype);
+ glsBuiltinPrecisionTests.FloatFunc3.prototype.constructor = glsBuiltinPrecisionTests.FloatFunc3;
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @param {glsBuiltinPrecisionTests.Tuple4} iargs
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.FloatFunc3.prototype.doApply = function(ctx, iargs) {
+ var a = /** @type {tcuInterval.Interval} */ (iargs.a);
+ var b = /** @type {tcuInterval.Interval} */ (iargs.b);
+ var c = /** @type {tcuInterval.Interval} */ (iargs.c);
+ var retVal = this.applyMonotone(ctx, a, b, c);
+ return retVal;
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @param {tcuInterval.Interval} xi
+ * @param {tcuInterval.Interval} yi
+ * @param {tcuInterval.Interval} zi
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.FloatFunc3.prototype.applyMonotone = function(ctx, xi, yi, zi) {
+ /**
+ * @param {number=} x
+ * @param {number=} y
+ * @param {number=} z
+ * @return {tcuInterval.Interval}
+ */
+ var body = function(x, y, z) {
+ x = x || 0;
+ y = y || 0;
+ z = z || 0;
+ return this.applyPoint(ctx, x, y, z);
+ };
+ var ret = tcuInterval.applyMonotone3(xi, yi, zi, body.bind(this));
+ var retVal;
+
+ ret.operatorOrAssignBinary(this.innerExtrema(ctx, xi, yi, zi));
+
+ ret.operatorAndAssignBinary(this.getCodomain().operatorOrBinary(new tcuInterval.Interval(NaN)));
+
+ retVal = ctx.format.convert(ret);
+ return retVal;
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @param {tcuInterval.Interval} xi
+ * @param {tcuInterval.Interval} yi
+ * @param {tcuInterval.Interval} zi
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.FloatFunc3.prototype.innerExtrema = function(ctx, xi, yi, zi) {
+ return new tcuInterval.Interval(); // empty interval, i.e. no extrema
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @param {number} x
+ * @param {number} y
+ * @param {number} z
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.FloatFunc3.prototype.applyPoint = function(ctx, x, y, z) {
+ /** @type {number} */ var exact = this.applyExact(x, y, z);
+ /** @type {number} */ var prec = this.precision(ctx, exact, x, y, z);
+
+ var a = new tcuInterval.Interval(exact);
+ var b = tcuInterval.withNumbers(-prec, prec);
+ return tcuInterval.Interval.operatorSum(a, b);
+ };
+
+ /**
+ * @param {number} x
+ * @param {number} y
+ * @param {number} z
+ * @return {number}
+ */
+ glsBuiltinPrecisionTests.FloatFunc3.prototype.applyExact = function(x, y, z) {
+ throw new Error('Virtual function. Please override');
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @param {number} result
+ * @param {number} x
+ * @param {number} y
+ * @param {number} z
+ * @return {number}
+ */
+ glsBuiltinPrecisionTests.FloatFunc3.prototype.precision = function(ctx, result, x, y, z) {
+ throw new Error('Virtual function. Please override');
+ };
+
+ /**
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.FloatFunc3.prototype.getCodomain = function() {
+ return tcuInterval.unbounded(true);
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.FloatFunc3}
+ */
+ glsBuiltinPrecisionTests.Clamp = function() {
+ glsBuiltinPrecisionTests.FloatFunc3.call(this);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Clamp, glsBuiltinPrecisionTests.FloatFunc3);
+
+ glsBuiltinPrecisionTests.Clamp.prototype.getName = function() {
+ return 'clamp';
+ };
+
+ glsBuiltinPrecisionTests.Clamp.prototype.applyExact = function(x, minVal, maxVal) {
+ var debug = false;
+ var retVal;
+
+ retVal = deMath.clamp(x, minVal, maxVal);
+ if (debug) {
+ console.log('> minVal: ' + minVal);
+ console.log('> maxVal: ' + maxVal);
+ console.log('> x: ' + x);
+ console.log('> ret: ' + retVal);
+ }
+ return retVal;
+
+ };
+
+ glsBuiltinPrecisionTests.Clamp.prototype.precision = function(ctx, result, x, minVal, maxVal) {
+ var debug = false;
+ var retVal;
+
+ retVal = minVal > maxVal ? NaN : 0;
+
+ if (debug) {
+ console.log('precision> minVal: ' + minVal);
+ console.log('precision> maxVal: ' + maxVal);
+ console.log('precision> x: ' + x);
+ console.log('precision> ret: ' + retVal);
+ }
+
+ return retVal;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.InfixOperator}
+ */
+ glsBuiltinPrecisionTests.Add = function() {
+ glsBuiltinPrecisionTests.InfixOperator.call(this);
+ };
+
+ glsBuiltinPrecisionTests.Add.prototype = Object.create(glsBuiltinPrecisionTests.InfixOperator.prototype);
+ glsBuiltinPrecisionTests.Add.prototype.constructor = glsBuiltinPrecisionTests.Add;
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.Add.prototype.getName = function() {
+ return 'add';
+ };
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.Add.prototype.getSymbol = function() {
+ return '+';
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @param {glsBuiltinPrecisionTests.Tuple4} iargs
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.Add.prototype.doApply = function(ctx, iargs) {
+ var a = /** @type {tcuInterval.Interval} */ (iargs.a);
+ var b = /** @type {tcuInterval.Interval} */ (iargs.b);
+ // Fast-path for common case
+ if (iargs.a.isOrdinary() && iargs.b.isOrdinary()) {
+ /** type{tcuInterval.Interval} */ var ret;
+ ret = tcuInterval.setIntervalBounds(
+ function(dummy) {
+ return iargs.a.lo() + iargs.b.lo();
+ },
+ function(dummy) {
+ return iargs.a.hi() + iargs.b.hi();
+ });
+ return ctx.format.convert(ctx.format.roundOut(ret, true));
+ }
+ return this.applyMonotone(ctx, a, b);
+ };
+
+ /**
+ * @param {number} x
+ * @param {number} y
+ * @return {number}
+ */
+ glsBuiltinPrecisionTests.Add.prototype.applyExact = function(x, y) {
+ return x + y;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.InfixOperator}
+ */
+ glsBuiltinPrecisionTests.Sub = function() {
+ glsBuiltinPrecisionTests.InfixOperator.call(this);
+ };
+
+ glsBuiltinPrecisionTests.Sub.prototype = Object.create(glsBuiltinPrecisionTests.InfixOperator.prototype);
+ glsBuiltinPrecisionTests.Sub.prototype.constructor = glsBuiltinPrecisionTests.Sub;
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.Sub.prototype.getName = function() {
+ return 'sub';
+ };
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.Sub.prototype.getSymbol = function() {
+ return '-';
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @param {glsBuiltinPrecisionTests.Tuple4} iargs
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.Sub.prototype.doApply = function(ctx, iargs) {
+ var a = /** @type {tcuInterval.Interval} */ (iargs.a);
+ var b = /** @type {tcuInterval.Interval} */ (iargs.b);
+ var retVal;
+
+ // Fast-path for common case
+ if (iargs.a.isOrdinary() && iargs.b.isOrdinary()) {
+ /** type{tcuInterval.Interval} */ var ret;
+ ret = tcuInterval.setIntervalBounds(
+ function(dummy) {
+ return iargs.a.lo() - iargs.b.hi();
+ },
+ function(dummy) {
+ return iargs.a.hi() - iargs.b.lo();
+ });
+ return ctx.format.convert(ctx.format.roundOut(ret, true));
+ }
+ retVal = this.applyMonotone(ctx, a, b);
+ return retVal;
+ };
+
+ /**
+ * @param {number} x
+ * @param {number} y
+ * @return {number}
+ */
+ glsBuiltinPrecisionTests.Sub.prototype.applyExact = function(x, y) {
+ return x - y;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.InfixOperator}
+ */
+ glsBuiltinPrecisionTests.Mul = function() {
+ glsBuiltinPrecisionTests.InfixOperator.call(this);
+ };
+
+ glsBuiltinPrecisionTests.Mul.prototype = Object.create(glsBuiltinPrecisionTests.InfixOperator.prototype);
+ glsBuiltinPrecisionTests.Mul.prototype.constructor = glsBuiltinPrecisionTests.Mul;
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.Mul.prototype.getName = function() {
+ return 'mul';
+ };
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.Mul.prototype.getSymbol = function() {
+ return '*';
+ };
+
+ glsBuiltinPrecisionTests.isNegative = function(n) {
+ return ((n = +n) || 1 / n) < 0;
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @param {glsBuiltinPrecisionTests.Tuple4} iargs
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.Mul.prototype.doApply = function(ctx, iargs) {
+ var a = /** @type {tcuInterval.Interval} */ (iargs.a);
+ var b = /** @type {tcuInterval.Interval} */ (iargs.b);
+ // Fast-path for common case
+ if (iargs.a.isOrdinary() && iargs.b.isOrdinary()) {
+ /** type{tcuInterval.Interval} */ var ret = new tcuInterval.Interval();
+ if (glsBuiltinPrecisionTests.isNegative(a.hi())) {
+ a = a.operatorNegative();
+ b = b.operatorNegative();
+ }
+ if (a.lo() >= 0 && b.lo() >= 0) {
+ ret = tcuInterval.setIntervalBounds(
+ function(dummy) {
+ return iargs.a.lo() * iargs.b.lo();
+ },
+ function(dummy) {
+ return iargs.a.hi() * iargs.b.hi();
+ });
+ return ctx.format.convert(ctx.format.roundOut(ret, true));
+ }
+ if (a.lo() >= 0 && b.hi() <= 0) {
+ ret = tcuInterval.setIntervalBounds(
+ function(dummy) {
+ return iargs.a.hi() * iargs.b.lo();
+ },
+ function(dummy) {
+ return iargs.a.lo() * iargs.b.hi();
+ });
+ return ctx.format.convert(ctx.format.roundOut(ret, true));
+ }
+ }
+
+ return this.applyMonotone(ctx, a, b);
+ };
+
+ /**
+ * @param {number} x
+ * @param {number} y
+ * @return {number}
+ */
+ glsBuiltinPrecisionTests.Mul.prototype.applyExact = function(x, y) {
+ return x * y;
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @param {tcuInterval.Interval} xi
+ * @param {tcuInterval.Interval} yi
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.Mul.prototype.innerExtrema = function(ctx, xi, yi) {
+ if (((xi.contains(tcuInterval.NEGATIVE_INFINITY) || xi.contains(tcuInterval.POSITIVE_INFINITY)) && yi.contains(tcuInterval.ZERO)) ||
+ ((yi.contains(tcuInterval.NEGATIVE_INFINITY) || yi.contains(tcuInterval.POSITIVE_INFINITY)) && xi.contains(tcuInterval.ZERO)))
+ return new tcuInterval.Interval(NaN);
+
+ return new tcuInterval.Interval(); // empty interval, i.e. no extrema
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.InfixOperator}
+ */
+ glsBuiltinPrecisionTests.Div = function() {
+ glsBuiltinPrecisionTests.InfixOperator.call(this);
+ };
+
+ glsBuiltinPrecisionTests.Div.prototype = Object.create(glsBuiltinPrecisionTests.InfixOperator.prototype);
+ glsBuiltinPrecisionTests.Div.prototype.constructor = glsBuiltinPrecisionTests.Div;
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.Div.prototype.getName = function() {
+ return 'div';
+ };
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.Div.prototype.getSymbol = function() {
+ return '/';
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @param {tcuInterval.Interval} nom
+ * @param {tcuInterval.Interval} den
+ * @return {tcuInterval.Interval}
+ */
+ glsBuiltinPrecisionTests.Div.prototype.innerExtrema = function(ctx, nom, den) {
+ var ret = new tcuInterval.Interval();
+ if (den.contains(tcuInterval.ZERO)) {
+ if (nom.contains(tcuInterval.ZERO))
+ ret.operatorOrAssignBinary(tcuInterval.NAN);
+ if (nom.lo() < 0 || nom.hi() > 0.0)
+ ret.operatorOrAssignBinary(tcuInterval.unbounded());
+ }
+
+ return ret;
+ };
+
+ glsBuiltinPrecisionTests.Div.prototype.precision = function(ctx, ret, nom, den) {
+ var fmt = ctx.format;
+
+ // \todo [2014-03-05 lauri] Check that the limits in GLSL 3.10 are actually correct.
+ // For now, we assume that division's precision is 2.5 ULP when the value is within
+ // [2^MINEXP, 2^MAXEXP-1]
+
+ if (den === 0)
+ return 0; // Result must be exactly inf
+ else if (deMath.deInBounds32(Math.abs(den),
+ deMath.deLdExp(1, fmt.getMinExp()),
+ deMath.deLdExp(1, fmt.getMaxExp() - 1)))
+ return fmt.ulp(ret, 2.5);
+ else
+ return Infinity; // Can be any number, but must be a number.
+ };
+
+ /**
+ * @param {number} x
+ * @param {number} y
+ * @return {number}
+ */
+ glsBuiltinPrecisionTests.Div.prototype.applyExact = function(x, y) {
+ return x / y;
+ };
+
+ glsBuiltinPrecisionTests.Div.prototype.applyPoint = function(ctx, x, y) {
+ var ret = glsBuiltinPrecisionTests.FloatFunc2.prototype.applyPoint.call(this, ctx, x, y);
+ if (isFinite(x) && isFinite(y) && y != 0) {
+ var dst = ctx.format.convert(ret);
+ if (dst.contains(tcuInterval.NEGATIVE_INFINITY)) {
+ ret.operatorOrAssignBinary(-ctx.format.getMaxValue());
+ }
+ if (dst.contains(tcuInterval.POSITIVE_INFINITY)) {
+ ret.operatorOrAssignBinary(+ctx.format.getMaxValue());
+ }
+ }
+ return ret;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.PrimitiveFunc}
+ */
+ glsBuiltinPrecisionTests.CompWiseFunc = function(typename, Sig) {
+ glsBuiltinPrecisionTests.PrimitiveFunc.call(this, Sig);
+ this.typename = typename;
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.CompWiseFunc, glsBuiltinPrecisionTests.PrimitiveFunc);
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.CompWiseFunc.prototype.getName = function() {
+ return this.doGetScalarFunc().getName();
+ };
+
+ /**
+ * @param {Array<glsBuiltinPrecisionTests.ExprBase>} args
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.CompWiseFunc.prototype.doPrint = function(args) {
+ return this.doGetScalarFunc().print(args);
+ };
+
+ /**
+ * @return {glsBuiltinPrecisionTests.Func}
+ */
+ glsBuiltinPrecisionTests.CompWiseFunc.prototype.doGetScalarFunc = function() {
+ throw new Error('Virtual function. Please override.');
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.CompWiseFunc}
+ * @param {number} rows
+ * @param {number} cols
+ */
+ glsBuiltinPrecisionTests.CompMatFuncBase = function(rows, cols) {
+ var name = glsBuiltinPrecisionTests.dataTypeNameOfMatrix('float', rows, cols);
+ glsBuiltinPrecisionTests.CompWiseFunc.call(this, 'float', new glsBuiltinPrecisionTests.Signature(name, name, name));
+ this.rows = rows;
+ this.cols = cols;
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.CompMatFuncBase, glsBuiltinPrecisionTests.CompWiseFunc);
+
+ glsBuiltinPrecisionTests.CompMatFuncBase.prototype.doApply = function(ctx, iargs) {
+ var ret = new tcuMatrix.Matrix(this.rows, this.cols);
+ var fun = this.doGetScalarFunc();
+
+ for (var row = 0; row < this.rows; ++row)
+ for (var col = 0; col < this.cols; ++col)
+ ret.set(row, col, fun.applyFunction(ctx,
+ iargs.a.get(row, col),
+ iargs.b.get(row, col)));
+
+ return ret;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.CompMatFuncBase}
+ * @param {function(new:glsBuiltinPrecisionTests.Func)} F
+ * @param {number} rows
+ * @param {number} cols
+ */
+ glsBuiltinPrecisionTests.CompMatFunc = function(F, rows, cols) {
+ glsBuiltinPrecisionTests.CompMatFuncBase.call(this, rows, cols);
+ this.m_function = F;
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.CompMatFunc, glsBuiltinPrecisionTests.CompMatFuncBase);
+
+ /**
+ * @return {glsBuiltinPrecisionTests.Func}
+ */
+ glsBuiltinPrecisionTests.CompMatFunc.prototype.doGetScalarFunc = function() {
+ return new this.m_function();
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.Mul}
+ */
+ glsBuiltinPrecisionTests.ScalarMatrixCompMult = function() {
+ glsBuiltinPrecisionTests.Mul.call(this);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.ScalarMatrixCompMult, glsBuiltinPrecisionTests.Mul);
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.ScalarMatrixCompMult.prototype.getName = function() {
+ return 'matrixCompMult';
+ };
+
+ /**
+ * @param {Array<glsBuiltinPrecisionTests.ExprBase>} args
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.ScalarMatrixCompMult.prototype.doPrint = function(args) {
+ return glsBuiltinPrecisionTests.Func.prototype.doPrint.call(this, args);
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.CompMatFunc}
+ * @param {number} rows
+ * @param {number} cols
+ */
+ glsBuiltinPrecisionTests.MatrixCompMult = function(rows, cols) {
+ glsBuiltinPrecisionTests.CompMatFunc.call(this, glsBuiltinPrecisionTests.ScalarMatrixCompMult, rows, cols);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.MatrixCompMult, glsBuiltinPrecisionTests.CompMatFunc);
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.PrimitiveFunc}
+ * @param {number} rows
+ * @param {number} cols
+ */
+ glsBuiltinPrecisionTests.OuterProduct = function(rows, cols) {
+ var name = glsBuiltinPrecisionTests.dataTypeNameOfMatrix('float', rows, cols);
+ var sig = new glsBuiltinPrecisionTests.Signature(name, 'vec' + rows, 'vec' + cols);
+ glsBuiltinPrecisionTests.PrimitiveFunc.call(this, sig);
+ this.rows = rows;
+ this.cols = cols;
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.OuterProduct, glsBuiltinPrecisionTests.PrimitiveFunc);
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.OuterProduct.prototype.getName = function() {
+ return 'outerProduct';
+ };
+
+ glsBuiltinPrecisionTests.OuterProduct.prototype.doApply = function(ctx, iargs) {
+ var ret = new tcuMatrix.Matrix(this.rows, this.cols);
+ var mul = new glsBuiltinPrecisionTests.Mul();
+
+ for (var row = 0; row < this.rows; ++row) {
+ for (var col = 0; col < this.cols; ++col)
+ ret.set(row, col, mul.applyFunction(ctx, iargs.a[row], iargs.b[col]));
+ }
+
+ return ret;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.PrimitiveFunc}
+ * @param {number} rows
+ * @param {number} cols
+ */
+ glsBuiltinPrecisionTests.Transpose = function(rows, cols) {
+ var nameRet = glsBuiltinPrecisionTests.dataTypeNameOfMatrix('float', rows, cols);
+ var nameParam = glsBuiltinPrecisionTests.dataTypeNameOfMatrix('float', cols, rows);
+ var sig = new glsBuiltinPrecisionTests.Signature(nameRet, nameParam);
+ glsBuiltinPrecisionTests.PrimitiveFunc.call(this, sig);
+ this.rows = rows;
+ this.cols = cols;
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Transpose, glsBuiltinPrecisionTests.PrimitiveFunc);
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.Transpose.prototype.getName = function() {
+ return 'transpose';
+ };
+
+ glsBuiltinPrecisionTests.Transpose.prototype.doApply = function(ctx, iargs) {
+ var ret = new tcuMatrix.Matrix(this.rows, this.cols);
+
+ for (var row = 0; row < this.rows; ++row)
+ for (var col = 0; col < this.cols; ++col)
+ ret.set(row, col, iargs.a.get(col, row));
+
+ return ret;
+ };
+
+ /**
+ * @constructor
+ * @param {*} In
+ */
+ glsBuiltinPrecisionTests.Inputs = function(In) {
+ // vector<typename In::In0> in0;
+ // vector<typename In::In1> in1;
+ // vector<typename In::In2> in2;
+ // vector<typename In::In3> in3;
+ this.in0 = [];
+ this.in1 = [];
+ this.in2 = [];
+ this.in3 = [];
+ };
+
+ /**
+ * @constructor
+ * @param {number} size
+ * @param {*} Out
+ */
+ glsBuiltinPrecisionTests.Outputs = function(size, Out) {
+ // Outputs (size_t size) : out0(size), out1(size) {}
+ this.out0 = [];
+ this.out1 = [];
+ };
+
+ /**
+ * @constructor
+ * @param {*} In
+ * @param {*} Out
+ */
+ glsBuiltinPrecisionTests.Variables = function(In, Out) {
+ this.in0 = new glsBuiltinPrecisionTests.Variable(In.In0);
+ this.in1 = new glsBuiltinPrecisionTests.Variable(In.In1);
+ this.in2 = new glsBuiltinPrecisionTests.Variable(In.In2);
+ this.in3 = new glsBuiltinPrecisionTests.Variable(In.In3);
+ this.out0 = new glsBuiltinPrecisionTests.Variable(Out.Out0);
+ this.out1 = new glsBuiltinPrecisionTests.Variable(Out.Out1);
+ };
+
+ /**
+ * @constructor
+ * @param {function(new:glsBuiltinPrecisionTests.Func)} F
+ * @return {glsBuiltinPrecisionTests.GenFuncs}
+ */
+ glsBuiltinPrecisionTests.makeVectorizedFuncs = function(F) {
+ return new glsBuiltinPrecisionTests.GenFuncs(
+ new F(),
+ new glsBuiltinPrecisionTests.VectorizedFunc(new F(), 2),
+ new glsBuiltinPrecisionTests.VectorizedFunc(new F(), 3),
+ new glsBuiltinPrecisionTests.VectorizedFunc(new F(), 4));
+ };
+
+ /**
+ * @constructor
+ * @param {glsBuiltinPrecisionTests.Typename} typename
+ */
+ glsBuiltinPrecisionTests.Sampling = function(typename) {
+ this.typename = typename;
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.Typename} typename
+ * @param {number=} size
+ * @return {glsBuiltinPrecisionTests.Sampling}
+ */
+ glsBuiltinPrecisionTests.SamplingFactory = function(typename, size) {
+ if (size > 1)
+ return new glsBuiltinPrecisionTests.DefaultSamplingVector(typename, size);
+ switch (typename) {
+ case 'vec4' : return new glsBuiltinPrecisionTests.DefaultSamplingVector('float', 4);
+ case 'vec3' : return new glsBuiltinPrecisionTests.DefaultSamplingVector('float', 3);
+ case 'vec2' : return new glsBuiltinPrecisionTests.DefaultSamplingVector('float', 2);
+ case 'boolean' : return new glsBuiltinPrecisionTests.DefaultSamplingBool(typename);
+ case 'float' : return new glsBuiltinPrecisionTests.DefaultSamplingFloat(typename);
+ case 'mat2': return new glsBuiltinPrecisionTests.DefaultSamplingMatrix('float', 2, 2);
+ case 'mat2x3': return new glsBuiltinPrecisionTests.DefaultSamplingMatrix('float', 3, 2);
+ case 'mat2x4': return new glsBuiltinPrecisionTests.DefaultSamplingMatrix('float', 4, 2);
+ case 'mat3x2': return new glsBuiltinPrecisionTests.DefaultSamplingMatrix('float', 2, 3);
+ case 'mat3': return new glsBuiltinPrecisionTests.DefaultSamplingMatrix('float', 3, 3);
+ case 'mat3x4': return new glsBuiltinPrecisionTests.DefaultSamplingMatrix('float', 4, 3);
+ case 'mat4x2': return new glsBuiltinPrecisionTests.DefaultSamplingMatrix('float', 2, 4);
+ case 'mat4x3': return new glsBuiltinPrecisionTests.DefaultSamplingMatrix('float', 3, 4);
+ case 'mat4': return new glsBuiltinPrecisionTests.DefaultSamplingMatrix('float', 4, 4);
+ case 'int' : return new glsBuiltinPrecisionTests.DefaultSamplingInt(typename);
+ }
+ return new glsBuiltinPrecisionTests.DefaultSamplingVoid(typename);
+ };
+
+ /**
+ * @param {tcuFloatFormat.FloatFormat} fmt
+ * @param {Array<*>} arr
+ */
+ glsBuiltinPrecisionTests.Sampling.prototype.genFixeds = function(fmt, arr) {
+ throw new Error('Virtual function. Please override.');
+ };
+
+ /**
+ * @param {tcuFloatFormat.FloatFormat} fmt
+ * @param {gluShaderUtil.precision} precision
+ * @param {deRandom.Random} random
+ * @return {*}
+ */
+ glsBuiltinPrecisionTests.Sampling.prototype.genRandom = function(fmt, precision, random) {
+ return 0;
+ };
+
+ /**
+ * @return {number}
+ */
+ glsBuiltinPrecisionTests.Sampling.prototype.getWeight = function() {
+ return 0;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.Sampling}
+ * @param {glsBuiltinPrecisionTests.Typename} typename
+ */
+ glsBuiltinPrecisionTests.DefaultSamplingVoid = function(typename) {
+ glsBuiltinPrecisionTests.Sampling.call(this, typename);
+ };
+
+ glsBuiltinPrecisionTests.DefaultSamplingVoid.prototype = Object.create(glsBuiltinPrecisionTests.Sampling.prototype);
+ glsBuiltinPrecisionTests.DefaultSamplingVoid.prototype.constructor = glsBuiltinPrecisionTests.DefaultSamplingVoid;
+
+ /**
+ * @param {tcuFloatFormat.FloatFormat} fmt
+ * @param {Array<number>} dst
+ */
+ glsBuiltinPrecisionTests.DefaultSamplingVoid.prototype.genFixeds = function(fmt, dst) {
+ dst.push(NaN);
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.Sampling}
+ * @param {glsBuiltinPrecisionTests.Typename} typename
+ */
+ glsBuiltinPrecisionTests.DefaultSamplingBool = function(typename) {
+ glsBuiltinPrecisionTests.Sampling.call(this, typename);
+ };
+
+ glsBuiltinPrecisionTests.DefaultSamplingBool.prototype = Object.create(glsBuiltinPrecisionTests.Sampling.prototype);
+ glsBuiltinPrecisionTests.DefaultSamplingBool.prototype.constructor = glsBuiltinPrecisionTests.DefaultSamplingBool;
+
+ /**
+ * @param {tcuFloatFormat.FloatFormat} fmt
+ * @param {Array<Boolean>} dst
+ */
+ glsBuiltinPrecisionTests.DefaultSamplingBool.prototype.genFixeds = function(fmt, dst) {
+ dst.push(true);
+ dst.push(false);
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.Sampling}
+ * @param {glsBuiltinPrecisionTests.Typename} typename
+ */
+ glsBuiltinPrecisionTests.DefaultSamplingInt = function(typename) {
+ glsBuiltinPrecisionTests.Sampling.call(this, typename);
+ };
+
+ glsBuiltinPrecisionTests.DefaultSamplingInt.prototype = Object.create(glsBuiltinPrecisionTests.Sampling.prototype);
+ glsBuiltinPrecisionTests.DefaultSamplingInt.prototype.constructor = glsBuiltinPrecisionTests.DefaultSamplingInt;
+
+ glsBuiltinPrecisionTests.DefaultSamplingInt.prototype.genRandom = function(fmt, prec, rnd) {
+ /** @type {number} */ var exp = rnd.getInt(0, this.getNumBits(prec) - 2);
+ /** @type {number} */ var sign = rnd.getBool() ? -1 : 1;
+
+ return sign * rnd.getInt(0, 1 << exp);
+ };
+
+ glsBuiltinPrecisionTests.DefaultSamplingInt.prototype.genFixeds = function(fmt, dst) {
+ dst.push(0);
+ dst.push(-1);
+ dst.push(1);
+ };
+
+ glsBuiltinPrecisionTests.DefaultSamplingInt.prototype.getWeight = function() {
+ return 1.0;
+ };
+
+ /**
+ * @param {gluShaderUtil.precision} prec
+ * @return {number}
+ */
+ glsBuiltinPrecisionTests.DefaultSamplingInt.prototype.getNumBits = function(prec) {
+ switch (prec) {
+ case gluShaderUtil.precision.PRECISION_LOWP: return 8;
+ case gluShaderUtil.precision.PRECISION_MEDIUMP: return 16;
+ case gluShaderUtil.precision.PRECISION_HIGHP: return 32;
+ default:
+ throw new Error('Invalid precision: ' + prec);
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.Sampling}
+ * @param {glsBuiltinPrecisionTests.Typename} typename
+ */
+ glsBuiltinPrecisionTests.DefaultSamplingFloat = function(typename) {
+ glsBuiltinPrecisionTests.Sampling.call(this, typename);
+ };
+
+ glsBuiltinPrecisionTests.DefaultSamplingFloat.prototype = Object.create(glsBuiltinPrecisionTests.Sampling.prototype);
+ glsBuiltinPrecisionTests.DefaultSamplingFloat.prototype.constructor = glsBuiltinPrecisionTests.DefaultSamplingFloat;
+
+ glsBuiltinPrecisionTests.DefaultSamplingFloat.prototype.genRandom = function(format, prec, rnd) {
+ /** type{number} */ var minExp = format.getMinExp();
+ /** type{number} */ var maxExp = format.getMaxExp();
+ /** type{boolean} */ var haveSubnormal = format.hasSubnormal() != tcuFloatFormat.YesNoMaybe.NO;
+
+ // Choose exponent so that the cumulative distribution is cubic.
+ // This makes the probability distribution quadratic, with the peak centered on zero.
+ /** type{number} */ var minRoot = deMath.deCbrt(minExp - 0.5 - (haveSubnormal ? 1.0 : 0.0));
+ /** type{number} */ var maxRoot = deMath.deCbrt(maxExp + 0.5);
+ /** type{number} */ var fractionBits = format.getFractionBits();
+ /** type{number} */ var exp = deMath.rint(Math.pow(rnd.getFloat(minRoot, maxRoot),
+ 3.0));
+ /** type{number} */ var base = 0.0; // integral power of two
+ /** type{number} */ var quantum = 0.0; // smallest representable difference in the binade
+ /** type{number} */ var significand = 0.0; // Significand.
+
+ // DE_ASSERT(fractionBits < std::numeric_limits<float>::digits);
+
+ // Generate some occasional special numbers
+ switch (rnd.getInt(0, 64)) {
+ case 0: return 0;
+ case 1: return Number.POSITIVE_INFINITY;
+ case 2: return Number.NEGATIVE_INFINITY;
+ case 3: return NaN;
+ default: break;
+ }
+
+ if (exp >= minExp) {
+ // Normal number
+ base = deMath.deFloatLdExp(1.0, exp);
+ quantum = deMath.deFloatLdExp(1.0, exp - fractionBits);
+ } else {
+ // Subnormal
+ base = 0.0;
+ quantum = deMath.deFloatLdExp(1.0, minExp - fractionBits);
+ }
+
+ switch (rnd.getInt(0, 16)) {
+ // The highest number in this binade, significand is all bits one.
+ case 0:
+ significand = base - quantum;
+ break;
+ // Significand is one.
+ case 1:
+ significand = quantum;
+ break;
+ // Significand is zero.
+ case 2:
+ significand = 0.0;
+ break;
+ // Random (evenly distributed) significand.
+ default: {
+ /** type{number} */ var intFraction = rnd.getInt() & ((1 << fractionBits) - 1);
+ significand = intFraction * quantum;
+ }
+ }
+
+ // Produce positive numbers more often than negative.
+ return (rnd.getInt(0, 3) == 0 ? -1.0 : 1.0) * (base + significand);
+ };
+
+ glsBuiltinPrecisionTests.DefaultSamplingFloat.prototype.genFixeds = function(format, dst) {
+ /** @type {number} */ var minExp = format.getMinExp();
+ /** @type {number} */ var maxExp = format.getMaxExp();
+ /** @type {number} */ var fractionBits = format.getFractionBits();
+ /** @type {number} */ var minQuantum = deMath.deFloatLdExp(1.0, minExp - fractionBits);
+ /** @type {number} */ var minNormalized = deMath.deFloatLdExp(1.0, minExp);
+ /** @type {number} */ var maxQuantum = deMath.deFloatLdExp(1.0, maxExp - fractionBits);
+
+ // If unit testing is enabled, include exact numbers
+ if (enableUnittests) {
+ dst.push(0.2);
+ dst.push(0.5);
+ }
+
+ // NaN
+ dst.push(NaN);
+ // Zero
+ dst.push(0.0);
+
+ for (var sign = -1; sign <= 1; sign += 2) {
+ // Smallest subnormal
+ dst.push(sign * minQuantum);
+
+ // Largest subnormal
+ dst.push(sign * (minNormalized - minQuantum));
+
+ // Smallest normalized
+ dst.push(sign * minNormalized);
+
+ // Next smallest normalized
+ dst.push(sign * (minNormalized + minQuantum));
+
+ dst.push(sign * 0.5);
+ dst.push(sign * 1.0);
+ dst.push(sign * 2.0);
+
+ // Largest number
+ dst.push(sign * (deMath.deFloatLdExp(1.0, maxExp) +
+ (deMath.deFloatLdExp(1.0, maxExp) - maxQuantum)));
+
+ dst.push(sign * Number.POSITIVE_INFINITY);
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.Sampling}
+ * @param {glsBuiltinPrecisionTests.Typename} typename
+ * @param {number} size
+ */
+ glsBuiltinPrecisionTests.DefaultSamplingVector = function(typename, size) {
+ glsBuiltinPrecisionTests.Sampling.call(this, typename);
+ this.size = size;
+ };
+
+ glsBuiltinPrecisionTests.DefaultSamplingVector.prototype = Object.create(glsBuiltinPrecisionTests.Sampling.prototype);
+ glsBuiltinPrecisionTests.DefaultSamplingVector.prototype.constructor = glsBuiltinPrecisionTests.DefaultSamplingVector;
+
+ glsBuiltinPrecisionTests.DefaultSamplingVector.prototype.genRandom = function(fmt, prec, rnd) {
+ /** @type {Array<*>} */ var ret = [];
+
+ for (var ndx = 0; ndx < this.size; ++ndx)
+ ret[ndx] = glsBuiltinPrecisionTests.SamplingFactory(this.typename).genRandom(fmt, prec, rnd);
+
+ return ret;
+ };
+
+ glsBuiltinPrecisionTests.DefaultSamplingVector.prototype.genFixeds = function(fmt, dst) {
+ /** @type {Array<*>} */ var scalars = [];
+
+ glsBuiltinPrecisionTests.SamplingFactory(this.typename).genFixeds(fmt, scalars);
+
+ for (var scalarNdx = 0; scalarNdx < scalars.length; ++scalarNdx) {
+ var value = [];
+ for (var i = 0; i < this.size; i++)
+ value[i] = scalars[scalarNdx];
+ dst.push(value);
+ }
+ };
+
+ glsBuiltinPrecisionTests.DefaultSamplingVector.prototype.getWeight = function() {
+ return Math.pow(glsBuiltinPrecisionTests.SamplingFactory(this.typename).getWeight(), this.size);
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.Sampling}
+ * @param {glsBuiltinPrecisionTests.Typename} typename
+ * @param {number} rows
+ * @param {number} cols
+ */
+ glsBuiltinPrecisionTests.DefaultSamplingMatrix = function(typename, rows, cols) {
+ glsBuiltinPrecisionTests.Sampling.call(this, typename);
+ this.rows = rows;
+ this.cols = cols;
+ };
+
+ glsBuiltinPrecisionTests.DefaultSamplingMatrix.prototype = Object.create(glsBuiltinPrecisionTests.Sampling.prototype);
+ glsBuiltinPrecisionTests.DefaultSamplingMatrix.prototype.constructor = glsBuiltinPrecisionTests.DefaultSamplingMatrix;
+
+ glsBuiltinPrecisionTests.DefaultSamplingMatrix.prototype.genRandom = function(fmt, prec, rnd) {
+ /** @type {tcuMatrix.Matrix} */ var ret = new tcuMatrix.Matrix(this.rows, this.cols);
+ var sampler = glsBuiltinPrecisionTests.SamplingFactory(this.typename);
+
+ for (var rowNdx = 0; rowNdx < this.rows; ++rowNdx)
+ for (var colNdx = 0; colNdx < this.cols; ++colNdx)
+ ret.set(rowNdx, colNdx, sampler.genRandom(fmt, prec, rnd));
+
+ return ret;
+ };
+
+ glsBuiltinPrecisionTests.DefaultSamplingMatrix.prototype.genFixeds = function(fmt, dst) {
+ /** @type {Array<number>} */ var scalars = [];
+
+ glsBuiltinPrecisionTests.SamplingFactory(this.typename).genFixeds(fmt, scalars);
+
+ for (var scalarNdx = 0; scalarNdx < scalars.length; ++scalarNdx)
+ dst.push(new tcuMatrix.Matrix(this.rows, this.cols, scalars[scalarNdx]));
+
+ if (this.cols == this.rows) {
+ var mat = new tcuMatrix.Matrix(this.rows, this.cols, 0);
+ var x = 1;
+ mat.set(0, 0, x);
+ for (var ndx = 0; ndx < this.cols; ++ndx) {
+ mat.set(this.cols - 1 - ndx, ndx, x);
+ x *= 2;
+ }
+ dst.push(mat);
+ }
+ };
+
+ glsBuiltinPrecisionTests.DefaultSamplingMatrix.prototype.getWeight = function() {
+ return Math.pow(glsBuiltinPrecisionTests.SamplingFactory(this.typename).getWeight(), this.rows * this.cols);
+ };
+
+ /**
+ * @constructor
+ * @param {number=} size
+ * @param {glsBuiltinPrecisionTests.InTypes} In
+ */
+ glsBuiltinPrecisionTests.Samplings = function(In, size) {
+ this.in0 = glsBuiltinPrecisionTests.SamplingFactory(In.In0, size);
+ this.in1 = glsBuiltinPrecisionTests.SamplingFactory(In.In1, size);
+ this.in2 = glsBuiltinPrecisionTests.SamplingFactory(In.In2, size);
+ this.in3 = glsBuiltinPrecisionTests.SamplingFactory(In.In3, size);
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.InTypes} In
+ * @param {number=} size
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.Samplings}
+ */
+ glsBuiltinPrecisionTests.DefaultSamplings = function(In, size) {
+ glsBuiltinPrecisionTests.Samplings.call(this, In, size);
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {glsBuiltinPrecisionTests.Context} context
+ * @param {string} name
+ * @param {string} extension
+ */
+ glsBuiltinPrecisionTests.PrecisionCase = function(context, name, extension) {
+ /** @type {string} */ this.m_extension = extension === undefined ? '' : extension;
+ /** @type {glsBuiltinPrecisionTests.Context} */ this.m_ctx = context;
+ /** @type {*} */ this.m_status;
+ /** @type {deRandom.Random} */ this.m_rnd = new deRandom.Random(1234); // (0xdeadbeefu + context.testContext.getCommandLine().getBaseSeed())
+ tcuTestCase.DeqpTest.call(this, name, extension);
+ };
+
+ glsBuiltinPrecisionTests.PrecisionCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ glsBuiltinPrecisionTests.PrecisionCase.prototype.constructor = glsBuiltinPrecisionTests.PrecisionCase;
+
+ /**
+ * @return {tcuFloatFormat.FloatFormat}
+ */
+ glsBuiltinPrecisionTests.PrecisionCase.prototype.getFormat = function() {
+ return this.m_ctx.floatFormat;
+ };
+
+ /**
+ * Return an output value extracted from flat array
+ * @param {goog.NumberArray} output
+ * @param {number} index Index of the element to extract
+ * @param {*} reference Reference for type informaion
+ * @return {glsBuiltinPrecisionTests.Value}
+ */
+ glsBuiltinPrecisionTests.getOutput = function(output, index, reference) {
+ if (reference instanceof Array) {
+ var ret = [];
+ var size = reference.length;
+ for (var i = 0; i < size; i++)
+ ret[i] = output[size * index + i];
+ return ret;
+ }
+ if (reference instanceof tcuMatrix.Matrix) {
+ var ret = new tcuMatrix.Matrix(reference.rows, reference.cols);
+ var size = reference.rows * reference.cols;
+ for (var i = 0; i < reference.rows; i++)
+ for (var j = 0; j < reference.cols; j++)
+ ret.set(i, j, output[size * index + j * reference.rows + i]);
+ return ret;
+ }
+
+ return output[index];
+ };
+ /**
+ * @param {glsBuiltinPrecisionTests.Variables} variables Variables<In, Out>
+ * @param {glsBuiltinPrecisionTests.Inputs} inputs Inputs<In>
+ * @param {glsBuiltinPrecisionTests.Statement} stmt
+ */
+ glsBuiltinPrecisionTests.PrecisionCase.prototype.testStatement = function(variables, inputs, stmt) {
+ /** @type {tcuFloatFormat.FloatFormat} */ var fmt = this.getFormat();
+ /** @type {number} */ var inCount = glsBuiltinPrecisionTests.numInputs(this.In);
+ /** @type {number} */ var outCount = glsBuiltinPrecisionTests.numOutputs(this.Out);
+ /** @type {number} */ var numValues = (inCount > 0) ? inputs.in0.length : 1;
+ /** @type {tcuFloatFormat.FloatFormat} */ var highpFmt = this.m_ctx.highpFormat;
+ var outputs = [];
+ /** @type {number} */ var maxMsgs = 100;
+ /** @type {number} */ var numErrors = 0;
+ /** @type {glsShaderExecUtil.ShaderSpec} */ var spec = new glsShaderExecUtil.ShaderSpec();
+ /** @type {glsBuiltinPrecisionTests.Environment} */ var env = new glsBuiltinPrecisionTests.Environment(); // Hoisted out of the inner loop for optimization.
+
+ switch (inCount) {
+ case 4: DE_ASSERT(inputs.in3.length == numValues);
+ case 3: DE_ASSERT(inputs.in2.length == numValues);
+ case 2: DE_ASSERT(inputs.in1.length == numValues);
+ case 1: DE_ASSERT(inputs.in0.length == numValues);
+ default: break;
+ }
+ if (enableUnittests)
+ numValues = 2;
+
+ // TODO: Fix logging
+ //Print out the statement and its definitions
+ // bufferedLogToConsole("Statement: " + stmt);
+ // var funcInfo = ''
+ // var funcs = {};
+ // stmt.getUsedFuncs(funcs);
+ // for (var key in funcs) {
+ // var func = funcs[key];
+ // funcInfo += func.printDefinition();
+ // };
+ // if (funcInfo.length > 0)
+ // bufferedLogToConsole('Reference definitions:' + funcInfo);
+
+ // Initialize ShaderSpec from precision, variables and statement.
+
+ spec.globalDeclarations = 'precision ' + gluShaderUtil.getPrecisionName(this.m_ctx.precision) + ' float;\n';
+
+ if (this.m_extension.length > 0)
+ spec.globalDeclarations += '#extension ' + this.m_extension + ' : require\n';
+
+ spec.inputs = [];
+
+ switch (inCount) {
+ case 4: spec.inputs[3] = this.makeSymbol(variables.in3);
+ case 3: spec.inputs[2] = this.makeSymbol(variables.in2);
+ case 2: spec.inputs[1] = this.makeSymbol(variables.in1);
+ case 1: spec.inputs[0] = this.makeSymbol(variables.in0);
+ default: break;
+ }
+
+ spec.outputs = [];
+
+ switch (outCount) {
+ case 2: spec.outputs[1] = this.makeSymbol(variables.out1);
+ case 1: spec.outputs[0] = this.makeSymbol(variables.out0);
+ default: break;
+ }
+
+ spec.source = stmt;
+
+ if (enableUnittests == false) {
+ // Run the shader with inputs.
+ /** @type {glsShaderExecUtil.ShaderExecutor} */
+ var executor = glsShaderExecUtil.createExecutor(this.m_ctx.shaderType, spec);
+ /** @type {Array<*>} */ var inputArr =
+ [
+ tcuMatrixUtil.flatten(inputs.in0), tcuMatrixUtil.flatten(inputs.in1), tcuMatrixUtil.flatten(inputs.in2), tcuMatrixUtil.flatten(inputs.in3)
+ ];
+
+ // executor.log(log());
+ if (!executor.isOk())
+ testFailed('Shader compilation failed');
+
+ executor.useProgram();
+ var outputArray = executor.execute(numValues, inputArr);
+
+ switch (outCount) {
+ case 2:
+ outputs[1] = glsBuiltinPrecisionTests.cast(this.Out.Out1, outputArray[1]);
+ case 1:
+ outputs[0] = glsBuiltinPrecisionTests.cast(this.Out.Out0, outputArray[0]);
+ default: break;
+ }
+ }
+
+ // Initialize environment with dummy values so we don't need to bind in inner loop.
+
+ var in0 = new tcuInterval.Interval();
+ var in1 = new tcuInterval.Interval();
+ var in2 = new tcuInterval.Interval();
+ var in3 = new tcuInterval.Interval();
+ var reference0 = new tcuInterval.Interval();
+ var reference1 = new tcuInterval.Interval();
+
+ env.bind(variables.in0, in0);
+ env.bind(variables.in1, in1);
+ env.bind(variables.in2, in2);
+ env.bind(variables.in3, in3);
+ env.bind(variables.out0, reference0);
+ env.bind(variables.out1, reference1);
+
+ // For each input tuple, compute output reference interval and compare
+ // shader output to the reference.
+ for (var valueNdx = 0; valueNdx < numValues; valueNdx++) {
+ /** @type {boolean} */ var result = true;
+ var value0, value1;
+ var msg = '';
+
+ var in0_ = glsBuiltinPrecisionTests.convert(this.Arg0, fmt, glsBuiltinPrecisionTests.round(this.Arg0, fmt, inputs.in0[valueNdx]));
+ var in1_ = glsBuiltinPrecisionTests.convert(this.Arg1, fmt, glsBuiltinPrecisionTests.round(this.Arg1, fmt, inputs.in1[valueNdx]));
+ var in2_ = glsBuiltinPrecisionTests.convert(this.Arg2, fmt, glsBuiltinPrecisionTests.round(this.Arg2, fmt, inputs.in2[valueNdx]));
+ var in3_ = glsBuiltinPrecisionTests.convert(this.Arg3, fmt, glsBuiltinPrecisionTests.round(this.Arg3, fmt, inputs.in3[valueNdx]));
+
+ env.bind(variables.in0, in0_);
+ env.bind(variables.in1, in1_);
+ env.bind(variables.in2, in2_);
+ env.bind(variables.in3, in3_);
+
+ stmt.execute(new glsBuiltinPrecisionTests.EvalContext(fmt, this.m_ctx.precision, env));
+
+ switch (outCount) {
+ case 2:
+ reference1 = glsBuiltinPrecisionTests.convert(this.Out.Out1, highpFmt, env.lookup(variables.out1));
+ if (enableUnittests)
+ result = referenceComparison(reference1, valueNdx + outCount - 1, this.m_ctx.floatFormat);
+ else {
+ value1 = glsBuiltinPrecisionTests.getOutput(outputs[1], valueNdx, reference1);
+ if (!glsBuiltinPrecisionTests.contains(this.Out.Out1, reference1, value1)) {
+ msg = 'Shader output 1 (' + value1 + ') is outside acceptable range: ' + reference1;
+ result = false;
+ }
+ }
+ case 1:
+ reference0 = glsBuiltinPrecisionTests.convert(this.Out.Out0, highpFmt, env.lookup(variables.out0));
+ if (enableUnittests)
+ result = referenceComparison(reference0, valueNdx + outCount - 1, this.m_ctx.floatFormat);
+ else {
+ value0 = glsBuiltinPrecisionTests.getOutput(outputs[0], valueNdx, reference0);
+ if (!glsBuiltinPrecisionTests.contains(this.Out.Out0, reference0, value0)) {
+ msg = 'Shader output 0 (' + value0 + ') is outside acceptable range: ' + reference0;
+ result = false;
+ }
+ }
+ default: break;
+ }
+
+ if (!result)
+ ++numErrors;
+
+ if (!result && numErrors <= maxMsgs) {
+ /** @type {string} */ var builder = '';
+
+ builder += (result ? 'Passed' : 'Failed') + '\n' + msg + '\n sample:\n' + valueNdx;
+
+ if (inCount > 0) {
+ builder += '\t' + variables.in0.getName() + ' = ' +
+ inputs.in0[valueNdx] + '\n';
+ }
+
+ if (inCount > 1) {
+ builder += '\t' + variables.in1.getName() + ' = ' +
+ inputs.in1[valueNdx] + '\n';
+ }
+
+ if (inCount > 2) {
+ builder += '\t' + variables.in2.getName() + ' = ' +
+ inputs.in2[valueNdx] + '\n';
+ }
+
+ if (inCount > 3) {
+ builder += '\t' + variables.in3.getName() + ' = ' +
+ inputs.in3[valueNdx] + '\n';
+ }
+
+ if (enableUnittests == false) {
+ if (outCount > 0) {
+ builder += '\t' + variables.out0.getName() + ' = ' +
+ value0 + '\n' +
+ '\tExpected range: ' +
+ reference0 + '\n';
+ }
+
+ if (outCount > 1) {
+ builder += '\t' + variables.out1.getName() + ' = ' +
+ value1 + '\n' +
+ '\tExpected range: ' +
+ reference1 + '\n';
+ }
+ }
+ bufferedLogToConsole(builder);
+ }
+ }
+
+ if (numErrors > maxMsgs) {
+ bufferedLogToConsole('(Skipped ' + (numErrors - maxMsgs) + ' messages.)');
+ }
+
+ if (numErrors == 0) {
+ testPassed('All ' + numValues + ' inputs passed.');
+ } else {
+ testFailed('' + numErrors + '/' + numValues + ' inputs failed.');
+ }
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.Variable} variable Variable<typename>
+ * @return {glsShaderExecUtil.Symbol}
+ */
+ glsBuiltinPrecisionTests.PrecisionCase.prototype.makeSymbol = function(variable) {
+ var v = variable;
+ return new glsShaderExecUtil.Symbol(v.getName(), gluVarType.getVarTypeOf(v.typename, this.m_size, this.m_ctx.precision));
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.Tuple4}
+ * @param {*} in0
+ * @param {*} in1
+ * @param {*} in2
+ * @param {*} in3
+ */
+ glsBuiltinPrecisionTests.InTuple = function(in0, in1, in2, in3) {
+ glsBuiltinPrecisionTests.Tuple4.call(this, in0, in1, in2, in3);
+ };
+
+ glsBuiltinPrecisionTests.InTuple.prototype = Object.create(glsBuiltinPrecisionTests.Tuple4.prototype);
+ glsBuiltinPrecisionTests.InTuple.prototype.constructor = glsBuiltinPrecisionTests.InTuple;
+
+ /**
+ * @param {*} In
+ * @param {glsBuiltinPrecisionTests.Samplings} samplings Samplings<In>
+ * @param {tcuFloatFormat.FloatFormat} floatFormat
+ * @param {gluShaderUtil.precision} intPrecision
+ * @param {number} numSamples
+ * @param {deRandom.Random} rnd
+ * @return {glsBuiltinPrecisionTests.Inputs}
+ */
+ glsBuiltinPrecisionTests.generateInputs = function(In, samplings, floatFormat, intPrecision, numSamples, rnd) {
+ /*Inputs<In>*/ var ret = new glsBuiltinPrecisionTests.Inputs(In);
+ /*Inputs<In>*/ var fixedInputs = new glsBuiltinPrecisionTests.Inputs(In);
+ // set<InTuple<In>, InputLess<InTuple<In> > > seenInputs;
+ /** @type {Array<glsBuiltinPrecisionTests.InTuple,glsBuiltinPrecisionTests.InputLess>} */
+ var seenInputs = [];
+
+ samplings.in0.genFixeds(floatFormat, fixedInputs.in0);
+ samplings.in1.genFixeds(floatFormat, fixedInputs.in1);
+ samplings.in2.genFixeds(floatFormat, fixedInputs.in2);
+ samplings.in3.genFixeds(floatFormat, fixedInputs.in3);
+
+ for (var ndx0 = 0; ndx0 < fixedInputs.in0.length; ++ndx0) {
+ for (var ndx1 = 0; ndx1 < fixedInputs.in1.length; ++ndx1) {
+ for (var ndx2 = 0; ndx2 < fixedInputs.in2.length; ++ndx2) {
+ for (var ndx3 = 0; ndx3 < fixedInputs.in3.length; ++ndx3) {
+ var tuple = new glsBuiltinPrecisionTests.InTuple(fixedInputs.in0[ndx0],
+ fixedInputs.in1[ndx1],
+ fixedInputs.in2[ndx2],
+ fixedInputs.in3[ndx3]);
+
+ seenInputs.push(tuple);
+ ret.in0.push(tuple.a);
+ ret.in1.push(tuple.b);
+ ret.in2.push(tuple.c);
+ ret.in3.push(tuple.d);
+ }
+ }
+ }
+ }
+
+ for (var ndx = 0; ndx < numSamples; ++ndx) {
+ var in0 = samplings.in0.genRandom(floatFormat, intPrecision, rnd);
+ var in1 = samplings.in1.genRandom(floatFormat, intPrecision, rnd);
+ var in2 = samplings.in2.genRandom(floatFormat, intPrecision, rnd);
+ var in3 = samplings.in3.genRandom(floatFormat, intPrecision, rnd);
+ var tuple = new glsBuiltinPrecisionTests.InTuple(in0, in1, in2, in3);
+
+ // if (de::contains(seenInputs, tuple))
+ // continue;
+
+ seenInputs.push(tuple);
+ ret.in0.push(in0);
+ ret.in1.push(in1);
+ ret.in2.push(in2);
+ ret.in3.push(in3);
+ }
+
+ return ret;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.PrecisionCase}
+ * @param {string} name
+ * @param {glsBuiltinPrecisionTests.FuncBase} func
+ */
+ glsBuiltinPrecisionTests.FuncCaseBase = function(context, name, func) {
+ glsBuiltinPrecisionTests.PrecisionCase.call(this, context, name, func.getRequiredExtension());
+ };
+
+ glsBuiltinPrecisionTests.FuncCaseBase.prototype = Object.create(glsBuiltinPrecisionTests.PrecisionCase.prototype);
+ glsBuiltinPrecisionTests.FuncCaseBase.prototype.constructor = glsBuiltinPrecisionTests.FuncCaseBase;
+
+ glsBuiltinPrecisionTests.FuncCaseBase.prototype.iterate = function() {
+
+ assertMsgOptions(!(this.m_extension !== undefined && this.m_extension.trim() !== '') &&
+ !sglrGLContext.isExtensionSupported(gl, this.m_extension),
+ 'Unsupported extension: ' + this.m_extension, false, true);
+
+ this.runTest();
+
+ // m_status.setTestContextResult(m_testCtx);
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.FuncCaseBase}
+ * @param {glsBuiltinPrecisionTests.Context} context
+ * @param {string} name
+ * @param {glsBuiltinPrecisionTests.Func} func
+ */
+ glsBuiltinPrecisionTests.InOutFuncCase = function(context, name, func) {
+ glsBuiltinPrecisionTests.FuncCaseBase.call(this, context, name, func);
+ this.Sig = func.Sig;
+ this.m_func = func;
+ this.Ret = func.Sig.Ret;
+ this.Arg0 = func.Sig.Arg0;
+ this.Arg1 = func.Sig.Arg1;
+ this.Arg2 = func.Sig.Arg2;
+ this.Arg3 = func.Sig.Arg3;
+ this.In = new glsBuiltinPrecisionTests.InTypes(this.Arg0, this.Arg2, this.Arg3);
+ this.Out = new glsBuiltinPrecisionTests.OutTypes(this.Ret, this.Arg1);
+ this.m_size = this.m_func.m_size;
+ };
+
+ glsBuiltinPrecisionTests.InOutFuncCase.prototype = Object.create(glsBuiltinPrecisionTests.FuncCaseBase.prototype);
+ glsBuiltinPrecisionTests.InOutFuncCase.prototype.constructor = glsBuiltinPrecisionTests.InOutFuncCase;
+
+ /**
+ * Samplings<In>
+ * @return {glsBuiltinPrecisionTests.Samplings}
+ */
+ glsBuiltinPrecisionTests.InOutFuncCase.prototype.getSamplings = function() {
+ return new glsBuiltinPrecisionTests.DefaultSamplings(this.In, this.m_size);
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.Signature} Sig_
+ */
+ glsBuiltinPrecisionTests.InOutFuncCase.prototype.runTest = function(Sig_) {
+ /** @type {glsBuiltinPrecisionTests.Inputs} */ var inputs = (glsBuiltinPrecisionTests.generateInputs(
+ this.In,
+ this.getSamplings(),
+ this.m_ctx.floatFormat,
+ this.m_ctx.precision,
+ this.m_ctx.numRandoms,
+ this.m_rnd));
+
+ var variables = new glsBuiltinPrecisionTests.Variables(this.In, this.Out);
+ // Variables<In, Out> variables;
+ //
+ variables.out0 = new glsBuiltinPrecisionTests.Variable(this.Out.Out0, 'out0');
+ variables.out1 = new glsBuiltinPrecisionTests.Variable(this.Arg1, 'out1');
+ variables.in0 = new glsBuiltinPrecisionTests.Variable(this.Arg0, 'in0');
+ variables.in1 = new glsBuiltinPrecisionTests.Variable(this.Arg2, 'in1');
+ variables.in2 = new glsBuiltinPrecisionTests.Variable(this.Arg3, 'in2');
+ variables.in3 = new glsBuiltinPrecisionTests.Variable('void', 'in3');
+
+ var expr = glsBuiltinPrecisionTests.applyVar(this.m_func,
+ variables.in0, variables.out1,
+ variables.in1, variables.in2);
+ var stmt = glsBuiltinPrecisionTests.variableAssignment(variables.out0, expr);
+
+ this.testStatement(variables, inputs, stmt);
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.FuncCaseBase}
+ * @param {glsBuiltinPrecisionTests.Context} context
+ * @param {string} name
+ * @param {glsBuiltinPrecisionTests.Func} func
+ */
+ glsBuiltinPrecisionTests.FuncCase = function(context, name, func) {
+ glsBuiltinPrecisionTests.FuncCaseBase.call(this, context, name, func);
+ this.Sig = func.Sig;
+ this.m_func = func;
+ this.Ret = func.Sig.Ret;
+ this.Arg0 = func.Sig.Arg0;
+ this.Arg1 = func.Sig.Arg1;
+ this.Arg2 = func.Sig.Arg2;
+ this.Arg3 = func.Sig.Arg3;
+ this.In = new glsBuiltinPrecisionTests.InTypes(this.Arg0, this.Arg1, this.Arg2, this.Arg3);
+ this.Out = new glsBuiltinPrecisionTests.OutTypes(this.Ret);
+ this.m_size = this.m_func.m_size;
+ };
+
+ glsBuiltinPrecisionTests.FuncCase.prototype = Object.create(glsBuiltinPrecisionTests.FuncCaseBase.prototype);
+ glsBuiltinPrecisionTests.FuncCase.prototype.constructor = glsBuiltinPrecisionTests.FuncCase;
+
+ /**
+ * Samplings<In>
+ * @return {glsBuiltinPrecisionTests.Samplings}
+ */
+ glsBuiltinPrecisionTests.FuncCase.prototype.getSamplings = function() {
+ return new glsBuiltinPrecisionTests.DefaultSamplings(this.In, this.m_size);
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.Signature} Sig_
+ */
+ glsBuiltinPrecisionTests.FuncCase.prototype.runTest = function(Sig_) {
+ /** @type {glsBuiltinPrecisionTests.Inputs} */ var inputs = (glsBuiltinPrecisionTests.generateInputs(
+ this.In,
+ this.getSamplings(),
+ this.m_ctx.floatFormat,
+ this.m_ctx.precision,
+ this.m_ctx.numRandoms,
+ this.m_rnd));
+
+ var variables = new glsBuiltinPrecisionTests.Variables(this.In, this.Out);
+ // Variables<In, Out> variables;
+ //
+ variables.out0 = new glsBuiltinPrecisionTests.Variable(this.Ret, 'out0');
+ variables.out1 = new glsBuiltinPrecisionTests.Variable('void', 'out1');
+ variables.in0 = new glsBuiltinPrecisionTests.Variable(this.Arg0, 'in0');
+ variables.in1 = new glsBuiltinPrecisionTests.Variable(this.Arg1, 'in1');
+ variables.in2 = new glsBuiltinPrecisionTests.Variable(this.Arg2, 'in2');
+ variables.in3 = new glsBuiltinPrecisionTests.Variable(this.Arg3, 'in3');
+
+ var expr = glsBuiltinPrecisionTests.applyVar(this.m_func,
+ variables.in0, variables.in1,
+ variables.in2, variables.in3);
+ var stmt = glsBuiltinPrecisionTests.variableAssignment(variables.out0, expr);
+
+ this.testStatement(variables, inputs, stmt);
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.Func} func
+ * @param {glsBuiltinPrecisionTests.Variable} arg0
+ * @param {glsBuiltinPrecisionTests.Variable} arg1
+ * @param {glsBuiltinPrecisionTests.Variable} arg2
+ * @param {glsBuiltinPrecisionTests.Variable} arg3
+ * @return {glsBuiltinPrecisionTests.ApplyVar}
+ */
+ glsBuiltinPrecisionTests.applyVar = function(func, arg0, arg1, arg2, arg3) {
+ return new glsBuiltinPrecisionTests.ApplyVar(func.Sig, func, arg0, arg1, arg2, arg3);
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.Variable} variable
+ * @param {glsBuiltinPrecisionTests.ApplyVar} value
+ * @param {boolean} isDeclaration
+ */
+ glsBuiltinPrecisionTests.variableStatement = function(variable, value, isDeclaration) {
+ return new glsBuiltinPrecisionTests.VariableStatement(variable, value, isDeclaration);
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.Variable} variable
+ * @param {glsBuiltinPrecisionTests.ApplyVar} value
+ */
+ glsBuiltinPrecisionTests.variableAssignment = function(variable, value) {
+ return glsBuiltinPrecisionTests.variableStatement(variable, value, false);
+ };
+
+ /**
+ * @constructor
+ */
+ glsBuiltinPrecisionTests.CaseFactories = function() {};
+
+ /**
+ * @return {Array<glsBuiltinPrecisionTests.CaseFactory>}
+ */
+ glsBuiltinPrecisionTests.CaseFactories.prototype.getFactories = function() {};
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.CaseFactories}
+ */
+ glsBuiltinPrecisionTests.BuiltinFuncs = function() {
+ /** @type {Array<glsBuiltinPrecisionTests.CaseFactory>} */ this.m_factories = [];
+ };
+
+ glsBuiltinPrecisionTests.BuiltinFuncs.prototype = Object.create(glsBuiltinPrecisionTests.CaseFactories.prototype);
+ glsBuiltinPrecisionTests.BuiltinFuncs.prototype.constructor = glsBuiltinPrecisionTests.BuiltinFuncs;
+
+ /**
+ * @return {Array<glsBuiltinPrecisionTests.CaseFactory>}
+ */
+ glsBuiltinPrecisionTests.BuiltinFuncs.prototype.getFactories = function() {
+ return this.m_factories.slice();
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.CaseFactory} fact
+ */
+ glsBuiltinPrecisionTests.BuiltinFuncs.prototype.addFactory = function(fact) {
+ this.m_factories.push(fact);
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.Context} context
+ * @param {string} name
+ * @param {glsBuiltinPrecisionTests.Func} func
+ * @return {glsBuiltinPrecisionTests.PrecisionCase}
+ */
+ glsBuiltinPrecisionTests.createFuncCase = function(context, name, func) {
+ switch (func.getOutParamIndex()) {
+ case -1:
+ return new glsBuiltinPrecisionTests.FuncCase(context, name, func);
+ case 1:
+ return new glsBuiltinPrecisionTests.InOutFuncCase(context, name, func);
+ default:
+ throw new Error(!'Impossible');
+ }
+ };
+
+ /**
+ * @constructor
+ */
+ glsBuiltinPrecisionTests.CaseFactory = function() {};
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.CaseFactory.prototype.getName = function() {
+ return '';
+ };
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.CaseFactory.prototype.getDesc = function() {
+ return '';
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.Context} ctx
+ */
+ glsBuiltinPrecisionTests.CaseFactory.prototype.createCase = function(ctx) {
+ throw new Error('Virtual function. Please override.');
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.CaseFactory}
+ * @param {glsBuiltinPrecisionTests.Func} func
+ */
+ glsBuiltinPrecisionTests.SimpleFuncCaseFactory = function(func) {
+ glsBuiltinPrecisionTests.CaseFactory.call(this);
+ this.m_func = func;
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.SimpleFuncCaseFactory, glsBuiltinPrecisionTests.CaseFactory);
+
+ glsBuiltinPrecisionTests.SimpleFuncCaseFactory.prototype.getName = function() {
+ return this.m_func.getName().toLowerCase();
+ };
+
+ glsBuiltinPrecisionTests.SimpleFuncCaseFactory.prototype.getDesc = function() {
+ return "Function '" + this.getName() + "'";
+ };
+
+ glsBuiltinPrecisionTests.SimpleFuncCaseFactory.prototype.createCase = function(ctx) {
+ return glsBuiltinPrecisionTests.createFuncCase(ctx, ctx.name, this.m_func);
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.CaseFactory}
+ */
+ glsBuiltinPrecisionTests.FuncCaseFactory = function() {
+ glsBuiltinPrecisionTests.CaseFactory.call(this);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.FuncCaseFactory, glsBuiltinPrecisionTests.CaseFactory);
+
+ glsBuiltinPrecisionTests.FuncCaseFactory.prototype.getFunc = function() {
+ throw new Error('Virtual function. Please override.');
+ };
+
+ glsBuiltinPrecisionTests.FuncCaseFactory.prototype.getName = function() {
+ return this.getFunc().getName().toLowerCase();
+ };
+
+ glsBuiltinPrecisionTests.FuncCaseFactory.prototype.getDesc = function() {
+ return "Function '" + this.getFunc().getName() + "'";
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.FuncCaseFactory}
+ */
+ glsBuiltinPrecisionTests.TemplateFuncCaseFactory = function(genF) {
+ glsBuiltinPrecisionTests.FuncCaseFactory.call(this);
+ this.m_genF = genF;
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.TemplateFuncCaseFactory, glsBuiltinPrecisionTests.FuncCaseFactory);
+
+ glsBuiltinPrecisionTests.TemplateFuncCaseFactory.prototype.getFunc = function() {
+ return new this.m_genF(1);
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.Context} ctx
+ */
+ glsBuiltinPrecisionTests.TemplateFuncCaseFactory.prototype.createCase = function(ctx) {
+ var group = tcuTestCase.newTest(ctx.name, ctx.name);
+ group.addChild(glsBuiltinPrecisionTests.createFuncCase(ctx, 'scalar', new this.m_genF(1)));
+ group.addChild(glsBuiltinPrecisionTests.createFuncCase(ctx, 'vec2', new this.m_genF(2)));
+ group.addChild(glsBuiltinPrecisionTests.createFuncCase(ctx, 'vec3', new this.m_genF(3)));
+ group.addChild(glsBuiltinPrecisionTests.createFuncCase(ctx, 'vec4', new this.m_genF(4)));
+
+ return group;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.FuncCaseFactory}
+ */
+ glsBuiltinPrecisionTests.MatrixFuncCaseFactory = function(genF) {
+ glsBuiltinPrecisionTests.FuncCaseFactory.call(this);
+ this.m_genF = genF;
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.MatrixFuncCaseFactory, glsBuiltinPrecisionTests.FuncCaseFactory);
+
+ glsBuiltinPrecisionTests.MatrixFuncCaseFactory.prototype.getFunc = function() {
+ return new this.m_genF(2, 2);
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.Context} ctx
+ */
+ glsBuiltinPrecisionTests.MatrixFuncCaseFactory.prototype.createCase = function(ctx) {
+ var group = tcuTestCase.newTest(ctx.name, ctx.name);
+ this.addCase(ctx, group, 2, 2);
+ this.addCase(ctx, group, 3, 2);
+ this.addCase(ctx, group, 4, 2);
+ this.addCase(ctx, group, 2, 3);
+ this.addCase(ctx, group, 3, 3);
+ this.addCase(ctx, group, 4, 3);
+ this.addCase(ctx, group, 2, 4);
+ this.addCase(ctx, group, 3, 4);
+ this.addCase(ctx, group, 4, 4);
+
+ return group;
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.Context} ctx
+ * @param {tcuTestCase.DeqpTest} group
+ * @param {number} rows
+ * @param {number} cols
+ */
+ glsBuiltinPrecisionTests.MatrixFuncCaseFactory.prototype.addCase = function(ctx, group, rows, cols) {
+ var name = glsBuiltinPrecisionTests.dataTypeNameOfMatrix('float', rows, cols);
+ group.addChild(glsBuiltinPrecisionTests.createFuncCase(ctx, name, new this.m_genF(rows, cols)));
+ };
+
+ glsBuiltinPrecisionTests.dataTypeNameOfMatrix = function(typename, rows, cols) {
+ switch (typename) {
+ case 'float':
+ if (rows === cols)
+ return 'mat' + rows;
+ else
+ return 'mat' + cols + 'x' + rows;
+ }
+ throw new Error('Invalid arguments (' + typename + ', ' + rows + ', ' + cols + ')');
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.FuncCaseFactory}
+ */
+ glsBuiltinPrecisionTests.SquareMatrixFuncCaseFactory = function(genF) {
+ glsBuiltinPrecisionTests.FuncCaseFactory.call(this);
+ this.m_genF = genF;
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.SquareMatrixFuncCaseFactory, glsBuiltinPrecisionTests.FuncCaseFactory);
+
+ glsBuiltinPrecisionTests.SquareMatrixFuncCaseFactory.prototype.getFunc = function() {
+ return new this.m_genF(2);
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.Context} ctx
+ */
+ glsBuiltinPrecisionTests.SquareMatrixFuncCaseFactory.prototype.createCase = function(ctx) {
+ var group = tcuTestCase.newTest(ctx.name, ctx.name);
+
+ group.addChild(glsBuiltinPrecisionTests.createFuncCase(ctx, 'mat2', new this.m_genF(2)));
+ return group;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.PrimitiveFunc}
+ * @param {glsBuiltinPrecisionTests.Func} scalarFunc
+ * @param {number=} size
+ */
+ glsBuiltinPrecisionTests.GenFunc = function(scalarFunc, size) {
+ glsBuiltinPrecisionTests.PrimitiveFunc.call(this, scalarFunc.Sig);
+ this.m_func = scalarFunc;
+ this.m_size = size;
+ };
+
+ glsBuiltinPrecisionTests.GenFunc.prototype = Object.create(glsBuiltinPrecisionTests.PrimitiveFunc.prototype);
+ glsBuiltinPrecisionTests.GenFunc.prototype.constructor = glsBuiltinPrecisionTests.GenFunc;
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.GenFunc.prototype.getName = function() {
+ return this.m_func.getName();
+ };
+
+ /**
+ * @return {number}
+ */
+ glsBuiltinPrecisionTests.GenFunc.prototype.getOutParamIndex = function() {
+ return this.m_func.getOutParamIndex();
+ };
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.GenFunc.prototype.getRequiredExtension = function() {
+ return this.m_func.getRequiredExtension();
+ };
+
+ /**
+ * @param {Array<glsBuiltinPrecisionTests.ExprBase>} args
+ */
+ glsBuiltinPrecisionTests.GenFunc.prototype.doPrint = function(args) {
+ return this.m_func.print(args);
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.EvalContext} ctx
+ * @param {glsBuiltinPrecisionTests.Tuple4} iargs
+ * @return {*}
+ */
+ glsBuiltinPrecisionTests.GenFunc.prototype.doApply = function(ctx, iargs) {
+ /** @type {Array<*>} */ var ret = [];
+
+ if (this.m_size > 1) {
+ for (var ndx = 0; ndx < this.m_size; ++ndx) {
+ var a = iargs.a === undefined ? undefined : iargs.a[ndx];
+ var b = iargs.b === undefined ? undefined : iargs.b[ndx];
+ var c = iargs.c === undefined ? undefined : iargs.c[ndx];
+ var d = iargs.d === undefined ? undefined : iargs.d[ndx];
+ ret[ndx] = this.m_func.applyFunction(ctx, a, b, c, d);
+ }
+ } else
+ ret[0] = this.m_func.applyFunction(ctx, iargs.a, iargs.b, iargs.c, iargs.d);
+
+ return ret;
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.FuncSet} dst
+ */
+ glsBuiltinPrecisionTests.GenFunc.prototype.doGetUsedFuncs = function(dst) {
+ this.m_func.getUsedFuncs(dst);
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.GenFunc}
+ * @param {glsBuiltinPrecisionTests.Func} func
+ * @param {number} size
+ */
+ glsBuiltinPrecisionTests.VectorizedFunc = function(func, size) {
+ glsBuiltinPrecisionTests.GenFunc.call(this, func, size);
+ };
+
+ glsBuiltinPrecisionTests.VectorizedFunc.prototype = Object.create(glsBuiltinPrecisionTests.GenFunc.prototype);
+ glsBuiltinPrecisionTests.VectorizedFunc.prototype.constructor = glsBuiltinPrecisionTests.VectorizedFunc;
+
+ /**
+ * @constructor
+ * @param {glsBuiltinPrecisionTests.Func} func_
+ * @param {glsBuiltinPrecisionTests.GenFunc} func2_
+ * @param {glsBuiltinPrecisionTests.GenFunc} func3_
+ * @param {glsBuiltinPrecisionTests.GenFunc} func4_
+ */
+ glsBuiltinPrecisionTests.GenFuncs = function(func_, func2_, func3_, func4_) {
+ this.func = func_;
+ this.func2 = func2_;
+ this.func3 = func3_;
+ this.func4 = func4_;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.CaseFactory}
+ * @param {glsBuiltinPrecisionTests.GenFuncs} funcs
+ * @param {string} name
+ */
+ glsBuiltinPrecisionTests.GenFuncCaseFactory = function(funcs, name) {
+ glsBuiltinPrecisionTests.CaseFactory.call(this);
+ this.m_funcs = funcs;
+ this.m_name = name;
+ };
+
+ glsBuiltinPrecisionTests.GenFuncCaseFactory.prototype = Object.create(glsBuiltinPrecisionTests.CaseFactory.prototype);
+ glsBuiltinPrecisionTests.GenFuncCaseFactory.prototype.constructor = glsBuiltinPrecisionTests.GenFuncCaseFactory;
+
+ /**
+ * @param {glsBuiltinPrecisionTests.Context} ctx
+ * @return {tcuTestCase.DeqpTest}
+ */
+ glsBuiltinPrecisionTests.GenFuncCaseFactory.prototype.createCase = function(ctx) {
+ /** @type {tcuTestCase.DeqpTest} */
+ var group = tcuTestCase.newTest(ctx.name, ctx.name);
+ group.addChild(glsBuiltinPrecisionTests.createFuncCase(ctx, 'scalar', this.m_funcs.func));
+ group.addChild(glsBuiltinPrecisionTests.createFuncCase(ctx, 'vec2', this.m_funcs.func2));
+ group.addChild(glsBuiltinPrecisionTests.createFuncCase(ctx, 'vec3', this.m_funcs.func3));
+ group.addChild(glsBuiltinPrecisionTests.createFuncCase(ctx, 'vec4', this.m_funcs.func4));
+
+ return group;
+ };
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.GenFuncCaseFactory.prototype.getName = function() {
+ return this.m_name;
+ };
+
+ /**
+ * @return {string}
+ */
+ glsBuiltinPrecisionTests.GenFuncCaseFactory.prototype.getDesc = function() {
+ return "Function '" + this.m_funcs.func.getName() + "'";
+ };
+
+ /**
+ * @constructor
+ * @param {string} name_
+ * @param {tcuFloatFormat.FloatFormat} floatFormat_
+ * @param {tcuFloatFormat.FloatFormat} highpFormat_
+ * @param {gluShaderUtil.precision} precision_
+ * @param {gluShaderProgram.shaderType} shaderType_
+ * @param {number} numRandoms_
+ */
+ glsBuiltinPrecisionTests.Context = function(name_, floatFormat_, highpFormat_, precision_, shaderType_, numRandoms_) {
+ /** @type {string} */ this.name = name_;
+ /** @type {tcuFloatFormat.FloatFormat} */ this.floatFormat = floatFormat_;
+ /** @type {tcuFloatFormat.FloatFormat} */ this.highpFormat = highpFormat_;
+ /** @type {gluShaderUtil.precision} */ this.precision = precision_;
+ /** @type {gluShaderProgram.shaderType} */ this.shaderType = shaderType_;
+ /** @type {number} */ this.numRandoms = numRandoms_;
+ };
+
+ /**
+ * @constructor
+ * @param {tcuFloatFormat.FloatFormat} highp_
+ * @param {tcuFloatFormat.FloatFormat} mediump_
+ * @param {tcuFloatFormat.FloatFormat} lowp_
+ * @param {Array<gluShaderProgram.shaderType>} shaderTypes_
+ * @param {number} numRandoms_
+ */
+ glsBuiltinPrecisionTests.PrecisionTestContext = function(highp_, mediump_, lowp_, shaderTypes_, numRandoms_) {
+ /** @type {Array<gluShaderProgram.shaderType>} */ this.shaderTypes = shaderTypes_;
+ /** @type {Array<tcuFloatFormat.FloatFormat>} */ this.formats = [];
+ this.formats[gluShaderUtil.precision.PRECISION_HIGHP] = highp_;
+ this.formats[gluShaderUtil.precision.PRECISION_MEDIUMP] = mediump_;
+ this.formats[gluShaderUtil.precision.PRECISION_LOWP] = lowp_;
+ /** @type {number} */ this.numRandoms = numRandoms_;
+ };
+
+ /**
+ * \brief Simple incremental counter.
+ *
+ * This is used to make sure that different ExpandContexts will not produce
+ * overlapping temporary names.
+ * @constructor
+ *
+ */
+ glsBuiltinPrecisionTests.Counter = function() {
+ this.m_count = 0;
+ };
+
+ glsBuiltinPrecisionTests.Counter.prototype.get = function() {
+ return this.m_count++;
+ };
+
+ /**
+ * @constructor
+ */
+ glsBuiltinPrecisionTests.ExpandContext = function(counter) {
+ this.m_counter = counter;
+ this.m_statements = [];
+ };
+
+ /**
+ * @param {string} typename
+ * @param {string} baseName
+ * @return {glsBuiltinPrecisionTests.Variable}
+ */
+ glsBuiltinPrecisionTests.ExpandContext.prototype.genSym = function(typename, baseName) {
+ return new glsBuiltinPrecisionTests.Variable(typename, baseName + this.m_counter.get());
+ };
+
+ glsBuiltinPrecisionTests.ExpandContext.prototype.addStatement = function(/*const StatementP&*/ stmt) {
+ this.m_statements.push(stmt);
+ };
+
+ glsBuiltinPrecisionTests.ExpandContext.prototype.getStatements = function() {
+ return this.m_statements;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.Func}
+ * @param {glsBuiltinPrecisionTests.Signature} Sig_ template <typename Sig_>
+ */
+ glsBuiltinPrecisionTests.DerivedFunc = function(Sig_) {
+ glsBuiltinPrecisionTests.Func.call(this, Sig_);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.DerivedFunc, glsBuiltinPrecisionTests.Func);
+
+ glsBuiltinPrecisionTests.DerivedFunc.prototype.doPrintDefinition = function() {
+ var os = '';
+ var paramNames = this.getParamNames();
+
+ this.initialize();
+
+ os += this.Ret + ' ' + this.getName() +
+ '(';
+ if (glsBuiltinPrecisionTests.isTypeValid(this.Arg0))
+ os += this.Arg0 + ' ' + paramNames.a;
+ if (glsBuiltinPrecisionTests.isTypeValid(this.Arg1))
+ os += ', ' + this.Arg1 + ' ' + paramNames.b;
+ if (glsBuiltinPrecisionTests.isTypeValid(this.Arg2))
+ os += ', ' + this.Arg2 + ' ' + paramNames.c;
+ if (glsBuiltinPrecisionTests.isTypeValid(this.Arg3))
+ os += ', ' + this.Arg3 + ' ' + paramNames.d;
+ os += ')\n{\n';
+
+ for (var ndx = 0; ndx < this.m_body.length; ++ndx)
+ os += this.m_body[ndx];
+ os += 'return ' + this.m_ret + ';\n';
+ os += '}\n';
+
+ return os;
+ };
+
+ glsBuiltinPrecisionTests.DerivedFunc.prototype.doApply = function(ctx, args) {
+ var funEnv = new glsBuiltinPrecisionTests.Environment();
+ this.initialize();
+
+ funEnv.bind(this.m_var0, args.a);
+ funEnv.bind(this.m_var1, args.b);
+ funEnv.bind(this.m_var2, args.c);
+ funEnv.bind(this.m_var3, args.d);
+
+ var funCtx = new glsBuiltinPrecisionTests.EvalContext(ctx.format, ctx.floatPrecision, funEnv, ctx.callDepth);
+
+ for (var ndx = 0; ndx < this.m_body.length; ++ndx)
+ this.m_body[ndx].execute(funCtx);
+
+ var ret = this.m_ret.evaluate(funCtx);
+
+ // \todo [lauri] Store references instead of values in environment
+ args.a = funEnv.lookup(this.m_var0);
+ args.b = funEnv.lookup(this.m_var1);
+ args.c = funEnv.lookup(this.m_var2);
+ args.d = funEnv.lookup(this.m_var3);
+
+ return ret;
+ };
+
+ glsBuiltinPrecisionTests.DerivedFunc.prototype.initialize = function() {
+ if (!this.m_ret) {
+ var paramNames = this.getParamNames();
+ var symCounter = new glsBuiltinPrecisionTests.Counter();
+ var ctx = new glsBuiltinPrecisionTests.ExpandContext(symCounter);
+
+ this.m_var0 = new glsBuiltinPrecisionTests.Variable(this.Arg0, paramNames.a);
+ this.m_var1 = new glsBuiltinPrecisionTests.Variable(this.Arg1, paramNames.b);
+ this.m_var2 = new glsBuiltinPrecisionTests.Variable(this.Arg2, paramNames.c);
+ this.m_var3 = new glsBuiltinPrecisionTests.Variable(this.Arg3, paramNames.d);
+ var args = new glsBuiltinPrecisionTests.Tuple4(this.m_var0,
+ this.m_var1, this.m_var2, this.m_var3);
+
+ this.m_ret = this.doExpand(ctx, args);
+ this.m_body = ctx.getStatements();
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.Func}
+ * @param {glsBuiltinPrecisionTests.Signature} Sig_ template <typename Sig_>
+ */
+ glsBuiltinPrecisionTests.Alternatives = function(Sig_) {
+ glsBuiltinPrecisionTests.Func.call(this, Sig_);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Alternatives,glsBuiltinPrecisionTests.Func);
+
+ glsBuiltinPrecisionTests.Alternatives.prototype.getName = function() {
+ return 'alternatives';
+ };
+
+ glsBuiltinPrecisionTests.Alternatives.prototype.doPrintDefinition = function() {};
+
+ glsBuiltinPrecisionTests.Alternatives.prototype.doGetUsedFuncs = function(dst) {};
+
+ glsBuiltinPrecisionTests.Alternatives.prototype.doApply = function(ctx,args) {
+ return glsBuiltinPrecisionTests.union(this.Sig.Ret,args.a,args.b);
+ };
+
+ glsBuiltinPrecisionTests.Alternatives.prototype.doPrint = function(args) {
+ return '{' + args[0] + '|' + args[1] + '}';
+ };
+
+ glsBuiltinPrecisionTests.sizeToName = function(size) {
+ switch (size) {
+ case 4: return 'vec4';
+ case 3: return 'vec3';
+ case 2: return 'vec2';
+ }
+ return 'float';
+ };
+
+ /**
+ * @constructor
+ * @param {number} size
+ * @extends {glsBuiltinPrecisionTests.DerivedFunc}
+ */
+ glsBuiltinPrecisionTests.Dot = function(size) {
+ var name = glsBuiltinPrecisionTests.sizeToName(size);
+ var sig = new glsBuiltinPrecisionTests.Signature('float', name, name);
+ glsBuiltinPrecisionTests.DerivedFunc.call(this, sig);
+ this.m_inputSize = size;
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Dot, glsBuiltinPrecisionTests.DerivedFunc);
+
+ glsBuiltinPrecisionTests.Dot.prototype.getName = function() {
+ return 'dot';
+ };
+
+ glsBuiltinPrecisionTests.Dot.prototype.doExpand = function(ctx, args) {
+ if (this.m_inputSize > 1) {
+ var val = app(new glsBuiltinPrecisionTests.Mul(),
+ new glsBuiltinPrecisionTests.VectorVariable(args.a, 0), new glsBuiltinPrecisionTests.VectorVariable(args.b, 0));
+ for (var i = 1; i < this.m_inputSize; i++) {
+ var tmp = new glsBuiltinPrecisionTests.Apply('float', new glsBuiltinPrecisionTests.Mul(),
+ new glsBuiltinPrecisionTests.VectorVariable(args.a, i), new glsBuiltinPrecisionTests.VectorVariable(args.b, i));
+ val = app(new glsBuiltinPrecisionTests.Add(), val, tmp);
+ }
+ return val;
+ } else {
+ // args.a * args.b
+ var ret = app(new glsBuiltinPrecisionTests.Mul(), args.a, args.b);
+ return ret;
+ }
+ };
+
+ /**
+ * @constructor
+ * @param {number} size
+ * @extends {glsBuiltinPrecisionTests.DerivedFunc}
+ */
+ glsBuiltinPrecisionTests.Length = function(size) {
+ var name = glsBuiltinPrecisionTests.sizeToName(size);
+ var sig = new glsBuiltinPrecisionTests.Signature('float', name);
+ glsBuiltinPrecisionTests.DerivedFunc.call(this, sig);
+ this.m_inputSize = size;
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Length, glsBuiltinPrecisionTests.DerivedFunc);
+
+ glsBuiltinPrecisionTests.Length.prototype.getName = function() {
+ return 'length';
+ };
+
+ glsBuiltinPrecisionTests.Length.prototype.doExpand = function(ctx, args) {
+ //sqrt(dot(args.a, args.a));
+ var v0 = app(new glsBuiltinPrecisionTests.Dot(this.m_inputSize), args.a, args.a);
+ var v1 = app(new glsBuiltinPrecisionTests.Sqrt(), v0);
+ return v1;
+ };
+
+ /**
+ * @constructor
+ * @param {number} size
+ * @extends {glsBuiltinPrecisionTests.DerivedFunc}
+ */
+ glsBuiltinPrecisionTests.Distance = function(size) {
+ var name = glsBuiltinPrecisionTests.sizeToName(size);
+ var sig = new glsBuiltinPrecisionTests.Signature('float', name, name);
+ glsBuiltinPrecisionTests.DerivedFunc.call(this, sig);
+ this.m_inputSize = size;
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Distance, glsBuiltinPrecisionTests.DerivedFunc);
+
+ glsBuiltinPrecisionTests.Distance.prototype.getName = function() {
+ return 'distance';
+ };
+
+ glsBuiltinPrecisionTests.Distance.prototype.doExpand = function(ctx, args) {
+ //length(args.a - args.b);
+ var v0 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Sub(), args.a, args.b);
+ var v1 = app(new glsBuiltinPrecisionTests.Length(this.m_inputSize), v0);
+ return v1;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.DerivedFunc}
+ */
+ glsBuiltinPrecisionTests.Cross = function() {
+ var sig = new glsBuiltinPrecisionTests.Signature('vec3', 'vec3', 'vec3');
+ glsBuiltinPrecisionTests.DerivedFunc.call(this, sig);
+ this.m_inputSize = 3;
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Cross, glsBuiltinPrecisionTests.DerivedFunc);
+
+ glsBuiltinPrecisionTests.Cross.prototype.getName = function() {
+ return 'cross';
+ };
+
+ glsBuiltinPrecisionTests.Cross.prototype.doExpand = function(ctx, args) {
+ // vec3(x.a[1] * x.b[2] - x.b[1] * x.a[2],
+ // x.a[2] * x.b[0] - x.b[2] * x.a[0],
+ // x.a[0] * x.b[1] - x.b[0] * x.a[1]);
+ var a = [], b = [];
+ for (var i = 0; i < this.m_inputSize; i++) {
+ a[i] = new glsBuiltinPrecisionTests.VectorVariable(args.a, i);
+ b[i] = new glsBuiltinPrecisionTests.VectorVariable(args.b, i);
+ }
+ var v0 = app(new glsBuiltinPrecisionTests.Mul(), a[1], b[2]);
+ var v1 = app(new glsBuiltinPrecisionTests.Mul(), b[1], a[2]);
+ var v2 = app(new glsBuiltinPrecisionTests.Sub(), v0, v1);
+
+ var v3 = app(new glsBuiltinPrecisionTests.Mul(), a[2], b[0]);
+ var v4 = app(new glsBuiltinPrecisionTests.Mul(), b[2], a[0]);
+ var v5 = app(new glsBuiltinPrecisionTests.Sub(), v3, v4);
+
+ var v6 = app(new glsBuiltinPrecisionTests.Mul(), a[0], b[1]);
+ var v7 = app(new glsBuiltinPrecisionTests.Mul(), b[0], a[1]);
+ var v8 = app(new glsBuiltinPrecisionTests.Sub(), v6, v7);
+
+ var v9 = app(new glsBuiltinPrecisionTests.GenVec(this.m_inputSize, true), v2, v5, v8);
+ return v9;
+ };
+
+ /**
+ * @constructor
+ * @param {number} size
+ * @extends {glsBuiltinPrecisionTests.DerivedFunc}
+ */
+ glsBuiltinPrecisionTests.Normalize = function(size) {
+ var name = glsBuiltinPrecisionTests.sizeToName(size);
+ var sig = new glsBuiltinPrecisionTests.Signature(name, name);
+ glsBuiltinPrecisionTests.DerivedFunc.call(this, sig);
+ this.m_inputSize = size;
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Normalize, glsBuiltinPrecisionTests.DerivedFunc);
+
+ glsBuiltinPrecisionTests.Normalize.prototype.getName = function() {
+ return 'normalize';
+ };
+
+ glsBuiltinPrecisionTests.Normalize.prototype.doExpand = function(ctx, args) {
+ //args.a / length<Size>(args.a);
+ var v0 = app(new glsBuiltinPrecisionTests.Length(this.m_inputSize), args.a);
+ var v1 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Div(), args.a, v0);
+ return v1;
+ };
+
+ /**
+ * @constructor
+ * @param {number} size
+ * @extends {glsBuiltinPrecisionTests.DerivedFunc}
+ */
+ glsBuiltinPrecisionTests.FaceForward = function(size) {
+ var name = glsBuiltinPrecisionTests.sizeToName(size);
+ var sig = new glsBuiltinPrecisionTests.Signature(name, name, name, name);
+ glsBuiltinPrecisionTests.DerivedFunc.call(this, sig);
+ this.m_inputSize = size;
+ this.typename = name;
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.FaceForward, glsBuiltinPrecisionTests.DerivedFunc);
+
+ glsBuiltinPrecisionTests.FaceForward.prototype.getName = function() {
+ return 'faceforward';
+ };
+
+ glsBuiltinPrecisionTests.FaceForward.prototype.doExpand = function(ctx, args) {
+ //cond(dot(args.c, args.b) < constant(0.0f), args.a, -args.a);
+ var zero = new glsBuiltinPrecisionTests.Constant(0);
+ var v0 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Negate(), args.a);
+ var v1 = app(new glsBuiltinPrecisionTests.Dot(this.m_inputSize), args.c, args.b);
+ var v2 = app(new glsBuiltinPrecisionTests.LessThan('float'), v1, zero);
+ var v3 = app(new glsBuiltinPrecisionTests.Cond(this.typename), v2, args.a, v0);
+ return v3;
+ };
+
+ /**
+ * @constructor
+ * @param {number} size
+ * @extends {glsBuiltinPrecisionTests.DerivedFunc}
+ */
+ glsBuiltinPrecisionTests.Reflect = function(size) {
+ var name = glsBuiltinPrecisionTests.sizeToName(size);
+ var sig = new glsBuiltinPrecisionTests.Signature(name, name, name);
+ glsBuiltinPrecisionTests.DerivedFunc.call(this, sig);
+ this.m_inputSize = size;
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Reflect, glsBuiltinPrecisionTests.DerivedFunc);
+
+ glsBuiltinPrecisionTests.Reflect.prototype.getName = function() {
+ return 'reflect';
+ };
+
+ glsBuiltinPrecisionTests.Reflect.prototype.doExpand = function(ctx, args) {
+ //args.a - (args.b * dot(args.b, args.a) * constant(2.0f));
+ var two = new glsBuiltinPrecisionTests.Constant(2);
+ var v0 = app(new glsBuiltinPrecisionTests.Dot(this.m_inputSize), args.b, args.a);
+ var v1 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Mul(), args.b, v0);
+ var v2 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Mul(), v1, two);
+ var v3 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Sub(), args.a, v2);
+ return v3;
+ };
+
+ /**
+ * @constructor
+ * @param {number} size
+ * @extends {glsBuiltinPrecisionTests.DerivedFunc}
+ */
+ glsBuiltinPrecisionTests.Refract = function(size) {
+ var name = glsBuiltinPrecisionTests.sizeToName(size);
+ var sig = new glsBuiltinPrecisionTests.Signature(name, name, name, 'float');
+ glsBuiltinPrecisionTests.DerivedFunc.call(this, sig);
+ this.m_inputSize = size;
+ this.typename = name;
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Refract, glsBuiltinPrecisionTests.DerivedFunc);
+
+ glsBuiltinPrecisionTests.Refract.prototype.getName = function() {
+ return 'refract';
+ };
+
+ glsBuiltinPrecisionTests.Refract.prototype.doExpand = function(ctx, args) {
+ var i = args.a;
+ var n = args.b;
+ var eta = args.c;
+ var zero = new glsBuiltinPrecisionTests.Constant(0);
+ var one = new glsBuiltinPrecisionTests.Constant(1);
+ // dotNI = dot(n, i)
+ var v0 = app(new glsBuiltinPrecisionTests.Dot(this.m_inputSize), n, i);
+ var dotNI = glsBuiltinPrecisionTests.bindExpression('float', 'dotNI', ctx, v0);
+ // k = 1 - eta * eta * (1 - dotNI * dotNI)
+ var v1 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Mul(), dotNI, dotNI);
+ var v2 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Sub(), one, v1);
+ var v3 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Mul(), eta, eta);
+ var v4 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Mul(), v3, v2);
+ var v5 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Sub(), one, v4);
+ var k = glsBuiltinPrecisionTests.bindExpression('float', 'k', ctx, v5);
+
+ // i * eta - n * (eta * dotNI + sqrt(k))
+ var v6 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Mul(), eta, dotNI);
+ var v7 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Sqrt(), k);
+ var v8 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Add(), v6, v7);
+ var v9 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Mul(), n, v8);
+ var v10 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Mul(), i, eta);
+ var v11 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.Sub(), v10, v9);
+
+ var v12 = new glsBuiltinPrecisionTests.ApplyScalar(new glsBuiltinPrecisionTests.LessThan('float'), k, zero);
+
+ var zeroVector = app(new glsBuiltinPrecisionTests.GenVec(this.m_inputSize), zero);
+ var v13 = app(new glsBuiltinPrecisionTests.Cond(this.typename), v12, zeroVector, v11);
+ return v13;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.DerivedFunc}
+ */
+ glsBuiltinPrecisionTests.Radians = function() {
+ var sig = new glsBuiltinPrecisionTests.Signature('float', 'float');
+ glsBuiltinPrecisionTests.DerivedFunc.call(this, sig);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Radians, glsBuiltinPrecisionTests.DerivedFunc);
+
+ glsBuiltinPrecisionTests.Radians.prototype.getName = function() {
+ return 'radians';
+ };
+
+ glsBuiltinPrecisionTests.Radians.prototype.doExpand = function(ctx, args) {
+ var val = app(new glsBuiltinPrecisionTests.Div(),
+ new glsBuiltinPrecisionTests.Constant(Math.PI),
+ new glsBuiltinPrecisionTests.Constant(180));
+ return new glsBuiltinPrecisionTests.Apply('float',
+ new glsBuiltinPrecisionTests.Mul(),
+ val,
+ args.a);
+
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.DerivedFunc}
+ */
+ glsBuiltinPrecisionTests.Degrees = function() {
+ var sig = new glsBuiltinPrecisionTests.Signature('float', 'float');
+ glsBuiltinPrecisionTests.DerivedFunc.call(this, sig);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Degrees, glsBuiltinPrecisionTests.DerivedFunc);
+
+ glsBuiltinPrecisionTests.Degrees.prototype.getName = function() {
+ return 'degrees';
+ };
+
+ glsBuiltinPrecisionTests.Degrees.prototype.doExpand = function(ctx, args) {
+ var val = app(new glsBuiltinPrecisionTests.Div(),
+ new glsBuiltinPrecisionTests.Constant(180),
+ new glsBuiltinPrecisionTests.Constant(Math.PI));
+ return new glsBuiltinPrecisionTests.Apply('float',
+ new glsBuiltinPrecisionTests.Mul(),
+ val,
+ args.a);
+
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.DerivedFunc}
+ */
+ glsBuiltinPrecisionTests.Sinh = function() {
+ var sig = new glsBuiltinPrecisionTests.Signature('float', 'float');
+ glsBuiltinPrecisionTests.DerivedFunc.call(this, sig);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Sinh, glsBuiltinPrecisionTests.DerivedFunc);
+
+ glsBuiltinPrecisionTests.Sinh.prototype.getName = function() {
+ return 'sinh';
+ };
+
+ glsBuiltinPrecisionTests.Sinh.prototype.doExpand = function(ctx, args) {
+ // (exp(x) - exp(-x)) / constant(2.0f)
+ var x = args.a;
+ var v0 = app(new glsBuiltinPrecisionTests.Exp(), x);
+ var v1 = app(new glsBuiltinPrecisionTests.Negate(), x);
+ var v2 = app(new glsBuiltinPrecisionTests.Exp(), v1);
+ var v3 = app(new glsBuiltinPrecisionTests.Sub(), v0, v2);
+ var v4 = new glsBuiltinPrecisionTests.Constant(2);
+ var v5 = new glsBuiltinPrecisionTests.Apply('float', new glsBuiltinPrecisionTests.Div, v3, v4);
+ return v5;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.DerivedFunc}
+ */
+ glsBuiltinPrecisionTests.Cosh = function() {
+ var sig = new glsBuiltinPrecisionTests.Signature('float', 'float');
+ glsBuiltinPrecisionTests.DerivedFunc.call(this, sig);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Cosh, glsBuiltinPrecisionTests.DerivedFunc);
+
+ glsBuiltinPrecisionTests.Cosh.prototype.getName = function() {
+ return 'cosh';
+ };
+
+ glsBuiltinPrecisionTests.Cosh.prototype.doExpand = function(ctx, args) {
+ // (exp(x) + exp(-x)) / constant(2.0f)
+ var x = args.a;
+ var v0 = app(new glsBuiltinPrecisionTests.Exp(), x);
+ var v1 = app(new glsBuiltinPrecisionTests.Negate(), x);
+ var v2 = app(new glsBuiltinPrecisionTests.Exp(), v1);
+ var v3 = app(new glsBuiltinPrecisionTests.Add(), v0, v2);
+ var v4 = new glsBuiltinPrecisionTests.Constant(2);
+ var v5 = new glsBuiltinPrecisionTests.Apply('float', new glsBuiltinPrecisionTests.Div, v3, v4);
+ return v5;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.DerivedFunc}
+ */
+ glsBuiltinPrecisionTests.Tanh = function() {
+ var sig = new glsBuiltinPrecisionTests.Signature('float', 'float');
+ glsBuiltinPrecisionTests.DerivedFunc.call(this, sig);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Tanh, glsBuiltinPrecisionTests.DerivedFunc);
+
+ glsBuiltinPrecisionTests.Tanh.prototype.getName = function() {
+ return 'tanh';
+ };
+
+ glsBuiltinPrecisionTests.Tanh.prototype.doExpand = function(ctx, args) {
+ // sinh(x) / cosh(x)
+ var x = args.a;
+ var v0 = app(new glsBuiltinPrecisionTests.Sinh(), x);
+ var v1 = app(new glsBuiltinPrecisionTests.Cosh(), x);
+ var v2 = new glsBuiltinPrecisionTests.Apply('float', new glsBuiltinPrecisionTests.Div, v0, v1);
+ return v2;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.DerivedFunc}
+ */
+ glsBuiltinPrecisionTests.ASinh = function() {
+ var sig = new glsBuiltinPrecisionTests.Signature('float', 'float');
+ glsBuiltinPrecisionTests.DerivedFunc.call(this, sig);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.ASinh, glsBuiltinPrecisionTests.DerivedFunc);
+
+ glsBuiltinPrecisionTests.ASinh.prototype.getName = function() {
+ return 'asinh';
+ };
+
+ glsBuiltinPrecisionTests.ASinh.prototype.doExpand = function(ctx, args) {
+ // log(x + sqrt(x * x + constant(1.0f)))
+ var x = args.a;
+ var v0 = app(new glsBuiltinPrecisionTests.Mul(), x, x);
+ var v1 = new glsBuiltinPrecisionTests.Constant(1);
+ var v2 = app(new glsBuiltinPrecisionTests.Add(), v0, v1);
+ var v3 = app(new glsBuiltinPrecisionTests.Sqrt(), v2);
+ var v4 = app(new glsBuiltinPrecisionTests.Add(), x, v3);
+ var v5 = app(new glsBuiltinPrecisionTests.Log(), v4);
+ return v5;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.DerivedFunc}
+ */
+ glsBuiltinPrecisionTests.ACosh = function() {
+ var sig = new glsBuiltinPrecisionTests.Signature('float', 'float');
+ glsBuiltinPrecisionTests.DerivedFunc.call(this, sig);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.ACosh, glsBuiltinPrecisionTests.DerivedFunc);
+
+ glsBuiltinPrecisionTests.ACosh.prototype.getName = function() {
+ return 'acosh';
+ };
+
+ glsBuiltinPrecisionTests.ACosh.prototype.doExpand = function(ctx, args) {
+ // log(x + sqrt((x + constant(1.0f)) * (x - constant(1.0f))))
+ var x = args.a;
+ var one = new glsBuiltinPrecisionTests.Constant(1);
+ var v0 = app(new glsBuiltinPrecisionTests.Add(), x, one);
+ var v1 = app(new glsBuiltinPrecisionTests.Sub(), x, one);
+ var v2 = app(new glsBuiltinPrecisionTests.Mul(), v0, v1);
+ var v3 = app(new glsBuiltinPrecisionTests.Sqrt(), v2);
+ var v4 = app(new glsBuiltinPrecisionTests.Add(), x, v3);
+ var v5 = app(new glsBuiltinPrecisionTests.Log(), v4);
+ return v5;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.DerivedFunc}
+ */
+ glsBuiltinPrecisionTests.ATanh = function() {
+ var sig = new glsBuiltinPrecisionTests.Signature('float', 'float');
+ glsBuiltinPrecisionTests.DerivedFunc.call(this, sig);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.ATanh, glsBuiltinPrecisionTests.DerivedFunc);
+
+ glsBuiltinPrecisionTests.ATanh.prototype.getName = function() {
+ return 'atanh';
+ };
+
+ glsBuiltinPrecisionTests.ATanh.prototype.doExpand = function(ctx, args) {
+ // constant(0.5f) * log((constant(1.0f) + x) / (constant(1.0f) - x))
+ var x = args.a;
+ var one = new glsBuiltinPrecisionTests.Constant(1);
+ var half = new glsBuiltinPrecisionTests.Constant(0.5);
+ var v0 = app(new glsBuiltinPrecisionTests.Add(), one, x);
+ var v1 = app(new glsBuiltinPrecisionTests.Sub(), one, x);
+ var v2 = app(new glsBuiltinPrecisionTests.Div(), v0, v1);
+ var v3 = app(new glsBuiltinPrecisionTests.Log(), v2);
+ var v4 = app(new glsBuiltinPrecisionTests.Mul(), half, v3);
+ return v4;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.DerivedFunc}
+ */
+ glsBuiltinPrecisionTests.Sqrt = function() {
+ var sig = new glsBuiltinPrecisionTests.Signature('float', 'float');
+ glsBuiltinPrecisionTests.DerivedFunc.call(this, sig);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Sqrt, glsBuiltinPrecisionTests.DerivedFunc);
+
+ glsBuiltinPrecisionTests.Sqrt.prototype.getName = function() {
+ return 'sqrt';
+ };
+
+ glsBuiltinPrecisionTests.Sqrt.prototype.doExpand = function(ctx, args) {
+ // constant(1.0f) / app<InverseSqrt>(x)
+ var x = args.a;
+ var one = new glsBuiltinPrecisionTests.Constant(1);
+ var v0 = app(new glsBuiltinPrecisionTests.InverseSqrt(), x);
+ var v1 = app(new glsBuiltinPrecisionTests.Div(), one, v0);
+ return v1;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.DerivedFunc}
+ */
+ glsBuiltinPrecisionTests.Fract = function() {
+ var sig = new glsBuiltinPrecisionTests.Signature('float', 'float');
+ glsBuiltinPrecisionTests.DerivedFunc.call(this, sig);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Fract, glsBuiltinPrecisionTests.DerivedFunc);
+
+ glsBuiltinPrecisionTests.Fract.prototype.getName = function() {
+ return 'fract';
+ };
+
+ glsBuiltinPrecisionTests.Fract.prototype.doExpand = function(ctx, args) {
+ // x - floor(x)
+ var x = args.a;
+ var v0 = app(new glsBuiltinPrecisionTests.Floor(), x);
+ var v1 = app(new glsBuiltinPrecisionTests.Sub(), x, v0);
+ return v1;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.DerivedFunc}
+ */
+ glsBuiltinPrecisionTests.Mod = function() {
+ var sig = new glsBuiltinPrecisionTests.Signature('float', 'float', 'float');
+ glsBuiltinPrecisionTests.DerivedFunc.call(this, sig);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Mod, glsBuiltinPrecisionTests.DerivedFunc);
+
+ glsBuiltinPrecisionTests.Mod.prototype.getName = function() {
+ return 'mod';
+ };
+
+ glsBuiltinPrecisionTests.Mod.prototype.doExpand = function(ctx, args) {
+ // x - y * floor(x/y)
+ var x = args.a;
+ var y = args.b;
+ var v0 = app(new glsBuiltinPrecisionTests.Div(), x, y);
+ var v1 = app(new glsBuiltinPrecisionTests.Floor(), v0);
+ var v2 = app(new glsBuiltinPrecisionTests.Mul(), y, v1);
+ var v3 = app(new glsBuiltinPrecisionTests.Sub(), x, v2);
+ return v3;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.PrimitiveFunc}
+ */
+ glsBuiltinPrecisionTests.Modf = function() {
+ var sig = new glsBuiltinPrecisionTests.Signature('float', 'float', 'float');
+ glsBuiltinPrecisionTests.PrimitiveFunc.call(this, sig);
+ };
+ setParentClass(glsBuiltinPrecisionTests.Modf, glsBuiltinPrecisionTests.PrimitiveFunc);
+
+ glsBuiltinPrecisionTests.Modf.prototype.getName = function() {
+ return 'modf';
+ };
+
+ glsBuiltinPrecisionTests.Modf.prototype.doApply = function(ctx, iargs, variablenames) {
+ var intPart;
+ var func1 = function(x) {
+ intPart = Math.trunc(x);
+ return x - intPart;
+ };
+ var func2 = function(x) {
+ return Math.trunc(x);
+ };
+
+ var fracIV = tcuInterval.applyMonotone1p(func1, iargs.a);
+ var wholeIV = tcuInterval.applyMonotone1p(func2, iargs.a);
+
+ if (!iargs.a.isFinite()) {
+ // Behavior on modf(Inf) not well-defined, allow anything as a fractional part
+ // See Khronos bug 13907
+ fracIV.operatorOrAssignBinary(tcuInterval.NAN);
+ }
+
+ ctx.env.m_map[variablenames[1]] = wholeIV;
+ return fracIV;
+ };
+
+ glsBuiltinPrecisionTests.Modf.prototype.getOutParamIndex = function() {
+ return 1;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.DerivedFunc}
+ */
+ glsBuiltinPrecisionTests.Mix = function() {
+ var sig = new glsBuiltinPrecisionTests.Signature('float', 'float', 'float', 'float');
+ glsBuiltinPrecisionTests.DerivedFunc.call(this, sig);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Mix, glsBuiltinPrecisionTests.DerivedFunc);
+
+ glsBuiltinPrecisionTests.Mix.prototype.getName = function() {
+ return 'mix';
+ };
+
+ glsBuiltinPrecisionTests.Mix.prototype.operation1 = function(ctx, args) {
+ // (x * (constant(1.0f) - a)) + y * a
+ var x = args.a;
+ var y = args.b;
+ var a = args.c;
+ var one = new glsBuiltinPrecisionTests.Constant(1);
+ var v0 = app(new glsBuiltinPrecisionTests.Sub(), one, a);
+ var v1 = app(new glsBuiltinPrecisionTests.Mul(), x, v0);
+ var v2 = app(new glsBuiltinPrecisionTests.Mul(), y, a);
+ var v3 = app(new glsBuiltinPrecisionTests.Add(), v1, v2);
+ return v3;
+ };
+
+ glsBuiltinPrecisionTests.Mix.prototype.operation2 = function(ctx, args) {
+ // x + (y - x) * a
+ var x = args.a;
+ var y = args.b;
+ var a = args.c;
+ var v0 = app(new glsBuiltinPrecisionTests.Sub(), y, x);
+ var v1 = app(new glsBuiltinPrecisionTests.Mul(), a, v0);
+ var v2 = app(new glsBuiltinPrecisionTests.Add(), x, v1);
+ return v2;
+ };
+
+ glsBuiltinPrecisionTests.Mix.prototype.doExpand = function(ctx, args){
+ return app(new glsBuiltinPrecisionTests.Alternatives(this.Sig), this.operation1(ctx, args), this.operation2(ctx, args), new glsBuiltinPrecisionTests.Void(), new glsBuiltinPrecisionTests.Void());
+ }
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.DerivedFunc}
+ */
+ glsBuiltinPrecisionTests.SmoothStep = function() {
+ var sig = new glsBuiltinPrecisionTests.Signature('float', 'float', 'float', 'float');
+ glsBuiltinPrecisionTests.DerivedFunc.call(this, sig);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.SmoothStep, glsBuiltinPrecisionTests.DerivedFunc);
+
+ glsBuiltinPrecisionTests.SmoothStep.prototype.getName = function() {
+ return 'smoothstep';
+ };
+
+ glsBuiltinPrecisionTests.SmoothStep.prototype.doExpand = function(ctx, args) {
+ var edge0 = args.a;
+ var edge1 = args.b;
+ var x = args.c;
+ var zero = new glsBuiltinPrecisionTests.Constant(0);
+ var one = new glsBuiltinPrecisionTests.Constant(1);
+ //clamp((x - edge0) / (edge1 - edge0), constant(0.0f), constant(1.0f));
+ var v0 = app(new glsBuiltinPrecisionTests.Sub(), x, edge0);
+ var v1 = app(new glsBuiltinPrecisionTests.Sub(), edge1, edge0);
+ var v2 = app(new glsBuiltinPrecisionTests.Div(), v0, v1);
+ var v3 = app(new glsBuiltinPrecisionTests.Clamp(), v2, zero, one);
+ var t = glsBuiltinPrecisionTests.bindExpression('float', 't', ctx, v3);
+ //(t * t * (constant(3.0f) - constant(2.0f) * t))
+ var two = new glsBuiltinPrecisionTests.Constant(2);
+ var three = new glsBuiltinPrecisionTests.Constant(3);
+ var v4 = app(new glsBuiltinPrecisionTests.Mul(), v3, v3);
+ var v5 = app(new glsBuiltinPrecisionTests.Mul(), two, v3);
+ var v6 = app(new glsBuiltinPrecisionTests.Sub(), three, v5);
+ var v7 = app(new glsBuiltinPrecisionTests.Mul(), v4, v6);
+ return v7;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.DerivedFunc}
+ */
+ glsBuiltinPrecisionTests.Pow = function() {
+ var sig = new glsBuiltinPrecisionTests.Signature('float', 'float', 'float');
+ glsBuiltinPrecisionTests.DerivedFunc.call(this, sig);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Pow, glsBuiltinPrecisionTests.DerivedFunc);
+
+ glsBuiltinPrecisionTests.Pow.prototype.getName = function() {
+ return 'pow';
+ };
+
+ glsBuiltinPrecisionTests.Pow.prototype.doExpand = function(ctx, args) {
+ // exp2(y * log2(x))
+ var x = args.a;
+ var y = args.b;
+ var v0 = app(new glsBuiltinPrecisionTests.Log2(), x);
+ var v1 = app(new glsBuiltinPrecisionTests.Mul(), y, v0);
+ var v2 = app(new glsBuiltinPrecisionTests.Exp2(), v1);
+ return v2;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.CFloatFunc1}
+ */
+ glsBuiltinPrecisionTests.ExpFunc = function(name, func) {
+ glsBuiltinPrecisionTests.CFloatFunc1.call(this, name, func);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.ExpFunc, glsBuiltinPrecisionTests.CFloatFunc1);
+
+ glsBuiltinPrecisionTests.ExpFunc.prototype.getCodomain = function() {
+ return tcuInterval.withNumbers(0, Infinity);
+ };
+
+ glsBuiltinPrecisionTests.ExpFunc.prototype.precision = function(ctx, ret, x) {
+ switch (ctx.floatPrecision) {
+ case gluShaderUtil.precision.PRECISION_HIGHP:
+ return ctx.format.ulp(ret, 3.0 + 2.0 * Math.abs(x));
+ case gluShaderUtil.precision.PRECISION_MEDIUMP:
+ return ctx.format.ulp(ret, 2.0 + 2.0 * Math.abs(x));
+ case gluShaderUtil.precision.PRECISION_LOWP:
+ return ctx.format.ulp(ret, 2.0);
+ default:
+ throw new Error(!'Impossible');
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.ExpFunc}
+ */
+ glsBuiltinPrecisionTests.Exp = function() {
+ glsBuiltinPrecisionTests.ExpFunc.call(this, 'exp', Math.exp);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Exp, glsBuiltinPrecisionTests.ExpFunc);
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.ExpFunc}
+ */
+ glsBuiltinPrecisionTests.Exp2 = function() {
+ /**
+ * @param {number} x
+ * @return {number}
+ */
+ var exp2 = function(x) {
+ return Math.exp(x * Math.LN2);
+ };
+ glsBuiltinPrecisionTests.ExpFunc.call(this, 'exp2', exp2);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Exp2, glsBuiltinPrecisionTests.ExpFunc);
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.CFloatFunc1}
+ */
+ glsBuiltinPrecisionTests.LogFunc = function(name, func) {
+ glsBuiltinPrecisionTests.CFloatFunc1.call(this, name, func);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.LogFunc, glsBuiltinPrecisionTests.CFloatFunc1);
+
+ glsBuiltinPrecisionTests.LogFunc.prototype.precision = function(ctx, ret, x) {
+ if (x <= 0)
+ return NaN;
+ switch (ctx.floatPrecision) {
+ case gluShaderUtil.precision.PRECISION_HIGHP:
+ return (0.5 <= x && x <= 2.0) ? deMath.deLdExp(1.0, -21) : ctx.format.ulp(ret, 3.0);
+ case gluShaderUtil.precision.PRECISION_MEDIUMP:
+ return (0.5 <= x && x <= 2.0) ? deMath.deLdExp(1.0, -7) : ctx.format.ulp(ret, 2.0);
+ case gluShaderUtil.precision.PRECISION_LOWP:
+ return ctx.format.ulp(ret, 2.0);
+ default:
+ throw new Error(!'Impossible');
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.LogFunc}
+ */
+ glsBuiltinPrecisionTests.Log = function() {
+ glsBuiltinPrecisionTests.LogFunc.call(this, 'log', Math.log);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Log, glsBuiltinPrecisionTests.LogFunc);
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.LogFunc}
+ */
+ glsBuiltinPrecisionTests.Log2 = function() {
+ glsBuiltinPrecisionTests.LogFunc.call(this, 'log2', Math.log2);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Log2, glsBuiltinPrecisionTests.LogFunc);
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.CFloatFunc1}
+ */
+ glsBuiltinPrecisionTests.PreciseFunc1 = function(name, func) {
+ glsBuiltinPrecisionTests.CFloatFunc1.call(this, name, func);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.PreciseFunc1, glsBuiltinPrecisionTests.CFloatFunc1);
+
+ glsBuiltinPrecisionTests.PreciseFunc1.prototype.precision = function(ctx, ret, x) {
+ return 0;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.PreciseFunc1}
+ */
+ glsBuiltinPrecisionTests.Abs = function() {
+ glsBuiltinPrecisionTests.PreciseFunc1.call(this, 'abs', Math.abs);
+ };
+ setParentClass(glsBuiltinPrecisionTests.Abs, glsBuiltinPrecisionTests.PreciseFunc1);
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.PreciseFunc1}
+ */
+ glsBuiltinPrecisionTests.Sign = function() {
+ glsBuiltinPrecisionTests.PreciseFunc1.call(this, 'sign', Math.sign);
+ };
+ setParentClass(glsBuiltinPrecisionTests.Sign, glsBuiltinPrecisionTests.PreciseFunc1);
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.PreciseFunc1}
+ */
+ glsBuiltinPrecisionTests.Floor = function() {
+ glsBuiltinPrecisionTests.PreciseFunc1.call(this, 'floor', Math.floor);
+ };
+ setParentClass(glsBuiltinPrecisionTests.Floor, glsBuiltinPrecisionTests.PreciseFunc1);
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.PreciseFunc1}
+ */
+ glsBuiltinPrecisionTests.RoundEven = function() {
+ glsBuiltinPrecisionTests.PreciseFunc1.call(this, 'roundEven', deMath.rint);
+ };
+ setParentClass(glsBuiltinPrecisionTests.RoundEven, glsBuiltinPrecisionTests.PreciseFunc1);
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.PreciseFunc1}
+ */
+ glsBuiltinPrecisionTests.Ceil = function() {
+ glsBuiltinPrecisionTests.PreciseFunc1.call(this, 'ceil', Math.ceil);
+ };
+ setParentClass(glsBuiltinPrecisionTests.Ceil, glsBuiltinPrecisionTests.PreciseFunc1);
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.PreciseFunc1}
+ */
+ glsBuiltinPrecisionTests.Trunc = function() {
+ glsBuiltinPrecisionTests.PreciseFunc1.call(this, 'trunc', Math.trunc);
+ };
+ setParentClass(glsBuiltinPrecisionTests.Trunc, glsBuiltinPrecisionTests.PreciseFunc1);
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.CFloatFunc2}
+ */
+ glsBuiltinPrecisionTests.PreciseFunc2 = function(name, func) {
+ glsBuiltinPrecisionTests.CFloatFunc2.call(this, name, func);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.PreciseFunc2, glsBuiltinPrecisionTests.CFloatFunc2);
+
+ glsBuiltinPrecisionTests.PreciseFunc2.prototype.precision = function(ctx, ret, x, y) {
+ return 0;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.PreciseFunc2}
+ */
+ glsBuiltinPrecisionTests.Min = function() {
+ glsBuiltinPrecisionTests.PreciseFunc2.call(this, 'min', Math.min);
+ };
+ setParentClass(glsBuiltinPrecisionTests.Min, glsBuiltinPrecisionTests.PreciseFunc2);
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.PreciseFunc2}
+ */
+ glsBuiltinPrecisionTests.Max = function() {
+ glsBuiltinPrecisionTests.PreciseFunc2.call(this, 'max', Math.max);
+ };
+ setParentClass(glsBuiltinPrecisionTests.Max, glsBuiltinPrecisionTests.PreciseFunc2);
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.PreciseFunc2}
+ */
+ glsBuiltinPrecisionTests.Step = function() {
+ /**
+ * @param {number} edge
+ * @param {number} x
+ * return number
+ */
+ var step = function(edge, x) {
+ return x < edge ? 0.0 : 1.0;
+ };
+ glsBuiltinPrecisionTests.PreciseFunc2.call(this, 'step', step);
+ };
+ setParentClass(glsBuiltinPrecisionTests.Step, glsBuiltinPrecisionTests.PreciseFunc2);
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.CFloatFunc1}
+ */
+ glsBuiltinPrecisionTests.TrigFunc = function(name, func, loEx, hiEx) {
+ glsBuiltinPrecisionTests.CFloatFunc1.call(this, name, func);
+ this.m_loExtremum = loEx;
+ this.m_hiExtremum = hiEx;
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.TrigFunc, glsBuiltinPrecisionTests.CFloatFunc1);
+
+ glsBuiltinPrecisionTests.TrigFunc.prototype.innerExtrema = function(ctx, angle) {
+ var lo = angle.lo();
+ var hi = angle.hi();
+ var loSlope = this.doGetSlope(lo);
+ var hiSlope = this.doGetSlope(hi);
+
+ // Detect the high and low values the function can take between the
+ // interval endpoints.
+ if (angle.length() >= 2.0 * Math.PI) {
+ // The interval is longer than a full cycle, so it must get all possible values.
+ return this.m_hiExtremum.operatorOrBinary(this.m_loExtremum);
+ } else if (loSlope == 1 && hiSlope == -1) {
+ // The slope can change from positive to negative only at the maximum value.
+ return this.m_hiExtremum;
+ } else if (loSlope == -1 && hiSlope == 1) {
+ // The slope can change from negative to positive only at the maximum value.
+ return this.m_loExtremum;
+ } else if (loSlope == hiSlope &&
+ deMath.deSign(this.applyExact(hi) - this.applyExact(lo)) * loSlope == -1) {
+ // The slope has changed twice between the endpoints, so both extrema are included.
+ return this.m_hiExtremum.operatorOrBinary(this.m_loExtremum);
+ }
+
+ return new tcuInterval.Interval();
+ };
+
+ glsBuiltinPrecisionTests.TrigFunc.prototype.getCodomain = function() {
+ // Ensure that result is always within [-1, 1], or NaN (for +-inf)
+ var v = tcuInterval.withIntervals(new tcuInterval.Interval(-1), new tcuInterval.Interval(1));
+ return v.operatorOrBinary(tcuInterval.NAN);
+ };
+
+ glsBuiltinPrecisionTests.TrigFunc.prototype.precision = function(ctx, ret, arg) {
+ if (ctx.floatPrecision == gluShaderUtil.precision.PRECISION_HIGHP) {
+ // Use precision from OpenCL fast relaxed math
+ if (-Math.PI <= arg && arg <= Math.PI) {
+ return deMath.deLdExp(1.0, -11);
+ } else {
+ // "larger otherwise", let's pick |x| * 2^-12 , which is slightly over
+ // 2^-11 at x == pi.
+ return deMath.deLdExp(Math.abs(arg), -12);
+ }
+ } else if (ctx.floatPrecision == gluShaderUtil.precision.PRECISION_MEDIUMP) {
+ if (-Math.PI <= arg && arg <= Math.PI) {
+ // from OpenCL half-float extension specification
+ return ctx.format.ulp(ret, 2.0);
+ } else {
+ // |x| * 2^-10 , slightly larger than 2 ULP at x == pi
+ return deMath.deLdExp(Math.abs(arg), -10);
+ }
+ } else {
+ // from OpenCL half-float extension specification
+ return ctx.format.ulp(ret, 2.0);
+ }
+ };
+
+ /**
+ * @param {number} angle
+ * @return number
+ */
+ glsBuiltinPrecisionTests.TrigFunc.prototype.doGetSlope = function(angle) {
+ throw new Error('Virtual function. Please override.');
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.TrigFunc}
+ */
+ glsBuiltinPrecisionTests.Sin = function() {
+ glsBuiltinPrecisionTests.TrigFunc.call(this, 'sin', Math.sin, new tcuInterval.Interval(-1), new tcuInterval.Interval(1));
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Sin, glsBuiltinPrecisionTests.TrigFunc);
+
+ glsBuiltinPrecisionTests.Sin.prototype.doGetSlope = function(angle) {
+ return deMath.deSign(Math.cos(angle));
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.TrigFunc}
+ */
+ glsBuiltinPrecisionTests.Cos = function() {
+ glsBuiltinPrecisionTests.TrigFunc.call(this, 'cos', Math.cos, new tcuInterval.Interval(-1), new tcuInterval.Interval(1));
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Cos, glsBuiltinPrecisionTests.TrigFunc);
+
+ glsBuiltinPrecisionTests.Cos.prototype.doGetSlope = function(angle) {
+ return -deMath.deSign(Math.sin(angle));
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.DerivedFunc}
+ */
+ glsBuiltinPrecisionTests.Tan = function() {
+ var sig = new glsBuiltinPrecisionTests.Signature('float', 'float');
+ glsBuiltinPrecisionTests.DerivedFunc.call(this, sig);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Tan, glsBuiltinPrecisionTests.DerivedFunc);
+
+ glsBuiltinPrecisionTests.Tan.prototype.getName = function() {
+ return 'tan';
+ };
+
+ glsBuiltinPrecisionTests.Tan.prototype.doExpand = function(ctx, args) {
+ // sin(x) * (constant(1.0f) / cos(x)
+ var x = args.a;
+ var sin = app(new glsBuiltinPrecisionTests.Sin(), x);
+ var cos = app(new glsBuiltinPrecisionTests.Cos(), x);
+ var expr = app(new glsBuiltinPrecisionTests.Div(),
+ new glsBuiltinPrecisionTests.Constant(1),
+ cos);
+
+ expr = new glsBuiltinPrecisionTests.Apply('float', new glsBuiltinPrecisionTests.Mul(),
+ sin,
+ expr);
+ return expr;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.CFloatFunc1}
+ */
+ glsBuiltinPrecisionTests.ASin = function() {
+ glsBuiltinPrecisionTests.CFloatFunc1.call(this, 'asin', Math.asin);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.ASin, glsBuiltinPrecisionTests.CFloatFunc1);
+
+ glsBuiltinPrecisionTests.ASin.prototype.precision = function(ctx, ret, x) {
+ if (!deMath.deInBounds32(x, -1.0, 1.0))
+ return NaN;
+
+ if (ctx.floatPrecision == gluShaderUtil.precision.PRECISION_HIGHP) {
+ // Absolute error of 2^-11
+ return deMath.deLdExp(1.0, -11);
+ } else {
+ // Absolute error of 2^-8
+ return deMath.deLdExp(1.0, -8);
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.CFloatFunc1}
+ */
+ glsBuiltinPrecisionTests.ArcTrigFunc = function(name, func, precisionULPs, domain, coddomain) {
+ glsBuiltinPrecisionTests.CFloatFunc1.call(this, name, func);
+ this.m_precision = precisionULPs;
+ this.m_domain = domain;
+ this.m_codomain = coddomain;
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.ArcTrigFunc, glsBuiltinPrecisionTests.CFloatFunc1);
+
+ glsBuiltinPrecisionTests.ArcTrigFunc.prototype.precision = function(ctx, ret, x) {
+ if (!this.m_domain.contains(new tcuInterval.Interval(x)))
+ return NaN;
+
+ if (ctx.floatPrecision == gluShaderUtil.precision.PRECISION_HIGHP) {
+ // Use OpenCL's precision
+ return ctx.format.ulp(ret, this.m_precision);
+ } else {
+ // Use OpenCL half-float spec
+ return ctx.format.ulp(ret, 2.0);
+ }
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.ArcTrigFunc}
+ */
+ glsBuiltinPrecisionTests.ACos = function() {
+ glsBuiltinPrecisionTests.ArcTrigFunc.call(this, 'acos', Math.acos, 4096.0,
+ tcuInterval.withNumbers(-1, 1),
+ tcuInterval.withNumbers(0, Math.PI));
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.ACos, glsBuiltinPrecisionTests.ArcTrigFunc);
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.ArcTrigFunc}
+ */
+ glsBuiltinPrecisionTests.ATan = function() {
+ glsBuiltinPrecisionTests.ArcTrigFunc.call(this, 'atan', Math.atan, 4096.0,
+ tcuInterval.unbounded(),
+ tcuInterval.withNumbers(-Math.PI * 0.5, Math.PI * 0.5));
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.ATan, glsBuiltinPrecisionTests.ArcTrigFunc);
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.CFloatFunc2}
+ */
+ glsBuiltinPrecisionTests.ATan2 = function() {
+ glsBuiltinPrecisionTests.CFloatFunc2.call(this, 'atan', Math.atan2);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.ATan2, glsBuiltinPrecisionTests.CFloatFunc2);
+
+ glsBuiltinPrecisionTests.ATan2.prototype.innerExtrema = function(ctx, xi, yi) {
+ var ret = new tcuInterval.Interval();
+
+ if (yi.contains(tcuInterval.ZERO)) {
+ if (xi.contains(tcuInterval.ZERO))
+ ret.operatorOrAssignBinary(tcuInterval.NAN);
+ if (xi.intersects(tcuInterval.withNumbers(-Infinity, 0)))
+ ret.operatorOrAssignBinary(tcuInterval.withNumbers(-Math.PI, Math.PI));
+ }
+
+ if (ctx.format.hasInf() != tcuFloatFormat.YesNoMaybe.YES && (!yi.isFinite() || !xi.isFinite())) {
+ // Infinities may not be supported, allow anything, including NaN
+ ret.operatorOrAssignBinary(tcuInterval.NAN);
+ }
+
+ return ret;
+ };
+
+ glsBuiltinPrecisionTests.ATan2.prototype.precision = function(ctx, ret, x, y) {
+ if (ctx.floatPrecision == gluShaderUtil.precision.PRECISION_HIGHP)
+ return ctx.format.ulp(ret, 4096.0);
+ else
+ return ctx.format.ulp(ret, 2.0);
+ };
+
+ /**
+ * @constructor
+ * @param {number} size
+ * @extends {glsBuiltinPrecisionTests.DerivedFunc}
+ */
+ glsBuiltinPrecisionTests.DeterminantBase = function(size) {
+ var sig = new glsBuiltinPrecisionTests.Signature('float', 'mat' + size);
+ glsBuiltinPrecisionTests.DerivedFunc.call(this, sig);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.DeterminantBase, glsBuiltinPrecisionTests.DerivedFunc);
+
+ glsBuiltinPrecisionTests.DeterminantBase.prototype.getName = function() {
+ return 'determinant';
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.DeterminantBase}
+ */
+ glsBuiltinPrecisionTests.Determinant = function() {
+ // TODO: Support sizes 3 and 4
+ this.size = 2;
+ glsBuiltinPrecisionTests.DeterminantBase.call(this, this.size);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Determinant, glsBuiltinPrecisionTests.DeterminantBase);
+
+ glsBuiltinPrecisionTests.Determinant.prototype.doExpand = function(ctx, args) {
+ // mat[0][0] * mat[1][1] - mat[1][0] * mat[0][1]
+ var elem0_0 = new glsBuiltinPrecisionTests.MatrixVariable(args.a, 0, 0);
+ var elem0_1 = new glsBuiltinPrecisionTests.MatrixVariable(args.a, 0, 1);
+ var elem1_0 = new glsBuiltinPrecisionTests.MatrixVariable(args.a, 1, 0);
+ var elem1_1 = new glsBuiltinPrecisionTests.MatrixVariable(args.a, 1, 1);
+
+ var val0 = app(new glsBuiltinPrecisionTests.Mul(), elem0_0, elem1_1);
+ var val1 = app(new glsBuiltinPrecisionTests.Mul(), elem0_1, elem1_0);
+ return new glsBuiltinPrecisionTests.Apply('float', new glsBuiltinPrecisionTests.Sub(), val0, val1);
+ };
+
+ /**
+ * @constructor
+ * @extends {glsBuiltinPrecisionTests.DerivedFunc}
+ */
+ glsBuiltinPrecisionTests.Inverse = function() {
+ this.size = 2;
+ var name = 'mat' + this.size;
+ var sig = new glsBuiltinPrecisionTests.Signature(name, name);
+ glsBuiltinPrecisionTests.DerivedFunc.call(this, sig);
+ };
+
+ setParentClass(glsBuiltinPrecisionTests.Inverse, glsBuiltinPrecisionTests.DerivedFunc);
+
+ glsBuiltinPrecisionTests.Inverse.prototype.getName = function() {
+ return 'inverse';
+ };
+
+ glsBuiltinPrecisionTests.Inverse.prototype.doExpand = function(ctx, args) {
+ var mat = args.a;
+ var v0 = app(new glsBuiltinPrecisionTests.Determinant(), mat);
+ var det = glsBuiltinPrecisionTests.bindExpression('float', 'det', ctx, v0);
+
+ var elem0_0 = new glsBuiltinPrecisionTests.MatrixVariable(args.a, 0, 0);
+ var elem0_1 = new glsBuiltinPrecisionTests.MatrixVariable(args.a, 0, 1);
+ var elem1_0 = new glsBuiltinPrecisionTests.MatrixVariable(args.a, 1, 0);
+ var elem1_1 = new glsBuiltinPrecisionTests.MatrixVariable(args.a, 1, 1);
+
+ var result0_0 = app(new glsBuiltinPrecisionTests.Div(), elem1_1, det);
+ var result0_1 = app(new glsBuiltinPrecisionTests.Div(), elem0_1, det);
+ result0_1 = app(new glsBuiltinPrecisionTests.Negate(), result0_1);
+ var result1_0 = app(new glsBuiltinPrecisionTests.Div(), elem1_0, det);
+ result1_0 = app(new glsBuiltinPrecisionTests.Negate(), result1_0);
+ var result1_1 = app(new glsBuiltinPrecisionTests.Div(), elem0_0, det);
+
+ var col0 = app(new glsBuiltinPrecisionTests.GenVec(this.size, true), result0_0, result1_0);
+ var col1 = app(new glsBuiltinPrecisionTests.GenVec(this.size, true), result0_1, result1_1);
+ var ret = app(new glsBuiltinPrecisionTests.GenMat(this.size, this.size), col0, col1);
+
+ return ret;
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.PrecisionTestContext} ctx
+ * @param {glsBuiltinPrecisionTests.CaseFactory} factory
+ * @return {tcuTestCase.DeqpTest}
+ */
+ glsBuiltinPrecisionTests.createFuncGroup = function(ctx, factory) {
+ /** @type {tcuTestCase.DeqpTest} */ var group = tcuTestCase.newTest(factory.getName(), factory.getDesc());
+
+ for (var precNdx in gluShaderUtil.precision) {
+ /** @type {gluShaderUtil.precision} */ var precision = gluShaderUtil.precision[precNdx];
+ /** @type {string} */ var precName = gluShaderUtil.getPrecisionName(precision);
+ /** @type {tcuFloatFormat.FloatFormat} */ var fmt = ctx.formats[precision];
+ /** @type {tcuFloatFormat.FloatFormat} */ var highpFmt = ctx.formats[gluShaderUtil.precision.PRECISION_HIGHP];
+
+ for (var shaderNdx in ctx.shaderTypes) {
+ /** @type {gluShaderProgram.shaderType} */ var shaderType = ctx.shaderTypes[shaderNdx];
+ /** @type {string} */ var shaderName = gluShaderProgram.getShaderTypeName(shaderType);
+ /** @type {string} */ var name = precName + '_' + shaderName;
+ /** @type {glsBuiltinPrecisionTests.Context} */ var caseCtx = new glsBuiltinPrecisionTests.Context(name, fmt, highpFmt,
+ precision, shaderType, ctx.numRandoms);
+
+ group.addChild(factory.createCase(caseCtx));
+ }
+ }
+
+ return group;
+ };
+
+ /**
+ * @param {glsBuiltinPrecisionTests.CaseFactories} cases
+ * @param {Array<gluShaderProgram.shaderType>} shaderTypes
+ * @param {tcuTestCase.DeqpTest} dstGroup
+ */
+ glsBuiltinPrecisionTests.addBuiltinPrecisionTests = function(cases, shaderTypes, dstGroup) {
+ /** @type {tcuFloatFormat.FloatFormat} */ var highp = new tcuFloatFormat.FloatFormat(-126, 127, 23, true,
+ tcuFloatFormat.YesNoMaybe.MAYBE, // subnormals
+ tcuFloatFormat.YesNoMaybe.YES, // infinities
+ tcuFloatFormat.YesNoMaybe.MAYBE); // NaN
+ // \todo [2014-04-01 lauri] Check these once Khronos bug 11840 is resolved.
+ /** @type {tcuFloatFormat.FloatFormat} */ var mediump = new tcuFloatFormat.FloatFormat(-13, 13, 9, false);
+ // A fixed-point format is just a floating point format with a fixed
+ // exponent and support for subnormals.
+ /** @type {tcuFloatFormat.FloatFormat} */ var lowp = new tcuFloatFormat.FloatFormat(0, 0, 7, false, tcuFloatFormat.YesNoMaybe.YES);
+ /** @type {glsBuiltinPrecisionTests.PrecisionTestContext} */ var ctx = new glsBuiltinPrecisionTests.PrecisionTestContext(highp, mediump, lowp,
+ shaderTypes, 16384);
+
+ for (var ndx = 0; ndx < cases.getFactories().length; ++ndx)
+ dstGroup.addChild(glsBuiltinPrecisionTests.createFuncGroup(ctx, cases.getFactories()[ndx]));
+ };
+
+ /**
+ * @param {function(new:glsBuiltinPrecisionTests.Func)} F
+ * @param {glsBuiltinPrecisionTests.CaseFactories} funcs
+ * @param {string=} name
+ */
+ glsBuiltinPrecisionTests.addScalarFactory = function(F, funcs, name) {
+ if (name === undefined)
+ name = (new F()).getName();
+
+ funcs.addFactory(new glsBuiltinPrecisionTests.GenFuncCaseFactory(glsBuiltinPrecisionTests.makeVectorizedFuncs(F), name));
+ };
+
+ /**
+ * @param {function(new:glsBuiltinPrecisionTests.Func)} F
+ */
+ glsBuiltinPrecisionTests.createSimpleFuncCaseFactory = function(F) {
+ return new glsBuiltinPrecisionTests.SimpleFuncCaseFactory(new F());
+ };
+
+ /**
+ * @param {number} caseId test case Id
+ * @return {glsBuiltinPrecisionTests.CaseFactories}
+ */
+ glsBuiltinPrecisionTests.createES3BuiltinCases = function(caseId) {
+ /** @type {glsBuiltinPrecisionTests.CaseFactories} */ var funcs = new glsBuiltinPrecisionTests.BuiltinFuncs();
+
+ switch (caseId) {
+ case 0: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Add, funcs); break;
+ case 1: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Sub, funcs); break;
+ case 2: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Mul, funcs); break;
+ case 3: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Div, funcs); break;
+ case 4: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Radians, funcs); break;
+ case 5: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Degrees, funcs); break;
+ case 6: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Sin, funcs); break;
+ case 7: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Cos, funcs); break;
+ case 8: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Tan, funcs); break;
+ case 9: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.ASin, funcs); break;
+ case 10: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.ACos, funcs); break;
+ case 11: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.ATan, funcs); break;
+ case 12: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.ATan2, funcs, 'atan2'); break;
+ case 13: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Sinh, funcs); break;
+ case 14: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Cosh, funcs); break;
+ case 15: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Tanh, funcs); break;
+ case 16: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.ASinh, funcs); break;
+ case 17: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.ACosh, funcs); break;
+ case 18: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.ATanh, funcs); break;
+ case 19: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Pow, funcs); break;
+ case 20: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Exp, funcs); break;
+ case 21: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Exp2, funcs); break;
+ case 22: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Log, funcs); break;
+ case 23: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Log2, funcs); break;
+ case 24: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Sqrt, funcs); break;
+ case 25: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.InverseSqrt, funcs); break;
+ case 26: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Abs, funcs); break;
+ case 27: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Sign, funcs); break;
+ case 28: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Floor, funcs); break;
+ case 29: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Trunc, funcs); break;
+ case 30: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Round, funcs); break;
+ case 31: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.RoundEven, funcs); break;
+ case 32: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Ceil, funcs); break;
+ case 33: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Fract, funcs); break;
+ case 34: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Mod, funcs); break;
+ case 35: funcs.addFactory(glsBuiltinPrecisionTests.createSimpleFuncCaseFactory(glsBuiltinPrecisionTests.Modf)); break;
+ case 36: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Min, funcs); break;
+ case 37: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Max, funcs); break;
+ case 38: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Mix, funcs); break;
+ case 39: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Step, funcs); break;
+ case 40: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.SmoothStep, funcs); break;
+ case 41: glsBuiltinPrecisionTests.addScalarFactory(glsBuiltinPrecisionTests.Clamp, funcs); break;
+ case 42: funcs.addFactory(new glsBuiltinPrecisionTests.TemplateFuncCaseFactory(glsBuiltinPrecisionTests.Length)); break;
+ case 43: funcs.addFactory(new glsBuiltinPrecisionTests.TemplateFuncCaseFactory(glsBuiltinPrecisionTests.Distance)); break;
+ case 44: funcs.addFactory(new glsBuiltinPrecisionTests.TemplateFuncCaseFactory(glsBuiltinPrecisionTests.Dot)); break;
+ case 45: funcs.addFactory(glsBuiltinPrecisionTests.createSimpleFuncCaseFactory(glsBuiltinPrecisionTests.Cross)); break;
+ case 46: funcs.addFactory(new glsBuiltinPrecisionTests.TemplateFuncCaseFactory(glsBuiltinPrecisionTests.Normalize)); break;
+ case 47: funcs.addFactory(new glsBuiltinPrecisionTests.TemplateFuncCaseFactory(glsBuiltinPrecisionTests.FaceForward)); break;
+ case 48: funcs.addFactory(new glsBuiltinPrecisionTests.TemplateFuncCaseFactory(glsBuiltinPrecisionTests.Reflect)); break;
+ case 49: funcs.addFactory(new glsBuiltinPrecisionTests.TemplateFuncCaseFactory(glsBuiltinPrecisionTests.Refract)); break;
+ case 50: funcs.addFactory(new glsBuiltinPrecisionTests.MatrixFuncCaseFactory(glsBuiltinPrecisionTests.MatrixCompMult)); break;
+ case 51: funcs.addFactory(new glsBuiltinPrecisionTests.MatrixFuncCaseFactory(glsBuiltinPrecisionTests.OuterProduct)); break;
+ case 52: funcs.addFactory(new glsBuiltinPrecisionTests.MatrixFuncCaseFactory(glsBuiltinPrecisionTests.Transpose)); break;
+ case 53: funcs.addFactory(new glsBuiltinPrecisionTests.SquareMatrixFuncCaseFactory(glsBuiltinPrecisionTests.Determinant)); break;
+ case 54: funcs.addFactory(new glsBuiltinPrecisionTests.SquareMatrixFuncCaseFactory(glsBuiltinPrecisionTests.Inverse)); break;
+ default: break;
+ }
+
+ return funcs;
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsBuiltinPrecisionTestsUnitTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsBuiltinPrecisionTestsUnitTests.js
new file mode 100644
index 0000000000..e8df9d28e3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsBuiltinPrecisionTestsUnitTests.js
@@ -0,0 +1,2819 @@
+'use strict';
+goog.provide('modules.shared.glsBuiltinPrecisionTestsUnitTests');
+goog.require('framework.common.tcuInterval');
+goog.require('framework.common.tcuMatrix');
+
+goog.scope(function() {
+
+ modules.shared.glsBuiltinPrecisionTestsUnitTests.cppreference = [];
+ var tcuInterval = framework.common.tcuInterval;
+ var glsBuiltinPrecisionTestsUnitTests = modules.shared.glsBuiltinPrecisionTestsUnitTests;
+ var tcuMatrix = framework.common.tcuMatrix;
+
+ var ref = modules.shared.glsBuiltinPrecisionTestsUnitTests.cppreference;
+ref.push({testName: 'precision.add.lowp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.390625, 0.40625]});
+ref.push({testName: 'precision.add.lowp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.695313, 0.703125]});
+ref.push({testName: 'precision.add.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.390625, 0.40625, false, 0.390625, 0.40625]});
+ref.push({testName: 'precision.add.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.695313, 0.703125, false, 0.695313, 0.703125]});
+ref.push({testName: 'precision.add.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.390625, 0.40625, false, 0.390625, 0.40625, false, 0.390625, 0.40625]});
+ref.push({testName: 'precision.add.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.695313, 0.703125, false, 0.695313, 0.703125, false, 0.695313, 0.703125]});
+ref.push({testName: 'precision.add.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.390625, 0.40625, false, 0.390625, 0.40625, false, 0.390625, 0.40625, false, 0.390625, 0.40625]});
+ref.push({testName: 'precision.add.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.695313, 0.703125, false, 0.695313, 0.703125, false, 0.695313, 0.703125, false, 0.695313, 0.703125]});
+ref.push({testName: 'precision.add.lowp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.390625, 0.40625]});
+ref.push({testName: 'precision.add.lowp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.695313, 0.703125]});
+ref.push({testName: 'precision.add.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.390625, 0.40625, false, 0.390625, 0.40625]});
+ref.push({testName: 'precision.add.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.695313, 0.703125, false, 0.695313, 0.703125]});
+ref.push({testName: 'precision.add.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.390625, 0.40625, false, 0.390625, 0.40625, false, 0.390625, 0.40625]});
+ref.push({testName: 'precision.add.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.695313, 0.703125, false, 0.695313, 0.703125, false, 0.695313, 0.703125]});
+ref.push({testName: 'precision.add.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.390625, 0.40625, false, 0.390625, 0.40625, false, 0.390625, 0.40625, false, 0.390625, 0.40625]});
+ref.push({testName: 'precision.add.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.695313, 0.703125, false, 0.695313, 0.703125, false, 0.695313, 0.703125, false, 0.695313, 0.703125]});
+ref.push({testName: 'precision.add.mediump_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.399902, 0.400391]});
+ref.push({testName: 'precision.add.mediump_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.699219, 0.700195]});
+ref.push({testName: 'precision.add.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.399902, 0.400391, false, 0.399902, 0.400391]});
+ref.push({testName: 'precision.add.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.699219, 0.700195, false, 0.699219, 0.700195]});
+ref.push({testName: 'precision.add.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.399902, 0.400391, false, 0.399902, 0.400391, false, 0.399902, 0.400391]});
+ref.push({testName: 'precision.add.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.699219, 0.700195, false, 0.699219, 0.700195, false, 0.699219, 0.700195]});
+ref.push({testName: 'precision.add.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.399902, 0.400391, false, 0.399902, 0.400391, false, 0.399902, 0.400391, false, 0.399902, 0.400391]});
+ref.push({testName: 'precision.add.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.699219, 0.700195, false, 0.699219, 0.700195, false, 0.699219, 0.700195, false, 0.699219, 0.700195]});
+ref.push({testName: 'precision.add.mediump_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.399902, 0.400391]});
+ref.push({testName: 'precision.add.mediump_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.699219, 0.700195]});
+ref.push({testName: 'precision.add.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.399902, 0.400391, false, 0.399902, 0.400391]});
+ref.push({testName: 'precision.add.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.699219, 0.700195, false, 0.699219, 0.700195]});
+ref.push({testName: 'precision.add.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.399902, 0.400391, false, 0.399902, 0.400391, false, 0.399902, 0.400391]});
+ref.push({testName: 'precision.add.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.699219, 0.700195, false, 0.699219, 0.700195, false, 0.699219, 0.700195]});
+ref.push({testName: 'precision.add.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.399902, 0.400391, false, 0.399902, 0.400391, false, 0.399902, 0.400391, false, 0.399902, 0.400391]});
+ref.push({testName: 'precision.add.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.699219, 0.700195, false, 0.699219, 0.700195, false, 0.699219, 0.700195, false, 0.699219, 0.700195]});
+ref.push({testName: 'precision.add.highp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.4, 0.4]});
+ref.push({testName: 'precision.add.highp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.7, 0.7]});
+ref.push({testName: 'precision.add.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.4, 0.4, false, 0.4, 0.4]});
+ref.push({testName: 'precision.add.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.7, 0.7, false, 0.7, 0.7]});
+ref.push({testName: 'precision.add.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.4, 0.4, false, 0.4, 0.4, false, 0.4, 0.4]});
+ref.push({testName: 'precision.add.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.7, 0.7, false, 0.7, 0.7, false, 0.7, 0.7]});
+ref.push({testName: 'precision.add.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.4, 0.4, false, 0.4, 0.4, false, 0.4, 0.4, false, 0.4, 0.4]});
+ref.push({testName: 'precision.add.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.7, 0.7, false, 0.7, 0.7, false, 0.7, 0.7, false, 0.7, 0.7]});
+ref.push({testName: 'precision.add.highp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.4, 0.4]});
+ref.push({testName: 'precision.add.highp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.7, 0.7]});
+ref.push({testName: 'precision.add.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.4, 0.4, false, 0.4, 0.4]});
+ref.push({testName: 'precision.add.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.7, 0.7, false, 0.7, 0.7]});
+ref.push({testName: 'precision.add.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.4, 0.4, false, 0.4, 0.4, false, 0.4, 0.4]});
+ref.push({testName: 'precision.add.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.7, 0.7, false, 0.7, 0.7, false, 0.7, 0.7]});
+ref.push({testName: 'precision.add.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.4, 0.4, false, 0.4, 0.4, false, 0.4, 0.4, false, 0.4, 0.4]});
+ref.push({testName: 'precision.add.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.7, 0.7, false, 0.7, 0.7, false, 0.7, 0.7, false, 0.7, 0.7]});
+ref.push({testName: 'precision.sub.lowp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, -0.0078125, 0.0078125]});
+ref.push({testName: 'precision.sub.lowp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, -0.304688, -0.296875]});
+ref.push({testName: 'precision.sub.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125]});
+ref.push({testName: 'precision.sub.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -0.304688, -0.296875, false, -0.304688, -0.296875]});
+ref.push({testName: 'precision.sub.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125]});
+ref.push({testName: 'precision.sub.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.304688, -0.296875, false, -0.304688, -0.296875, false, -0.304688, -0.296875]});
+ref.push({testName: 'precision.sub.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125]});
+ref.push({testName: 'precision.sub.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -0.304688, -0.296875, false, -0.304688, -0.296875, false, -0.304688, -0.296875, false, -0.304688, -0.296875]});
+ref.push({testName: 'precision.sub.lowp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, -0.0078125, 0.0078125]});
+ref.push({testName: 'precision.sub.lowp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, -0.304688, -0.296875]});
+ref.push({testName: 'precision.sub.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125]});
+ref.push({testName: 'precision.sub.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -0.304688, -0.296875, false, -0.304688, -0.296875]});
+ref.push({testName: 'precision.sub.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125]});
+ref.push({testName: 'precision.sub.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.304688, -0.296875, false, -0.304688, -0.296875, false, -0.304688, -0.296875]});
+ref.push({testName: 'precision.sub.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125]});
+ref.push({testName: 'precision.sub.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -0.304688, -0.296875, false, -0.304688, -0.296875, false, -0.304688, -0.296875, false, -0.304688, -0.296875]});
+ref.push({testName: 'precision.sub.mediump_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, -0.000244141, 0.000244141]});
+ref.push({testName: 'precision.sub.mediump_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, -0.300293, -0.299805]});
+ref.push({testName: 'precision.sub.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, -0.000244141, 0.000244141, false, -0.000244141, 0.000244141]});
+ref.push({testName: 'precision.sub.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -0.300293, -0.299805, false, -0.300293, -0.299805]});
+ref.push({testName: 'precision.sub.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -0.000244141, 0.000244141, false, -0.000244141, 0.000244141, false, -0.000244141, 0.000244141]});
+ref.push({testName: 'precision.sub.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.300293, -0.299805, false, -0.300293, -0.299805, false, -0.300293, -0.299805]});
+ref.push({testName: 'precision.sub.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, -0.000244141, 0.000244141, false, -0.000244141, 0.000244141, false, -0.000244141, 0.000244141, false, -0.000244141, 0.000244141]});
+ref.push({testName: 'precision.sub.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -0.300293, -0.299805, false, -0.300293, -0.299805, false, -0.300293, -0.299805, false, -0.300293, -0.299805]});
+ref.push({testName: 'precision.sub.mediump_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, -0.000244141, 0.000244141]});
+ref.push({testName: 'precision.sub.mediump_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, -0.300293, -0.299805]});
+ref.push({testName: 'precision.sub.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, -0.000244141, 0.000244141, false, -0.000244141, 0.000244141]});
+ref.push({testName: 'precision.sub.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -0.300293, -0.299805, false, -0.300293, -0.299805]});
+ref.push({testName: 'precision.sub.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -0.000244141, 0.000244141, false, -0.000244141, 0.000244141, false, -0.000244141, 0.000244141]});
+ref.push({testName: 'precision.sub.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.300293, -0.299805, false, -0.300293, -0.299805, false, -0.300293, -0.299805]});
+ref.push({testName: 'precision.sub.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, -0.000244141, 0.000244141, false, -0.000244141, 0.000244141, false, -0.000244141, 0.000244141, false, -0.000244141, 0.000244141]});
+ref.push({testName: 'precision.sub.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -0.300293, -0.299805, false, -0.300293, -0.299805, false, -0.300293, -0.299805, false, -0.300293, -0.299805]});
+ref.push({testName: 'precision.sub.highp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.sub.highp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, -0.3, -0.3]});
+ref.push({testName: 'precision.sub.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.sub.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -0.3, -0.3, false, -0.3, -0.3]});
+ref.push({testName: 'precision.sub.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.sub.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.3, -0.3, false, -0.3, -0.3, false, -0.3, -0.3]});
+ref.push({testName: 'precision.sub.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.sub.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -0.3, -0.3, false, -0.3, -0.3, false, -0.3, -0.3, false, -0.3, -0.3]});
+ref.push({testName: 'precision.sub.highp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.sub.highp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, -0.3, -0.3]});
+ref.push({testName: 'precision.sub.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.sub.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -0.3, -0.3, false, -0.3, -0.3]});
+ref.push({testName: 'precision.sub.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.sub.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.3, -0.3, false, -0.3, -0.3, false, -0.3, -0.3]});
+ref.push({testName: 'precision.sub.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.sub.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -0.3, -0.3, false, -0.3, -0.3, false, -0.3, -0.3, false, -0.3, -0.3]});
+ref.push({testName: 'precision.mul.lowp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.mul.lowp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.mul.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.mul.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.mul.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.mul.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.mul.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.mul.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.mul.lowp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.mul.lowp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.mul.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.mul.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.mul.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.mul.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.mul.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.mul.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.mul.mediump_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.mul.mediump_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.mul.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.mul.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.mul.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.mul.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.mul.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.mul.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.mul.mediump_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.mul.mediump_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.mul.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.mul.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.mul.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.mul.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.mul.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.mul.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.mul.highp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.04, 0.04]});
+ref.push({testName: 'precision.mul.highp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.1, 0.1]});
+ref.push({testName: 'precision.mul.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04]});
+ref.push({testName: 'precision.mul.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1]});
+ref.push({testName: 'precision.mul.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]});
+ref.push({testName: 'precision.mul.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]});
+ref.push({testName: 'precision.mul.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]});
+ref.push({testName: 'precision.mul.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]});
+ref.push({testName: 'precision.mul.highp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.04, 0.04]});
+ref.push({testName: 'precision.mul.highp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.1, 0.1]});
+ref.push({testName: 'precision.mul.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04]});
+ref.push({testName: 'precision.mul.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1]});
+ref.push({testName: 'precision.mul.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]});
+ref.push({testName: 'precision.mul.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]});
+ref.push({testName: 'precision.mul.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]});
+ref.push({testName: 'precision.mul.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]});
+ref.push({testName: 'precision.div.lowp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.div.lowp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.div.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.div.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.div.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.div.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.div.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.div.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.div.lowp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.div.lowp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.div.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.div.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.div.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.div.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.div.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.div.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.div.mediump_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.996338, 1.0061]});
+ref.push({testName: 'precision.div.mediump_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.398682, 0.401611]});
+ref.push({testName: 'precision.div.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.996338, 1.0061, false, 0.996338, 1.0061]});
+ref.push({testName: 'precision.div.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.398682, 0.401611, false, 0.398682, 0.401611]});
+ref.push({testName: 'precision.div.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.996338, 1.0061, false, 0.996338, 1.0061, false, 0.996338, 1.0061]});
+ref.push({testName: 'precision.div.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.398682, 0.401611, false, 0.398682, 0.401611, false, 0.398682, 0.401611]});
+ref.push({testName: 'precision.div.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.996338, 1.0061, false, 0.996338, 1.0061, false, 0.996338, 1.0061, false, 0.996338, 1.0061]});
+ref.push({testName: 'precision.div.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.398682, 0.401611, false, 0.398682, 0.401611, false, 0.398682, 0.401611, false, 0.398682, 0.401611]});
+ref.push({testName: 'precision.div.mediump_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.996338, 1.0061]});
+ref.push({testName: 'precision.div.mediump_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.398682, 0.401611]});
+ref.push({testName: 'precision.div.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.996338, 1.0061, false, 0.996338, 1.0061]});
+ref.push({testName: 'precision.div.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.398682, 0.401611, false, 0.398682, 0.401611]});
+ref.push({testName: 'precision.div.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.996338, 1.0061, false, 0.996338, 1.0061, false, 0.996338, 1.0061]});
+ref.push({testName: 'precision.div.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.398682, 0.401611, false, 0.398682, 0.401611, false, 0.398682, 0.401611]});
+ref.push({testName: 'precision.div.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.996338, 1.0061, false, 0.996338, 1.0061, false, 0.996338, 1.0061, false, 0.996338, 1.0061]});
+ref.push({testName: 'precision.div.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.398682, 0.401611, false, 0.398682, 0.401611, false, 0.398682, 0.401611, false, 0.398682, 0.401611]});
+ref.push({testName: 'precision.div.highp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.div.highp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.4, 0.4]});
+ref.push({testName: 'precision.div.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.div.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.4, 0.4, false, 0.4, 0.4]});
+ref.push({testName: 'precision.div.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.div.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.4, 0.4, false, 0.4, 0.4, false, 0.4, 0.4]});
+ref.push({testName: 'precision.div.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.div.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.4, 0.4, false, 0.4, 0.4, false, 0.4, 0.4, false, 0.4, 0.4]});
+ref.push({testName: 'precision.div.highp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.div.highp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.4, 0.4]});
+ref.push({testName: 'precision.div.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.div.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.4, 0.4, false, 0.4, 0.4]});
+ref.push({testName: 'precision.div.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.div.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.4, 0.4, false, 0.4, 0.4, false, 0.4, 0.4]});
+ref.push({testName: 'precision.div.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.div.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.4, 0.4, false, 0.4, 0.4, false, 0.4, 0.4, false, 0.4, 0.4]});
+ref.push({testName: 'precision.radians.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.radians.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.radians.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.radians.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.radians.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.radians.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.radians.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.radians.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.radians.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.radians.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.radians.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.radians.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.radians.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.radians.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.radians.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.radians.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.radians.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.00347137, 0.00350952]});
+ref.push({testName: 'precision.radians.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.00868225, 0.0087738]});
+ref.push({testName: 'precision.radians.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.00347137, 0.00350952, false, 0.00347137, 0.00350952]});
+ref.push({testName: 'precision.radians.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.00868225, 0.0087738, false, 0.00868225, 0.0087738]});
+ref.push({testName: 'precision.radians.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.00347137, 0.00350952, false, 0.00347137, 0.00350952, false, 0.00347137, 0.00350952]});
+ref.push({testName: 'precision.radians.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.00868225, 0.0087738, false, 0.00868225, 0.0087738, false, 0.00868225, 0.0087738]});
+ref.push({testName: 'precision.radians.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.00347137, 0.00350952, false, 0.00347137, 0.00350952, false, 0.00347137, 0.00350952, false, 0.00347137, 0.00350952]});
+ref.push({testName: 'precision.radians.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.00868225, 0.0087738, false, 0.00868225, 0.0087738, false, 0.00868225, 0.0087738, false, 0.00868225, 0.0087738]});
+ref.push({testName: 'precision.radians.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.00347137, 0.00350952]});
+ref.push({testName: 'precision.radians.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.00868225, 0.0087738]});
+ref.push({testName: 'precision.radians.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.00347137, 0.00350952, false, 0.00347137, 0.00350952]});
+ref.push({testName: 'precision.radians.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.00868225, 0.0087738, false, 0.00868225, 0.0087738]});
+ref.push({testName: 'precision.radians.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.00347137, 0.00350952, false, 0.00347137, 0.00350952, false, 0.00347137, 0.00350952]});
+ref.push({testName: 'precision.radians.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.00868225, 0.0087738, false, 0.00868225, 0.0087738, false, 0.00868225, 0.0087738]});
+ref.push({testName: 'precision.radians.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.00347137, 0.00350952, false, 0.00347137, 0.00350952, false, 0.00347137, 0.00350952, false, 0.00347137, 0.00350952]});
+ref.push({testName: 'precision.radians.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.00868225, 0.0087738, false, 0.00868225, 0.0087738, false, 0.00868225, 0.0087738, false, 0.00868225, 0.0087738]});
+ref.push({testName: 'precision.radians.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.00349066, 0.00349066]});
+ref.push({testName: 'precision.radians.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.00872664, 0.00872665]});
+ref.push({testName: 'precision.radians.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.00349066, 0.00349066, false, 0.00349066, 0.00349066]});
+ref.push({testName: 'precision.radians.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.00872664, 0.00872665, false, 0.00872664, 0.00872665]});
+ref.push({testName: 'precision.radians.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.00349066, 0.00349066, false, 0.00349066, 0.00349066, false, 0.00349066, 0.00349066]});
+ref.push({testName: 'precision.radians.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.00872664, 0.00872665, false, 0.00872664, 0.00872665, false, 0.00872664, 0.00872665]});
+ref.push({testName: 'precision.radians.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.00349066, 0.00349066, false, 0.00349066, 0.00349066, false, 0.00349066, 0.00349066, false, 0.00349066, 0.00349066]});
+ref.push({testName: 'precision.radians.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.00872664, 0.00872665, false, 0.00872664, 0.00872665, false, 0.00872664, 0.00872665, false, 0.00872664, 0.00872665]});
+ref.push({testName: 'precision.radians.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.00349066, 0.00349066]});
+ref.push({testName: 'precision.radians.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.00872664, 0.00872665]});
+ref.push({testName: 'precision.radians.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.00349066, 0.00349066, false, 0.00349066, 0.00349066]});
+ref.push({testName: 'precision.radians.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.00872664, 0.00872665, false, 0.00872664, 0.00872665]});
+ref.push({testName: 'precision.radians.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.00349066, 0.00349066, false, 0.00349066, 0.00349066, false, 0.00349066, 0.00349066]});
+ref.push({testName: 'precision.radians.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.00872664, 0.00872665, false, 0.00872664, 0.00872665, false, 0.00872664, 0.00872665]});
+ref.push({testName: 'precision.radians.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.00349066, 0.00349066, false, 0.00349066, 0.00349066, false, 0.00349066, 0.00349066, false, 0.00349066, 0.00349066]});
+ref.push({testName: 'precision.radians.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.00872664, 0.00872665, false, 0.00872664, 0.00872665, false, 0.00872664, 0.00872665, false, 0.00872664, 0.00872665]});
+ref.push({testName: 'precision.degrees.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.degrees.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.degrees.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.degrees.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.degrees.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.degrees.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.degrees.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.degrees.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.degrees.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.degrees.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.degrees.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.degrees.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.degrees.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.degrees.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.degrees.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.degrees.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.degrees.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 11.4219, 11.5156]});
+ref.push({testName: 'precision.degrees.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 28.5625, 28.75]});
+ref.push({testName: 'precision.degrees.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 11.4219, 11.5156, false, 11.4219, 11.5156]});
+ref.push({testName: 'precision.degrees.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 28.5625, 28.75, false, 28.5625, 28.75]});
+ref.push({testName: 'precision.degrees.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 11.4219, 11.5156, false, 11.4219, 11.5156, false, 11.4219, 11.5156]});
+ref.push({testName: 'precision.degrees.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 28.5625, 28.75, false, 28.5625, 28.75, false, 28.5625, 28.75]});
+ref.push({testName: 'precision.degrees.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 11.4219, 11.5156, false, 11.4219, 11.5156, false, 11.4219, 11.5156, false, 11.4219, 11.5156]});
+ref.push({testName: 'precision.degrees.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 28.5625, 28.75, false, 28.5625, 28.75, false, 28.5625, 28.75, false, 28.5625, 28.75]});
+ref.push({testName: 'precision.degrees.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 11.4219, 11.5156]});
+ref.push({testName: 'precision.degrees.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 28.5625, 28.75]});
+ref.push({testName: 'precision.degrees.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 11.4219, 11.5156, false, 11.4219, 11.5156]});
+ref.push({testName: 'precision.degrees.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 28.5625, 28.75, false, 28.5625, 28.75]});
+ref.push({testName: 'precision.degrees.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 11.4219, 11.5156, false, 11.4219, 11.5156, false, 11.4219, 11.5156]});
+ref.push({testName: 'precision.degrees.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 28.5625, 28.75, false, 28.5625, 28.75, false, 28.5625, 28.75]});
+ref.push({testName: 'precision.degrees.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 11.4219, 11.5156, false, 11.4219, 11.5156, false, 11.4219, 11.5156, false, 11.4219, 11.5156]});
+ref.push({testName: 'precision.degrees.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 28.5625, 28.75, false, 28.5625, 28.75, false, 28.5625, 28.75, false, 28.5625, 28.75]});
+ref.push({testName: 'precision.degrees.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 11.4592, 11.4592]});
+ref.push({testName: 'precision.degrees.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 28.6479, 28.6479]});
+ref.push({testName: 'precision.degrees.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 11.4592, 11.4592, false, 11.4592, 11.4592]});
+ref.push({testName: 'precision.degrees.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 28.6479, 28.6479, false, 28.6479, 28.6479]});
+ref.push({testName: 'precision.degrees.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 11.4592, 11.4592, false, 11.4592, 11.4592, false, 11.4592, 11.4592]});
+ref.push({testName: 'precision.degrees.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 28.6479, 28.6479, false, 28.6479, 28.6479, false, 28.6479, 28.6479]});
+ref.push({testName: 'precision.degrees.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 11.4592, 11.4592, false, 11.4592, 11.4592, false, 11.4592, 11.4592, false, 11.4592, 11.4592]});
+ref.push({testName: 'precision.degrees.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 28.6479, 28.6479, false, 28.6479, 28.6479, false, 28.6479, 28.6479, false, 28.6479, 28.6479]});
+ref.push({testName: 'precision.degrees.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 11.4592, 11.4592]});
+ref.push({testName: 'precision.degrees.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 28.6479, 28.6479]});
+ref.push({testName: 'precision.degrees.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 11.4592, 11.4592, false, 11.4592, 11.4592]});
+ref.push({testName: 'precision.degrees.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 28.6479, 28.6479, false, 28.6479, 28.6479]});
+ref.push({testName: 'precision.degrees.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 11.4592, 11.4592, false, 11.4592, 11.4592, false, 11.4592, 11.4592]});
+ref.push({testName: 'precision.degrees.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 28.6479, 28.6479, false, 28.6479, 28.6479, false, 28.6479, 28.6479]});
+ref.push({testName: 'precision.degrees.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 11.4592, 11.4592, false, 11.4592, 11.4592, false, 11.4592, 11.4592, false, 11.4592, 11.4592]});
+ref.push({testName: 'precision.degrees.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 28.6479, 28.6479, false, 28.6479, 28.6479, false, 28.6479, 28.6479, false, 28.6479, 28.6479]});
+ref.push({testName: 'precision.sin.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.178448, 0.217356]});
+ref.push({testName: 'precision.sin.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.463801, 0.495051]});
+ref.push({testName: 'precision.sin.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.178448, 0.217356, false, 0.178448, 0.217356]});
+ref.push({testName: 'precision.sin.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.463801, 0.495051, false, 0.463801, 0.495051]});
+ref.push({testName: 'precision.sin.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.178448, 0.217356, false, 0.178448, 0.217356, false, 0.178448, 0.217356]});
+ref.push({testName: 'precision.sin.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.463801, 0.495051, false, 0.463801, 0.495051, false, 0.463801, 0.495051]});
+ref.push({testName: 'precision.sin.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.178448, 0.217356, false, 0.178448, 0.217356, false, 0.178448, 0.217356, false, 0.178448, 0.217356]});
+ref.push({testName: 'precision.sin.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.463801, 0.495051, false, 0.463801, 0.495051, false, 0.463801, 0.495051, false, 0.463801, 0.495051]});
+ref.push({testName: 'precision.sin.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.178448, 0.217356]});
+ref.push({testName: 'precision.sin.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.463801, 0.495051]});
+ref.push({testName: 'precision.sin.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.178448, 0.217356, false, 0.178448, 0.217356]});
+ref.push({testName: 'precision.sin.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.463801, 0.495051, false, 0.463801, 0.495051]});
+ref.push({testName: 'precision.sin.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.178448, 0.217356, false, 0.178448, 0.217356, false, 0.178448, 0.217356]});
+ref.push({testName: 'precision.sin.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.463801, 0.495051, false, 0.463801, 0.495051, false, 0.463801, 0.495051]});
+ref.push({testName: 'precision.sin.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.178448, 0.217356, false, 0.178448, 0.217356, false, 0.178448, 0.217356, false, 0.178448, 0.217356]});
+ref.push({testName: 'precision.sin.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.463801, 0.495051, false, 0.463801, 0.495051, false, 0.463801, 0.495051, false, 0.463801, 0.495051]});
+ref.push({testName: 'precision.sin.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.198133, 0.199349]});
+ref.push({testName: 'precision.sin.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.478449, 0.480402]});
+ref.push({testName: 'precision.sin.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.198133, 0.199349, false, 0.198133, 0.199349]});
+ref.push({testName: 'precision.sin.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.478449, 0.480402, false, 0.478449, 0.480402]});
+ref.push({testName: 'precision.sin.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.198133, 0.199349, false, 0.198133, 0.199349, false, 0.198133, 0.199349]});
+ref.push({testName: 'precision.sin.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.478449, 0.480402, false, 0.478449, 0.480402, false, 0.478449, 0.480402]});
+ref.push({testName: 'precision.sin.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.198133, 0.199349, false, 0.198133, 0.199349, false, 0.198133, 0.199349, false, 0.198133, 0.199349]});
+ref.push({testName: 'precision.sin.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.478449, 0.480402, false, 0.478449, 0.480402, false, 0.478449, 0.480402, false, 0.478449, 0.480402]});
+ref.push({testName: 'precision.sin.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.198133, 0.199349]});
+ref.push({testName: 'precision.sin.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.478449, 0.480402]});
+ref.push({testName: 'precision.sin.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.198133, 0.199349, false, 0.198133, 0.199349]});
+ref.push({testName: 'precision.sin.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.478449, 0.480402, false, 0.478449, 0.480402]});
+ref.push({testName: 'precision.sin.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.198133, 0.199349, false, 0.198133, 0.199349, false, 0.198133, 0.199349]});
+ref.push({testName: 'precision.sin.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.478449, 0.480402, false, 0.478449, 0.480402, false, 0.478449, 0.480402]});
+ref.push({testName: 'precision.sin.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.198133, 0.199349, false, 0.198133, 0.199349, false, 0.198133, 0.199349, false, 0.198133, 0.199349]});
+ref.push({testName: 'precision.sin.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.478449, 0.480402, false, 0.478449, 0.480402, false, 0.478449, 0.480402, false, 0.478449, 0.480402]});
+ref.push({testName: 'precision.sin.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.198181, 0.199158]});
+ref.push({testName: 'precision.sin.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.478937, 0.479914]});
+ref.push({testName: 'precision.sin.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.198181, 0.199158, false, 0.198181, 0.199158]});
+ref.push({testName: 'precision.sin.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.478937, 0.479914, false, 0.478937, 0.479914]});
+ref.push({testName: 'precision.sin.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.198181, 0.199158, false, 0.198181, 0.199158, false, 0.198181, 0.199158]});
+ref.push({testName: 'precision.sin.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.478937, 0.479914, false, 0.478937, 0.479914, false, 0.478937, 0.479914]});
+ref.push({testName: 'precision.sin.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.198181, 0.199158, false, 0.198181, 0.199158, false, 0.198181, 0.199158, false, 0.198181, 0.199158]});
+ref.push({testName: 'precision.sin.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.478937, 0.479914, false, 0.478937, 0.479914, false, 0.478937, 0.479914, false, 0.478937, 0.479914]});
+ref.push({testName: 'precision.sin.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.198181, 0.199158]});
+ref.push({testName: 'precision.sin.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.478937, 0.479914]});
+ref.push({testName: 'precision.sin.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.198181, 0.199158, false, 0.198181, 0.199158]});
+ref.push({testName: 'precision.sin.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.478937, 0.479914, false, 0.478937, 0.479914]});
+ref.push({testName: 'precision.sin.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.198181, 0.199158, false, 0.198181, 0.199158, false, 0.198181, 0.199158]});
+ref.push({testName: 'precision.sin.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.478937, 0.479914, false, 0.478937, 0.479914, false, 0.478937, 0.479914]});
+ref.push({testName: 'precision.sin.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.198181, 0.199158, false, 0.198181, 0.199158, false, 0.198181, 0.199158, false, 0.198181, 0.199158]});
+ref.push({testName: 'precision.sin.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.478937, 0.479914, false, 0.478937, 0.479914, false, 0.478937, 0.479914, false, 0.478937, 0.479914]});
+ref.push({testName: 'precision.cos.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.963816, 0.996612]});
+ref.push({testName: 'precision.cos.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.861958, 0.893208]});
+ref.push({testName: 'precision.cos.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.963816, 0.996612, false, 0.963816, 0.996612]});
+ref.push({testName: 'precision.cos.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.861958, 0.893208, false, 0.861958, 0.893208]});
+ref.push({testName: 'precision.cos.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.963816, 0.996612, false, 0.963816, 0.996612, false, 0.963816, 0.996612]});
+ref.push({testName: 'precision.cos.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.861958, 0.893208, false, 0.861958, 0.893208, false, 0.861958, 0.893208]});
+ref.push({testName: 'precision.cos.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.963816, 0.996612, false, 0.963816, 0.996612, false, 0.963816, 0.996612, false, 0.963816, 0.996612]});
+ref.push({testName: 'precision.cos.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.861958, 0.893208, false, 0.861958, 0.893208, false, 0.861958, 0.893208, false, 0.861958, 0.893208]});
+ref.push({testName: 'precision.cos.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.963816, 0.996612]});
+ref.push({testName: 'precision.cos.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.861958, 0.893208]});
+ref.push({testName: 'precision.cos.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.963816, 0.996612, false, 0.963816, 0.996612]});
+ref.push({testName: 'precision.cos.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.861958, 0.893208, false, 0.861958, 0.893208]});
+ref.push({testName: 'precision.cos.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.963816, 0.996612, false, 0.963816, 0.996612, false, 0.963816, 0.996612]});
+ref.push({testName: 'precision.cos.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.861958, 0.893208, false, 0.861958, 0.893208, false, 0.861958, 0.893208]});
+ref.push({testName: 'precision.cos.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.963816, 0.996612, false, 0.963816, 0.996612, false, 0.963816, 0.996612, false, 0.963816, 0.996612]});
+ref.push({testName: 'precision.cos.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.861958, 0.893208, false, 0.861958, 0.893208, false, 0.861958, 0.893208, false, 0.861958, 0.893208]});
+ref.push({testName: 'precision.cos.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.978075, 0.982029]});
+ref.push({testName: 'precision.cos.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.875629, 0.879536]});
+ref.push({testName: 'precision.cos.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.978075, 0.982029, false, 0.978075, 0.982029]});
+ref.push({testName: 'precision.cos.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.875629, 0.879536, false, 0.875629, 0.879536]});
+ref.push({testName: 'precision.cos.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.978075, 0.982029, false, 0.978075, 0.982029, false, 0.978075, 0.982029]});
+ref.push({testName: 'precision.cos.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.875629, 0.879536, false, 0.875629, 0.879536, false, 0.875629, 0.879536]});
+ref.push({testName: 'precision.cos.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.978075, 0.982029, false, 0.978075, 0.982029, false, 0.978075, 0.982029, false, 0.978075, 0.982029]});
+ref.push({testName: 'precision.cos.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.875629, 0.879536, false, 0.875629, 0.879536, false, 0.875629, 0.879536, false, 0.875629, 0.879536]});
+ref.push({testName: 'precision.cos.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.978075, 0.982029]});
+ref.push({testName: 'precision.cos.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.875629, 0.879536]});
+ref.push({testName: 'precision.cos.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.978075, 0.982029, false, 0.978075, 0.982029]});
+ref.push({testName: 'precision.cos.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.875629, 0.879536, false, 0.875629, 0.879536]});
+ref.push({testName: 'precision.cos.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.978075, 0.982029, false, 0.978075, 0.982029, false, 0.978075, 0.982029]});
+ref.push({testName: 'precision.cos.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.875629, 0.879536, false, 0.875629, 0.879536, false, 0.875629, 0.879536]});
+ref.push({testName: 'precision.cos.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.978075, 0.982029, false, 0.978075, 0.982029, false, 0.978075, 0.982029, false, 0.978075, 0.982029]});
+ref.push({testName: 'precision.cos.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.875629, 0.879536, false, 0.875629, 0.879536, false, 0.875629, 0.879536, false, 0.875629, 0.879536]});
+ref.push({testName: 'precision.cos.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.979578, 0.980555]});
+ref.push({testName: 'precision.cos.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.877094, 0.878071]});
+ref.push({testName: 'precision.cos.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.979578, 0.980555, false, 0.979578, 0.980555]});
+ref.push({testName: 'precision.cos.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.877094, 0.878071, false, 0.877094, 0.878071]});
+ref.push({testName: 'precision.cos.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.979578, 0.980555, false, 0.979578, 0.980555, false, 0.979578, 0.980555]});
+ref.push({testName: 'precision.cos.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.877094, 0.878071, false, 0.877094, 0.878071, false, 0.877094, 0.878071]});
+ref.push({testName: 'precision.cos.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.979578, 0.980555, false, 0.979578, 0.980555, false, 0.979578, 0.980555, false, 0.979578, 0.980555]});
+ref.push({testName: 'precision.cos.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.877094, 0.878071, false, 0.877094, 0.878071, false, 0.877094, 0.878071, false, 0.877094, 0.878071]});
+ref.push({testName: 'precision.cos.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.979578, 0.980555]});
+ref.push({testName: 'precision.cos.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.877094, 0.878071]});
+ref.push({testName: 'precision.cos.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.979578, 0.980555, false, 0.979578, 0.980555]});
+ref.push({testName: 'precision.cos.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.877094, 0.878071, false, 0.877094, 0.878071]});
+ref.push({testName: 'precision.cos.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.979578, 0.980555, false, 0.979578, 0.980555, false, 0.979578, 0.980555]});
+ref.push({testName: 'precision.cos.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.877094, 0.878071, false, 0.877094, 0.878071, false, 0.877094, 0.878071]});
+ref.push({testName: 'precision.cos.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.979578, 0.980555, false, 0.979578, 0.980555, false, 0.979578, 0.980555, false, 0.979578, 0.980555]});
+ref.push({testName: 'precision.cos.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.877094, 0.878071, false, 0.877094, 0.878071, false, 0.877094, 0.878071, false, 0.877094, 0.878071]});
+ref.push({testName: 'precision.tan.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.tan.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.tan.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.tan.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.tan.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.tan.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.tan.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.tan.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.tan.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.tan.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.tan.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.tan.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.tan.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.tan.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.tan.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.tan.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.tan.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.200684, 0.204834]});
+ref.push({testName: 'precision.tan.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.541016, 0.551758]});
+ref.push({testName: 'precision.tan.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.200684, 0.204834, false, 0.200684, 0.204834]});
+ref.push({testName: 'precision.tan.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.541016, 0.551758, false, 0.541016, 0.551758]});
+ref.push({testName: 'precision.tan.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.200684, 0.204834, false, 0.200684, 0.204834, false, 0.200684, 0.204834]});
+ref.push({testName: 'precision.tan.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.541016, 0.551758, false, 0.541016, 0.551758, false, 0.541016, 0.551758]});
+ref.push({testName: 'precision.tan.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.200684, 0.204834, false, 0.200684, 0.204834, false, 0.200684, 0.204834, false, 0.200684, 0.204834]});
+ref.push({testName: 'precision.tan.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.541016, 0.551758, false, 0.541016, 0.551758, false, 0.541016, 0.551758, false, 0.541016, 0.551758]});
+ref.push({testName: 'precision.tan.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.200684, 0.204834]});
+ref.push({testName: 'precision.tan.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.541016, 0.551758]});
+ref.push({testName: 'precision.tan.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.200684, 0.204834, false, 0.200684, 0.204834]});
+ref.push({testName: 'precision.tan.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.541016, 0.551758, false, 0.541016, 0.551758]});
+ref.push({testName: 'precision.tan.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.200684, 0.204834, false, 0.200684, 0.204834, false, 0.200684, 0.204834]});
+ref.push({testName: 'precision.tan.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.541016, 0.551758, false, 0.541016, 0.551758, false, 0.541016, 0.551758]});
+ref.push({testName: 'precision.tan.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.200684, 0.204834, false, 0.200684, 0.204834, false, 0.200684, 0.204834, false, 0.200684, 0.204834]});
+ref.push({testName: 'precision.tan.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.541016, 0.551758, false, 0.541016, 0.551758, false, 0.541016, 0.551758, false, 0.541016, 0.551758]});
+ref.push({testName: 'precision.tan.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.202111, 0.20331]});
+ref.push({testName: 'precision.tan.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.545443, 0.547163]});
+ref.push({testName: 'precision.tan.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.202111, 0.20331, false, 0.202111, 0.20331]});
+ref.push({testName: 'precision.tan.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.545443, 0.547163, false, 0.545443, 0.547163]});
+ref.push({testName: 'precision.tan.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.202111, 0.20331, false, 0.202111, 0.20331, false, 0.202111, 0.20331]});
+ref.push({testName: 'precision.tan.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.545443, 0.547163, false, 0.545443, 0.547163, false, 0.545443, 0.547163]});
+ref.push({testName: 'precision.tan.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.202111, 0.20331, false, 0.202111, 0.20331, false, 0.202111, 0.20331, false, 0.202111, 0.20331]});
+ref.push({testName: 'precision.tan.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.545443, 0.547163, false, 0.545443, 0.547163, false, 0.545443, 0.547163, false, 0.545443, 0.547163]});
+ref.push({testName: 'precision.tan.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.202111, 0.20331]});
+ref.push({testName: 'precision.tan.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.545443, 0.547163]});
+ref.push({testName: 'precision.tan.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.202111, 0.20331, false, 0.202111, 0.20331]});
+ref.push({testName: 'precision.tan.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.545443, 0.547163, false, 0.545443, 0.547163]});
+ref.push({testName: 'precision.tan.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.202111, 0.20331, false, 0.202111, 0.20331, false, 0.202111, 0.20331]});
+ref.push({testName: 'precision.tan.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.545443, 0.547163, false, 0.545443, 0.547163, false, 0.545443, 0.547163]});
+ref.push({testName: 'precision.tan.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.202111, 0.20331, false, 0.202111, 0.20331, false, 0.202111, 0.20331, false, 0.202111, 0.20331]});
+ref.push({testName: 'precision.tan.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.545443, 0.547163, false, 0.545443, 0.547163, false, 0.545443, 0.547163, false, 0.545443, 0.547163]});
+ref.push({testName: 'precision.asin.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.180951, 0.220173]});
+ref.push({testName: 'precision.asin.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.507974, 0.539224]});
+ref.push({testName: 'precision.asin.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.180951, 0.220173, false, 0.180951, 0.220173]});
+ref.push({testName: 'precision.asin.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.507974, 0.539224, false, 0.507974, 0.539224]});
+ref.push({testName: 'precision.asin.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.180951, 0.220173, false, 0.180951, 0.220173, false, 0.180951, 0.220173]});
+ref.push({testName: 'precision.asin.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.507974, 0.539224, false, 0.507974, 0.539224, false, 0.507974, 0.539224]});
+ref.push({testName: 'precision.asin.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.180951, 0.220173, false, 0.180951, 0.220173, false, 0.180951, 0.220173, false, 0.180951, 0.220173]});
+ref.push({testName: 'precision.asin.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.507974, 0.539224, false, 0.507974, 0.539224, false, 0.507974, 0.539224, false, 0.507974, 0.539224]});
+ref.push({testName: 'precision.asin.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.180951, 0.220173]});
+ref.push({testName: 'precision.asin.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.507974, 0.539224]});
+ref.push({testName: 'precision.asin.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.180951, 0.220173, false, 0.180951, 0.220173]});
+ref.push({testName: 'precision.asin.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.507974, 0.539224, false, 0.507974, 0.539224]});
+ref.push({testName: 'precision.asin.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.180951, 0.220173, false, 0.180951, 0.220173, false, 0.180951, 0.220173]});
+ref.push({testName: 'precision.asin.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.507974, 0.539224, false, 0.507974, 0.539224, false, 0.507974, 0.539224]});
+ref.push({testName: 'precision.asin.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.180951, 0.220173, false, 0.180951, 0.220173, false, 0.180951, 0.220173, false, 0.180951, 0.220173]});
+ref.push({testName: 'precision.asin.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.507974, 0.539224, false, 0.507974, 0.539224, false, 0.507974, 0.539224, false, 0.507974, 0.539224]});
+ref.push({testName: 'precision.asin.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.20082, 0.202046]});
+ref.push({testName: 'precision.asin.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.521646, 0.525552]});
+ref.push({testName: 'precision.asin.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.20082, 0.202046, false, 0.20082, 0.202046]});
+ref.push({testName: 'precision.asin.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.521646, 0.525552, false, 0.521646, 0.525552]});
+ref.push({testName: 'precision.asin.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.20082, 0.202046, false, 0.20082, 0.202046, false, 0.20082, 0.202046]});
+ref.push({testName: 'precision.asin.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.521646, 0.525552, false, 0.521646, 0.525552, false, 0.521646, 0.525552]});
+ref.push({testName: 'precision.asin.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.20082, 0.202046, false, 0.20082, 0.202046, false, 0.20082, 0.202046, false, 0.20082, 0.202046]});
+ref.push({testName: 'precision.asin.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.521646, 0.525552, false, 0.521646, 0.525552, false, 0.521646, 0.525552, false, 0.521646, 0.525552]});
+ref.push({testName: 'precision.asin.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.20082, 0.202046]});
+ref.push({testName: 'precision.asin.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.521646, 0.525552]});
+ref.push({testName: 'precision.asin.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.20082, 0.202046, false, 0.20082, 0.202046]});
+ref.push({testName: 'precision.asin.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.521646, 0.525552, false, 0.521646, 0.525552]});
+ref.push({testName: 'precision.asin.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.20082, 0.202046, false, 0.20082, 0.202046, false, 0.20082, 0.202046]});
+ref.push({testName: 'precision.asin.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.521646, 0.525552, false, 0.521646, 0.525552, false, 0.521646, 0.525552]});
+ref.push({testName: 'precision.asin.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.20082, 0.202046, false, 0.20082, 0.202046, false, 0.20082, 0.202046, false, 0.20082, 0.202046]});
+ref.push({testName: 'precision.asin.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.521646, 0.525552, false, 0.521646, 0.525552, false, 0.521646, 0.525552, false, 0.521646, 0.525552]});
+ref.push({testName: 'precision.asin.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.201358, 0.201358]});
+ref.push({testName: 'precision.asin.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.523599, 0.523599]});
+ref.push({testName: 'precision.asin.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.201358, 0.201358, false, 0.201358, 0.201358]});
+ref.push({testName: 'precision.asin.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.523599, 0.523599, false, 0.523599, 0.523599]});
+ref.push({testName: 'precision.asin.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.201358, 0.201358, false, 0.201358, 0.201358, false, 0.201358, 0.201358]});
+ref.push({testName: 'precision.asin.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.523599, 0.523599, false, 0.523599, 0.523599, false, 0.523599, 0.523599]});
+ref.push({testName: 'precision.asin.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.201358, 0.201358, false, 0.201358, 0.201358, false, 0.201358, 0.201358, false, 0.201358, 0.201358]});
+ref.push({testName: 'precision.asin.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.523599, 0.523599, false, 0.523599, 0.523599, false, 0.523599, 0.523599, false, 0.523599, 0.523599]});
+ref.push({testName: 'precision.asin.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.201358, 0.201358]});
+ref.push({testName: 'precision.asin.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.523599, 0.523599]});
+ref.push({testName: 'precision.asin.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.201358, 0.201358, false, 0.201358, 0.201358]});
+ref.push({testName: 'precision.asin.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.523599, 0.523599, false, 0.523599, 0.523599]});
+ref.push({testName: 'precision.asin.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.201358, 0.201358, false, 0.201358, 0.201358, false, 0.201358, 0.201358]});
+ref.push({testName: 'precision.asin.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.523599, 0.523599, false, 0.523599, 0.523599, false, 0.523599, 0.523599]});
+ref.push({testName: 'precision.asin.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.201358, 0.201358, false, 0.201358, 0.201358, false, 0.201358, 0.201358, false, 0.201358, 0.201358]});
+ref.push({testName: 'precision.asin.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.523599, 0.523599, false, 0.523599, 0.523599, false, 0.523599, 0.523599, false, 0.523599, 0.523599]});
+ref.push({testName: 'precision.acos.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1.35062, 1.38985]});
+ref.push({testName: 'precision.acos.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1.03157, 1.06282]});
+ref.push({testName: 'precision.acos.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.35062, 1.38985, false, 1.35062, 1.38985]});
+ref.push({testName: 'precision.acos.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.03157, 1.06282, false, 1.03157, 1.06282]});
+ref.push({testName: 'precision.acos.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.35062, 1.38985, false, 1.35062, 1.38985, false, 1.35062, 1.38985]});
+ref.push({testName: 'precision.acos.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.03157, 1.06282, false, 1.03157, 1.06282, false, 1.03157, 1.06282]});
+ref.push({testName: 'precision.acos.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.35062, 1.38985, false, 1.35062, 1.38985, false, 1.35062, 1.38985, false, 1.35062, 1.38985]});
+ref.push({testName: 'precision.acos.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.03157, 1.06282, false, 1.03157, 1.06282, false, 1.03157, 1.06282, false, 1.03157, 1.06282]});
+ref.push({testName: 'precision.acos.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1.35062, 1.38985]});
+ref.push({testName: 'precision.acos.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1.03157, 1.06282]});
+ref.push({testName: 'precision.acos.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.35062, 1.38985, false, 1.35062, 1.38985]});
+ref.push({testName: 'precision.acos.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.03157, 1.06282, false, 1.03157, 1.06282]});
+ref.push({testName: 'precision.acos.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.35062, 1.38985, false, 1.35062, 1.38985, false, 1.35062, 1.38985]});
+ref.push({testName: 'precision.acos.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.03157, 1.06282, false, 1.03157, 1.06282, false, 1.03157, 1.06282]});
+ref.push({testName: 'precision.acos.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.35062, 1.38985, false, 1.35062, 1.38985, false, 1.35062, 1.38985, false, 1.35062, 1.38985]});
+ref.push({testName: 'precision.acos.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.03157, 1.06282, false, 1.03157, 1.06282, false, 1.03157, 1.06282, false, 1.03157, 1.06282]});
+ref.push({testName: 'precision.acos.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1.36533, 1.37339]});
+ref.push({testName: 'precision.acos.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1.04329, 1.0511]});
+ref.push({testName: 'precision.acos.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.36533, 1.37339, false, 1.36533, 1.37339]});
+ref.push({testName: 'precision.acos.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.04329, 1.0511, false, 1.04329, 1.0511]});
+ref.push({testName: 'precision.acos.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.36533, 1.37339, false, 1.36533, 1.37339, false, 1.36533, 1.37339]});
+ref.push({testName: 'precision.acos.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.04329, 1.0511, false, 1.04329, 1.0511, false, 1.04329, 1.0511]});
+ref.push({testName: 'precision.acos.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.36533, 1.37339, false, 1.36533, 1.37339, false, 1.36533, 1.37339, false, 1.36533, 1.37339]});
+ref.push({testName: 'precision.acos.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.04329, 1.0511, false, 1.04329, 1.0511, false, 1.04329, 1.0511, false, 1.04329, 1.0511]});
+ref.push({testName: 'precision.acos.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1.36533, 1.37339]});
+ref.push({testName: 'precision.acos.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1.04329, 1.0511]});
+ref.push({testName: 'precision.acos.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.36533, 1.37339, false, 1.36533, 1.37339]});
+ref.push({testName: 'precision.acos.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.04329, 1.0511, false, 1.04329, 1.0511]});
+ref.push({testName: 'precision.acos.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.36533, 1.37339, false, 1.36533, 1.37339, false, 1.36533, 1.37339]});
+ref.push({testName: 'precision.acos.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.04329, 1.0511, false, 1.04329, 1.0511, false, 1.04329, 1.0511]});
+ref.push({testName: 'precision.acos.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.36533, 1.37339, false, 1.36533, 1.37339, false, 1.36533, 1.37339, false, 1.36533, 1.37339]});
+ref.push({testName: 'precision.acos.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.04329, 1.0511, false, 1.04329, 1.0511, false, 1.04329, 1.0511, false, 1.04329, 1.0511]});
+ref.push({testName: 'precision.acos.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1.36944, 1.36944]});
+ref.push({testName: 'precision.acos.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1.0472, 1.0472]});
+ref.push({testName: 'precision.acos.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.36944, 1.36944, false, 1.36944, 1.36944]});
+ref.push({testName: 'precision.acos.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.0472, 1.0472, false, 1.0472, 1.0472]});
+ref.push({testName: 'precision.acos.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.36944, 1.36944, false, 1.36944, 1.36944, false, 1.36944, 1.36944]});
+ref.push({testName: 'precision.acos.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.0472, 1.0472, false, 1.0472, 1.0472, false, 1.0472, 1.0472]});
+ref.push({testName: 'precision.acos.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.36944, 1.36944, false, 1.36944, 1.36944, false, 1.36944, 1.36944, false, 1.36944, 1.36944]});
+ref.push({testName: 'precision.acos.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.0472, 1.0472, false, 1.0472, 1.0472, false, 1.0472, 1.0472, false, 1.0472, 1.0472]});
+ref.push({testName: 'precision.acos.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1.36944, 1.36944]});
+ref.push({testName: 'precision.acos.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1.0472, 1.0472]});
+ref.push({testName: 'precision.acos.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.36944, 1.36944, false, 1.36944, 1.36944]});
+ref.push({testName: 'precision.acos.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.0472, 1.0472, false, 1.0472, 1.0472]});
+ref.push({testName: 'precision.acos.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.36944, 1.36944, false, 1.36944, 1.36944, false, 1.36944, 1.36944]});
+ref.push({testName: 'precision.acos.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.0472, 1.0472, false, 1.0472, 1.0472, false, 1.0472, 1.0472]});
+ref.push({testName: 'precision.acos.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.36944, 1.36944, false, 1.36944, 1.36944, false, 1.36944, 1.36944, false, 1.36944, 1.36944]});
+ref.push({testName: 'precision.acos.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.0472, 1.0472, false, 1.0472, 1.0472, false, 1.0472, 1.0472, false, 1.0472, 1.0472]});
+ref.push({testName: 'precision.atan2.lowp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.750168, 0.820628]});
+ref.push({testName: 'precision.atan2.lowp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.356773, 0.401508]});
+ref.push({testName: 'precision.atan2.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.750168, 0.820628, false, 0.750168, 0.820628]});
+ref.push({testName: 'precision.atan2.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.356773, 0.401508, false, 0.356773, 0.401508]});
+ref.push({testName: 'precision.atan2.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.750168, 0.820628, false, 0.750168, 0.820628, false, 0.750168, 0.820628]});
+ref.push({testName: 'precision.atan2.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.356773, 0.401508, false, 0.356773, 0.401508, false, 0.356773, 0.401508]});
+ref.push({testName: 'precision.atan2.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.750168, 0.820628, false, 0.750168, 0.820628, false, 0.750168, 0.820628, false, 0.750168, 0.820628]});
+ref.push({testName: 'precision.atan2.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.356773, 0.401508, false, 0.356773, 0.401508, false, 0.356773, 0.401508, false, 0.356773, 0.401508]});
+ref.push({testName: 'precision.atan2.lowp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.750168, 0.820628]});
+ref.push({testName: 'precision.atan2.lowp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.356773, 0.401508]});
+ref.push({testName: 'precision.atan2.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.750168, 0.820628, false, 0.750168, 0.820628]});
+ref.push({testName: 'precision.atan2.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.356773, 0.401508, false, 0.356773, 0.401508]});
+ref.push({testName: 'precision.atan2.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.750168, 0.820628, false, 0.750168, 0.820628, false, 0.750168, 0.820628]});
+ref.push({testName: 'precision.atan2.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.356773, 0.401508, false, 0.356773, 0.401508, false, 0.356773, 0.401508]});
+ref.push({testName: 'precision.atan2.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.750168, 0.820628, false, 0.750168, 0.820628, false, 0.750168, 0.820628, false, 0.750168, 0.820628]});
+ref.push({testName: 'precision.atan2.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.356773, 0.401508, false, 0.356773, 0.401508, false, 0.356773, 0.401508, false, 0.356773, 0.401508]});
+ref.push({testName: 'precision.atan2.mediump_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.782835, 0.787961]});
+ref.push({testName: 'precision.atan2.mediump_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.379446, 0.38182]});
+ref.push({testName: 'precision.atan2.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.782835, 0.787961, false, 0.782835, 0.787961]});
+ref.push({testName: 'precision.atan2.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.379446, 0.38182, false, 0.379446, 0.38182]});
+ref.push({testName: 'precision.atan2.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.782835, 0.787961, false, 0.782835, 0.787961, false, 0.782835, 0.787961]});
+ref.push({testName: 'precision.atan2.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.379446, 0.38182, false, 0.379446, 0.38182, false, 0.379446, 0.38182]});
+ref.push({testName: 'precision.atan2.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.782835, 0.787961, false, 0.782835, 0.787961, false, 0.782835, 0.787961, false, 0.782835, 0.787961]});
+ref.push({testName: 'precision.atan2.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.379446, 0.38182, false, 0.379446, 0.38182, false, 0.379446, 0.38182, false, 0.379446, 0.38182]});
+ref.push({testName: 'precision.atan2.mediump_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.782835, 0.787961]});
+ref.push({testName: 'precision.atan2.mediump_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.379446, 0.38182]});
+ref.push({testName: 'precision.atan2.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.782835, 0.787961, false, 0.782835, 0.787961]});
+ref.push({testName: 'precision.atan2.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.379446, 0.38182, false, 0.379446, 0.38182]});
+ref.push({testName: 'precision.atan2.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.782835, 0.787961, false, 0.782835, 0.787961, false, 0.782835, 0.787961]});
+ref.push({testName: 'precision.atan2.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.379446, 0.38182, false, 0.379446, 0.38182, false, 0.379446, 0.38182]});
+ref.push({testName: 'precision.atan2.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.782835, 0.787961, false, 0.782835, 0.787961, false, 0.782835, 0.787961, false, 0.782835, 0.787961]});
+ref.push({testName: 'precision.atan2.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.379446, 0.38182, false, 0.379446, 0.38182, false, 0.379446, 0.38182, false, 0.379446, 0.38182]});
+ref.push({testName: 'precision.atan2.highp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.785398, 0.785398]});
+ref.push({testName: 'precision.atan2.highp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.380506, 0.380507]});
+ref.push({testName: 'precision.atan2.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.785398, 0.785398, false, 0.785398, 0.785398]});
+ref.push({testName: 'precision.atan2.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.380506, 0.380507, false, 0.380506, 0.380507]});
+ref.push({testName: 'precision.atan2.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.785398, 0.785398, false, 0.785398, 0.785398, false, 0.785398, 0.785398]});
+ref.push({testName: 'precision.atan2.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.380506, 0.380507, false, 0.380506, 0.380507, false, 0.380506, 0.380507]});
+ref.push({testName: 'precision.atan2.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.785398, 0.785398, false, 0.785398, 0.785398, false, 0.785398, 0.785398, false, 0.785398, 0.785398]});
+ref.push({testName: 'precision.atan2.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.380506, 0.380507, false, 0.380506, 0.380507, false, 0.380506, 0.380507, false, 0.380506, 0.380507]});
+ref.push({testName: 'precision.atan2.highp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.785398, 0.785398]});
+ref.push({testName: 'precision.atan2.highp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.380506, 0.380507]});
+ref.push({testName: 'precision.atan2.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.785398, 0.785398, false, 0.785398, 0.785398]});
+ref.push({testName: 'precision.atan2.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.380506, 0.380507, false, 0.380506, 0.380507]});
+ref.push({testName: 'precision.atan2.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.785398, 0.785398, false, 0.785398, 0.785398, false, 0.785398, 0.785398]});
+ref.push({testName: 'precision.atan2.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.380506, 0.380507, false, 0.380506, 0.380507, false, 0.380506, 0.380507]});
+ref.push({testName: 'precision.atan2.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.785398, 0.785398, false, 0.785398, 0.785398, false, 0.785398, 0.785398, false, 0.785398, 0.785398]});
+ref.push({testName: 'precision.atan2.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.380506, 0.380507, false, 0.380506, 0.380507, false, 0.380506, 0.380507, false, 0.380506, 0.380507]});
+ref.push({testName: 'precision.atan.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.177259, 0.216024]});
+ref.push({testName: 'precision.atan.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.448023, 0.479273]});
+ref.push({testName: 'precision.atan.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.177259, 0.216024, false, 0.177259, 0.216024]});
+ref.push({testName: 'precision.atan.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.448023, 0.479273, false, 0.448023, 0.479273]});
+ref.push({testName: 'precision.atan.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.177259, 0.216024, false, 0.177259, 0.216024, false, 0.177259, 0.216024]});
+ref.push({testName: 'precision.atan.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.448023, 0.479273, false, 0.448023, 0.479273, false, 0.448023, 0.479273]});
+ref.push({testName: 'precision.atan.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.177259, 0.216024, false, 0.177259, 0.216024, false, 0.177259, 0.216024, false, 0.177259, 0.216024]});
+ref.push({testName: 'precision.atan.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.448023, 0.479273, false, 0.448023, 0.479273, false, 0.448023, 0.479273, false, 0.448023, 0.479273]});
+ref.push({testName: 'precision.atan.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.177259, 0.216024]});
+ref.push({testName: 'precision.atan.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.448023, 0.479273]});
+ref.push({testName: 'precision.atan.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.177259, 0.216024, false, 0.177259, 0.216024]});
+ref.push({testName: 'precision.atan.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.448023, 0.479273, false, 0.448023, 0.479273]});
+ref.push({testName: 'precision.atan.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.177259, 0.216024, false, 0.177259, 0.216024, false, 0.177259, 0.216024]});
+ref.push({testName: 'precision.atan.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.448023, 0.479273, false, 0.448023, 0.479273, false, 0.448023, 0.479273]});
+ref.push({testName: 'precision.atan.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.177259, 0.216024, false, 0.177259, 0.216024, false, 0.177259, 0.216024, false, 0.177259, 0.216024]});
+ref.push({testName: 'precision.atan.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.448023, 0.479273, false, 0.448023, 0.479273, false, 0.448023, 0.479273, false, 0.448023, 0.479273]});
+ref.push({testName: 'precision.atan.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.19686, 0.198072]});
+ref.push({testName: 'precision.atan.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.462671, 0.464624]});
+ref.push({testName: 'precision.atan.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.19686, 0.198072, false, 0.19686, 0.198072]});
+ref.push({testName: 'precision.atan.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.462671, 0.464624, false, 0.462671, 0.464624]});
+ref.push({testName: 'precision.atan.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.19686, 0.198072, false, 0.19686, 0.198072, false, 0.19686, 0.198072]});
+ref.push({testName: 'precision.atan.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.462671, 0.464624, false, 0.462671, 0.464624, false, 0.462671, 0.464624]});
+ref.push({testName: 'precision.atan.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.19686, 0.198072, false, 0.19686, 0.198072, false, 0.19686, 0.198072, false, 0.19686, 0.198072]});
+ref.push({testName: 'precision.atan.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.462671, 0.464624, false, 0.462671, 0.464624, false, 0.462671, 0.464624, false, 0.462671, 0.464624]});
+ref.push({testName: 'precision.atan.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.19686, 0.198072]});
+ref.push({testName: 'precision.atan.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.462671, 0.464624]});
+ref.push({testName: 'precision.atan.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.19686, 0.198072, false, 0.19686, 0.198072]});
+ref.push({testName: 'precision.atan.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.462671, 0.464624, false, 0.462671, 0.464624]});
+ref.push({testName: 'precision.atan.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.19686, 0.198072, false, 0.19686, 0.198072, false, 0.19686, 0.198072]});
+ref.push({testName: 'precision.atan.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.462671, 0.464624, false, 0.462671, 0.464624, false, 0.462671, 0.464624]});
+ref.push({testName: 'precision.atan.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.19686, 0.198072, false, 0.19686, 0.198072, false, 0.19686, 0.198072, false, 0.19686, 0.198072]});
+ref.push({testName: 'precision.atan.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.462671, 0.464624, false, 0.462671, 0.464624, false, 0.462671, 0.464624, false, 0.462671, 0.464624]});
+ref.push({testName: 'precision.atan.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.197395, 0.197396]});
+ref.push({testName: 'precision.atan.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.463647, 0.463648]});
+ref.push({testName: 'precision.atan.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.197395, 0.197396, false, 0.197395, 0.197396]});
+ref.push({testName: 'precision.atan.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.463647, 0.463648, false, 0.463647, 0.463648]});
+ref.push({testName: 'precision.atan.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.197395, 0.197396, false, 0.197395, 0.197396, false, 0.197395, 0.197396]});
+ref.push({testName: 'precision.atan.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.463647, 0.463648, false, 0.463647, 0.463648, false, 0.463647, 0.463648]});
+ref.push({testName: 'precision.atan.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.197395, 0.197396, false, 0.197395, 0.197396, false, 0.197395, 0.197396, false, 0.197395, 0.197396]});
+ref.push({testName: 'precision.atan.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.463647, 0.463648, false, 0.463647, 0.463648, false, 0.463647, 0.463648, false, 0.463647, 0.463648]});
+ref.push({testName: 'precision.atan.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.197395, 0.197396]});
+ref.push({testName: 'precision.atan.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.463647, 0.463648]});
+ref.push({testName: 'precision.atan.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.197395, 0.197396, false, 0.197395, 0.197396]});
+ref.push({testName: 'precision.atan.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.463647, 0.463648, false, 0.463647, 0.463648]});
+ref.push({testName: 'precision.atan.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.197395, 0.197396, false, 0.197395, 0.197396, false, 0.197395, 0.197396]});
+ref.push({testName: 'precision.atan.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.463647, 0.463648, false, 0.463647, 0.463648, false, 0.463647, 0.463648]});
+ref.push({testName: 'precision.atan.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.197395, 0.197396, false, 0.197395, 0.197396, false, 0.197395, 0.197396, false, 0.197395, 0.197396]});
+ref.push({testName: 'precision.atan.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.463647, 0.463648, false, 0.463647, 0.463648, false, 0.463647, 0.463648, false, 0.463647, 0.463648]});
+ref.push({testName: 'precision.sinh.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sinh.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sinh.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sinh.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sinh.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sinh.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sinh.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sinh.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sinh.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sinh.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sinh.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sinh.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sinh.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sinh.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sinh.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sinh.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sinh.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.197144, 0.205688]});
+ref.push({testName: 'precision.sinh.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.51416, 0.528809]});
+ref.push({testName: 'precision.sinh.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.197144, 0.205688, false, 0.197144, 0.205688]});
+ref.push({testName: 'precision.sinh.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.51416, 0.528809, false, 0.51416, 0.528809]});
+ref.push({testName: 'precision.sinh.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.197144, 0.205688, false, 0.197144, 0.205688, false, 0.197144, 0.205688]});
+ref.push({testName: 'precision.sinh.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.51416, 0.528809, false, 0.51416, 0.528809, false, 0.51416, 0.528809]});
+ref.push({testName: 'precision.sinh.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.197144, 0.205688, false, 0.197144, 0.205688, false, 0.197144, 0.205688, false, 0.197144, 0.205688]});
+ref.push({testName: 'precision.sinh.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.51416, 0.528809, false, 0.51416, 0.528809, false, 0.51416, 0.528809, false, 0.51416, 0.528809]});
+ref.push({testName: 'precision.sinh.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.197144, 0.205688]});
+ref.push({testName: 'precision.sinh.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.51416, 0.528809]});
+ref.push({testName: 'precision.sinh.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.197144, 0.205688, false, 0.197144, 0.205688]});
+ref.push({testName: 'precision.sinh.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.51416, 0.528809, false, 0.51416, 0.528809]});
+ref.push({testName: 'precision.sinh.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.197144, 0.205688, false, 0.197144, 0.205688, false, 0.197144, 0.205688]});
+ref.push({testName: 'precision.sinh.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.51416, 0.528809, false, 0.51416, 0.528809, false, 0.51416, 0.528809]});
+ref.push({testName: 'precision.sinh.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.197144, 0.205688, false, 0.197144, 0.205688, false, 0.197144, 0.205688, false, 0.197144, 0.205688]});
+ref.push({testName: 'precision.sinh.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.51416, 0.528809, false, 0.51416, 0.528809, false, 0.51416, 0.528809, false, 0.51416, 0.528809]});
+ref.push({testName: 'precision.sinh.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.201336, 0.201336]});
+ref.push({testName: 'precision.sinh.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.521095, 0.521096]});
+ref.push({testName: 'precision.sinh.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.201336, 0.201336, false, 0.201336, 0.201336]});
+ref.push({testName: 'precision.sinh.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.521095, 0.521096, false, 0.521095, 0.521096]});
+ref.push({testName: 'precision.sinh.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.201336, 0.201336, false, 0.201336, 0.201336, false, 0.201336, 0.201336]});
+ref.push({testName: 'precision.sinh.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.521095, 0.521096, false, 0.521095, 0.521096, false, 0.521095, 0.521096]});
+ref.push({testName: 'precision.sinh.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.201336, 0.201336, false, 0.201336, 0.201336, false, 0.201336, 0.201336, false, 0.201336, 0.201336]});
+ref.push({testName: 'precision.sinh.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.521095, 0.521096, false, 0.521095, 0.521096, false, 0.521095, 0.521096, false, 0.521095, 0.521096]});
+ref.push({testName: 'precision.sinh.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.201336, 0.201336]});
+ref.push({testName: 'precision.sinh.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.521095, 0.521096]});
+ref.push({testName: 'precision.sinh.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.201336, 0.201336, false, 0.201336, 0.201336]});
+ref.push({testName: 'precision.sinh.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.521095, 0.521096, false, 0.521095, 0.521096]});
+ref.push({testName: 'precision.sinh.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.201336, 0.201336, false, 0.201336, 0.201336, false, 0.201336, 0.201336]});
+ref.push({testName: 'precision.sinh.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.521095, 0.521096, false, 0.521095, 0.521096, false, 0.521095, 0.521096]});
+ref.push({testName: 'precision.sinh.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.201336, 0.201336, false, 0.201336, 0.201336, false, 0.201336, 0.201336, false, 0.201336, 0.201336]});
+ref.push({testName: 'precision.sinh.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.521095, 0.521096, false, 0.521095, 0.521096, false, 0.521095, 0.521096, false, 0.521095, 0.521096]});
+ref.push({testName: 'precision.cosh.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.cosh.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.cosh.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.cosh.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.cosh.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.cosh.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.cosh.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.cosh.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.cosh.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.cosh.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.cosh.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.cosh.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.cosh.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.cosh.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.cosh.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.cosh.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.cosh.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1.01074, 1.03027]});
+ref.push({testName: 'precision.cosh.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1.11816, 1.1377]});
+ref.push({testName: 'precision.cosh.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.01074, 1.03027, false, 1.01074, 1.03027]});
+ref.push({testName: 'precision.cosh.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.11816, 1.1377, false, 1.11816, 1.1377]});
+ref.push({testName: 'precision.cosh.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.01074, 1.03027, false, 1.01074, 1.03027, false, 1.01074, 1.03027]});
+ref.push({testName: 'precision.cosh.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.11816, 1.1377, false, 1.11816, 1.1377, false, 1.11816, 1.1377]});
+ref.push({testName: 'precision.cosh.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.01074, 1.03027, false, 1.01074, 1.03027, false, 1.01074, 1.03027, false, 1.01074, 1.03027]});
+ref.push({testName: 'precision.cosh.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.11816, 1.1377, false, 1.11816, 1.1377, false, 1.11816, 1.1377, false, 1.11816, 1.1377]});
+ref.push({testName: 'precision.cosh.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1.01074, 1.03027]});
+ref.push({testName: 'precision.cosh.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1.11816, 1.1377]});
+ref.push({testName: 'precision.cosh.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.01074, 1.03027, false, 1.01074, 1.03027]});
+ref.push({testName: 'precision.cosh.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.11816, 1.1377, false, 1.11816, 1.1377]});
+ref.push({testName: 'precision.cosh.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.01074, 1.03027, false, 1.01074, 1.03027, false, 1.01074, 1.03027]});
+ref.push({testName: 'precision.cosh.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.11816, 1.1377, false, 1.11816, 1.1377, false, 1.11816, 1.1377]});
+ref.push({testName: 'precision.cosh.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.01074, 1.03027, false, 1.01074, 1.03027, false, 1.01074, 1.03027, false, 1.01074, 1.03027]});
+ref.push({testName: 'precision.cosh.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.11816, 1.1377, false, 1.11816, 1.1377, false, 1.11816, 1.1377, false, 1.11816, 1.1377]});
+ref.push({testName: 'precision.cosh.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1.02007, 1.02007]});
+ref.push({testName: 'precision.cosh.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1.12763, 1.12763]});
+ref.push({testName: 'precision.cosh.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.02007, 1.02007, false, 1.02007, 1.02007]});
+ref.push({testName: 'precision.cosh.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.12763, 1.12763, false, 1.12763, 1.12763]});
+ref.push({testName: 'precision.cosh.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.02007, 1.02007, false, 1.02007, 1.02007, false, 1.02007, 1.02007]});
+ref.push({testName: 'precision.cosh.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.12763, 1.12763, false, 1.12763, 1.12763, false, 1.12763, 1.12763]});
+ref.push({testName: 'precision.cosh.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.02007, 1.02007, false, 1.02007, 1.02007, false, 1.02007, 1.02007, false, 1.02007, 1.02007]});
+ref.push({testName: 'precision.cosh.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.12763, 1.12763, false, 1.12763, 1.12763, false, 1.12763, 1.12763, false, 1.12763, 1.12763]});
+ref.push({testName: 'precision.cosh.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1.02007, 1.02007]});
+ref.push({testName: 'precision.cosh.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1.12763, 1.12763]});
+ref.push({testName: 'precision.cosh.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.02007, 1.02007, false, 1.02007, 1.02007]});
+ref.push({testName: 'precision.cosh.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.12763, 1.12763, false, 1.12763, 1.12763]});
+ref.push({testName: 'precision.cosh.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.02007, 1.02007, false, 1.02007, 1.02007, false, 1.02007, 1.02007]});
+ref.push({testName: 'precision.cosh.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.12763, 1.12763, false, 1.12763, 1.12763, false, 1.12763, 1.12763]});
+ref.push({testName: 'precision.cosh.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.02007, 1.02007, false, 1.02007, 1.02007, false, 1.02007, 1.02007, false, 1.02007, 1.02007]});
+ref.push({testName: 'precision.cosh.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.12763, 1.12763, false, 1.12763, 1.12763, false, 1.12763, 1.12763, false, 1.12763, 1.12763]});
+ref.push({testName: 'precision.tanh.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.tanh.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.tanh.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.tanh.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.tanh.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.tanh.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.tanh.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.tanh.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.tanh.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.tanh.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.tanh.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.tanh.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.tanh.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.tanh.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.tanh.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.tanh.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.tanh.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.19074, 0.204113]});
+ref.push({testName: 'precision.tanh.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.450711, 0.474146]});
+ref.push({testName: 'precision.tanh.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.19074, 0.204113, false, 0.19074, 0.204113]});
+ref.push({testName: 'precision.tanh.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.450711, 0.474146, false, 0.450711, 0.474146]});
+ref.push({testName: 'precision.tanh.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.19074, 0.204113, false, 0.19074, 0.204113, false, 0.19074, 0.204113]});
+ref.push({testName: 'precision.tanh.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.450711, 0.474146, false, 0.450711, 0.474146, false, 0.450711, 0.474146]});
+ref.push({testName: 'precision.tanh.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.19074, 0.204113, false, 0.19074, 0.204113, false, 0.19074, 0.204113, false, 0.19074, 0.204113]});
+ref.push({testName: 'precision.tanh.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.450711, 0.474146, false, 0.450711, 0.474146, false, 0.450711, 0.474146, false, 0.450711, 0.474146]});
+ref.push({testName: 'precision.tanh.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.19074, 0.204113]});
+ref.push({testName: 'precision.tanh.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.450711, 0.474146]});
+ref.push({testName: 'precision.tanh.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.19074, 0.204113, false, 0.19074, 0.204113]});
+ref.push({testName: 'precision.tanh.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.450711, 0.474146, false, 0.450711, 0.474146]});
+ref.push({testName: 'precision.tanh.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.19074, 0.204113, false, 0.19074, 0.204113, false, 0.19074, 0.204113]});
+ref.push({testName: 'precision.tanh.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.450711, 0.474146, false, 0.450711, 0.474146, false, 0.450711, 0.474146]});
+ref.push({testName: 'precision.tanh.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.19074, 0.204113, false, 0.19074, 0.204113, false, 0.19074, 0.204113, false, 0.19074, 0.204113]});
+ref.push({testName: 'precision.tanh.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.450711, 0.474146, false, 0.450711, 0.474146, false, 0.450711, 0.474146, false, 0.450711, 0.474146]});
+ref.push({testName: 'precision.tanh.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.197375, 0.197376]});
+ref.push({testName: 'precision.tanh.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.462116, 0.462118]});
+ref.push({testName: 'precision.tanh.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.197375, 0.197376, false, 0.197375, 0.197376]});
+ref.push({testName: 'precision.tanh.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.462116, 0.462118, false, 0.462116, 0.462118]});
+ref.push({testName: 'precision.tanh.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.197375, 0.197376, false, 0.197375, 0.197376, false, 0.197375, 0.197376]});
+ref.push({testName: 'precision.tanh.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.462116, 0.462118, false, 0.462116, 0.462118, false, 0.462116, 0.462118]});
+ref.push({testName: 'precision.tanh.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.197375, 0.197376, false, 0.197375, 0.197376, false, 0.197375, 0.197376, false, 0.197375, 0.197376]});
+ref.push({testName: 'precision.tanh.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.462116, 0.462118, false, 0.462116, 0.462118, false, 0.462116, 0.462118, false, 0.462116, 0.462118]});
+ref.push({testName: 'precision.tanh.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.197375, 0.197376]});
+ref.push({testName: 'precision.tanh.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.462116, 0.462118]});
+ref.push({testName: 'precision.tanh.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.197375, 0.197376, false, 0.197375, 0.197376]});
+ref.push({testName: 'precision.tanh.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.462116, 0.462118, false, 0.462116, 0.462118]});
+ref.push({testName: 'precision.tanh.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.197375, 0.197376, false, 0.197375, 0.197376, false, 0.197375, 0.197376]});
+ref.push({testName: 'precision.tanh.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.462116, 0.462118, false, 0.462116, 0.462118, false, 0.462116, 0.462118]});
+ref.push({testName: 'precision.tanh.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.197375, 0.197376, false, 0.197375, 0.197376, false, 0.197375, 0.197376, false, 0.197375, 0.197376]});
+ref.push({testName: 'precision.tanh.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.462116, 0.462118, false, 0.462116, 0.462118, false, 0.462116, 0.462118, false, 0.462116, 0.462118]});
+ref.push({testName: 'precision.asinh.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.asinh.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.asinh.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.asinh.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.asinh.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.asinh.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.asinh.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.asinh.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.asinh.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.asinh.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.asinh.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.asinh.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.asinh.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.asinh.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.asinh.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.asinh.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.asinh.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.183582, 0.213619]});
+ref.push({testName: 'precision.asinh.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.468033, 0.494521]});
+ref.push({testName: 'precision.asinh.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.183582, 0.213619, false, 0.183582, 0.213619]});
+ref.push({testName: 'precision.asinh.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.468033, 0.494521, false, 0.468033, 0.494521]});
+ref.push({testName: 'precision.asinh.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.183582, 0.213619, false, 0.183582, 0.213619, false, 0.183582, 0.213619]});
+ref.push({testName: 'precision.asinh.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.468033, 0.494521, false, 0.468033, 0.494521, false, 0.468033, 0.494521]});
+ref.push({testName: 'precision.asinh.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.183582, 0.213619, false, 0.183582, 0.213619, false, 0.183582, 0.213619, false, 0.183582, 0.213619]});
+ref.push({testName: 'precision.asinh.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.468033, 0.494521, false, 0.468033, 0.494521, false, 0.468033, 0.494521, false, 0.468033, 0.494521]});
+ref.push({testName: 'precision.asinh.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.183582, 0.213619]});
+ref.push({testName: 'precision.asinh.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.468033, 0.494521]});
+ref.push({testName: 'precision.asinh.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.183582, 0.213619, false, 0.183582, 0.213619]});
+ref.push({testName: 'precision.asinh.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.468033, 0.494521, false, 0.468033, 0.494521]});
+ref.push({testName: 'precision.asinh.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.183582, 0.213619, false, 0.183582, 0.213619, false, 0.183582, 0.213619]});
+ref.push({testName: 'precision.asinh.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.468033, 0.494521, false, 0.468033, 0.494521, false, 0.468033, 0.494521]});
+ref.push({testName: 'precision.asinh.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.183582, 0.213619, false, 0.183582, 0.213619, false, 0.183582, 0.213619, false, 0.183582, 0.213619]});
+ref.push({testName: 'precision.asinh.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.468033, 0.494521, false, 0.468033, 0.494521, false, 0.468033, 0.494521, false, 0.468033, 0.494521]});
+ref.push({testName: 'precision.asinh.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.198689, 0.198691]});
+ref.push({testName: 'precision.asinh.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.481211, 0.481213]});
+ref.push({testName: 'precision.asinh.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.198689, 0.198691, false, 0.198689, 0.198691]});
+ref.push({testName: 'precision.asinh.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.481211, 0.481213, false, 0.481211, 0.481213]});
+ref.push({testName: 'precision.asinh.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.198689, 0.198691, false, 0.198689, 0.198691, false, 0.198689, 0.198691]});
+ref.push({testName: 'precision.asinh.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.481211, 0.481213, false, 0.481211, 0.481213, false, 0.481211, 0.481213]});
+ref.push({testName: 'precision.asinh.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.198689, 0.198691, false, 0.198689, 0.198691, false, 0.198689, 0.198691, false, 0.198689, 0.198691]});
+ref.push({testName: 'precision.asinh.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.481211, 0.481213, false, 0.481211, 0.481213, false, 0.481211, 0.481213, false, 0.481211, 0.481213]});
+ref.push({testName: 'precision.asinh.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.198689, 0.198691]});
+ref.push({testName: 'precision.asinh.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.481211, 0.481213]});
+ref.push({testName: 'precision.asinh.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.198689, 0.198691, false, 0.198689, 0.198691]});
+ref.push({testName: 'precision.asinh.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.481211, 0.481213, false, 0.481211, 0.481213]});
+ref.push({testName: 'precision.asinh.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.198689, 0.198691, false, 0.198689, 0.198691, false, 0.198689, 0.198691]});
+ref.push({testName: 'precision.asinh.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.481211, 0.481213, false, 0.481211, 0.481213, false, 0.481211, 0.481213]});
+ref.push({testName: 'precision.asinh.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.198689, 0.198691, false, 0.198689, 0.198691, false, 0.198689, 0.198691, false, 0.198689, 0.198691]});
+ref.push({testName: 'precision.asinh.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.481211, 0.481213, false, 0.481211, 0.481213, false, 0.481211, 0.481213, false, 0.481211, 0.481213]});
+ref.push({testName: 'precision.acosh.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.acosh.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.atanh.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.atanh.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.atanh.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.atanh.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.atanh.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.atanh.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.atanh.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.atanh.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.atanh.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.atanh.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.atanh.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.atanh.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.atanh.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.atanh.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.atanh.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.atanh.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.atanh.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.196289, 0.208984]});
+ref.push({testName: 'precision.atanh.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.544922, 0.553711]});
+ref.push({testName: 'precision.atanh.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.196289, 0.208984, false, 0.196289, 0.208984]});
+ref.push({testName: 'precision.atanh.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.544922, 0.553711, false, 0.544922, 0.553711]});
+ref.push({testName: 'precision.atanh.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.196289, 0.208984, false, 0.196289, 0.208984, false, 0.196289, 0.208984]});
+ref.push({testName: 'precision.atanh.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.544922, 0.553711, false, 0.544922, 0.553711, false, 0.544922, 0.553711]});
+ref.push({testName: 'precision.atanh.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.196289, 0.208984, false, 0.196289, 0.208984, false, 0.196289, 0.208984, false, 0.196289, 0.208984]});
+ref.push({testName: 'precision.atanh.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.544922, 0.553711, false, 0.544922, 0.553711, false, 0.544922, 0.553711, false, 0.544922, 0.553711]});
+ref.push({testName: 'precision.atanh.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.196289, 0.208984]});
+ref.push({testName: 'precision.atanh.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.544922, 0.553711]});
+ref.push({testName: 'precision.atanh.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.196289, 0.208984, false, 0.196289, 0.208984]});
+ref.push({testName: 'precision.atanh.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.544922, 0.553711, false, 0.544922, 0.553711]});
+ref.push({testName: 'precision.atanh.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.196289, 0.208984, false, 0.196289, 0.208984, false, 0.196289, 0.208984]});
+ref.push({testName: 'precision.atanh.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.544922, 0.553711, false, 0.544922, 0.553711, false, 0.544922, 0.553711]});
+ref.push({testName: 'precision.atanh.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.196289, 0.208984, false, 0.196289, 0.208984, false, 0.196289, 0.208984, false, 0.196289, 0.208984]});
+ref.push({testName: 'precision.atanh.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.544922, 0.553711, false, 0.544922, 0.553711, false, 0.544922, 0.553711, false, 0.544922, 0.553711]});
+ref.push({testName: 'precision.atanh.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.202732, 0.202733]});
+ref.push({testName: 'precision.atanh.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.549306, 0.549306]});
+ref.push({testName: 'precision.atanh.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.202732, 0.202733, false, 0.202732, 0.202733]});
+ref.push({testName: 'precision.atanh.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.549306, 0.549306, false, 0.549306, 0.549306]});
+ref.push({testName: 'precision.atanh.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.202732, 0.202733, false, 0.202732, 0.202733, false, 0.202732, 0.202733]});
+ref.push({testName: 'precision.atanh.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.549306, 0.549306, false, 0.549306, 0.549306, false, 0.549306, 0.549306]});
+ref.push({testName: 'precision.atanh.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.202732, 0.202733, false, 0.202732, 0.202733, false, 0.202732, 0.202733, false, 0.202732, 0.202733]});
+ref.push({testName: 'precision.atanh.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.549306, 0.549306, false, 0.549306, 0.549306, false, 0.549306, 0.549306, false, 0.549306, 0.549306]});
+ref.push({testName: 'precision.atanh.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.202732, 0.202733]});
+ref.push({testName: 'precision.atanh.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.549306, 0.549306]});
+ref.push({testName: 'precision.atanh.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.202732, 0.202733, false, 0.202732, 0.202733]});
+ref.push({testName: 'precision.atanh.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.549306, 0.549306, false, 0.549306, 0.549306]});
+ref.push({testName: 'precision.atanh.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.202732, 0.202733, false, 0.202732, 0.202733, false, 0.202732, 0.202733]});
+ref.push({testName: 'precision.atanh.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.549306, 0.549306, false, 0.549306, 0.549306, false, 0.549306, 0.549306]});
+ref.push({testName: 'precision.atanh.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.202732, 0.202733, false, 0.202732, 0.202733, false, 0.202732, 0.202733, false, 0.202732, 0.202733]});
+ref.push({testName: 'precision.atanh.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.549306, 0.549306, false, 0.549306, 0.549306, false, 0.549306, 0.549306, false, 0.549306, 0.549306]});
+ref.push({testName: 'precision.pow.lowp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0, 0.782566]});
+ref.push({testName: 'precision.pow.lowp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0, 0.51834]});
+ref.push({testName: 'precision.pow.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0, 0.782566, false, 0, 0.782566]});
+ref.push({testName: 'precision.pow.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0, 0.51834, false, 0, 0.51834]});
+ref.push({testName: 'precision.pow.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0, 0.782566, false, 0, 0.782566, false, 0, 0.782566]});
+ref.push({testName: 'precision.pow.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0, 0.51834, false, 0, 0.51834, false, 0, 0.51834]});
+ref.push({testName: 'precision.pow.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0, 0.782566, false, 0, 0.782566, false, 0, 0.782566, false, 0, 0.782566]});
+ref.push({testName: 'precision.pow.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0, 0.51834, false, 0, 0.51834, false, 0, 0.51834, false, 0, 0.51834]});
+ref.push({testName: 'precision.pow.lowp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0, 0.782566]});
+ref.push({testName: 'precision.pow.lowp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0, 0.51834]});
+ref.push({testName: 'precision.pow.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0, 0.782566, false, 0, 0.782566]});
+ref.push({testName: 'precision.pow.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0, 0.51834, false, 0, 0.51834]});
+ref.push({testName: 'precision.pow.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0, 0.782566, false, 0, 0.782566, false, 0, 0.782566]});
+ref.push({testName: 'precision.pow.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0, 0.51834, false, 0, 0.51834, false, 0, 0.51834]});
+ref.push({testName: 'precision.pow.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0, 0.782566, false, 0, 0.782566, false, 0, 0.782566, false, 0, 0.782566]});
+ref.push({testName: 'precision.pow.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0, 0.51834, false, 0, 0.51834, false, 0, 0.51834, false, 0, 0.51834]});
+ref.push({testName: 'precision.pow.mediump_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.720704, 0.728633]});
+ref.push({testName: 'precision.pow.mediump_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.443535, 0.450783]});
+ref.push({testName: 'precision.pow.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.720704, 0.728633, false, 0.720704, 0.728633]});
+ref.push({testName: 'precision.pow.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.443535, 0.450783, false, 0.443535, 0.450783]});
+ref.push({testName: 'precision.pow.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.720704, 0.728633, false, 0.720704, 0.728633, false, 0.720704, 0.728633]});
+ref.push({testName: 'precision.pow.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.443535, 0.450783, false, 0.443535, 0.450783, false, 0.443535, 0.450783]});
+ref.push({testName: 'precision.pow.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.720704, 0.728633, false, 0.720704, 0.728633, false, 0.720704, 0.728633, false, 0.720704, 0.728633]});
+ref.push({testName: 'precision.pow.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.443535, 0.450783, false, 0.443535, 0.450783, false, 0.443535, 0.450783, false, 0.443535, 0.450783]});
+ref.push({testName: 'precision.pow.mediump_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.720704, 0.728633]});
+ref.push({testName: 'precision.pow.mediump_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.443535, 0.450783]});
+ref.push({testName: 'precision.pow.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.720704, 0.728633, false, 0.720704, 0.728633]});
+ref.push({testName: 'precision.pow.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.443535, 0.450783, false, 0.443535, 0.450783]});
+ref.push({testName: 'precision.pow.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.720704, 0.728633, false, 0.720704, 0.728633, false, 0.720704, 0.728633]});
+ref.push({testName: 'precision.pow.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.443535, 0.450783, false, 0.443535, 0.450783, false, 0.443535, 0.450783]});
+ref.push({testName: 'precision.pow.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.720704, 0.728633, false, 0.720704, 0.728633, false, 0.720704, 0.728633, false, 0.720704, 0.728633]});
+ref.push({testName: 'precision.pow.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.443535, 0.450783, false, 0.443535, 0.450783, false, 0.443535, 0.450783, false, 0.443535, 0.450783]});
+ref.push({testName: 'precision.pow.highp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.724779, 0.72478]});
+ref.push({testName: 'precision.pow.highp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.447213, 0.447214]});
+ref.push({testName: 'precision.pow.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.724779, 0.72478, false, 0.724779, 0.72478]});
+ref.push({testName: 'precision.pow.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.447213, 0.447214, false, 0.447213, 0.447214]});
+ref.push({testName: 'precision.pow.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.724779, 0.72478, false, 0.724779, 0.72478, false, 0.724779, 0.72478]});
+ref.push({testName: 'precision.pow.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.447213, 0.447214, false, 0.447213, 0.447214, false, 0.447213, 0.447214]});
+ref.push({testName: 'precision.pow.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.724779, 0.72478, false, 0.724779, 0.72478, false, 0.724779, 0.72478, false, 0.724779, 0.72478]});
+ref.push({testName: 'precision.pow.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.447213, 0.447214, false, 0.447213, 0.447214, false, 0.447213, 0.447214, false, 0.447213, 0.447214]});
+ref.push({testName: 'precision.pow.highp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.724779, 0.72478]});
+ref.push({testName: 'precision.pow.highp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.447213, 0.447214]});
+ref.push({testName: 'precision.pow.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.724779, 0.72478, false, 0.724779, 0.72478]});
+ref.push({testName: 'precision.pow.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.447213, 0.447214, false, 0.447213, 0.447214]});
+ref.push({testName: 'precision.pow.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.724779, 0.72478, false, 0.724779, 0.72478, false, 0.724779, 0.72478]});
+ref.push({testName: 'precision.pow.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.447213, 0.447214, false, 0.447213, 0.447214, false, 0.447213, 0.447214]});
+ref.push({testName: 'precision.pow.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.724779, 0.72478, false, 0.724779, 0.72478, false, 0.724779, 0.72478, false, 0.724779, 0.72478]});
+ref.push({testName: 'precision.pow.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.447213, 0.447214, false, 0.447213, 0.447214, false, 0.447213, 0.447214, false, 0.447213, 0.447214]});
+ref.push({testName: 'precision.exp.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1.20007, 1.24085]});
+ref.push({testName: 'precision.exp.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1.6331, 1.66435]});
+ref.push({testName: 'precision.exp.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.20007, 1.24085, false, 1.20007, 1.24085]});
+ref.push({testName: 'precision.exp.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.6331, 1.66435, false, 1.6331, 1.66435]});
+ref.push({testName: 'precision.exp.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.20007, 1.24085, false, 1.20007, 1.24085, false, 1.20007, 1.24085]});
+ref.push({testName: 'precision.exp.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.6331, 1.66435, false, 1.6331, 1.66435, false, 1.6331, 1.66435]});
+ref.push({testName: 'precision.exp.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.20007, 1.24085, false, 1.20007, 1.24085, false, 1.20007, 1.24085, false, 1.20007, 1.24085]});
+ref.push({testName: 'precision.exp.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.6331, 1.66435, false, 1.6331, 1.66435, false, 1.6331, 1.66435, false, 1.6331, 1.66435]});
+ref.push({testName: 'precision.exp.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1.20007, 1.24085]});
+ref.push({testName: 'precision.exp.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1.6331, 1.66435]});
+ref.push({testName: 'precision.exp.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.20007, 1.24085, false, 1.20007, 1.24085]});
+ref.push({testName: 'precision.exp.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.6331, 1.66435, false, 1.6331, 1.66435]});
+ref.push({testName: 'precision.exp.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.20007, 1.24085, false, 1.20007, 1.24085, false, 1.20007, 1.24085]});
+ref.push({testName: 'precision.exp.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.6331, 1.66435, false, 1.6331, 1.66435, false, 1.6331, 1.66435]});
+ref.push({testName: 'precision.exp.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.20007, 1.24085, false, 1.20007, 1.24085, false, 1.20007, 1.24085, false, 1.20007, 1.24085]});
+ref.push({testName: 'precision.exp.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.6331, 1.66435, false, 1.6331, 1.66435, false, 1.6331, 1.66435, false, 1.6331, 1.66435]});
+ref.push({testName: 'precision.exp.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1.21666, 1.22633]});
+ref.push({testName: 'precision.exp.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1.64286, 1.65458]});
+ref.push({testName: 'precision.exp.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.21666, 1.22633, false, 1.21666, 1.22633]});
+ref.push({testName: 'precision.exp.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.64286, 1.65458, false, 1.64286, 1.65458]});
+ref.push({testName: 'precision.exp.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.21666, 1.22633, false, 1.21666, 1.22633, false, 1.21666, 1.22633]});
+ref.push({testName: 'precision.exp.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.64286, 1.65458, false, 1.64286, 1.65458, false, 1.64286, 1.65458]});
+ref.push({testName: 'precision.exp.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.21666, 1.22633, false, 1.21666, 1.22633, false, 1.21666, 1.22633, false, 1.21666, 1.22633]});
+ref.push({testName: 'precision.exp.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.64286, 1.65458, false, 1.64286, 1.65458, false, 1.64286, 1.65458, false, 1.64286, 1.65458]});
+ref.push({testName: 'precision.exp.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1.21666, 1.22633]});
+ref.push({testName: 'precision.exp.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1.64286, 1.65458]});
+ref.push({testName: 'precision.exp.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.21666, 1.22633, false, 1.21666, 1.22633]});
+ref.push({testName: 'precision.exp.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.64286, 1.65458, false, 1.64286, 1.65458]});
+ref.push({testName: 'precision.exp.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.21666, 1.22633, false, 1.21666, 1.22633, false, 1.21666, 1.22633]});
+ref.push({testName: 'precision.exp.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.64286, 1.65458, false, 1.64286, 1.65458, false, 1.64286, 1.65458]});
+ref.push({testName: 'precision.exp.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.21666, 1.22633, false, 1.21666, 1.22633, false, 1.21666, 1.22633, false, 1.21666, 1.22633]});
+ref.push({testName: 'precision.exp.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.64286, 1.65458, false, 1.64286, 1.65458, false, 1.64286, 1.65458, false, 1.64286, 1.65458]});
+ref.push({testName: 'precision.exp.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1.2214, 1.2214]});
+ref.push({testName: 'precision.exp.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1.64872, 1.64872]});
+ref.push({testName: 'precision.exp.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.2214, 1.2214, false, 1.2214, 1.2214]});
+ref.push({testName: 'precision.exp.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.64872, 1.64872, false, 1.64872, 1.64872]});
+ref.push({testName: 'precision.exp.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.2214, 1.2214, false, 1.2214, 1.2214, false, 1.2214, 1.2214]});
+ref.push({testName: 'precision.exp.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.64872, 1.64872, false, 1.64872, 1.64872, false, 1.64872, 1.64872]});
+ref.push({testName: 'precision.exp.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.2214, 1.2214, false, 1.2214, 1.2214, false, 1.2214, 1.2214, false, 1.2214, 1.2214]});
+ref.push({testName: 'precision.exp.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.64872, 1.64872, false, 1.64872, 1.64872, false, 1.64872, 1.64872, false, 1.64872, 1.64872]});
+ref.push({testName: 'precision.exp.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1.2214, 1.2214]});
+ref.push({testName: 'precision.exp.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1.64872, 1.64872]});
+ref.push({testName: 'precision.exp.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.2214, 1.2214, false, 1.2214, 1.2214]});
+ref.push({testName: 'precision.exp.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.64872, 1.64872, false, 1.64872, 1.64872]});
+ref.push({testName: 'precision.exp.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.2214, 1.2214, false, 1.2214, 1.2214, false, 1.2214, 1.2214]});
+ref.push({testName: 'precision.exp.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.64872, 1.64872, false, 1.64872, 1.64872, false, 1.64872, 1.64872]});
+ref.push({testName: 'precision.exp.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.2214, 1.2214, false, 1.2214, 1.2214, false, 1.2214, 1.2214, false, 1.2214, 1.2214]});
+ref.push({testName: 'precision.exp.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.64872, 1.64872, false, 1.64872, 1.64872, false, 1.64872, 1.64872, false, 1.64872, 1.64872]});
+ref.push({testName: 'precision.log.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, -1.64878, -1.57831]});
+ref.push({testName: 'precision.log.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, -0.708772, -0.677522]});
+ref.push({testName: 'precision.log.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -1.64878, -1.57831, false, -1.64878, -1.57831]});
+ref.push({testName: 'precision.log.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -0.708772, -0.677522, false, -0.708772, -0.677522]});
+ref.push({testName: 'precision.log.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -1.64878, -1.57831, false, -1.64878, -1.57831, false, -1.64878, -1.57831]});
+ref.push({testName: 'precision.log.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -0.708772, -0.677522, false, -0.708772, -0.677522, false, -0.708772, -0.677522]});
+ref.push({testName: 'precision.log.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -1.64878, -1.57831, false, -1.64878, -1.57831, false, -1.64878, -1.57831, false, -1.64878, -1.57831]});
+ref.push({testName: 'precision.log.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -0.708772, -0.677522, false, -0.708772, -0.677522, false, -0.708772, -0.677522, false, -0.708772, -0.677522]});
+ref.push({testName: 'precision.log.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, -1.64878, -1.57831]});
+ref.push({testName: 'precision.log.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, -0.708772, -0.677522]});
+ref.push({testName: 'precision.log.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -1.64878, -1.57831, false, -1.64878, -1.57831]});
+ref.push({testName: 'precision.log.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -0.708772, -0.677522, false, -0.708772, -0.677522]});
+ref.push({testName: 'precision.log.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -1.64878, -1.57831, false, -1.64878, -1.57831, false, -1.64878, -1.57831]});
+ref.push({testName: 'precision.log.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -0.708772, -0.677522, false, -0.708772, -0.677522, false, -0.708772, -0.677522]});
+ref.push({testName: 'precision.log.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -1.64878, -1.57831, false, -1.64878, -1.57831, false, -1.64878, -1.57831, false, -1.64878, -1.57831]});
+ref.push({testName: 'precision.log.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -0.708772, -0.677522, false, -0.708772, -0.677522, false, -0.708772, -0.677522, false, -0.708772, -0.677522]});
+ref.push({testName: 'precision.log.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, -1.61359, -1.60456]});
+ref.push({testName: 'precision.log.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, -0.70096, -0.685335]});
+ref.push({testName: 'precision.log.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -1.61359, -1.60456, false, -1.61359, -1.60456]});
+ref.push({testName: 'precision.log.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -0.70096, -0.685335, false, -0.70096, -0.685335]});
+ref.push({testName: 'precision.log.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -1.61359, -1.60456, false, -1.61359, -1.60456, false, -1.61359, -1.60456]});
+ref.push({testName: 'precision.log.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -0.70096, -0.685335, false, -0.70096, -0.685335, false, -0.70096, -0.685335]});
+ref.push({testName: 'precision.log.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -1.61359, -1.60456, false, -1.61359, -1.60456, false, -1.61359, -1.60456, false, -1.61359, -1.60456]});
+ref.push({testName: 'precision.log.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -0.70096, -0.685335, false, -0.70096, -0.685335, false, -0.70096, -0.685335, false, -0.70096, -0.685335]});
+ref.push({testName: 'precision.log.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, -1.61359, -1.60456]});
+ref.push({testName: 'precision.log.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, -0.70096, -0.685335]});
+ref.push({testName: 'precision.log.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -1.61359, -1.60456, false, -1.61359, -1.60456]});
+ref.push({testName: 'precision.log.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -0.70096, -0.685335, false, -0.70096, -0.685335]});
+ref.push({testName: 'precision.log.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -1.61359, -1.60456, false, -1.61359, -1.60456, false, -1.61359, -1.60456]});
+ref.push({testName: 'precision.log.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -0.70096, -0.685335, false, -0.70096, -0.685335, false, -0.70096, -0.685335]});
+ref.push({testName: 'precision.log.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -1.61359, -1.60456, false, -1.61359, -1.60456, false, -1.61359, -1.60456, false, -1.61359, -1.60456]});
+ref.push({testName: 'precision.log.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -0.70096, -0.685335, false, -0.70096, -0.685335, false, -0.70096, -0.685335, false, -0.70096, -0.685335]});
+ref.push({testName: 'precision.log.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, -1.60944, -1.60944]});
+ref.push({testName: 'precision.log.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, -0.693148, -0.693147]});
+ref.push({testName: 'precision.log.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -1.60944, -1.60944, false, -1.60944, -1.60944]});
+ref.push({testName: 'precision.log.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -0.693148, -0.693147, false, -0.693148, -0.693147]});
+ref.push({testName: 'precision.log.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -1.60944, -1.60944, false, -1.60944, -1.60944, false, -1.60944, -1.60944]});
+ref.push({testName: 'precision.log.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -0.693148, -0.693147, false, -0.693148, -0.693147, false, -0.693148, -0.693147]});
+ref.push({testName: 'precision.log.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -1.60944, -1.60944, false, -1.60944, -1.60944, false, -1.60944, -1.60944, false, -1.60944, -1.60944]});
+ref.push({testName: 'precision.log.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -0.693148, -0.693147, false, -0.693148, -0.693147, false, -0.693148, -0.693147, false, -0.693148, -0.693147]});
+ref.push({testName: 'precision.log.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, -1.60944, -1.60944]});
+ref.push({testName: 'precision.log.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, -0.693148, -0.693147]});
+ref.push({testName: 'precision.log.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -1.60944, -1.60944, false, -1.60944, -1.60944]});
+ref.push({testName: 'precision.log.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -0.693148, -0.693147, false, -0.693148, -0.693147]});
+ref.push({testName: 'precision.log.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -1.60944, -1.60944, false, -1.60944, -1.60944, false, -1.60944, -1.60944]});
+ref.push({testName: 'precision.log.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -0.693148, -0.693147, false, -0.693148, -0.693147, false, -0.693148, -0.693147]});
+ref.push({testName: 'precision.log.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -1.60944, -1.60944, false, -1.60944, -1.60944, false, -1.60944, -1.60944, false, -1.60944, -1.60944]});
+ref.push({testName: 'precision.log.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -0.693148, -0.693147, false, -0.693148, -0.693147, false, -0.693148, -0.693147, false, -0.693148, -0.693147]});
+ref.push({testName: 'precision.exp2.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1.12935, 1.16681]});
+ref.push({testName: 'precision.exp2.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1.39859, 1.42984]});
+ref.push({testName: 'precision.exp2.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.12935, 1.16681, false, 1.12935, 1.16681]});
+ref.push({testName: 'precision.exp2.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.39859, 1.42984, false, 1.39859, 1.42984]});
+ref.push({testName: 'precision.exp2.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.12935, 1.16681, false, 1.12935, 1.16681, false, 1.12935, 1.16681]});
+ref.push({testName: 'precision.exp2.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.39859, 1.42984, false, 1.39859, 1.42984, false, 1.39859, 1.42984]});
+ref.push({testName: 'precision.exp2.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.12935, 1.16681, false, 1.12935, 1.16681, false, 1.12935, 1.16681, false, 1.12935, 1.16681]});
+ref.push({testName: 'precision.exp2.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.39859, 1.42984, false, 1.39859, 1.42984, false, 1.39859, 1.42984, false, 1.39859, 1.42984]});
+ref.push({testName: 'precision.exp2.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1.12935, 1.16681]});
+ref.push({testName: 'precision.exp2.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1.39859, 1.42984]});
+ref.push({testName: 'precision.exp2.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.12935, 1.16681, false, 1.12935, 1.16681]});
+ref.push({testName: 'precision.exp2.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.39859, 1.42984, false, 1.39859, 1.42984]});
+ref.push({testName: 'precision.exp2.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.12935, 1.16681, false, 1.12935, 1.16681, false, 1.12935, 1.16681]});
+ref.push({testName: 'precision.exp2.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.39859, 1.42984, false, 1.39859, 1.42984, false, 1.39859, 1.42984]});
+ref.push({testName: 'precision.exp2.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.12935, 1.16681, false, 1.12935, 1.16681, false, 1.12935, 1.16681, false, 1.12935, 1.16681]});
+ref.push({testName: 'precision.exp2.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.39859, 1.42984, false, 1.39859, 1.42984, false, 1.39859, 1.42984, false, 1.39859, 1.42984]});
+ref.push({testName: 'precision.exp2.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1.14397, 1.15354]});
+ref.push({testName: 'precision.exp2.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1.40835, 1.42007]});
+ref.push({testName: 'precision.exp2.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.14397, 1.15354, false, 1.14397, 1.15354]});
+ref.push({testName: 'precision.exp2.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.40835, 1.42007, false, 1.40835, 1.42007]});
+ref.push({testName: 'precision.exp2.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.14397, 1.15354, false, 1.14397, 1.15354, false, 1.14397, 1.15354]});
+ref.push({testName: 'precision.exp2.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.40835, 1.42007, false, 1.40835, 1.42007, false, 1.40835, 1.42007]});
+ref.push({testName: 'precision.exp2.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.14397, 1.15354, false, 1.14397, 1.15354, false, 1.14397, 1.15354, false, 1.14397, 1.15354]});
+ref.push({testName: 'precision.exp2.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.40835, 1.42007, false, 1.40835, 1.42007, false, 1.40835, 1.42007, false, 1.40835, 1.42007]});
+ref.push({testName: 'precision.exp2.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1.14397, 1.15354]});
+ref.push({testName: 'precision.exp2.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1.40835, 1.42007]});
+ref.push({testName: 'precision.exp2.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.14397, 1.15354, false, 1.14397, 1.15354]});
+ref.push({testName: 'precision.exp2.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.40835, 1.42007, false, 1.40835, 1.42007]});
+ref.push({testName: 'precision.exp2.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.14397, 1.15354, false, 1.14397, 1.15354, false, 1.14397, 1.15354]});
+ref.push({testName: 'precision.exp2.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.40835, 1.42007, false, 1.40835, 1.42007, false, 1.40835, 1.42007]});
+ref.push({testName: 'precision.exp2.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.14397, 1.15354, false, 1.14397, 1.15354, false, 1.14397, 1.15354, false, 1.14397, 1.15354]});
+ref.push({testName: 'precision.exp2.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.40835, 1.42007, false, 1.40835, 1.42007, false, 1.40835, 1.42007, false, 1.40835, 1.42007]});
+ref.push({testName: 'precision.exp2.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1.1487, 1.1487]});
+ref.push({testName: 'precision.exp2.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1.41421, 1.41421]});
+ref.push({testName: 'precision.exp2.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.1487, 1.1487, false, 1.1487, 1.1487]});
+ref.push({testName: 'precision.exp2.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.41421, 1.41421, false, 1.41421, 1.41421]});
+ref.push({testName: 'precision.exp2.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.1487, 1.1487, false, 1.1487, 1.1487, false, 1.1487, 1.1487]});
+ref.push({testName: 'precision.exp2.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.41421, 1.41421, false, 1.41421, 1.41421, false, 1.41421, 1.41421]});
+ref.push({testName: 'precision.exp2.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.1487, 1.1487, false, 1.1487, 1.1487, false, 1.1487, 1.1487, false, 1.1487, 1.1487]});
+ref.push({testName: 'precision.exp2.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.41421, 1.41421, false, 1.41421, 1.41421, false, 1.41421, 1.41421, false, 1.41421, 1.41421]});
+ref.push({testName: 'precision.exp2.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1.1487, 1.1487]});
+ref.push({testName: 'precision.exp2.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1.41421, 1.41421]});
+ref.push({testName: 'precision.exp2.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.1487, 1.1487, false, 1.1487, 1.1487]});
+ref.push({testName: 'precision.exp2.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.41421, 1.41421, false, 1.41421, 1.41421]});
+ref.push({testName: 'precision.exp2.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.1487, 1.1487, false, 1.1487, 1.1487, false, 1.1487, 1.1487]});
+ref.push({testName: 'precision.exp2.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.41421, 1.41421, false, 1.41421, 1.41421, false, 1.41421, 1.41421]});
+ref.push({testName: 'precision.exp2.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.1487, 1.1487, false, 1.1487, 1.1487, false, 1.1487, 1.1487, false, 1.1487, 1.1487]});
+ref.push({testName: 'precision.exp2.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.41421, 1.41421, false, 1.41421, 1.41421, false, 1.41421, 1.41421, false, 1.41421, 1.41421]});
+ref.push({testName: 'precision.log2.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, -1.99219]});
+ref.push({testName: 'precision.log2.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, -1.01563, -0.984375]});
+ref.push({testName: 'precision.log2.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, -1.99219, false, -Infinity, -1.99219]});
+ref.push({testName: 'precision.log2.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -1.01563, -0.984375, false, -1.01563, -0.984375]});
+ref.push({testName: 'precision.log2.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, -1.99219, false, -Infinity, -1.99219, false, -Infinity, -1.99219]});
+ref.push({testName: 'precision.log2.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -1.01563, -0.984375, false, -1.01563, -0.984375, false, -1.01563, -0.984375]});
+ref.push({testName: 'precision.log2.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, -1.99219, false, -Infinity, -1.99219, false, -Infinity, -1.99219, false, -Infinity, -1.99219]});
+ref.push({testName: 'precision.log2.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -1.01563, -0.984375, false, -1.01563, -0.984375, false, -1.01563, -0.984375, false, -1.01563, -0.984375]});
+ref.push({testName: 'precision.log2.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, -1.99219]});
+ref.push({testName: 'precision.log2.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, -1.01563, -0.984375]});
+ref.push({testName: 'precision.log2.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, -1.99219, false, -Infinity, -1.99219]});
+ref.push({testName: 'precision.log2.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -1.01563, -0.984375, false, -1.01563, -0.984375]});
+ref.push({testName: 'precision.log2.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, -1.99219, false, -Infinity, -1.99219, false, -Infinity, -1.99219]});
+ref.push({testName: 'precision.log2.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -1.01563, -0.984375, false, -1.01563, -0.984375, false, -1.01563, -0.984375]});
+ref.push({testName: 'precision.log2.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, -1.99219, false, -Infinity, -1.99219, false, -Infinity, -1.99219, false, -Infinity, -1.99219]});
+ref.push({testName: 'precision.log2.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -1.01563, -0.984375, false, -1.01563, -0.984375, false, -1.01563, -0.984375, false, -1.01563, -0.984375]});
+ref.push({testName: 'precision.log2.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, -2.33009, -2.31271]});
+ref.push({testName: 'precision.log2.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, -1.00781, -0.992188]});
+ref.push({testName: 'precision.log2.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -2.33009, -2.31271, false, -2.33009, -2.31271]});
+ref.push({testName: 'precision.log2.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -1.00781, -0.992188, false, -1.00781, -0.992188]});
+ref.push({testName: 'precision.log2.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -2.33009, -2.31271, false, -2.33009, -2.31271, false, -2.33009, -2.31271]});
+ref.push({testName: 'precision.log2.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -1.00781, -0.992188, false, -1.00781, -0.992188, false, -1.00781, -0.992188]});
+ref.push({testName: 'precision.log2.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -2.33009, -2.31271, false, -2.33009, -2.31271, false, -2.33009, -2.31271, false, -2.33009, -2.31271]});
+ref.push({testName: 'precision.log2.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -1.00781, -0.992188, false, -1.00781, -0.992188, false, -1.00781, -0.992188, false, -1.00781, -0.992188]});
+ref.push({testName: 'precision.log2.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, -2.33009, -2.31271]});
+ref.push({testName: 'precision.log2.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, -1.00781, -0.992188]});
+ref.push({testName: 'precision.log2.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -2.33009, -2.31271, false, -2.33009, -2.31271]});
+ref.push({testName: 'precision.log2.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -1.00781, -0.992188, false, -1.00781, -0.992188]});
+ref.push({testName: 'precision.log2.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -2.33009, -2.31271, false, -2.33009, -2.31271, false, -2.33009, -2.31271]});
+ref.push({testName: 'precision.log2.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -1.00781, -0.992188, false, -1.00781, -0.992188, false, -1.00781, -0.992188]});
+ref.push({testName: 'precision.log2.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -2.33009, -2.31271, false, -2.33009, -2.31271, false, -2.33009, -2.31271, false, -2.33009, -2.31271]});
+ref.push({testName: 'precision.log2.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -1.00781, -0.992188, false, -1.00781, -0.992188, false, -1.00781, -0.992188, false, -1.00781, -0.992188]});
+ref.push({testName: 'precision.log2.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, -2.32193, -2.32193]});
+ref.push({testName: 'precision.log2.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, -1, -1]});
+ref.push({testName: 'precision.log2.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -2.32193, -2.32193, false, -2.32193, -2.32193]});
+ref.push({testName: 'precision.log2.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -1, -1, false, -1, -1]});
+ref.push({testName: 'precision.log2.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -2.32193, -2.32193, false, -2.32193, -2.32193, false, -2.32193, -2.32193]});
+ref.push({testName: 'precision.log2.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -1, -1, false, -1, -1, false, -1, -1]});
+ref.push({testName: 'precision.log2.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -2.32193, -2.32193, false, -2.32193, -2.32193, false, -2.32193, -2.32193, false, -2.32193, -2.32193]});
+ref.push({testName: 'precision.log2.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -1, -1, false, -1, -1, false, -1, -1, false, -1, -1]});
+ref.push({testName: 'precision.log2.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, -2.32193, -2.32193]});
+ref.push({testName: 'precision.log2.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, -1, -1]});
+ref.push({testName: 'precision.log2.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -2.32193, -2.32193, false, -2.32193, -2.32193]});
+ref.push({testName: 'precision.log2.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -1, -1, false, -1, -1]});
+ref.push({testName: 'precision.log2.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -2.32193, -2.32193, false, -2.32193, -2.32193, false, -2.32193, -2.32193]});
+ref.push({testName: 'precision.log2.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -1, -1, false, -1, -1, false, -1, -1]});
+ref.push({testName: 'precision.log2.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -2.32193, -2.32193, false, -2.32193, -2.32193, false, -2.32193, -2.32193, false, -2.32193, -2.32193]});
+ref.push({testName: 'precision.log2.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -1, -1, false, -1, -1, false, -1, -1, false, -1, -1]});
+ref.push({testName: 'precision.sqrt.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sqrt.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sqrt.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sqrt.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sqrt.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sqrt.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sqrt.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sqrt.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sqrt.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sqrt.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sqrt.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sqrt.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sqrt.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sqrt.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sqrt.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sqrt.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.sqrt.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.444382, 0.450222]});
+ref.push({testName: 'precision.sqrt.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.702718, 0.711507]});
+ref.push({testName: 'precision.sqrt.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.444382, 0.450222, false, 0.444382, 0.450222]});
+ref.push({testName: 'precision.sqrt.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.702718, 0.711507, false, 0.702718, 0.711507]});
+ref.push({testName: 'precision.sqrt.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.444382, 0.450222, false, 0.444382, 0.450222, false, 0.444382, 0.450222]});
+ref.push({testName: 'precision.sqrt.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.702718, 0.711507, false, 0.702718, 0.711507, false, 0.702718, 0.711507]});
+ref.push({testName: 'precision.sqrt.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.444382, 0.450222, false, 0.444382, 0.450222, false, 0.444382, 0.450222, false, 0.444382, 0.450222]});
+ref.push({testName: 'precision.sqrt.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.702718, 0.711507, false, 0.702718, 0.711507, false, 0.702718, 0.711507, false, 0.702718, 0.711507]});
+ref.push({testName: 'precision.sqrt.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.444382, 0.450222]});
+ref.push({testName: 'precision.sqrt.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.702718, 0.711507]});
+ref.push({testName: 'precision.sqrt.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.444382, 0.450222, false, 0.444382, 0.450222]});
+ref.push({testName: 'precision.sqrt.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.702718, 0.711507, false, 0.702718, 0.711507]});
+ref.push({testName: 'precision.sqrt.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.444382, 0.450222, false, 0.444382, 0.450222, false, 0.444382, 0.450222]});
+ref.push({testName: 'precision.sqrt.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.702718, 0.711507, false, 0.702718, 0.711507, false, 0.702718, 0.711507]});
+ref.push({testName: 'precision.sqrt.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.444382, 0.450222, false, 0.444382, 0.450222, false, 0.444382, 0.450222, false, 0.444382, 0.450222]});
+ref.push({testName: 'precision.sqrt.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.702718, 0.711507, false, 0.702718, 0.711507, false, 0.702718, 0.711507, false, 0.702718, 0.711507]});
+ref.push({testName: 'precision.sqrt.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.447213, 0.447214]});
+ref.push({testName: 'precision.sqrt.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.707107, 0.707107]});
+ref.push({testName: 'precision.sqrt.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.447213, 0.447214, false, 0.447213, 0.447214]});
+ref.push({testName: 'precision.sqrt.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.707107, 0.707107, false, 0.707107, 0.707107]});
+ref.push({testName: 'precision.sqrt.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.447213, 0.447214, false, 0.447213, 0.447214, false, 0.447213, 0.447214]});
+ref.push({testName: 'precision.sqrt.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.707107, 0.707107, false, 0.707107, 0.707107, false, 0.707107, 0.707107]});
+ref.push({testName: 'precision.sqrt.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.447213, 0.447214, false, 0.447213, 0.447214, false, 0.447213, 0.447214, false, 0.447213, 0.447214]});
+ref.push({testName: 'precision.sqrt.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.707107, 0.707107, false, 0.707107, 0.707107, false, 0.707107, 0.707107, false, 0.707107, 0.707107]});
+ref.push({testName: 'precision.sqrt.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.447213, 0.447214]});
+ref.push({testName: 'precision.sqrt.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.707107, 0.707107]});
+ref.push({testName: 'precision.sqrt.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.447213, 0.447214, false, 0.447213, 0.447214]});
+ref.push({testName: 'precision.sqrt.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.707107, 0.707107, false, 0.707107, 0.707107]});
+ref.push({testName: 'precision.sqrt.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.447213, 0.447214, false, 0.447213, 0.447214, false, 0.447213, 0.447214]});
+ref.push({testName: 'precision.sqrt.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.707107, 0.707107, false, 0.707107, 0.707107, false, 0.707107, 0.707107]});
+ref.push({testName: 'precision.sqrt.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.447213, 0.447214, false, 0.447213, 0.447214, false, 0.447213, 0.447214, false, 0.447213, 0.447214]});
+ref.push({testName: 'precision.sqrt.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.707107, 0.707107, false, 0.707107, 0.707107, false, 0.707107, 0.707107, false, 0.707107, 0.707107]});
+ref.push({testName: 'precision.inversesqrt.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1.99219, Infinity]});
+ref.push({testName: 'precision.inversesqrt.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1.39859, 1.42984]});
+ref.push({testName: 'precision.inversesqrt.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.99219, Infinity, false, 1.99219, Infinity]});
+ref.push({testName: 'precision.inversesqrt.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.39859, 1.42984, false, 1.39859, 1.42984]});
+ref.push({testName: 'precision.inversesqrt.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.99219, Infinity, false, 1.99219, Infinity, false, 1.99219, Infinity]});
+ref.push({testName: 'precision.inversesqrt.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.39859, 1.42984, false, 1.39859, 1.42984, false, 1.39859, 1.42984]});
+ref.push({testName: 'precision.inversesqrt.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.99219, Infinity, false, 1.99219, Infinity, false, 1.99219, Infinity, false, 1.99219, Infinity]});
+ref.push({testName: 'precision.inversesqrt.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.39859, 1.42984, false, 1.39859, 1.42984, false, 1.39859, 1.42984, false, 1.39859, 1.42984]});
+ref.push({testName: 'precision.inversesqrt.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1.99219, Infinity]});
+ref.push({testName: 'precision.inversesqrt.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1.39859, 1.42984]});
+ref.push({testName: 'precision.inversesqrt.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1.99219, Infinity, false, 1.99219, Infinity]});
+ref.push({testName: 'precision.inversesqrt.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.39859, 1.42984, false, 1.39859, 1.42984]});
+ref.push({testName: 'precision.inversesqrt.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.99219, Infinity, false, 1.99219, Infinity, false, 1.99219, Infinity]});
+ref.push({testName: 'precision.inversesqrt.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.39859, 1.42984, false, 1.39859, 1.42984, false, 1.39859, 1.42984]});
+ref.push({testName: 'precision.inversesqrt.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1.99219, Infinity, false, 1.99219, Infinity, false, 1.99219, Infinity, false, 1.99219, Infinity]});
+ref.push({testName: 'precision.inversesqrt.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.39859, 1.42984, false, 1.39859, 1.42984, false, 1.39859, 1.42984, false, 1.39859, 1.42984]});
+ref.push({testName: 'precision.inversesqrt.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 2.22716, 2.24415]});
+ref.push({testName: 'precision.inversesqrt.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1.41031, 1.41812]});
+ref.push({testName: 'precision.inversesqrt.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 2.22716, 2.24415, false, 2.22716, 2.24415]});
+ref.push({testName: 'precision.inversesqrt.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.41031, 1.41812, false, 1.41031, 1.41812]});
+ref.push({testName: 'precision.inversesqrt.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 2.22716, 2.24415, false, 2.22716, 2.24415, false, 2.22716, 2.24415]});
+ref.push({testName: 'precision.inversesqrt.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.41031, 1.41812, false, 1.41031, 1.41812, false, 1.41031, 1.41812]});
+ref.push({testName: 'precision.inversesqrt.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 2.22716, 2.24415, false, 2.22716, 2.24415, false, 2.22716, 2.24415, false, 2.22716, 2.24415]});
+ref.push({testName: 'precision.inversesqrt.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.41031, 1.41812, false, 1.41031, 1.41812, false, 1.41031, 1.41812, false, 1.41031, 1.41812]});
+ref.push({testName: 'precision.inversesqrt.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 2.22716, 2.24415]});
+ref.push({testName: 'precision.inversesqrt.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1.41031, 1.41812]});
+ref.push({testName: 'precision.inversesqrt.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 2.22716, 2.24415, false, 2.22716, 2.24415]});
+ref.push({testName: 'precision.inversesqrt.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.41031, 1.41812, false, 1.41031, 1.41812]});
+ref.push({testName: 'precision.inversesqrt.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 2.22716, 2.24415, false, 2.22716, 2.24415, false, 2.22716, 2.24415]});
+ref.push({testName: 'precision.inversesqrt.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.41031, 1.41812, false, 1.41031, 1.41812, false, 1.41031, 1.41812]});
+ref.push({testName: 'precision.inversesqrt.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 2.22716, 2.24415, false, 2.22716, 2.24415, false, 2.22716, 2.24415, false, 2.22716, 2.24415]});
+ref.push({testName: 'precision.inversesqrt.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.41031, 1.41812, false, 1.41031, 1.41812, false, 1.41031, 1.41812, false, 1.41031, 1.41812]});
+ref.push({testName: 'precision.inversesqrt.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 2.23607, 2.23607]});
+ref.push({testName: 'precision.inversesqrt.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1.41421, 1.41421]});
+ref.push({testName: 'precision.inversesqrt.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 2.23607, 2.23607, false, 2.23607, 2.23607]});
+ref.push({testName: 'precision.inversesqrt.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.41421, 1.41421, false, 1.41421, 1.41421]});
+ref.push({testName: 'precision.inversesqrt.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 2.23607, 2.23607, false, 2.23607, 2.23607, false, 2.23607, 2.23607]});
+ref.push({testName: 'precision.inversesqrt.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.41421, 1.41421, false, 1.41421, 1.41421, false, 1.41421, 1.41421]});
+ref.push({testName: 'precision.inversesqrt.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 2.23607, 2.23607, false, 2.23607, 2.23607, false, 2.23607, 2.23607, false, 2.23607, 2.23607]});
+ref.push({testName: 'precision.inversesqrt.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.41421, 1.41421, false, 1.41421, 1.41421, false, 1.41421, 1.41421, false, 1.41421, 1.41421]});
+ref.push({testName: 'precision.inversesqrt.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 2.23607, 2.23607]});
+ref.push({testName: 'precision.inversesqrt.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1.41421, 1.41421]});
+ref.push({testName: 'precision.inversesqrt.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 2.23607, 2.23607, false, 2.23607, 2.23607]});
+ref.push({testName: 'precision.inversesqrt.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1.41421, 1.41421, false, 1.41421, 1.41421]});
+ref.push({testName: 'precision.inversesqrt.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 2.23607, 2.23607, false, 2.23607, 2.23607, false, 2.23607, 2.23607]});
+ref.push({testName: 'precision.inversesqrt.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.41421, 1.41421, false, 1.41421, 1.41421, false, 1.41421, 1.41421]});
+ref.push({testName: 'precision.inversesqrt.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 2.23607, 2.23607, false, 2.23607, 2.23607, false, 2.23607, 2.23607, false, 2.23607, 2.23607]});
+ref.push({testName: 'precision.inversesqrt.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1.41421, 1.41421, false, 1.41421, 1.41421, false, 1.41421, 1.41421, false, 1.41421, 1.41421]});
+ref.push({testName: 'precision.abs.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.abs.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]});
+ref.push({testName: 'precision.abs.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.abs.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.abs.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.abs.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.abs.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.abs.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.abs.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.abs.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]});
+ref.push({testName: 'precision.abs.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.abs.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.abs.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.abs.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.abs.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.abs.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.abs.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.abs.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]});
+ref.push({testName: 'precision.abs.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.abs.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.abs.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.abs.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.abs.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.abs.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.abs.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.abs.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]});
+ref.push({testName: 'precision.abs.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.abs.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.abs.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.abs.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.abs.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.abs.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.abs.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.2, 0.2]});
+ref.push({testName: 'precision.abs.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]});
+ref.push({testName: 'precision.abs.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.abs.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.abs.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.abs.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.abs.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.abs.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.abs.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.2, 0.2]});
+ref.push({testName: 'precision.abs.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]});
+ref.push({testName: 'precision.abs.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.abs.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.abs.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.abs.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.abs.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.abs.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.sign.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.sign.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.sign.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.sign.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.sign.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.sign.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.sign.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.sign.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.sign.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.sign.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.sign.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.sign.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.sign.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.sign.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.floor.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.floor.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.floor.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.floor.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.floor.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.floor.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.floor.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.floor.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.floor.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.floor.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.floor.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.floor.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.floor.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.floor.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.trunc.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.trunc.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.trunc.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.trunc.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.trunc.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.trunc.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.trunc.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.trunc.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.trunc.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.trunc.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.trunc.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.trunc.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.trunc.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.round.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.round.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0, 1]});
+ref.push({testName: 'precision.round.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.round.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.round.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.round.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.round.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.round.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.round.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.round.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0, 1]});
+ref.push({testName: 'precision.round.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.round.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.round.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.round.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.round.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.round.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.round.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.round.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0, 1]});
+ref.push({testName: 'precision.round.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.round.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.round.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.round.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.round.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.round.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.round.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.round.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0, 1]});
+ref.push({testName: 'precision.round.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.round.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.round.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.round.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.round.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.round.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.round.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.round.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0, 1]});
+ref.push({testName: 'precision.round.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.round.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.round.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.round.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.round.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.round.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.round.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.round.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0, 1]});
+ref.push({testName: 'precision.round.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.round.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.round.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.round.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.round.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.round.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.roundeven.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.roundeven.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.roundeven.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.roundeven.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.roundeven.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.roundeven.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.roundeven.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.roundeven.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.roundeven.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.roundeven.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.roundeven.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.roundeven.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.roundeven.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.roundeven.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.ceil.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.ceil.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.ceil.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.ceil.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.ceil.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.ceil.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.ceil.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.ceil.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.ceil.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.ceil.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.ceil.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.ceil.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.ceil.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.ceil.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.fract.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.fract.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]});
+ref.push({testName: 'precision.fract.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.fract.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.fract.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.fract.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.fract.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.fract.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.fract.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.fract.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]});
+ref.push({testName: 'precision.fract.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.fract.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.fract.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.fract.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.fract.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.fract.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.fract.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.fract.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]});
+ref.push({testName: 'precision.fract.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.fract.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.fract.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.fract.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.fract.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.fract.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.fract.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.fract.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]});
+ref.push({testName: 'precision.fract.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.fract.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.fract.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.fract.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.fract.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.fract.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.fract.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.2, 0.2]});
+ref.push({testName: 'precision.fract.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]});
+ref.push({testName: 'precision.fract.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.fract.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.fract.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.fract.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.fract.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.fract.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.fract.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.2, 0.2]});
+ref.push({testName: 'precision.fract.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]});
+ref.push({testName: 'precision.fract.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.fract.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.fract.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.fract.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.fract.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.fract.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.mod.lowp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.mod.lowp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.mod.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.mod.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.mod.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.mod.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.mod.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.mod.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.mod.lowp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.mod.lowp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.mod.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.mod.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.mod.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.mod.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.mod.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.mod.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.mod.mediump_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, -0.000244141, 0.200195]});
+ref.push({testName: 'precision.mod.mediump_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.mod.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, -0.000244141, 0.200195, false, -0.000244141, 0.200195]});
+ref.push({testName: 'precision.mod.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.mod.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -0.000244141, 0.200195, false, -0.000244141, 0.200195, false, -0.000244141, 0.200195]});
+ref.push({testName: 'precision.mod.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.mod.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, -0.000244141, 0.200195, false, -0.000244141, 0.200195, false, -0.000244141, 0.200195, false, -0.000244141, 0.200195]});
+ref.push({testName: 'precision.mod.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.mod.mediump_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, -0.000244141, 0.200195]});
+ref.push({testName: 'precision.mod.mediump_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.mod.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, -0.000244141, 0.200195, false, -0.000244141, 0.200195]});
+ref.push({testName: 'precision.mod.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.mod.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -0.000244141, 0.200195, false, -0.000244141, 0.200195, false, -0.000244141, 0.200195]});
+ref.push({testName: 'precision.mod.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.mod.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, -0.000244141, 0.200195, false, -0.000244141, 0.200195, false, -0.000244141, 0.200195, false, -0.000244141, 0.200195]});
+ref.push({testName: 'precision.mod.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.mod.highp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0, 0.2]});
+ref.push({testName: 'precision.mod.highp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.2, 0.2]});
+ref.push({testName: 'precision.mod.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0, 0.2, false, 0, 0.2]});
+ref.push({testName: 'precision.mod.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.mod.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0, 0.2, false, 0, 0.2, false, 0, 0.2]});
+ref.push({testName: 'precision.mod.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.mod.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0, 0.2, false, 0, 0.2, false, 0, 0.2, false, 0, 0.2]});
+ref.push({testName: 'precision.mod.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.mod.highp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0, 0.2]});
+ref.push({testName: 'precision.mod.highp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.2, 0.2]});
+ref.push({testName: 'precision.mod.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0, 0.2, false, 0, 0.2]});
+ref.push({testName: 'precision.mod.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.mod.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0, 0.2, false, 0, 0.2, false, 0, 0.2]});
+ref.push({testName: 'precision.mod.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.mod.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0, 0.2, false, 0, 0.2, false, 0, 0.2, false, 0, 0.2]});
+ref.push({testName: 'precision.mod.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.modf.lowp_vertex', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.modf.lowp_vertex', input: '0.2, (), (), ()', reference: [false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.modf.lowp_vertex', input: '0.5, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.modf.lowp_vertex', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]});
+ref.push({testName: 'precision.modf.lowp_fragment', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.modf.lowp_fragment', input: '0.2, (), (), ()', reference: [false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.modf.lowp_fragment', input: '0.5, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.modf.lowp_fragment', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]});
+ref.push({testName: 'precision.modf.mediump_vertex', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.modf.mediump_vertex', input: '0.2, (), (), ()', reference: [false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.modf.mediump_vertex', input: '0.5, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.modf.mediump_vertex', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]});
+ref.push({testName: 'precision.modf.mediump_fragment', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.modf.mediump_fragment', input: '0.2, (), (), ()', reference: [false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.modf.mediump_fragment', input: '0.5, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.modf.mediump_fragment', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]});
+ref.push({testName: 'precision.modf.highp_vertex', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.modf.highp_vertex', input: '0.2, (), (), ()', reference: [false, 0.2, 0.2]});
+ref.push({testName: 'precision.modf.highp_vertex', input: '0.5, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.modf.highp_vertex', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]});
+ref.push({testName: 'precision.modf.highp_fragment', input: '0.2, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.modf.highp_fragment', input: '0.2, (), (), ()', reference: [false, 0.2, 0.2]});
+ref.push({testName: 'precision.modf.highp_fragment', input: '0.5, (), (), ()', reference: [false, 0, 0]});
+ref.push({testName: 'precision.modf.highp_fragment', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]});
+ref.push({testName: 'precision.min.lowp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.min.lowp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.min.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.min.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.min.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.min.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.min.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.min.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.min.lowp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.min.lowp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.min.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.min.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.min.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.min.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.min.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.min.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.min.mediump_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.min.mediump_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.min.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.min.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.min.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.min.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.min.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.min.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.min.mediump_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.min.mediump_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.min.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.min.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.min.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.min.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.min.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.min.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.min.highp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.2, 0.2]});
+ref.push({testName: 'precision.min.highp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.2, 0.2]});
+ref.push({testName: 'precision.min.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.min.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.min.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.min.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.min.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.min.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.min.highp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.2, 0.2]});
+ref.push({testName: 'precision.min.highp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.2, 0.2]});
+ref.push({testName: 'precision.min.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.min.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.min.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.min.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.min.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.min.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.max.lowp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.max.lowp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.5, 0.5]});
+ref.push({testName: 'precision.max.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.max.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.max.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.max.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.max.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.max.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.max.lowp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.max.lowp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.5, 0.5]});
+ref.push({testName: 'precision.max.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.max.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.max.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.max.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.max.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.max.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.max.mediump_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.max.mediump_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.5, 0.5]});
+ref.push({testName: 'precision.max.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.max.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.max.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.max.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.max.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.max.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.max.mediump_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.max.mediump_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.5, 0.5]});
+ref.push({testName: 'precision.max.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.max.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.max.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.max.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.max.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.max.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.max.highp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.2, 0.2]});
+ref.push({testName: 'precision.max.highp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.5, 0.5]});
+ref.push({testName: 'precision.max.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.max.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.max.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.max.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.max.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.max.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.max.highp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.2, 0.2]});
+ref.push({testName: 'precision.max.highp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.5, 0.5]});
+ref.push({testName: 'precision.max.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.max.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.max.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.max.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.max.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.max.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.clamp.lowp_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.clamp.lowp_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.clamp.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.clamp.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.clamp.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.clamp.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.clamp.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.clamp.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.clamp.lowp_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.clamp.lowp_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.clamp.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.clamp.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.clamp.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.clamp.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.clamp.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.clamp.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.clamp.mediump_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.clamp.mediump_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.clamp.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.clamp.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.clamp.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.clamp.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.clamp.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.clamp.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.clamp.mediump_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.clamp.mediump_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.clamp.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.clamp.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.clamp.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.clamp.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.clamp.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.clamp.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.clamp.highp_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, 0.2, 0.2]});
+ref.push({testName: 'precision.clamp.highp_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0.2, 0.2]});
+ref.push({testName: 'precision.clamp.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.clamp.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.clamp.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.clamp.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.clamp.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.clamp.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.clamp.highp_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, 0.2, 0.2]});
+ref.push({testName: 'precision.clamp.highp_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0.2, 0.2]});
+ref.push({testName: 'precision.clamp.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.clamp.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.clamp.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.clamp.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.clamp.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.clamp.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.mix.lowp_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, 0.179688, 0.210938]});
+ref.push({testName: 'precision.mix.lowp_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0.1875, 0.203125]});
+ref.push({testName: 'precision.mix.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [false, 0.179688, 0.210938, false, 0.179688, 0.210938]});
+ref.push({testName: 'precision.mix.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0.1875, 0.203125, false, 0.1875, 0.203125]});
+ref.push({testName: 'precision.mix.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [false, 0.179688, 0.210938, false, 0.179688, 0.210938, false, 0.179688, 0.210938]});
+ref.push({testName: 'precision.mix.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0.1875, 0.203125, false, 0.1875, 0.203125, false, 0.1875, 0.203125]});
+ref.push({testName: 'precision.mix.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [false, 0.179688, 0.210938, false, 0.179688, 0.210938, false, 0.179688, 0.210938, false, 0.179688, 0.210938]});
+ref.push({testName: 'precision.mix.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0.1875, 0.203125, false, 0.1875, 0.203125, false, 0.1875, 0.203125, false, 0.1875, 0.203125]});
+ref.push({testName: 'precision.mix.lowp_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, 0.179688, 0.210938]});
+ref.push({testName: 'precision.mix.lowp_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0.1875, 0.203125]});
+ref.push({testName: 'precision.mix.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [false, 0.179688, 0.210938, false, 0.179688, 0.210938]});
+ref.push({testName: 'precision.mix.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0.1875, 0.203125, false, 0.1875, 0.203125]});
+ref.push({testName: 'precision.mix.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [false, 0.179688, 0.210938, false, 0.179688, 0.210938, false, 0.179688, 0.210938]});
+ref.push({testName: 'precision.mix.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0.1875, 0.203125, false, 0.1875, 0.203125, false, 0.1875, 0.203125]});
+ref.push({testName: 'precision.mix.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [false, 0.179688, 0.210938, false, 0.179688, 0.210938, false, 0.179688, 0.210938, false, 0.179688, 0.210938]});
+ref.push({testName: 'precision.mix.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0.1875, 0.203125, false, 0.1875, 0.203125, false, 0.1875, 0.203125, false, 0.1875, 0.203125]});
+ref.push({testName: 'precision.mix.mediump_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, 0.199707, 0.200684]});
+ref.push({testName: 'precision.mix.mediump_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.mix.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [false, 0.199707, 0.200684, false, 0.199707, 0.200684]});
+ref.push({testName: 'precision.mix.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.mix.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [false, 0.199707, 0.200684, false, 0.199707, 0.200684, false, 0.199707, 0.200684]});
+ref.push({testName: 'precision.mix.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.mix.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [false, 0.199707, 0.200684, false, 0.199707, 0.200684, false, 0.199707, 0.200684, false, 0.199707, 0.200684]});
+ref.push({testName: 'precision.mix.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.mix.mediump_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, 0.199707, 0.200684]});
+ref.push({testName: 'precision.mix.mediump_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.mix.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [false, 0.199707, 0.200684, false, 0.199707, 0.200684]});
+ref.push({testName: 'precision.mix.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.mix.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [false, 0.199707, 0.200684, false, 0.199707, 0.200684, false, 0.199707, 0.200684]});
+ref.push({testName: 'precision.mix.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.mix.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [false, 0.199707, 0.200684, false, 0.199707, 0.200684, false, 0.199707, 0.200684, false, 0.199707, 0.200684]});
+ref.push({testName: 'precision.mix.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.mix.highp_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, 0.2, 0.2]});
+ref.push({testName: 'precision.mix.highp_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0.2, 0.2]});
+ref.push({testName: 'precision.mix.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.mix.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.mix.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.mix.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.mix.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.mix.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.mix.highp_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, 0.2, 0.2]});
+ref.push({testName: 'precision.mix.highp_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0.2, 0.2]});
+ref.push({testName: 'precision.mix.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.mix.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.mix.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.mix.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.mix.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.mix.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2, false, 0.2, 0.2]});
+ref.push({testName: 'precision.step.lowp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0, 1]});
+ref.push({testName: 'precision.step.lowp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.step.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.step.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.step.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.step.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.step.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.step.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.step.lowp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0, 1]});
+ref.push({testName: 'precision.step.lowp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.step.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.step.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.step.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.step.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.step.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.step.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.step.mediump_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0, 1]});
+ref.push({testName: 'precision.step.mediump_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.step.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.step.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.step.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.step.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.step.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.step.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.step.mediump_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0, 1]});
+ref.push({testName: 'precision.step.mediump_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.step.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.step.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.step.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.step.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.step.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0, 1, false, 0, 1, false, 0, 1, false, 0, 1]});
+ref.push({testName: 'precision.step.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.step.highp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.step.highp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.step.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.step.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.step.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.step.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.step.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.step.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.step.highp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.step.highp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.step.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.step.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.step.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.step.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.step.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.step.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 1, 1, false, 1, 1, false, 1, 1, false, 1, 1]});
+ref.push({testName: 'precision.smoothstep.lowp_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.lowp_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.lowp_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.lowp_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.mediump_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.mediump_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0, 3]});
+ref.push({testName: 'precision.smoothstep.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0, 3, false, 0, 3]});
+ref.push({testName: 'precision.smoothstep.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0, 3, false, 0, 3, false, 0, 3]});
+ref.push({testName: 'precision.smoothstep.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0, 3, false, 0, 3, false, 0, 3, false, 0, 3]});
+ref.push({testName: 'precision.smoothstep.mediump_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.mediump_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0, 3]});
+ref.push({testName: 'precision.smoothstep.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0, 3, false, 0, 3]});
+ref.push({testName: 'precision.smoothstep.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0, 3, false, 0, 3, false, 0, 3]});
+ref.push({testName: 'precision.smoothstep.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0, 3, false, 0, 3, false, 0, 3, false, 0, 3]});
+ref.push({testName: 'precision.smoothstep.highp_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.highp_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0, 3]});
+ref.push({testName: 'precision.smoothstep.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0, 3, false, 0, 3]});
+ref.push({testName: 'precision.smoothstep.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0, 3, false, 0, 3, false, 0, 3]});
+ref.push({testName: 'precision.smoothstep.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0, 3, false, 0, 3, false, 0, 3, false, 0, 3]});
+ref.push({testName: 'precision.smoothstep.highp_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.highp_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, 0, 3]});
+ref.push({testName: 'precision.smoothstep.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, 0, 3, false, 0, 3]});
+ref.push({testName: 'precision.smoothstep.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, 0, 3, false, 0, 3, false, 0, 3]});
+ref.push({testName: 'precision.smoothstep.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity, true, -Infinity, Infinity]});
+ref.push({testName: 'precision.smoothstep.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, 0, 3, false, 0, 3, false, 0, 3, false, 0, 3]});
+ref.push({testName: 'precision.length.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.length.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.length.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.length.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.length.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.length.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.length.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.length.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.length.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.length.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.length.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.length.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.length.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.length.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.length.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.length.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.length.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.198712, 0.201489]});
+ref.push({testName: 'precision.length.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.497805, 0.50342]});
+ref.push({testName: 'precision.length.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.280921, 0.285045]});
+ref.push({testName: 'precision.length.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.702718, 0.711507]});
+ref.push({testName: 'precision.length.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.344072, 0.349095]});
+ref.push({testName: 'precision.length.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.860664, 0.871406]});
+ref.push({testName: 'precision.length.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.397121, 0.403285]});
+ref.push({testName: 'precision.length.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.995609, 1.00684]});
+ref.push({testName: 'precision.length.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.198712, 0.201489]});
+ref.push({testName: 'precision.length.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.497805, 0.50342]});
+ref.push({testName: 'precision.length.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.280921, 0.285045]});
+ref.push({testName: 'precision.length.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.702718, 0.711507]});
+ref.push({testName: 'precision.length.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.344072, 0.349095]});
+ref.push({testName: 'precision.length.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.860664, 0.871406]});
+ref.push({testName: 'precision.length.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.397121, 0.403285]});
+ref.push({testName: 'precision.length.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.995609, 1.00684]});
+ref.push({testName: 'precision.length.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.2, 0.2]});
+ref.push({testName: 'precision.length.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]});
+ref.push({testName: 'precision.length.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.282843, 0.282843]});
+ref.push({testName: 'precision.length.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.707107, 0.707107]});
+ref.push({testName: 'precision.length.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.34641, 0.34641]});
+ref.push({testName: 'precision.length.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.866025, 0.866026]});
+ref.push({testName: 'precision.length.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.4, 0.4]});
+ref.push({testName: 'precision.length.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.length.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.2, 0.2]});
+ref.push({testName: 'precision.length.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.5, 0.5]});
+ref.push({testName: 'precision.length.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.282843, 0.282843]});
+ref.push({testName: 'precision.length.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.707107, 0.707107]});
+ref.push({testName: 'precision.length.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.34641, 0.34641]});
+ref.push({testName: 'precision.length.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.866025, 0.866026]});
+ref.push({testName: 'precision.length.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.4, 0.4]});
+ref.push({testName: 'precision.length.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.distance.lowp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.lowp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.lowp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.lowp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.mediump_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.mediump_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.297819, 0.302277]});
+ref.push({testName: 'precision.distance.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.421276, 0.427394]});
+ref.push({testName: 'precision.distance.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.515672, 0.524075]});
+ref.push({testName: 'precision.distance.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.595637, 0.604962]});
+ref.push({testName: 'precision.distance.mediump_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.mediump_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.297819, 0.302277]});
+ref.push({testName: 'precision.distance.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.421276, 0.427394]});
+ref.push({testName: 'precision.distance.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.515672, 0.524075]});
+ref.push({testName: 'precision.distance.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.595637, 0.604962]});
+ref.push({testName: 'precision.distance.highp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.highp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.3, 0.3]});
+ref.push({testName: 'precision.distance.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.424264, 0.424264]});
+ref.push({testName: 'precision.distance.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.519615, 0.519615]});
+ref.push({testName: 'precision.distance.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.6, 0.6]});
+ref.push({testName: 'precision.distance.highp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.highp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.3, 0.3]});
+ref.push({testName: 'precision.distance.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.424264, 0.424264]});
+ref.push({testName: 'precision.distance.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.519615, 0.519615]});
+ref.push({testName: 'precision.distance.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [true, -Infinity, Infinity]});
+ref.push({testName: 'precision.distance.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.6, 0.6]});
+ref.push({testName: 'precision.dot.lowp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.dot.lowp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.dot.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.0625, 0.09375]});
+ref.push({testName: 'precision.dot.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.1875, 0.203125]});
+ref.push({testName: 'precision.dot.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.09375, 0.140625]});
+ref.push({testName: 'precision.dot.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.28125, 0.304688]});
+ref.push({testName: 'precision.dot.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.125, 0.1875]});
+ref.push({testName: 'precision.dot.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.375, 0.40625]});
+ref.push({testName: 'precision.dot.lowp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.dot.lowp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.dot.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.0625, 0.09375]});
+ref.push({testName: 'precision.dot.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.1875, 0.203125]});
+ref.push({testName: 'precision.dot.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.09375, 0.140625]});
+ref.push({testName: 'precision.dot.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.28125, 0.304688]});
+ref.push({testName: 'precision.dot.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.125, 0.1875]});
+ref.push({testName: 'precision.dot.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.375, 0.40625]});
+ref.push({testName: 'precision.dot.mediump_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.dot.mediump_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.dot.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.0799561, 0.0802002]});
+ref.push({testName: 'precision.dot.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.dot.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.119873, 0.120361]});
+ref.push({testName: 'precision.dot.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.299805, 0.300293]});
+ref.push({testName: 'precision.dot.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.159668, 0.160645]});
+ref.push({testName: 'precision.dot.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.399414, 0.400391]});
+ref.push({testName: 'precision.dot.mediump_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.dot.mediump_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.dot.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.0799561, 0.0802002]});
+ref.push({testName: 'precision.dot.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.dot.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.119873, 0.120361]});
+ref.push({testName: 'precision.dot.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.299805, 0.300293]});
+ref.push({testName: 'precision.dot.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.159668, 0.160645]});
+ref.push({testName: 'precision.dot.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.399414, 0.400391]});
+ref.push({testName: 'precision.dot.highp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.04, 0.04]});
+ref.push({testName: 'precision.dot.highp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.1, 0.1]});
+ref.push({testName: 'precision.dot.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.08, 0.08]});
+ref.push({testName: 'precision.dot.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.2, 0.2]});
+ref.push({testName: 'precision.dot.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.12, 0.12]});
+ref.push({testName: 'precision.dot.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.3, 0.3]});
+ref.push({testName: 'precision.dot.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.16, 0.16]});
+ref.push({testName: 'precision.dot.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.4, 0.4]});
+ref.push({testName: 'precision.dot.highp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.04, 0.04]});
+ref.push({testName: 'precision.dot.highp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.1, 0.1]});
+ref.push({testName: 'precision.dot.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.08, 0.08]});
+ref.push({testName: 'precision.dot.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.2, 0.2]});
+ref.push({testName: 'precision.dot.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.12, 0.12]});
+ref.push({testName: 'precision.dot.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.3, 0.3]});
+ref.push({testName: 'precision.dot.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.16, 0.16]});
+ref.push({testName: 'precision.dot.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.4, 0.4]});
+ref.push({testName: 'precision.cross.lowp_vertex', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -0.015625, 0.015625, false, -0.015625, 0.015625, false, -0.015625, 0.015625]});
+ref.push({testName: 'precision.cross.lowp_vertex', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125]});
+ref.push({testName: 'precision.cross.lowp_fragment', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -0.015625, 0.015625, false, -0.015625, 0.015625, false, -0.015625, 0.015625]});
+ref.push({testName: 'precision.cross.lowp_fragment', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125, false, -0.0078125, 0.0078125]});
+ref.push({testName: 'precision.cross.mediump_vertex', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -0.00012207, 0.00012207, false, -0.00012207, 0.00012207, false, -0.00012207, 0.00012207]});
+ref.push({testName: 'precision.cross.mediump_vertex', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.00012207, 0.00012207, false, -0.00012207, 0.00012207, false, -0.00012207, 0.00012207]});
+ref.push({testName: 'precision.cross.mediump_fragment', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -0.00012207, 0.00012207, false, -0.00012207, 0.00012207, false, -0.00012207, 0.00012207]});
+ref.push({testName: 'precision.cross.mediump_fragment', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.00012207, 0.00012207, false, -0.00012207, 0.00012207, false, -0.00012207, 0.00012207]});
+ref.push({testName: 'precision.cross.highp_vertex', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -3.72529e-009, 3.72529e-009, false, -3.72529e-009, 3.72529e-009, false, -3.72529e-009, 3.72529e-009]});
+ref.push({testName: 'precision.cross.highp_vertex', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.cross.highp_fragment', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, -3.72529e-009, 3.72529e-009, false, -3.72529e-009, 3.72529e-009, false, -3.72529e-009, 3.72529e-009]});
+ref.push({testName: 'precision.cross.highp_fragment', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.normalize.lowp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.normalize.lowp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.normalize.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.normalize.lowp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.normalize.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.normalize.lowp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.normalize.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.normalize.lowp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.normalize.lowp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.normalize.lowp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.normalize.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.normalize.lowp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.normalize.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.normalize.lowp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.normalize.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.normalize.lowp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.normalize.mediump_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 0.989926, 1.01235]});
+ref.push({testName: 'precision.normalize.mediump_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 0.990765, 1.00929]});
+ref.push({testName: 'precision.normalize.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.699031, 0.71508, false, 0.699031, 0.71508]});
+ref.push({testName: 'precision.normalize.mediump_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.700293, 0.713965, false, 0.700293, 0.713965]});
+ref.push({testName: 'precision.normalize.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.570329, 0.584282, false, 0.570329, 0.584282, false, 0.570329, 0.584282]});
+ref.push({testName: 'precision.normalize.mediump_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.571344, 0.583388, false, 0.571344, 0.583388, false, 0.571344, 0.583388]});
+ref.push({testName: 'precision.normalize.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.494586, 0.506559, false, 0.494586, 0.506559, false, 0.494586, 0.506559, false, 0.494586, 0.506559]});
+ref.push({testName: 'precision.normalize.mediump_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.495383, 0.504646, false, 0.495383, 0.504646, false, 0.495383, 0.504646, false, 0.495383, 0.504646]});
+ref.push({testName: 'precision.normalize.mediump_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 0.989926, 1.01235]});
+ref.push({testName: 'precision.normalize.mediump_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 0.990765, 1.00929]});
+ref.push({testName: 'precision.normalize.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.699031, 0.71508, false, 0.699031, 0.71508]});
+ref.push({testName: 'precision.normalize.mediump_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.700293, 0.713965, false, 0.700293, 0.713965]});
+ref.push({testName: 'precision.normalize.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.570329, 0.584282, false, 0.570329, 0.584282, false, 0.570329, 0.584282]});
+ref.push({testName: 'precision.normalize.mediump_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.571344, 0.583388, false, 0.571344, 0.583388, false, 0.571344, 0.583388]});
+ref.push({testName: 'precision.normalize.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.494586, 0.506559, false, 0.494586, 0.506559, false, 0.494586, 0.506559, false, 0.494586, 0.506559]});
+ref.push({testName: 'precision.normalize.mediump_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.495383, 0.504646, false, 0.495383, 0.504646, false, 0.495383, 0.504646, false, 0.495383, 0.504646]});
+ref.push({testName: 'precision.normalize.highp_vertex.scalar', input: '0.2, (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.normalize.highp_vertex.scalar', input: '0.5, (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.normalize.highp_vertex.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.707106, 0.707107, false, 0.707106, 0.707107]});
+ref.push({testName: 'precision.normalize.highp_vertex.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.707106, 0.707107, false, 0.707106, 0.707107]});
+ref.push({testName: 'precision.normalize.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.57735, 0.577351, false, 0.57735, 0.577351, false, 0.57735, 0.577351]});
+ref.push({testName: 'precision.normalize.highp_vertex.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.57735, 0.577351, false, 0.57735, 0.577351, false, 0.57735, 0.577351]});
+ref.push({testName: 'precision.normalize.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.normalize.highp_vertex.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.normalize.highp_fragment.scalar', input: '0.2, (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.normalize.highp_fragment.scalar', input: '0.5, (), (), ()', reference: [false, 1, 1]});
+ref.push({testName: 'precision.normalize.highp_fragment.vec2', input: 'vec2(0.2, 0.2), (), (), ()', reference: [false, 0.707106, 0.707107, false, 0.707106, 0.707107]});
+ref.push({testName: 'precision.normalize.highp_fragment.vec2', input: 'vec2(0.5, 0.5), (), (), ()', reference: [false, 0.707106, 0.707107, false, 0.707106, 0.707107]});
+ref.push({testName: 'precision.normalize.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.57735, 0.577351, false, 0.57735, 0.577351, false, 0.57735, 0.577351]});
+ref.push({testName: 'precision.normalize.highp_fragment.vec3', input: 'vec3(0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.57735, 0.577351, false, 0.57735, 0.577351, false, 0.57735, 0.577351]});
+ref.push({testName: 'precision.normalize.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.normalize.highp_fragment.vec4', input: 'vec4(0.5, 0.5, 0.5, 0.5), (), (), ()', reference: [false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5, false, 0.5, 0.5]});
+ref.push({testName: 'precision.faceforward.lowp_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, -0.203125, -0.195313]});
+ref.push({testName: 'precision.faceforward.lowp_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, -0.203125, -0.195313]});
+ref.push({testName: 'precision.faceforward.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [false, -0.203125, -0.195313, false, -0.203125, -0.195313]});
+ref.push({testName: 'precision.faceforward.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, -0.203125, -0.195313, false, -0.203125, -0.195313]});
+ref.push({testName: 'precision.faceforward.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [false, -0.203125, -0.195313, false, -0.203125, -0.195313, false, -0.203125, -0.195313]});
+ref.push({testName: 'precision.faceforward.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, -0.203125, -0.195313, false, -0.203125, -0.195313, false, -0.203125, -0.195313]});
+ref.push({testName: 'precision.faceforward.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [false, -0.203125, -0.195313, false, -0.203125, -0.195313, false, -0.203125, -0.195313, false, -0.203125, -0.195313]});
+ref.push({testName: 'precision.faceforward.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, -0.203125, -0.195313, false, -0.203125, -0.195313, false, -0.203125, -0.195313, false, -0.203125, -0.195313]});
+ref.push({testName: 'precision.faceforward.lowp_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, -0.203125, -0.195313]});
+ref.push({testName: 'precision.faceforward.lowp_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, -0.203125, -0.195313]});
+ref.push({testName: 'precision.faceforward.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [false, -0.203125, -0.195313, false, -0.203125, -0.195313]});
+ref.push({testName: 'precision.faceforward.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, -0.203125, -0.195313, false, -0.203125, -0.195313]});
+ref.push({testName: 'precision.faceforward.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [false, -0.203125, -0.195313, false, -0.203125, -0.195313, false, -0.203125, -0.195313]});
+ref.push({testName: 'precision.faceforward.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, -0.203125, -0.195313, false, -0.203125, -0.195313, false, -0.203125, -0.195313]});
+ref.push({testName: 'precision.faceforward.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [false, -0.203125, -0.195313, false, -0.203125, -0.195313, false, -0.203125, -0.195313, false, -0.203125, -0.195313]});
+ref.push({testName: 'precision.faceforward.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, -0.203125, -0.195313, false, -0.203125, -0.195313, false, -0.203125, -0.195313, false, -0.203125, -0.195313]});
+ref.push({testName: 'precision.faceforward.mediump_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, -0.200195, -0.199951]});
+ref.push({testName: 'precision.faceforward.mediump_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, -0.200195, -0.199951]});
+ref.push({testName: 'precision.faceforward.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [false, -0.200195, -0.199951, false, -0.200195, -0.199951]});
+ref.push({testName: 'precision.faceforward.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, -0.200195, -0.199951, false, -0.200195, -0.199951]});
+ref.push({testName: 'precision.faceforward.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [false, -0.200195, -0.199951, false, -0.200195, -0.199951, false, -0.200195, -0.199951]});
+ref.push({testName: 'precision.faceforward.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, -0.200195, -0.199951, false, -0.200195, -0.199951, false, -0.200195, -0.199951]});
+ref.push({testName: 'precision.faceforward.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [false, -0.200195, -0.199951, false, -0.200195, -0.199951, false, -0.200195, -0.199951, false, -0.200195, -0.199951]});
+ref.push({testName: 'precision.faceforward.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, -0.200195, -0.199951, false, -0.200195, -0.199951, false, -0.200195, -0.199951, false, -0.200195, -0.199951]});
+ref.push({testName: 'precision.faceforward.mediump_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, -0.200195, -0.199951]});
+ref.push({testName: 'precision.faceforward.mediump_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, -0.200195, -0.199951]});
+ref.push({testName: 'precision.faceforward.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [false, -0.200195, -0.199951, false, -0.200195, -0.199951]});
+ref.push({testName: 'precision.faceforward.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, -0.200195, -0.199951, false, -0.200195, -0.199951]});
+ref.push({testName: 'precision.faceforward.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [false, -0.200195, -0.199951, false, -0.200195, -0.199951, false, -0.200195, -0.199951]});
+ref.push({testName: 'precision.faceforward.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, -0.200195, -0.199951, false, -0.200195, -0.199951, false, -0.200195, -0.199951]});
+ref.push({testName: 'precision.faceforward.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [false, -0.200195, -0.199951, false, -0.200195, -0.199951, false, -0.200195, -0.199951, false, -0.200195, -0.199951]});
+ref.push({testName: 'precision.faceforward.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, -0.200195, -0.199951, false, -0.200195, -0.199951, false, -0.200195, -0.199951, false, -0.200195, -0.199951]});
+ref.push({testName: 'precision.faceforward.highp_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, -0.2, -0.2]});
+ref.push({testName: 'precision.faceforward.highp_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, -0.2, -0.2]});
+ref.push({testName: 'precision.faceforward.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [false, -0.2, -0.2, false, -0.2, -0.2]});
+ref.push({testName: 'precision.faceforward.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, -0.2, -0.2, false, -0.2, -0.2]});
+ref.push({testName: 'precision.faceforward.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2]});
+ref.push({testName: 'precision.faceforward.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2]});
+ref.push({testName: 'precision.faceforward.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2]});
+ref.push({testName: 'precision.faceforward.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2]});
+ref.push({testName: 'precision.faceforward.highp_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, -0.2, -0.2]});
+ref.push({testName: 'precision.faceforward.highp_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, -0.2, -0.2]});
+ref.push({testName: 'precision.faceforward.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.2, 0.2), ()', reference: [false, -0.2, -0.2, false, -0.2, -0.2]});
+ref.push({testName: 'precision.faceforward.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), vec2(0.5, 0.5), ()', reference: [false, -0.2, -0.2, false, -0.2, -0.2]});
+ref.push({testName: 'precision.faceforward.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), ()', reference: [false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2]});
+ref.push({testName: 'precision.faceforward.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), ()', reference: [false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2]});
+ref.push({testName: 'precision.faceforward.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), ()', reference: [false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2]});
+ref.push({testName: 'precision.faceforward.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), ()', reference: [false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2]});
+ref.push({testName: 'precision.reflect.lowp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.164063, 0.203125]});
+ref.push({testName: 'precision.reflect.lowp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.0859375, 0.109375]});
+ref.push({testName: 'precision.reflect.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.148438, 0.1875, false, 0.148438, 0.1875]});
+ref.push({testName: 'precision.reflect.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -0.0078125, 0.015625, false, -0.0078125, 0.015625]});
+ref.push({testName: 'precision.reflect.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.132813, 0.171875, false, 0.132813, 0.171875, false, 0.132813, 0.171875]});
+ref.push({testName: 'precision.reflect.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.117188, -0.078125, false, -0.117188, -0.078125, false, -0.117188, -0.078125]});
+ref.push({testName: 'precision.reflect.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.117188, 0.15625, false, 0.117188, 0.15625, false, 0.117188, 0.15625, false, 0.117188, 0.15625]});
+ref.push({testName: 'precision.reflect.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -0.210938, -0.171875, false, -0.210938, -0.171875, false, -0.210938, -0.171875, false, -0.210938, -0.171875]});
+ref.push({testName: 'precision.reflect.lowp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.164063, 0.203125]});
+ref.push({testName: 'precision.reflect.lowp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.0859375, 0.109375]});
+ref.push({testName: 'precision.reflect.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.148438, 0.1875, false, 0.148438, 0.1875]});
+ref.push({testName: 'precision.reflect.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -0.0078125, 0.015625, false, -0.0078125, 0.015625]});
+ref.push({testName: 'precision.reflect.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.132813, 0.171875, false, 0.132813, 0.171875, false, 0.132813, 0.171875]});
+ref.push({testName: 'precision.reflect.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.117188, -0.078125, false, -0.117188, -0.078125, false, -0.117188, -0.078125]});
+ref.push({testName: 'precision.reflect.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.117188, 0.15625, false, 0.117188, 0.15625, false, 0.117188, 0.15625, false, 0.117188, 0.15625]});
+ref.push({testName: 'precision.reflect.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -0.210938, -0.171875, false, -0.210938, -0.171875, false, -0.210938, -0.171875, false, -0.210938, -0.171875]});
+ref.push({testName: 'precision.reflect.mediump_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.183838, 0.184326]});
+ref.push({testName: 'precision.reflect.mediump_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.0998535, 0.10022]});
+ref.push({testName: 'precision.reflect.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.167725, 0.168457, false, 0.167725, 0.168457]});
+ref.push({testName: 'precision.reflect.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -0.000244141, 0.000244141, false, -0.000244141, 0.000244141]});
+ref.push({testName: 'precision.reflect.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.151611, 0.152344, false, 0.151611, 0.152344, false, 0.151611, 0.152344]});
+ref.push({testName: 'precision.reflect.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.100342, -0.0996094, false, -0.100342, -0.0996094, false, -0.100342, -0.0996094]});
+ref.push({testName: 'precision.reflect.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.135498, 0.136475, false, 0.135498, 0.136475, false, 0.135498, 0.136475, false, 0.135498, 0.136475]});
+ref.push({testName: 'precision.reflect.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -0.200439, -0.199219, false, -0.200439, -0.199219, false, -0.200439, -0.199219, false, -0.200439, -0.199219]});
+ref.push({testName: 'precision.reflect.mediump_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.183838, 0.184326]});
+ref.push({testName: 'precision.reflect.mediump_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.0998535, 0.10022]});
+ref.push({testName: 'precision.reflect.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.167725, 0.168457, false, 0.167725, 0.168457]});
+ref.push({testName: 'precision.reflect.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, -0.000244141, 0.000244141, false, -0.000244141, 0.000244141]});
+ref.push({testName: 'precision.reflect.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.151611, 0.152344, false, 0.151611, 0.152344, false, 0.151611, 0.152344]});
+ref.push({testName: 'precision.reflect.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.100342, -0.0996094, false, -0.100342, -0.0996094, false, -0.100342, -0.0996094]});
+ref.push({testName: 'precision.reflect.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.135498, 0.136475, false, 0.135498, 0.136475, false, 0.135498, 0.136475, false, 0.135498, 0.136475]});
+ref.push({testName: 'precision.reflect.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -0.200439, -0.199219, false, -0.200439, -0.199219, false, -0.200439, -0.199219, false, -0.200439, -0.199219]});
+ref.push({testName: 'precision.reflect.highp_vertex.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.184, 0.184]});
+ref.push({testName: 'precision.reflect.highp_vertex.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.1, 0.1]});
+ref.push({testName: 'precision.reflect.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.168, 0.168, false, 0.168, 0.168]});
+ref.push({testName: 'precision.reflect.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.reflect.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.152, 0.152, false, 0.152, 0.152, false, 0.152, 0.152]});
+ref.push({testName: 'precision.reflect.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.1, -0.1, false, -0.1, -0.1, false, -0.1, -0.1]});
+ref.push({testName: 'precision.reflect.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.136, 0.136, false, 0.136, 0.136, false, 0.136, 0.136, false, 0.136, 0.136]});
+ref.push({testName: 'precision.reflect.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2]});
+ref.push({testName: 'precision.reflect.highp_fragment.scalar', input: '0.2, 0.2, (), ()', reference: [false, 0.184, 0.184]});
+ref.push({testName: 'precision.reflect.highp_fragment.scalar', input: '0.2, 0.5, (), ()', reference: [false, 0.1, 0.1]});
+ref.push({testName: 'precision.reflect.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.168, 0.168, false, 0.168, 0.168]});
+ref.push({testName: 'precision.reflect.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.reflect.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.152, 0.152, false, 0.152, 0.152, false, 0.152, 0.152]});
+ref.push({testName: 'precision.reflect.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, -0.1, -0.1, false, -0.1, -0.1, false, -0.1, -0.1]});
+ref.push({testName: 'precision.reflect.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.136, 0.136, false, 0.136, 0.136, false, 0.136, 0.136, false, 0.136, 0.136]});
+ref.push({testName: 'precision.reflect.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2, false, -0.2, -0.2]});
+ref.push({testName: 'precision.refract.lowp_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.refract.lowp_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.refract.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), 0.2, ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.refract.lowp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), 0.5, ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.refract.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), 0.2, ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.refract.lowp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), 0.5, ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.refract.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), 0.2, ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.refract.lowp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), 0.5, ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.refract.lowp_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.refract.lowp_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, -Infinity, Infinity]});
+ref.push({testName: 'precision.refract.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), 0.2, ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.refract.lowp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), 0.5, ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.refract.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), 0.2, ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.refract.lowp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), 0.5, ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.refract.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), 0.2, ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.refract.lowp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), 0.5, ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.refract.mediump_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, -0.159424, -0.155762]});
+ref.push({testName: 'precision.refract.mediump_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, -0.0787354, -0.0756836]});
+ref.push({testName: 'precision.refract.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), 0.2, ()', reference: [false, -0.161377, -0.157471, false, -0.161377, -0.157471]});
+ref.push({testName: 'precision.refract.mediump_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), 0.5, ()', reference: [false, -0.0828857, -0.079834, false, -0.0828857, -0.079834]});
+ref.push({testName: 'precision.refract.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), 0.2, ()', reference: [false, -0.162842, -0.158936, false, -0.162842, -0.158936, false, -0.162842, -0.158936]});
+ref.push({testName: 'precision.refract.mediump_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), 0.5, ()', reference: [false, -0.0872803, -0.0842285, false, -0.0872803, -0.0842285, false, -0.0872803, -0.0842285]});
+ref.push({testName: 'precision.refract.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), 0.2, ()', reference: [false, -0.164551, -0.1604, false, -0.164551, -0.1604, false, -0.164551, -0.1604, false, -0.164551, -0.1604]});
+ref.push({testName: 'precision.refract.mediump_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), 0.5, ()', reference: [false, -0.0914307, -0.0883789, false, -0.0914307, -0.0883789, false, -0.0914307, -0.0883789, false, -0.0914307, -0.0883789]});
+ref.push({testName: 'precision.refract.mediump_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, -0.159424, -0.155762]});
+ref.push({testName: 'precision.refract.mediump_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, -0.0787354, -0.0756836]});
+ref.push({testName: 'precision.refract.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), 0.2, ()', reference: [false, -0.161377, -0.157471, false, -0.161377, -0.157471]});
+ref.push({testName: 'precision.refract.mediump_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), 0.5, ()', reference: [false, -0.0828857, -0.079834, false, -0.0828857, -0.079834]});
+ref.push({testName: 'precision.refract.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), 0.2, ()', reference: [false, -0.162842, -0.158936, false, -0.162842, -0.158936, false, -0.162842, -0.158936]});
+ref.push({testName: 'precision.refract.mediump_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), 0.5, ()', reference: [false, -0.0872803, -0.0842285, false, -0.0872803, -0.0842285, false, -0.0872803, -0.0842285]});
+ref.push({testName: 'precision.refract.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), 0.2, ()', reference: [false, -0.164551, -0.1604, false, -0.164551, -0.1604, false, -0.164551, -0.1604, false, -0.164551, -0.1604]});
+ref.push({testName: 'precision.refract.mediump_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), 0.5, ()', reference: [false, -0.0914307, -0.0883789, false, -0.0914307, -0.0883789, false, -0.0914307, -0.0883789, false, -0.0914307, -0.0883789]});
+ref.push({testName: 'precision.refract.highp_vertex.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, -0.157566, -0.157566]});
+ref.push({testName: 'precision.refract.highp_vertex.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, -0.0772513, -0.0772512]});
+ref.push({testName: 'precision.refract.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), 0.2, ()', reference: [false, -0.159185, -0.159185, false, -0.159185, -0.159185]});
+ref.push({testName: 'precision.refract.highp_vertex.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), 0.5, ()', reference: [false, -0.0813898, -0.0813897, false, -0.0813898, -0.0813897]});
+ref.push({testName: 'precision.refract.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), 0.2, ()', reference: [false, -0.160818, -0.160818, false, -0.160818, -0.160818, false, -0.160818, -0.160818]});
+ref.push({testName: 'precision.refract.highp_vertex.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), 0.5, ()', reference: [false, -0.0856203, -0.0856202, false, -0.0856203, -0.0856202, false, -0.0856203, -0.0856202]});
+ref.push({testName: 'precision.refract.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), 0.2, ()', reference: [false, -0.162464, -0.162464, false, -0.162464, -0.162464, false, -0.162464, -0.162464, false, -0.162464, -0.162464]});
+ref.push({testName: 'precision.refract.highp_vertex.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), 0.5, ()', reference: [false, -0.0899426, -0.0899425, false, -0.0899426, -0.0899425, false, -0.0899426, -0.0899425, false, -0.0899426, -0.0899425]});
+ref.push({testName: 'precision.refract.highp_fragment.scalar', input: '0.2, 0.2, 0.2, ()', reference: [false, -0.157566, -0.157566]});
+ref.push({testName: 'precision.refract.highp_fragment.scalar', input: '0.2, 0.2, 0.5, ()', reference: [false, -0.0772513, -0.0772512]});
+ref.push({testName: 'precision.refract.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), 0.2, ()', reference: [false, -0.159185, -0.159185, false, -0.159185, -0.159185]});
+ref.push({testName: 'precision.refract.highp_fragment.vec2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), 0.5, ()', reference: [false, -0.0813898, -0.0813897, false, -0.0813898, -0.0813897]});
+ref.push({testName: 'precision.refract.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), 0.2, ()', reference: [false, -0.160818, -0.160818, false, -0.160818, -0.160818, false, -0.160818, -0.160818]});
+ref.push({testName: 'precision.refract.highp_fragment.vec3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), 0.5, ()', reference: [false, -0.0856203, -0.0856202, false, -0.0856203, -0.0856202, false, -0.0856203, -0.0856202]});
+ref.push({testName: 'precision.refract.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), 0.2, ()', reference: [false, -0.162464, -0.162464, false, -0.162464, -0.162464, false, -0.162464, -0.162464, false, -0.162464, -0.162464]});
+ref.push({testName: 'precision.refract.highp_fragment.vec4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), 0.5, ()', reference: [false, -0.0899426, -0.0899425, false, -0.0899426, -0.0899425, false, -0.0899426, -0.0899425, false, -0.0899426, -0.0899425]});
+ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), mat2(vec2(0.2, 0), vec2(0, 0.2)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), mat2(vec2(0.5, 0), vec2(0, 0.5)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat2x3', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat2x3', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), mat2x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat2x4', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat2x4', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), mat2x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat3x2', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat3x2', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), mat3x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), mat3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat3x4', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat3x4', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), mat3x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat4x2', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat4x2', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), mat4x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0), vec2(0, 0)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat4x3', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat4x3', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), mat4x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5), vec3(0, 0, 0)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.matrixcompmult.lowp_vertex.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), mat4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0), vec4(0, 0, 0, 0.5)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), mat2(vec2(0.2, 0), vec2(0, 0.2)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), mat2(vec2(0.5, 0), vec2(0, 0.5)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat2x3', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat2x3', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), mat2x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat2x4', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat2x4', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), mat2x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat3x2', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat3x2', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), mat3x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), mat3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat3x4', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat3x4', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), mat3x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat4x2', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat4x2', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), mat4x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0), vec2(0, 0)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat4x3', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat4x3', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), mat4x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5), vec3(0, 0, 0)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), (), ()', reference: [false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.matrixcompmult.lowp_fragment.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), mat4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0), vec4(0, 0, 0, 0.5)), (), ()', reference: [false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), mat2(vec2(0.2, 0), vec2(0, 0.2)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), mat2(vec2(0.5, 0), vec2(0, 0.5)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat2x3', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat2x3', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), mat2x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat2x4', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat2x4', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), mat2x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat3x2', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat3x2', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), mat3x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), mat3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat3x4', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat3x4', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), mat3x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat4x2', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat4x2', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), mat4x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0), vec2(0, 0)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat4x3', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat4x3', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), mat4x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5), vec3(0, 0, 0)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.matrixcompmult.mediump_vertex.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), mat4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0), vec4(0, 0, 0, 0.5)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), mat2(vec2(0.2, 0), vec2(0, 0.2)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), mat2(vec2(0.5, 0), vec2(0, 0.5)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat2x3', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat2x3', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), mat2x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat2x4', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat2x4', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), mat2x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat3x2', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat3x2', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), mat3x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), mat3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat3x4', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat3x4', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), mat3x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat4x2', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat4x2', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), mat4x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0), vec2(0, 0)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat4x3', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat4x3', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), mat4x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5), vec3(0, 0, 0)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), (), ()', reference: [false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.matrixcompmult.mediump_fragment.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), mat4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0), vec4(0, 0, 0, 0.5)), (), ()', reference: [false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), mat2(vec2(0.2, 0), vec2(0, 0.2)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0.04, 0.04]});
+ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), mat2(vec2(0.5, 0), vec2(0, 0.5)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0.1, 0.1]});
+ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat2x3', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat2x3', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), mat2x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat2x4', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat2x4', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), mat2x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat3x2', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat3x2', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), mat3x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04]});
+ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), mat3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1]});
+ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat3x4', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat3x4', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), mat3x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat4x2', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat4x2', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), mat4x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0), vec2(0, 0)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat4x3', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat4x3', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), mat4x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5), vec3(0, 0, 0)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04]});
+ref.push({testName: 'precision.matrixcompmult.highp_vertex.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), mat4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0), vec4(0, 0, 0, 0.5)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1]});
+ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), mat2(vec2(0.2, 0), vec2(0, 0.2)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0.04, 0.04]});
+ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), mat2(vec2(0.5, 0), vec2(0, 0.5)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0.1, 0.1]});
+ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat2x3', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat2x3', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), mat2x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat2x4', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat2x4', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), mat2x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat3x2', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat3x2', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), mat3x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04]});
+ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), mat3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1]});
+ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat3x4', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat3x4', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), mat3x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat4x2', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat4x2', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), mat4x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0), vec2(0, 0)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat4x3', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat4x3', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), mat4x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5), vec3(0, 0, 0)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), (), ()', reference: [false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.04, 0.04]});
+ref.push({testName: 'precision.matrixcompmult.highp_fragment.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), mat4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0), vec4(0, 0, 0, 0.5)), (), ()', reference: [false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.1, 0.1]});
+ref.push({testName: 'precision.outerproduct.lowp_vertex.mat2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.outerproduct.lowp_vertex.mat2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.outerproduct.lowp_vertex.mat2x3', input: 'vec3(0.2, 0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.outerproduct.lowp_vertex.mat2x3', input: 'vec3(0.2, 0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.outerproduct.lowp_vertex.mat2x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.outerproduct.lowp_vertex.mat2x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.outerproduct.lowp_vertex.mat3x2', input: 'vec2(0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.outerproduct.lowp_vertex.mat3x2', input: 'vec2(0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.outerproduct.lowp_vertex.mat3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.outerproduct.lowp_vertex.mat3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.outerproduct.lowp_vertex.mat3x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.outerproduct.lowp_vertex.mat3x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.outerproduct.lowp_vertex.mat4x2', input: 'vec2(0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.outerproduct.lowp_vertex.mat4x2', input: 'vec2(0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.outerproduct.lowp_vertex.mat4x3', input: 'vec3(0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.outerproduct.lowp_vertex.mat4x3', input: 'vec3(0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.outerproduct.lowp_vertex.mat4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.outerproduct.lowp_vertex.mat4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.outerproduct.lowp_fragment.mat2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.outerproduct.lowp_fragment.mat2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.outerproduct.lowp_fragment.mat2x3', input: 'vec3(0.2, 0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.outerproduct.lowp_fragment.mat2x3', input: 'vec3(0.2, 0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.outerproduct.lowp_fragment.mat2x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.outerproduct.lowp_fragment.mat2x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.outerproduct.lowp_fragment.mat3x2', input: 'vec2(0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.outerproduct.lowp_fragment.mat3x2', input: 'vec2(0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.outerproduct.lowp_fragment.mat3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.outerproduct.lowp_fragment.mat3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.outerproduct.lowp_fragment.mat3x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.outerproduct.lowp_fragment.mat3x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.outerproduct.lowp_fragment.mat4x2', input: 'vec2(0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.outerproduct.lowp_fragment.mat4x2', input: 'vec2(0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.outerproduct.lowp_fragment.mat4x3', input: 'vec3(0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.outerproduct.lowp_fragment.mat4x3', input: 'vec3(0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.outerproduct.lowp_fragment.mat4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875, false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.outerproduct.lowp_fragment.mat4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563, false, 0.09375, 0.101563]});
+ref.push({testName: 'precision.outerproduct.mediump_vertex.mat2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.outerproduct.mediump_vertex.mat2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.outerproduct.mediump_vertex.mat2x3', input: 'vec3(0.2, 0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.outerproduct.mediump_vertex.mat2x3', input: 'vec3(0.2, 0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.outerproduct.mediump_vertex.mat2x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.outerproduct.mediump_vertex.mat2x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.outerproduct.mediump_vertex.mat3x2', input: 'vec2(0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.outerproduct.mediump_vertex.mat3x2', input: 'vec2(0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.outerproduct.mediump_vertex.mat3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.outerproduct.mediump_vertex.mat3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.outerproduct.mediump_vertex.mat3x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.outerproduct.mediump_vertex.mat3x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.outerproduct.mediump_vertex.mat4x2', input: 'vec2(0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.outerproduct.mediump_vertex.mat4x2', input: 'vec2(0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.outerproduct.mediump_vertex.mat4x3', input: 'vec3(0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.outerproduct.mediump_vertex.mat4x3', input: 'vec3(0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.outerproduct.mediump_vertex.mat4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.outerproduct.mediump_vertex.mat4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.outerproduct.mediump_fragment.mat2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.outerproduct.mediump_fragment.mat2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.outerproduct.mediump_fragment.mat2x3', input: 'vec3(0.2, 0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.outerproduct.mediump_fragment.mat2x3', input: 'vec3(0.2, 0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.outerproduct.mediump_fragment.mat2x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.outerproduct.mediump_fragment.mat2x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.outerproduct.mediump_fragment.mat3x2', input: 'vec2(0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.outerproduct.mediump_fragment.mat3x2', input: 'vec2(0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.outerproduct.mediump_fragment.mat3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.outerproduct.mediump_fragment.mat3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.outerproduct.mediump_fragment.mat3x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.outerproduct.mediump_fragment.mat3x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.outerproduct.mediump_fragment.mat4x2', input: 'vec2(0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.outerproduct.mediump_fragment.mat4x2', input: 'vec2(0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.outerproduct.mediump_fragment.mat4x3', input: 'vec3(0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.outerproduct.mediump_fragment.mat4x3', input: 'vec3(0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.outerproduct.mediump_fragment.mat4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001, false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.outerproduct.mediump_fragment.mat4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098, false, 0.0999756, 0.100098]});
+ref.push({testName: 'precision.outerproduct.highp_vertex.mat2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]});
+ref.push({testName: 'precision.outerproduct.highp_vertex.mat2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]});
+ref.push({testName: 'precision.outerproduct.highp_vertex.mat2x3', input: 'vec3(0.2, 0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]});
+ref.push({testName: 'precision.outerproduct.highp_vertex.mat2x3', input: 'vec3(0.2, 0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]});
+ref.push({testName: 'precision.outerproduct.highp_vertex.mat2x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]});
+ref.push({testName: 'precision.outerproduct.highp_vertex.mat2x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]});
+ref.push({testName: 'precision.outerproduct.highp_vertex.mat3x2', input: 'vec2(0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]});
+ref.push({testName: 'precision.outerproduct.highp_vertex.mat3x2', input: 'vec2(0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]});
+ref.push({testName: 'precision.outerproduct.highp_vertex.mat3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]});
+ref.push({testName: 'precision.outerproduct.highp_vertex.mat3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]});
+ref.push({testName: 'precision.outerproduct.highp_vertex.mat3x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]});
+ref.push({testName: 'precision.outerproduct.highp_vertex.mat3x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]});
+ref.push({testName: 'precision.outerproduct.highp_vertex.mat4x2', input: 'vec2(0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]});
+ref.push({testName: 'precision.outerproduct.highp_vertex.mat4x2', input: 'vec2(0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]});
+ref.push({testName: 'precision.outerproduct.highp_vertex.mat4x3', input: 'vec3(0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]});
+ref.push({testName: 'precision.outerproduct.highp_vertex.mat4x3', input: 'vec3(0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]});
+ref.push({testName: 'precision.outerproduct.highp_vertex.mat4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]});
+ref.push({testName: 'precision.outerproduct.highp_vertex.mat4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]});
+ref.push({testName: 'precision.outerproduct.highp_fragment.mat2', input: 'vec2(0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]});
+ref.push({testName: 'precision.outerproduct.highp_fragment.mat2', input: 'vec2(0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]});
+ref.push({testName: 'precision.outerproduct.highp_fragment.mat2x3', input: 'vec3(0.2, 0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]});
+ref.push({testName: 'precision.outerproduct.highp_fragment.mat2x3', input: 'vec3(0.2, 0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]});
+ref.push({testName: 'precision.outerproduct.highp_fragment.mat2x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec2(0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]});
+ref.push({testName: 'precision.outerproduct.highp_fragment.mat2x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec2(0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]});
+ref.push({testName: 'precision.outerproduct.highp_fragment.mat3x2', input: 'vec2(0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]});
+ref.push({testName: 'precision.outerproduct.highp_fragment.mat3x2', input: 'vec2(0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]});
+ref.push({testName: 'precision.outerproduct.highp_fragment.mat3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]});
+ref.push({testName: 'precision.outerproduct.highp_fragment.mat3', input: 'vec3(0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]});
+ref.push({testName: 'precision.outerproduct.highp_fragment.mat3x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec3(0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]});
+ref.push({testName: 'precision.outerproduct.highp_fragment.mat3x4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec3(0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]});
+ref.push({testName: 'precision.outerproduct.highp_fragment.mat4x2', input: 'vec2(0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]});
+ref.push({testName: 'precision.outerproduct.highp_fragment.mat4x2', input: 'vec2(0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]});
+ref.push({testName: 'precision.outerproduct.highp_fragment.mat4x3', input: 'vec3(0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]});
+ref.push({testName: 'precision.outerproduct.highp_fragment.mat4x3', input: 'vec3(0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]});
+ref.push({testName: 'precision.outerproduct.highp_fragment.mat4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.2, 0.2, 0.2, 0.2), (), ()', reference: [false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04, false, 0.04, 0.04]});
+ref.push({testName: 'precision.outerproduct.highp_fragment.mat4', input: 'vec4(0.2, 0.2, 0.2, 0.2), vec4(0.5, 0.5, 0.5, 0.5), (), ()', reference: [false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1, false, 0.1, 0.1]});
+ref.push({testName: 'precision.transpose.lowp_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.transpose.lowp_vertex.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5]});
+ref.push({testName: 'precision.transpose.lowp_vertex.mat2x3', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0]});
+ref.push({testName: 'precision.transpose.lowp_vertex.mat2x3', input: 'mat3x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0]});
+ref.push({testName: 'precision.transpose.lowp_vertex.mat2x4', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.lowp_vertex.mat2x4', input: 'mat4x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0), vec2(0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.lowp_vertex.mat3x2', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.lowp_vertex.mat3x2', input: 'mat2x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.lowp_vertex.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.transpose.lowp_vertex.mat3', input: 'mat3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5]});
+ref.push({testName: 'precision.transpose.lowp_vertex.mat3x4', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0]});
+ref.push({testName: 'precision.transpose.lowp_vertex.mat3x4', input: 'mat4x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5), vec3(0, 0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0]});
+ref.push({testName: 'precision.transpose.lowp_vertex.mat4x2', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.lowp_vertex.mat4x2', input: 'mat2x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.lowp_vertex.mat4x3', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.lowp_vertex.mat4x3', input: 'mat3x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.lowp_vertex.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.transpose.lowp_vertex.mat4', input: 'mat4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0), vec4(0, 0, 0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5]});
+ref.push({testName: 'precision.transpose.lowp_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.transpose.lowp_fragment.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5]});
+ref.push({testName: 'precision.transpose.lowp_fragment.mat2x3', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0]});
+ref.push({testName: 'precision.transpose.lowp_fragment.mat2x3', input: 'mat3x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0]});
+ref.push({testName: 'precision.transpose.lowp_fragment.mat2x4', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.lowp_fragment.mat2x4', input: 'mat4x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0), vec2(0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.lowp_fragment.mat3x2', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.lowp_fragment.mat3x2', input: 'mat2x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.lowp_fragment.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.transpose.lowp_fragment.mat3', input: 'mat3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5]});
+ref.push({testName: 'precision.transpose.lowp_fragment.mat3x4', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0]});
+ref.push({testName: 'precision.transpose.lowp_fragment.mat3x4', input: 'mat4x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5), vec3(0, 0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0]});
+ref.push({testName: 'precision.transpose.lowp_fragment.mat4x2', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.lowp_fragment.mat4x2', input: 'mat2x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.lowp_fragment.mat4x3', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.lowp_fragment.mat4x3', input: 'mat3x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.lowp_fragment.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), (), (), ()', reference: [false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.195313, 0.203125]});
+ref.push({testName: 'precision.transpose.lowp_fragment.mat4', input: 'mat4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0), vec4(0, 0, 0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5]});
+ref.push({testName: 'precision.transpose.mediump_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.transpose.mediump_vertex.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5]});
+ref.push({testName: 'precision.transpose.mediump_vertex.mat2x3', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0]});
+ref.push({testName: 'precision.transpose.mediump_vertex.mat2x3', input: 'mat3x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0]});
+ref.push({testName: 'precision.transpose.mediump_vertex.mat2x4', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.mediump_vertex.mat2x4', input: 'mat4x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0), vec2(0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.mediump_vertex.mat3x2', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.mediump_vertex.mat3x2', input: 'mat2x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.mediump_vertex.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.transpose.mediump_vertex.mat3', input: 'mat3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5]});
+ref.push({testName: 'precision.transpose.mediump_vertex.mat3x4', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0]});
+ref.push({testName: 'precision.transpose.mediump_vertex.mat3x4', input: 'mat4x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5), vec3(0, 0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0]});
+ref.push({testName: 'precision.transpose.mediump_vertex.mat4x2', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.mediump_vertex.mat4x2', input: 'mat2x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.mediump_vertex.mat4x3', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.mediump_vertex.mat4x3', input: 'mat3x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.mediump_vertex.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.transpose.mediump_vertex.mat4', input: 'mat4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0), vec4(0, 0, 0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5]});
+ref.push({testName: 'precision.transpose.mediump_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.transpose.mediump_fragment.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5]});
+ref.push({testName: 'precision.transpose.mediump_fragment.mat2x3', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0]});
+ref.push({testName: 'precision.transpose.mediump_fragment.mat2x3', input: 'mat3x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0]});
+ref.push({testName: 'precision.transpose.mediump_fragment.mat2x4', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.mediump_fragment.mat2x4', input: 'mat4x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0), vec2(0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.mediump_fragment.mat3x2', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.mediump_fragment.mat3x2', input: 'mat2x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.mediump_fragment.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.transpose.mediump_fragment.mat3', input: 'mat3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5]});
+ref.push({testName: 'precision.transpose.mediump_fragment.mat3x4', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0]});
+ref.push({testName: 'precision.transpose.mediump_fragment.mat3x4', input: 'mat4x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5), vec3(0, 0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0]});
+ref.push({testName: 'precision.transpose.mediump_fragment.mat4x2', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.mediump_fragment.mat4x2', input: 'mat2x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.mediump_fragment.mat4x3', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.mediump_fragment.mat4x3', input: 'mat3x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.mediump_fragment.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), (), (), ()', reference: [false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.199951, 0.200195]});
+ref.push({testName: 'precision.transpose.mediump_fragment.mat4', input: 'mat4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0), vec4(0, 0, 0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5]});
+ref.push({testName: 'precision.transpose.highp_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0.2, 0.2]});
+ref.push({testName: 'precision.transpose.highp_vertex.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5]});
+ref.push({testName: 'precision.transpose.highp_vertex.mat2x3', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0]});
+ref.push({testName: 'precision.transpose.highp_vertex.mat2x3', input: 'mat3x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0]});
+ref.push({testName: 'precision.transpose.highp_vertex.mat2x4', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.highp_vertex.mat2x4', input: 'mat4x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0), vec2(0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.highp_vertex.mat3x2', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.highp_vertex.mat3x2', input: 'mat2x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.highp_vertex.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2]});
+ref.push({testName: 'precision.transpose.highp_vertex.mat3', input: 'mat3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5]});
+ref.push({testName: 'precision.transpose.highp_vertex.mat3x4', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0]});
+ref.push({testName: 'precision.transpose.highp_vertex.mat3x4', input: 'mat4x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5), vec3(0, 0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0]});
+ref.push({testName: 'precision.transpose.highp_vertex.mat4x2', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.highp_vertex.mat4x2', input: 'mat2x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.highp_vertex.mat4x3', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.highp_vertex.mat4x3', input: 'mat3x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.highp_vertex.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2]});
+ref.push({testName: 'precision.transpose.highp_vertex.mat4', input: 'mat4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0), vec4(0, 0, 0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5]});
+ref.push({testName: 'precision.transpose.highp_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0.2, 0.2]});
+ref.push({testName: 'precision.transpose.highp_fragment.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5]});
+ref.push({testName: 'precision.transpose.highp_fragment.mat2x3', input: 'mat3x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0]});
+ref.push({testName: 'precision.transpose.highp_fragment.mat2x3', input: 'mat3x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0]});
+ref.push({testName: 'precision.transpose.highp_fragment.mat2x4', input: 'mat4x2(vec2(0.2, 0), vec2(0, 0.2), vec2(0, 0), vec2(0, 0)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.highp_fragment.mat2x4', input: 'mat4x2(vec2(0.5, 0), vec2(0, 0.5), vec2(0, 0), vec2(0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.highp_fragment.mat3x2', input: 'mat2x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.highp_fragment.mat3x2', input: 'mat2x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.highp_fragment.mat3', input: 'mat3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2]});
+ref.push({testName: 'precision.transpose.highp_fragment.mat3', input: 'mat3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5]});
+ref.push({testName: 'precision.transpose.highp_fragment.mat3x4', input: 'mat4x3(vec3(0.2, 0, 0), vec3(0, 0.2, 0), vec3(0, 0, 0.2), vec3(0, 0, 0)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0]});
+ref.push({testName: 'precision.transpose.highp_fragment.mat3x4', input: 'mat4x3(vec3(0.5, 0, 0), vec3(0, 0.5, 0), vec3(0, 0, 0.5), vec3(0, 0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0]});
+ref.push({testName: 'precision.transpose.highp_fragment.mat4x2', input: 'mat2x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.highp_fragment.mat4x2', input: 'mat2x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.highp_fragment.mat4x3', input: 'mat3x4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.highp_fragment.mat4x3', input: 'mat3x4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0]});
+ref.push({testName: 'precision.transpose.highp_fragment.mat4', input: 'mat4(vec4(0.2, 0, 0, 0), vec4(0, 0.2, 0, 0), vec4(0, 0, 0.2, 0), vec4(0, 0, 0, 0.2)), (), (), ()', reference: [false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.2, 0.2]});
+ref.push({testName: 'precision.transpose.highp_fragment.mat4', input: 'mat4(vec4(0.5, 0, 0, 0), vec4(0, 0.5, 0, 0), vec4(0, 0, 0.5, 0), vec4(0, 0, 0, 0.5)), (), (), ()', reference: [false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5, false, 0, 0, false, 0, 0, false, 0, 0, false, 0, 0, false, 0.5, 0.5]});
+ref.push({testName: 'precision.determinant.lowp_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.determinant.lowp_vertex.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 0.25, 0.25]});
+ref.push({testName: 'precision.determinant.lowp_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 0.03125, 0.046875]});
+ref.push({testName: 'precision.determinant.lowp_fragment.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 0.25, 0.25]});
+ref.push({testName: 'precision.determinant.mediump_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.determinant.mediump_vertex.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 0.25, 0.25]});
+ref.push({testName: 'precision.determinant.mediump_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 0.039978, 0.0401001]});
+ref.push({testName: 'precision.determinant.mediump_fragment.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 0.25, 0.25]});
+ref.push({testName: 'precision.determinant.highp_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 0.04, 0.04]});
+ref.push({testName: 'precision.determinant.highp_vertex.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 0.25, 0.25]});
+ref.push({testName: 'precision.determinant.highp_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 0.04, 0.04]});
+ref.push({testName: 'precision.determinant.highp_fragment.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 0.25, 0.25]});
+ref.push({testName: 'precision.inverse.lowp_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.inverse.lowp_vertex.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.inverse.lowp_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.inverse.lowp_fragment.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity, false, -Infinity, Infinity]});
+ref.push({testName: 'precision.inverse.mediump_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 4.96677, 5.02716, false, -5.96046e-007, 5.96046e-007, false, -5.96046e-007, 5.96046e-007, false, 4.96677, 5.02716]});
+ref.push({testName: 'precision.inverse.mediump_vertex.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 1.99512, 2.00488, false, -5.96046e-007, 5.96046e-007, false, -5.96046e-007, 5.96046e-007, false, 1.99512, 2.00488]});
+ref.push({testName: 'precision.inverse.mediump_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 4.96677, 5.02716, false, -5.96046e-007, 5.96046e-007, false, -5.96046e-007, 5.96046e-007, false, 4.96677, 5.02716]});
+ref.push({testName: 'precision.inverse.mediump_fragment.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 1.99512, 2.00488, false, -5.96046e-007, 5.96046e-007, false, -5.96046e-007, 5.96046e-007, false, 1.99512, 2.00488]});
+ref.push({testName: 'precision.inverse.highp_vertex.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 5, 5, false, -2.8026e-045, 2.8026e-045, false, -2.8026e-045, 2.8026e-045, false, 5, 5]});
+ref.push({testName: 'precision.inverse.highp_vertex.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 2, 2, false, -2.8026e-045, 2.8026e-045, false, -2.8026e-045, 2.8026e-045, false, 2, 2]});
+ref.push({testName: 'precision.inverse.highp_fragment.mat2', input: 'mat2(vec2(0.2, 0), vec2(0, 0.2)), (), (), ()', reference: [false, 5, 5, false, -2.8026e-045, 2.8026e-045, false, -2.8026e-045, 2.8026e-045, false, 5, 5]});
+ref.push({testName: 'precision.inverse.highp_fragment.mat2', input: 'mat2(vec2(0.5, 0), vec2(0, 0.5)), (), (), ()', reference: [false, 2, 2, false, -2.8026e-045, 2.8026e-045, false, -2.8026e-045, 2.8026e-045, false, 2, 2]});
+
+ glsBuiltinPrecisionTestsUnitTests.plainArray = function(input) {
+ var ret = [];
+
+ if (input instanceof tcuInterval.Interval) {
+ var i = 0;
+ ret[i] = input.m_hasNaN;
+ i++;
+ ret[i] = input.m_lo;
+ i++;
+ ret[i] = input.m_hi;
+ return ret;
+ }
+
+ if (input instanceof tcuMatrix.Matrix) {
+ for (var i = 0, l = 0; i < input.cols; i++)
+ for (var j = 0; j < input.rows; j++, l++) {
+ ret[l] = input.matrix[i][j].m_hasNaN;
+ l++;
+ ret[l] = input.matrix[i][j].m_lo;
+ l++;
+ ret[l] = input.matrix[i][j].m_hi;
+ }
+ return ret;
+ }
+
+ if (input instanceof Array) {
+ var size = input.length;
+ for (var i = 0, j = 0; j < size; j++, i++) {
+ ret[i] = input[j].m_hasNaN;
+ i++;
+ ret[i] = input[j].m_lo;
+ i++;
+ ret[i] = input[j].m_hi;
+ }
+ return ret;
+ }
+ return ret;
+ };
+
+ glsBuiltinPrecisionTestsUnitTests.Compare = function(num1, num2, diff) {
+ if (isFinite(num1))
+ if (Math.abs(Math.abs(num1) - Math.abs(num2)) <= diff)
+ return true;
+ else
+ return false;
+ else
+ if (isFinite(num2))
+ return false;
+ else
+ return true;
+ };
+
+ glsBuiltinPrecisionTestsUnitTests.referenceComparison = function(reference, index, precision) {
+ if (index > 1)
+ return true;
+
+ var testName = _currentTestName;
+ var message1 = '';
+ var ref1 = glsBuiltinPrecisionTestsUnitTests.plainArray(reference);
+ var a = ref.length;
+ var len;
+ var ref_len = ref1.length;
+ var cpp_nan;
+ var ref_nan;
+ var ref_lo;
+ var ref_hi;
+ var cpp_lo;
+ var cpp_hi;
+ var str;
+ var retVal1;
+ var retVal2;
+ var varfix = Math.max(0.0001, precision.ulp(0, 2));
+ var error = false;
+
+ for (var i = 0; i < a; i++) {
+ str = ref[i].testName;
+
+ if (testName == str) {
+ len = ref[i].reference.length;
+
+ if (len != ref_len)
+ return false;
+
+ for (var j = 0; j < len; j++) {
+ cpp_nan = ref[i + index].reference[j];
+ ref_nan = ref1[j];
+ j++;
+ cpp_lo = ref[i + index].reference[j];
+ ref_lo = ref1[j];
+ j++;
+ cpp_hi = ref[i + index].reference[j];
+ ref_hi = ref1[j];
+
+ if (ref_nan == cpp_nan) {
+ retVal1 = glsBuiltinPrecisionTestsUnitTests.Compare(ref_lo, cpp_lo, varfix);
+ retVal2 = glsBuiltinPrecisionTestsUnitTests.Compare(ref_hi, ref_hi, varfix);
+
+ if ((retVal1 != true) || (retVal2 != true)) {
+ message1 = 'Error: ' + varfix;
+ bufferedLogToConsole(message1);
+ message1 = 'C++ Reference values: ' + cpp_nan + ', ' + cpp_lo + ', ' + cpp_hi;
+ bufferedLogToConsole(message1);
+ message1 = 'JS values: ' + ref_nan + ', ' + ref_lo + ', ' + ref_hi;
+ bufferedLogToConsole(message1);
+ error = true;
+ }
+ }
+ }
+ if (error)
+ return false;
+ else
+ return true;
+ }
+ }
+ return true;
+ };
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsDrawTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsDrawTests.js
new file mode 100644
index 0000000000..eb7a4b2935
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsDrawTests.js
@@ -0,0 +1,3452 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('modules.shared.glsDrawTests');
+goog.require('framework.common.tcuFloat');
+goog.require('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuPixelFormat');
+goog.require('framework.common.tcuRGBA');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluStrUtil');
+goog.require('framework.opengl.simplereference.sglrGLContext');
+goog.require('framework.opengl.simplereference.sglrReferenceContext');
+goog.require('framework.opengl.simplereference.sglrShaderProgram');
+goog.require('framework.referencerenderer.rrFragmentOperations');
+goog.require('framework.referencerenderer.rrGenericVector');
+goog.require('framework.referencerenderer.rrShadingContext');
+goog.require('framework.referencerenderer.rrVertexAttrib');
+goog.require('framework.referencerenderer.rrVertexPacket');
+
+goog.scope(function() {
+
+ var glsDrawTests = modules.shared.glsDrawTests;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var tcuRGBA = framework.common.tcuRGBA;
+ var tcuFloat = framework.common.tcuFloat;
+ var tcuPixelFormat = framework.common.tcuPixelFormat;
+ var tcuSurface = framework.common.tcuSurface;
+ var tcuImageCompare = framework.common.tcuImageCompare;
+ var tcuTextureUtil = framework.common.tcuTextureUtil;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var gluStrUtil = framework.opengl.gluStrUtil;
+ var sglrGLContext = framework.opengl.simplereference.sglrGLContext;
+ var sglrReferenceContext = framework.opengl.simplereference.sglrReferenceContext;
+ var sglrShaderProgram = framework.opengl.simplereference.sglrShaderProgram;
+ var deMath = framework.delibs.debase.deMath;
+ var deRandom = framework.delibs.debase.deRandom;
+ var rrFragmentOperations = framework.referencerenderer.rrFragmentOperations;
+ var rrGenericVector = framework.referencerenderer.rrGenericVector;
+ var rrShadingContext = framework.referencerenderer.rrShadingContext;
+ var rrVertexAttrib = framework.referencerenderer.rrVertexAttrib;
+ var rrVertexPacket = framework.referencerenderer.rrVertexPacket;
+
+ /** @const {number} */ glsDrawTests.MAX_RENDER_TARGET_SIZE = 512;
+
+ // Utils
+
+ /**
+ * @param {glsDrawTests.DrawTestSpec.Target} target
+ * @return {number}
+ */
+ glsDrawTests.targetToGL = function(target) {
+ assertMsgOptions(target != null, 'Target is null', false, true);
+
+ var targets = [
+ gl.ELEMENT_ARRAY_BUFFER, // TARGET_ELEMENT_ARRAY = 0,
+ gl.ARRAY_BUFFER // TARGET_ARRAY,
+ ];
+
+ return targets[target];
+ };
+
+ /**
+ * @param {?glsDrawTests.DrawTestSpec.Usage} usage
+ * @return {number}
+ */
+ glsDrawTests.usageToGL = function(usage) {
+ assertMsgOptions(usage != null, 'Usage is null', false, true);
+
+ var usages = [
+ gl.DYNAMIC_DRAW, // USAGE_DYNAMIC_DRAW = 0,
+ gl.STATIC_DRAW, // USAGE_STATIC_DRAW,
+ gl.STREAM_DRAW, // USAGE_STREAM_DRAW,
+
+ gl.STREAM_READ, // USAGE_STREAM_READ,
+ gl.STREAM_COPY, // USAGE_STREAM_COPY,
+
+ gl.STATIC_READ, // USAGE_STATIC_READ,
+ gl.STATIC_COPY, // USAGE_STATIC_COPY,
+
+ gl.DYNAMIC_READ, // USAGE_DYNAMIC_READ,
+ gl.DYNAMIC_COPY // USAGE_DYNAMIC_COPY,
+ ];
+ assertMsgOptions(usages.length == Object.keys(glsDrawTests.DrawTestSpec.Usage).length,
+ 'Amount of usage gl vlaues is different from amount of usages', false, true);
+
+ return usages[usage];
+ };
+
+ /**
+ * @param {?glsDrawTests.DrawTestSpec.InputType} type
+ * @return {number}
+ */
+ glsDrawTests.inputTypeToGL = function(type) {
+ assertMsgOptions(type != null, 'Input type is null', false, true);
+
+ var types = [
+ gl.FLOAT, // INPUTTYPE_FLOAT = 0,
+ gl.BYTE, // INPUTTYPE_BYTE,
+ gl.SHORT, // INPUTTYPE_SHORT,
+ gl.UNSIGNED_BYTE, // INPUTTYPE_UNSIGNED_BYTE,
+ gl.UNSIGNED_SHORT, // INPUTTYPE_UNSIGNED_SHORT,
+
+ gl.INT, // INPUTTYPE_INT,
+ gl.UNSIGNED_INT, // INPUTTYPE_UNSIGNED_INT,
+ gl.HALF_FLOAT, // INPUTTYPE_HALF,
+ gl.UNSIGNED_INT_2_10_10_10_REV, // INPUTTYPE_UNSIGNED_INT_2_10_10_10,
+ gl.INT_2_10_10_10_REV // INPUTTYPE_INT_2_10_10_10,
+ ];
+ assertMsgOptions(types.length == Object.keys(glsDrawTests.DrawTestSpec.InputType).length,
+ 'Amount of gl input types is different from amount of input types', false, true);
+
+ return types[type];
+ };
+
+ /**
+ * @param {?glsDrawTests.DrawTestSpec.OutputType} type
+ * @return {string}
+ */
+ glsDrawTests.outputTypeToGLType = function(type) {
+ assertMsgOptions(type != null, 'Output type is null', false, true);
+
+ var types = [
+ 'float', // OUTPUTTYPE_FLOAT = 0,
+ 'vec2', // OUTPUTTYPE_VEC2,
+ 'vec3', // OUTPUTTYPE_VEC3,
+ 'vec4', // OUTPUTTYPE_VEC4,
+
+ 'int', // OUTPUTTYPE_INT,
+ 'uint', // OUTPUTTYPE_UINT,
+
+ 'ivec2', // OUTPUTTYPE_IVEC2,
+ 'ivec3', // OUTPUTTYPE_IVEC3,
+ 'ivec4', // OUTPUTTYPE_IVEC4,
+
+ 'uvec2', // OUTPUTTYPE_UVEC2,
+ 'uvec3', // OUTPUTTYPE_UVEC3,
+ 'uvec4' // OUTPUTTYPE_UVEC4,
+ ];
+ assertMsgOptions(types.length == Object.keys(glsDrawTests.DrawTestSpec.OutputType).length,
+ 'Amount of output type names is different than amount of output types', false, true);
+
+ return types[type];
+ };
+
+ /**
+ * @param {?glsDrawTests.DrawTestSpec.Primitive} primitive
+ * @return {number}
+ */
+ glsDrawTests.primitiveToGL = function(primitive) {
+ var primitives = [
+ gl.POINTS, // PRIMITIVE_POINTS = 0,
+ gl.TRIANGLES, // PRIMITIVE_TRIANGLES,
+ gl.TRIANGLE_FAN, // PRIMITIVE_TRIANGLE_FAN,
+ gl.TRIANGLE_STRIP, // PRIMITIVE_TRIANGLE_STRIP,
+ gl.LINES, // PRIMITIVE_LINES
+ gl.LINE_STRIP, // PRIMITIVE_LINE_STRIP
+ gl.LINE_LOOP
+ ];
+ assertMsgOptions(primitives.length == Object.keys(glsDrawTests.DrawTestSpec.Primitive).length,
+ 'Amount of gl primitive values is different than amount of primitives', false, true);
+
+ return primitives[primitive];
+ };
+
+ /**
+ * @param {?glsDrawTests.DrawTestSpec.IndexType} indexType
+ * @return {number}
+ */
+ glsDrawTests.indexTypeToGL = function(indexType) {
+ var indexTypes = [
+ gl.UNSIGNED_BYTE, // INDEXTYPE_BYTE = 0,
+ gl.UNSIGNED_SHORT, // INDEXTYPE_SHORT,
+ gl.UNSIGNED_INT // INDEXTYPE_INT,
+ ];
+ assertMsgOptions(indexTypes.length == Object.keys(glsDrawTests.DrawTestSpec.IndexType).length,
+ 'Amount of gl index types is different than amount of index types', false, true);
+
+ return indexTypes[indexType];
+ };
+
+ /**
+ * @param {?glsDrawTests.DrawTestSpec.IndexType} indexType
+ * @return {?glsDrawTests.DrawTestSpec.InputType}
+ */
+ glsDrawTests.indexTypeToInputType = function(indexType) {
+ var inputTypes = [
+ glsDrawTests.DrawTestSpec.InputType.UNSIGNED_BYTE, // INDEXTYPE_BYTE = 0,
+ glsDrawTests.DrawTestSpec.InputType.UNSIGNED_SHORT, // INDEXTYPE_SHORT,
+ glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT // INDEXTYPE_INT,
+ ];
+ assertMsgOptions(inputTypes.length == Object.keys(glsDrawTests.DrawTestSpec.IndexType).length,
+ 'Amount of relevant input types is different than amount of index types', false, true);
+
+ return inputTypes[indexType];
+ };
+
+ /**
+ * @param {?glsDrawTests.DrawTestSpec.InputType} type
+ * @return {boolean}
+ */
+ glsDrawTests.inputTypeIsFloatType = function(type) {
+ if (type == glsDrawTests.DrawTestSpec.InputType.FLOAT)
+ return true;
+ if (type == glsDrawTests.DrawTestSpec.InputType.HALF)
+ return true;
+ return false;
+ };
+
+ /**
+ * @param {?glsDrawTests.DrawTestSpec.OutputType} type
+ * @return {boolean}
+ */
+ glsDrawTests.outputTypeIsFloatType = function(type) {
+ if (type == glsDrawTests.DrawTestSpec.OutputType.FLOAT ||
+ type == glsDrawTests.DrawTestSpec.OutputType.VEC2 ||
+ type == glsDrawTests.DrawTestSpec.OutputType.VEC3 ||
+ type == glsDrawTests.DrawTestSpec.OutputType.VEC4)
+ return true;
+
+ return false;
+ };
+
+ /**
+ * @param {?glsDrawTests.DrawTestSpec.OutputType} type
+ * @return {boolean}
+ */
+ glsDrawTests.outputTypeIsIntType = function(type) {
+ if (type == glsDrawTests.DrawTestSpec.OutputType.INT ||
+ type == glsDrawTests.DrawTestSpec.OutputType.IVEC2 ||
+ type == glsDrawTests.DrawTestSpec.OutputType.IVEC3 ||
+ type == glsDrawTests.DrawTestSpec.OutputType.IVEC4)
+ return true;
+
+ return false;
+ };
+
+ /**
+ * @param {?glsDrawTests.DrawTestSpec.OutputType} type
+ * @return {boolean}
+ */
+ glsDrawTests.outputTypeIsUintType = function(type) {
+ if (type == glsDrawTests.DrawTestSpec.OutputType.UINT ||
+ type == glsDrawTests.DrawTestSpec.OutputType.UVEC2 ||
+ type == glsDrawTests.DrawTestSpec.OutputType.UVEC3 ||
+ type == glsDrawTests.DrawTestSpec.OutputType.UVEC4)
+ return true;
+
+ return false;
+ };
+
+ /**
+ * @param {?glsDrawTests.DrawTestSpec.Primitive} primitive
+ * @param {number} primitiveCount
+ * @return {number}
+ */
+ glsDrawTests.getElementCount = function(primitive, primitiveCount) {
+ switch (primitive) {
+ case glsDrawTests.DrawTestSpec.Primitive.POINTS: return primitiveCount;
+ case glsDrawTests.DrawTestSpec.Primitive.TRIANGLES: return primitiveCount * 3;
+ case glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_FAN: return primitiveCount + 2;
+ case glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_STRIP: return primitiveCount + 2;
+ case glsDrawTests.DrawTestSpec.Primitive.LINES: return primitiveCount * 2;
+ case glsDrawTests.DrawTestSpec.Primitive.LINE_STRIP: return primitiveCount + 1;
+ case glsDrawTests.DrawTestSpec.Primitive.LINE_LOOP: return (primitiveCount == 1) ? (2) : (primitiveCount);
+ default:
+ throw new Error('Invalid primitive');
+ }
+ };
+
+ //MethodInfo
+
+ /**
+ * @typedef {{indexed: boolean, instanced: boolean, ranged: boolean, first: boolean}}
+ */
+ glsDrawTests.MethodInfo = {
+ /** @type {boolean} */ indexed: false,
+ /** @type {boolean} */ instanced: false,
+ /** @type {boolean} */ ranged: false,
+ /** @type {boolean} */ first: false
+ };
+
+ /**
+ * @param {?glsDrawTests.DrawTestSpec.DrawMethod} method
+ * @return {glsDrawTests.MethodInfo}
+ */
+ glsDrawTests.getMethodInfo = function(method) {
+ /** @type {Array<glsDrawTests.MethodInfo>} */ var infos = [{
+ indexed: false, instanced: false, ranged: false, first: true //!< DRAWMETHOD_DRAWARRAYS,
+ },{
+ indexed: false, instanced: true, ranged: false, first: true //!< DRAWMETHOD_DRAWARRAYS_INSTANCED,
+ },{
+ indexed: true, instanced: false, ranged: false, first: false //!< DRAWMETHOD_DRAWELEMENTS,
+ },{
+ indexed: true, instanced: false, ranged: true, first: false //!< DRAWMETHOD_DRAWELEMENTS_RANGED,
+ },{
+ indexed: true, instanced: true, ranged: false, first: false //!< DRAWMETHOD_DRAWELEMENTS_INSTANCED
+ }
+ ];
+
+ assertMsgOptions(infos.length == Object.keys(glsDrawTests.DrawTestSpec.DrawMethod).length,
+ 'Number of info names', false, true);
+ assertMsgOptions(method < infos.length, 'Invalid method', false, true);
+ return /** @type {glsDrawTests.MethodInfo} */ (infos[method]);
+ };
+
+ /**
+ * @param {glsDrawTests.DrawTestSpec} a
+ * @param {glsDrawTests.DrawTestSpec} b
+ * @return {boolean}
+ */
+ glsDrawTests.checkSpecsShaderCompatible = function(a, b) {
+ // Only the attributes matter
+ if (a.attribs.length != b.attribs.length)
+ return false;
+
+ for (var ndx = 0; ndx < a.attribs.length; ++ndx) {
+ // Only the output type (== shader input type) matters and the usage in the shader.
+
+ if (a.attribs[ndx].additionalPositionAttribute != b.attribs[ndx].additionalPositionAttribute)
+ return false;
+
+ // component counts need not to match
+ if (glsDrawTests.outputTypeIsFloatType(a.attribs[ndx].outputType) && glsDrawTests.outputTypeIsFloatType(b.attribs[ndx].outputType))
+ continue;
+ if (glsDrawTests.outputTypeIsIntType(a.attribs[ndx].outputType) && glsDrawTests.outputTypeIsIntType(b.attribs[ndx].outputType))
+ continue;
+ if (glsDrawTests.outputTypeIsUintType(a.attribs[ndx].outputType) && glsDrawTests.outputTypeIsUintType(b.attribs[ndx].outputType))
+ continue;
+
+ return false;
+ }
+
+ return true;
+ };
+
+ // generate random vectors in a way that does not depend on argument evaluation order
+
+ /**
+ * @param {deRandom.Random} random
+ * @return {Array<number>}
+ */
+ glsDrawTests.generateRandomVec4 = function(random) {
+ /** @type {Array<number>} */ var retVal = [];
+
+ for (var i = 0; i < 4; ++i)
+ retVal[i] = random.getFloat();
+
+ return retVal;
+ };
+
+ /**
+ * @param {deRandom.Random} random
+ * @return {Array<number>}
+ */
+ glsDrawTests.generateRandomIVec4 = function(random) {
+ /** @type {Array<number>} */ var retVal = [];
+
+ for (var i = 0; i < 4; ++i)
+ retVal[i] = random.getInt();
+
+ return retVal;
+ };
+
+ /**
+ * @param {deRandom.Random} random
+ * @return {Array<number>}
+ */
+ glsDrawTests.generateRandomUVec4 = function(random) {
+ /** @type {Array<number>} */ var retVal = [];
+
+ for (var i = 0; i < 4; ++i)
+ retVal[i] = Math.abs(random.getInt());
+
+ return retVal;
+ };
+
+ //GLValue
+
+ /**
+ * glsDrawTests.GLValue class
+ * @constructor
+ */
+ glsDrawTests.GLValue = function() {
+ /** @type {goog.NumberArray} */ this.m_value = [0];
+ /** @type {?glsDrawTests.DrawTestSpec.InputType} */ this.m_type;
+ };
+
+ /**
+ * @param {goog.TypedArray} dst
+ * @param {glsDrawTests.GLValue} val
+ */
+ glsDrawTests.copyGLValueToArray = function(dst, val) {
+ /** @type {Uint8Array} */ var dst8 = new Uint8Array(dst.buffer).subarray(dst.byteOffset, dst.byteOffset + dst.byteLength);
+ /** @type {Uint8Array} */ var val8 = new Uint8Array(val.m_value.buffer); // TODO: Fix encapsulation issue
+ dst8.set(val8);
+ };
+
+ /**
+ * @param {goog.TypedArray} dst
+ * @param {goog.TypedArray} src
+ */
+ glsDrawTests.copyArray = function(dst, src) {
+ /** @type {Uint8Array} */ var dst8 = new Uint8Array(dst.buffer).subarray(dst.byteOffset, dst.byteOffset + dst.byteLength);
+ /** @type {Uint8Array} */ var src8 = new Uint8Array(src.buffer).subarray(src.byteOffset, src.byteOffset + src.byteLength);
+ dst8.set(src8);
+ };
+
+ /**
+ * typeToTypedArray function. Determines which type of array will store the value, and stores it.
+ * @param {number} value
+ * @param {?glsDrawTests.DrawTestSpec.InputType} type
+ */
+ glsDrawTests.GLValue.typeToTypedArray = function(value, type) {
+ var array;
+
+ switch (type) {
+ case glsDrawTests.DrawTestSpec.InputType.FLOAT:
+ array = new Float32Array(1);
+ break;
+
+ case glsDrawTests.DrawTestSpec.InputType.BYTE:
+ array = new Int8Array(1);
+ break;
+ case glsDrawTests.DrawTestSpec.InputType.SHORT:
+ array = new Int16Array(1);
+ break;
+
+ case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_BYTE:
+ array = new Uint8Array(1);
+ break;
+ case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_SHORT:
+ array = new Uint16Array(1);
+ break;
+
+ case glsDrawTests.DrawTestSpec.InputType.INT:
+ array = new Int32Array(1);
+ break;
+ case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT:
+ array = new Uint32Array(1);
+ break;
+ case glsDrawTests.DrawTestSpec.InputType.HALF:
+ array = new Uint16Array(1);
+ value = glsDrawTests.GLValue.floatToHalf(value);
+ break;
+ case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT_2_10_10_10:
+ array = new Uint32Array(1);
+ break;
+ case glsDrawTests.DrawTestSpec.InputType.INT_2_10_10_10:
+ array = new Int32Array(1);
+ break;
+ default:
+ throw new Error('glsDrawTests.GLValue.typeToTypedArray - Invalid InputType');
+ }
+
+ array[0] = value;
+ return array;
+ };
+
+ /**
+ * glsDrawTests.GLValue.create
+ * @param {number} value
+ * @param {?glsDrawTests.DrawTestSpec.InputType} type
+ */
+ glsDrawTests.GLValue.create = function(value, type) {
+ var v = new glsDrawTests.GLValue();
+ v.m_value = glsDrawTests.GLValue.typeToTypedArray(value, type);
+ v.m_type = type;
+ return v;
+ };
+
+ /**
+ * glsDrawTests.GLValue.halfToFloat
+ * @param {number} value
+ * @return {number}
+ */
+ glsDrawTests.GLValue.halfToFloat = function(value) {
+ return tcuFloat.halfFloatToNumberNoDenorm(value);
+ };
+
+ /**
+ * @param {number} f
+ * @return {number}
+ */
+ glsDrawTests.GLValue.floatToHalf = function(f) {
+ // No denorm support.
+ return tcuFloat.numberToHalfFloatNoDenorm(f);
+ };
+
+ /**
+ * glsDrawTests.GLValue.getMaxValue
+ * @param {?glsDrawTests.DrawTestSpec.InputType} type
+ * @return {glsDrawTests.GLValue}
+ */
+ glsDrawTests.GLValue.getMaxValue = function(type) {
+ var value = 0;
+
+ assertMsgOptions(type >= 0 && type < Object.keys(glsDrawTests.DrawTestSpec.InputType).length,
+ 'Invalid type for GLValue', false, true);
+
+ switch (type) {
+ case glsDrawTests.DrawTestSpec.InputType.FLOAT:
+ value = 127;
+ break;
+ case glsDrawTests.DrawTestSpec.InputType.BYTE:
+ value = 127;
+ break;
+ case glsDrawTests.DrawTestSpec.InputType.SHORT:
+ value = 32760;
+ break;
+ case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_BYTE:
+ value = 255;
+ break;
+ case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_SHORT:
+ value = 65530;
+ break;
+ case glsDrawTests.DrawTestSpec.InputType.INT:
+ value = 2147483647;
+ break;
+ case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT:
+ value = 4294967295;
+ break;
+ case glsDrawTests.DrawTestSpec.InputType.HALF:
+ value = 256;
+ break;
+ default: //For any other valid type, return 0
+ value = 0;
+ }
+
+ return glsDrawTests.GLValue.create(value, type);
+ };
+
+ /**
+ * glsDrawTests.GLValue.getMinValue
+ * @param {?glsDrawTests.DrawTestSpec.InputType} type
+ * @return {glsDrawTests.GLValue}
+ */
+ glsDrawTests.GLValue.getMinValue = function(type) {
+ var value = 0;
+
+ assertMsgOptions(type >= 0 && type < Object.keys(glsDrawTests.DrawTestSpec.InputType).length,
+ 'Invalid type for GLValue', false, true);
+
+ switch (type) {
+ case glsDrawTests.DrawTestSpec.InputType.FLOAT:
+ value = -127;
+ break;
+ case glsDrawTests.DrawTestSpec.InputType.BYTE:
+ value = -127;
+ break;
+ case glsDrawTests.DrawTestSpec.InputType.SHORT:
+ value = -32760;
+ break;
+ case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_BYTE:
+ value = 0;
+ break;
+ case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_SHORT:
+ value = 0;
+ break;
+ case glsDrawTests.DrawTestSpec.InputType.INT:
+ value = -2147483647;
+ break;
+ case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT:
+ value = 0;
+ break;
+ case glsDrawTests.DrawTestSpec.InputType.HALF:
+ value = -256;
+ break;
+ default: //For any other valid type, return 0
+ value = 0;
+ }
+
+ return glsDrawTests.GLValue.create(value, type);
+ };
+
+ /**
+ * glsDrawTests.GLValue.getRandom
+ * @param {deRandom.Random} rnd
+ * @param {glsDrawTests.GLValue} min
+ * @param {glsDrawTests.GLValue} max
+ * @return {glsDrawTests.GLValue}
+ */
+ glsDrawTests.GLValue.getRandom = function(rnd, min, max) {
+ assertMsgOptions(min.getType() == max.getType(), 'Min and max types differ', false, true);
+
+ var minv = min.interpret();
+ var maxv = max.interpret();
+ var type = min.getType();
+ var value;
+
+ if (maxv < minv)
+ return min;
+
+ switch (type) {
+ case glsDrawTests.DrawTestSpec.InputType.FLOAT:
+ case glsDrawTests.DrawTestSpec.InputType.HALF: {
+ return glsDrawTests.GLValue.create(minv + rnd.getFloat() * (maxv - minv), type);
+ break;
+ }
+
+ case glsDrawTests.DrawTestSpec.InputType.SHORT:
+ case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_SHORT:
+ case glsDrawTests.DrawTestSpec.InputType.BYTE:
+ case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_BYTE:
+ case glsDrawTests.DrawTestSpec.InputType.INT:
+ case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT: {
+ return glsDrawTests.GLValue.create(minv + rnd.getInt() % (maxv - minv), type);
+ break;
+ }
+
+ default:
+ throw new Error('glsDrawTests.GLValue.getRandom - Invalid input type');
+ break;
+ }
+ };
+
+ // Minimum difference required between coordinates
+
+ /**
+ * @param {?glsDrawTests.DrawTestSpec.InputType} type
+ * @return {glsDrawTests.GLValue}
+ */
+ glsDrawTests.GLValue.minValue = function(type) {
+ switch (type) {
+ case glsDrawTests.DrawTestSpec.InputType.FLOAT:
+ case glsDrawTests.DrawTestSpec.InputType.BYTE:
+ case glsDrawTests.DrawTestSpec.InputType.HALF:
+ return glsDrawTests.GLValue.create(4, type);
+ case glsDrawTests.DrawTestSpec.InputType.SHORT:
+ case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_SHORT:
+ return glsDrawTests.GLValue.create(4 * 256, type);
+ case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_BYTE:
+ return glsDrawTests.GLValue.create(4 * 2, type);
+ case glsDrawTests.DrawTestSpec.InputType.INT:
+ case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT:
+ return glsDrawTests.GLValue.create(4 * 16777216, type);
+
+ default:
+ throw new Error('glsDrawTests.GLValue.minValue - Invalid input type');
+ }
+ };
+
+ /**
+ * @param {glsDrawTests.GLValue} val
+ * @return {glsDrawTests.GLValue}
+ */
+ glsDrawTests.GLValue.abs = function(val) {
+ var type = val.getType();
+ switch (type) {
+ case glsDrawTests.DrawTestSpec.InputType.SHORT:
+ return glsDrawTests.GLValue.create(0x7FFF & val.getValue(), type);
+ case glsDrawTests.DrawTestSpec.InputType.BYTE:
+ return glsDrawTests.GLValue.create(0x7F & val.getValue(), type);
+ case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_BYTE:
+ case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_SHORT:
+ case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT:
+ return val;
+ case glsDrawTests.DrawTestSpec.InputType.FLOAT:
+ case glsDrawTests.DrawTestSpec.InputType.HALF:
+ return glsDrawTests.GLValue.create(Math.abs(val.interpret()), type);
+ case glsDrawTests.DrawTestSpec.InputType.INT:
+ return glsDrawTests.GLValue.create(0x7FFFFFFF & val.getValue(), type);
+ default:
+ throw new Error('glsDrawTests.GLValue.abs - Invalid input type');
+ }
+ };
+
+ /**
+ * @return {?glsDrawTests.DrawTestSpec.InputType}
+ */
+ glsDrawTests.GLValue.prototype.getType = function() {
+ return this.m_type;
+ };
+
+ /**
+ * glsDrawTests.GLValue.toFloat
+ * @return {number}
+ */
+ glsDrawTests.GLValue.prototype.toFloat = function() {
+ return this.interpret();
+ };
+
+ /**
+ * glsDrawTests.GLValue.getValue
+ * @return {number}
+ */
+ glsDrawTests.GLValue.prototype.getValue = function() {
+ return this.m_value[0];
+ };
+
+ /**
+ * interpret function. Returns the m_value as a quantity so arithmetic operations can be performed on it
+ * Only some types require this.
+ * @return {number}
+ */
+ glsDrawTests.GLValue.prototype.interpret = function() {
+ if (this.m_type == glsDrawTests.DrawTestSpec.InputType.HALF)
+ return glsDrawTests.GLValue.halfToFloat(this.m_value[0]);
+
+ return this.m_value[0];
+ };
+
+ /**
+ * @param {glsDrawTests.GLValue} other
+ * @return {glsDrawTests.GLValue}
+ */
+ glsDrawTests.GLValue.prototype.add = function(other) {
+ return glsDrawTests.GLValue.create(this.interpret() + other.interpret(), this.m_type);
+ };
+
+ /**
+ * @param {glsDrawTests.GLValue} other
+ * @return {glsDrawTests.GLValue}
+ */
+ glsDrawTests.GLValue.prototype.mul = function(other) {
+ return glsDrawTests.GLValue.create(this.interpret() * other.interpret(), this.m_type);
+ };
+
+ /**
+ * @param {glsDrawTests.GLValue} other
+ * @return {glsDrawTests.GLValue}
+ */
+ glsDrawTests.GLValue.prototype.div = function(other) {
+ return glsDrawTests.GLValue.create(this.interpret() / other.interpret(), this.m_type);
+ };
+
+ /**
+ * @param {glsDrawTests.GLValue} other
+ * @return {glsDrawTests.GLValue}
+ */
+ glsDrawTests.GLValue.prototype.sub = function(other) {
+ return glsDrawTests.GLValue.create(this.interpret() - other.interpret(), this.m_type);
+ };
+
+ /**
+ * @param {glsDrawTests.GLValue} other
+ * @return {glsDrawTests.GLValue}
+ */
+ glsDrawTests.GLValue.prototype.addToSelf = function(other) {
+ this.m_value[0] = this.interpret() + other.interpret();
+ return this;
+ };
+
+ /**
+ * @param {glsDrawTests.GLValue} other
+ * @return {glsDrawTests.GLValue}
+ */
+ glsDrawTests.GLValue.prototype.subToSelf = function(other) {
+ this.m_value[0] = this.interpret() - other.interpret();
+ return this;
+ };
+
+ /**
+ * @param {glsDrawTests.GLValue} other
+ * @return {glsDrawTests.GLValue}
+ */
+ glsDrawTests.GLValue.prototype.mulToSelf = function(other) {
+ this.m_value[0] = this.interpret() * other.interpret();
+ return this;
+ };
+
+ /**
+ * @param {glsDrawTests.GLValue} other
+ * @return {glsDrawTests.GLValue}
+ */
+ glsDrawTests.GLValue.prototype.divToSelf = function(other) {
+ this.m_value[0] = this.interpret() / other.interpret();
+ return this;
+ };
+
+ /**
+ * @param {glsDrawTests.GLValue} other
+ * @return {boolean}
+ */
+ glsDrawTests.GLValue.prototype.equals = function(other) {
+ return this.m_value[0] == other.getValue();
+ };
+
+ /**
+ * @param {glsDrawTests.GLValue} other
+ * @return {boolean}
+ */
+ glsDrawTests.GLValue.prototype.lessThan = function(other) {
+ return this.interpret() < other.interpret();
+ };
+
+ /**
+ * @param {glsDrawTests.GLValue} other
+ * @return {boolean}
+ */
+ glsDrawTests.GLValue.prototype.greaterThan = function(other) {
+ return this.interpret() > other.interpret();
+ };
+
+ /**
+ * @param {glsDrawTests.GLValue} other
+ * @return {boolean}
+ */
+ glsDrawTests.GLValue.prototype.lessOrEqualThan = function(other) {
+ return this.interpret() <= other.interpret();
+ };
+
+ /**
+ * @param {glsDrawTests.GLValue} other
+ * @return {boolean}
+ */
+ glsDrawTests.GLValue.prototype.greaterOrEqualThan = function(other) {
+ return this.interpret() >= other.interpret();
+ };
+
+ // AttriuteArray
+
+ /**
+ * AttributeArray
+ * @constructor
+ * @param {?glsDrawTests.DrawTestSpec.Storage} storage
+ * @param {sglrGLContext.GLContext | sglrReferenceContext.ReferenceContext} context
+ */
+ glsDrawTests.AttributeArray = function(storage, context) {
+ /** @type {?glsDrawTests.DrawTestSpec.Storage} */ this.m_storage = storage;
+ /** @type {sglrGLContext.GLContext | sglrReferenceContext.ReferenceContext} */ this.m_ctx = context;
+ /** @type {WebGLBuffer|sglrReferenceContext.DataBuffer|null} */ this.m_glBuffer;
+
+ /** @type {number} */ this.m_size = 0;
+ /** @type {Uint8Array} */ this.m_data; //NOTE: Used in unsupported user storage
+ /** @type {number} */ this.m_componentCount;
+ /** @type {boolean} */ this.m_bound = false;
+ /** @type {glsDrawTests.DrawTestSpec.Target} */ this.m_target = glsDrawTests.DrawTestSpec.Target.ARRAY;
+ /** @type {?glsDrawTests.DrawTestSpec.InputType} */ this.m_inputType = glsDrawTests.DrawTestSpec.InputType.FLOAT;
+ /** @type {?glsDrawTests.DrawTestSpec.OutputType} */ this.m_outputType = glsDrawTests.DrawTestSpec.OutputType.VEC4;
+ /** @type {boolean} */ this.m_normalize = false;
+ /** @type {number} */ this.m_stride = 0;
+ /** @type {number} */ this.m_offset = 0;
+ /** @type {Array<number>} */ this.m_defaultAttrib;
+ /** @type {number} */ this.m_instanceDivisor = 0;
+ /** @type {boolean} */ this.m_isPositionAttr = false;
+
+ if (this.m_storage == glsDrawTests.DrawTestSpec.Storage.BUFFER) {
+ this.m_glBuffer = this.m_ctx.createBuffer();
+ }
+ };
+
+ /** @return {number} */ glsDrawTests.AttributeArray.prototype.getComponentCount = function() {return this.m_componentCount;};
+
+ /** @return {?glsDrawTests.DrawTestSpec.Target} */ glsDrawTests.AttributeArray.prototype.getTarget = function() {return this.m_target;};
+
+ /** @return {?glsDrawTests.DrawTestSpec.InputType} */ glsDrawTests.AttributeArray.prototype.getInputType = function() {return this.m_inputType;};
+
+ /** @return {?glsDrawTests.DrawTestSpec.OutputType} */ glsDrawTests.AttributeArray.prototype.getOutputType = function() {return this.m_outputType;};
+
+ /** @return {?glsDrawTests.DrawTestSpec.Storage} */ glsDrawTests.AttributeArray.prototype.getStorageType = function() {return this.m_storage;};
+
+ /** @return {boolean} */ glsDrawTests.AttributeArray.prototype.getNormalized = function() {return this.m_normalize;};
+
+ /** @return {number} */ glsDrawTests.AttributeArray.prototype.getStride = function() {return this.m_stride;};
+
+ /** @return {boolean} */ glsDrawTests.AttributeArray.prototype.isBound = function() {return this.m_bound;};
+
+ /** @return {boolean} */ glsDrawTests.AttributeArray.prototype.isPositionAttribute = function() {return this.m_isPositionAttr;};
+
+ /**
+ * @param {glsDrawTests.DrawTestSpec.Target} target
+ * @param {number} size
+ * @param {goog.TypedArray} ptr
+ * @param {?glsDrawTests.DrawTestSpec.Usage} usage
+ */
+ glsDrawTests.AttributeArray.prototype.data = function(target, size, ptr, usage) {
+ this.m_size = size;
+ this.m_target = target;
+
+ if (this.m_storage == glsDrawTests.DrawTestSpec.Storage.BUFFER) {
+ this.m_ctx.bindBuffer(glsDrawTests.targetToGL(target), this.m_glBuffer);
+ this.m_ctx.bufferData(glsDrawTests.targetToGL(target), ptr, glsDrawTests.usageToGL(usage));
+ } else
+ throw new Error('Wrong storage type');
+ };
+
+ /**
+ * @param {glsDrawTests.DrawTestSpec.Target} target
+ * @param {number} offset
+ * @param {number} size
+ * @param {goog.TypedArray} ptr
+ */
+ glsDrawTests.AttributeArray.prototype.subdata = function(target, offset, size, ptr) {
+ this.m_target = target;
+
+ if (this.m_storage == glsDrawTests.DrawTestSpec.Storage.BUFFER) {
+ this.m_ctx.bindBuffer(glsDrawTests.targetToGL(target), this.m_glBuffer);
+
+ this.m_ctx.bufferSubData(glsDrawTests.targetToGL(target), offset, size, ptr);
+ } else
+ throw new Error('Wrong storage type');
+ };
+
+ /**
+ * @param {boolean} bound
+ * @param {number} offset
+ * @param {number} size
+ * @param {?glsDrawTests.DrawTestSpec.InputType} inputType
+ * @param {?glsDrawTests.DrawTestSpec.OutputType} outType
+ * @param {boolean} normalized
+ * @param {number} stride
+ * @param {number} instanceDivisor
+ * @param {Array<number>} defaultAttrib
+ * @param {boolean} isPositionAttr
+ */
+ glsDrawTests.AttributeArray.prototype.setupArray = function(bound, offset, size, inputType, outType,
+ normalized, stride, instanceDivisor, defaultAttrib, isPositionAttr) {
+ this.m_componentCount = size;
+ this.m_bound = bound;
+ this.m_inputType = inputType;
+ this.m_outputType = outType;
+ this.m_normalize = normalized;
+ this.m_stride = stride;
+ this.m_offset = offset;
+ this.m_defaultAttrib = defaultAttrib;
+ this.m_instanceDivisor = instanceDivisor;
+ this.m_isPositionAttr = isPositionAttr;
+ };
+
+ /**
+ * @param {number} loc (32-bit)
+ */
+ glsDrawTests.AttributeArray.prototype.bindAttribute = function(loc) {
+ if (!this.isBound()) {
+ /** @type {Array<number>} */ var attr = this.m_defaultAttrib;
+ switch (this.m_inputType) {
+ case glsDrawTests.DrawTestSpec.InputType.FLOAT: {
+ switch (this.m_componentCount) {
+ case 1: this.m_ctx.vertexAttrib1f(loc, attr[0]); break;
+ case 2: this.m_ctx.vertexAttrib2f(loc, attr[0], attr[1]); break;
+ case 3: this.m_ctx.vertexAttrib3f(loc, attr[0], attr[1], attr[2]); break;
+ case 4: this.m_ctx.vertexAttrib4f(loc, attr[0], attr[1], attr[2], attr[3]); break;
+ default: throw new Error('Invalid component count'); break;
+ }
+ break;
+ }
+ case glsDrawTests.DrawTestSpec.InputType.INT: {
+ this.m_ctx.vertexAttribI4i(loc, attr[0], attr[1], attr[2], attr[3]);
+ break;
+ }
+ case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT: {
+ this.m_ctx.vertexAttribI4ui(loc, attr[0], attr[1], attr[2], attr[3]);
+ break;
+ }
+ default:
+ throw new Error('Invalid input type');
+ break;
+ }
+ } else {
+ /** @type {Uint8Array} */ var basePtr = null;
+
+ if (this.m_storage == glsDrawTests.DrawTestSpec.Storage.BUFFER) {
+ this.m_ctx.bindBuffer(glsDrawTests.targetToGL(this.m_target), this.m_glBuffer);
+
+ basePtr = null;
+ } else
+ throw new Error('Invalid storage type');
+
+ if (!glsDrawTests.inputTypeIsFloatType(this.m_inputType)) {
+ // Input is not float type
+
+ if (glsDrawTests.outputTypeIsFloatType(this.m_outputType)) {
+ var size = this.m_componentCount;
+
+ // Output type is float type
+ this.m_ctx.vertexAttribPointer(loc, size, glsDrawTests.inputTypeToGL(this.m_inputType), this.m_normalize, this.m_stride, this.m_offset);
+ } else {
+ // Output type is int type
+ this.m_ctx.vertexAttribIPointer(loc, this.m_componentCount, glsDrawTests.inputTypeToGL(this.m_inputType), this.m_stride, this.m_offset);
+ }
+ } else {
+ // Input type is float type
+
+ // Output type must be float type
+ assertMsgOptions(glsDrawTests.outputTypeIsFloatType(this.m_outputType), 'Output type is not float', false, true);
+
+ this.m_ctx.vertexAttribPointer(loc, this.m_componentCount, glsDrawTests.inputTypeToGL(this.m_inputType), this.m_normalize,
+ this.m_stride, this.m_offset);
+ }
+
+ if (this.m_instanceDivisor)
+ this.m_ctx.vertexAttribDivisor(loc, this.m_instanceDivisor);
+ }
+ };
+
+ /**
+ * @param {glsDrawTests.DrawTestSpec.Target} target
+ */
+ glsDrawTests.AttributeArray.prototype.bindIndexArray = function(target) {
+ if (this.m_storage == glsDrawTests.DrawTestSpec.Storage.BUFFER) {
+ this.m_ctx.bindBuffer(glsDrawTests.targetToGL(target), this.m_glBuffer);
+ }
+ };
+
+ // DrawTestShaderProgram
+
+ /**
+ * @constructor
+ * @extends {sglrShaderProgram.ShaderProgram}
+ * @param {Array<glsDrawTests.AttributeArray>} arrays
+ */
+ glsDrawTests.DrawTestShaderProgram = function(arrays) {
+ sglrShaderProgram.ShaderProgram.call(this, this.createProgramDeclaration(arrays));
+
+ this.m_componentCount = [];
+ this.m_isCoord = [];
+ this.m_attrType = [];
+
+ for (var arrayNdx = 0; arrayNdx < arrays.length; arrayNdx++) {
+ this.m_componentCount[arrayNdx] = this.getComponentCount(arrays[arrayNdx].getOutputType());
+ this.m_isCoord[arrayNdx] = arrays[arrayNdx].isPositionAttribute();
+ this.m_attrType[arrayNdx] = this.mapOutputType(arrays[arrayNdx].getOutputType());
+ }
+ };
+
+ glsDrawTests.DrawTestShaderProgram.prototype = Object.create(sglrShaderProgram.ShaderProgram.prototype);
+ glsDrawTests.DrawTestShaderProgram.prototype.constructor = glsDrawTests.DrawTestShaderProgram;
+
+ /**
+ * @param {Array<number>} color
+ * @param {goog.NumberArray} attribValue
+ * @param {number} numComponents
+ * @return {Array<number>}
+ */
+ glsDrawTests.calcShaderColor = function(color, attribValue, numComponents) {
+ switch (numComponents) {
+ case 1:
+ color[0] = deMath.scale(color, attribValue[0])[0];
+ break;
+
+ case 2:
+ color[0] = color[0] * attribValue[0];
+ color[1] = color[1] * attribValue[1];
+ break;
+
+ case 3:
+ color[0] = color[0] * attribValue[0];
+ color[1] = color[1] * attribValue[1];
+ color[2] = color[2] * attribValue[2];
+ break;
+
+ case 4:
+ color[0] = color[0] * attribValue[0] * attribValue[3];
+ color[1] = color[1] * attribValue[1] * attribValue[3];
+ color[2] = color[2] * attribValue[2] * attribValue[3];
+ break;
+
+ default:
+ throw new Error('Invalid component count');
+ }
+
+ return color;
+ };
+
+ /**
+ * @param {Array<number>} coord
+ * @param {goog.NumberArray} attribValue
+ * @param {number} numComponents
+ * @return {Array<number>}
+ */
+ glsDrawTests.calcShaderCoord = function(coord, attribValue, numComponents) {
+ switch (numComponents) {
+ case 1:
+
+ coord = deMath.add(coord, [attribValue[0], attribValue[0]]);
+ coord[0] = coord[0];
+ coord[1] = coord[1];
+ break;
+ case 2:
+ coord = deMath.add(coord, [attribValue[0], attribValue[1]]);
+ coord[0] = coord[0];
+ coord[1] = coord[1];
+ break;
+ case 3:
+ coord = deMath.add(coord, [attribValue[0] + attribValue[2], attribValue[1]]);
+ coord[0] = coord[0];
+ coord[1] = coord[1];
+ coord[2] = coord[2];
+ break;
+ case 4:
+ coord = deMath.add(coord, [attribValue[0] + attribValue[2], attribValue[1] + attribValue[3]]);
+ coord[0] = coord[0];
+ coord[1] = coord[1];
+ coord[2] = coord[2];
+ coord[3] = coord[3];
+ break;
+
+ default:
+ throw new Error('Invalid component count');
+ }
+
+ return coord;
+ };
+
+ /**
+ * @param {Array<rrVertexAttrib.VertexAttrib>} inputs
+ * @param {Array<rrVertexPacket.VertexPacket>} packets
+ * @param {number} numPackets
+ */
+ glsDrawTests.DrawTestShaderProgram.prototype.shadeVertices = function(inputs, packets, numPackets) {
+ var u_coordScale = this.getUniformByName('u_coordScale').value;
+ var u_colorScale = this.getUniformByName('u_colorScale').value;
+
+ for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) {
+ var varyingLocColor = 0;
+
+ /** @type {rrVertexPacket.VertexPacket} */ var packet = packets[packetNdx];
+
+ // Calc output color
+ /** @type {Array<number>} */ var coord = [0.0, 0.0];
+ /** @type {Array<number>} */ var color = [1.0, 1.0, 1.0];
+
+ for (var attribNdx = 0; attribNdx < this.m_attrType.length; attribNdx++) {
+ var numComponents = this.m_componentCount[attribNdx];
+ /** @type {boolean} */ var isCoord = this.m_isCoord[attribNdx];
+
+ var attrib = rrVertexAttrib.readVertexAttrib(inputs[attribNdx], packet.instanceNdx, packet.vertexNdx, this.m_attrType[attribNdx]);
+
+ if (isCoord) {
+ coord = glsDrawTests.calcShaderCoord(
+ coord,
+ attrib,
+ numComponents
+ );
+ } else {
+ color = glsDrawTests.calcShaderColor(
+ color,
+ attrib,
+ numComponents
+ );
+ }
+ }
+
+ // Transform position
+ packet.position = [u_coordScale * coord[0], u_coordScale * coord[1], 1.0, 1.0];
+ packet.pointSize = 1.0;
+
+ // Pass color to FS
+ packet.outputs[varyingLocColor] = deMath.add(deMath.scale([u_colorScale * color[0], u_colorScale * color[1], u_colorScale * color[2], 1.0], 0.5), [0.5, 0.5, 0.5, 0.5]);
+ }
+ };
+
+ /**
+ * @param {Array<rrFragmentOperations.Fragment>} packets
+ * @param {rrShadingContext.FragmentShadingContext} context
+ */
+ glsDrawTests.DrawTestShaderProgram.prototype.shadeFragments = function(packets, context) {
+ var varyingLocColor = 0;
+
+ for (var packetNdx = 0; packetNdx < packets.length; ++packetNdx) {
+ /** @type {rrFragmentOperations.Fragment} */ var packet = packets[packetNdx];
+ packet.value = rrShadingContext.readVarying(packet, context, varyingLocColor);
+ }
+ };
+
+ /**
+ * @param {Array<glsDrawTests.AttributeArray>} arrays
+ * @return {string}
+ */
+ glsDrawTests.DrawTestShaderProgram.prototype.genVertexSource = function(arrays) {
+ /** @type {Array<string>}*/ var params;
+ var vertexShaderTmpl = '';
+
+ params = this.generateShaderParams();
+
+ vertexShaderTmpl += params['VTX_HDR'];
+
+ for (var arrayNdx = 0; arrayNdx < arrays.length; arrayNdx++) {
+ vertexShaderTmpl += params['VTX_IN'] + ' highp ' + glsDrawTests.outputTypeToGLType(arrays[arrayNdx].getOutputType()) + ' a_' + arrayNdx + ';\n';
+ }
+
+ vertexShaderTmpl +=
+ 'uniform highp float u_coordScale;\n' +
+ 'uniform highp float u_colorScale;\n' +
+ params['VTX_OUT'] + ' ' + params['COL_PRECISION'] + ' vec4 v_color;\n' +
+ 'void main(void)\n' +
+ '{\n' +
+ '\tgl_PointSize = 1.0;\n' +
+ '\thighp vec2 coord = vec2(0.0, 0.0);\n' +
+ '\thighp vec3 color = vec3(1.0, 1.0, 1.0);\n';
+
+ for (var arrayNdx = 0; arrayNdx < arrays.length; arrayNdx++) {
+ var isPositionAttr = arrays[arrayNdx].isPositionAttribute();
+
+ if (isPositionAttr) {
+ switch (arrays[arrayNdx].getOutputType()) {
+ case glsDrawTests.DrawTestSpec.OutputType.FLOAT:
+ case glsDrawTests.DrawTestSpec.OutputType.INT:
+ case glsDrawTests.DrawTestSpec.OutputType.UINT:
+ vertexShaderTmpl +=
+ '\tcoord += vec2(float(a_' + arrayNdx + '), float(a_' + arrayNdx + '));\n';
+ break;
+
+ case glsDrawTests.DrawTestSpec.OutputType.VEC2:
+ case glsDrawTests.DrawTestSpec.OutputType.IVEC2:
+ case glsDrawTests.DrawTestSpec.OutputType.UVEC2:
+ vertexShaderTmpl +=
+ '\tcoord += vec2(a_' + arrayNdx + '.xy);\n';
+ break;
+
+ case glsDrawTests.DrawTestSpec.OutputType.VEC3:
+ case glsDrawTests.DrawTestSpec.OutputType.IVEC3:
+ case glsDrawTests.DrawTestSpec.OutputType.UVEC3:
+ vertexShaderTmpl +=
+ '\tcoord += vec2(a_' + arrayNdx + '.xy);\n' +
+ '\tcoord.x += float(a_' + arrayNdx + '.z);\n';
+ break;
+
+ case glsDrawTests.DrawTestSpec.OutputType.VEC4:
+ case glsDrawTests.DrawTestSpec.OutputType.IVEC4:
+ case glsDrawTests.DrawTestSpec.OutputType.UVEC4:
+ vertexShaderTmpl +=
+ '\tcoord += vec2(a_' + arrayNdx + '.xy);\n' +
+ '\tcoord += vec2(a_' + arrayNdx + '.zw);\n';
+ break;
+
+ default:
+ throw new Error('Invalid output type');
+ break;
+ }
+ } else {
+ switch (arrays[arrayNdx].getOutputType()) {
+ case glsDrawTests.DrawTestSpec.OutputType.FLOAT:
+ case glsDrawTests.DrawTestSpec.OutputType.INT:
+ case glsDrawTests.DrawTestSpec.OutputType.UINT:
+ vertexShaderTmpl +=
+ '\tcolor = color * float(a_' + arrayNdx + ');\n';
+ break;
+
+ case glsDrawTests.DrawTestSpec.OutputType.VEC2:
+ case glsDrawTests.DrawTestSpec.OutputType.IVEC2:
+ case glsDrawTests.DrawTestSpec.OutputType.UVEC2:
+ vertexShaderTmpl +=
+ '\tcolor.rg = color.rg * vec2(a_' + arrayNdx + '.xy);\n';
+ break;
+
+ case glsDrawTests.DrawTestSpec.OutputType.VEC3:
+ case glsDrawTests.DrawTestSpec.OutputType.IVEC3:
+ case glsDrawTests.DrawTestSpec.OutputType.UVEC3:
+ vertexShaderTmpl +=
+ '\tcolor = color.rgb * vec3(a_' + arrayNdx + '.xyz);\n';
+ break;
+
+ case glsDrawTests.DrawTestSpec.OutputType.VEC4:
+ case glsDrawTests.DrawTestSpec.OutputType.IVEC4:
+ case glsDrawTests.DrawTestSpec.OutputType.UVEC4:
+ vertexShaderTmpl +=
+ '\tcolor = color.rgb * vec3(a_' + arrayNdx + '.xyz) * float(a_' + arrayNdx + '.w);\n';
+ break;
+
+ default:
+ throw new Error('Invalid output type');
+ break;
+ }
+ }
+ }
+
+ vertexShaderTmpl +=
+ '\tv_color = vec4(u_colorScale * color, 1.0) * 0.5 + vec4(0.5, 0.5, 0.5, 0.5);\n' +
+ '\tgl_Position = vec4(u_coordScale * coord, 1.0, 1.0);\n' +
+ '}\n';
+
+ return vertexShaderTmpl;
+ };
+
+ /**
+ * @return {string}
+ */
+ glsDrawTests.DrawTestShaderProgram.prototype.genFragmentSource = function() {
+ /** @type {Array<string>} */ var params;
+
+ params = this.generateShaderParams();
+
+ var fragmentShaderTmpl = params['FRAG_HDR'] +
+ params['FRAG_IN'] + ' ' + params['COL_PRECISION'] + ' vec4 v_color;\n' +
+ 'void main(void)\n' +
+ '{\n' +
+ '\t' + params['FRAG_COLOR'] + '= v_color;\n' +
+ '}\n';
+
+ return fragmentShaderTmpl;
+ };
+
+ /**
+ * @return {Array<string>}
+ */
+ glsDrawTests.DrawTestShaderProgram.prototype.generateShaderParams = function() {
+ /** @type {Array<string>} */ var params = [];
+ if (gluShaderUtil.isGLSLVersionSupported(gl, gluShaderUtil.GLSLVersion.V300_ES)) {
+ params['VTX_IN'] = 'in';
+ params['VTX_OUT'] = 'out';
+ params['FRAG_IN'] = 'in';
+ params['FRAG_COLOR'] = 'dEQP_FragColor';
+ params['VTX_HDR'] = '#version 300 es\n';
+ params['FRAG_HDR'] = '#version 300 es\nlayout(location = 0) out mediump vec4 dEQP_FragColor;\n';
+ params['COL_PRECISION'] = 'mediump';
+ } else if (gluShaderUtil.isGLSLVersionSupported(gl, gluShaderUtil.GLSLVersion.V100_ES)) {
+ params['VTX_IN'] = 'attribute';
+ params['VTX_OUT'] = 'varying';
+ params['FRAG_IN'] = 'varying';
+ params['FRAG_COLOR'] = 'gl_FragColor';
+ params['VTX_HDR'] = '';
+ params['FRAG_HDR'] = '';
+ params['COL_PRECISION'] = 'mediump';
+ } else
+ throw new Error('Invalid GL version');
+
+ return params;
+ };
+
+ /**
+ * @param {?glsDrawTests.DrawTestSpec.OutputType} type
+ * @return {rrGenericVector.GenericVecType}
+ */
+ glsDrawTests.DrawTestShaderProgram.prototype.mapOutputType = function(type) {
+ switch (type) {
+ case glsDrawTests.DrawTestSpec.OutputType.FLOAT:
+ case glsDrawTests.DrawTestSpec.OutputType.VEC2:
+ case glsDrawTests.DrawTestSpec.OutputType.VEC3:
+ case glsDrawTests.DrawTestSpec.OutputType.VEC4:
+ return rrGenericVector.GenericVecType.FLOAT;
+
+ case glsDrawTests.DrawTestSpec.OutputType.INT:
+ case glsDrawTests.DrawTestSpec.OutputType.IVEC2:
+ case glsDrawTests.DrawTestSpec.OutputType.IVEC3:
+ case glsDrawTests.DrawTestSpec.OutputType.IVEC4:
+ return rrGenericVector.GenericVecType.INT32;
+
+ case glsDrawTests.DrawTestSpec.OutputType.UINT:
+ case glsDrawTests.DrawTestSpec.OutputType.UVEC2:
+ case glsDrawTests.DrawTestSpec.OutputType.UVEC3:
+ case glsDrawTests.DrawTestSpec.OutputType.UVEC4:
+ return rrGenericVector.GenericVecType.UINT32;
+
+ default:
+ throw new Error('Invalid output type');
+ }
+ };
+
+ /**
+ * @param {?glsDrawTests.DrawTestSpec.OutputType} type
+ * @return {number}
+ */
+ glsDrawTests.DrawTestShaderProgram.prototype.getComponentCount = function(type) {
+ switch (type) {
+ case glsDrawTests.DrawTestSpec.OutputType.FLOAT:
+ case glsDrawTests.DrawTestSpec.OutputType.INT:
+ case glsDrawTests.DrawTestSpec.OutputType.UINT:
+ return 1;
+
+ case glsDrawTests.DrawTestSpec.OutputType.VEC2:
+ case glsDrawTests.DrawTestSpec.OutputType.IVEC2:
+ case glsDrawTests.DrawTestSpec.OutputType.UVEC2:
+ return 2;
+
+ case glsDrawTests.DrawTestSpec.OutputType.VEC3:
+ case glsDrawTests.DrawTestSpec.OutputType.IVEC3:
+ case glsDrawTests.DrawTestSpec.OutputType.UVEC3:
+ return 3;
+
+ case glsDrawTests.DrawTestSpec.OutputType.VEC4:
+ case glsDrawTests.DrawTestSpec.OutputType.IVEC4:
+ case glsDrawTests.DrawTestSpec.OutputType.UVEC4:
+ return 4;
+
+ default:
+ throw new Error('Invalid output type');
+ }
+ };
+
+ /**
+ * @param {Array<glsDrawTests.AttributeArray>} arrays
+ * @return {sglrShaderProgram.ShaderProgramDeclaration}
+ */
+ glsDrawTests.DrawTestShaderProgram.prototype.createProgramDeclaration = function(arrays) {
+ /** @type {sglrShaderProgram.ShaderProgramDeclaration} */ var decl = new sglrShaderProgram.ShaderProgramDeclaration();
+
+ for (var arrayNdx = 0; arrayNdx < arrays.length; arrayNdx++)
+ decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_' + arrayNdx, this.mapOutputType(arrays[arrayNdx].getOutputType())));
+
+ decl.pushVertexToFragmentVarying(new sglrShaderProgram.VertexToFragmentVarying(rrGenericVector.GenericVecType.FLOAT));
+ decl.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(rrGenericVector.GenericVecType.FLOAT));
+
+ decl.pushVertexSource(new sglrShaderProgram.VertexSource(this.genVertexSource(arrays)));
+ decl.pushFragmentSource(new sglrShaderProgram.FragmentSource(this.genFragmentSource()));
+
+ decl.pushUniform(new sglrShaderProgram.Uniform('u_coordScale', gluShaderUtil.DataType.FLOAT));
+ decl.pushUniform(new sglrShaderProgram.Uniform('u_colorScale', gluShaderUtil.DataType.FLOAT));
+
+ return decl;
+ };
+
+ /**
+ * @typedef {glsDrawTests.RandomArrayGenerator}
+ */
+ glsDrawTests.RandomArrayGenerator = {};
+
+ /**
+ * @param {goog.TypedArray} data
+ * @param {?glsDrawTests.DrawTestSpec.InputType} type
+ * @param {deRandom.Random} rnd
+ * @param {glsDrawTests.GLValue} min
+ * @param {glsDrawTests.GLValue} max
+ */
+ glsDrawTests.RandomArrayGenerator.setData = function(data, type, rnd, min, max) {
+ switch (type) {
+ case glsDrawTests.DrawTestSpec.InputType.FLOAT:
+ case glsDrawTests.DrawTestSpec.InputType.SHORT:
+ case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_SHORT:
+ case glsDrawTests.DrawTestSpec.InputType.BYTE:
+ case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_BYTE:
+ case glsDrawTests.DrawTestSpec.InputType.INT:
+ case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT:
+ case glsDrawTests.DrawTestSpec.InputType.HALF:
+ glsDrawTests.copyGLValueToArray(data, glsDrawTests.GLValue.getRandom(rnd, min, max));
+ break;
+ default:
+ throw new Error('Invalid input type');
+ }
+ };
+
+ /**
+ * createBasicArray
+ * @param {number} seed
+ * @param {number} elementCount
+ * @param {number} componentCount
+ * @param {number} offset
+ * @param {number} stride
+ * @param {?glsDrawTests.DrawTestSpec.InputType} type
+ * @param {number} first
+ * @param {?glsDrawTests.DrawTestSpec.Primitive} primitive
+ * @param {?goog.TypedArray} indices
+ * @param {number} indexSize
+ * @return {goog.TypedArray}
+ */
+ glsDrawTests.RandomArrayGenerator.createArray = function(seed, elementCount, componentCount, offset, stride, type, first, primitive, indices, indexSize) {
+ assertMsgOptions(componentCount >= 1 && componentCount <= 4, 'Unacceptable number of components', false, true);
+
+ /** @type {glsDrawTests.GLValue} */ var min = glsDrawTests.GLValue.getMinValue(type);
+ /** @type {glsDrawTests.GLValue} */ var max = glsDrawTests.GLValue.getMaxValue(type);
+
+ var packed = type == glsDrawTests.DrawTestSpec.InputType.INT_2_10_10_10 ||
+ type == glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT_2_10_10_10;
+ /** @type {number} */ var limit10 = (1 << 10);
+ /** @type {number} */ var limit2 = (1 << 2);
+
+
+ /** @type {number} */ var componentSize = glsDrawTests.DrawTestSpec.inputTypeSize(type);
+ /** @type {number} */ var elementSize = componentSize * componentCount;
+ /** @type {number} */ var bufferSize = offset + Math.max(elementCount * stride, elementCount * elementSize);
+
+ var data = new ArrayBuffer(bufferSize);
+ var writePtr = new Uint8Array(data, offset);
+
+ var previousComponentsFloat = [0, 0, 0, 0];
+ var rnd = new deRandom.Random(seed);
+
+ for (var vertexNdx = 0; vertexNdx < elementCount; vertexNdx++) {
+ var components = [];
+
+ for (var componentNdx = 0; componentNdx < componentCount; componentNdx++) {
+ var getRandomComponent = function() {
+ // For packed formats we can't use GLValue
+ if (packed) {
+ if (componentNdx == 3) {
+ return rnd.getInt() % limit2;
+ } else {
+ return rnd.getInt() % limit10;
+ }
+ } else {
+ return glsDrawTests.GLValue.getRandom(rnd, min, max);
+ }
+ };
+
+ var component = getRandomComponent();
+ var componentFloat = (component instanceof glsDrawTests.GLValue) ? component.toFloat() : component;
+
+ // Try to not create vertex near previous
+ if (vertexNdx != 0 && Math.abs(componentFloat - previousComponentsFloat[componentNdx]) < min.toFloat()) {
+ // Too close, try again (but only once)
+ component = getRandomComponent();
+ componentFloat = (component instanceof glsDrawTests.GLValue) ? component.toFloat() : component;
+ }
+
+ components.push(component);
+ previousComponentsFloat[componentNdx] = componentFloat;
+ }
+
+ if (packed) {
+ var packedValue = deMath.binaryOp(
+ deMath.shiftLeft(/** @type {Array<number>} */ (components)[3], 30), deMath.binaryOp(
+ deMath.shiftLeft(/** @type {Array<number>} */ (components)[2], 20), deMath.binaryOp(
+ deMath.shiftLeft(/** @type {Array<number>} */ (components)[1], 10), /** @type {Array<number>} */ (components)[0], deMath.BinaryOp.OR
+ ), deMath.BinaryOp.OR
+ ), deMath.BinaryOp.OR
+ );
+ glsDrawTests.copyArray(writePtr, new Uint32Array([packedValue]));
+ } else {
+ for (var componentNdx = 0; componentNdx < componentCount; componentNdx++) {
+ glsDrawTests.copyGLValueToArray(writePtr.subarray(componentNdx * componentSize), components[componentNdx]);
+ }
+ }
+
+ writePtr = writePtr.subarray(stride);
+ }
+
+ return new Uint8Array(data);
+ };
+
+ /**
+ * @param {number} seed
+ * @param {number} elementCount
+ * @param {?glsDrawTests.DrawTestSpec.IndexType} type
+ * @param {number} offset
+ * @param {number} min
+ * @param {number} max
+ * @return {goog.TypedArray}
+ */
+ glsDrawTests.RandomArrayGenerator.generateIndices = function(seed, elementCount, type, offset, min, max) {
+ return glsDrawTests.RandomArrayGenerator.createIndices(seed, elementCount, offset, min, max, type);
+ };
+
+ /**
+ * @param {number} seed
+ * @param {number} elementCount
+ * @param {number} offset
+ * @param {number} min
+ * @param {number} max
+ * @param {?glsDrawTests.DrawTestSpec.IndexType} type
+ * @return {goog.TypedArray}
+ */
+ glsDrawTests.RandomArrayGenerator.createIndices = function(seed, elementCount, offset, min, max, type) {
+ /** @type {number}*/ var elementSize = glsDrawTests.DrawTestSpec.indexTypeSize(type);
+ /** @type {number}*/ var bufferSize = offset + elementCount * elementSize;
+
+ var data = new ArrayBuffer(bufferSize);
+ var writePtr = new Uint8Array(data).subarray(offset);
+
+ var rnd = new deRandom.Random(seed);
+
+ /* TODO: get limits for given index type --> if (min < 0 || min > std::numeric_limits<T>::max() ||
+ max < 0 || max > std::numeric_limits<T>::max() ||
+ min > max)
+ DE_ASSERT(!"Invalid range");*/
+
+ // JS refrast requires shuffled unique keys
+ var keys = [];
+ for (var key = 0; key < elementCount; key++)
+ keys.push(glsDrawTests.GLValue.create(key, glsDrawTests.indexTypeToInputType(type)));
+
+ for (var elementNdx = 0; elementNdx < elementCount; ++elementNdx) {
+ var randomkey = rnd.getInt(0, keys.length - 1);
+ var ndx = keys[randomkey];
+
+ keys.splice(randomkey, 1);
+
+ glsDrawTests.copyArray(
+ writePtr.subarray(elementSize * elementNdx),
+ new Uint8Array(ndx.m_value.buffer)
+ );
+ }
+
+ return new Uint8Array(data);
+ };
+
+ /**
+ * @param {number} seed
+ * @param {?glsDrawTests.DrawTestSpec.InputType} type
+ * @return {Array<number>}
+ */
+ glsDrawTests.RandomArrayGenerator.generateAttributeValue = function(seed, type) {
+ var random = new deRandom.Random(seed);
+
+ switch (type) {
+ case glsDrawTests.DrawTestSpec.InputType.FLOAT:
+ return glsDrawTests.generateRandomVec4(random);
+
+ case glsDrawTests.DrawTestSpec.InputType.INT:
+ return glsDrawTests.generateRandomIVec4(random);
+
+ case glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT:
+ return glsDrawTests.generateRandomUVec4(random);
+
+ default:
+ throw new Error('Invalid attribute type');
+ }
+ };
+
+ // AttributePack
+
+ /**
+ * @param {sglrReferenceContext.ReferenceContext | sglrGLContext.GLContext} drawContext
+ * @param {Array<number>} screenSize (2 positive elements in array)
+ * @param {boolean} useVao
+ * @param {boolean} logEnabled
+ * @constructor
+ */
+ glsDrawTests.AttributePack = function(drawContext, screenSize, useVao, logEnabled) {
+ /** @type {sglrReferenceContext.ReferenceContext | sglrGLContext.GLContext} */ this.m_ctx = drawContext;
+
+ /** @type {Array<glsDrawTests.AttributeArray>} */ this.m_arrays = [];
+ /** @type {sglrShaderProgram.ShaderProgram} */ this.m_program;
+ /** @type {tcuSurface.Surface} */ this.m_screen = new tcuSurface.Surface(screenSize[0], screenSize[1]);
+ /** @type {boolean} */ this.m_useVao = useVao;
+ /** @type {boolean} */ this.m_logEnabled = logEnabled;
+ /** @type {WebGLProgram | sglrShaderProgram.ShaderProgram | null} */ this.m_programID = null;
+ /** @type {WebGLVertexArrayObject|sglrReferenceContext.VertexArray|null} */ this.m_vaoID = null;
+
+ if (this.m_useVao)
+ this.m_vaoID = this.m_ctx.createVertexArray();
+ };
+
+ /**
+ * @return {tcuSurface.Surface}
+ */
+ glsDrawTests.AttributePack.prototype.getSurface = function() {
+ return this.m_screen;
+ };
+
+ /**
+ * @param {number} i
+ * @return {glsDrawTests.AttributeArray}
+ */
+ glsDrawTests.AttributePack.prototype.getArray = function(i) {
+ return this.m_arrays[i];
+ };
+
+ /**
+ * @return number
+ */
+ glsDrawTests.AttributePack.prototype.getArrayCount = function() {
+ return this.m_arrays.length;
+ };
+
+ /**
+ * @param {?glsDrawTests.DrawTestSpec.Storage} storage
+ */
+ glsDrawTests.AttributePack.prototype.newArray = function(storage) {
+ this.m_arrays.push(new glsDrawTests.AttributeArray(storage, this.m_ctx));
+ };
+
+ /**
+ * clearArrays
+ */
+ glsDrawTests.AttributePack.prototype.clearArrays = function() {
+ this.m_arrays.length = 0;
+ };
+
+ /**
+ * updateProgram
+ */
+ glsDrawTests.AttributePack.prototype.updateProgram = function() {
+ if (this.m_programID)
+ this.m_ctx.deleteProgram(this.m_programID);
+
+ this.m_program = new glsDrawTests.DrawTestShaderProgram(this.m_arrays);
+ this.m_programID = this.m_ctx.createProgram(this.m_program);
+ };
+
+ /**
+ * @param {?glsDrawTests.DrawTestSpec.Primitive} primitive
+ * @param {?glsDrawTests.DrawTestSpec.DrawMethod} drawMethod
+ * @param {number} firstVertex
+ * @param {number} vertexCount
+ * @param {?glsDrawTests.DrawTestSpec.IndexType} indexType
+ * @param {number} indexOffset
+ * @param {number} rangeStart
+ * @param {number} rangeEnd
+ * @param {number} instanceCount
+ * @param {number} coordScale
+ * @param {number} colorScale
+ * @param {glsDrawTests.AttributeArray} indexArray
+ */
+ glsDrawTests.AttributePack.prototype.render = function(primitive, drawMethod, firstVertex, vertexCount, indexType,
+ indexOffset, rangeStart, rangeEnd, instanceCount, coordScale, colorScale, indexArray) {
+ assertMsgOptions(this.m_program != null, 'Program is null', false, true);
+ assertMsgOptions(this.m_programID != null, 'No context created program', false, true);
+
+ this.m_ctx.viewport(0, 0, this.m_screen.getWidth(), this.m_screen.getHeight());
+ this.m_ctx.clearColor(0.0, 0.0, 0.0, 1.0);
+ this.m_ctx.clear(gl.COLOR_BUFFER_BIT);
+
+ this.m_ctx.useProgram(this.m_programID);
+
+ this.m_ctx.uniform1f(this.m_ctx.getUniformLocation(this.m_programID, 'u_coordScale'), coordScale);
+ this.m_ctx.uniform1f(this.m_ctx.getUniformLocation(this.m_programID, 'u_colorScale'), colorScale);
+
+ if (this.m_useVao)
+ this.m_ctx.bindVertexArray(this.m_vaoID);
+
+ if (indexArray)
+ indexArray.bindIndexArray(glsDrawTests.DrawTestSpec.Target.ELEMENT_ARRAY);
+
+ for (var arrayNdx = 0; arrayNdx < this.m_arrays.length; arrayNdx++) {
+ var attribName = '';
+ attribName += 'a_' + arrayNdx;
+
+ var loc = this.m_ctx.getAttribLocation(this.m_programID, attribName);
+
+ if (this.m_arrays[arrayNdx].isBound())
+ this.m_ctx.enableVertexAttribArray(loc);
+
+ this.m_arrays[arrayNdx].bindAttribute(loc);
+ }
+
+ if (drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWARRAYS)
+ this.m_ctx.drawArrays(glsDrawTests.primitiveToGL(primitive), firstVertex, vertexCount);
+ else if (drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWARRAYS_INSTANCED)
+ this.m_ctx.drawArraysInstanced(glsDrawTests.primitiveToGL(primitive), firstVertex, vertexCount, instanceCount);
+ else if (drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS)
+ this.m_ctx.drawElements(glsDrawTests.primitiveToGL(primitive), vertexCount, glsDrawTests.indexTypeToGL(indexType), indexOffset);
+ else if (drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_RANGED)
+ this.m_ctx.drawRangeElements(glsDrawTests.primitiveToGL(primitive), rangeStart, rangeEnd, vertexCount, glsDrawTests.indexTypeToGL(indexType), indexOffset);
+ else if (drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_INSTANCED)
+ this.m_ctx.drawElementsInstanced(glsDrawTests.primitiveToGL(primitive), vertexCount, glsDrawTests.indexTypeToGL(indexType), indexOffset, instanceCount);
+ else
+ throw new Error('Invalid draw method');
+
+ for (var arrayNdx = 0; arrayNdx < this.m_arrays.length; arrayNdx++) {
+ if (this.m_arrays[arrayNdx].isBound()) {
+ var attribName = '';
+ attribName += 'a_' + arrayNdx;
+
+ var loc = this.m_ctx.getAttribLocation(this.m_programID, attribName);
+
+ this.m_ctx.disableVertexAttribArray(loc);
+ }
+ }
+
+ if (this.m_useVao)
+ this.m_ctx.bindVertexArray(null);
+
+ this.m_ctx.useProgram(null);
+ this.m_screen.readViewport(this.m_ctx, [0 , 0, this.m_screen.getWidth(), this.m_screen.getHeight()]);
+ };
+
+ // DrawTestSpec
+
+ /**
+ * @constructor
+ */
+ glsDrawTests.DrawTestSpec = function() {
+ /** @type {?glsDrawTests.DrawTestSpec.Primitive} */ this.primitive = null;
+ /** @type {number} */ this.primitiveCount = 0; //!< number of primitives to draw (per instance)
+
+ /** @type {?glsDrawTests.DrawTestSpec.DrawMethod} */ this.drawMethod = null;
+ /** @type {?glsDrawTests.DrawTestSpec.IndexType} */ this.indexType = null; //!< used only if drawMethod = DrawElements*
+ /** @type {number} */ this.indexPointerOffset = 0; //!< used only if drawMethod = DrawElements*
+ /** @type {?glsDrawTests.DrawTestSpec.Storage} */ this.indexStorage = null; //!< used only if drawMethod = DrawElements*
+ /** @type {number} */ this.first = 0; //!< used only if drawMethod = DrawArrays*
+ /** @type {number} */ this.indexMin = 0; //!< used only if drawMethod = Draw*Ranged
+ /** @type {number} */ this.indexMax = 0; //!< used only if drawMethod = Draw*Ranged
+ /** @type {number} */ this.instanceCount = 0; //!< used only if drawMethod = Draw*Instanced or Draw*Indirect
+ /** @type {number} */ this.indirectOffset = 0; //!< used only if drawMethod = Draw*Indirect
+ /** @type {number} */ this.baseVertex = 0; //!< used only if drawMethod = DrawElementsIndirect or *BaseVertex
+
+ /** @type {Array<glsDrawTests.DrawTestSpec.AttributeSpec>} */ this.attribs = [];
+ };
+
+ /**
+ * @param {glsDrawTests.DrawTestSpec.Target} target
+ * @return {string}
+ */
+ glsDrawTests.DrawTestSpec.targetToString = function(target) {
+ assertMsgOptions(target != null, 'Target is null', false, true);
+
+ var targets = [
+ 'element_array', // TARGET_ELEMENT_ARRAY = 0,
+ 'array' // TARGET_ARRAY,
+ ];
+ assertMsgOptions(targets.length == Object.keys(glsDrawTests.DrawTestSpec.Target).length,
+ 'The amount of target names is different than the amount of targets', false, true);
+
+ return targets[target];
+ };
+
+ /**
+ * @param {?glsDrawTests.DrawTestSpec.InputType} type
+ * @return {string}
+ */
+ glsDrawTests.DrawTestSpec.inputTypeToString = function(type) {
+ assertMsgOptions(type != null, 'Type is null', false, true);
+
+ var types = [
+ 'float', // INPUTTYPE_FLOAT = 0,
+
+ 'byte', // INPUTTYPE_BYTE,
+ 'short', // INPUTTYPE_SHORT,
+
+ 'unsigned_byte', // INPUTTYPE_UNSIGNED_BYTE,
+ 'unsigned_short', // INPUTTYPE_UNSIGNED_SHORT,
+
+ 'int', // INPUTTYPE_INT,
+ 'unsigned_int', // INPUTTYPE_UNSIGNED_INT,
+ 'half', // INPUTTYPE_HALF,
+ 'unsigned_int2_10_10_10', // INPUTTYPE_UNSIGNED_INT_2_10_10_10,
+ 'int2_10_10_10' // INPUTTYPE_INT_2_10_10_10,
+ ];
+ assertMsgOptions(types.length == Object.keys(glsDrawTests.DrawTestSpec.InputType).length,
+ 'The amount of type names is different than the amount of types', false, true);
+
+ return types[type];
+ };
+
+ /**
+ * @param {?glsDrawTests.DrawTestSpec.OutputType} type
+ * @return {string}
+ */
+ glsDrawTests.DrawTestSpec.outputTypeToString = function(type) {
+ assertMsgOptions(type != null, 'Type is null', false, true);
+
+ var types = [
+ 'float', // OUTPUTTYPE_FLOAT = 0,
+ 'vec2', // OUTPUTTYPE_VEC2,
+ 'vec3', // OUTPUTTYPE_VEC3,
+ 'vec4', // OUTPUTTYPE_VEC4,
+
+ 'int', // OUTPUTTYPE_INT,
+ 'uint', // OUTPUTTYPE_UINT,
+
+ 'ivec2', // OUTPUTTYPE_IVEC2,
+ 'ivec3', // OUTPUTTYPE_IVEC3,
+ 'ivec4', // OUTPUTTYPE_IVEC4,
+
+ 'uvec2', // OUTPUTTYPE_UVEC2,
+ 'uvec3', // OUTPUTTYPE_UVEC3,
+ 'uvec4' // OUTPUTTYPE_UVEC4,
+ ];
+ assertMsgOptions(types.length == Object.keys(glsDrawTests.DrawTestSpec.OutputType).length,
+ 'The amount of type names is different than the amount of types', false, true);
+
+ return types[type];
+ };
+
+ /**
+ * @param {?glsDrawTests.DrawTestSpec.Usage} usage
+ * @return {string}
+ */
+ glsDrawTests.DrawTestSpec.usageTypeToString = function(usage) {
+ assertMsgOptions(usage != null, 'Usage is null', false, true);
+
+ var usages = [
+ 'dynamic_draw', // USAGE_DYNAMIC_DRAW = 0,
+ 'static_draw', // USAGE_STATIC_DRAW,
+ 'stream_draw', // USAGE_STREAM_DRAW,
+
+ 'stream_read', // USAGE_STREAM_READ,
+ 'stream_copy', // USAGE_STREAM_COPY,
+
+ 'static_read', // USAGE_STATIC_READ,
+ 'static_copy', // USAGE_STATIC_COPY,
+
+ 'dynamic_read', // USAGE_DYNAMIC_READ,
+ 'dynamic_copy' // USAGE_DYNAMIC_COPY,
+ ];
+ assertMsgOptions(usages.length == Object.keys(glsDrawTests.DrawTestSpec.Usage).length,
+ 'The amount of usage names is different than the amount of usages', false, true);
+
+ return usages[usage];
+ };
+
+ /**
+ * @param {?glsDrawTests.DrawTestSpec.Storage} storage
+ * @return {string}
+ */
+ glsDrawTests.DrawTestSpec.storageToString = function(storage) {
+ assertMsgOptions(storage != null, 'Storage is null', false, true);
+
+ var storages = [
+ 'user_ptr', // STORAGE_USER = 0,
+ 'buffer' // STORAGE_BUFFER,
+ ];
+ assertMsgOptions(storages.length == Object.keys(glsDrawTests.DrawTestSpec.Storage).length,
+ 'The amount of storage names is different than the amount of storages', false, true);
+
+ return storages[storage];
+ };
+
+ /**
+ * @param {glsDrawTests.DrawTestSpec.Primitive} primitive
+ * @return {string}
+ */
+ glsDrawTests.DrawTestSpec.primitiveToString = function(primitive) {
+ assertMsgOptions(primitive != null, 'Primitive is null', false, true);
+
+ var primitives = [
+ 'points', // PRIMITIVE_POINTS ,
+ 'triangles', // PRIMITIVE_TRIANGLES,
+ 'triangle_fan', // PRIMITIVE_TRIANGLE_FAN,
+ 'triangle_strip', // PRIMITIVE_TRIANGLE_STRIP,
+ 'lines', // PRIMITIVE_LINES
+ 'line_strip', // PRIMITIVE_LINE_STRIP
+ 'line_loop'
+ ];
+ assertMsgOptions(primitives.length == Object.keys(glsDrawTests.DrawTestSpec.Primitive).length,
+ 'The amount of primitive names is different than the amount of primitives', false, true);
+
+ return primitives[primitive];
+ };
+
+ /**
+ * @param {?glsDrawTests.DrawTestSpec.IndexType} type
+ * @return {string}
+ */
+ glsDrawTests.DrawTestSpec.indexTypeToString = function(type) {
+ assertMsgOptions(type != null, 'Index type is null', false, true);
+
+ var indexTypes = [
+ 'byte', // INDEXTYPE_BYTE = 0,
+ 'short', // INDEXTYPE_SHORT,
+ 'int' // INDEXTYPE_INT,
+ ];
+ assertMsgOptions(indexTypes.length == Object.keys(glsDrawTests.DrawTestSpec.IndexType).length,
+ 'The amount of index type names is different than the amount of index types', false, true);
+
+ return indexTypes[type];
+ };
+
+ /**
+ * @param {?glsDrawTests.DrawTestSpec.DrawMethod} method
+ * @return {string}
+ */
+ glsDrawTests.DrawTestSpec.drawMethodToString = function(method) {
+ assertMsgOptions(method != null, 'Method is null', false, true);
+
+ var methods = [
+ 'draw_arrays', //!< DRAWMETHOD_DRAWARRAYS
+ 'draw_arrays_instanced', //!< DRAWMETHOD_DRAWARRAYS_INSTANCED
+ 'draw_elements', //!< DRAWMETHOD_DRAWELEMENTS
+ 'draw_range_elements', //!< DRAWMETHOD_DRAWELEMENTS_RANGED
+ 'draw_elements_instanced' //!< DRAWMETHOD_DRAWELEMENTS_INSTANCED
+ ];
+ assertMsgOptions(methods.length == Object.keys(glsDrawTests.DrawTestSpec.DrawMethod).length,
+ 'The amount of method names is different than the amount of methods', false, true);
+
+ return methods[method];
+ };
+
+ /**
+ * @param {?glsDrawTests.DrawTestSpec.InputType} type
+ * @return {number}
+ */
+ glsDrawTests.DrawTestSpec.inputTypeSize = function(type) {
+ assertMsgOptions(type != null, 'Input type is null', false, true);
+
+ var size = [
+ 4, // INPUTTYPE_FLOAT = 0,
+
+ 1, // INPUTTYPE_BYTE,
+ 2, // INPUTTYPE_SHORT,
+
+ 1, // INPUTTYPE_UNSIGNED_BYTE,
+ 2, // INPUTTYPE_UNSIGNED_SHORT,
+
+ 4, // INPUTTYPE_INT,
+ 4, // INPUTTYPE_UNSIGNED_INT,
+ 2, // INPUTTYPE_HALF,
+ 4 / 4, // INPUTTYPE_UNSIGNED_INT_2_10_10_10,
+ 4 / 4 // INPUTTYPE_INT_2_10_10_10,
+ ];
+ assertMsgOptions(size.length == Object.keys(glsDrawTests.DrawTestSpec.InputType).length,
+ 'The amount of type names is different than the amount of types', false, true);
+
+ return size[type];
+ };
+
+ /**
+ * @param {?glsDrawTests.DrawTestSpec.IndexType} type
+ * @return {number}
+ */
+ glsDrawTests.DrawTestSpec.indexTypeSize = function(type) {
+ assertMsgOptions(type != null, 'Type is null', false, true);
+
+ var size = [
+ 1, // INDEXTYPE_BYTE,
+ 2, // INDEXTYPE_SHORT,
+ 4 // INDEXTYPE_INT,
+ ];
+ assertMsgOptions(size.length == Object.keys(glsDrawTests.DrawTestSpec.IndexType).length,
+ 'The amount of type names is different than the amount of types', false, true);
+
+ return size[type];
+ };
+
+ /**
+ * @return {string}
+ */
+ glsDrawTests.DrawTestSpec.prototype.getName = function() {
+ /** @type {glsDrawTests.MethodInfo} */ var methodInfo = glsDrawTests.getMethodInfo(this.drawMethod);
+ /** @type {boolean} */ var hasFirst = methodInfo.first;
+ /** @type {boolean} */ var instanced = methodInfo.instanced;
+ /** @type {boolean} */ var ranged = methodInfo.ranged;
+ /** @type {boolean} */ var indexed = methodInfo.indexed;
+
+ var name = '';
+
+ for (var ndx = 0; ndx < this.attribs.length; ++ndx) {
+ /** @type {glsDrawTests.DrawTestSpec.AttributeSpec}*/ var attrib = this.attribs[ndx];
+
+ if (this.attribs.length > 1)
+ name += 'attrib' + ndx + '_';
+
+ if (ndx == 0 || attrib.additionalPositionAttribute)
+ name += 'pos_';
+ else
+ name += 'col_';
+
+ if (attrib.useDefaultAttribute) {
+ name += 'non_array_' +
+ glsDrawTests.DrawTestSpec.inputTypeToString(/** @type {?glsDrawTests.DrawTestSpec.InputType} */ (attrib.inputType)) + '_' +
+ attrib.componentCount + '_' +
+ glsDrawTests.DrawTestSpec.outputTypeToString(attrib.outputType) + '_';
+ } else {
+ name += glsDrawTests.DrawTestSpec.storageToString(attrib.storage) + '_' +
+ attrib.offset + '_' +
+ attrib.stride + '_' +
+ glsDrawTests.DrawTestSpec.inputTypeToString(/** @type {?glsDrawTests.DrawTestSpec.InputType} */ (attrib.inputType));
+ if (attrib.inputType != glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT_2_10_10_10 && attrib.inputType != glsDrawTests.DrawTestSpec.InputType.INT_2_10_10_10)
+ name += attrib.componentCount;
+ name += '_' +
+ (attrib.normalize ? 'normalized_' : '') +
+ glsDrawTests.DrawTestSpec.outputTypeToString(attrib.outputType) + '_' +
+ glsDrawTests.DrawTestSpec.usageTypeToString(attrib.usage) + '_' +
+ attrib.instanceDivisor + '_';
+ }
+ }
+
+ if (indexed)
+ name += 'index_' + glsDrawTests.DrawTestSpec.indexTypeToString(this.indexType) + '_' +
+ glsDrawTests.DrawTestSpec.storageToString(this.indexStorage) + '_' +
+ 'offset' + this.indexPointerOffset + '_';
+ if (hasFirst)
+ name += 'first' + this.first + '_';
+ if (ranged)
+ name += 'ranged_' + this.indexMin + '_' + this.indexMax + '_';
+ if (instanced)
+ name += 'instances' + this.instanceCount + '_';
+
+ switch (this.primitive) {
+ case glsDrawTests.DrawTestSpec.Primitive.POINTS:
+ name += 'points_';
+ break;
+ case glsDrawTests.DrawTestSpec.Primitive.TRIANGLES:
+ name += 'triangles_';
+ break;
+ case glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_FAN:
+ name += 'triangle_fan_';
+ break;
+ case glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_STRIP:
+ name += 'triangle_strip_';
+ break;
+ case glsDrawTests.DrawTestSpec.Primitive.LINES:
+ name += 'lines_';
+ break;
+ case glsDrawTests.DrawTestSpec.Primitive.LINE_STRIP:
+ name += 'line_strip_';
+ break;
+ case glsDrawTests.DrawTestSpec.Primitive.LINE_LOOP:
+ name += 'line_loop_';
+ break;
+ default:
+ throw new Error('Invalid primitive');
+ break;
+ }
+
+ name += this.primitiveCount;
+
+ return name;
+ };
+
+ /**
+ * @return {string}
+ */
+ glsDrawTests.DrawTestSpec.prototype.getDesc = function() {
+ var desc = '';
+
+ for (var ndx = 0; ndx < this.attribs.length; ++ndx) {
+ /** @type {glsDrawTests.DrawTestSpec.AttributeSpec} */ var attrib = this.attribs[ndx];
+
+ if (attrib.useDefaultAttribute) {
+ desc += 'Attribute ' + ndx + ': default, ' + ((ndx == 0 || attrib.additionalPositionAttribute) ? ('position ,') : ('color ,')) +
+ 'input datatype ' + glsDrawTests.DrawTestSpec.inputTypeToString(/** @type {?glsDrawTests.DrawTestSpec.InputType} */ (attrib.inputType)) + ', ' +
+ 'input component count ' + attrib.componentCount + ', ' +
+ 'used as ' + glsDrawTests.DrawTestSpec.outputTypeToString(attrib.outputType) + ', ';
+ } else {
+ desc += 'Attribute ' + ndx + ': ' + ((ndx == 0 || attrib.additionalPositionAttribute) ? ('position ,') : ('color ,')) +
+ 'Storage in ' + glsDrawTests.DrawTestSpec.storageToString(attrib.storage) + ', ' +
+ 'stride ' + attrib.stride + ', ' +
+ 'input datatype ' + glsDrawTests.DrawTestSpec.inputTypeToString(/** @type {?glsDrawTests.DrawTestSpec.InputType} */ (attrib.inputType)) + ', ' +
+ 'input component count ' + attrib.componentCount + ', ' +
+ (attrib.normalize ? 'normalized, ' : '') +
+ 'used as ' + glsDrawTests.DrawTestSpec.outputTypeToString(attrib.outputType) + ', ' +
+ 'instance divisor ' + attrib.instanceDivisor + ', ';
+ }
+ }
+
+ if (this.drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWARRAYS) {
+ desc += 'drawArrays(), ' +
+ 'first ' + this.first + ', ';
+ } else if (this.drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWARRAYS_INSTANCED) {
+ desc += 'drawArraysInstanced(), ' +
+ 'first ' + this.first + ', ' +
+ 'instance count ' + this.instanceCount + ', ';
+ } else if (this.drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS) {
+ desc += 'drawElements(), ' +
+ 'index type ' + glsDrawTests.DrawTestSpec.indexTypeToString(this.indexType) + ', ' +
+ 'index storage in ' + glsDrawTests.DrawTestSpec.storageToString(this.indexStorage) + ', ' +
+ 'index offset ' + this.indexPointerOffset + ', ';
+ } else if (this.drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_RANGED) {
+ desc += 'drawElementsRanged(), ' +
+ 'index type ' + glsDrawTests.DrawTestSpec.indexTypeToString(this.indexType) + ', ' +
+ 'index storage in ' + glsDrawTests.DrawTestSpec.storageToString(this.indexStorage) + ', ' +
+ 'index offset ' + this.indexPointerOffset + ', ' +
+ 'range start ' + this.indexMin + ', ' +
+ 'range end ' + this.indexMax + ', ';
+ } else if (this.drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_INSTANCED) {
+ desc += 'drawElementsInstanced(), ' +
+ 'index type ' + glsDrawTests.DrawTestSpec.indexTypeToString(this.indexType) + ', ' +
+ 'index storage in ' + glsDrawTests.DrawTestSpec.storageToString(this.indexStorage) + ', ' +
+ 'index offset ' + this.indexPointerOffset + ', ' +
+ 'instance count ' + this.instanceCount + ', ';
+ } else
+ throw new Error('Invalid draw method');
+
+ desc += this.primitiveCount;
+
+ switch (this.primitive) {
+ case glsDrawTests.DrawTestSpec.Primitive.POINTS:
+ desc += 'points';
+ break;
+ case glsDrawTests.DrawTestSpec.Primitive.TRIANGLES:
+ desc += 'triangles';
+ break;
+ case glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_FAN:
+ desc += 'triangles (fan)';
+ break;
+ case glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_STRIP:
+ desc += 'triangles (strip)';
+ break;
+ case glsDrawTests.DrawTestSpec.Primitive.LINES:
+ desc += 'lines';
+ break;
+ case glsDrawTests.DrawTestSpec.Primitive.LINE_STRIP:
+ desc += 'lines (strip)';
+ break;
+ case glsDrawTests.DrawTestSpec.Primitive.LINE_LOOP:
+ desc += 'lines (loop)';
+ break;
+ default:
+ throw new Error('Invalid primitive');
+ break;
+ }
+
+ return desc;
+ };
+
+ /**
+ * @return {string}
+ */
+ glsDrawTests.DrawTestSpec.prototype.getMultilineDesc = function() {
+ var desc = '';
+
+ for (var ndx = 0; ndx < this.attribs.length; ++ndx) {
+ /** @type {glsDrawTests.DrawTestSpec.AttributeSpec} */ var attrib = this.attribs[ndx];
+
+ if (attrib.useDefaultAttribute) {
+ desc += 'Attribute ' + ndx + ': default, ' + ((ndx == 0 || attrib.additionalPositionAttribute) ? ('position\n') : ('color\n')) +
+ '\tinput datatype ' + glsDrawTests.DrawTestSpec.inputTypeToString(/** @type {?glsDrawTests.DrawTestSpec.InputType} */ (attrib.inputType)) + '\n' +
+ '\tinput component count ' + attrib.componentCount + '\n' +
+ '\tused as ' + glsDrawTests.DrawTestSpec.outputTypeToString(attrib.outputType) + '\n';
+ } else {
+ desc += 'Attribute ' + ndx + ': ' + ((ndx == 0 || attrib.additionalPositionAttribute) ? ('position\n') : ('color\n')) +
+ '\tStorage in ' + glsDrawTests.DrawTestSpec.storageToString(attrib.storage) + '\n' +
+ '\tstride ' + attrib.stride + '\n' +
+ '\tinput datatype ' + glsDrawTests.DrawTestSpec.inputTypeToString(/** @type {?glsDrawTests.DrawTestSpec.InputType} */ (attrib.inputType)) + '\n' +
+ '\tinput component count ' + attrib.componentCount + '\n' +
+ (attrib.normalize ? '\tnormalized\n' : '') +
+ '\tused as ' + glsDrawTests.DrawTestSpec.outputTypeToString(attrib.outputType) + '\n' +
+ '\tinstance divisor ' + attrib.instanceDivisor + '\n';
+ }
+ }
+
+ if (this.drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWARRAYS) {
+ desc += 'drawArrays()\n' +
+ '\tfirst ' + this.first + '\n';
+ } else if (this.drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWARRAYS_INSTANCED) {
+ desc += 'drawArraysInstanced()\n' +
+ '\tfirst ' + this.first + '\n' +
+ '\tinstance count ' + this.instanceCount + '\n';
+ } else if (this.drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS) {
+ desc += 'drawElements()\n' +
+ '\tindex type ' + glsDrawTests.DrawTestSpec.indexTypeToString(this.indexType) + '\n' +
+ '\tindex storage in ' + glsDrawTests.DrawTestSpec.storageToString(this.indexStorage) + '\n' +
+ '\tindex offset ' + this.indexPointerOffset + '\n';
+ } else if (this.drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_RANGED) {
+ desc += 'drawElementsRanged()\n' +
+ '\tindex type ' + glsDrawTests.DrawTestSpec.indexTypeToString(this.indexType) + '\n' +
+ '\tindex storage in ' + glsDrawTests.DrawTestSpec.storageToString(this.indexStorage) + '\n' +
+ '\tindex offset ' + this.indexPointerOffset + '\n' +
+ '\trange start ' + this.indexMin + '\n' +
+ '\trange end ' + this.indexMax + '\n';
+ } else if (this.drawMethod == glsDrawTests.DrawTestSpec.DrawMethod.DRAWELEMENTS_INSTANCED) {
+ desc += 'drawElementsInstanced()\n' +
+ '\tindex type ' + glsDrawTests.DrawTestSpec.indexTypeToString(this.indexType) + '\n' +
+ '\tindex storage in ' + glsDrawTests.DrawTestSpec.storageToString(this.indexStorage) + '\n' +
+ '\tindex offset ' + this.indexPointerOffset + '\n' +
+ '\tinstance count ' + this.instanceCount + '\n';
+ } else
+ throw new Error('Invalid draw method');
+
+ desc += '\t' + this.primitiveCount + ' ';
+
+ switch (this.primitive) {
+ case glsDrawTests.DrawTestSpec.Primitive.POINTS:
+ desc += 'points';
+ break;
+ case glsDrawTests.DrawTestSpec.Primitive.TRIANGLES:
+ desc += 'triangles';
+ break;
+ case glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_FAN:
+ desc += 'triangles (fan)';
+ break;
+ case glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_STRIP:
+ desc += 'triangles (strip)';
+ break;
+ case glsDrawTests.DrawTestSpec.Primitive.LINES:
+ desc += 'lines';
+ break;
+ case glsDrawTests.DrawTestSpec.Primitive.LINE_STRIP:
+ desc += 'lines (strip)';
+ break;
+ case glsDrawTests.DrawTestSpec.Primitive.LINE_LOOP:
+ desc += 'lines (loop)';
+ break;
+ default:
+ throw new Error('Invalid primitive');
+ break;
+ }
+
+ desc += '\n';
+
+ return desc;
+ };
+
+ /**
+ * @enum {number}
+ */
+ glsDrawTests.DrawTestSpec.Target = {
+ ELEMENT_ARRAY: 0,
+ ARRAY: 1
+ };
+
+ /**
+ * @enum {number}
+ */
+ glsDrawTests.DrawTestSpec.InputType = {
+ FLOAT: 0,
+
+ BYTE: 1,
+ SHORT: 2,
+
+ UNSIGNED_BYTE: 3,
+ UNSIGNED_SHORT: 4,
+
+ INT: 5,
+ UNSIGNED_INT: 6,
+ HALF: 7,
+ UNSIGNED_INT_2_10_10_10: 8,
+ INT_2_10_10_10: 9
+ };
+
+ /**
+ * @enum {number}
+ */
+ glsDrawTests.DrawTestSpec.OutputType = {
+ FLOAT: 0,
+ VEC2: 1,
+ VEC3: 2,
+ VEC4: 3,
+
+ INT: 4,
+ UINT: 5,
+
+ IVEC2: 6,
+ IVEC3: 7,
+ IVEC4: 8,
+
+ UVEC2: 9,
+ UVEC3: 10,
+ UVEC4: 11
+ };
+
+ /**
+ * @enum {number}
+ */
+ glsDrawTests.DrawTestSpec.Usage = {
+ DYNAMIC_DRAW: 0,
+ STATIC_DRAW: 1,
+ STREAM_DRAW: 2,
+
+ STREAM_READ: 3,
+ STREAM_COPY: 4,
+
+ STATIC_READ: 5,
+ STATIC_COPY: 6,
+
+ DYNAMIC_READ: 7,
+ DYNAMIC_COPY: 8
+ };
+
+ /**
+ * @enum {number}
+ */
+ glsDrawTests.DrawTestSpec.Storage = {
+ USER: 0,
+ BUFFER: 1
+ };
+
+ /**
+ * @enum {number}
+ */
+ glsDrawTests.DrawTestSpec.Primitive = {
+ POINTS: 0,
+ TRIANGLES: 1,
+ TRIANGLE_FAN: 2,
+ TRIANGLE_STRIP: 3,
+ LINES: 4,
+ LINE_STRIP: 5,
+ LINE_LOOP: 6
+ };
+
+ /**
+ * @enum {number}
+ */
+ glsDrawTests.DrawTestSpec.IndexType = {
+ BYTE: 0,
+ SHORT: 1,
+ INT: 2
+ };
+
+ /**
+ * @enum {number}
+ */
+ glsDrawTests.DrawTestSpec.DrawMethod = {
+ DRAWARRAYS: 0,
+ DRAWARRAYS_INSTANCED: 1,
+ DRAWELEMENTS: 2,
+ DRAWELEMENTS_RANGED: 3,
+ DRAWELEMENTS_INSTANCED: 4
+ };
+
+ /**
+ * @enum {number}
+ */
+ glsDrawTests.DrawTestSpec.CompatibilityTestType = {
+ NONE: 0,
+ UNALIGNED_OFFSET: 1,
+ UNALIGNED_STRIDE: 2
+ };
+
+ /**
+ * @return {number}
+ */
+ glsDrawTests.DrawTestSpec.prototype.hash = function() {
+ // Use only drawmode-relevant values in "hashing" as the unrelevant values might not be set (causing non-deterministic behavior).
+ /** @type {glsDrawTests.MethodInfo} */ var methodInfo = glsDrawTests.getMethodInfo(this.drawMethod);
+ /** @type {boolean} */ var arrayed = methodInfo.first;
+ /** @type {boolean} */ var instanced = methodInfo.instanced;
+ /** @type {boolean} */ var ranged = methodInfo.ranged;
+ /** @type {boolean} */ var indexed = methodInfo.indexed;
+
+ /** @type {number} */ var indexHash = (!indexed) ? (0) : (this.indexType + 10 * this.indexPointerOffset + 100 * this.indexStorage);
+ /** @type {number} */ var arrayHash = (!arrayed) ? (0) : (this.first);
+ /** @type {number} */ var indexRangeHash = (!ranged) ? (0) : (this.indexMin + 10 * this.indexMax);
+ /** @type {number} */ var instanceHash = (!instanced) ? (0) : (this.instanceCount);
+ /** @type {number} */ var basicHash = this.primitive + 10 * this.primitiveCount + 100 * this.drawMethod;
+
+ return indexHash + 3 * arrayHash + 5 * indexRangeHash + 7 * instanceHash + 13 * basicHash + 17 * this.attribs.length + 19 * this.primitiveCount;
+ };
+
+ /**
+ * @return {boolean}
+ */
+ glsDrawTests.DrawTestSpec.prototype.valid = function() {
+ assertMsgOptions(this.primitive != null, 'Primitive is null', false, true);
+ assertMsgOptions(this.drawMethod != null, 'Draw method is null', false, true);
+
+ var methodInfo = glsDrawTests.getMethodInfo(this.drawMethod);
+
+ if (methodInfo.ranged) {
+ var maxIndexValue = 0;
+ if (this.indexType == glsDrawTests.DrawTestSpec.IndexType.BYTE)
+ maxIndexValue = glsDrawTests.GLValue.getMaxValue(glsDrawTests.DrawTestSpec.InputType.UNSIGNED_BYTE).interpret();
+ else if (this.indexType == glsDrawTests.DrawTestSpec.IndexType.SHORT)
+ maxIndexValue = glsDrawTests.GLValue.getMaxValue(glsDrawTests.DrawTestSpec.InputType.UNSIGNED_SHORT).interpret();
+ else if (this.indexType == glsDrawTests.DrawTestSpec.IndexType.INT)
+ maxIndexValue = glsDrawTests.GLValue.getMaxValue(glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT).interpret();
+ else
+ throw new Error('Invalid index type');
+
+ if (this.indexMin > this.indexMax)
+ return false;
+ if (this.indexMin < 0 || this.indexMax < 0)
+ return false;
+ if (this.indexMin > maxIndexValue || this.indexMax > maxIndexValue)
+ return false;
+ }
+
+ if (methodInfo.first && this.first < 0)
+ return false;
+
+ return true;
+ };
+
+ /**
+ * @return {glsDrawTests.DrawTestSpec.CompatibilityTestType}
+ */
+ glsDrawTests.DrawTestSpec.prototype.isCompatibilityTest = function() {
+ var methodInfo = glsDrawTests.getMethodInfo(this.drawMethod);
+
+ var bufferAlignmentBad = false;
+ var strideAlignmentBad = false;
+
+ // Attribute buffer alignment
+ for (var ndx = 0; ndx < this.attribs.length; ++ndx)
+ if (!this.attribs[ndx].isBufferAligned())
+ bufferAlignmentBad = true;
+
+ // Attribute stride alignment
+ for (var ndx = 0; ndx < this.attribs.length; ++ndx)
+ if (!this.attribs[ndx].isBufferStrideAligned())
+ strideAlignmentBad = true;
+
+ // Index buffer alignment
+ if (methodInfo.indexed) {
+ if (this.indexStorage == glsDrawTests.DrawTestSpec.Storage.BUFFER) {
+ var indexSize = 0;
+ if (this.indexType == glsDrawTests.DrawTestSpec.IndexType.BYTE)
+ indexSize = 1;
+ else if (this.indexType == glsDrawTests.DrawTestSpec.IndexType.SHORT)
+ indexSize = 2;
+ else if (this.indexType == glsDrawTests.DrawTestSpec.IndexType.INT)
+ indexSize = 4;
+ else
+ throw new Error('');
+
+ if (this.indexPointerOffset % indexSize != 0)
+ bufferAlignmentBad = true;
+ }
+ }
+
+ // \note combination bad alignment & stride is treated as bad offset
+ if (bufferAlignmentBad)
+ return glsDrawTests.DrawTestSpec.CompatibilityTestType.UNALIGNED_OFFSET;
+ else if (strideAlignmentBad)
+ return glsDrawTests.DrawTestSpec.CompatibilityTestType.UNALIGNED_STRIDE;
+ else
+ return glsDrawTests.DrawTestSpec.CompatibilityTestType.NONE;
+ };
+
+ // DrawTestSpec.AttributeSpec
+
+ /**
+ * @constructor
+ */
+ glsDrawTests.DrawTestSpec.AttributeSpec = function() {
+ /** @type {?glsDrawTests.DrawTestSpec.InputType} */ this.inputType = null;
+ /** @type {?glsDrawTests.DrawTestSpec.OutputType} */ this.outputType = null;
+ /** @type {?glsDrawTests.DrawTestSpec.Storage} */ this.storage = glsDrawTests.DrawTestSpec.Storage.BUFFER; //Always BUFFER in WebGL up to 2
+ /** @type {?glsDrawTests.DrawTestSpec.Usage} */ this.usage = null;
+ /** @type {number} */ this.componentCount = 0;
+ /** @type {number} */ this.offset = 0;
+ /** @type {number} */ this.stride = 0;
+ /** @type {boolean} */ this.normalize = false;
+ /** @type {number} */ this.instanceDivisor = 0; //!< used only if drawMethod = Draw*Instanced
+ /** @type {boolean} */ this.useDefaultAttribute = false;
+
+ /** @type {boolean} */ this.additionalPositionAttribute = false; //!< treat this attribute as position attribute. Attribute at index 0 is alway treated as such. False by default
+ };
+
+ /**
+ * @param {?glsDrawTests.DrawTestSpec.InputType} inputType
+ * @param {?glsDrawTests.DrawTestSpec.OutputType} outputType
+ * @param {?glsDrawTests.DrawTestSpec.Storage} storage
+ * @param {?glsDrawTests.DrawTestSpec.Usage} usage
+ * @param {number} componentCount
+ * @param {number} offset
+ * @param {number} stride
+ * @param {boolean} normalize
+ * @param {number} instanceDivisor
+ * @return {glsDrawTests.DrawTestSpec.AttributeSpec}
+ */
+ glsDrawTests.DrawTestSpec.AttributeSpec.createAttributeArray = function(inputType, outputType, storage, usage, componentCount,
+ offset, stride, normalize, instanceDivisor) {
+ /** @type {glsDrawTests.DrawTestSpec.AttributeSpec} */ var spec;
+
+ spec.inputType = inputType;
+ spec.outputType = outputType;
+ spec.storage = storage;
+ spec.usage = usage;
+ spec.componentCount = componentCount;
+ spec.offset = offset;
+ spec.stride = stride;
+ spec.normalize = normalize;
+ spec.instanceDivisor = instanceDivisor;
+
+ spec.useDefaultAttribute = false;
+
+ return spec;
+ };
+
+ /**
+ * @param {?glsDrawTests.DrawTestSpec.InputType} inputType
+ * @param {?glsDrawTests.DrawTestSpec.OutputType} outputType
+ * @param {number} componentCount
+ * @return {glsDrawTests.DrawTestSpec.AttributeSpec}
+ */
+ glsDrawTests.DrawTestSpec.AttributeSpec.createDefaultAttribute = function(inputType, outputType, componentCount) {
+ assertMsgOptions(inputType == glsDrawTests.DrawTestSpec.InputType.INT || inputType == glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT || inputType == glsDrawTests.DrawTestSpec.InputType.FLOAT, 'Invalid input type', false, true);
+ assertMsgOptions(inputType == glsDrawTests.DrawTestSpec.InputType.FLOAT || componentCount == 4, 'If not float, input type should have 4 components', false, true);
+
+ /** @type {glsDrawTests.DrawTestSpec.AttributeSpec} */ var spec;
+
+ spec.inputType = inputType;
+ spec.outputType = outputType;
+ spec.storage = glsDrawTests.DrawTestSpec.Storage.BUFFER; //Always BUFFER in WebGL up to 2
+ spec.usage = null;
+ spec.componentCount = componentCount;
+ spec.offset = 0;
+ spec.stride = 0;
+ spec.normalize = false;
+ spec.instanceDivisor = 0;
+
+ spec.useDefaultAttribute = true;
+
+ return spec;
+ };
+
+ /**
+ * @return {number}
+ */
+ glsDrawTests.DrawTestSpec.AttributeSpec.prototype.hash = function() {
+ if (this.useDefaultAttribute) {
+ return 1 * this.inputType + 7 * this.outputType + 13 * this.componentCount;
+ } else {
+ return 1 * this.inputType + 2 * this.outputType + 3 * this.storage + 5 * this.usage + 7 * this.componentCount + 11 * this.offset + 13 * this.stride + 17 * (this.normalize ? 0 : 1) + 19 * this.instanceDivisor;
+ }
+ };
+
+ /**
+ * @return {boolean}
+ */
+ glsDrawTests.DrawTestSpec.AttributeSpec.prototype.valid = function(/*ctxType*/) {
+ /** @type {boolean} */ var inputTypeFloat = this.inputType == glsDrawTests.DrawTestSpec.InputType.FLOAT || this.inputType == glsDrawTests.DrawTestSpec.InputType.HALF;
+ /** @type {boolean} */ var inputTypeUnsignedInteger = this.inputType == glsDrawTests.DrawTestSpec.InputType.UNSIGNED_BYTE || this.inputType == glsDrawTests.DrawTestSpec.InputType.UNSIGNED_SHORT || this.inputType == glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT || this.inputType == glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT_2_10_10_10;
+ /** @type {boolean} */ var inputTypeSignedInteger = this.inputType == glsDrawTests.DrawTestSpec.InputType.BYTE || this.inputType == glsDrawTests.DrawTestSpec.InputType.SHORT || this.inputType == glsDrawTests.DrawTestSpec.InputType.INT || this.inputType == glsDrawTests.DrawTestSpec.InputType.INT_2_10_10_10;
+ /** @type {boolean} */ var inputTypePacked = this.inputType == glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT_2_10_10_10 || this.inputType == glsDrawTests.DrawTestSpec.InputType.INT_2_10_10_10;
+
+ /** @type {boolean} */ var outputTypeFloat = this.outputType == glsDrawTests.DrawTestSpec.OutputType.FLOAT || this.outputType == glsDrawTests.DrawTestSpec.OutputType.VEC2 || this.outputType == glsDrawTests.DrawTestSpec.OutputType.VEC3 || this.outputType == glsDrawTests.DrawTestSpec.OutputType.VEC4;
+ /** @type {boolean} */ var outputTypeSignedInteger = this.outputType == glsDrawTests.DrawTestSpec.OutputType.INT || this.outputType == glsDrawTests.DrawTestSpec.OutputType.IVEC2 || this.outputType == glsDrawTests.DrawTestSpec.OutputType.IVEC3 || this.outputType == glsDrawTests.DrawTestSpec.OutputType.IVEC4;
+ /** @type {boolean} */ var outputTypeUnsignedInteger = this.outputType == glsDrawTests.DrawTestSpec.OutputType.UINT || this.outputType == glsDrawTests.DrawTestSpec.OutputType.UVEC2 || this.outputType == glsDrawTests.DrawTestSpec.OutputType.UVEC3 || this.outputType == glsDrawTests.DrawTestSpec.OutputType.UVEC4;
+
+ if (this.useDefaultAttribute) {
+ if (this.inputType != glsDrawTests.DrawTestSpec.InputType.INT && this.inputType != glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT && this.inputType != glsDrawTests.DrawTestSpec.InputType.FLOAT)
+ return false;
+
+ if (this.inputType != glsDrawTests.DrawTestSpec.InputType.FLOAT && this.componentCount != 4)
+ return false;
+
+ // no casting allowed (undefined results)
+ if (this.inputType == glsDrawTests.DrawTestSpec.InputType.INT && !outputTypeSignedInteger)
+ return false;
+ if (this.inputType == glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT && !outputTypeUnsignedInteger)
+ return false;
+ }
+
+ if (inputTypePacked && this.componentCount != 4)
+ return false;
+
+ // Invalid conversions:
+
+ // float -> [u]int
+ if (inputTypeFloat && !outputTypeFloat)
+ return false;
+
+ // uint -> int (undefined results)
+ if (inputTypeUnsignedInteger && outputTypeSignedInteger)
+ return false;
+
+ // int -> uint (undefined results)
+ if (inputTypeSignedInteger && outputTypeUnsignedInteger)
+ return false;
+
+ // packed -> non-float (packed formats are converted to floats)
+ if (inputTypePacked && !outputTypeFloat)
+ return false;
+
+ // Invalid normalize. Normalize is only valid if output type is float
+ if (this.normalize && !outputTypeFloat)
+ return false;
+
+ return true;
+ };
+
+ /**
+ * @return {boolean}
+ */
+ glsDrawTests.DrawTestSpec.AttributeSpec.prototype.isBufferAligned = function() {
+ var inputTypePacked = this.inputType == glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT_2_10_10_10 || this.inputType == glsDrawTests.DrawTestSpec.InputType.INT_2_10_10_10;
+
+ // Buffer alignment, offset is a multiple of underlying data type size?
+ if (this.storage == glsDrawTests.DrawTestSpec.Storage.BUFFER) {
+ var dataTypeSize = glsDrawTests.DrawTestSpec.inputTypeSize(this.inputType);
+ if (inputTypePacked)
+ dataTypeSize = 4;
+
+ if (this.offset % dataTypeSize != 0)
+ return false;
+ }
+
+ return true;
+ };
+
+ /**
+ * @return {boolean}
+ */
+ glsDrawTests.DrawTestSpec.AttributeSpec.prototype.isBufferStrideAligned = function() {
+ var inputTypePacked = this.inputType == glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT_2_10_10_10 || this.inputType == glsDrawTests.DrawTestSpec.InputType.INT_2_10_10_10;
+
+ // Buffer alignment, offset is a multiple of underlying data type size?
+ if (this.storage == glsDrawTests.DrawTestSpec.Storage.BUFFER) {
+ var dataTypeSize = glsDrawTests.DrawTestSpec.inputTypeSize(this.inputType);
+ if (inputTypePacked)
+ dataTypeSize = 4;
+
+ if (this.stride % dataTypeSize != 0)
+ return false;
+ }
+
+ return true;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {glsDrawTests.DrawTestSpec} spec
+ * @param {string} name
+ * @param {string} desc
+ */
+ glsDrawTests.DrawTest = function(spec, name, desc) {
+ tcuTestCase.DeqpTest.call(this, name, desc, spec);
+
+ /** @type {WebGL2RenderingContext} */ this.m_renderCtx = gl;
+ /** @type {tcuPixelFormat.PixelFormat} */ this.m_pixelformat = new tcuPixelFormat.PixelFormat(
+ /** @type {number} */ (gl.getParameter(gl.RED_BITS)), /** @type {number} */ (gl.getParameter(gl.GREEN_BITS)),
+ /** @type {number} */ (gl.getParameter(gl.BLUE_BITS)), /** @type {number} */ (gl.getParameter(gl.ALPHA_BITS))
+ );
+
+ /** @type {sglrReferenceContext.ReferenceContextBuffers} */ this.m_refBuffers = null;
+ /** @type {sglrReferenceContext.ReferenceContext} */ this.m_refContext = null;
+ /** @type {sglrGLContext.GLContext} */ this.m_glesContext = null;
+
+ /** @type {glsDrawTests.AttributePack} */ this.m_glArrayPack = null;
+ /** @type {glsDrawTests.AttributePack} */ this.m_rrArrayPack = null;
+
+ /** @type {number} */ this.m_maxDiffRed = -1;
+ /** @type {number} */ this.m_maxDiffGreen = -1;
+ /** @type {number} */ this.m_maxDiffBlue = -1;
+
+ /** @type {Array<glsDrawTests.DrawTestSpec>} */ this.m_specs = [];
+ /** @type {Array<string>} */this.m_iteration_descriptions = [];
+ /** @type {number} */ this.m_iteration = 0;
+
+ if (spec)
+ this.addIteration(spec);
+ };
+
+ glsDrawTests.DrawTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ glsDrawTests.DrawTest.prototype.constructor = glsDrawTests.DrawTest;
+
+ /**
+ * @param {glsDrawTests.DrawTestSpec} spec
+ * @param {string=} description
+ */
+ glsDrawTests.DrawTest.prototype.addIteration = function(spec, description) {
+ // Validate spec
+ /** @type {boolean} */ var validSpec = spec.valid();
+
+ if (!validSpec)
+ return;
+
+ this.m_specs.push(spec);
+
+ if (description)
+ this.m_iteration_descriptions.push(description);
+ else
+ this.m_iteration_descriptions.push('');
+ };
+
+ /**
+ * init
+ */
+ glsDrawTests.DrawTest.prototype.init = function() {
+ var renderTargetWidth = Math.min(glsDrawTests.MAX_RENDER_TARGET_SIZE, gl.canvas.width);
+ var renderTargetHeight = Math.min(glsDrawTests.MAX_RENDER_TARGET_SIZE, gl.canvas.height);
+ /** @type {sglrReferenceContext.ReferenceContextLimits} */ var limits = new sglrReferenceContext.ReferenceContextLimits(gl);
+ /** @type {boolean} */ var useVao = true;
+
+ this.m_glesContext = new sglrGLContext.GLContext(gl);
+
+ assertMsgOptions(this.m_specs.length > 0, 'Specs is empty', false, true);
+
+ this.m_refBuffers = new sglrReferenceContext.ReferenceContextBuffers(this.m_pixelformat, 0, 0, renderTargetWidth, renderTargetHeight);
+ this.m_refContext = new sglrReferenceContext.ReferenceContext(limits, this.m_refBuffers.getColorbuffer(), this.m_refBuffers.getDepthbuffer(), this.m_refBuffers.getStencilbuffer());
+
+ this.m_glArrayPack = new glsDrawTests.AttributePack(this.m_glesContext, [renderTargetWidth, renderTargetHeight], useVao, true);
+ this.m_rrArrayPack = new glsDrawTests.AttributePack(this.m_refContext, [renderTargetWidth, renderTargetHeight], useVao, false);
+
+ this.m_maxDiffRed = Math.ceil(256.0 * (15.0 / (1 << this.m_pixelformat.redBits)));
+ this.m_maxDiffGreen = Math.ceil(256.0 * (15.0 / (1 << this.m_pixelformat.greenBits)));
+ this.m_maxDiffBlue = Math.ceil(256.0 * (15.0 / (1 << this.m_pixelformat.blueBits)));
+ };
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ glsDrawTests.DrawTest.prototype.iterate = function() {
+ var specNdx = Math.floor(this.m_iteration / 2);
+ var drawStep = (this.m_iteration % 2) == 0;
+ var compareStep = (this.m_iteration % 2) == 1;
+ /** @type {tcuTestCase.IterateResult} */ var iterateResult = (this.m_iteration + 1 == this.m_specs.length * 2) ? (tcuTestCase.IterateResult.STOP) : (tcuTestCase.IterateResult.CONTINUE);
+ /** @type {glsDrawTests.DrawTestSpec} */ var spec = this.m_specs[specNdx];
+ var updateProgram = (this.m_iteration == 0) || (drawStep && !glsDrawTests.checkSpecsShaderCompatible(this.m_specs[specNdx], this.m_specs[specNdx - 1])); // try to use the same shader in all iterations
+
+ if (drawStep && this.m_specs.length != 1)
+ debug('Iteration ' + specNdx + ' of ' + (this.m_specs.length - 1) + ': ' + this.m_iteration_descriptions[specNdx]);
+
+ this.m_iteration++;
+
+ if (drawStep) {
+ /** @type {glsDrawTests.MethodInfo} */ var methodInfo = glsDrawTests.getMethodInfo(spec.drawMethod);
+ /** @type {boolean} */ var indexed = methodInfo.indexed;
+ /** @type {boolean} */ var instanced = methodInfo.instanced;
+ /** @type {boolean} */ var ranged = methodInfo.ranged;
+ /** @type {boolean} */ var hasFirst = methodInfo.first;
+
+ /** @type {number} */ var primitiveElementCount = glsDrawTests.getElementCount(spec.primitive, spec.primitiveCount); // !< elements to be drawn
+ /** @type {number} */ var indexMin = (ranged) ? (spec.indexMin) : (0);
+ /** @type {number} */ var firstAddition = (hasFirst) ? (spec.first) : (0);
+ /** @type {number} */ var elementCount = primitiveElementCount + indexMin + firstAddition; // !< elements in buffer (buffer should have at least primitiveElementCount ACCESSIBLE (index range, first) elements)
+ /** @type {number} */ var maxElementIndex = primitiveElementCount + indexMin + firstAddition - 1;
+ /** @type {number} */ var indexMax = Math.max(0, (ranged) ? (deMath.clamp(spec.indexMax, 0, maxElementIndex)) : (maxElementIndex));
+ /** @type {number} */ var coordScale = this.getCoordScale(spec);
+ /** @type {number} */ var colorScale = this.getColorScale(spec);
+
+ /** @type {Array<number>} */ var nullAttribValue = [];
+
+ // Log info
+ bufferedLogToConsole(spec.getMultilineDesc());
+
+ // Data
+ this.m_glArrayPack.clearArrays();
+ this.m_rrArrayPack.clearArrays();
+
+ // indices
+ /** @type {number} */ var seed;
+ /** @type {number} */ var indexElementSize;
+ /** @type {number} */ var indexArraySize;
+ /** @type {goog.TypedArray} */ var indexArray;
+ /** @type {goog.TypedArray} */ var indexPointer;
+
+ /** @type {glsDrawTests.AttributeArray}*/ var glArray;
+ /** @type {glsDrawTests.AttributeArray}*/ var rrArray;
+
+ if (indexed) {
+ seed = spec.hash();
+ indexElementSize = glsDrawTests.DrawTestSpec.indexTypeSize(spec.indexType);
+ indexArraySize = spec.indexPointerOffset + indexElementSize * elementCount;
+ indexArray = glsDrawTests.RandomArrayGenerator.generateIndices(seed, elementCount, spec.indexType, spec.indexPointerOffset, indexMin, indexMax);
+ indexPointer = indexArray.subarray(spec.indexPointerOffset);
+
+ glArray = new glsDrawTests.AttributeArray(spec.indexStorage, this.m_glesContext);
+ rrArray = new glsDrawTests.AttributeArray(spec.indexStorage, this.m_refContext);
+
+ glArray.data(glsDrawTests.DrawTestSpec.Target.ELEMENT_ARRAY, indexArraySize, indexArray, glsDrawTests.DrawTestSpec.Usage.STATIC_DRAW);
+ rrArray.data(glsDrawTests.DrawTestSpec.Target.ELEMENT_ARRAY, indexArraySize, indexArray, glsDrawTests.DrawTestSpec.Usage.STATIC_DRAW);
+
+ indexArray = null;
+ }
+
+ // attributes
+ for (var attribNdx = 0; attribNdx < spec.attribs.length; attribNdx++) {
+ /** @type {glsDrawTests.DrawTestSpec.AttributeSpec} */ var attribSpec = spec.attribs[attribNdx];
+ var isPositionAttr = (attribNdx == 0) || (attribSpec.additionalPositionAttribute);
+
+ if (attribSpec.useDefaultAttribute) {
+ seed = 10 * attribSpec.hash() + 100 * spec.hash() + attribNdx;
+ /** @type {Array<number>} */ var attribValue = glsDrawTests.RandomArrayGenerator.generateAttributeValue(seed, attribSpec.inputType);
+
+ // changed USER for BUFFER in JS version
+ this.m_glArrayPack.newArray(glsDrawTests.DrawTestSpec.Storage.BUFFER);
+ this.m_rrArrayPack.newArray(glsDrawTests.DrawTestSpec.Storage.BUFFER);
+
+ this.m_glArrayPack.getArray(attribNdx).setupArray(false, 0, attribSpec.componentCount, attribSpec.inputType, attribSpec.outputType, false, 0, 0, attribValue, isPositionAttr);
+ this.m_rrArrayPack.getArray(attribNdx).setupArray(false, 0, attribSpec.componentCount, attribSpec.inputType, attribSpec.outputType, false, 0, 0, attribValue, isPositionAttr);
+ } else {
+ seed = attribSpec.hash() + 100 * spec.hash() + attribNdx;
+ /** @type {number} */ var elementSize = attribSpec.componentCount * glsDrawTests.DrawTestSpec.inputTypeSize(attribSpec.inputType);
+ /** @type {number} */ var stride = (attribSpec.stride == 0) ? (elementSize) : (attribSpec.stride);
+ /** @type {number} */ var evaluatedElementCount = (instanced && attribSpec.instanceDivisor > 0) ? (spec.instanceCount / attribSpec.instanceDivisor + 1) : (elementCount);
+ /** @type {number} */ var referencedElementCount = (ranged) ? (Math.max(evaluatedElementCount, spec.indexMax + 1)) : (evaluatedElementCount);
+ /** @type {number} */ var bufferSize = attribSpec.offset + stride * (referencedElementCount - 1) + elementSize;
+ /** @type {goog.TypedArray} */ var data = glsDrawTests.RandomArrayGenerator.createArray(
+ seed,
+ referencedElementCount,
+ attribSpec.componentCount,
+ attribSpec.offset,
+ stride,
+ attribSpec.inputType,
+ indexed ? 0 : spec.first,
+ spec.primitive,
+ indexed ? indexPointer : null,
+ indexElementSize
+ );
+
+ this.m_glArrayPack.newArray(attribSpec.storage);
+ this.m_rrArrayPack.newArray(attribSpec.storage);
+
+ this.m_glArrayPack.getArray(attribNdx).data(glsDrawTests.DrawTestSpec.Target.ARRAY, bufferSize, data, attribSpec.usage);
+ this.m_rrArrayPack.getArray(attribNdx).data(glsDrawTests.DrawTestSpec.Target.ARRAY, bufferSize, data, attribSpec.usage);
+
+ this.m_glArrayPack.getArray(attribNdx).setupArray(true, attribSpec.offset, attribSpec.componentCount, attribSpec.inputType, attribSpec.outputType, attribSpec.normalize, attribSpec.stride, attribSpec.instanceDivisor, nullAttribValue, isPositionAttr);
+ this.m_rrArrayPack.getArray(attribNdx).setupArray(true, attribSpec.offset, attribSpec.componentCount, attribSpec.inputType, attribSpec.outputType, attribSpec.normalize, attribSpec.stride, attribSpec.instanceDivisor, nullAttribValue, isPositionAttr);
+
+ data = null;
+ }
+ }
+
+ // Shader program
+ if (updateProgram) {
+ this.m_glArrayPack.updateProgram();
+ this.m_rrArrayPack.updateProgram();
+ }
+
+ /** @type {glsDrawTests.DrawTestSpec.CompatibilityTestType} */ var ctype;
+
+ // Draw
+ try {
+ // indices
+ if (indexed) {
+ this.m_glArrayPack.render(spec.primitive, spec.drawMethod, 0, primitiveElementCount, spec.indexType, spec.indexPointerOffset, spec.indexMin, spec.indexMax, spec.instanceCount, coordScale, colorScale, glArray);
+ this.m_rrArrayPack.render(spec.primitive, spec.drawMethod, 0, primitiveElementCount, spec.indexType, spec.indexPointerOffset, spec.indexMin, spec.indexMax, spec.instanceCount, coordScale, colorScale, rrArray);
+ } else {
+ this.m_glArrayPack.render(spec.primitive, spec.drawMethod, spec.first, primitiveElementCount, null, 0, 0, 0, spec.instanceCount, coordScale, colorScale, null);
+ this.m_rrArrayPack.render(spec.primitive, spec.drawMethod, spec.first, primitiveElementCount, null, 0, 0, 0, spec.instanceCount, coordScale, colorScale, null);
+ }
+ } catch (err) {
+ if (err instanceof wtu.GLErrorException) {
+ // GL Errors are ok if the mode is not properly aligned
+ ctype = spec.isCompatibilityTest();
+
+ bufferedLogToConsole('Got error: ' + err.message);
+
+ if (ctype == glsDrawTests.DrawTestSpec.CompatibilityTestType.UNALIGNED_OFFSET)
+ checkMessage(false, 'Failed to draw with unaligned buffers.');
+ else if (ctype == glsDrawTests.DrawTestSpec.CompatibilityTestType.UNALIGNED_STRIDE)
+ checkMessage(false, 'Failed to draw with unaligned stride.');
+ else
+ throw err;
+ }
+ }
+ } else if (compareStep) {
+ if (!this.compare(spec.primitive)) {
+ ctype = spec.isCompatibilityTest();
+
+ if (ctype == glsDrawTests.DrawTestSpec.CompatibilityTestType.UNALIGNED_OFFSET)
+ checkMessage(false, 'Failed to draw with unaligned buffers.');
+ else if (ctype == glsDrawTests.DrawTestSpec.CompatibilityTestType.UNALIGNED_STRIDE)
+ checkMessage(false, 'Failed to draw with unaligned stride.');
+ else
+ testFailedOptions('Image comparison failed.', false);
+ return iterateResult;
+ }
+ } else {
+ testFailedOptions('Image comparison failed.', false);
+ return tcuTestCase.IterateResult.STOP;
+ }
+
+ if (iterateResult == tcuTestCase.IterateResult.STOP)
+ testPassed('');
+
+ return iterateResult;
+ };
+
+ /**
+ * @enum {number} PrimitiveClass
+ */
+ glsDrawTests.PrimitiveClass = {
+ POINT: 0,
+ LINE: 1,
+ TRIANGLE: 2
+ };
+
+ /**
+ * @param {?glsDrawTests.DrawTestSpec.Primitive} primitiveType
+ * @return {glsDrawTests.PrimitiveClass}
+ */
+ glsDrawTests.getDrawPrimitiveClass = function(primitiveType) {
+ switch (primitiveType) {
+ case glsDrawTests.DrawTestSpec.Primitive.POINTS:
+ return glsDrawTests.PrimitiveClass.POINT;
+
+ case glsDrawTests.DrawTestSpec.Primitive.LINES:
+ case glsDrawTests.DrawTestSpec.Primitive.LINE_STRIP:
+ case glsDrawTests.DrawTestSpec.Primitive.LINE_LOOP:
+ return glsDrawTests.PrimitiveClass.LINE;
+
+ case glsDrawTests.DrawTestSpec.Primitive.TRIANGLES:
+ case glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_FAN:
+ case glsDrawTests.DrawTestSpec.Primitive.TRIANGLE_STRIP:
+ return glsDrawTests.PrimitiveClass.TRIANGLE;
+
+ default:
+ throw new Error('Invalid primitive type');
+ }
+ };
+
+ /**
+ * @param {number} c1
+ * @param {number} c2
+ * @param {Array<number>} threshold
+ * @return {boolean}
+ */
+ glsDrawTests.compareUintRGB8 = function(c1, c2, threshold) {
+ return (Math.abs(((c1 >> 16) & 0xff) - ((c2 >> 16) & 0xff)) <= threshold[0] && // Red
+ Math.abs(((c1 >> 8) & 0xff) - ((c2 >> 8) & 0xff)) <= threshold[1] && // Green
+ Math.abs((c1 & 0xff) - (c2 & 0xff)) <= threshold[2]); // Blue
+ };
+
+ /**
+ * @param {number} c1
+ * @param {number} c2
+ * @param {number} c3
+ * @param {number} renderTargetDifference
+ * @return {boolean}
+ */
+ glsDrawTests.isEdgeTripletComponent = function(c1, c2, c3, renderTargetDifference) {
+ /** @type {number} */ var roundingDifference = 2 * renderTargetDifference; // src and dst pixels rounded to different directions
+ /** @type {number} */ var d1 = c2 - c1;
+ /** @type {number} */ var d2 = c3 - c2;
+ /** @type {number} */ var rampDiff = Math.abs(d2 - d1);
+
+ return rampDiff > roundingDifference;
+ };
+
+ /**
+ * @param {tcuRGBA.RGBA} c1
+ * @param {tcuRGBA.RGBA} c2
+ * @param {tcuRGBA.RGBA} c3
+ * @param {Array<number>} renderTargetThreshold
+ * @return {boolean}
+ */
+ glsDrawTests.isEdgeTriplet = function(c1, c2, c3, renderTargetThreshold) {
+ // black (background color) and non-black is always an edge
+ /** @type {boolean} */ var b1 = c1 == 0x000000;
+ /** @type {boolean} */ var b2 = c2 == 0x000000;
+ /** @type {boolean} */ var b3 = c3 == 0x000000;
+
+ // both pixels with coverage and pixels without coverage
+ if ((b1 && b2 && b3) == false && (b1 || b2 || b3) == true)
+ return true;
+ // all black
+ if (b1 && b2 && b3)
+ return false;
+ // all with coverage
+ assertMsgOptions(!b1 && !b2 && !b3, 'All colors with coverage', false, true);
+
+ // Color is always linearly interpolated => component values change nearly linearly
+ // in any constant direction on triangle hull. (df/dx ~= C).
+
+ // Edge detection (this function) is run against the reference image
+ // => no dithering to worry about
+
+ return glsDrawTests.isEdgeTripletComponent((c1 >> 16) && 0xff, (c2 >> 16) && 0xff, (c3 >> 16) && 0xff, renderTargetThreshold[0]) ||
+ glsDrawTests.isEdgeTripletComponent((c1 >> 8) && 0xff, (c2 >> 8) && 0xff, (c3 >> 8) && 0xff, renderTargetThreshold[1]) ||
+ glsDrawTests.isEdgeTripletComponent(c1 && 0xff, c2 && 0xff, c3 && 0xff, renderTargetThreshold[2]);
+ };
+
+ /**
+ * @param {number} x
+ * @param {number} y
+ * @param {tcuSurface.Surface} ref
+ * @param {Array<number>} renderTargetThreshold
+ * @return {boolean}
+ */
+ glsDrawTests.pixelNearEdge = function(x, y, ref, renderTargetThreshold) {
+ // should not be called for edge pixels
+ assertMsgOptions(x >= 1 && x <= ref.getWidth() - 2, 'The pixel was on the edge', false, true);
+ assertMsgOptions(y >= 1 && y <= ref.getHeight() - 2, 'The pixel was on the edge', false, true);
+
+ // horizontal
+
+ /** @type {number} */ var c1;
+ /** @type {number} */ var c2;
+ /** @type {number} */ var c3;
+
+ for (var dy = -1; dy < 2; ++dy) {
+ c1 = ref.getPixelUintRGB8(x - 1, y + dy);
+ c2 = ref.getPixelUintRGB8(x, y + dy);
+ c3 = ref.getPixelUintRGB8(x + 1, y + dy);
+ if (glsDrawTests.isEdgeTriplet(c1, c2, c3, renderTargetThreshold))
+ return true;
+ }
+
+ // vertical
+
+ for (var dx = -1; dx < 2; ++dx) {
+ c1 = ref.getPixelUintRGB8(x + dx, y - 1);
+ c2 = ref.getPixelUintRGB8(x + dx, y);
+ c3 = ref.getPixelUintRGB8(x + dx, y + 1);
+ if (glsDrawTests.isEdgeTriplet(c1, c2, c3, renderTargetThreshold))
+ return true;
+ }
+
+ return false;
+ };
+
+ /**
+ * @param {number} c
+ * @return {number}
+ */
+ glsDrawTests.getVisualizationGrayscaleColorUintRGB8 = function(c) {
+ // make triangle coverage and error pixels obvious by converting coverage to grayscale
+ if (c == 0x000000)
+ return 0;
+ else
+ return 50 + Math.floor((((c >> 16) & 0xff) + ((c >> 8) & 0xff) + (c & 0xff)) / 8);
+ };
+
+ /**
+ * @param {number} x
+ * @param {number} y
+ * @param {tcuSurface.Surface} target
+ * @return {boolean}
+ */
+ glsDrawTests.pixelNearLineIntersection = function(x, y, target) {
+ // should not be called for edge pixels
+ assertMsgOptions(x >= 1 && x <= target.getWidth() - 2, 'Pixel is in the edge', false, true);
+ assertMsgOptions(y >= 1 && y <= target.getHeight() - 2, 'Pixel is in the edge', false, true);
+
+ var coveredPixels = 0;
+
+ for (var dy = -1; dy < 2; dy++)
+ for (var dx = -1; dx < 2; dx++) {
+ var targetCoverage = target.getPixelUintRGB8(x + dx, y + dy);
+ if (targetCoverage) {
+ ++coveredPixels;
+
+ // A single thin line cannot have more than 3 covered pixels in a 3x3 area
+ if (coveredPixels >= 4)
+ return true;
+ }
+ }
+
+ return false;
+ };
+
+ // search 3x3 are for matching color
+ /**
+ * @param {tcuSurface.Surface} target
+ * @param {number} x
+ * @param {number} y
+ * @param {tcuRGBA.RGBA} color
+ * @param {Array<number>} compareThreshold
+ * @return {boolean}
+ */
+ glsDrawTests.pixelNeighborhoodContainsColor = function(target, x, y, color, compareThreshold) {
+ // should not be called for edge pixels
+ assertMsgOptions(x >= 1 && x <= target.getWidth() - 2, 'Pixel is in the edge', false, true);
+ assertMsgOptions(y >= 1 && y <= target.getHeight() - 2, 'Pixel is in the edge', false, true);
+
+ for (var dy = -1; dy < 2; dy++)
+ for (var dx = -1; dx < 2; dx++) {
+ if (glsDrawTests.compareUintRGB8(color, target.getPixelUintRGB8(x + dx, y + dy), compareThreshold))
+ return true;
+ }
+
+ return false;
+ };
+
+ // search 3x3 are for matching coverage (coverage == (color != background color))
+ /**
+ * @param {tcuSurface.Surface} target
+ * @param {number} x
+ * @param {number} y
+ * @param {boolean} coverage
+ * @return {boolean}
+ */
+ glsDrawTests.pixelNeighborhoodContainsCoverage = function(target, x, y, coverage) {
+ // should not be called for edge pixels
+ assertMsgOptions(x >= 1 && x <= target.getWidth() - 2, 'Pixel is in the edge', false, true);
+ assertMsgOptions(y >= 1 && y <= target.getHeight() - 2, 'Pixel is in the edge', false, true);
+
+ for (var dy = -1; dy < 2; dy++)
+ for (var dx = -1; dx < 2; dx++) {
+ var targetCmpCoverage = target.getPixelUintRGB8(x + dx, y + dy) != 0x000000; // Pixel is not black
+ if (targetCmpCoverage == coverage)
+ return true;
+ }
+
+ return false;
+ };
+
+ /**
+ * @param {string} imageSetName
+ * @param {string} imageSetDesc
+ * @param {tcuSurface.Surface} reference
+ * @param {tcuSurface.Surface} result
+ * @param {Array<number>} compareThreshold
+ * @param {Array<number>} renderTargetThreshold
+ * @param {number} maxAllowedInvalidPixels
+ * @return {boolean}
+ */
+ glsDrawTests.edgeRelaxedImageCompare = function(imageSetName, imageSetDesc, reference, result, compareThreshold, renderTargetThreshold, maxAllowedInvalidPixels) {
+ assertMsgOptions(result.getWidth() == reference.getWidth() && result.getHeight() == reference.getHeight(), 'Reference and result images have different dimensions', false, true);
+
+ /** @type {Array<number>} */ var green = [0, 255, 0, 255];
+ /** @type {Array<number>} */ var errorColor = [255, 0, 0, 255];
+ /** @type {number} */ var width = reference.getWidth();
+ /** @type {number} */ var height = reference.getHeight();
+ /** @type {tcuSurface.Surface} */ var errorMask = new tcuSurface.Surface(width, height);
+ /** @type {number} */ var numFailingPixels = 0;
+
+ // clear errormask edges which would otherwise be transparent
+
+ tcuTextureUtil.getSubregion(errorMask.getAccess(), 0, 0, 0, width, 1, 1).clear(green);
+ tcuTextureUtil.getSubregion(errorMask.getAccess(), 0, height - 1, 0, width, 1, 1).clear(green);
+ tcuTextureUtil.getSubregion(errorMask.getAccess(), 0, 0, 0, 1, height, 1).clear(green);
+ tcuTextureUtil.getSubregion(errorMask.getAccess(), width - 1, 0, 0, 1, height, 1).clear(green);
+
+ // skip edge pixels since coverage on edge cannot be verified
+
+ for (var y = 1; y < height - 1; ++y)
+ for (var x = 1; x < width - 1; ++x) {
+ /** @type {number} */ var refPixel = reference.getPixelUintRGB8(x, y);
+ /** @type {number} */ var screenPixel = result.getPixelUintRGB8(x, y);
+ /** @type {boolean} */ var isOkReferencePixel = glsDrawTests.pixelNeighborhoodContainsColor(result, x, y, refPixel, compareThreshold); // screen image has a matching pixel nearby (~= If something is drawn on reference, it must be drawn to screen too.)
+ /** @type {boolean} */ var isOkScreenPixel = glsDrawTests.pixelNeighborhoodContainsColor(reference, x, y, screenPixel, compareThreshold); // reference image has a matching pixel nearby (~= If something is drawn on screen, it must be drawn to reference too.)
+
+ if (isOkScreenPixel && isOkReferencePixel) {
+ // pixel valid, write greenish pixels to make the result image easier to read
+ /** @type {number} */ var grayscaleValue = glsDrawTests.getVisualizationGrayscaleColorUintRGB8(screenPixel);
+ errorMask.getAccess().setPixel([grayscaleValue / 255, 1, grayscaleValue / 255, 1], x, y);
+ } else if (!glsDrawTests.pixelNearEdge(x, y, reference, renderTargetThreshold)) {
+ // non-edge pixel values must be within threshold of the reference values
+ errorMask.getAccess().setPixel(deMath.scale(errorColor, 1 / 255), x, y);
+ ++numFailingPixels;
+ } else {
+ // we are on/near an edge, verify only coverage (coverage == not background colored)
+ /** @type {boolean} */ var referenceCoverage = refPixel != 0x000000; // Not black
+ /** @type {boolean} */ var screenCoverage = screenPixel != 0x000000; // Not black
+ /** @type {boolean} */ var isOkReferenceCoverage = glsDrawTests.pixelNeighborhoodContainsCoverage(result, x, y, referenceCoverage); // Check reference pixel against screen pixel
+ /** @type {boolean} */ var isOkScreenCoverage = glsDrawTests.pixelNeighborhoodContainsCoverage(reference, x, y, screenCoverage); // Check screen pixels against reference pixel
+
+ if (isOkScreenCoverage && isOkReferenceCoverage) {
+ // pixel valid, write greenish pixels to make the result image easier to read
+ var grayscaleValue = glsDrawTests.getVisualizationGrayscaleColorUintRGB8(screenPixel);
+ errorMask.getAccess().setPixel([grayscaleValue / 255, 1, grayscaleValue / 255, 1], x, y);
+ } else {
+ // coverage does not match
+ errorMask.getAccess().setPixel(deMath.scale(errorColor, 1 / 255), x, y);
+ ++numFailingPixels;
+ }
+ }
+ }
+
+ bufferedLogToConsole(
+ 'Comparing images:</br>' +
+ '<span> </span>allowed deviation in pixel positions = 1</br>' +
+ '<span> </span>number of allowed invalid pixels = ' + maxAllowedInvalidPixels + '</br>' +
+ '<span> </span>number of invalid pixels = ' + numFailingPixels
+ );
+
+ if (numFailingPixels > maxAllowedInvalidPixels) {
+ debug('Image comparison failed. Color threshold = (' + compareThreshold[0] + ', ' + compareThreshold[1] + ', ' + compareThreshold[2] + ')');
+ tcuImageCompare.displayImages(result.getAccess(), reference.getAccess(), errorMask.getAccess());
+
+ return false;
+ } else {
+ return true;
+ }
+ };
+
+ /**
+ * @param {string} imageSetName
+ * @param {string} imageSetDesc
+ * @param {tcuSurface.Surface} reference
+ * @param {tcuSurface.Surface} result
+ * @param {Array<number>} compareThreshold
+ * @param {number} maxAllowedInvalidPixels
+ * @return {boolean}
+ */
+ glsDrawTests.intersectionRelaxedLineImageCompare = function(imageSetName, imageSetDesc, reference, result, compareThreshold, maxAllowedInvalidPixels) {
+ assertMsgOptions(result.getWidth() == reference.getWidth() && result.getHeight() == reference.getHeight(), 'Reference and result images have different dimensions', false, true);
+
+ /** @type {Array<number>} */ var green = [0, 255, 0, 255];
+ /** @type {Array<number>} */ var errorColor = [255, 0, 0, 255];
+ var width = reference.getWidth();
+ var height = reference.getHeight();
+ /** @type {tcuSurface.Surface} */ var errorMask = new tcuSurface.Surface(width, height);
+ /** @type {number} */ var numFailingPixels = 0;
+
+ // clear errormask edges which would otherwise be transparent
+
+ tcuTextureUtil.getSubregion(errorMask.getAccess(), 0, 0, 0, width, 1, 1).clear(green);
+ tcuTextureUtil.getSubregion(errorMask.getAccess(), 0, height - 1, 0, width, 1, 1).clear(green);
+ tcuTextureUtil.getSubregion(errorMask.getAccess(), 0, 0, 0, 1, height, 1).clear(green);
+ tcuTextureUtil.getSubregion(errorMask.getAccess(), width - 1, 0, 0, 1, height, 1).clear(green);
+
+ // skip edge pixels since coverage on edge cannot be verified
+
+ for (var y = 1; y < height - 1; ++y)
+ for (var x = 1; x < width - 1; ++x) {
+ /** @type {number} */ var refPixel = reference.getPixelUintRGB8(x, y);
+ /** @type {number} */ var screenPixel = result.getPixelUintRGB8(x, y);
+ /** @type {boolean} */ var isOkScreenPixel = glsDrawTests.pixelNeighborhoodContainsColor(reference, x, y, screenPixel, compareThreshold); // reference image has a matching pixel nearby (~= If something is drawn on screen, it must be drawn to reference too.)
+ /** @type {boolean} */ var isOkReferencePixel = glsDrawTests.pixelNeighborhoodContainsColor(result, x, y, refPixel, compareThreshold); // screen image has a matching pixel nearby (~= If something is drawn on reference, it must be drawn to screen too.)
+
+ /** @type {number} */ var grayscaleValue;
+
+ if (isOkScreenPixel && isOkReferencePixel) {
+ // pixel valid, write greenish pixels to make the result image easier to read
+ grayscaleValue = glsDrawTests.getVisualizationGrayscaleColorUintRGB8(screenPixel);
+ errorMask.getAccess().setPixel([grayscaleValue / 255, 1, grayscaleValue / 255, 1], x, y);
+ } else if (!glsDrawTests.pixelNearLineIntersection(x, y, reference) &&
+ !glsDrawTests.pixelNearLineIntersection(x, y, result)) {
+ // non-intersection pixel values must be within threshold of the reference values
+ errorMask.getAccess().setPixel(deMath.scale(errorColor, 1 / 255), x, y);
+ ++numFailingPixels;
+ } else {
+ // pixel is near a line intersection
+ // we are on/near an edge, verify only coverage (coverage == not background colored)
+ /** @type {boolean} */ var referenceCoverage = refPixel != 0x000000; // Not Black
+ /** @type {boolean} */ var screenCoverage = screenPixel != 0x000000; // Not Black
+ /** @type {boolean} */ var isOkScreenCoverage = glsDrawTests.pixelNeighborhoodContainsCoverage(reference, x, y, screenCoverage); // Check screen pixels against reference pixel
+ /** @type {boolean} */ var isOkReferenceCoverage = glsDrawTests.pixelNeighborhoodContainsCoverage(result, x, y, referenceCoverage); // Check reference pixel against screen pixel
+
+ if (isOkScreenCoverage && isOkReferenceCoverage) {
+ // pixel valid, write greenish pixels to make the result image easier to read
+ grayscaleValue = glsDrawTests.getVisualizationGrayscaleColorUintRGB8(screenPixel);
+ errorMask.getAccess().setPixel([grayscaleValue / 255, 1, grayscaleValue / 255, 1], x, y);
+ } else {
+ // coverage does not match
+ errorMask.getAccess().setPixel(deMath.scale(errorColor, 1 / 255), x, y);
+ ++numFailingPixels;
+ }
+ }
+ }
+
+ bufferedLogToConsole(
+ 'Comparing images:</br>' +
+ '<span> </span>allowed deviation in pixel positions = 1</br>' +
+ '<span> </span>number of allowed invalid pixels = ' + maxAllowedInvalidPixels + '</br>' +
+ '<span> </span>number of invalid pixels = ' + numFailingPixels
+ );
+
+ if (numFailingPixels > maxAllowedInvalidPixels) {
+ debug('Image comparison failed. Color threshold = (' + compareThreshold[0] + ', ' + compareThreshold[1] + ', ' + compareThreshold[2] + ')');
+ tcuImageCompare.displayImages(result.getAccess(), reference.getAccess(), errorMask.getAccess());
+
+ return false;
+ } else {
+ return true;
+ }
+ };
+
+ /**
+ * @param {?glsDrawTests.DrawTestSpec.Primitive} primitiveType
+ * @return {boolean}
+ */
+ glsDrawTests.DrawTest.prototype.compare = function(primitiveType) {
+ /** @type {tcuSurface.Surface} */ var ref = this.m_rrArrayPack.getSurface();
+ /** @type {tcuSurface.Surface} */ var screen = this.m_glArrayPack.getSurface();
+
+ if (/** @type {number} */ (gl.getParameter(gl.SAMPLES)) > 1) {
+ // \todo [mika] Improve compare when using multisampling
+ bufferedLogToConsole('Warning: Comparision of result from multisample render targets are not as strict as without multisampling. Might produce false positives!');
+ return tcuImageCompare.fuzzyCompare('Compare Results', 'Compare Results', ref.getAccess(), screen.getAccess(), 0.3, tcuImageCompare.CompareLogMode.RESULT);
+ } else {
+ /** @type {glsDrawTests.PrimitiveClass} */ var primitiveClass = glsDrawTests.getDrawPrimitiveClass(primitiveType);
+
+ switch (primitiveClass) {
+ case glsDrawTests.PrimitiveClass.POINT: {
+ // Point are extremely unlikely to have overlapping regions, don't allow any no extra / missing pixels
+ /**@type {number} */ var maxAllowedInvalidPixelsWithPoints = 0;
+ return tcuImageCompare.intThresholdPositionDeviationErrorThresholdCompare(
+ 'CompareResult',
+ 'Result of rendering',
+ ref.getAccess(),
+ screen.getAccess(),
+ [this.m_maxDiffRed, this.m_maxDiffGreen, this.m_maxDiffBlue, 256],
+ [1, 1, 0], //!< 3x3 search kernel
+ true, //!< relax comparison on the image boundary
+ maxAllowedInvalidPixelsWithPoints //!< error threshold
+ );
+ }
+
+ case glsDrawTests.PrimitiveClass.LINE: {
+ // Lines can potentially have a large number of overlapping pixels. Pixel comparison may potentially produce
+ // false negatives in such pixels if for example the pixel in question is overdrawn by another line in the
+ // reference image but not in the resultin image. Relax comparison near line intersection points (areas) and
+ // compare only coverage, not color, in such pixels
+ /**@type {number} */ var maxAllowedInvalidPixelsWithLines = 15; // line are allowed to have a few bad pixels
+ return glsDrawTests.intersectionRelaxedLineImageCompare(
+ 'CompareResult',
+ 'Result of rendering',
+ ref,
+ screen,
+ [this.m_maxDiffRed, this.m_maxDiffGreen, this.m_maxDiffBlue],
+ maxAllowedInvalidPixelsWithLines
+ );
+ }
+
+ case glsDrawTests.PrimitiveClass.TRIANGLE: {
+ // Triangles are likely to partially or fully overlap. Pixel difference comparison is fragile in pixels
+ // where there could be potential overlapping since the pixels might be covered by one triangle in the
+ // reference image and by the other in the result image. Relax comparsion near primitive edges and
+ // compare only coverage, not color, in such pixels.
+ /** @type {number} */ var maxAllowedInvalidPixelsWithTriangles = 10;
+
+ /* TODO: Implement
+ var renderTargetThreshold = //TODO: get color threshold from the pixel format --> m_renderCtx.getRenderTarget().getPixelFormat().getColorThreshold().toIVec().xyz();
+ */
+
+ /** @type {Array<number>} */ var renderTargetThreshold = [3, 3, 3, 3];
+
+ return glsDrawTests.edgeRelaxedImageCompare(
+ 'CompareResult',
+ 'Result of rendering',
+ ref,
+ screen,
+ [this.m_maxDiffRed, this.m_maxDiffGreen, this.m_maxDiffBlue],
+ renderTargetThreshold,
+ maxAllowedInvalidPixelsWithTriangles
+ );
+ }
+
+ default:
+ throw new Error('Invalid primitive class');
+ }
+ }
+ };
+
+ /**
+ * @param {glsDrawTests.DrawTestSpec} spec
+ * @return {number}
+ */
+ glsDrawTests.DrawTest.prototype.getCoordScale = function(spec) {
+ var maxValue = 1.0;
+
+ for (var arrayNdx = 0; arrayNdx < spec.attribs.length; arrayNdx++) {
+ /** @type {glsDrawTests.DrawTestSpec.AttributeSpec} */ var attribSpec = spec.attribs[arrayNdx];
+ /** @type {boolean} */ var isPositionAttr = (arrayNdx == 0) || (attribSpec.additionalPositionAttribute);
+ /** @type {number} */ var attrMaxValue = 0;
+
+ if (!isPositionAttr)
+ continue;
+
+ if (attribSpec.inputType == glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT_2_10_10_10) {
+ if (attribSpec.normalize)
+ attrMaxValue += 1.0;
+ else
+ attrMaxValue += 1024.0;
+ } else if (attribSpec.inputType == glsDrawTests.DrawTestSpec.InputType.INT_2_10_10_10) {
+ if (attribSpec.normalize)
+ attrMaxValue += 1.0;
+ else
+ attrMaxValue += 512.0;
+ } else {
+ var max = glsDrawTests.GLValue.getMaxValue(attribSpec.inputType).getValue();
+
+ attrMaxValue += (attribSpec.normalize && !glsDrawTests.inputTypeIsFloatType(attribSpec.inputType)) ? (1.0) : (max * 1.1);
+ }
+
+ if (attribSpec.outputType == glsDrawTests.DrawTestSpec.OutputType.VEC3 || attribSpec.outputType == glsDrawTests.DrawTestSpec.OutputType.VEC4 ||
+ attribSpec.outputType == glsDrawTests.DrawTestSpec.OutputType.IVEC3 || attribSpec.outputType == glsDrawTests.DrawTestSpec.OutputType.IVEC4 ||
+ attribSpec.outputType == glsDrawTests.DrawTestSpec.OutputType.UVEC3 || attribSpec.outputType == glsDrawTests.DrawTestSpec.OutputType.UVEC4)
+ attrMaxValue *= 2;
+
+ maxValue += attrMaxValue;
+ }
+
+ return 1.0 / maxValue;
+ };
+
+ /**
+ * @param {glsDrawTests.DrawTestSpec} spec
+ * @return {number}
+ */
+ glsDrawTests.DrawTest.prototype.getColorScale = function(spec) {
+ var colorScale = 1.0;
+
+ for (var arrayNdx = 1; arrayNdx < spec.attribs.length; arrayNdx++) {
+ /** @type {glsDrawTests.DrawTestSpec.AttributeSpec} */ var attribSpec = spec.attribs[arrayNdx];
+ /** @type {boolean} */ var isPositionAttr = (arrayNdx == 0) || (attribSpec.additionalPositionAttribute);
+
+ if (isPositionAttr)
+ continue;
+
+ if (attribSpec.inputType == glsDrawTests.DrawTestSpec.InputType.UNSIGNED_INT_2_10_10_10) {
+ if (!attribSpec.normalize)
+ colorScale *= 1.0 / 1024.0;
+ } else if (attribSpec.inputType == glsDrawTests.DrawTestSpec.InputType.INT_2_10_10_10) {
+ if (!attribSpec.normalize)
+ colorScale *= 1.0 / 512.0;
+ } else {
+ var max = glsDrawTests.GLValue.getMaxValue(attribSpec.inputType).toFloat();
+
+ colorScale *= (attribSpec.normalize && !glsDrawTests.inputTypeIsFloatType(attribSpec.inputType) ? 1.0 : (1.0 / max));
+ if (attribSpec.outputType == glsDrawTests.DrawTestSpec.OutputType.VEC4 ||
+ attribSpec.outputType == glsDrawTests.DrawTestSpec.OutputType.UVEC4 ||
+ attribSpec.outputType == glsDrawTests.DrawTestSpec.OutputType.IVEC4)
+ colorScale *= (attribSpec.normalize && !glsDrawTests.inputTypeIsFloatType(attribSpec.inputType) ? 1.0 : 1.0 / max);
+ }
+ }
+
+ return colorScale;
+ };
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsFboCompletenessTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsFboCompletenessTests.js
new file mode 100644
index 0000000000..c0f59c2092
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsFboCompletenessTests.js
@@ -0,0 +1,961 @@
+'use strict';
+goog.provide('modules.shared.glsFboCompletenessTests');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.opengl.gluObjectWrapper');
+goog.require('framework.opengl.gluStrUtil');
+goog.require('modules.shared.glsFboUtil');
+
+goog.scope(function() {
+
+ var glsFboCompletenessTests = modules.shared.glsFboCompletenessTests;
+ var glsFboUtil = modules.shared.glsFboUtil;
+ var gluObjectWrapper = framework.opengl.gluObjectWrapper;
+ var gluStrUtil = framework.opengl.gluStrUtil;
+ var tcuTestCase = framework.common.tcuTestCase;
+
+ /**
+ * @param {WebGL2RenderingContext} gl
+ */
+ glsFboCompletenessTests.initGlDependents = function(gl) {
+ if (!(gl = gl || window.gl)) throw new Error('Invalid gl object');
+
+ // The following extensions are applicable both to ES2 and ES3.
+ /**
+ * OES_depth_texture
+ * @type {Array<number>}
+ */
+ glsFboCompletenessTests.s_oesDepthTextureFormats = [
+ glsFboUtil.formatkey(gl.DEPTH_COMPONENT, gl.UNSIGNED_SHORT),
+ glsFboUtil.formatkey(gl.DEPTH_COMPONENT, gl.UNSIGNED_INT)
+ ];
+
+ /**
+ * OES_packed_depth_stencil
+ * @type {Array<number>}
+ */
+ glsFboCompletenessTests.s_oesPackedDepthStencilSizedFormats = [
+ gl.DEPTH24_STENCIL8
+ ];
+
+ /**
+ * s_oesPackedDepthStencilTexFormats
+ * @type {Array<number>}
+ */
+ glsFboCompletenessTests.s_oesPackedDepthStencilTexFormats = [
+ glsFboUtil.formatkey(gl.DEPTH_STENCIL, gl.UNSIGNED_INT_24_8)
+ ];
+
+ /**
+ * OES_required_internalformat
+ * @type {Array<number>}
+ */
+ glsFboCompletenessTests.s_oesRequiredInternalFormatColorFormats = [
+ // Same as ES2 RBO formats, plus RGBA8 (even without OES_rgb8_rgba8)
+ gl.RGB5_A1, gl.RGBA8, gl.RGBA4, gl.RGB565
+ ];
+
+ /**
+ * s_oesRequiredInternalFormatDepthFormats
+ * @type {Array<number>}
+ */
+ glsFboCompletenessTests.s_oesRequiredInternalFormatDepthFormats = [
+ gl.DEPTH_COMPONENT16
+ ];
+
+ /**
+ * EXT_color_buffer_half_float
+ * @type {Array<number>}
+ */
+ glsFboCompletenessTests.s_extColorBufferHalfFloatFormats = [
+ gl.RGBA16F, gl.RGB16F, gl.RG16F, gl.R16F
+ ];
+
+ /**
+ * s_oesDepth24SizedFormats
+ * @type {Array<number>}
+ */
+ glsFboCompletenessTests.s_oesDepth24SizedFormats = [
+ gl.DEPTH_COMPONENT24
+ ];
+
+ /**
+ * s_oesDepth32SizedFormats
+ * @type {Array<number>}
+ */
+ glsFboCompletenessTests.s_oesDepth32SizedFormats = [
+ gl['DEPTH_COMPONENT32']
+ ];
+
+ /**
+ * s_oesRgb8Rgba8RboFormats
+ * @type {Array<number>}
+ */
+ glsFboCompletenessTests.s_oesRgb8Rgba8RboFormats = [
+ gl.RGB8, gl.RGBA8
+ ];
+
+ /**
+ * s_oesRequiredInternalFormatRgb8ColorFormat
+ * @type {Array<number>}
+ */
+ glsFboCompletenessTests.s_oesRequiredInternalFormatRgb8ColorFormat = [
+ gl.RGB8
+ ];
+
+ /**
+ * s_extTextureType2101010RevFormats
+ * @type {Array<number>}
+ */
+ glsFboCompletenessTests.s_extTextureType2101010RevFormats = [
+ glsFboUtil.formatkey(gl.RGBA, gl.UNSIGNED_INT_2_10_10_10_REV),
+ glsFboUtil.formatkey(gl.RGB, gl.UNSIGNED_INT_2_10_10_10_REV)
+ ];
+
+ /**
+ * s_oesRequiredInternalFormat10bitColorFormats
+ * @type {Array<number>}
+ */
+ glsFboCompletenessTests.s_oesRequiredInternalFormat10bitColorFormats = [
+ gl.RGB10_A2, gl['RGB10']
+ ];
+
+ /**
+ * s_extTextureRgRboFormats
+ * @type {Array<number>}
+ */
+ glsFboCompletenessTests.s_extTextureRgRboFormats = [
+ gl.R8, gl.RG8
+ ];
+
+ /**
+ * s_extTextureRgTexFormats
+ * @type {Array<number>}
+ */
+ glsFboCompletenessTests.s_extTextureRgTexFormats = [
+ glsFboUtil.formatkey(gl.RED, gl.UNSIGNED_BYTE),
+ glsFboUtil.formatkey(gl.RG, gl.UNSIGNED_BYTE)
+ ];
+
+ /**
+ * s_extTextureRgFloatTexFormats
+ * @type {Array<number>}
+ */
+ glsFboCompletenessTests.s_extTextureRgFloatTexFormats = [
+ glsFboUtil.formatkey(gl.RED, gl.FLOAT),
+ glsFboUtil.formatkey(gl.RG, gl.FLOAT)
+ ];
+
+ /**
+ * s_extTextureRgHalfFloatTexFormats
+ * @type {Array<number>}
+ */
+ glsFboCompletenessTests.s_extTextureRgHalfFloatTexFormats = [
+ glsFboUtil.formatkey(gl.RED, gl['HALF_FLOAT_OES']),
+ glsFboUtil.formatkey(gl.RG, gl['HALF_FLOAT_OES'])
+ ];
+
+ /**
+ * s_nvPackedFloatRboFormats
+ * @type {Array<number>}
+ */
+ glsFboCompletenessTests.s_nvPackedFloatRboFormats = [
+ gl.R11F_G11F_B10F
+ ];
+
+ /**
+ * s_nvPackedFloatTexFormats
+ * @type {Array<number>}
+ */
+ glsFboCompletenessTests.s_nvPackedFloatTexFormats = [
+ glsFboUtil.formatkey(gl.RGB, gl.UNSIGNED_INT_10F_11F_11F_REV)
+ ];
+
+ /**
+ * s_extSrgbRboFormats
+ * @type {Array<number>}
+ */
+ glsFboCompletenessTests.s_extSrgbRboFormats = [
+ gl.SRGB8_ALPHA8
+ ];
+
+ /**
+ * s_extSrgbRenderableTexFormats
+ * @type {Array<number>}
+ */
+ glsFboCompletenessTests.s_extSrgbRenderableTexFormats = [
+ glsFboUtil.formatkey(gl['SRGB_ALPHA'], gl.UNSIGNED_BYTE)
+ ];
+
+ /**
+ * s_extSrgbNonRenderableTexFormats
+ * @type {Array<number>}
+ */
+ glsFboCompletenessTests.s_extSrgbNonRenderableTexFormats = [
+ glsFboUtil.formatkey(gl.SRGB, gl.UNSIGNED_BYTE),
+ gl.SRGB8
+ ];
+
+ /**
+ * s_nvSrgbFormatsRboFormats
+ * @type {Array<number>}
+ */
+ glsFboCompletenessTests.s_nvSrgbFormatsRboFormats = [
+ gl.SRGB8
+ ];
+
+ /**
+ * s_nvSrgbFormatsTextureFormats
+ * The extension does not actually require any unsized format
+ * to be renderable. However, the renderablility of unsized
+ * SRGB,UBYTE internalformat-type pair is implied.
+ * @type {Array<number>}
+ */
+ glsFboCompletenessTests.s_nvSrgbFormatsTextureFormats = [
+ gl.SRGB8,
+ glsFboUtil.formatkey(gl.SRGB, gl.UNSIGNED_BYTE)
+ ];
+
+ /**
+ * s_oesRgb8Rgba8TexFormats
+ * @type {Array<number>}
+ */
+ glsFboCompletenessTests.s_oesRgb8Rgba8TexFormats = [
+ glsFboUtil.formatkey(gl.RGB, gl.UNSIGNED_BYTE),
+ glsFboUtil.formatkey(gl.RGBA, gl.UNSIGNED_BYTE)
+ ];
+
+ var fmt = glsFboUtil.FormatFlags;
+
+ /**
+ * s_esExtFormats
+ * @type {Array<glsFboUtil.FormatExtEntry>}
+ */
+ glsFboCompletenessTests.s_esExtFormats = [
+ new glsFboUtil.FormatExtEntry(
+ 'OES_depth_texture',
+ fmt.REQUIRED_RENDERABLE | fmt.DEPTH_RENDERABLE | fmt.TEXTURE_VALID,
+ glsFboUtil.rangeArray(glsFboCompletenessTests.s_oesDepthTextureFormats)
+ ),
+ new glsFboUtil.FormatExtEntry(
+ 'OES_packed_depth_stencil',
+ fmt.REQUIRED_RENDERABLE | fmt.DEPTH_RENDERABLE | fmt.STENCIL_RENDERABLE | fmt.RENDERBUFFER_VALID,
+ glsFboUtil.rangeArray(glsFboCompletenessTests.s_oesPackedDepthStencilSizedFormats)
+ ),
+ new glsFboUtil.FormatExtEntry(
+ 'OES_packed_depth_stencil OES_required_internalformat',
+ fmt.DEPTH_RENDERABLE | fmt.STENCIL_RENDERABLE | fmt.TEXTURE_VALID,
+ glsFboUtil.rangeArray(glsFboCompletenessTests.s_oesPackedDepthStencilTexFormats)
+ ),
+
+ // \todo [2013-12-10 lauri] Find out if OES_texture_half_float is really a
+ // requirement on ES3 also. Or is color_buffer_half_float applicatble at
+ // all on ES3, since there's also EXT_color_buffer_float?
+ new glsFboUtil.FormatExtEntry(
+ 'OES_texture_half_float EXT_color_buffer_half_float',
+ fmt.REQUIRED_RENDERABLE | fmt.COLOR_RENDERABLE | fmt.RENDERBUFFER_VALID,
+ glsFboUtil.rangeArray(glsFboCompletenessTests.s_extColorBufferHalfFloatFormats)
+ ),
+
+ // OES_required_internalformat doesn't actually specify that these are renderable,
+ // since it was written against ES 1.1.
+ new glsFboUtil.FormatExtEntry(
+ 'OES_required_internalformat',
+ // Allow but don't require RGBA8 to be color-renderable if
+ // OES_rgb8_rgba8 is not present.
+ fmt.COLOR_RENDERABLE | fmt.TEXTURE_VALID,
+ glsFboUtil.rangeArray(glsFboCompletenessTests.s_oesRequiredInternalFormatColorFormats)
+ ),
+ new glsFboUtil.FormatExtEntry(
+ 'OES_required_internalformat',
+ fmt.DEPTH_RENDERABLE | fmt.TEXTURE_VALID,
+ glsFboUtil.rangeArray(glsFboCompletenessTests.s_oesRequiredInternalFormatDepthFormats)
+ ),
+ new glsFboUtil.FormatExtEntry(
+ 'EXT_texture_rg',
+ fmt.REQUIRED_RENDERABLE | fmt.COLOR_RENDERABLE | fmt.RENDERBUFFER_VALID,
+ glsFboUtil.rangeArray(glsFboCompletenessTests.s_extTextureRgRboFormats)
+ ),
+
+ // These are not specified to be color-renderable, but the wording is
+ // exactly as ambiguous as the wording in the ES2 spec.
+ new glsFboUtil.FormatExtEntry(
+ 'EXT_texture_rg',
+ fmt.REQUIRED_RENDERABLE | fmt.TEXTURE_VALID,
+ glsFboUtil.rangeArray(glsFboCompletenessTests.s_extTextureRgTexFormats)
+ ),
+ new glsFboUtil.FormatExtEntry(
+ 'EXT_texture_rg OES_texture_float',
+ fmt.REQUIRED_RENDERABLE | fmt.TEXTURE_VALID,
+ glsFboUtil.rangeArray(glsFboCompletenessTests.s_extTextureRgFloatTexFormats)
+ ),
+ new glsFboUtil.FormatExtEntry(
+ 'EXT_texture_rg OES_texture_half_float',
+ fmt.REQUIRED_RENDERABLE | fmt.TEXTURE_VALID,
+ glsFboUtil.rangeArray(glsFboCompletenessTests.s_extTextureRgHalfFloatTexFormats)
+ ),
+
+ // Some Tegra drivers report gl.EXT_packed_float even for ES. Treat it as
+ // a synonym for the NV_ version.
+ new glsFboUtil.FormatExtEntry(
+ 'EXT_packed_float',
+ fmt.REQUIRED_RENDERABLE | fmt.TEXTURE_VALID,
+ glsFboUtil.rangeArray(glsFboCompletenessTests.s_nvPackedFloatTexFormats)
+ ),
+ new glsFboUtil.FormatExtEntry(
+ 'EXT_packed_float EXT_color_buffer_half_float',
+ fmt.REQUIRED_RENDERABLE | fmt.COLOR_RENDERABLE | fmt.RENDERBUFFER_VALID,
+ glsFboUtil.rangeArray(glsFboCompletenessTests.s_nvPackedFloatRboFormats)
+ ),
+ new glsFboUtil.FormatExtEntry(
+ 'EXT_sRGB',
+ fmt.COLOR_RENDERABLE | fmt.TEXTURE_VALID,
+ glsFboUtil.rangeArray(glsFboCompletenessTests.s_extSrgbRenderableTexFormats)
+ ),
+ new glsFboUtil.FormatExtEntry(
+ 'EXT_sRGB',
+ fmt.TEXTURE_VALID,
+ glsFboUtil.rangeArray(glsFboCompletenessTests.s_extSrgbNonRenderableTexFormats)
+ ),
+ new glsFboUtil.FormatExtEntry(
+ 'EXT_sRGB',
+ fmt.REQUIRED_RENDERABLE | fmt.COLOR_RENDERABLE | fmt.RENDERBUFFER_VALID,
+ glsFboUtil.rangeArray(glsFboCompletenessTests.s_extSrgbRboFormats)
+ ),
+ new glsFboUtil.FormatExtEntry(
+ 'NV_sRGB_formats',
+ fmt.REQUIRED_RENDERABLE | fmt.COLOR_RENDERABLE | fmt.RENDERBUFFER_VALID,
+ glsFboUtil.rangeArray(glsFboCompletenessTests.s_nvSrgbFormatsRboFormats)
+ ),
+ new glsFboUtil.FormatExtEntry(
+ 'NV_sRGB_formats',
+ fmt.REQUIRED_RENDERABLE | fmt.COLOR_RENDERABLE | fmt.TEXTURE_VALID,
+ glsFboUtil.rangeArray(glsFboCompletenessTests.s_nvSrgbFormatsTextureFormats)
+ ),
+
+ // In Khronos bug 7333 discussion, the consensus is that these texture
+ // formats, at least, should be color-renderable. Still, that cannot be
+ // found in any extension specs, so only allow it, not require it.
+ new glsFboUtil.FormatExtEntry(
+ 'OES_rgb8_rgba8',
+ fmt.COLOR_RENDERABLE | fmt.TEXTURE_VALID,
+ glsFboUtil.rangeArray(glsFboCompletenessTests.s_oesRgb8Rgba8TexFormats)
+ ),
+ new glsFboUtil.FormatExtEntry(
+ 'OES_rgb8_rgba8',
+ fmt.REQUIRED_RENDERABLE | fmt.COLOR_RENDERABLE | fmt.RENDERBUFFER_VALID,
+ glsFboUtil.rangeArray(glsFboCompletenessTests.s_oesRgb8Rgba8RboFormats)
+ ),
+ new glsFboUtil.FormatExtEntry(
+ 'OES_rgb8_rgba8 OES_required_internalformat',
+ fmt.TEXTURE_VALID,
+ glsFboUtil.rangeArray(glsFboCompletenessTests.s_oesRequiredInternalFormatRgb8ColorFormat)
+ ),
+
+ // The depth-renderability of the depth RBO formats is not explicitly
+ // spelled out, but all renderbuffer formats are meant to be renderable.
+ new glsFboUtil.FormatExtEntry(
+ 'OES_depth24',
+ fmt.REQUIRED_RENDERABLE | fmt.DEPTH_RENDERABLE | fmt.RENDERBUFFER_VALID,
+ glsFboUtil.rangeArray(glsFboCompletenessTests.s_oesDepth24SizedFormats)
+ ),
+ new glsFboUtil.FormatExtEntry(
+ 'OES_depth24 OES_required_internalformat OES_depth_texture',
+ fmt.TEXTURE_VALID,
+ glsFboUtil.rangeArray(glsFboCompletenessTests.s_oesDepth24SizedFormats)
+ ),
+
+ new glsFboUtil.FormatExtEntry(
+ 'OES_depth32',
+ fmt.REQUIRED_RENDERABLE | fmt.DEPTH_RENDERABLE | fmt.RENDERBUFFER_VALID,
+ glsFboUtil.rangeArray(glsFboCompletenessTests.s_oesDepth32SizedFormats)
+ ),
+ new glsFboUtil.FormatExtEntry(
+ 'OES_depth32 OES_required_internalformat OES_depth_texture',
+ fmt.TEXTURE_VALID,
+ glsFboUtil.rangeArray(glsFboCompletenessTests.s_oesDepth32SizedFormats)
+ ),
+
+ new glsFboUtil.FormatExtEntry(
+ 'EXT_texture_type_2_10_10_10_REV',
+ fmt.TEXTURE_VALID, // explicitly unrenderable
+ glsFboUtil.rangeArray(glsFboCompletenessTests.s_extTextureType2101010RevFormats)
+ ),
+ new glsFboUtil.FormatExtEntry(
+ 'EXT_texture_type_2_10_10_10_REV OES_required_internalformat',
+ fmt.TEXTURE_VALID, // explicitly unrenderable
+ glsFboUtil.rangeArray(glsFboCompletenessTests.s_oesRequiredInternalFormat10bitColorFormats)
+ )
+ ];
+
+ }; // initGlDependents ----------------------------------------
+
+ /**
+ * @constructor
+ * @param {null} testCtx
+ * @param {WebGLRenderingContextBase} renderCtx
+ * @param {glsFboUtil.CheckerFactory} factory
+ */
+ glsFboCompletenessTests.Context = function(testCtx, renderCtx, factory) {
+
+ this.m_testCtx = testCtx;
+ this.m_renderCtx = renderCtx;
+ this.m_ctxFormats = new glsFboUtil.FormatDB();
+ this.m_minFormats = new glsFboUtil.FormatDB();
+ this.m_maxFormats = new glsFboUtil.FormatDB();
+ this.m_verifier = new glsFboUtil.FboVerifier(this.m_ctxFormats, factory);
+ this.m_haveMultiColorAtts = false;
+
+ // FormatExtEntries
+ var extRange = glsFboUtil.rangeArray(glsFboCompletenessTests.s_esExtFormats);
+ this.addExtFormats(extRange);
+
+ };
+
+ // RenderContext&
+ glsFboCompletenessTests.Context.prototype.getRenderContext = function() {
+ return this.m_renderCtx;
+ };
+
+ // TestContext&
+ glsFboCompletenessTests.Context.prototype.getTestContext = function() {
+ return this.m_testCtx;
+ };
+
+ // const FboVerifier&
+ glsFboCompletenessTests.Context.prototype.getVerifier = function() {
+ return this.m_verifier;
+ };
+
+ // const FormatDB&
+ glsFboCompletenessTests.Context.prototype.getMinFormats = function() {
+ return this.m_minFormats;
+ };
+
+ // const FormatDB&
+ glsFboCompletenessTests.Context.prototype.getCtxFormats = function() {
+ return this.m_ctxFormats;
+ };
+
+ // bool
+ glsFboCompletenessTests.Context.prototype.haveMultiColorAtts = function() {
+ return this.m_haveMultiColorAtts;
+ };
+
+ glsFboCompletenessTests.Context.prototype.setHaveMulticolorAtts = function(have) {
+ this.m_haveMultiColorAtts = (have == true);
+ };
+
+ glsFboCompletenessTests.Context.prototype.addFormats = function(fmtRange) {
+ glsFboUtil.addFormats(this.m_minFormats, fmtRange);
+ glsFboUtil.addFormats(this.m_ctxFormats, fmtRange);
+ glsFboUtil.addFormats(this.m_maxFormats, fmtRange);
+ };
+ glsFboCompletenessTests.Context.prototype.addExtFormats = function(extRange) {
+ glsFboUtil.addExtFormats(this.m_ctxFormats, extRange, this.m_renderCtx);
+ glsFboUtil.addExtFormats(this.m_maxFormats, extRange, this.m_renderCtx);
+ };
+
+ glsFboCompletenessTests.Context.prototype.createRenderableTests = function(gl) {
+
+ /** @type {tcuTestCase.DeqpTest} */
+ var renderableTests = tcuTestCase.newTest('renderable', 'Tests for support of renderable image formats');
+ /** @type {tcuTestCase.DeqpTest} */
+ var rbRenderableTests = tcuTestCase.newTest('renderbuffer', 'Tests for renderbuffer formats');
+ /** @type {tcuTestCase.DeqpTest} */
+ var texRenderableTests = tcuTestCase.newTest('texture', 'Tests for texture formats');
+
+ var attPoints = [
+ [gl.DEPTH_ATTACHMENT, 'depth', 'Tests for depth attachments'],
+ [gl.STENCIL_ATTACHMENT, 'stencil', 'Tests for stencil attachments'],
+ [gl.COLOR_ATTACHMENT0, 'color0', 'Tests for color attachments']
+ ];
+
+ // At each attachment point, iterate through all the possible formats to
+ // detect both false positives and false negatives.
+ var rboFmts = this.m_maxFormats.getFormats(glsFboUtil.FormatFlags.ANY_FORMAT);
+ var texFmts = this.m_maxFormats.getFormats(glsFboUtil.FormatFlags.ANY_FORMAT);
+
+ for (var i = 0, l_attPoints = attPoints.length; i < l_attPoints; ++i) {
+ var rbAttTests = tcuTestCase.newTest(attPoints[i][1], attPoints[i][2]);
+ var texAttTests = tcuTestCase.newTest(attPoints[i][1], attPoints[i][2]);
+
+ for (var j = 0, l_rboFmts = rboFmts.length; j < l_rboFmts; ++j) {
+ var params = glsFboCompletenessTests.renderableParams(
+ attPoints[i][0], gl.RENDERBUFFER, rboFmts[j]
+ );
+ rbAttTests.addChild(
+ new glsFboCompletenessTests.RenderableTest(
+ glsFboCompletenessTests.renderableParams.getName(params),
+ glsFboCompletenessTests.renderableParams.getDescription(params),
+ this, params
+ )
+ );
+ }
+ rbRenderableTests.addChild(rbAttTests);
+
+ for (var j = 0, l_texFmts = texFmts.length; j < l_texFmts; ++j) {
+ var params = glsFboCompletenessTests.renderableParams(
+ attPoints[i][0], gl.TEXTURE, texFmts[j]
+ );
+ texAttTests.addChild(
+ new glsFboCompletenessTests.RenderableTest(
+ glsFboCompletenessTests.renderableParams.getName(params),
+ glsFboCompletenessTests.renderableParams.getDescription(params),
+ this, params
+ )
+ );
+ }
+ texRenderableTests.addChild(texAttTests);
+
+ }
+ renderableTests.addChild(rbRenderableTests);
+ renderableTests.addChild(texRenderableTests);
+
+ return renderableTests;
+ };
+
+ glsFboCompletenessTests.Context.prototype.createAttachmentTests = function(gl) {
+
+ var attCombTests = tcuTestCase.newTest('attachment_combinations', 'Tests for attachment combinations');
+
+ var s_bufTypes = [gl.NONE, gl.RENDERBUFFER, gl.TEXTURE];
+ var ls_bufTypes = s_bufTypes.length;
+
+ for (var col0 = 0; col0 < ls_bufTypes; ++col0)
+ for (var coln = 0; coln < ls_bufTypes; ++coln)
+ for (var dep = 0; dep < ls_bufTypes; ++dep)
+ for (var stc = 0; stc < ls_bufTypes; ++stc) {
+ var params = glsFboCompletenessTests.attachmentParams(
+ s_bufTypes[col0], s_bufTypes[coln], s_bufTypes[dep], s_bufTypes[stc]
+ );
+ attCombTests.addChild(new glsFboCompletenessTests.AttachmentTest(
+ glsFboCompletenessTests.attachmentParams.getName(params),
+ glsFboCompletenessTests.attachmentParams.getDescription(params),
+ this, params
+ ));
+ }
+ return attCombTests;
+ };
+
+ glsFboCompletenessTests.Context.prototype.createSizeTests = function(gl) {
+
+ var sizeTests = tcuTestCase.newTest('size', 'Tests for attachment sizes');
+
+ sizeTests.addChild(new glsFboCompletenessTests.EmptyImageTest(
+ 'zero', 'Test for zero-sized image attachment', this
+ ));
+
+ return sizeTests;
+
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} desc
+ * @param {Object} params
+ */
+ glsFboCompletenessTests.TestBase = function(name, desc, params) {
+ tcuTestCase.DeqpTest.call(this, name, desc);
+ this.m_params = params;
+ };
+ glsFboCompletenessTests.TestBase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ glsFboCompletenessTests.TestBase.prototype.constructor = glsFboCompletenessTests.TestBase;
+
+ glsFboCompletenessTests.TestBase.prototype.getContext = function() {
+ return tcuTestCase.runner;
+ };
+
+ // GLenum attPoint, GLenum bufType
+ /**
+ * @param {number} attPoint
+ * @param {number} bufType
+ * @param {WebGLRenderingContextBase=} gl
+ */
+ glsFboCompletenessTests.TestBase.prototype.getDefaultFormat = function(attPoint, bufType, gl) {
+ gl = gl || window.gl;
+
+ if (bufType == gl.NONE) {
+ return glsFboUtil.ImageFormat.none();
+ }
+
+ // Prefer a standard format, if there is one, but if not, use a format
+ // provided by an extension.
+ var formats = this.m_ctx.getMinFormats().getFormats(
+ glsFboUtil.formatFlag(attPoint, gl) | glsFboUtil.formatFlag(bufType, gl)
+ );
+
+ if (!formats.length) {
+ formats = this.m_ctx.getCtxFormats().getFormats(
+ glsFboUtil.formatFlag(attPoint, gl) | glsFboUtil.formatFlag(bufType, gl)
+ );
+ }
+ if (!formats.length) {
+ throw new Error('Unsupported attachment kind for attachment point');
+ }
+
+ return formats[0];
+
+ };
+
+ /**
+ * @param {number} bufType
+ * @param {glsFboUtil.ImageFormat} format
+ * @param {number} width
+ * @param {number} height
+ * @param {glsFboUtil.FboBuilder} builder
+ * @param {WebGLRenderingContextBase=} gl
+ * @return {glsFboUtil.Image}
+ */
+ glsFboCompletenessTests.makeImage = function(bufType, format, width, height, builder, gl) {
+ gl = gl || window.gl;
+ var image = 0;
+ switch (bufType) {
+ case gl.NONE:
+ return null;
+ break;
+ case gl.RENDERBUFFER:
+ image = /** @type {glsFboUtil.Renderbuffer}*/(builder.makeConfig(glsFboUtil.Renderbuffer));
+ break;
+ case gl.TEXTURE:
+ image = /** @type {glsFboUtil.Texture2D}*/(builder.makeConfig(glsFboUtil.Texture2D));
+ break;
+ default:
+ throw new Error('Impossible case');
+ }
+ image.internalFormat = format;
+ image.width = width;
+ image.height = height;
+ return image;
+ };
+
+ /**
+ * @param {number} bufType
+ * @param {glsFboUtil.ImageFormat} format
+ * @param {number} width
+ * @param {number} height
+ * @param {glsFboUtil.FboBuilder} builder
+ * @param {WebGLRenderingContextBase=} gl
+ * @return {glsFboUtil.Attachment}
+ */
+ glsFboCompletenessTests.makeAttachment = function(bufType, format, width, height, builder, gl) {
+ gl = gl || window.gl;
+ var cfg = glsFboCompletenessTests.makeImage(bufType, format, width, height, builder, gl);
+ if (cfg == null) return null;
+
+ /** @type {glsFboUtil.Attachment} */ var att = null;
+ var img = 0;
+
+ var mask = glsFboUtil.Config.s_types.RENDERBUFFER | glsFboUtil.Config.s_types.TEXTURE_2D;
+
+ switch (cfg.type & mask) {
+ case glsFboUtil.Config.s_types.RENDERBUFFER:
+ img = builder.glCreateRbo(/** @type {glsFboUtil.Renderbuffer} */(cfg));
+ att = /** @type {glsFboUtil.RenderbufferAttachment} */ (builder.makeConfig(glsFboUtil.RenderbufferAttachment));
+ break;
+ case glsFboUtil.Config.s_types.TEXTURE_2D:
+ img = builder.glCreateTexture(/** @type {glsFboUtil.Texture2D} */(cfg));
+ att = /** @type {glsFboUtil.TextureFlatAttachment} */ (builder.makeConfig(glsFboUtil.TextureFlatAttachment));
+ att.texTarget = gl.TEXTURE_2D;
+ break;
+ default:
+ throw new Error('Unsupported config.');
+ }
+ att.imageName = img;
+ return att;
+ };
+
+ //GLenum target, GLenum bufType, ImageFormat format, GLsizei width, GLsizei height, FboBuilder& builder, webglctx
+ /**
+ * @param {number} target
+ * @param {number} bufType
+ * @param {glsFboUtil.ImageFormat} format
+ * @param {number} width
+ * @param {number} height
+ * @param {glsFboUtil.FboBuilder} builder
+ * @param {WebGL2RenderingContext} gl
+ */
+ glsFboCompletenessTests.TestBase.prototype.attachTargetToNew = function(
+ target, bufType, format, width, height, builder, gl
+ ) {
+ var imgFmt = format;
+ if (imgFmt.format == gl.NONE)
+ imgFmt = this.getDefaultFormat(target, bufType, gl);
+ var att = glsFboCompletenessTests.makeAttachment(bufType, imgFmt, width, height, builder, gl);
+ builder.glAttach(target, att);
+ };
+
+ /**
+ * @param {number} status
+ * @param {WebGLRenderingContextBase=} gl
+ * @return {string}
+ */
+ glsFboCompletenessTests.statusName = function(status, gl) {
+ gl = gl || window.gl;
+
+ var errorName = gluStrUtil.getErrorName(status);
+ if (status != gl.NO_ERROR && errorName != '')
+ return errorName + ' (during FBO initialization)';
+
+ var fbStatusName = gluStrUtil.getFramebufferStatusName(status);
+ if (fbStatusName != '')
+ return fbStatusName;
+
+ return 'unknown value (' + status + ')';
+ };
+
+ glsFboCompletenessTests.TestBase.prototype.iterate = function() {
+ var gl = window.gl;
+
+ var fbo = new gluObjectWrapper.Framebuffer(gl);
+ var builder = new glsFboUtil.FboBuilder(fbo.get(), gl.FRAMEBUFFER, gl);
+ var ret = this.build(builder, gl);
+ var statuses = this.m_ctx.getVerifier().validStatusCodes(builder, gl);
+
+ var errorCode = builder.getError();
+ if (errorCode != gl.NO_ERROR) {
+ bufferedLogToConsole('Received ' + gluStrUtil.getErrorName(errorCode) + ' (during FBO initialization).');
+ if (statuses.isErrorCodeValid(errorCode))
+ testPassed();
+ else if (statuses.isErrorCodeRequired(gl.NO_ERROR))
+ testFailedOptions('Excepted no error but got ' + gluStrUtil.getErrorName(errorCode), true);
+ else
+ testFailedOptions('Got wrong error code', true);
+ } else {
+ var fboStatus = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ var validStatus = statuses.isFBOStatusValid(fboStatus);
+ bufferedLogToConsole('Received ' + gluStrUtil.getFramebufferStatusName(fboStatus));
+ if (!validStatus) {
+ if (fboStatus == gl.FRAMEBUFFER_COMPLETE) {
+ testFailedOptions('Framebuffer checked as complete, expected incomplete', true);
+ } else if (statuses.isFBOStatusRequired(gl.FRAMEBUFFER_COMPLETE)) {
+ testFailedOptions('Framebuffer checked as incomplete, expected complete', true);
+ } else {
+ // An incomplete status is allowed, but not _this_ incomplete status.
+ testFailedOptions('Framebuffer checked as incomplete, but with wrong status', true);
+ }
+ } else if (fboStatus != gl.FRAMEBUFFER_COMPLETE && statuses.isFBOStatusValid(gl.FRAMEBUFFER_COMPLETE)) {
+ testPassedOptions('Warning: framebuffer object could have checked as complete but did not.', true);
+ } else {
+ // pass
+ testPassed();
+ }
+ }
+ builder.deinit();
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ glsFboCompletenessTests.formatName = function(format, gl) {
+ if (!(gl = gl || window.gl)) throw new Error('Invalid GL object');
+
+ var s = gluStrUtil.getPixelFormatName(format.format).substr(3).toLowerCase();
+
+ if (format.unsizedType != gl.NONE)
+ s += '_' + gluStrUtil.getTypeName(format.unsizedType).substr(3).toLowerCase();
+
+ return s;
+ };
+ glsFboCompletenessTests.formatDesc = function(format, gl) {
+ if (!(gl = gl || window.gl)) throw new Error('Invalid GL object');
+
+ var s = gluStrUtil.getPixelFormatName(format.format);
+
+ if (format.unsizedType != gl.NONE)
+ s += ' with type ' + gluStrUtil.getTypeName(format.unsizedType);
+
+ return s;
+ };
+
+ /**
+ * @typedef {{attPoint: number, bufType: number, format: glsFboUtil.ImageFormat}}
+ */
+ glsFboCompletenessTests.renderableParamsT;
+
+ /**
+ * @param {number} attPoint
+ * @param {number} bufType
+ * @param {glsFboUtil.ImageFormat} format
+ * @return {glsFboCompletenessTests.renderableParamsT}
+ */
+ glsFboCompletenessTests.renderableParams = function(attPoint, bufType, format) {
+ var ret = {
+ attPoint: attPoint,
+ bufType: bufType,
+ format: format
+ };
+ return ret;
+ };
+ /**
+ * @param {glsFboCompletenessTests.renderableParamsT} params
+ * @param {WebGLRenderingContextBase=} gl
+ * @return {string}
+ */
+ glsFboCompletenessTests.renderableParams.getName = function(params, gl) {
+ return glsFboCompletenessTests.formatName(params.format, gl);
+ };
+ /**
+ * @param {glsFboCompletenessTests.renderableParamsT} params
+ * @param {WebGLRenderingContextBase=} gl
+ * @return {string}
+ */
+ glsFboCompletenessTests.renderableParams.getDescription = function(params, gl) {
+ return glsFboCompletenessTests.formatDesc(params.format, gl);
+ };
+
+ /**
+ * @constructor
+ * @extends {glsFboCompletenessTests.TestBase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {glsFboCompletenessTests.Context} ctx
+ * @param {glsFboCompletenessTests.renderableParamsT} params
+ */
+ glsFboCompletenessTests.RenderableTest = function(name, desc, ctx, params) {
+ glsFboCompletenessTests.TestBase.call(this, name, desc, params);
+ this.m_ctx = ctx;
+ };
+ glsFboCompletenessTests.RenderableTest.prototype = Object.create(glsFboCompletenessTests.TestBase.prototype);
+ glsFboCompletenessTests.RenderableTest.prototype.constructor = glsFboCompletenessTests.RenderableTest;
+
+ glsFboCompletenessTests.RenderableTest.prototype.build = function(builder, gl) {
+ this.attachTargetToNew(this.m_params.attPoint, this.m_params.bufType, this.m_params.format, 64, 64, builder, gl);
+ return true;
+ };
+
+ glsFboCompletenessTests.attTypeName = function(bufType, gl) {
+ if (!(gl = gl || window.gl)) throw new Error('Invalid GL object');
+ switch (bufType) {
+ case gl.NONE: return 'none';
+ case gl.RENDERBUFFER: return 'rbo';
+ case gl.TEXTURE: return 'tex';
+ default: break;
+ }
+ throw new Error('Impossible case');
+ };
+
+ /**
+ * @typedef {{color0Kind: number, colornKind: number, depthKind: number, stencilKind: number}}
+ */
+ glsFboCompletenessTests.attachmentParamsT;
+
+ /**
+ * @param {number} color0Kind
+ * @param {number} colornKind
+ * @param {number} depthKind
+ * @param {number} stencilKind
+ * @return {glsFboCompletenessTests.attachmentParamsT}
+ */
+ glsFboCompletenessTests.attachmentParams = function(color0Kind, colornKind, depthKind, stencilKind) {
+ var ret = {
+ color0Kind: color0Kind,
+ colornKind: colornKind,
+ depthKind: depthKind,
+ stencilKind: stencilKind
+ };
+ return ret;
+ };
+ /**
+ * @param {glsFboCompletenessTests.attachmentParamsT} params
+ * @param {WebGLRenderingContextBase=} gl
+ * @return {string}
+ */
+ glsFboCompletenessTests.attachmentParams.getName = function(params, gl) {
+ return (glsFboCompletenessTests.attTypeName(params.color0Kind, gl) + '_' +
+ glsFboCompletenessTests.attTypeName(params.colornKind, gl) + '_' +
+ glsFboCompletenessTests.attTypeName(params.depthKind, gl) + '_' +
+ glsFboCompletenessTests.attTypeName(params.stencilKind, gl));
+ };
+ /**
+ * @param {glsFboCompletenessTests.attachmentParamsT} params
+ * @return {string}
+ */
+ glsFboCompletenessTests.attachmentParams.getDescription = glsFboCompletenessTests.attachmentParams.getName;
+
+ /**
+ * @constructor
+ * @extends {glsFboCompletenessTests.TestBase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {glsFboCompletenessTests.Context} ctx
+ * @param {glsFboCompletenessTests.attachmentParamsT} params
+ */
+ glsFboCompletenessTests.AttachmentTest = function(name, desc, ctx, params) {
+ glsFboCompletenessTests.TestBase.call(this, name, desc, params);
+ this.m_ctx = ctx;
+ };
+ glsFboCompletenessTests.AttachmentTest.prototype = Object.create(glsFboCompletenessTests.TestBase.prototype);
+ glsFboCompletenessTests.AttachmentTest.prototype.constructor = glsFboCompletenessTests.AttachmentTest;
+
+ glsFboCompletenessTests.AttachmentTest.prototype.makeDepthAndStencil = function(builder, gl) {
+
+ /** @type {glsFboUtil.Attachment} */
+ var att = null;
+
+ if (this.m_params.stencilKind == this.m_params.depthKind) {
+ // If there is a common stencil+depth -format, try to use a common
+ // image for both attachments.
+ var flags = glsFboUtil.FormatFlags.DEPTH_RENDERABLE |
+ glsFboUtil.FormatFlags.STENCIL_RENDERABLE |
+ glsFboUtil.formatFlag(this.m_params.stencilKind, gl);
+
+ var formats = this.m_ctx.getMinFormats().getFormats(flags);
+ if (formats.length) {
+ var format = formats[0];
+ att = glsFboCompletenessTests.makeAttachment(this.m_params.depthKind, format, 64, 64, builder, gl);
+ builder.glAttach(gl.DEPTH_ATTACHMENT, att);
+ builder.glAttach(gl.STENCIL_ATTACHMENT, att);
+ return;
+ }
+ }
+ // Either the kinds were separate, or a suitable format was not found.
+ // Create separate images.
+ this.attachTargetToNew(gl.STENCIL_ATTACHMENT, this.m_params.stencilKind,
+ glsFboUtil.ImageFormat.none(), 64, 64, builder, gl);
+ this.attachTargetToNew(gl.DEPTH_ATTACHMENT, this.m_params.depthKind,
+ glsFboUtil.ImageFormat.none(), 64, 64, builder, gl);
+ };
+
+ glsFboCompletenessTests.AttachmentTest.prototype.build = function(builder, gl) {
+
+ this.attachTargetToNew(gl.COLOR_ATTACHMENT0, this.m_params.color0Kind,
+ glsFboUtil.ImageFormat.none(), 64, 64, builder, gl);
+
+ if (this.m_params.colornKind != gl.NONE) {
+ if (this.m_ctx.haveMultiColorAtts())
+ throw new Error('Multiple attachments not supported');
+ var maxAttachments = gl.getParameter(gl.MAX_COLOR_ATTACHMENTS);
+
+ for (var i = 1; i < maxAttachments; ++i) {
+ this.attachTargetToNew(gl.COLOR_ATTACHMENT0 + i, this.m_params.colornKind,
+ glsFboUtil.ImageFormat.none(), 64, 64, builder, gl);
+ }
+ }
+
+ this.makeDepthAndStencil(builder, gl);
+
+ return true;
+ };
+
+ /**
+ * @constructor
+ * @extends {glsFboCompletenessTests.TestBase}
+ * @param {string} name
+ * @param {string} desc
+ * @param {glsFboCompletenessTests.Context} ctx
+ */
+ glsFboCompletenessTests.EmptyImageTest = function(name, desc, ctx) {
+ glsFboCompletenessTests.TestBase.call(this, name, desc, null);
+ this.m_ctx = ctx;
+ };
+ glsFboCompletenessTests.EmptyImageTest.prototype = Object.create(glsFboCompletenessTests.TestBase.prototype);
+ glsFboCompletenessTests.EmptyImageTest.prototype.constructor = glsFboCompletenessTests.EmptyImageTest;
+
+ glsFboCompletenessTests.EmptyImageTest.prototype.build = function(builder, gl) {
+ this.attachTargetToNew(gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER,
+ glsFboUtil.ImageFormat.none(), 0, 0, builder, gl);
+ return true;
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsFboUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsFboUtil.js
new file mode 100644
index 0000000000..86d05891f2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsFboUtil.js
@@ -0,0 +1,1413 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('modules.shared.glsFboUtil');
+goog.require('framework.opengl.gluTextureUtil');
+goog.require('framework.opengl.gluStrUtil');
+
+goog.scope(function() {
+
+ var glsFboUtil = modules.shared.glsFboUtil;
+ var gluTextureUtil = framework.opengl.gluTextureUtil;
+ var gluStrUtil = framework.opengl.gluStrUtil;
+ var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+ };
+
+ /**
+ * @constructor
+ * @template KeyT
+ * @template ValueT
+ * @param {function(!KeyT, !KeyT):boolean} comparefnc
+ */
+ glsFboUtil.Map = function(comparefnc) {
+ /** @type {Array<{first: !KeyT, second: ValueT}>} */
+ this.store = [];
+ this.compare = comparefnc;
+ this.length = 0;
+ };
+
+ /**
+ * @param {number} num1
+ * @param {number} num2
+ * @return {boolean}
+ */
+ glsFboUtil.Map.compareNumber = function(num1, num2) {
+ return num1 < num2;
+ };
+
+ /**
+ * @param {!KeyT} key
+ * @param {ValueT} value
+ * @return {{first: !KeyT, second: ValueT}}
+ */
+ glsFboUtil.Map.prototype.pair = function(key, value) {
+ return {
+ first: key,
+ second: value
+ };
+ };
+
+ /**
+ * @protected
+ * @param {!KeyT} key
+ * @return {number}
+ */
+ glsFboUtil.Map.prototype.findInsertionPoint = function(key) {
+ var /** @type {number} */i, /** @type {number} */length;
+ for (i = 0, length = this.store.length; i < length; ++i) {
+ if (!this.compare(key, this.store[i].first)) break;
+ }
+ return i;
+ };
+
+ /**
+ * index should be a value returned from findInsertionPoint.
+ * returns true if the compare function returns false reflexively
+ * (i.e. no matter the order in which the keys are passed as arguments).
+ * @protected
+ * @param {!KeyT} key
+ * @param {number} index
+ * @return {boolean}
+ */
+ glsFboUtil.Map.prototype.foundIndexMatches = function(key, index) {
+ return (
+ this.store[index] !== undefined &&
+ !this.compare(this.store[index].first, key)
+ );
+ };
+
+ /**
+ * @param {!KeyT} key
+ * @return {boolean}
+ */
+ glsFboUtil.Map.prototype.isset = function(key) {
+ return this.foundIndexMatches(key, this.findInsertionPoint(key));
+ };
+
+ /**
+ * @param {!KeyT} key
+ * @param {ValueT} value
+ */
+ glsFboUtil.Map.prototype.set = function(key, value) {
+ var index = this.findInsertionPoint(key);
+ if (this.foundIndexMatches(key, index)) {
+ this.store[index].second = value;
+ } else {
+ this.store.splice(index, 0, this.pair(key, value));
+ ++this.length;
+ }
+ };
+
+ /**
+ * @param {!KeyT} key
+ * @return {?ValueT}
+ */
+ glsFboUtil.Map.prototype.remove = function(key) {
+ var index = this.findInsertionPoint(key);
+ /** @type {?ValueT} */ var ret = null;
+ if (this.foundIndexMatches(key, index)) {
+ ret = this.store[index].second;
+ this.store.splice(index, 1);
+ --this.length;
+ }
+ return ret;
+ };
+
+ /**
+ * @param {KeyT} key
+ * @return {?{first: KeyT, second: ValueT}}
+ */
+ glsFboUtil.Map.prototype.get = function(key) {
+ var index = this.findInsertionPoint(key);
+ if (this.foundIndexMatches(key, index)) return this.store[index];
+ return null;
+ };
+
+ /**
+ * @param {KeyT} key
+ * @return {?ValueT}
+ */
+ glsFboUtil.Map.prototype.getValue = function(key) {
+ var index = this.findInsertionPoint(key);
+ if (this.foundIndexMatches(key, index)) return this.store[index].second;
+ return null;
+ };
+
+ /**
+ * @param {!KeyT} key
+ * @param {ValueT} fallback
+ * @return {ValueT}
+ */
+ glsFboUtil.Map.prototype.lookupDefault = function(key, fallback) {
+ var index = this.findInsertionPoint(key);
+ if (this.foundIndexMatches(key, index)) return this.store[index].second;
+ return fallback;
+ };
+
+ /**
+ * @param {number} index
+ * @return {{first: KeyT, second: ValueT}|undefined}
+ */
+ glsFboUtil.Map.prototype.getIndex = function(index) {
+ return this.store[index];
+ };
+
+ /**
+ * Use the callback to set the value to be identified by key.
+ * If a value is already identified by the key, it will be passed to the callback
+ * @param {!KeyT} key
+ * @param {function(ValueT=):!ValueT} callback
+ */
+ glsFboUtil.Map.prototype.transform = function(key, callback) {
+ var index = this.findInsertionPoint(key);
+ if (this.foundIndexMatches(key, index)) {
+ this.store[index].second = callback(this.store[index].second);
+ } else {
+ this.store.splice(index, 0, this.pair(key, callback()));
+ ++this.length;
+ }
+ };
+
+ /**
+ * removed all elements from the Map
+ */
+ glsFboUtil.Map.prototype.clear = function() {
+ this.store.splice(0, this.length);
+ this.length = 0;
+ };
+
+ /**
+ * @constructor
+ */
+ glsFboUtil.FormatDB = function() {
+ this.m_map = /** @type {glsFboUtil.Map<glsFboUtil.ImageFormat,number>} */(
+ new glsFboUtil.Map(glsFboUtil.ImageFormat.lessthan)
+ );
+ };
+
+ /**
+ * @param {glsFboUtil.ImageFormat} format
+ * @param {number} newFlags
+ */
+ glsFboUtil.FormatDB.prototype.addFormat = function(format, newFlags) {
+ this.m_map.transform(format, function(flags) {
+ return flags | newFlags;
+ });
+ };
+
+ /**
+ * @param {number} requirements
+ * @return {Array<glsFboUtil.ImageFormat>}
+ */
+ glsFboUtil.FormatDB.prototype.getFormats = function(requirements) {
+ /** @type {Array<glsFboUtil.ImageFormat>} */ var ret = [];
+ for (var i = 0; i < this.m_map.length; ++i) {
+ var pair = this.m_map.getIndex(i);
+ if ((pair.second & requirements) == requirements)
+ ret.push(pair.first);
+ }
+
+ return ret;
+ };
+
+ /**
+ * @param {glsFboUtil.ImageFormat} format
+ * @param {number} fallback
+ * @return {number}
+ */
+ glsFboUtil.FormatDB.prototype.getFormatInfo = function(format, fallback) {
+ return this.m_map.lookupDefault(format, fallback);
+ };
+
+ /**
+ * @param {Object} map
+ * @param {number} key
+ * @param {number} fallback
+ * @return {number}
+ */
+ glsFboUtil.lookupDefault = function(map, key, fallback) {
+ return (map[key] !== undefined) ? map[key] : fallback;
+ };
+
+ /**
+ * @param {Array<number>} array
+ * @param {number} item
+ * @return {boolean}
+ */
+ glsFboUtil.contains = function(array, item) {
+ var l = array.length;
+ for (var i = 0; i < l; ++i)
+ if (array[i] == item) return true;
+ return false;
+ };
+
+ /**
+ * @typedef {Array<(number | glsFboUtil.Range<number>)>}
+ */
+ glsFboUtil.formatT;
+
+ /**
+ * @param {glsFboUtil.FormatDB} db
+ * @param {glsFboUtil.Range<glsFboUtil.formatT>} stdFmts
+ */
+ glsFboUtil.addFormats = function(db, stdFmts) {
+ for (var set = stdFmts.reset(); set = stdFmts.current(); stdFmts.next()) {
+ for (var fmt = set[1].reset(); fmt = set[1].current(); set[1].next()) {
+ db.addFormat(glsFboUtil.formatKeyInfo(fmt), set[0]);
+ }
+ }
+ };
+
+ /**
+ * @param {glsFboUtil.FormatDB} db
+ * @param {glsFboUtil.Range} extFmts
+ * @param {WebGLRenderingContextBase=} gl
+ * @throws {Error}
+ */
+ glsFboUtil.addExtFormats = function(db, extFmts, gl) {
+ if (!(gl = gl || window.gl)) throw new Error('Invalid gl object');
+ var extensions = gl.getSupportedExtensions();
+
+ // loop through the range, looking at the extentions.
+ for (var ext = extFmts.reset(); ext = extFmts.current(); extFmts.next()) {
+ var tokens = ext.extensions.split(/\s+/);
+
+ var supported = function() {
+ for (var i = 0, l = tokens.length; i < l; ++i)
+ if (extensions.indexOf(tokens[i]) === -1) return false;
+ return true;
+ }();
+
+ if (supported) {
+ for (var format = ext.formats.reset(); format = ext.formats.current(); ext.formats.next()) {
+ db.addFormat(glsFboUtil.formatKeyInfo(format), ext.flags);
+ }
+ }
+
+ }
+
+ };
+
+ /**
+ * @param {number} glenum
+ * @param {WebGLRenderingContextBase=} gl
+ * @return {number}
+ * @throws {Error}
+ */
+ glsFboUtil.formatFlag = function(glenum, gl) {
+ if (!(gl = gl || window.gl)) throw new Error('Invalid gl object');
+
+ switch (glenum) {
+ case gl.NONE:
+ return glsFboUtil.FormatFlags.ANY_FORMAT;
+ case gl.RENDERBUFFER:
+ return glsFboUtil.FormatFlags.RENDERBUFFER_VALID;
+ case gl.TEXTURE:
+ return glsFboUtil.FormatFlags.TEXTURE_VALID;
+ case gl.STENCIL_ATTACHMENT:
+ return glsFboUtil.FormatFlags.STENCIL_RENDERABLE;
+ case gl.DEPTH_ATTACHMENT:
+ return glsFboUtil.FormatFlags.DEPTH_RENDERABLE;
+ default:
+ if (glenum < gl.COLOR_ATTACHMENT0 || glenum > gl.COLOR_ATTACHMENT15) {
+ throw new Error('glenum out of range');
+ }
+ }
+ return glsFboUtil.FormatFlags.COLOR_RENDERABLE;
+ };
+
+ /**
+ * Remove value from array
+ * @param {Array} array
+ * @param {number} value
+ */
+ glsFboUtil.remove_from_array = function(array, value) {
+ var index = 0;
+ while ((index = array.indexOf(value)) != -1) {
+ array.splice(index, 1);
+ }
+ };
+
+ /**
+ * glsFboUtil.FormatExtEntry
+ * @constructor
+ * @struct
+ * @param {string=} extensions
+ * @param {number=} flags
+ * @param {glsFboUtil.Range=} formats
+ */
+ glsFboUtil.FormatExtEntry = function(extensions, flags, formats) {
+ this.extensions = null;
+ this.flags = null;
+ this.formats = null;
+
+ if (extensions !== undefined) {
+ this.extensions = extensions;
+ if (flags !== undefined) {
+ this.flags = flags;
+ if (formats !== undefined)
+ this.formats = formats;
+ }
+ }
+
+ };
+
+ /**
+ * glsFboUtil.Range
+ * @constructor
+ * @struct
+ * @template T
+ * @param {Array<T>} array
+ * @param {number=} begin
+ * @param {number=} end
+ */
+ glsFboUtil.Range = function(array, begin, end) {
+ // @private
+ this.m_begin = (begin === undefined ? 0 : begin);
+ // @private
+ this.m_end = end || array.length;
+ /**
+ * @private
+ * @type {Array<T>}
+ */
+ this.m_array = array;
+ // @private
+ this.m_index = this.m_begin;
+ };
+
+ /**
+ * @return {Array<T>}
+ */
+ glsFboUtil.Range.prototype.array = function() {
+ return this.m_array;
+ };
+
+ /**
+ * @return {number}
+ */
+ glsFboUtil.Range.prototype.begin = function() {
+ return this.m_begin;
+ };
+
+ /** *generated by script*
+ * @return {number}
+ */
+ glsFboUtil.Range.prototype.end = function() {
+ return this.m_end;
+ };
+
+ /**
+ * Returns the current pointer index as well as the current object
+ * @param {number} id
+ * @return {{first: number, second: T}}
+ */
+ glsFboUtil.Range.prototype.get = function(id) {
+ return {
+ first: id,
+ second: this.m_array[id]
+ };
+ };
+
+ /**
+ * Sets the internal pointer to the beginning of the range, and returns the first object.
+ * @return {T}
+ */
+ glsFboUtil.Range.prototype.reset = function() {
+ this.m_index = this.m_begin;
+ return this.current();
+ };
+
+ /**
+ * returns the current object within the specified range. The internal pointer is unaltered.
+ * @return {T}
+ */
+ glsFboUtil.Range.prototype.current = function() {
+ return this.m_index < this.m_end ? this.m_array[this.m_index] : null;
+ };
+
+ /**
+ * Increments the internal pointer
+ */
+ glsFboUtil.Range.prototype.next = function() {
+ ++this.m_index;
+ };
+
+ /**
+ * glsFboUtil.rangeArray
+ * replaces the macro GLS_ARRAY_RANGE
+ * Creates a new Range object from the specified array, spanning the whole array.
+ * @template T
+ * @param {Array<T>} array
+ * @return {glsFboUtil.Range<T>}
+ */
+ glsFboUtil.rangeArray = function(array) {
+ return new glsFboUtil.Range(array);
+ };
+
+ /**
+ * @constructor
+ * @struct
+ * @param {number=} format
+ * @param {number=} unsizedType
+ */
+ glsFboUtil.ImageFormat = function(format, unsizedType) {
+ this.format = format || 0;
+ //! Type if format is unsized, gl.NONE if sized.
+ this.unsizedType = unsizedType || 0;
+
+ };
+
+ /**
+ * @param {!glsFboUtil.ImageFormat} obj1
+ * @param {!glsFboUtil.ImageFormat} obj2
+ * @return {boolean}
+ */
+ glsFboUtil.ImageFormat.lessthan = function(obj1, obj2) {
+ return (
+ (obj1.format < obj2.format) ||
+ (obj1.format == obj2.format && obj1.unsizedType < obj2.unsizedType)
+ );
+ };
+
+ /**
+ * Sets the object's parameters to gl.NONE
+ */
+ glsFboUtil.ImageFormat.prototype.none = function() {
+ this.format = 0;
+ this.unsizedType = 0;
+ };
+
+ /**
+ * @return {glsFboUtil.ImageFormat}
+ */
+ glsFboUtil.ImageFormat.none = function() {
+ var obj = new glsFboUtil.ImageFormat();
+ obj.none();
+ return obj;
+ };
+
+ // where key is a FormatKey, and a FormatKey is a unsigned 32bit int.
+
+ /**
+ * @param {number} key
+ * @return {glsFboUtil.ImageFormat}
+ */
+ glsFboUtil.formatKeyInfo = function(key) {
+ return new glsFboUtil.ImageFormat(
+ (key & 0x0000ffff),
+ (key & 0xffff0000) >>> 16
+ );
+ };
+
+ /**
+ * glsFboUtil.Config Class.
+ * @constructor
+ */
+ glsFboUtil.Config = function() {
+ this.type = glsFboUtil.Config.s_types.CONFIG;
+ this.target = glsFboUtil.Config.s_target.NONE;
+ };
+ /**
+ * @enum {number}
+ */
+ glsFboUtil.Config.s_target = {
+ NONE: 0,
+ RENDERBUFFER: 0x8D41,
+ TEXTURE_2D: 0x0DE1,
+ TEXTURE_CUBE_MAP: 0x8513,
+ TEXTURE_3D: 0x806F,
+ TEXTURE_2D_ARRAY: 0x8C1A,
+
+ FRAMEBUFFER: 0x8D40
+ };
+
+ // the c++ uses dynamic casts to determain if an object inherits from a
+ // given class. Here, each class' constructor assigns a bit to obj.type.
+ // look for the bit to see if an object inherits that class.
+
+ /**
+ * @enum
+ */
+ glsFboUtil.Config.s_types = {
+ CONFIG: 0x000001,
+
+ IMAGE: 0x000010,
+ RENDERBUFFER: 0x000020,
+ TEXTURE: 0x000040,
+ TEXTURE_FLAT: 0x000080,
+ TEXTURE_2D: 0x000100,
+ TEXTURE_CUBE_MAP: 0x000200,
+ TEXTURE_LAYERED: 0x000400,
+ TEXTURE_3D: 0x000800,
+ TEXTURE_2D_ARRAY: 0x001000,
+
+ ATTACHMENT: 0x010000,
+ ATT_RENDERBUFFER: 0x020000,
+ ATT_TEXTURE: 0x040000,
+ ATT_TEXTURE_FLAT: 0x080000,
+ ATT_TEXTURE_LAYER: 0x100000,
+
+ UNUSED: 0xFFE0E00E
+ };
+
+ /**
+ * glsFboUtil.Image Class.
+ * @constructor
+ * @extends {glsFboUtil.Config}
+ */
+ glsFboUtil.Image = function() {
+ glsFboUtil.Config.call(this);
+ this.type |= glsFboUtil.Config.s_types.IMAGE;
+ this.width = 0;
+ this.height = 0;
+ this.internalFormat = new glsFboUtil.ImageFormat();
+ };
+
+ /**
+ * glsFboUtil.Renderbuffer Class.
+ * @constructor
+ * @extends {glsFboUtil.Image}
+ */
+ glsFboUtil.Renderbuffer = function() {
+ glsFboUtil.Image.call(this);
+ this.type |= glsFboUtil.Config.s_types.RENDERBUFFER;
+ this.target = glsFboUtil.Config.s_target.RENDERBUFFER;
+ this.numSamples = 0;
+ };
+
+ /**
+ * glsFboUtil.Texture Class.
+ * @constructor
+ * @extends {glsFboUtil.Image}
+ */
+ glsFboUtil.Texture = function() {
+ glsFboUtil.Image.call(this);
+ this.type |= glsFboUtil.Config.s_types.TEXTURE;
+ this.numLevels = 1;
+ };
+
+ /**
+ * glsFboUtil.TextureFlat Class.
+ * @constructor
+ * @extends {glsFboUtil.Texture}
+ */
+ glsFboUtil.TextureFlat = function() {
+ glsFboUtil.Texture.call(this);
+ this.type |= glsFboUtil.Config.s_types.TEXTURE_FLAT;
+ };
+
+ /**
+ * glsFboUtil.Texture2D Class.
+ * @constructor
+ * @extends {glsFboUtil.TextureFlat}
+ */
+ glsFboUtil.Texture2D = function() {
+ glsFboUtil.TextureFlat.call(this);
+ this.type |= glsFboUtil.Config.s_types.TEXTURE_2D;
+ this.target = glsFboUtil.Config.s_target.TEXTURE_2D;
+ };
+
+ /**
+ * glsFboUtil.TextureCubeMap Class.
+ * @constructor
+ * @extends {glsFboUtil.TextureFlat}
+ */
+ glsFboUtil.TextureCubeMap = function() {
+ glsFboUtil.TextureFlat.call(this);
+ this.type |= glsFboUtil.Config.s_types.TEXTURE_CUBE_MAP;
+ this.target = glsFboUtil.Config.s_target.TEXTURE_CUBE_MAP;
+ };
+
+ /**
+ * glsFboUtil.TextureLayered Class.
+ * @constructor
+ * @extends {glsFboUtil.Texture}
+ */
+ glsFboUtil.TextureLayered = function() {
+ glsFboUtil.Texture.call(this);
+ this.type |= glsFboUtil.Config.s_types.TEXTURE_LAYERED;
+ this.numLayers = 1;
+ };
+
+ /**
+ * glsFboUtil.Texture3D Class.
+ * @constructor
+ * @extends {glsFboUtil.TextureLayered}
+ */
+ glsFboUtil.Texture3D = function() {
+ glsFboUtil.TextureLayered.call(this);
+ this.type |= glsFboUtil.Config.s_types.TEXTURE_3D;
+ this.target = glsFboUtil.Config.s_target.TEXTURE_3D;
+ };
+
+ /**
+ * glsFboUtil.Texture2DArray Class.
+ * @constructor
+ * @extends {glsFboUtil.TextureLayered}
+ */
+ glsFboUtil.Texture2DArray = function() {
+ glsFboUtil.TextureLayered.call(this);
+ this.type |= glsFboUtil.Config.s_types.TEXTURE_2D_ARRAY;
+ this.target = glsFboUtil.Config.s_target.TEXTURE_2D_ARRAY;
+ };
+
+ /**
+ * glsFboUtil.Attachment Class.
+ * @constructor
+ * @extends {glsFboUtil.Config}
+ */
+ glsFboUtil.Attachment = function() {
+ glsFboUtil.Config.call(this);
+
+ this.type |= glsFboUtil.Config.s_types.ATTACHMENT;
+
+ /** @type {glsFboUtil.Config.s_target} */
+ this.target = glsFboUtil.Config.s_target.FRAMEBUFFER;
+
+ /** @type {WebGLObject} */
+ this.imageName = null;
+ };
+
+ /**
+ * this function is declared, but has no definition/is unused in the c++
+ * @param {number} attPoint
+ * @param {number} image
+ * @param {number} vfr
+ */
+ glsFboUtil.Attachment.prototype.isComplete = function(attPoint, image, vfr) { };
+
+ /**
+ * glsFboUtil.RenderBufferAttachments Class.
+ * @constructor
+ * @extends {glsFboUtil.Attachment}
+ */
+ glsFboUtil.RenderbufferAttachment = function() {
+ glsFboUtil.Attachment.call(this);
+ this.type |= glsFboUtil.Config.s_types.ATT_RENDERBUFFER;
+ this.renderbufferTarget = glsFboUtil.Config.s_target.RENDERBUFFER;
+ };
+ glsFboUtil.RenderbufferAttachment.prototype = Object.create(glsFboUtil.Attachment.prototype);
+ glsFboUtil.RenderbufferAttachment.prototype.constructor = glsFboUtil.RenderbufferAttachment;
+
+ /**
+ * glsFboUtil.TextureAttachment Class.
+ * @constructor
+ * @extends {glsFboUtil.Attachment}
+ */
+ glsFboUtil.TextureAttachment = function() {
+ glsFboUtil.Attachment.call(this);
+ this.type |= glsFboUtil.Config.s_types.ATT_TEXTURE;
+ this.level = 0;
+ };
+ glsFboUtil.TextureAttachment.prototype = Object.create(glsFboUtil.Attachment.prototype);
+ glsFboUtil.TextureAttachment.prototype.constructor = glsFboUtil.TextureAttachment;
+
+ /**
+ * glsFboUtil.TextureFlatAttachment Class.
+ * @constructor
+ * @extends {glsFboUtil.TextureAttachment}
+ */
+ glsFboUtil.TextureFlatAttachment = function() {
+ glsFboUtil.TextureAttachment.call(this);
+ this.type |= glsFboUtil.Config.s_types.ATT_TEXTURE_FLAT;
+ this.texTarget = glsFboUtil.Config.s_target.NONE;
+ };
+ glsFboUtil.TextureFlatAttachment.prototype = Object.create(glsFboUtil.TextureAttachment.prototype);
+ glsFboUtil.TextureFlatAttachment.prototype.constructor = glsFboUtil.TextureFlatAttachment;
+
+ /**
+ * glsFboUtil.TextureLayerAttachment Class.
+ * @constructor
+ * @extends {glsFboUtil.TextureAttachment}
+ */
+ glsFboUtil.TextureLayerAttachment = function() {
+ glsFboUtil.TextureAttachment.call(this);
+ this.type |= glsFboUtil.Config.s_types.ATT_TEXTURE_LAYER;
+ this.layer = 0;
+ };
+ glsFboUtil.TextureLayerAttachment.prototype = Object.create(glsFboUtil.TextureAttachment.prototype);
+ glsFboUtil.TextureLayerAttachment.prototype.constructor = glsFboUtil.TextureLayerAttachment;
+
+ // these are a collection of helper functions for creating various gl textures.
+ glsFboUtil.glsup = function() {
+
+ var glInit = function(cfg, gl) {
+ if ((cfg.type & glsFboUtil.Config.s_types.TEXTURE_2D) != 0) {
+ glInitFlat(cfg, glTarget(cfg, gl), gl);
+
+ } else if ((cfg.type & glsFboUtil.Config.s_types.TEXTURE_CUBE_MAP) != 0) {
+ for (var i = gl.TEXTURE_CUBE_MAP_NEGATIVE_X; i <= gl.TEXTURE_CUBE_MAP_POSITIVE_Z; ++i)
+ glInitFlat(cfg, i, gl);
+ } else if ((cfg.type & glsFboUtil.Config.s_types.TEXTURE_3D) != 0) {
+ glInitLayered(cfg, 2, gl);
+
+ } else if ((cfg.type & glsFboUtil.Config.s_types.TEXTURE_2D_ARRAY) != 0) {
+ glInitLayered(cfg, 1, gl);
+ }
+ };
+
+ var glInitFlat = function(cfg, target, gl) {
+ var format = glsFboUtil.transferImageFormat(cfg.internalFormat, gl);
+ var w = cfg.width;
+ var h = cfg.height;
+ for (var level = 0; level < cfg.numLevels; ++level) {
+ gl.texImage2D(
+ target, level, cfg.internalFormat.format,
+ w, h, 0, format.format, format.dataType, null
+ );
+ w = Math.max(1, w / 2);
+ h = Math.max(1, h / 2);
+ }
+ };
+
+ var glInitLayered = function(cfg, depth_divider, gl) {
+ var format = glsFboUtil.transferImageFormat(cfg.internalFormat, gl);
+ var w = cfg.width;
+ var h = cfg.height;
+ var depth = cfg.numLayers;
+ for (var level = 0; level < cfg.numLevels; ++level) {
+ gl.texImage3D(
+ glTarget(cfg, gl), level, cfg.internalFormat.format,
+ w, h, depth, 0, format.format, format.dataType, null
+ );
+ w = Math.max(1, w / 2);
+ h = Math.max(1, h / 2);
+ depth = Math.max(1, depth / depth_divider);
+ }
+ };
+
+ var glCreate = function(cfg, gl) {
+ if (!(gl = gl || window.gl)) throw new Error('Invalid gl object');
+
+ if (cfg.type & glsFboUtil.Config.s_types.RENDERBUFFER) {
+ var ret = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, ret);
+
+ if (cfg.numSamples == 0) {
+ gl.renderbufferStorage(
+ gl.RENDERBUFFER,
+ cfg.internalFormat.format,
+ cfg.width, cfg.height
+ );
+ } else {
+ gl.renderbufferStorageMultisample(
+ gl.RENDERBUFFER,
+ cfg.numSamples,
+ cfg.internalFormat.format,
+ cfg.width, cfg.height
+ );
+ }
+ gl.bindRenderbuffer(gl.RENDERBUFFER, null);
+
+ } else if (cfg.type & glsFboUtil.Config.s_types.TEXTURE) {
+ var ret = gl.createTexture();
+ gl.bindTexture(glTarget(cfg, gl), ret);
+ glInit(cfg, gl);
+ gl.bindTexture(glTarget(cfg, gl), null);
+
+ } else {
+ throw new Error('Impossible image type');
+ }
+ return ret;
+ };
+
+ var glTarget = function(cfg, gl) {
+ if (!(gl = gl || window.gl)) throw new Error('Invalid gl object');
+ var mask = (
+ glsFboUtil.Config.s_types.RENDERBUFFER |
+ glsFboUtil.Config.s_types.TEXTURE_2D |
+ glsFboUtil.Config.s_types.TEXTURE_CUBE_MAP |
+ glsFboUtil.Config.s_types.TEXTURE_3D |
+ glsFboUtil.Config.s_types.TEXTURE_2D_ARRAY
+ );
+ switch (cfg.type & mask) {
+ case glsFboUtil.Config.s_types.RENDERBUFFER: return gl.RENDERBUFFER;
+ case glsFboUtil.Config.s_types.TEXTURE_2D: return gl.TEXTURE_2D;
+ case glsFboUtil.Config.s_types.TEXTURE_CUBE_MAP: return gl.TEXTURE_CUBE_MAP;
+ case glsFboUtil.Config.s_types.TEXTURE_3D: return gl.TEXTURE_3D;
+ case glsFboUtil.Config.s_types.TEXTURE_2D_ARRAY: return gl.TEXTURE_2D_ARRAY;
+ default: break;
+ }
+ throw new Error('Impossible image type.');
+ };
+
+ var glDelete = function(cfg, img, gl) {
+ if (cfg.type & glsFboUtil.Config.s_types.RENDERBUFFER)
+ gl.deleteRenderbuffer(img);
+ else if (cfg.type & glsFboUtil.Config.s_types.TEXTURE)
+ gl.deleteTexture(img);
+ else
+ throw new Error('Impossible image type');
+ };
+
+ return {
+ create: glCreate,
+ remove: glDelete
+ };
+
+ }();
+
+ /** *generated by script*
+ * @param {number} img
+ * @return {number}
+ */
+ glsFboUtil.imageNumSamples = function(img) {
+ return (img.numSamples != undefined) ? img.numSamples : 0;
+ };
+
+ /** *generated by script*
+ * @param {glsFboUtil.Attachment} att
+ * @param {number} attPoint
+ * @param {WebGLRenderingContextBase=} gl
+ * @throws {Error}
+ */
+ glsFboUtil.attachAttachment = function(att, attPoint, gl) {
+ if (!(gl = gl || window.gl)) throw new Error('Invalid gl object');
+
+ var mask = (
+ glsFboUtil.Config.s_types.ATT_RENDERBUFFER |
+ glsFboUtil.Config.s_types.ATT_TEXTURE_FLAT |
+ glsFboUtil.Config.s_types.ATT_TEXTURE_LAYER
+ );
+
+ switch (att.type & mask) {
+ case glsFboUtil.Config.s_types.ATT_RENDERBUFFER:
+ gl.framebufferRenderbuffer(
+ att.target, attPoint, att.renderbufferTarget, /** @type {WebGLRenderbuffer} */(att.imageName)
+ );
+ break;
+ case glsFboUtil.Config.s_types.ATT_TEXTURE_FLAT:
+ gl.framebufferTexture2D(
+ att.target, attPoint, att.texTarget, /** @type {WebGLTexture} */(att.imageName), att.level
+ );
+ break;
+ case glsFboUtil.Config.s_types.ATT_TEXTURE_LAYER:
+ gl.framebufferTextureLayer(
+ att.target, attPoint, /** @type {WebGLTexture} */(att.imageName), att.level, att.layer
+ );
+ break;
+ default:
+ throw new Error('Impossible attachment type');
+ }
+
+ };
+
+ /** *generated by script*
+ * @param {glsFboUtil.Attachment} att
+ * @param {WebGLRenderingContextBase=} gl
+ * @return {number}
+ * @throws {Error}
+ */
+ glsFboUtil.attachmentType = function(att, gl) {
+ if (!(gl = gl || window.gl)) throw new Error('Invalid gl object');
+
+ if (att.type & glsFboUtil.Config.s_types.ATT_RENDERBUFFER) {
+ return gl.RENDERBUFFER;
+ }
+ if (att.type & glsFboUtil.Config.s_types.ATT_TEXTURE) {
+ return gl.TEXTURE;
+ }
+ throw new Error('Impossible attachment type.');
+
+ };
+
+ /**
+ * @param {glsFboUtil.Attachment} att
+ * @return {number}
+ * @throws {Error}
+ */
+ glsFboUtil.textureLayer = function(att) {
+ if (att.type & glsFboUtil.Config.s_types.ATT_TEXTURE_FLAT) return 0;
+ if (att.type & glsFboUtil.Config.s_types.ATT_TEXTURE_LAYER) return att.layer;
+ throw new Error('Impossible attachment type.');
+ };
+
+ /**
+ * @param {glsFboUtil.Checker} cctx
+ * @param {glsFboUtil.Attachment} att
+ * @param {number} attPoint
+ * @param {glsFboUtil.Image} image
+ * @param {glsFboUtil.FormatDB} db
+ * @param {WebGLRenderingContextBase=} gl
+ * @throws {Error}
+ */
+ glsFboUtil.checkAttachmentCompleteness = function(cctx, att, attPoint, image, db, gl) {
+ if (!(gl = gl || window.gl)) throw new Error('Invalid gl object');
+
+ // GLES2 4.4.5 / GLES3 4.4.4, "glsFboUtil.Framebuffer attachment completeness"
+ if (
+ (att.type & glsFboUtil.Config.s_types.ATT_TEXTURE) &&
+ (image.type & glsFboUtil.Config.s_types.TEXTURE_LAYERED)
+ ) {
+ // GLES3: "If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is
+ // TEXTURE and the value of FRAMEBUFFER_ATTACHMENT_OBJECT_NAME names a
+ // three-dimensional texture, then the value of
+ // FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER must be smaller than the depth
+ // of the texture.
+ //
+ // GLES3: "If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is
+ // TEXTURE and the value of FRAMEBUFFER_ATTACHMENT_OBJECT_NAME names a
+ // two-dimensional array texture, then the value of
+ // FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER must be smaller than the
+ // number of layers in the texture.
+ cctx.addFBOStatus(
+ glsFboUtil.textureLayer(att) < image.numLayers,
+ gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT
+ );
+ }
+
+ // "The width and height of image are non-zero."
+ cctx.addFBOStatus(
+ image.width > 0 && image.height > 0,
+ gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT
+ );
+
+ // Check for renderability
+ var flags = db.getFormatInfo(image.internalFormat, glsFboUtil.FormatFlags.ANY_FORMAT);
+
+ // If the format does not have the proper renderability flag, the
+ // completeness check _must_ fail.
+ cctx.addFBOStatus(
+ (flags & glsFboUtil.formatFlag(attPoint)) != 0,
+ gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT
+ );
+
+ // If the format is only optionally renderable, the completeness check _can_ fail.
+ cctx.addPotentialFBOStatus(
+ (flags & glsFboUtil.FormatFlags.REQUIRED_RENDERABLE) != 0,
+ gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT
+ );
+
+ };
+
+ // replaces GLS_UNSIZED_FORMATKEY
+
+ /**
+ * All params and return types for this function are 32 bit
+ * @param {number} format
+ * @param {number} type
+ * @return {number}
+ */
+ glsFboUtil.formatkey = function(format, type) {
+ // The formatkey value should be 32-bit unsigned int.
+ return ((type << 16) >>> 0 | format) & 0xFFFFFFFF;
+ };
+
+ /**
+ * @enum
+ */
+ glsFboUtil.FormatFlags = {
+ ANY_FORMAT: 0x00,
+ COLOR_RENDERABLE: 0x01,
+ DEPTH_RENDERABLE: 0x02,
+ STENCIL_RENDERABLE: 0x04,
+ RENDERBUFFER_VALID: 0x08,
+ TEXTURE_VALID: 0x10,
+ REQUIRED_RENDERABLE: 0x20 //< Without this, renderability is allowed, not required.
+ };
+
+ /**
+ * A framebuffer configuration
+ * @constructor
+ * @param {WebGLRenderingContextBase=} gl
+ */
+ glsFboUtil.Framebuffer = function(gl) {
+ this.m_gl = gl || window.gl;
+ this.fbid = 0;
+
+ var fbidCompare = function(obj1, obj2) {
+ return obj1._fbid < obj2._fbid;
+ };
+
+ this.attachments = /** @type {glsFboUtil.Map<number,glsFboUtil.Attachment>} */(
+ new glsFboUtil.Map(glsFboUtil.Map.compareNumber)
+ );
+ this.textures = /** @type {glsFboUtil.Map<Object,glsFboUtil.Texture>} */(
+ new glsFboUtil.Map(fbidCompare)
+ );
+ this.rbos = /** @type {glsFboUtil.Map<Object,glsFboUtil.Renderbuffer>} */(
+ new glsFboUtil.Map(fbidCompare)
+ );
+ };
+
+ /**
+ * @param {number} attPoint
+ * @param {glsFboUtil.Attachment} att
+ */
+ glsFboUtil.Framebuffer.prototype.attach = function(attPoint, att) {
+ if (!att) {
+ this.attachments.remove(attPoint);
+ } else {
+ this.attachments.set(attPoint, att);
+ }
+ };
+
+ /**
+ * @param {WebGLTexture} texName
+ * @param {glsFboUtil.Texture} texCfg
+ */
+ glsFboUtil.Framebuffer.prototype.setTexture = function(texName, texCfg) {
+ texName._fbid = this.fbid++;
+ this.textures.set(texName, texCfg);
+ };
+
+ /**
+ * @param {WebGLRenderbuffer} rbName
+ * @param {glsFboUtil.Renderbuffer} rbCfg
+ */
+ glsFboUtil.Framebuffer.prototype.setRbo = function(rbName, rbCfg) {
+ rbName._fbid = this.fbid++;
+ this.rbos.set(rbName, rbCfg);
+ };
+
+ /**
+ * @param {number} type
+ * @param {WebGLObject} imgName
+ * @return {glsFboUtil.Image}
+ * @throws {Error}
+ */
+ glsFboUtil.Framebuffer.prototype.getImage = function(type, imgName) {
+ switch (type) {
+ case this.m_gl.TEXTURE: return this.textures.lookupDefault(/** @type {WebGLTexture} */(imgName), null);
+ case this.m_gl.RENDERBUFFER: return this.rbos.lookupDefault(/** @type {WebGLTexture} */(imgName), null);
+ default: break;
+ }
+ throw new Error('Bad image type.');
+ };
+
+ /**
+ * @constructor
+ * @extends {glsFboUtil.Framebuffer}
+ * @param {WebGLFramebuffer} fbo
+ * @param {number} target
+ * @param {WebGLRenderingContextBase=} gl
+ */
+ glsFboUtil.FboBuilder = function(fbo, target, gl) {
+ glsFboUtil.Framebuffer.call(this, gl);
+
+ this.m_gl = gl || window.gl;
+ this.m_target = target;
+ this.m_configs = [];
+ this.m_error = this.m_gl.NO_ERROR;
+
+ this.m_gl.bindFramebuffer(this.m_target, fbo);
+
+ };
+
+ glsFboUtil.FboBuilder.prototype = Object.create(glsFboUtil.Framebuffer.prototype);
+ glsFboUtil.FboBuilder.prototype.constructor = glsFboUtil.FboBuilder;
+
+ glsFboUtil.FboBuilder.prototype.deinit = function() {
+
+ var pair;
+ for (var i = 0; i < this.textures.length; ++i) {
+ pair = this.textures.getIndex(i);
+ glsFboUtil.glsup.remove(pair.second, pair.first, this.m_gl);
+ }
+ this.textures.clear();
+
+ for (var i = 0; i < this.rbos.length; ++i) {
+ pair = this.rbos.getIndex(i);
+ glsFboUtil.glsup.remove(pair.second, pair.first, this.m_gl);
+ }
+ this.rbos.clear();
+
+ this.m_gl.bindFramebuffer(this.m_target, null);
+/*
+ for (var i = 0 ; i < this.m_configs.length ; ++i) {
+ delete this.m_configs[i];
+ }
+//*/
+ };
+
+ /**
+ * @param {number} attPoint
+ * @param {glsFboUtil.Attachment} att
+ */
+ glsFboUtil.FboBuilder.prototype.glAttach = function(attPoint, att) {
+ if (!att) {
+ this.m_gl.framebufferRenderbuffer(this.m_target, attPoint, this.m_gl.RENDERBUFFER, null);
+ } else {
+ glsFboUtil.attachAttachment(att, attPoint, this.m_gl);
+ }
+ this.checkError();
+ this.attach(attPoint, att);
+ };
+
+ /**
+ * @param {glsFboUtil.Texture} texCfg
+ * @return {WebGLTexture}
+ */
+ glsFboUtil.FboBuilder.prototype.glCreateTexture = function(texCfg) {
+ var texName = glsFboUtil.glsup.create(texCfg, this.m_gl);
+ this.checkError();
+ this.setTexture(texName, texCfg);
+ return texName;
+ };
+
+ /** *generated by script*
+ * @param {glsFboUtil.Renderbuffer} rbCfg
+ * @return {WebGLRenderbuffer}
+ */
+ glsFboUtil.FboBuilder.prototype.glCreateRbo = function(rbCfg) {
+ var rbName = glsFboUtil.glsup.create(rbCfg, this.m_gl);
+ this.checkError();
+ this.setRbo(rbName, rbCfg);
+ return rbName;
+ };
+
+ /**
+ * @param {function(new:glsFboUtil.Config)} Definition
+ * @return {glsFboUtil.Config}
+ */
+ glsFboUtil.FboBuilder.prototype.makeConfig = function(Definition) {
+ var cfg = new Definition();
+ this.m_configs.push(cfg);
+ return cfg;
+ };
+
+ /**
+ */
+ glsFboUtil.FboBuilder.prototype.checkError = function() {
+ var error = this.m_gl.getError();
+ if (error != this.m_gl.NO_ERROR && this.m_error == this.m_gl.NO_ERROR) {
+ this.m_error = error;
+ }
+ };
+
+ /** *generated by script*
+ * @return {number}
+ */
+ glsFboUtil.FboBuilder.prototype.getError = function() {
+ return this.m_error;
+ };
+
+ glsFboUtil.isFramebufferStatus = function(fboStatus) {
+ return gluStrUtil.getFramebufferStatusName(fboStatus) != '';
+ }
+
+ glsFboUtil.isErrorCode = function(errorCode) {
+ return gluStrUtil.getErrorName(errorCode) != '';
+ }
+
+ /**
+ * @typedef {funcion(): glsFboUtil.ValidStatusCodes}
+ */
+ glsFboUtil.ValidStatusCodes = function() {
+ this.m_errorCodes = [];
+ this.m_errorStatusCodes = [];
+ this.m_allowComplete = false;
+ };
+
+ glsFboUtil.ValidStatusCodes.prototype.isFBOStatusValid = function(fboStatus) {
+ if (fboStatus == gl.FRAMEBUFFER_COMPLETE)
+ return this.m_allowComplete;
+ else {
+ for(var ndx = 0; ndx < this.m_errorStatusCodes.length; ++ndx) {
+ if (this.m_errorStatusCodes[ndx] == fboStatus)
+ return true;
+ }
+ return false;
+ }
+ };
+
+ glsFboUtil.ValidStatusCodes.prototype.isFBOStatusRequired = function(fboStatus) {
+ if (fboStatus == gl.FRAMEBUFFER_COMPLETE)
+ return this.m_allowComplete && this.m_errorStatusCodes.length == 0;
+ else
+ // fboStatus is the only allowed error status and succeeding is forbidden
+ return !this.m_allowComplete && this.m_errorStatusCodes.length == 1 && this.m_errorStatusCodes[0] == fboStatus;
+ };
+
+ glsFboUtil.ValidStatusCodes.prototype.isErrorCodeValid = function(errorCode) {
+ if (errorCode == gl.NO_ERROR)
+ return this.m_errorCodes.length == 0;
+ else {
+ // rule violation exists?
+ for (var ndx = 0; ndx < this.m_errorCodes.length; ++ndx) {
+ if (this.m_errorCodes[ndx] == errorCode)
+ return true;
+ }
+ return false;
+ }
+ };
+
+ glsFboUtil.ValidStatusCodes.prototype.isErrorCodeRequired = function(errorCode) {
+ if (this.m_errorCodes.length == 0 && errorCode == gl.NO_ERROR)
+ return true;
+ else
+ // only this error code listed
+ return this.m_errorCodes.length == 1 && merrorCodes[0] == errorCode;
+ };
+
+ glsFboUtil.ValidStatusCodes.prototype.addErrorCode = function(error) {
+ DE_ASSERT(glsFboUtil.isErrorCode(error));
+ DE_ASSERT(error != gl.NO_ERROR)
+ this.m_errorCodes.push(error);
+ };
+
+ glsFboUtil.ValidStatusCodes.prototype.addFBOErrorStatus = function(status) {
+ DE_ASSERT(glsFboUtil.isFramebufferStatus(status));
+ DE_ASSERT(status != gl.FRAMEBUFFER_COMPLETE)
+ this.m_errorStatusCodes.push(status);
+ };
+
+ glsFboUtil.ValidStatusCodes.prototype.setAllowComplete = function(b) {
+ this.m_allowComplete = b;
+ };
+
+ /**
+ * @typedef {function(): glsFboUtil.Checker}
+ */
+ glsFboUtil.CheckerFactory;
+
+ /**
+ * @constructor
+ * @param {WebGLRenderingContextBase=} gl
+ * @throws {Error}
+ */
+ glsFboUtil.Checker = function(gl) {
+ if (!(gl = gl || window.gl)) throw new Error('Invalid gl object');
+
+ this.m_statusCodes = new glsFboUtil.ValidStatusCodes();
+ this.m_statusCodes.setAllowComplete(true);
+
+ if (typeof(this.check) != 'function')
+ throw new Error('Constructor called on virtual class: glsFboUtil.Checker');
+ };
+
+ /**
+ * @param {boolean} condition
+ * @param {number} error
+ */
+ glsFboUtil.Checker.prototype.addGLError = function(condition, error) {
+ if (!condition) {
+ this.m_statusCodes.addErrorCode(error);
+ this.m_statusCodes.setAllowComplete(false);
+ }
+ };
+
+ /**
+ * @param {boolean} condition
+ * @param {number} error
+ */
+ glsFboUtil.Checker.prototype.addPotentialGLError = function(condition, error) {
+ if (!condition) {
+ this.m_statusCodes.addErrorCode(error);
+ }
+ };
+
+ /**
+ * @param {boolean} condition
+ * @param {number} status
+ */
+ glsFboUtil.Checker.prototype.addFBOStatus = function(condition, status) {
+ if (!condition) {
+ this.m_statusCodes.addFBOErrorStatus(status);
+ this.m_statusCodes.setAllowComplete(false);
+ }
+ };
+
+ /**
+ * @param {boolean} condition
+ * @param {number} status
+ */
+ glsFboUtil.Checker.prototype.addPotentialFBOStatus = function(condition, status) {
+ if (!condition) {
+ this.m_statusCodes.addFBOErrorStatus(status);
+ }
+ };
+
+ /**
+ * @return {Array<number>}
+ */
+ glsFboUtil.Checker.prototype.getStatusCodes = function () {
+ return this.m_statusCodes;
+ };
+
+ /**
+ * @param {glsFboUtil.ImageFormat} imgFormat
+ * @param {WebGLRenderingContextBase=} gl
+ * @return {gluTextureUtil.TransferFormat}
+ * @throws {Error}
+ */
+ glsFboUtil.transferImageFormat = function(imgFormat, gl) {
+ if (!(gl = gl || window.gl)) throw new Error('Invalid gl object');
+ if (imgFormat.unsizedType == gl.NONE)
+ return gluTextureUtil.getTransferFormat(gluTextureUtil.mapGLInternalFormat(imgFormat.format));
+ else
+ return new gluTextureUtil.TransferFormat(imgFormat.format, imgFormat.unsizedType);
+ };
+
+ // FormatDB, CheckerFactory
+
+ /**
+ * @constructor
+ * @param {glsFboUtil.FormatDB} formats
+ * @param {glsFboUtil.CheckerFactory} factory
+ */
+ glsFboUtil.FboVerifier = function(formats, factory) {
+ this.m_formats = formats;
+ this.m_factory = factory;
+ };
+ // config::Framebuffer
+ glsFboUtil.FboVerifier.prototype.validStatusCodes = function(cfg, gl) {
+ if (!(gl = gl || window.gl)) throw new Error('Invalid gl object');
+
+ /** @type {glsFboUtil.Checker} */
+ var cctx = this.m_factory();
+
+ for (var id = 0; id < cfg.textures.length; ++id) {
+ var flags = this.m_formats.getFormatInfo(cfg.textures.getIndex(id).second.internalFormat, glsFboUtil.FormatFlags.ANY_FORMAT);
+ var textureIsValid = (flags & glsFboUtil.FormatFlags.TEXTURE_VALID) != 0;
+ cctx.addGLError(textureIsValid, gl.INVALID_ENUM);
+ cctx.addGLError(textureIsValid, gl.INVALID_OPERATION);
+ cctx.addGLError(textureIsValid, gl.INVALID_VALUE);
+ }
+
+ for (var id = 0; id < cfg.rbos.length; ++id) {
+ var flags = this.m_formats.getFormatInfo(cfg.rbos.getIndex(id).second.internalFormat, glsFboUtil.FormatFlags.ANY_FORMAT);
+ var rboIsValid = (flags & glsFboUtil.FormatFlags.RENDERBUFFER_VALID) != 0;
+ cctx.addGLError(rboIsValid, gl.INVALID_ENUM);
+ }
+
+ var count = 0;
+ for (var index = 0; index < cfg.attachments.length; ++index) {
+ var attPoint = cfg.attachments.getIndex(index).first;
+ var att = cfg.attachments.getIndex(index).second;
+ /** @type {glsFboUtil.Image}*/
+ var image = cfg.getImage(glsFboUtil.attachmentType(att, gl), att.imageName);
+ glsFboUtil.checkAttachmentCompleteness(cctx, att, attPoint, image, this.m_formats, gl);
+ cctx.check(attPoint, att, image);
+ ++count;
+ }
+
+ // "There is at least one image attached to the framebuffer."
+ // TODO: support XXX_framebuffer_no_attachments
+ cctx.addFBOStatus(count > 0, gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);
+
+ return cctx.getStatusCodes();
+
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsLifetimeTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsLifetimeTests.js
new file mode 100644
index 0000000000..427a3a4fce
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsLifetimeTests.js
@@ -0,0 +1,1118 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+'use strict';
+goog.provide('modules.shared.glsLifetimeTests');
+goog.require('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuStringTemplate');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('modules.shared.glsTextureTestUtil');
+
+goog.scope(function() {
+var glsLifetimeTests = modules.shared.glsLifetimeTests;
+var tcuStringTemplate = framework.common.tcuStringTemplate;
+var tcuSurface = framework.common.tcuSurface;
+var deRandom = framework.delibs.debase.deRandom;
+var glsTextureTestUtil = modules.shared.glsTextureTestUtil;
+var gluShaderProgram = framework.opengl.gluShaderProgram;
+var tcuTestCase = framework.common.tcuTestCase;
+var tcuImageCompare = framework.common.tcuImageCompare;
+
+/** @const */ var VIEWPORT_SIZE = 128;
+/** @const */ var FRAMEBUFFER_SIZE = 128;
+
+var setParentClass = function(child, parent) {
+ child.prototype = Object.create(parent.prototype);
+ child.prototype.constructor = child;
+};
+
+/** @const */ var s_vertexShaderSrc =
+ '#version 100\n' +
+ 'attribute vec2 pos;\n' +
+ 'void main()\n' +
+ '{\n' +
+ ' gl_Position = vec4(pos.xy, 0.0, 1.0);\n' +
+ '}\n';
+
+/** @const */ var s_fragmentShaderSrc =
+ '#version 100\n' +
+ 'void main()\n' +
+ '{\n' +
+ ' gl_FragColor = vec4(1.0);\n' +
+ '}\n';
+
+/**
+ * @constructor
+ * @extends {gluShaderProgram.Shader}
+ * @param {gluShaderProgram.shaderType} type
+ * @param {string} src
+ */
+glsLifetimeTests.CheckedShader = function(type, src) {
+ gluShaderProgram.Shader.call(this, gl, type);
+ this.setSources(src);
+ this.compile();
+ assertMsgOptions(this.getCompileStatus() === true, 'Failed to compile shader', false, true);
+};
+
+setParentClass(glsLifetimeTests.CheckedShader, gluShaderProgram.Shader);
+
+/**
+ * @constructor
+ * @extends {gluShaderProgram.Program}
+ * @param {WebGLShader} vtxShader
+ * @param {WebGLShader} fragShader
+ */
+glsLifetimeTests.CheckedProgram = function(vtxShader, fragShader) {
+ gluShaderProgram.Program.call(this, gl);
+ this.attachShader(vtxShader);
+ this.attachShader(fragShader);
+ this.link();
+ assertMsgOptions(this.info.linkOk === true, 'Failed to link program', false, true);
+};
+
+setParentClass(glsLifetimeTests.CheckedProgram, gluShaderProgram.Program);
+
+/**
+ * @constructor
+ */
+glsLifetimeTests.Binder = function() {
+};
+
+/**
+ * @param {WebGLObject} obj
+ */
+glsLifetimeTests.Binder.prototype.bind = function(obj) { throw new Error('Virtual function'); };
+
+/**
+ * @return {WebGLObject}
+ */
+glsLifetimeTests.Binder.prototype.getBinding = function() { throw new Error('Virtual function'); };
+
+/**
+ * @constructor
+ * @extends {glsLifetimeTests.Binder}
+ * @param {?function(number, ?)} bindFunc
+ * @param {number} bindTarget
+ * @param {number} bindingParam
+ */
+glsLifetimeTests.SimpleBinder = function(bindFunc, bindTarget, bindingParam) {
+ glsLifetimeTests.Binder.call(this);
+ this.m_bindFunc = bindFunc;
+ this.m_bindTarget = bindTarget;
+ this.m_bindingParam = bindingParam;
+};
+
+setParentClass(glsLifetimeTests.SimpleBinder, glsLifetimeTests.Binder);
+
+glsLifetimeTests.SimpleBinder.prototype.bind = function(obj) {
+ this.m_bindFunc.call(gl, this.m_bindTarget, obj);
+};
+
+glsLifetimeTests.SimpleBinder.prototype.getBinding = function() {
+ return /** @type {WebGLObject} */ (gl.getParameter(this.m_bindingParam));
+};
+
+/**
+ * @constructor
+ */
+glsLifetimeTests.Type = function() {
+};
+
+/**
+ * Create a type
+ * @return {WebGLObject}
+ */
+glsLifetimeTests.Type.prototype.gen = function() { throw new Error('Virtual function'); };
+
+/**
+ * Destroy a type
+ * @param {WebGLObject} obj
+ */
+glsLifetimeTests.Type.prototype.release = function(obj) { throw new Error('Virtual function'); };
+
+/**
+ * Is object valid
+ * @param {WebGLObject} obj
+ */
+glsLifetimeTests.Type.prototype.exists = function(obj) { throw new Error('Virtual function'); };
+
+/**
+ * Is object flagged for deletion
+ * @param {WebGLObject} obj
+ */
+glsLifetimeTests.Type.prototype.isDeleteFlagged = function(obj) { return false; };
+
+/**
+ * @return {glsLifetimeTests.Binder}
+ */
+glsLifetimeTests.Type.prototype.binder = function() { return null; };
+
+/**
+ * @return {string}
+ */
+glsLifetimeTests.Type.prototype.getName = function() { throw new Error('Virtual function'); };
+
+/**
+ * Is the object unbound automatically when it is deleted?
+ * @return {boolean}
+ */
+glsLifetimeTests.Type.prototype.nameLingers = function() { return false; };
+
+/**
+ * Does 'create' creates the object fully?
+ * If not, the object is created at bound time
+ * @return {boolean}
+ */
+glsLifetimeTests.Type.prototype.genCreates = function() { return false; };
+
+/**
+ * @constructor
+ * @extends {glsLifetimeTests.Type}
+ * @param {string} name
+ * @param {function(): WebGLObject} genFunc
+ * @param {function(?)} deleteFunc
+ * @param {function(?): boolean} existsFunc
+ * @param {glsLifetimeTests.Binder} binder
+ * @param {boolean=} genCreates
+ */
+glsLifetimeTests.SimpleType = function(name, genFunc, deleteFunc, existsFunc, binder, genCreates) {
+ glsLifetimeTests.Type.call(this);
+ this.m_getName = name;
+ this.m_genFunc = genFunc;
+ this.m_deleteFunc = deleteFunc;
+ this.m_existsFunc = existsFunc;
+ this.m_binder = binder;
+ this.m_genCreates = genCreates || false;
+};
+
+setParentClass(glsLifetimeTests.SimpleType, glsLifetimeTests.Type);
+
+glsLifetimeTests.SimpleType.prototype.gen = function() { return this.m_genFunc.call(gl); };
+
+glsLifetimeTests.SimpleType.prototype.release = function(obj) { return this.m_deleteFunc.call(gl, obj); };
+
+glsLifetimeTests.SimpleType.prototype.exists = function(obj) { return this.m_existsFunc.call(gl, obj); };
+
+glsLifetimeTests.SimpleType.prototype.binder = function() { return this.m_binder; };
+
+glsLifetimeTests.SimpleType.prototype.getName = function() { return this.m_getName; };
+
+glsLifetimeTests.SimpleType.prototype.genCreates = function() { return this.m_genCreates; };
+
+/**
+ * @constructor
+ * @extends {glsLifetimeTests.Type}
+ */
+glsLifetimeTests.ProgramType = function() {
+ glsLifetimeTests.Type.call(this);
+};
+
+setParentClass(glsLifetimeTests.ProgramType, glsLifetimeTests.Type);
+
+glsLifetimeTests.ProgramType.prototype.gen = function() { return gl.createProgram(); };
+
+glsLifetimeTests.ProgramType.prototype.release = function(obj) { return gl.deleteProgram(/** @type {WebGLProgram} */ (obj)); };
+
+glsLifetimeTests.ProgramType.prototype.exists = function(obj) { return gl.isProgram(/** @type {WebGLProgram} */ (obj)); };
+
+glsLifetimeTests.ProgramType.prototype.getName = function() { return 'program'; };
+
+glsLifetimeTests.ProgramType.prototype.genCreates = function() { return true; };
+
+glsLifetimeTests.ProgramType.prototype.nameLingers = function() { return true; };
+
+glsLifetimeTests.ProgramType.prototype.isDeleteFlagged = function(obj) { return gl.getProgramParameter(/** @type {WebGLProgram} */ (obj), gl.DELETE_STATUS); };
+
+/**
+ * @constructor
+ * @extends {glsLifetimeTests.Type}
+ */
+glsLifetimeTests.ShaderType = function() {
+ glsLifetimeTests.Type.call(this);
+};
+
+setParentClass(glsLifetimeTests.ShaderType, glsLifetimeTests.Type);
+
+glsLifetimeTests.ShaderType.prototype.gen = function() { return gl.createShader(gl.FRAGMENT_SHADER); };
+
+glsLifetimeTests.ShaderType.prototype.release = function(obj) { return gl.deleteShader(/** @type {WebGLShader} */ (obj)); };
+
+glsLifetimeTests.ShaderType.prototype.exists = function(obj) { return gl.isShader(/** @type {WebGLShader} */ (obj)); };
+
+glsLifetimeTests.ShaderType.prototype.getName = function() { return 'shader'; };
+
+glsLifetimeTests.ShaderType.prototype.genCreates = function() { return true; };
+
+glsLifetimeTests.ShaderType.prototype.nameLingers = function() { return true; };
+
+glsLifetimeTests.ShaderType.prototype.isDeleteFlagged = function(obj) { return gl.getShaderParameter(/** @type {WebGLShader} */ (obj), gl.DELETE_STATUS); };
+
+/**
+ * @constructor
+ * @param {glsLifetimeTests.Type} elementType
+ * @param {glsLifetimeTests.Type} containerType
+ */
+glsLifetimeTests.Attacher = function(elementType, containerType) {
+ this.m_elementType = elementType;
+ this.m_containerType = containerType;
+};
+
+/**
+ * @param {number} seed
+ * @param {WebGLObject} obj
+ */
+glsLifetimeTests.Attacher.prototype.initAttachment = function(seed, obj) { throw new Error('Virtual function'); };
+
+/**
+ * @param {WebGLObject} element
+ * @param {WebGLObject} target
+ */
+glsLifetimeTests.Attacher.prototype.attach = function(element, target) { throw new Error('Virtual function'); };
+
+/**
+ * @param {WebGLObject} element
+ * @param {WebGLObject} target
+ */
+glsLifetimeTests.Attacher.prototype.detach = function(element, target) { throw new Error('Virtual function'); };
+glsLifetimeTests.Attacher.prototype.canAttachDeleted = function() { return true; };
+
+/**
+ * @return {glsLifetimeTests.Type}
+ */
+glsLifetimeTests.Attacher.prototype.getElementType = function() { return this.m_elementType; };
+
+/**
+ * @return {glsLifetimeTests.Type}
+ */
+glsLifetimeTests.Attacher.prototype.getContainerType = function() { return this.m_containerType; };
+
+/**
+ * @constructor
+ */
+glsLifetimeTests.InputAttacher = function(attacher) {
+ this.m_attacher = attacher;
+};
+
+glsLifetimeTests.InputAttacher.prototype.getAttacher = function() { return this.m_attacher; };
+
+/**
+ * @param {WebGLObject} container
+ * @param {tcuSurface.Surface} dst
+ */
+glsLifetimeTests.InputAttacher.prototype.drawContainer = function(container, dst) { throw new Error('Virtual function'); };
+
+/**
+ * @constructor
+ */
+glsLifetimeTests.OutputAttacher = function(attacher) {
+ this.m_attacher = attacher;
+};
+
+glsLifetimeTests.OutputAttacher.prototype.getAttacher = function() { return this.m_attacher; };
+
+/**
+ * @param {number} seed
+ * @param {WebGLObject} container
+ */
+glsLifetimeTests.OutputAttacher.prototype.setupContainer = function(seed, container) { throw new Error('Virtual function'); };
+
+/**
+ * @param {WebGLObject} attachment
+ * @param {tcuSurface.Surface} dst
+ */
+glsLifetimeTests.OutputAttacher.prototype.drawAttachment = function(attachment, dst) { throw new Error('Virtual function'); };
+
+/**
+ * @constructor
+ */
+glsLifetimeTests.Types = function() {
+ /** @type {Array<glsLifetimeTests.Type>} */ this.m_types = [];
+ /** @type {Array<glsLifetimeTests.Attacher>} */ this.m_attachers = [];
+ /** @type {Array<glsLifetimeTests.InputAttacher>} */ this.m_inAttachers = [];
+ /** @type {Array<glsLifetimeTests.OutputAttacher>} */ this.m_outAttachers = [];
+};
+
+/**
+ * @return {glsLifetimeTests.ProgramType}
+ */
+glsLifetimeTests.Types.prototype.getProgramType = function() { throw new Error('Virtual function'); };
+
+glsLifetimeTests.Types.prototype.getTypes = function() { return this.m_types; };
+
+glsLifetimeTests.Types.prototype.getAttachers = function() { return this.m_attachers; };
+
+glsLifetimeTests.Types.prototype.getInputAttachers = function() { return this.m_inAttachers; };
+
+glsLifetimeTests.Types.prototype.getOutputAttachers = function() { return this.m_outAttachers; };
+
+/**
+ * @param {number} seed
+ * @param {WebGLFramebuffer} fbo
+ */
+glsLifetimeTests.setupFbo = function(seed, fbo) {
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+
+ if (seed == 0) {
+ gl.clearColor(0.0, 0.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ } else {
+ var rnd = new deRandom.Random(seed);
+ var width = rnd.getInt(0, FRAMEBUFFER_SIZE);
+ var height = rnd.getInt(0, FRAMEBUFFER_SIZE);
+ var x = rnd.getInt(0, FRAMEBUFFER_SIZE - width);
+ var y = rnd.getInt(0, FRAMEBUFFER_SIZE - height);
+ var r1 = rnd.getFloat();
+ var g1 = rnd.getFloat();
+ var b1 = rnd.getFloat();
+ var a1 = rnd.getFloat();
+ var r2 = rnd.getFloat();
+ var g2 = rnd.getFloat();
+ var b2 = rnd.getFloat();
+ var a2 = rnd.getFloat();
+
+ gl.clearColor(r1, g1, b1, a1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.scissor(x, y, width, height);
+ gl.enable(gl.SCISSOR_TEST);
+ gl.clearColor(r2, g2, b2, a2);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.disable(gl.SCISSOR_TEST);
+ }
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+};
+
+/**
+ * @param {{x: number, y:number, width: number, height: number}} rect
+ * @param {tcuSurface.Surface} dst
+ */
+glsLifetimeTests.readRectangle = function(rect, dst) {
+ dst.readViewport(gl, rect);
+};
+
+/**
+ * @param {WebGLFramebuffer} fbo
+ * @param {tcuSurface.Surface} dst
+ */
+glsLifetimeTests.drawFbo = function(fbo, dst) {
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ dst.readViewport(gl, [0, 0, FRAMEBUFFER_SIZE, FRAMEBUFFER_SIZE]);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+};
+
+/**
+ * @constructor
+ * @extends {glsLifetimeTests.Attacher}
+ */
+glsLifetimeTests.FboAttacher = function(elementType, containerType) {
+ glsLifetimeTests.Attacher.call(this, elementType, containerType);
+};
+
+setParentClass(glsLifetimeTests.FboAttacher, glsLifetimeTests.Attacher);
+
+glsLifetimeTests.FboAttacher.prototype.initStorage = function() { throw new Error('Virtual function'); };
+
+glsLifetimeTests.FboAttacher.prototype.initAttachment = function(seed, element) {
+ var binder = this.getElementType().binder();
+ var fbo = gl.createFramebuffer();
+
+ binder.bind(element);
+ this.initStorage();
+ binder.bind(null);
+
+ this.attach(element, fbo);
+ glsLifetimeTests.setupFbo(seed, fbo);
+ this.detach(element, fbo);
+
+ gl.deleteFramebuffer(fbo);
+
+ bufferedLogToConsole('Drew to ' + this.getElementType().getName() + ' ' + element + ' with seed ' + seed + '.');
+};
+
+/**
+ * @constructor
+ * @extends {glsLifetimeTests.InputAttacher}
+ */
+glsLifetimeTests.FboInputAttacher = function(attacher) {
+ glsLifetimeTests.InputAttacher.call(this, attacher);
+};
+
+setParentClass(glsLifetimeTests.FboInputAttacher, glsLifetimeTests.InputAttacher);
+
+glsLifetimeTests.FboInputAttacher.prototype.drawContainer = function(obj, dst) {
+ var fbo = /** @type {WebGLFramebuffer} */ (obj);
+ glsLifetimeTests.drawFbo(fbo, dst);
+ bufferedLogToConsole('Read pixels from framebuffer ' + fbo + ' to output image.');
+};
+
+/**
+ * @constructor
+ * @extends {glsLifetimeTests.OutputAttacher}
+ */
+glsLifetimeTests.FboOutputAttacher = function(attacher) {
+ glsLifetimeTests.OutputAttacher.call(this, attacher);
+};
+
+setParentClass(glsLifetimeTests.FboOutputAttacher, glsLifetimeTests.OutputAttacher);
+
+glsLifetimeTests.FboOutputAttacher.prototype.setupContainer = function(seed, fbo) {
+ glsLifetimeTests.setupFbo(seed, /** @type {WebGLFramebuffer} */ (fbo));
+ bufferedLogToConsole('Drew to framebuffer ' + fbo + ' with seed ' + seed + '.');
+};
+
+glsLifetimeTests.FboOutputAttacher.prototype.drawAttachment = function(element, dst) {
+ var fbo = gl.createFramebuffer();
+ this.m_attacher.attach(element, fbo);
+ glsLifetimeTests.drawFbo(fbo, dst);
+ this.m_attacher.detach(element, fbo);
+ gl.deleteFramebuffer(fbo);
+ bufferedLogToConsole('Read pixels from ' + this.m_attacher.getElementType().getName() + ' ' + element + ' to output image.');
+};
+
+/**
+ * @constructor
+ * @extends {glsLifetimeTests.FboAttacher}
+ */
+glsLifetimeTests.TextureFboAttacher = function(elementType, containerType) {
+ glsLifetimeTests.FboAttacher.call(this, elementType, containerType);
+};
+
+setParentClass(glsLifetimeTests.TextureFboAttacher, glsLifetimeTests.FboAttacher);
+
+glsLifetimeTests.TextureFboAttacher.prototype.initStorage = function() {
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, FRAMEBUFFER_SIZE, FRAMEBUFFER_SIZE, 0,
+ gl.RGBA, gl.UNSIGNED_SHORT_4_4_4_4, null);
+
+};
+
+glsLifetimeTests.TextureFboAttacher.prototype.attach = function(element, target) {
+ var texture = /** @type {WebGLTexture} */ (element);
+ var fbo = /** @type {WebGLFramebuffer} */ (target);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0,
+ gl.TEXTURE_2D, texture, 0);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+};
+
+glsLifetimeTests.TextureFboAttacher.prototype.detach = function(texture, target) {
+ var fbo = /** @type {WebGLFramebuffer} */ (target);
+ this.attach(null, fbo);
+};
+
+glsLifetimeTests.getFboAttachment = function(fbo, requiredType) {
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ var type = gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0,
+ gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE);
+ var name = gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0,
+ gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+
+ var ret = type == requiredType ? name : null;
+ return ret;
+};
+
+glsLifetimeTests.TextureFboAttacher.prototype.getAttachment = function(fbo) {
+ return glsLifetimeTests.getFboAttachment(fbo, gl.TEXTURE);
+};
+
+/**
+ * @constructor
+ * @extends {glsLifetimeTests.FboAttacher}
+ */
+glsLifetimeTests.RboFboAttacher = function(elementType, containerType) {
+ glsLifetimeTests.FboAttacher.call(this, elementType, containerType);
+};
+
+setParentClass(glsLifetimeTests.RboFboAttacher, glsLifetimeTests.FboAttacher);
+
+glsLifetimeTests.RboFboAttacher.prototype.initStorage = function() {
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, FRAMEBUFFER_SIZE, FRAMEBUFFER_SIZE);
+
+};
+
+glsLifetimeTests.RboFboAttacher.prototype.attach = function(element, target) {
+ var rbo = /** @type {WebGLRenderbuffer} */ (element);
+ var fbo = /** @type {WebGLFramebuffer} */ (target);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+};
+
+glsLifetimeTests.RboFboAttacher.prototype.detach = function(rbo, target) {
+ var fbo = /** @type {WebGLFramebuffer} */ (target);
+ this.attach(null, fbo);
+};
+
+glsLifetimeTests.RboFboAttacher.prototype.getAttachment = function(fbo) {
+ return glsLifetimeTests.getFboAttachment(fbo, gl.RENDERBUFFER);
+};
+
+/**
+ * @constructor
+ * @extends {glsLifetimeTests.Attacher}
+ */
+glsLifetimeTests.ShaderProgramAttacher = function(elementType, containerType) {
+ glsLifetimeTests.Attacher.call(this, elementType, containerType);
+};
+
+setParentClass(glsLifetimeTests.ShaderProgramAttacher, glsLifetimeTests.Attacher);
+
+glsLifetimeTests.ShaderProgramAttacher.prototype.initAttachment = function(seed, obj) {
+ var shader = /** @type {WebGLShader} */ (obj);
+ var s_fragmentShaderTemplate =
+ '#version 100\n' +
+ 'void main()\n' +
+ '{\n' +
+ ' gl_FragColor = vec4(${RED}, ${GREEN}, ${BLUE}, 1.0);\n' +
+ '}';
+
+ var rnd = new deRandom.Random(seed);
+ var params = [];
+ params['RED'] = rnd.getFloat().toString(10);
+ params['GREEN'] = rnd.getFloat().toString(10);
+ params['BLUE'] = rnd.getFloat().toString(10);
+
+ var source = tcuStringTemplate.specialize(s_fragmentShaderTemplate, params);
+ gl.shaderSource(shader, source);
+ gl.compileShader(shader);
+ var compileStatus = gl.getShaderParameter(shader, gl.COMPILE_STATUS);
+ assertMsgOptions(compileStatus === true, 'Failed to compile shader: ' + source, false, true);
+};
+
+glsLifetimeTests.ShaderProgramAttacher.prototype.attach = function(element, target) {
+ var shader = /** @type {WebGLShader} */ (element);
+ var program = /** @type {WebGLProgram} */ (target);
+ gl.attachShader(program, shader);
+};
+
+glsLifetimeTests.ShaderProgramAttacher.prototype.detach = function(element, target) {
+ var shader = /** @type {WebGLShader} */ (element);
+ var program = /** @type {WebGLProgram} */ (target);
+ gl.detachShader(program, shader);
+};
+
+glsLifetimeTests.ShaderProgramAttacher.prototype.getAttachment = function(program) {
+ var shaders = gl.getAttachedShaders(program);
+ for (var i = 0; i < shaders.length; i++) {
+ var shader = shaders[i];
+ var type = gl.getShaderParameter(shader, gl.SHADER_TYPE);
+ if (type === gl.FRAGMENT_SHADER)
+ return shader;
+ }
+ return null;
+};
+
+/**
+ * @constructor
+ * @extends {glsLifetimeTests.InputAttacher}
+ */
+glsLifetimeTests.ShaderProgramInputAttacher = function(attacher) {
+ glsLifetimeTests.InputAttacher.call(this, attacher);
+};
+
+setParentClass(glsLifetimeTests.ShaderProgramInputAttacher, glsLifetimeTests.InputAttacher);
+
+glsLifetimeTests.ShaderProgramInputAttacher.prototype.drawContainer = function(container, dst) {
+ var program = /** @type {WebGLProgram} */ (container);
+ var s_vertices = [-1.0, 0.0, 1.0, 1.0, 0.0, -1.0];
+ glsLifetimeTests.ShaderProgramInputAttacher.seed = glsLifetimeTests.ShaderProgramInputAttacher.seed || 0;
+ var vtxShader = new glsLifetimeTests.CheckedShader(gluShaderProgram.shaderType.VERTEX, s_vertexShaderSrc);
+ var viewport = new glsTextureTestUtil.RandomViewport(document.getElementById('canvas'), VIEWPORT_SIZE, VIEWPORT_SIZE, glsLifetimeTests.ShaderProgramInputAttacher.seed);
+
+ gl.attachShader(program, vtxShader.getShader());
+ gl.linkProgram(program);
+
+ var linkStatus = gl.getProgramParameter(program, gl.LINK_STATUS);
+ assertMsgOptions(linkStatus === true, 'Program link failed', false, true);
+
+ bufferedLogToConsole('Attached a temporary vertex shader and linked program ' + program);
+
+ gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height);
+
+ bufferedLogToConsole('Positioned viewport randomly');
+
+ gl.useProgram(program);
+
+ var posLoc = gl.getAttribLocation(program, 'pos');
+ assertMsgOptions(posLoc >= 0, 'Could not find pos attribute', false, true);
+
+ var buf = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buf);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(s_vertices), gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(posLoc);
+ gl.vertexAttribPointer(posLoc, 2, gl.FLOAT, false, 0, 0);
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+
+ gl.clearColor(0, 0, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.drawArrays(gl.TRIANGLES, 0, 3);
+
+ gl.disableVertexAttribArray(posLoc);
+ gl.deleteBuffer(buf);
+ bufferedLogToConsole('Drew a fixed triangle');
+
+ gl.useProgram(null);
+
+ glsLifetimeTests.readRectangle(viewport, dst);
+ bufferedLogToConsole('Copied viewport to output image');
+
+ gl.detachShader(program, vtxShader.getShader());
+ bufferedLogToConsole('Removed temporary vertex shader');
+};
+
+/**
+ * @constructor
+ * @extends {glsLifetimeTests.Types}
+ */
+glsLifetimeTests.ES2Types = function() {
+ glsLifetimeTests.Types.call(this);
+ this.m_bufferBind = new glsLifetimeTests.SimpleBinder(gl.bindBuffer, gl.ARRAY_BUFFER, gl.ARRAY_BUFFER_BINDING);
+ this.m_bufferType = new glsLifetimeTests.SimpleType('buffer', gl.createBuffer, gl.deleteBuffer, gl.isBuffer, this.m_bufferBind);
+ this.m_textureBind = new glsLifetimeTests.SimpleBinder(gl.bindTexture, gl.TEXTURE_2D, gl.TEXTURE_BINDING_2D);
+ this.m_textureType = new glsLifetimeTests.SimpleType('texture', gl.createTexture, gl.deleteTexture, gl.isTexture, this.m_textureBind);
+ this.m_rboBind = new glsLifetimeTests.SimpleBinder(gl.bindRenderbuffer, gl.RENDERBUFFER, gl.RENDERBUFFER_BINDING);
+ this.m_rboType = new glsLifetimeTests.SimpleType('renderbuffer', gl.createRenderbuffer, gl.deleteRenderbuffer, gl.isRenderbuffer, this.m_rboBind);
+ this.m_fboBind = new glsLifetimeTests.SimpleBinder(gl.bindFramebuffer, gl.FRAMEBUFFER, gl.FRAMEBUFFER_BINDING);
+ this.m_fboType = new glsLifetimeTests.SimpleType('framebuffer', gl.createFramebuffer, gl.deleteFramebuffer, gl.isFramebuffer, this.m_fboBind);
+ this.m_shaderType = new glsLifetimeTests.ShaderType();
+ this.m_programType = new glsLifetimeTests.ProgramType();
+ this.m_texFboAtt = new glsLifetimeTests.TextureFboAttacher(this.m_textureType, this.m_fboType);
+ this.m_texFboInAtt = new glsLifetimeTests.FboInputAttacher(this.m_texFboAtt);
+ this.m_texFboOutAtt = new glsLifetimeTests.FboOutputAttacher(this.m_texFboAtt);
+ this.m_rboFboAtt = new glsLifetimeTests.RboFboAttacher(this.m_rboType, this.m_fboType);
+ this.m_rboFboInAtt = new glsLifetimeTests.FboInputAttacher(this.m_rboFboAtt);
+ this.m_rboFboOutAtt = new glsLifetimeTests.FboOutputAttacher(this.m_rboFboAtt);
+ this.m_shaderAtt = new glsLifetimeTests.ShaderProgramAttacher(this.m_shaderType, this.m_programType);
+ this.m_shaderInAtt = new glsLifetimeTests.ShaderProgramInputAttacher(this.m_shaderAtt);
+
+ this.m_types.push(this.m_bufferType, this.m_textureType, this.m_rboType, this.m_fboType, this.m_shaderType, this.m_programType);
+ this.m_attachers.push(this.m_texFboAtt, this.m_rboFboAtt, this.m_shaderAtt);
+ this.m_inAttachers.push(this.m_texFboInAtt, this.m_rboFboInAtt, this.m_shaderInAtt);
+ this.m_outAttachers.push(this.m_texFboOutAtt, this.m_rboFboOutAtt);
+};
+
+setParentClass(glsLifetimeTests.ES2Types, glsLifetimeTests.Types);
+
+glsLifetimeTests.ES2Types.prototype.getProgramType = function() { return this.m_programType; };
+
+/**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} description
+ * @param {glsLifetimeTests.Type} type
+ * @param {function()} test
+ */
+glsLifetimeTests.LifeTest = function(name, description, type, test) {
+ tcuTestCase.DeqpTest.call(this, name, description);
+ this.m_type = type;
+ this.m_test = test;
+};
+
+setParentClass(glsLifetimeTests.LifeTest, tcuTestCase.DeqpTest);
+
+glsLifetimeTests.LifeTest.prototype.iterate = function() {
+ this.m_test();
+ return tcuTestCase.IterateResult.STOP;
+};
+
+/**
+ * @this {glsLifetimeTests.LifeTest}
+ */
+glsLifetimeTests.LifeTest.testGen = function() {
+ var obj = this.m_type.gen();
+ if (this.m_type.genCreates())
+ assertMsgOptions(this.m_type.exists(obj), "create* should have created an object, but didn't", false, true);
+ else
+ assertMsgOptions(!this.m_type.exists(obj), 'create* should not have created an object, but did', false, true);
+ this.m_type.release(obj);
+ testPassed();
+};
+
+/**
+ * @this {glsLifetimeTests.LifeTest}
+ */
+glsLifetimeTests.LifeTest.testDelete = function() {
+ var obj = this.m_type.gen();
+ this.m_type.release(obj);
+ assertMsgOptions(!this.m_type.exists(obj), 'Object still exists after deletion', false, true);
+ testPassed();
+};
+
+/**
+ * @this {glsLifetimeTests.LifeTest}
+ */
+glsLifetimeTests.LifeTest.testBind = function() {
+ var obj = this.m_type.gen();
+ this.m_type.binder().bind(obj);
+ var err = gl.getError();
+ assertMsgOptions(err == gl.NONE, 'Bind failed', false, true);
+ assertMsgOptions(this.m_type.exists(obj), 'Object does not exist after binding', false, true);
+ this.m_type.binder().bind(null);
+ this.m_type.release(obj);
+ testPassed();
+};
+
+/**
+ * @this {glsLifetimeTests.LifeTest}
+ */
+glsLifetimeTests.LifeTest.testDeleteBound = function() {
+ var obj = this.m_type.gen();
+ this.m_type.binder().bind(obj);
+ this.m_type.release(obj);
+ if (this.m_type.nameLingers()) {
+ assertMsgOptions(gl.getError() == gl.NONE, 'Deleting bound object failed', false, true);
+ assertMsgOptions(this.m_type.binder().getBinding() === obj, 'Deleting bound object did not retain binding', false, true);
+ assertMsgOptions(this.m_type.exists(obj), 'Deleting bound object made its name invalid', false, true);
+ assertMsgOptions(this.m_type.isDeleteFlagged(obj), 'Deleting bound object did not flag the object for deletion', false, true);
+ this.m_type.binder().bind(null);
+ } else {
+ assertMsgOptions(gl.getError() == gl.NONE, 'Deleting bound object failed', false, true);
+ assertMsgOptions(this.m_type.binder().getBinding() === null, 'Deleting bound object did not remove binding', false, true);
+ assertMsgOptions(!this.m_type.exists(obj), 'Deleting bound object did not make its name invalid', false, true);
+ }
+ assertMsgOptions(this.m_type.binder().getBinding() === null, "Unbinding didn't remove binding", false, true);
+ assertMsgOptions(!this.m_type.exists(obj), 'Name is still valid after deleting and unbinding', false, true);
+ testPassed();
+};
+
+/**
+ * @this {glsLifetimeTests.LifeTest}
+ */
+glsLifetimeTests.LifeTest.testDeleteUsed = function() {
+ var vtxShader = new glsLifetimeTests.CheckedShader(gluShaderProgram.shaderType.VERTEX, s_vertexShaderSrc);
+ var fragShader = new glsLifetimeTests.CheckedShader(gluShaderProgram.shaderType.FRAGMENT, s_fragmentShaderSrc);
+ var program = new glsLifetimeTests.CheckedProgram(vtxShader.getShader(), fragShader.getShader());
+ var programId = program.getProgram();
+ bufferedLogToConsole('Created and linked program ' + programId);
+ gl.useProgram(programId);
+
+ gl.deleteProgram(programId);
+ bufferedLogToConsole('Deleted program ' + programId);
+ assertMsgOptions(gl.isProgram(programId), 'Deleted current program', false, true);
+ var deleteFlagged = gl.getProgramParameter(programId, gl.DELETE_STATUS);
+ assertMsgOptions(deleteFlagged == true, 'Program object was not flagged as deleted', false, true);
+ gl.useProgram(null);
+ assertMsgOptions(!gl.isProgram(programId), 'Deleted program name still valid after being made non-current', false, true);
+ testPassed();
+};
+
+/**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} description
+ * @param {glsLifetimeTests.Attacher} attacher
+ * @param {function()} test
+ */
+glsLifetimeTests.AttachmentTest = function(name, description, attacher, test) {
+ tcuTestCase.DeqpTest.call(this, name, description);
+ this.m_attacher = attacher;
+ this.m_test = test;
+};
+
+setParentClass(glsLifetimeTests.AttachmentTest, tcuTestCase.DeqpTest);
+
+glsLifetimeTests.AttachmentTest.prototype.iterate = function() {
+ this.m_test();
+ return tcuTestCase.IterateResult.STOP;
+};
+
+/**
+ * @this {glsLifetimeTests.AttachmentTest}
+ */
+glsLifetimeTests.AttachmentTest.testDeletedNames = function() {
+ var getAttachment = function(attacher, container) {
+ var queriedAttachment = attacher.getAttachment(container);
+ bufferedLogToConsole('Result of query for ' + attacher.getElementType().getName() +
+ ' attached to ' + attacher.getContainerType().getName() + ' ' +
+ container + ': ' + queriedAttachment);
+ return queriedAttachment;
+ };
+
+ var elemType = this.m_attacher.getElementType();
+ var containerType = this.m_attacher.getContainerType();
+ var container = containerType.gen();
+
+ var element = elemType.gen();
+ this.m_attacher.initAttachment(0, element);
+ this.m_attacher.attach(element, container);
+ assertMsgOptions(getAttachment(this.m_attacher, container) == element,
+ 'Attachment not returned by query even before deletion.', false, true);
+
+ elemType.release(element);
+ // "Such a container or other context may continue using the object, and
+ // may still contain state identifying its name as being currently bound"
+ //
+ // We here interpret "may" to mean that whenever the container has a
+ // deleted object attached to it, a query will return that object's former
+ // name.
+ assertMsgOptions(getAttachment(this.m_attacher, container) == element,
+ 'Attachment name not returned by query after attachment was deleted.', false, true);
+
+ if (elemType.nameLingers())
+ assertMsgOptions(elemType.exists(element),
+ 'Attached object name no longer valid after deletion.', false, true);
+ else
+ assertMsgOptions(!elemType.exists(element),
+ 'Attached object name still valid after deletion.', false, true);
+
+ this.m_attacher.detach(element, container);
+ assertMsgOptions(getAttachment(this.m_attacher, container) == null,
+ 'Attachment name returned by query even after detachment.', false, true);
+ assertMsgOptions(!elemType.exists(element),
+ 'Deleted attached object name still usable after detachment.', false, true);
+ testPassed();
+};
+
+/**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} description
+ * @param {glsLifetimeTests.InputAttacher} attacher
+ */
+glsLifetimeTests.InputAttachmentTest = function(name, description, attacher) {
+ tcuTestCase.DeqpTest.call(this, name, description);
+ this.m_inputAttacher = attacher;
+};
+
+setParentClass(glsLifetimeTests.InputAttachmentTest, tcuTestCase.DeqpTest);
+
+glsLifetimeTests.InputAttachmentTest.prototype.iterate = function() {
+ var attacher = this.m_inputAttacher.getAttacher();
+ var containerType = attacher.getContainerType();
+ var elementType = attacher.getElementType();
+ var container = containerType.gen();
+
+ glsLifetimeTests.InputAttachmentTest.seed = glsLifetimeTests.InputAttachmentTest.seed || 0;
+ ++glsLifetimeTests.InputAttachmentTest.seed;
+ var rnd = new deRandom.Random(glsLifetimeTests.InputAttachmentTest.seed);
+ var refSeed = rnd.getInt();
+ var newSeed = rnd.getInt();
+
+ var refSurface = new tcuSurface.Surface(VIEWPORT_SIZE, VIEWPORT_SIZE); // Surface from drawing with refSeed-seeded attachment
+ var delSurface = new tcuSurface.Surface(VIEWPORT_SIZE, VIEWPORT_SIZE); // Surface from drawing with deleted refSeed attachment
+ var newSurface = new tcuSurface.Surface(VIEWPORT_SIZE, VIEWPORT_SIZE); // Surface from drawing with newSeed-seeded attachment
+
+ bufferedLogToConsole('Testing if writing to a newly created object modifies a deleted attachment');
+
+ bufferedLogToConsole('Writing to an original attachment');
+ var element = elementType.gen();
+
+ attacher.initAttachment(refSeed, element);
+ attacher.attach(element, container);
+ this.m_inputAttacher.drawContainer(container, refSurface);
+ // element gets deleted here
+ bufferedLogToConsole('Deleting attachment');
+ elementType.release(element);
+
+ bufferedLogToConsole('Writing to a new attachment after deleting the original');
+ var newElement = elementType.gen();
+
+ attacher.initAttachment(newSeed, newElement);
+
+ this.m_inputAttacher.drawContainer(container, delSurface);
+ attacher.detach(element, container);
+
+ attacher.attach(newElement, container);
+ this.m_inputAttacher.drawContainer(container, newSurface);
+ attacher.detach(newElement, container);
+ var surfacesMatch = tcuImageCompare.pixelThresholdCompare(
+ 'Reading from deleted',
+ 'Comparison result from reading from a container with a deleted attachment ' +
+ 'before and after writing to a fresh object.',
+ refSurface, delSurface, [0, 0, 0, 0]);
+
+ /* TODO: Add logging images */
+ // if (!surfacesMatch)
+ // log() << TestLog::Image("New attachment",
+ // "Container state after attached to the fresh object",
+ // newSurface);
+
+ assertMsgOptions(surfacesMatch,
+ 'Writing to a fresh object modified the container with a deleted attachment.', false, true);
+
+ testPassed();
+ return tcuTestCase.IterateResult.STOP;
+};
+
+/**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} description
+ * @param {glsLifetimeTests.OutputAttacher} attacher
+ */
+glsLifetimeTests.OutputAttachmentTest = function(name, description, attacher) {
+ tcuTestCase.DeqpTest.call(this, name, description);
+ this.m_outputAttacher = attacher;
+};
+
+setParentClass(glsLifetimeTests.OutputAttachmentTest, tcuTestCase.DeqpTest);
+
+glsLifetimeTests.OutputAttachmentTest.prototype.iterate = function() {
+ var attacher = this.m_outputAttacher.getAttacher();
+ var containerType = attacher.getContainerType();
+ var elementType = attacher.getElementType();
+ var container = containerType.gen();
+ glsLifetimeTests.InputAttachmentTest.seed = glsLifetimeTests.InputAttachmentTest.seed || 0;
+ ++glsLifetimeTests.InputAttachmentTest.seed;
+ var rnd = new deRandom.Random(glsLifetimeTests.InputAttachmentTest.seed);
+ var refSeed = rnd.getInt();
+ var newSeed = rnd.getInt();
+
+ var refSurface = new tcuSurface.Surface(VIEWPORT_SIZE, VIEWPORT_SIZE); // Surface from drawing with refSeed-seeded attachment
+ var delSurface = new tcuSurface.Surface(VIEWPORT_SIZE, VIEWPORT_SIZE); // Surface from drawing with deleted refSeed attachment
+ var newSurface = new tcuSurface.Surface(VIEWPORT_SIZE, VIEWPORT_SIZE); // Surface from drawing with newSeed-seeded attachment
+
+ bufferedLogToConsole('Testing if writing to a container with a deleted attachment ' +
+ 'modifies a newly created object');
+
+ bufferedLogToConsole('Writing to a container with an existing attachment');
+ var element = elementType.gen();
+
+ attacher.initAttachment(0, element);
+ attacher.attach(element, container);
+
+ // For reference purposes, make note of what refSeed looks like.
+ this.m_outputAttacher.setupContainer(refSeed, container);
+ // Since in WebGL, buffer bound to TRANSFORM_FEEDBACK_BUFFER can not be bound to other targets.
+ // Unfortunately, element will be bound again in drawAttachment() for drawing.
+ // Detach element from container before drawing, then reattach it after drawing.
+ attacher.detach(element, container);
+ this.m_outputAttacher.drawAttachment(element, refSurface);
+ attacher.attach(element, container);
+ elementType.release(element);
+
+ bufferedLogToConsole('Writing to a container after deletion of attachment');
+ var newElement = elementType.gen();
+ bufferedLogToConsole('Creating a new object ');
+
+ bufferedLogToConsole('Recording state of new object before writing to container');
+ attacher.initAttachment(newSeed, newElement);
+ this.m_outputAttacher.drawAttachment(newElement, newSurface);
+
+ bufferedLogToConsole('Writing to container');
+
+ // Now re-write refSeed to the container.
+ this.m_outputAttacher.setupContainer(refSeed, container);
+ // Does it affect the newly created attachment object?
+ this.m_outputAttacher.drawAttachment(newElement, delSurface);
+ attacher.detach(element, container);
+
+ var surfacesMatch = tcuImageCompare.pixelThresholdCompare(
+ 'Writing to deleted',
+ 'Comparison result from reading from a fresh object before and after ' +
+ 'writing to a container with a deleted attachment',
+ newSurface, delSurface, [0, 0, 0, 0]);
+
+ /* TODO: Add logging images */
+ // if (!surfacesMatch)
+ // log() << TestLog::Image(
+ // "Original attachment",
+ // "Result of container modification on original attachment before deletion.",
+ // refSurface);
+
+ assertMsgOptions(surfacesMatch,
+ 'Writing to container with deleted attachment modified a new object.', false, true);
+
+ testPassed();
+ return tcuTestCase.IterateResult.STOP;
+};
+
+glsLifetimeTests.createLifeTestGroup = function(spec, types) {
+ var group = tcuTestCase.newTest(spec.name, spec.name);
+
+ for (var i = 0; i < types.length; i++) {
+ var type = types[i];
+ var name = type.getName();
+ if (!spec.needBind || type.binder() != null)
+ group.addChild(new glsLifetimeTests.LifeTest(name, name, type, spec.func));
+ }
+
+ return group;
+};
+
+/**
+ * @param {tcuTestCase.DeqpTest} group
+ * @param {glsLifetimeTests.Types} types
+ */
+glsLifetimeTests.addTestCases = function(group, types) {
+ var attacherName = function(attacher) {
+ return attacher.getElementType().getName() + '_' + attacher.getContainerType().getName();
+ };
+
+ var s_lifeTests = [
+ /* Create */ { name: 'gen', func: glsLifetimeTests.LifeTest.testGen, needBind: false },
+ /* Delete */ { name: 'delete', func: glsLifetimeTests.LifeTest.testDelete, needBind: false },
+ /* Bind */ { name: 'bind', func: glsLifetimeTests.LifeTest.testBind, needBind: true },
+ /* Delete bound */ { name: 'delete_bound', func: glsLifetimeTests.LifeTest.testDeleteBound, needBind: true }
+ ];
+
+ s_lifeTests.forEach(function(spec) {
+ group.addChild(glsLifetimeTests.createLifeTestGroup(spec, types.getTypes()));
+ });
+
+ var delUsedGroup = tcuTestCase.newTest('delete_used', 'Delete current program');
+ group.addChild(delUsedGroup);
+
+ delUsedGroup.addChild(new glsLifetimeTests.LifeTest('program', 'program', types.getProgramType(),
+ glsLifetimeTests.LifeTest.testDeleteUsed));
+
+ var attGroup = tcuTestCase.newTest('attach', 'Attachment tests');
+ group.addChild(attGroup);
+
+ var nameGroup = tcuTestCase.newTest('deleted_name', 'Name of deleted attachment');
+ attGroup.addChild(nameGroup);
+
+ var atts = types.getAttachers();
+ for (var i = 0; i < atts.length; i++) {
+ var att = atts[i];
+ var name = attacherName(att);
+ nameGroup.addChild(new glsLifetimeTests.AttachmentTest(name, name, att,
+ glsLifetimeTests.AttachmentTest.testDeletedNames));
+ }
+
+ var inputGroup = tcuTestCase.newTest('deleted_input', 'Input from deleted attachment');
+ attGroup.addChild(inputGroup);
+
+ var inAtts = types.getInputAttachers();
+ for (var i = 0; i < inAtts.length; i++) {
+ var att = inAtts[i];
+ var name = attacherName(att.getAttacher());
+ inputGroup.addChild(new glsLifetimeTests.InputAttachmentTest(name, name, att));
+ }
+
+ var outputGroup = tcuTestCase.newTest('deleted_output', 'Output to deleted attachment');
+ attGroup.addChild(outputGroup);
+
+ var outAtts = types.getOutputAttachers();
+ for (var i = 0; i < outAtts.length; i++) {
+ var att = outAtts[i];
+ var name = attacherName(att.getAttacher());
+ outputGroup.addChild(new glsLifetimeTests.OutputAttachmentTest(name, name, att));
+ }
+
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsRandomUniformBlockCase.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsRandomUniformBlockCase.js
new file mode 100644
index 0000000000..20b8dcd472
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsRandomUniformBlockCase.js
@@ -0,0 +1,282 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('modules.shared.glsRandomUniformBlockCase');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('modules.shared.glsUniformBlockCase');
+
+goog.scope(function() {
+
+ var glsRandomUniformBlockCase = modules.shared.glsRandomUniformBlockCase;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var glsUniformBlockCase = modules.shared.glsUniformBlockCase;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var deMath = framework.delibs.debase.deMath;
+ var deRandom = framework.delibs.debase.deRandom;
+
+ glsRandomUniformBlockCase.FeatureBits = {
+ FEATURE_VECTORS: (1 << 0),
+ FEATURE_MATRICES: (1 << 1),
+ FEATURE_ARRAYS: (1 << 2),
+ FEATURE_STRUCTS: (1 << 3),
+ FEATURE_NESTED_STRUCTS: (1 << 4),
+ FEATURE_INSTANCE_ARRAYS: (1 << 5),
+ FEATURE_VERTEX_BLOCKS: (1 << 6),
+ FEATURE_FRAGMENT_BLOCKS: (1 << 7),
+ FEATURE_SHARED_BLOCKS: (1 << 8),
+ FEATURE_UNUSED_UNIFORMS: (1 << 9),
+ FEATURE_UNUSED_MEMBERS: (1 << 10),
+ FEATURE_PACKED_LAYOUT: (1 << 11),
+ FEATURE_SHARED_LAYOUT: (1 << 12),
+ FEATURE_STD140_LAYOUT: (1 << 13),
+ FEATURE_MATRIX_LAYOUT: (1 << 14), //!< Matrix layout flags.
+ FEATURE_ARRAYS_OF_ARRAYS: (1 << 15)
+ };
+
+ /**
+ * glsRandomUniformBlockCase.RandomUniformBlockCase class
+ * @param {string} name
+ * @param {string} description
+ * @param {glsUniformBlockCase.BufferMode} bufferMode
+ * @param {number} features
+ * @param {number} seed
+ * @constructor
+ * @extends {glsUniformBlockCase.UniformBlockCase}
+ */
+ glsRandomUniformBlockCase.RandomUniformBlockCase = function(name, description, bufferMode, features, seed) {
+ glsUniformBlockCase.UniformBlockCase.call(this, name, description, bufferMode);
+ this.m_features = features;
+ this.m_maxVertexBlocks = ((features & glsRandomUniformBlockCase.FeatureBits.FEATURE_VERTEX_BLOCKS) ? 4 : 0);
+ this.m_maxFragmentBlocks = ((features & glsRandomUniformBlockCase.FeatureBits.FEATURE_FRAGMENT_BLOCKS) ? 4 : 0);
+ this.m_maxSharedBlocks = ((features & glsRandomUniformBlockCase.FeatureBits.FEATURE_SHARED_BLOCKS) ? 4 : 0);
+ this.m_maxInstances = ((features & glsRandomUniformBlockCase.FeatureBits.FEATURE_INSTANCE_ARRAYS) ? 3 : 0);
+ this.m_maxArrayLength = ((features & glsRandomUniformBlockCase.FeatureBits.FEATURE_ARRAYS) ? 8 : 0);
+ this.m_maxStructDepth = ((features & glsRandomUniformBlockCase.FeatureBits.FEATURE_STRUCTS) ? 2 : 0);
+ this.m_maxBlockMembers = 5;
+ this.m_maxStructMembers = 4;
+ this.m_seed = seed;
+ this.m_blockNdx = 1;
+ this.m_uniformNdx = 1;
+ this.m_structNdx = 1;
+ };
+
+ glsRandomUniformBlockCase.RandomUniformBlockCase.prototype = Object.create(glsUniformBlockCase.UniformBlockCase.prototype);
+ glsRandomUniformBlockCase.RandomUniformBlockCase.prototype.constructor = glsRandomUniformBlockCase.RandomUniformBlockCase;
+
+ /**
+ * generateType
+ * @param {deRandom.Random} rnd
+ * @param {number} typeDepth
+ * @param {boolean} arrayOk
+ * @return {glsUniformBlockCase.VarType}
+ */
+ glsRandomUniformBlockCase.RandomUniformBlockCase.prototype.generateType = function(rnd, typeDepth, arrayOk) {
+ /** @type {number} */ var structWeight = 0.1;
+ /** @type {number} */ var arrayWeight = 0.1;
+ /** @type {number} */ var flags;
+
+ if (typeDepth < this.m_maxStructDepth && rnd.getFloat() < structWeight) {
+ /** @type {number} */ var unusedVtxWeight = 0.15;
+ /** @type {number} */ var unusedFragWeight = 0.15;
+ /** @type {boolean} */ var unusedOk = (this.m_features & glsRandomUniformBlockCase.FeatureBits.FEATURE_UNUSED_MEMBERS) != 0;
+ /** @type {Array<glsUniformBlockCase.VarType>} */ var memberTypes = [];
+ /** @type {number} */ var numMembers = rnd.getInt(1, this.m_maxStructMembers);
+
+ // Generate members first so nested struct declarations are in correct order.
+ for (var ndx = 0; ndx < numMembers; ndx++)
+ memberTypes.push(this.generateType(rnd, typeDepth + 1, true));
+
+ /** @type {glsUniformBlockCase.StructType} */ var structType = this.m_interface.allocStruct('s' + this.genName('A'.charCodeAt(0), 'Z'.charCodeAt(0), this.m_structNdx));
+ this.m_structNdx += 1;
+
+ assertMsgOptions(this.m_blockNdx <= 'Z'.charCodeAt(0) - 'A'.charCodeAt(0), 'generateType', false, true);
+ for (var ndx = 0; ndx < numMembers; ndx++) {
+ flags = 0;
+
+ flags |= (unusedOk && rnd.getFloat() < unusedVtxWeight) ? glsUniformBlockCase.UniformFlags.UNUSED_VERTEX : 0;
+ flags |= (unusedOk && rnd.getFloat() < unusedFragWeight) ? glsUniformBlockCase.UniformFlags.UNUSED_FRAGMENT : 0;
+
+ structType.addMember('m' + ('A'.charCodeAt(0) + ndx), memberTypes[ndx], flags);
+ }
+
+ return glsUniformBlockCase.newVarTypeStruct(structType);
+ } else if (this.m_maxArrayLength > 0 && arrayOk && rnd.getFloat() < arrayWeight) {
+ /** @type {boolean} */ var arraysOfArraysOk = (this.m_features & glsRandomUniformBlockCase.FeatureBits.FEATURE_ARRAYS_OF_ARRAYS) != 0;
+ /** @type {number} */ var arrayLength = rnd.getInt(1, this.m_maxArrayLength);
+ /** @type {glsUniformBlockCase.VarType} */ var elementType = this.generateType(rnd, typeDepth, arraysOfArraysOk);
+ return glsUniformBlockCase.newVarTypeArray(elementType, arrayLength);
+ } else {
+ /** @type {Array<gluShaderUtil.DataType>} */ var typeCandidates = [];
+
+ typeCandidates.push(gluShaderUtil.DataType.FLOAT);
+ typeCandidates.push(gluShaderUtil.DataType.INT);
+ typeCandidates.push(gluShaderUtil.DataType.UINT);
+ typeCandidates.push(gluShaderUtil.DataType.BOOL);
+
+ if (this.m_features & glsRandomUniformBlockCase.FeatureBits.FEATURE_VECTORS) {
+ typeCandidates.push(gluShaderUtil.DataType.FLOAT_VEC2);
+ typeCandidates.push(gluShaderUtil.DataType.FLOAT_VEC3);
+ typeCandidates.push(gluShaderUtil.DataType.FLOAT_VEC4);
+ typeCandidates.push(gluShaderUtil.DataType.INT_VEC2);
+ typeCandidates.push(gluShaderUtil.DataType.INT_VEC3);
+ typeCandidates.push(gluShaderUtil.DataType.INT_VEC4);
+ typeCandidates.push(gluShaderUtil.DataType.UINT_VEC2);
+ typeCandidates.push(gluShaderUtil.DataType.UINT_VEC3);
+ typeCandidates.push(gluShaderUtil.DataType.UINT_VEC4);
+ typeCandidates.push(gluShaderUtil.DataType.BOOL_VEC2);
+ typeCandidates.push(gluShaderUtil.DataType.BOOL_VEC3);
+ typeCandidates.push(gluShaderUtil.DataType.BOOL_VEC4);
+ }
+
+ if (this.m_features & glsRandomUniformBlockCase.FeatureBits.FEATURE_MATRICES) {
+ typeCandidates.push(gluShaderUtil.DataType.FLOAT_MAT2);
+ typeCandidates.push(gluShaderUtil.DataType.FLOAT_MAT2X3);
+ typeCandidates.push(gluShaderUtil.DataType.FLOAT_MAT3X2);
+ typeCandidates.push(gluShaderUtil.DataType.FLOAT_MAT3);
+ typeCandidates.push(gluShaderUtil.DataType.FLOAT_MAT3X4);
+ typeCandidates.push(gluShaderUtil.DataType.FLOAT_MAT4X2);
+ typeCandidates.push(gluShaderUtil.DataType.FLOAT_MAT4X3);
+ typeCandidates.push(gluShaderUtil.DataType.FLOAT_MAT4);
+ }
+
+ /** @type {gluShaderUtil.DataType} */ var type = (rnd.choose(typeCandidates)[0]);
+ flags = 0;
+
+ if (!gluShaderUtil.isDataTypeBoolOrBVec(type)) {
+ // Precision.
+ /** @type {Array<number>} */ var precisionCandidates = [glsUniformBlockCase.UniformFlags.PRECISION_LOW, glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM, glsUniformBlockCase.UniformFlags.PRECISION_HIGH];
+ flags |= rnd.choose(precisionCandidates)[0];
+ }
+
+ return glsUniformBlockCase.newVarTypeBasic(type, flags);
+ }
+ };
+
+ /**
+ * genName
+ * @param {number} first
+ * @param {number} last
+ * @param {number} ndx
+ * @return {string}
+ */
+ glsRandomUniformBlockCase.RandomUniformBlockCase.prototype.genName = function(first, last, ndx) {
+ /** @type {string} */ var str = '';
+ /** @type {number} */ var alphabetLen = last - first + 1;
+
+ while (ndx > alphabetLen) {
+ str = String.fromCharCode(first + ((ndx - 1) % alphabetLen)) + str;
+ ndx = Math.floor((ndx - 1) / alphabetLen);
+ }
+
+ str = String.fromCharCode(first + (ndx % (alphabetLen + 1)) - 1) + str;
+
+ return str;
+ };
+
+ /**
+ * generateUniform
+ * @param {deRandom.Random} rnd
+ * @param {glsUniformBlockCase.UniformBlock} block
+ */
+ glsRandomUniformBlockCase.RandomUniformBlockCase.prototype.generateUniform = function(rnd, block) {
+ /** @type {number} */ var unusedVtxWeight = 0.15;
+ /** @type {number} */ var unusedFragWeight = 0.15;
+ /** @type {boolean} */ var unusedOk = (this.m_features & glsRandomUniformBlockCase.FeatureBits.FEATURE_UNUSED_UNIFORMS) != 0;
+ /** @type {number} */ var flags = 0;
+ /** @type {string} */ var name = this.genName('a'.charCodeAt(0), 'z'.charCodeAt(0), this.m_uniformNdx);
+ /** @type {glsUniformBlockCase.VarType} */ var type = this.generateType(rnd, 0, true); //TODO: implement this.
+
+ flags |= (unusedOk && rnd.getFloat() < unusedVtxWeight) ? glsUniformBlockCase.UniformFlags.UNUSED_VERTEX : 0;
+ flags |= (unusedOk && rnd.getFloat() < unusedFragWeight) ? glsUniformBlockCase.UniformFlags.UNUSED_FRAGMENT : 0;
+
+ block.addUniform(new glsUniformBlockCase.Uniform(name, type, flags));
+
+ this.m_uniformNdx += 1;
+ };
+
+ /**
+ * generateBlock
+ * @param {deRandom.Random} rnd
+ * @param {number} layoutFlags
+ */
+ glsRandomUniformBlockCase.RandomUniformBlockCase.prototype.generateBlock = function(rnd, layoutFlags) {
+ assertMsgOptions(this.m_blockNdx <= 'z'.charCodeAt(0) - 'a'.charCodeAt(0), 'generateBlock', false, true);
+
+ /** @type {number} */ var instanceArrayWeight = 0.3;
+ /** @type {glsUniformBlockCase.UniformBlock} */ var block = this.m_interface.allocBlock('Block' + String.fromCharCode('A'.charCodeAt(0) + this.m_blockNdx));
+ /** @type {number} */ var numInstances = (this.m_maxInstances > 0 && rnd.getFloat() < instanceArrayWeight) ? rnd.getInt(0, this.m_maxInstances) : 0;
+ /** @type {number} */ var numUniforms = rnd.getInt(1, this.m_maxBlockMembers);
+
+ if (numInstances > 0)
+ block.setArraySize(numInstances);
+
+ if (numInstances > 0 || rnd.getBool())
+ block.setInstanceName('block' + String.fromCharCode('A'.charCodeAt(0) + this.m_blockNdx));
+
+ // Layout flag candidates.
+ /** @type {Array<number>} */ var layoutFlagCandidates = [];
+ layoutFlagCandidates.push(0);
+ if (this.m_features & glsRandomUniformBlockCase.FeatureBits.FEATURE_PACKED_LAYOUT)
+ layoutFlagCandidates.push(glsUniformBlockCase.UniformFlags.LAYOUT_SHARED);
+ if ((this.m_features & glsRandomUniformBlockCase.FeatureBits.FEATURE_SHARED_LAYOUT) && ((layoutFlags & glsUniformBlockCase.UniformFlags.DECLARE_BOTH) != glsUniformBlockCase.UniformFlags.DECLARE_BOTH))
+ layoutFlagCandidates.push(glsUniformBlockCase.UniformFlags.LAYOUT_PACKED); // \note packed layout can only be used in a single shader stage.
+ if (this.m_features & glsRandomUniformBlockCase.FeatureBits.FEATURE_STD140_LAYOUT)
+ layoutFlagCandidates.push(glsUniformBlockCase.UniformFlags.LAYOUT_STD140);
+
+ layoutFlags |= rnd.choose(layoutFlagCandidates)[0]; //In Javascript, this function returns an array, so taking element 0.
+
+ if (this.m_features & glsRandomUniformBlockCase.FeatureBits.FEATURE_MATRIX_LAYOUT) {
+ /** @type {Array<number>}*/ var matrixCandidates = [0, glsUniformBlockCase.UniformFlags.LAYOUT_ROW_MAJOR, glsUniformBlockCase.UniformFlags.LAYOUT_COLUMN_MAJOR];
+ layoutFlags |= rnd.choose(matrixCandidates)[0];
+ }
+
+ block.setFlags(layoutFlags);
+
+ for (var ndx = 0; ndx < numUniforms; ndx++)
+ this.generateUniform(rnd, block);
+
+ this.m_blockNdx += 1;
+ };
+
+ /**
+ * Initializes the glsRandomUniformBlockCase.RandomUniformBlockCase
+ */
+ glsRandomUniformBlockCase.RandomUniformBlockCase.prototype.init = function() {
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(this.m_seed);
+
+ /** @type {number} */ var numShared = this.m_maxSharedBlocks > 0 ? rnd.getInt(1, this.m_maxSharedBlocks) : 0;
+ /** @type {number} */ var numVtxBlocks = this.m_maxVertexBlocks - numShared > 0 ? rnd.getInt(1, this.m_maxVertexBlocks - numShared) : 0;
+ /** @type {number} */ var numFragBlocks = this.m_maxFragmentBlocks - numShared > 0 ? rnd.getInt(1, this.m_maxFragmentBlocks - numShared) : 0;
+
+ for (var ndx = 0; ndx < numShared; ndx++)
+ this.generateBlock(rnd, glsUniformBlockCase.UniformFlags.DECLARE_VERTEX | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT);
+
+ for (var ndx = 0; ndx < numVtxBlocks; ndx++)
+ this.generateBlock(rnd, glsUniformBlockCase.UniformFlags.DECLARE_VERTEX);
+
+ for (var ndx = 0; ndx < numFragBlocks; ndx++)
+ this.generateBlock(rnd, glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT);
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsSamplerObjectTest.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsSamplerObjectTest.js
new file mode 100644
index 0000000000..0d4030bd91
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsSamplerObjectTest.js
@@ -0,0 +1,1148 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('modules.shared.glsSamplerObjectTest');
+goog.require('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.common.tcuTextureUtil');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.opengl.gluDrawUtil');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('framework.opengl.gluTextureUtil');
+
+goog.scope(function() {
+
+var glsSamplerObjectTest = modules.shared.glsSamplerObjectTest;
+var tcuTestCase = framework.common.tcuTestCase;
+var deRandom = framework.delibs.debase.deRandom;
+var gluShaderProgram = framework.opengl.gluShaderProgram;
+var tcuTexture = framework.common.tcuTexture;
+var tcuSurface = framework.common.tcuSurface;
+var tcuTextureUtil = framework.common.tcuTextureUtil;
+var tcuImageCompare = framework.common.tcuImageCompare;
+var gluDrawUtil = framework.opengl.gluDrawUtil;
+var gluTextureUtil = framework.opengl.gluTextureUtil;
+var deString = framework.delibs.debase.deString;
+
+ var DE_ASSERT = function(expression) {
+ if (!expression) throw new Error('Assert failed');
+ };
+
+ // glsSamplerObjectTest.TextureSamplerTest
+
+ /** @const @type {number} */ glsSamplerObjectTest.VIEWPORT_WIDTH = 128;
+ /** @const @type {number} */ glsSamplerObjectTest.VIEWPORT_HEIGHT = 128;
+
+ /** @const @type {number} */ glsSamplerObjectTest.TEXTURE2D_WIDTH = 32;
+ /** @const @type {number} */ glsSamplerObjectTest.TEXTURE2D_HEIGHT = 32;
+
+ /** @const @type {number} */ glsSamplerObjectTest.TEXTURE3D_WIDTH = 32;
+ /** @const @type {number} */ glsSamplerObjectTest.TEXTURE3D_HEIGHT = 32;
+ /** @const @type {number} */ glsSamplerObjectTest.TEXTURE3D_DEPTH = 32;
+
+ /** @const @type {number} */ glsSamplerObjectTest.CUBEMAP_SIZE = 32;
+
+ /** @const @type {Array<number>} */ glsSamplerObjectTest.s_positions = [
+ -1.0, -1.0,
+ 1.0, -1.0,
+ 1.0, 1.0,
+ 1.0, 1.0,
+ -1.0, 1.0,
+ -1.0, -1.0
+ ];
+
+ /** @const @type {Array<number>} */ glsSamplerObjectTest.s_positions3D = [
+ -1.0, -1.0, -1.0,
+ 1.0, -1.0, 1.0,
+ 1.0, 1.0, -1.0,
+ 1.0, 1.0, -1.0,
+ -1.0, 1.0, 1.0,
+ -1.0, -1.0, -1.0
+ ];
+
+ /** @const @type {Array<number>} */ glsSamplerObjectTest.s_positionsCube = [
+ -1.0, -1.0, -1.0, -0.5,
+ 1.0, -1.0, 1.0, -0.5,
+ 1.0, 1.0, 1.0, 0.5,
+ 1.0, 1.0, 1.0, 0.5,
+ -1.0, 1.0, -1.0, 0.5,
+ -1.0, -1.0, -1.0, -0.5
+ ];
+
+ /**
+ * @struct
+ * @constructor
+ */
+ glsSamplerObjectTest.SamplingState = function(minFilter, magFilter, wrapT, wrapS, wrapR, minLod, maxLod) {
+ /** @type {number} */ this.minFilter = minFilter;
+ /** @type {number} */ this.magFilter = magFilter;
+ /** @type {number} */ this.wrapT = wrapT;
+ /** @type {number} */ this.wrapS = wrapS;
+ /** @type {number} */ this.wrapR = wrapR;
+ /** @type {number} */ this.minLod = minLod;
+ /** @type {number} */ this.maxLod = maxLod;
+ };
+
+ /**
+ * @struct
+ * @param {string} name
+ * @param {string} desc
+ * @param {number} target
+ * @param {glsSamplerObjectTest.SamplingState} state1
+ * @param {glsSamplerObjectTest.SamplingState} state2
+ * @param {glsSamplerObjectTest.SamplingState=} state3
+ * @constructor
+ */
+ glsSamplerObjectTest.TestSpec = function(name, desc, target, state1, state2, state3) {
+ /** @type {string} */ this.name = name;
+ /** @type {string} */ this.desc = desc;
+ /** @type {number} */ this.target = target;
+ /** @type {glsSamplerObjectTest.SamplingState} */ this.textureState = state1;
+ /** @type {glsSamplerObjectTest.SamplingState} */ this.textureState2 = state3 !== undefined ? state2 : null; // merging TST and MTST structs
+ /** @type {glsSamplerObjectTest.SamplingState} */ this.samplerState = state3 !== undefined ? state3 : state2;
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @const @param {glsSamplerObjectTest.TestSpec} spec
+ */
+ glsSamplerObjectTest.TextureSamplerTest = function(spec) {
+ tcuTestCase.DeqpTest.call(this, spec.name, spec.desc);
+ /** @type {gluShaderProgram.ShaderProgram} */ this.m_program = null;
+ /** @type {number} */ this.m_target = spec.target;
+ /** @type {glsSamplerObjectTest.SamplingState} */ this.m_textureState = spec.textureState;
+ /** @type {glsSamplerObjectTest.SamplingState} */ this.m_samplerState = spec.samplerState;
+ /** @type {deRandom.Random} */ this.m_random = new deRandom.Random(deString.deStringHash(spec.name));
+ };
+
+ glsSamplerObjectTest.TextureSamplerTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ glsSamplerObjectTest.TextureSamplerTest.prototype.constructor = glsSamplerObjectTest.TextureSamplerTest;
+
+ /**
+ * @private
+ * @param {tcuSurface.Surface} textureRef
+ * @param {tcuSurface.Surface} samplerRef
+ * @param {number} x
+ * @param {number} y
+ */
+ glsSamplerObjectTest.TextureSamplerTest.prototype.renderReferences = function(textureRef, samplerRef, x, y) {
+ /** @type {WebGLTexture} */ var texture = glsSamplerObjectTest.TextureSamplerTest.createTexture(this.m_target);
+
+ gl.viewport(x, y, glsSamplerObjectTest.VIEWPORT_WIDTH, glsSamplerObjectTest.VIEWPORT_HEIGHT);
+
+ gl.bindTexture(this.m_target, texture);
+
+ glsSamplerObjectTest.TextureSamplerTest.setTextureState(this.m_target, this.m_textureState);
+ this.render();
+ var texRef = textureRef.getAccess();
+ var texRefTransferFormat = gluTextureUtil.getTransferFormat(texRef.getFormat());
+ gl.readPixels(x, y, texRef.m_width, texRef.m_height, texRefTransferFormat.format, texRefTransferFormat.dataType, textureRef.m_pixels);
+
+ glsSamplerObjectTest.TextureSamplerTest.setTextureState(this.m_target, this.m_samplerState);
+ this.render();
+ var sampRef = samplerRef.getAccess();
+ var sampRefTransferFormat = gluTextureUtil.getTransferFormat(sampRef.getFormat());
+ gl.readPixels(x, y, sampRef.m_width, sampRef.m_height, sampRefTransferFormat.format, sampRefTransferFormat.dataType, samplerRef.m_pixels);
+
+ gl.deleteTexture(texture);
+ };
+
+ /**
+ * @private
+ * @param {tcuSurface.Surface} textureResult
+ * @param {tcuSurface.Surface} samplerResult
+ * @param {number} x
+ * @param {number} y
+ */
+ glsSamplerObjectTest.TextureSamplerTest.prototype.renderResults = function(textureResult, samplerResult, x, y) {
+ /** @type {WebGLTexture} */ var texture = glsSamplerObjectTest.TextureSamplerTest.createTexture(this.m_target);
+
+ gl.viewport(x, y, glsSamplerObjectTest.VIEWPORT_WIDTH, glsSamplerObjectTest.VIEWPORT_HEIGHT);
+
+ var sampler = gl.createSampler();
+ DE_ASSERT(sampler != -1);
+
+ gl.bindSampler(0, sampler);
+
+ // First set sampler state
+ glsSamplerObjectTest.TextureSamplerTest.setSamplerState(this.m_samplerState, sampler);
+
+ // Set texture state
+ gl.bindTexture(this.m_target, texture);
+
+ glsSamplerObjectTest.TextureSamplerTest.setTextureState(this.m_target, this.m_textureState);
+ // Render using sampler
+ this.render();
+ var sampRes = samplerResult.getAccess();
+ var sampResTransferFormat = gluTextureUtil.getTransferFormat(sampRes.getFormat());
+ gl.readPixels(x, y, sampRes.m_width, sampRes.m_height, sampResTransferFormat.format, sampResTransferFormat.dataType, samplerResult.m_pixels);
+
+ // Render without sampler
+ gl.bindSampler(0, null);
+ gl.deleteSampler(sampler);
+
+ this.render();
+ var texRes = textureResult.getAccess();
+ var texResTransferFormat = gluTextureUtil.getTransferFormat(texRes.getFormat());
+ gl.readPixels(x, y, texRes.m_width, texRes.m_height, texResTransferFormat.format, texResTransferFormat.dataType, textureResult.m_pixels);
+
+ gl.deleteSampler(sampler);
+ gl.deleteTexture(texture);
+ };
+
+ /**
+ * @private
+ */
+ glsSamplerObjectTest.TextureSamplerTest.prototype.render = function() {
+ /** @type {WebGLUniformLocation} */ var samplerLoc;
+ /** @type {WebGLUniformLocation} */ var scaleLoc;
+
+ gl.useProgram(this.m_program.getProgram());
+
+ samplerLoc = gl.getUniformLocation(this.m_program.getProgram(), 'u_sampler');
+ DE_ASSERT(samplerLoc != null);
+
+ scaleLoc = gl.getUniformLocation(this.m_program.getProgram(), 'u_posScale');
+ DE_ASSERT(scaleLoc != null);
+
+ gl.clearColor(0.5, 0.5, 0.5, 1.0);
+
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ gl.uniform1i(samplerLoc, 0);
+
+ gl.uniform1f(scaleLoc, 1.0);
+
+ /** @type {Array<gluDrawUtil.VertexArrayBinding>} */ var vertexArrays;
+ switch (this.m_target) {
+ case gl.TEXTURE_2D: {
+ vertexArrays = [
+ gluDrawUtil.vabFromBindingPointAndArrayPointer(
+ gluDrawUtil.bindingPointFromName('a_position'),
+ new gluDrawUtil.VertexArrayPointer(
+ gluDrawUtil.VertexComponentType.VTX_COMP_FLOAT,
+ gluDrawUtil.VertexComponentConversion.VTX_COMP_CONVERT_NONE,
+ 2,
+ 6,
+ 0,
+ glsSamplerObjectTest.s_positions))
+ ];
+
+ gluDrawUtil.draw(gl, this.m_program.getProgram(), vertexArrays, new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.TRIANGLES, 6));
+
+ gl.uniform1f(scaleLoc, 0.25);
+
+ gluDrawUtil.draw(gl, this.m_program.getProgram(), vertexArrays, new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.TRIANGLES, 6));
+
+ break;
+ }
+
+ case gl.TEXTURE_3D: {
+ vertexArrays = [
+ gluDrawUtil.vabFromBindingPointAndArrayPointer(
+ gluDrawUtil.bindingPointFromName('a_position'),
+ new gluDrawUtil.VertexArrayPointer(
+ gluDrawUtil.VertexComponentType.VTX_COMP_FLOAT,
+ gluDrawUtil.VertexComponentConversion.VTX_COMP_CONVERT_NONE,
+ 3,
+ 6,
+ 0,
+ glsSamplerObjectTest.s_positions3D))
+ ];
+
+ gluDrawUtil.draw(gl, this.m_program.getProgram(), vertexArrays, new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.TRIANGLES, 6));
+
+ gl.uniform1f(scaleLoc, 0.25);
+
+ gluDrawUtil.draw(gl, this.m_program.getProgram(), vertexArrays, new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.TRIANGLES, 6));
+
+ break;
+ }
+
+ case gl.TEXTURE_CUBE_MAP: {
+ vertexArrays = [
+ gluDrawUtil.vabFromBindingPointAndArrayPointer(
+ gluDrawUtil.bindingPointFromName('a_position'),
+ new gluDrawUtil.VertexArrayPointer(
+ gluDrawUtil.VertexComponentType.VTX_COMP_FLOAT,
+ gluDrawUtil.VertexComponentConversion.VTX_COMP_CONVERT_NONE,
+ 4,
+ 6,
+ 0,
+ glsSamplerObjectTest.s_positionsCube))
+ ];
+
+ gluDrawUtil.draw(gl, this.m_program.getProgram(), vertexArrays, new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.TRIANGLES, 6));
+
+ gl.uniform1f(scaleLoc, 0.25);
+
+ gluDrawUtil.draw(gl, this.m_program.getProgram(), vertexArrays, new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.TRIANGLES, 6));
+
+ break;
+ }
+
+ default:
+ DE_ASSERT(false);
+ }
+ };
+
+ /**
+ * @private
+ * @param {number} target
+ * @param {glsSamplerObjectTest.SamplingState} state
+ */
+ glsSamplerObjectTest.TextureSamplerTest.setTextureState = function(target, state) {
+ gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, state.minFilter);
+ gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, state.magFilter);
+ gl.texParameteri(target, gl.TEXTURE_WRAP_S, state.wrapS);
+ gl.texParameteri(target, gl.TEXTURE_WRAP_T, state.wrapT);
+ gl.texParameteri(target, gl.TEXTURE_WRAP_R, state.wrapR);
+ gl.texParameterf(target, gl.TEXTURE_MAX_LOD, state.maxLod);
+ gl.texParameterf(target, gl.TEXTURE_MIN_LOD, state.minLod);
+ };
+
+ /**
+ * @private
+ * @param {glsSamplerObjectTest.SamplingState} state
+ * @param {WebGLSampler} sampler
+ */
+ glsSamplerObjectTest.TextureSamplerTest.setSamplerState = function(state, sampler) {
+ gl.samplerParameteri(sampler, gl.TEXTURE_MIN_FILTER, state.minFilter);
+ gl.samplerParameteri(sampler, gl.TEXTURE_MAG_FILTER, state.magFilter);
+ gl.samplerParameteri(sampler, gl.TEXTURE_WRAP_S, state.wrapS);
+ gl.samplerParameteri(sampler, gl.TEXTURE_WRAP_T, state.wrapT);
+ gl.samplerParameteri(sampler, gl.TEXTURE_WRAP_R, state.wrapR);
+ gl.samplerParameterf(sampler, gl.TEXTURE_MAX_LOD, state.maxLod);
+ gl.samplerParameterf(sampler, gl.TEXTURE_MIN_LOD, state.minLod);
+ };
+
+ /**
+ * @private
+ * @return {WebGLTexture}
+ */
+ glsSamplerObjectTest.TextureSamplerTest.createTexture2D = function() {
+ /** @type {WebGLTexture} */ var texture = null;
+ /** @type {tcuTexture.Texture2D} */ var refTexture = new tcuTexture.Texture2D(
+ new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA,
+ tcuTexture.ChannelType.UNORM_INT8),
+ glsSamplerObjectTest.TEXTURE2D_WIDTH,
+ glsSamplerObjectTest.TEXTURE2D_HEIGHT);
+
+ refTexture.allocLevel(0);
+ tcuTextureUtil.fillWithComponentGradients(refTexture.getLevel(0), [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]);
+
+ texture = gl.createTexture();
+
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, refTexture.getWidth(), refTexture.getHeight(), 0, gl.RGBA, gl.UNSIGNED_BYTE, refTexture.getLevel(0).getDataPtr());
+
+ gl.generateMipmap(gl.TEXTURE_2D);
+
+ gl.bindTexture(gl.TEXTURE_2D, null);
+
+ return texture;
+ };
+
+ /**
+ * @private
+ * @return {WebGLTexture}
+ */
+ glsSamplerObjectTest.TextureSamplerTest.createTexture3D = function() {
+ /** @type {WebGLTexture} */ var texture = null;
+ /** @type {tcuTexture.Texture3D} */ var refTexture = new tcuTexture.Texture3D(
+ new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA,
+ tcuTexture.ChannelType.UNORM_INT8),
+ glsSamplerObjectTest.TEXTURE3D_WIDTH,
+ glsSamplerObjectTest.TEXTURE3D_HEIGHT,
+ glsSamplerObjectTest.TEXTURE3D_DEPTH);
+
+ refTexture.allocLevel(0);
+ tcuTextureUtil.fillWithComponentGradients(refTexture.getLevel(0), [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]);
+
+ texture = gl.createTexture();
+
+ gl.bindTexture(gl.TEXTURE_3D, texture);
+
+ gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, refTexture.getWidth(), refTexture.getHeight(), refTexture.getDepth(), 0, gl.RGBA, gl.UNSIGNED_BYTE, refTexture.getLevel(0).getDataPtr());
+
+ gl.generateMipmap(gl.TEXTURE_3D);
+
+ gl.bindTexture(gl.TEXTURE_3D, null);
+
+ return texture;
+ };
+
+ /**
+ * @private
+ * @return {WebGLTexture}
+ */
+ glsSamplerObjectTest.TextureSamplerTest.createTextureCube = function() {
+ /** @type {WebGLTexture} */ var texture = null;
+ /** @type {tcuTexture.TextureCube} */ var refTexture = new tcuTexture.TextureCube(
+ new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA,
+ tcuTexture.ChannelType.UNORM_INT8),
+ glsSamplerObjectTest.CUBEMAP_SIZE);
+
+ texture = gl.createTexture();
+
+ refTexture.allocLevel(tcuTexture.CubeFace.CUBEFACE_POSITIVE_X, 0);
+ refTexture.allocLevel(tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y, 0);
+ refTexture.allocLevel(tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z, 0);
+ refTexture.allocLevel(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X, 0);
+ refTexture.allocLevel(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y, 0);
+ refTexture.allocLevel(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z, 0);
+
+ tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_POSITIVE_X), [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]);
+ tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y), [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]);
+ tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z), [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]);
+ tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X), [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]);
+ tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y), [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]);
+ tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z), [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 1.0, 1.0]);
+
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture);
+ // TODO: check internalFormat / format parameters in texImage2D (were RGBA8 and RGBA respectively)
+ for (var face in tcuTexture.CubeFace) {
+ /** @const @type {number} */ var target = gluTextureUtil.getGLCubeFace(tcuTexture.CubeFace[face]);
+ gl.texImage2D(target, 0, gl.RGBA, refTexture.getSize(), refTexture.getSize(), 0, gl.RGBA, gl.UNSIGNED_BYTE, refTexture.getLevelFace(0, tcuTexture.CubeFace[face]).getDataPtr());
+ }
+
+ gl.generateMipmap(gl.TEXTURE_CUBE_MAP);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, null);
+
+ return texture;
+ };
+
+ /**
+ * @private
+ * @param {number} target
+ * @return {WebGLTexture}
+ */
+ glsSamplerObjectTest.TextureSamplerTest.createTexture = function(target) {
+ /** @type {WebGLTexture} */ var texture;
+ switch (target) {
+ case gl.TEXTURE_2D:
+ texture = glsSamplerObjectTest.TextureSamplerTest.createTexture2D();
+ break;
+
+ case gl.TEXTURE_3D:
+ texture = glsSamplerObjectTest.TextureSamplerTest.createTexture3D();
+ break;
+
+ case gl.TEXTURE_CUBE_MAP:
+ texture = glsSamplerObjectTest.TextureSamplerTest.createTextureCube();
+ break;
+
+ default:
+ throw new Error('Unsupported target: ' + WebGLTestUtils.glEnumToString(gl, target));
+ }
+
+ return texture;
+ };
+
+ /**
+ * @private
+ * @param {number} target
+ * @return {string}
+ */
+ glsSamplerObjectTest.TextureSamplerTest.selectVertexShader = function(target) {
+ switch (target) {
+ case gl.TEXTURE_2D:
+ return '#version 300 es\n' +
+ 'in highp vec2 a_position;\n' +
+ 'uniform highp float u_posScale;\n' +
+ 'out mediump vec2 v_texCoord;\n' +
+ 'void main (void)\n' +
+ ' {\n' +
+ '\tv_texCoord = a_position;\n' +
+ '\tgl_Position = vec4(u_posScale * a_position, 0.0, 1.0);\n' +
+ '}';
+
+ case gl.TEXTURE_3D:
+ return '#version 300 es\n' +
+ 'in highp vec3 a_position;\n' +
+ 'uniform highp float u_posScale;\n' +
+ 'out mediump vec3 v_texCoord;\n' +
+ 'void main (void)\n' +
+ ' {\n' +
+ '\tv_texCoord = a_position;\n' +
+ '\tgl_Position = vec4(u_posScale * a_position.xy, 0.0, 1.0);\n' +
+ '}';
+
+ case gl.TEXTURE_CUBE_MAP:
+ return '#version 300 es\n' +
+ 'in highp vec4 a_position;\n' +
+ 'uniform highp float u_posScale;\n' +
+ 'out mediump vec2 v_texCoord;\n' +
+ 'void main (void)\n' +
+ ' {\n' +
+ '\tv_texCoord = a_position.zw;\n' +
+ '\tgl_Position = vec4(u_posScale * a_position.xy, 0.0, 1.0);\n' +
+ '}';
+
+ default:
+ DE_ASSERT(false);
+ return '';
+ }
+ };
+
+ /**
+ * @private
+ * @param {number} target
+ * @return {string}
+ */
+ glsSamplerObjectTest.TextureSamplerTest.selectFragmentShader = function(target) {
+ switch (target) {
+ case gl.TEXTURE_2D:
+ return '#version 300 es\nlayout(location = 0) out mediump vec4 o_color;\n' +
+ 'uniform lowp sampler2D u_sampler;\n' +
+ 'in mediump vec2 v_texCoord;\n' +
+ 'void main (void)\n' +
+ ' {\n' +
+ '\to_color = texture(u_sampler, v_texCoord);\n' +
+ '}';
+
+ case gl.TEXTURE_3D:
+ return '#version 300 es\nlayout(location = 0) out mediump vec4 o_color;\n' +
+ 'uniform lowp sampler3D u_sampler;\n' +
+ 'in mediump vec3 v_texCoord;\n' +
+ 'void main (void)\n' +
+ ' {\n' +
+ '\to_color = texture(u_sampler, v_texCoord);\n' +
+ '}';
+
+ case gl.TEXTURE_CUBE_MAP:
+ return '#version 300 es\nlayout(location = 0) out mediump vec4 o_color;\n' +
+ 'uniform lowp samplerCube u_sampler;\n' +
+ 'in mediump vec2 v_texCoord;\n' +
+ 'void main (void)\n' +
+ ' {\n' +
+ '\to_color = texture(u_sampler, vec3(cos(3.14 * v_texCoord.y) * sin(3.14 * v_texCoord.x), sin(3.14 * v_texCoord.y), cos(3.14 * v_texCoord.y) * cos(3.14 * v_texCoord.x)));\n' +
+ '}';
+
+ default:
+ DE_ASSERT(false);
+ return '';
+ }
+ };
+
+ glsSamplerObjectTest.TextureSamplerTest.prototype.init = function() {
+ /** @const @type {string} */ var vertexShaderTemplate = glsSamplerObjectTest.TextureSamplerTest.selectVertexShader(this.m_target);
+ /** @const @type {string} */ var fragmentShaderTemplate = glsSamplerObjectTest.TextureSamplerTest.selectFragmentShader(this.m_target);
+
+ DE_ASSERT(!this.m_program);
+ this.m_program = new gluShaderProgram.ShaderProgram(gl,
+ gluShaderProgram.makeVtxFragSources(
+ vertexShaderTemplate,
+ fragmentShaderTemplate));
+
+ if (!this.m_program.isOk()) {
+ // tcu::TestLog& log = m_testCtx.getLog();
+ // log << *m_program;
+ throw new Error('Failed to compile shaders');
+ }
+ };
+
+ glsSamplerObjectTest.TextureSamplerTest.prototype.iterate = function() {
+ //tcu::TestLog& log = m_testCtx.getLog();
+
+ /** @type {tcuSurface.Surface} */ var textureRef = new tcuSurface.Surface(glsSamplerObjectTest.VIEWPORT_WIDTH, glsSamplerObjectTest.VIEWPORT_HEIGHT);
+ /** @type {tcuSurface.Surface} */ var samplerRef = new tcuSurface.Surface(glsSamplerObjectTest.VIEWPORT_WIDTH, glsSamplerObjectTest.VIEWPORT_HEIGHT);
+
+ /** @type {tcuSurface.Surface} */ var textureResult = new tcuSurface.Surface(glsSamplerObjectTest.VIEWPORT_WIDTH, glsSamplerObjectTest.VIEWPORT_HEIGHT);
+ /** @type {tcuSurface.Surface} */ var samplerResult = new tcuSurface.Surface(glsSamplerObjectTest.VIEWPORT_WIDTH, glsSamplerObjectTest.VIEWPORT_HEIGHT);
+
+ /** @type {number} */ var x = this.m_random.getInt(0, gl.drawingBufferWidth - glsSamplerObjectTest.VIEWPORT_WIDTH);
+ /** @type {number} */ var y = this.m_random.getInt(0, gl.drawingBufferHeight - glsSamplerObjectTest.VIEWPORT_HEIGHT);
+
+ this.renderReferences(textureRef, samplerRef, x, y);
+ this.renderResults(textureResult, samplerResult, x, y);
+
+ /** @type {boolean} */ var isOk = tcuImageCompare.pixelThresholdCompare('Sampler render result', 'Result from rendering with sampler', samplerRef, samplerResult, [0, 0, 0, 0]);
+
+ if (!tcuImageCompare.pixelThresholdCompare('Texture render result', 'Result from rendering with texture state', textureRef, textureResult, [0, 0, 0, 0]))
+ isOk = false;
+
+ assertMsgOptions(isOk, '', true, false);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ // glsSamplerObjectTest.MultiTextureSamplerTest
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @const @param {glsSamplerObjectTest.TestSpec} spec
+ */
+ glsSamplerObjectTest.MultiTextureSamplerTest = function(spec) {
+ tcuTestCase.DeqpTest.call(this, spec.name, spec.desc);
+ /** @type {gluShaderProgram.ShaderProgram} */ this.m_program = null;
+ /** @type {number} */ this.m_target = spec.target;
+ /** @type {glsSamplerObjectTest.SamplingState} */ this.m_textureState1 = spec.textureState;
+ /** @type {glsSamplerObjectTest.SamplingState} */ this.m_textureState2 = spec.textureState2;
+ /** @type {glsSamplerObjectTest.SamplingState} */ this.m_samplerState = spec.samplerState;
+ /** @type {deRandom.Random} */ this.m_random = new deRandom.Random(deString.deStringHash(spec.name));
+ };
+
+ glsSamplerObjectTest.MultiTextureSamplerTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ glsSamplerObjectTest.MultiTextureSamplerTest.prototype.constructor = glsSamplerObjectTest.MultiTextureSamplerTest;
+
+ glsSamplerObjectTest.MultiTextureSamplerTest.prototype.init = function() {
+ /** @type {string} */ var vertexShaderTemplate = glsSamplerObjectTest.MultiTextureSamplerTest.selectVertexShader(this.m_target);
+ /** @type {string} */ var fragmentShaderTemplate = glsSamplerObjectTest.MultiTextureSamplerTest.selectFragmentShader(this.m_target);
+
+ DE_ASSERT(!this.m_program);
+ this.m_program = new gluShaderProgram.ShaderProgram(gl,
+ gluShaderProgram.makeVtxFragSources(
+ vertexShaderTemplate,
+ fragmentShaderTemplate));
+ if (!this.m_program.isOk()) {
+ // tcu::TestLog& log = m_testCtx.getLog();
+ //
+ // log << *m_program;
+ throw new Error('Failed to compile shaders');
+ }
+ };
+
+ glsSamplerObjectTest.MultiTextureSamplerTest.prototype.deinit = function() {
+ gl.activeTexture(gl.TEXTURE0);
+ }
+
+ glsSamplerObjectTest.MultiTextureSamplerTest.prototype.iterate = function() {
+ //tcu::TestLog& log = m_testCtx.getLog();
+
+ /** @type {tcuSurface.Surface} */ var textureRef = new tcuSurface.Surface(glsSamplerObjectTest.VIEWPORT_WIDTH, glsSamplerObjectTest.VIEWPORT_HEIGHT);
+ /** @type {tcuSurface.Surface} */ var samplerRef = new tcuSurface.Surface(glsSamplerObjectTest.VIEWPORT_WIDTH, glsSamplerObjectTest.VIEWPORT_HEIGHT);
+
+ /** @type {tcuSurface.Surface} */ var textureResult = new tcuSurface.Surface(glsSamplerObjectTest.VIEWPORT_WIDTH, glsSamplerObjectTest.VIEWPORT_HEIGHT);
+ /** @type {tcuSurface.Surface} */ var samplerResult = new tcuSurface.Surface(glsSamplerObjectTest.VIEWPORT_WIDTH, glsSamplerObjectTest.VIEWPORT_HEIGHT);
+
+ /** @type {number} */ var x = this.m_random.getInt(0, gl.drawingBufferWidth - glsSamplerObjectTest.VIEWPORT_WIDTH);
+ /** @type {number} */ var y = this.m_random.getInt(0, gl.drawingBufferHeight - glsSamplerObjectTest.VIEWPORT_HEIGHT);
+
+ this.renderReferences(textureRef, samplerRef, x, y);
+ this.renderResults(textureResult, samplerResult, x, y);
+
+ /** @type {boolean} */ var isOk = tcuImageCompare.pixelThresholdCompare('Sampler render result', 'Result from rendering with sampler', samplerRef, samplerResult, [0, 0, 0, 0]);
+
+ if (!tcuImageCompare.pixelThresholdCompare('Texture render result', 'Result from rendering with texture state', textureRef, textureResult, [0, 0, 0, 0]))
+ isOk = false;
+
+ assertMsgOptions(isOk, '', true, false);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @private
+ * @param {tcuSurface.Surface} textureRef
+ * @param {tcuSurface.Surface} samplerRef
+ * @param {number} x
+ * @param {number} y
+ */
+ glsSamplerObjectTest.MultiTextureSamplerTest.prototype.renderReferences = function(textureRef, samplerRef, x, y) {
+ /** @type {WebGLTexture} */ var texture1 = glsSamplerObjectTest.MultiTextureSamplerTest.createTexture(this.m_target, 0);
+ /** @type {WebGLTexture} */ var texture2 = glsSamplerObjectTest.MultiTextureSamplerTest.createTexture(this.m_target, 1);
+
+ gl.viewport(x, y, glsSamplerObjectTest.VIEWPORT_WIDTH, glsSamplerObjectTest.VIEWPORT_HEIGHT);
+
+ // Generate texture rendering reference
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(this.m_target, texture1);
+ glsSamplerObjectTest.MultiTextureSamplerTest.setTextureState(this.m_target, this.m_textureState1);
+
+ gl.activeTexture(gl.TEXTURE1);
+ gl.bindTexture(this.m_target, texture2);
+ glsSamplerObjectTest.MultiTextureSamplerTest.setTextureState(this.m_target, this.m_textureState2);
+
+ this.render();
+ var texRef = textureRef.getAccess();
+ var texRefTransferFormat = gluTextureUtil.getTransferFormat(texRef.getFormat());
+ gl.readPixels(x, y, texRef.m_width, texRef.m_height, texRefTransferFormat.format, texRefTransferFormat.dataType, textureRef.m_pixels);
+
+ // Generate sampler rendering reference
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(this.m_target, texture1);
+ glsSamplerObjectTest.MultiTextureSamplerTest.setTextureState(this.m_target, this.m_samplerState);
+
+ gl.activeTexture(gl.TEXTURE1);
+ gl.bindTexture(this.m_target, texture2);
+ glsSamplerObjectTest.MultiTextureSamplerTest.setTextureState(this.m_target, this.m_samplerState);
+
+ this.render();
+ var sampRef = samplerRef.getAccess();
+ var sampRefTransferFormat = gluTextureUtil.getTransferFormat(sampRef.getFormat());
+ gl.readPixels(x, y, sampRef.m_width, sampRef.m_height, sampRefTransferFormat.format, sampRefTransferFormat.dataType, samplerRef.m_pixels);
+ };
+
+ /**
+ * @private
+ * @param {tcuSurface.Surface} textureResult
+ * @param {tcuSurface.Surface} samplerResult
+ * @param {number} x
+ * @param {number} y
+ */
+ glsSamplerObjectTest.MultiTextureSamplerTest.prototype.renderResults = function(textureResult, samplerResult, x, y) {
+ /** @type {WebGLTexture} */ var texture1 = glsSamplerObjectTest.MultiTextureSamplerTest.createTexture(this.m_target, 0);
+ /** @type {WebGLTexture} */ var texture2 = glsSamplerObjectTest.MultiTextureSamplerTest.createTexture(this.m_target, 1);
+
+ gl.viewport(x, y, glsSamplerObjectTest.VIEWPORT_WIDTH, glsSamplerObjectTest.VIEWPORT_HEIGHT);
+
+ /** @type {WebGLSampler} */ var sampler = gl.createSampler();
+ DE_ASSERT(sampler != -1);
+
+ gl.bindSampler(0, sampler);
+ gl.bindSampler(1, sampler);
+
+ // First set sampler state
+ glsSamplerObjectTest.MultiTextureSamplerTest.setSamplerState(this.m_samplerState, sampler);
+
+ // Set texture state
+ gl.bindTexture(this.m_target, texture1);
+ glsSamplerObjectTest.MultiTextureSamplerTest.setTextureState(this.m_target, this.m_textureState1);
+
+ gl.bindTexture(this.m_target, texture2);
+ glsSamplerObjectTest.MultiTextureSamplerTest.setTextureState(this. m_target, this.m_textureState2);
+
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(this.m_target, texture1);
+
+ gl.activeTexture(gl.TEXTURE1);
+ gl.bindTexture(this.m_target, texture2);
+
+ // Render using sampler
+ this.render();
+ var sampRes = samplerResult.getAccess();
+ var sampResTransferFormat = gluTextureUtil.getTransferFormat(sampRes.getFormat());
+ gl.readPixels(x, y, sampRes.m_width, sampRes.m_height, sampResTransferFormat.format, sampResTransferFormat.dataType, samplerResult.m_pixels);
+
+ gl.bindSampler(0, null);
+ gl.bindSampler(1, null);
+
+ this.render();
+ var texRes = textureResult.getAccess();
+ var texResTransferFormat = gluTextureUtil.getTransferFormat(texRes.getFormat());
+ gl.readPixels(x, y, texRes.m_width, texRes.m_height, texResTransferFormat.format, texResTransferFormat.dataType, textureResult.m_pixels);
+
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(this.m_target, null);
+
+ gl.activeTexture(gl.TEXTURE1);
+ gl.bindTexture(this.m_target, null);
+
+ gl.deleteSampler(sampler);
+ gl.deleteTexture(texture1);
+ gl.deleteTexture(texture2);
+ };
+
+ glsSamplerObjectTest.MultiTextureSamplerTest.prototype.render = function() {
+
+ gl.useProgram(this.m_program.getProgram());
+
+ /** @type {WebGLUniformLocation} */ var samplerLoc1 = gl.getUniformLocation(this.m_program.getProgram(), 'u_sampler1');
+ DE_ASSERT(samplerLoc1 != -1);
+
+ /** @type {WebGLUniformLocation} */ var samplerLoc2 = gl.getUniformLocation(this.m_program.getProgram(), 'u_sampler2');
+ DE_ASSERT(samplerLoc2 != -1);
+
+ /** @type {WebGLUniformLocation} */ var scaleLoc = gl.getUniformLocation(this.m_program.getProgram(), 'u_posScale');
+ DE_ASSERT(scaleLoc != -1);
+
+ gl.clearColor(0.5, 0.5, 0.5, 1.0);
+
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ gl.uniform1i(samplerLoc1, 0);
+
+ gl.uniform1i(samplerLoc2, 1);
+
+ gl.uniform1f(scaleLoc, 1.0);
+
+ /** @type {Array<gluDrawUtil.VertexArrayBinding>} */ var vertexArrays;
+ switch (this.m_target) {
+ case gl.TEXTURE_2D: {
+ vertexArrays = [
+ gluDrawUtil.vabFromBindingPointAndArrayPointer(
+ gluDrawUtil.bindingPointFromName('a_position'),
+ new gluDrawUtil.VertexArrayPointer(
+ gluDrawUtil.VertexComponentType.VTX_COMP_FLOAT,
+ gluDrawUtil.VertexComponentConversion.VTX_COMP_CONVERT_NONE,
+ 2,
+ 6,
+ 0,
+ glsSamplerObjectTest.s_positions))
+ ];
+
+ gluDrawUtil.draw(gl, this.m_program.getProgram(), vertexArrays, new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.TRIANGLES, 6));
+
+ gl.uniform1f(scaleLoc, 0.25);
+
+ gluDrawUtil.draw(gl, this.m_program.getProgram(), vertexArrays, new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.TRIANGLES, 6));
+
+ break;
+ }
+
+ case gl.TEXTURE_3D: {
+ vertexArrays = [
+ gluDrawUtil.vabFromBindingPointAndArrayPointer(
+ gluDrawUtil.bindingPointFromName('a_position'),
+ new gluDrawUtil.VertexArrayPointer(
+ gluDrawUtil.VertexComponentType.VTX_COMP_FLOAT,
+ gluDrawUtil.VertexComponentConversion.VTX_COMP_CONVERT_NONE,
+ 3,
+ 6,
+ 0,
+ glsSamplerObjectTest.s_positions3D))
+ ];
+
+ gluDrawUtil.draw(gl, this.m_program.getProgram(), vertexArrays, new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.TRIANGLES, 6));
+
+ gl.uniform1f(scaleLoc, 0.25);
+
+ gluDrawUtil.draw(gl, this.m_program.getProgram(), vertexArrays, new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.TRIANGLES, 6));
+
+ break;
+ }
+
+ case gl.TEXTURE_CUBE_MAP: {
+ vertexArrays = [
+ gluDrawUtil.vabFromBindingPointAndArrayPointer(
+ gluDrawUtil.bindingPointFromName('a_position'),
+ new gluDrawUtil.VertexArrayPointer(
+ gluDrawUtil.VertexComponentType.VTX_COMP_FLOAT,
+ gluDrawUtil.VertexComponentConversion.VTX_COMP_CONVERT_NONE,
+ 4,
+ 6,
+ 0,
+ glsSamplerObjectTest.s_positionsCube))
+ ];
+
+ gluDrawUtil.draw(gl, this.m_program.getProgram(), vertexArrays, new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.TRIANGLES, 6));
+
+ gl.uniform1f(scaleLoc, 0.25);
+
+ gluDrawUtil.draw(gl, this.m_program.getProgram(), vertexArrays, new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.TRIANGLES, 6));
+
+ break;
+ }
+
+ default:
+ DE_ASSERT(false);
+ }
+
+ };
+
+ /**
+ * @private
+ * @param {number} target
+ * @param {glsSamplerObjectTest.SamplingState} state
+ */
+ glsSamplerObjectTest.MultiTextureSamplerTest.setTextureState = function(target, state) {
+ gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, state.minFilter);
+ gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, state.magFilter);
+ gl.texParameteri(target, gl.TEXTURE_WRAP_S, state.wrapS);
+ gl.texParameteri(target, gl.TEXTURE_WRAP_T, state.wrapT);
+ gl.texParameteri(target, gl.TEXTURE_WRAP_R, state.wrapR);
+ gl.texParameterf(target, gl.TEXTURE_MAX_LOD, state.maxLod);
+ gl.texParameterf(target, gl.TEXTURE_MIN_LOD, state.minLod);
+ };
+
+ /**
+ * @private
+ * @param {glsSamplerObjectTest.SamplingState} state
+ * @param {WebGLSampler} sampler
+ */
+ glsSamplerObjectTest.MultiTextureSamplerTest.setSamplerState = function(state, sampler) {
+ gl.samplerParameteri(sampler, gl.TEXTURE_MIN_FILTER, state.minFilter);
+ gl.samplerParameteri(sampler, gl.TEXTURE_MAG_FILTER, state.magFilter);
+ gl.samplerParameteri(sampler, gl.TEXTURE_WRAP_S, state.wrapS);
+ gl.samplerParameteri(sampler, gl.TEXTURE_WRAP_T, state.wrapT);
+ gl.samplerParameteri(sampler, gl.TEXTURE_WRAP_R, state.wrapR);
+ gl.samplerParameterf(sampler, gl.TEXTURE_MAX_LOD, state.maxLod);
+ gl.samplerParameterf(sampler, gl.TEXTURE_MIN_LOD, state.minLod);
+ };
+
+ /**
+ * @private
+ * @param {number} id
+ * @return {WebGLTexture }
+ */
+ glsSamplerObjectTest.MultiTextureSamplerTest.createTexture2D = function(id) {
+ /** @type {WebGLTexture} */ var texture = null;
+ /** @type {tcuTexture.Texture2D} */ var refTexture = new tcuTexture.Texture2D(
+ new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA,
+ tcuTexture.ChannelType.UNORM_INT8),
+ glsSamplerObjectTest.TEXTURE2D_WIDTH,
+ glsSamplerObjectTest.TEXTURE2D_HEIGHT);
+
+ refTexture.allocLevel(0);
+
+ texture = gl.createTexture();
+
+ switch (id) {
+ case 0:
+ tcuTextureUtil.fillWithComponentGradients(refTexture.getLevel(0), [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 0.5, 0.5]);
+ break;
+
+ case 1:
+ tcuTextureUtil.fillWithComponentGradients(refTexture.getLevel(0), [0.0, 0.0, 0.0, 0.0], [0.5, 0.5, 1.0, 1.0]);
+ break;
+
+ default:
+ DE_ASSERT(false);
+ }
+
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, refTexture.getWidth(), refTexture.getHeight(), 0, gl.RGBA, gl.UNSIGNED_BYTE, refTexture.getLevel(0).getDataPtr());
+
+ gl.generateMipmap(gl.TEXTURE_2D);
+
+ gl.bindTexture(gl.TEXTURE_2D, null);
+
+ return texture;
+ };
+
+ /**
+ * @private
+ * @param {number} id
+ * @return {WebGLTexture}
+ */
+ glsSamplerObjectTest.MultiTextureSamplerTest.createTexture3D = function(id) {
+ /** @type {WebGLTexture} */ var texture = null;
+ /** @type {tcuTexture.Texture3D} */ var refTexture = new tcuTexture.Texture3D(
+ new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA,
+ tcuTexture.ChannelType.UNORM_INT8),
+ glsSamplerObjectTest.TEXTURE3D_WIDTH,
+ glsSamplerObjectTest.TEXTURE3D_HEIGHT,
+ glsSamplerObjectTest.TEXTURE3D_DEPTH);
+
+ refTexture.allocLevel(0);
+
+ texture = gl.createTexture();
+
+ switch (id) {
+ case 0:
+ tcuTextureUtil.fillWithComponentGradients(refTexture.getLevel(0), [0.0, 0.0, 0.0, 0.0], [1.0, 1.0, 0.5, 0.5]);
+ break;
+
+ case 1:
+ tcuTextureUtil.fillWithComponentGradients(refTexture.getLevel(0), [0.0, 0.0, 0.0, 0.0], [0.5, 0.5, 1.0, 1.0]);
+ break;
+
+ default:
+ DE_ASSERT(false);
+ }
+
+ gl.bindTexture(gl.TEXTURE_3D, texture);
+ // TODO: check internalFormat and format in texImage3D
+ gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA, refTexture.getWidth(), refTexture.getHeight(), refTexture.getDepth(), 0, gl.RGBA, gl.UNSIGNED_BYTE, refTexture.getLevel(0).getDataPtr());
+
+ gl.generateMipmap(gl.TEXTURE_3D);
+
+ gl.bindTexture(gl.TEXTURE_3D, null);
+
+ return texture;
+ };
+
+ /**
+ * @private
+ * @param {number} id
+ * @return {WebGLTexture}
+ */
+ glsSamplerObjectTest.MultiTextureSamplerTest.createTextureCube = function(id) {
+ /** @type {WebGLTexture} */ var texture = null;
+ /** @type {tcuTexture.TextureCube} */ var refTexture = new tcuTexture.TextureCube(
+ new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA,
+ tcuTexture.ChannelType.UNORM_INT8),
+ glsSamplerObjectTest.CUBEMAP_SIZE);
+
+ texture = gl.createTexture();
+
+ refTexture.allocLevel(tcuTexture.CubeFace.CUBEFACE_POSITIVE_X, 0);
+ refTexture.allocLevel(tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y, 0);
+ refTexture.allocLevel(tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z, 0);
+ refTexture.allocLevel(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X, 0);
+ refTexture.allocLevel(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y, 0);
+ refTexture.allocLevel(tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z, 0);
+
+ switch (id) {
+ case 0:
+ tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_POSITIVE_X), [0.0, 0.0, 0.0, 0.0], [0.5, 0.5, 0.5, 0.5]);
+ tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y), [0.0, 0.0, 0.0, 0.0], [0.5, 0.5, 0.5, 0.5]);
+ tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z), [0.0, 0.0, 0.0, 0.0], [0.5, 0.5, 0.5, 0.5]);
+ tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X), [0.0, 0.0, 0.0, 0.0], [0.5, 0.5, 0.5, 0.5]);
+ tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y), [0.0, 0.0, 0.0, 0.0], [0.5, 0.5, 0.5, 0.5]);
+ tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z), [0.0, 0.0, 0.0, 0.0], [0.5, 0.5, 0.5, 0.5]);
+ break;
+
+ case 1:
+ tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_POSITIVE_X), [0.5, 0.5, 0.5, 0.5], [1.0, 1.0, 1.0, 1.0]);
+ tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y), [0.5, 0.5, 0.5, 0.5], [1.0, 1.0, 1.0, 1.0]);
+ tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z), [0.5, 0.5, 0.5, 0.5], [1.0, 1.0, 1.0, 1.0]);
+ tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X), [0.5, 0.5, 0.5, 0.5], [1.0, 1.0, 1.0, 1.0]);
+ tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y), [0.5, 0.5, 0.5, 0.5], [1.0, 1.0, 1.0, 1.0]);
+ tcuTextureUtil.fillWithComponentGradients(refTexture.getLevelFace(0, tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z), [0.5, 0.5, 0.5, 0.5], [1.0, 1.0, 1.0, 1.0]);
+ break;
+
+ default:
+ DE_ASSERT(false);
+ }
+
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture);
+
+ for (var face in tcuTexture.CubeFace) {
+ /** @const @type {number} */ var target = gluTextureUtil.getGLCubeFace(tcuTexture.CubeFace[face]);
+ gl.texImage2D(target, 0, gl.RGBA, refTexture.getSize(), refTexture.getSize(), 0, gl.RGBA, gl.UNSIGNED_BYTE, refTexture.getLevelFace(0, tcuTexture.CubeFace[face]).getDataPtr());
+ }
+
+ gl.generateMipmap(gl.TEXTURE_CUBE_MAP);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, null);
+
+ return texture;
+ };
+
+ /**
+ * @private
+ * @param {number} target
+ * @param {number} id
+ * @return {WebGLTexture}
+ */
+ glsSamplerObjectTest.MultiTextureSamplerTest.createTexture = function(target, id) {
+ /** @type {WebGLTexture} */ var texture;
+ switch (target) {
+ case gl.TEXTURE_2D:
+ texture = glsSamplerObjectTest.MultiTextureSamplerTest.createTexture2D(id);
+ break;
+
+ case gl.TEXTURE_3D:
+ texture = glsSamplerObjectTest.MultiTextureSamplerTest.createTexture3D(id);
+ break;
+
+ case gl.TEXTURE_CUBE_MAP:
+ texture = glsSamplerObjectTest.MultiTextureSamplerTest.createTextureCube(id);
+ break;
+
+ default:
+ DE_ASSERT(false);
+ }
+
+ return texture;
+ };
+
+ /**
+ * @private
+ * @param {number} target
+ * @return {string}
+ */
+ glsSamplerObjectTest.MultiTextureSamplerTest.selectVertexShader = function(target) {
+ switch (target) {
+ case gl.TEXTURE_2D:
+ return '#version 300 es\n' +
+ 'in highp vec2 a_position;\n' +
+ 'uniform highp float u_posScale;\n' +
+ 'out mediump vec2 v_texCoord;\n' +
+ 'void main (void)\n' +
+ ' {\n' +
+ '\tv_texCoord = a_position;\n' +
+ '\tgl_Position = vec4(u_posScale * a_position, 0.0, 1.0);\n' +
+ '}';
+
+ case gl.TEXTURE_3D:
+ return '#version 300 es\n' +
+ 'in highp vec3 a_position;\n' +
+ 'uniform highp float u_posScale;\n' +
+ 'out mediump vec3 v_texCoord;\n' +
+ 'void main (void)\n' +
+ ' {\n' +
+ '\tv_texCoord = a_position;\n' +
+ '\tgl_Position = vec4(u_posScale * a_position.xy, 0.0, 1.0);\n' +
+ '}';
+
+ case gl.TEXTURE_CUBE_MAP:
+ return '#version 300 es\n' +
+ 'in highp vec4 a_position;\n' +
+ 'uniform highp float u_posScale;\n' +
+ 'out mediump vec2 v_texCoord;\n' +
+ 'void main (void)\n' +
+ ' {\n' +
+ '\tv_texCoord = a_position.zw;\n' +
+ '\tgl_Position = vec4(u_posScale * a_position.xy, 0.0, 1.0);\n' +
+ '}';
+
+ default:
+ DE_ASSERT(false);
+ return '';
+ }
+ };
+
+ /**
+ * @private
+ * @param {number} target
+ * @return {string}
+ */
+ glsSamplerObjectTest.MultiTextureSamplerTest.selectFragmentShader = function(target) {
+ switch (target) {
+ case gl.TEXTURE_2D:
+ return '#version 300 es\nlayout(location = 0) out mediump vec4 o_color;\n' +
+ 'uniform lowp sampler2D u_sampler1;\n' +
+ 'uniform lowp sampler2D u_sampler2;\n' +
+ 'in mediump vec2 v_texCoord;\n' +
+ 'void main (void)\n' +
+ ' {\n' +
+ '\to_color = vec4(0.75, 0.75, 0.75, 1.0) * (texture(u_sampler1, v_texCoord) + texture(u_sampler2, v_texCoord));\n' +
+ '}';
+
+ break;
+
+ case gl.TEXTURE_3D:
+ return '#version 300 es\nlayout(location = 0) out mediump vec4 o_color;\n' +
+ 'uniform lowp sampler3D u_sampler1;\n' +
+ 'uniform lowp sampler3D u_sampler2;\n' +
+ 'in mediump vec3 v_texCoord;\n' +
+ 'void main (void)\n' +
+ ' {\n' +
+ '\to_color = vec4(0.75, 0.75, 0.75, 1.0) * (texture(u_sampler1, v_texCoord) + texture(u_sampler2, v_texCoord));\n' +
+ '}';
+
+ case gl.TEXTURE_CUBE_MAP:
+ return '#version 300 es\nlayout(location = 0) out mediump vec4 o_color;\n' +
+ 'uniform lowp samplerCube u_sampler1;\n' +
+ 'uniform lowp samplerCube u_sampler2;\n' +
+ 'in mediump vec2 v_texCoord;\n' +
+ 'void main (void)\n' +
+ ' {\n' +
+ '\to_color = vec4(0.5, 0.5, 0.5, 1.0) * (texture(u_sampler1, vec3(cos(3.14 * v_texCoord.y) * sin(3.14 * v_texCoord.x), sin(3.14 * v_texCoord.y), cos(3.14 * v_texCoord.y) * cos(3.14 * v_texCoord.x)))' +
+ '+ texture(u_sampler2, vec3(cos(3.14 * v_texCoord.y) * sin(3.14 * v_texCoord.x), sin(3.14 * v_texCoord.y), cos(3.14 * v_texCoord.y) * cos(3.14 * v_texCoord.x))));\n' +
+ '}';
+
+ default:
+ DE_ASSERT(false);
+ return '';
+ }
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderExecUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderExecUtil.js
new file mode 100644
index 0000000000..9ea29e7e4c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderExecUtil.js
@@ -0,0 +1,731 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL (ES) Module
+ * -----------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief Shader execution utilities.
+ *//*--------------------------------------------------------------------*/
+'use strict';
+goog.provide('modules.shared.glsShaderExecUtil');
+goog.require('framework.common.tcuMatrix');
+goog.require('framework.common.tcuMatrixUtil');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.opengl.gluDrawUtil');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluTextureUtil');
+goog.require('framework.opengl.gluVarType');
+
+goog.scope(function() {
+
+ var glsShaderExecUtil = modules.shared.glsShaderExecUtil;
+ var gluVarType = framework.opengl.gluVarType;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var gluShaderProgram = framework.opengl.gluShaderProgram;
+ var gluDrawUtil = framework.opengl.gluDrawUtil;
+ var gluTextureUtil = framework.opengl.gluTextureUtil;
+ var tcuTexture = framework.common.tcuTexture;
+ var tcuMatrix = framework.common.tcuMatrix;
+ var tcuMatrixUtil = framework.common.tcuMatrixUtil;
+
+ var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+ };
+
+ var setParentClass = function(child, parent) {
+ child.prototype = Object.create(parent.prototype);
+ child.prototype.constructor = child;
+ };
+
+ /**
+ * @constructor
+ * @param {string=} name
+ * @param {gluVarType.VarType=} varType
+ */
+ glsShaderExecUtil.Symbol = function(name, varType) {
+ name = name === undefined ? '<unnamed>' : name;
+ /** @type {string} */ this.name = name;
+ /** @type {gluVarType.VarType} */ this.varType = varType || null;
+ };
+
+ //! Complete shader specification.
+ /**
+ * @constructor
+ */
+ glsShaderExecUtil.ShaderSpec = function() {
+ /** @type {gluShaderUtil.GLSLVersion} */ this.version = gluShaderUtil.GLSLVersion.V300_ES; //!< Shader version.
+ /** @type {Array<glsShaderExecUtil.Symbol>} */ this.inputs = [];
+ /** @type {Array<glsShaderExecUtil.Symbol>} */ this.outputs = [];
+ /** @type {string} */ this.globalDeclarations = ''; //!< These are placed into global scope. Can contain uniform declarations for example.
+ /** @type {*} */ this.source; //!< Source snippet to be executed.
+ };
+
+ /**
+ * Base class for shader executor.
+ * @constructor
+ * @param {glsShaderExecUtil.ShaderSpec} shaderSpec
+ */
+ glsShaderExecUtil.ShaderExecutor = function(shaderSpec) {
+ /** @type {Array<glsShaderExecUtil.Symbol>} */ this.m_inputs = shaderSpec.inputs;
+ /** @type {Array<glsShaderExecUtil.Symbol>} */ this.m_outputs = shaderSpec.outputs;
+ };
+
+ glsShaderExecUtil.ShaderExecutor.prototype.useProgram = function() {
+ DE_ASSERT(this.isOk);
+ gl.useProgram(this.getProgram());
+ };
+
+ /**
+ * @return {boolean}
+ */
+ glsShaderExecUtil.ShaderExecutor.prototype.isOk = function() {
+ throw new Error('Virtual function. Please override.');
+ };
+
+ /**
+ * @return {WebGLProgram}
+ */
+ glsShaderExecUtil.ShaderExecutor.prototype.getProgram = function() {
+ throw new Error('Virtual function. Please override.');
+ };
+
+ /**
+ * @param {number} numValues
+ * @param {Array<Array<number>>} inputs
+ * @return {Array<goog.TypedArray>} outputs
+ */
+ glsShaderExecUtil.ShaderExecutor.prototype.execute = function(numValues, inputs) {
+ throw new Error('Virtual function. Please override.');
+ };
+
+ /**
+ * Base class for shader executor.
+ * @param {gluShaderProgram.shaderType} shaderType
+ * @param {glsShaderExecUtil.ShaderSpec} shaderSpec
+ * @return {glsShaderExecUtil.ShaderExecutor}
+ */
+ glsShaderExecUtil.createExecutor = function(shaderType, shaderSpec) {
+ switch (shaderType) {
+ case gluShaderProgram.shaderType.VERTEX: return new glsShaderExecUtil.VertexShaderExecutor(shaderSpec);
+ case gluShaderProgram.shaderType.FRAGMENT: return new glsShaderExecUtil.FragmentShaderExecutor(shaderSpec);
+ default:
+ throw new Error('Unsupported shader type: ' + shaderType);
+ }
+ };
+
+ /**
+ * @param {glsShaderExecUtil.ShaderSpec} shaderSpec
+ * @return {string}
+ */
+ glsShaderExecUtil.generateVertexShader = function(shaderSpec) {
+ /** @type {boolean} */ var usesInout = true;
+ /** @type {string} */ var in_ = usesInout ? 'in' : 'attribute';
+ /** @type {string} */ var out = usesInout ? 'out' : 'varying';
+ /** @type {string} */ var src = '';
+ /** @type {number} */ var vecSize;
+ /** @type {gluShaderUtil.DataType} */ var intBaseType;
+
+ src += '#version 300 es\n';
+
+ if (shaderSpec.globalDeclarations.length > 0)
+ src += (shaderSpec.globalDeclarations + '\n');
+
+ for (var i = 0; i < shaderSpec.inputs.length; ++i)
+ src += (in_ + ' ' + gluVarType.declareVariable(shaderSpec.inputs[i].varType, shaderSpec.inputs[i].name) + ';\n');
+
+ for (var i = 0; i < shaderSpec.outputs.length; i++) {
+ var output = shaderSpec.outputs[i];
+ DE_ASSERT(output.varType.isBasicType());
+
+ if (gluShaderUtil.isDataTypeBoolOrBVec(output.varType.getBasicType())) {
+ vecSize = gluShaderUtil.getDataTypeScalarSize(output.varType.getBasicType());
+ intBaseType = vecSize > 1 ? gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.INT, vecSize) : gluShaderUtil.DataType.INT;
+ /** @type {gluVarType.VarType} */ var intType = new gluVarType.VarType().VarTypeBasic(intBaseType, gluShaderUtil.precision.PRECISION_HIGHP);
+
+ src += ('flat ' + out + ' ' + gluVarType.declareVariable(intType, 'o_' + output.name) + ';\n');
+ } else
+ src += ('flat ' + out + ' ' + gluVarType.declareVariable(output.varType, output.name) + ';\n');
+ }
+
+ src += '\n' +
+ 'void main (void)\n' +
+ '{\n' +
+ ' gl_Position = vec4(0.0);\n' +
+ ' gl_PointSize = 1.0;\n\n';
+
+ // Declare necessary output variables (bools).
+ for (var i = 0; i < shaderSpec.outputs.length; i++) {
+ if (gluShaderUtil.isDataTypeBoolOrBVec(shaderSpec.outputs[i].varType.getBasicType()))
+ src += ('\t' + gluVarType.declareVariable(shaderSpec.outputs[i].varType, shaderSpec.outputs[i].name) + ';\n');
+ }
+
+ //Operation - indented to correct level.
+ // TODO: Add indenting
+ src += shaderSpec.source;
+
+ // Assignments to outputs.
+ for (var i = 0; i < shaderSpec.outputs.length; i++) {
+ if (gluShaderUtil.isDataTypeBoolOrBVec(output.varType.getBasicType())) {
+ vecSize = gluShaderUtil.getDataTypeScalarSize(output.varType.getBasicType());
+ intBaseType = vecSize > 1 ? gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.INT, vecSize) : gluShaderUtil.DataType.INT;
+
+ src += ('\to_' + output.name + ' = ' + gluShaderUtil.getDataTypeName(intBaseType) + '(' + output.name + ');\n');
+ }
+ }
+
+ src += '}\n';
+
+ return src;
+ };
+
+ /**
+ * @return {string}
+ */
+ glsShaderExecUtil.generateEmptyFragmentSource = function() {
+ /** @type {string} */ var src;
+
+ src = '#version 300 es\n';
+ src += 'out lowp vec4 color;\n';
+ src += 'void main (void)\n{\n';
+ src += ' color = vec4(0.0);\n';
+ src += '}\n';
+
+ return src;
+ };
+
+ /**
+ * @param {glsShaderExecUtil.ShaderSpec} shaderSpec
+ * @param {string} inputPrefix
+ * @param {string} outputPrefix
+ * @return {string}
+ */
+ glsShaderExecUtil.generatePassthroughVertexShader = function(shaderSpec, inputPrefix, outputPrefix) {
+ // flat qualifier is not present in earlier versions?
+ // DE_ASSERT(glu::glslVersionUsesInOutQualifiers(shaderSpec.version));
+
+ /** @type {string} */ var src;
+
+ src = '#version 300 es\n' +
+ 'in highp vec4 a_position;\n';
+
+ for (var i = 0; i < shaderSpec.inputs.length; i++) {
+ src += ('in ' + gluVarType.declareVariable(shaderSpec.inputs[i].varType, inputPrefix + shaderSpec.inputs[i].name) + ';\n' +
+ 'flat out ' + gluVarType.declareVariable(shaderSpec.inputs[i].varType, outputPrefix + shaderSpec.inputs[i].name) + ';\n');
+ }
+
+ src += '\nvoid main (void)\n{\n' +
+ ' gl_Position = a_position;\n' +
+ ' gl_PointSize = 1.0;\n';
+
+ for (var i = 0; i < shaderSpec.inputs.length; i++)
+ src += ('\t' + outputPrefix + shaderSpec.inputs[i].name + ' = ' + inputPrefix + shaderSpec.inputs[i].name + ';\n');
+
+ src += '}\n';
+
+ return src;
+ };
+
+ /**
+ * @param {glsShaderExecUtil.ShaderSpec} shaderSpec
+ * @param {boolean} useIntOutputs
+ * @param {*} outLocationMap
+ * @return {string}
+ */
+ glsShaderExecUtil.generateFragmentShader = function(shaderSpec, useIntOutputs, outLocationMap) {
+ /** @type {number} */ var vecSize;
+ /** @type {number} */ var numVecs;
+ /** @type {gluShaderUtil.DataType} */ var intBasicType;
+ /** @type {gluShaderUtil.DataType} */ var uintBasicType;
+ /** @type {gluVarType.VarType} */ var uintType;
+ /** @type {gluVarType.VarType} */ var intType;
+
+ /** @type {string} */ var src;
+ src = '#version 300 es\n';
+
+ if (!shaderSpec.globalDeclarations.length > 0)
+ src += (shaderSpec.globalDeclarations + '\n');
+
+ for (var i = 0; i < shaderSpec.inputs.length; i++)
+ src += ('flat in ' + gluVarType.declareVariable(shaderSpec.inputs[i].varType, shaderSpec.inputs[i].name) + ';\n');
+
+ for (var outNdx = 0; outNdx < shaderSpec.outputs.length; ++outNdx) {
+ /** @type {glsShaderExecUtil.Symbol} */ var output = shaderSpec.outputs[outNdx];
+ /** @type {number} */ var location = outLocationMap[output.name];
+ /** @type {string} */ var outVarName = 'o_' + output.name;
+ /** @type {gluVarType.VariableDeclaration} */ var decl = new gluVarType.VariableDeclaration(output.varType, outVarName, gluVarType.Storage.STORAGE_OUT, undefined, new gluVarType.Layout(location));
+
+ DE_ASSERT(output.varType.isBasicType());
+
+ if (useIntOutputs && gluShaderUtil.isDataTypeFloatOrVec(output.varType.getBasicType())) {
+ vecSize = gluShaderUtil.getDataTypeScalarSize(output.varType.getBasicType());
+ uintBasicType = vecSize > 1 ? gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.UINT, vecSize) : gluShaderUtil.DataType.UINT;
+ uintType = gluVarType.newTypeBasic(uintBasicType, gluShaderUtil.precision.PRECISION_HIGHP);
+
+ decl.varType = uintType;
+ src += (decl + ';\n');
+ } else if (gluShaderUtil.isDataTypeBoolOrBVec(output.varType.getBasicType())) {
+ vecSize = gluShaderUtil.getDataTypeScalarSize(output.varType.getBasicType());
+ intBasicType = vecSize > 1 ? gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.INT, vecSize) : gluShaderUtil.DataType.INT;
+ intType = gluVarType.newTypeBasic(intBasicType, gluShaderUtil.precision.PRECISION_HIGHP);
+
+ decl.varType = intType;
+ src += (decl + ';\n');
+ } else if (gluShaderUtil.isDataTypeMatrix(output.varType.getBasicType())) {
+ vecSize = gluShaderUtil.getDataTypeMatrixNumRows(output.varType.getBasicType());
+ numVecs = gluShaderUtil.getDataTypeMatrixNumColumns(output.varType.getBasicType());
+ uintBasicType = gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.UINT, vecSize);
+ uintType = gluVarType.newTypeBasic(uintBasicType, gluShaderUtil.precision.PRECISION_HIGHP);
+
+ decl.varType = uintType;
+ for (var vecNdx = 0; vecNdx < numVecs; ++vecNdx) {
+ decl.name = outVarName + '_' + (vecNdx);
+ decl.layout.location = location + vecNdx;
+ src += (decl + ';\n');
+ }
+ } else //src += '';//glu::VariableDeclaration(output.varType, output.name, glu::STORAGE_OUT, glu::INTERPOLATION_LAST, location) << ";\n";
+ src += new gluVarType.VariableDeclaration(output.varType, output.name, gluVarType.Storage.STORAGE_OUT, undefined, new gluVarType.Layout(location)) + ';\n';
+ }
+
+ src += '\nvoid main (void)\n{\n';
+
+ for (var i = 0; i < shaderSpec.outputs.length; i++) {
+ if ((useIntOutputs && gluShaderUtil.isDataTypeFloatOrVec(shaderSpec.outputs[i].varType.getBasicType())) ||
+ gluShaderUtil.isDataTypeBoolOrBVec(shaderSpec.outputs[i].varType.getBasicType()) ||
+ gluShaderUtil.isDataTypeMatrix(shaderSpec.outputs[i].varType.getBasicType()))
+ src += ('\t' + gluVarType.declareVariable(shaderSpec.outputs[i].varType, shaderSpec.outputs[i].name) + ';\n');
+ }
+
+ // Operation - indented to correct level.
+ // TODO: Add indenting
+ src += shaderSpec.source;
+ // {
+ // std::istringstream opSrc (shaderSpec.source);
+ // /** @type{number} */ var line;
+ //
+ // while (std::getline(opSrc, line))
+ // src += ('\t' << line << '\n');
+ // }
+
+ for (var i = 0; i < shaderSpec.outputs.length; i++) {
+ if (useIntOutputs && gluShaderUtil.isDataTypeFloatOrVec(shaderSpec.outputs[i].varType.getBasicType()))
+ src += (' o_' + shaderSpec.outputs[i].name + ' = floatBitsToUint(' + shaderSpec.outputs[i].name + ');\n');
+ else if (gluShaderUtil.isDataTypeMatrix(shaderSpec.outputs[i].varType.getBasicType())) {
+ numVecs = gluShaderUtil.getDataTypeMatrixNumColumns(shaderSpec.outputs[i].varType.getBasicType());
+
+ for (var vecNdx = 0; vecNdx < numVecs; ++vecNdx)
+ if (useIntOutputs)
+ src += ('\to_' + shaderSpec.outputs[i].name + '_' + vecNdx + ' = floatBitsToUint(' + shaderSpec.outputs[i].name + '[' + vecNdx + ']);\n');
+ else
+ src += ('\to_' + shaderSpec.outputs[i].name + '_' + vecNdx + ' = ' + shaderSpec.outputs[i].name + '[' + vecNdx + '];\n');
+ } else if (gluShaderUtil.isDataTypeBoolOrBVec(shaderSpec.outputs[i].varType.getBasicType())) {
+ vecSize = gluShaderUtil.getDataTypeScalarSize(shaderSpec.outputs[i].varType.getBasicType());
+ intBasicType = vecSize > 1 ? gluShaderUtil.getDataTypeVector(gluShaderUtil.DataType.INT, vecSize) : gluShaderUtil.DataType.INT;
+
+ src += ('\to_' + shaderSpec.outputs[i].name + ' = ' + gluShaderUtil.getDataTypeName(intBasicType) + '(' + shaderSpec.outputs[i].name + ');\n');
+ }
+ }
+
+ src += '}\n';
+
+ return src;
+ };
+
+ /**
+ * @param {Array<glsShaderExecUtil.Symbol>} outputs
+ * @return {gluShaderProgram.TransformFeedbackVaryings}
+ */
+ glsShaderExecUtil.getTFVaryings = function(outputs) {
+ var names = [];
+ for (var i = 0; i < outputs.length; i++) {
+ if (gluShaderUtil.isDataTypeBoolOrBVec(outputs[i].varType.getBasicType())) {
+ names.push('o_' + outputs[i].name);
+ } else {
+ names.push(outputs[i].name);
+ }
+ }
+ return new gluShaderProgram.TransformFeedbackVaryings(names);
+ };
+
+ // VertexProcessorExecutor (base class for vertex and geometry executors)
+
+ /**
+ * @constructor
+ * @extends {glsShaderExecUtil.ShaderExecutor}
+ * @param {glsShaderExecUtil.ShaderSpec} shaderSpec
+ * @param {gluShaderProgram.ProgramSources} sources
+ */
+ glsShaderExecUtil.VertexProcessorExecutor = function(shaderSpec, sources) {
+ sources.add(glsShaderExecUtil.getTFVaryings(shaderSpec.outputs));
+ sources.add(new gluShaderProgram.TransformFeedbackMode(gl.INTERLEAVED_ATTRIBS));
+ glsShaderExecUtil.ShaderExecutor.call(this, shaderSpec);
+ this.m_program = new gluShaderProgram.ShaderProgram(gl, sources);
+ };
+
+ setParentClass(glsShaderExecUtil.VertexProcessorExecutor, glsShaderExecUtil.ShaderExecutor);
+
+ /**
+ * @return {boolean}
+ */
+ glsShaderExecUtil.VertexProcessorExecutor.prototype.isOk = function() {
+ return this.m_program.isOk();
+ };
+
+ /**
+ * @return {WebGLProgram}
+ */
+ glsShaderExecUtil.VertexProcessorExecutor.prototype.getProgram = function() {
+ return this.m_program.getProgram();
+ };
+
+ /**
+ * @param {Array<*>} arr
+ * @return {number}
+ */
+ glsShaderExecUtil.computeTotalScalarSize = function(arr) {
+ /** @type {number} */ var size = 0;
+ for (var i = 0; i < arr.length; i++)
+ size += arr[i].varType.getScalarSize();
+ return size;
+ };
+
+ /**
+ * @param {Array<number>} ptr
+ * @param {number} colNdx
+ * @param {number} size Column size
+ * @return {Array<number>}
+ */
+ glsShaderExecUtil.getColumn = function(ptr, colNdx, size) {
+ var begin = colNdx * size;
+ var end = (colNdx + 1) * size;
+ return ptr.slice(begin, end);
+ };
+
+ glsShaderExecUtil.VertexProcessorExecutor.prototype.execute = function(numValues, inputs) {
+ /** @type {glsShaderExecUtil.Symbol} */ var symbol;
+ var outputs = [];
+ /** @type {boolean} */ var useTFObject = true;
+ /** @type {Array<gluDrawUtil.VertexArrayBinding>} */ var vertexArrays = [];
+ var transformFeedback = gl.createTransformFeedback();
+ var outputBuffer = gl.createBuffer();
+
+ /** @type {number} */ var outputBufferStride = glsShaderExecUtil.computeTotalScalarSize(this.m_outputs) * 4;
+
+ // Setup inputs.
+ for (var inputNdx = 0; inputNdx < this.m_inputs.length; inputNdx++) {
+ symbol = this.m_inputs[inputNdx];
+ /*const void* */var ptr = inputs[inputNdx];
+ /** @type {gluShaderUtil.DataType} */ var basicType = symbol.varType.getBasicType();
+ /** @type {number} */ var vecSize = gluShaderUtil.getDataTypeScalarSize(basicType);
+
+ if (gluShaderUtil.isDataTypeFloatOrVec(basicType))
+ vertexArrays.push(gluDrawUtil.newFloatVertexArrayBinding(symbol.name, vecSize, numValues, 0, ptr));
+ else if (gluShaderUtil.isDataTypeIntOrIVec(basicType))
+ vertexArrays.push(gluDrawUtil.newInt32VertexArrayBinding(symbol.name, vecSize, numValues, 0, ptr));
+ else if (gluShaderUtil.isDataTypeUintOrUVec(basicType))
+ vertexArrays.push(gluDrawUtil.newUint32VertexArrayBinding(symbol.name, vecSize, numValues, 0, ptr));
+ else if (gluShaderUtil.isDataTypeMatrix(basicType)) {
+ /** @type {number} */ var numRows = gluShaderUtil.getDataTypeMatrixNumRows(basicType);
+ /** @type {number} */ var numCols = gluShaderUtil.getDataTypeMatrixNumColumns(basicType);
+ // A matrix consists of several (column-major) vectors. A buffer is created for
+ // every vector in gluDrawUtil.draw() below. Data in every buffer will be tightly
+ // packed. So the stride should be 0. This is different from the code in native
+ // deqp, which use only one buffer for a matrix, the data is interleaved.
+ /** @type {number} */ var stride = 0;
+
+ for (var colNdx = 0; colNdx < numCols; ++colNdx)
+ vertexArrays.push(gluDrawUtil.newFloatColumnVertexArrayBinding(symbol.name,
+ colNdx,
+ numRows,
+ numValues,
+ stride,
+ glsShaderExecUtil.getColumn(ptr, colNdx, numRows * numValues)));
+ } else
+ DE_ASSERT(false);
+ }
+
+ // Setup TF outputs.
+ if (useTFObject)
+ gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, transformFeedback);
+ gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, outputBuffer);
+ gl.bufferData(gl.TRANSFORM_FEEDBACK_BUFFER, outputBufferStride * numValues, gl.STREAM_READ);
+ gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, outputBuffer);
+
+ // Draw with rasterization disabled.
+ gl.beginTransformFeedback(gl.POINTS);
+ gl.enable(gl.RASTERIZER_DISCARD);
+ gluDrawUtil.draw(gl, this.m_program.getProgram(), vertexArrays,
+ new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.POINTS, numValues));
+ gl.disable(gl.RASTERIZER_DISCARD);
+ gl.endTransformFeedback();
+
+ // Read back data.
+ var result = new ArrayBuffer(outputBufferStride * numValues);
+ gl.getBufferSubData(gl.TRANSFORM_FEEDBACK_BUFFER, 0, new Uint8Array(result));
+ /** @type {number} */ var curOffset = 0; // Offset in buffer in bytes.
+
+ for (var outputNdx = 0; outputNdx < this.m_outputs.length; outputNdx++) {
+ symbol = this.m_outputs[outputNdx];
+ /** @type {number} */ var scalarSize = symbol.varType.getScalarSize();
+ var readPtr = new Uint8Array(result, curOffset);
+
+ if (scalarSize * 4 === outputBufferStride)
+ outputs[outputNdx] = readPtr;
+ else {
+ var dstPtr = new Uint8Array(scalarSize * numValues * 4);
+
+ for (var ndx = 0; ndx < numValues; ndx++)
+ for (var j = 0; j < scalarSize * 4; j++) {
+ dstPtr[scalarSize * 4 * ndx + j] = readPtr[ndx * outputBufferStride + j];
+ }
+ outputs[outputNdx] = dstPtr;
+ }
+ curOffset += scalarSize * 4;
+ }
+
+ if (useTFObject)
+ gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, null);
+ gl.bindBuffer(gl.TRANSFORM_FEEDBACK_BUFFER, null);
+
+ return outputs;
+ };
+
+ // VertexShaderExecutor
+
+ /**
+ * @constructor
+ * @extends {glsShaderExecUtil.VertexProcessorExecutor}
+ * @param {glsShaderExecUtil.ShaderSpec} shaderSpec
+ */
+ glsShaderExecUtil.VertexShaderExecutor = function(shaderSpec) {
+ var sources = gluShaderProgram.makeVtxFragSources(glsShaderExecUtil.generateVertexShader(shaderSpec),
+ glsShaderExecUtil.generateEmptyFragmentSource());
+ glsShaderExecUtil.VertexProcessorExecutor.call(this, shaderSpec, sources);
+ };
+
+ setParentClass(glsShaderExecUtil.VertexShaderExecutor, glsShaderExecUtil.VertexProcessorExecutor);
+
+ /**
+ * @constructor
+ * @extends {glsShaderExecUtil.ShaderExecutor}
+ * @param {glsShaderExecUtil.ShaderSpec} shaderSpec
+ */
+ glsShaderExecUtil.FragmentShaderExecutor = function(shaderSpec) {
+ glsShaderExecUtil.ShaderExecutor.call(this, shaderSpec);
+ /** @type {Array<glsShaderExecUtil.Symbol>} */ this.m_outLocationSymbols = [];
+ this.m_outLocationMap = glsShaderExecUtil.generateLocationMap(this.m_outputs, this.m_outLocationSymbols);
+ var sources = gluShaderProgram.makeVtxFragSources(glsShaderExecUtil.generatePassthroughVertexShader(shaderSpec, 'a_', ''),
+ glsShaderExecUtil.generateFragmentShader(shaderSpec, true, this.m_outLocationMap));
+ this.m_program = new gluShaderProgram.ShaderProgram(gl, sources);
+ };
+
+ setParentClass(glsShaderExecUtil.FragmentShaderExecutor, glsShaderExecUtil.ShaderExecutor);
+
+ /**
+ * @return {boolean}
+ */
+ glsShaderExecUtil.FragmentShaderExecutor.prototype.isOk = function() {
+ return this.m_program.isOk();
+ };
+
+ /**
+ * @return {WebGLProgram}
+ */
+ glsShaderExecUtil.FragmentShaderExecutor.prototype.getProgram = function() {
+ return this.m_program.getProgram();
+ };
+
+ /**
+ * @param {gluVarType.VarType} outputType
+ * @param {boolean} useIntOutputs
+ * @return {tcuTexture.TextureFormat}
+ */
+ glsShaderExecUtil.getRenderbufferFormatForOutput = function(outputType, useIntOutputs) {
+ var channelOrderMap = [
+ tcuTexture.ChannelOrder.R,
+ tcuTexture.ChannelOrder.RG,
+ tcuTexture.ChannelOrder.RGBA, // No RGB variants available.
+ tcuTexture.ChannelOrder.RGBA
+ ];
+
+ var basicType = outputType.getBasicType();
+ var numComps = gluShaderUtil.getDataTypeNumComponents(basicType);
+ var channelType;
+
+ switch (gluShaderUtil.getDataTypeScalarType(basicType)) {
+ case 'uint': channelType = tcuTexture.ChannelType.UNSIGNED_INT32; break;
+ case 'int': channelType = tcuTexture.ChannelType.SIGNED_INT32; break;
+ case 'bool': channelType = tcuTexture.ChannelType.SIGNED_INT32; break;
+ case 'float': channelType = useIntOutputs ? tcuTexture.ChannelType.UNSIGNED_INT32 : tcuTexture.ChannelType.FLOAT; break;
+ default:
+ throw new Error('Invalid output type ' + gluShaderUtil.getDataTypeScalarType(basicType));
+ }
+
+ return new tcuTexture.TextureFormat(channelOrderMap[numComps - 1], channelType);
+ };
+
+ glsShaderExecUtil.FragmentShaderExecutor.prototype.execute = function(numValues, inputs) {
+ /** @type {boolean} */ var useIntOutputs = true;
+ /** @type {glsShaderExecUtil.Symbol} */ var symbol;
+ var outputs = [];
+ var maxRenderbufferSize = /** @type {number} */ (gl.getParameter(gl.MAX_RENDERBUFFER_SIZE));
+ /** @type {number} */ var framebufferW = Math.min(maxRenderbufferSize, numValues);
+ /** @type {number} */ var framebufferH = Math.ceil(numValues / framebufferW);
+
+ var framebuffer = gl.createFramebuffer();
+ var renderbuffers = [];
+ for (var i = 0; i < this.m_outLocationSymbols.length; i++)
+ renderbuffers.push(gl.createRenderbuffer());
+
+ var vertexArrays = [];
+ var positions = [];
+
+ if (framebufferH > maxRenderbufferSize)
+ throw new Error('Value count is too high for maximum supported renderbuffer size');
+
+ // Compute positions - 1px points are used to drive fragment shading.
+ for (var valNdx = 0; valNdx < numValues; valNdx++) {
+ /** @type {number} */ var ix = valNdx % framebufferW;
+ /** @type {number} */ var iy = Math.floor(valNdx / framebufferW);
+ var fx = -1 + 2 * (ix + 0.5) / framebufferW;
+ var fy = -1 + 2 * (iy + 0.5) / framebufferH;
+
+ positions[2 * valNdx] = fx;
+ positions[2 * valNdx + 1] = fy;
+ }
+
+ // Vertex inputs.
+ vertexArrays.push(gluDrawUtil.newFloatVertexArrayBinding('a_position', 2, numValues, 0, positions));
+
+ for (var inputNdx = 0; inputNdx < this.m_inputs.length; inputNdx++) {
+ symbol = this.m_inputs[inputNdx];
+ var attribName = 'a_' + symbol.name;
+ var ptr = inputs[inputNdx];
+ /** @type {gluShaderUtil.DataType} */ var basicType = symbol.varType.getBasicType();
+ /** @type {number} */ var vecSize = gluShaderUtil.getDataTypeScalarSize(basicType);
+
+ if (gluShaderUtil.isDataTypeFloatOrVec(basicType))
+ vertexArrays.push(gluDrawUtil.newFloatVertexArrayBinding(attribName, vecSize, numValues, 0, ptr));
+ else if (gluShaderUtil.isDataTypeIntOrIVec(basicType))
+ vertexArrays.push(gluDrawUtil.newInt32VertexArrayBinding(attribName, vecSize, numValues, 0, ptr));
+ else if (gluShaderUtil.isDataTypeUintOrUVec(basicType))
+ vertexArrays.push(gluDrawUtil.newUint32VertexArrayBinding(attribName, vecSize, numValues, 0, ptr));
+ else if (gluShaderUtil.isDataTypeMatrix(basicType)) {
+ var numRows = gluShaderUtil.getDataTypeMatrixNumRows(basicType);
+ var numCols = gluShaderUtil.getDataTypeMatrixNumColumns(basicType);
+ // A matrix consists of several (column-major) vectors. A buffer is created for
+ // every vector in gluDrawUtil.draw() below. Data in every buffer will be tightly
+ // packed. So the stride should be 0. This is different from the code in native
+ // deqp, which use only one buffer for a matrix, the data is interleaved.
+ var stride = 0;
+
+ for (var colNdx = 0; colNdx < numCols; ++colNdx)
+ vertexArrays.push(gluDrawUtil.newFloatColumnVertexArrayBinding(attribName,
+ colNdx,
+ numRows,
+ numValues,
+ stride,
+ glsShaderExecUtil.getColumn(ptr, colNdx, numRows * numValues)));
+ } else
+ DE_ASSERT(false);
+ }
+
+ // Construct framebuffer.
+ gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
+
+ for (var outNdx = 0; outNdx < this.m_outLocationSymbols.length; ++outNdx) {
+ symbol = this.m_outLocationSymbols[outNdx];
+ var renderbuffer = renderbuffers[outNdx];
+ var format = gluTextureUtil.getInternalFormat(glsShaderExecUtil.getRenderbufferFormatForOutput(symbol.varType, useIntOutputs));
+
+ gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);
+ gl.renderbufferStorage(gl.RENDERBUFFER, format, framebufferW, framebufferH);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + outNdx, gl.RENDERBUFFER, renderbuffer);
+ }
+ gl.bindRenderbuffer(gl.RENDERBUFFER, null);
+ assertMsgOptions(gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_COMPLETE, 'Framebuffer is incomplete', false, true);
+
+ var drawBuffers = [];
+ for (var ndx = 0; ndx < this.m_outLocationSymbols.length; ndx++)
+ drawBuffers[ndx] = gl.COLOR_ATTACHMENT0 + ndx;
+ gl.drawBuffers(drawBuffers);
+
+ // Render
+ gl.viewport(0, 0, framebufferW, framebufferH);
+ gluDrawUtil.draw(gl, this.m_program.getProgram(), vertexArrays,
+ new gluDrawUtil.PrimitiveList(gluDrawUtil.primitiveType.POINTS, numValues));
+
+ // Read back pixels.
+
+ // \todo [2013-08-07 pyry] Some fast-paths could be added here.
+
+ for (var outNdx = 0; outNdx < this.m_outputs.length; ++outNdx) {
+ symbol = this.m_outputs[outNdx];
+ /** @type {number} */ var outSize = symbol.varType.getScalarSize();
+ /** @type {number} */ var outVecSize = gluShaderUtil.getDataTypeNumComponents(symbol.varType.getBasicType());
+ /** @type {number} */ var outNumLocs = gluShaderUtil.getDataTypeNumLocations(symbol.varType.getBasicType());
+ var format = glsShaderExecUtil.getRenderbufferFormatForOutput(symbol.varType, useIntOutputs);
+ var readFormat = new tcuTexture.TextureFormat(tcuTexture.ChannelOrder.RGBA, format.type);
+ var transferFormat = gluTextureUtil.getTransferFormat(readFormat);
+ /** @type {number} */ var outLocation = this.m_outLocationMap[symbol.name];
+ var tmpBuf = new tcuTexture.TextureLevel(readFormat, framebufferW, framebufferH);
+
+ for (var locNdx = 0; locNdx < outNumLocs; ++locNdx) {
+ gl.readBuffer(gl.COLOR_ATTACHMENT0 + outLocation + locNdx);
+ gl.readPixels(0, 0, framebufferW, framebufferH, transferFormat.format, transferFormat.dataType, tmpBuf.getAccess().getDataPtr());
+
+ if (outSize == 4 && outNumLocs == 1) {
+ outputs[outNdx] = new Uint8Array(tmpBuf.getAccess().getBuffer());
+ } else {
+ if (locNdx == 0)
+ outputs[outNdx] = new Uint32Array(numValues * outVecSize);
+ var srcPtr = new Uint32Array(tmpBuf.getAccess().getBuffer());
+ for (var valNdx = 0; valNdx < numValues; valNdx++) {
+ var srcOffset = valNdx * 4;
+ var dstOffset = outSize * valNdx + outVecSize * locNdx;
+ for (var j = 0; j < outVecSize; j++)
+ outputs[outNdx][dstOffset + j] = srcPtr[srcOffset + j];
+ }
+ }
+ }
+ }
+
+ // \todo [2013-08-07 pyry] Clear draw buffers & viewport?
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ return outputs;
+ };
+
+ glsShaderExecUtil.generateLocationMap = function(symbols, locationSymbols) {
+ var ret = [];
+ locationSymbols.length = 0;
+ var location = 0;
+
+ for (var i = 0; i < symbols.length; i++) {
+ var symbol = symbols[i];
+ var numLocations = gluShaderUtil.getDataTypeNumLocations(symbol.varType.getBasicType());
+ ret[symbol.name] = location;
+ location += numLocations;
+
+ for (var ndx = 0; ndx < numLocations; ++ndx)
+ locationSymbols.push(symbol);
+ }
+
+ return ret;
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderLibrary.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderLibrary.js
new file mode 100644
index 0000000000..27f86e055c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderLibrary.js
@@ -0,0 +1,1114 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('modules.shared.glsShaderLibrary');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('modules.shared.glsShaderLibraryCase');
+
+goog.scope(function() {
+
+var glsShaderLibrary = modules.shared.glsShaderLibrary;
+var tcuTestCase = framework.common.tcuTestCase;
+var glsShaderLibraryCase = modules.shared.glsShaderLibraryCase;
+var gluShaderUtil = framework.opengl.gluShaderUtil;
+
+ glsShaderLibrary.generateTestCases = function() {
+ /** @type {glsShaderLibrary.Parser} */ var parser = new glsShaderLibrary.Parser();
+ try {
+ /** @type {Object} */ var state = tcuTestCase.runner;
+ var tree = parser.parse(state.testFile);
+ var rootTest = tcuTestCase.newTest(state.testName, 'Top level');
+ rootTest.setChildren(tree);
+ state.setRoot(rootTest);
+ }
+ catch (err) {
+ bufferedLogToConsole(err);
+ testFailed('Failed to parse shader test case file');
+ return false;
+ }
+ return true;
+ };
+
+ glsShaderLibrary.processTestFile = function() {
+ if (glsShaderLibrary.generateTestCases()) {
+ tcuTestCase.runner.runCallback(glsShaderLibraryCase.runTestCases);
+ } else {
+ tcuTestCase.runner.terminate();
+ }
+ };
+
+ glsShaderLibrary.isWhitespace = function(value) {
+ return /^[ \t\r\n]+$/.test(value);
+ };
+ glsShaderLibrary.isEOL = function(value) {
+ return /^[\r\n]+$/.test(value);
+ };
+ glsShaderLibrary.isAlpha = function(value) {
+ return /^[a-zA-Z]$/.test(value);
+ };
+ glsShaderLibrary.isNumeric = function(value) {
+ return /^[0-9]$/.test(value);
+ };
+ glsShaderLibrary.isCaseNameChar = function(value) {
+ return /^[a-zA-Z0-9_\-\.]$/.test(value);
+ };
+
+ /**
+ * Removes however many indents there are on the first line from all lines.
+ * @param {string} str
+ * @return {string} output
+ */
+ glsShaderLibrary.removeExtraIndentation = function(str) {
+ return glsShaderLibrary.removeExtraIndentationArray(
+ str.split(/\r\n|\r|\n/)
+ ).join('\n');
+ };
+
+ /**
+ * Returns an array of strings without indentation.
+ * @param {Array<string>} arr
+ * @return {Array<string>} output
+ */
+ glsShaderLibrary.removeExtraIndentationArray = function(arr) {
+ /** @type {Array<string>} */ var output = [];
+
+ if (arr.length) {
+
+ /** @type {number} */ var numIndentChars = 0;
+ for (var i = 0; i < arr[0].length && glsShaderLibrary.isWhitespace(arr[0].charAt(i)); ++i) {
+ numIndentChars += arr[0].charAt(i) === '\t' ? 4 : 1;
+ }
+
+ for (var i = 0; i < arr.length; ++i) {
+ /** @type {number} */ var removed = 0;
+ /** @type {number} */ var j;
+ // Some tests are indented inconsistently, so we have to check for non-whitespace characters here.
+ for (j = 0; removed < numIndentChars && j < arr[i].length && glsShaderLibrary.isWhitespace(arr[i].charAt(j)); ++j) {
+ removed += (arr[i].charAt(j) === '\t' ? 4 : 1);
+ }
+
+ output.push(arr[i].substr(j, arr[i].length - j));
+ }
+
+ }
+
+ return output;
+ };
+
+ glsShaderLibrary.de_assert = function(condition) {
+ if (!condition) {
+ throw Error();
+ }
+ };
+
+ /**
+ * @param {string} str
+ * @param {string} endstr end of string character
+ * @param {boolean=} trimFront trim leading whitespace
+ * @return {string} str
+ * @private
+ */
+ glsShaderLibrary.parseStringLiteralHelper = function(str, endstr, trimFront) {
+ trimFront = trimFront || false;
+
+ /** @type {number} */ var index_end = 0;
+ // isolate the string
+ do {
+ index_end = str.indexOf(endstr, index_end + 1);
+ } while (index_end >= 0 && str.charAt(index_end - 1) === '\\');
+
+ if (index_end <= 0) {
+ index_end = str.length;
+ }
+
+ // strip quotes, replace \n and \t with nl and tabs respectively
+ str = str.substr(endstr.length, index_end - endstr.length);
+ if (trimFront)
+ str = str.replace(/^\s*\n/, '');
+ var result = '';
+ var i = 0;
+ while (str[i] != undefined) {
+ if (str[i] == '\\') {
+ switch (str[i + 1]) {
+ case undefined:
+ break;
+ case 'n':
+ result += '\n';
+ break;
+ case 't':
+ result += '\t';
+ break;
+ default:
+ result += str[i + 1];
+ break;
+ }
+ i += 2;
+ } else {
+ result += str[i];
+ i++;
+ }
+ }
+ return result;
+
+ };
+
+ /**
+ * glsShaderLibrary.Parser class
+ * @constructor
+ */
+ glsShaderLibrary.Parser = function() {
+
+ /* data members */
+
+ /**
+ * The Token constants
+ * @enum {number}
+ */
+ var Token = {
+ TOKEN_INVALID: 0,
+ TOKEN_EOF: 1,
+ TOKEN_STRING: 2,
+ TOKEN_SHADER_SOURCE: 3,
+
+ TOKEN_INT_LITERAL: 4,
+ TOKEN_FLOAT_LITERAL: 5,
+
+ // identifiers
+ TOKEN_IDENTIFIER: 6,
+ TOKEN_TRUE: 7,
+ TOKEN_FALSE: 8,
+ TOKEN_DESC: 9,
+ TOKEN_EXPECT: 10,
+ TOKEN_GROUP: 11,
+ TOKEN_CASE: 12,
+ TOKEN_END: 13,
+ TOKEN_VALUES: 14,
+ TOKEN_BOTH: 15,
+ TOKEN_VERTEX: 26,
+ TOKEN_FRAGMENT: 17,
+ TOKEN_UNIFORM: 18,
+ TOKEN_INPUT: 19,
+ TOKEN_OUTPUT: 20,
+ TOKEN_FLOAT: 21,
+ TOKEN_FLOAT_VEC2: 22,
+ TOKEN_FLOAT_VEC3: 23,
+ TOKEN_FLOAT_VEC4: 24,
+ TOKEN_FLOAT_MAT2: 25,
+ TOKEN_FLOAT_MAT2X3: 26,
+ TOKEN_FLOAT_MAT2X4: 27,
+ TOKEN_FLOAT_MAT3X2: 28,
+ TOKEN_FLOAT_MAT3: 29,
+ TOKEN_FLOAT_MAT3X4: 30,
+ TOKEN_FLOAT_MAT4X2: 31,
+ TOKEN_FLOAT_MAT4X3: 32,
+ TOKEN_FLOAT_MAT4: 33,
+ TOKEN_INT: 34,
+ TOKEN_INT_VEC2: 35,
+ TOKEN_INT_VEC3: 36,
+ TOKEN_INT_VEC4: 37,
+ TOKEN_UINT: 38,
+ TOKEN_UINT_VEC2: 39,
+ TOKEN_UINT_VEC3: 40,
+ TOKEN_UINT_VEC4: 41,
+ TOKEN_BOOL: 42,
+ TOKEN_BOOL_VEC2: 43,
+ TOKEN_BOOL_VEC3: 44,
+ TOKEN_BOOL_VEC4: 45,
+ TOKEN_VERSION: 46,
+
+ // symbols
+ TOKEN_ASSIGN: 47,
+ TOKEN_PLUS: 48,
+ TOKEN_MINUS: 49,
+ TOKEN_COMMA: 50,
+ TOKEN_VERTICAL_BAR: 51,
+ TOKEN_SEMI_COLON: 52,
+ TOKEN_LEFT_PAREN: 53,
+ TOKEN_RIGHT_PAREN: 54,
+ TOKEN_LEFT_BRACKET: 55,
+ TOKEN_RIGHT_BRACKET: 56,
+ TOKEN_LEFT_BRACE: 57,
+ TOKEN_RIGHT_BRACE: 58,
+
+ TOKEN_LAST: 59
+ };
+
+ /** @type {string} */ var m_input = '';
+ /** @type {number} */ var m_curPtr = 0;
+ /** @type {number} */ var m_curToken;// = Token.TOKEN_INVALID;
+ /** @type {string} */ var m_curTokenStr = '';
+
+ /* function members */
+ this.parse = function(input) {
+
+ // initialise parser
+ m_input = input;
+ m_curPtr = 0;
+ m_curToken = Token.TOKEN_INVALID;
+ m_curTokenStr = '';
+ advanceToken();
+
+ /** @type {Array<tcuTestCase.DeqpTest>} */ var nodeList = [];
+
+ for (;;) {
+
+ if (m_curToken === Token.TOKEN_CASE) {
+ parseShaderCase(nodeList);
+ } else if (m_curToken === Token.TOKEN_GROUP) {
+ parseShaderGroup(nodeList);
+ } else if (m_curToken === Token.TOKEN_EOF) {
+ break;
+ } else {
+ // throw Error("invalid token encountered at main level: '" + m_curTokenStr + "'");
+ testFailed("invalid token encountered at main level: '" + m_curTokenStr + "'");
+ tcuTestCase.runner.terminate();
+ }
+
+ }
+
+ return nodeList;
+
+ };
+
+ /**
+ * ensures that the token exists
+ * otherwise it returns the corresponding token's name depending on enum number value
+ * @param {number} id
+ * @return {string} name
+ */
+ var resolveTokenName = function(id) {
+ for (var name in Token) {
+ if (Token[name] === id) return name;
+ }
+ return 'TOKEN_UNKNOWN';
+ };
+
+ /**
+ * Throws an error which contains the passed string
+ * @param {string} errorStr that contains an error to notify
+ * @return {string} error
+ */
+ var parseError = function(errorStr) {
+ // abort
+ throw 'glsShaderLibrary.Parser error: ' + errorStr + ' near ' + m_input.substr(m_curPtr, m_curPtr + 80);
+ };
+
+ /**
+ * Converts string into float
+ * @param {string} str
+ * @return {number}
+ */
+ var parseFloatLiteral = function(str) {
+ return parseFloat(str);
+ };
+
+ /**
+ * Converts string into integer
+ * @param {string} str
+ * @return {number}
+ */
+ var parseIntLiteral = function(str) {
+ return parseInt(str, 10);
+ };
+ var parseStringLiteral = function(str) {
+ /**
+ * @type {string}
+ * find delimitor
+ */ var endchar = str.substr(0, 1);
+ return glsShaderLibrary.parseStringLiteralHelper(str, endchar);
+ };
+ var parseShaderSource = function(str) {
+ // similar to parse literal, delimitors are two double quotes ("")
+ return glsShaderLibrary.removeExtraIndentation(
+ glsShaderLibrary.parseStringLiteralHelper(str, '""', true)
+ );
+ };
+
+ var advanceTokenWorker = function() {
+
+ // Skip old token
+ m_curPtr += m_curTokenStr.length;
+
+ // Reset token (for safety).
+ m_curToken = Token.TOKEN_INVALID;
+ m_curTokenStr = '';
+
+ // Eat whitespace & comments while they last.
+ for (;;) {
+
+ while (glsShaderLibrary.isWhitespace(m_input.charAt(m_curPtr))) ++m_curPtr;
+
+ // check for EOL comment
+ if (m_input.charAt(m_curPtr) === '#') {
+ // if m_input is to be an array of lines then this probably wont work very well
+ while (
+ m_curPtr < m_input.length &&
+ !glsShaderLibrary.isEOL(m_input.charAt(m_curPtr))
+ ) ++m_curPtr;
+ } else {
+ break;
+ }
+
+ }
+
+ if (m_curPtr >= m_input.length) {
+
+ m_curToken = Token.TOKEN_EOF;
+ m_curTokenStr = '<EOF>';
+
+ } else if (glsShaderLibrary.isAlpha(m_input.charAt(m_curPtr))) {
+
+ /** @type {number} */ var end = m_curPtr + 1;
+ while (glsShaderLibrary.isCaseNameChar(m_input.charAt(end))) ++end;
+
+ m_curTokenStr = m_input.substr(m_curPtr, end - m_curPtr);
+
+ m_curToken = (function() {
+ // consider reimplementing with a binary search
+ switch (m_curTokenStr) {
+ case 'true': return Token.TOKEN_TRUE;
+ case 'false': return Token.TOKEN_FALSE;
+ case 'desc': return Token.TOKEN_DESC;
+ case 'expect': return Token.TOKEN_EXPECT;
+ case 'group': return Token.TOKEN_GROUP;
+ case 'case': return Token.TOKEN_CASE;
+ case 'end': return Token.TOKEN_END;
+ case 'values': return Token.TOKEN_VALUES;
+ case 'both': return Token.TOKEN_BOTH;
+ case 'vertex': return Token.TOKEN_VERTEX;
+ case 'fragment': return Token.TOKEN_FRAGMENT;
+ case 'uniform': return Token.TOKEN_UNIFORM;
+ case 'input': return Token.TOKEN_INPUT;
+ case 'output': return Token.TOKEN_OUTPUT;
+ case 'float': return Token.TOKEN_FLOAT;
+ case 'vec2': return Token.TOKEN_FLOAT_VEC2;
+ case 'vec3': return Token.TOKEN_FLOAT_VEC3;
+ case 'vec4': return Token.TOKEN_FLOAT_VEC4;
+ case 'mat2': return Token.TOKEN_FLOAT_MAT2;
+ case 'mat2x3': return Token.TOKEN_FLOAT_MAT2X3;
+ case 'mat2x4': return Token.TOKEN_FLOAT_MAT2X4;
+ case 'mat3x2': return Token.TOKEN_FLOAT_MAT3X2;
+ case 'mat3': return Token.TOKEN_FLOAT_MAT3;
+ case 'mat3x4': return Token.TOKEN_FLOAT_MAT3X4;
+ case 'mat4x2': return Token.TOKEN_FLOAT_MAT4X2;
+ case 'mat4x3': return Token.TOKEN_FLOAT_MAT4X3;
+ case 'mat4': return Token.TOKEN_FLOAT_MAT4;
+ case 'int': return Token.TOKEN_INT;
+ case 'ivec2': return Token.TOKEN_INT_VEC2;
+ case 'ivec3': return Token.TOKEN_INT_VEC3;
+ case 'ivec4': return Token.TOKEN_INT_VEC4;
+ case 'uint': return Token.TOKEN_UINT;
+ case 'uvec2': return Token.TOKEN_UINT_VEC2;
+ case 'uvec3': return Token.TOKEN_UINT_VEC3;
+ case 'uvec4': return Token.TOKEN_UINT_VEC4;
+ case 'bool': return Token.TOKEN_BOOL;
+ case 'bvec2': return Token.TOKEN_BOOL_VEC2;
+ case 'bvec3': return Token.TOKEN_BOOL_VEC3;
+ case 'bvec4': return Token.TOKEN_BOOL_VEC4;
+ case 'version': return Token.TOKEN_VERSION;
+ default: return Token.TOKEN_IDENTIFIER;
+ }
+ }());
+
+ } else if (glsShaderLibrary.isNumeric(m_input.charAt(m_curPtr))) {
+
+ /** @type {number} */ var p = m_curPtr;
+ while (glsShaderLibrary.isNumeric(m_input.charAt(p))) ++p;
+
+ if (m_input.charAt(p) === '.') { // float
+
+ ++p;
+ while (glsShaderLibrary.isNumeric(m_input.charAt(p))) ++p;
+
+ if (m_input.charAt(p) === 'e' || m_input.charAt(p) === 'E') {
+
+ ++p;
+ if (m_input.charAt(p) === '+' || m_input.charAt(p) === '-') ++p;
+
+ glsShaderLibrary.de_assert(p < m_input.length && glsShaderLibrary.isNumeric(m_input.charAt(p)));
+ while (glsShaderLibrary.isNumeric(m_input.charAt(p))) ++p;
+
+ }
+
+ m_curToken = Token.TOKEN_FLOAT_LITERAL;
+ m_curTokenStr = m_input.substr(m_curPtr, p - m_curPtr);
+
+ } else {
+
+ m_curToken = Token.TOKEN_INT_LITERAL;
+ m_curTokenStr = m_input.substr(m_curPtr, p - m_curPtr);
+
+ }
+
+ } else if (m_input.charAt(m_curPtr) === '"' && m_input.charAt(m_curPtr + 1) === '"') { // shader source
+
+ var p = m_curPtr + 2;
+
+ while (m_input.charAt(p) != '"' || m_input.charAt(p + 1) != '"') {
+ glsShaderLibrary.de_assert(p < m_input.length);
+ if (m_input.charAt(p) === '\\') {
+ glsShaderLibrary.de_assert(p + 1 < m_input.length);
+ p += 2;
+ } else {
+ ++p;
+ }
+ }
+ p += 2;
+
+ m_curToken = Token.TOKEN_SHADER_SOURCE;
+ m_curTokenStr = m_input.substr(m_curPtr, p - m_curPtr);
+
+ } else if (m_input.charAt(m_curPtr) === '"' || m_input.charAt(m_curPtr) === "'") {
+
+ /** @type {string} */ var delimitor = m_input.charAt(m_curPtr);
+ var p = m_curPtr + 1;
+
+ while (m_input.charAt(p) != delimitor) {
+
+ glsShaderLibrary.de_assert(p < m_input.length);
+ if (m_input.charAt(p) === '\\') {
+ glsShaderLibrary.de_assert(p + 1 < m_input.length);
+ p += 2;
+ } else {
+ ++p;
+ }
+
+ }
+ ++p;
+
+ m_curToken = Token.TOKEN_STRING;
+ m_curTokenStr = m_input.substr(m_curPtr, p - m_curPtr);
+
+ } else {
+
+ m_curTokenStr = m_input.charAt(m_curPtr);
+ m_curToken = (function() {
+ // consider reimplementing with a binary search
+ switch (m_curTokenStr) {
+ case '=': return Token.TOKEN_ASSIGN;
+ case '+': return Token.TOKEN_PLUS;
+ case '-': return Token.TOKEN_MINUS;
+ case ',': return Token.TOKEN_COMMA;
+ case '|': return Token.TOKEN_VERTICAL_BAR;
+ case ';': return Token.TOKEN_SEMI_COLON;
+ case '(': return Token.TOKEN_LEFT_PAREN;
+ case ')': return Token.TOKEN_RIGHT_PAREN;
+ case '[': return Token.TOKEN_LEFT_BRACKET;
+ case ']': return Token.TOKEN_RIGHT_BRACKET;
+ case '{': return Token.TOKEN_LEFT_BRACE;
+ case '}': return Token.TOKEN_RIGHT_BRACE;
+
+ default: return Token.TOKEN_INVALID;
+ }
+ }());
+
+ }
+
+ };
+
+ /**
+ * @return {Object.<number, string, string>}
+ */
+ var advanceTokenTester = function(input, current_index) {
+ m_input = input;
+ m_curPtr = current_index;
+ m_curTokenStr = '';
+ advanceTokenWorker();
+ return {
+ /** @type {number} */ idType: m_curToken,
+ /** @type {string} */ name: resolveTokenName(m_curToken),
+ /** @type {string} */ value: m_curTokenStr
+ };
+ };
+
+ /**
+ * @param {Token=} tokenAssumed
+ */
+ var advanceToken = function(tokenAssumed) {
+ if (typeof(tokenAssumed) !== 'undefined') {
+ assumeToken(tokenAssumed);
+ }
+ advanceTokenWorker();
+ };
+ var assumeToken = function(token) {
+
+ if (m_curToken != token) {
+ // parse error
+ /** @type {string} */ var msg = "unexpected token '" + m_curTokenStr + "', expecting '" + getTokenName(token) + "'";
+ throw Error('Parse Error. ' + msg + ' near ' + m_curPtr + ' ...');
+ }
+ };
+ var mapDataTypeToken = function(token) {
+ switch (token) {
+ case Token.TOKEN_FLOAT: return gluShaderUtil.DataType.FLOAT;
+ case Token.TOKEN_FLOAT_VEC2: return gluShaderUtil.DataType.FLOAT_VEC2;
+ case Token.TOKEN_FLOAT_VEC3: return gluShaderUtil.DataType.FLOAT_VEC3;
+ case Token.TOKEN_FLOAT_VEC4: return gluShaderUtil.DataType.FLOAT_VEC4;
+ case Token.TOKEN_FLOAT_MAT2: return gluShaderUtil.DataType.FLOAT_MAT2;
+ case Token.TOKEN_FLOAT_MAT2X3: return gluShaderUtil.DataType.FLOAT_MAT2X3;
+ case Token.TOKEN_FLOAT_MAT2X4: return gluShaderUtil.DataType.FLOAT_MAT2X4;
+ case Token.TOKEN_FLOAT_MAT3X2: return gluShaderUtil.DataType.FLOAT_MAT3X2;
+ case Token.TOKEN_FLOAT_MAT3: return gluShaderUtil.DataType.FLOAT_MAT3;
+ case Token.TOKEN_FLOAT_MAT3X4: return gluShaderUtil.DataType.FLOAT_MAT3X4;
+ case Token.TOKEN_FLOAT_MAT4X2: return gluShaderUtil.DataType.FLOAT_MAT4X2;
+ case Token.TOKEN_FLOAT_MAT4X3: return gluShaderUtil.DataType.FLOAT_MAT4X3;
+ case Token.TOKEN_FLOAT_MAT4: return gluShaderUtil.DataType.FLOAT_MAT4;
+ case Token.TOKEN_INT: return gluShaderUtil.DataType.INT;
+ case Token.TOKEN_INT_VEC2: return gluShaderUtil.DataType.INT_VEC2;
+ case Token.TOKEN_INT_VEC3: return gluShaderUtil.DataType.INT_VEC3;
+ case Token.TOKEN_INT_VEC4: return gluShaderUtil.DataType.INT_VEC4;
+ case Token.TOKEN_UINT: return gluShaderUtil.DataType.UINT;
+ case Token.TOKEN_UINT_VEC2: return gluShaderUtil.DataType.UINT_VEC2;
+ case Token.TOKEN_UINT_VEC3: return gluShaderUtil.DataType.UINT_VEC3;
+ case Token.TOKEN_UINT_VEC4: return gluShaderUtil.DataType.UINT_VEC4;
+ case Token.TOKEN_BOOL: return gluShaderUtil.DataType.BOOL;
+ case Token.TOKEN_BOOL_VEC2: return gluShaderUtil.DataType.BOOL_VEC2;
+ case Token.TOKEN_BOOL_VEC3: return gluShaderUtil.DataType.BOOL_VEC3;
+ case Token.TOKEN_BOOL_VEC4: return gluShaderUtil.DataType.BOOL_VEC4;
+ default: return gluShaderUtil.DataType.INVALID;
+ }
+ };
+
+ /**
+ * Returns the corresponding token's name depending on enum number value
+ * @param {number} token
+ * @return {string}
+ */
+ var getTokenName = function(token) {
+ switch (token) {
+ case Token.TOKEN_INVALID: return '<invalid>';
+ case Token.TOKEN_EOF: return '<eof>';
+ case Token.TOKEN_STRING: return '<string>';
+ case Token.TOKEN_SHADER_SOURCE: return 'source';
+
+ case Token.TOKEN_INT_LITERAL: return '<int>';
+ case Token.TOKEN_FLOAT_LITERAL: return '<float>';
+
+ // identifiers
+ case Token.TOKEN_IDENTIFIER: return '<identifier>';
+ case Token.TOKEN_TRUE: return 'true';
+ case Token.TOKEN_FALSE: return 'false';
+ case Token.TOKEN_DESC: return 'desc';
+ case Token.TOKEN_EXPECT: return 'expect';
+ case Token.TOKEN_GROUP: return 'group';
+ case Token.TOKEN_CASE: return 'case';
+ case Token.TOKEN_END: return 'end';
+ case Token.TOKEN_VALUES: return 'values';
+ case Token.TOKEN_BOTH: return 'both';
+ case Token.TOKEN_VERTEX: return 'vertex';
+ case Token.TOKEN_FRAGMENT: return 'fragment';
+ case Token.TOKEN_UNIFORM: return 'uniform';
+ case Token.TOKEN_INPUT: return 'input';
+ case Token.TOKEN_OUTPUT: return 'output';
+ case Token.TOKEN_FLOAT: return 'float';
+ case Token.TOKEN_FLOAT_VEC2: return 'vec2';
+ case Token.TOKEN_FLOAT_VEC3: return 'vec3';
+ case Token.TOKEN_FLOAT_VEC4: return 'vec4';
+ case Token.TOKEN_FLOAT_MAT2: return 'mat2';
+ case Token.TOKEN_FLOAT_MAT2X3: return 'mat2x3';
+ case Token.TOKEN_FLOAT_MAT2X4: return 'mat2x4';
+ case Token.TOKEN_FLOAT_MAT3X2: return 'mat3x2';
+ case Token.TOKEN_FLOAT_MAT3: return 'mat3';
+ case Token.TOKEN_FLOAT_MAT3X4: return 'mat3x4';
+ case Token.TOKEN_FLOAT_MAT4X2: return 'mat4x2';
+ case Token.TOKEN_FLOAT_MAT4X3: return 'mat4x3';
+ case Token.TOKEN_FLOAT_MAT4: return 'mat4';
+ case Token.TOKEN_INT: return 'int';
+ case Token.TOKEN_INT_VEC2: return 'ivec2';
+ case Token.TOKEN_INT_VEC3: return 'ivec3';
+ case Token.TOKEN_INT_VEC4: return 'ivec4';
+ case Token.TOKEN_UINT: return 'uint';
+ case Token.TOKEN_UINT_VEC2: return 'uvec2';
+ case Token.TOKEN_UINT_VEC3: return 'uvec3';
+ case Token.TOKEN_UINT_VEC4: return 'uvec4';
+ case Token.TOKEN_BOOL: return 'bool';
+ case Token.TOKEN_BOOL_VEC2: return 'bvec2';
+ case Token.TOKEN_BOOL_VEC3: return 'bvec3';
+ case Token.TOKEN_BOOL_VEC4: return 'bvec4';
+
+ case Token.TOKEN_ASSIGN: return '=';
+ case Token.TOKEN_PLUS: return '+';
+ case Token.TOKEN_MINUS: return '-';
+ case Token.TOKEN_COMMA: return ',';
+ case Token.TOKEN_VERTICAL_BAR: return '|';
+ case Token.TOKEN_SEMI_COLON: return ';';
+ case Token.TOKEN_LEFT_PAREN: return '(';
+ case Token.TOKEN_RIGHT_PAREN: return ')';
+ case Token.TOKEN_LEFT_BRACKET: return '[';
+ case Token.TOKEN_RIGHT_BRACKET: return ']';
+ case Token.TOKEN_LEFT_BRACE: return ' {';
+ case Token.TOKEN_RIGHT_BRACE: return '}';
+
+ default: return '<unknown>';
+ }
+ };
+
+ /**
+ * @param {?gluShaderUtil.DataType} expectedDataType
+ * @param {Object} result
+ */
+ var parseValueElement = function(expectedDataType, result) {
+ /** @type {?string} */ var scalarType = null;
+ /** @type {number} */ var scalarSize = 0;
+ if (expectedDataType) {
+ scalarType = gluShaderUtil.getDataTypeScalarType(expectedDataType);
+ scalarSize = gluShaderUtil.getDataTypeScalarSize(expectedDataType);
+ }
+
+ /** @type {Array<number>} */ var elems = [];
+
+ if (scalarSize > 1) {
+ glsShaderLibrary.de_assert(mapDataTypeToken(m_curToken) === expectedDataType);
+ advanceToken(); // data type(float, vec2, etc.)
+ advanceToken(Token.TOKEN_LEFT_PAREN);
+ }
+
+ for (var i = 0; i < scalarSize; ++i) {
+ if (scalarType === 'float') {
+
+ /** @type {number} */ var signMult = 1.0;
+ if (m_curToken === Token.TOKEN_MINUS) {
+ signMult = -1.0;
+ advanceToken();
+ }
+
+ assumeToken(Token.TOKEN_FLOAT_LITERAL);
+ elems.push(signMult * parseFloatLiteral(m_curTokenStr));
+ advanceToken(Token.TOKEN_FLOAT_LITERAL);
+
+ } else if (scalarType === 'int' || scalarType === 'uint') {
+
+ var signMult = 1;
+ if (m_curToken === Token.TOKEN_MINUS) {
+ signMult = -1;
+ advanceToken();
+ }
+
+ assumeToken(Token.TOKEN_INT_LITERAL);
+ elems.push(signMult * parseIntLiteral(m_curTokenStr));
+ advanceToken(Token.TOKEN_INT_LITERAL);
+
+ } else {
+
+ glsShaderLibrary.de_assert(scalarType === 'bool');
+ elems.push(m_curToken === Token.TOKEN_TRUE);
+ if (m_curToken != Token.TOKEN_TRUE && m_curToken != Token.TOKEN_FALSE) {
+ throw Error('unexpected token, expecting bool: ' + m_curTokenStr);
+ }
+ advanceToken(); // true/false
+
+ }
+
+ if (i != (scalarSize - 1)) {
+ advanceToken(Token.TOKEN_COMMA);
+ }
+ }
+
+ if (scalarSize > 1) {
+ advanceToken(Token.TOKEN_RIGHT_PAREN);
+ }
+
+ for (var i = 0; i < elems.length; i++)
+ result.elements.push(elems[i]);
+
+ };
+
+ /**
+ * @param {Object.<Array, number>} valueBlock
+ */
+ var parseValue = function(valueBlock) {
+
+ /**
+ * @type {Object}
+ */
+ var result = {
+ /** @type {?gluShaderUtil.DataType} */ dataType: null,
+ /** @type {?glsShaderLibraryCase.shaderCase} */ storageType: null,
+ /** @type {?string} */ valueName: null,
+ /** @type {Array} */ elements: []
+ };
+
+ // parse storage
+ switch (m_curToken) {
+ case Token.TOKEN_UNIFORM:
+ result.storageType = glsShaderLibraryCase.shaderCase.STORAGE_UNIFORM;
+ break;
+ case Token.TOKEN_INPUT:
+ result.storageType = glsShaderLibraryCase.shaderCase.STORAGE_INPUT;
+ break;
+ case Token.TOKEN_OUTPUT:
+ result.storageType = glsShaderLibraryCase.shaderCase.STORAGE_OUTPUT;
+ break;
+ default:
+ throw Error('unexpected token encountered when parsing value classifier');
+ break;
+ }
+ advanceToken();
+
+ // parse data type
+ result.dataType = mapDataTypeToken(m_curToken);
+ if (result.dataType === gluShaderUtil.DataType.INVALID) {
+ throw Error('unexpected token when parsing value data type: ' + m_curTokenStr);
+ }
+ advanceToken();
+
+ // parse value name
+ if (m_curToken === Token.TOKEN_IDENTIFIER) {
+ result.valueName = m_curTokenStr;
+ } else if (m_curToken === Token.TOKEN_STRING) {
+ result.valueName = parseStringLiteral(m_curTokenStr);
+ } else {
+ throw Error('unexpected token when parsing value name: ' + m_curTokenStr);
+ }
+ advanceToken();
+
+ // parse assignment operator.
+ advanceToken(Token.TOKEN_ASSIGN);
+
+ // parse actual value
+ if (m_curToken === Token.TOKEN_LEFT_BRACKET) { // value list
+ advanceToken(Token.TOKEN_LEFT_BRACKET);
+ result.arrayLength = 0;
+
+ for (;;) {
+ parseValueElement(result.dataType, result);
+ result.arrayLength += 1;
+
+ if (m_curToken === Token.TOKEN_RIGHT_BRACKET) {
+ break;
+ } else if (m_curToken === Token.TOKEN_VERTICAL_BAR) { // pipe?
+ advanceToken();
+ continue;
+ } else {
+ throw Error('unexpected token in value element array: ' + m_curTokenStr);
+ }
+ }
+
+ advanceToken(Token.TOKEN_RIGHT_BRACKET);
+
+ } else { // arrays, single elements
+ parseValueElement(result.dataType, result);
+ result.arrayLength = 1;
+ }
+
+ advanceToken(Token.TOKEN_SEMI_COLON);
+
+ valueBlock.values.push(result);
+
+ };
+
+ /**
+ * @param {Object.<Array, number>} valueBlock
+ */
+ var parseValueBlock = function(valueBlock) {
+
+ advanceToken(Token.TOKEN_VALUES);
+ advanceToken(Token.TOKEN_LEFT_BRACE);
+
+ for (;;) {
+ if (
+ m_curToken === Token.TOKEN_UNIFORM ||
+ m_curToken === Token.TOKEN_INPUT ||
+ m_curToken === Token.TOKEN_OUTPUT
+ ) {
+ parseValue(valueBlock);
+ } else if (m_curToken === Token.TOKEN_RIGHT_BRACE) {
+ break;
+ } else {
+ throw Error('unexpected( token when parsing a value block: ' + m_curTokenStr);
+ }
+ }
+
+ advanceToken(Token.TOKEN_RIGHT_BRACE);
+
+ /** @type {number} */ var arrayLength = 1;
+ // compute combined array length of value block.
+ for (var i = 0; i < valueBlock.values.length; ++i) {
+ if (valueBlock.values[i].arrayLength > 1) {
+ glsShaderLibrary.de_assert(arrayLength === 1 || arrayLength === valueBlock.values[i].arrayLength);
+ arrayLength = valueBlock.values[i].arrayLength;
+ }
+ }
+
+ valueBlock.arrayLength = arrayLength;
+
+ };
+
+ /**
+ * @param {Array<tcuTestCase.DeqpTest>} shaderNodeList
+ */
+ var parseShaderCase = function(shaderNodeList) {
+
+ // parse case
+ advanceToken(Token.TOKEN_CASE);
+
+ /**
+ * @type {string}
+ * parse case name
+ */
+ var caseName = m_curTokenStr;
+ advanceToken(); // \note [pyry] All token types are allowed here.
+
+ /**
+ * @type {Array<Object>}
+ * setup case
+ */
+ var valueBlockList = [];
+
+ /** TODO: Should the default version be defined elsewhere? */
+ /** @type {string} */ var version = '100';
+ /** @type {number} */ var expectResult = glsShaderLibraryCase.expectResult.EXPECT_PASS;
+ /** @type {string} */ var description;
+ /** @type {string} */ var bothSource = '';
+ /** @type {string} */ var vertexSource = '';
+ /** @type {string} */ var fragmentSource = '';
+
+ for (;;) {
+
+ if (m_curToken === Token.TOKEN_END) {
+
+ break;
+
+ } else if (m_curToken === Token.TOKEN_DESC) {
+
+ advanceToken();
+ assumeToken(Token.TOKEN_STRING);
+
+ description = parseStringLiteral(m_curTokenStr);
+ advanceToken();
+
+ } else if (m_curToken === Token.TOKEN_EXPECT) {
+
+ advanceToken();
+ assumeToken(Token.TOKEN_IDENTIFIER);
+
+ expectResult = (function(token) {
+ switch (token) {
+ case 'pass': return glsShaderLibraryCase.expectResult.EXPECT_PASS;
+ case 'compile_fail': return glsShaderLibraryCase.expectResult.EXPECT_COMPILE_FAIL;
+ case 'link_fail': return glsShaderLibraryCase.expectResult.EXPECT_LINK_FAIL;
+ case 'compile_or_link_fail': return glsShaderLibraryCase.expectResult.EXPECT_COMPILE_LINK_FAIL;
+ case 'build_successful': return glsShaderLibraryCase.expectResult.EXPECT_BUILD_SUCCESSFUL;
+ default:
+ throw Error('invalid expected result value: ' + m_curTokenStr);
+ }
+ }(m_curTokenStr));
+
+ advanceToken();
+
+ } else if (m_curToken === Token.TOKEN_VALUES) {
+
+ /** @type {Object.<Array, number>} */ var block = glsShaderLibraryCase.genValueBlock();
+ parseValueBlock(block);
+ valueBlockList.push(block);
+
+ } else if (
+ m_curToken === Token.TOKEN_BOTH ||
+ m_curToken === Token.TOKEN_VERTEX ||
+ m_curToken === Token.TOKEN_FRAGMENT
+ ) {
+
+ /** @type {number} */ var token = m_curToken;
+ advanceToken();
+ assumeToken(Token.TOKEN_SHADER_SOURCE);
+ /** @type {string} */ var source = parseShaderSource(m_curTokenStr);
+
+ advanceToken();
+ switch (token) {
+ case Token.TOKEN_BOTH: bothSource = source; break;
+ case Token.TOKEN_VERTEX: vertexSource = source; break;
+ case Token.TOKEN_FRAGMENT: fragmentSource = source; break;
+ default: glsShaderLibrary.de_assert(false); break;
+ }
+
+ } else if (m_curToken === Token.TOKEN_VERSION) {
+
+ advanceToken();
+
+ /** @type {number} */ var versionNum = 0;
+ /** @type {string} */ var postfix = '';
+
+ assumeToken(Token.TOKEN_INT_LITERAL);
+ versionNum = parseIntLiteral(m_curTokenStr);
+ advanceToken();
+
+ if (m_curToken === Token.TOKEN_IDENTIFIER) {
+ postfix = m_curTokenStr;
+ advanceToken();
+ }
+
+ // TODO: need to fix these constants, we dont have glu
+ if (versionNum === 100 && postfix === 'es') version = '100';
+ else if (versionNum === 300 && postfix === 'es') version = '300 es';
+ else if (versionNum === 310 && postfix === 'es') version = '310 es';
+ else if (versionNum === 130) version = '130';
+ else if (versionNum === 140) version = '140';
+ else if (versionNum === 150) version = '150';
+ else if (versionNum === 330) version = '330';
+ else if (versionNum === 400) version = '400';
+ else if (versionNum === 410) version = '410';
+ else if (versionNum === 420) version = '420';
+ else if (versionNum === 430) version = '430';
+ else if (versionNum === 440) version = '440';
+ else if (versionNum === 450) version = '450';
+ else {
+ throw Error('Unknown GLSL version');
+ }
+
+ } else {
+ throw Error('unexpected token while parsing shader case: ' + m_curTokenStr);
+ }
+
+ }
+
+ advanceToken(Token.TOKEN_END); // case end
+
+ /**
+ * no ShaderCase yet?
+ * @param {?string} vert
+ * @param {?string} frag
+ * @param {glsShaderLibraryCase.caseType} type
+ * @return {Object}
+ */
+ var getShaderSpec = function(vert, frag, type) {
+ return {
+ /** @type {glsShaderLibraryCase.expectResult} */ expectResult: expectResult,
+ /** @type {glsShaderLibraryCase.caseType} */ caseType: type,
+ /** @type {Array<Object>} */ valueBlockList: valueBlockList,
+ /** @type {string} */ targetVersion: version,
+ /** @type {?string} */ vertexSource: vert,
+ /** @type {?string} */ fragmentSource: frag
+ };
+ };
+ getShaderSpec.bind(this);
+
+ if (bothSource.length) {
+
+ glsShaderLibrary.de_assert(!vertexSource);
+ glsShaderLibrary.de_assert(!fragmentSource);
+
+ shaderNodeList.push(tcuTestCase.newTest(caseName + '_vertex', description, getShaderSpec(bothSource, null,
+ glsShaderLibraryCase.caseType.CASETYPE_VERTEX_ONLY)));
+ shaderNodeList.push(tcuTestCase.newTest(caseName + '_fragment', description, getShaderSpec(null, bothSource,
+ glsShaderLibraryCase.caseType.CASETYPE_FRAGMENT_ONLY)));
+
+ } else {
+ glsShaderLibrary.de_assert(vertexSource);
+ glsShaderLibrary.de_assert(fragmentSource);
+
+ shaderNodeList.push(tcuTestCase.newTest(caseName, description, getShaderSpec(vertexSource, fragmentSource,
+ glsShaderLibraryCase.caseType.CASETYPE_COMPLETE)));
+ }
+ };
+
+ /**
+ * @param {Array<tcuTestCase.DeqpTest>} shaderNodeList
+ */
+ var parseShaderGroup = function(shaderNodeList) {
+
+ // parse 'case'
+ advanceToken(Token.TOKEN_GROUP);
+
+ /** @type {string}
+ * parse case name
+ */ var name = m_curTokenStr;
+ advanceToken(); // \note [pyry] We don't want to check token type here (for instance to allow "uniform") group.
+
+ // Parse description.
+ assumeToken(Token.TOKEN_STRING);
+ /** @type {string} */ var description = parseStringLiteral(m_curTokenStr);
+ advanceToken(Token.TOKEN_STRING);
+
+ /** @type {Array<tcuTestCase.DeqpTest>} */ var children = [];
+
+ for (;;) {
+
+ if (m_curToken === Token.TOKEN_END) {
+ break;
+ } else if (m_curToken === Token.TOKEN_GROUP) {
+ parseShaderGroup(children);
+ } else if (m_curToken === Token.TOKEN_CASE) {
+ parseShaderCase(children);
+ } else {
+ testFailed('unexpected token while parsing shader group: ' + m_curTokenStr);
+ tcuTestCase.runner.terminate();
+ }
+
+ }
+
+ advanceToken(Token.TOKEN_END); // group end
+
+ /** @type {tcuTestCase.DeqpTest} */ var groupNode = tcuTestCase.newTest(name, description, null);
+ groupNode.setChildren(children);
+
+ shaderNodeList.push(groupNode);
+
+ };
+
+ // uncomment to expose private functions
+ (function(obj) {
+ obj.priv = {
+ m_curPtr: m_curPtr,
+
+ parseError: parseError,
+ parseFloatLiteral: parseFloatLiteral,
+ parseIntLiteral: parseIntLiteral,
+ parseStringLiteral: parseStringLiteral,
+ parseShaderSource: parseShaderSource,
+ advanceTokenTester: advanceTokenTester,
+ assumeToken: assumeToken,
+ mapDataTypeToken: mapDataTypeToken,
+ getTokenName: getTokenName,
+
+ Token: Token,
+
+ parseValueElement: parseValueElement,
+ parseValue: parseValue,
+ parseValueBlock: parseValueBlock,
+ parseShaderCase: parseShaderCase,
+ parseShaderGroup: parseShaderGroup,
+
+ none: false
+ };
+ }(this));
+ //*/
+ };
+
+/**
+ * Parse the test file and execute the test cases
+ * @param {string} testName Name of the test file (without extension)
+ * @param {string} filter Optional filter. Common substring of the names of the tests that should be glsShaderLibrary.run.
+ */
+glsShaderLibrary.run = function(testName, filter) {
+ WebGLTestUtils.loadTextFileAsync(testName + '.test', function(success, content) {
+ if (success) {
+ tcuTestCase.runner.testFile = content;
+ tcuTestCase.runner.testName = testName;
+ tcuTestCase.runner.runCallback(glsShaderLibrary.processTestFile);
+ } else {
+ testFailed('Failed to load test file: ' + testName);
+ tcuTestCase.runner.terminate();
+ }
+ });
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderLibraryCase.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderLibraryCase.js
new file mode 100644
index 0000000000..fa9666de56
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderLibraryCase.js
@@ -0,0 +1,1132 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('modules.shared.glsShaderLibraryCase');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.opengl.gluDrawUtil');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('framework.opengl.gluShaderUtil');
+
+goog.scope(function() {
+
+var glsShaderLibraryCase = modules.shared.glsShaderLibraryCase;
+var tcuTestCase = framework.common.tcuTestCase;
+var gluShaderProgram = framework.opengl.gluShaderProgram;
+var gluShaderUtil = framework.opengl.gluShaderUtil;
+var gluDrawUtil = framework.opengl.gluDrawUtil;
+
+ /** @const @type {number} */ glsShaderLibraryCase.VIEWPORT_WIDTH = 128;
+ /** @const @type {number} */ glsShaderLibraryCase.VIEWPORT_HEIGHT = 128;
+
+/**
+ * Shader compilation expected result enum
+ * @enum {number}
+ */
+glsShaderLibraryCase.expectResult = {
+ EXPECT_PASS: 0,
+ EXPECT_COMPILE_FAIL: 1,
+ EXPECT_LINK_FAIL: 2,
+ EXPECT_COMPILE_LINK_FAIL: 3,
+ EXPECT_VALIDATION_FAIL: 4,
+ EXPECT_BUILD_SUCCESSFUL: 5
+};
+
+/**
+ * Test case type
+ * @enum {number}
+ */
+glsShaderLibraryCase.caseType = {
+ CASETYPE_COMPLETE: 0, //!< Has all shaders specified separately.
+ CASETYPE_VERTEX_ONLY: 1, //!< "Both" case, vertex shader sub case.
+ CASETYPE_FRAGMENT_ONLY: 2 //!< "Both" case, fragment shader sub case.
+};
+
+/**
+ * glsShaderLibraryCase.BeforeDrawValidator target type enum
+ * @enum {number}
+ */
+glsShaderLibraryCase.targetType = {
+ PROGRAM: 0,
+ PIPELINE: 1
+};
+
+/**
+ * Shader case type enum
+ * @enum {number}
+ */
+glsShaderLibraryCase.shaderCase = {
+ STORAGE_INPUT: 0,
+ STORAGE_OUTPUT: 1,
+ STORAGE_UNIFORM: 2
+};
+
+/**
+ * Checks if shader uses in/out qualifiers depending on the version
+ * @param {string} version
+ * @return {boolean} version
+ */
+glsShaderLibraryCase.usesShaderInoutQualifiers = function(version) {
+ switch (version) {
+ case '100':
+ case '130':
+ case '140':
+ case '150':
+ return false;
+
+ default:
+ return true;
+ }
+};
+
+/**
+ * Checks if version supports fragment highp precision
+ * @param {string} version
+ * @return {boolean} version ,True when is different from version 100
+ */
+glsShaderLibraryCase.supportsFragmentHighp = function(version) {
+ return version !== '100';
+};
+
+/**
+ * This functions builds a matching vertex shader for a 'both' case, when
+ * the fragment shader is being tested.
+ * We need to build attributes and varyings for each 'input'.
+ * @param { {values:Array}} valueBlock
+ * @return {string} res
+ */
+glsShaderLibraryCase.genVertexShader = function(valueBlock) {
+ /** @type {string} */ var res = '';
+ /** @type {Object} */ var state = tcuTestCase.runner;
+ /** @type {boolean} */ var usesInout = glsShaderLibraryCase.usesShaderInoutQualifiers(state.currentTest.spec.targetVersion);
+ /** @type {string} */ var vtxIn = usesInout ? 'in' : 'attribute';
+ /** @type {string} */ var vtxOut = usesInout ? 'out' : 'varying';
+
+ res += '#version ' + state.currentTest.spec.targetVersion + '\n';
+ res += 'precision highp float;\n';
+ res += 'precision highp int;\n';
+ res += '\n';
+ res += vtxIn + ' highp vec4 dEQP_Position;\n';
+
+ for (var ndx = 0; ndx < valueBlock.values.length; ndx++) {
+ var val = valueBlock.values[ndx];
+ if (val.storageType === glsShaderLibraryCase.shaderCase.STORAGE_INPUT) {
+ /** @type {string} */ var floatType = gluShaderUtil.getDataTypeFloatScalars(val.dataType);
+ res += vtxIn + ' ' + floatType + ' a_' + val.valueName + ';\n';
+
+ if (gluShaderUtil.getDataTypeScalarType(val.dataType) === 'float')
+ res += vtxOut + ' ' + floatType + ' ' + val.valueName + ';\n';
+ else
+ res += vtxOut + ' ' + floatType + ' v_' + val.valueName + ';\n';
+ }
+ }
+ res += '\n';
+
+ // Main function.
+ // - gl_Position = dEQP_Position;
+ // - for each input: write attribute directly to varying
+ res += 'void main()\n';
+ res += ' {\n';
+ res += '\tgl_Position = dEQP_Position;\n';
+ for (var ndx = 0; ndx < valueBlock.values.length; ndx++) {
+ var val = valueBlock.values[ndx];
+ if (val.storageType === glsShaderLibraryCase.shaderCase.STORAGE_INPUT) {
+ /** @type {string} */ var name = val.valueName;
+ if (gluShaderUtil.getDataTypeScalarType(val.dataType) === 'float')
+ res += '\t' + name + ' = a_' + name + ';\n';
+ else
+ res += '\tv_' + name + ' = a_' + name + ';\n';
+ }
+ }
+
+ res += '}\n';
+ return res;
+};
+
+/**
+ * @param { {values:Array}} valueBlock
+ * @param {boolean} useFloatTypes
+ * @return {string} stream
+ */
+glsShaderLibraryCase.genCompareFunctions = function(valueBlock, useFloatTypes) {
+ var cmpTypeFound = {};
+ /** @type {string} */ var stream = '';
+
+ for (var ndx = 0; ndx < valueBlock.values.length; ndx++) {
+ /** @type {Array} */ var val = valueBlock.values[ndx];
+ if (val.storageType === glsShaderLibraryCase.shaderCase.STORAGE_OUTPUT)
+ cmpTypeFound[gluShaderUtil.getDataTypeName(val.dataType)] = true;
+
+ }
+ if (useFloatTypes) {
+ if (cmpTypeFound['bool']) stream += 'bool isOk (float a, bool b) { return ((a > 0.5) == b); }\n';
+ if (cmpTypeFound['bvec2']) stream += 'bool isOk (vec2 a, bvec2 b) { return (greaterThan(a, vec2(0.5)) == b); }\n';
+ if (cmpTypeFound['bvec3']) stream += 'bool isOk (vec3 a, bvec3 b) { return (greaterThan(a, vec3(0.5)) == b); }\n';
+ if (cmpTypeFound['bvec4']) stream += 'bool isOk (vec4 a, bvec4 b) { return (greaterThan(a, vec4(0.5)) == b); }\n';
+ if (cmpTypeFound['int']) stream += 'bool isOk (float a, int b) { float atemp = a+0.5; return (float(b) <= atemp && atemp <= float(b+1)); }\n';
+ if (cmpTypeFound['ivec2']) stream += 'bool isOk (vec2 a, ivec2 b) { return (ivec2(floor(a + 0.5)) == b); }\n';
+ if (cmpTypeFound['ivec3']) stream += 'bool isOk (vec3 a, ivec3 b) { return (ivec3(floor(a + 0.5)) == b); }\n';
+ if (cmpTypeFound['ivec4']) stream += 'bool isOk (vec4 a, ivec4 b) { return (ivec4(floor(a + 0.5)) == b); }\n';
+ if (cmpTypeFound['uint']) stream += 'bool isOk (float a, uint b) { float atemp = a+0.5; return (float(b) <= atemp && atemp <= float(b+1u)); }\n';
+ if (cmpTypeFound['uvec2']) stream += 'bool isOk (vec2 a, uvec2 b) { return (uvec2(floor(a + 0.5)) == b); }\n';
+ if (cmpTypeFound['uvec3']) stream += 'bool isOk (vec3 a, uvec3 b) { return (uvec3(floor(a + 0.5)) == b); }\n';
+ if (cmpTypeFound['uvec4']) stream += 'bool isOk (vec4 a, uvec4 b) { return (uvec4(floor(a + 0.5)) == b); }\n';
+ } else {
+ if (cmpTypeFound['bool']) stream += 'bool isOk (bool a, bool b) { return (a == b); }\n';
+ if (cmpTypeFound['bvec2']) stream += 'bool isOk (bvec2 a, bvec2 b) { return (a == b); }\n';
+ if (cmpTypeFound['bvec3']) stream += 'bool isOk (bvec3 a, bvec3 b) { return (a == b); }\n';
+ if (cmpTypeFound['bvec4']) stream += 'bool isOk (bvec4 a, bvec4 b) { return (a == b); }\n';
+ if (cmpTypeFound['int']) stream += 'bool isOk (int a, int b) { return (a == b); }\n';
+ if (cmpTypeFound['ivec2']) stream += 'bool isOk (ivec2 a, ivec2 b) { return (a == b); }\n';
+ if (cmpTypeFound['ivec3']) stream += 'bool isOk (ivec3 a, ivec3 b) { return (a == b); }\n';
+ if (cmpTypeFound['ivec4']) stream += 'bool isOk (ivec4 a, ivec4 b) { return (a == b); }\n';
+ if (cmpTypeFound['uint']) stream += 'bool isOk (uint a, uint b) { return (a == b); }\n';
+ if (cmpTypeFound['uvec2']) stream += 'bool isOk (uvec2 a, uvec2 b) { return (a == b); }\n';
+ if (cmpTypeFound['uvec3']) stream += 'bool isOk (uvec3 a, uvec3 b) { return (a == b); }\n';
+ if (cmpTypeFound['uvec4']) stream += 'bool isOk (uvec4 a, uvec4 b) { return (a == b); }\n';
+ }
+
+ if (cmpTypeFound['float'])
+ stream += 'bool isOk (float a, float b, float eps) { return (abs(a-b) <= (eps*abs(b) + eps)); }\n';
+ if (cmpTypeFound['vec2'])
+ stream += 'bool isOk (vec2 a, vec2 b, float eps) { return all(lessThanEqual(abs(a-b), (eps*abs(b) + eps))); }\n';
+ if (cmpTypeFound['vec3'])
+ stream += 'bool isOk (vec3 a, vec3 b, float eps) { return all(lessThanEqual(abs(a-b), (eps*abs(b) + eps))); }\n';
+ if (cmpTypeFound['vec4'])
+ stream += 'bool isOk (vec4 a, vec4 b, float eps) { return all(lessThanEqual(abs(a-b), (eps*abs(b) + eps))); }\n';
+
+ if (cmpTypeFound['mat2'])
+ stream += 'bool isOk (mat2 a, mat2 b, float eps) { vec2 diff = max(abs(a[0]-b[0]), abs(a[1]-b[1])); return all(lessThanEqual(diff, vec2(eps))); }\n';
+ if (cmpTypeFound['mat2x3'])
+ stream += 'bool isOk (mat2x3 a, mat2x3 b, float eps) { vec3 diff = max(abs(a[0]-b[0]), abs(a[1]-b[1])); return all(lessThanEqual(diff, vec3(eps))); }\n';
+ if (cmpTypeFound['mat2x4'])
+ stream += 'bool isOk (mat2x4 a, mat2x4 b, float eps) { vec4 diff = max(abs(a[0]-b[0]), abs(a[1]-b[1])); return all(lessThanEqual(diff, vec4(eps))); }\n';
+ if (cmpTypeFound['mat3x2'])
+ stream += 'bool isOk (mat3x2 a, mat3x2 b, float eps) { vec2 diff = max(max(abs(a[0]-b[0]), abs(a[1]-b[1])), abs(a[2]-b[2])); return all(lessThanEqual(diff, vec2(eps))); }\n';
+ if (cmpTypeFound['mat3'])
+ stream += 'bool isOk (mat3 a, mat3 b, float eps) { vec3 diff = max(max(abs(a[0]-b[0]), abs(a[1]-b[1])), abs(a[2]-b[2])); return all(lessThanEqual(diff, vec3(eps))); }\n';
+ if (cmpTypeFound['mat3x4'])
+ stream += 'bool isOk (mat3x4 a, mat3x4 b, float eps) { vec4 diff = max(max(abs(a[0]-b[0]), abs(a[1]-b[1])), abs(a[2]-b[2])); return all(lessThanEqual(diff, vec4(eps))); }\n';
+ if (cmpTypeFound['mat4x2'])
+ stream += 'bool isOk (mat4x2 a, mat4x2 b, float eps) { vec2 diff = max(max(abs(a[0]-b[0]), abs(a[1]-b[1])), max(abs(a[2]-b[2]), abs(a[3]-b[3]))); return all(lessThanEqual(diff, vec2(eps))); }\n';
+ if (cmpTypeFound['mat4x3'])
+ stream += 'bool isOk (mat4x3 a, mat4x3 b, float eps) { vec3 diff = max(max(abs(a[0]-b[0]), abs(a[1]-b[1])), max(abs(a[2]-b[2]), abs(a[3]-b[3]))); return all(lessThanEqual(diff, vec3(eps))); }\n';
+ if (cmpTypeFound['mat4'])
+ stream += 'bool isOk (mat4 a, mat4 b, float eps) { vec4 diff = max(max(abs(a[0]-b[0]), abs(a[1]-b[1])), max(abs(a[2]-b[2]), abs(a[3]-b[3]))); return all(lessThanEqual(diff, vec4(eps))); }\n';
+
+ return stream;
+};
+
+/**
+ * @param {string} dstVec4Var
+ * @param { {values:Array}} valueBlock
+ * @param {string} nonFloatNamePrefix
+ * @param {?string=} checkVarName
+ * @return {string} output
+ */
+glsShaderLibraryCase.genCompareOp = function(dstVec4Var, valueBlock, nonFloatNamePrefix, checkVarName) {
+
+ /** @type {boolean} */ var isFirstOutput = true;
+ /** @type {string} */ var output = '';
+
+ for (var ndx = 0; ndx < valueBlock.values.length; ndx++) {
+ /** @type {Array} */ var val = valueBlock.values[ndx];
+ /** @type {string} */ var valueName = val.valueName;
+
+ if (val.storageType === glsShaderLibraryCase.shaderCase.STORAGE_OUTPUT) {
+ // Check if we're only interested in one variable (then skip if not the right one).
+ if (checkVarName && (valueName !== checkVarName))
+ continue;
+
+ // Prefix.
+ if (isFirstOutput) {
+ output += 'bool RES = ';
+ isFirstOutput = false;
+ } else
+ output += 'RES = RES && ';
+
+ // Generate actual comparison.
+ if (gluShaderUtil.getDataTypeScalarType(val.dataType) === 'float')
+ output += 'isOk(' + valueName + ', ref_' + valueName + ', 0.05);\n';
+ else
+ output += 'isOk(' + nonFloatNamePrefix + valueName + ', ref_' + valueName + ');\n';
+ }
+ // \note Uniforms are already declared in shader.
+ }
+
+ if (isFirstOutput)
+ output += dstVec4Var + ' = vec4(1.0);\n'; // \todo [petri] Should we give warning if not expect-failure case?
+ else
+ output += dstVec4Var + ' = vec4(RES, RES, RES, 1.0);\n';
+
+ return output;
+};
+
+/**
+ * @param { {values:Array}} valueBlock
+ * @return {string} shader
+ */
+glsShaderLibraryCase.genFragmentShader = function(valueBlock) {
+ /** @type {string} */ var shader = '';
+ /** @type {Object} */ var state = tcuTestCase.runner;
+ /** @type {boolean} */ var usesInout = glsShaderLibraryCase.usesShaderInoutQualifiers(state.currentTest.spec.targetVersion);
+ /** @type {string} */ var vtxIn = usesInout ? 'in' : 'attribute';
+ /** @type {string} */ var vtxOut = usesInout ? 'out' : 'varying';
+ /** @type {boolean} */ var customColorOut = usesInout;
+ /** @type {string} */ var fragIn = usesInout ? 'in' : 'varying';
+ /** @type {string} */ var prec = glsShaderLibraryCase.supportsFragmentHighp(state.currentTest.spec.targetVersion) ? 'highp' : 'mediump';
+
+ shader += '#version ' + state.currentTest.spec.targetVersion + '\n';
+
+ shader += 'precision ' + prec + ' float;\n';
+ shader += 'precision ' + prec + ' int;\n';
+ shader += '\n';
+
+ if (customColorOut) {
+ shader += 'layout(location = 0) out mediump vec4 dEQP_FragColor;\n';
+ shader += '\n';
+ }
+
+ shader += glsShaderLibraryCase.genCompareFunctions(valueBlock, true);
+ shader += '\n';
+
+ // Declarations (varying, reference for each output).
+ for (var ndx = 0; ndx < valueBlock.values.length; ndx++) {
+ /** @type {Array} */ var val = valueBlock.values[ndx];
+ /** @type {string} */ var floatType = gluShaderUtil.getDataTypeFloatScalars(val.dataType);
+ /** @type {string} */ var refType = gluShaderUtil.getDataTypeName(val.dataType);
+
+ if (val.storageType == glsShaderLibraryCase.shaderCase.STORAGE_OUTPUT) {
+ if (gluShaderUtil.getDataTypeScalarType(val.dataType) === 'float')
+ shader += fragIn + ' ' + floatType + ' ' + val.valueName + ';\n';
+ else
+ shader += fragIn + ' ' + floatType + ' v_' + val.valueName + ';\n';
+
+ shader += 'uniform ' + refType + ' ref_' + val.valueName + ';\n';
+ }
+ }
+
+ shader += '\n';
+ shader += 'void main()\n';
+ shader += ' {\n';
+
+ shader += '\t';
+ shader += glsShaderLibraryCase.genCompareOp(customColorOut ? 'dEQP_FragColor' : 'gl_FragColor', valueBlock, 'v_', null);
+
+ shader += '}\n';
+ return shader;
+};
+
+glsShaderLibraryCase.caseRequirement = (function() {
+
+/**
+ * @constructor
+ */
+var CaseRequirement = function() {
+
+/**
+ * @param {number} shaderType
+ * @return {boolean}
+ */
+ this.isAffected = function(shaderType) {
+ for (var i = 0; i < this.shaderTypes.length; i++)
+ if (this.shaderTypes[i] === shaderType)
+ return true;
+ return false;
+ };
+
+ this.checkRequirements = function(gl) {
+ if (this.type === requirementType.EXTENSION) {
+ var extns = gl.getSupportedExtensions();
+ for (var i = 0; i < extns.length; i++)
+ for (var j = 0; j < this.requirements.length; j++)
+ if (extns[i] === this.requirements[j]) {
+ this.supportedExtension = this.requirements[j];
+ return true;
+ }
+ if (this.requirements.length === 1)
+ throw Error('Test requires extension of ' + this.requirements[0]);
+ else
+ throw Error('Test requires any extension of ' + this.requirements);
+ } else if (this.type === requirementType.IMPLEMENTATION_LIMIT) {
+ var value = gl.getParameter(this.enumName);
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'Failed to read parameter ' + this.enumName, false, true);
+
+ if (!(value > this.referenceValue))
+ throw Error('Test requires ' + this.enumName + ' (' + value + ') > ' + this.referenceValue);
+ }
+ };
+
+ this.getSupportedExtension = function() {
+ return this.supportedExtension;
+ };
+
+};
+
+var createAnyExtensionRequirement = function(requirements, shaderTypes) {
+ var cr = new CaseRequirement();
+ cr.type = requirementType.EXTENSION;
+ cr.requirements = requirements;
+ cr.shaderTypes = shaderTypes;
+ return cr;
+};
+
+var createLimitRequirement = function(enumName, ref) {
+ var cr = new CaseRequirement();
+ cr.type = requirementType.IMPLEMENTATION_LIMIT;
+ cr.enumName = enumName;
+ cr.referenceValue = ref;
+};
+
+/**
+ * @enum {number}
+ */
+var requirementType = {
+ EXTENSION: 0,
+ IMPLEMENTATION_LIMIT: 1
+};
+
+return {
+ createAnyExtensionRequirement: createAnyExtensionRequirement,
+ createLimitRequirement: createLimitRequirement,
+ requirementType: requirementType
+};
+
+}());
+
+/** Specialize a shader only for the vertex test case.
+ * @param {string} baseCode
+ * @param {number} shaderType
+ * @param {Array<Object>} requirements
+ * @return {string} resultBuf
+ */
+glsShaderLibraryCase.injectExtensionRequirements = function(baseCode, shaderType, requirements) {
+/**
+ * @param {Array<Object>} requirements
+ * @param {number} shaderType
+ * @return {string} buf
+ */
+ var generateExtensionStatements = function(requirements, shaderType) {
+ /** @type {string} */ var buf = '';
+
+ if (requirements)
+ for (var ndx = 0; ndx < requirements.length; ndx++)
+ if (requirements[ndx].type === glsShaderLibraryCase.caseRequirement.requirementType.EXTENSION &&
+ requirements[ndx].isAffected(shaderType))
+ buf += '#extension ' + requirements[ndx].getSupportedExtension() + ' : require\n';
+
+ return buf;
+ };
+
+ /** @type {string} */ var extensions = generateExtensionStatements(requirements, shaderType);
+
+ if (extensions.length === 0)
+ return baseCode;
+
+ /** @type {Array<string>} */ var splitLines = baseCode.split('\n');
+ /** @type {boolean} */ var firstNonPreprocessorLine = true;
+ /** @type {string} */ var resultBuf = '';
+
+ for (var i = 0; i < splitLines.length; i++) {
+ /** @const @type {boolean} */ var isPreprocessorDirective = (splitLines[i].match(/^\s*#/) !== null);
+
+ if (!isPreprocessorDirective && firstNonPreprocessorLine) {
+ firstNonPreprocessorLine = false;
+ resultBuf += extensions;
+ }
+
+ resultBuf += splitLines[i] + '\n';
+ }
+
+ return resultBuf;
+};
+
+/** Specialize a shader for the vertex shader test case.
+ * @param {string} src
+ * @param { {values:Array}} valueBlock
+ * @return {string} withExt
+ */
+glsShaderLibraryCase.specializeVertexShader = function(src, valueBlock) {
+ /** @type {string} */ var decl = '';
+ /** @type {string} */ var setup = '';
+ /** @type {string} */ var output = '';
+ /** @type {Object} */ var state = tcuTestCase.runner;
+ /** @type {boolean} */ var usesInout = glsShaderLibraryCase.usesShaderInoutQualifiers(state.currentTest.spec.targetVersion);
+ /** @type {string} */ var vtxIn = usesInout ? 'in' : 'attribute';
+ /** @type {string} */ var vtxOut = usesInout ? 'out' : 'varying';
+
+ // Output (write out position).
+ output += 'gl_Position = dEQP_Position;\n';
+
+ // Declarations (position + attribute for each input, varying for each output).
+ decl += vtxIn + ' highp vec4 dEQP_Position;\n';
+ for (var ndx = 0; ndx < valueBlock.values.length; ndx++) {
+ /** @type {Array} */ var val = valueBlock.values[ndx];
+ /** @type {string} */ var valueName = val.valueName;
+ /** @type {string} */ var floatType = gluShaderUtil.getDataTypeFloatScalars(val.dataType);
+ /** @type {string} */ var dataTypeName = gluShaderUtil.getDataTypeName(val.dataType);
+
+ if (val.storageType === glsShaderLibraryCase.shaderCase.STORAGE_INPUT) {
+ if (gluShaderUtil.getDataTypeScalarType(val.dataType) === 'float') {
+ decl += vtxIn + ' ' + floatType + ' ' + valueName + ';\n';
+ } else {
+ decl += vtxIn + ' ' + floatType + ' a_' + valueName + ';\n';
+ setup += dataTypeName + ' ' + valueName + ' = ' + dataTypeName + '(a_' + valueName + ');\n';
+ }
+ } else if (val.storageType === glsShaderLibraryCase.shaderCase.STORAGE_OUTPUT) {
+ if (gluShaderUtil.getDataTypeScalarType(val.dataType) === 'float')
+ decl += vtxOut + ' ' + floatType + ' ' + valueName + ';\n';
+ else {
+ decl += vtxOut + ' ' + floatType + ' v_' + valueName + ';\n';
+ decl += dataTypeName + ' ' + valueName + ';\n';
+
+ output += 'v_' + valueName + ' = ' + floatType + '(' + valueName + ');\n';
+ }
+ }
+ }
+
+ /** @type {string} */
+ var baseSrc = src
+ .replace(/\$\{DECLARATIONS\}/g, decl)
+ .replace(/\$\{DECLARATIONS:single-line\}/g, decl.replace(/\n/g, ' '))
+ .replace(/\$\{SETUP\}/g, setup)
+ .replace(/\$\{OUTPUT\}/g, output)
+ .replace(/\$\{POSITION_FRAG_COLOR\}/g, 'gl_Position');
+
+ /** @type {string} */
+ var withExt = glsShaderLibraryCase.injectExtensionRequirements(baseSrc, gluShaderProgram.shaderType.VERTEX, state.currentTest.spec.requirements);
+
+ return withExt;
+};
+
+/** Specialize a shader only for the vertex test case.
+ * @param {string} src
+ * @param { {values:Array}} valueBlock
+ * @return {string} withExt
+ */
+glsShaderLibraryCase.specializeVertexOnly = function(src, valueBlock) {
+ /** @type {string} */ var decl = '';
+ /** @type {string} */ var setup = '';
+ /** @type {string} */ var output = '';
+ /** @type {Object} */ var state = tcuTestCase.runner;
+ /** @type {boolean} */ var usesInout = glsShaderLibraryCase.usesShaderInoutQualifiers(state.currentTest.spec.targetVersion);
+ /** @type {string} */ var vtxIn = usesInout ? 'in' : 'attribute';
+
+ // Output (write out position).
+ output += 'gl_Position = dEQP_Position;\n';
+
+ // Declarations (position + attribute for each input, varying for each output).
+ decl += vtxIn + ' highp vec4 dEQP_Position;\n';
+
+ for (var ndx = 0; ndx < valueBlock.values.length; ndx++) {
+ /** @type {Array} */ var val = valueBlock.values[ndx];
+ /** @type {string} */ var valueName = val.valueName;
+ /** @type {string} */ var type = gluShaderUtil.getDataTypeName(val.dataType);
+
+ if (val.storageType === glsShaderLibraryCase.shaderCase.STORAGE_INPUT) {
+ if (gluShaderUtil.getDataTypeScalarType(val.dataType) === 'float') {
+ decl += vtxIn + ' ' + type + ' ' + valueName + ';\n';
+ } else {
+ /** @type {string} */ var floatType = gluShaderUtil.getDataTypeFloatScalars(val.dataType);
+
+ decl += vtxIn + ' ' + floatType + ' a_' + valueName + ';\n';
+ setup += type + ' ' + valueName + ' = ' + type + '(a_' + valueName + ');\n';
+ }
+ } else if (val.storageType === glsShaderLibraryCase.shaderCase.STORAGE_UNIFORM &&
+ !val.valueName.match('\\.'))
+ decl += 'uniform ' + type + ' ' + valueName + ';\n';
+ }
+
+ /** @type {string} */
+ var baseSrc = src
+ .replace(/\$\{VERTEX_DECLARATIONS\}/g, decl)
+ .replace(/\$\{VERTEX_DECLARATIONS:single-line\}/g, decl.replace(/\n/g, ' '))
+ .replace(/\$\{VERTEX_SETUP\}/g, setup)
+ .replace(/\$\{VERTEX_OUTPUT\}/g, output);
+
+ /** @type {string} */
+ var withExt = glsShaderLibraryCase.injectExtensionRequirements(baseSrc, gluShaderProgram.shaderType.VERTEX, state.currentTest.spec.requirements);
+
+ return withExt;
+};
+
+/** Specialize a shader for the fragment shader test case.
+ * @param {string} src
+ * @param { {values:Array}} valueBlock
+ * @return {string} withExt
+ */
+glsShaderLibraryCase.specializeFragmentShader = function(src, valueBlock) {
+ /** @type {string} */ var decl = '';
+ /** @type {string} */ var setup = '';
+ /** @type {string} */ var output = '';
+
+ /** @type {Object} */ var state = tcuTestCase.runner;
+
+ /** @type {boolean} */ var usesInout = glsShaderLibraryCase.usesShaderInoutQualifiers(state.currentTest.spec.targetVersion);
+ /** @type {boolean} */ var customColorOut = usesInout;
+ /** @type {string} */ var fragIn = usesInout ? 'in' : 'varying';
+ /** @type {string} */ var fragColor = customColorOut ? 'dEQP_FragColor' : 'gl_FragColor';
+
+ decl += glsShaderLibraryCase.genCompareFunctions(valueBlock, false);
+ output += glsShaderLibraryCase.genCompareOp(fragColor, valueBlock, '', null);
+
+ if (customColorOut)
+ decl += 'layout(location = 0) out mediump vec4 dEQP_FragColor;\n';
+
+ for (var ndx = 0; ndx < valueBlock.values.length; ndx++) {
+ /** @type {Array} */ var val = valueBlock.values[ndx];
+ /** @type {string} */ var valueName = val.valueName;
+ /** @type {string} */ var floatType = gluShaderUtil.getDataTypeFloatScalars(val.dataType);
+ /** @type {string} */ var refType = gluShaderUtil.getDataTypeName(val.dataType);
+
+ if (val.storageType === glsShaderLibraryCase.shaderCase.STORAGE_INPUT) {
+ if (gluShaderUtil.getDataTypeScalarType(val.dataType) === 'float')
+ decl += fragIn + ' ' + floatType + ' ' + valueName + ';\n';
+ else {
+ decl += fragIn + ' ' + floatType + ' v_' + valueName + ';\n';
+ var offset = gluShaderUtil.isDataTypeIntOrIVec(val.dataType) ? ' * 1.0025' : ''; // \todo [petri] bit of a hack to avoid errors in chop() due to varying interpolation
+ setup += refType + ' ' + valueName + ' = ' + refType + '(v_' + valueName + offset + ');\n';
+ }
+ } else if (val.storageType === glsShaderLibraryCase.shaderCase.STORAGE_OUTPUT) {
+ decl += 'uniform ' + refType + ' ref_' + valueName + ';\n';
+ decl += refType + ' ' + valueName + ';\n';
+ }
+ }
+
+ /* \todo [2010-04-01 petri] Check all outputs. */
+
+ /** @type {string} */
+ var baseSrc = src
+ .replace(/\$\{DECLARATIONS\}/g, decl)
+ .replace(/\$\{DECLARATIONS:single-line\}/g, decl.replace(/\n/g, ' '))
+ .replace(/\$\{SETUP\}/g, setup)
+ .replace(/\$\{OUTPUT\}/g, output)
+ .replace(/\$\{POSITION_FRAG_COLOR\}/g, fragColor);
+
+ /** @type {string} */
+ var withExt = glsShaderLibraryCase.injectExtensionRequirements(baseSrc, gluShaderProgram.shaderType.FRAGMENT, state.currentTest.spec.requirements);
+
+ return withExt;
+};
+
+/** Specialize a shader only for the fragment test case.
+ * @param {string} src
+ * @param { {values:Array}} valueBlock
+ * @return {string} withExt
+ */
+glsShaderLibraryCase.specializeFragmentOnly = function(src, valueBlock) {
+ /** @type {string} */ var decl = '';
+ /** @type {string} */ var output = '';
+ /** @type {Object} */ var state = tcuTestCase.runner;
+ /** @type {boolean} */ var usesInout = glsShaderLibraryCase.usesShaderInoutQualifiers(state.currentTest.spec.targetVersion);
+ /** @type {boolean} */ var customColorOut = usesInout;
+ /** @type {string} */ var fragIn = usesInout ? 'in' : 'varying';
+ /** @type {string} */ var fragColor = customColorOut ? 'dEQP_FragColor' : 'gl_FragColor';
+
+ decl += glsShaderLibraryCase.genCompareFunctions(valueBlock, false);
+ output += glsShaderLibraryCase.genCompareOp(fragColor, valueBlock, '', null);
+
+ if (customColorOut)
+ decl += 'layout(location = 0) out mediump vec4 dEQP_FragColor;\n';
+
+ for (var ndx = 0; ndx < valueBlock.values.length; ndx++) {
+ /** @type {Array} */ var val = valueBlock.values[ndx];
+ /** @type {string} */ var valueName = val.valueName;
+ /** @type {string} */ var floatType = gluShaderUtil.getDataTypeFloatScalars(val.dataType);
+ /** @type {string} */ var refType = gluShaderUtil.getDataTypeName(val.dataType);
+
+ if (val.storageType === glsShaderLibraryCase.shaderCase.STORAGE_OUTPUT) {
+ decl += 'uniform ' + refType + ' ref_' + valueName + ';\n';
+ decl += refType + ' ' + valueName + ';\n';
+ } else if (val.storageType === glsShaderLibraryCase.shaderCase.STORAGE_UNIFORM &&
+ !valueName.match('\\.'))
+ decl += 'uniform ' + refType + ' ' + valueName + ';\n';
+ }
+
+ /** @type {string} */
+ var baseSrc = src
+ .replace(/\$\{FRAGMENT_DECLARATIONS\}/g, decl)
+ .replace(/\$\{FRAGMENT_DECLARATIONS:single-line\}/g, decl.replace(/\n/g, ' '))
+ .replace(/\$\{FRAGMENT_OUTPUT\}/g, output)
+ .replace(/\$\{FRAG_COLOR\}/g, fragColor);
+
+ /** @type {string} */
+ var withExt = glsShaderLibraryCase.injectExtensionRequirements(baseSrc, gluShaderProgram.shaderType.FRAGMENT, state.currentTest.spec.requirements);
+
+ return withExt;
+};
+
+/**
+ * Is tessellation present
+ * @return {boolean} True if tessellation is present
+ */
+glsShaderLibraryCase.isTessellationPresent = function() {
+ /* TODO: GLES 3.1: implement */
+ return false;
+};
+
+glsShaderLibraryCase.setUniformValue = function(gl, pipelinePrograms, name, val, arrayNdx) {
+ /** @type {boolean} */ var foundAnyMatch = false;
+
+ for (var programNdx = 0; programNdx < pipelinePrograms.length; ++programNdx) {
+ /** @const @type {WebGLUniformLocation} */ var loc = gl.getUniformLocation(pipelinePrograms[programNdx], name);
+ /** @const @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(val.dataType);
+ /** @const @type {number} */ var elemNdx = (val.arrayLength === 1) ? (0) : (arrayNdx * scalarSize);
+
+ if (!loc)
+ continue;
+
+ foundAnyMatch = true;
+
+ gl.useProgram(pipelinePrograms[programNdx]);
+
+ /** @type {Array} */ var element = val.elements.slice(elemNdx, elemNdx + scalarSize);
+ switch (val.dataType) {
+ case gluShaderUtil.DataType.FLOAT: gl.uniform1fv(loc, new Float32Array(element)); break;
+ case gluShaderUtil.DataType.FLOAT_VEC2: gl.uniform2fv(loc, new Float32Array(element)); break;
+ case gluShaderUtil.DataType.FLOAT_VEC3: gl.uniform3fv(loc, new Float32Array(element)); break;
+ case gluShaderUtil.DataType.FLOAT_VEC4: gl.uniform4fv(loc, new Float32Array(element)); break;
+ case gluShaderUtil.DataType.FLOAT_MAT2: gl.uniformMatrix2fv(loc, false, new Float32Array(element)); break;
+ case gluShaderUtil.DataType.FLOAT_MAT3: gl.uniformMatrix3fv(loc, false, new Float32Array(element)); break;
+ case gluShaderUtil.DataType.FLOAT_MAT4: gl.uniformMatrix4fv(loc, false, new Float32Array(element)); break;
+ case gluShaderUtil.DataType.INT: gl.uniform1iv(loc, new Int32Array(element)); break;
+ case gluShaderUtil.DataType.INT_VEC2: gl.uniform2iv(loc, new Int32Array(element)); break;
+ case gluShaderUtil.DataType.INT_VEC3: gl.uniform3iv(loc, new Int32Array(element)); break;
+ case gluShaderUtil.DataType.INT_VEC4: gl.uniform4iv(loc, new Int32Array(element)); break;
+
+ /** TODO: What type should be used for bool uniforms? */
+ case gluShaderUtil.DataType.BOOL: gl.uniform1iv(loc, new Int32Array(element)); break;
+ case gluShaderUtil.DataType.BOOL_VEC2: gl.uniform2iv(loc, new Int32Array(element)); break;
+ case gluShaderUtil.DataType.BOOL_VEC3: gl.uniform3iv(loc, new Int32Array(element)); break;
+ case gluShaderUtil.DataType.BOOL_VEC4: gl.uniform4iv(loc, new Int32Array(element)); break;
+
+ case gluShaderUtil.DataType.UINT: gl.uniform1uiv(loc, new Uint32Array(element)); break;
+ case gluShaderUtil.DataType.UINT_VEC2: gl.uniform2uiv(loc, new Uint32Array(element)); break;
+ case gluShaderUtil.DataType.UINT_VEC3: gl.uniform3uiv(loc, new Uint32Array(element)); break;
+ case gluShaderUtil.DataType.UINT_VEC4: gl.uniform4uiv(loc, new Uint32Array(element)); break;
+ case gluShaderUtil.DataType.FLOAT_MAT2X3: gl.uniformMatrix2x3fv(loc, false, new Float32Array(element)); break;
+ case gluShaderUtil.DataType.FLOAT_MAT2X4: gl.uniformMatrix2x4fv(loc, false, new Float32Array(element)); break;
+ case gluShaderUtil.DataType.FLOAT_MAT3X2: gl.uniformMatrix3x2fv(loc, false, new Float32Array(element)); break;
+ case gluShaderUtil.DataType.FLOAT_MAT3X4: gl.uniformMatrix3x4fv(loc, false, new Float32Array(element)); break;
+ case gluShaderUtil.DataType.FLOAT_MAT4X2: gl.uniformMatrix4x2fv(loc, false, new Float32Array(element)); break;
+ case gluShaderUtil.DataType.FLOAT_MAT4X3: gl.uniformMatrix4x3fv(loc, false, new Float32Array(element)); break;
+
+ default:
+ testFailed('Unknown data type ' + val.dataType);
+ }
+ }
+
+ if (!foundAnyMatch)
+ bufferedLogToConsole('WARNING // Uniform \"' + name + '\" location is not valid, location = -1. Cannot set value to the uniform.');
+};
+
+/**
+ * Evaluates pixels, if they are white, black or there is any unexpected result
+ * @param {gluDrawUtil.Surface} surface
+ * @param {number} minX
+ * @param {number} maxX
+ * @param {number} minY
+ * @param {number} maxY
+ * @return {boolean} True if tessellation is present
+ */
+glsShaderLibraryCase.checkPixels = function(surface, minX, maxX, minY, maxY) {
+ /** @type {boolean} */ var allWhite = true;
+ /** @type {boolean} */ var allBlack = true;
+ /** @type {boolean} */ var anyUnexpected = false;
+
+ assertMsgOptions((maxX > minX) && (maxY > minY), 'glsShaderLibraryCase.checkPixels sanity check', false, true);
+
+ for (var y = minY; y <= maxY; y++) {
+ for (var x = minX; x <= maxX; x++) {
+ /** @type {number} */ var pixel = surface.getPixelUintRGB8(x, y);
+ /** @type {boolean} */ var isWhite = (pixel == 0xFFFFFF);
+ /** @type {boolean} */ var isBlack = (pixel == 0x000000);
+
+ allWhite = allWhite && isWhite;
+ allBlack = allBlack && isBlack;
+ anyUnexpected = anyUnexpected || (!isWhite && !isBlack);
+
+ // Early terminate as soon as we know the check hasn't passed
+ if (!allWhite && !allBlack)
+ break;
+ }
+ }
+
+ if (!allWhite) {
+ if (anyUnexpected)
+ testFailed('WARNING: expecting all rendered pixels to be white or black, but got other colors as well!');
+ else if (!allBlack)
+ testFailed('WARNING: got inconsistent results over the image, when all pixels should be the same color!');
+
+ return false;
+ }
+ return true;
+};
+
+/**
+ * Initialize a test case
+ */
+glsShaderLibraryCase.init = function() {
+/** @type {Object} */ var state = tcuTestCase.runner;
+/** @type {Object} */ var test = state.currentTest;
+
+ bufferedLogToConsole('Processing ' + test.fullName());
+
+ if (!test.spec.valueBlockList.length)
+ test.spec.valueBlockList.push(glsShaderLibraryCase.genValueBlock());
+ /** @type { {values:Array}} */ var valueBlock = test.spec.valueBlockList[0];
+
+ if (test.spec.requirements)
+ for (var ndx = 0; ndx < test.spec.requirements.length; ++ndx)
+ test.spec.requirements[ndx].checkRequirements();
+
+ /** @type {Array<gluShaderProgram.ShaderInfo>} */ var sources = [];
+
+ if (test.spec.caseType === glsShaderLibraryCase.caseType.CASETYPE_COMPLETE) {
+ /** @type {string} */ var vertex = glsShaderLibraryCase.specializeVertexOnly(test.spec.vertexSource, valueBlock);
+ /** @type {string} */ var fragment = glsShaderLibraryCase.specializeFragmentOnly(test.spec.fragmentSource, valueBlock);
+ sources.push(gluShaderProgram.genVertexSource(vertex));
+ sources.push(gluShaderProgram.genFragmentSource(fragment));
+ } else if (test.spec.caseType === glsShaderLibraryCase.caseType.CASETYPE_VERTEX_ONLY) {
+ sources.push(gluShaderProgram.genVertexSource(glsShaderLibraryCase.specializeVertexShader(test.spec.vertexSource, valueBlock)));
+ sources.push(gluShaderProgram.genFragmentSource(glsShaderLibraryCase.genFragmentShader(valueBlock)));
+ } else if (test.spec.caseType === glsShaderLibraryCase.caseType.CASETYPE_FRAGMENT_ONLY) {
+ sources.push(gluShaderProgram.genVertexSource(glsShaderLibraryCase.genVertexShader(valueBlock)));
+ sources.push(gluShaderProgram.genFragmentSource(glsShaderLibraryCase.specializeFragmentShader(test.spec.fragmentSource, valueBlock)));
+ }
+
+ test.programs = [];
+ test.programs.push({
+ programSources: {
+ sources: sources
+ }
+ }
+ );
+
+};
+
+/**
+ * Execute a test case
+ * @return {boolean} True if test case passed
+ */
+glsShaderLibraryCase.execute = function() {
+ /** @const @type {number} */ var quadSize = 1.0;
+ /** @const @type {Array<number>} */
+ var s_positions = [
+ -quadSize, -quadSize, 0.0, 1.0,
+ -quadSize, +quadSize, 0.0, 1.0,
+ +quadSize, -quadSize, 0.0, 1.0,
+ +quadSize, +quadSize, 0.0, 1.0
+ ];
+
+ /** @const @type {Array<number>} */
+ var s_indices = [
+ 0, 1, 2,
+ 1, 3, 2
+ ];
+
+ var wtu = WebGLTestUtils;
+ /** @type {WebGL2RenderingContext} */ var gl = wtu.create3DContext('canvas');
+ /** @type {Object} */ var state = tcuTestCase.runner;
+ /** @type {Object} */ var test = state.currentTest;
+ /** @type {Object} */ var spec = test.spec;
+
+ // Compute viewport.
+ /* TODO: original code used random number generator to compute viewport, we use whole canvas */
+ /** @const @type {number} */ var width = Math.min(canvas.width, glsShaderLibraryCase.VIEWPORT_WIDTH);
+ /** @const @type {number} */ var height = Math.min(canvas.height, glsShaderLibraryCase.VIEWPORT_HEIGHT);
+ /** @const @type {number} */ var viewportX = 0;
+ /** @const @type {number} */ var viewportY = 0;
+ /** @const @type {number} */ var numVerticesPerDraw = 4;
+ /** @const @type {boolean} */ var tessellationPresent = glsShaderLibraryCase.isTessellationPresent();
+
+ /** @type {boolean} */ var allCompilesOk = true;
+ /** @type {boolean} */ var allLinksOk = true;
+ /** @type {?string} */ var failReason = null;
+
+ /** @type {number} */ var vertexProgramID = -1;
+ /** @type {Array<WebGLProgram>} */ var pipelineProgramIDs = [];
+ /** @type {Array<gluShaderProgram.ShaderProgram>} */ var programs = [];
+ var programPipeline;
+
+ // Set the name of the current test so testFailedOptions/testPassedOptions can use it.
+ setCurrentTestName(test.fullName());
+ debug('Start testcase: ' + test.fullName());
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'Start testcase: ' + test.fullName(), false, true);
+
+ /** @type {gluShaderProgram.ShaderProgram} */ var program = new gluShaderProgram.ShaderProgram(gl, test.programs[0].programSources);
+
+ vertexProgramID = program.getProgram();
+ pipelineProgramIDs.push(program.getProgram());
+ programs.push(program);
+
+ // Check that compile/link results are what we expect.
+
+ for (var i = 0; i < program.shaders.length; i++) {
+ if (!program.shaders[i].info.compileOk)
+ allCompilesOk = false;
+ }
+
+ if (!program.getProgramInfo().linkOk)
+ allLinksOk = false;
+
+ switch (spec.expectResult) {
+ case glsShaderLibraryCase.expectResult.EXPECT_PASS:
+ case glsShaderLibraryCase.expectResult.EXPECT_VALIDATION_FAIL:
+ case glsShaderLibraryCase.expectResult.EXPECT_BUILD_SUCCESSFUL:
+ if (!allCompilesOk)
+ failReason = 'expected shaders to compile and link properly, but failed to compile.';
+ else if (!allLinksOk)
+ failReason = 'expected shaders to compile and link properly, but failed to link.';
+ break;
+
+ case glsShaderLibraryCase.expectResult.EXPECT_COMPILE_FAIL:
+ if (allCompilesOk && !allLinksOk)
+ failReason = 'expected compilation to fail, but shaders compiled and link failed.';
+ else if (allCompilesOk)
+ failReason = 'expected compilation to fail, but shaders compiled correctly.';
+ break;
+
+ case glsShaderLibraryCase.expectResult.EXPECT_LINK_FAIL:
+ if (!allCompilesOk)
+ failReason = 'expected linking to fail, but unable to compile.';
+ else if (allLinksOk)
+ failReason = 'expected linking to fail, but passed.';
+ break;
+
+ case glsShaderLibraryCase.expectResult.EXPECT_COMPILE_LINK_FAIL:
+ if (allCompilesOk && allLinksOk)
+ failReason = 'expected compile or link to fail, but passed.';
+ break;
+
+ default:
+ testFailedOptions('Unknown expected result', true);
+ return false;
+ }
+
+ if (failReason != null) {
+ // \todo [2010-06-07 petri] These should be handled in the test case?
+
+ // If implementation parses shader at link time, report it as quality warning.
+ if (spec.expectResult === glsShaderLibraryCase.expectResult.EXPECT_COMPILE_FAIL && allCompilesOk && !allLinksOk)
+ bufferedLogToConsole('Quality warning: implementation parses shader at link time: ' + failReason);
+ else {
+ bufferedLogToConsole('ERROR: ' + failReason);
+ testFailedOptions(failReason, true);
+ }
+ return false;
+ }
+
+ // Return if compile/link expected to fail.
+ if (spec.expectResult === glsShaderLibraryCase.expectResult.EXPECT_COMPILE_FAIL ||
+ spec.expectResult === glsShaderLibraryCase.expectResult.EXPECT_COMPILE_LINK_FAIL ||
+ spec.expectResult === glsShaderLibraryCase.expectResult.EXPECT_LINK_FAIL ||
+ spec.expectResult === glsShaderLibraryCase.expectResult.EXPECT_BUILD_SUCCESSFUL) {
+ if (spec.expectResult === glsShaderLibraryCase.expectResult.EXPECT_BUILD_SUCCESSFUL) {
+ testPassedOptions('Compile/link is expected to succeed', true);
+ } else {
+ testPassedOptions('Compile/link is expected to fail', true);
+ }
+ setCurrentTestName('');
+ return (failReason === null);
+ }
+
+ // Setup viewport.
+ gl.viewport(viewportX, viewportY, width, height);
+
+ // Start using program
+ gl.useProgram(vertexProgramID);
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'glUseProgram()', false, true);
+
+ // Fetch location for positions positions.
+ /** @type {number} */ var positionLoc = gl.getAttribLocation(vertexProgramID, 'dEQP_Position');
+ if (positionLoc === -1) {
+ testFailedOptions("no location found for attribute 'dEQP_Position'", true);
+ return false;
+ }
+
+ // Iterate all value blocks.
+ for (var blockNdx = 0; blockNdx < spec.valueBlockList.length; blockNdx++) {
+ /** @type { {values:Array}} */ var block = spec.valueBlockList[blockNdx];
+
+ // always render at least one pass even if there is no input/output data
+ /** @const @type {number} */ var numRenderPasses = Math.max(block.arrayLength, 1);
+
+ // Iterate all array sub-cases.
+ for (var arrayNdx = 0; arrayNdx < numRenderPasses; arrayNdx++) {
+ /** @const @type {number} */ var numValues = block.values.length;
+ /** @type {Array<gluDrawUtil.VertexArrayBinding>} */ var vertexArrays = [];
+ /** @type {number} */ var attribValueNdx = 0;
+ /** @type {number} */ var postDrawError;
+
+ vertexArrays.push(new gluDrawUtil.VertexArrayBinding(gl.FLOAT, positionLoc, 4, numVerticesPerDraw, s_positions));
+
+ // Collect VA pointer for inputs
+ for (var valNdx = 0; valNdx < numValues; valNdx++) {
+ var val = block.values[valNdx];
+ /** @const @type {string} */ var valueName = val.valueName;
+ /** @const @type {gluShaderUtil.DataType} */ var dataType = val.dataType;
+ /** @const @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(val.dataType);
+
+ if (val.storageType === glsShaderLibraryCase.shaderCase.STORAGE_INPUT) {
+ // Replicate values four times.
+ /** @type {Array} */ var scalars = [];
+
+ for (var repNdx = 0; repNdx < numVerticesPerDraw; repNdx++)
+ for (var ndx = 0; ndx < scalarSize; ndx++)
+ scalars[repNdx * scalarSize + ndx] = val.elements[arrayNdx * scalarSize + ndx];
+
+ // Attribute name prefix.
+ /** @type {string} */ var attribPrefix = '';
+ // \todo [2010-05-27 petri] Should latter condition only apply for vertex cases (or actually non-fragment cases)?
+ if ((spec.caseType === glsShaderLibraryCase.caseType.CASETYPE_FRAGMENT_ONLY) || (gluShaderUtil.getDataTypeScalarType(dataType) !== 'float'))
+ attribPrefix = 'a_';
+
+ // Input always given as attribute.
+ /** @type {string} */ var attribName = attribPrefix + valueName;
+ /** @type {number} */ var attribLoc = gl.getAttribLocation(vertexProgramID, attribName);
+ if (attribLoc === -1) {
+ bufferedLogToConsole("Warning: no location found for attribute '" + attribName + "'");
+ continue;
+ }
+
+ if (gluShaderUtil.isDataTypeMatrix(dataType)) {
+ var numCols = gluShaderUtil.getDataTypeMatrixNumColumns(dataType);
+ var numRows = gluShaderUtil.getDataTypeMatrixNumRows(dataType);
+
+ assertMsgOptions(scalarSize === numCols * numRows, 'Matrix size sanity check', false, true);
+
+ for (var i = 0; i < numCols; i++)
+ vertexArrays.push(new gluDrawUtil.VertexArrayBinding(gl.FLOAT, attribLoc + i, numRows, numVerticesPerDraw, scalars, scalarSize * 4, i * numRows * 4));
+ } else
+ vertexArrays.push(new gluDrawUtil.VertexArrayBinding(gl.FLOAT, attribLoc, scalarSize, numVerticesPerDraw, scalars));
+
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'set vertex attrib array', false, true);
+ }
+ }
+
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'before set uniforms', false, true);
+
+ // set uniform values for outputs (refs).
+ for (var valNdx = 0; valNdx < numValues; valNdx++) {
+ /** @type {Array} */ var val1 = block.values[valNdx];
+ /** @type {string} */ var valueName1 = val1.valueName;
+
+ if (val1.storageType === glsShaderLibraryCase.shaderCase.STORAGE_OUTPUT) {
+ // Set reference value.
+ glsShaderLibraryCase.setUniformValue(gl, pipelineProgramIDs, 'ref_' + valueName1, val1, arrayNdx);
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'set reference uniforms', false, true);
+ } else if (val1.storageType === glsShaderLibraryCase.shaderCase.STORAGE_UNIFORM) {
+ glsShaderLibraryCase.setUniformValue(gl, pipelineProgramIDs, valueName1, val1, arrayNdx);
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'set uniforms', false, true);
+ }
+ }
+
+ // Clear.
+ gl.clearColor(0.125, 0.25, 0.5, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'clear buffer', false, true);
+
+ // Use program or pipeline
+ if (spec.separatePrograms)
+ gl.useProgram(null);
+ else
+ gl.useProgram(vertexProgramID);
+
+ // Draw.
+ // if (tessellationPresent) {
+ // gl.patchParameteri(gl.PATCH_VERTICES, 3);
+ // assertMsgOptions(gl.getError() === gl.NO_ERROR, 'set patchParameteri(PATCH_VERTICES, 3)', false, true);
+ // }
+
+ gluDrawUtil.draw(gl, vertexProgramID, vertexArrays, gluDrawUtil.triangles(s_indices));
+
+ postDrawError = gl.getError();
+
+ if (spec.expectResult === glsShaderLibraryCase.expectResult.EXPECT_PASS) {
+ /** @type {gluDrawUtil.Surface} */ var surface = new gluDrawUtil.Surface();
+ /** @const @type {number} */ var w = s_positions[3];
+ /** @const @type {number} */ var minY = Math.ceil(((-quadSize / w) * 0.5 + 0.5) * height + 1.0);
+ /** @const @type {number} */ var maxY = Math.floor(((+quadSize / w) * 0.5 + 0.5) * height - 0.5);
+ /** @const @type {number} */ var minX = Math.ceil(((-quadSize / w) * 0.5 + 0.5) * width + 1.0);
+ /** @const @type {number} */ var maxX = Math.floor(((+quadSize / w) * 0.5 + 0.5) * width - 0.5);
+
+ assertMsgOptions(postDrawError === gl.NO_ERROR, 'draw', false, true);
+
+ surface.readSurface(gl, viewportX, viewportY, width, height);
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, 'read pixels', false, true);
+
+ if (!glsShaderLibraryCase.checkPixels(surface, minX, maxX, minY, maxY)) {
+ testFailedOptions((
+ 'INCORRECT RESULT for (value block ' + (blockNdx + 1) +
+ ' of ' + spec.valueBlockList.length + ', sub-case ' +
+ (arrayNdx + 1) + ' of ' + block.arrayLength + '):'
+ ), true);
+
+ /* TODO: Port */
+ /*
+ log << TestLog::Message << "Failing shader input/output values:" << TestLog::EndMessage;
+ dumpValues(block, arrayNdx);
+
+ // Dump image on failure.
+ log << TestLog::Image("Result", "Rendered result image", surface);
+
+ */
+ gl.useProgram(null);
+
+ return false;
+ }
+ } else if (spec.expectResult === glsShaderLibraryCase.expectResult.EXPECT_VALIDATION_FAIL) {
+ /** TODO: GLES 3.1: Implement */
+ testFailedOptions('Unsupported test case', true);
+ }
+ }
+ }
+ gl.useProgram(null);
+
+ assertMsgOptions(gl.getError() === gl.NO_ERROR, '', true, true);
+ setCurrentTestName('');
+
+ return true;
+};
+
+glsShaderLibraryCase.runTestCases = function() {
+/** @type {Object} */ var state = tcuTestCase.runner;
+ if (state.next()) {
+ try {
+ glsShaderLibraryCase.init();
+ glsShaderLibraryCase.execute();
+ } catch (err) {
+ bufferedLogToConsole(err);
+ }
+ tcuTestCase.runner.runCallback(glsShaderLibraryCase.runTestCases);
+ } else
+ tcuTestCase.runner.terminate();
+
+};
+
+glsShaderLibraryCase.genValueBlock = function() {
+ return {
+ /** @type {Array} */ values: [],
+ /** @type {number} */ arrayLength: 0
+ };
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderRenderCase.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderRenderCase.js
new file mode 100644
index 0000000000..31f59de1f6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsShaderRenderCase.js
@@ -0,0 +1,1200 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('modules.shared.glsShaderRenderCase');
+goog.require('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuMatrix');
+goog.require('framework.common.tcuRGBA');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.opengl.gluDrawUtil');
+goog.require('framework.opengl.gluTexture');
+goog.require('framework.opengl.gluTextureUtil');
+goog.require('framework.opengl.gluShaderProgram');
+
+goog.scope(function() {
+ var glsShaderRenderCase = modules.shared.glsShaderRenderCase;
+
+ var deMath = framework.delibs.debase.deMath;
+ var deString = framework.delibs.debase.deString;
+ var deRandom = framework.delibs.debase.deRandom;
+ var gluTextureUtil = framework.opengl.gluTextureUtil;
+ var gluTexture = framework.opengl.gluTexture;
+ var gluDrawUtil = framework.opengl.gluDrawUtil;
+ var tcuImageCompare = framework.common.tcuImageCompare;
+ var tcuTexture = framework.common.tcuTexture;
+ var tcuMatrix = framework.common.tcuMatrix;
+ var tcuRGBA = framework.common.tcuRGBA;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var tcuSurface = framework.common.tcuSurface;
+ var gluShaderProgram = framework.opengl.gluShaderProgram;
+
+ /** @typedef {function(glsShaderRenderCase.ShaderEvalContext)} */ glsShaderRenderCase.ShaderEvalFunc;
+
+ /** @const {number} */ glsShaderRenderCase.GRID_SIZE = 64;
+ /** @const {number} */ glsShaderRenderCase.MAX_RENDER_WIDTH = 128;
+ /** @const {number} */ glsShaderRenderCase.MAX_RENDER_HEIGHT = 112;
+ /** @const {Array<number>} */ glsShaderRenderCase.DEFAULT_CLEAR_COLOR = [0.125, 0.25, 0.5, 1.0];
+ /** @const {number} */ glsShaderRenderCase.MAX_USER_ATTRIBS = 4;
+ /** @const {number} */ glsShaderRenderCase.MAX_TEXTURES = 4;
+
+ /**
+ * @param {Array<number>} a
+ * @return {tcuRGBA.RGBA}
+ */
+ glsShaderRenderCase.toRGBA = function(a) {
+ return tcuRGBA.newRGBAComponents(
+ deMath.clamp(Math.round(a[0] * 255.0), 0, 255),
+ deMath.clamp(Math.round(a[1] * 255.0), 0, 255),
+ deMath.clamp(Math.round(a[2] * 255.0), 0, 255),
+ deMath.clamp(Math.round(a[3] * 255.0), 0, 255));
+ };
+
+ /**
+ * Helper function
+ * @param {?(gluTexture.Texture2D|gluTexture.TextureCube|gluTexture.Texture2DArray|gluTexture.Texture3D)} tex
+ * @return {gluTexture.Type}
+ */
+ glsShaderRenderCase.getTextureType = function(tex) {
+ if (tex === null || tex.getType() <= 0)
+ return gluTexture.Type.TYPE_NONE;
+ else
+ return tex.getType();
+ };
+
+ /**
+ * @constructor
+ * @param {number=} indent
+ */
+ glsShaderRenderCase.LineStream = function(indent) {
+ indent = indent === undefined ? 0 : indent;
+ /** @type {number} */ this.m_indent = indent;
+ /** @type {string} */ this.m_stream;
+ /** @type {string} */ this.m_string;
+ };
+
+ /**
+ * @return {string}
+ */
+ glsShaderRenderCase.LineStream.prototype.str = function() {
+ this.m_string = this.m_stream;
+ return this.m_string;
+ };
+
+ /**
+ * @constructor
+ * @param {(gluTexture.Texture2D|gluTexture.TextureCube|gluTexture.Texture2DArray|gluTexture.Texture3D)=} tex
+ * @param {tcuTexture.Sampler=} sampler
+ */
+ glsShaderRenderCase.TextureBinding = function(tex, sampler) {
+ tex = tex === undefined ? null : tex;
+ sampler = sampler === undefined ? null : sampler;
+ /** @type {gluTexture.Type} */ this.m_type = glsShaderRenderCase.getTextureType(tex);
+ /** @type {tcuTexture.Sampler} */ this.m_sampler = sampler;
+ /** @type {(gluTexture.Texture2D|gluTexture.TextureCube|gluTexture.Texture2DArray|gluTexture.Texture3D)} */
+ this.m_binding = tex;
+ };
+
+ /**
+ * @param {tcuTexture.Sampler} sampler
+ */
+ glsShaderRenderCase.TextureBinding.prototype.setSampler = function(sampler) {
+ this.m_sampler = sampler;
+ };
+
+ /**
+ * @param {(gluTexture.Texture2D|gluTexture.TextureCube|gluTexture.Texture2DArray|gluTexture.Texture3D)} tex
+ */
+ glsShaderRenderCase.TextureBinding.prototype.setTexture = function(tex) {
+ this.m_type = glsShaderRenderCase.getTextureType(tex);
+ this.m_binding = tex;
+ };
+
+ /** @return {gluTexture.Type} */
+ glsShaderRenderCase.TextureBinding.prototype.getType = function() {
+ return this.m_type;
+ };
+
+ /** @return {tcuTexture.Sampler} */
+ glsShaderRenderCase.TextureBinding.prototype.getSampler = function() {
+ return this.m_sampler;
+ };
+
+ /** @return {(gluTexture.Texture2D|gluTexture.TextureCube|gluTexture.Texture2DArray|gluTexture.Texture3D)} */
+ glsShaderRenderCase.TextureBinding.prototype.getBinding = function() {
+ return this.m_binding;
+ };
+
+ /**
+ * @constructor
+ * @param {number} gridSize
+ * @param {number} width
+ * @param {number} height
+ * @param {Array<number>} constCoords
+ * @param {Array<tcuMatrix.Matrix>} userAttribTransforms
+ * @param {Array<glsShaderRenderCase.TextureBinding>} textures
+ */
+ glsShaderRenderCase.QuadGrid = function(gridSize, width, height, constCoords, userAttribTransforms, textures) {
+ /** @type {number} */ this.m_gridSize = gridSize;
+ /** @type {number} */ this.m_numVertices = (gridSize + 1) * (gridSize + 1);
+ /** @type {number} */ this.m_numTriangles = (gridSize * gridSize *2);
+ /** @type {Array<number>} */ this.m_constCoords = constCoords;
+ /** @type {Array<tcuMatrix.Matrix>} */ this.m_userAttribTransforms = userAttribTransforms;
+ /** @type {Array<glsShaderRenderCase.TextureBinding>} */ this.m_textures = textures;
+ /** @type {Array<Array<number>>} */ this.m_screenPos = [];
+ /** @type {Array<Array<number>>} */ this.m_positions = [];
+ /** @type {Array<Array<number>>} */ this.m_coords = []; //!< Near-unit coordinates, roughly [-2.0 .. 2.0].
+ /** @type {Array<Array<number>>} */ this.m_unitCoords = []; //!< Positive-only coordinates [0.0 .. 1.5].
+ /** @type {Array<number>} */ this.m_attribOne = [];
+ /** @type {Array<Array<number>>} */ this.m_userAttribs = [];
+ for (var attribNdx = 0; attribNdx < this.getNumUserAttribs(); attribNdx++)
+ this.m_userAttribs[attribNdx] = [];
+ /** @type {Array<number>} */ this.m_indices = [];
+
+ /** @type Array<number>} */ var viewportScale = [width, height, 0, 0];
+ for (var y = 0; y < gridSize + 1; y++)
+ for (var x = 0; x < gridSize + 1; x++) {
+ /** @type {number} */ var sx = x / gridSize;
+ /** @type {number} */ var sy = y / gridSize;
+ /** @type {number} */ var fx = 2.0 * sx - 1.0;
+ /** @type {number} */ var fy = 2.0 * sy - 1.0;
+ /** @type {number} */ var vtxNdx = ((y * (gridSize + 1)) + x);
+
+ this.m_positions[vtxNdx] = [fx, fy, 0.0, 1.0];
+ this.m_attribOne[vtxNdx] = 1.0;
+ this.m_screenPos[vtxNdx] = deMath.multiply([sx, sy, 0.0, 1.0], viewportScale);
+ this.m_coords[vtxNdx] = this.getCoords(sx, sy);
+ this.m_unitCoords[vtxNdx] = this.getUnitCoords(sx, sy);
+
+ for (var attribNdx = 0; attribNdx < this.getNumUserAttribs(); attribNdx++)
+ this.m_userAttribs[attribNdx][vtxNdx] = this.getUserAttrib(attribNdx, sx, sy);
+ }
+
+ // Compute indices.
+ for (var y = 0; y < gridSize; y++)
+ for (var x = 0; x < gridSize; x++) {
+ /** @type {number} */ var stride = gridSize + 1;
+ /** @type {number} */ var v00 = (y * stride) + x;
+ /** @type {number} */ var v01 = (y * stride) + x + 1;
+ /** @type {number} */ var v10 = ((y + 1) * stride) + x;
+ /** @type {number} */ var v11 = ((y + 1) * stride) + x + 1;
+
+ /** @type {number} */ var baseNdx = ((y * gridSize) + x) * 6;
+ this.m_indices[baseNdx + 0] = v10;
+ this.m_indices[baseNdx + 1] = v00;
+ this.m_indices[baseNdx + 2] = v01;
+
+ this.m_indices[baseNdx + 3] = v10;
+ this.m_indices[baseNdx + 4] = v01;
+ this.m_indices[baseNdx + 5] = v11;
+ }
+ };
+
+ /** @return {number} */
+ glsShaderRenderCase.QuadGrid.prototype.getGridSize = function() {
+ return this.m_gridSize;
+ };
+
+ /** @return {number} */
+ glsShaderRenderCase.QuadGrid.prototype.getNumVertices = function() {
+ return this.m_numVertices;
+ };
+
+ /** @return {number} */
+ glsShaderRenderCase.QuadGrid.prototype.getNumTriangles = function() {
+ return this.m_numTriangles;
+ };
+
+ /** @return {Array<number>} */
+ glsShaderRenderCase.QuadGrid.prototype.getConstCoords = function() {
+ return this.m_constCoords;
+ };
+
+ /** @return {Array<tcuMatrix.Matrix>} */
+ glsShaderRenderCase.QuadGrid.prototype.getUserAttribTransforms = function() {
+ return this.m_userAttribTransforms;
+ };
+
+ /** @return {Array<glsShaderRenderCase.TextureBinding>} */
+ glsShaderRenderCase.QuadGrid.prototype.getTextures = function() {
+ return this.m_textures;
+ };
+
+ /** @return {Array<Array<number>>} */
+ glsShaderRenderCase.QuadGrid.prototype.getPositions = function() {
+ return this.m_positions;
+ };
+
+ /** @return {Array<number>} */
+ glsShaderRenderCase.QuadGrid.prototype.getAttribOne = function() {
+ return this.m_attribOne;
+ };
+
+ /** @return {Array<Array<number>>} */
+ glsShaderRenderCase.QuadGrid.prototype.getCoordsArray = function() {
+ return this.m_coords;
+ };
+
+ /** @return {Array<Array<number>>} */
+ glsShaderRenderCase.QuadGrid.prototype.getUnitCoordsArray = function() {
+ return this.m_unitCoords;
+ };
+
+ /**
+ * @param {number} attribNdx
+ * @return {Array<number>}
+ */
+ glsShaderRenderCase.QuadGrid.prototype.getUserAttribByIndex = function(attribNdx) {
+ return this.m_userAttribs[attribNdx];
+ };
+
+ /** @return {Array<number>} */
+ glsShaderRenderCase.QuadGrid.prototype.getIndices = function() {
+ return this.m_indices;
+ };
+
+ /**
+ * @param {number} sx
+ * @param {number} sy
+ * @return {Array<number>}
+ */
+ glsShaderRenderCase.QuadGrid.prototype.getCoords = function(sx, sy) {
+ /** @type {number} */ var fx = 2.0 * sx - 1.0;
+ /** @type {number} */ var fy = 2.0 * sy - 1.0;
+ return [fx, fy, -fx + 0.33 * fy, -0.275 * fx - fy];
+ };
+
+ /**
+ * @param {number} sx
+ * @param {number} sy
+ * @return {Array<number>}
+ */
+ glsShaderRenderCase.QuadGrid.prototype.getUnitCoords = function(sx, sy) {
+ return [sx, sy, 0.33 * sx + 0.5 * sy, 0.5 * sx + 0.25 * sy];
+ };
+
+ /**
+ * @return {number}
+ */
+ glsShaderRenderCase.QuadGrid.prototype.getNumUserAttribs = function() {
+ return this.m_userAttribTransforms.length;
+ };
+
+ /**
+ * @param {number} attribNdx
+ * @param {number} sx
+ * @param {number} sy
+ * @return {Array<number>}
+ */
+ glsShaderRenderCase.QuadGrid.prototype.getUserAttrib = function(attribNdx, sx, sy) {
+ // homogeneous normalized screen-space coordinates
+ return tcuMatrix.multiplyMatVec(this.m_userAttribTransforms[attribNdx], [sx, sy, 0.0, 1.0]);
+ };
+
+ /**
+ * @constructor
+ * @struct
+ */
+ glsShaderRenderCase.ShaderSampler = function() {
+ /** @type {tcuTexture.Sampler} */ this.sampler;
+ /** @type {tcuTexture.Texture2D} */ this.tex2D = null;
+ /** @type {tcuTexture.TextureCube} */ this.texCube = null;
+ /** @type {tcuTexture.Texture2DArray} */ this.tex2DArray = null;
+ /** @type {tcuTexture.Texture3D} */ this.tex3D = null;
+ };
+
+ /**
+ * @constructor
+ * @param {glsShaderRenderCase.QuadGrid} quadGrid_
+ */
+ glsShaderRenderCase.ShaderEvalContext = function(quadGrid_) {
+ /** @type {Array<number>} */ this.coords = [0, 0, 0, 0]
+ /** @type {Array<number>} */ this.unitCoords = [0, 0, 0, 0]
+ /** @type {Array<number>} */ this.constCoords = quadGrid_.getConstCoords();
+ /** @type {Array<Array<number>>} */ this.in_ = [];
+ /** @type {Array<glsShaderRenderCase.ShaderSampler>} */ this.textures = [];
+ /** @type {Array<number>} */ this.color = [0, 0, 0, 0.0];
+ /** @type {boolean} */ this.isDiscarded = false;
+ /** @type {glsShaderRenderCase.QuadGrid} */ this.quadGrid = quadGrid_;
+
+ /** @type {Array<glsShaderRenderCase.TextureBinding>} */ var bindings = this.quadGrid.getTextures();
+ assertMsgOptions(bindings.length <= glsShaderRenderCase.MAX_TEXTURES, 'Too many bindings.', false, true);
+
+ // Fill in texture array.
+ for (var ndx = 0; ndx < bindings.length; ndx++) {
+ /** @type {glsShaderRenderCase.TextureBinding} */ var binding = bindings[ndx];
+
+ this.textures[ndx] = new glsShaderRenderCase.ShaderSampler();
+
+ if (binding.getType() == gluTexture.Type.TYPE_NONE)
+ continue;
+
+ this.textures[ndx].sampler = binding.getSampler();
+
+ switch (binding.getType()) {
+ case gluTexture.Type.TYPE_2D:
+ this.textures[ndx].tex2D = binding.getBinding().getRefTexture();
+ break;
+ case gluTexture.Type.TYPE_CUBE_MAP:
+ this.textures[ndx].texCube = binding.getBinding().getRefTexture();
+ break;
+ case gluTexture.Type.TYPE_2D_ARRAY:
+ this.textures[ndx].tex2DArray = binding.getBinding().getRefTexture();
+ break;
+ case gluTexture.Type.TYPE_3D:
+ this.textures[ndx].tex3D = binding.getBinding().getRefTexture();
+ break;
+ default:
+ throw new Error("Binding type not supported");
+ }
+ }
+ };
+
+ /**
+ * @param {number} sx
+ * @param {number} sy
+ */
+ glsShaderRenderCase.ShaderEvalContext.prototype.reset = function(sx, sy) {
+ // Clear old values
+ this.color = [0.0, 0.0, 0.0, 1.0];
+ this.isDiscarded = false;
+
+ // Compute coords
+ this.coords = this.quadGrid.getCoords(sx, sy);
+ this.unitCoords = this.quadGrid.getUnitCoords(sx, sy);
+
+ // Compute user attributes.
+ /** @type {number} */ var numAttribs = this.quadGrid.getNumUserAttribs();
+ assertMsgOptions(numAttribs <= glsShaderRenderCase.MAX_USER_ATTRIBS, 'numAttribs out of range', false, true);
+ for (var attribNdx = 0; attribNdx < numAttribs; attribNdx++)
+ this.in_[attribNdx] = this.quadGrid.getUserAttrib(attribNdx, sx, sy);
+ };
+
+ glsShaderRenderCase.ShaderEvalContext.prototype.discard = function() {
+ this.isDiscarded = true;
+ };
+
+ /**
+ * @param {number} unitNdx
+ * @param {Array<number>} coords
+ */
+ glsShaderRenderCase.ShaderEvalContext.prototype.texture2D = function(unitNdx, coords) {
+ if (this.textures.length > 0 && this.textures[unitNdx].tex2D)
+ return this.textures[unitNdx].tex2D.getView().sample(this.textures[unitNdx].sampler, coords, 0.0);
+ else
+ return [0.0, 0.0, 0.0, 1.0];
+ };
+
+ /** @param {glsShaderRenderCase.ShaderEvalContext} c */
+ glsShaderRenderCase.evalCoordsPassthroughX = function(c) {
+ c.color[0] = c.coords[0];
+ };
+
+ /** @param {glsShaderRenderCase.ShaderEvalContext} c */
+ glsShaderRenderCase.evalCoordsPassthroughXY = function(c) {
+ var swizzle01 = deMath.swizzle(c.coords, [0, 1]);
+ c.color[0] = swizzle01[0];
+ c.color[1] = swizzle01[1];
+ };
+
+ /** @param {glsShaderRenderCase.ShaderEvalContext} c */
+ glsShaderRenderCase.evalCoordsPassthroughXYZ = function(c) {
+ var swizzle012 = deMath.swizzle(c.coords, [0, 1, 2]);
+ c.color[0] = swizzle012[0];
+ c.color[1] = swizzle012[1];
+ c.color[2] = swizzle012[2];
+ };
+
+ /** @param {glsShaderRenderCase.ShaderEvalContext} c */
+ glsShaderRenderCase.evalCoordsPassthrough = function(c) {
+ c.color = c.coords;
+ };
+
+ /** @param {glsShaderRenderCase.ShaderEvalContext} c */
+ glsShaderRenderCase.evalCoordsSwizzleWZYX = function(c) {
+ c.color = deMath.swizzle(c.coords, [3, 2, 1, 0]);
+ };
+
+ /**
+ * @constructor
+ * @param {?glsShaderRenderCase.ShaderEvalFunc=} evalFunc
+ */
+ glsShaderRenderCase.ShaderEvaluator = function(evalFunc) {
+ /** @type {?glsShaderRenderCase.ShaderEvalFunc} */ this.m_evalFunc = evalFunc || null;
+ };
+
+ /**
+ * @param {glsShaderRenderCase.ShaderEvalContext} ctx
+ */
+ glsShaderRenderCase.ShaderEvaluator.prototype.evaluate = function(ctx) {
+ assertMsgOptions(this.m_evalFunc !== null, 'No evaluation function specified.', false, true);
+ this.m_evalFunc(ctx);
+ };
+
+ /**
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} description
+ * @param {boolean} isVertexCase
+ * @param {glsShaderRenderCase.ShaderEvalFunc=} evalFunc
+ */
+ glsShaderRenderCase.ShaderRenderCase = function(name, description, isVertexCase, evalFunc) {
+ tcuTestCase.DeqpTest.call(this, name, description);
+ // evalFunc = evalFunc || null;
+ /** @type {boolean} */ this.m_isVertexCase = isVertexCase;
+ /** @type {?glsShaderRenderCase.ShaderEvalFunc} */ this.m_defaultEvaluator = evalFunc || null;
+ /** @type {glsShaderRenderCase.ShaderEvaluator} */ this.m_evaluator = new glsShaderRenderCase.ShaderEvaluator(this.m_defaultEvaluator);
+ /** @type {string} */ this.m_vertShaderSource = '';
+ /** @type {string} */ this.m_fragShaderSource = '';
+ /** @type {Array<number>} */ this.m_clearColor = glsShaderRenderCase.DEFAULT_CLEAR_COLOR;
+ /** @type {Array<tcuMatrix.Matrix>} */ this.m_userAttribTransforms = [];
+ /** @type {Array<glsShaderRenderCase.TextureBinding>} */ this.m_textures = [];
+ /** @type {?gluShaderProgram.ShaderProgram} */ this.m_program = null;
+ };
+
+ /**
+ * @param {string} name
+ * @param {string} description
+ * @param {boolean} isVertexCase
+ * @param {glsShaderRenderCase.ShaderEvaluator} evaluator
+ * @return {glsShaderRenderCase.ShaderRenderCase}
+ */
+ glsShaderRenderCase.ShaderRenderCase.newWithEvaluator = function(name, description, isVertexCase, evaluator) {
+ var renderCase = new glsShaderRenderCase.ShaderRenderCase(name, description, isVertexCase);
+ renderCase.m_evaluator = evaluator;
+ return renderCase;
+ };
+
+ glsShaderRenderCase.ShaderRenderCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ glsShaderRenderCase.ShaderRenderCase.prototype.constructor = glsShaderRenderCase.ShaderRenderCase;
+
+ glsShaderRenderCase.ShaderRenderCase.prototype.deinit = function() {
+ this.m_program = null;
+ };
+
+ glsShaderRenderCase.ShaderRenderCase.prototype.init = function() {
+ this.postinit();
+ };
+
+ glsShaderRenderCase.ShaderRenderCase.prototype.postinit = function() {
+ if (this.m_vertShaderSource.length === 0 || this.m_fragShaderSource.length === 0) {
+ assertMsgOptions(this.m_vertShaderSource.length === 0 && this.m_fragShaderSource.length === 0, 'No shader source.', false, true);
+ this.setupShaderData();
+ }
+
+ assertMsgOptions(!this.m_program, 'Program defined.', false, true);
+ this.m_program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(this.m_vertShaderSource, this.m_fragShaderSource));
+
+ try {
+ bufferedLogToConsole(this.m_program.program.info.infoLog); // Always log shader program.
+
+ if (!this.m_program.isOk())
+ throw new Error("Shader compile error.");
+ }
+ catch (exception) {
+ // Clean up.
+ this.deinit();
+ throw exception;
+ }
+ };
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ glsShaderRenderCase.ShaderRenderCase.prototype.postiterate = function() {
+ assertMsgOptions(this.m_program !== null, 'Program not specified.', false, true);
+ /** @type {?WebGLProgram} */ var programID = this.m_program.getProgram();
+ gl.useProgram(programID);
+
+ // Create quad grid.
+ /** @type {Array<number>} */ var viewportSize = this.getViewportSize();
+ /** @type {number} */ var width = viewportSize[0];
+ /** @type {number} */ var height = viewportSize[1];
+
+ // \todo [petri] Better handling of constCoords (render in multiple chunks, vary coords).
+ /** @type {glsShaderRenderCase.QuadGrid} */
+ var quadGrid = new glsShaderRenderCase.QuadGrid(
+ this.m_isVertexCase ? glsShaderRenderCase.GRID_SIZE : 4, width, height,
+ [0.125, 0.25, 0.5, 1.0], this.m_userAttribTransforms, this.m_textures);
+
+ // Render result.
+ /** @type {tcuSurface.Surface} */ var resImage = new tcuSurface.Surface(width, height);
+ this.render(resImage, programID, quadGrid);
+
+ // Compute reference.
+ /** @type {tcuSurface.Surface} */ var refImage = new tcuSurface.Surface(width, height);
+ if (this.m_isVertexCase)
+ this.computeVertexReference(refImage, quadGrid);
+ else
+ this.computeFragmentReference(refImage, quadGrid);
+
+ // Compare.
+ /** @type {boolean} */ var testOk = this.compareImages(resImage, refImage, 0.05);
+
+ // De-initialize.
+ gl.useProgram(null);
+
+ if (!testOk)
+ testFailedOptions("Fail", false);
+ else
+ testPassedOptions("Pass", true);
+
+ return tcuTestCase.IterateResult.STOP;
+ };
+
+ /**
+ * @return {tcuTestCase.IterateResult}
+ */
+ glsShaderRenderCase.ShaderRenderCase.prototype.iterate = function() {
+ return this.postiterate();
+ };
+
+ glsShaderRenderCase.ShaderRenderCase.prototype.setupShaderData = function() {};
+
+ /**
+ * @param {?WebGLProgram} programId
+ */
+ glsShaderRenderCase.ShaderRenderCase.prototype.setup = function(programId) {};
+
+ /**
+ * @param {?WebGLProgram} programId
+ * @param {Array<number>} constCoords
+ */
+ glsShaderRenderCase.ShaderRenderCase.prototype.setupUniforms = function(programId, constCoords) {};
+
+ /**
+ * @return {Array<number>}
+ */
+ glsShaderRenderCase.ShaderRenderCase.prototype.getViewportSize = function() {
+ return [Math.min(gl.canvas.width, glsShaderRenderCase.MAX_RENDER_WIDTH),
+ Math.min(gl.canvas.height, glsShaderRenderCase.MAX_RENDER_HEIGHT)];
+ };
+
+ /**
+ * @param {?WebGLProgram} programId
+ */
+ glsShaderRenderCase.ShaderRenderCase.prototype.setupDefaultInputs = function(programId) {
+ // SETUP UNIFORMS.
+ glsShaderRenderCase.setupDefaultUniforms(programId);
+
+ // SETUP TEXTURES.
+ for (var ndx = 0; ndx < this.m_textures.length; ndx++) {
+ /** @type {glsShaderRenderCase.TextureBinding} */ var tex = this.m_textures[ndx];
+ /** @type {tcuTexture.Sampler} */ var sampler = tex.getSampler();
+ /** @type {number} */ var texTarget = gl.NONE;
+ /** @type {number} */ var texObj = 0;
+
+ if (tex.getType() === gluTexture.Type.TYPE_NONE)
+ continue;
+
+ switch (tex.getType()) {
+ case gluTexture.Type.TYPE_2D:
+ texTarget = gl.TEXTURE_2D;
+ texObj = tex.getBinding().getGLTexture();
+ break;
+ case gluTexture.Type.TYPE_CUBE_MAP:
+ texTarget = gl.TEXTURE_CUBE_MAP;
+ texObj = tex.getBinding().getGLTexture();
+ break;
+ case gluTexture.Type.TYPE_2D_ARRAY:
+ texTarget = gl.TEXTURE_2D_ARRAY;
+ texObj = tex.getBinding().getGLTexture();
+ break;
+ case gluTexture.Type.TYPE_3D:
+ texTarget = gl.TEXTURE_3D;
+ texObj = tex.getBinding().getGLTexture();
+ break;
+ default:
+ throw new Error("Type not supported");
+ }
+
+ gl.activeTexture(gl.TEXTURE0+ ndx);
+ gl.bindTexture(texTarget, texObj);
+ gl.texParameteri(texTarget, gl.TEXTURE_WRAP_S, gluTextureUtil.getGLWrapMode(sampler.wrapS));
+ gl.texParameteri(texTarget, gl.TEXTURE_WRAP_T, gluTextureUtil.getGLWrapMode(sampler.wrapT));
+ gl.texParameteri(texTarget, gl.TEXTURE_MIN_FILTER, gluTextureUtil.getGLFilterMode(sampler.minFilter));
+ gl.texParameteri(texTarget, gl.TEXTURE_MAG_FILTER, gluTextureUtil.getGLFilterMode(sampler.magFilter));
+
+ if (texTarget === gl.TEXTURE_3D)
+ gl.texParameteri(texTarget, gl.TEXTURE_WRAP_R, gluTextureUtil.getGLWrapMode(sampler.wrapR));
+
+ if (sampler.compare != tcuTexture.CompareMode.COMPAREMODE_NONE)
+ {
+ gl.texParameteri(texTarget, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE);
+ gl.texParameteri(texTarget, gl.TEXTURE_COMPARE_FUNC, gluTextureUtil.getGLCompareFunc(sampler.compare));
+ }
+ }
+ };
+
+ /**
+ * @param {tcuSurface.Surface} result
+ * @param {?WebGLProgram} programId
+ * @param {glsShaderRenderCase.QuadGrid} quadGrid
+ **/
+ glsShaderRenderCase.ShaderRenderCase.prototype.render = function(result, programId, quadGrid) {
+ // Buffer info.
+ /** @type {number} */ var width = result.getWidth();
+ /** @type {number} */ var height = result.getHeight();
+
+ /** @type {number} */ var xOffsetMax = gl.drawingBufferWidth - width;
+ /** @type {number} */ var yOffsetMax = gl.drawingBufferHeight - height;
+
+ /** @type {number} */ var hash = deString.deStringHash(this.m_vertShaderSource) + deString.deStringHash(this.m_fragShaderSource);
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(hash);
+
+ /** @type {number} */ var xOffset = rnd.getInt(0, xOffsetMax);
+ /** @type {number} */ var yOffset = rnd.getInt(0, yOffsetMax);
+
+ gl.viewport(xOffset, yOffset, width, height);
+
+ // Setup program.
+ this.setupUniforms(programId, quadGrid.getConstCoords());
+ this.setupDefaultInputs(programId);
+
+ // Clear.
+ gl.clearColor(this.m_clearColor[0], this.m_clearColor[1], this.m_clearColor[2], this.m_clearColor[3]);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ // Draw.
+ /** @type {Array<gluDrawUtil.VertexArrayBinding>} */ var vertexArrays = [];
+ /** @type {number} */ var numElements = quadGrid.getNumTriangles()*3;
+
+ glsShaderRenderCase.getDefaultVertexArrays(quadGrid, programId, vertexArrays);
+
+ gluDrawUtil.draw(gl, programId, vertexArrays, gluDrawUtil.triangles(quadGrid.getIndices()));
+
+ // Read back results.
+ result.readViewport(gl, [xOffset, yOffset, width, height]);
+
+ };
+
+ /**
+ * @param {tcuSurface.Surface} result
+ * @param {glsShaderRenderCase.QuadGrid} quadGrid
+ **/
+ glsShaderRenderCase.ShaderRenderCase.prototype.computeVertexReference = function(result, quadGrid) {
+ // Buffer info.
+ /** @type {number} */ var width = result.getWidth();
+ /** @type {number} */ var height = result.getHeight();
+ /** @type {number} */ var gridSize = quadGrid.getGridSize();
+ /** @type {number} */ var stride = gridSize + 1;
+ /** @type {boolean} */ var hasAlpha = gl.getContextAttributes().alpha;
+ /** @type {glsShaderRenderCase.ShaderEvalContext} */
+ var evalCtx = new glsShaderRenderCase.ShaderEvalContext(quadGrid);
+ /** @type {Array<number>} */ var color = [];
+ // Evaluate color for each vertex.
+ /** @type {Array<Array<number>>} */ var colors = [];
+ for (var y = 0; y < gridSize + 1; y++)
+ for (var x = 0; x < gridSize + 1; x++) {
+ /** @type {number} */ var sx = x / gridSize;
+ /** @type {number} */ var sy = y / gridSize;
+ /** @type {number} */ var vtxNdx = ((y * (gridSize+ 1 )) + x);
+
+ evalCtx.reset(sx, sy);
+ this.m_evaluator.evaluate(evalCtx);
+ assertMsgOptions(!evalCtx.isDiscarded, 'Discard is not available in vertex shader.', false, true);
+ color = evalCtx.color;
+
+ if (!hasAlpha)
+ color[3] = 1.0;
+
+ colors[vtxNdx] = color;
+ }
+ // Render quads.
+ for (var y = 0; y < gridSize; y++)
+ for (var x = 0; x < gridSize; x++) {
+ /** @type {number} */ var x0 = x / gridSize;
+ /** @type {number} */ var x1 = (x + 1) / gridSize;
+ /** @type {number} */ var y0 = y / gridSize;
+ /** @type {number} */ var y1 = (y + 1) / gridSize;
+
+ /** @type {number} */ var sx0 = x0 * width;
+ /** @type {number} */ var sx1 = x1 * width;
+ /** @type {number} */ var sy0 = y0 * height;
+ /** @type {number} */ var sy1 = y1 * height;
+ /** @type {number} */ var oosx = 1.0 / (sx1 - sx0);
+ /** @type {number} */ var oosy = 1.0 / (sy1 - sy0);
+
+ /** @type {number} */ var ix0 = Math.ceil(sx0 - 0.5);
+ /** @type {number} */ var ix1 = Math.ceil(sx1 - 0.5);
+ /** @type {number} */ var iy0 = Math.ceil(sy0 - 0.5);
+ /** @type {number} */ var iy1 = Math.ceil(sy1 - 0.5);
+
+ /** @type {number} */ var v00 = (y * stride) + x;
+ /** @type {number} */ var v01 = (y * stride) + x + 1;
+ /** @type {number} */ var v10 = ((y + 1) * stride) + x;
+ /** @type {number} */ var v11 = ((y + 1) * stride) + x + 1;
+ /** @type {Array<number>} */ var c00 = colors[v00];
+ /** @type {Array<number>} */ var c01 = colors[v01];
+ /** @type {Array<number>} */ var c10 = colors[v10];
+ /** @type {Array<number>} */ var c11 = colors[v11];
+
+ for (var iy = iy0; iy < iy1; iy++)
+ for (var ix = ix0; ix < ix1; ix++) {
+ assertMsgOptions(deMath.deInBounds32(ix, 0, width), 'Out of bounds.', false, true);
+ assertMsgOptions(deMath.deInBounds32(iy, 0, height), 'Out of bounds.', false, true);
+
+ /** @type {number} */ var sfx = ix + 0.5;
+ /** @type {number} */ var sfy = iy + 0.5;
+ /** @type {number} */ var fx1 = deMath.clamp((sfx - sx0) * oosx, 0.0, 1.0);
+ /** @type {number} */ var fy1 = deMath.clamp((sfy - sy0) * oosy, 0.0, 1.0);
+
+ // Triangle quad interpolation.
+ /** @type {boolean} */ var tri = fx1 + fy1 <= 1.0;
+ /** @type {number} */ var tx = tri ? fx1 : (1.0 - fx1);
+ /** @type {number} */ var ty = tri ? fy1 : (1.0 - fy1);
+ /** @type {Array<number>} */ var t0 = tri ? c00 : c11;
+ /** @type {Array<number>} */ var t1 = tri ? c01 : c10;
+ /** @type {Array<number>} */ var t2 = tri ? c10 : c01;
+ color = deMath.add(t0, deMath.add(deMath.scale(deMath.subtract(t1, t0), tx), deMath.scale(deMath.subtract(t2, t0), ty)));
+
+ result.setPixel(ix, iy, glsShaderRenderCase.toRGBA(color).toIVec());
+ }
+ }
+ };
+
+ /**
+ * @param {tcuSurface.Surface} result
+ * @param {glsShaderRenderCase.QuadGrid} quadGrid
+ **/
+ glsShaderRenderCase.ShaderRenderCase.prototype.computeFragmentReference = function(result, quadGrid) {
+ // Buffer info.
+ /** @type {number} */ var width = result.getWidth();
+ /** @type {number} */ var height = result.getHeight();
+ /** @type {boolean} */ var hasAlpha = gl.getContextAttributes().alpha;
+ /** @type {glsShaderRenderCase.ShaderEvalContext} */ var evalCtx = new glsShaderRenderCase.ShaderEvalContext(quadGrid);
+
+ // Render.
+ for (var y = 0; y < height; y++)
+ for (var x = 0; x < width; x++) {
+ /** @type {number} */ var sx = (x + 0.5) / width;
+ /** @type {number} */ var sy = (y + 0.5) / height;
+
+ evalCtx.reset(sx, sy);
+ this.m_evaluator.evaluate(evalCtx);
+ // Select either clear color or computed color based on discarded bit.
+ /** @type {Array<number>} */ var color = evalCtx.isDiscarded ? this.m_clearColor : evalCtx.color;
+
+ if (!hasAlpha)
+ color[3] = 1.0;
+
+ result.setPixel(x, y, glsShaderRenderCase.toRGBA(color).toIVec());
+ }
+ };
+
+ /**
+ * @param {tcuSurface.Surface} resImage
+ * @param {tcuSurface.Surface} refImage
+ * @param {number} errorThreshold
+ * @return {boolean}
+ */
+ glsShaderRenderCase.ShaderRenderCase.prototype.compareImages = function(resImage, refImage, errorThreshold) {
+ return tcuImageCompare.fuzzyCompare("ComparisonResult", "Image comparison result", refImage.getAccess(), resImage.getAccess(), errorThreshold);
+ };
+
+ /**
+ * @param {number} number
+ * @return {string} */
+ glsShaderRenderCase.getIntUniformName = function(number) {
+ switch (number) {
+ case 0: return "ui_zero";
+ case 1: return "ui_one";
+ case 2: return "ui_two";
+ case 3: return "ui_three";
+ case 4: return "ui_four";
+ case 5: return "ui_five";
+ case 6: return "ui_six";
+ case 7: return "ui_seven";
+ case 8: return "ui_eight";
+ case 101: return "ui_oneHundredOne";
+ default:
+ throw new Error("Uniform not supported.");
+ }
+ };
+
+ /**
+ * @param {number} number
+ * @return {string} */
+ glsShaderRenderCase.getFloatUniformName = function(number) {
+ switch (number) {
+ case 0: return "uf_zero";
+ case 1: return "uf_one";
+ case 2: return "uf_two";
+ case 3: return "uf_three";
+ case 4: return "uf_four";
+ case 5: return "uf_five";
+ case 6: return "uf_six";
+ case 7: return "uf_seven";
+ case 8: return "uf_eight";
+ default:
+ throw new Error("Uniform not supported.");
+ }
+ };
+
+ /**
+ * @param {number} number
+ * @return {string} */
+ glsShaderRenderCase.getFloatFractionUniformName = function(number) {
+ switch (number) {
+ case 1: return "uf_one";
+ case 2: return "uf_half";
+ case 3: return "uf_third";
+ case 4: return "uf_fourth";
+ case 5: return "uf_fifth";
+ case 6: return "uf_sixth";
+ case 7: return "uf_seventh";
+ case 8: return "uf_eighth";
+ default:
+ throw new Error("Uniform not supported.");
+ }
+ };
+
+ /**
+ * @param {?WebGLProgram} programID
+ */
+ glsShaderRenderCase.setupDefaultUniforms = function(programID) {
+ /** @type {?WebGLUniformLocation} */ var uniLoc;
+ // Bool.
+ /**
+ * @constructor
+ * @struct
+ */
+ var BoolUniform = function(name, value) {
+ /** @type {string} */ this.name = name;
+ /** @type {boolean} */ this.value = value;
+ };
+
+ /** @type {Array<BoolUniform>} */ var s_boolUniforms = [
+ new BoolUniform("ub_true", true),
+ new BoolUniform("ub_false", false)
+ ];
+
+ for (var i = 0; i < s_boolUniforms.length; i++) {
+ uniLoc = gl.getUniformLocation(programID, s_boolUniforms[i].name);
+ if (uniLoc != null)
+ gl.uniform1i(uniLoc, s_boolUniforms[i].value ? 1 : 0);
+ }
+
+ // BVec4.
+ /**
+ * @constructor
+ * @struct
+ */
+ var BVec4Uniform = function(name, value) {
+ /** @type {string} */ this.name = name;
+ /** @type {Array<boolean>} */ this.value = value;
+ };
+
+ /** @type {Array<BVec4Uniform>} */ var s_bvec4Uniforms = [
+ new BVec4Uniform("ub4_true", [true, true, true, true]),
+ new BVec4Uniform("ub4_false", [false, false, false, false])
+ ];
+
+ for (var i = 0; i < s_bvec4Uniforms.length; i++) {
+ /** @type {BVec4Uniform} */ var uni = s_bvec4Uniforms[i];
+ /** @type {Array<number>} */ var arr = [];
+ arr[0] = uni.value[0] ? 1 : 0;
+ arr[1] = uni.value[1] ? 1 : 0;
+ arr[2] = uni.value[2] ? 1 : 0;
+ arr[3] = uni.value[3] ? 1 : 0;
+ uniLoc = gl.getUniformLocation(programID, uni.name);
+ if (uniLoc != null)
+ gl.uniform4iv(uniLoc, new Int32Array(arr));
+ }
+
+ // Int.
+ /**
+ * @constructor
+ * @struct
+ */
+ var IntUniform = function(name, value) {
+ /** @type {string} */ this.name = name;
+ /** @type {number} */ this.value = value;
+ };
+
+ /** @type {Array<IntUniform>} */ var s_intUniforms = [
+ new IntUniform("ui_minusOne", -1),
+ new IntUniform("ui_zero", 0),
+ new IntUniform("ui_one", 1),
+ new IntUniform("ui_two", 2),
+ new IntUniform("ui_three", 3),
+ new IntUniform("ui_four", 4),
+ new IntUniform("ui_five", 5),
+ new IntUniform("ui_six", 6),
+ new IntUniform("ui_seven", 7),
+ new IntUniform("ui_eight", 8),
+ new IntUniform("ui_oneHundredOne", 101)
+ ];
+
+ for (var i = 0; i < s_intUniforms.length; i++) {
+ uniLoc = gl.getUniformLocation(programID, s_intUniforms[i].name);
+ if (uniLoc != null)
+ gl.uniform1i(uniLoc, s_intUniforms[i].value);
+ }
+
+ // IVec2.
+ /**
+ * @constructor
+ * @struct
+ */
+ var IVec2Uniform = function(name, value) {
+ /** @type {string} */ this.name = name;
+ /** @type {Array<number>} */ this.value = value;
+ };
+
+ /** @type {Array<IVec2Uniform>} */ var s_ivec2Uniforms = [
+ new IVec2Uniform("ui2_minusOne", [-1, -1]),
+ new IVec2Uniform("ui2_zero", [0, 0]),
+ new IVec2Uniform("ui2_one", [1, 1]),
+ new IVec2Uniform("ui2_two", [2, 2]),
+ new IVec2Uniform("ui2_four", [4, 4]),
+ new IVec2Uniform("ui2_five", [5, 5])
+ ];
+
+ for (var i = 0; i < s_ivec2Uniforms.length; i++) {
+ uniLoc = gl.getUniformLocation(programID, s_ivec2Uniforms[i].name);
+ if (uniLoc != null)
+ gl.uniform2iv(uniLoc, new Int32Array(s_ivec2Uniforms[i].value));
+ }
+
+ // IVec3.
+ /**
+ * @constructor
+ * @struct
+ */
+ var IVec3Uniform = function(name, value) {
+ /** @type {string} */ this.name = name;
+ /** @type {Array<number>} */ this.value = value;
+ };
+
+ /** @type {Array<IVec3Uniform>} */ var s_ivec3Uniforms = [
+ new IVec3Uniform("ui3_minusOne", [-1, -1, -1]),
+ new IVec3Uniform("ui3_zero", [0, 0, 0]),
+ new IVec3Uniform("ui3_one", [1, 1, 1]),
+ new IVec3Uniform("ui3_two", [2, 2, 2]),
+ new IVec3Uniform("ui3_four", [4, 4, 4]),
+ new IVec3Uniform("ui3_five", [5, 5, 5])
+ ];
+
+ for (var i = 0; i < s_ivec3Uniforms.length; i++) {
+ uniLoc = gl.getUniformLocation(programID, s_ivec3Uniforms[i].name);
+ if (uniLoc != null)
+ gl.uniform3iv(uniLoc, new Int32Array(s_ivec3Uniforms[i].value));
+ }
+
+ // IVec4.
+ /**
+ * @constructor
+ * @struct
+ */
+ var IVec4Uniform = function(name, value) {
+ /** @type {string} */ this.name = name;
+ /** @type {Array<number>} */ this.value = value;
+ };
+ /** @type {Array<IVec4Uniform>} */ var s_ivec4Uniforms = [
+ new IVec4Uniform("ui4_minusOne", [-1, -1, -1, -1]),
+ new IVec4Uniform("ui4_zero", [0, 0, 0, 0]),
+ new IVec4Uniform("ui4_one", [1, 1, 1, 1]),
+ new IVec4Uniform("ui4_two", [2, 2, 2, 2]),
+ new IVec4Uniform("ui4_four", [4, 4, 4, 4]),
+ new IVec4Uniform("ui4_five", [5, 5, 5, 5])
+ ];
+
+ for (var i = 0; i < s_ivec4Uniforms.length; i++) {
+ uniLoc = gl.getUniformLocation(programID, s_ivec4Uniforms[i].name);
+ if (uniLoc != null)
+ gl.uniform4iv(uniLoc, new Int32Array(s_ivec4Uniforms[i].value));
+ }
+
+ // Float.
+ /**
+ * @constructor
+ * @struct
+ */
+ var FloatUniform = function(name, value) {
+ /** @type {string} */ this.name = name;
+ /** @type {number} */ this.value = value;
+ };
+ /** @type {Array<FloatUniform>} */ var s_floatUniforms = [
+ new FloatUniform("uf_zero", 0.0),
+ new FloatUniform("uf_one", 1.0),
+ new FloatUniform("uf_two", 2.0),
+ new FloatUniform("uf_three", 3.0),
+ new FloatUniform("uf_four", 4.0),
+ new FloatUniform("uf_five", 5.0),
+ new FloatUniform("uf_six", 6.0),
+ new FloatUniform("uf_seven", 7.0),
+ new FloatUniform("uf_eight", 8.0),
+ new FloatUniform("uf_half", 1.0 / 2.0),
+ new FloatUniform("uf_third", 1.0 / 3.0),
+ new FloatUniform("uf_fourth", 1.0 / 4.0),
+ new FloatUniform("uf_fifth", 1.0 / 5.0),
+ new FloatUniform("uf_sixth", 1.0 / 6.0),
+ new FloatUniform("uf_seventh", 1.0 / 7.0),
+ new FloatUniform("uf_eighth", 1.0 / 8.0)
+ ];
+
+ for (var i = 0; i < s_floatUniforms.length; i++) {
+ uniLoc = gl.getUniformLocation(programID, s_floatUniforms[i].name);
+ if (uniLoc != null)
+ gl.uniform1f(uniLoc, s_floatUniforms[i].value);
+ }
+
+ // Vec2.
+ /**
+ * @constructor
+ * @struct
+ */
+ var Vec2Uniform = function(name, value) {
+ /** @type {string} */ this.name = name;
+ /** @type {Array<number>} */ this.value = value;
+ };
+ /** @type {Array<Vec2Uniform>} */ var s_vec2Uniforms = [
+ new Vec2Uniform("uv2_minusOne", [-1.0, -1.0]),
+ new Vec2Uniform("uv2_zero", [0.0, 0.0]),
+ new Vec2Uniform("uv2_half", [0.5, 0.5]),
+ new Vec2Uniform("uv2_one", [1.0, 1.0]),
+ new Vec2Uniform("uv2_two", [2.0, 2.0])
+ ];
+
+ for (var i = 0; i < s_vec2Uniforms.length; i++) {
+ uniLoc = gl.getUniformLocation(programID, s_vec2Uniforms[i].name);
+ if (uniLoc != null)
+ gl.uniform2fv(uniLoc, new Float32Array(s_vec2Uniforms[i].value));
+ }
+
+ // Vec3.
+ /**
+ * @constructor
+ * @struct
+ */
+ var Vec3Uniform = function(name, value) {
+ /** @type {string} */ this.name = name;
+ /** @type {Array<number>} */ this.value = value;
+ };
+ /** @type {Array<Vec3Uniform>} */ var s_vec3Uniforms = [
+ new Vec3Uniform("uv3_minusOne", [-1.0, -1.0, -1.0]),
+ new Vec3Uniform("uv3_zero", [0.0, 0.0, 0.0]),
+ new Vec3Uniform("uv3_half", [0.5, 0.5, 0.5]),
+ new Vec3Uniform("uv3_one", [1.0, 1.0, 1.0]),
+ new Vec3Uniform("uv3_two", [2.0, 2.0, 2.0])
+ ];
+
+ for (var i = 0; i < s_vec3Uniforms.length; i++) {
+ uniLoc = gl.getUniformLocation(programID, s_vec3Uniforms[i].name);
+ if (uniLoc != null)
+ gl.uniform3fv(uniLoc, new Float32Array(s_vec3Uniforms[i].value));
+ }
+
+ // Vec4.
+ /**
+ * @constructor
+ * @struct
+ */
+ var Vec4Uniform = function(name, value) {
+ /** @type {string} */ this.name = name;
+ /** @type {Array<number>} */ this.value = value;
+ };
+ /** @type {Array<Vec4Uniform>} */ var s_vec4Uniforms = [
+ new Vec4Uniform("uv4_minusOne", [-1.0, -1.0, -1.0, -1.0]),
+ new Vec4Uniform("uv4_zero", [0.0, 0.0, 0.0, 0.0]),
+ new Vec4Uniform("uv4_half", [0.5, 0.5, 0.5, 0.5]),
+ new Vec4Uniform("uv4_one", [1.0, 1.0, 1.0, 1.0]),
+ new Vec4Uniform("uv4_two", [2.0, 2.0, 2.0, 2.0]),
+ new Vec4Uniform("uv4_black", [0.0, 0.0, 0.0, 1.0]),
+ new Vec4Uniform("uv4_gray", [0.5, 0.5, 0.5, 1.0]),
+ new Vec4Uniform("uv4_white", [1.0, 1.0, 1.0, 1.0])
+ ];
+
+ for (var i = 0; i < s_vec4Uniforms.length; i++) {
+ uniLoc = gl.getUniformLocation(programID, s_vec4Uniforms[i].name);
+ if (uniLoc != null)
+ gl.uniform4fv(uniLoc, new Float32Array(s_vec4Uniforms[i].value));
+ }
+ };
+
+ /**
+ * @param {glsShaderRenderCase.QuadGrid} quadGrid
+ * @param {?WebGLProgram} program
+ * @param {Array<gluDrawUtil.VertexArrayBinding>} vertexArrays
+ */
+ glsShaderRenderCase.getDefaultVertexArrays = function(quadGrid, program, vertexArrays) {
+ /** @type {number} */ var numElements = quadGrid.getNumVertices();
+ var posArray = [].concat.apply([], quadGrid.getPositions());
+ var coordsArray = [].concat.apply([], quadGrid.getCoordsArray());
+ var unitCoordsArray = [].concat.apply([], quadGrid.getUnitCoordsArray());
+
+ vertexArrays.push(gluDrawUtil.newFloatVertexArrayBinding("a_position", 4, numElements, 0, posArray));
+ vertexArrays.push(gluDrawUtil.newFloatVertexArrayBinding("a_coords", 4, numElements, 0, coordsArray));
+ vertexArrays.push(gluDrawUtil.newFloatVertexArrayBinding("a_unitCoords", 4, numElements, 0, unitCoordsArray));
+ vertexArrays.push(gluDrawUtil.newFloatVertexArrayBinding("a_one", 1, numElements, 0, quadGrid.getAttribOne()));
+
+ // a_inN.
+ for (var userNdx = 0; userNdx < quadGrid.getNumUserAttribs(); userNdx++) {
+ /** @type {string} */ var name = "a_in" + userNdx;
+ var userAttribArray = [].concat.apply([], quadGrid.getUserAttribByIndex(userNdx));
+ vertexArrays.push(gluDrawUtil.newFloatVertexArrayBinding(name, 4, numElements, 0, userAttribArray));
+ }
+
+ // Matrix attributes - these are set by location
+ /**
+ * @constructor
+ * @struct
+ */
+ var Matrix = function(name, cols, rows) {
+ this.name = name;
+ this.numCols = cols;
+ this.numRows = rows;
+ };
+
+ /** @type {Array<Matrix>} */ var matrices = [
+ new Matrix('a_mat2', 2, 2),
+ new Matrix('a_mat2x3', 2, 3),
+ new Matrix('a_mat2x4', 2, 4),
+ new Matrix('a_mat3x2', 3, 2),
+ new Matrix('a_mat3', 3, 3),
+ new Matrix('a_mat3x4', 3, 4),
+ new Matrix('a_mat4x2', 4, 2),
+ new Matrix('a_mat4x3', 4, 3),
+ new Matrix('a_mat4', 4, 4)
+ ];
+
+ for (var matNdx = 0; matNdx < matrices.length; matNdx++) {
+ /** @type {number} */ var loc = gl.getAttribLocation(program, matrices[matNdx].name);
+
+ if (loc < 0)
+ continue; // Not used in shader.
+
+ /** @type {number} */ var numRows = matrices[matNdx].numRows;
+ /** @type {number} */ var numCols = matrices[matNdx].numCols;
+
+ for (var colNdx = 0; colNdx < numCols; colNdx++) {
+ var data = [].concat.apply([], quadGrid.getUserAttribByIndex(colNdx));
+ vertexArrays.push(gluDrawUtil.newFloatColumnVertexArrayBinding(matrices[matNdx].name, colNdx, numRows, numElements, 4 * 4, data));
+ }
+ }
+ };
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsStateQuery.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsStateQuery.js
new file mode 100644
index 0000000000..962d87fb47
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsStateQuery.js
@@ -0,0 +1,367 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('modules.shared.glsStateQuery');
+
+goog.scope(function() {
+var glsStateQuery = modules.shared.glsStateQuery;
+
+/**
+ * Compare two objects. Objects must have the same type and contents.
+ * If comparing numbers, allow some epsilon differences
+ * @param {*} a
+ * @param {*} b
+ * return {boolean}
+ */
+glsStateQuery.compare = function(a, b) {
+ /** @const */ var eps = 0.01;
+ if (a === b)
+ return true;
+
+ if (typeof a === 'number' && typeof b === 'number')
+ return Math.abs(a - b) < eps;
+
+ //compare array-like parameters
+ if (typeof a == 'object' && typeof b == 'object') {
+ if (a.constructor !== b.constructor)
+ return false;
+
+ if ('length' in a && 'length' in b) {
+ if (a.length !== b.length)
+ return false;
+ for (var i = 0; i < a.length; i++) {
+ if (typeof a[i] === 'number' && typeof b[i] === 'number') {
+ if (Math.abs(a[i] - b[i]) >= eps)
+ return false;
+ } else if (a[i] !== b[i])
+ return false;
+ }
+ return true;
+ }
+
+ }
+ return false;
+};
+
+/**
+ * Verify that WebGL state 'param' has the expected value
+ * @param {number} param
+ * @param {*} reference
+ * @return {boolean}
+ */
+glsStateQuery.verify = function(param, reference) {
+ var value = gl.getParameter(param);
+ var result = glsStateQuery.compare(value, reference);
+ if (!result) {
+ bufferedLogToConsole('Result: ' + value + ' Expected: ' + reference);
+ }
+ return result;
+};
+
+/**
+ * Verify that WebGL current vertex attrib has the expected value
+ * @param {number} index
+ * @param {*} reference
+ * @return {boolean}
+ */
+glsStateQuery.verifyCurrentVertexAttrib = function(index, reference) {
+ var value = gl.getVertexAttrib(index, gl.CURRENT_VERTEX_ATTRIB);
+ var result = glsStateQuery.compare(value, reference);
+ if (!result) {
+ bufferedLogToConsole('Result: ' + value + ' Expected: ' + reference);
+ }
+ return result;
+};
+
+/**
+ * Verify that WebGL vertex attrib attribute 'param' has the expected value
+ * @param {number} index
+ * @param {number} param
+ * @param {*} reference
+ * @return {boolean}
+ */
+glsStateQuery.verifyVertexAttrib = function(index, param, reference) {
+ var value = (param == gl.VERTEX_ATTRIB_ARRAY_POINTER) ?
+ gl.getVertexAttribOffset(index, param) :
+ gl.getVertexAttrib(index, param);
+ var result = glsStateQuery.compare(value, reference);
+ if (!result) {
+ bufferedLogToConsole('Result: ' + value + ' Expected: ' + reference);
+ }
+ return result;
+};
+
+/**
+ * Verify that WebGL uniform has the expected value
+ * @param {WebGLProgram} program
+ * @param {WebGLUniformLocation} location
+ * @param {*} reference
+ * @return {boolean}
+ */
+glsStateQuery.verifyUniform = function(program, location, reference) {
+ var value = gl.getUniform(program, location);
+ var result = glsStateQuery.compare(value, reference);
+ if (!result) {
+ bufferedLogToConsole('Result: ' + value + ' Expected: ' + reference);
+ }
+ return result;
+};
+
+/**
+ * Verify that WebGL shader state 'param' has the expected value
+ * @param {WebGLShader} shader
+ * @param {number} param
+ * @param {*} reference
+ * @return {boolean}
+ */
+glsStateQuery.verifyShader = function(shader, param, reference) {
+ var value = gl.getShaderParameter(shader, param);
+ var result = glsStateQuery.compare(value, reference);
+ if (!result) {
+ bufferedLogToConsole('Result: ' + value + ' Expected: ' + reference);
+ }
+ return result;
+};
+
+/**
+ * Verify that WebGL program state 'param' has the expected value
+ * @param {WebGLProgram} program
+ * @param {number} param
+ * @param {*} reference
+ * @return {boolean}
+ */
+glsStateQuery.verifyProgram = function(program, param, reference) {
+ var value = gl.getProgramParameter(program, param);
+ var result = glsStateQuery.compare(value, reference);
+ if (!result) {
+ bufferedLogToConsole('Result: ' + value + ' Expected: ' + reference);
+ }
+ return result;
+};
+
+/**
+ * Verify that WebGL sampler state 'param' has the expected value
+ * @param {WebGLSampler} sampler
+ * @param {number} param
+ * @param {*} reference
+ * @return {boolean}
+ */
+glsStateQuery.verifySampler = function(sampler, param, reference) {
+ var value = gl.getSamplerParameter(sampler, param);
+ var result = glsStateQuery.compare(value, reference);
+ if (!result) {
+ bufferedLogToConsole('Result: ' + value + ' Expected: ' + reference);
+ }
+ return result;
+};
+
+/**
+ * Verify that WebGL texture state 'param' has the expected value
+ * @param {number} target
+ * @param {number} param
+ * @param {*} reference
+ * @return {boolean}
+ */
+glsStateQuery.verifyTexture = function(target, param, reference) {
+ var value = gl.getTexParameter(target, param);
+ var result = glsStateQuery.compare(value, reference);
+ if (!result) {
+ bufferedLogToConsole('Result: ' + value + ' Expected: ' + reference);
+ }
+ return result;
+};
+
+/**
+ * Verify that WebGL state 'param' has one of the expected values
+ * @param {number} param
+ * @param {Array<*>} reference
+ * return {boolean}
+ */
+glsStateQuery.verifyAnyOf = function(param, reference) {
+ var value = gl.getParameter(param);
+ for (var i = 0; i < reference.length; i++)
+ if (glsStateQuery.compare(value, reference[i]))
+ return true;
+ bufferedLogToConsole('Result: ' + value + ' Expected one of: ' + reference);
+ return false;
+};
+
+/**
+ * Verify that WebGL state 'param' has the expected value
+ * @param {number} param
+ * @param {number|Array<number>} reference
+ * @return {boolean}
+ */
+glsStateQuery.verifyGreaterOrEqual = function(param, reference) {
+ var value = gl.getParameter(param);
+ if (reference instanceof Array) {
+ var v = /** @type {Array<number>} */ (value);
+ if (v.length != reference.length) {
+ bufferedLogToConsole('Result: ' + value + ' Expected >= : ' + reference);
+ return false;
+ }
+ for (var i = 0; i < reference.length; i++)
+ if (v[i] < reference[i]) {
+ bufferedLogToConsole('Result: ' + value + ' Expected >= : ' + reference);
+ return false;
+ }
+ return true;
+ }
+ var n = /** @type {number} */ (value);
+ if (n < reference) {
+ bufferedLogToConsole('Result: ' + value + ' Expected >= : ' + reference);
+ return false;
+ }
+ return true;
+};
+
+/**
+ * Verify that WebGL state 'param' has the expected value
+ * @param {number} param
+ * @param {number|Array<number>} reference
+ * @return {boolean}
+ */
+glsStateQuery.verifyLessOrEqual = function(param, reference) {
+ var value = gl.getParameter(param);
+ if (reference instanceof Array) {
+ var v = /** @type {Array<number>} */ (value);
+ if (v.length != reference.length) {
+ bufferedLogToConsole('Result: ' + value + ' Expected <= : ' + reference);
+ return false;
+ }
+ for (var i = 0; i > reference.length; i++)
+ if (v[i] < reference[i]) {
+ bufferedLogToConsole('Result: ' + value + ' Expected <= : ' + reference);
+ return false;
+ }
+ return true;
+ }
+ var n = /** @type {number} */ (value);
+ if (n > reference) {
+ bufferedLogToConsole('Result: ' + value + ' Expected <= : ' + reference);
+ return false;
+ }
+ return true;
+};
+
+/**
+ * Verify that WebGL state 'param' has the expected value (value & mask == reference)
+ * @param {number} param
+ * @param {number} reference
+ * @param {number} mask
+ * @return {boolean}
+ */
+glsStateQuery.verifyMasked = function(param, reference, mask) {
+ var value = /** @type {number} */ (gl.getParameter(param));
+ if ((value & mask) !== reference) {
+ bufferedLogToConsole('Result: ' + value + ' Expected: ' + reference + 'Mask: 0x' + mask.toString(16));
+ return false;
+ }
+ return true;
+};
+
+/**
+ * Verify that WebGL fbo attachment 'param' has the expected value
+ * @param {number} fbo
+ * @param {number} attachment
+ * @param {number} param
+ * @param {*} reference
+ * @return {boolean}
+ */
+glsStateQuery.verifyAttachment = function(fbo, attachment, param, reference) {
+ var value = gl.getFramebufferAttachmentParameter(fbo, attachment, param);
+ var result = glsStateQuery.compare(value, reference);
+ if (!result) {
+ bufferedLogToConsole('Result: ' + value + ' Expected: ' + reference);
+ }
+ return result;
+};
+
+/**
+ * Verify that WebGL fbo color attachment 'param' has the expected value
+ * @param {number} fbo
+ * @param {number} param
+ * @param {*} reference
+ * @return {boolean}
+ */
+glsStateQuery.verifyColorAttachment = function(fbo, param, reference) {
+ return glsStateQuery.verifyAttachment(fbo, gl.COLOR_ATTACHMENT0, param, reference);
+};
+
+/**
+ * Verify that WebGL rbo attribute 'param' has the expected value
+ * @param {number} param
+ * @param {*} reference
+ * @return {boolean}
+ */
+glsStateQuery.verifyRenderbuffer = function(param, reference) {
+ var value = gl.getRenderbufferParameter(gl.RENDERBUFFER, param);
+ var result = glsStateQuery.compare(value, reference);
+ if (!result) {
+ bufferedLogToConsole('Result: ' + value + ' Expected: ' + reference);
+ }
+ return result;
+};
+
+/**
+ * Verify that WebGL active uniform block's attribute 'param' has the expected value
+ * @param {WebGLProgram} program
+ * @param {number} index
+ * @param {number} param
+ * @param {*} reference
+ * @return {boolean}
+ */
+glsStateQuery.verifyActiveUniformBlock = function(program, index, param, reference) {
+ var value = gl.getActiveUniformBlockParameter(program, index, param);
+ var result = glsStateQuery.compare(value, reference);
+ if (!result) {
+ bufferedLogToConsole('Result: ' + value + ' Expected: ' + reference);
+ }
+ return result;
+};
+
+/**
+ * @param {number} param
+ * @param {Array<number>} reference
+ * @param {Array<boolean>} enableRef
+ * @return {boolean}
+ */
+
+glsStateQuery.verifyMask = function(param, reference, enableRef) {
+ var intVector4 = /** @type {Array<number>} */ (gl.getParameter(param));
+
+ if ((enableRef[0] && (intVector4[0] != reference[0])) ||
+ (enableRef[1] && (intVector4[1] != reference[1])) ||
+ (enableRef[2] && (intVector4[2] != reference[2])) ||
+ (enableRef[3] && (intVector4[3] != reference[3])))
+ {
+ bufferedLogToConsole("// ERROR: expected " +
+ (enableRef[0] ? "" : "(") + reference[0] + (enableRef[0] ? "" : ")") + ", " +
+ (enableRef[1] ? "" : "(") + reference[1] + (enableRef[1] ? "" : ")") + ", " +
+ (enableRef[2] ? "" : "(") + reference[2] + (enableRef[2] ? "" : ")") + ", " +
+ (enableRef[3] ? "" : "(") + reference[3] + (enableRef[3] ? "" : ")"));
+
+ return false;
+ }
+ return true;
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsTextureTestUtil.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsTextureTestUtil.js
new file mode 100644
index 0000000000..f35d942261
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsTextureTestUtil.js
@@ -0,0 +1,2642 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('modules.shared.glsTextureTestUtil');
+goog.require('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuPixelFormat');
+goog.require('framework.common.tcuRGBA');
+goog.require('framework.common.tcuStringTemplate');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTexLookupVerifier');
+goog.require('framework.common.tcuTexCompareVerifier');
+goog.require('framework.common.tcuTexture');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.opengl.gluDrawUtil');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('framework.delibs.debase.deRandom');
+
+goog.scope(function() {
+var tcuTexLookupVerifier = framework.common.tcuTexLookupVerifier;
+var tcuTexCompareVerifier = framework.common.tcuTexCompareVerifier;
+var glsTextureTestUtil = modules.shared.glsTextureTestUtil;
+var gluDrawUtil = framework.opengl.gluDrawUtil;
+var gluShaderProgram = framework.opengl.gluShaderProgram;
+var tcuTexture = framework.common.tcuTexture;
+var tcuSurface = framework.common.tcuSurface;
+var gluShaderUtil = framework.opengl.gluShaderUtil;
+var tcuStringTemplate = framework.common.tcuStringTemplate;
+var deMath = framework.delibs.debase.deMath;
+var tcuImageCompare = framework.common.tcuImageCompare;
+var tcuPixelFormat = framework.common.tcuPixelFormat;
+var tcuRGBA = framework.common.tcuRGBA;
+var deRandom = framework.delibs.debase.deRandom;
+
+var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+};
+
+var MIN_SUBPIXEL_BITS = 4;
+
+/**
+ * @enum
+ */
+glsTextureTestUtil.textureType = {
+ TEXTURETYPE_2D: 0,
+ TEXTURETYPE_CUBE: 1,
+ TEXTURETYPE_2D_ARRAY: 2,
+ TEXTURETYPE_3D: 3,
+ TEXTURETYPE_CUBE_ARRAY: 4,
+ TEXTURETYPE_1D: 5,
+ TEXTURETYPE_1D_ARRAY: 6,
+ TEXTURETYPE_BUFFER: 7
+};
+
+/**
+ * @enum
+ */
+glsTextureTestUtil.samplerType = {
+ SAMPLERTYPE_FLOAT: 0,
+ SAMPLERTYPE_INT: 1,
+ SAMPLERTYPE_UINT: 2,
+ SAMPLERTYPE_SHADOW: 3,
+
+ SAMPLERTYPE_FETCH_FLOAT: 4,
+ SAMPLERTYPE_FETCH_INT: 5,
+ SAMPLERTYPE_FETCH_UINT: 6
+};
+
+/**
+ * @param {tcuTexture.TextureFormat} format
+ * @return {glsTextureTestUtil.samplerType}
+ */
+glsTextureTestUtil.getSamplerType = function(format) {
+ if (format == null)
+ throw new Error('Missing format information');
+
+ switch (format.type) {
+ case tcuTexture.ChannelType.SIGNED_INT8:
+ case tcuTexture.ChannelType.SIGNED_INT16:
+ case tcuTexture.ChannelType.SIGNED_INT32:
+ return glsTextureTestUtil.samplerType.SAMPLERTYPE_INT;
+
+ case tcuTexture.ChannelType.UNSIGNED_INT8:
+ case tcuTexture.ChannelType.UNSIGNED_INT32:
+ case tcuTexture.ChannelType.UNSIGNED_INT_1010102_REV:
+ return glsTextureTestUtil.samplerType.SAMPLERTYPE_UINT;
+
+ // Texture formats used in depth/stencil textures.
+ case tcuTexture.ChannelType.UNSIGNED_INT16:
+ case tcuTexture.ChannelType.UNSIGNED_INT_24_8:
+ return (format.order == tcuTexture.ChannelOrder.D || format.order == tcuTexture.ChannelOrder.DS) ? glsTextureTestUtil.samplerType.SAMPLERTYPE_FLOAT : glsTextureTestUtil.samplerType.SAMPLERTYPE_UINT;
+
+ default:
+ return glsTextureTestUtil.samplerType.SAMPLERTYPE_FLOAT;
+ }
+};
+
+/**
+ * @constructor
+ * @param {HTMLElement} canvas
+ * @param {number} preferredWidth
+ * @param {number} preferredHeight
+ * @param {number=} seed
+ */
+glsTextureTestUtil.RandomViewport = function(canvas, preferredWidth, preferredHeight, seed) {
+ this.width = Math.min(canvas.width, preferredWidth);
+ this.height = Math.min(canvas.height, preferredHeight);
+
+ if (typeof seed === 'undefined')
+ seed = preferredWidth + preferredHeight;
+
+ var rnd = new deRandom.Random(seed);
+ this.x = rnd.getInt(0, canvas.width - this.width);
+ this.y = rnd.getInt(0, canvas.height - this.height);
+};
+
+/**
+ * @constructor
+ * @param {glsTextureTestUtil.textureType} texType
+ */
+glsTextureTestUtil.RenderParams = function(texType) {
+ this.flags = {
+ projected: false,
+ use_bias: false,
+ log_programs: false,
+ log_uniforms: false
+ };
+ this.texType = texType;
+ this.w = [1, 1, 1, 1];
+ this.bias = 0;
+ this.ref = 0;
+ this.colorScale = [1, 1, 1, 1];
+ this.colorBias = [0, 0, 0, 0];
+ this.samplerType = glsTextureTestUtil.samplerType.SAMPLERTYPE_FLOAT;
+};
+
+/**
+ * @enum
+ */
+glsTextureTestUtil.lodMode = {
+ EXACT: 0, //!< Ideal lod computation.
+ MIN_BOUND: 1, //!< Use estimation range minimum bound.
+ MAX_BOUND: 2 //!< Use estimation range maximum bound.
+
+};
+
+/**
+ * @constructor
+ * @extends {glsTextureTestUtil.RenderParams}
+ * @param {glsTextureTestUtil.textureType} texType
+ * @param {tcuTexture.Sampler=} sampler
+ * @param {glsTextureTestUtil.lodMode=} lodMode_
+ */
+glsTextureTestUtil.ReferenceParams = function(texType, sampler, lodMode_) {
+ glsTextureTestUtil.RenderParams.call(this, texType);
+ if (sampler)
+ this.sampler = sampler;
+ if (lodMode_)
+ this.lodMode = lodMode_;
+ else
+ this.lodMode = glsTextureTestUtil.lodMode.EXACT;
+ this.minLod = -1000;
+ this.maxLod = 1000;
+ this.baseLevel = 0;
+ this.maxLevel = 1000;
+};
+
+glsTextureTestUtil.ReferenceParams.prototype = Object.create(glsTextureTestUtil.RenderParams.prototype);
+
+/** Copy constructor */
+glsTextureTestUtil.ReferenceParams.prototype.constructor = glsTextureTestUtil.ReferenceParams;
+
+/**
+ * @param {Array<number>} bottomLeft
+ * @param {Array<number>} topRight
+ * @return {Array<number>}
+ */
+glsTextureTestUtil.computeQuadTexCoord2D = function(bottomLeft, topRight) {
+ var dst = [];
+ dst.length = 4 * 2;
+
+ dst[0] = bottomLeft[0]; dst[1] = bottomLeft[1];
+ dst[2] = bottomLeft[0]; dst[3] = topRight[1];
+ dst[4] = topRight[0]; dst[5] = bottomLeft[1];
+ dst[6] = topRight[0]; dst[7] = topRight[1];
+
+ return dst;
+};
+
+/**
+ * @param {tcuTexture.CubeFace} face
+ * @return {Array<number>}
+ */
+glsTextureTestUtil.computeQuadTexCoordCube = function(face) {
+ var texCoordNegX = [
+ -1, 1, -1,
+ -1, -1, -1,
+ -1, 1, 1,
+ -1, -1, 1
+ ];
+ var texCoordPosX = [
+ +1, 1, 1,
+ +1, -1, 1,
+ +1, 1, -1,
+ +1, -1, -1
+ ];
+ var texCoordNegY = [
+ -1, -1, 1,
+ -1, -1, -1,
+ 1, -1, 1,
+ 1, -1, -1
+ ];
+ var texCoordPosY = [
+ -1, +1, -1,
+ -1, +1, 1,
+ 1, +1, -1,
+ 1, +1, 1
+ ];
+ var texCoordNegZ = [
+ 1, 1, -1,
+ 1, -1, -1,
+ -1, 1, -1,
+ -1, -1, -1
+ ];
+ var texCoordPosZ = [
+ -1, 1, +1,
+ -1, -1, +1,
+ 1, 1, +1,
+ 1, -1, +1
+ ];
+
+ switch (face) {
+ case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X: return texCoordNegX;
+ case tcuTexture.CubeFace.CUBEFACE_POSITIVE_X: return texCoordPosX;
+ case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y: return texCoordNegY;
+ case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y: return texCoordPosY;
+ case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z: return texCoordNegZ;
+ case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z: return texCoordPosZ;
+ }
+ throw new Error('Unrecognized face ' + face);
+};
+
+/**
+ * @param {tcuTexture.CubeFace} face
+ * @param {Array<number>} bottomLeft
+ * @param {Array<number>} topRight
+ * @return {Array<number>}
+ */
+glsTextureTestUtil.computeQuadTexCoordCubeFace = function(face, bottomLeft, topRight) {
+ var dst = [];
+ /** @type {number} */ var sRow = 0;
+ /** @type {number} */ var tRow = 0;
+ /** @type {number} */ var mRow = 0;
+ /** @type {number} */ var sSign = 1.0;
+ /** @type {number} */ var tSign = 1.0;
+ /** @type {number} */ var mSign = 1.0;
+
+ switch (face) {
+ case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X: mRow = 0; sRow = 2; tRow = 1; mSign = -1.0; tSign = -1.0; break;
+ case tcuTexture.CubeFace.CUBEFACE_POSITIVE_X: mRow = 0; sRow = 2; tRow = 1; sSign = -1.0; tSign = -1.0; break;
+ case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y: mRow = 1; sRow = 0; tRow = 2; mSign = -1.0; tSign = -1.0; break;
+ case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y: mRow = 1; sRow = 0; tRow = 2; break;
+ case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z: mRow = 2; sRow = 0; tRow = 1; mSign = -1.0; sSign = -1.0; tSign = -1.0; break;
+ case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z: mRow = 2; sRow = 0; tRow = 1; tSign = -1.0; break;
+ default:
+ throw new Error('Invalid cube face specified.');
+ }
+
+ dst[0 + mRow] = mSign;
+ dst[3 + mRow] = mSign;
+ dst[6 + mRow] = mSign;
+ dst[9 + mRow] = mSign;
+
+ dst[0 + sRow] = sSign * bottomLeft[0];
+ dst[3 + sRow] = sSign * bottomLeft[0];
+ dst[6 + sRow] = sSign * topRight[0];
+ dst[9 + sRow] = sSign * topRight[0];
+
+ dst[0 + tRow] = tSign * bottomLeft[1];
+ dst[3 + tRow] = tSign * topRight[1];
+ dst[6 + tRow] = tSign * bottomLeft[1];
+ dst[9 + tRow] = tSign * topRight[1];
+
+ return dst;
+};
+
+/**
+ * @param {number} layerNdx
+ * @param {Array<number>} bottomLeft
+ * @param {Array<number>} topRight
+ * @return {Array<number>}
+ */
+glsTextureTestUtil.computeQuadTexCoord2DArray = function(layerNdx, bottomLeft, topRight) {
+ var dst = [];
+ dst.length = 4 * 3;
+
+ dst[0] = bottomLeft[0]; dst[1] = bottomLeft[1]; dst[2] = layerNdx;
+ dst[3] = bottomLeft[0]; dst[4] = topRight[1]; dst[5] = layerNdx;
+ dst[6] = topRight[0]; dst[7] = bottomLeft[1]; dst[8] = layerNdx;
+ dst[9] = topRight[0]; dst[10] = topRight[1]; dst[11] = layerNdx;
+
+ return dst;
+};
+
+/**
+ * @param {Array<number>} a
+ * @param {Array<number>} b
+ * @param {Array<number>} c
+ * @return {Array<number>} a + (b - a) * c
+ */
+glsTextureTestUtil.selectCoords = function(a, b, c) {
+ var x1 = deMath.subtract(b, a);
+ var x2 = deMath.multiply(x1, c);
+ var x3 = deMath.add(a, x2);
+ return x3;
+};
+
+/**
+ * @param {Array<number>} p0
+ * @param {Array<number>} p1
+ * @param {Array<number>} dirSwz
+ * @return {Array<number>}
+ */
+glsTextureTestUtil.computeQuadTexCoord3D = function(p0, p1, dirSwz) {
+ var dst = [];
+ dst.length = 4 * 3;
+
+ var f0 = deMath.swizzle(([0, 0, 0]), [dirSwz[0], dirSwz[1], dirSwz[2]]);
+ var f1 = deMath.swizzle(([0, 1, 0]), [dirSwz[0], dirSwz[1], dirSwz[2]]);
+ var f2 = deMath.swizzle(([1, 0, 0]), [dirSwz[0], dirSwz[1], dirSwz[2]]);
+ var f3 = deMath.swizzle(([1, 1, 0]), [dirSwz[0], dirSwz[1], dirSwz[2]]);
+
+ var v0 = glsTextureTestUtil.selectCoords(p0, p1, f0);
+ var v1 = glsTextureTestUtil.selectCoords(p0, p1, f1);
+ var v2 = glsTextureTestUtil.selectCoords(p0, p1, f2);
+ var v3 = glsTextureTestUtil.selectCoords(p0, p1, f3);
+
+ dst[0] = v0[0]; dst[1] = v0[1]; dst[2] = v0[2];
+ dst[3] = v1[0]; dst[4] = v1[1]; dst[5] = v1[2];
+ dst[6] = v2[0]; dst[7] = v2[1]; dst[8] = v2[2];
+ dst[9] = v3[0]; dst[10] = v3[1]; dst[11] = v3[2];
+
+ return dst;
+};
+
+/**
+ * @enum
+ */
+glsTextureTestUtil.programType = {
+ PROGRAM_2D_FLOAT: 0,
+ PROGRAM_2D_INT: 1,
+ PROGRAM_2D_UINT: 2,
+ PROGRAM_2D_SHADOW: 3,
+
+ PROGRAM_2D_FLOAT_BIAS: 4,
+ PROGRAM_2D_INT_BIAS: 5,
+ PROGRAM_2D_UINT_BIAS: 6,
+ PROGRAM_2D_SHADOW_BIAS: 7,
+
+ PROGRAM_1D_FLOAT: 8,
+ PROGRAM_1D_INT: 9,
+ PROGRAM_1D_UINT: 10,
+ PROGRAM_1D_SHADOW: 11,
+
+ PROGRAM_1D_FLOAT_BIAS: 12,
+ PROGRAM_1D_INT_BIAS: 13,
+ PROGRAM_1D_UINT_BIAS: 14,
+ PROGRAM_1D_SHADOW_BIAS: 15,
+
+ PROGRAM_CUBE_FLOAT: 16,
+ PROGRAM_CUBE_INT: 17,
+ PROGRAM_CUBE_UINT: 18,
+ PROGRAM_CUBE_SHADOW: 19,
+
+ PROGRAM_CUBE_FLOAT_BIAS: 20,
+ PROGRAM_CUBE_INT_BIAS: 21,
+ PROGRAM_CUBE_UINT_BIAS: 22,
+ PROGRAM_CUBE_SHADOW_BIAS: 23,
+
+ PROGRAM_1D_ARRAY_FLOAT: 24,
+ PROGRAM_1D_ARRAY_INT: 25,
+ PROGRAM_1D_ARRAY_UINT: 26,
+ PROGRAM_1D_ARRAY_SHADOW: 27,
+
+ PROGRAM_2D_ARRAY_FLOAT: 28,
+ PROGRAM_2D_ARRAY_INT: 29,
+ PROGRAM_2D_ARRAY_UINT: 30,
+ PROGRAM_2D_ARRAY_SHADOW: 31,
+
+ PROGRAM_3D_FLOAT: 32,
+ PROGRAM_3D_INT: 33,
+ PROGRAM_3D_UINT: 34,
+
+ PROGRAM_3D_FLOAT_BIAS: 35,
+ PROGRAM_3D_INT_BIAS: 36,
+ PROGRAM_3D_UINT_BIAS: 37,
+
+ PROGRAM_CUBE_ARRAY_FLOAT: 38,
+ PROGRAM_CUBE_ARRAY_INT: 39,
+ PROGRAM_CUBE_ARRAY_UINT: 40,
+ PROGRAM_CUBE_ARRAY_SHADOW: 41,
+
+ PROGRAM_BUFFER_FLOAT: 42,
+ PROGRAM_BUFFER_INT: 43,
+ PROGRAM_BUFFER_UINT: 44
+};
+
+/**
+ * @constructor
+ * @param {string} version GL version
+ * @param {gluShaderUtil.precision} precision
+ */
+glsTextureTestUtil.ProgramLibrary = function(version, precision) {
+ this.m_glslVersion = version;
+ this.m_texCoordPrecision = precision;
+};
+
+/**
+ * @param {glsTextureTestUtil.programType} program
+ * @return {gluShaderProgram.ShaderProgram}
+ */
+glsTextureTestUtil.ProgramLibrary.prototype.getProgram = function(program) {
+ /* TODO: Implement */
+ // if (m_programs.find(program) != m_programs.end())
+ // return m_programs[program]; // Return from cache.
+
+ var vertShaderTemplate =
+ '${VTX_HEADER}' +
+ '${VTX_IN} highp vec4 a_position;\n' +
+ '${VTX_IN} ${PRECISION} ${TEXCOORD_TYPE} a_texCoord;\n' +
+ '${VTX_OUT} ${PRECISION} ${TEXCOORD_TYPE} v_texCoord;\n' +
+ '\n' +
+ 'void main (void)\n' +
+ ' {\n' +
+ ' gl_Position = a_position;\n' +
+ ' v_texCoord = a_texCoord;\n' +
+ '}\n';
+ var fragShaderTemplate =
+ '${FRAG_HEADER}' +
+ '${FRAG_IN} ${PRECISION} ${TEXCOORD_TYPE} v_texCoord;\n' +
+ 'uniform ${PRECISION} float u_bias;\n' +
+ 'uniform ${PRECISION} float u_ref;\n' +
+ 'uniform ${PRECISION} vec4 u_colorScale;\n' +
+ 'uniform ${PRECISION} vec4 u_colorBias;\n' +
+ 'uniform ${PRECISION} ${SAMPLER_TYPE} u_sampler;\n' +
+ '\n' +
+ 'void main (void)\n' +
+ ' {\n' +
+ ' ${FRAG_COLOR} = ${LOOKUP} * u_colorScale + u_colorBias;\n' +
+ '}\n';
+
+ var params = [];
+
+ var isCube = deMath.deInRange32(program, glsTextureTestUtil.programType.PROGRAM_CUBE_FLOAT, glsTextureTestUtil.programType.PROGRAM_CUBE_SHADOW_BIAS);
+ var isArray = deMath.deInRange32(program, glsTextureTestUtil.programType.PROGRAM_2D_ARRAY_FLOAT, glsTextureTestUtil.programType.PROGRAM_2D_ARRAY_SHADOW) ||
+ deMath.deInRange32(program, glsTextureTestUtil.programType.PROGRAM_1D_ARRAY_FLOAT, glsTextureTestUtil.programType.PROGRAM_1D_ARRAY_SHADOW);
+
+ var is1D = deMath.deInRange32(program, glsTextureTestUtil.programType.PROGRAM_1D_FLOAT, glsTextureTestUtil.programType.PROGRAM_1D_UINT_BIAS) ||
+ deMath.deInRange32(program, glsTextureTestUtil.programType.PROGRAM_1D_ARRAY_FLOAT, glsTextureTestUtil.programType.PROGRAM_1D_ARRAY_SHADOW) ||
+ deMath.deInRange32(program, glsTextureTestUtil.programType.PROGRAM_BUFFER_FLOAT, glsTextureTestUtil.programType.PROGRAM_BUFFER_UINT);
+
+ var is2D = deMath.deInRange32(program, glsTextureTestUtil.programType.PROGRAM_2D_FLOAT, glsTextureTestUtil.programType.PROGRAM_2D_UINT_BIAS) ||
+ deMath.deInRange32(program, glsTextureTestUtil.programType.PROGRAM_2D_ARRAY_FLOAT, glsTextureTestUtil.programType.PROGRAM_2D_ARRAY_SHADOW);
+
+ var is3D = deMath.deInRange32(program, glsTextureTestUtil.programType.PROGRAM_3D_FLOAT, glsTextureTestUtil.programType.PROGRAM_3D_UINT_BIAS);
+ var isCubeArray = deMath.deInRange32(program, glsTextureTestUtil.programType.PROGRAM_CUBE_ARRAY_FLOAT, glsTextureTestUtil.programType.PROGRAM_CUBE_ARRAY_SHADOW);
+ var isBuffer = deMath.deInRange32(program, glsTextureTestUtil.programType.PROGRAM_BUFFER_FLOAT, glsTextureTestUtil.programType.PROGRAM_BUFFER_UINT);
+
+ if (this.m_glslVersion === '100 es') {
+ params['FRAG_HEADER'] = '';
+ params['VTX_HEADER'] = '';
+ params['VTX_IN'] = 'attribute';
+ params['VTX_OUT'] = 'varying';
+ params['FRAG_IN'] = 'varying';
+ params['FRAG_COLOR'] = 'gl_FragColor';
+ } else if (this.m_glslVersion === '300 es' || this.m_glslVersion === '310 es' || this.m_glslVersion === '330 es') {
+ var ext = null;
+
+ // if (isCubeArray && glu::glslVersionIsES(m_glslVersion))
+ // ext = "gl.EXT_texture_cube_map_array";
+ // else if (isBuffer && glu::glslVersionIsES(m_glslVersion))
+ // ext = "gl.EXT_texture_buffer";
+
+ var extension = '';
+ if (ext)
+ extension = '\n#extension ' + ext + ' : require';
+
+ params['FRAG_HEADER'] = '#version ' + this.m_glslVersion + extension + '\nlayout(location = 0) out mediump vec4 dEQP_FragColor;\n';
+ params['VTX_HEADER'] = '#version ' + this.m_glslVersion + '\n';
+ params['VTX_IN'] = 'in';
+ params['VTX_OUT'] = 'out';
+ params['FRAG_IN'] = 'in';
+ params['FRAG_COLOR'] = 'dEQP_FragColor';
+ } else
+ throw new Error('Unsupported version: ' + this.m_glslVersion);
+
+ params['PRECISION'] = gluShaderUtil.getPrecisionName(this.m_texCoordPrecision);
+
+ if (isCubeArray)
+ params['TEXCOORD_TYPE'] = 'vec4';
+ else if (isCube || (is2D && isArray) || is3D)
+ params['TEXCOORD_TYPE'] = 'vec3';
+ else if ((is1D && isArray) || is2D)
+ params['TEXCOORD_TYPE'] = 'vec2';
+ else if (is1D)
+ params['TEXCOORD_TYPE'] = 'float';
+ else
+ DE_ASSERT(false);
+
+ var sampler = null;
+ var lookup = null;
+
+ if (this.m_glslVersion === '300 es' || this.m_glslVersion === '310 es' || this.m_glslVersion === '330 es') {
+ switch (program) {
+ case glsTextureTestUtil.programType.PROGRAM_2D_FLOAT: sampler = 'sampler2D'; lookup = 'texture(u_sampler, v_texCoord)'; break;
+ case glsTextureTestUtil.programType.PROGRAM_2D_INT: sampler = 'isampler2D'; lookup = 'vec4(texture(u_sampler, v_texCoord))'; break;
+ case glsTextureTestUtil.programType.PROGRAM_2D_UINT: sampler = 'usampler2D'; lookup = 'vec4(texture(u_sampler, v_texCoord))'; break;
+ case glsTextureTestUtil.programType.PROGRAM_2D_SHADOW: sampler = 'sampler2DShadow'; lookup = 'vec4(texture(u_sampler, vec3(v_texCoord, u_ref)), 0.0, 0.0, 1.0)'; break;
+ case glsTextureTestUtil.programType.PROGRAM_2D_FLOAT_BIAS: sampler = 'sampler2D'; lookup = 'texture(u_sampler, v_texCoord, u_bias)'; break;
+ case glsTextureTestUtil.programType.PROGRAM_2D_INT_BIAS: sampler = 'isampler2D'; lookup = 'vec4(texture(u_sampler, v_texCoord, u_bias))'; break;
+ case glsTextureTestUtil.programType.PROGRAM_2D_UINT_BIAS: sampler = 'usampler2D'; lookup = 'vec4(texture(u_sampler, v_texCoord, u_bias))'; break;
+ case glsTextureTestUtil.programType.PROGRAM_2D_SHADOW_BIAS: sampler = 'sampler2DShadow'; lookup = 'vec4(texture(u_sampler, vec3(v_texCoord, u_ref), u_bias), 0.0, 0.0, 1.0)'; break;
+ case glsTextureTestUtil.programType.PROGRAM_1D_FLOAT: sampler = 'sampler1D'; lookup = 'texture(u_sampler, v_texCoord)'; break;
+ case glsTextureTestUtil.programType.PROGRAM_1D_INT: sampler = 'isampler1D'; lookup = 'vec4(texture(u_sampler, v_texCoord))'; break;
+ case glsTextureTestUtil.programType.PROGRAM_1D_UINT: sampler = 'usampler1D'; lookup = 'vec4(texture(u_sampler, v_texCoord))'; break;
+ case glsTextureTestUtil.programType.PROGRAM_1D_SHADOW: sampler = 'sampler1DShadow'; lookup = 'vec4(texture(u_sampler, vec3(v_texCoord, u_ref)), 0.0, 0.0, 1.0)'; break;
+ case glsTextureTestUtil.programType.PROGRAM_1D_FLOAT_BIAS: sampler = 'sampler1D'; lookup = 'texture(u_sampler, v_texCoord, u_bias)'; break;
+ case glsTextureTestUtil.programType.PROGRAM_1D_INT_BIAS: sampler = 'isampler1D'; lookup = 'vec4(texture(u_sampler, v_texCoord, u_bias))'; break;
+ case glsTextureTestUtil.programType.PROGRAM_1D_UINT_BIAS: sampler = 'usampler1D'; lookup = 'vec4(texture(u_sampler, v_texCoord, u_bias))'; break;
+ case glsTextureTestUtil.programType.PROGRAM_1D_SHADOW_BIAS: sampler = 'sampler1DShadow'; lookup = 'vec4(texture(u_sampler, vec3(v_texCoord, u_ref), u_bias), 0.0, 0.0, 1.0)'; break;
+ case glsTextureTestUtil.programType.PROGRAM_CUBE_FLOAT: sampler = 'samplerCube'; lookup = 'texture(u_sampler, v_texCoord)'; break;
+ case glsTextureTestUtil.programType.PROGRAM_CUBE_INT: sampler = 'isamplerCube'; lookup = 'vec4(texture(u_sampler, v_texCoord))'; break;
+ case glsTextureTestUtil.programType.PROGRAM_CUBE_UINT: sampler = 'usamplerCube'; lookup = 'vec4(texture(u_sampler, v_texCoord))'; break;
+ case glsTextureTestUtil.programType.PROGRAM_CUBE_SHADOW: sampler = 'samplerCubeShadow'; lookup = 'vec4(texture(u_sampler, vec4(v_texCoord, u_ref)), 0.0, 0.0, 1.0)'; break;
+ case glsTextureTestUtil.programType.PROGRAM_CUBE_FLOAT_BIAS: sampler = 'samplerCube'; lookup = 'texture(u_sampler, v_texCoord, u_bias)'; break;
+ case glsTextureTestUtil.programType.PROGRAM_CUBE_INT_BIAS: sampler = 'isamplerCube'; lookup = 'vec4(texture(u_sampler, v_texCoord, u_bias))'; break;
+ case glsTextureTestUtil.programType.PROGRAM_CUBE_UINT_BIAS: sampler = 'usamplerCube'; lookup = 'vec4(texture(u_sampler, v_texCoord, u_bias))'; break;
+ case glsTextureTestUtil.programType.PROGRAM_CUBE_SHADOW_BIAS: sampler = 'samplerCubeShadow'; lookup = 'vec4(texture(u_sampler, vec4(v_texCoord, u_ref), u_bias), 0.0, 0.0, 1.0)'; break;
+ case glsTextureTestUtil.programType.PROGRAM_2D_ARRAY_FLOAT: sampler = 'sampler2DArray'; lookup = 'texture(u_sampler, v_texCoord)'; break;
+ case glsTextureTestUtil.programType.PROGRAM_2D_ARRAY_INT: sampler = 'isampler2DArray'; lookup = 'vec4(texture(u_sampler, v_texCoord))'; break;
+ case glsTextureTestUtil.programType.PROGRAM_2D_ARRAY_UINT: sampler = 'usampler2DArray'; lookup = 'vec4(texture(u_sampler, v_texCoord))'; break;
+ case glsTextureTestUtil.programType.PROGRAM_2D_ARRAY_SHADOW: sampler = 'sampler2DArrayShadow'; lookup = 'vec4(texture(u_sampler, vec4(v_texCoord, u_ref)), 0.0, 0.0, 1.0)'; break;
+ case glsTextureTestUtil.programType.PROGRAM_3D_FLOAT: sampler = 'sampler3D'; lookup = 'texture(u_sampler, v_texCoord)'; break;
+ case glsTextureTestUtil.programType.PROGRAM_3D_INT: sampler = 'isampler3D'; lookup = 'vec4(texture(u_sampler, v_texCoord))'; break;
+ case glsTextureTestUtil.programType.PROGRAM_3D_UINT: sampler = ' usampler3D'; lookup = 'vec4(texture(u_sampler, v_texCoord))'; break;
+ case glsTextureTestUtil.programType.PROGRAM_3D_FLOAT_BIAS: sampler = 'sampler3D'; lookup = 'texture(u_sampler, v_texCoord, u_bias)'; break;
+ case glsTextureTestUtil.programType.PROGRAM_3D_INT_BIAS: sampler = 'isampler3D'; lookup = 'vec4(texture(u_sampler, v_texCoord, u_bias))'; break;
+ case glsTextureTestUtil.programType.PROGRAM_3D_UINT_BIAS: sampler = ' usampler3D'; lookup = 'vec4(texture(u_sampler, v_texCoord, u_bias))'; break;
+ case glsTextureTestUtil.programType.PROGRAM_CUBE_ARRAY_FLOAT: sampler = 'samplerCubeArray'; lookup = 'texture(u_sampler, v_texCoord)'; break;
+ case glsTextureTestUtil.programType.PROGRAM_CUBE_ARRAY_INT: sampler = 'isamplerCubeArray'; lookup = 'vec4(texture(u_sampler, v_texCoord))'; break;
+ case glsTextureTestUtil.programType.PROGRAM_CUBE_ARRAY_UINT: sampler = 'usamplerCubeArray'; lookup = 'vec4(texture(u_sampler, v_texCoord))'; break;
+ case glsTextureTestUtil.programType.PROGRAM_CUBE_ARRAY_SHADOW: sampler = 'samplerCubeArrayShadow'; lookup = 'vec4(texture(u_sampler, vec4(v_texCoord, u_ref)), 0.0, 0.0, 1.0)'; break;
+ case glsTextureTestUtil.programType.PROGRAM_1D_ARRAY_FLOAT: sampler = 'sampler1DArray'; lookup = 'texture(u_sampler, v_texCoord)'; break;
+ case glsTextureTestUtil.programType.PROGRAM_1D_ARRAY_INT: sampler = 'isampler1DArray'; lookup = 'vec4(texture(u_sampler, v_texCoord))'; break;
+ case glsTextureTestUtil.programType.PROGRAM_1D_ARRAY_UINT: sampler = 'usampler1DArray'; lookup = 'vec4(texture(u_sampler, v_texCoord))'; break;
+ case glsTextureTestUtil.programType.PROGRAM_1D_ARRAY_SHADOW: sampler = 'sampler1DArrayShadow'; lookup = 'vec4(texture(u_sampler, vec4(v_texCoord, u_ref)), 0.0, 0.0, 1.0)'; break;
+ case glsTextureTestUtil.programType.PROGRAM_BUFFER_FLOAT: sampler = 'samplerBuffer'; lookup = 'texelFetch(u_sampler, int(v_texCoord))'; break;
+ case glsTextureTestUtil.programType.PROGRAM_BUFFER_INT: sampler = 'isamplerBuffer'; lookup = 'vec4(texelFetch(u_sampler, int(v_texCoord)))'; break;
+ case glsTextureTestUtil.programType.PROGRAM_BUFFER_UINT: sampler = 'usamplerBuffer'; lookup = 'vec4(texelFetch(u_sampler, int(v_texCoord)))'; break;
+ default:
+ DE_ASSERT(false);
+ }
+ } else if (this.m_glslVersion === '100 es') {
+ sampler = isCube ? 'samplerCube' : 'sampler2D';
+
+ switch (program) {
+ case glsTextureTestUtil.programType.PROGRAM_2D_FLOAT: lookup = 'texture2D(u_sampler, v_texCoord)'; break;
+ case glsTextureTestUtil.programType.PROGRAM_2D_FLOAT_BIAS: lookup = 'texture2D(u_sampler, v_texCoord, u_bias)'; break;
+ case glsTextureTestUtil.programType.PROGRAM_CUBE_FLOAT: lookup = 'textureCube(u_sampler, v_texCoord)'; break;
+ case glsTextureTestUtil.programType.PROGRAM_CUBE_FLOAT_BIAS: lookup = 'textureCube(u_sampler, v_texCoord, u_bias)'; break;
+ default:
+ DE_ASSERT(false);
+ }
+ } else
+ DE_ASSERT(!'Unsupported version');
+
+ params['SAMPLER_TYPE'] = sampler;
+ params['LOOKUP'] = lookup;
+
+ var vertSrc = tcuStringTemplate.specialize(vertShaderTemplate, params);
+ var fragSrc = tcuStringTemplate.specialize(fragShaderTemplate, params);
+ var progObj = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vertSrc, fragSrc));
+ // if (!progObj.isOk()) {
+ // // log << *progObj;
+ // testFailedOptions("Failed to create shader", true);
+ // }
+
+ // try
+ // {
+ // m_programs[program] = progObj;
+ // }
+ // catch (...)
+ // {
+ // delete progObj;
+ // throw;
+ // }
+
+ return progObj;
+};
+
+// public:
+// glsTextureTestUtil.ProgramLibrary (const glu::RenderContext& context, tcu::TestContext& testCtx, glu::GLSLVersion glslVersion, glu::Precision texCoordPrecision);
+// ~glsTextureTestUtil.ProgramLibrary (void);
+
+// glu::ShaderProgram* getProgram (Program program);
+// void clear (void);
+
+// private:
+// glsTextureTestUtil.ProgramLibrary (const glsTextureTestUtil.ProgramLibrary& other);
+// glsTextureTestUtil.ProgramLibrary& operator= (const glsTextureTestUtil.ProgramLibrary& other);
+
+// const glu::RenderContext& m_context;
+// tcu::TestContext& m_testCtx;
+// glu::GLSLVersion m_glslVersion;
+// glu::Precision m_texCoordPrecision;
+// std::map<Program, glu::ShaderProgram*> m_programs;
+// };
+
+/**
+ * @constructor
+ * @param {string} version GL version
+ * @param {gluShaderUtil.precision} precision
+ */
+glsTextureTestUtil.TextureRenderer = function(version, precision) {
+ this.m_programLibrary = new glsTextureTestUtil.ProgramLibrary(version, precision);
+};
+
+/**
+ * @param {tcuPixelFormat.PixelFormat} format
+ * @return {Array<boolean>}
+ */
+glsTextureTestUtil.getCompareMask = function(format) {
+ return [
+ format.redBits > 0,
+ format.greenBits > 0,
+ format.blueBits > 0,
+ format.alphaBits > 0
+ ];
+};
+
+/**
+ * @param {tcuPixelFormat.PixelFormat} format
+ * @return {Array<number>}
+ */
+glsTextureTestUtil.getBitsVec = function(format) {
+ return [
+ format.redBits,
+ format.greenBits,
+ format.blueBits,
+ format.alphaBits
+ ];
+};
+
+/**
+ * @param {number} texUnit
+ * @param {Array<number>} texCoord
+ * @param {glsTextureTestUtil.RenderParams} params
+ */
+glsTextureTestUtil.TextureRenderer.prototype.renderQuad = function(texUnit, texCoord, params) {
+ var wCoord = params.flags.projected ? params.w : [1, 1, 1, 1];
+ var useBias = params.flags.use_bias;
+ var logUniforms = params.flags.log_uniforms;
+
+ // Render quad with texture.
+ var position = [
+ -1 * wCoord[0], -1 * wCoord[0], 0, wCoord[0],
+ -1 * wCoord[1], +1 * wCoord[1], 0, wCoord[1],
+ +1 * wCoord[2], -1 * wCoord[2], 0, wCoord[2],
+ +1 * wCoord[3], +1 * wCoord[3], 0, wCoord[3]
+ ];
+ /** @const */ var indices = [0, 1, 2, 2, 1, 3];
+
+ /** @type {?glsTextureTestUtil.programType} */ var progSpec = null;
+ var numComps = 0;
+ if (params.texType == glsTextureTestUtil.textureType.TEXTURETYPE_2D) {
+ numComps = 2;
+
+ switch (params.samplerType) {
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_FLOAT: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_2D_FLOAT_BIAS : glsTextureTestUtil.programType.PROGRAM_2D_FLOAT; break;
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_INT: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_2D_INT_BIAS : glsTextureTestUtil.programType.PROGRAM_2D_INT; break;
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_UINT: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_2D_UINT_BIAS : glsTextureTestUtil.programType.PROGRAM_2D_UINT; break;
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_SHADOW: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_2D_SHADOW_BIAS : glsTextureTestUtil.programType.PROGRAM_2D_SHADOW; break;
+ default: throw new Error('Unrecognized sampler type:' + params.samplerType);
+ }
+ } else if (params.texType == glsTextureTestUtil.textureType.TEXTURETYPE_1D) {
+ numComps = 1;
+
+ switch (params.samplerType) {
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_FLOAT: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_1D_FLOAT_BIAS : glsTextureTestUtil.programType.PROGRAM_1D_FLOAT; break;
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_INT: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_1D_INT_BIAS : glsTextureTestUtil.programType.PROGRAM_1D_INT; break;
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_UINT: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_1D_UINT_BIAS : glsTextureTestUtil.programType.PROGRAM_1D_UINT; break;
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_SHADOW: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_1D_SHADOW_BIAS : glsTextureTestUtil.programType.PROGRAM_1D_SHADOW; break;
+ default: throw new Error('Unrecognized sampler type:' + params.samplerType);
+ }
+ } else if (params.texType == glsTextureTestUtil.textureType.TEXTURETYPE_CUBE) {
+ numComps = 3;
+
+ switch (params.samplerType) {
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_FLOAT: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_CUBE_FLOAT_BIAS : glsTextureTestUtil.programType.PROGRAM_CUBE_FLOAT; break;
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_INT: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_CUBE_INT_BIAS : glsTextureTestUtil.programType.PROGRAM_CUBE_INT; break;
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_UINT: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_CUBE_UINT_BIAS : glsTextureTestUtil.programType.PROGRAM_CUBE_UINT; break;
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_SHADOW: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_CUBE_SHADOW_BIAS : glsTextureTestUtil.programType.PROGRAM_CUBE_SHADOW; break;
+ default: throw new Error('Unrecognized sampler type:' + params.samplerType);
+ }
+ } else if (params.texType == glsTextureTestUtil.textureType.TEXTURETYPE_3D) {
+ numComps = 3;
+
+ switch (params.samplerType) {
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_FLOAT: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_3D_FLOAT_BIAS : glsTextureTestUtil.programType.PROGRAM_3D_FLOAT; break;
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_INT: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_3D_INT_BIAS : glsTextureTestUtil.programType.PROGRAM_3D_INT; break;
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_UINT: progSpec = useBias ? glsTextureTestUtil.programType.PROGRAM_3D_UINT_BIAS : glsTextureTestUtil.programType.PROGRAM_3D_UINT; break;
+ default: throw new Error('Unrecognized sampler type:' + params.samplerType);
+ }
+ } else if (params.texType == glsTextureTestUtil.textureType.TEXTURETYPE_2D_ARRAY) {
+ DE_ASSERT(!useBias); // \todo [2012-02-17 pyry] Support bias.
+
+ numComps = 3;
+
+ switch (params.samplerType) {
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_FLOAT: progSpec = glsTextureTestUtil.programType.PROGRAM_2D_ARRAY_FLOAT; break;
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_INT: progSpec = glsTextureTestUtil.programType.PROGRAM_2D_ARRAY_INT; break;
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_UINT: progSpec = glsTextureTestUtil.programType.PROGRAM_2D_ARRAY_UINT; break;
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_SHADOW: progSpec = glsTextureTestUtil.programType.PROGRAM_2D_ARRAY_SHADOW; break;
+ default: throw new Error('Unrecognized sampler type:' + params.samplerType);
+ }
+ } else if (params.texType == glsTextureTestUtil.textureType.TEXTURETYPE_CUBE_ARRAY) {
+ DE_ASSERT(!useBias);
+
+ numComps = 4;
+
+ switch (params.samplerType) {
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_FLOAT: progSpec = glsTextureTestUtil.programType.PROGRAM_CUBE_ARRAY_FLOAT; break;
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_INT: progSpec = glsTextureTestUtil.programType.PROGRAM_CUBE_ARRAY_INT; break;
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_UINT: progSpec = glsTextureTestUtil.programType.PROGRAM_CUBE_ARRAY_UINT; break;
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_SHADOW: progSpec = glsTextureTestUtil.programType.PROGRAM_CUBE_ARRAY_SHADOW; break;
+ default: throw new Error('Unrecognized sampler type:' + params.samplerType);
+ }
+ } else if (params.texType == glsTextureTestUtil.textureType.TEXTURETYPE_1D_ARRAY) {
+ DE_ASSERT(!useBias); // \todo [2012-02-17 pyry] Support bias.
+
+ numComps = 2;
+
+ switch (params.samplerType) {
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_FLOAT: progSpec = glsTextureTestUtil.programType.PROGRAM_1D_ARRAY_FLOAT; break;
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_INT: progSpec = glsTextureTestUtil.programType.PROGRAM_1D_ARRAY_INT; break;
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_UINT: progSpec = glsTextureTestUtil.programType.PROGRAM_1D_ARRAY_UINT; break;
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_SHADOW: progSpec = glsTextureTestUtil.programType.PROGRAM_1D_ARRAY_SHADOW; break;
+ default: throw new Error('Unrecognized sampler type:' + params.samplerType);
+ }
+ } else if (params.texType == glsTextureTestUtil.textureType.TEXTURETYPE_BUFFER) {
+ numComps = 1;
+
+ switch (params.samplerType) {
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_FETCH_FLOAT: progSpec = glsTextureTestUtil.programType.PROGRAM_BUFFER_FLOAT; break;
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_FETCH_INT: progSpec = glsTextureTestUtil.programType.PROGRAM_BUFFER_INT; break;
+ case glsTextureTestUtil.samplerType.SAMPLERTYPE_FETCH_UINT: progSpec = glsTextureTestUtil.programType.PROGRAM_BUFFER_UINT; break;
+ default: throw new Error('Unrecognized sampler type:' + params.samplerType);
+ }
+ } else
+ throw new Error('Unrecognized texture type:' + params.texType);
+
+ if (progSpec === null)
+ throw new Error('Could not find program specification');
+
+ var program = this.m_programLibrary.getProgram(progSpec);
+
+ // \todo [2012-09-26 pyry] Move to glsTextureTestUtil.ProgramLibrary and log unique programs only(?)
+ /* TODO: Port logging
+ if (params.flags.log_programs)
+ log << *program;
+ */
+
+ // Program and uniforms.
+ var prog = program.getProgram();
+ gl.useProgram(prog);
+
+ var loc = gl.getUniformLocation(prog, 'u_sampler');
+ gl.uniform1i(loc, texUnit);
+ // if (logUniforms)
+ // log << TestLog::Message << "u_sampler = " << texUnit << TestLog::EndMessage;
+
+ if (useBias) {
+ gl.uniform1f(gl.getUniformLocation(prog, 'u_bias'), params.bias);
+ // if (logUniforms)
+ // log << TestLog::Message << "u_bias = " << params.bias << TestLog::EndMessage;
+ }
+
+ if (params.samplerType == glsTextureTestUtil.samplerType.SAMPLERTYPE_SHADOW) {
+ gl.uniform1f(gl.getUniformLocation(prog, 'u_ref'), params.ref);
+ // if (logUniforms)
+ // log << TestLog::Message << "u_ref = " << params.ref << TestLog::EndMessage;
+ }
+
+ gl.uniform4fv(gl.getUniformLocation(prog, 'u_colorScale'), params.colorScale);
+ gl.uniform4fv(gl.getUniformLocation(prog, 'u_colorBias'), params.colorBias);
+
+ // if (logUniforms)
+ // {
+ // log << TestLog::Message << "u_colorScale = " << params.colorScale << TestLog::EndMessage;
+ // log << TestLog::Message << "u_colorBias = " << params.colorBias << TestLog::EndMessage;
+ // }
+ var vertexArrays = [];
+
+ var posLoc = gl.getAttribLocation(prog, 'a_position');
+ if (posLoc === -1) {
+ testFailedOptions("no location found for attribute 'a_position'", true);
+ }
+ var texLoc = gl.getAttribLocation(prog, 'a_texCoord');
+ if (texLoc === -1) {
+ testFailedOptions("no location found for attribute 'a_texCoord'", true);
+ }
+
+ vertexArrays.push(new gluDrawUtil.VertexArrayBinding(gl.FLOAT, posLoc, 4, 4, position));
+ vertexArrays.push(new gluDrawUtil.VertexArrayBinding(gl.FLOAT, texLoc, numComps, 4, texCoord));
+ gluDrawUtil.draw(gl, prog, vertexArrays, gluDrawUtil.triangles(indices));
+};
+
+// public:
+// glsTextureTestUtil.TextureRenderer (const glu::RenderContext& context, tcu::TestContext& testCtx, glu::GLSLVersion glslVersion, glu::Precision texCoordPrecision);
+// ~glsTextureTestUtil.TextureRenderer (void);
+
+// void clear (void); //!< Frees allocated resources. Destructor will call clear() as well.
+
+// void renderQuad (int texUnit, const float* texCoord, TextureType texType);
+// void renderQuad (int texUnit, const float* texCoord, const glsTextureTestUtil.RenderParams& params);
+
+// private:
+// glsTextureTestUtil.TextureRenderer (const glsTextureTestUtil.TextureRenderer& other);
+// glsTextureTestUtil.TextureRenderer& operator= (const glsTextureTestUtil.TextureRenderer& other);
+
+// const glu::RenderContext& m_renderCtx;
+// tcu::TestContext& m_testCtx;
+// glsTextureTestUtil.ProgramLibrary m_programLibrary;
+// };
+
+/**
+ * @constructor
+ * @param {tcuSurface.Surface} surface
+ * @param {tcuPixelFormat.PixelFormat=} colorFmt
+ * @param {number=} x
+ * @param {number=} y
+ * @param {number=} width
+ * @param {number=} height
+ */
+glsTextureTestUtil.SurfaceAccess = function(surface, colorFmt, x, y, width, height) {
+ this.m_surface = surface;
+ this.colorMask = undefined; /*TODO*/
+ this.m_x = x || 0;
+ this.m_y = y || 0;
+ this.m_width = width || surface.getWidth();
+ this.m_height = height || surface.getHeight();
+};
+
+/** @return {number} */
+glsTextureTestUtil.SurfaceAccess.prototype.getWidth = function() { return this.m_width; };
+/** @return {number} */
+glsTextureTestUtil.SurfaceAccess.prototype.getHeight = function() { return this.m_height; };
+
+/**
+ * @param {Array<number>} color
+ * @param {number} x
+ * @param {number} y
+ */
+glsTextureTestUtil.SurfaceAccess.prototype.setPixel = function(color, x, y) {
+ /* TODO: Apply color mask */
+ var c = color;
+ for (var i = 0; i < c.length; i++)
+ c[i] = deMath.clamp(Math.round(color[i] * 255), 0, 255);
+ this.m_surface.setPixel(x, y, c);
+};
+
+/**
+ * @param {glsTextureTestUtil.lodMode} mode
+ * @param {number} dudx
+ * @param {number} dvdx
+ * @param {number} dwdx
+ * @param {number} dudy
+ * @param {number} dvdy
+ * @param {number} dwdy
+ * @return {number}
+ */
+glsTextureTestUtil.computeLodFromDerivates3D = function(mode, dudx, dvdx, dwdx, dudy, dvdy, dwdy) {
+ var p = 0;
+ switch (mode) {
+ case glsTextureTestUtil.lodMode.EXACT:
+ p = Math.max(Math.sqrt(dudx * dudx + dvdx * dvdx + dwdx * dwdx), Math.sqrt(dudy * dudy + dvdy * dvdy + dwdy * dwdy));
+ break;
+
+ case glsTextureTestUtil.lodMode.MIN_BOUND:
+ case glsTextureTestUtil.lodMode.MAX_BOUND: {
+ var mu = Math.max(Math.abs(dudx), Math.abs(dudy));
+ var mv = Math.max(Math.abs(dvdx), Math.abs(dvdy));
+ var mw = Math.max(Math.abs(dwdx), Math.abs(dwdy));
+
+ p = (mode == glsTextureTestUtil.lodMode.MIN_BOUND) ? Math.max(mu, mv, mw) : mu + mv + mw;
+ break;
+ }
+
+ default:
+ DE_ASSERT(false);
+ }
+
+ // Native dEQP uses 32-bit numbers. So here 64-bit floating numbers should be transformed into 32-bit ones to ensure the correctness of the result.
+ return deMath.toFloat32(Math.log(p)) * deMath.INV_LOG_2_FLOAT32;
+};
+
+/**
+ * @param {glsTextureTestUtil.lodMode} mode
+ * @param {Array<number>} dstSize
+ * @param {Array<number>} srcSize
+ * @param {Array<number>} sq
+ * @param {Array<number>} tq
+ * @param {Array<number>=} rq
+ * @return {number}
+ */
+glsTextureTestUtil.computeNonProjectedTriLod = function(mode, dstSize, srcSize, sq, tq, rq) {
+ var dux = (sq[2] - sq[0]) * srcSize[0];
+ var duy = (sq[1] - sq[0]) * srcSize[0];
+ var dvx = (tq[2] - tq[0]) * srcSize[1];
+ var dvy = (tq[1] - tq[0]) * srcSize[1];
+ var dwx = 0;
+ var dwy = 0;
+ if (rq) {
+ dwx = (rq[2] - rq[0]) * srcSize[2];
+ dwy = (rq[1] - rq[0]) * srcSize[2];
+ }
+ var dx = dstSize[0];
+ var dy = dstSize[1];
+
+ return glsTextureTestUtil.computeLodFromDerivates3D(mode, dux / dx, dvx / dx, dwx / dx, duy / dy, dvy / dy, dwy / dy);
+};
+
+/**
+ * @param {Array<number>} v
+ * @param {number} x
+ * @param {number} y
+ * @return {number}
+ */
+glsTextureTestUtil.triangleInterpolate = function(v, x, y) {
+ return v[0] + (v[2] - v[0]) * x + (v[1] - v[0]) * y;
+};
+
+/**
+ * @param {Array<number>} s
+ * @param {Array<number>} w
+ * @param {number} wx
+ * @param {number} width
+ * @param {number} ny
+ * @return {number}
+ */
+glsTextureTestUtil.triDerivateX = function(s, w, wx, width, ny) {
+ var d = w[1] * w[2] * (width * (ny - 1) + wx) - w[0] * (w[2] * width * ny + w[1] * wx);
+ return (w[0] * w[1] * w[2] * width * (w[1] * (s[0] - s[2]) * (ny - 1) + ny * (w[2] * (s[1] - s[0]) + w[0] * (s[2] - s[1])))) / (d * d);
+};
+
+/**
+ * @param {Array<number>} s
+ * @param {Array<number>} w
+ * @param {number} wy
+ * @param {number} height
+ * @param {number} nx
+ * @return {number}
+ */
+glsTextureTestUtil.triDerivateY = function(s, w, wy, height, nx) {
+ var d = w[1] * w[2] * (height * (nx - 1) + wy) - w[0] * (w[1] * height * nx + w[2] * wy);
+ return (w[0] * w[1] * w[2] * height * (w[2] * (s[0] - s[1]) * (nx - 1) + nx * (w[0] * (s[1] - s[2]) + w[1] * (s[2] - s[0])))) / (d * d);
+};
+
+/**
+ * @param {(tcuTexture.Texture2DView|tcuTexture.Texture2DArrayView|tcuTexture.TextureCubeView)} src
+ * @param {glsTextureTestUtil.ReferenceParams} params
+ * @param {Array<number>} texCoord Texture coordinates
+ * @param {number} lod
+ * @return {Array<number>} sample
+ */
+glsTextureTestUtil.execSample = function(src, params, texCoord, lod) {
+ if (params.samplerType == glsTextureTestUtil.samplerType.SAMPLERTYPE_SHADOW)
+ return [src.sampleCompare(params.sampler, params.ref, texCoord, lod), 0, 0, 1];
+ else
+ return src.sample(params.sampler, texCoord, lod);
+};
+
+/**
+ * @param {Array<number>} pixel
+ * @param {Array<number>} scale
+ * @param {Array<number>} bias
+ */
+glsTextureTestUtil.applyScaleAndBias = function(pixel, scale, bias) {
+ pixel[0] = pixel[0] * scale[0] + bias[0];
+ pixel[1] = pixel[1] * scale[1] + bias[1];
+ pixel[2] = pixel[2] * scale[2] + bias[2];
+ pixel[3] = pixel[3] * scale[3] + bias[3];
+};
+
+/**
+ * @param {Array<number>} pixel
+ * @param {Array<number>} scale
+ * @param {Array<number>} bias
+ */
+glsTextureTestUtil.deapplyScaleAndBias = function(pixel, scale, bias) {
+ pixel[0] = (pixel[0] - bias[0]) / scale[0];
+ pixel[1] = (pixel[1] - bias[1]) / scale[1];
+ pixel[2] = (pixel[2] - bias[2]) / scale[2];
+ pixel[3] = (pixel[3] - bias[3]) / scale[3];
+};
+
+/**
+ * @param {glsTextureTestUtil.SurfaceAccess} dst
+ * @param {tcuTexture.Texture2DView} src
+ * @param {Array<number>} sq
+ * @param {Array<number>} tq
+ * @param {glsTextureTestUtil.ReferenceParams} params
+ */
+glsTextureTestUtil.sampleTextureProjected2D = function(dst, src, sq, tq, params) {
+ /** @type {number} */ var lodBias = params.flags.use_bias ? params.bias : 0.0;
+ /** @type {number} */ var dstW = dst.getWidth();
+ /** @type {number} */ var dstH = dst.getHeight();
+
+ /** @type {Array<number>} */ var uq = deMath.scale(sq, src.getWidth());
+ /** @type {Array<number>} */ var vq = deMath.scale(tq, src.getHeight());
+
+ /** @type {Array<Array<number>>} */ var triS = [deMath.swizzle(sq, [0, 1, 2]), deMath.swizzle(sq, [3, 2, 1])];
+ /** @type {Array<Array<number>>} */ var triT = [deMath.swizzle(tq, [0, 1, 2]), deMath.swizzle(tq, [3, 2, 1])];
+ /** @type {Array<Array<number>>} */ var triU = [deMath.swizzle(uq, [0, 1, 2]), deMath.swizzle(uq, [3, 2, 1])];
+ /** @type {Array<Array<number>>} */ var triV = [deMath.swizzle(vq, [0, 1, 2]), deMath.swizzle(vq, [3, 2, 1])];
+ /** @type {Array<Array<number>>} */ var triW = [deMath.swizzle(params.w, [0, 1, 2]), deMath.swizzle(params.w, [3, 2, 1])];
+
+ for (var py = 0; py < dst.getHeight(); py++) {
+ for (var px = 0; px < dst.getWidth(); px++) {
+ /** @type {number} */ var wx = px + 0.5;
+ /** @type {number} */ var wy = py + 0.5;
+ /** @type {number} */ var nx = wx / dstW;
+ /** @type {number} */ var ny = wy / dstH;
+
+ /** @type {number} */ var triNdx = nx + ny >= 1.0 ? 1 : 0;
+ /** @type {number} */ var triWx = triNdx ? dstW - wx : wx;
+ /** @type {number} */ var triWy = triNdx ? dstH - wy : wy;
+ /** @type {number} */ var triNx = triNdx ? 1.0 - nx : nx;
+ /** @type {number} */ var triNy = triNdx ? 1.0 - ny : ny;
+
+ /** @type {number} */ var s = glsTextureTestUtil.projectedTriInterpolate(triS[triNdx], triW[triNdx], triNx, triNy);
+ /** @type {number} */ var t = glsTextureTestUtil.projectedTriInterpolate(triT[triNdx], triW[triNdx], triNx, triNy);
+ /** @type {number} */ var lod = glsTextureTestUtil.computeProjectedTriLod2D(params.lodMode, triU[triNdx], triV[triNdx], triW[triNdx], triWx, triWy, dst.getWidth(), dst.getHeight()) + lodBias;
+
+ var pixel = glsTextureTestUtil.execSample(src, params, [s, t], lod);
+ glsTextureTestUtil.applyScaleAndBias(pixel, params.colorScale, params.colorBias);
+ dst.setPixel(pixel, px, py);
+ }
+ }
+};
+
+/**
+ * @param {glsTextureTestUtil.lodMode} mode
+ * @param {Array<number>} u
+ * @param {Array<number>} v
+ * @param {Array<number>} projection
+ * @param {number} wx
+ * @param {number} wy
+ * @param {number} width
+ * @param {number} height
+ * @return {number}
+ */
+glsTextureTestUtil.computeProjectedTriLod2D = function(mode, u, v, projection, wx, wy, width, height) {
+ // Exact derivatives.
+ /** @type {number} */ var dudx = glsTextureTestUtil.triDerivateX(u, projection, wx, width, wy / height);
+ /** @type {number} */ var dvdx = glsTextureTestUtil.triDerivateX(v, projection, wx, width, wy / height);
+ /** @type {number} */ var dudy = glsTextureTestUtil.triDerivateY(u, projection, wy, height, wx / width);
+ /** @type {number} */ var dvdy = glsTextureTestUtil.triDerivateY(v, projection, wy, height, wx / width);
+
+ return glsTextureTestUtil.computeLodFromDerivates2D(mode, dudx, dvdx, dudy, dvdy);
+};
+
+/**
+ * @param {glsTextureTestUtil.SurfaceAccess} dst
+ * @param {tcuTexture.Texture2DView} src
+ * @param {Array<number>} sq
+ * @param {Array<number>} tq
+ * @param {glsTextureTestUtil.ReferenceParams} params
+ */
+glsTextureTestUtil.sampleTextureNonProjected2D = function(dst, src, sq, tq, params) {
+ var lodBias = params.flags.use_bias ? params.bias : 0;
+
+ var dstSize = [dst.getWidth(), dst.getHeight()];
+ var srcSize = [src.getWidth(), src.getHeight()];
+
+ // Coordinates and lod per triangle.
+ var triS = [deMath.swizzle(sq, [0, 1, 2]), deMath.swizzle(sq, [3, 2, 1])];
+ var triT = [deMath.swizzle(tq, [0, 1, 2]), deMath.swizzle(tq, [3, 2, 1])];
+ var triLod = [deMath.clamp((glsTextureTestUtil.computeNonProjectedTriLod(params.lodMode, dstSize, srcSize, triS[0], triT[0]) + lodBias), params.minLod, params.maxLod),
+ deMath.clamp((glsTextureTestUtil.computeNonProjectedTriLod(params.lodMode, dstSize, srcSize, triS[1], triT[1]) + lodBias), params.minLod, params.maxLod)];
+
+
+ for (var y = 0; y < dst.getHeight(); y++) {
+ for (var x = 0; x < dst.getWidth(); x++) {
+ var yf = (y + 0.5) / dst.getHeight();
+ var xf = (x + 0.5) / dst.getWidth();
+
+ var triNdx = xf + yf >= 1 ? 1 : 0; // Top left fill rule.
+ var triX = triNdx ? 1 - xf : xf;
+ var triY = triNdx ? 1 - yf : yf;
+
+ var s = glsTextureTestUtil.triangleInterpolate(triS[triNdx], triX, triY);
+ var t = glsTextureTestUtil.triangleInterpolate(triT[triNdx], triX, triY);
+ var lod = triLod[triNdx];
+
+ var pixel = glsTextureTestUtil.execSample(src, params, [s, t], lod);
+ glsTextureTestUtil.applyScaleAndBias(pixel, params.colorScale, params.colorBias);
+ dst.setPixel(pixel, x, y);
+ }
+ }
+};
+
+/**
+ * @param {glsTextureTestUtil.SurfaceAccess} dst
+ * @param {tcuTexture.Texture2DArrayView} src
+ * @param {Array<number>} sq
+ * @param {Array<number>} tq
+ * @param {Array<number>} rq
+ * @param {glsTextureTestUtil.ReferenceParams} params
+ */
+glsTextureTestUtil.sampleTextureNonProjected2DArray = function(dst, src, sq, tq, rq, params) {
+ var lodBias = (params.flags.use_bias) ? params.bias : 0;
+
+ var dstSize = [dst.getWidth(), dst.getHeight()];
+ var srcSize = [src.getWidth(), src.getHeight()];
+
+ // Coordinates and lod per triangle.
+ var triS = [deMath.swizzle(sq, [0, 1, 2]), deMath.swizzle(sq, [3, 2, 1])];
+ var triT = [deMath.swizzle(tq, [0, 1, 2]), deMath.swizzle(tq, [3, 2, 1])];
+ var triR = [deMath.swizzle(rq, [0, 1, 2]), deMath.swizzle(rq, [3, 2, 1])];
+ var triLod = [glsTextureTestUtil.computeNonProjectedTriLod(params.lodMode, dstSize, srcSize, triS[0], triT[0]) + lodBias,
+ glsTextureTestUtil.computeNonProjectedTriLod(params.lodMode, dstSize, srcSize, triS[1], triT[1]) + lodBias];
+
+ for (var y = 0; y < dst.getHeight(); y++) {
+ for (var x = 0; x < dst.getWidth(); x++) {
+ var yf = (y + 0.5) / dst.getHeight();
+ var xf = (x + 0.5) / dst.getWidth();
+
+ var triNdx = xf + yf >= 1 ? 1 : 0; // Top left fill rule.
+ var triX = triNdx ? 1 - xf : xf;
+ var triY = triNdx ? 1 - yf : yf;
+
+ var s = glsTextureTestUtil.triangleInterpolate(triS[triNdx], triX, triY);
+ var t = glsTextureTestUtil.triangleInterpolate(triT[triNdx], triX, triY);
+ var r = glsTextureTestUtil.triangleInterpolate(triR[triNdx], triX, triY);
+ var lod = triLod[triNdx];
+
+ var pixel = glsTextureTestUtil.execSample(src, params, [s, t, r], lod);
+ glsTextureTestUtil.applyScaleAndBias(pixel, params.colorScale, params.colorBias);
+ dst.setPixel(pixel, x, y);
+ }
+ }
+};
+
+/**
+ * @param {glsTextureTestUtil.SurfaceAccess} dst
+ * @param {tcuTexture.Texture2DView} src
+ * @param {Array<number>} texCoord
+ * @param {glsTextureTestUtil.ReferenceParams} params
+ */
+glsTextureTestUtil.sampleTexture2D = function(dst, src, texCoord, params) {
+ var view = src.getSubView(params.baseLevel, params.maxLevel);
+ var sq = [texCoord[0 + 0], texCoord[2 + 0], texCoord[4 + 0], texCoord[6 + 0]];
+ var tq = [texCoord[0 + 1], texCoord[2 + 1], texCoord[4 + 1], texCoord[6 + 1]];
+
+ if (params.flags.projected)
+ glsTextureTestUtil.sampleTextureProjected2D(dst, view, sq, tq, params);
+ else
+ glsTextureTestUtil.sampleTextureNonProjected2D(dst, view, sq, tq, params);
+};
+
+/**
+ * @param {glsTextureTestUtil.lodMode} mode
+ * @param {number} dudx
+ * @param {number} dvdx
+ * @param {number} dudy
+ * @param {number} dvdy
+ * @return {number}
+ */
+glsTextureTestUtil.computeLodFromDerivates2D = function(mode, dudx, dvdx, dudy, dvdy) {
+ var p = 0;
+ switch (mode) {
+ case glsTextureTestUtil.lodMode.EXACT:
+ p = Math.max(Math.sqrt(dudx * dudx + dvdx * dvdx), Math.sqrt(dudy * dudy + dvdy * dvdy));
+ break;
+
+ case glsTextureTestUtil.lodMode.MIN_BOUND:
+ case glsTextureTestUtil.lodMode.MAX_BOUND: {
+ var mu = Math.max(Math.abs(dudx), Math.abs(dudy));
+ var mv = Math.max(Math.abs(dvdx), Math.abs(dvdy));
+
+ p = (mode == glsTextureTestUtil.lodMode.MIN_BOUND) ? Math.max(mu, mv) : mu + mv;
+ break;
+ }
+
+ default:
+ throw new Error('Unrecognized mode:' + mode);
+ }
+
+ // Native dEQP uses 32-bit numbers. So here 64-bit floating numbers should be transformed into 32-bit ones to ensure the correctness of the result.
+ return deMath.toFloat32(Math.log(p)) * deMath.INV_LOG_2_FLOAT32;
+};
+
+/**
+ * @param {glsTextureTestUtil.lodMode} lodModeParm
+ * @param {Array<number>} coord
+ * @param {Array<number>} coordDx
+ * @param {Array<number>} coordDy
+ * @param {number} faceSize
+ * @return {number}
+ */
+glsTextureTestUtil.computeCubeLodFromDerivates = function(lodModeParm, coord, coordDx, coordDy, faceSize) {
+ var face = tcuTexture.selectCubeFace(coord);
+ var maNdx = 0;
+ var sNdx = 0;
+ var tNdx = 0;
+
+ // \note Derivate signs don't matter when computing lod
+ switch (face) {
+ case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_X:
+ case tcuTexture.CubeFace.CUBEFACE_POSITIVE_X: maNdx = 0; sNdx = 2; tNdx = 1; break;
+ case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Y:
+ case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Y: maNdx = 1; sNdx = 0; tNdx = 2; break;
+ case tcuTexture.CubeFace.CUBEFACE_NEGATIVE_Z:
+ case tcuTexture.CubeFace.CUBEFACE_POSITIVE_Z: maNdx = 2; sNdx = 0; tNdx = 1; break;
+ default:
+ throw new Error('Unrecognized face ' + face);
+ } {
+ var sc = coord[sNdx];
+ var tc = coord[tNdx];
+ var ma = Math.abs(coord[maNdx]);
+ var scdx = coordDx[sNdx];
+ var tcdx = coordDx[tNdx];
+ var madx = Math.abs(coordDx[maNdx]);
+ var scdy = coordDy[sNdx];
+ var tcdy = coordDy[tNdx];
+ var mady = Math.abs(coordDy[maNdx]);
+ var dudx = faceSize * 0.5 * (scdx * ma - sc * madx) / (ma * ma);
+ var dvdx = faceSize * 0.5 * (tcdx * ma - tc * madx) / (ma * ma);
+ var dudy = faceSize * 0.5 * (scdy * ma - sc * mady) / (ma * ma);
+ var dvdy = faceSize * 0.5 * (tcdy * ma - tc * mady) / (ma * ma);
+ return glsTextureTestUtil.computeLodFromDerivates2D(lodModeParm, dudx, dvdx, dudy, dvdy);
+ }
+};
+
+/**
+ * @param {glsTextureTestUtil.SurfaceAccess} dst
+ * @param {tcuTexture.TextureCubeView} src
+ * @param {Array<number>} sq
+ * @param {Array<number>} tq
+ * @param {Array<number>} rq
+ * @param {glsTextureTestUtil.ReferenceParams} params
+ */
+glsTextureTestUtil.sampleTextureCube_str = function(dst, src, sq, tq, rq, params) {
+ var dstSize = [dst.getWidth(), dst.getHeight()];
+ var dstW = dstSize[0];
+ var dstH = dstSize[1];
+ var srcSize = src.getSize();
+
+ // Coordinates per triangle.
+ var triS = [deMath.swizzle(sq, [0, 1, 2]), deMath.swizzle(sq, [3, 2, 1])];
+ var triT = [deMath.swizzle(tq, [0, 1, 2]), deMath.swizzle(tq, [3, 2, 1])];
+ var triR = [deMath.swizzle(rq, [0, 1, 2]), deMath.swizzle(rq, [3, 2, 1])];
+ var triW = [deMath.swizzle(params.w, [0, 1, 2]), deMath.swizzle(params.w, [3, 2, 1])];
+
+ var lodBias = (params.flags.use_bias ? params.bias : 0);
+
+ for (var py = 0; py < dst.getHeight(); py++) {
+ for (var px = 0; px < dst.getWidth(); px++) {
+ var wx = px + 0.5;
+ var wy = py + 0.5;
+ var nx = wx / dstW;
+ var ny = wy / dstH;
+ var triNdx = nx + ny >= 1 ? 1 : 0;
+ var triNx = triNdx ? 1 - nx : nx;
+ var triNy = triNdx ? 1 - ny : ny;
+
+ var coord = [glsTextureTestUtil.triangleInterpolate(triS[triNdx], triNx, triNy),
+ glsTextureTestUtil.triangleInterpolate(triT[triNdx], triNx, triNy),
+ glsTextureTestUtil.triangleInterpolate(triR[triNdx], triNx, triNy)];
+ var coordDx = [glsTextureTestUtil.triDerivateX(triS[triNdx], triW[triNdx], wx, dstW, triNy),
+ glsTextureTestUtil.triDerivateX(triT[triNdx], triW[triNdx], wx, dstW, triNy),
+ glsTextureTestUtil.triDerivateX(triR[triNdx], triW[triNdx], wx, dstW, triNy)];
+ var coordDy = [glsTextureTestUtil.triDerivateY(triS[triNdx], triW[triNdx], wy, dstH, triNx),
+ glsTextureTestUtil.triDerivateY(triT[triNdx], triW[triNdx], wy, dstH, triNx),
+ glsTextureTestUtil.triDerivateY(triR[triNdx], triW[triNdx], wy, dstH, triNx)];
+
+ var lod = deMath.clamp((glsTextureTestUtil.computeCubeLodFromDerivates(params.lodMode, coord, coordDx, coordDy, srcSize) + lodBias), params.minLod, params.maxLod);
+
+ var pixel = glsTextureTestUtil.execSample(src, params, coord, lod);
+ glsTextureTestUtil.applyScaleAndBias(pixel, params.colorScale, params.colorBias);
+ dst.setPixel(pixel, px, py);
+ }
+ }
+};
+
+/**
+ * @param {glsTextureTestUtil.SurfaceAccess} dst
+ * @param {tcuTexture.TextureCubeView} src
+ * @param {Array<number>} texCoord
+ * @param {glsTextureTestUtil.ReferenceParams} params
+ */
+glsTextureTestUtil.sampleTextureCube = function(dst, src, texCoord, params) {
+ /*const tcu::TextureCubeView*/ var view = src.getSubView(params.baseLevel, params.maxLevel);
+ var sq = [texCoord[0 + 0], texCoord[3 + 0], texCoord[6 + 0], texCoord[9 + 0]];
+ var tq = [texCoord[0 + 1], texCoord[3 + 1], texCoord[6 + 1], texCoord[9 + 1]];
+ var rq = [texCoord[0 + 2], texCoord[3 + 2], texCoord[6 + 2], texCoord[9 + 2]];
+
+ glsTextureTestUtil.sampleTextureCube_str(dst, view, sq, tq, rq, params);
+};
+
+/**
+ * @param {glsTextureTestUtil.SurfaceAccess} dst
+ * @param {tcuTexture.Texture2DArrayView} src
+ * @param {Array<number>} texCoord
+ * @param {glsTextureTestUtil.ReferenceParams} params
+ */
+glsTextureTestUtil.sampleTexture2DArray = function(dst, src, texCoord, params) {
+ var sq = [texCoord[0 + 0], texCoord[3 + 0], texCoord[6 + 0], texCoord[9 + 0]];
+ var tq = [texCoord[0 + 1], texCoord[3 + 1], texCoord[6 + 1], texCoord[9 + 1]];
+ var rq = [texCoord[0 + 2], texCoord[3 + 2], texCoord[6 + 2], texCoord[9 + 2]];
+
+ DE_ASSERT(!(params.flags.projected)); // \todo [2012-02-17 pyry] Support projected lookups.
+ glsTextureTestUtil.sampleTextureNonProjected2DArray(dst, src, sq, tq, rq, params);
+};
+
+/**
+ * @param {glsTextureTestUtil.SurfaceAccess} dst
+ * @param {tcuTexture.Texture3DView} src
+ * @param {Array<number>} sq
+ * @param {Array<number>} tq
+ * @param {Array<number>} rq
+ * @param {glsTextureTestUtil.ReferenceParams} params
+ */
+glsTextureTestUtil.sampleTextureNonProjected3D = function(dst, src, sq, tq, rq, params) {
+ var lodBias = params.flags.use_bias ? params.bias : 0;
+
+ var dstSize = [dst.getWidth(), dst.getHeight()];
+ var srcSize = [src.getWidth(), src.getHeight(), src.getDepth()];
+
+ // Coordinates and lod per triangle.
+ var triS = [deMath.swizzle(sq, [0, 1, 2]), deMath.swizzle(sq, [3, 2, 1])];
+ var triT = [deMath.swizzle(tq, [0, 1, 2]), deMath.swizzle(tq, [3, 2, 1])];
+ var triR = [deMath.swizzle(rq, [0, 1, 2]), deMath.swizzle(rq, [3, 2, 1])];
+ var triLod = [deMath.clamp((glsTextureTestUtil.computeNonProjectedTriLod(params.lodMode, dstSize, srcSize, triS[0], triT[0], triR[0]) + lodBias), params.minLod, params.maxLod),
+ deMath.clamp((glsTextureTestUtil.computeNonProjectedTriLod(params.lodMode, dstSize, srcSize, triS[1], triT[1], triR[1]) + lodBias), params.minLod, params.maxLod)];
+
+ for (var y = 0; y < dst.getHeight(); y++) {
+ for (var x = 0; x < dst.getWidth(); x++) {
+ var yf = (y + 0.5) / dst.getHeight();
+ var xf = (x + 0.5) / dst.getWidth();
+
+ var triNdx = xf + yf >= 1 ? 1 : 0; // Top left fill rule.
+ var triX = triNdx ? 1 - xf : xf;
+ var triY = triNdx ? 1 - yf : yf;
+
+ var s = glsTextureTestUtil.triangleInterpolate(triS[triNdx], triX, triY);
+ var t = glsTextureTestUtil.triangleInterpolate(triT[triNdx], triX, triY);
+ var r = glsTextureTestUtil.triangleInterpolate(triR[triNdx], triX, triY);
+ var lod = triLod[triNdx];
+
+ var pixel = src.sample(params.sampler, [s, t, r], lod);
+ glsTextureTestUtil.applyScaleAndBias(pixel, params.colorScale, params.colorBias);
+ dst.setPixel(pixel, x, y);
+ }
+ }
+};
+
+/**
+ * @param {glsTextureTestUtil.SurfaceAccess} dst
+ * @param {tcuTexture.Texture3DView} src
+ * @param {Array<number>} texCoord
+ * @param {glsTextureTestUtil.ReferenceParams} params
+ */
+glsTextureTestUtil.sampleTexture3D = function(dst, src, texCoord, params) {
+ /*const tcu::TextureCubeView*/ var view = src.getSubView(params.baseLevel, params.maxLevel);
+ var sq = [texCoord[0 + 0], texCoord[3 + 0], texCoord[6 + 0], texCoord[9 + 0]];
+ var tq = [texCoord[0 + 1], texCoord[3 + 1], texCoord[6 + 1], texCoord[9 + 1]];
+ var rq = [texCoord[0 + 2], texCoord[3 + 2], texCoord[6 + 2], texCoord[9 + 2]];
+
+ glsTextureTestUtil.sampleTextureNonProjected3D(dst, view, sq, tq, rq, params);
+};
+
+/**
+ * @param {tcuSurface.Surface} reference
+ * @param {tcuSurface.Surface} rendered
+ * @param {Array<number>} threshold
+ * @param {Array< Array<number> >} skipPixels
+ *
+ * @return {boolean}
+ */
+glsTextureTestUtil.compareImages = function(reference, rendered, threshold, skipPixels) {
+ return tcuImageCompare.pixelThresholdCompare('Result', 'Image comparison result', reference, rendered, threshold, undefined /*tcu::COMPARE_LOG_RESULT*/, skipPixels);
+};
+
+/**
+ * @param {tcuTexture.ConstPixelBufferAccess} result
+ * @param {tcuTexture.Texture2DView} src
+ * @param {Array<number>} texCoord
+ * @param {glsTextureTestUtil.ReferenceParams} sampleParams
+ * @param {tcuTexLookupVerifier.LookupPrecision} lookupPrec
+ * @param {tcuTexLookupVerifier.LodPrecision} lodPrec
+ * @param {tcuPixelFormat.PixelFormat} pixelFormat
+ * @return {boolean}
+ */
+glsTextureTestUtil.verifyTexture2DResult = function(result, src, texCoord, sampleParams, lookupPrec, lodPrec, pixelFormat) {
+ DE_ASSERT(deMath.equal(glsTextureTestUtil.getCompareMask(pixelFormat), lookupPrec.colorMask));
+ /** @type {tcuSurface.Surface} */ var reference = new tcuSurface.Surface(result.getWidth(), result.getHeight());
+ /** @type {tcuSurface.Surface} */ var errorMask = new tcuSurface.Surface(result.getWidth(), result.getHeight());
+ /** @type {number} */ var numFailedPixels;
+
+ /** @type {glsTextureTestUtil.SurfaceAccess} */ var surface = new glsTextureTestUtil.SurfaceAccess(reference, pixelFormat);
+
+ glsTextureTestUtil.sampleTexture2D(surface, src, texCoord, sampleParams);
+ numFailedPixels = glsTextureTestUtil.computeTextureLookupDiff2D(result, reference.getAccess(), errorMask.getAccess(), src, texCoord, sampleParams, lookupPrec, lodPrec/*, testCtx.getWatchDog()*/);
+
+ if (numFailedPixels > 0)
+ tcuImageCompare.displayImages(result, reference.getAccess(), errorMask.getAccess());
+
+ return numFailedPixels == 0;
+};
+
+/**
+ * @param {tcuTexture.ConstPixelBufferAccess} result
+ * @param {tcuTexture.ConstPixelBufferAccess} reference
+ * @param {tcuTexture.PixelBufferAccess} errorMask
+ * @param {tcuTexture.Texture2DView} src
+ * @param {Array<number>} texCoord
+ * @param {glsTextureTestUtil.ReferenceParams} sampleParams
+ * @param {tcuTexCompareVerifier.TexComparePrecision} comparePrec
+ * @param {tcuTexLookupVerifier.LodPrecision} lodPrec
+ * @param {Array<number>} nonShadowThreshold
+ * @return {number}
+ */
+glsTextureTestUtil.computeTextureCompareDiff2D = function(result, reference, errorMask, src, texCoord, sampleParams, comparePrec, lodPrec, nonShadowThreshold) {
+ DE_ASSERT(result.getWidth() == reference.getWidth() && result.getHeight() == reference.getHeight());
+ DE_ASSERT(result.getWidth() == errorMask.getWidth() && result.getHeight() == errorMask.getHeight());
+
+ var sq = [texCoord[0 + 0], texCoord[2 + 0], texCoord[4 + 0], texCoord[6 + 0]];
+ var tq = [texCoord[0 + 1], texCoord[2 + 1], texCoord[4 + 1], texCoord[6 + 1]];
+
+ var dstSize = [result.getWidth(), result.getHeight()];
+ var dstW = dstSize[0];
+ var dstH = dstSize[1];
+ var srcSize = [src.getWidth(), src.getHeight()];
+
+ // Coordinates and lod per triangle.
+ var triS = [deMath.swizzle(sq, [0, 1, 2]), deMath.swizzle(sq, [3, 2, 1])];
+ var triT = [deMath.swizzle(tq, [0, 1, 2]), deMath.swizzle(tq, [3, 2, 1])];
+ var triW = [deMath.swizzle(sampleParams.w, [0, 1, 2]), deMath.swizzle(sampleParams.w, [3, 2, 1])];
+
+ var lodBias = sampleParams.flags.use_bias ? [sampleParams.bias, sampleParams.bias] : [0, 0];
+ var numFailed = 0;
+
+ var lodOffsets = [
+ [-1, 0],
+ [1, 0],
+ [0, -1],
+ [0, 1]
+ ];
+
+ /** @type {Array<number>} */ var green = [0, 255, 0, 255];
+ errorMask.clear(green);
+
+ /** @type {Array<number>} */ var red = [];
+ for (var py = 0; py < result.getHeight(); py++) {
+ for (var px = 0; px < result.getWidth(); px++) {
+ /** @type {Array<number>} */
+ var resPix = result.getPixel(px, py);
+ /** @type {Array<number>} */
+ var refPix = reference.getPixel(px, py);
+
+ if (!deMath.boolAll(deMath.lessThanEqual(deMath.absDiff(deMath.swizzle(refPix, [1, 2, 3]), deMath.swizzle(resPix, [1, 2, 3])), nonShadowThreshold))) {
+ red = [255, 0, 0, 255];
+ errorMask.setPixel(red, px, py);
+ numFailed += 1;
+ continue;
+ }
+
+ if (resPix[0] != refPix[0]) {
+ var wx = px + 0.5;
+ var wy = py + 0.5;
+ var nx = wx / dstW;
+ var ny = wy / dstH;
+
+ var triNdx = nx + ny >= 1.0 ? 1 : 0;
+ var triWx = triNdx ? dstW - wx : wx;
+ var triWy = triNdx ? dstH - wy : wy;
+ var triNx = triNdx ? 1.0 - nx : nx;
+ var triNy = triNdx ? 1.0 - ny : ny;
+
+ var coord = [glsTextureTestUtil.projectedTriInterpolate(triS[triNdx], triW[triNdx], triNx, triNy),
+ glsTextureTestUtil.projectedTriInterpolate(triT[triNdx], triW[triNdx], triNx, triNy)];
+ var coordDx = deMath.multiply([glsTextureTestUtil.triDerivateX(triS[triNdx], triW[triNdx], wx, dstW, triNy),
+ glsTextureTestUtil.triDerivateX(triT[triNdx], triW[triNdx], wx, dstW, triNy)], srcSize);
+ var coordDy = deMath.multiply([glsTextureTestUtil.triDerivateY(triS[triNdx], triW[triNdx], wy, dstH, triNx),
+ glsTextureTestUtil.triDerivateY(triT[triNdx], triW[triNdx], wy, dstH, triNx)], srcSize);
+
+ var lodBounds = tcuTexLookupVerifier.computeLodBoundsFromDerivatesUV(coordDx[0], coordDx[1], coordDy[0], coordDy[1], lodPrec);
+
+ // Compute lod bounds across lodOffsets range.
+ for (var lodOffsNdx = 0; lodOffsNdx < lodOffsets.length; lodOffsNdx++) {
+ var wxo = triWx + lodOffsets[lodOffsNdx][0];
+ var wyo = triWy + lodOffsets[lodOffsNdx][1];
+ var nxo = wxo / dstW;
+ var nyo = wyo / dstH;
+
+ var coordO = [glsTextureTestUtil.projectedTriInterpolate(triS[triNdx], triW[triNdx], nxo, nyo),
+ glsTextureTestUtil.projectedTriInterpolate(triT[triNdx], triW[triNdx], nxo, nyo)];
+ var coordDxo = deMath.multiply([glsTextureTestUtil.triDerivateX(triS[triNdx], triW[triNdx], wxo, dstW, nyo),
+ glsTextureTestUtil.triDerivateX(triT[triNdx], triW[triNdx], wxo, dstW, nyo)], srcSize);
+ var coordDyo = deMath.multiply([glsTextureTestUtil.triDerivateY(triS[triNdx], triW[triNdx], wyo, dstH, nxo),
+ glsTextureTestUtil.triDerivateY(triT[triNdx], triW[triNdx], wyo, dstH, nxo)], srcSize);
+ var lodO = tcuTexLookupVerifier.computeLodBoundsFromDerivatesUV(coordDxo[0], coordDxo[1], coordDyo[0], coordDyo[1], lodPrec);
+
+ lodBounds[0] = Math.min(lodBounds[0], lodO[0]);
+ lodBounds[1] = Math.max(lodBounds[1], lodO[1]);
+ }
+
+ var clampedLod = tcuTexLookupVerifier.clampLodBounds(deMath.add(lodBounds, lodBias), [sampleParams.minLod, sampleParams.maxLod], lodPrec);
+ var isOk = tcuTexCompareVerifier.isTexCompareResultValid2D(src, sampleParams.sampler, comparePrec, coord, clampedLod, sampleParams.ref, resPix[0]);
+
+ if (!isOk) {
+ red = [255, 0, 0, 255];
+ errorMask.setPixel(red, px, py);
+ numFailed += 1;
+ }
+ }
+ }
+ }
+
+ return numFailed;
+};
+
+/**
+ * @param {tcuTexture.ConstPixelBufferAccess} result
+ * @param {tcuTexture.Texture3DView} src
+ * @param {Array<number>} texCoord
+ * @param {glsTextureTestUtil.ReferenceParams} sampleParams
+ * @param {tcuTexLookupVerifier.LookupPrecision} lookupPrec
+ * @param {tcuTexLookupVerifier.LodPrecision} lodPrec
+ * @param {tcuPixelFormat.PixelFormat} pixelFormat
+ * @return {boolean}
+ */
+glsTextureTestUtil.verifyTexture3DResult = function(
+ result, src, texCoord, sampleParams, lookupPrec, lodPrec, pixelFormat
+) {
+ /** @type {tcuSurface.Surface} */ var reference = new tcuSurface.Surface(result.getWidth(), result.getHeight());
+ /** @type {tcuSurface.Surface} */ var errorMask = new tcuSurface.Surface(result.getWidth(), result.getHeight());
+ var numFailedPixels = 0;
+
+ assertMsgOptions(
+ deMath.equal(glsTextureTestUtil.getCompareMask(pixelFormat), lookupPrec.colorMask),
+ 'Compare color masks do not match', false, true
+ );
+
+ /** @type {glsTextureTestUtil.SurfaceAccess} */ var surface = new glsTextureTestUtil.SurfaceAccess(reference, pixelFormat);
+ glsTextureTestUtil.sampleTexture3D(surface, src, texCoord, sampleParams);
+ numFailedPixels = glsTextureTestUtil.computeTextureLookupDiff3D(result, reference.getAccess(), errorMask.getAccess(), src, texCoord, sampleParams, lookupPrec, lodPrec);
+
+ if (numFailedPixels > 0)
+ tcuImageCompare.displayImages(result, reference.getAccess(), errorMask.getAccess());
+
+ return numFailedPixels == 0;
+};
+
+/**
+ * @param {tcuTexture.ConstPixelBufferAccess} result
+ * @param {tcuTexture.ConstPixelBufferAccess} reference
+ * @param {tcuTexture.PixelBufferAccess} errorMask
+ * @param {tcuTexture.Texture3DView} baseView
+ * @param {Array<number>} texCoord
+ * @param {glsTextureTestUtil.ReferenceParams} sampleParams
+ * @param {tcuTexLookupVerifier.LookupPrecision} lookupPrec
+ * @param {tcuTexLookupVerifier.LodPrecision} lodPrec
+ * @return {number}
+ */
+glsTextureTestUtil.computeTextureLookupDiff3D = function(
+ result, reference, errorMask, baseView, texCoord,
+ sampleParams, lookupPrec, lodPrec
+) {
+ assertMsgOptions(
+ result.getWidth() == reference.getWidth() &&
+ result.getHeight() == reference.getHeight(),
+ 'Result and reference images are not the same size', false, true
+ );
+ assertMsgOptions(
+ result.getWidth() == errorMask.getWidth() &&
+ result.getHeight() == errorMask.getHeight(),
+ 'Result and error mask images are not the same size', false, true
+ );
+
+ /** @type {tcuTexture.Texture3DView} */
+ var src = baseView.getSubView(
+ sampleParams.baseLevel, sampleParams.maxLevel
+ );
+
+ var sq =
+ [texCoord[0 + 0], texCoord[3 + 0], texCoord[6 + 0], texCoord[9 + 0]];
+ var tq =
+ [texCoord[0 + 1], texCoord[3 + 1], texCoord[6 + 1], texCoord[9 + 1]];
+ var rq =
+ [texCoord[0 + 2], texCoord[3 + 2], texCoord[6 + 2], texCoord[9 + 2]];
+
+ var dstSize = [result.getWidth(), result.getHeight()];
+ var dstW = dstSize[0];
+ var dstH = dstSize[1];
+ var srcSize = [src.getWidth(), src.getHeight(), src.getDepth()];
+
+ // Coordinates and lod per triangle.
+ var triS = [deMath.swizzle(sq, [0, 1, 2]), deMath.swizzle(sq, [3, 2, 1])];
+ var triT = [deMath.swizzle(tq, [0, 1, 2]), deMath.swizzle(tq, [3, 2, 1])];
+ var triR = [deMath.swizzle(rq, [0, 1, 2]), deMath.swizzle(rq, [3, 2, 1])];
+ var triW = [
+ deMath.swizzle(sampleParams.w, [0, 1, 2]),
+ deMath.swizzle(sampleParams.w, [3, 2, 1])
+ ];
+
+ var lodBias = sampleParams.flags.useBias ? sampleParams.bias : 0.0;
+
+ var posEps = 1.0 / ((1 << MIN_SUBPIXEL_BITS) + 1);
+
+ var numFailed = 0;
+
+ var lodOffsets = [
+ [-1, 0],
+ [+1, 0],
+ [0, -1],
+ [0, +1]
+ ];
+
+ var green = [0, 255, 0, 255];
+ errorMask.clear(new tcuRGBA.RGBA(green).toVec());
+
+ for (var py = 0; py < result.getHeight(); py++) {
+ // Ugly hack, validation can take way too long at the moment.
+ /*TODO: if (watchDog)
+ qpWatchDog_touch(watchDog);*/
+
+ for (var px = 0; px < result.getWidth(); px++) {
+ /** @type {Array<number>} */
+ var resPix = result.getPixel(px, py);
+ glsTextureTestUtil.deapplyScaleAndBias(resPix, sampleParams.colorScale, sampleParams.colorBias);
+ /** @type {Array<number>} */
+ var refPix = reference.getPixel(px, py);
+ glsTextureTestUtil.deapplyScaleAndBias(refPix, sampleParams.colorScale, sampleParams.colorBias);
+
+ // Try comparison to ideal reference first,
+ // and if that fails use slower verificator.
+ if (!deMath.boolAll(deMath.lessThanEqual(
+ deMath.absDiff(resPix, refPix),
+ lookupPrec.colorThreshold))
+ ) {
+ /** @type {number} */ var wx = px + 0.5;
+ /** @type {number} */ var wy = py + 0.5;
+ /** @type {number} */ var nx = wx / dstW;
+ /** @type {number} */ var ny = wy / dstH;
+
+ /** @type {boolean} */ var tri0 = nx + ny - posEps <= 1.0;
+ /** @type {boolean} */ var tri1 = nx + ny + posEps >= 1.0;
+
+ var isOk = false;
+
+ assertMsgOptions(
+ tri0 || tri1,
+ 'Pixel should belong at least to one triangle',
+ false, true
+ );
+
+ // Pixel can belong to either of the triangles
+ // if it lies close enough to the edge.
+ for (var triNdx = (tri0 ? 0 : 1);
+ triNdx <= (tri1 ? 1 : 0);
+ triNdx++) {
+ var triWx = triNdx ? dstW - wx : wx;
+ var triWy = triNdx ? dstH - wy : wy;
+ var triNx = triNdx ? 1.0 - nx : nx;
+ var triNy = triNdx ? 1.0 - ny : ny;
+
+ var coord = [
+ glsTextureTestUtil.projectedTriInterpolate(
+ triS[triNdx], triW[triNdx], triNx, triNy
+ ),
+ glsTextureTestUtil.projectedTriInterpolate(
+ triT[triNdx], triW[triNdx], triNx, triNy
+ ),
+ glsTextureTestUtil.projectedTriInterpolate(
+ triR[triNdx], triW[triNdx], triNx, triNy
+ )
+ ];
+ var coordDx = deMath.multiply([
+ glsTextureTestUtil.triDerivateX(
+ triS[triNdx], triW[triNdx], wx, dstW, triNy
+ ),
+ glsTextureTestUtil.triDerivateX(
+ triT[triNdx], triW[triNdx], wx, dstW, triNy
+ ),
+ glsTextureTestUtil.triDerivateX(
+ triR[triNdx], triW[triNdx], wx, dstW, triNy
+ )
+ ], srcSize);
+ var coordDy = deMath.multiply([
+ glsTextureTestUtil.triDerivateY(
+ triS[triNdx], triW[triNdx], wy, dstH, triNx
+ ),
+ glsTextureTestUtil.triDerivateY(
+ triT[triNdx], triW[triNdx], wy, dstH, triNx
+ ),
+ glsTextureTestUtil.triDerivateY(
+ triR[triNdx], triW[triNdx], wy, dstH, triNx
+ )
+ ], srcSize);
+
+ var lodBounds =
+ tcuTexLookupVerifier.computeLodBoundsFromDerivates(
+ coordDx[0], coordDx[1], coordDx[2],
+ coordDy[0], coordDy[1], coordDy[2], lodPrec
+ );
+
+ // Compute lod bounds across lodOffsets range.
+ for (var lodOffsNdx = 0;
+ lodOffsNdx < lodOffsets.length;
+ lodOffsNdx++) {
+ var wxo = triWx + lodOffsets[lodOffsNdx][0];
+ var wyo = triWy + lodOffsets[lodOffsNdx][1];
+ var nxo = wxo / dstW;
+ var nyo = wyo / dstH;
+
+ var coordO = [
+ glsTextureTestUtil.projectedTriInterpolate(
+ triS[triNdx], triW[triNdx], nxo, nyo
+ ),
+ glsTextureTestUtil.projectedTriInterpolate(
+ triT[triNdx], triW[triNdx], nxo, nyo
+ ),
+ glsTextureTestUtil.projectedTriInterpolate(
+ triR[triNdx], triW[triNdx], nxo, nyo
+ )
+ ];
+ var coordDxo = deMath.multiply([
+ glsTextureTestUtil.triDerivateX(
+ triS[triNdx], triW[triNdx], wxo, dstW, nyo
+ ),
+ glsTextureTestUtil.triDerivateX(
+ triT[triNdx], triW[triNdx], wxo, dstW, nyo
+ ),
+ glsTextureTestUtil.triDerivateX(
+ triR[triNdx], triW[triNdx], wxo, dstW, nyo
+ )
+ ], srcSize);
+ var coordDyo = deMath.multiply([
+ glsTextureTestUtil.triDerivateY(
+ triS[triNdx], triW[triNdx], wyo, dstH, nxo
+ ),
+ glsTextureTestUtil.triDerivateY(
+ triT[triNdx], triW[triNdx], wyo, dstH, nxo
+ ),
+ glsTextureTestUtil.triDerivateY(
+ triR[triNdx], triW[triNdx], wyo, dstH, nxo
+ )
+ ], srcSize);
+ var lodO =
+ tcuTexLookupVerifier.computeLodBoundsFromDerivates(
+ coordDxo[0], coordDxo[1], coordDxo[2],
+ coordDyo[0], coordDyo[1], coordDyo[2], lodPrec
+ );
+
+ lodBounds[0] = Math.min(lodBounds[0], lodO[0]);
+ lodBounds[1] = Math.max(lodBounds[1], lodO[1]);
+ }
+
+ var clampedLod = tcuTexLookupVerifier.clampLodBounds(
+ deMath.addScalar(lodBounds, lodBias),
+ [sampleParams.minLod, sampleParams.maxLod],
+ lodPrec
+ );
+
+ if (
+ tcuTexLookupVerifier.isLookupResultValid(
+ src, sampleParams.sampler, lookupPrec,
+ coord, clampedLod, resPix
+ )
+ ) {
+ isOk = true;
+ break;
+ }
+ }
+
+ if (!isOk) {
+ var red = [255, 0, 0, 255];
+ errorMask.setPixel(new tcuRGBA.RGBA(red).toVec(), px, py);
+ numFailed += 1;
+ }
+ }
+ }
+ }
+
+ return numFailed;
+};
+
+/**
+ * @param {tcuTexture.ConstPixelBufferAccess} result
+ * @param {tcuTexture.TextureCubeView} src
+ * @param {Array<number>} texCoord
+ * @param {glsTextureTestUtil.ReferenceParams} sampleParams
+ * @param {tcuTexLookupVerifier.LookupPrecision} lookupPrec
+ * @param {tcuTexLookupVerifier.LodPrecision} lodPrec
+ * @param {tcuPixelFormat.PixelFormat} pixelFormat
+ * @return {boolean}
+ */
+glsTextureTestUtil.verifyTextureCubeResult = function(
+ result, src, texCoord, sampleParams, lookupPrec, lodPrec, pixelFormat
+) {
+ /** @type {tcuSurface.Surface} */
+ var reference = new tcuSurface.Surface(
+ result.getWidth(), result.getHeight()
+ );
+ /** @type {tcuSurface.Surface} */
+ var errorMask = new tcuSurface.Surface(
+ result.getWidth(), result.getHeight()
+ );
+ /** @type {number} */ var numFailedPixels = 0;
+
+ assertMsgOptions(
+ deMath.equal(glsTextureTestUtil.getCompareMask(pixelFormat), lookupPrec.colorMask),
+ 'Compare color masks do not match', false, true
+ );
+
+ /** @type {glsTextureTestUtil.SurfaceAccess} */
+ var surface = new glsTextureTestUtil.SurfaceAccess(reference, pixelFormat);
+
+ glsTextureTestUtil.sampleTextureCube(
+ surface, src, texCoord, sampleParams
+ );
+
+ numFailedPixels = glsTextureTestUtil.computeTextureLookupDiffCube(
+ result, reference.getAccess(), errorMask.getAccess(),
+ src, texCoord, sampleParams, lookupPrec, lodPrec
+ /*, testCtx.getWatchDog()*/
+ );
+
+ if (numFailedPixels > 0)
+ tcuImageCompare.displayImages(result, reference.getAccess(), errorMask.getAccess());
+
+ return numFailedPixels == 0;
+};
+
+/**
+ * @param {tcuTexture.ConstPixelBufferAccess} result
+ * @param {tcuTexture.ConstPixelBufferAccess} reference
+ * @param {tcuTexture.PixelBufferAccess} errorMask
+ * @param {tcuTexture.TextureCubeView} baseView
+ * @param {Array<number>} texCoord
+ * @param {glsTextureTestUtil.ReferenceParams} sampleParams
+ * @param {tcuTexLookupVerifier.LookupPrecision} lookupPrec
+ * @param {tcuTexLookupVerifier.LodPrecision} lodPrec
+ * @return {number}
+ */
+glsTextureTestUtil.computeTextureLookupDiffCube = function(
+ result, reference, errorMask, baseView, texCoord,
+ sampleParams, lookupPrec, lodPrec
+) {
+ assertMsgOptions(
+ result.getWidth() == reference.getWidth() &&
+ result.getHeight() == reference.getHeight(),
+ 'Result and reference images are not the same size', false, true
+ );
+ assertMsgOptions(
+ result.getWidth() == errorMask.getWidth() &&
+ result.getHeight() == errorMask.getHeight(),
+ 'Result and error mask images are not the same size', false, true
+ );
+
+ /** @type {tcuTexture.TextureCubeView} */
+ var src = baseView.getSubView(
+ sampleParams.baseLevel, sampleParams.maxLevel
+ );
+
+ var sq =
+ [texCoord[0 + 0], texCoord[3 + 0], texCoord[6 + 0], texCoord[9 + 0]];
+ var tq =
+ [texCoord[0 + 1], texCoord[3 + 1], texCoord[6 + 1], texCoord[9 + 1]];
+ var rq =
+ [texCoord[0 + 2], texCoord[3 + 2], texCoord[6 + 2], texCoord[9 + 2]];
+
+ var dstSize = [result.getWidth(), result.getHeight()];
+ var dstW = dstSize[0];
+ var dstH = dstSize[1];
+ var srcSize = [src.getSize(), src.getSize()];
+
+ // Coordinates and lod per triangle.
+ var triS = [deMath.swizzle(sq, [0, 1, 2]), deMath.swizzle(sq, [3, 2, 1])];
+ var triT = [deMath.swizzle(tq, [0, 1, 2]), deMath.swizzle(tq, [3, 2, 1])];
+ var triR = [deMath.swizzle(rq, [0, 1, 2]), deMath.swizzle(rq, [3, 2, 1])];
+ var triW = [
+ deMath.swizzle(sampleParams.w, [0, 1, 2]),
+ deMath.swizzle(sampleParams.w, [3, 2, 1])
+ ];
+
+ var lodBias = sampleParams.flags.useBias ? sampleParams.bias : 0.0;
+
+ var posEps = 1.0 / ((1 << MIN_SUBPIXEL_BITS) + 1);
+
+ var numFailed = 0;
+
+ var lodOffsets = [
+ [-1, 0],
+ [+1, 0],
+ [0, -1],
+ [0, +1],
+
+ // \note Not strictly allowed by spec,
+ // but implementations do this in practice.
+ [-1, -1],
+ [-1, 1],
+ [1, -1],
+ [1, 1]
+ ];
+
+ var green = [0, 255, 0, 255];
+ errorMask.clear(new tcuRGBA.RGBA(green).toVec());
+
+ for (var py = 0; py < result.getHeight(); py++) {
+ // Ugly hack, validation can take way too long at the moment.
+ /*TODO: if (watchDog)
+ qpWatchDog_touch(watchDog);*/
+
+ for (var px = 0; px < result.getWidth(); px++) {
+ /** @type {Array<number>} */
+ var resPix = result.getPixel(px, py);
+ glsTextureTestUtil.deapplyScaleAndBias(resPix, sampleParams.colorScale, sampleParams.colorBias);
+ /** @type {Array<number>} */
+ var refPix = reference.getPixel(px, py);
+ glsTextureTestUtil.deapplyScaleAndBias(refPix, sampleParams.colorScale, sampleParams.colorBias);
+
+ // Try comparison to ideal reference first,
+ // and if that fails use slower verificator.
+ if (!deMath.boolAll(deMath.lessThanEqual(
+ deMath.absDiff(resPix, refPix),
+ lookupPrec.colorThreshold))
+ ) {
+ /** @type {number} */ var wx = px + 0.5;
+ /** @type {number} */ var wy = py + 0.5;
+ /** @type {number} */ var nx = wx / dstW;
+ /** @type {number} */ var ny = wy / dstH;
+
+ /** @type {boolean} */ var tri0 = nx + ny - posEps <= 1.0;
+ /** @type {boolean} */ var tri1 = nx + ny + posEps >= 1.0;
+
+ var isOk = false;
+
+ assertMsgOptions(
+ tri0 || tri1,
+ 'Pixel should belong at least to one triangle',
+ false, true
+ );
+
+ // Pixel can belong to either of the triangles
+ // if it lies close enough to the edge.
+ for (var triNdx = (tri0 ? 0 : 1);
+ triNdx <= (tri1 ? 1 : 0);
+ triNdx++) {
+ var triWx = triNdx ? dstW - wx : wx;
+ var triWy = triNdx ? dstH - wy : wy;
+ var triNx = triNdx ? 1.0 - nx : nx;
+ var triNy = triNdx ? 1.0 - ny : ny;
+
+ var coord = [
+ glsTextureTestUtil.projectedTriInterpolate(
+ triS[triNdx], triW[triNdx], triNx, triNy
+ ),
+ glsTextureTestUtil.projectedTriInterpolate(
+ triT[triNdx], triW[triNdx], triNx, triNy
+ ),
+ glsTextureTestUtil.projectedTriInterpolate(
+ triR[triNdx], triW[triNdx], triNx, triNy
+ )
+ ];
+ var coordDx = [
+ glsTextureTestUtil.triDerivateX(
+ triS[triNdx], triW[triNdx], wx, dstW, triNy
+ ),
+ glsTextureTestUtil.triDerivateX(
+ triT[triNdx], triW[triNdx], wx, dstW, triNy
+ ),
+ glsTextureTestUtil.triDerivateX(
+ triR[triNdx], triW[triNdx], wx, dstW, triNy
+ )
+ ];
+ var coordDy = [
+ glsTextureTestUtil.triDerivateY(
+ triS[triNdx], triW[triNdx], wy, dstH, triNx
+ ),
+ glsTextureTestUtil.triDerivateY(
+ triT[triNdx], triW[triNdx], wy, dstH, triNx
+ ),
+ glsTextureTestUtil.triDerivateY(
+ triR[triNdx], triW[triNdx], wy, dstH, triNx
+ )
+ ];
+
+ var lodBounds =
+ tcuTexLookupVerifier.computeCubeLodBoundsFromDerivates(
+ coord, coordDx, coordDy, src.getSize(), lodPrec
+ );
+
+ // Compute lod bounds across lodOffsets range.
+ for (var lodOffsNdx = 0;
+ lodOffsNdx < lodOffsets.length;
+ lodOffsNdx++) {
+ var wxo = triWx + lodOffsets[lodOffsNdx][0];
+ var wyo = triWy + lodOffsets[lodOffsNdx][1];
+ var nxo = wxo / dstW;
+ var nyo = wyo / dstH;
+
+ var coordO = [
+ glsTextureTestUtil.projectedTriInterpolate(
+ triS[triNdx], triW[triNdx], nxo, nyo
+ ),
+ glsTextureTestUtil.projectedTriInterpolate(
+ triT[triNdx], triW[triNdx], nxo, nyo
+ ),
+ glsTextureTestUtil.projectedTriInterpolate(
+ triR[triNdx], triW[triNdx], nxo, nyo
+ )
+ ];
+ var coordDxo = [
+ glsTextureTestUtil.triDerivateX(
+ triS[triNdx], triW[triNdx], wxo, dstW, nyo
+ ),
+ glsTextureTestUtil.triDerivateX(
+ triT[triNdx], triW[triNdx], wxo, dstW, nyo
+ ),
+ glsTextureTestUtil.triDerivateX(
+ triR[triNdx], triW[triNdx], wxo, dstW, nyo
+ )
+ ];
+ var coordDyo = [
+ glsTextureTestUtil.triDerivateY(
+ triS[triNdx], triW[triNdx], wyo, dstH, nxo
+ ),
+ glsTextureTestUtil.triDerivateY(
+ triT[triNdx], triW[triNdx], wyo, dstH, nxo
+ ),
+ glsTextureTestUtil.triDerivateY(
+ triR[triNdx], triW[triNdx], wyo, dstH, nxo
+ )
+ ];
+ var lodO =
+ tcuTexLookupVerifier.
+ computeCubeLodBoundsFromDerivates(
+ coordO, coordDxo, coordDyo,
+ src.getSize(), lodPrec
+ );
+
+ lodBounds[0] = Math.min(lodBounds[0], lodO[0]);
+ lodBounds[1] = Math.max(lodBounds[1], lodO[1]);
+ }
+
+ var clampedLod = tcuTexLookupVerifier.clampLodBounds(
+ deMath.addScalar(lodBounds, lodBias),
+ [sampleParams.minLod, sampleParams.maxLod],
+ lodPrec
+ );
+
+ if (tcuTexLookupVerifier.
+ isLookupResultValid_TextureCubeView(
+ src, sampleParams.sampler, lookupPrec, coord, clampedLod, resPix
+ )
+ ) {
+ isOk = true;
+ break;
+ }
+ }
+
+ if (!isOk) {
+ var red = [255, 0, 0, 255];
+ errorMask.setPixel(new tcuRGBA.RGBA(red).toVec(), px, py);
+ numFailed += 1;
+ }
+ }
+ }
+ }
+
+ return numFailed;
+};
+
+/**
+ * @param {tcuTexture.ConstPixelBufferAccess} result
+ * @param {tcuTexture.Texture2DArrayView} src
+ * @param {Array<number>} texCoord
+ * @param {glsTextureTestUtil.ReferenceParams} sampleParams
+ * @param {tcuTexLookupVerifier.LookupPrecision} lookupPrec
+ * @param {tcuTexLookupVerifier.LodPrecision} lodPrec
+ * @param {tcuPixelFormat.PixelFormat} pixelFormat
+ * @return {boolean}
+ */
+glsTextureTestUtil.verifyTexture2DArrayResult = function(result, src, texCoord, sampleParams, lookupPrec, lodPrec, pixelFormat) {
+ DE_ASSERT(deMath.equal(glsTextureTestUtil.getCompareMask(pixelFormat), lookupPrec.colorMask));
+ /** @type {tcuSurface.Surface} */ var reference = new tcuSurface.Surface(result.getWidth(), result.getHeight());
+ /** @type {tcuSurface.Surface} */ var errorMask = new tcuSurface.Surface(result.getWidth(), result.getHeight());
+ /** @type {number} */ var numFailedPixels;
+
+ /** @type {glsTextureTestUtil.SurfaceAccess} */ var surface = new glsTextureTestUtil.SurfaceAccess(reference, pixelFormat);
+
+ glsTextureTestUtil.sampleTexture2DArray(surface, src, texCoord, sampleParams);
+ numFailedPixels = glsTextureTestUtil.computeTextureLookupDiff2DArray(result, reference.getAccess(), errorMask.getAccess(), src, texCoord, sampleParams, lookupPrec, lodPrec/*, testCtx.getWatchDog()*/);
+
+ if (numFailedPixels > 0)
+ tcuImageCompare.displayImages(result, reference.getAccess(), errorMask.getAccess());
+
+ return numFailedPixels == 0;
+};
+
+/**
+ * @param {tcuTexture.ConstPixelBufferAccess} result
+ * @param {tcuTexture.ConstPixelBufferAccess} reference
+ * @param {tcuTexture.PixelBufferAccess} errorMask
+ * @param {tcuTexture.Texture2DArrayView} src
+ * @param {Array<number>} texCoord
+ * @param {glsTextureTestUtil.ReferenceParams} sampleParams
+ * @param {tcuTexCompareVerifier.TexComparePrecision} comparePrec
+ * @param {tcuTexLookupVerifier.LodPrecision} lodPrec
+ * @param {Array<number>} nonShadowThreshold
+ * @return {number}
+ */
+glsTextureTestUtil.computeTextureCompareDiff2DArray = function(result, reference, errorMask, src, texCoord, sampleParams, comparePrec, lodPrec, nonShadowThreshold) {
+ DE_ASSERT(result.getWidth() == reference.getWidth() && result.getHeight() == reference.getHeight());
+ DE_ASSERT(result.getWidth() == errorMask.getWidth() && result.getHeight() == errorMask.getHeight());
+
+ var sq = [texCoord[0 + 0], texCoord[3 + 0], texCoord[6 + 0], texCoord[9 + 0]];
+ var tq = [texCoord[0 + 1], texCoord[3 + 1], texCoord[6 + 1], texCoord[9 + 1]];
+ var rq = [texCoord[0 + 2], texCoord[3 + 2], texCoord[6 + 2], texCoord[9 + 2]];
+
+ var dstSize = [result.getWidth(), result.getHeight()];
+ var dstW = dstSize[0];
+ var dstH = dstSize[1];
+ var srcSize = [src.getWidth(), src.getHeight()];
+
+ // Coordinates and lod per triangle.
+ var triS = [deMath.swizzle(sq, [0, 1, 2]), deMath.swizzle(sq, [3, 2, 1])];
+ var triT = [deMath.swizzle(tq, [0, 1, 2]), deMath.swizzle(tq, [3, 2, 1])];
+ var triR = [deMath.swizzle(rq, [0, 1, 2]), deMath.swizzle(rq, [3, 2, 1])];
+ var triW = [deMath.swizzle(sampleParams.w, [0, 1, 2]), deMath.swizzle(sampleParams.w, [3, 2, 1])];
+
+ var lodBias = sampleParams.flags.use_bias ? [sampleParams.bias, sampleParams.bias] : [0, 0];
+ var numFailed = 0;
+
+ var lodOffsets = [
+ [-1, 0],
+ [1, 0],
+ [0, -1],
+ [0, 1]
+ ];
+
+ /** @type {Array<number>} */ var green = [0, 255, 0, 255];
+ errorMask.clear(green);
+
+ /** @type {Array<number>} */ var red = [];
+ for (var py = 0; py < result.getHeight(); py++) {
+ for (var px = 0; px < result.getWidth(); px++) {
+ /** @type {Array<number>} */
+ var resPix = result.getPixel(px, py);
+ /** @type {Array<number>} */
+ var refPix = reference.getPixel(px, py);
+
+ if (!deMath.boolAll(deMath.lessThanEqual(deMath.absDiff(deMath.swizzle(refPix, [1, 2, 3]), deMath.swizzle(resPix, [1, 2, 3])), nonShadowThreshold))) {
+ red = [255, 0, 0, 255];
+ errorMask.setPixel(red, px, py);
+ numFailed += 1;
+ continue;
+ }
+
+ if (resPix[0] != refPix[0]) {
+ var wx = px + 0.5;
+ var wy = py + 0.5;
+ var nx = wx / dstW;
+ var ny = wy / dstH;
+
+ var triNdx = nx + ny >= 1.0 ? 1 : 0;
+ var triWx = triNdx ? dstW - wx : wx;
+ var triWy = triNdx ? dstH - wy : wy;
+ var triNx = triNdx ? 1.0 - nx : nx;
+ var triNy = triNdx ? 1.0 - ny : ny;
+
+ var coord = [glsTextureTestUtil.projectedTriInterpolate(triS[triNdx], triW[triNdx], triNx, triNy),
+ glsTextureTestUtil.projectedTriInterpolate(triT[triNdx], triW[triNdx], triNx, triNy),
+ glsTextureTestUtil.projectedTriInterpolate(triR[triNdx], triW[triNdx], triNx, triNy)];
+ var coordDx = deMath.multiply([glsTextureTestUtil.triDerivateX(triS[triNdx], triW[triNdx], wx, dstW, triNy),
+ glsTextureTestUtil.triDerivateX(triT[triNdx], triW[triNdx], wx, dstW, triNy)], srcSize);
+ var coordDy = deMath.multiply([glsTextureTestUtil.triDerivateY(triS[triNdx], triW[triNdx], wy, dstH, triNx),
+ glsTextureTestUtil.triDerivateY(triT[triNdx], triW[triNdx], wy, dstH, triNx)], srcSize);
+
+ var lodBounds = tcuTexLookupVerifier.computeLodBoundsFromDerivatesUV(coordDx[0], coordDx[1], coordDy[0], coordDy[1], lodPrec);
+
+ // Compute lod bounds across lodOffsets range.
+ for (var lodOffsNdx = 0; lodOffsNdx < lodOffsets.length; lodOffsNdx++) {
+ var wxo = triWx + lodOffsets[lodOffsNdx][0];
+ var wyo = triWy + lodOffsets[lodOffsNdx][1];
+ var nxo = wxo / dstW;
+ var nyo = wyo / dstH;
+
+ var coordO = [glsTextureTestUtil.projectedTriInterpolate(triS[triNdx], triW[triNdx], nxo, nyo),
+ glsTextureTestUtil.projectedTriInterpolate(triT[triNdx], triW[triNdx], nxo, nyo)];
+ var coordDxo = deMath.multiply([glsTextureTestUtil.triDerivateX(triS[triNdx], triW[triNdx], wxo, dstW, nyo),
+ glsTextureTestUtil.triDerivateX(triT[triNdx], triW[triNdx], wxo, dstW, nyo)], srcSize);
+ var coordDyo = deMath.multiply([glsTextureTestUtil.triDerivateY(triS[triNdx], triW[triNdx], wyo, dstH, nxo),
+ glsTextureTestUtil.triDerivateY(triT[triNdx], triW[triNdx], wyo, dstH, nxo)], srcSize);
+ var lodO = tcuTexLookupVerifier.computeLodBoundsFromDerivatesUV(coordDxo[0], coordDxo[1], coordDyo[0], coordDyo[1], lodPrec);
+
+ lodBounds[0] = Math.min(lodBounds[0], lodO[0]);
+ lodBounds[1] = Math.max(lodBounds[1], lodO[1]);
+ }
+
+ var clampedLod = tcuTexLookupVerifier.clampLodBounds(deMath.add(lodBounds, lodBias), [sampleParams.minLod, sampleParams.maxLod], lodPrec);
+ var isOk = tcuTexCompareVerifier.isTexCompareResultValid2DArray(src, sampleParams.sampler, comparePrec, coord, clampedLod, sampleParams.ref, resPix[0]);
+
+ if (!isOk) {
+ red = [255, 0, 0, 255];
+ errorMask.setPixel(red, px, py);
+ numFailed += 1;
+ }
+ }
+ }
+ }
+
+ return numFailed;
+};
+
+/**
+ * @param {tcuTexture.ConstPixelBufferAccess} result
+ * @param {tcuTexture.ConstPixelBufferAccess} reference
+ * @param {tcuTexture.PixelBufferAccess} errorMask
+ * @param {tcuTexture.TextureCubeView} src
+ * @param {Array<number>} texCoord
+ * @param {glsTextureTestUtil.ReferenceParams} sampleParams
+ * @param {tcuTexCompareVerifier.TexComparePrecision} comparePrec
+ * @param {tcuTexLookupVerifier.LodPrecision} lodPrec
+ * @param {Array<number>} nonShadowThreshold
+ * @return {number}
+ */
+glsTextureTestUtil.computeTextureCompareDiffCube = function(result, reference, errorMask, src, texCoord, sampleParams, comparePrec, lodPrec, nonShadowThreshold) {
+ DE_ASSERT(result.getWidth() == reference.getWidth() && result.getHeight() == reference.getHeight());
+ DE_ASSERT(result.getWidth() == errorMask.getWidth() && result.getHeight() == errorMask.getHeight());
+
+ var sq = [texCoord[0 + 0], texCoord[3 + 0], texCoord[6 + 0], texCoord[9 + 0]];
+ var tq = [texCoord[0 + 1], texCoord[3 + 1], texCoord[6 + 1], texCoord[9 + 1]];
+ var rq = [texCoord[0 + 2], texCoord[3 + 2], texCoord[6 + 2], texCoord[9 + 2]];
+
+ var dstSize = [result.getWidth(), result.getHeight()];
+ var dstW = dstSize[0];
+ var dstH = dstSize[1];
+ var srcSize = src.getSize();
+
+ // Coordinates per triangle.
+ var triS = [deMath.swizzle(sq, [0, 1, 2]), deMath.swizzle(sq, [3, 2, 1])];
+ var triT = [deMath.swizzle(tq, [0, 1, 2]), deMath.swizzle(tq, [3, 2, 1])];
+ var triR = [deMath.swizzle(rq, [0, 1, 2]), deMath.swizzle(rq, [3, 2, 1])];
+ var triW = [deMath.swizzle(sampleParams.w, [0, 1, 2]), deMath.swizzle(sampleParams.w, [3, 2, 1])];
+
+ var lodBias = sampleParams.flags.use_bias ? [sampleParams.bias, sampleParams.bias] : [0, 0];
+ var numFailed = 0;
+
+ var lodOffsets = [
+ [-1, 0],
+ [1, 0],
+ [0, -1],
+ [0, 1]
+ ];
+
+ /** @type {Array<number>} */ var green = [0, 255, 0, 255];
+ errorMask.clear(new tcuRGBA.RGBA(green).toVec());
+
+ /** @type {Array<number>} */ var red = [];
+ for (var py = 0; py < result.getHeight(); py++) {
+ for (var px = 0; px < result.getWidth(); px++) {
+ /** @type {Array<number>} */
+ var resPix = result.getPixel(px, py);
+ /** @type {Array<number>} */
+ var refPix = reference.getPixel(px, py);
+
+ if (!deMath.boolAll(deMath.lessThanEqual(deMath.absDiff(deMath.swizzle(resPix, [1, 2, 3]), deMath.swizzle(refPix, [1, 2, 3])), nonShadowThreshold))) {
+ red = [255, 0, 0, 255];
+ errorMask.setPixel(red, px, py);
+ numFailed += 1;
+ continue;
+ }
+
+ if (resPix[0] != refPix[0]) {
+ var wx = px + 0.5;
+ var wy = py + 0.5;
+ var nx = wx / dstW;
+ var ny = wy / dstH;
+
+ var triNdx = nx + ny >= 1.0 ? 1 : 0;
+ var triWx = triNdx ? dstW - wx : wx;
+ var triWy = triNdx ? dstH - wy : wy;
+ var triNx = triNdx ? 1.0 - nx : nx;
+ var triNy = triNdx ? 1.0 - ny : ny;
+
+ var coord = [glsTextureTestUtil.projectedTriInterpolate(triS[triNdx], triW[triNdx], triNx, triNy),
+ glsTextureTestUtil.projectedTriInterpolate(triT[triNdx], triW[triNdx], triNx, triNy),
+ glsTextureTestUtil.projectedTriInterpolate(triR[triNdx], triW[triNdx], triNx, triNy)];
+ var coordDx = [glsTextureTestUtil.triDerivateX(triS[triNdx], triW[triNdx], wx, dstW, triNy),
+ glsTextureTestUtil.triDerivateX(triT[triNdx], triW[triNdx], wx, dstW, triNy),
+ glsTextureTestUtil.triDerivateX(triR[triNdx], triW[triNdx], wx, dstW, triNy)];
+ var coordDy = [glsTextureTestUtil.triDerivateY(triS[triNdx], triW[triNdx], wy, dstH, triNx),
+ glsTextureTestUtil.triDerivateY(triT[triNdx], triW[triNdx], wy, dstH, triNx),
+ glsTextureTestUtil.triDerivateY(triR[triNdx], triW[triNdx], wy, dstH, triNx)];
+
+ var lodBounds = tcuTexLookupVerifier.computeCubeLodBoundsFromDerivates(coord, coordDx, coordDy, srcSize, lodPrec);
+
+ // Compute lod bounds across lodOffsets range.
+ for (var lodOffsNdx = 0; lodOffsNdx < lodOffsets.length; lodOffsNdx++) {
+ var wxo = triWx + lodOffsets[lodOffsNdx][0];
+ var wyo = triWy + lodOffsets[lodOffsNdx][1];
+ var nxo = wxo / dstW;
+ var nyo = wyo / dstH;
+
+ var coordO = [glsTextureTestUtil.projectedTriInterpolate(triS[triNdx], triW[triNdx], nxo, nyo),
+ glsTextureTestUtil.projectedTriInterpolate(triT[triNdx], triW[triNdx], nxo, nyo),
+ glsTextureTestUtil.projectedTriInterpolate(triR[triNdx], triW[triNdx], nxo, nyo)];
+ var coordDxo = [glsTextureTestUtil.triDerivateX(triS[triNdx], triW[triNdx], wxo, dstW, nyo),
+ glsTextureTestUtil.triDerivateX(triT[triNdx], triW[triNdx], wxo, dstW, nyo),
+ glsTextureTestUtil.triDerivateX(triR[triNdx], triW[triNdx], wxo, dstW, nyo)];
+ var coordDyo = [glsTextureTestUtil.triDerivateY(triS[triNdx], triW[triNdx], wyo, dstH, nxo),
+ glsTextureTestUtil.triDerivateY(triT[triNdx], triW[triNdx], wyo, dstH, nxo),
+ glsTextureTestUtil.triDerivateY(triR[triNdx], triW[triNdx], wyo, dstH, nxo)];
+ var lodO = tcuTexLookupVerifier.computeCubeLodBoundsFromDerivates(coordO, coordDxo, coordDyo, srcSize, lodPrec);
+
+ lodBounds[0] = Math.min(lodBounds[0], lodO[0]);
+ lodBounds[1] = Math.max(lodBounds[1], lodO[1]);
+ }
+
+ var clampedLod = tcuTexLookupVerifier.clampLodBounds(deMath.add(lodBounds, lodBias), [sampleParams.minLod, sampleParams.maxLod], lodPrec);
+ var isOk = tcuTexCompareVerifier.isTexCompareResultValidCube(src, sampleParams.sampler, comparePrec, coord, clampedLod, sampleParams.ref, resPix[0]);
+
+ if (!isOk) {
+ red = [255, 0, 0, 255];
+ errorMask.setPixel(red, px, py);
+ numFailed += 1;
+ }
+ }
+ }
+ }
+
+ return numFailed;
+};
+
+/**
+ * @param {Array<number>} s
+ * @param {Array<number>} w
+ * @param {number} nx
+ * @param {number} ny
+ * @return {number}
+ */
+glsTextureTestUtil.projectedTriInterpolate = function(s, w, nx, ny) {
+ return (s[0] * (1.0 - nx - ny) / w[0] + s[1] * ny / w[1] + s[2] * nx / w[2]) / ((1.0 - nx - ny) / w[0] + ny / w[1] + nx / w[2]);
+};
+
+/**
+ * @param {tcuTexture.ConstPixelBufferAccess} result
+ * @param {tcuTexture.ConstPixelBufferAccess} reference
+ * @param {tcuTexture.PixelBufferAccess} errorMask
+ * @param {tcuTexture.Texture2DView} baseView
+ * @param {Array<number>} texCoord
+ * @param {glsTextureTestUtil.ReferenceParams} sampleParams
+ * @param {tcuTexLookupVerifier.LookupPrecision} lookupPrec
+ * @param {tcuTexLookupVerifier.LodPrecision} lodPrec
+ * @param {*=} watchDog - TODO: ??
+ * @return {number}
+ */
+glsTextureTestUtil.computeTextureLookupDiff2D = function(result, reference, errorMask, baseView, texCoord, sampleParams, lookupPrec, lodPrec, watchDog) {
+ DE_ASSERT(result.getWidth() == reference.getWidth() && result.getHeight() == reference.getHeight());
+ DE_ASSERT(result.getWidth() == errorMask.getWidth() && result.getHeight() == errorMask.getHeight());
+
+ /** @type {tcuTexture.Texture2DView} */ var src = baseView.getSubView(sampleParams.baseLevel, sampleParams.maxLevel);
+
+ /** @type {Array<number>} */ var sq = [texCoord[0 + 0], texCoord[2 + 0], texCoord[4 + 0], texCoord[6 + 0]];
+ /** @type {Array<number>} */ var tq = [texCoord[0 + 1], texCoord[2 + 1], texCoord[4 + 1], texCoord[6 + 1]];
+
+ /** @type {Array<number>} */ var dstSize = [result.getWidth(), result.getHeight()];
+ /** @type {number} */ var dstW = dstSize[0];
+ /** @type {number} */ var dstH = dstSize[1];
+ /** @type {Array<number>} */ var srcSize = [src.getWidth(), src.getHeight()];
+
+ // Coordinates and lod per triangle.
+ /** @type {Array<Array<number>>} */ var triS = [deMath.swizzle(sq, [0, 1, 2]), deMath.swizzle(sq, [3, 2, 1])];
+ /** @type {Array<Array<number>>} */ var triT = [deMath.swizzle(tq, [0, 1, 2]), deMath.swizzle(tq, [3, 2, 1])];
+ /** @type {Array<Array<number>>} */ var triW = [deMath.swizzle(sampleParams.w, [0, 1, 2]), deMath.swizzle(sampleParams.w, [3, 2, 1])];
+
+ /** @type {Array<number>} */ var lodBias = sampleParams.flags.use_bias ? [sampleParams.bias, sampleParams.bias] : [0.0, 0.0];
+
+ /** @type {number} */ var numFailed = 0;
+
+ /** @type {Array<Array<number>>} */ var lodOffsets = [
+ [-1, 0],
+ [1, 0],
+ [0, -1],
+ [0, 1]
+ ];
+
+ /** @type {Array<number>} */ var green = [0, 255, 0, 255];
+ errorMask.clear(new tcuRGBA.RGBA(green).toVec());
+
+ for (var py = 0; py < result.getHeight(); py++) {
+ // Ugly hack, validation can take way too long at the moment.
+
+ // TODO:are we implementing qpWatchDog? skipping in the meantime
+ // if (watchDog)
+ // qpWatchDog_touch(watchDog);
+
+ for (var px = 0; px < result.getWidth(); px++) {
+ /** @type {Array<number>} */
+ var resPix = result.getPixel(px, py);
+ glsTextureTestUtil.deapplyScaleAndBias(resPix, sampleParams.colorScale, sampleParams.colorBias);
+ /** @type {Array<number>} */
+ var refPix = reference.getPixel(px, py);
+ glsTextureTestUtil.deapplyScaleAndBias(refPix, sampleParams.colorScale, sampleParams.colorBias);
+
+ // Try comparison to ideal reference first, and if that fails use slower verificator.
+ if (!deMath.boolAll(deMath.lessThanEqual(deMath.absDiff(resPix, refPix), lookupPrec.colorThreshold))) {
+ /** @type {number} */ var wx = px + 0.5;
+ /** @type {number} */ var wy = py + 0.5;
+ /** @type {number} */ var nx = wx / dstW;
+ /** @type {number} */ var ny = wy / dstH;
+
+ /** @type {number} */ var triNdx = nx + ny >= 1.0 ? 1 : 0;
+ /** @type {number} */ var triWx = triNdx ? dstW - wx : wx;
+ /** @type {number} */ var triWy = triNdx ? dstH - wy : wy;
+ /** @type {number} */ var triNx = triNdx ? 1.0 - nx : nx;
+ /** @type {number} */ var triNy = triNdx ? 1.0 - ny : ny;
+
+ /** @type {Array<number>} */ var coord = [
+ glsTextureTestUtil.projectedTriInterpolate(triS[triNdx], triW[triNdx], triNx, triNy),
+ glsTextureTestUtil.projectedTriInterpolate(triT[triNdx], triW[triNdx], triNx, triNy)
+ ];
+ /** @type {Array<number>} */ var coordDx = deMath.multiply([
+ glsTextureTestUtil.triDerivateX(triS[triNdx], triW[triNdx], wx, dstW, triNy),
+ glsTextureTestUtil.triDerivateX(triT[triNdx], triW[triNdx], wx, dstW, triNy)], srcSize);
+ /** @type {Array<number>} */ var coordDy = deMath.multiply([
+ glsTextureTestUtil.triDerivateY(triS[triNdx], triW[triNdx], wy, dstH, triNx),
+ glsTextureTestUtil.triDerivateY(triT[triNdx], triW[triNdx], wy, dstH, triNx)], srcSize);
+
+ /** @type {Array<number>} */
+ var lodBounds = tcuTexLookupVerifier.computeLodBoundsFromDerivatesUV(coordDx[0], coordDx[1], coordDy[0], coordDy[1], lodPrec);
+
+ // Compute lod bounds across lodOffsets range.
+ for (var lodOffsNdx = 0; lodOffsNdx < lodOffsets.length; lodOffsNdx++) {
+ /** @type {number} */ var wxo = triWx + lodOffsets[lodOffsNdx][0];
+ /** @type {number} */ var wyo = triWy + lodOffsets[lodOffsNdx][1];
+ /** @type {number} */ var nxo = wxo / dstW;
+ /** @type {number} */ var nyo = wyo / dstH;
+
+ /** @type {Array<number>} */ var coordO = [
+ glsTextureTestUtil.projectedTriInterpolate(triS[triNdx], triW[triNdx], nxo, nyo),
+ glsTextureTestUtil.projectedTriInterpolate(triT[triNdx], triW[triNdx], nxo, nyo)];
+ /** @type {Array<number>} */ var coordDxo = deMath.multiply([
+ glsTextureTestUtil.triDerivateX(triS[triNdx], triW[triNdx], wxo, dstW, nyo),
+ glsTextureTestUtil.triDerivateX(triT[triNdx], triW[triNdx], wxo, dstW, nyo)], srcSize);
+ /** @type {Array<number>} */ var coordDyo = deMath.multiply([
+ glsTextureTestUtil.triDerivateY(triS[triNdx], triW[triNdx], wyo, dstH, nxo),
+ glsTextureTestUtil.triDerivateY(triT[triNdx], triW[triNdx], wyo, dstH, nxo)], srcSize);
+ /** @type {Array<number>} */
+ var lodO = tcuTexLookupVerifier.computeLodBoundsFromDerivatesUV(coordDxo[0], coordDxo[1], coordDyo[0], coordDyo[1], lodPrec);
+
+ lodBounds[0] = Math.min(lodBounds[0], lodO[0]);
+ lodBounds[1] = Math.max(lodBounds[1], lodO[1]);
+ }
+
+ /** @type {Array<number>} */ var clampedLod = tcuTexLookupVerifier.clampLodBounds(
+ deMath.add(lodBounds, lodBias), [sampleParams.minLod, sampleParams.maxLod], lodPrec);
+ /** @type {boolean} */
+ var isOk = tcuTexLookupVerifier.isLookupResultValid_Texture2DView(src, sampleParams.sampler, lookupPrec, coord, clampedLod, resPix);
+
+ if (!isOk) {
+ /** @type {tcuRGBA.RGBA} */ var red = tcuRGBA.newRGBAComponents(255, 0, 0, 255);
+ errorMask.setPixel(red.toVec(), px, py);
+ numFailed += 1;
+ }
+ }
+ }
+ }
+
+ return numFailed;
+};
+
+// Verifies texture lookup results and returns number of failed pixels.
+
+/**
+ * @param {tcuTexture.ConstPixelBufferAccess} result
+ * @param {tcuTexture.ConstPixelBufferAccess} reference
+ * @param {tcuTexture.PixelBufferAccess} errorMask
+ * @param {tcuTexture.Texture2DArrayView} src
+ * @param {Array<number>} texCoord
+ * @param {glsTextureTestUtil.ReferenceParams} sampleParams
+ * @param {tcuTexLookupVerifier.LookupPrecision} lookupPrec
+ * @param {tcuTexLookupVerifier.LodPrecision} lodPrec
+ * @param {*=} watchDog - TODO: ??
+ * @return {number}
+ */
+glsTextureTestUtil.computeTextureLookupDiff2DArray = function(result, reference, errorMask, src, texCoord, sampleParams, lookupPrec, lodPrec, watchDog) {
+ DE_ASSERT(result.getWidth() == reference.getWidth() && result.getHeight() == reference.getHeight());
+ DE_ASSERT(result.getWidth() == errorMask.getWidth() && result.getHeight() == errorMask.getHeight());
+
+ /** @type {Array<number>} */ var sq = [texCoord[0 + 0], texCoord[3 + 0], texCoord[6 + 0], texCoord[9 + 0]];
+ /** @type {Array<number>} */ var tq = [texCoord[0 + 1], texCoord[3 + 1], texCoord[6 + 1], texCoord[9 + 1]];
+ /** @type {Array<number>} */ var rq = [texCoord[0 + 2], texCoord[3 + 2], texCoord[6 + 2], texCoord[9 + 2]];
+
+ /** @type {Array<number>} */ var dstSize = [result.getWidth(), result.getHeight()];
+ /** @type {number} */ var dstW = dstSize[0];
+ /** @type {number} */ var dstH = dstSize[1];
+ /** @type {Array<number>} */ var srcSize = [src.getWidth(), src.getHeight()];
+
+ // Coordinates and lod per triangle.
+ /** @type {Array<Array<number>>} */ var triS = [deMath.swizzle(sq, [0, 1, 2]), deMath.swizzle(sq, [3, 2, 1])];
+ /** @type {Array<Array<number>>} */ var triT = [deMath.swizzle(tq, [0, 1, 2]), deMath.swizzle(tq, [3, 2, 1])];
+ /** @type {Array<Array<number>>} */ var triR = [deMath.swizzle(rq, [0, 1, 2]), deMath.swizzle(rq, [3, 2, 1])];
+ /** @type {Array<Array<number>>} */ var triW = [deMath.swizzle(sampleParams.w, [0, 1, 2]), deMath.swizzle(sampleParams.w, [3, 2, 1])];
+
+ /** @type {Array<number>} */ var lodBias = sampleParams.flags.use_bias ? [sampleParams.bias, sampleParams.bias] : [0.0, 0.0];
+
+ /** @type {number} */ var numFailed = 0;
+
+ /** @type {Array<Array<number>>} */ var lodOffsets = [
+ [-1, 0],
+ [1, 0],
+ [0, -1],
+ [0, 1]
+ ];
+
+ /** @type {Array<number>} */ var green = [0, 255, 0, 255];
+ errorMask.clear(new tcuRGBA.RGBA(green).toVec());
+
+ for (var py = 0; py < result.getHeight(); py++) {
+ // Ugly hack, validation can take way too long at the moment.
+
+ // TODO:are we implementing qpWatchDog? skipping in the meantime
+ // if (watchDog)
+ // qpWatchDog_touch(watchDog);
+
+ for (var px = 0; px < result.getWidth(); px++) {
+ /** @type {Array<number>} */
+ var resPix = result.getPixel(px, py);
+ glsTextureTestUtil.deapplyScaleAndBias(resPix, sampleParams.colorScale, sampleParams.colorBias);
+ /** @type {Array<number>} */
+ var refPix = reference.getPixel(px, py);
+ glsTextureTestUtil.deapplyScaleAndBias(refPix, sampleParams.colorScale, sampleParams.colorBias);
+
+
+ // Try comparison to ideal reference first, and if that fails use slower verificator.
+ if (!deMath.boolAll(deMath.lessThanEqual(deMath.absDiff(resPix, refPix), lookupPrec.colorThreshold))) {
+ /** @type {number} */ var wx = px + 0.5;
+ /** @type {number} */ var wy = py + 0.5;
+ /** @type {number} */ var nx = wx / dstW;
+ /** @type {number} */ var ny = wy / dstH;
+
+ /** @type {number} */ var triNdx = nx + ny >= 1.0 ? 1 : 0;
+ /** @type {number} */ var triWx = triNdx ? dstW - wx : wx;
+ /** @type {number} */ var triWy = triNdx ? dstH - wy : wy;
+ /** @type {number} */ var triNx = triNdx ? 1.0 - nx : nx;
+ /** @type {number} */ var triNy = triNdx ? 1.0 - ny : ny;
+
+ /** @type {Array<number>} */ var coord = [
+ glsTextureTestUtil.projectedTriInterpolate(triS[triNdx], triW[triNdx], triNx, triNy),
+ glsTextureTestUtil.projectedTriInterpolate(triT[triNdx], triW[triNdx], triNx, triNy),
+ glsTextureTestUtil.projectedTriInterpolate(triR[triNdx], triW[triNdx], triNx, triNy)
+ ];
+ /** @type {Array<number>} */ var coordDx = deMath.multiply([
+ glsTextureTestUtil.triDerivateX(triS[triNdx], triW[triNdx], wx, dstW, triNy),
+ glsTextureTestUtil.triDerivateX(triT[triNdx], triW[triNdx], wx, dstW, triNy)], srcSize);
+ /** @type {Array<number>} */ var coordDy = deMath.multiply([
+ glsTextureTestUtil.triDerivateY(triS[triNdx], triW[triNdx], wy, dstH, triNx),
+ glsTextureTestUtil.triDerivateY(triT[triNdx], triW[triNdx], wy, dstH, triNx)], srcSize);
+
+ /** @type {Array<number>} */
+ var lodBounds = tcuTexLookupVerifier.computeLodBoundsFromDerivatesUV(coordDx[0], coordDx[1], coordDy[0], coordDy[1], lodPrec);
+
+ // Compute lod bounds across lodOffsets range.
+ for (var lodOffsNdx = 0; lodOffsNdx < lodOffsets.length; lodOffsNdx++) {
+ /** @type {number} */ var wxo = triWx + lodOffsets[lodOffsNdx][0];
+ /** @type {number} */ var wyo = triWy + lodOffsets[lodOffsNdx][1];
+ /** @type {number} */ var nxo = wxo / dstW;
+ /** @type {number} */ var nyo = wyo / dstH;
+
+ /** @type {Array<number>} */ var coordO = [
+ glsTextureTestUtil.projectedTriInterpolate(triS[triNdx], triW[triNdx], nxo, nyo),
+ glsTextureTestUtil.projectedTriInterpolate(triT[triNdx], triW[triNdx], nxo, nyo),
+ glsTextureTestUtil.projectedTriInterpolate(triR[triNdx], triW[triNdx], nxo, nyo)
+ ];
+ /** @type {Array<number>} */ var coordDxo = deMath.multiply([
+ glsTextureTestUtil.triDerivateX(triS[triNdx], triW[triNdx], wxo, dstW, nyo),
+ glsTextureTestUtil.triDerivateX(triT[triNdx], triW[triNdx], wxo, dstW, nyo)], srcSize
+ );
+ /** @type {Array<number>} */ var coordDyo = deMath.multiply([
+ glsTextureTestUtil.triDerivateY(triS[triNdx], triW[triNdx], wyo, dstH, nxo),
+ glsTextureTestUtil.triDerivateY(triT[triNdx], triW[triNdx], wyo, dstH, nxo)], srcSize
+ );
+ /** @type {Array<number>} */
+ var lodO = tcuTexLookupVerifier.computeLodBoundsFromDerivatesUV(coordDxo[0], coordDxo[1], coordDyo[0], coordDyo[1], lodPrec);
+
+ lodBounds[0] = Math.min(lodBounds[0], lodO[0]);
+ lodBounds[1] = Math.max(lodBounds[1], lodO[1]);
+ }
+
+ /** @type {Array<number>} */ var clampedLod = tcuTexLookupVerifier.clampLodBounds(
+ deMath.add(lodBounds, lodBias), [sampleParams.minLod, sampleParams.maxLod], lodPrec);
+ /** @type {boolean} */
+ var isOk = tcuTexLookupVerifier.isLookupResultValid_Texture2DArrayView(src, sampleParams.sampler, lookupPrec, coord, clampedLod, resPix);
+
+ if (!isOk) {
+ /** @type {tcuRGBA.RGBA} */ var red = tcuRGBA.newRGBAComponents(255, 0, 0, 255);
+ errorMask.setPixel(red.toVec(), px, py);
+ numFailed += 1;
+ }
+ }
+ }
+ }
+
+ return numFailed;
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsUniformBlockCase.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsUniformBlockCase.js
new file mode 100644
index 0000000000..e9c45366ac
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsUniformBlockCase.js
@@ -0,0 +1,2451 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('modules.shared.glsUniformBlockCase');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.delibs.debase.deString');
+goog.require('framework.delibs.debase.deUtil');
+goog.require('framework.opengl.gluDrawUtil');
+goog.require('framework.opengl.gluShaderProgram');
+goog.require('framework.opengl.gluShaderUtil');
+
+goog.scope(function() {
+
+var glsUniformBlockCase = modules.shared.glsUniformBlockCase;
+var tcuTestCase = framework.common.tcuTestCase;
+var gluShaderProgram = framework.opengl.gluShaderProgram;
+var gluShaderUtil = framework.opengl.gluShaderUtil;
+var gluDrawUtil = framework.opengl.gluDrawUtil;
+var deUtil = framework.delibs.debase.deUtil;
+var deMath = framework.delibs.debase.deMath;
+var deRandom = framework.delibs.debase.deRandom;
+var deString = framework.delibs.debase.deString;
+
+var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+};
+
+var littleEndian = (function() {
+ var buffer = new ArrayBuffer(2);
+ new DataView(buffer).setInt16(0, 256, true /* littleEndian */);
+ // Int16Array uses the platform's endianness.
+ return new Int16Array(buffer)[0] === 256;
+})();
+
+/**
+ * Class to implement some pointers functionality.
+ * @constructor
+ */
+glsUniformBlockCase.BlockPointers = function() {
+ /** @type {ArrayBuffer} */ this.data; //!< Data (vector<deUint8>).
+ /** @type {Array<number>} */ this.offsets = []; //!< Reference block pointers (map<int, void*>).
+ /** @type {Array<number>} */ this.sizes = [];
+};
+
+/**
+ * push - Adds an offset/size pair to the collection
+ * @param {number} offset Offset of the element to refer.
+ * @param {number} size Size of the referred element.
+ */
+glsUniformBlockCase.BlockPointers.prototype.push = function(offset, size) {
+ this.offsets.push(offset);
+ this.sizes.push(size);
+};
+
+/**
+ * find - Finds and maps the data at the given offset, and returns a Uint8Array
+ * @param {number} index of the element to find.
+ * @return {Uint8Array}
+ */
+glsUniformBlockCase.BlockPointers.prototype.find = function(index) {
+ return new Uint8Array(this.data, this.offsets[index], this.sizes[index]);
+};
+
+/**
+ * resize - Replaces resize of a vector in C++. Sets the size of the data buffer.
+ * NOTE: In this case however, if you resize, the data is lost.
+ * @param {number} newsize The new size of the data buffer.
+ */
+glsUniformBlockCase.BlockPointers.prototype.resize = function(newsize) {
+ this.data = new ArrayBuffer(newsize);
+};
+
+/**
+ * glsUniformBlockCase.isSupportedGLSLVersion
+ * @param {gluShaderUtil.GLSLVersion} version
+ * @return {boolean}
+ */
+glsUniformBlockCase.isSupportedGLSLVersion = function(version) {
+ return version >= gluShaderUtil.GLSLVersion.V300_ES;
+};
+
+/**
+ * @enum {number}
+ */
+glsUniformBlockCase.UniformFlags = {
+ PRECISION_LOW: (1 << 0),
+ PRECISION_MEDIUM: (1 << 1),
+ PRECISION_HIGH: (1 << 2),
+
+ LAYOUT_SHARED: (1 << 3),
+ LAYOUT_PACKED: (1 << 4),
+ LAYOUT_STD140: (1 << 5),
+ LAYOUT_ROW_MAJOR: (1 << 6),
+ LAYOUT_COLUMN_MAJOR: (1 << 7), //!< \note Lack of both flags means column-major matrix.
+
+ DECLARE_VERTEX: (1 << 8),
+ DECLARE_FRAGMENT: (1 << 9),
+
+ UNUSED_VERTEX: (1 << 10), //!< glsUniformBlockCase.Uniform or struct member is not read in vertex shader.
+ UNUSED_FRAGMENT: (1 << 11) //!< glsUniformBlockCase.Uniform or struct member is not read in fragment shader.
+};
+
+/** @const */ glsUniformBlockCase.UniformFlags.PRECISION_MASK = glsUniformBlockCase.UniformFlags.PRECISION_LOW | glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM | glsUniformBlockCase.UniformFlags.PRECISION_HIGH;
+/** @const */ glsUniformBlockCase.UniformFlags.LAYOUT_MASK = glsUniformBlockCase.UniformFlags.LAYOUT_SHARED | glsUniformBlockCase.UniformFlags.LAYOUT_PACKED | glsUniformBlockCase.UniformFlags.LAYOUT_STD140 | glsUniformBlockCase.UniformFlags.LAYOUT_ROW_MAJOR | glsUniformBlockCase.UniformFlags.LAYOUT_COLUMN_MAJOR;
+/** @const */ glsUniformBlockCase.UniformFlags.DECLARE_BOTH = glsUniformBlockCase.UniformFlags.DECLARE_VERTEX | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT;
+/** @const */ glsUniformBlockCase.UniformFlags.UNUSED_BOTH = glsUniformBlockCase.UniformFlags.UNUSED_VERTEX | glsUniformBlockCase.UniformFlags.UNUSED_FRAGMENT;
+
+/**
+* glsUniformBlockCase.VarType types enum
+* @enum {number}
+*/
+glsUniformBlockCase.Type = {
+ TYPE_BASIC: 0,
+ TYPE_ARRAY: 1,
+ TYPE_STRUCT: 2
+};
+
+glsUniformBlockCase.Type.TYPE_LAST = Object.keys(glsUniformBlockCase.Type).length;
+
+/**
+* glsUniformBlockCase.TypeArray struct (nothing to do with JS's TypedArrays)
+* @param {glsUniformBlockCase.VarType} elementType
+* @param {number} arraySize
+* @constructor
+*/
+glsUniformBlockCase.TypeArray = function(elementType, arraySize) {
+ /** @type {glsUniformBlockCase.VarType} */ this.elementType = elementType;
+ /** @type {number} */ this.size = arraySize;
+};
+
+/**
+ * glsUniformBlockCase.VarType class
+ * @constructor
+ */
+glsUniformBlockCase.VarType = function() {
+ /** @type {glsUniformBlockCase.Type} */ this.m_type;
+ /** @type {number} */ this.m_flags = 0;
+
+ /*
+ * m_data used to be a 'Data' union in C++. Using a var is enough here.
+ * it will contain any necessary value.
+ */
+
+ /** @type {(gluShaderUtil.DataType|glsUniformBlockCase.TypeArray|glsUniformBlockCase.StructType)} */
+ this.m_data;
+};
+
+/**
+* Creates a basic type glsUniformBlockCase.VarType. Use this after the constructor call.
+* @param {gluShaderUtil.DataType} basicType
+* @param {number} flags
+* @return {glsUniformBlockCase.VarType} The currently modified object
+*/
+glsUniformBlockCase.VarType.prototype.VarTypeBasic = function(basicType, flags) {
+ this.m_type = glsUniformBlockCase.Type.TYPE_BASIC;
+ this.m_flags = flags;
+ this.m_data = basicType;
+
+ return this;
+};
+
+/**
+* Creates an array type glsUniformBlockCase.VarType. Use this after the constructor call.
+* @param {glsUniformBlockCase.VarType} elementType
+* @param {number} arraySize
+* @return {glsUniformBlockCase.VarType} The currently modified object
+*/
+glsUniformBlockCase.VarType.prototype.VarTypeArray = function(elementType, arraySize) {
+ this.m_type = glsUniformBlockCase.Type.TYPE_ARRAY;
+ this.m_flags = 0;
+ this.m_data = new glsUniformBlockCase.TypeArray(elementType, arraySize);
+
+ return this;
+};
+
+/**
+* Creates a struct type glsUniformBlockCase.VarType. Use this after the constructor call.
+* @param {glsUniformBlockCase.StructType} structPtr
+* @return {glsUniformBlockCase.VarType} The currently modified object
+*/
+glsUniformBlockCase.VarType.prototype.VarTypeStruct = function(structPtr) {
+ this.m_type = glsUniformBlockCase.Type.TYPE_STRUCT;
+ this.m_flags = 0;
+ this.m_data = structPtr;
+
+ return this;
+};
+
+/** isBasicType
+* @return {boolean} true if the glsUniformBlockCase.VarType represents a basic type.
+**/
+glsUniformBlockCase.VarType.prototype.isBasicType = function() {
+ return this.m_type == glsUniformBlockCase.Type.TYPE_BASIC;
+};
+
+/** isArrayType
+* @return {boolean} true if the glsUniformBlockCase.VarType represents an array.
+**/
+glsUniformBlockCase.VarType.prototype.isArrayType = function() {
+ return this.m_type == glsUniformBlockCase.Type.TYPE_ARRAY;
+};
+
+/** isStructType
+* @return {boolean} true if the glsUniformBlockCase.VarType represents a struct.
+**/
+glsUniformBlockCase.VarType.prototype.isStructType = function() {
+ return this.m_type == glsUniformBlockCase.Type.TYPE_STRUCT;
+};
+
+/** getFlags
+* @return {number} returns the flags of the glsUniformBlockCase.VarType.
+**/
+glsUniformBlockCase.VarType.prototype.getFlags = function() {
+ return this.m_flags;
+};
+
+/** getBasicType
+* @return {gluShaderUtil.DataType} returns the basic data type of the glsUniformBlockCase.VarType.
+**/
+glsUniformBlockCase.VarType.prototype.getBasicType = function() {
+ return /** @type {gluShaderUtil.DataType} */ (this.m_data);
+};
+
+/** getElementType
+* @return {glsUniformBlockCase.VarType} returns the glsUniformBlockCase.VarType of the element in case of an Array.
+**/
+glsUniformBlockCase.VarType.prototype.getElementType = function() {
+ return this.m_data.elementType;
+};
+
+/** getArraySize
+* (not to be confused with a javascript array)
+* @return {number} returns the size of the array in case it is an array.
+**/
+glsUniformBlockCase.VarType.prototype.getArraySize = function() {
+ return this.m_data.size;
+};
+
+/** getStruct
+* @return {glsUniformBlockCase.StructType} returns the structure when it is a glsUniformBlockCase.StructType.
+**/
+glsUniformBlockCase.VarType.prototype.getStruct = function() {
+ return /** @type {glsUniformBlockCase.StructType} */ (this.m_data);
+};
+
+/**
+ * Creates a basic type glsUniformBlockCase.VarType.
+ * @param {gluShaderUtil.DataType} basicType
+ * @param {number} flags
+ * @return {glsUniformBlockCase.VarType}
+ */
+glsUniformBlockCase.newVarTypeBasic = function(basicType, flags) {
+ return new glsUniformBlockCase.VarType().VarTypeBasic(basicType, flags);
+};
+
+/**
+* Creates an array type glsUniformBlockCase.VarType.
+* @param {glsUniformBlockCase.VarType} elementType
+* @param {number} arraySize
+* @return {glsUniformBlockCase.VarType}
+*/
+glsUniformBlockCase.newVarTypeArray = function(elementType, arraySize) {
+ return new glsUniformBlockCase.VarType().VarTypeArray(elementType, arraySize);
+};
+
+/**
+* Creates a struct type glsUniformBlockCase.VarType.
+* @param {glsUniformBlockCase.StructType} structPtr
+* @return {glsUniformBlockCase.VarType}
+*/
+glsUniformBlockCase.newVarTypeStruct = function(structPtr) {
+ return new glsUniformBlockCase.VarType().VarTypeStruct(structPtr);
+};
+
+/** glsUniformBlockCase.StructMember
+ * in the JSDoc annotations or if a number would do.
+ * @constructor
+**/
+glsUniformBlockCase.StructMember = function() {
+ /** @type {string} */ this.m_name;
+ /** @type {glsUniformBlockCase.VarType} */ this.m_type;
+ /** @type {number} */ this.m_flags = 0;
+};
+
+/**
+ * Creates a glsUniformBlockCase.StructMember. Use this after the constructor call.
+ * @param {string} name
+ * @param {glsUniformBlockCase.VarType} type
+ * @param {number} flags
+ * @return {glsUniformBlockCase.StructMember} The currently modified object
+ */
+glsUniformBlockCase.StructMember.prototype.Constructor = function(name, type, flags) {
+ this.m_type = type;
+ this.m_name = name;
+ this.m_flags = flags;
+
+ return this;
+};
+
+/** getName
+* @return {string} the name of the member
+**/
+glsUniformBlockCase.StructMember.prototype.getName = function() { return this.m_name; };
+
+/** getType
+* @return {glsUniformBlockCase.VarType} the type of the member
+**/
+glsUniformBlockCase.StructMember.prototype.getType = function() { return this.m_type; };
+
+/** getFlags
+* @return {number} the flags in the member
+**/
+glsUniformBlockCase.StructMember.prototype.getFlags = function() { return this.m_flags; };
+
+/**
+ * Creates a glsUniformBlockCase.StructMember with name, type and flags.
+ * @param {string} name
+ * @param {glsUniformBlockCase.VarType} type
+ * @return {glsUniformBlockCase.StructMember}
+ */
+ glsUniformBlockCase.newStructMember = function(name, type, flags) {
+ return new glsUniformBlockCase.StructMember().Constructor(name, type, flags);
+ };
+
+/**
+ * glsUniformBlockCase.StructType
+ * @constructor
+ */
+glsUniformBlockCase.StructType = function() {
+ /** @type {string}*/ this.m_typeName;
+ /** @type {Array<glsUniformBlockCase.StructMember>} */ this.m_members = [];
+};
+
+/**
+ * glsUniformBlockCase.StructType - Constructor with type name
+ * @param {string} typeName
+ * @return {glsUniformBlockCase.StructType} The currently modified object.
+ */
+glsUniformBlockCase.StructType.prototype.Constructor = function(typeName) {
+ /** @type {string}*/ this.m_typeName = typeName;
+ return this;
+};
+
+/** getTypeName
+* @return {string}
+**/
+glsUniformBlockCase.StructType.prototype.getTypeName = function() {
+ return this.m_typeName;
+};
+
+/*
+ * Instead of iterators, we'll add
+ * a getter for a specific element (getMember),
+ * and current members amount (getSize).
+ */
+
+/** getMember
+* @param {number} memberNdx The index of the member to retrieve.
+* @return {glsUniformBlockCase.StructMember}
+**/
+glsUniformBlockCase.StructType.prototype.getMember = function(memberNdx) {
+ if (memberNdx >= 0 && memberNdx < this.m_members.length)
+ return this.m_members[memberNdx];
+ else {
+ throw new Error("Invalid member index for glsUniformBlockCase.StructType's members");
+ }
+};
+
+/** getSize
+* @return {number} The size of the m_members array.
+**/
+glsUniformBlockCase.StructType.prototype.getSize = function() {
+ return this.m_members.length;
+};
+
+/** addMember
+* @param {string} member_name
+* @param {glsUniformBlockCase.VarType} member_type
+* @param {number=} member_flags
+**/
+glsUniformBlockCase.StructType.prototype.addMember = function(member_name, member_type, member_flags) {
+ var member = glsUniformBlockCase.newStructMember(member_name, member_type, member_flags);
+
+ this.m_members.push(member);
+};
+
+/**
+ * Creates a glsUniformBlockCase.StructType.
+ * @param {string} name
+ * @return {glsUniformBlockCase.StructType}
+ */
+glsUniformBlockCase.newStructType = function(name) {
+ return new glsUniformBlockCase.StructType().Constructor(name);
+};
+
+/** glsUniformBlockCase.Uniform
+ * @param {string} name
+ * @param {glsUniformBlockCase.VarType} type
+ * @param {number=} flags
+ * @constructor
+**/
+glsUniformBlockCase.Uniform = function(name, type, flags) {
+ /** @type {string} */ this.m_name = name;
+ /** @type {glsUniformBlockCase.VarType} */ this.m_type = type;
+ /** @type {number} */ this.m_flags = (typeof flags === 'undefined') ? 0 : flags;
+};
+
+/** getName
+ * @return {string}
+ */
+glsUniformBlockCase.Uniform.prototype.getName = function() {
+ return this.m_name;
+};
+
+/** getType
+ * @return {glsUniformBlockCase.VarType}
+ */
+glsUniformBlockCase.Uniform.prototype.getType = function() {
+ return this.m_type;
+};
+
+/** getFlags
+* @return {number}
+**/
+glsUniformBlockCase.Uniform.prototype.getFlags = function() {
+ return this.m_flags;
+};
+
+/** glsUniformBlockCase.UniformBlock
+ * @param {string} blockName
+ * @constructor
+**/
+glsUniformBlockCase.UniformBlock = function(blockName) {
+ /** @type {string} */ this.m_blockName = blockName;
+ /** @type {string} */ this.m_instanceName;
+ /** @type {Array<glsUniformBlockCase.Uniform>} */ this.m_uniforms = [];
+ /** @type {number} */ this.m_arraySize = 0; //!< Array size or 0 if not interface block array.
+ /** @type {number} */ this.m_flags = 0;
+};
+
+/** getBlockName
+* @return {string}
+**/
+glsUniformBlockCase.UniformBlock.prototype.getBlockName = function() {
+ return this.m_blockName;
+};
+
+/** getInstanceName
+* @return {string}
+**/
+glsUniformBlockCase.UniformBlock.prototype.getInstanceName = function() {
+ return this.m_instanceName;
+};
+
+/** isArray
+* @return {boolean}
+**/
+glsUniformBlockCase.UniformBlock.prototype.isArray = function() {
+ return this.m_arraySize > 0;
+};
+
+/** getArraySize
+* @return {number}
+**/
+glsUniformBlockCase.UniformBlock.prototype.getArraySize = function() {
+ return this.m_arraySize;
+};
+
+/** getFlags
+* @return {number}
+**/
+glsUniformBlockCase.UniformBlock.prototype.getFlags = function() {
+ return this.m_flags;
+};
+
+/** setInstanceName
+* @param {string} name
+**/
+glsUniformBlockCase.UniformBlock.prototype.setInstanceName = function(name) {
+ this.m_instanceName = name;
+};
+
+/** setFlags
+* @param {number} flags
+**/
+glsUniformBlockCase.UniformBlock.prototype.setFlags = function(flags) {
+ this.m_flags = flags;
+};
+
+/** setArraySize
+* @param {number} arraySize
+**/
+glsUniformBlockCase.UniformBlock.prototype.setArraySize = function(arraySize) {
+ this.m_arraySize = arraySize;
+};
+
+/** addUniform
+* @param {glsUniformBlockCase.Uniform} uniform
+**/
+glsUniformBlockCase.UniformBlock.prototype.addUniform = function(uniform) {
+ this.m_uniforms.push(uniform);
+};
+
+/*
+ * Using uniform getter (getUniform),
+ * and uniform array size getter (countUniforms)
+ * instead of iterators.
+*/
+
+/**
+ * getUniform
+ * @param {number} index
+ * @return {glsUniformBlockCase.Uniform}
+ */
+glsUniformBlockCase.UniformBlock.prototype.getUniform = function(index) {
+ if (index >= 0 && index < this.m_uniforms.length)
+ return this.m_uniforms[index];
+ else {
+ throw new Error("Invalid uniform index for glsUniformBlockCase.UniformBlock's uniforms");
+ }
+};
+
+/**
+ * countUniforms
+ * @return {number}
+ */
+glsUniformBlockCase.UniformBlock.prototype.countUniforms = function() {
+ return this.m_uniforms.length;
+};
+
+/**
+ * glsUniformBlockCase.ShaderInterface
+ * @constructor
+ */
+glsUniformBlockCase.ShaderInterface = function() {
+ /** @type {Array<glsUniformBlockCase.StructType>} */ this.m_structs = [];
+ /** @type {Array<glsUniformBlockCase.UniformBlock>} */ this.m_uniformBlocks = [];
+};
+
+/** allocStruct
+* @param {string} name
+* @return {glsUniformBlockCase.StructType}
+**/
+glsUniformBlockCase.ShaderInterface.prototype.allocStruct = function(name) {
+ //m_structs.reserve(m_structs.length + 1);
+ this.m_structs.push(glsUniformBlockCase.newStructType(name));
+ return this.m_structs[this.m_structs.length - 1];
+};
+
+/** findStruct
+* @param {string} name
+* @return {glsUniformBlockCase.StructType}
+**/
+glsUniformBlockCase.ShaderInterface.prototype.findStruct = function(name) {
+ for (var pos = 0; pos < this.m_structs.length; pos++) {
+ if (this.m_structs[pos].getTypeName() == name)
+ return this.m_structs[pos];
+ }
+ return null;
+};
+
+/** getNamedStructs
+* @param {Array<glsUniformBlockCase.StructType>} structs
+**/
+glsUniformBlockCase.ShaderInterface.prototype.getNamedStructs = function(structs) {
+ for (var pos = 0; pos < this.m_structs.length; pos++) {
+ if (this.m_structs[pos].getTypeName() != undefined)
+ structs.push(this.m_structs[pos]);
+ }
+};
+
+/** allocBlock
+* @param {string} name
+* @return {glsUniformBlockCase.UniformBlock}
+**/
+glsUniformBlockCase.ShaderInterface.prototype.allocBlock = function(name) {
+ this.m_uniformBlocks.push(new glsUniformBlockCase.UniformBlock(name));
+ return this.m_uniformBlocks[this.m_uniformBlocks.length - 1];
+};
+
+/** getNumUniformBlocks
+* @return {number}
+**/
+glsUniformBlockCase.ShaderInterface.prototype.getNumUniformBlocks = function() {
+ return this.m_uniformBlocks.length;
+};
+
+/** getUniformBlock
+* @param {number} ndx
+* @return {glsUniformBlockCase.UniformBlock}
+**/
+glsUniformBlockCase.ShaderInterface.prototype.getUniformBlock = function(ndx) {
+ return this.m_uniformBlocks[ndx];
+};
+
+/**
+ * @constructor
+ */
+glsUniformBlockCase.BlockLayoutEntry = function() {
+ return {
+ /** @type {number} */ size: 0,
+ /** @type {string} */ name: '',
+ /** @type {Array<number>} */ activeUniformIndices: []
+ };
+};
+
+/**
+ * @constructor
+ */
+glsUniformBlockCase.UniformLayoutEntry = function() {
+ return {
+ /** @type {string} */ name: '',
+ /** @type {gluShaderUtil.DataType} */ type: gluShaderUtil.DataType.INVALID,
+ /** @type {number} */ size: 0,
+ /** @type {number} */ blockNdx: -1,
+ /** @type {number} */ offset: -1,
+ /** @type {number} */ arrayStride: -1,
+ /** @type {number} */ matrixStride: -1,
+ /** @type {boolean} */ isRowMajor: false
+ };
+};
+
+/**
+ * @constructor
+ */
+glsUniformBlockCase.UniformLayout = function() {
+ /** @type {Array<glsUniformBlockCase.BlockLayoutEntry>}*/ this.blocks = [];
+ /** @type {Array<glsUniformBlockCase.UniformLayoutEntry>}*/ this.uniforms = [];
+};
+
+/** getUniformIndex, returns a uniform index number in the layout,
+ * given the uniform's name.
+ * @param {string} name
+ * @return {number} uniform's index
+ */
+glsUniformBlockCase.UniformLayout.prototype.getUniformIndex = function(name) {
+ for (var ndx = 0; ndx < this.uniforms.length; ndx++) {
+ if (this.uniforms[ndx].name == name)
+ return ndx;
+ }
+ return -1;
+};
+
+/** getBlockIndex, returns a block index number in the layout,
+ * given the block's name.
+ * @param {string} name the name of the block
+ * @return {number} block's index
+ */
+glsUniformBlockCase.UniformLayout.prototype.getBlockIndex = function(name) {
+ for (var ndx = 0; ndx < this.blocks.length; ndx++) {
+ if (this.blocks[ndx].name == name)
+ return ndx;
+ }
+ return -1;
+};
+
+/**
+ * @enum {number}
+ */
+glsUniformBlockCase.BufferMode = {
+ BUFFERMODE_SINGLE: 0, //!< Single buffer shared between uniform blocks.
+ BUFFERMODE_PER_BLOCK: 1 //!< Per-block buffers
+};
+
+glsUniformBlockCase.BufferMode.BUFFERMODE_LAST = Object.keys(glsUniformBlockCase.BufferMode).length;
+
+/**
+ * glsUniformBlockCase.PrecisionFlagsFmt
+ * @param {number} flags
+ * @return {string}
+ */
+glsUniformBlockCase.PrecisionFlagsFmt = function(flags) {
+ // Precision.
+ DE_ASSERT(deMath.dePop32(flags & (glsUniformBlockCase.UniformFlags.PRECISION_LOW | glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM | glsUniformBlockCase.UniformFlags.PRECISION_HIGH)) <= 1);
+ var str = '';
+ str += (flags & glsUniformBlockCase.UniformFlags.PRECISION_LOW ? 'lowp' :
+ flags & glsUniformBlockCase.UniformFlags.PRECISION_MEDIUM ? 'mediump' :
+ flags & glsUniformBlockCase.UniformFlags.PRECISION_HIGH ? 'highp' : '');
+
+ return str;
+};
+
+/**
+ * glsUniformBlockCase.LayoutFlagsFmt
+ * @param {number} flags_
+ * @return {string}
+ */
+glsUniformBlockCase.LayoutFlagsFmt = function(flags_) {
+ var str = '';
+ var bitDesc =
+ [{ bit: glsUniformBlockCase.UniformFlags.LAYOUT_SHARED, token: 'shared' }, { bit: glsUniformBlockCase.UniformFlags.LAYOUT_PACKED, token: 'packed' }, { bit: glsUniformBlockCase.UniformFlags.LAYOUT_STD140, token: 'std140' }, { bit: glsUniformBlockCase.UniformFlags.LAYOUT_ROW_MAJOR, token: 'row_major' }, { bit: glsUniformBlockCase.UniformFlags.LAYOUT_COLUMN_MAJOR, token: 'column_major' }
+ ];
+
+ /** @type {number} */ var remBits = flags_;
+ for (var descNdx = 0; descNdx < bitDesc.length; descNdx++) {
+ if (remBits & bitDesc[descNdx].bit) {
+ if (remBits != flags_)
+ str += ', ';
+ str += bitDesc[descNdx].token;
+ remBits &= (~bitDesc[descNdx].bit) & 0xFFFFFFFF; //0xFFFFFFFF truncate to 32 bit value
+ }
+ }
+ DE_ASSERT(remBits == 0);
+
+ return str;
+};
+
+/**
+ * @constructor
+ */
+glsUniformBlockCase.UniformBufferManager = function(renderCtx) {
+ this.m_renderCtx = renderCtx;
+ /** @type {Array<number>} */ this.m_buffers = [];
+};
+
+/**
+ * allocBuffer
+ * @return {WebGLBuffer}
+ */
+glsUniformBlockCase.UniformBufferManager.prototype.allocBuffer = function() {
+ /** @type {WebGLBuffer} */ var buf = this.m_renderCtx.createBuffer();
+
+ this.m_buffers.push(buf);
+
+ return buf;
+};
+
+/**
+ * @param {string} name
+ * @param {string} description
+ * @param {glsUniformBlockCase.BufferMode} bufferMode
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ */
+glsUniformBlockCase.UniformBlockCase = function(name, description, bufferMode) {
+ tcuTestCase.DeqpTest.call(this, name, description);
+ /** @type {string} */ this.m_name = name;
+ /** @type {string} */ this.m_description = description;
+ /** @type {glsUniformBlockCase.BufferMode} */ this.m_bufferMode = bufferMode;
+ /** @type {glsUniformBlockCase.ShaderInterface} */ this.m_interface = new glsUniformBlockCase.ShaderInterface();
+};
+
+glsUniformBlockCase.UniformBlockCase.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+glsUniformBlockCase.UniformBlockCase.prototype.constructor = glsUniformBlockCase.UniformBlockCase;
+
+/**
+ * glsUniformBlockCase.getDataTypeByteSize
+ * @param {gluShaderUtil.DataType} type
+ * @return {number}
+ */
+glsUniformBlockCase.getDataTypeByteSize = function(type) {
+ return gluShaderUtil.getDataTypeScalarSize(type) * deMath.INT32_SIZE;
+};
+
+/**
+ * glsUniformBlockCase.getDataTypeByteAlignment
+ * @param {gluShaderUtil.DataType} type
+ * @return {number}
+ */
+glsUniformBlockCase.getDataTypeByteAlignment = function(type) {
+ switch (type) {
+ case gluShaderUtil.DataType.FLOAT:
+ case gluShaderUtil.DataType.INT:
+ case gluShaderUtil.DataType.UINT:
+ case gluShaderUtil.DataType.BOOL: return 1 * deMath.INT32_SIZE;
+
+ case gluShaderUtil.DataType.FLOAT_VEC2:
+ case gluShaderUtil.DataType.INT_VEC2:
+ case gluShaderUtil.DataType.UINT_VEC2:
+ case gluShaderUtil.DataType.BOOL_VEC2: return 2 * deMath.INT32_SIZE;
+
+ case gluShaderUtil.DataType.FLOAT_VEC3:
+ case gluShaderUtil.DataType.INT_VEC3:
+ case gluShaderUtil.DataType.UINT_VEC3:
+ case gluShaderUtil.DataType.BOOL_VEC3: // Fall-through to vec4
+
+ case gluShaderUtil.DataType.FLOAT_VEC4:
+ case gluShaderUtil.DataType.INT_VEC4:
+ case gluShaderUtil.DataType.UINT_VEC4:
+ case gluShaderUtil.DataType.BOOL_VEC4: return 4 * deMath.INT32_SIZE;
+
+ default:
+ DE_ASSERT(false);
+ return 0;
+ }
+};
+
+/**
+ * glsUniformBlockCase.getDataTypeArrayStride
+ * @param {gluShaderUtil.DataType} type
+ * @return {number}
+ */
+glsUniformBlockCase.getDataTypeArrayStride = function(type) {
+ DE_ASSERT(!gluShaderUtil.isDataTypeMatrix(type));
+
+ /** @type {number} */ var baseStride = glsUniformBlockCase.getDataTypeByteSize(type);
+ /** @type {number} */ var vec4Alignment = deMath.INT32_SIZE * 4;
+
+ DE_ASSERT(baseStride <= vec4Alignment);
+ return Math.max(baseStride, vec4Alignment); // Really? See rule 4.
+};
+
+/**
+ * glsUniformBlockCase.deRoundUp32 Rounds up 'a' in case the
+ * relationship with 'b' has a decimal part.
+ * @param {number} a
+ * @param {number} b
+ * @return {number}
+ */
+glsUniformBlockCase.deRoundUp32 = function(a, b) {
+ var d = Math.trunc(a / b);
+ return d * b == a ? a : (d + 1) * b;
+};
+
+/**
+ * glsUniformBlockCase.computeStd140BaseAlignment
+ * @param {glsUniformBlockCase.VarType} type
+ * @return {number}
+ */
+glsUniformBlockCase.computeStd140BaseAlignment = function(type) {
+ /** @type {number} */ var vec4Alignment = deMath.INT32_SIZE * 4;
+
+ if (type.isBasicType()) {
+ /** @type {gluShaderUtil.DataType} */ var basicType = type.getBasicType();
+
+ if (gluShaderUtil.isDataTypeMatrix(basicType)) {
+ /** @type {boolean} */ var isRowMajor = !!(type.getFlags() & glsUniformBlockCase.UniformFlags.LAYOUT_ROW_MAJOR);
+ /** @type {number} */ var vecSize = isRowMajor ? gluShaderUtil.getDataTypeMatrixNumColumns(basicType) :
+ gluShaderUtil.getDataTypeMatrixNumRows(basicType);
+
+ return glsUniformBlockCase.getDataTypeArrayStride(gluShaderUtil.getDataTypeFloatVec(vecSize));
+ } else
+ return glsUniformBlockCase.getDataTypeByteAlignment(basicType);
+ } else if (type.isArrayType()) {
+ /** @type {number} */ var elemAlignment = glsUniformBlockCase.computeStd140BaseAlignment(type.getElementType());
+
+ // Round up to alignment of vec4
+ return glsUniformBlockCase.deRoundUp32(elemAlignment, vec4Alignment);
+ } else {
+ DE_ASSERT(type.isStructType());
+
+ /** @type {number} */ var maxBaseAlignment = 0;
+
+ for (var memberNdx = 0; memberNdx < type.getStruct().getSize(); memberNdx++) {
+ /** @type {glsUniformBlockCase.StructMember} */ var memberIter = type.getStruct().getMember(memberNdx);
+ maxBaseAlignment = Math.max(maxBaseAlignment, glsUniformBlockCase.computeStd140BaseAlignment(memberIter.getType()));
+ }
+
+ return glsUniformBlockCase.deRoundUp32(maxBaseAlignment, vec4Alignment);
+ }
+};
+
+/**
+ * mergeLayoutflags
+ * @param {number} prevFlags
+ * @param {number} newFlags
+ * @return {number}
+ */
+glsUniformBlockCase.mergeLayoutFlags = function(prevFlags, newFlags) {
+ /** @type {number} */ var packingMask = glsUniformBlockCase.UniformFlags.LAYOUT_PACKED | glsUniformBlockCase.UniformFlags.LAYOUT_SHARED | glsUniformBlockCase.UniformFlags.LAYOUT_STD140;
+ /** @type {number} */ var matrixMask = glsUniformBlockCase.UniformFlags.LAYOUT_ROW_MAJOR | glsUniformBlockCase.UniformFlags.LAYOUT_COLUMN_MAJOR;
+
+ /** @type {number} */ var mergedFlags = 0;
+
+ mergedFlags |= ((newFlags & packingMask) ? newFlags : prevFlags) & packingMask;
+ mergedFlags |= ((newFlags & matrixMask) ? newFlags : prevFlags) & matrixMask;
+
+ return mergedFlags;
+};
+
+/**
+ * glsUniformBlockCase.computeStd140Layout_B
+ * @param {glsUniformBlockCase.UniformLayout} layout
+ * @param {number} curOffset
+ * @param {number} curBlockNdx
+ * @param {string} curPrefix
+ * @param {glsUniformBlockCase.VarType} type
+ * @param {number} layoutFlags
+ * @return {number} //This is what would return in the curOffset output parameter in the original C++ project.
+ */
+glsUniformBlockCase.computeStd140Layout_B = function(layout, curOffset, curBlockNdx, curPrefix, type, layoutFlags) {
+ /** @type {number} */ var baseAlignment = glsUniformBlockCase.computeStd140BaseAlignment(type);
+ /** @type {glsUniformBlockCase.UniformLayoutEntry} */ var entry;
+ /** @type {number} */ var stride;
+ /** @type {gluShaderUtil.DataType} */ var elemBasicType;
+ /** @type {boolean} */ var isRowMajor;
+ /** @type {number} */ var vecSize;
+ /** @type {number} */ var numVecs;
+
+ curOffset = deMath.deAlign32(curOffset, baseAlignment);
+
+ if (type.isBasicType()) {
+ /** @type {gluShaderUtil.DataType} */ var basicType = type.getBasicType();
+ entry = new glsUniformBlockCase.UniformLayoutEntry();
+
+ entry.name = curPrefix;
+ entry.type = basicType;
+ entry.size = 1;
+ entry.arrayStride = 0;
+ entry.matrixStride = 0;
+ entry.blockNdx = curBlockNdx;
+
+ if (gluShaderUtil.isDataTypeMatrix(basicType)) {
+ // Array of vectors as specified in rules 5 & 7.
+ isRowMajor = !!(layoutFlags & glsUniformBlockCase.UniformFlags.LAYOUT_ROW_MAJOR);
+ vecSize = isRowMajor ? gluShaderUtil.getDataTypeMatrixNumColumns(basicType) :
+ gluShaderUtil.getDataTypeMatrixNumRows(basicType);
+ numVecs = isRowMajor ? gluShaderUtil.getDataTypeMatrixNumRows(basicType) :
+ gluShaderUtil.getDataTypeMatrixNumColumns(basicType);
+ stride = glsUniformBlockCase.getDataTypeArrayStride(gluShaderUtil.getDataTypeFloatVec(vecSize));
+
+ entry.offset = curOffset;
+ entry.matrixStride = stride;
+ entry.isRowMajor = isRowMajor;
+
+ curOffset += numVecs * stride;
+ } else {
+ // Scalar or vector.
+ entry.offset = curOffset;
+
+ curOffset += glsUniformBlockCase.getDataTypeByteSize(basicType);
+ }
+
+ layout.uniforms.push(entry);
+ } else if (type.isArrayType()) {
+ /** @type {glsUniformBlockCase.VarType} */ var elemType = type.getElementType();
+
+ if (elemType.isBasicType() && !gluShaderUtil.isDataTypeMatrix(elemType.getBasicType())) {
+ // Array of scalars or vectors.
+ elemBasicType = elemType.getBasicType();
+ entry = new glsUniformBlockCase.UniformLayoutEntry();
+ stride = glsUniformBlockCase.getDataTypeArrayStride(elemBasicType);
+
+ entry.name = curPrefix + '[0]'; // Array uniforms are always postfixed with [0]
+ entry.type = elemBasicType;
+ entry.blockNdx = curBlockNdx;
+ entry.offset = curOffset;
+ entry.size = type.getArraySize();
+ entry.arrayStride = stride;
+ entry.matrixStride = 0;
+
+ curOffset += stride * type.getArraySize();
+
+ layout.uniforms.push(entry);
+ } else if (elemType.isBasicType() && gluShaderUtil.isDataTypeMatrix(elemType.getBasicType())) {
+ // Array of matrices.
+ elemBasicType = elemType.getBasicType();
+ isRowMajor = !!(layoutFlags & glsUniformBlockCase.UniformFlags.LAYOUT_ROW_MAJOR);
+ vecSize = isRowMajor ? gluShaderUtil.getDataTypeMatrixNumColumns(elemBasicType) :
+ gluShaderUtil.getDataTypeMatrixNumRows(elemBasicType);
+ numVecs = isRowMajor ? gluShaderUtil.getDataTypeMatrixNumRows(elemBasicType) :
+ gluShaderUtil.getDataTypeMatrixNumColumns(elemBasicType);
+ stride = glsUniformBlockCase.getDataTypeArrayStride(gluShaderUtil.getDataTypeFloatVec(vecSize));
+ entry = new glsUniformBlockCase.UniformLayoutEntry();
+
+ entry.name = curPrefix + '[0]'; // Array uniforms are always postfixed with [0]
+ entry.type = elemBasicType;
+ entry.blockNdx = curBlockNdx;
+ entry.offset = curOffset;
+ entry.size = type.getArraySize();
+ entry.arrayStride = stride * numVecs;
+ entry.matrixStride = stride;
+ entry.isRowMajor = isRowMajor;
+
+ curOffset += numVecs * type.getArraySize() * stride;
+
+ layout.uniforms.push(entry);
+ } else {
+ DE_ASSERT(elemType.isStructType() || elemType.isArrayType());
+
+ for (var elemNdx = 0; elemNdx < type.getArraySize(); elemNdx++)
+ curOffset = glsUniformBlockCase.computeStd140Layout_B(layout, curOffset, curBlockNdx, curPrefix + '[' + elemNdx + ']', type.getElementType(), layoutFlags);
+ }
+ } else {
+ DE_ASSERT(type.isStructType());
+
+ for (var memberNdx = 0; memberNdx < type.getStruct().getSize(); memberNdx++) {
+ /** @type {glsUniformBlockCase.StructMember} */ var memberIter = type.getStruct().getMember(memberNdx);
+ curOffset = glsUniformBlockCase.computeStd140Layout_B(layout, curOffset, curBlockNdx, curPrefix + '.' + memberIter.getName(), memberIter.getType(), layoutFlags);
+ }
+
+ curOffset = deMath.deAlign32(curOffset, baseAlignment);
+ }
+
+ return curOffset;
+};
+
+/**
+ * glsUniformBlockCase.computeStd140Layout
+ * @param {glsUniformBlockCase.UniformLayout} layout
+ * @param {glsUniformBlockCase.ShaderInterface} sinterface
+ */
+glsUniformBlockCase.computeStd140Layout = function(layout, sinterface) {
+ // \todo [2012-01-23 pyry] Uniforms in default block.
+
+ /** @type {number} */ var numUniformBlocks = sinterface.getNumUniformBlocks();
+
+ for (var blockNdx = 0; blockNdx < numUniformBlocks; blockNdx++) {
+ /** @type {glsUniformBlockCase.UniformBlock} */ var block = sinterface.getUniformBlock(blockNdx);
+ /** @type {boolean} */ var hasInstanceName = block.getInstanceName() !== undefined;
+ /** @type {string} */ var blockPrefix = hasInstanceName ? (block.getBlockName() + '.') : '';
+ /** @type {number} */ var curOffset = 0;
+ /** @type {number} */ var activeBlockNdx = layout.blocks.length;
+ /** @type {number} */ var firstUniformNdx = layout.uniforms.length;
+
+ for (var ubNdx = 0; ubNdx < block.countUniforms(); ubNdx++) {
+ /** @type {glsUniformBlockCase.Uniform} */ var uniform = block.getUniform(ubNdx);
+ curOffset = glsUniformBlockCase.computeStd140Layout_B(layout, curOffset, activeBlockNdx, blockPrefix + uniform.getName(), uniform.getType(), glsUniformBlockCase.mergeLayoutFlags(block.getFlags(), uniform.getFlags()));
+ }
+
+ /** @type {number} */ var uniformIndicesEnd = layout.uniforms.length;
+ /** @type {number} */ var blockSize = curOffset;
+ /** @type {number} */ var numInstances = block.isArray() ? block.getArraySize() : 1;
+
+ // Create block layout entries for each instance.
+ for (var instanceNdx = 0; instanceNdx < numInstances; instanceNdx++) {
+ // Allocate entry for instance.
+ layout.blocks.push(new glsUniformBlockCase.BlockLayoutEntry());
+ /** @type {glsUniformBlockCase.BlockLayoutEntry} */ var blockEntry = layout.blocks[layout.blocks.length - 1];
+
+ blockEntry.name = block.getBlockName();
+ blockEntry.size = blockSize;
+
+ // Compute active uniform set for block.
+ for (var uniformNdx = firstUniformNdx; uniformNdx < uniformIndicesEnd; uniformNdx++)
+ blockEntry.activeUniformIndices.push(uniformNdx);
+
+ if (block.isArray())
+ blockEntry.name += '[' + instanceNdx + ']';
+ }
+ }
+};
+
+/**
+ * glsUniformBlockCase.generateValue - Value generator
+ * @param {glsUniformBlockCase.UniformLayoutEntry} entry
+ * @param {Uint8Array} basePtr
+ * @param {deRandom.Random} rnd
+ */
+glsUniformBlockCase.generateValue = function(entry, basePtr, rnd) {
+ /** @type {gluShaderUtil.DataType}*/ var scalarType = gluShaderUtil.getDataTypeScalarTypeAsDataType(entry.type); //Using a more appropriate function in this case.
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(entry.type);
+ /** @type {boolean} */ var isMatrix = gluShaderUtil.isDataTypeMatrix(entry.type);
+ /** @type {number} */ var numVecs = isMatrix ? (entry.isRowMajor ? gluShaderUtil.getDataTypeMatrixNumRows(entry.type) : gluShaderUtil.getDataTypeMatrixNumColumns(entry.type)) : 1;
+ /** @type {number} */ var vecSize = scalarSize / numVecs;
+ /** @type {boolean} */ var isArray = entry.size > 1;
+ /** @type {number} */ var compSize = deMath.INT32_SIZE;
+
+ DE_ASSERT(scalarSize % numVecs == 0);
+
+ for (var elemNdx = 0; elemNdx < entry.size; elemNdx++) {
+ /** @type {Uint8Array} */ var elemPtr = basePtr.subarray(entry.offset + (isArray ? elemNdx * entry.arrayStride : 0));
+
+ for (var vecNdx = 0; vecNdx < numVecs; vecNdx++) {
+ /** @type {Uint8Array} */ var vecPtr = elemPtr.subarray(isMatrix ? vecNdx * entry.matrixStride : 0);
+
+ for (var compNdx = 0; compNdx < vecSize; compNdx++) {
+ /** @type {Uint8Array} */ var compPtr = vecPtr.subarray(compSize * compNdx);
+ /** @type {number} */ var _random;
+
+ //Copy the random data byte per byte
+ var _size = glsUniformBlockCase.getDataTypeByteSize(scalarType);
+
+ var nbuffer = new ArrayBuffer(_size);
+ var nview = new DataView(nbuffer);
+
+ switch (scalarType) {
+ case gluShaderUtil.DataType.FLOAT:
+ _random = rnd.getInt(-9, 9);
+ nview.setFloat32(0, _random, littleEndian);
+ break;
+ case gluShaderUtil.DataType.INT:
+ _random = rnd.getInt(-9, 9);
+ nview.setInt32(0, _random, littleEndian);
+ break;
+ case gluShaderUtil.DataType.UINT:
+ _random = rnd.getInt(0, 9);
+ nview.setUint32(0, _random, littleEndian);
+ break;
+ // \note Random bit pattern is used for true values. Spec states that all non-zero values are
+ // interpreted as true but some implementations fail this.
+ case gluShaderUtil.DataType.BOOL:
+ _random = rnd.getBool() ? 1 : 0;
+ nview.setUint32(0, _random, littleEndian);
+ break;
+ default:
+ DE_ASSERT(false);
+ }
+
+ for (var i = 0; i < _size; i++) {
+ compPtr[i] = nview.getUint8(i);
+ }
+ }
+ }
+ }
+};
+
+/**
+ * glsUniformBlockCase.generateValues
+ * @param {glsUniformBlockCase.UniformLayout} layout
+ * @param {glsUniformBlockCase.BlockPointers} blockPointers
+ * @param {number} seed
+ */
+glsUniformBlockCase.generateValues = function(layout, blockPointers, seed) {
+ /** @type  {deRandom.Random} */ var rnd = new deRandom.Random(seed);
+ /** @type  {number} */ var numBlocks = layout.blocks.length;
+
+ for (var blockNdx = 0; blockNdx < numBlocks; blockNdx++) {
+ /** @type {Uint8Array} */ var basePtr = blockPointers.find(blockNdx);
+ /** @type  {number} */ var numEntries = layout.blocks[blockNdx].activeUniformIndices.length;
+
+ for (var entryNdx = 0; entryNdx < numEntries; entryNdx++) {
+ /** @type {glsUniformBlockCase.UniformLayoutEntry} */ var entry = layout.uniforms[layout.blocks[blockNdx].activeUniformIndices[entryNdx]];
+ glsUniformBlockCase.generateValue(entry, basePtr, rnd);
+ }
+ }
+};
+
+// Shader generator.
+
+/**
+ * glsUniformBlockCase.getCompareFuncForType
+ * @param {gluShaderUtil.DataType} type
+ * @return {string}
+ */
+glsUniformBlockCase.getCompareFuncForType = function(type) {
+ switch (type) {
+ case gluShaderUtil.DataType.FLOAT: return 'mediump float compare_float (highp float a, highp float b) { return abs(a - b) < 0.05 ? 1.0 : 0.0; }\n';
+ case gluShaderUtil.DataType.FLOAT_VEC2: return 'mediump float compare_vec2 (highp vec2 a, highp vec2 b) { return compare_float(a.x, b.x)*compare_float(a.y, b.y); }\n';
+ case gluShaderUtil.DataType.FLOAT_VEC3: return 'mediump float compare_vec3 (highp vec3 a, highp vec3 b) { return compare_float(a.x, b.x)*compare_float(a.y, b.y)*compare_float(a.z, b.z); }\n';
+ case gluShaderUtil.DataType.FLOAT_VEC4: return 'mediump float compare_vec4 (highp vec4 a, highp vec4 b) { return compare_float(a.x, b.x)*compare_float(a.y, b.y)*compare_float(a.z, b.z)*compare_float(a.w, b.w); }\n';
+ case gluShaderUtil.DataType.FLOAT_MAT2: return 'mediump float compare_mat2 (highp mat2 a, highp mat2 b) { return compare_vec2(a[0], b[0])*compare_vec2(a[1], b[1]); }\n';
+ case gluShaderUtil.DataType.FLOAT_MAT2X3: return 'mediump float compare_mat2x3 (highp mat2x3 a, highp mat2x3 b) { return compare_vec3(a[0], b[0])*compare_vec3(a[1], b[1]); }\n';
+ case gluShaderUtil.DataType.FLOAT_MAT2X4: return 'mediump float compare_mat2x4 (highp mat2x4 a, highp mat2x4 b) { return compare_vec4(a[0], b[0])*compare_vec4(a[1], b[1]); }\n';
+ case gluShaderUtil.DataType.FLOAT_MAT3X2: return 'mediump float compare_mat3x2 (highp mat3x2 a, highp mat3x2 b) { return compare_vec2(a[0], b[0])*compare_vec2(a[1], b[1])*compare_vec2(a[2], b[2]); }\n';
+ case gluShaderUtil.DataType.FLOAT_MAT3: return 'mediump float compare_mat3 (highp mat3 a, highp mat3 b) { return compare_vec3(a[0], b[0])*compare_vec3(a[1], b[1])*compare_vec3(a[2], b[2]); }\n';
+ case gluShaderUtil.DataType.FLOAT_MAT3X4: return 'mediump float compare_mat3x4 (highp mat3x4 a, highp mat3x4 b) { return compare_vec4(a[0], b[0])*compare_vec4(a[1], b[1])*compare_vec4(a[2], b[2]); }\n';
+ case gluShaderUtil.DataType.FLOAT_MAT4X2: return 'mediump float compare_mat4x2 (highp mat4x2 a, highp mat4x2 b) { return compare_vec2(a[0], b[0])*compare_vec2(a[1], b[1])*compare_vec2(a[2], b[2])*compare_vec2(a[3], b[3]); }\n';
+ case gluShaderUtil.DataType.FLOAT_MAT4X3: return 'mediump float compare_mat4x3 (highp mat4x3 a, highp mat4x3 b) { return compare_vec3(a[0], b[0])*compare_vec3(a[1], b[1])*compare_vec3(a[2], b[2])*compare_vec3(a[3], b[3]); }\n';
+ case gluShaderUtil.DataType.FLOAT_MAT4: return 'mediump float compare_mat4 (highp mat4 a, highp mat4 b) { return compare_vec4(a[0], b[0])*compare_vec4(a[1], b[1])*compare_vec4(a[2], b[2])*compare_vec4(a[3], b[3]); }\n';
+ case gluShaderUtil.DataType.INT: return 'mediump float compare_int (highp int a, highp int b) { return a == b ? 1.0 : 0.0; }\n';
+ case gluShaderUtil.DataType.INT_VEC2: return 'mediump float compare_ivec2 (highp ivec2 a, highp ivec2 b) { return a == b ? 1.0 : 0.0; }\n';
+ case gluShaderUtil.DataType.INT_VEC3: return 'mediump float compare_ivec3 (highp ivec3 a, highp ivec3 b) { return a == b ? 1.0 : 0.0; }\n';
+ case gluShaderUtil.DataType.INT_VEC4: return 'mediump float compare_ivec4 (highp ivec4 a, highp ivec4 b) { return a == b ? 1.0 : 0.0; }\n';
+ case gluShaderUtil.DataType.UINT: return 'mediump float compare_uint (highp uint a, highp uint b) { return a == b ? 1.0 : 0.0; }\n';
+ case gluShaderUtil.DataType.UINT_VEC2: return 'mediump float compare_uvec2 (highp uvec2 a, highp uvec2 b) { return a == b ? 1.0 : 0.0; }\n';
+ case gluShaderUtil.DataType.UINT_VEC3: return 'mediump float compare_uvec3 (highp uvec3 a, highp uvec3 b) { return a == b ? 1.0 : 0.0; }\n';
+ case gluShaderUtil.DataType.UINT_VEC4: return 'mediump float compare_uvec4 (highp uvec4 a, highp uvec4 b) { return a == b ? 1.0 : 0.0; }\n';
+ case gluShaderUtil.DataType.BOOL: return 'mediump float compare_bool (bool a, bool b) { return a == b ? 1.0 : 0.0; }\n';
+ case gluShaderUtil.DataType.BOOL_VEC2: return 'mediump float compare_bvec2 (bvec2 a, bvec2 b) { return a == b ? 1.0 : 0.0; }\n';
+ case gluShaderUtil.DataType.BOOL_VEC3: return 'mediump float compare_bvec3 (bvec3 a, bvec3 b) { return a == b ? 1.0 : 0.0; }\n';
+ case gluShaderUtil.DataType.BOOL_VEC4: return 'mediump float compare_bvec4 (bvec4 a, bvec4 b) { return a == b ? 1.0 : 0.0; }\n';
+ default:
+ throw new Error('Type "' + type + '" not supported.');
+
+ }
+};
+
+/**
+ * glsUniformBlockCase.getCompareDependencies
+ * @param {Array<gluShaderUtil.DataType>} compareFuncs Should contain unique elements
+ * @param {gluShaderUtil.DataType} basicType
+ */
+glsUniformBlockCase.getCompareDependencies = function(compareFuncs, basicType) {
+ switch (basicType) {
+ case gluShaderUtil.DataType.FLOAT_VEC2:
+ case gluShaderUtil.DataType.FLOAT_VEC3:
+ case gluShaderUtil.DataType.FLOAT_VEC4:
+ deUtil.dePushUniqueToArray(compareFuncs, gluShaderUtil.DataType.FLOAT);
+ deUtil.dePushUniqueToArray(compareFuncs, basicType);
+ break;
+
+ case gluShaderUtil.DataType.FLOAT_MAT2:
+ case gluShaderUtil.DataType.FLOAT_MAT2X3:
+ case gluShaderUtil.DataType.FLOAT_MAT2X4:
+ case gluShaderUtil.DataType.FLOAT_MAT3X2:
+ case gluShaderUtil.DataType.FLOAT_MAT3:
+ case gluShaderUtil.DataType.FLOAT_MAT3X4:
+ case gluShaderUtil.DataType.FLOAT_MAT4X2:
+ case gluShaderUtil.DataType.FLOAT_MAT4X3:
+ case gluShaderUtil.DataType.FLOAT_MAT4:
+ deUtil.dePushUniqueToArray(compareFuncs, gluShaderUtil.DataType.FLOAT);
+ deUtil.dePushUniqueToArray(compareFuncs, gluShaderUtil.getDataTypeFloatVec(gluShaderUtil.getDataTypeMatrixNumRows(basicType)));
+ deUtil.dePushUniqueToArray(compareFuncs, basicType);
+ break;
+
+ default:
+ deUtil.dePushUniqueToArray(compareFuncs, basicType);
+ break;
+ }
+};
+
+/**
+ * glsUniformBlockCase.collectUniqueBasicTypes_B
+ * @param {Array<gluShaderUtil.DataType>} basicTypes Should contain unique elements
+ * @param {glsUniformBlockCase.VarType} type
+ */
+glsUniformBlockCase.collectUniqueBasicTypes_B = function(basicTypes, type) {
+ if (type.isStructType()) {
+ /** @type {glsUniformBlockCase.StructType} */ var stype = type.getStruct();
+ for (var memberNdx = 0; memberNdx < stype.getSize(); memberNdx++)
+ glsUniformBlockCase.collectUniqueBasicTypes_B(basicTypes, stype.getMember(memberNdx).getType());
+ } else if (type.isArrayType())
+ glsUniformBlockCase.collectUniqueBasicTypes_B(basicTypes, type.getElementType());
+ else {
+ DE_ASSERT(type.isBasicType());
+ deUtil.dePushUniqueToArray(basicTypes, type.getBasicType());
+ }
+};
+
+/**
+ * glsUniformBlockCase.collectUniqueBasicTypes_A
+ * @param {Array<gluShaderUtil.DataType>} basicTypes Should contain unique elements
+ * @param {glsUniformBlockCase.UniformBlock} uniformBlock
+ */
+glsUniformBlockCase.collectUniqueBasicTypes_A = function(basicTypes, uniformBlock) {
+ for (var uniformNdx = 0; uniformNdx < uniformBlock.countUniforms(); uniformNdx++)
+ glsUniformBlockCase.collectUniqueBasicTypes_B(basicTypes, uniformBlock.getUniform(uniformNdx).getType());
+};
+
+/**
+ * glsUniformBlockCase.collectUniqueBasicTypes
+ * @param {Array<gluShaderUtil.DataType>} basicTypes Should contain unique elements
+ * @param {glsUniformBlockCase.ShaderInterface} sinterface
+ */
+glsUniformBlockCase.collectUniqueBasicTypes = function(basicTypes, sinterface) {
+ for (var ndx = 0; ndx < sinterface.getNumUniformBlocks(); ++ndx)
+ glsUniformBlockCase.collectUniqueBasicTypes_A(basicTypes, sinterface.getUniformBlock(ndx));
+};
+
+/**
+ * glsUniformBlockCase.collectUniqueBasicTypes
+ * @return {string} Was originally an output parameter. As it is a basic type, we have to return it instead.
+ * @param {glsUniformBlockCase.ShaderInterface} sinterface
+ */
+glsUniformBlockCase.generateCompareFuncs = function(sinterface) {
+ /** @type {string} */ var str = '';
+ /** @type {Array<gluShaderUtil.DataType>} */ var types = []; //Will contain unique elements.
+ /** @type {Array<gluShaderUtil.DataType>} */ var compareFuncs = []; //Will contain unique elements.
+
+ // Collect unique basic types
+ glsUniformBlockCase.collectUniqueBasicTypes(types, sinterface);
+
+ // Set of compare functions required
+ for (var typeNdx = 0; typeNdx < types.length; typeNdx++)
+ glsUniformBlockCase.getCompareDependencies(compareFuncs, types[typeNdx]);
+
+ for (var type in gluShaderUtil.DataType) {
+ if (compareFuncs.indexOf(gluShaderUtil.DataType[type]) > -1)
+ str += glsUniformBlockCase.getCompareFuncForType(gluShaderUtil.DataType[type]);
+ }
+
+ return str;
+};
+
+/**
+ * glsUniformBlockCase.Indent - Prints level_ number of tab chars
+ * @param {number} level_
+ * @return {string}
+ */
+glsUniformBlockCase.Indent = function(level_) {
+ var str = '';
+ for (var i = 0; i < level_; i++)
+ str += '\t';
+
+ return str;
+};
+
+/**
+ * glsUniformBlockCase.generateDeclaration_C
+ * @return {string} src
+ * @param {glsUniformBlockCase.StructType} structType
+ * @param {number} indentLevel
+ */
+glsUniformBlockCase.generateDeclaration_C = function(structType, indentLevel) {
+ /** @type {string} */ var src = '';
+
+ DE_ASSERT(structType.getTypeName() !== undefined);
+ src += glsUniformBlockCase.generateFullDeclaration(structType, indentLevel);
+ src += ';\n';
+
+ return src;
+};
+
+/**
+ * glsUniformBlockCase.generateFullDeclaration
+ * @return {string} src
+ * @param {glsUniformBlockCase.StructType} structType
+ * @param {number} indentLevel
+ */
+glsUniformBlockCase.generateFullDeclaration = function(structType, indentLevel) {
+ var src = 'struct';
+ if (structType.getTypeName())
+ src += ' ' + structType.getTypeName();
+ src += '\n' + glsUniformBlockCase.Indent(indentLevel) + ' {\n';
+
+ for (var memberNdx = 0; memberNdx < structType.getSize(); memberNdx++) {
+ src += glsUniformBlockCase.Indent(indentLevel + 1);
+ /** @type {glsUniformBlockCase.StructMember} */ var memberIter = structType.getMember(memberNdx);
+ src += glsUniformBlockCase.generateDeclaration_B(memberIter.getType(), memberIter.getName(), indentLevel + 1, memberIter.getFlags() & glsUniformBlockCase.UniformFlags.UNUSED_BOTH);
+ }
+
+ src += glsUniformBlockCase.Indent(indentLevel) + '}';
+
+ return src;
+};
+
+/**
+ * glsUniformBlockCase.generateLocalDeclaration
+ * @return {string} src
+ * @param {glsUniformBlockCase.StructType} structType
+ * @param {number} indentLevel
+ */
+glsUniformBlockCase.generateLocalDeclaration = function(structType, indentLevel) {
+ /** @type {string} */ var src = '';
+
+ if (structType.getTypeName() === undefined)
+ src += glsUniformBlockCase.generateFullDeclaration(structType, indentLevel);
+ else
+ src += structType.getTypeName();
+
+ return src;
+};
+
+/**
+ * glsUniformBlockCase.generateDeclaration_B
+ * @return {string} src
+ * @param {glsUniformBlockCase.VarType} type
+ * @param {string} name
+ * @param {number} indentLevel
+ * @param {number} unusedHints
+ */
+glsUniformBlockCase.generateDeclaration_B = function(type, name, indentLevel, unusedHints) {
+ /** @type {string} */ var src = '';
+ /** @type {number} */ var flags = type.getFlags();
+
+ if ((flags & glsUniformBlockCase.UniformFlags.LAYOUT_MASK) != 0)
+ src += 'layout(' + glsUniformBlockCase.LayoutFlagsFmt(flags & glsUniformBlockCase.UniformFlags.LAYOUT_MASK) + ') ';
+
+ if ((flags & glsUniformBlockCase.UniformFlags.PRECISION_MASK) != 0)
+ src += glsUniformBlockCase.PrecisionFlagsFmt(flags & glsUniformBlockCase.UniformFlags.PRECISION_MASK) + ' ';
+
+ if (type.isBasicType())
+ src += gluShaderUtil.getDataTypeName(type.getBasicType()) + ' ' + name;
+ else if (type.isArrayType()) {
+ /** @type {Array<number>} */ var arraySizes = [];
+ /** @type {glsUniformBlockCase.VarType} */ var curType = type;
+ while (curType.isArrayType()) {
+ arraySizes.push(curType.getArraySize());
+ curType = curType.getElementType();
+ }
+
+ if (curType.isBasicType()) {
+ if ((curType.getFlags() & glsUniformBlockCase.UniformFlags.PRECISION_MASK) != 0)
+ src += glsUniformBlockCase.PrecisionFlagsFmt(curType.getFlags() & glsUniformBlockCase.UniformFlags.PRECISION_MASK) + ' ';
+ src += gluShaderUtil.getDataTypeName(curType.getBasicType());
+ } else {
+ DE_ASSERT(curType.isStructType());
+ src += glsUniformBlockCase.generateLocalDeclaration(curType.getStruct(), indentLevel + 1);
+ }
+
+ src += ' ' + name;
+
+ for (var sizeNdx = 0; sizeNdx < arraySizes.length; sizeNdx++)
+ src += '[' + arraySizes[sizeNdx] + ']';
+ } else {
+ src += glsUniformBlockCase.generateLocalDeclaration(type.getStruct(), indentLevel + 1);
+ src += ' ' + name;
+ }
+
+ src += ';';
+
+ // Print out unused hints.
+ if (unusedHints != 0)
+ src += ' // unused in ' + (unusedHints == glsUniformBlockCase.UniformFlags.UNUSED_BOTH ? 'both shaders' :
+ unusedHints == glsUniformBlockCase.UniformFlags.UNUSED_VERTEX ? 'vertex shader' :
+ unusedHints == glsUniformBlockCase.UniformFlags.UNUSED_FRAGMENT ? 'fragment shader' : '???');
+
+ src += '\n';
+
+ return src;
+};
+
+/**
+ * glsUniformBlockCase.generateDeclaration_A
+ * @return {string} src
+ * @param {glsUniformBlockCase.Uniform} uniform
+ * @param {number} indentLevel
+ */
+glsUniformBlockCase.generateDeclaration_A = function(uniform, indentLevel) {
+ /** @type {string} */ var src = '';
+
+ if ((uniform.getFlags() & glsUniformBlockCase.UniformFlags.LAYOUT_MASK) != 0)
+ src += 'layout(' + glsUniformBlockCase.LayoutFlagsFmt(uniform.getFlags() & glsUniformBlockCase.UniformFlags.LAYOUT_MASK) + ') ';
+
+ src += glsUniformBlockCase.generateDeclaration_B(uniform.getType(), uniform.getName(), indentLevel, uniform.getFlags() & glsUniformBlockCase.UniformFlags.UNUSED_BOTH);
+
+ return src;
+};
+
+/**
+ * glsUniformBlockCase.generateDeclaration
+ * @return {string} src
+ * @param {glsUniformBlockCase.UniformBlock} block
+ */
+glsUniformBlockCase.generateDeclaration = function(block) {
+ /** @type {string} */ var src = '';
+
+ if ((block.getFlags() & glsUniformBlockCase.UniformFlags.LAYOUT_MASK) != 0)
+ src += 'layout(' + glsUniformBlockCase.LayoutFlagsFmt(block.getFlags() & glsUniformBlockCase.UniformFlags.LAYOUT_MASK) + ') ';
+
+ src += 'uniform ' + block.getBlockName();
+ src += '\n {\n';
+
+ for (var uniformNdx = 0; uniformNdx < block.countUniforms(); uniformNdx++) {
+ src += glsUniformBlockCase.Indent(1);
+ src += glsUniformBlockCase.generateDeclaration_A(block.getUniform(uniformNdx), 1 /* indent level */);
+ }
+
+ src += '}';
+
+ if (block.getInstanceName() !== undefined) {
+ src += ' ' + block.getInstanceName();
+ if (block.isArray())
+ src += '[' + block.getArraySize() + ']';
+ } else
+ DE_ASSERT(!block.isArray());
+
+ src += ';\n';
+
+ return src;
+};
+
+/**
+ * glsUniformBlockCase.newArrayBufferFromView - Creates a new buffer copying data from a given view
+ * @param {goog.NumberArray} view
+ * @return {ArrayBuffer} The newly created buffer
+ */
+glsUniformBlockCase.newArrayBufferFromView = function(view) {
+ var buffer = new ArrayBuffer(view.length * view.BYTES_PER_ELEMENT);
+ var copyview;
+ switch (view.BYTES_PER_ELEMENT) {
+ case 1:
+ copyview = new Uint8Array(buffer); break;
+ case 2:
+ copyview = new Uint16Array(buffer); break;
+ case 4:
+ copyview = new Uint32Array(buffer); break;
+ default:
+ assertMsgOptions(false, 'Unexpected value for BYTES_PER_ELEMENT in view', false, true);
+ }
+ for (var i = 0; i < view.length; i++)
+ copyview[i] = view[i];
+
+ return buffer;
+};
+
+/**
+ * glsUniformBlockCase.generateValueSrc
+ * @return {string} Used to be an output parameter in C++ project
+ * @param {glsUniformBlockCase.UniformLayoutEntry} entry
+ * @param {Uint8Array} basePtr
+ * @param {number} elementNdx
+ */
+glsUniformBlockCase.generateValueSrc = function(entry, basePtr, elementNdx) {
+ /** @type {string} */ var src = '';
+ /** @type {gluShaderUtil.DataType} */ var scalarType = gluShaderUtil.getDataTypeScalarTypeAsDataType(entry.type);
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(entry.type);
+ /** @type {boolean} */ var isArray = entry.size > 1;
+ /** @type {Uint8Array} */ var elemPtr = basePtr.subarray(entry.offset + (isArray ? elementNdx * entry.arrayStride : 0));
+ /** @type {number} */ var compSize = deMath.INT32_SIZE;
+ /** @type {Uint8Array} */ var compPtr;
+ if (scalarSize > 1)
+ src += gluShaderUtil.getDataTypeName(entry.type) + '(';
+
+ if (gluShaderUtil.isDataTypeMatrix(entry.type)) {
+ /** @type {number} */ var numRows = gluShaderUtil.getDataTypeMatrixNumRows(entry.type);
+ /** @type {number} */ var numCols = gluShaderUtil.getDataTypeMatrixNumColumns(entry.type);
+
+ DE_ASSERT(scalarType == gluShaderUtil.DataType.FLOAT);
+
+ // Constructed in column-wise order.
+ for (var colNdx = 0; colNdx < numCols; colNdx++) {
+ for (var rowNdx = 0; rowNdx < numRows; rowNdx++) {
+ compPtr = elemPtr.subarray(entry.isRowMajor ? rowNdx * entry.matrixStride + colNdx * compSize :
+ colNdx * entry.matrixStride + rowNdx * compSize);
+
+ if (colNdx > 0 || rowNdx > 0)
+ src += ', ';
+
+ var newbuffer = new Uint8Array(compPtr.subarray(0, 4)).buffer;
+ var newview = new DataView(newbuffer);
+ src += parseFloat(newview.getFloat32(0, littleEndian)).toFixed(1);
+ }
+ }
+ } else {
+ for (var scalarNdx = 0; scalarNdx < scalarSize; scalarNdx++) {
+ compPtr = elemPtr.subarray(scalarNdx * compSize);
+
+ if (scalarNdx > 0)
+ src += ', ';
+
+ var newbuffer = glsUniformBlockCase.newArrayBufferFromView(compPtr.subarray(0, 4));
+ var newview = new DataView(newbuffer);
+
+ switch (scalarType) {
+ case gluShaderUtil.DataType.FLOAT: src += parseFloat(newview.getFloat32(0, littleEndian) * 100 / 100).toFixed(1); break;
+ case gluShaderUtil.DataType.INT: src += newview.getInt32(0, littleEndian); break;
+ case gluShaderUtil.DataType.UINT: src += newview.getUint32(0, littleEndian) + 'u'; break;
+ case gluShaderUtil.DataType.BOOL: src += (newview.getUint32(0, littleEndian) != 0 ? 'true' : 'false'); break;
+ default:
+ DE_ASSERT(false);
+ }
+ }
+ }
+
+ if (scalarSize > 1)
+ src += ')';
+
+ return src;
+};
+
+/**
+ * glsUniformBlockCase.generateCompareSrc_A
+ * @return {string} Used to be an output parameter in C++ project
+ * @param {string} resultVar
+ * @param {glsUniformBlockCase.VarType} type
+ * @param {string} srcName
+ * @param {string} apiName
+ * @param {glsUniformBlockCase.UniformLayout} layout
+ * @param {Uint8Array} basePtr
+ * @param {number} unusedMask
+ */
+glsUniformBlockCase.generateCompareSrc_A = function(resultVar, type, srcName, apiName, layout, basePtr, unusedMask) {
+ /** @type {string} */ var src = '';
+ /** @type {string} */ var op;
+ /** @type {glsUniformBlockCase.VarType|gluShaderUtil.DataType} */ var elementType;
+
+ if (type.isBasicType() || (type.isArrayType() && type.getElementType().isBasicType())) {
+ // Basic type or array of basic types.
+ /** @type {boolean} */ var isArray = type.isArrayType();
+ elementType = isArray ? type.getElementType().getBasicType() : type.getBasicType();
+ /** @type {string} */ var typeName = gluShaderUtil.getDataTypeName(elementType);
+ /** @type {string} */ var fullApiName = apiName + (isArray ? '[0]' : ''); // Arrays are always postfixed with [0]
+ /** @type {number} */ var uniformNdx = layout.getUniformIndex(fullApiName);
+ /** @type {glsUniformBlockCase.UniformLayoutEntry} */ var entry = layout.uniforms[uniformNdx];
+
+ if (isArray) {
+ for (var elemNdx = 0; elemNdx < type.getArraySize(); elemNdx++) {
+ src += '\tresult *= compare_' + typeName + '(' + srcName + '[' + elemNdx + '], ';
+ src += glsUniformBlockCase.generateValueSrc(entry, basePtr, elemNdx);
+ src += ');\n';
+ }
+ } else {
+ src += '\tresult *= compare_' + typeName + '(' + srcName + ', ';
+ src += glsUniformBlockCase.generateValueSrc(entry, basePtr, 0);
+ src += ');\n';
+ }
+ } else if (type.isArrayType()) {
+ elementType = type.getElementType();
+
+ for (var elementNdx = 0; elementNdx < type.getArraySize(); elementNdx++) {
+ op = '[' + elementNdx + ']';
+ src += glsUniformBlockCase.generateCompareSrc_A(resultVar, elementType, srcName + op, apiName + op, layout, basePtr, unusedMask);
+ }
+ } else {
+ DE_ASSERT(type.isStructType());
+
+ /** @type {glsUniformBlockCase.StructType} */ var stype = type.getStruct();
+ for (var memberNdx = 0; memberNdx < stype.getSize(); memberNdx++) {
+ /** @type {glsUniformBlockCase.StructMember} */ var memberIter = stype.getMember(memberNdx);
+ if (memberIter.getFlags() & unusedMask)
+ continue; // Skip member.
+
+ op = '.' + memberIter.getName();
+ src += glsUniformBlockCase.generateCompareSrc_A(resultVar, memberIter.getType(), srcName + op, apiName + op, layout, basePtr, unusedMask);
+ }
+ }
+
+ return src;
+};
+
+/**
+ * glsUniformBlockCase.generateCompareSrc
+ * @return {string} Used to be an output parameter in C++ project
+ * @param {string} resultVar
+ * @param {glsUniformBlockCase.ShaderInterface} sinterface
+ * @param {glsUniformBlockCase.UniformLayout} layout
+ * @param {glsUniformBlockCase.BlockPointers} blockPointers
+ * @param {boolean} isVertex
+ */
+glsUniformBlockCase.generateCompareSrc = function(resultVar, sinterface, layout, blockPointers, isVertex) {
+ /** @type {string} */ var src = '';
+ /** @type {number} */ var unusedMask = isVertex ? glsUniformBlockCase.UniformFlags.UNUSED_VERTEX : glsUniformBlockCase.UniformFlags.UNUSED_FRAGMENT;
+
+ for (var blockNdx = 0; blockNdx < sinterface.getNumUniformBlocks(); blockNdx++) {
+ /** @type {glsUniformBlockCase.UniformBlock} */ var block = sinterface.getUniformBlock(blockNdx);
+
+ if ((block.getFlags() & (isVertex ? glsUniformBlockCase.UniformFlags.DECLARE_VERTEX : glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT)) == 0)
+ continue; // Skip.
+
+ /** @type {boolean} */ var hasInstanceName = block.getInstanceName() !== undefined;
+ /** @type {boolean} */ var isArray = block.isArray();
+ /** @type {number} */ var numInstances = isArray ? block.getArraySize() : 1;
+ /** @type {string} */ var apiPrefix = hasInstanceName ? block.getBlockName() + '.' : '';
+
+ DE_ASSERT(!isArray || hasInstanceName);
+
+ for (var instanceNdx = 0; instanceNdx < numInstances; instanceNdx++) {
+ /** @type {string} */ var instancePostfix = isArray ? '[' + instanceNdx + ']' : '';
+ /** @type {string} */ var blockInstanceName = block.getBlockName() + instancePostfix;
+ /** @type {string} */ var srcPrefix = hasInstanceName ? block.getInstanceName() + instancePostfix + '.' : '';
+ /** @type {number} */ var activeBlockNdx = layout.getBlockIndex(blockInstanceName);
+ /** @type {Uint8Array} */ var basePtr = blockPointers.find(activeBlockNdx);
+
+ for (var uniformNdx = 0; uniformNdx < block.countUniforms(); uniformNdx++) {
+ /** @type {glsUniformBlockCase.Uniform} */ var uniform = block.getUniform(uniformNdx);
+
+ if (uniform.getFlags() & unusedMask)
+ continue; // Don't read from that uniform.
+
+ src += glsUniformBlockCase.generateCompareSrc_A(resultVar, uniform.getType(), srcPrefix + uniform.getName(), apiPrefix + uniform.getName(), layout, basePtr, unusedMask);
+ }
+ }
+ }
+
+ return src;
+};
+
+/**
+ * glsUniformBlockCase.generateVertexShader
+ * @return {string} src
+ * @param {glsUniformBlockCase.ShaderInterface} sinterface
+ * @param {glsUniformBlockCase.UniformLayout} layout
+ * @param {glsUniformBlockCase.BlockPointers} blockPointers
+ */
+glsUniformBlockCase.generateVertexShader = function(sinterface, layout, blockPointers) {
+ /** @type {string} */ var src = '';
+
+ DE_ASSERT(glsUniformBlockCase.isSupportedGLSLVersion(gluShaderUtil.getGLSLVersion(gl)));
+
+ src += gluShaderUtil.getGLSLVersionDeclaration(gluShaderUtil.getGLSLVersion(gl)) + '\n';
+ src += 'in highp vec4 a_position;\n';
+ src += 'out mediump float v_vtxResult;\n';
+ src += '\n';
+
+ /** @type {Array<glsUniformBlockCase.StructType>} */ var namedStructs = [];
+ sinterface.getNamedStructs(namedStructs);
+ for (var structNdx = 0; structNdx < namedStructs.length; structNdx++)
+ src += glsUniformBlockCase.generateDeclaration_C(namedStructs[structNdx], 0);
+
+ for (var blockNdx = 0; blockNdx < sinterface.getNumUniformBlocks(); blockNdx++) {
+ /** @type {glsUniformBlockCase.UniformBlock} */ var block = sinterface.getUniformBlock(blockNdx);
+ if (block.getFlags() & glsUniformBlockCase.UniformFlags.DECLARE_VERTEX)
+ src += glsUniformBlockCase.generateDeclaration(block);
+ }
+
+ // Comparison utilities.
+ src += '\n';
+ src += glsUniformBlockCase.generateCompareFuncs(sinterface);
+
+ src += '\n' +
+ 'void main (void)\n' +
+ ' {\n' +
+ ' gl_Position = a_position;\n' +
+ ' mediump float result = 1.0;\n';
+
+ // Value compare.
+ src += glsUniformBlockCase.generateCompareSrc('result', sinterface, layout, blockPointers, true);
+
+ src += ' v_vtxResult = result;\n' +
+ '}\n';
+
+ return src;
+};
+
+/**
+ * glsUniformBlockCase.generateFragmentShader
+ * @return {string} Used to be an output parameter
+ * @param {glsUniformBlockCase.ShaderInterface} sinterface
+ * @param {glsUniformBlockCase.UniformLayout} layout
+ * @param {glsUniformBlockCase.BlockPointers} blockPointers
+ */
+glsUniformBlockCase.generateFragmentShader = function(sinterface, layout, blockPointers) {
+ /** @type {string} */ var src = '';
+ DE_ASSERT(glsUniformBlockCase.isSupportedGLSLVersion(gluShaderUtil.getGLSLVersion(gl)));
+
+ src += gluShaderUtil.getGLSLVersionDeclaration(gluShaderUtil.getGLSLVersion(gl)) + '\n';
+ src += 'in mediump float v_vtxResult;\n';
+ src += 'layout(location = 0) out mediump vec4 dEQP_FragColor;\n';
+ src += '\n';
+
+ /** @type {Array<glsUniformBlockCase.StructType>} */ var namedStructs = [];
+ sinterface.getNamedStructs(namedStructs);
+ for (var structNdx = 0; structNdx < namedStructs.length; structNdx++)
+ src += glsUniformBlockCase.generateDeclaration_C(namedStructs[structNdx], 0);
+
+ for (var blockNdx = 0; blockNdx < sinterface.getNumUniformBlocks(); blockNdx++) {
+ /** @type {glsUniformBlockCase.UniformBlock} */ var block = sinterface.getUniformBlock(blockNdx);
+ if (block.getFlags() & glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT)
+ src += glsUniformBlockCase.generateDeclaration(block);
+ }
+
+ // Comparison utilities.
+ src += '\n';
+ src += glsUniformBlockCase.generateCompareFuncs(sinterface);
+
+ src += '\n' +
+ 'void main (void)\n' +
+ ' {\n' +
+ ' mediump float result = 1.0;\n';
+
+ // Value compare.
+ src += glsUniformBlockCase.generateCompareSrc('result', sinterface, layout, blockPointers, false);
+
+ src += ' dEQP_FragColor = vec4(1.0, v_vtxResult, result, 1.0);\n' +
+ '}\n';
+
+ return src;
+};
+
+/**
+ * TODO: test glsUniformBlockCase.getGLUniformLayout Gets the uniform blocks and uniforms in the program.
+ * @param {WebGL2RenderingContext} gl
+ * @param {glsUniformBlockCase.UniformLayout} layout To store the layout described in program.
+ * @param {WebGLProgram} program id
+ */
+glsUniformBlockCase.getGLUniformLayout = function(gl, layout, program) {
+ /** @type {number} */ var numActiveUniforms = 0;
+ /** @type {number} */ var numActiveBlocks = 0;
+
+ numActiveUniforms = /** @type {number} */ (gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS)); // ACTIVE_UNIFORM* returns GLInt
+ numActiveBlocks = /** @type {number} */ (gl.getProgramParameter(program, gl.ACTIVE_UNIFORM_BLOCKS));
+
+ /** @type {glsUniformBlockCase.BlockLayoutEntry} */ var entryBlock;
+ /** @type {glsUniformBlockCase.UniformLayoutEntry} */ var entryUniform;
+ /** @type {number} */ var size;
+ /** @type {number} */ var nameLen;
+ /** @type {string} */ var nameBuf;
+ /** @type {number} */ var numBlockUniforms;
+
+ // Block entries.
+ //No need to allocate these beforehand: layout.blocks.resize(numActiveBlocks);
+ for (var blockNdx = 0; blockNdx < numActiveBlocks; blockNdx++) {
+ entryBlock = new glsUniformBlockCase.BlockLayoutEntry();
+
+ size = /** @type {number} */ (gl.getActiveUniformBlockParameter(program, blockNdx, gl.UNIFORM_BLOCK_DATA_SIZE));
+ // nameLen not used so this line is removed.
+ // nameLen = gl.getActiveUniformBlockParameter(program, blockNdx, gl.UNIFORM_BLOCK_NAME_LENGTH); // TODO: UNIFORM_BLOCK_NAME_LENGTH is removed in WebGL2
+ numBlockUniforms = /** @type {number} */ (gl.getActiveUniformBlockParameter(program, blockNdx, gl.UNIFORM_BLOCK_ACTIVE_UNIFORMS));
+
+ nameBuf = gl.getActiveUniformBlockName(program, blockNdx);
+
+ entryBlock.name = nameBuf;
+ entryBlock.size = size;
+ //entry.activeUniformIndices.resize(numBlockUniforms);
+
+ if (numBlockUniforms > 0)
+ entryBlock.activeUniformIndices = gl.getActiveUniformBlockParameter(program, blockNdx, gl.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES);
+
+ layout.blocks.push(entryBlock); //Pushing the block into the array here.
+ }
+
+ if (numActiveUniforms > 0) {
+ // glsUniformBlockCase.Uniform entries.
+ /** @type {Array<number>} */ var uniformIndices = [];
+ for (var i = 0; i < numActiveUniforms; i++)
+ uniformIndices.push(i);
+
+ /** @type {Array<number>} */ var types = [];
+ /** @type {Array<number>} */ var sizes = [];
+ /** @type {Array<number>} */ var nameLengths = [];
+ /** @type {Array<number>} */ var blockIndices = [];
+ /** @type {Array<number>} */ var offsets = [];
+ /** @type {Array<number>} */ var arrayStrides = [];
+ /** @type {Array<number>} */ var matrixStrides = [];
+ /** @type {Array<number>} */ var rowMajorFlags = [];
+
+ // Execute queries.
+ types = gl.getActiveUniforms(program, uniformIndices, gl.UNIFORM_TYPE);
+ sizes = gl.getActiveUniforms(program, uniformIndices, gl.UNIFORM_SIZE);
+ // Remove this: nameLengths = gl.getActiveUniforms(program, uniformIndices, gl.UNIFORM_NAME_LENGTH);
+ blockIndices = gl.getActiveUniforms(program, uniformIndices, gl.UNIFORM_BLOCK_INDEX);
+ offsets = gl.getActiveUniforms(program, uniformIndices, gl.UNIFORM_OFFSET);
+ arrayStrides = gl.getActiveUniforms(program, uniformIndices, gl.UNIFORM_ARRAY_STRIDE);
+ matrixStrides = gl.getActiveUniforms(program, uniformIndices, gl.UNIFORM_MATRIX_STRIDE);
+ rowMajorFlags = gl.getActiveUniforms(program, uniformIndices, gl.UNIFORM_IS_ROW_MAJOR);
+
+ // Translate to LayoutEntries
+ // No resize needed. Will push them: layout.uniforms.resize(numActiveUniforms);
+ for (var uniformNdx = 0; uniformNdx < numActiveUniforms; uniformNdx++) {
+ entryUniform = new glsUniformBlockCase.UniformLayoutEntry();
+
+ // Remove this: nameLen = 0;
+ size = 0;
+ /** @type {number} */ var type = gl.NONE;
+
+ var uniform = gl.getActiveUniform(program, uniformNdx);
+
+ nameBuf = uniform.name;
+ // Remove this: nameLen = nameBuf.length;
+ size = uniform.size;
+ type = uniform.type;
+
+ // Remove this: nameLen != nameLengths[uniformNdx] ||
+ if (size != sizes[uniformNdx] ||
+ type != types[uniformNdx])
+ testFailedOptions("Values returned by gl.getActiveUniform() don't match with values queried with gl.getActiveUniforms().", true);
+
+ entryUniform.name = nameBuf;
+ entryUniform.type = gluShaderUtil.getDataTypeFromGLType(types[uniformNdx]);
+ entryUniform.size = sizes[uniformNdx];
+ entryUniform.blockNdx = blockIndices[uniformNdx];
+ entryUniform.offset = offsets[uniformNdx];
+ entryUniform.arrayStride = arrayStrides[uniformNdx];
+ entryUniform.matrixStride = matrixStrides[uniformNdx];
+ entryUniform.isRowMajor = rowMajorFlags[uniformNdx] != false;
+
+ layout.uniforms.push(entryUniform); //Pushing this uniform in the end.
+ }
+ }
+};
+
+/**
+ * glsUniformBlockCase.copyUniformData_A - Copies a source uniform buffer segment to a destination uniform buffer segment.
+ * @param {glsUniformBlockCase.UniformLayoutEntry} dstEntry
+ * @param {Uint8Array} dstBlockPtr
+ * @param {glsUniformBlockCase.UniformLayoutEntry} srcEntry
+ * @param {Uint8Array} srcBlockPtr
+ */
+glsUniformBlockCase.copyUniformData_A = function(dstEntry, dstBlockPtr, srcEntry, srcBlockPtr) {
+ /** @type {Uint8Array} */ var dstBasePtr = dstBlockPtr.subarray(dstEntry.offset);
+ /** @type {Uint8Array} */ var srcBasePtr = srcBlockPtr.subarray(srcEntry.offset);
+
+ DE_ASSERT(dstEntry.size <= srcEntry.size);
+ DE_ASSERT(dstEntry.type == srcEntry.type);
+
+ /** @type {number} */ var scalarSize = gluShaderUtil.getDataTypeScalarSize(dstEntry.type);
+ /** @type {boolean} */ var isMatrix = gluShaderUtil.isDataTypeMatrix(dstEntry.type);
+ /** @type {number} */ var compSize = deMath.INT32_SIZE;
+
+ for (var elementNdx = 0; elementNdx < dstEntry.size; elementNdx++) {
+ /** @type {Uint8Array} */ var dstElemPtr = dstBasePtr.subarray(elementNdx * dstEntry.arrayStride);
+ /** @type {Uint8Array} */ var srcElemPtr = srcBasePtr.subarray(elementNdx * srcEntry.arrayStride);
+
+ if (isMatrix) {
+ /** @type {number} */ var numRows = gluShaderUtil.getDataTypeMatrixNumRows(dstEntry.type);
+ /** @type {number} */ var numCols = gluShaderUtil.getDataTypeMatrixNumColumns(dstEntry.type);
+
+ for (var colNdx = 0; colNdx < numCols; colNdx++) {
+ for (var rowNdx = 0; rowNdx < numRows; rowNdx++) {
+ var srcoffset = dstEntry.isRowMajor ? rowNdx * dstEntry.matrixStride + colNdx * compSize :
+ colNdx * dstEntry.matrixStride + rowNdx * compSize;
+ /** @type {Uint8Array} */ var dstCompPtr = dstElemPtr.subarray(srcoffset, srcoffset + compSize);
+ var dstoffset = srcEntry.isRowMajor ? rowNdx * srcEntry.matrixStride + colNdx * compSize :
+ colNdx * srcEntry.matrixStride + rowNdx * compSize;
+ /** @type {Uint8Array} */ var srcCompPtr = srcElemPtr.subarray(dstoffset, dstoffset + compSize);
+
+ //Copy byte per byte
+ for (var i = 0; i < compSize; i++)
+ dstCompPtr[i] = srcCompPtr[i];
+ }
+ }
+ } else
+ //Copy byte per byte
+ for (var i = 0; i < scalarSize * compSize; i++)
+ dstElemPtr[i] = srcElemPtr[i];
+ }
+};
+
+/**
+ * glsUniformBlockCase.copyUniformData - Copies a source uniform buffer to a destination uniform buffer.
+ * @param {glsUniformBlockCase.UniformLayout} dstLayout
+ * @param {glsUniformBlockCase.BlockPointers} dstBlockPointers
+ * @param {glsUniformBlockCase.UniformLayout} srcLayout
+ * @param {glsUniformBlockCase.BlockPointers} srcBlockPointers
+ */
+glsUniformBlockCase.copyUniformData = function(dstLayout, dstBlockPointers, srcLayout, srcBlockPointers) {
+ // \note Src layout is used as reference in case of activeUniforms happens to be incorrect in dstLayout blocks.
+ /** @type {number} */ var numBlocks = srcLayout.blocks.length;
+
+ for (var srcBlockNdx = 0; srcBlockNdx < numBlocks; srcBlockNdx++) {
+ /** @type {glsUniformBlockCase.BlockLayoutEntry} */ var srcBlock = srcLayout.blocks[srcBlockNdx];
+ /** @type {Uint8Array} */ var srcBlockPtr = srcBlockPointers.find(srcBlockNdx);
+ /** @type {number} */ var dstBlockNdx = dstLayout.getBlockIndex(srcBlock.name);
+ /** @type {Uint8Array} */ var dstBlockPtr = dstBlockNdx >= 0 ? dstBlockPointers.find(dstBlockNdx) : null;
+
+ if (dstBlockNdx < 0)
+ continue;
+
+ for (var srcUniformNdx = 0; srcUniformNdx < srcBlock.activeUniformIndices.length; srcUniformNdx++) {
+ /** @type {number} */ var srcUniformNdxIter = srcBlock.activeUniformIndices[srcUniformNdx];
+ /** @type {glsUniformBlockCase.UniformLayoutEntry} */ var srcEntry = srcLayout.uniforms[srcUniformNdxIter];
+ /** @type {number} */ var dstUniformNdx = dstLayout.getUniformIndex(srcEntry.name);
+
+ if (dstUniformNdx < 0)
+ continue;
+
+ glsUniformBlockCase.copyUniformData_A(dstLayout.uniforms[dstUniformNdx], dstBlockPtr, srcEntry, srcBlockPtr);
+ }
+ }
+};
+
+ /**
+ * TODO: Test with an actual WebGL 2.0 context
+ * iterate - The actual execution of the test.
+ * @return {tcuTestCase.IterateResult}
+ */
+ glsUniformBlockCase.UniformBlockCase.prototype.iterate = function() {
+ /** @type {glsUniformBlockCase.UniformLayout} */ var refLayout = new glsUniformBlockCase.UniformLayout(); //!< std140 layout.
+ /** @type {glsUniformBlockCase.BlockPointers} */ var blockPointers = new glsUniformBlockCase.BlockPointers();
+
+ // Compute reference layout.
+ glsUniformBlockCase.computeStd140Layout(refLayout, this.m_interface);
+
+ // Assign storage for reference values.
+ /** @type {number} */ var totalSize = 0;
+ for (var blockNdx = 0; blockNdx < refLayout.blocks.length; blockNdx++) {
+ /** @type {glsUniformBlockCase.BlockLayoutEntry} */ var blockIter = refLayout.blocks[blockNdx];
+ totalSize += blockIter.size;
+ }
+ blockPointers.resize(totalSize);
+
+ // Pointers for each block.
+ var curOffset = 0;
+ for (var blockNdx = 0; blockNdx < refLayout.blocks.length; blockNdx++) {
+ var size = refLayout.blocks[blockNdx].size;
+ blockPointers.push(curOffset, size);
+ curOffset += size;
+ }
+
+ // Generate values.
+ glsUniformBlockCase.generateValues(refLayout, blockPointers, 1 /* seed */);
+
+ // Generate shaders and build program.
+ /** @type {string} */ var vtxSrc = glsUniformBlockCase.generateVertexShader(this.m_interface, refLayout, blockPointers);
+ /** @type {string} */ var fragSrc = glsUniformBlockCase.generateFragmentShader(this.m_interface, refLayout, blockPointers);
+
+ /** @type {gluShaderProgram.ShaderProgram}*/ var program = new gluShaderProgram.ShaderProgram(gl, gluShaderProgram.makeVtxFragSources(vtxSrc, fragSrc));
+ bufferedLogToConsole(program.getProgramInfo().infoLog);
+
+ if (!program.isOk()) {
+ // Compile failed.
+ testFailedOptions('Compile failed', false);
+ return tcuTestCase.IterateResult.STOP;
+ }
+
+ // Query layout from GL.
+ /** @type {glsUniformBlockCase.UniformLayout} */ var glLayout = new glsUniformBlockCase.UniformLayout();
+ glsUniformBlockCase.getGLUniformLayout(gl, glLayout, program.getProgram());
+
+ // Print layout to log.
+ bufferedLogToConsole('Active glsUniformBlockCase.Uniform Blocks');
+ for (var blockNdx = 0; blockNdx < glLayout.blocks.length; blockNdx++)
+ bufferedLogToConsole(blockNdx + ': ' + glLayout.blocks[blockNdx]);
+
+ bufferedLogToConsole('Active Uniforms');
+ for (var uniformNdx = 0; uniformNdx < glLayout.uniforms.length; uniformNdx++)
+ bufferedLogToConsole(uniformNdx + ': ' + glLayout.uniforms[uniformNdx]);
+
+ // Check that we can even try rendering with given layout.
+ if (!this.checkLayoutIndices(glLayout) || !this.checkLayoutBounds(glLayout) || !this.compareTypes(refLayout, glLayout)) {
+ testFailedOptions('Invalid layout', false);
+ return tcuTestCase.IterateResult.STOP; // It is not safe to use the given layout.
+ }
+
+ // Verify all std140 blocks.
+ if (!this.compareStd140Blocks(refLayout, glLayout))
+ testFailedOptions('Invalid std140 layout', false);
+
+ // Verify all shared blocks - all uniforms should be active, and certain properties match.
+ if (!this.compareSharedBlocks(refLayout, glLayout))
+ testFailedOptions('Invalid shared layout', false);
+
+ // Check consistency with index queries
+ if (!this.checkIndexQueries(program.getProgram(), glLayout))
+ testFailedOptions('Inconsintent block index query results', false);
+
+ // Use program.
+ gl.useProgram(program.getProgram());
+
+ /** @type {number} */ var binding;
+ /** @type {WebGLBuffer} */ var buffer;
+
+ // Assign binding points to all active uniform blocks.
+ for (var blockNdx = 0; blockNdx < glLayout.blocks.length; blockNdx++) {
+ binding = blockNdx; // \todo [2012-01-25 pyry] Randomize order?
+ gl.uniformBlockBinding(program.getProgram(), blockNdx, binding);
+ }
+
+ /** @type {number} */ var numBlocks;
+ /** @type {glsUniformBlockCase.BlockPointers} */ var glBlockPointers;
+
+ // Allocate buffers, write data and bind to targets.
+ /** @type {glsUniformBlockCase.UniformBufferManager} */ var bufferManager = new glsUniformBlockCase.UniformBufferManager(gl);
+ if (this.m_bufferMode == glsUniformBlockCase.BufferMode.BUFFERMODE_PER_BLOCK) {
+ numBlocks = glLayout.blocks.length;
+ glBlockPointers = new glsUniformBlockCase.BlockPointers();
+
+ var totalsize = 0;
+ for (var blockNdx = 0; blockNdx < numBlocks; blockNdx++)
+ totalsize += glLayout.blocks[blockNdx].size;
+
+ glBlockPointers.resize(totalsize);
+
+ var offset = 0;
+ for (var blockNdx = 0; blockNdx < numBlocks; blockNdx++) {
+ glBlockPointers.push(offset, glLayout.blocks[blockNdx].size);
+ offset += glLayout.blocks[blockNdx].size;
+ }
+
+ glsUniformBlockCase.copyUniformData(glLayout, glBlockPointers, refLayout, blockPointers);
+
+ for (var blockNdx = 0; blockNdx < numBlocks; blockNdx++) {
+ buffer = bufferManager.allocBuffer();
+ binding = blockNdx;
+ gl.bindBuffer(gl.UNIFORM_BUFFER, buffer);
+ gl.bufferData(gl.UNIFORM_BUFFER, glBlockPointers.find(blockNdx) /*(glw::GLsizeiptr)glData[blockNdx].size(), &glData[blockNdx][0]*/, gl.STATIC_DRAW);
+ gl.bindBufferBase(gl.UNIFORM_BUFFER, binding, buffer);
+ }
+ } else {
+ DE_ASSERT(this.m_bufferMode == glsUniformBlockCase.BufferMode.BUFFERMODE_SINGLE);
+
+ totalSize = 0;
+ curOffset = 0;
+ numBlocks = glLayout.blocks.length;
+ /** @type {number} */ var bindingAlignment = 0;
+ glBlockPointers = new glsUniformBlockCase.BlockPointers();
+
+ bindingAlignment = /** @type {number} */ (gl.getParameter(gl.UNIFORM_BUFFER_OFFSET_ALIGNMENT));
+
+ // Compute total size and offsets.
+ curOffset = 0;
+ for (var blockNdx = 0; blockNdx < numBlocks; blockNdx++) {
+ if (bindingAlignment > 0)
+ curOffset = glsUniformBlockCase.deRoundUp32(curOffset, bindingAlignment);
+ glBlockPointers.push(curOffset, glLayout.blocks[blockNdx].size);
+ curOffset += glLayout.blocks[blockNdx].size;
+ }
+ totalSize = curOffset;
+ glBlockPointers.resize(totalSize);
+
+ // Copy to gl format.
+ glsUniformBlockCase.copyUniformData(glLayout, glBlockPointers, refLayout, blockPointers);
+
+ // Allocate buffer and upload data.
+ buffer = bufferManager.allocBuffer();
+ gl.bindBuffer(gl.UNIFORM_BUFFER, buffer);
+ if (glBlockPointers.data.byteLength > 0 /*!glData.empty()*/)
+ gl.bufferData(gl.UNIFORM_BUFFER, glBlockPointers.find(blockNdx) /*(glw::GLsizeiptr)glData.size(), &glData[0]*/, gl.STATIC_DRAW);
+
+ // Bind ranges to binding points.
+ for (var blockNdx = 0; blockNdx < numBlocks; blockNdx++) {
+ binding = blockNdx;
+ gl.bindBufferRange(gl.UNIFORM_BUFFER, binding, buffer, glBlockPointers.offsets[blockNdx], glLayout.blocks[blockNdx].size);
+ }
+ }
+
+ /** @type {boolean} */ var renderOk = this.render(program);
+ if (!renderOk)
+ testFailedOptions('Image compare failed', false);
+ else
+ assertMsgOptions(renderOk, '', true, false);
+
+ return tcuTestCase.IterateResult.STOP;
+};
+
+/**
+* compareStd140Blocks
+* @param {glsUniformBlockCase.UniformLayout} refLayout
+* @param {glsUniformBlockCase.UniformLayout} cmpLayout
+**/
+glsUniformBlockCase.UniformBlockCase.prototype.compareStd140Blocks = function(refLayout, cmpLayout) {
+ /**@type {boolean} */ var isOk = true;
+ /**@type {number} */ var numBlocks = this.m_interface.getNumUniformBlocks();
+
+ for (var blockNdx = 0; blockNdx < numBlocks; blockNdx++) {
+ /**@type {glsUniformBlockCase.UniformBlock} */ var block = this.m_interface.getUniformBlock(blockNdx);
+ /**@type {boolean} */ var isArray = block.isArray();
+ /**@type {string} */ var instanceName = block.getBlockName() + (isArray ? '[0]' : '');
+ /**@type {number} */ var refBlockNdx = refLayout.getBlockIndex(instanceName);
+ /**@type {number} */ var cmpBlockNdx = cmpLayout.getBlockIndex(instanceName);
+ /**@type {boolean} */ var isUsed = (block.getFlags() & (glsUniformBlockCase.UniformFlags.DECLARE_VERTEX | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT)) != 0;
+
+ if ((block.getFlags() & glsUniformBlockCase.UniformFlags.LAYOUT_STD140) == 0)
+ continue; // Not std140 layout.
+
+ DE_ASSERT(refBlockNdx >= 0);
+
+ if (cmpBlockNdx < 0) {
+ // Not found, should it?
+ if (isUsed) {
+ bufferedLogToConsole("Error: glsUniformBlockCase.Uniform block '" + instanceName + "' not found");
+ isOk = false;
+ }
+
+ continue; // Skip block.
+ }
+
+ /** @type {glsUniformBlockCase.BlockLayoutEntry} */ var refBlockLayout = refLayout.blocks[refBlockNdx];
+ /** @type {glsUniformBlockCase.BlockLayoutEntry} */ var cmpBlockLayout = cmpLayout.blocks[cmpBlockNdx];
+
+ // \todo [2012-01-24 pyry] Verify that activeUniformIndices is correct.
+ // \todo [2012-01-24 pyry] Verify all instances.
+ if (refBlockLayout.activeUniformIndices.length != cmpBlockLayout.activeUniformIndices.length) {
+ bufferedLogToConsole("Error: Number of active uniforms differ in block '" + instanceName +
+ "' (expected " + refBlockLayout.activeUniformIndices.length +
+ ', got ' + cmpBlockLayout.activeUniformIndices.length +
+ ')');
+ isOk = false;
+ }
+
+ for (var ndx = 0; ndx < refBlockLayout.activeUniformIndices.length; ndx++) {
+ /** @type {number} */ var ndxIter = refBlockLayout.activeUniformIndices[ndx];
+ /** @type {glsUniformBlockCase.UniformLayoutEntry} */ var refEntry = refLayout.uniforms[ndxIter];
+ /** @type {number} */ var cmpEntryNdx = cmpLayout.getUniformIndex(refEntry.name);
+
+ if (cmpEntryNdx < 0) {
+ bufferedLogToConsole("Error: glsUniformBlockCase.Uniform '" + refEntry.name + "' not found");
+ isOk = false;
+ continue;
+ }
+
+ /** @type {glsUniformBlockCase.UniformLayoutEntry} */ var cmpEntry = cmpLayout.uniforms[cmpEntryNdx];
+
+ if (refEntry.type != cmpEntry.type ||
+ refEntry.size != cmpEntry.size ||
+ refEntry.offset != cmpEntry.offset ||
+ refEntry.arrayStride != cmpEntry.arrayStride ||
+ refEntry.matrixStride != cmpEntry.matrixStride ||
+ refEntry.isRowMajor != cmpEntry.isRowMajor) {
+ bufferedLogToConsole("Error: Layout mismatch in '" + refEntry.name + "':\n" +
+ ' expected: type = ' + gluShaderUtil.getDataTypeName(refEntry.type) + ', size = ' + refEntry.size + ', row major = ' + (refEntry.isRowMajor ? 'true' : 'false') + '\n' +
+ ' got: type = ' + gluShaderUtil.getDataTypeName(cmpEntry.type) + ', size = ' + cmpEntry.size + ', row major = ' + (cmpEntry.isRowMajor ? 'true' : 'false'));
+ isOk = false;
+ }
+ }
+ }
+
+ return isOk;
+};
+
+/**
+* compareSharedBlocks
+* @param {glsUniformBlockCase.UniformLayout} refLayout
+* @param {glsUniformBlockCase.UniformLayout} cmpLayout
+**/
+glsUniformBlockCase.UniformBlockCase.prototype.compareSharedBlocks = function(refLayout, cmpLayout) {
+ /** @type {boolean} */ var isOk = true;
+ /** @type {number} */ var numBlocks = this.m_interface.getNumUniformBlocks();
+
+ for (var blockNdx = 0; blockNdx < numBlocks; blockNdx++) {
+ /** @type {glsUniformBlockCase.UniformBlock} */ var block = this.m_interface.getUniformBlock(blockNdx);
+ /** @type {boolean} */ var isArray = block.isArray();
+ /** @type {string} */ var instanceName = block.getBlockName() + (isArray ? '[0]' : '');
+ /** @type {number} */ var refBlockNdx = refLayout.getBlockIndex(instanceName);
+ /** @type {number} */ var cmpBlockNdx = cmpLayout.getBlockIndex(instanceName);
+ /** @type {boolean} */ var isUsed = (block.getFlags() & (glsUniformBlockCase.UniformFlags.DECLARE_VERTEX | glsUniformBlockCase.UniformFlags.DECLARE_FRAGMENT)) != 0;
+
+ if ((block.getFlags() & glsUniformBlockCase.UniformFlags.LAYOUT_SHARED) == 0)
+ continue; // Not shared layout.
+
+ DE_ASSERT(refBlockNdx >= 0);
+
+ if (cmpBlockNdx < 0) {
+ // Not found, should it?
+ if (isUsed) {
+ bufferedLogToConsole("Error: glsUniformBlockCase.Uniform block '" + instanceName + "' not found");
+ isOk = false;
+ }
+
+ continue; // Skip block.
+ }
+
+ /** @type {glsUniformBlockCase.BlockLayoutEntry} */ var refBlockLayout = refLayout.blocks[refBlockNdx];
+ /** @type {glsUniformBlockCase.BlockLayoutEntry} */ var cmpBlockLayout = cmpLayout.blocks[cmpBlockNdx];
+
+ if (refBlockLayout.activeUniformIndices.length != cmpBlockLayout.activeUniformIndices.length) {
+ bufferedLogToConsole("Error: Number of active uniforms differ in block '" + instanceName +
+ "' (expected " + refBlockLayout.activeUniformIndices.length +
+ ', got ' + cmpBlockLayout.activeUniformIndices.length +
+ ')');
+ isOk = false;
+ }
+
+ for (var ndx = 0; ndx < refBlockLayout.activeUniformIndices.length; ndx++) {
+ /** @type {number} */ var ndxIter = refBlockLayout.activeUniformIndices[ndx];
+ /** @type {glsUniformBlockCase.UniformLayoutEntry} */ var refEntry = refLayout.uniforms[ndxIter];
+ /** @type {number} */ var cmpEntryNdx = cmpLayout.getUniformIndex(refEntry.name);
+
+ if (cmpEntryNdx < 0) {
+ bufferedLogToConsole("Error: glsUniformBlockCase.Uniform '" + refEntry.name + "' not found");
+ isOk = false;
+ continue;
+ }
+
+ /** @type {glsUniformBlockCase.UniformLayoutEntry} */ var cmpEntry = cmpLayout.uniforms[cmpEntryNdx];
+
+ if (refEntry.type != cmpEntry.type ||
+ refEntry.size != cmpEntry.size ||
+ refEntry.isRowMajor != cmpEntry.isRowMajor) {
+ bufferedLogToConsole("Error: Layout mismatch in '" + refEntry.name + "':\n" +
+ ' expected: type = ' + gluShaderUtil.getDataTypeName(refEntry.type) + ', size = ' + refEntry.size + ', row major = ' + (refEntry.isRowMajor ? 'true' : 'false') + '\n' +
+ ' got: type = ' + gluShaderUtil.getDataTypeName(cmpEntry.type) + ', size = ' + cmpEntry.size + ', row major = ' + (cmpEntry.isRowMajor ? 'true' : 'false'));
+ isOk = false;
+ }
+ }
+ }
+
+ return isOk;
+};
+
+/** compareTypes
+* @param {glsUniformBlockCase.UniformLayout} refLayout
+* @param {glsUniformBlockCase.UniformLayout} cmpLayout
+* @return {boolean} true if uniform types are the same
+**/
+glsUniformBlockCase.UniformBlockCase.prototype.compareTypes = function(refLayout, cmpLayout) {
+ /** @type {boolean} */ var isOk = true;
+ /** @type {number} */ var numBlocks = this.m_interface.getNumUniformBlocks();
+
+ for (var blockNdx = 0; blockNdx < numBlocks; blockNdx++) {
+ /** @type {glsUniformBlockCase.UniformBlock} */ var block = this.m_interface.getUniformBlock(blockNdx);
+ /** @type {boolean} */ var isArray = block.isArray();
+ /** @type {number} */ var numInstances = isArray ? block.getArraySize() : 1;
+
+ for (var instanceNdx = 0; instanceNdx < numInstances; instanceNdx++) {
+ /** @type {string} */ var instanceName;
+
+ instanceName += block.getBlockName();
+ if (isArray)
+ instanceName = instanceName + '[' + instanceNdx + ']';
+
+ /** @type {number} */ var cmpBlockNdx = cmpLayout.getBlockIndex(instanceName);
+
+ if (cmpBlockNdx < 0)
+ continue;
+
+ /** @type {glsUniformBlockCase.BlockLayoutEntry} */ var cmpBlockLayout = cmpLayout.blocks[cmpBlockNdx];
+
+ for (var ndx = 0; ndx < cmpBlockLayout.activeUniformIndices.length; ndx++) {
+ /** @type {number} */ var ndxIter = cmpBlockLayout.activeUniformIndices[ndx];
+ /** @type {glsUniformBlockCase.UniformLayoutEntry} */ var cmpEntry = cmpLayout.uniforms[ndxIter];
+ /** @type {number} */ var refEntryNdx = refLayout.getUniformIndex(cmpEntry.name);
+
+ if (refEntryNdx < 0) {
+ bufferedLogToConsole("Error: glsUniformBlockCase.Uniform '" + cmpEntry.name + "' not found in reference layout");
+ isOk = false;
+ continue;
+ }
+
+ /** @type {glsUniformBlockCase.UniformLayoutEntry} */ var refEntry = refLayout.uniforms[refEntryNdx];
+
+ // \todo [2012-11-26 pyry] Should we check other properties as well?
+ if (refEntry.type != cmpEntry.type) {
+ bufferedLogToConsole("Error: glsUniformBlockCase.Uniform type mismatch in '" + refEntry.name + "':</br>" +
+ "' expected: '" + gluShaderUtil.getDataTypeName(refEntry.type) + "'</br>" +
+ "' got: '" + gluShaderUtil.getDataTypeName(cmpEntry.type) + "'");
+ isOk = false;
+ }
+ }
+ }
+ }
+
+ return isOk;
+};
+
+/** checkLayoutIndices
+* @param {glsUniformBlockCase.UniformLayout} layout Layout whose indices are to be checked
+* @return {boolean} true if all is ok
+**/
+glsUniformBlockCase.UniformBlockCase.prototype.checkLayoutIndices = function(layout) {
+ /** @type {number} */ var numUniforms = layout.uniforms.length;
+ /** @type {number} */ var numBlocks = layout.blocks.length;
+ /** @type {boolean} */ var isOk = true;
+
+ // Check uniform block indices.
+ for (var uniformNdx = 0; uniformNdx < numUniforms; uniformNdx++) {
+ /** @type {glsUniformBlockCase.UniformLayoutEntry} */ var uniform = layout.uniforms[uniformNdx];
+
+ if (uniform.blockNdx < 0 || !deMath.deInBounds32(uniform.blockNdx, 0, numBlocks)) {
+ bufferedLogToConsole("Error: Invalid block index in uniform '" + uniform.name + "'");
+ isOk = false;
+ }
+ }
+
+ // Check active uniforms.
+ for (var blockNdx = 0; blockNdx < numBlocks; blockNdx++) {
+ /** @type {glsUniformBlockCase.BlockLayoutEntry} */ var block = layout.blocks[blockNdx];
+
+ for (var uniformNdx = 0; uniformNdx < block.activeUniformIndices.length; uniformNdx++) {
+ /** @type {glsUniformBlockCase.UniformLayoutEntry} */ var activeUniformNdx = block.activeUniformIndices[uniformNdx];
+ if (!deMath.deInBounds32(activeUniformNdx, 0, numUniforms)) {
+ bufferedLogToConsole('Error: Invalid active uniform index ' + activeUniformNdx + " in block '" + block.name);
+ isOk = false;
+ }
+ }
+ }
+ return isOk;
+};
+
+/** checkLayoutBounds
+* @param {glsUniformBlockCase.UniformLayout} layout The uniform layout to check
+* @return {boolean} true if all is within bounds
+**/
+glsUniformBlockCase.UniformBlockCase.prototype.checkLayoutBounds = function(layout) {
+ /** @type {number} */ var numUniforms = layout.uniforms.length;
+ /** @type {boolean}*/ var isOk = true;
+
+ for (var uniformNdx = 0; uniformNdx < numUniforms; uniformNdx++) {
+ /** @type {glsUniformBlockCase.UniformLayoutEntry}*/ var uniform = layout.uniforms[uniformNdx];
+
+ if (uniform.blockNdx < 0)
+ continue;
+
+ /** @type {glsUniformBlockCase.BlockLayoutEntry}*/ var block = layout.blocks[uniform.blockNdx];
+ /** @type {boolean}*/ var isMatrix = gluShaderUtil.isDataTypeMatrix(uniform.type);
+ /** @type {number}*/ var numVecs = isMatrix ? (uniform.isRowMajor ? gluShaderUtil.getDataTypeMatrixNumRows(uniform.type) : gluShaderUtil.getDataTypeMatrixNumColumns(uniform.type)) : 1;
+ /** @type {number}*/ var numComps = isMatrix ? (uniform.isRowMajor ? gluShaderUtil.getDataTypeMatrixNumColumns(uniform.type) : gluShaderUtil.getDataTypeMatrixNumRows(uniform.type)) : gluShaderUtil.getDataTypeScalarSize(uniform.type);
+ /** @type {number}*/ var numElements = uniform.size;
+ /** @type {number}*/ var compSize = deMath.INT32_SIZE;
+ /** @type {number}*/ var vecSize = numComps * compSize;
+
+ /** @type {number}*/ var minOffset = 0;
+ /** @type {number}*/ var maxOffset = 0;
+
+ // For negative strides.
+ minOffset = Math.min(minOffset, (numVecs - 1) * uniform.matrixStride);
+ minOffset = Math.min(minOffset, (numElements - 1) * uniform.arrayStride);
+ minOffset = Math.min(minOffset, (numElements - 1) * uniform.arrayStride + (numVecs - 1) * uniform.matrixStride);
+
+ maxOffset = Math.max(maxOffset, vecSize);
+ maxOffset = Math.max(maxOffset, (numVecs - 1) * uniform.matrixStride + vecSize);
+ maxOffset = Math.max(maxOffset, (numElements - 1) * uniform.arrayStride + vecSize);
+ maxOffset = Math.max(maxOffset, (numElements - 1) * uniform.arrayStride + (numVecs - 1) * uniform.matrixStride + vecSize);
+
+ if (uniform.offset + minOffset < 0 || uniform.offset + maxOffset > block.size) {
+ bufferedLogToConsole("Error: glsUniformBlockCase.Uniform '" + uniform.name + "' out of block bounds");
+ isOk = false;
+ }
+ }
+
+ return isOk;
+};
+
+/** checkIndexQueries
+* @param {WebGLProgram} program The shader program to be checked against
+* @param {glsUniformBlockCase.UniformLayout} layout The layout to check
+* @return {boolean} true if everything matches.
+**/
+glsUniformBlockCase.UniformBlockCase.prototype.checkIndexQueries = function(program, layout) {
+ /** @type {boolean}*/ var allOk = true;
+
+ // \note Spec mandates that uniform blocks are assigned consecutive locations from 0
+ // to ACTIVE_UNIFORM_BLOCKS. BlockLayoutEntries are stored in that order in glsUniformBlockCase.UniformLayout.
+ for (var blockNdx = 0; blockNdx < layout.blocks.length; blockNdx++) {
+ /** @const */ var block = layout.blocks[blockNdx];
+ /** @const */ var queriedNdx = gl.getUniformBlockIndex(program, block.name);
+
+ if (queriedNdx != blockNdx) {
+ bufferedLogToConsole('ERROR: glGetUniformBlockIndex(' + block.name + ') returned ' + queriedNdx + ', expected ' + blockNdx + '!');
+ allOk = false;
+ }
+ }
+
+ return allOk;
+};
+
+/** @const @type {number} */ glsUniformBlockCase.VIEWPORT_WIDTH = 128;
+/** @const @type {number} */ glsUniformBlockCase.VIEWPORT_HEIGHT = 128;
+
+/** Renders a white square, and then tests all pixels are
+* effectively white in the color buffer.
+* @param {gluShaderProgram.ShaderProgram} program The shader program to use.
+* @return {boolean} false if there was at least one incorrect pixel
+**/
+glsUniformBlockCase.UniformBlockCase.prototype.render = function(program) {
+ // Compute viewport.
+ /** @type {deRandom.Random} */ var rnd = new deRandom.Random(deString.deStringHash(this.name));
+ /** @const */ var viewportW = Math.min(gl.canvas.width, glsUniformBlockCase.VIEWPORT_WIDTH);
+ /** @const */ var viewportH = Math.min(gl.canvas.height, glsUniformBlockCase.VIEWPORT_HEIGHT);
+ /** @const */ var viewportX = rnd.getInt(0, gl.canvas.width);
+ /** @const */ var viewportY = rnd.getInt(0, gl.canvas.height);
+
+ gl.clearColor(0.125, 0.25, 0.5, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+
+ //Draw
+ var position = [
+ -1.0, -1.0, 0.0, 1.0,
+ -1.0, 1.0, 0.0, 1.0,
+ 1.0, -1.0, 0.0, 1.0,
+ 1.0, 1.0, 0.0, 1.0
+ ];
+ var indices = [0, 1, 2, 2, 1, 3];
+
+ gl.viewport(viewportX, viewportY, viewportW, viewportH);
+
+ // Access
+ var posLoc = gl.getAttribLocation(program.getProgram(), 'a_position');
+ var posArray = [new gluDrawUtil.VertexArrayBinding(gl.FLOAT, posLoc, 4, 4, position)];
+ gluDrawUtil.draw(gl, program.getProgram(), posArray, gluDrawUtil.triangles(indices));
+
+ // Verify that all pixels are white.
+ var pixels = new gluDrawUtil.Surface();
+ var numFailedPixels = 0;
+
+ var readPixelsX = (viewportX + viewportW) > gl.canvas.width
+ ? (gl.canvas.width - viewportX) : viewportW;
+ var readPixelsY = (viewportY + viewportH) > gl.canvas.height
+ ? (gl.canvas.height - viewportY) : viewportH;
+
+ var buffer = pixels.readSurface(gl, viewportX, viewportY, readPixelsX, readPixelsY);
+
+ var whitePixel = new gluDrawUtil.Pixel([255.0, 255.0, 255.0, 255.0]);
+ for (var y = 0; y < readPixelsY; y++) {
+ for (var x = 0; x < readPixelsX; x++) {
+ if (!pixels.getPixel(x, y).equals(whitePixel))
+ numFailedPixels += 1;
+ }
+ }
+
+ if (numFailedPixels > 0) {
+ bufferedLogToConsole('Image comparison failed, got ' + numFailedPixels + ' non-white pixels.');
+ }
+
+ return numFailedPixels == 0;
+};
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsVertexArrayTests.js b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsVertexArrayTests.js
new file mode 100644
index 0000000000..99dc79f35e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/modules/shared/glsVertexArrayTests.js
@@ -0,0 +1,2534 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES Utilities
+ * ------------------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+'use strict';
+goog.provide('modules.shared.glsVertexArrayTests');
+goog.require('framework.common.tcuFloat');
+goog.require('framework.common.tcuImageCompare');
+goog.require('framework.common.tcuLogImage');
+goog.require('framework.common.tcuPixelFormat');
+goog.require('framework.common.tcuRGBA');
+goog.require('framework.common.tcuSurface');
+goog.require('framework.common.tcuTestCase');
+goog.require('framework.delibs.debase.deMath');
+goog.require('framework.delibs.debase.deRandom');
+goog.require('framework.opengl.gluShaderUtil');
+goog.require('framework.opengl.simplereference.sglrGLContext');
+goog.require('framework.opengl.simplereference.sglrReferenceContext');
+goog.require('framework.opengl.simplereference.sglrShaderProgram');
+goog.require('framework.referencerenderer.rrFragmentOperations');
+goog.require('framework.referencerenderer.rrGenericVector');
+goog.require('framework.referencerenderer.rrShadingContext');
+goog.require('framework.referencerenderer.rrVertexAttrib');
+goog.require('framework.referencerenderer.rrVertexPacket');
+
+goog.scope(function() {
+
+ var glsVertexArrayTests = modules.shared.glsVertexArrayTests;
+ var tcuTestCase = framework.common.tcuTestCase;
+ var tcuRGBA = framework.common.tcuRGBA;
+ var tcuFloat = framework.common.tcuFloat;
+ var tcuPixelFormat = framework.common.tcuPixelFormat;
+ var tcuSurface = framework.common.tcuSurface;
+ var tcuImageCompare = framework.common.tcuImageCompare;
+ var tcuLogImage = framework.common.tcuLogImage;
+ var gluShaderUtil = framework.opengl.gluShaderUtil;
+ var sglrGLContext = framework.opengl.simplereference.sglrGLContext;
+ var sglrReferenceContext = framework.opengl.simplereference.sglrReferenceContext;
+ var sglrShaderProgram = framework.opengl.simplereference.sglrShaderProgram;
+ var deMath = framework.delibs.debase.deMath;
+ var deRandom = framework.delibs.debase.deRandom;
+ var rrFragmentOperations = framework.referencerenderer.rrFragmentOperations;
+ var rrGenericVector = framework.referencerenderer.rrGenericVector;
+ var rrShadingContext = framework.referencerenderer.rrShadingContext;
+ var rrVertexAttrib = framework.referencerenderer.rrVertexAttrib;
+ var rrVertexPacket = framework.referencerenderer.rrVertexPacket;
+
+ var DE_ASSERT = function(x) {
+ if (!x)
+ throw new Error('Assert failed');
+ };
+
+ /**
+ * @interface
+ */
+ glsVertexArrayTests.deArray = function() {};
+
+ /**
+ * glsVertexArrayTests.deArray.Target enum
+ * @enum
+ */
+ glsVertexArrayTests.deArray.Target = {
+ ELEMENT_ARRAY: 0,
+ ARRAY: 1
+ };
+
+ /**
+ * glsVertexArrayTests.deArray.InputType enum
+ * @enum
+ */
+ glsVertexArrayTests.deArray.InputType = {
+ FLOAT: 0,
+ /*FIXED: 1,
+ DOUBLE: 2,*/
+
+ BYTE: 1,
+ SHORT: 2,
+
+ UNSIGNED_BYTE: 3,
+ UNSIGNED_SHORT: 4,
+
+ INT: 5,
+ UNSIGNED_INT: 6,
+ HALF: 7,
+ UNSIGNED_INT_2_10_10_10: 8,
+ INT_2_10_10_10: 9
+ };
+
+ /**
+ * glsVertexArrayTests.deArray.OutputType enum
+ * @enum
+ */
+ glsVertexArrayTests.deArray.OutputType = {
+ FLOAT: 0,
+ VEC2: 1,
+ VEC3: 2,
+ VEC4: 3,
+
+ INT: 4,
+ UINT: 5,
+
+ IVEC2: 6,
+ IVEC3: 7,
+ IVEC4: 8,
+
+ UVEC2: 9,
+ UVEC3: 10,
+ UVEC4: 11
+ };
+
+ /**
+ * glsVertexArrayTests.deArray.Usage enum
+ * @enum
+ */
+ glsVertexArrayTests.deArray.Usage = {
+ DYNAMIC_DRAW: 0,
+ STATIC_DRAW: 1,
+ STREAM_DRAW: 2,
+
+ STREAM_READ: 3,
+ STREAM_COPY: 4,
+
+ STATIC_READ: 5,
+ STATIC_COPY: 6,
+
+ DYNAMIC_READ: 7,
+ DYNAMIC_COPY: 8
+ };
+
+ /**
+ * glsVertexArrayTests.deArray.Storage enum
+ * @enum
+ */
+ glsVertexArrayTests.deArray.Storage = {
+ USER: 0,
+ BUFFER: 1
+ };
+
+ /**
+ * glsVertexArrayTests.deArray.Primitive enum
+ * @enum
+ */
+ glsVertexArrayTests.deArray.Primitive = {
+ POINTS: 0,
+ TRIANGLES: 1,
+ TRIANGLE_FAN: 2,
+ TRIANGLE_STRIP: 3
+ };
+
+ //glsVertexArrayTests.deArray static functions
+
+ /**
+ * @param {glsVertexArrayTests.deArray.Target} target
+ * @return {string}
+ */
+ glsVertexArrayTests.deArray.targetToString = function(target) {
+ DE_ASSERT(target < Object.keys(glsVertexArrayTests.deArray.Target).length);
+
+ /** @type {Array<string>} */ var targets =
+ [
+ 'element_array', // glsVertexArrayTests.deArray.Target.ELEMENT_ARRAY
+ 'array' // glsVertexArrayTests.deArray.Target.ARRAY
+ ];
+ DE_ASSERT(targets.length == Object.keys(glsVertexArrayTests.deArray.Target).length);
+
+ return targets[target];
+ };
+
+ /**
+ * @param {glsVertexArrayTests.deArray.InputType} type
+ * @return {string}
+ */
+ glsVertexArrayTests.deArray.inputTypeToString = function(type) {
+ DE_ASSERT(type < Object.keys(glsVertexArrayTests.deArray.InputType).length);
+
+ /** @type {Array<string>} */ var types =
+ [
+ 'float', // glsVertexArrayTests.deArray.InputType.FLOAT
+
+ 'byte', // glsVertexArrayTests.deArray.InputType.BYTE
+ 'short', // glsVertexArrayTests.deArray.InputType.SHORT
+
+ 'unsigned_byte', // glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE
+ 'unsigned_short', // glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT
+
+ 'int', // glsVertexArrayTests.deArray.InputType.INT
+ 'unsigned_int', // glsVertexArrayTests.deArray.InputType.UNSIGNED_INT
+ 'half', // glsVertexArrayTests.deArray.InputType.HALF
+ 'unsigned_int2_10_10_10', // glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10
+ 'int2_10_10_10' // glsVertexArrayTests.deArray.InputType.INT_2_10_10_10
+ ];
+ DE_ASSERT(types.length == Object.keys(glsVertexArrayTests.deArray.InputType).length);
+
+ return types[type];
+ };
+
+ /**
+ * @param {glsVertexArrayTests.deArray.OutputType} type
+ * @return {string}
+ */
+ glsVertexArrayTests.deArray.outputTypeToString = function(type) {
+ DE_ASSERT(type < Object.keys(glsVertexArrayTests.deArray.OutputType).length);
+
+ /** @type {Array<string>} */ var types =
+ [
+ 'float', // glsVertexArrayTests.deArray.OutputType.FLOAT
+ 'vec2', // glsVertexArrayTests.deArray.OutputType.VEC2
+ 'vec3', // glsVertexArrayTests.deArray.OutputType.VEC3
+ 'vec4', // glsVertexArrayTests.deArray.OutputType.VEC4
+
+ 'int', // glsVertexArrayTests.deArray.OutputType.INT
+ 'uint', // glsVertexArrayTests.deArray.OutputType.UINT
+
+ 'ivec2', // glsVertexArrayTests.deArray.OutputType.IVEC2
+ 'ivec3', // glsVertexArrayTests.deArray.OutputType.IVEC3
+ 'ivec4', // glsVertexArrayTests.deArray.OutputType.IVEC4
+
+ 'uvec2', // glsVertexArrayTests.deArray.OutputType.UVEC2
+ 'uvec3', // glsVertexArrayTests.deArray.OutputType.UVEC3
+ 'uvec4' // glsVertexArrayTests.deArray.OutputType.UVEC4
+ ];
+ DE_ASSERT(types.length == Object.keys(glsVertexArrayTests.deArray.OutputType).length);
+
+ return types[type];
+ };
+
+ /**
+ * @param {glsVertexArrayTests.deArray.Usage} usage
+ * @return {string}
+ */
+ glsVertexArrayTests.deArray.usageTypeToString = function(usage) {
+ DE_ASSERT(usage < Object.keys(glsVertexArrayTests.deArray.Usage).length);
+
+ /** @type {Array<string>} */ var usages =
+ [
+ 'dynamic_draw', // glsVertexArrayTests.deArray.Usage.DYNAMIC_DRAW
+ 'static_draw', // glsVertexArrayTests.deArray.Usage.STATIC_DRAW
+ 'stream_draw', // glsVertexArrayTests.deArray.Usage.STREAM_DRAW
+
+ 'stream_read', // glsVertexArrayTests.deArray.Usage.STREAM_READ
+ 'stream_copy', // glsVertexArrayTests.deArray.Usage.STREAM_COPY
+
+ 'static_read', // glsVertexArrayTests.deArray.Usage.STATIC_READ
+ 'static_copy', // glsVertexArrayTests.deArray.Usage.STATIC_COPY
+
+ 'dynamic_read', // glsVertexArrayTests.deArray.Usage.DYNAMIC_READ
+ 'dynamic_copy' // glsVertexArrayTests.deArray.Usage.DYNAMIC_COPY
+ ];
+ DE_ASSERT(usages.length == Object.keys(glsVertexArrayTests.deArray.Usage).length);
+
+ return usages[usage];
+ };
+
+ /**
+ * @param {glsVertexArrayTests.deArray.Storage} storage
+ * @return {string}
+ */
+ glsVertexArrayTests.deArray.storageToString = function(storage) {
+ DE_ASSERT(storage < Object.keys(glsVertexArrayTests.deArray.Storage).length);
+
+ /** @type {Array<string>} */ var storages =
+ [
+ 'user_ptr', // glsVertexArrayTests.deArray.Storage.USER
+ 'buffer' // glsVertexArrayTests.deArray.Storage.BUFFER
+ ];
+ DE_ASSERT(storages.length == Object.keys(glsVertexArrayTests.deArray.Storage).length);
+
+ return storages[storage];
+ };
+
+ /**
+ * @param {glsVertexArrayTests.deArray.Primitive} primitive
+ * @return {string}
+ */
+ glsVertexArrayTests.deArray.primitiveToString = function(primitive) {
+ DE_ASSERT(primitive < Object.keys(glsVertexArrayTests.deArray.Primitive).length);
+
+ /** @type {Array<string>} */ var primitives =
+ [
+ 'points', // glsVertexArrayTests.deArray.Primitive.POINTS
+ 'triangles', // glsVertexArrayTests.deArray.Primitive.TRIANGLES
+ 'triangle_fan', // glsVertexArrayTests.deArray.Primitive.TRIANGLE_FAN
+ 'triangle_strip' // glsVertexArrayTests.deArray.Primitive.TRIANGLE_STRIP
+ ];
+ DE_ASSERT(primitives.length == Object.keys(glsVertexArrayTests.deArray.Primitive).length);
+
+ return primitives[primitive];
+ };
+
+ /**
+ * @param {glsVertexArrayTests.deArray.InputType} type
+ * @return {number}
+ */
+ glsVertexArrayTests.deArray.inputTypeSize = function(type) {
+ DE_ASSERT(type < Object.keys(glsVertexArrayTests.deArray.InputType).length);
+
+ /** @type {Array<number>} */ var size = [
+ 4, // glsVertexArrayTests.deArray.InputType.FLOAT
+
+ 1, // glsVertexArrayTests.deArray.InputType.BYTE
+ 2, // glsVertexArrayTests.deArray.InputType.SHORT
+
+ 1, // glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE
+ 2, // glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT
+
+ 4, // glsVertexArrayTests.deArray.InputType.INT
+ 4, // glsVertexArrayTests.deArray.InputType.UNSIGNED_INT
+ 2, // glsVertexArrayTests.deArray.InputType.HALF
+ 4 / 4, // glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10
+ 4 / 4 // glsVertexArrayTests.deArray.InputType.INT_2_10_10_10
+ ];
+ DE_ASSERT(size.length == Object.keys(glsVertexArrayTests.deArray.InputType).length);
+
+ return size[type];
+ };
+
+ /**
+ * @param {glsVertexArrayTests.deArray.InputType} type
+ * @return {boolean}
+ */
+ glsVertexArrayTests.inputTypeIsFloatType = function(type) {
+ if (type == glsVertexArrayTests.deArray.InputType.FLOAT)
+ return true;
+ /*if (type == glsVertexArrayTests.deArray.InputType.FIXED)
+ return true;
+ if (type == glsVertexArrayTests.deArray.InputType.DOUBLE)
+ return true;*/
+ if (type == glsVertexArrayTests.deArray.InputType.HALF)
+ return true;
+ return false;
+ };
+
+ /**
+ * @param {glsVertexArrayTests.deArray.OutputType} type
+ * @return {boolean}
+ */
+ glsVertexArrayTests.outputTypeIsFloatType = function(type) {
+ if (type == glsVertexArrayTests.deArray.OutputType.FLOAT ||
+ type == glsVertexArrayTests.deArray.OutputType.VEC2 ||
+ type == glsVertexArrayTests.deArray.OutputType.VEC3 ||
+ type == glsVertexArrayTests.deArray.OutputType.VEC4)
+ return true;
+
+ return false;
+ };
+
+ //glsVertexArrayTests.deArray member functions (all virtual, since this is an interface)
+
+ /**
+ * @param {glsVertexArrayTests.deArray.Target} target
+ * @param {number} size
+ * @param {Uint8Array} data
+ * @param {glsVertexArrayTests.deArray.Usage} usage
+ */
+ glsVertexArrayTests.deArray.prototype.data = function(target, size, data, usage) {};
+
+ /**
+ * @param {glsVertexArrayTests.deArray.Target} target
+ * @param {number} offset
+ * @param {number} size
+ * @param {Uint8Array} data
+ */
+ glsVertexArrayTests.deArray.prototype.subdata = function(target, offset, size, data) {};
+
+ /**
+ * @param {number} attribNdx
+ * @param {number} offset
+ * @param {number} size
+ * @param {glsVertexArrayTests.deArray.InputType} inType
+ * @param {glsVertexArrayTests.deArray.OutputType} outType
+ * @param {boolean} normalized
+ * @param {number} stride
+ */
+ glsVertexArrayTests.deArray.prototype.bind = function(attribNdx, offset, size, inType, outType, normalized, stride) {};
+
+ /**
+ * unBind
+ */
+ glsVertexArrayTests.deArray.prototype.unBind = function() {};
+
+ /**
+ * @return {boolean}
+ */
+ glsVertexArrayTests.deArray.prototype.isBound = function() {};
+
+ /**
+ * @return {number}
+ */
+ glsVertexArrayTests.deArray.prototype.getComponentCount = function() {};
+
+ /**
+ * @return {glsVertexArrayTests.deArray.Target}
+ */
+ glsVertexArrayTests.deArray.prototype.getTarget = function() {};
+
+ /**
+ * @return {glsVertexArrayTests.deArray.InputType}
+ */
+ glsVertexArrayTests.deArray.prototype.getInputType = function() {};
+
+ /**
+ * @return {glsVertexArrayTests.deArray.OutputType}
+ */
+ glsVertexArrayTests.deArray.prototype.getOutputType = function() {};
+
+ /**
+ * @return {glsVertexArrayTests.deArray.Storage}
+ */
+ glsVertexArrayTests.deArray.prototype.getStorageType = function() {};
+
+ /**
+ * @return {boolean}
+ */
+ glsVertexArrayTests.deArray.prototype.getNormalized = function() {};
+
+ /**
+ * @return {number}
+ */
+ glsVertexArrayTests.deArray.prototype.getStride = function() {};
+
+ /**
+ * @return {number}
+ */
+ glsVertexArrayTests.deArray.prototype.getAttribNdx = function() {};
+
+ /**
+ * @param {number} attribNdx
+ */
+ glsVertexArrayTests.deArray.prototype.setAttribNdx = function(attribNdx) {};
+
+ //glsVertexArrayTests.ContextArray class, implements glsVertexArrayTests.deArray interface
+
+ /**
+ * @constructor
+ * @implements {glsVertexArrayTests.deArray}
+ * @param {glsVertexArrayTests.deArray.Storage} storage
+ * @param {sglrGLContext.GLContext | sglrReferenceContext.ReferenceContext} context
+ */
+ glsVertexArrayTests.ContextArray = function(storage, context) {
+ /** @type {glsVertexArrayTests.deArray.Storage} */ this.m_storage = storage;
+ /** @type {sglrGLContext.GLContext | sglrReferenceContext.ReferenceContext} */ this.m_ctx = context;
+ /** @type {WebGLBuffer|sglrReferenceContext.DataBuffer|null} */ this.m_glBuffer = null;
+
+ /** @type {boolean} */ this.m_bound = false;
+ /** @type {number} */ this.m_attribNdx = 0;
+ /** @type {number} */ this.m_size = 0;
+ /** @type {Uint8Array} */ this.m_data = null;
+ /** @type {number} */ this.m_componentCount = 1;
+ /** @type {glsVertexArrayTests.deArray.Target} */ this.m_target = glsVertexArrayTests.deArray.Target.ARRAY;
+ /** @type {glsVertexArrayTests.deArray.InputType} */ this.m_inputType = glsVertexArrayTests.deArray.InputType.FLOAT;
+ /** @type {glsVertexArrayTests.deArray.OutputType} */ this.m_outputType = glsVertexArrayTests.deArray.OutputType.FLOAT;
+ /** @type {boolean} */ this.m_normalize = false;
+ /** @type {number} */ this.m_stride = 0;
+ /** @type {number} */ this.m_offset = 0;
+
+ if (this.m_storage == glsVertexArrayTests.deArray.Storage.BUFFER) {
+ this.m_glBuffer = this.m_ctx.createBuffer();
+ }
+ };
+
+ // glsVertexArrayTests.ContextArray member functions
+
+ /**
+ * unBind
+ */
+ glsVertexArrayTests.ContextArray.prototype.unBind = function() { this.m_bound = false; };
+
+ /**
+ * @return {boolean}
+ */
+ glsVertexArrayTests.ContextArray.prototype.isBound = function() { return this.m_bound; };
+
+ /**
+ * @return {number}
+ */
+ glsVertexArrayTests.ContextArray.prototype.getComponentCount = function() { return this.m_componentCount; };
+
+ /**
+ * @return {glsVertexArrayTests.deArray.Target}
+ */
+ glsVertexArrayTests.ContextArray.prototype.getTarget = function() { return this.m_target; };
+
+ /**
+ * @return {glsVertexArrayTests.deArray.InputType}
+ */
+ glsVertexArrayTests.ContextArray.prototype.getInputType = function() { return this.m_inputType; };
+
+ /**
+ * @return {glsVertexArrayTests.deArray.OutputType}
+ */
+ glsVertexArrayTests.ContextArray.prototype.getOutputType = function() { return this.m_outputType; };
+
+ /**
+ * @return {glsVertexArrayTests.deArray.Storage}
+ */
+ glsVertexArrayTests.ContextArray.prototype.getStorageType = function() { return this.m_storage; };
+
+ /**
+ * @return {boolean}
+ */
+ glsVertexArrayTests.ContextArray.prototype.getNormalized = function() { return this.m_normalize; };
+
+ /**
+ * @return {number}
+ */
+ glsVertexArrayTests.ContextArray.prototype.getStride = function() { return this.m_stride; };
+
+ /**
+ * @return {number}
+ */
+ glsVertexArrayTests.ContextArray.prototype.getAttribNdx = function() { return this.m_attribNdx; };
+
+ /**
+ * @param {number} attribNdx
+ */
+ glsVertexArrayTests.ContextArray.prototype.setAttribNdx = function(attribNdx) { this.m_attribNdx = attribNdx; };
+
+ /**
+ * @param {glsVertexArrayTests.deArray.Target} target
+ * @param {number} size
+ * @param {Uint8Array} ptr
+ * @param {glsVertexArrayTests.deArray.Usage} usage
+ */
+ glsVertexArrayTests.ContextArray.prototype.data = function(target, size, ptr, usage) {
+ this.m_size = size;
+ this.m_target = target;
+
+ if (this.m_storage == glsVertexArrayTests.deArray.Storage.BUFFER) {
+ this.m_ctx.bindBuffer(glsVertexArrayTests.ContextArray.targetToGL(target), this.m_glBuffer);
+
+ //No need for size param here, as opposed to GL ES.
+ this.m_ctx.bufferData(glsVertexArrayTests.ContextArray.targetToGL(target), ptr, glsVertexArrayTests.ContextArray.usageToGL(usage));
+ } else if (this.m_storage == glsVertexArrayTests.deArray.Storage.USER) {
+ this.m_data = new Uint8Array(size);
+ for (var i = 0; i < size; i++)
+ this.m_data[i] = ptr[i];
+ } else
+ throw new Error('glsVertexArrayTests.ContextArray.prototype.data - Invalid storage type specified');
+ };
+
+ /**
+ * @param {glsVertexArrayTests.deArray.Target} target
+ * @param {number} offset
+ * @param {number} size
+ * @param {Uint8Array} ptr
+ */
+ glsVertexArrayTests.ContextArray.prototype.subdata = function(target, offset, size, ptr) {
+ this.m_target = target;
+
+ if (this.m_storage == glsVertexArrayTests.deArray.Storage.BUFFER) {
+ this.m_ctx.bindBuffer(glsVertexArrayTests.ContextArray.targetToGL(target), this.m_glBuffer);
+
+ this.m_ctx.bufferSubData(glsVertexArrayTests.ContextArray.targetToGL(target), offset, ptr);
+ } else if (this.m_storage == glsVertexArrayTests.deArray.Storage.USER)
+ for (var i = offset; i < size; i++)
+ this.m_data[i] = ptr[i];
+ else
+ throw new Error('glsVertexArrayTests.ContextArray.prototype.subdata - Invalid storage type specified');
+ };
+
+ /**
+ * @param {number} attribNdx
+ * @param {number} offset
+ * @param {number} size
+ * @param {glsVertexArrayTests.deArray.InputType} inType
+ * @param {glsVertexArrayTests.deArray.OutputType} outType
+ * @param {boolean} normalized
+ * @param {number} stride
+ */
+ glsVertexArrayTests.ContextArray.prototype.bind = function(attribNdx, offset, size, inType, outType, normalized, stride) {
+ this.m_attribNdx = attribNdx;
+ this.m_bound = true;
+ this.m_componentCount = size;
+ this.m_inputType = inType;
+ this.m_outputType = outType;
+ this.m_normalize = normalized;
+ this.m_stride = stride;
+ this.m_offset = offset;
+ };
+
+ /**
+ * @param {glsVertexArrayTests.deArray.Target} target
+ */
+ glsVertexArrayTests.ContextArray.prototype.bindIndexArray = function(target) {
+ if (this.m_storage == glsVertexArrayTests.deArray.Storage.USER) {
+ } else if (this.m_storage == glsVertexArrayTests.deArray.Storage.BUFFER) {
+ this.m_ctx.bindBuffer(glsVertexArrayTests.ContextArray.targetToGL(target), this.m_glBuffer);
+ }
+ };
+
+ /**
+ * @param {number} loc
+ */
+ glsVertexArrayTests.ContextArray.prototype.glBind = function(loc) {
+ if (this.m_storage == glsVertexArrayTests.deArray.Storage.BUFFER) {
+ this.m_ctx.bindBuffer(glsVertexArrayTests.ContextArray.targetToGL(this.m_target), this.m_glBuffer);
+
+ if (!glsVertexArrayTests.inputTypeIsFloatType(this.m_inputType)) {
+ // Input is not float type
+
+ if (glsVertexArrayTests.outputTypeIsFloatType(this.m_outputType)) {
+ // Output type is float type
+ this.m_ctx.vertexAttribPointer(loc, this.m_componentCount, glsVertexArrayTests.ContextArray.inputTypeToGL(this.m_inputType), this.m_normalize, this.m_stride, this.m_offset);
+ } else {
+ // Output type is int type
+ this.m_ctx.vertexAttribIPointer(loc, this.m_componentCount, glsVertexArrayTests.ContextArray.inputTypeToGL(this.m_inputType), this.m_stride, this.m_offset);
+ }
+ } else {
+ // Input type is float type
+ // Output type must be float type
+ DE_ASSERT(this.m_outputType == glsVertexArrayTests.deArray.OutputType.FLOAT || this.m_outputType == glsVertexArrayTests.deArray.OutputType.VEC2 || this.m_outputType == glsVertexArrayTests.deArray.OutputType.VEC3 || this.m_outputType == glsVertexArrayTests.deArray.OutputType.VEC4);
+
+ this.m_ctx.vertexAttribPointer(loc, this.m_componentCount, glsVertexArrayTests.ContextArray.inputTypeToGL(this.m_inputType), this.m_normalize, this.m_stride, this.m_offset);
+ }
+
+ this.m_ctx.bindBuffer(glsVertexArrayTests.ContextArray.targetToGL(this.m_target), null);
+ } else if (this.m_storage == glsVertexArrayTests.deArray.Storage.USER) {
+ this.m_ctx.bindBuffer(glsVertexArrayTests.ContextArray.targetToGL(this.m_target), null);
+
+ if (!glsVertexArrayTests.inputTypeIsFloatType(this.m_inputType)) {
+ // Input is not float type
+
+ if (glsVertexArrayTests.outputTypeIsFloatType(this.m_outputType)) {
+ // Output type is float type
+ this.m_ctx.vertexAttribPointer(loc, this.m_componentCount, glsVertexArrayTests.ContextArray.inputTypeToGL(this.m_inputType), this.m_normalize, this.m_stride, this.m_data.subarray(this.m_offset));
+ } else {
+ // Output type is int type
+ this.m_ctx.vertexAttribIPointer(loc, this.m_componentCount, glsVertexArrayTests.ContextArray.inputTypeToGL(this.m_inputType), this.m_stride, this.m_data.subarray(this.m_offset));
+ }
+ } else {
+ // Input type is float type
+
+ // Output type must be float type
+ DE_ASSERT(this.m_outputType == glsVertexArrayTests.deArray.OutputType.FLOAT || this.m_outputType == glsVertexArrayTests.deArray.OutputType.VEC2 || this.m_outputType == glsVertexArrayTests.deArray.OutputType.VEC3 || this.m_outputType == glsVertexArrayTests.deArray.OutputType.VEC4);
+
+ this.m_ctx.vertexAttribPointer(loc, this.m_componentCount, glsVertexArrayTests.ContextArray.inputTypeToGL(this.m_inputType), this.m_normalize, this.m_stride, this.m_data.subarray(this.m_offset));
+ }
+ } else
+ throw new Error('glsVertexArrayTests.ContextArray.prototype.glBind - Invalid storage type specified');
+ };
+
+ //glsVertexArrayTests.ContextArray static functions
+
+ /**
+ * @param {glsVertexArrayTests.deArray.Target} target
+ * @return {number}
+ */
+ glsVertexArrayTests.ContextArray.targetToGL = function(target) {
+ DE_ASSERT(target < Object.keys(glsVertexArrayTests.deArray.Target).length);
+
+ /** @type {Array<number>} */ var targets =
+ [
+ gl.ELEMENT_ARRAY_BUFFER, // glsVertexArrayTests.deArray.Target.ELEMENT_ARRAY
+ gl.ARRAY_BUFFER // glsVertexArrayTests.deArray.Target.ARRAY
+ ];
+
+ return targets[target];
+ };
+
+ /**
+ * @param {glsVertexArrayTests.deArray.Usage} usage
+ * @return {number}
+ */
+ glsVertexArrayTests.ContextArray.usageToGL = function(usage) {
+ DE_ASSERT(usage < Object.keys(glsVertexArrayTests.deArray.Usage).length);
+
+ /** @type {Array<number>} */ var usages =
+ [
+ gl.DYNAMIC_DRAW, // glsVertexArrayTests.deArray.Usage.DYNAMIC_DRAW
+ gl.STATIC_DRAW, // glsVertexArrayTests.deArray.Usage.STATIC_DRAW
+ gl.STREAM_DRAW, // glsVertexArrayTests.deArray.Usage.STREAM_DRAW
+
+ gl.STREAM_READ, // glsVertexArrayTests.deArray.Usage.STREAM_READ
+ gl.STREAM_COPY, // glsVertexArrayTests.deArray.Usage.STREAM_COPY
+
+ gl.STATIC_READ, // glsVertexArrayTests.deArray.Usage.STATIC_READ
+ gl.STATIC_COPY, // glsVertexArrayTests.deArray.Usage.STATIC_COPY
+
+ gl.DYNAMIC_READ, // glsVertexArrayTests.deArray.Usage.DYNAMIC_READ
+ gl.DYNAMIC_COPY // glsVertexArrayTests.deArray.Usage.DYNAMIC_COPY
+ ];
+ DE_ASSERT(usages.length == Object.keys(glsVertexArrayTests.deArray.Usage).length);
+
+ return usages[usage];
+ };
+
+ /**
+ * @param {glsVertexArrayTests.deArray.InputType} type
+ * @return {number}
+ */
+ glsVertexArrayTests.ContextArray.inputTypeToGL = function(type) {
+ DE_ASSERT(type < Object.keys(glsVertexArrayTests.deArray.InputType).length);
+
+ /** @type {Array<number>} */ var types =
+ [
+ gl.FLOAT, // glsVertexArrayTests.deArray.InputType.FLOAT
+
+ gl.BYTE, // glsVertexArrayTests.deArray.InputType.BYTE
+ gl.SHORT, // glsVertexArrayTests.deArray.InputType.SHORT
+ gl.UNSIGNED_BYTE, // glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE
+ gl.UNSIGNED_SHORT, // glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT
+
+ gl.INT, // glsVertexArrayTests.deArray.InputType.INT
+ gl.UNSIGNED_INT, // glsVertexArrayTests.deArray.InputType.UNSIGNED_INT
+ gl.HALF_FLOAT, // glsVertexArrayTests.deArray.InputType.HALF
+ gl.UNSIGNED_INT_2_10_10_10_REV, // glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10
+ gl.INT_2_10_10_10_REV // glsVertexArrayTests.deArray.InputType.INT_2_10_10_10
+ ];
+ DE_ASSERT(types.length == Object.keys(glsVertexArrayTests.deArray.InputType).length);
+
+ return types[type];
+ };
+
+ /**
+ * @param {glsVertexArrayTests.deArray.OutputType} type
+ * @return {string}
+ */
+ glsVertexArrayTests.ContextArray.outputTypeToGLType = function(type) {
+ DE_ASSERT(type < Object.keys(glsVertexArrayTests.deArray.OutputType).length);
+
+ /** @type {Array<string>} */ var types =
+ [
+ 'float', // glsVertexArrayTests.deArray.OutputType.FLOAT
+ 'vec2', // glsVertexArrayTests.deArray.OutputType.VEC2
+ 'vec3', // glsVertexArrayTests.deArray.OutputType.VEC3
+ 'vec4', // glsVertexArrayTests.deArray.OutputType.VEC4
+
+ 'int', // glsVertexArrayTests.deArray.OutputType.INT
+ 'uint', // glsVertexArrayTests.deArray.OutputType.UINT
+
+ 'ivec2', // glsVertexArrayTests.deArray.OutputType.IVEC2
+ 'ivec3', // glsVertexArrayTests.deArray.OutputType.IVEC3
+ 'ivec4', // glsVertexArrayTests.deArray.OutputType.IVEC4
+
+ 'uvec2', // glsVertexArrayTests.deArray.OutputType.UVEC2
+ 'uvec3', // glsVertexArrayTests.deArray.OutputType.UVEC3
+ 'uvec4' // glsVertexArrayTests.deArray.OutputType.UVEC4
+ ];
+ DE_ASSERT(types.length == Object.keys(glsVertexArrayTests.deArray.OutputType).length);
+
+ return types[type];
+ };
+
+ /**
+ * @param {glsVertexArrayTests.deArray.Primitive} primitive
+ * @return {number}
+ */
+ glsVertexArrayTests.ContextArray.primitiveToGL = function(primitive) {
+ /** @type {Array<number>} */ var primitives =
+ [
+ gl.POINTS, // glsVertexArrayTests.deArray.Primitive.POINTS
+ gl.TRIANGLES, // glsVertexArrayTests.deArray.Primitive.TRIANGLES
+ gl.TRIANGLE_FAN, // glsVertexArrayTests.deArray.Primitive.TRIANGLE_FAN
+ gl.TRIANGLE_STRIP // glsVertexArrayTests.deArray.Primitive.TRIANGLE_STRIP
+ ];
+ DE_ASSERT(primitives.length == Object.keys(glsVertexArrayTests.deArray.Primitive).length);
+
+ return primitives[primitive];
+ };
+
+ /**
+ * @constructor
+ * @param {sglrGLContext.GLContext | sglrReferenceContext.ReferenceContext} drawContext
+ */
+ glsVertexArrayTests.ContextArrayPack = function(drawContext) {
+ /** @type {WebGLRenderingContextBase} */ this.m_renderCtx = gl;
+ //TODO: Reference rasterizer implementation.
+ /** @type {sglrGLContext.GLContext | sglrReferenceContext.ReferenceContext} */ this.m_ctx = drawContext;
+
+ /** @type {Array<glsVertexArrayTests.ContextArray>} */ this.m_arrays = [];
+ /** @type {sglrShaderProgram.ShaderProgram} */ this.m_program;
+ /** @type {tcuSurface.Surface} */ this.m_screen = new tcuSurface.Surface(
+ Math.min(512, canvas.width),
+ Math.min(512, canvas.height)
+ );
+ };
+
+ /**
+ * @return {number}
+ */
+ glsVertexArrayTests.ContextArrayPack.prototype.getArrayCount = function() {
+ return this.m_arrays.length;
+ };
+
+ /**
+ * @param {glsVertexArrayTests.deArray.Storage} storage
+ */
+ glsVertexArrayTests.ContextArrayPack.prototype.newArray = function(storage) {
+ this.m_arrays.push(new glsVertexArrayTests.ContextArray(storage, this.m_ctx));
+ };
+
+ /**
+ * @param {number} i
+ * @return {glsVertexArrayTests.ContextArray}
+ */
+ glsVertexArrayTests.ContextArrayPack.prototype.getArray = function(i) {
+ return this.m_arrays[i];
+ };
+
+ /**
+ * updateProgram
+ */
+ glsVertexArrayTests.ContextArrayPack.prototype.updateProgram = function() {
+ this.m_program = new glsVertexArrayTests.ContextShaderProgram(this.m_renderCtx, this.m_arrays);
+ };
+
+ /**
+ * @param {glsVertexArrayTests.deArray.Primitive} primitive
+ * @param {number} firstVertex
+ * @param {number} vertexCount
+ * @param {boolean} useVao
+ * @param {number} coordScale
+ * @param {number} colorScale
+ */
+ glsVertexArrayTests.ContextArrayPack.prototype.render = function(primitive, firstVertex, vertexCount, useVao, coordScale, colorScale) {
+ var program;
+ /** @type {(WebGLVertexArrayObject|sglrReferenceContext.VertexArray|null)} */ var vaoID = null;
+
+ this.updateProgram();
+
+ this.m_ctx.viewport(0, 0, this.m_screen.getWidth(), this.m_screen.getHeight());
+ this.m_ctx.clearColor(0.0, 0.0, 0.0, 1.0);
+ this.m_ctx.clear(gl.COLOR_BUFFER_BIT);
+
+ program = this.m_ctx.createProgram(this.m_program);
+
+ this.m_ctx.useProgram(program);
+
+ this.m_ctx.uniform1f(this.m_ctx.getUniformLocation(program, 'u_coordScale'), coordScale);
+ this.m_ctx.uniform1f(this.m_ctx.getUniformLocation(program, 'u_colorScale'), colorScale);
+
+ if (useVao) {
+ vaoID = this.m_ctx.createVertexArray();
+ this.m_ctx.bindVertexArray(vaoID);
+ }
+
+ /** @type {string} */ var attribName;
+ /** @type {number} */ var loc;
+ for (var arrayNdx = 0; arrayNdx < this.m_arrays.length; arrayNdx++) {
+ if (this.m_arrays[arrayNdx].isBound()) {
+ attribName = 'a_' + this.m_arrays[arrayNdx].getAttribNdx();
+ loc = this.m_ctx.getAttribLocation(program, attribName);
+ this.m_ctx.enableVertexAttribArray(loc);
+
+ this.m_arrays[arrayNdx].glBind(loc);
+ }
+ }
+
+ DE_ASSERT((firstVertex % 6) == 0);
+ //this.m_ctx.drawArrays(glsVertexArrayTests.ContextArray.primitiveToGL(primitive), firstVertex, vertexCount - firstVertex);
+ this.m_ctx.drawQuads(gl.TRIANGLES, firstVertex, vertexCount - firstVertex);
+
+ for (var arrayNdx = 0; arrayNdx < this.m_arrays.length; arrayNdx++) {
+ if (this.m_arrays[arrayNdx].isBound()) {
+ attribName = 'a_' + this.m_arrays[arrayNdx].getAttribNdx();
+ loc = this.m_ctx.getAttribLocation(program, attribName);
+
+ this.m_ctx.disableVertexAttribArray(loc);
+ }
+ }
+
+ if (useVao)
+ vaoID = this.m_ctx.deleteVertexArray(vaoID);
+
+ this.m_ctx.deleteProgram(program);
+ this.m_ctx.useProgram(null);
+ this.m_ctx.readPixels(0, 0, this.m_screen.getWidth(), this.m_screen.getHeight(), gl.RGBA, gl.UNSIGNED_BYTE, this.m_screen.getAccess().getDataPtr());
+ };
+
+ /**
+ * @return {tcuSurface.Surface}
+ */
+ glsVertexArrayTests.ContextArrayPack.prototype.getSurface = function() { return this.m_screen; };
+
+ /**
+ * glsVertexArrayTests.ContextShaderProgram class
+ * @constructor
+ * @extends {sglrShaderProgram.ShaderProgram}
+ * @param {WebGLRenderingContextBase | sglrReferenceContext.ReferenceContext} ctx
+ * @param {Array<glsVertexArrayTests.ContextArray>} arrays
+ */
+ glsVertexArrayTests.ContextShaderProgram = function(ctx, arrays) {
+ sglrShaderProgram.ShaderProgram.call(this, this.createProgramDeclaration(ctx, arrays));
+ this.m_componentCount = new Array(arrays.length);
+ /** @type {Array<rrGenericVector.GenericVecType>} */ this.m_attrType = new Array(arrays.length);
+
+ for (var arrayNdx = 0; arrayNdx < arrays.length; arrayNdx++) {
+ this.m_componentCount[arrayNdx] = this.getComponentCount(arrays[arrayNdx].getOutputType());
+ this.m_attrType[arrayNdx] = this.mapOutputType(arrays[arrayNdx].getOutputType());
+ }
+ };
+
+ glsVertexArrayTests.ContextShaderProgram.prototype = Object.create(sglrShaderProgram.ShaderProgram.prototype);
+ glsVertexArrayTests.ContextShaderProgram.prototype.constructor = glsVertexArrayTests.ContextShaderProgram;
+
+ /**
+ * glsVertexArrayTests.calcShaderColorCoord function
+ * @param {Array<number>} coord (2 elements)
+ * @param {Array<number>} color (3 elements)
+ * @param {goog.NumberArray} attribValue (4 elements)
+ * @param {boolean} isCoordinate
+ * @param {number} numComponents
+ */
+ glsVertexArrayTests.calcShaderColorCoord = function(coord, color, attribValue, isCoordinate, numComponents) {
+ if (isCoordinate)
+ switch (numComponents) {
+ case 1:
+ coord[0] = attribValue[0];
+ coord[1] = attribValue[0];
+ break;
+ case 2:
+ coord[0] = attribValue[0];
+ coord[1] = attribValue[1];
+ break;
+ case 3:
+ coord[0] = attribValue[0] + attribValue[2];
+ coord[1] = attribValue[1];
+ break;
+ case 4:
+ coord[0] = attribValue[0] + attribValue[2];
+ coord[1] = attribValue[1] + attribValue[3];
+ break;
+ default:
+ throw new Error('glsVertexArrayTests.calcShaderColorCoord - Invalid number of components');
+ } else {
+ switch (numComponents) {
+ case 1:
+ color[0] = color[0] * attribValue[0];
+ break;
+ case 2:
+ color[0] = color[0] * attribValue[0];
+ color[1] = color[1] * attribValue[1];
+ break;
+ case 3:
+ color[0] = color[0] * attribValue[0];
+ color[1] = color[1] * attribValue[1];
+ color[2] = color[2] * attribValue[2];
+ break;
+ case 4:
+ color[0] = color[0] * attribValue[0] * attribValue[3];
+ color[1] = color[1] * attribValue[1] * attribValue[3];
+ color[2] = color[2] * attribValue[2] * attribValue[3];
+ break;
+ default:
+ throw new Error('glsVertexArrayTests.calcShaderColorCoord - Invalid number of components');
+ }
+ }
+ };
+
+ /**
+ * glsVertexArrayTests.ContextShaderProgram.shadeVertices
+ * @param {Array<rrVertexAttrib.VertexAttrib>} inputs
+ * @param {Array<rrVertexPacket.VertexPacket>} packets
+ * @param {number} numPackets
+ */
+ glsVertexArrayTests.ContextShaderProgram.prototype.shadeVertices = function(inputs, packets, numPackets) {
+ /** @type {number} */ var u_coordScale = this.getUniformByName('u_coordScale').value[0];
+ /** @type {number} */ var u_colorScale = this.getUniformByName('u_colorScale').value[0];
+
+ for (var packetNdx = 0; packetNdx < numPackets; ++packetNdx) {
+ /** @type {number} */ var varyingLocColor = 0;
+
+ /** @type {rrVertexPacket.VertexPacket} */ var packet = packets[packetNdx];
+
+ // Calc output color
+ /** @type {Array<number>} */ var coord = [1.0, 1.0];
+ /** @type {Array<number>} */ var color = [1.0, 1.0, 1.0];
+
+ for (var attribNdx = 0; attribNdx < this.m_attrType.length; attribNdx++) {
+ /** @type {number} */ var numComponents = this.m_componentCount[attribNdx];
+
+ glsVertexArrayTests.calcShaderColorCoord(coord, color, rrVertexAttrib.readVertexAttrib(inputs[attribNdx], packet.instanceNdx, packet.vertexNdx, this.m_attrType[attribNdx]), attribNdx == 0, numComponents);
+ }
+
+ // Transform position
+ packet.position = [u_coordScale * coord[0], u_coordScale * coord[1], 1.0, 1.0];
+
+ // Pass color to FS
+ packet.outputs[varyingLocColor] = [u_colorScale * color[0], u_colorScale * color[1], u_colorScale * color[2], 1.0];
+ }
+ };
+
+ /**
+ * @param {Array<rrFragmentOperations.Fragment>} packets
+ * @param {rrShadingContext.FragmentShadingContext} context
+ */
+ glsVertexArrayTests.ContextShaderProgram.prototype.shadeFragments = function(packets, context) {
+ var varyingLocColor = 0;
+
+ // Normal shading
+ for (var packetNdx = 0; packetNdx < packets.length; ++packetNdx)
+ packets[packetNdx].value = rrShadingContext.readTriangleVarying(packets[packetNdx], context, varyingLocColor);
+ };
+
+ /**
+ * @param {Array<glsVertexArrayTests.ContextArray>} arrays
+ * @return string
+ */
+ glsVertexArrayTests.ContextShaderProgram.prototype.genVertexSource = function(arrays) {
+ var vertexShaderSrc = '';
+ var params = [];
+
+ params['VTX_IN'] = 'in';
+ params['VTX_OUT'] = 'out';
+ params['FRAG_IN'] = 'in';
+ params['FRAG_COLOR'] = 'dEQP_FragColor';
+ params['VTX_HDR'] = '#version 300 es\n';
+ params['FRAG_HDR'] = '#version 300 es\nlayout(location = 0) out mediump vec4 dEQP_FragColor;\n';
+
+ vertexShaderSrc += params['VTX_HDR'];
+
+ for (var arrayNdx = 0; arrayNdx < arrays.length; arrayNdx++) {
+ vertexShaderSrc += params['VTX_IN'] + ' highp ' + glsVertexArrayTests.ContextArray.outputTypeToGLType(arrays[arrayNdx].getOutputType()) + ' a_' + arrays[arrayNdx].getAttribNdx() + ';\n';
+ }
+
+ vertexShaderSrc +=
+ 'uniform highp float u_coordScale;\n' +
+ 'uniform highp float u_colorScale;\n' +
+ params['VTX_OUT'] + ' mediump vec4 v_color;\n' +
+ 'void main(void)\n' +
+ ' {\n' +
+ '\tgl_PointSize = 1.0;\n' +
+ '\thighp vec2 coord = vec2(1.0, 1.0);\n' +
+ '\thighp vec3 color = vec3(1.0, 1.0, 1.0);\n';
+
+ for (var arrayNdx = 0; arrayNdx < arrays.length; arrayNdx++) {
+ if (arrays[arrayNdx].getAttribNdx() == 0) {
+ switch (arrays[arrayNdx].getOutputType()) {
+ case (glsVertexArrayTests.deArray.OutputType.FLOAT):
+ vertexShaderSrc +=
+ '\tcoord = vec2(a_0);\n';
+ break;
+
+ case (glsVertexArrayTests.deArray.OutputType.VEC2):
+ vertexShaderSrc +=
+ '\tcoord = a_0.xy;\n';
+ break;
+
+ case (glsVertexArrayTests.deArray.OutputType.VEC3):
+ vertexShaderSrc +=
+ '\tcoord = a_0.xy;\n' +
+ '\tcoord.x = coord.x + a_0.z;\n';
+ break;
+
+ case (glsVertexArrayTests.deArray.OutputType.VEC4):
+ vertexShaderSrc +=
+ '\tcoord = a_0.xy;\n' +
+ '\tcoord += a_0.zw;\n';
+ break;
+
+ case (glsVertexArrayTests.deArray.OutputType.IVEC2):
+ case (glsVertexArrayTests.deArray.OutputType.UVEC2):
+ vertexShaderSrc +=
+ '\tcoord = vec2(a_0.xy);\n';
+ break;
+
+ case (glsVertexArrayTests.deArray.OutputType.IVEC3):
+ case (glsVertexArrayTests.deArray.OutputType.UVEC3):
+ vertexShaderSrc +=
+ '\tcoord = vec2(a_0.xy);\n' +
+ '\tcoord.x = coord.x + float(a_0.z);\n';
+ break;
+
+ case (glsVertexArrayTests.deArray.OutputType.IVEC4):
+ case (glsVertexArrayTests.deArray.OutputType.UVEC4):
+ vertexShaderSrc +=
+ '\tcoord = vec2(a_0.xy);\n' +
+ '\tcoord += vec2(a_0.zw);\n';
+ break;
+
+ default:
+ throw new Error('Invalid output type');
+ break;
+ }
+ continue;
+ }
+
+ switch (arrays[arrayNdx].getOutputType()) {
+ case (glsVertexArrayTests.deArray.OutputType.FLOAT):
+ vertexShaderSrc +=
+ '\tcolor = color * a_' + arrays[arrayNdx].getAttribNdx() + ';\n';
+ break;
+
+ case (glsVertexArrayTests.deArray.OutputType.VEC2):
+ vertexShaderSrc +=
+ '\tcolor.rg = color.rg * a_' + arrays[arrayNdx].getAttribNdx() + '.xy;\n';
+ break;
+
+ case (glsVertexArrayTests.deArray.OutputType.VEC3):
+ vertexShaderSrc +=
+ '\tcolor = color.rgb * a_' + arrays[arrayNdx].getAttribNdx() + '.xyz;\n';
+ break;
+
+ case (glsVertexArrayTests.deArray.OutputType.VEC4):
+ vertexShaderSrc +=
+ '\tcolor = color.rgb * a_' + arrays[arrayNdx].getAttribNdx() + '.xyz * a_' + arrays[arrayNdx].getAttribNdx() + '.w;\n';
+ break;
+
+ default:
+ throw new Error('Invalid output type');
+ break;
+ }
+ }
+
+ vertexShaderSrc +=
+ '\tv_color = vec4(u_colorScale * color, 1.0);\n' +
+ '\tgl_Position = vec4(u_coordScale * coord, 1.0, 1.0);\n' +
+ '}\n';
+
+ return vertexShaderSrc;
+ };
+
+ /**
+ * @return {string}
+ */
+ glsVertexArrayTests.ContextShaderProgram.prototype.genFragmentSource = function() {
+ var params = [];
+
+ params['VTX_IN'] = 'in';
+ params['VTX_OUT'] = 'out';
+ params['FRAG_IN'] = 'in';
+ params['FRAG_COLOR'] = 'dEQP_FragColor';
+ params['VTX_HDR'] = '#version 300 es\n';
+ params['FRAG_HDR'] = '#version 300 es\nlayout(location = 0) out mediump vec4 dEQP_FragColor;\n';
+
+ /* TODO: Check if glsl supported version check function is needed.*/
+
+ var fragmentShaderSrc = params['FRAG_HDR'] +
+ params['FRAG_IN'] + ' mediump vec4 v_color;\n' +
+ 'void main(void)\n' +
+ ' {\n' +
+ '\t' + params['FRAG_COLOR'] + ' = v_color;\n' +
+ '}\n';
+
+ return fragmentShaderSrc;
+ };
+
+ /**
+ * @param {glsVertexArrayTests.deArray.OutputType} type
+ * @return {rrGenericVector.GenericVecType}
+ */
+ glsVertexArrayTests.ContextShaderProgram.prototype.mapOutputType = function(type) {
+ switch (type) {
+ case (glsVertexArrayTests.deArray.OutputType.FLOAT):
+ case (glsVertexArrayTests.deArray.OutputType.VEC2):
+ case (glsVertexArrayTests.deArray.OutputType.VEC3):
+ case (glsVertexArrayTests.deArray.OutputType.VEC4):
+ return rrGenericVector.GenericVecType.FLOAT;
+
+ case (glsVertexArrayTests.deArray.OutputType.INT):
+ case (glsVertexArrayTests.deArray.OutputType.IVEC2):
+ case (glsVertexArrayTests.deArray.OutputType.IVEC3):
+ case (glsVertexArrayTests.deArray.OutputType.IVEC4):
+ return rrGenericVector.GenericVecType.INT32;
+
+ case (glsVertexArrayTests.deArray.OutputType.UINT):
+ case (glsVertexArrayTests.deArray.OutputType.UVEC2):
+ case (glsVertexArrayTests.deArray.OutputType.UVEC3):
+ case (glsVertexArrayTests.deArray.OutputType.UVEC4):
+ return rrGenericVector.GenericVecType.UINT32;
+
+ default:
+ throw new Error('Invalid output type');
+ }
+ };
+
+ /**
+ * @param {glsVertexArrayTests.deArray.OutputType} type
+ * @return {number}
+ */
+ glsVertexArrayTests.ContextShaderProgram.prototype.getComponentCount = function(type) {
+ switch (type) {
+ case (glsVertexArrayTests.deArray.OutputType.FLOAT):
+ case (glsVertexArrayTests.deArray.OutputType.INT):
+ case (glsVertexArrayTests.deArray.OutputType.UINT):
+ return 1;
+
+ case (glsVertexArrayTests.deArray.OutputType.VEC2):
+ case (glsVertexArrayTests.deArray.OutputType.IVEC2):
+ case (glsVertexArrayTests.deArray.OutputType.UVEC2):
+ return 2;
+
+ case (glsVertexArrayTests.deArray.OutputType.VEC3):
+ case (glsVertexArrayTests.deArray.OutputType.IVEC3):
+ case (glsVertexArrayTests.deArray.OutputType.UVEC3):
+ return 3;
+
+ case (glsVertexArrayTests.deArray.OutputType.VEC4):
+ case (glsVertexArrayTests.deArray.OutputType.IVEC4):
+ case (glsVertexArrayTests.deArray.OutputType.UVEC4):
+ return 4;
+
+ default:
+ throw new Error('Invalid output type');
+ }
+ };
+
+ /**
+ * @param {WebGLRenderingContextBase | sglrReferenceContext.ReferenceContext} ctx
+ * @param {Array<glsVertexArrayTests.ContextArray>} arrays
+ * @return {sglrShaderProgram.ShaderProgramDeclaration}
+ */
+ glsVertexArrayTests.ContextShaderProgram.prototype.createProgramDeclaration = function(ctx, arrays) {
+ /** @type {sglrShaderProgram.ShaderProgramDeclaration} */ var decl = new sglrShaderProgram.ShaderProgramDeclaration();
+
+ for (var arrayNdx = 0; arrayNdx < arrays.length; arrayNdx++)
+ decl.pushVertexAttribute(new sglrShaderProgram.VertexAttribute('a_' + arrayNdx, this.mapOutputType(arrays[arrayNdx].getOutputType())));
+
+ decl.pushVertexToFragmentVarying(new sglrShaderProgram.VertexToFragmentVarying(rrGenericVector.GenericVecType.FLOAT));
+ decl.pushFragmentOutput(new sglrShaderProgram.FragmentOutput(rrGenericVector.GenericVecType.FLOAT));
+
+ decl.pushVertexSource(new sglrShaderProgram.VertexSource(this.genVertexSource(/*ctx,*/ arrays))); //TODO: Check if we need to review the support of a given GLSL version (we'd need the ctx)
+ decl.pushFragmentSource(new sglrShaderProgram.FragmentSource(this.genFragmentSource(/*ctx*/)));
+
+ decl.pushUniform(new sglrShaderProgram.Uniform('u_coordScale', gluShaderUtil.DataType.FLOAT));
+ decl.pushUniform(new sglrShaderProgram.Uniform('u_colorScale', gluShaderUtil.DataType.FLOAT));
+
+ return decl;
+ };
+
+ /**
+ * glsVertexArrayTests.GLValue class
+ * @constructor
+ */
+ glsVertexArrayTests.GLValue = function() {
+ /** @type {goog.NumberArray} */ this.m_value = [0];
+ /** @type {glsVertexArrayTests.deArray.InputType} */ this.m_type;
+ };
+
+ /**
+ * @param {Uint8Array} dst
+ * @param {glsVertexArrayTests.GLValue} val
+ */
+ glsVertexArrayTests.copyGLValueToArray = function(dst, val) {
+ /** @type {Uint8Array} */ var val8 = new Uint8Array(val.m_value.buffer); // TODO: Fix encapsulation issue
+ dst.set(val8);
+ };
+
+ /**
+ * @param {Uint8Array} dst
+ * @param {goog.NumberArray} src
+ */
+ glsVertexArrayTests.copyArray = function(dst, src) {
+ /** @type {Uint8Array} */ var src8 = new Uint8Array(src.buffer).subarray(src.byteOffset, src.byteOffset + src.byteLength); // TODO: Fix encapsulation issue
+ dst.set(src8);
+ };
+
+ /**
+ * typeToTypedArray function. Determines which type of array will store the value, and stores it.
+ * @param {number} value
+ * @param {glsVertexArrayTests.deArray.InputType} type
+ */
+ glsVertexArrayTests.GLValue.typeToTypedArray = function(value, type) {
+ var array;
+
+ switch (type) {
+ case glsVertexArrayTests.deArray.InputType.FLOAT:
+ array = new Float32Array(1);
+ break;
+ /*case glsVertexArrayTests.deArray.InputType.FIXED:
+ array = new Int32Array(1);
+ break;
+ case glsVertexArrayTests.deArray.InputType.DOUBLE:
+ array = new Float32Array(1); // 64-bit?
+ break;*/
+
+ case glsVertexArrayTests.deArray.InputType.BYTE:
+ array = new Int8Array(1);
+ break;
+ case glsVertexArrayTests.deArray.InputType.SHORT:
+ array = new Int16Array(1);
+ break;
+
+ case glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE:
+ array = new Uint8Array(1);
+ break;
+ case glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT:
+ array = new Uint16Array(1);
+ break;
+
+ case glsVertexArrayTests.deArray.InputType.INT:
+ array = new Int32Array(1);
+ break;
+ case glsVertexArrayTests.deArray.InputType.UNSIGNED_INT:
+ array = new Uint32Array(1);
+ break;
+ case glsVertexArrayTests.deArray.InputType.HALF:
+ array = new Uint16Array(1);
+ value = glsVertexArrayTests.GLValue.floatToHalf(value);
+ break;
+ case glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10:
+ array = new Uint32Array(1);
+ break;
+ case glsVertexArrayTests.deArray.InputType.INT_2_10_10_10:
+ array = new Int32Array(1);
+ break;
+ default:
+ throw new Error('glsVertexArrayTests.GLValue.typeToTypedArray - Invalid InputType');
+ }
+
+ array[0] = value;
+ return array;
+ };
+
+ /**
+ * glsVertexArrayTests.GLValue.create
+ * @param {number} value
+ * @param {glsVertexArrayTests.deArray.InputType} type
+ */
+ glsVertexArrayTests.GLValue.create = function(value, type) {
+ var v = new glsVertexArrayTests.GLValue();
+ v.m_value = glsVertexArrayTests.GLValue.typeToTypedArray(value, type);
+ v.m_type = type;
+ return v;
+ };
+
+ /**
+ * glsVertexArrayTests.GLValue.halfToFloat
+ * @param {number} value
+ * @return {number}
+ */
+ glsVertexArrayTests.GLValue.halfToFloat = function(value) {
+ return tcuFloat.halfFloatToNumberNoDenorm(value);
+ };
+
+ /**
+ * @param {number} f
+ * @return {number}
+ */
+ glsVertexArrayTests.GLValue.floatToHalf = function(f) {
+ // No denorm support.
+ return tcuFloat.numberToHalfFloatNoDenorm(f);
+ };
+
+ /**
+ * glsVertexArrayTests.GLValue.getMaxValue
+ * @param {glsVertexArrayTests.deArray.InputType} type
+ * @return {glsVertexArrayTests.GLValue}
+ */
+ glsVertexArrayTests.GLValue.getMaxValue = function(type) {
+ var value;
+
+ switch (type) {
+ case glsVertexArrayTests.deArray.InputType.FLOAT:
+ value = 127;
+ break;
+ /*case glsVertexArrayTests.deArray.InputType.FIXED:
+ value = 32760;
+ break;
+ case glsVertexArrayTests.deArray.InputType.DOUBLE:
+ value = 127;
+ break;*/
+ case glsVertexArrayTests.deArray.InputType.BYTE:
+ value = 127;
+ break;
+ case glsVertexArrayTests.deArray.InputType.SHORT:
+ value = 32760;
+ break;
+ case glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE:
+ value = 255;
+ break;
+ case glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT:
+ value = 65530;
+ break;
+ case glsVertexArrayTests.deArray.InputType.INT:
+ value = 2147483647;
+ break;
+ case glsVertexArrayTests.deArray.InputType.UNSIGNED_INT:
+ value = 4294967295;
+ break;
+ case glsVertexArrayTests.deArray.InputType.HALF:
+ value = 256;
+ break;
+ default: //Original code returns garbage-filled GLValues
+ return new glsVertexArrayTests.GLValue();
+ }
+
+ return glsVertexArrayTests.GLValue.create(value, type);
+ };
+
+ /**
+ * glsVertexArrayTests.GLValue.getMinValue
+ * @param {glsVertexArrayTests.deArray.InputType} type
+ * @return {glsVertexArrayTests.GLValue}
+ */
+ glsVertexArrayTests.GLValue.getMinValue = function(type) {
+ var value;
+
+ switch (type) {
+ case glsVertexArrayTests.deArray.InputType.FLOAT:
+ value = -127;
+ break;
+ /*case glsVertexArrayTests.deArray.InputType.FIXED:
+ value = -32760;
+ break;
+ case glsVertexArrayTests.deArray.InputType.DOUBLE:
+ value = -127;
+ break;*/
+ case glsVertexArrayTests.deArray.InputType.BYTE:
+ value = -127;
+ break;
+ case glsVertexArrayTests.deArray.InputType.SHORT:
+ value = -32760;
+ break;
+ case glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE:
+ value = 0;
+ break;
+ case glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT:
+ value = 0;
+ break;
+ case glsVertexArrayTests.deArray.InputType.INT:
+ value = -2147483647;
+ break;
+ case glsVertexArrayTests.deArray.InputType.UNSIGNED_INT:
+ value = 0;
+ break;
+ case glsVertexArrayTests.deArray.InputType.HALF:
+ value = -256;
+ break;
+
+ default: //Original code returns garbage-filled GLValues
+ return new glsVertexArrayTests.GLValue();
+ }
+
+ return glsVertexArrayTests.GLValue.create(value, type);
+ };
+
+ /**
+ * glsVertexArrayTests.GLValue.getRandom
+ * @param {deRandom.Random} rnd
+ * @param {glsVertexArrayTests.GLValue} min
+ * @param {glsVertexArrayTests.GLValue} max
+ * @return {glsVertexArrayTests.GLValue}
+ */
+ glsVertexArrayTests.GLValue.getRandom = function(rnd, min, max) {
+ DE_ASSERT(min.getType() == max.getType());
+
+ var minv = min.interpret();
+ var maxv = max.interpret();
+ var type = min.getType();
+ var value;
+
+ if (maxv < minv)
+ return min;
+
+ switch (type) {
+ case glsVertexArrayTests.deArray.InputType.FLOAT:
+ //case glsVertexArrayTests.deArray.InputType.DOUBLE:
+ case glsVertexArrayTests.deArray.InputType.HALF: {
+ return glsVertexArrayTests.GLValue.create(minv + rnd.getFloat() * (maxv - minv), type);
+ break;
+ }
+
+ /*case glsVertexArrayTests.deArray.InputType.FIXED: {
+ return minv == maxv ? min : glsVertexArrayTests.GLValue.create(minv + rnd.getInt() % (maxv - minv), type);
+ break;
+ }*/
+
+ case glsVertexArrayTests.deArray.InputType.SHORT:
+ case glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT:
+ case glsVertexArrayTests.deArray.InputType.BYTE:
+ case glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE:
+ case glsVertexArrayTests.deArray.InputType.INT:
+ case glsVertexArrayTests.deArray.InputType.UNSIGNED_INT: {
+ return glsVertexArrayTests.GLValue.create(minv + rnd.getInt() % (maxv - minv), type);
+ break;
+ }
+
+ default:
+ throw new Error('glsVertexArrayTests.GLValue.getRandom - Invalid input type');
+ break;
+ }
+ };
+
+ // Minimum difference required between coordinates
+
+ /**
+ * @param {glsVertexArrayTests.deArray.InputType} type
+ * @return {glsVertexArrayTests.GLValue}
+ */
+ glsVertexArrayTests.GLValue.minValue = function(type) {
+ switch (type) {
+ case glsVertexArrayTests.deArray.InputType.FLOAT:
+ case glsVertexArrayTests.deArray.InputType.BYTE:
+ case glsVertexArrayTests.deArray.InputType.HALF:
+ //case glsVertexArrayTests.deArray.InputType.DOUBLE:
+ return glsVertexArrayTests.GLValue.create(4, type);
+ case glsVertexArrayTests.deArray.InputType.SHORT:
+ case glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT:
+ return glsVertexArrayTests.GLValue.create(4 * 256, type);
+ case glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE:
+ return glsVertexArrayTests.GLValue.create(4 * 2, type);
+ /*case glsVertexArrayTests.deArray.InputType.FIXED:
+ return glsVertexArrayTests.GLValue.create(4 * 512, type);*/
+ case glsVertexArrayTests.deArray.InputType.INT:
+ case glsVertexArrayTests.deArray.InputType.UNSIGNED_INT:
+ return glsVertexArrayTests.GLValue.create(4 * 16777216, type);
+
+ default:
+ throw new Error('glsVertexArrayTests.GLValue.minValue - Invalid input type');
+ }
+ };
+
+ /**
+ * @param {glsVertexArrayTests.GLValue} val
+ * @return {glsVertexArrayTests.GLValue}
+ */
+ glsVertexArrayTests.GLValue.abs = function(val) {
+ var type = val.getType();
+ switch (type) {
+ //case glsVertexArrayTests.deArray.InputType.FIXED:
+ case glsVertexArrayTests.deArray.InputType.SHORT:
+ return glsVertexArrayTests.GLValue.create(0x7FFF & val.getValue(), type);
+ case glsVertexArrayTests.deArray.InputType.BYTE:
+ return glsVertexArrayTests.GLValue.create(0x7F & val.getValue(), type);
+ case glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE:
+ case glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT:
+ case glsVertexArrayTests.deArray.InputType.UNSIGNED_INT:
+ return val;
+ case glsVertexArrayTests.deArray.InputType.FLOAT:
+ case glsVertexArrayTests.deArray.InputType.HALF:
+ //case glsVertexArrayTests.deArray.InputType.DOUBLE:
+ return glsVertexArrayTests.GLValue.create(Math.abs(val.interpret()), type);
+ case glsVertexArrayTests.deArray.InputType.INT:
+ return glsVertexArrayTests.GLValue.create(0x7FFFFFFF & val.getValue(), type);
+ default:
+ throw new Error('glsVertexArrayTests.GLValue.abs - Invalid input type');
+ }
+ };
+
+ /**
+ * @return {glsVertexArrayTests.deArray.InputType}
+ */
+ glsVertexArrayTests.GLValue.prototype.getType = function() {
+ return this.m_type;
+ };
+
+ /**
+ * glsVertexArrayTests.GLValue.toFloat
+ * @return {number}
+ */
+ glsVertexArrayTests.GLValue.prototype.toFloat = function() {
+ return this.interpret();
+ };
+
+ /**
+ * glsVertexArrayTests.GLValue.getValue
+ * @return {number}
+ */
+ glsVertexArrayTests.GLValue.prototype.getValue = function() {
+ return this.m_value[0];
+ };
+
+ /**
+ * interpret function. Returns the m_value as a quantity so arithmetic operations can be performed on it
+ * Only some types require this.
+ * @return {number}
+ */
+ glsVertexArrayTests.GLValue.prototype.interpret = function() {
+ if (this.m_type == glsVertexArrayTests.deArray.InputType.HALF)
+ return glsVertexArrayTests.GLValue.halfToFloat(this.m_value[0]);
+ /*else if (this.m_type == glsVertexArrayTests.deArray.InputType.FIXED) {
+ var maxValue = 65536;
+ return Math.floor((2 * this.m_value[0] + 1) / (maxValue - 1));
+ }*/
+
+ return this.m_value[0];
+ };
+
+ /**
+ * @param {glsVertexArrayTests.GLValue} other
+ * @return {glsVertexArrayTests.GLValue}
+ */
+ glsVertexArrayTests.GLValue.prototype.add = function(other) {
+ return glsVertexArrayTests.GLValue.create(this.interpret() + other.interpret(), this.m_type);
+ };
+
+ /**
+ * @param {glsVertexArrayTests.GLValue} other
+ * @return {glsVertexArrayTests.GLValue}
+ */
+ glsVertexArrayTests.GLValue.prototype.mul = function(other) {
+ return glsVertexArrayTests.GLValue.create(this.interpret() * other.interpret(), this.m_type);
+ };
+
+ /**
+ * @param {glsVertexArrayTests.GLValue} other
+ * @return {glsVertexArrayTests.GLValue}
+ */
+ glsVertexArrayTests.GLValue.prototype.div = function(other) {
+ return glsVertexArrayTests.GLValue.create(this.interpret() / other.interpret(), this.m_type);
+ };
+
+ /**
+ * @param {glsVertexArrayTests.GLValue} other
+ * @return {glsVertexArrayTests.GLValue}
+ */
+ glsVertexArrayTests.GLValue.prototype.sub = function(other) {
+ return glsVertexArrayTests.GLValue.create(this.interpret() - other.interpret(), this.m_type);
+ };
+
+ /**
+ * @param {glsVertexArrayTests.GLValue} other
+ * @return {glsVertexArrayTests.GLValue}
+ */
+ glsVertexArrayTests.GLValue.prototype.addToSelf = function(other) {
+ this.m_value[0] = this.interpret() + other.interpret();
+ return this;
+ };
+
+ /**
+ * @param {glsVertexArrayTests.GLValue} other
+ * @return {glsVertexArrayTests.GLValue}
+ */
+ glsVertexArrayTests.GLValue.prototype.subToSelf = function(other) {
+ this.m_value[0] = this.interpret() - other.interpret();
+ return this;
+ };
+
+ /**
+ * @param {glsVertexArrayTests.GLValue} other
+ * @return {glsVertexArrayTests.GLValue}
+ */
+ glsVertexArrayTests.GLValue.prototype.mulToSelf = function(other) {
+ this.m_value[0] = this.interpret() * other.interpret();
+ return this;
+ };
+
+ /**
+ * @param {glsVertexArrayTests.GLValue} other
+ * @return {glsVertexArrayTests.GLValue}
+ */
+ glsVertexArrayTests.GLValue.prototype.divToSelf = function(other) {
+ this.m_value[0] = this.interpret() / other.interpret();
+ return this;
+ };
+
+ /**
+ * @param {glsVertexArrayTests.GLValue} other
+ * @return {boolean}
+ */
+ glsVertexArrayTests.GLValue.prototype.equals = function(other) {
+ return this.m_value[0] == other.getValue();
+ };
+
+ /**
+ * @param {glsVertexArrayTests.GLValue} other
+ * @return {boolean}
+ */
+ glsVertexArrayTests.GLValue.prototype.lessThan = function(other) {
+ return this.interpret() < other.interpret();
+ };
+
+ /**
+ * @param {glsVertexArrayTests.GLValue} other
+ * @return {boolean}
+ */
+ glsVertexArrayTests.GLValue.prototype.greaterThan = function(other) {
+ return this.interpret() > other.interpret();
+ };
+
+ /**
+ * @param {glsVertexArrayTests.GLValue} other
+ * @return {boolean}
+ */
+ glsVertexArrayTests.GLValue.prototype.lessOrEqualThan = function(other) {
+ return this.interpret() <= other.interpret();
+ };
+
+ /**
+ * @param {glsVertexArrayTests.GLValue} other
+ * @return {boolean}
+ */
+ glsVertexArrayTests.GLValue.prototype.greaterOrEqualThan = function(other) {
+ return this.interpret() >= other.interpret();
+ };
+
+ /**
+ * glsVertexArrayTests.RandomArrayGenerator class. Contains static methods only
+ */
+ glsVertexArrayTests.RandomArrayGenerator = function() {};
+
+ /**
+ * glsVertexArrayTests.RandomArrayGenerator.setData
+ * @param {Uint8Array} data
+ * @param {glsVertexArrayTests.deArray.InputType} type
+ * @param {deRandom.Random} rnd
+ * @param {glsVertexArrayTests.GLValue} min
+ * @param {glsVertexArrayTests.GLValue} max
+ */
+ glsVertexArrayTests.RandomArrayGenerator.setData = function(data, type, rnd, min, max) {
+ // Parameter type is not necessary, but we'll use it to assert the created glsVertexArrayTests.GLValue is of the correct type.
+ /** @type {glsVertexArrayTests.GLValue} */ var value = glsVertexArrayTests.GLValue.getRandom(rnd, min, max);
+ DE_ASSERT(value.getType() == type);
+
+ glsVertexArrayTests.copyGLValueToArray(data, value);
+ };
+
+ /**
+ * generateArray
+ * @param {number} seed
+ * @param {glsVertexArrayTests.GLValue} min
+ * @param {glsVertexArrayTests.GLValue} max
+ * @param {number} count
+ * @param {number} componentCount
+ * @param {number} stride
+ * @param {glsVertexArrayTests.deArray.InputType} type
+ * @return {ArrayBuffer}
+ */
+ glsVertexArrayTests.RandomArrayGenerator.generateArray = function(seed, min, max, count, componentCount, stride, type) {
+ /** @type {ArrayBuffer} */ var data;
+ /** @type {Uint8Array} */ var data8;
+
+ var rnd = new deRandom.Random(seed);
+
+ if (stride == 0)
+ stride = componentCount * glsVertexArrayTests.deArray.inputTypeSize(type);
+
+ data = new ArrayBuffer(stride * count);
+ data8 = new Uint8Array(data);
+
+ for (var vertexNdx = 0; vertexNdx < count; vertexNdx++) {
+ for (var componentNdx = 0; componentNdx < componentCount; componentNdx++) {
+ glsVertexArrayTests.RandomArrayGenerator.setData(data8.subarray(vertexNdx * stride + glsVertexArrayTests.deArray.inputTypeSize(type) * componentNdx), type, rnd, min, max);
+ }
+ }
+
+ return data;
+ };
+
+ /* {
+ static char* generateQuads (int seed, int count, int componentCount, int offset, int stride, Array::Primitive primitive, Array::InputType type, glsVertexArrayTests.GLValue min, glsVertexArrayTests.GLValue max);
+ static char* generatePerQuad (int seed, int count, int componentCount, int stride, Array::Primitive primitive, Array::InputType type, glsVertexArrayTests.GLValue min, glsVertexArrayTests.GLValue max);
+
+ private:
+ template<typename T>
+ static char* createQuads (int seed, int count, int componentCount, int offset, int stride, Array::Primitive primitive, T min, T max);
+ template<typename T>
+ static char* createPerQuads (int seed, int count, int componentCount, int stride, Array::Primitive primitive, T min, T max);
+ static char* createQuadsPacked (int seed, int count, int componentCount, int offset, int stride, Array::Primitive primitive);
+ };*/
+
+ /**
+ * @param {number} seed
+ * @param {number} count
+ * @param {number} componentCount
+ * @param {number} offset
+ * @param {number} stride
+ * @param {glsVertexArrayTests.deArray.Primitive} primitive
+ * @param {glsVertexArrayTests.deArray.InputType} type
+ * @param {glsVertexArrayTests.GLValue} min
+ * @param {glsVertexArrayTests.GLValue} max
+ * @param {number} scale Coordinate scaling factor
+ * @return {ArrayBuffer}
+ */
+ glsVertexArrayTests.RandomArrayGenerator.generateQuads = function(seed, count, componentCount, offset, stride, primitive, type, min, max, scale) {
+ /** @type {ArrayBuffer} */ var data;
+
+ switch (type) {
+ case glsVertexArrayTests.deArray.InputType.FLOAT:
+ /*case glsVertexArrayTests.deArray.InputType.FIXED:
+ case glsVertexArrayTests.deArray.InputType.DOUBLE:*/
+ case glsVertexArrayTests.deArray.InputType.BYTE:
+ case glsVertexArrayTests.deArray.InputType.SHORT:
+ case glsVertexArrayTests.deArray.InputType.UNSIGNED_BYTE:
+ case glsVertexArrayTests.deArray.InputType.UNSIGNED_SHORT:
+ case glsVertexArrayTests.deArray.InputType.UNSIGNED_INT:
+ case glsVertexArrayTests.deArray.InputType.INT:
+ case glsVertexArrayTests.deArray.InputType.HALF:
+ data = glsVertexArrayTests.RandomArrayGenerator.createQuads(seed, count, componentCount, offset, stride, primitive, min, max, scale);
+ break;
+
+ case glsVertexArrayTests.deArray.InputType.INT_2_10_10_10:
+ case glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10:
+ data = glsVertexArrayTests.RandomArrayGenerator.createQuadsPacked(seed, count, componentCount, offset, stride, primitive);
+ break;
+
+ default:
+ throw new Error('glsVertexArrayTests.RandomArrayGenerator.generateQuads - Invalid input type');
+ break;
+ }
+
+ return data;
+ };
+
+ /**
+ * @param {number} seed
+ * @param {number} count
+ * @param {number} componentCount
+ * @param {number} offset
+ * @param {number} stride
+ * @param {glsVertexArrayTests.deArray.Primitive} primitive
+ * @return {ArrayBuffer}
+ */
+ glsVertexArrayTests.RandomArrayGenerator.createQuadsPacked = function(seed, count, componentCount, offset, stride, primitive) {
+ DE_ASSERT(componentCount == 4);
+
+ /** @type {number} */ var quadStride = 0;
+
+ if (stride == 0)
+ stride = deMath.INT32_SIZE;
+
+ switch (primitive) {
+ case glsVertexArrayTests.deArray.Primitive.TRIANGLES:
+ quadStride = stride * 6;
+ break;
+
+ default:
+ throw new Error('glsVertexArrayTests.RandomArrayGenerator.createQuadsPacked - Invalid primitive');
+ break;
+ }
+
+ /** @type {ArrayBuffer} */ var _data = new ArrayBuffer(offset + quadStride * (count - 1) + stride * 5 + componentCount * glsVertexArrayTests.deArray.inputTypeSize(glsVertexArrayTests.deArray.InputType.INT_2_10_10_10)); // last element must be fully in the array
+ /** @type {Uint8Array} */ var resultData = new Uint8Array(_data).subarray(offset);
+
+ /** @type {number} */ var max = 1024;
+ /** @type {number} */ var min = 10;
+ /** @type {number} */ var max2 = 4;
+
+ var rnd = new deRandom.Random(seed);
+
+ switch (primitive) {
+ case glsVertexArrayTests.deArray.Primitive.TRIANGLES: {
+ for (var quadNdx = 0; quadNdx < count; quadNdx++) {
+ /** @type {number} */ var x1 = min + rnd.getInt() % (max - min);
+ /** @type {number} */ var x2 = min + rnd.getInt() % (max - x1);
+
+ /** @type {number} */ var y1 = min + rnd.getInt() % (max - min);
+ /** @type {number} */ var y2 = min + rnd.getInt() % (max - y1);
+
+ /** @type {number} */ var z = min + rnd.getInt() % (max - min);
+ /** @type {number} */ var w = rnd.getInt() % max2;
+
+ /** @type {number} */ var val1 = (w << 30) | (z << 20) | (y1 << 10) | x1;
+ /** @type {number} */ var val2 = (w << 30) | (z << 20) | (y1 << 10) | x2;
+ /** @type {number} */ var val3 = (w << 30) | (z << 20) | (y2 << 10) | x1;
+
+ /** @type {number} */ var val4 = (w << 30) | (z << 20) | (y2 << 10) | x1;
+ /** @type {number} */ var val5 = (w << 30) | (z << 20) | (y1 << 10) | x2;
+ /** @type {number} */ var val6 = (w << 30) | (z << 20) | (y2 << 10) | x2;
+
+ glsVertexArrayTests.copyArray(resultData.subarray(quadNdx * quadStride + stride * 0), new Uint32Array([val1]));
+ glsVertexArrayTests.copyArray(resultData.subarray(quadNdx * quadStride + stride * 1), new Uint32Array([val2]));
+ glsVertexArrayTests.copyArray(resultData.subarray(quadNdx * quadStride + stride * 2), new Uint32Array([val3]));
+ glsVertexArrayTests.copyArray(resultData.subarray(quadNdx * quadStride + stride * 3), new Uint32Array([val4]));
+ glsVertexArrayTests.copyArray(resultData.subarray(quadNdx * quadStride + stride * 4), new Uint32Array([val5]));
+ glsVertexArrayTests.copyArray(resultData.subarray(quadNdx * quadStride + stride * 5), new Uint32Array([val6]));
+ }
+
+ break;
+ }
+
+ default:
+ throw new Error('glsVertexArrayTests.RandomArrayGenerator.createQuadsPacked - Invalid primitive');
+ break;
+ }
+
+ return _data;
+ };
+
+ /**
+ * @param {number} seed
+ * @param {number} count
+ * @param {number} componentCount
+ * @param {number} offset
+ * @param {number} stride
+ * @param {glsVertexArrayTests.deArray.Primitive} primitive
+ * @param {glsVertexArrayTests.GLValue} min
+ * @param {glsVertexArrayTests.GLValue} max
+ * @param {number} scale Coordinate scaling factor
+ * @return {ArrayBuffer}
+ */
+ glsVertexArrayTests.RandomArrayGenerator.createQuads = function(seed, count, componentCount, offset, stride, primitive, min, max, scale) {
+ var componentStride = min.m_value.byteLength; //TODO: Fix encapsulation issue
+ var quadStride = 0;
+ var type = min.getType(); //Instead of using the template parameter.
+
+ if (stride == 0)
+ stride = componentCount * componentStride;
+ DE_ASSERT(stride >= componentCount * componentStride);
+
+ switch (primitive) {
+ case glsVertexArrayTests.deArray.Primitive.TRIANGLES:
+ quadStride = stride * 6;
+ break;
+
+ default:
+ throw new Error('glsVertexArrayTests.RandomArrayGenerator.createQuads - Invalid primitive');
+ break;
+ }
+
+ /** @type {ArrayBuffer} */ var _data = new ArrayBuffer(offset + quadStride * count);
+ /** @type {Uint8Array} */ var resultData = new Uint8Array(_data).subarray(offset);
+
+ var rnd = new deRandom.Random(seed);
+
+ switch (primitive) {
+ case glsVertexArrayTests.deArray.Primitive.TRIANGLES: {
+ for (var quadNdx = 0; quadNdx < count; ++quadNdx) {
+ /** @type {glsVertexArrayTests.GLValue} */ var x1 = null;
+ /** @type {glsVertexArrayTests.GLValue} */ var x2 = null;
+ /** @type {glsVertexArrayTests.GLValue} */ var y1 = null;
+ /** @type {glsVertexArrayTests.GLValue} */ var y2 = null;
+ /** @type {glsVertexArrayTests.GLValue} */ var z = null;
+ /** @type {glsVertexArrayTests.GLValue} */ var w = null;
+
+ // attempt to find a good (i.e not extremely small) quad
+ for (var attemptNdx = 0; attemptNdx < 4; ++attemptNdx) {
+ x1 = glsVertexArrayTests.GLValue.getRandom(rnd, min, max);
+ x2 = glsVertexArrayTests.GLValue.getRandom(rnd, glsVertexArrayTests.GLValue.minValue(type), glsVertexArrayTests.GLValue.abs(max.sub(x1)));
+
+ y1 = glsVertexArrayTests.GLValue.getRandom(rnd, min, max);
+ y2 = glsVertexArrayTests.GLValue.getRandom(rnd, glsVertexArrayTests.GLValue.minValue(type), glsVertexArrayTests.GLValue.abs(max.sub(y1)));
+
+ z = (componentCount > 2) ? (glsVertexArrayTests.GLValue.getRandom(rnd, min, max)) : (glsVertexArrayTests.GLValue.create(0, type));
+ w = (componentCount > 3) ? (glsVertexArrayTests.GLValue.getRandom(rnd, min, max)) : (glsVertexArrayTests.GLValue.create(1, type));
+
+ // no additional components, all is good
+ if (componentCount <= 2)
+ break;
+
+ // The result quad is too thin?
+ if ((Math.abs(x2.interpret() + z.interpret()) < glsVertexArrayTests.GLValue.minValue(type).interpret()) ||
+ (Math.abs(y2.interpret() + w.interpret()) < glsVertexArrayTests.GLValue.minValue(type).interpret()))
+ continue;
+
+ // all ok
+ break;
+ }
+
+ x2 = x1.add(x2);
+ y2 = y1.add(y2);
+
+ /**
+ * Transform GL vertex coordinates so that after vertex shading the vertices will be rounded.
+ * We want to avoid quads that cover a pixel partially
+ */
+ var round = function(pos, scale, offset, range) {
+ // Perform the same transformation as the vertex shader
+ var val = (pos.interpret() + offset) * scale;
+ var half = range / 2;
+ val = val * half + half;
+ // Round it
+ val = Math.round(val);
+ // And reverse the vertex shading transformation
+ val = (val - half) / half;
+ val = val / scale - offset;
+ return glsVertexArrayTests.GLValue.create(val, pos.m_type);
+ };
+
+ var viewport = gl.getParameter(gl.VIEWPORT);
+ var voffset = 0;
+ if (componentCount > 2)
+ voffset = z.interpret();
+ x1 = round(x1, scale, voffset, viewport[2]);
+ x2 = round(x2, scale, voffset, viewport[2]);
+ voffset = 1;
+ if (componentCount > 3)
+ voffset = w.interpret();
+ y1 = round(y1, scale, voffset, viewport[3]);
+ y2 = round(y2, scale, voffset, viewport[3]);
+
+ glsVertexArrayTests.copyGLValueToArray(resultData.subarray(quadNdx * quadStride), x1);
+ glsVertexArrayTests.copyGLValueToArray(resultData.subarray(quadNdx * quadStride + componentStride), y1);
+
+ glsVertexArrayTests.copyGLValueToArray(resultData.subarray(quadNdx * quadStride + stride), x2);
+ glsVertexArrayTests.copyGLValueToArray(resultData.subarray(quadNdx * quadStride + stride + componentStride), y1);
+
+ glsVertexArrayTests.copyGLValueToArray(resultData.subarray(quadNdx * quadStride + stride * 2), x1);
+ glsVertexArrayTests.copyGLValueToArray(resultData.subarray(quadNdx * quadStride + stride * 2 + componentStride), y2);
+
+ glsVertexArrayTests.copyGLValueToArray(resultData.subarray(quadNdx * quadStride + stride * 3), x1);
+ glsVertexArrayTests.copyGLValueToArray(resultData.subarray(quadNdx * quadStride + stride * 3 + componentStride), y2);
+
+ glsVertexArrayTests.copyGLValueToArray(resultData.subarray(quadNdx * quadStride + stride * 4), x2);
+ glsVertexArrayTests.copyGLValueToArray(resultData.subarray(quadNdx * quadStride + stride * 4 + componentStride), y1);
+
+ glsVertexArrayTests.copyGLValueToArray(resultData.subarray(quadNdx * quadStride + stride * 5), x2);
+ glsVertexArrayTests.copyGLValueToArray(resultData.subarray(quadNdx * quadStride + stride * 5 + componentStride), y2);
+
+ if (componentCount > 2) {
+ for (var i = 0; i < 6; i++)
+ glsVertexArrayTests.copyGLValueToArray(resultData.subarray(quadNdx * quadStride + stride * i + componentStride * 2), z);
+ }
+
+ if (componentCount > 3) {
+ for (var i = 0; i < 6; i++)
+ glsVertexArrayTests.copyGLValueToArray(resultData.subarray(quadNdx * quadStride + stride * i + componentStride * 3), w);
+ }
+ }
+
+ break;
+ }
+
+ default:
+ throw new Error('glsVertexArrayTests.RandomArrayGenerator.createQuads - Invalid primitive');
+ break;
+ }
+
+ return _data;
+ };
+
+ /**
+ * @param {number} seed
+ * @param {number} count
+ * @param {number} componentCount
+ * @param {number} stride
+ * @param {glsVertexArrayTests.deArray.Primitive} primitive
+ * @param {glsVertexArrayTests.deArray.InputType} type
+ * @param {glsVertexArrayTests.GLValue} min
+ * @param {glsVertexArrayTests.GLValue} max
+ */
+ glsVertexArrayTests.RandomArrayGenerator.generatePerQuad = function(seed, count, componentCount, stride, primitive, type, min, max) {
+ /** @type {ArrayBuffer} */ var data = null;
+
+ data = glsVertexArrayTests.RandomArrayGenerator.createPerQuads(seed, count, componentCount, stride, primitive, min, max);
+ return data;
+ };
+
+ /**
+ * @param {number} seed
+ * @param {number} count
+ * @param {number} componentCount
+ * @param {number} stride
+ * @param {glsVertexArrayTests.deArray.Primitive} primitive
+ * @param {glsVertexArrayTests.GLValue} min
+ * @param {glsVertexArrayTests.GLValue} max
+ */
+ glsVertexArrayTests.RandomArrayGenerator.createPerQuads = function(seed, count, componentCount, stride, primitive, min, max) {
+ var rnd = new deRandom.Random(seed);
+
+ var componentStride = min.m_value.byteLength; //TODO: Fix encapsulation issue.
+
+ if (stride == 0)
+ stride = componentStride * componentCount;
+
+ var quadStride = 0;
+
+ switch (primitive) {
+ case glsVertexArrayTests.deArray.Primitive.TRIANGLES:
+ quadStride = stride * 6;
+ break;
+
+ default:
+ throw new Error('glsVertexArrayTests.RandomArrayGenerator.createPerQuads - Invalid primitive');
+ break;
+ }
+
+ /** @type {ArrayBuffer} */ var data = new ArrayBuffer(count * quadStride);
+
+ for (var quadNdx = 0; quadNdx < count; quadNdx++) {
+ for (var componentNdx = 0; componentNdx < componentCount; componentNdx++) {
+ /** @type {glsVertexArrayTests.GLValue} */ var val = glsVertexArrayTests.GLValue.getRandom(rnd, min, max);
+
+ var data8 = new Uint8Array(data);
+ glsVertexArrayTests.copyGLValueToArray(data8.subarray(quadNdx * quadStride + stride * 0 + componentStride * componentNdx), val);
+ glsVertexArrayTests.copyGLValueToArray(data8.subarray(quadNdx * quadStride + stride * 1 + componentStride * componentNdx), val);
+ glsVertexArrayTests.copyGLValueToArray(data8.subarray(quadNdx * quadStride + stride * 2 + componentStride * componentNdx), val);
+ glsVertexArrayTests.copyGLValueToArray(data8.subarray(quadNdx * quadStride + stride * 3 + componentStride * componentNdx), val);
+ glsVertexArrayTests.copyGLValueToArray(data8.subarray(quadNdx * quadStride + stride * 4 + componentStride * componentNdx), val);
+ glsVertexArrayTests.copyGLValueToArray(data8.subarray(quadNdx * quadStride + stride * 5 + componentStride * componentNdx), val);
+ }
+ }
+
+ return data;
+ };
+
+ /**
+ * class glsVertexArrayTests.VertexArrayTest
+ * @constructor
+ * @extends {tcuTestCase.DeqpTest}
+ * @param {string} name
+ * @param {string} description
+ */
+ glsVertexArrayTests.VertexArrayTest = function(name, description) {
+ tcuTestCase.DeqpTest.call(this, name, description);
+
+ var r = /** @type {number} */ (gl.getParameter(gl.RED_BITS));
+ var g = /** @type {number} */ (gl.getParameter(gl.GREEN_BITS));
+ var b = /** @type {number} */ (gl.getParameter(gl.BLUE_BITS));
+ var a = /** @type {number} */ (gl.getParameter(gl.ALPHA_BITS));
+ this.m_pixelformat = new tcuPixelFormat.PixelFormat(r, g, b, a);
+
+ /** @type {sglrReferenceContext.ReferenceContextBuffers} */ this.m_refBuffers = null;
+ /** @type {sglrReferenceContext.ReferenceContext} */ this.m_refContext = null;
+ /** @type {sglrGLContext.GLContext} */ this.m_glesContext = null;
+ /** @type {glsVertexArrayTests.ContextArrayPack} */ this.m_glArrayPack = null;
+ /** @type {glsVertexArrayTests.ContextArrayPack} */ this.m_rrArrayPack = null;
+ /** @type {boolean} */ this.m_isOk = false;
+ /** @type {number} */ this.m_maxDiffRed = Math.ceil(256.0 * (2.0 / (1 << this.m_pixelformat.redBits)));
+ /** @type {number} */ this.m_maxDiffGreen = Math.ceil(256.0 * (2.0 / (1 << this.m_pixelformat.greenBits)));
+ /** @type {number} */ this.m_maxDiffBlue = Math.ceil(256.0 * (2.0 / (1 << this.m_pixelformat.blueBits)));
+ };
+
+ glsVertexArrayTests.VertexArrayTest.prototype = Object.create(tcuTestCase.DeqpTest.prototype);
+ glsVertexArrayTests.VertexArrayTest.prototype.constructor = glsVertexArrayTests.VertexArrayTest;
+
+ /**
+ * init
+ */
+ glsVertexArrayTests.VertexArrayTest.prototype.init = function() {
+ /** @type {number}*/ var renderTargetWidth = Math.min(512, canvas.width);
+ /** @type {number}*/ var renderTargetHeight = Math.min(512, canvas.height);
+ /** @type {sglrReferenceContext.ReferenceContextLimits} */ var limits = new sglrReferenceContext.ReferenceContextLimits(gl);
+
+ this.m_glesContext = new sglrGLContext.GLContext(gl);
+ this.m_refBuffers = new sglrReferenceContext.ReferenceContextBuffers(this.m_pixelformat, 0, 0, renderTargetWidth, renderTargetHeight);
+ this.m_refContext = new sglrReferenceContext.ReferenceContext(limits, this.m_refBuffers.getColorbuffer(), this.m_refBuffers.getDepthbuffer(), this.m_refBuffers.getStencilbuffer());
+
+ this.m_glArrayPack = new glsVertexArrayTests.ContextArrayPack(this.m_glesContext);
+ this.m_rrArrayPack = new glsVertexArrayTests.ContextArrayPack(this.m_refContext);
+ };
+
+ /**
+ * compare
+ */
+ glsVertexArrayTests.VertexArrayTest.prototype.compare = function() {
+ /** @type {tcuSurface.Surface} */ var ref = this.m_rrArrayPack.getSurface();
+ /** @type {tcuSurface.Surface} */ var screen = this.m_glArrayPack.getSurface();
+
+ if (/** @type {number} */ (this.m_glesContext.getParameter(gl.SAMPLES)) > 1) {
+ // \todo [mika] Improve compare when using multisampling
+ bufferedLogToConsole('Warning: Comparison of result from multisample render targets are not as strict as without multisampling. Might produce false positives!');
+ this.m_isOk = tcuImageCompare.fuzzyCompare('Compare Results', 'Compare Results', ref.getAccess(), screen.getAccess(), 1.5);
+ } else {
+ /** @type {tcuRGBA.RGBA} */ var threshold = tcuRGBA.newRGBAComponents(this.m_maxDiffRed, this.m_maxDiffGreen, this.m_maxDiffBlue, 255);
+ /** @type {tcuSurface.Surface} */ var error = new tcuSurface.Surface(ref.getWidth(), ref.getHeight());
+
+ this.m_isOk = true;
+
+ for (var y = 1; y < ref.getHeight() - 1; y++) {
+ for (var x = 1; x < ref.getWidth() - 1; x++) {
+ /** @type {tcuRGBA.RGBA} */ var refPixel = tcuRGBA.newRGBAFromArray(ref.getPixel(x, y));
+ /** @type {tcuRGBA.RGBA} */ var screenPixel = tcuRGBA.newRGBAFromArray(screen.getPixel(x, y));
+ /** @type {boolean} */ var isOkPixel = false;
+
+ // Don't do comparisons for this pixel if it belongs to a one-pixel-thin part (i.e. it doesn't have similar-color neighbors in both x and y directions) in both result and reference.
+ // This fixes some false negatives.
+ /** @type {boolean} */ var refThin = (
+ !tcuRGBA.compareThreshold(refPixel, tcuRGBA.newRGBAFromArray(ref.getPixel(x - 1, y)), threshold) &&
+ !tcuRGBA.compareThreshold(refPixel, tcuRGBA.newRGBAFromArray(ref.getPixel(x + 1, y)), threshold)
+ ) || (
+ !tcuRGBA.compareThreshold(refPixel, tcuRGBA.newRGBAFromArray(ref.getPixel(x, y - 1)), threshold) &&
+ !tcuRGBA.compareThreshold(refPixel, tcuRGBA.newRGBAFromArray(ref.getPixel(x, y + 1)), threshold)
+ );
+
+ /** @type {boolean} */ var screenThin = (
+ !tcuRGBA.compareThreshold(screenPixel, tcuRGBA.newRGBAFromArray(screen.getPixel(x - 1, y)), threshold) &&
+ !tcuRGBA.compareThreshold(screenPixel, tcuRGBA.newRGBAFromArray(screen.getPixel(x + 1, y)), threshold)
+ ) || (
+ !tcuRGBA.compareThreshold(screenPixel, tcuRGBA.newRGBAFromArray(screen.getPixel(x, y - 1)), threshold) &&
+ !tcuRGBA.compareThreshold(screenPixel, tcuRGBA.newRGBAFromArray(screen.getPixel(x, y + 1)), threshold)
+ );
+
+ if (refThin && screenThin)
+ isOkPixel = true;
+ else {
+ //NOTE: This will ignore lines less than three pixels wide, so
+ //even if there's a difference, the test will pass.
+ for (var dy = -1; dy < 2 && !isOkPixel; dy++) {
+ for (var dx = -1; dx < 2 && !isOkPixel; dx++) {
+ // Check reference pixel against screen pixel
+ /** @type {tcuRGBA.RGBA} */ var screenCmpPixel = tcuRGBA.newRGBAFromArray(screen.getPixel(x + dx, y + dy));
+ /** @type {number} (8-bit) */ var r = Math.abs(refPixel.getRed() - screenCmpPixel.getRed());
+ /** @type {number} (8-bit) */ var g = Math.abs(refPixel.getGreen() - screenCmpPixel.getGreen());
+ /** @type {number} (8-bit) */ var b = Math.abs(refPixel.getBlue() - screenCmpPixel.getBlue());
+
+ if (r <= this.m_maxDiffRed && g <= this.m_maxDiffGreen && b <= this.m_maxDiffBlue)
+ isOkPixel = true;
+
+ // Check screen pixels against reference pixel
+ /** @type {tcuRGBA.RGBA} */ var refCmpPixel = tcuRGBA.newRGBAFromArray(ref.getPixel(x + dx, y + dy));
+ r = Math.abs(refCmpPixel.getRed() - screenPixel.getRed());
+ g = Math.abs(refCmpPixel.getGreen() - screenPixel.getGreen());
+ b = Math.abs(refCmpPixel.getBlue() - screenPixel.getBlue());
+
+ if (r <= this.m_maxDiffRed && g <= this.m_maxDiffGreen && b <= this.m_maxDiffBlue)
+ isOkPixel = true;
+ }
+ }
+ }
+
+ if (isOkPixel)
+ error.setPixel(x, y,
+ [tcuRGBA.newRGBAFromArray(screen.getPixel(x, y)).getRed(),
+ (tcuRGBA.newRGBAFromArray(screen.getPixel(x, y)).getGreen() + 255) / 2,
+ tcuRGBA.newRGBAFromArray(screen.getPixel(x, y)).getBlue(), 255]
+ );
+ else {
+ error.setPixel(x, y, [255, 0, 0, 255]);
+ this.m_isOk = false;
+ }
+ }
+ }
+
+ if (!this.m_isOk) {
+ debug('Image comparison failed, threshold = (' + this.m_maxDiffRed + ', ' + this.m_maxDiffGreen + ', ' + this.m_maxDiffBlue + ')');
+ //log << TestLog::ImageSet("Compare result", "Result of rendering");
+ tcuImageCompare.displayImages(screen.getAccess(), ref.getAccess(), error.getAccess());
+ } else {
+ //log << TestLog::ImageSet("Compare result", "Result of rendering")
+ tcuLogImage.logImage('Result', '', screen.getAccess());
+ }
+ }
+ };
+
+ //TODO: Is this actually used? -> glsVertexArrayTests.VertexArrayTest& operator= (const glsVertexArrayTests.VertexArrayTest& other);
+
+ /**
+ * glsVertexArrayTests.MultiVertexArrayTest class
+ * @constructor
+ * @extends {glsVertexArrayTests.VertexArrayTest}
+ * @param {glsVertexArrayTests.MultiVertexArrayTest.Spec} spec
+ * @param {string} name
+ * @param {string} desc
+ */
+ glsVertexArrayTests.MultiVertexArrayTest = function(spec, name, desc) {
+ glsVertexArrayTests.VertexArrayTest.call(this, name, desc);
+
+ /** @type {glsVertexArrayTests.MultiVertexArrayTest.Spec} */ this.m_spec = spec;
+ /** @type {number} */ this.m_iteration = 0;
+ };
+
+ glsVertexArrayTests.MultiVertexArrayTest.prototype = Object.create(glsVertexArrayTests.VertexArrayTest.prototype);
+ glsVertexArrayTests.MultiVertexArrayTest.prototype.constructor = glsVertexArrayTests.MultiVertexArrayTest;
+
+ /**
+ * glsVertexArrayTests.MultiVertexArrayTest.Spec class
+ * @constructor
+ */
+ glsVertexArrayTests.MultiVertexArrayTest.Spec = function() {
+ /** @type {glsVertexArrayTests.deArray.Primitive} */ this.primitive;
+ /** @type {number} */ this.drawCount = 0;
+ /** @type {number} */ this.first = 0;
+ /** @type {Array<glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec>} */ this.arrays = [];
+ };
+
+ /**
+ * glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec class
+ * @constructor
+ * @param {glsVertexArrayTests.deArray.InputType} inputType_
+ * @param {glsVertexArrayTests.deArray.OutputType} outputType_
+ * @param {glsVertexArrayTests.deArray.Storage} storage_
+ * @param {glsVertexArrayTests.deArray.Usage} usage_
+ * @param {number} componentCount_
+ * @param {number} offset_
+ * @param {number} stride_
+ * @param {boolean} normalize_
+ * @param {glsVertexArrayTests.GLValue} min_
+ * @param {glsVertexArrayTests.GLValue} max_
+ */
+ glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec = function(inputType_, outputType_, storage_, usage_, componentCount_, offset_, stride_, normalize_, min_, max_) {
+ this.inputType = inputType_;
+ this.outputType = outputType_;
+ this.storage = storage_;
+ this.usage = usage_;
+ this.componentCount = componentCount_;
+ this.offset = offset_;
+ /** @type {number} */ this.stride = stride_;
+ this.normalize = normalize_;
+ this.min = min_;
+ this.max = max_;
+ };
+
+ /**
+ * getName
+ * @return {string}
+ */
+ glsVertexArrayTests.MultiVertexArrayTest.Spec.prototype.getName = function() {
+ var name = '';
+
+ for (var ndx = 0; ndx < this.arrays.length; ++ndx) {
+ /** @type {glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec} */ var array = this.arrays[ndx];
+
+ if (this.arrays.length > 1)
+ name += 'array' + ndx + '_';
+
+ name += glsVertexArrayTests.deArray.storageToString(array.storage) + '_' +
+ array.offset + '_' +
+ array.stride + '_' +
+ glsVertexArrayTests.deArray.inputTypeToString(array.inputType);
+
+ if (array.inputType != glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10 && array.inputType != glsVertexArrayTests.deArray.InputType.INT_2_10_10_10)
+ name += array.componentCount;
+ name += '_' +
+ (array.normalize ? 'normalized_' : '') +
+ glsVertexArrayTests.deArray.outputTypeToString(array.outputType) + '_' +
+ glsVertexArrayTests.deArray.usageTypeToString(array.usage) + '_';
+ }
+
+ if (this.first)
+ name += 'first' + this.first + '_';
+
+ switch (this.primitive) {
+ case glsVertexArrayTests.deArray.Primitive.TRIANGLES:
+ name += 'quads_';
+ break;
+ case glsVertexArrayTests.deArray.Primitive.POINTS:
+ name += 'points_';
+ break;
+
+ default:
+ throw new Error('glsVertexArrayTests.MultiVertexArrayTest.Spec.getName - Invalid primitive type');
+ break;
+ }
+
+ name += this.drawCount;
+
+ return name;
+ };
+
+ /**
+ * getName
+ * @return {string}
+ */
+ glsVertexArrayTests.MultiVertexArrayTest.Spec.prototype.getDesc = function() {
+ var desc = '';
+
+ for (var ndx = 0; ndx < this.arrays.length; ++ndx) {
+ /** @type {glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec} */ var array = this.arrays[ndx];
+
+ desc += 'Array ' + ndx + ': ' +
+ 'Storage in ' + glsVertexArrayTests.deArray.storageToString(array.storage) + ', ' +
+ 'stride ' + array.stride + ', ' +
+ 'input datatype ' + glsVertexArrayTests.deArray.inputTypeToString(array.inputType) + ', ' +
+ 'input component count ' + array.componentCount + ', ' +
+ (array.normalize ? 'normalized, ' : '') +
+ 'used as ' + glsVertexArrayTests.deArray.outputTypeToString(array.outputType) + ', ';
+ }
+
+ desc += 'drawArrays(), ' +
+ 'first ' + this.first + ', ' +
+ this.drawCount;
+
+ switch (this.primitive) {
+ case glsVertexArrayTests.deArray.Primitive.TRIANGLES:
+ desc += 'quads ';
+ break;
+ case glsVertexArrayTests.deArray.Primitive.POINTS:
+ desc += 'points';
+ break;
+
+ default:
+ throw new Error('glsVertexArrayTests.MultiVertexArrayTest.Spec.getDesc - Invalid primitive type');
+ break;
+ }
+
+ return desc;
+ };
+
+ /**
+ * iterate
+ * @return {tcuTestCase.IterateResult}
+ */
+ glsVertexArrayTests.MultiVertexArrayTest.prototype.iterate = function() {
+ if (this.m_iteration == 0) {
+ var primitiveSize = (this.m_spec.primitive == glsVertexArrayTests.deArray.Primitive.TRIANGLES) ? (6) : (1); // in non-indexed draw Triangles means rectangles
+ var coordScale = 1.0;
+ var colorScale = 1.0;
+ var useVao = true; // WebGL, WebGL 2.0 - gl.getType().getProfile() == glu::PROFILE_CORE;
+
+ // Log info
+ bufferedLogToConsole(this.m_spec.getDesc());
+
+ // Color and Coord scale
+
+ // First array is always position
+ /** @type {glsVertexArrayTests.MultiVertexArrayTest.Spec.ArraySpec} */ var arraySpec = this.m_spec.arrays[0];
+ if (arraySpec.inputType == glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10) {
+ if (arraySpec.normalize)
+ coordScale = 1;
+ else
+ coordScale = 1 / 1024;
+ } else if (arraySpec.inputType == glsVertexArrayTests.deArray.InputType.INT_2_10_10_10) {
+ if (arraySpec.normalize)
+ coordScale = 1.0;
+ else
+ coordScale = 1.0 / 512.0;
+ } else
+ coordScale = arraySpec.normalize && !glsVertexArrayTests.inputTypeIsFloatType(arraySpec.inputType) ? 1.0 : 0.9 / arraySpec.max.toFloat();
+
+ if (arraySpec.outputType == glsVertexArrayTests.deArray.OutputType.VEC3 || arraySpec.outputType == glsVertexArrayTests.deArray.OutputType.VEC4 ||
+ arraySpec.outputType == glsVertexArrayTests.deArray.OutputType.IVEC3 || arraySpec.outputType == glsVertexArrayTests.deArray.OutputType.IVEC4 ||
+ arraySpec.outputType == glsVertexArrayTests.deArray.OutputType.UVEC3 || arraySpec.outputType == glsVertexArrayTests.deArray.OutputType.UVEC4)
+ coordScale = coordScale * 0.5;
+
+ // And other arrays are color-like
+ for (var arrayNdx = 1; arrayNdx < this.m_spec.arrays.length; arrayNdx++) {
+ arraySpec = this.m_spec.arrays[arrayNdx];
+
+ colorScale *= (arraySpec.normalize && !glsVertexArrayTests.inputTypeIsFloatType(arraySpec.inputType) ? 1.0 : 1.0 / arraySpec.max.toFloat());
+ if (arraySpec.outputType == glsVertexArrayTests.deArray.OutputType.VEC4)
+ colorScale *= (arraySpec.normalize && !glsVertexArrayTests.inputTypeIsFloatType(arraySpec.inputType) ? 1.0 : 1.0 / arraySpec.max.toFloat());
+ }
+
+ // Data
+
+ for (var arrayNdx = 0; arrayNdx < this.m_spec.arrays.length; arrayNdx++) {
+ arraySpec = this.m_spec.arrays[arrayNdx];
+ /** @type {number} */ var seed = arraySpec.inputType + 10 * arraySpec.outputType + 100 * arraySpec.storage + 1000 * this.m_spec.primitive + 10000 * arraySpec.usage + this.m_spec.drawCount + 12 * arraySpec.componentCount + arraySpec.stride + arraySpec.normalize;
+ /** @type {ArrayBuffer} */ var data = null;
+ /** @type {number} */ var stride = arraySpec.stride == 0 ? arraySpec.componentCount * glsVertexArrayTests.deArray.inputTypeSize(arraySpec.inputType) : arraySpec.stride;
+ /** @type {number} */ var bufferSize = arraySpec.offset + stride * (this.m_spec.drawCount * primitiveSize - 1) + arraySpec.componentCount * glsVertexArrayTests.deArray.inputTypeSize(arraySpec.inputType);
+
+ switch (this.m_spec.primitive) {
+ // case glsVertexArrayTests.deArray.Primitive.POINTS:
+ // data = glsVertexArrayTests.RandomArrayGenerator.generateArray(seed, arraySpec.min, arraySpec.max, arraySpec.count, arraySpec.componentCount, arraySpec.stride, arraySpec.inputType);
+ // break;
+ case glsVertexArrayTests.deArray.Primitive.TRIANGLES:
+ if (arrayNdx == 0) {
+ data = glsVertexArrayTests.RandomArrayGenerator.generateQuads(seed, this.m_spec.drawCount, arraySpec.componentCount, arraySpec.offset, arraySpec.stride, this.m_spec.primitive, arraySpec.inputType, arraySpec.min, arraySpec.max, coordScale);
+ } else {
+ DE_ASSERT(arraySpec.offset == 0); // \note [jarkko] it just hasn't been implemented
+ data = glsVertexArrayTests.RandomArrayGenerator.generatePerQuad(seed, this.m_spec.drawCount, arraySpec.componentCount, arraySpec.stride, this.m_spec.primitive, arraySpec.inputType, arraySpec.min, arraySpec.max);
+ }
+ break;
+
+ default:
+ throw new Error('glsVertexArrayTests.MultiVertexArrayTest.prototype.iterate - Invalid primitive type');
+ break;
+ }
+
+ this.m_glArrayPack.newArray(arraySpec.storage);
+ this.m_rrArrayPack.newArray(arraySpec.storage);
+
+ this.m_glArrayPack.getArray(arrayNdx).data(glsVertexArrayTests.deArray.Target.ARRAY, bufferSize, new Uint8Array(data), arraySpec.usage);
+ this.m_rrArrayPack.getArray(arrayNdx).data(glsVertexArrayTests.deArray.Target.ARRAY, bufferSize, new Uint8Array(data), arraySpec.usage);
+
+ this.m_glArrayPack.getArray(arrayNdx).bind(arrayNdx, arraySpec.offset, arraySpec.componentCount, arraySpec.inputType, arraySpec.outputType, arraySpec.normalize, arraySpec.stride);
+ this.m_rrArrayPack.getArray(arrayNdx).bind(arrayNdx, arraySpec.offset, arraySpec.componentCount, arraySpec.inputType, arraySpec.outputType, arraySpec.normalize, arraySpec.stride);
+ }
+
+ try {
+ this.m_glArrayPack.render(this.m_spec.primitive, this.m_spec.first, this.m_spec.drawCount * primitiveSize, useVao, coordScale, colorScale);
+ this.m_rrArrayPack.render(this.m_spec.primitive, this.m_spec.first, this.m_spec.drawCount * primitiveSize, useVao, coordScale, colorScale);
+ }
+ catch (err) {
+ // GL Errors are ok if the mode is not properly aligned
+
+ bufferedLogToConsole('Got error: ' + err.message);
+
+ if (this.isUnalignedBufferOffsetTest())
+ testFailedOptions('Failed to draw with unaligned buffers', false); // TODO: QP_TEST_RESULT_COMPATIBILITY_WARNING
+ else if (this.isUnalignedBufferStrideTest())
+ testFailedOptions('Failed to draw with unaligned stride', false); // QP_TEST_RESULT_COMPATIBILITY_WARNING
+ else
+ throw new Error(err.message);
+
+ return tcuTestCase.IterateResult.STOP;
+ }
+
+ this.m_iteration++;
+ return tcuTestCase.IterateResult.CONTINUE;
+ } else if (this.m_iteration == 1) {
+ this.compare();
+
+ if (this.m_isOk) {
+ testPassedOptions('', true);
+ } else {
+ if (this.isUnalignedBufferOffsetTest())
+ testFailedOptions('Failed to draw with unaligned buffers', false); // QP_TEST_RESULT_COMPATIBILITY_WARNING
+ else if (this.isUnalignedBufferStrideTest())
+ testFailedOptions('Failed to draw with unaligned stride', false); // QP_TEST_RESULT_COMPATIBILITY_WARNING
+ else
+ testFailedOptions('Image comparison failed', false);
+ }
+
+ this.m_iteration++;
+ return tcuTestCase.IterateResult.STOP;
+ } else {
+ testFailedOptions('glsVertexArrayTests.MultiVertexArrayTest.iterate - Invalid iteration stage', false);
+ return tcuTestCase.IterateResult.STOP;
+ }
+ };
+
+ /**
+ * isUnalignedBufferOffsetTest
+ * @return {boolean}
+ */
+ glsVertexArrayTests.MultiVertexArrayTest.prototype.isUnalignedBufferOffsetTest = function() {
+ // Buffer offsets should be data type size aligned
+ for (var i = 0; i < this.m_spec.arrays.length; ++i) {
+ if (this.m_spec.arrays[i].storage == glsVertexArrayTests.deArray.Storage.BUFFER) {
+ /** @type {boolean} */ var inputTypePacked = this.m_spec.arrays[i].inputType == glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10 || this.m_spec.arrays[i].inputType == glsVertexArrayTests.deArray.InputType.INT_2_10_10_10;
+
+ /** @type {number} */ var dataTypeSize = glsVertexArrayTests.deArray.inputTypeSize(this.m_spec.arrays[i].inputType);
+ if (inputTypePacked)
+ dataTypeSize = 4;
+
+ if (this.m_spec.arrays[i].offset % dataTypeSize != 0)
+ return true;
+ }
+ }
+ return false;
+ };
+
+ /**
+ * isUnalignedBufferStrideTest
+ * @return {boolean}
+ */
+ glsVertexArrayTests.MultiVertexArrayTest.prototype.isUnalignedBufferStrideTest = function() {
+ // Buffer strides should be data type size aligned
+ for (var i = 0; i < this.m_spec.arrays.length; ++i) {
+ if (this.m_spec.arrays[i].storage == glsVertexArrayTests.deArray.Storage.BUFFER) {
+ /** @type {boolean} */ var inputTypePacked = this.m_spec.arrays[i].inputType == glsVertexArrayTests.deArray.InputType.UNSIGNED_INT_2_10_10_10 || this.m_spec.arrays[i].inputType == glsVertexArrayTests.deArray.InputType.INT_2_10_10_10;
+
+ /** @type {number} */ var dataTypeSize = glsVertexArrayTests.deArray.inputTypeSize(this.m_spec.arrays[i].inputType);
+ if (inputTypePacked)
+ dataTypeSize = 4;
+
+ if (this.m_spec.arrays[i].stride % dataTypeSize != 0)
+ return true;
+ }
+ }
+ return false;
+ };
+
+});
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/run-closure.sh b/dom/canvas/test/webgl-conf/checkout/deqp/run-closure.sh
new file mode 100755
index 0000000000..7dcc44c12c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/run-closure.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# Helper script for properly invoking the closure compiler in order to
+# type check the ported dEQP tests.
+#
+# Assumes the Closure compiler:
+# https://github.com/google/closure-compiler
+# is installed side-by-side with the WebGL repository, for example:
+#
+# WebGL/
+# doc/
+# extensions/
+# sdk/
+# ...
+# closure/
+# compiler.jar
+#
+# The externs.zip file inside the closure compiler needs to be modified
+# to support WebGL2.
+# and that the shell is cd'd into the directory containing this
+# script.
+#
+
+: ${JAVA:=java}
+
+$JAVA -jar ../../../../closure/compiler.jar --compilation_level ADVANCED_OPTIMIZATIONS --warning_level VERBOSE --externs compiler_additional_extern.js --js functional/**.js framework/**.js modules/**.js --js_output_file /dev/null --js ../closure-library/closure/**.js
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/chrome.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/chrome.js
new file mode 100644
index 0000000000..7cd036f1f9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/chrome.js
@@ -0,0 +1,156 @@
+/*
+ * Copyright 2013 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for globals in Chrome. This file describes the
+ * externs API for the chrome.* object when running in a normal browser
+ * context. For APIs available in Chrome Extensions, see chrome_extensions.js
+ * in this directory.
+ * @externs
+ */
+
+
+/**
+ * namespace
+ * @const
+ */
+var chrome = {};
+
+
+
+/**
+ * Returns an object representing current load times. Note that the properties
+ * on the object do not change and the function must be called again to get
+ * up-to-date data.
+ *
+ * @see http://goto.google.com/chromeloadtimesextension
+ *
+ * @return {!ChromeLoadTimes}
+ */
+chrome.loadTimes = function() {};
+
+
+
+/**
+ * The data object given by chrome.loadTimes().
+ * @constructor
+ */
+function ChromeLoadTimes() {}
+
+
+/** @type {number} */
+ChromeLoadTimes.prototype.requestTime;
+
+
+/** @type {number} */
+ChromeLoadTimes.prototype.startLoadTime;
+
+
+/** @type {number} */
+ChromeLoadTimes.prototype.commitLoadTime;
+
+
+/** @type {number} */
+ChromeLoadTimes.prototype.finishDocumentLoadTime;
+
+
+/** @type {number} */
+ChromeLoadTimes.prototype.finishLoadTime;
+
+
+/** @type {number} */
+ChromeLoadTimes.prototype.firstPaintTime;
+
+
+/** @type {number} */
+ChromeLoadTimes.prototype.firstPaintAfterLoadTime;
+
+
+/** @type {number} */
+ChromeLoadTimes.prototype.navigationType;
+
+
+/**
+ * True iff the resource was fetched over SPDY.
+ * @type {boolean}
+ */
+ChromeLoadTimes.prototype.wasFetchedViaSpdy;
+
+
+/** @type {boolean} */
+ChromeLoadTimes.prototype.wasNpnNegotiated;
+
+
+/** @type {string} */
+ChromeLoadTimes.prototype.npnNegotiatedProtocol;
+
+
+/** @type {boolean} */
+ChromeLoadTimes.prototype.wasAlternateProtocolAvailable;
+
+
+/** @type {string} */
+ChromeLoadTimes.prototype.connectionInfo;
+
+
+/**
+ * Returns an object containing timing information.
+ * @return {!ChromeCsiInfo}
+ */
+chrome.csi = function() {};
+
+
+
+/**
+ * The data object given by chrome.csi().
+ * @constructor
+ */
+function ChromeCsiInfo() {}
+
+
+/**
+ * Same as chrome.loadTimes().requestTime, if defined.
+ * Otherwise, gives the same value as chrome.loadTimes().startLoadTime.
+ * In milliseconds, truncated.
+ * @type {number}
+ */
+ChromeCsiInfo.prototype.startE;
+
+
+/**
+ * Same as chrome.loadTimes().finishDocumentLoadTime but in milliseconds and
+ * truncated.
+ * @type {number}
+ */
+ChromeCsiInfo.prototype.onloadT;
+
+
+/**
+ * The time since startE in milliseconds.
+ * @type {number}
+ */
+ChromeCsiInfo.prototype.pageT;
+
+
+/** @type {number} */
+ChromeCsiInfo.prototype.tran;
+
+
+/**
+ * @param {string|!ArrayBuffer|!Object} message
+ * @see https://developers.google.com/native-client/devguide/tutorial
+ */
+HTMLEmbedElement.prototype.postMessage = function(message) {};
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/deprecated.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/deprecated.js
new file mode 100644
index 0000000000..9dcf947c9d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/deprecated.js
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2008 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview JavaScript Built-Ins that are not
+ * part of any specifications but are
+ * still needed in some project's build.
+ * @externs
+ *
+ */
+
+// Do we need an opera.js?
+var opera;
+Window.prototype.opera;
+Window.prototype.opera.postError;
+
+/** @constructor */ function XSLTProcessor() {}
+/**
+ * @param {*=} opt_text
+ * @param {*=} opt_value
+ * @param {*=} opt_defaultSelected
+ * @param {*=} opt_selected
+ * @constructor
+ * @extends {Element}
+ */
+function Option(opt_text, opt_value, opt_defaultSelected, opt_selected) {}
+
+
+// The "methods" object is a place to hang arbitrary external
+// properties. It is a throwback to pre-typed days, and should
+// not be used for any new definitions; it exists only to bridge
+// the gap between the old way and the new way.
+var methods = {};
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es3.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es3.js
new file mode 100644
index 0000000000..934b1fe2b7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es3.js
@@ -0,0 +1,2236 @@
+/*
+ * Copyright 2008 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview ECMAScript 3 Built-Ins. This include common extensions so this
+ * is actually ES3+Reality.
+ * @externs
+ * @author stevey@google.com (Steve Yegge)
+ * @author nicksantos@google.com (Nick Santos)
+ * @author arv@google.com (Erik Arvidsson)
+ * @author johnlenz@google.com (John Lenz)
+ */
+
+
+// These built-ins are still needed for compilation.
+
+/**
+ * @constructor
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Functions_and_function_scope/arguments
+ */
+function Arguments() {}
+
+/**
+ * @type {Function}
+ * @see http://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Functions_and_function_scope/arguments/callee
+ */
+Arguments.prototype.callee;
+
+/**
+ * Use the non-standard {@see Function.prototype.caller} property of a function
+ * object instead.
+ * @type {Function}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Functions/arguments/caller
+ * @deprecated
+ */
+Arguments.prototype.caller;
+
+/**
+ * @type {number}
+ * @see http://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Functions_and_function_scope/arguments/length
+ */
+Arguments.prototype.length;
+
+/**
+ * @type {!Arguments}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Functions_and_function_scope/arguments
+ */
+var arguments;
+
+/**
+ * @type {number}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Properties/Infinity
+ * @const
+ */
+var Infinity;
+
+/**
+ * @type {number}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Properties/NaN
+ * @const
+ */
+var NaN;
+
+/**
+ * @type {undefined}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Properties/undefined
+ * @const
+ */
+var undefined;
+
+/**
+ * @param {string} uri
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Functions/decodeURI
+ */
+function decodeURI(uri) {}
+
+/**
+ * @param {string} uri
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Functions/decodeURIComponent
+ */
+function decodeURIComponent(uri) {}
+
+/**
+ * @param {string} uri
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Functions/encodeURI
+ */
+function encodeURI(uri) {}
+
+/**
+ * @param {string} uri
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Functions/encodeURIComponent
+ */
+function encodeURIComponent(uri) {}
+
+/**
+ * Should only be used in browsers where encode/decodeURIComponent
+ * are not present, as the latter handle fancy Unicode characters.
+ * @param {string} str
+ * @return {string}
+ * @nosideeffects
+ * @see https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Predefined_Functions/escape_and_unescape_Functions
+ */
+function escape(str) {}
+
+/**
+ * Should only be used in browsers where encode/decodeURIComponent
+ * are not present, as the latter handle fancy Unicode characters.
+ * @param {string} str
+ * @return {string}
+ * @nosideeffects
+ * @see https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Predefined_Functions/escape_and_unescape_Functions
+ */
+function unescape(str) {}
+
+/**
+ * @param {*} num
+ * @return {boolean}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Functions/isFinite
+ */
+function isFinite(num) {}
+
+/**
+ * @param {*} num
+ * @return {boolean}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Functions/isNaN
+ */
+function isNaN(num) {}
+
+/**
+ * @param {*} num
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Functions/parseFloat
+ */
+function parseFloat(num) {}
+
+/**
+ * Parse an integer. Use of {@code parseInt} without {@code base} is strictly
+ * banned in Google. If you really want to parse octal or hex based on the
+ * leader, then pass {@code undefined} as the base.
+ *
+ * @param {*} num
+ * @param {number|undefined} base
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Functions/parseInt
+ */
+function parseInt(num, base) {}
+
+/**
+ * @param {string} code
+ * @return {*}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Functions/eval
+ */
+function eval(code) {}
+
+/**
+ * @constructor
+ * @param {*=} opt_value
+ * @return {!Object}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object
+ */
+function Object(opt_value) {}
+
+/**
+ * The constructor of the current object.
+ * @type {Function}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/constructor
+ */
+Object.prototype.constructor = function() {};
+
+/**
+ * Binds an object's property to a function to be called when that property is
+ * looked up.
+ * Mozilla-only.
+ *
+ * @param {string} sprop
+ * @param {Function} fun
+ * @modifies {this}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/defineGetter
+ */
+Object.prototype.__defineGetter__ = function(sprop, fun) {};
+
+/**
+ * Binds an object's property to a function to be called when an attempt is made
+ * to set that property.
+ * Mozilla-only.
+ *
+ * @param {string} sprop
+ * @param {Function} fun
+ * @modifies {this}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/defineSetter
+ */
+Object.prototype.__defineSetter__ = function(sprop, fun) {};
+
+/**
+ * Returns whether the object has a property with the specified name.
+ *
+ * @param {*} propertyName Implicitly cast to a string.
+ * @return {boolean}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/hasOwnProperty
+ */
+Object.prototype.hasOwnProperty = function(propertyName) {};
+
+/**
+ * Returns whether an object exists in another object's prototype chain.
+ *
+ * @param {Object} other
+ * @return {boolean}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/isPrototypeOf
+ */
+Object.prototype.isPrototypeOf = function(other) {};
+
+/**
+ * Return the function bound as a getter to the specified property.
+ * Mozilla-only.
+ *
+ * @param {string} sprop a string containing the name of the property whose
+ * getter should be returned
+ * @return {Function}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/lookupGetter
+ */
+Object.prototype.__lookupGetter__ = function(sprop) {};
+
+/**
+ * Return the function bound as a setter to the specified property.
+ * Mozilla-only.
+ *
+ * @param {string} sprop a string containing the name of the property whose
+ * setter should be returned.
+ * @return {Function}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/lookupSetter
+ */
+Object.prototype.__lookupSetter__ = function(sprop) {};
+
+/**
+ * Executes a function when a non-existent method is called on an object.
+ * Mozilla-only.
+ *
+ * @param {Function} fun
+ * @return {*}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/noSuchMethod
+ */
+Object.prototype.__noSuchMethod__ = function(fun) {};
+
+/**
+ * Points to an object's context. For top-level objects, this is the e.g. window.
+ * Mozilla-only.
+ *
+ * @type {Object}
+ * @deprecated
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/parent
+ */
+Object.prototype.__parent__;
+
+/**
+ * Points to the object which was used as prototype when the object was instantiated.
+ * Mozilla-only.
+ *
+ * Will be null on Object.prototype.
+ *
+ * @type {Object}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/proto
+ */
+Object.prototype.__proto__;
+
+/**
+ * Determine whether the specified property in an object can be enumerated by a
+ * for..in loop, with the exception of properties inherited through the
+ * prototype chain.
+ *
+ * @param {string} propertyName
+ * @return {boolean}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/propertyIsEnumerable
+ */
+Object.prototype.propertyIsEnumerable = function(propertyName) {};
+
+/**
+ * Returns a localized string representing the object.
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/toLocaleString
+ */
+Object.prototype.toLocaleString = function() {};
+
+/**
+ * Returns a string representing the source code of the object.
+ * Mozilla-only.
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/toSource
+ */
+Object.prototype.toSource = function() {};
+
+/**
+ * Returns a string representing the object.
+ * @this {*}
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/toString
+ */
+Object.prototype.toString = function() {};
+
+/**
+ * Removes a watchpoint set with the {@see Object.prototype.watch} method.
+ * Mozilla-only.
+ * @param {string} prop The name of a property of the object.
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/unwatch
+ */
+Object.prototype.unwatch = function(prop) {};
+
+/**
+ * Returns the object's {@code this} value.
+ * @return {*}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/valueOf
+ */
+Object.prototype.valueOf = function() {};
+
+/**
+ * Sets a watchpoint method.
+ * Mozilla-only.
+ * @param {string} prop The name of a property of the object.
+ * @param {Function} handler A function to call.
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/watch
+ */
+Object.prototype.watch = function(prop, handler) {};
+
+
+/**
+ * @constructor
+ * @param {...*} var_args
+ * @nosideeffects
+ * @throws {Error}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function
+ */
+function Function(var_args) {}
+
+/**
+ * @param {...*} var_args
+ * @return {*}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function/call
+ */
+Function.prototype.call = function(var_args) {};
+
+/**
+ * @param {...*} var_args
+ * @return {*}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function/apply
+ */
+Function.prototype.apply = function(var_args) {};
+
+Function.prototype.arguments;
+
+/**
+ * @type {number}
+ * @deprecated
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function/arity
+ */
+Function.prototype.arity;
+
+/**
+ * Nonstandard; Mozilla and JScript only.
+ * @type {Function}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function/caller
+ */
+Function.prototype.caller;
+
+/**
+ * Nonstandard.
+ * @type {?}
+ * @see http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/displayName
+ */
+Function.prototype.displayName;
+
+/**
+ * Expected number of arguments.
+ * @type {number}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function/length
+ */
+Function.prototype.length;
+
+/**
+ * @type {string}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function/name
+ */
+Function.prototype.name;
+
+/**
+ * @this {Function}
+ * @return {string}
+ * @nosideeffects
+ * @override
+ */
+Function.prototype.toString = function() {};
+
+
+/**
+ * @constructor
+ * @param {...*} var_args
+ * @return {!Array.<?>}
+ * @nosideeffects
+ * @template T
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array
+ */
+function Array(var_args) {}
+
+// Functions:
+
+/**
+ * Returns a new array comprised of this array joined with other array(s)
+ * and/or value(s).
+ *
+ * @param {...*} var_args
+ * @return {!Array.<?>}
+ * @this {*}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/concat
+ */
+Array.prototype.concat = function(var_args) {};
+
+/**
+ * Joins all elements of an array into a string.
+ *
+ * @param {*=} opt_separator Specifies a string to separate each element of the
+ * array. The separator is converted to a string if necessary. If omitted,
+ * the array elements are separated with a comma.
+ * @return {string}
+ * @this {{length: number}|string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/join
+ */
+Array.prototype.join = function(opt_separator) {};
+
+/**
+ * Removes the last element from an array and returns that element.
+ *
+ * @return {T}
+ * @this {{length: number}|Array.<T>}
+ * @modifies {this}
+ * @template T
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/pop
+ */
+Array.prototype.pop = function() {};
+
+/**
+ * Mutates an array by appending the given elements and returning the new
+ * length of the array.
+ *
+ * @param {...T} var_args
+ * @return {number} The new length of the array.
+ * @this {{length: number}|Array.<T>}
+ * @template T
+ * @modifies {this}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/push
+ */
+Array.prototype.push = function(var_args) {};
+
+/**
+ * Transposes the elements of an array in place: the first array element becomes the
+ * last and the last becomes the first.
+ *
+ * @this {{length: number}}
+ * @modifies {this}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/reverse
+ */
+Array.prototype.reverse = function() {};
+
+/**
+ * Removes the first element from an array and returns that element. This
+ * method changes the length of the array.
+ *
+ * @this {{length: number}|Array.<T>}
+ * @modifies {this}
+ * @return {T}
+ * @template T
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/shift
+ */
+Array.prototype.shift = function() {};
+
+/**
+ * Extracts a section of an array and returns a new array.
+ *
+ * @param {*=} opt_begin Zero-based index at which to begin extraction. A
+ * non-number type will be auto-cast by the browser to a number.
+ * @param {*=} opt_end Zero-based index at which to end extraction. slice
+ * extracts up to but not including end.
+ * @return {!Array.<T>}
+ * @this {{length: number}|Array.<T>|string}
+ * @template T
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/slice
+ */
+Array.prototype.slice = function(opt_begin, opt_end) {};
+
+/**
+ * Sorts the elements of an array in place.
+ *
+ * @param {function(T,T):number=} opt_compareFunction Specifies a function that
+ * defines the sort order.
+ * @this {{length: number}|Array.<T>}
+ * @template T
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/sort
+ */
+Array.prototype.sort = function(opt_compareFunction) {};
+
+/**
+ * Changes the content of an array, adding new elements while removing old
+ * elements.
+ *
+ * @param {*=} opt_index Index at which to start changing the array. If negative,
+ * will begin that many elements from the end. A non-number type will be
+ * auto-cast by the browser to a number.
+ * @param {*=} opt_howMany An integer indicating the number of old array elements
+ * to remove.
+ * @param {...T} var_args
+ * @return {!Array.<T>}
+ * @this {{length: number}|Array.<T>}
+ * @modifies {this}
+ * @template T
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/splice
+ */
+Array.prototype.splice = function(opt_index, opt_howMany, var_args) {};
+
+/**
+ * @return {string}
+ * @this {Object}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/toSource
+ */
+Array.prototype.toSource;
+
+/**
+ * @this {Array.<?>}
+ * @return {string}
+ * @nosideeffects
+ * @override
+ */
+Array.prototype.toString = function() {};
+
+/**
+ * Adds one or more elements to the beginning of an array and returns the new
+ * length of the array.
+ *
+ * @param {...*} var_args
+ * @return {number} The new length of the array
+ * @this {{length: number}}
+ * @modifies {this}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/unshift
+ */
+Array.prototype.unshift = function(var_args) {};
+
+/**
+ * Apply a function simultaneously against two values of the array (from
+ * left-to-right) as to reduce it to a single value.
+ *
+ * @param {?function(?, T, number, !Array.<T>) : R} callback
+ * @param {*=} opt_initialValue
+ * @return {R}
+ * @this {{length: number}|Array.<T>|string}
+ * @template T,R
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/reduce
+ */
+Array.prototype.reduce = function(callback, opt_initialValue) {};
+
+/**
+ * Apply a function simultaneously against two values of the array (from
+ * right-to-left) as to reduce it to a single value.
+ *
+ * @param {?function(?, T, number, !Array.<T>) : R} callback
+ * @param {*=} opt_initialValue
+ * @return {R}
+ * @this {{length: number}|Array.<T>|string}
+ * @template T,R
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/reduceRight
+ */
+Array.prototype.reduceRight = function(callback, opt_initialValue) {};
+
+/**
+ * Available in ECMAScript 5, Mozilla 1.6+.
+ * @param {?function(this:S, T, number, !Array.<T>): ?} callback
+ * @param {S=} opt_thisobj
+ * @return {boolean}
+ * @this {{length: number}|Array.<T>|string}
+ * @template T,S
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/every
+ */
+Array.prototype.every = function(callback, opt_thisobj) {};
+
+/**
+ * Available in ECMAScript 5, Mozilla 1.6+.
+ * @param {?function(this:S, T, number, !Array.<T>): ?} callback
+ * @param {S=} opt_thisobj
+ * @return {!Array.<T>}
+ * @this {{length: number}|Array.<T>|string}
+ * @template T,S
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/filter
+ */
+Array.prototype.filter = function(callback, opt_thisobj) {};
+
+/**
+ * Available in ECMAScript 5, Mozilla 1.6+.
+ * @param {?function(this:S, T, number, !Array.<T>): ?} callback
+ * @param {S=} opt_thisobj
+ * @this {{length: number}|Array.<T>|string}
+ * @template T,S
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/forEach
+ */
+Array.prototype.forEach = function(callback, opt_thisobj) {};
+
+/**
+ * Available in ECMAScript 5, Mozilla 1.6+.
+ * @param {T} obj
+ * @param {number=} opt_fromIndex
+ * @return {number}
+ * @this {{length: number}|Array.<T>|string}
+ * @nosideeffects
+ * @template T
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/indexOf
+ */
+Array.prototype.indexOf = function(obj, opt_fromIndex) {};
+
+/**
+ * Available in ECMAScript 5, Mozilla 1.6+.
+ * @param {T} obj
+ * @param {number=} opt_fromIndex
+ * @return {number}
+ * @this {{length: number}|Array.<T>|string}
+ * @nosideeffects
+ * @template T
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/lastIndexOf
+ */
+Array.prototype.lastIndexOf = function(obj, opt_fromIndex) {};
+
+/**
+ * Available in ECMAScript 5, Mozilla 1.6+.
+ * @param {?function(this:S, T, number, !Array.<T>): R} callback
+ * @param {S=} opt_thisobj
+ * @return {!Array.<R>}
+ * @this {{length: number}|Array.<T>|string}
+ * @template T,S,R
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/map
+ */
+Array.prototype.map = function(callback, opt_thisobj) {};
+
+/**
+ * Available in ECMAScript 5, Mozilla 1.6+.
+ * @param {?function(this:S, T, number, !Array.<T>): ?} callback
+ * @param {S=} opt_thisobj
+ * @return {boolean}
+ * @this {{length: number}|Array.<T>|string}
+ * @template T,S
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/some
+ */
+Array.prototype.some = function(callback, opt_thisobj) {};
+
+/**
+ * @type {number}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/index
+ */
+Array.prototype.index;
+
+/**
+ * @type {?string}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/input
+ */
+Array.prototype.input;
+
+/**
+ * @type {number}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/length
+ */
+Array.prototype.length;
+
+/**
+ * @param {{length: number}|Array.<T>} arr
+ * @param {?function(this:S, T, number, ?) : ?} callback
+ * @param {S=} opt_context
+ * @return {boolean}
+ * @template T,S
+ */
+Array.every = function(arr, callback, opt_context) {};
+
+/**
+ * @param {{length: number}|Array.<T>} arr
+ * @param {?function(this:S, T, number, ?) : ?} callback
+ * @param {S=} opt_context
+ * @return {!Array.<T>}
+ * @template T,S
+ */
+Array.filter = function(arr, callback, opt_context) {};
+
+/**
+ * @param {{length: number}|Array.<T>} arr
+ * @param {?function(this:S, T, number, ?) : ?} callback
+ * @param {S=} opt_context
+ * @template T,S
+ */
+Array.forEach = function(arr, callback, opt_context) {};
+
+/**
+ * Mozilla 1.6+ only.
+ * @param {{length: number}|Array.<T>} arr
+ * @param {T} obj
+ * @param {number=} opt_fromIndex
+ * @return {number}
+ * @template T
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/indexOf
+ */
+Array.indexOf = function(arr, obj, opt_fromIndex) {};
+
+/**
+ * Mozilla 1.6+ only.
+ * @param {{length: number}|Array.<T>} arr
+ * @param {T} obj
+ * @param {number=} opt_fromIndex
+ * @return {number}
+ * @template T
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/lastIndexOf
+ */
+Array.lastIndexOf = function(arr, obj, opt_fromIndex) {};
+
+/**
+ * @param {{length: number}|Array.<T>} arr
+ * @param {?function(this:S, T, number, !Array.<T>): R} callback
+ * @param {S=} opt_context
+ * @return {!Array.<R>}
+ * @template T,S,R
+ */
+Array.map = function(arr, callback, opt_context) {};
+
+/**
+ * @param {{length: number}|Array.<T>} arr
+ * @param {?function(this:S, T, number, ?) : ?} callback
+ * @param {S=} opt_context
+ * @return {boolean}
+ * @template T,S
+ */
+Array.some = function(arr, callback, opt_context) {};
+
+/**
+ * Introduced in 1.8.5.
+ * @param {*} arr
+ * @return {boolean}
+ * @see http://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray
+ */
+Array.isArray = function(arr) {};
+
+/**
+ * @constructor
+ * @param {*=} opt_value
+ * @return {boolean}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean
+ */
+function Boolean(opt_value) {}
+
+/**
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean/toSource
+ * @override
+ */
+Boolean.prototype.toSource = function() {};
+
+/**
+ * @this {boolean|Boolean}
+ * @return {string}
+ * @nosideeffects
+ * @override
+ */
+Boolean.prototype.toString = function() {};
+
+/**
+ * @constructor
+ * @param {*=} opt_value
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number
+ */
+function Number(opt_value) {}
+
+/**
+ * @this {Number|number}
+ * @param {number=} opt_fractionDigits
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number/toExponential
+ */
+Number.prototype.toExponential = function(opt_fractionDigits) {};
+
+/**
+ * @this {Number|number}
+ * @param {*=} opt_digits
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number/toFixed
+ */
+Number.prototype.toFixed = function(opt_digits) {};
+
+/**
+ * @this {Number|number}
+ * @param {number=} opt_precision
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number/toPrecision
+ */
+Number.prototype.toPrecision = function(opt_precision) {};
+
+/**
+ * Returns a string representing the number.
+ * @this {Number|number}
+ * @param {(number|Number)=} opt_radix An optional radix.
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number/toString
+ * @override
+ */
+Number.prototype.toString = function(opt_radix) {};
+
+// Properties.
+/**
+ * @type {number}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number/MAX_VALUE
+ */
+Number.MAX_VALUE;
+
+/**
+ * @type {number}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number/MIN_VALUE
+ */
+Number.MIN_VALUE;
+
+/**
+ * @type {number}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number/NaN
+ */
+Number.NaN;
+
+/**
+ * @type {number}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number/NEGATIVE_INFINITY
+ */
+Number.NEGATIVE_INFINITY;
+
+/**
+ * @type {number}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number/POSITIVE_INFINITY
+ */
+Number.POSITIVE_INFINITY;
+
+
+/**
+ * @const
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math
+ */
+var Math = {};
+
+/**
+ * @param {*} x
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/abs
+ */
+Math.abs = function(x) {};
+
+/**
+ * @param {*} x
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/acos
+ */
+Math.acos = function(x) {};
+
+/**
+ * @param {*} x
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/asin
+ */
+Math.asin = function(x) {};
+
+/**
+ * @param {*} x
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/atan
+ */
+Math.atan = function(x) {};
+
+/**
+ * @param {*} y
+ * @param {*} x
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/atan2
+ */
+Math.atan2 = function(y, x) {};
+
+/**
+ * @param {*} x
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/ceil
+ */
+Math.ceil = function(x) {};
+
+/**
+ * @param {*} x
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/cos
+ */
+Math.cos = function(x) {};
+
+/**
+ * @param {*} x
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/exp
+ */
+Math.exp = function(x) {};
+
+/**
+ * @param {*} x
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/floor
+ */
+Math.floor = function(x) {};
+
+/**
+ * @param {*} x
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/log
+ */
+Math.log = function(x) {};
+
+/**
+ * @param {...*} var_args
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/max
+ */
+Math.max = function(var_args) {};
+
+/**
+ * @param {...*} var_args
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/min
+ */
+Math.min = function(var_args) {};
+
+/**
+ * @param {*} x
+ * @param {*} y
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/pow
+ */
+Math.pow = function(x, y) {};
+
+/**
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/random
+ */
+Math.random = function() {};
+
+/**
+ * @param {*} x
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/round
+ */
+Math.round = function(x) {};
+
+/**
+ * @param {*} x
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/sin
+ */
+Math.sin = function(x) {};
+
+/**
+ * @param {*} x
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/sqrt
+ */
+Math.sqrt = function(x) {};
+
+/**
+ * @param {*} x
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/tan
+ */
+Math.tan = function(x) {};
+
+/**
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/toSource
+ */
+Math.toSource = function() {};
+
+// Properties:
+
+/**
+ * @type {number}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/E
+ */
+Math.E;
+
+/**
+ * @type {number}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/LN2
+ */
+Math.LN2;
+
+/**
+ * @type {number}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/LN10
+ */
+Math.LN10;
+
+/**
+ * @type {number}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/LOG2E
+ */
+Math.LOG2E;
+
+/**
+ * @type {number}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/LOG10E
+ */
+Math.LOG10E;
+
+/**
+ * @type {number}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/PI
+ */
+Math.PI;
+
+/**
+ * @type {number}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/SQRT1_2
+ */
+Math.SQRT1_2;
+
+/**
+ * @type {number}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Math/SQRT2
+ */
+Math.SQRT2;
+
+
+/**
+ * @param {?=} opt_yr_num
+ * @param {?=} opt_mo_num
+ * @param {?=} opt_day_num
+ * @param {?=} opt_hr_num
+ * @param {?=} opt_min_num
+ * @param {?=} opt_sec_num
+ * @param {?=} opt_ms_num
+ * @constructor
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date
+ */
+function Date(opt_yr_num, opt_mo_num, opt_day_num, opt_hr_num, opt_min_num,
+ opt_sec_num, opt_ms_num) {}
+
+/**
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/now
+ */
+Date.now = function() {};
+
+/**
+ * Parses a string representation of a date, and returns the number
+ * of milliseconds since January 1, 1970, 00:00:00, local time.
+ * @param {*} date
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/parse
+ */
+Date.parse = function(date) {};
+
+/**
+ * @param {number} year
+ * @param {number} month
+ * @param {number=} opt_date
+ * @param {number=} opt_hours
+ * @param {number=} opt_minute
+ * @param {number=} opt_second
+ * @param {number=} opt_ms
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/UTC
+ */
+Date.UTC = function(year, month,
+ opt_date, opt_hours, opt_minute, opt_second, opt_ms) {};
+
+/**
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getDate
+ */
+Date.prototype.getDate = function() {};
+
+/**
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getDay
+ */
+Date.prototype.getDay = function() {};
+
+/**
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getMonth
+ */
+Date.prototype.getMonth = function() {};
+
+/**
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getFullYear
+ */
+Date.prototype.getFullYear = function() {};
+
+/**
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getYear
+ */
+Date.prototype.getYear = function() {};
+
+/**
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getHours
+ */
+Date.prototype.getHours = function() {};
+
+/**
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getMinutes
+ */
+Date.prototype.getMinutes = function() {};
+
+/**
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getSeconds
+ */
+Date.prototype.getSeconds = function() {};
+
+/**
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getMilliseconds
+ */
+Date.prototype.getMilliseconds = function() {};
+
+/**
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getTime
+ */
+Date.prototype.getTime = function() {};
+
+/**
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getTimezoneOffset
+ */
+Date.prototype.getTimezoneOffset = function() {};
+
+/**
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getUTCDate
+ */
+Date.prototype.getUTCDate = function() {};
+
+/**
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getUTCDay
+ */
+Date.prototype.getUTCDay = function() {};
+
+/**
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getUTCMonth
+ */
+Date.prototype.getUTCMonth = function() {};
+
+/**
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getUTCFullYear
+ */
+Date.prototype.getUTCFullYear = function() {};
+
+/**
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getUTCHours
+ */
+Date.prototype.getUTCHours = function() {};
+
+/**
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getUTCMinutes
+ */
+Date.prototype.getUTCMinutes = function() {};
+
+/**
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getUTCSeconds
+ */
+Date.prototype.getUTCSeconds = function() {};
+
+/**
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/getUTCMilliseconds
+ */
+Date.prototype.getUTCMilliseconds = function() {};
+
+/**
+ * Sets the day of the month for a specified date according to local time.
+ *
+ * @param {number} dayValue
+ * @modifies {this}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setDate
+ */
+Date.prototype.setDate = function(dayValue) {};
+
+/**
+ * Set the month for a specified date according to local time.
+ *
+ * @param {number} monthValue
+ * @param {number=} opt_dayValue
+ * @modifies {this}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setMonth
+ */
+Date.prototype.setMonth = function(monthValue, opt_dayValue) {};
+
+/**
+ * Sets the full year for a specified date according to local time.
+ *
+ * @param {number} yearValue
+ * @param {number=} opt_monthValue
+ * @param {number=} opt_dayValue
+ * @modifies {this}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setFullYear
+ */
+Date.prototype.setFullYear =
+ function(yearValue, opt_monthValue, opt_dayValue) {};
+
+/**
+ * Sets the year for a specified date according to local time.
+ *
+ * @param {number} yearValue
+ * @deprecated
+ * @modifies {this}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setYear
+ */
+Date.prototype.setYear = function(yearValue) {};
+
+/**
+ * Sets the hours for a specified date according to local time.
+ *
+ * @param {number} hoursValue
+ * @param {number=} opt_minutesValue
+ * @param {number=} opt_secondsValue
+ * @param {number=} opt_msValue
+ * @modifies {this}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setHours
+ */
+Date.prototype.setHours = function(hoursValue, opt_minutesValue,
+ opt_secondsValue, opt_msValue) {};
+
+/**
+ * Sets the minutes for a specified date according to local time.
+ *
+ * @param {number} minutesValue
+ * @param {number=} opt_secondsValue
+ * @param {number=} opt_msValue
+ * @modifies {this}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setMinutes
+ */
+Date.prototype.setMinutes =
+ function(minutesValue, opt_secondsValue, opt_msValue) {};
+
+/**
+ * Sets the seconds for a specified date according to local time.
+ *
+ * @param {number} secondsValue
+ * @param {number=} opt_msValue
+ * @modifies {this}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setSeconds
+ */
+Date.prototype.setSeconds = function(secondsValue, opt_msValue) {};
+
+/**
+ * Sets the milliseconds for a specified date according to local time.
+ *
+ * @param {number} millisecondsValue
+ * @modifies {this}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setMilliseconds
+ */
+Date.prototype.setMilliseconds = function(millisecondsValue) {};
+
+/**
+ * Sets the Date object to the time represented by a number of milliseconds
+ * since January 1, 1970, 00:00:00 UTC.
+ *
+ * @param {number} timeValue
+ * @modifies {this}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setTime
+ */
+Date.prototype.setTime = function(timeValue) {};
+
+/**
+ * Sets the day of the month for a specified date according to universal time.
+ *
+ * @param {number} dayValue
+ * @modifies {this}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setUTCDate
+ */
+Date.prototype.setUTCDate = function(dayValue) {};
+
+/**
+ * Sets the month for a specified date according to universal time.
+ *
+ * @param {number} monthValue
+ * @param {number=} opt_dayValue
+ * @modifies {this}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setUTCMonth
+ */
+Date.prototype.setUTCMonth = function(monthValue, opt_dayValue) {};
+
+/**
+ * Sets the full year for a specified date according to universal time.
+ *
+ * @param {number} yearValue
+ * @param {number=} opt_monthValue
+ * @param {number=} opt_dayValue
+ * @modifies {this}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setUTCFullYear
+ */
+Date.prototype.setUTCFullYear = function(yearValue, opt_monthValue,
+ opt_dayValue) {};
+
+/**
+ * Sets the hour for a specified date according to universal time.
+ *
+ * @param {number} hoursValue
+ * @param {number=} opt_minutesValue
+ * @param {number=} opt_secondsValue
+ * @param {number=} opt_msValue
+ * @modifies {this}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setUTCHours
+ */
+Date.prototype.setUTCHours = function(hoursValue, opt_minutesValue,
+ opt_secondsValue, opt_msValue) {};
+
+/**
+ * Sets the minutes for a specified date according to universal time.
+ *
+ * @param {number} minutesValue
+ * @param {number=} opt_secondsValue
+ * @param {number=} opt_msValue
+ * @modifies {this}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setUTCMinutes
+ */
+Date.prototype.setUTCMinutes = function(minutesValue, opt_secondsValue,
+ opt_msValue) {};
+
+
+/**
+ * Sets the seconds for a specified date according to universal time.
+ *
+ * @param {number} secondsValue
+ * @param {number=} opt_msValue
+ * @modifies {this}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setUTCSeconds
+ */
+Date.prototype.setUTCSeconds = function(secondsValue, opt_msValue) {};
+
+/**
+ * Sets the milliseconds for a specified date according to universal time.
+ *
+ * @param {number} millisecondsValue
+ * @modifies {this}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setUTCMilliseconds
+ */
+Date.prototype.setUTCMilliseconds = function(millisecondsValue) {};
+
+/**
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/toSource
+ * @override
+ */
+Date.prototype.toSource = function() {};
+
+/**
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/toDateString
+ */
+Date.prototype.toDateString = function() {};
+
+/**
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/toGMTString
+ */
+Date.prototype.toGMTString = function() {};
+
+/**
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/toTimeString
+ */
+Date.prototype.toTimeString = function() {};
+
+/**
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/toUTCString
+ */
+Date.prototype.toUTCString = function() {};
+
+/**
+ * @param {(string|Array.<string>)=} opt_locales
+ * @param {Object=} opt_options
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/toLocaleDateString
+ */
+Date.prototype.toLocaleDateString = function(opt_locales, opt_options) {};
+
+/**
+ * @param {string} formatString
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/toLocaleFormat
+ */
+Date.prototype.toLocaleFormat = function(formatString) {};
+
+/**
+ * @param {string|Array.<string>=} opt_locales
+ * @param {Object=} opt_options
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/toLocaleString
+ * @see http://www.ecma-international.org/ecma-402/1.0/#sec-13.3.1
+ * @override
+ */
+Date.prototype.toLocaleString = function(opt_locales, opt_options) {};
+
+/**
+ * @param {(string|Array.<string>)=} opt_locales
+ * @param {Object=} opt_options
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/toLocaleTimeString
+ */
+Date.prototype.toLocaleTimeString = function(opt_locales, opt_options) {};
+
+/**
+ * @this {Date}
+ * @return {string}
+ * @nosideeffects
+ * @override
+ */
+Date.prototype.toString = function() {};
+
+/**
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/valueOf
+ */
+Date.prototype.valueOf;
+
+/**
+ * @constructor
+ * @param {*=} opt_str
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String
+ */
+function String(opt_str) {}
+// Functions:
+
+/**
+ * @param {...number} var_args
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/fromCharCode
+ */
+String.fromCharCode = function(var_args) {};
+
+/**
+ * @this {String|string}
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/anchor
+ */
+String.prototype.anchor = function() {};
+
+/**
+ * @this {String|string}
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/big
+ */
+String.prototype.big = function() {};
+
+/**
+ * @this {String|string}
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/blink
+ */
+String.prototype.blink = function() {};
+
+/**
+ * @this {String|string}
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/bold
+ */
+String.prototype.bold = function() {};
+
+/**
+ * Returns the specified character from a string.
+ *
+ * @this {String|string}
+ * @param {number} index
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/charAt
+ */
+String.prototype.charAt = function(index) {};
+
+/**
+ * Returns a number indicating the Unicode value of the character at the given
+ * index.
+ *
+ * @this {String|string}
+ * @param {number=} opt_index
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/charCodeAt
+ */
+String.prototype.charCodeAt = function(opt_index) {};
+
+/**
+ * Combines the text of two or more strings and returns a new string.
+ *
+ * @this {String|string}
+ * @param {...*} var_args
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/concat
+ */
+String.prototype.concat = function(var_args) {};
+
+/**
+ * @this {String|string}
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/fixed
+ */
+String.prototype.fixed = function() {};
+
+/**
+ * @this {String|string}
+ * @param {string} color
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/fontcolor
+ */
+String.prototype.fontcolor = function(color) {};
+
+/**
+ * @this {String|string}
+ * @param {number} size
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/fontsize
+ */
+String.prototype.fontsize = function(size) {};
+
+/**
+ * Returns the index within the calling String object of the first occurrence
+ * of the specified value, starting the search at fromIndex, returns -1 if the
+ * value is not found.
+ *
+ * @this {String|string}
+ * @param {string|null} searchValue
+ * @param {(number|null)=} opt_fromIndex
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/indexOf
+ */
+String.prototype.indexOf = function(searchValue, opt_fromIndex) {};
+
+/**
+ * @this {String|string}
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/italics
+ */
+String.prototype.italics = function() {};
+
+/**
+ * Returns the index within the calling String object of the last occurrence of
+ * the specified value, or -1 if not found. The calling string is searched
+ * backward, starting at fromIndex.
+ *
+ * @this {String|string}
+ * @param {string|null} searchValue
+ * @param {(number|null)=} opt_fromIndex
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/lastIndexOf
+ */
+String.prototype.lastIndexOf = function(searchValue, opt_fromIndex) {};
+
+/**
+ * @this {String|string}
+ * @param {string} hrefAttribute
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/link
+ */
+String.prototype.link = function(hrefAttribute) {};
+
+/**
+ * Returns a number indicating whether a reference string comes before or after
+ * or is the same as the given string in sort order.
+ *
+ * @this {*}
+ * @param {?string} compareString
+ * @param {string|Array.<string>=} locales
+ * @param {Object=} options
+ * @return {number}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Objects/String/localeCompare
+ * @see http://www.ecma-international.org/ecma-402/1.0/#sec-13.1.1
+ */
+String.prototype.localeCompare = function(compareString, locales, options) {};
+
+/**
+ * Used to retrieve the matches when matching a string against a regular
+ * expression.
+ *
+ * @this {String|string}
+ * @param {*} regexp
+ * @return {Array.<string>} This should really return an Array with a few
+ * special properties, but we do not have a good way to model this in
+ * our type system. Also see Regexp.prototype.exec.
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/match
+ */
+String.prototype.match = function(regexp) {};
+
+/**
+ * @this {String|string}
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/quote
+ */
+String.prototype.quote = function() {};
+
+/**
+ * Finds a match between a regular expression and a string, and replaces the
+ * matched substring with a new substring.
+ *
+ * This may have side-effects if the replacement function has side-effects.
+ *
+ * @this {String|string}
+ * @param {RegExp|string} regex
+ * @param {string|Function} str
+ * @param {string=} opt_flags
+ * @return {string}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/replace
+ */
+String.prototype.replace = function(regex, str, opt_flags) {};
+
+/**
+ * Executes the search for a match between a regular expression and this String
+ * object.
+ *
+ * @this {String|string}
+ * @param {RegExp|string} regexp
+ * @return {number}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/search
+ */
+String.prototype.search = function(regexp) {};
+
+/**
+ * @this {String|string}
+ * @param {number} begin
+ * @param {number=} opt_end
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/slice
+ */
+String.prototype.slice = function(begin, opt_end) {};
+
+/**
+ * @this {String|string}
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/small
+ */
+String.prototype.small = function() {};
+
+/**
+ * @this {String|string}
+ * @param {*=} opt_separator
+ * @param {number=} opt_limit
+ * @return {!Array.<string>}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/split
+ */
+String.prototype.split = function(opt_separator, opt_limit) {};
+
+/**
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/strike
+ */
+String.prototype.strike = function() {};
+
+/**
+ * @this {String|string}
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/sub
+ */
+String.prototype.sub = function() {};
+
+/**
+ * @this {String|string}
+ * @param {number} start
+ * @param {number=} opt_length
+ * @return {string} The specified substring.
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/substr
+ */
+String.prototype.substr = function(start, opt_length) {};
+
+/**
+ * @this {String|string}
+ * @param {number} start
+ * @param {number=} opt_end
+ * @return {string} The specified substring.
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/substring
+ */
+String.prototype.substring = function(start, opt_end) {};
+
+/**
+ * @this {String|string}
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/sup
+ */
+String.prototype.sup = function() {};
+
+/**
+ * @this {String|string}
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/toLocaleUpperCase
+ */
+String.prototype.toLocaleUpperCase = function() {};
+
+/**
+ * @this {String|string}
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/toLocaleLowerCase
+ */
+String.prototype.toLocaleLowerCase = function() {};
+
+/**
+ * @this {String|string}
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/toLowerCase
+ */
+String.prototype.toLowerCase = function() {};
+
+/**
+ * @this {String|string}
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/toUpperCase
+ */
+String.prototype.toUpperCase = function() {};
+
+/**
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/toSource
+ * @override
+ */
+String.prototype.toSource = function() {};
+
+/**
+ * @this {string|String}
+ * @return {string}
+ * @nosideeffects
+ * @override
+ */
+String.prototype.toString = function() {};
+
+/**
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/valueOf
+ */
+String.prototype.valueOf;
+
+/**
+ * @type {number}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/length
+ */
+String.prototype.length;
+
+/**
+ * @constructor
+ * @param {*=} opt_pattern
+ * @param {*=} opt_flags
+ * @return {!RegExp}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp
+ */
+function RegExp(opt_pattern, opt_flags) {}
+
+/**
+ * @param {*} pattern
+ * @param {*=} opt_flags
+ * @return {void}
+ * @modifies {this}
+ * @deprecated
+ * @see http://msdn.microsoft.com/en-us/library/x9cswe0z(v=VS.85).aspx
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp/compile
+ */
+RegExp.prototype.compile = function(pattern, opt_flags) {};
+
+/**
+ * @param {*} str The string to search.
+ * @return {Array.<string>} This should really return an Array with a few
+ * special properties, but we do not have a good way to model this in
+ * our type system. Also see String.prototype.match.
+ * @see http://msdn.microsoft.com/en-us/library/z908hy33(VS.85).aspx
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp/exec
+ */
+RegExp.prototype.exec = function(str) {};
+
+/**
+ * @param {*} str The string to search.
+ * @return {boolean} Whether the string was matched.
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp/test
+ */
+RegExp.prototype.test = function(str) {};
+
+/**
+ * @this {RegExp}
+ * @return {string}
+ * @nosideeffects
+ * @override
+ */
+RegExp.prototype.toString = function() {};
+
+// Constructor properties:
+
+/**
+ * The string against which the last regexp was matched.
+ * @type {string}
+ * @see http://www.devguru.com/Technologies/Ecmascript/Quickref/regexp_input.html
+ */
+RegExp.input;
+
+/**
+ * The last matched characters.
+ * @type {string}
+ * @see http://www.devguru.com/Technologies/Ecmascript/Quickref/regexp_lastMatch.html
+ */
+RegExp.lastMatch;
+
+/**
+ * The last matched parenthesized substring, if any.
+ * @type {string}
+ * @see http://www.devguru.com/Technologies/Ecmascript/Quickref/regexp_lastParen.html
+ */
+RegExp.lastParen;
+
+/**
+ * The substring of the input up to the characters most recently matched.
+ * @type {string}
+ * @see http://www.devguru.com/Technologies/Ecmascript/Quickref/regexp_leftContext.html
+ */
+RegExp.leftContext;
+
+/**
+ * The substring of the input after the characters most recently matched.
+ * @type {string}
+ * @see http://www.devguru.com/Technologies/Ecmascript/Quickref/regexp_rightContext.html
+ */
+RegExp.rightContext;
+
+/**
+ * @type {string}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp
+ */
+RegExp.$1;
+/**
+ * @type {string}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp
+ */
+RegExp.$2;
+/**
+ * @type {string}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp
+ */
+RegExp.$3;
+/**
+ * @type {string}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp
+ */
+RegExp.$4;
+/**
+ * @type {string}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp
+ */
+RegExp.$5;
+/**
+ * @type {string}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp
+ */
+RegExp.$6;
+/**
+ * @type {string}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp
+ */
+RegExp.$7;
+/**
+ * @type {string}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp
+ */
+RegExp.$8;
+/**
+ * @type {string}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp
+ */
+RegExp.$9;
+
+// Prototype properties:
+
+/**
+ * Whether to test the regular expression against all possible matches
+ * in a string, or only against the first.
+ * @type {boolean}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp/global
+ */
+RegExp.prototype.global;
+
+/**
+ * Whether to ignore case while attempting a match in a string.
+ * @type {boolean}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp/ignoreCase
+ */
+RegExp.prototype.ignoreCase;
+
+/**
+ * The index at which to start the next match.
+ * @type {number}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp/lastIndex
+ */
+RegExp.prototype.lastIndex;
+
+/**
+ * Whether or not to search in strings across multiple lines.
+ * @type {boolean}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp/multiline
+ */
+RegExp.prototype.multiline;
+
+/**
+ * The text of the pattern.
+ * @type {string}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp/source
+ */
+RegExp.prototype.source;
+
+
+/**
+ * @constructor
+ * @param {*=} opt_message
+ * @param {*=} opt_file
+ * @param {*=} opt_line
+ * @return {!Error}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Error
+ */
+function Error(opt_message, opt_file, opt_line) {}
+
+
+/**
+ * Chrome/v8 specific, altering the maximum depth of the stack trace
+ * (10 by default).
+ * @type {number}
+ * @see http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
+ */
+Error.stackTraceLimit;
+
+
+/**
+ * Chrome/v8 specific, adds a stack trace to the error object. The optional
+ * constructorOpt parameter allows you to pass in a function value. When
+ * collecting the stack trace all frames above the topmost call to this
+ * function, including that call, will be left out of the stack trace.
+ * @param {Object} error The object to add the stack trace to.
+ * @param {Function=} opt_constructor A function in the stack trace
+ * @see http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
+ */
+Error.captureStackTrace = function(error, opt_constructor){};
+
+
+/**
+ * IE-only.
+ * @type {string}
+ * @see http://msdn.microsoft.com/en-us/library/2w6a45b5.aspx
+ */
+Error.prototype.description;
+
+
+/**
+ * Mozilla-only.
+ * @type {number}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Error/lineNumber
+ */
+Error.prototype.lineNumber;
+
+/**
+ * Mozilla-only
+ * @type {string}
+ * @see https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Error/fileName
+ */
+Error.prototype.fileName;
+
+/**
+ * @type {string}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Error/name
+ */
+Error.prototype.name;
+
+/**
+ * @type {string}
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Error/message
+ */
+Error.prototype.message;
+
+/**
+ * Doesn't seem to exist, but closure/debug.js references it.
+ */
+Error.prototype.sourceURL;
+
+/** @type {string} */
+Error.prototype.stack;
+
+
+/**
+ * @constructor
+ * @extends {Error}
+ * @param {*=} opt_message
+ * @param {*=} opt_file
+ * @param {*=} opt_line
+ * @return {!EvalError}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/EvalError
+ */
+function EvalError(opt_message, opt_file, opt_line) {}
+
+/**
+ * @constructor
+ * @extends {Error}
+ * @param {*=} opt_message
+ * @param {*=} opt_file
+ * @param {*=} opt_line
+ * @return {!RangeError}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RangeError
+ */
+function RangeError(opt_message, opt_file, opt_line) {}
+
+/**
+ * @constructor
+ * @extends {Error}
+ * @param {*=} opt_message
+ * @param {*=} opt_file
+ * @param {*=} opt_line
+ * @return {!ReferenceError}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/ReferenceError
+ */
+function ReferenceError(opt_message, opt_file, opt_line) {}
+
+/**
+ * @constructor
+ * @extends {Error}
+ * @param {*=} opt_message
+ * @param {*=} opt_file
+ * @param {*=} opt_line
+ * @return {!SyntaxError}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/SyntaxError
+ */
+function SyntaxError(opt_message, opt_file, opt_line) {}
+
+/**
+ * @constructor
+ * @extends {Error}
+ * @param {*=} opt_message
+ * @param {*=} opt_file
+ * @param {*=} opt_line
+ * @return {!TypeError}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/TypeError
+ */
+function TypeError(opt_message, opt_file, opt_line) {}
+
+/**
+ * @constructor
+ * @extends {Error}
+ * @param {*=} opt_message
+ * @param {*=} opt_file
+ * @param {*=} opt_line
+ * @return {!URIError}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/URIError
+ */
+function URIError(opt_message, opt_file, opt_line) {}
+
+
+// JScript extensions.
+// @see http://msdn.microsoft.com/en-us/library/894hfyb4(VS.80).aspx
+
+/**
+ * @param {string} progId
+ * @param {string=} opt_location
+ * @constructor
+ * @see http://msdn.microsoft.com/en-us/library/7sw4ddf8.aspx
+ */
+function ActiveXObject(progId, opt_location) {}
+
+/**
+ * @return {string}
+ * @nosideeffects
+ * @see http://msdn.microsoft.com/en-us/library/9k34bww2(VS.80).aspx
+ */
+function ScriptEngine() {}
+
+/**
+ * @return {number}
+ * @nosideeffects
+ * @see http://msdn.microsoft.com/en-us/library/yf25ky07(VS.80).aspx
+ */
+function ScriptEngineMajorVersion() {}
+
+/**
+ * @return {number}
+ * @nosideeffects
+ * @see http://msdn.microsoft.com/en-us/library/wx3812cz(VS.80).aspx
+ */
+function ScriptEngineMinorVersion() {}
+
+/**
+ * @return {number}
+ * @nosideeffects
+ * @see http://msdn.microsoft.com/en-us/library/e98hsk2f(VS.80).aspx
+ */
+function ScriptEngineBuildVersion() {}
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es5.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es5.js
new file mode 100644
index 0000000000..a7d444a8aa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es5.js
@@ -0,0 +1,269 @@
+/*
+ * Copyright 2009 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for ECMAScript 5.
+ * @see http://www.ecma-international.org/publications/files/drafts/tc39-2009-025.pdf
+ * @externs
+ */
+
+
+/**
+ * @param {Object|undefined} selfObj Specifies the object to which |this| should
+ * point when the function is run. If the value is null or undefined, it
+ * will default to the global object.
+ * @param {...*} var_args Additional arguments that are partially
+ * applied to fn.
+ * @return {!Function} A partially-applied form of the Function on which
+ * bind() was invoked as a method.
+ * @nosideeffects
+ * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/bind
+ */
+Function.prototype.bind = function(selfObj, var_args) {};
+
+
+/**
+ * @this {String|string}
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/Trim
+ */
+String.prototype.trim = function() {};
+
+
+/**
+ * @this {String|string}
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/TrimLeft
+ */
+String.prototype.trimLeft = function() {};
+
+
+/**
+ * @this {String|string}
+ * @return {string}
+ * @nosideeffects
+ * @see http://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/TrimRight
+ */
+String.prototype.trimRight = function() {};
+
+
+/**
+ * A object property descriptor used by Object.create, Object.defineProperty,
+ * Object.defineProperties, Object.getOwnPropertyDescriptor.
+ *
+ * Note: not a real constructor.
+ * @constructor
+ */
+var ObjectPropertyDescriptor = function(){};
+
+/** @type {*} */
+ObjectPropertyDescriptor.prototype.value;
+
+/** @type {(function():?)||undefined} */
+ObjectPropertyDescriptor.prototype.get;
+
+/** @type {(function(?):void)||undefined} */
+ObjectPropertyDescriptor.prototype.set;
+
+/** @type {boolean|undefined} */
+ObjectPropertyDescriptor.prototype.writable;
+
+/** @type {boolean|undefined} */
+ObjectPropertyDescriptor.prototype.enumerable;
+
+/** @type {boolean|undefined} */
+ObjectPropertyDescriptor.prototype.configurable;
+
+
+/**
+ * @param {Object} proto
+ * @param {Object=} opt_properties A map of ObjectPropertyDescriptors.
+ * @return {!Object}
+ * @nosideeffects
+ * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/create
+ */
+Object.create = function(proto, opt_properties) {};
+
+
+/**
+ * @param {!Object} obj
+ * @param {string} prop
+ * @param {!Object} descriptor A ObjectPropertyDescriptor.
+ * @return {!Object}
+ * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/defineProperty
+ */
+Object.defineProperty = function(obj, prop, descriptor) {};
+
+
+/**
+ * @param {!Object} obj
+ * @param {!Object} props A map of ObjectPropertyDescriptors.
+ * @return {!Object}
+ * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/defineProperties
+ */
+Object.defineProperties = function(obj, props) {};
+
+
+/**
+ * @param {!Object} obj
+ * @param {string} prop
+ * @return {!ObjectPropertyDescriptor|undefined}
+ * @nosideeffects
+ * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor
+ */
+Object.getOwnPropertyDescriptor = function(obj, prop) {};
+
+
+/**
+ * @param {!Object} obj
+ * @return {!Array.<string>}
+ * @nosideeffects
+ * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/keys
+ */
+Object.keys = function(obj) {};
+
+
+/**
+ * @param {!Object} obj
+ * @return {!Array.<string>}
+ * @nosideeffects
+ * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames
+ */
+Object.getOwnPropertyNames = function(obj) {};
+
+
+/**
+ * @param {!Object} obj
+ * @return {Object}
+ * @nosideeffects
+ * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/GetPrototypeOf
+ */
+Object.getPrototypeOf = function(obj) {};
+
+
+/**
+ * @param {T} obj
+ * @return {T}
+ * @template T
+ * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/preventExtensions
+ */
+Object.preventExtensions = function(obj) {};
+
+
+/**
+ * @param {T} obj
+ * @return {T}
+ * @template T
+ * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/seal
+ */
+Object.seal = function(obj) {};
+
+
+/**
+ * @param {T} obj
+ * @return {T}
+ * @template T
+ * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/freeze
+ */
+Object.freeze = function(obj) {};
+
+
+/**
+ * @param {!Object} obj
+ * @return {boolean}
+ * @nosideeffects
+ * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/isExtensible
+ */
+Object.isExtensible = function(obj) {};
+
+
+/**
+ * @param {!Object} obj
+ * @return {boolean}
+ * @nosideeffects
+ * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/isSealed
+ */
+Object.isSealed = function(obj) {};
+
+
+/**
+ * @param {!Object} obj
+ * @return {boolean}
+ * @nosideeffects
+ * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/isFrozen
+ */
+Object.isFrozen = function(obj) {};
+
+
+/**
+ * As per ECMAScript 5, 15.12.3.
+ * @param {string=} opt_key The JSON key for this object.
+ * @return {*} The serializable representation of this object. Note that this
+ * need not be a string. See http://goo.gl/PEUvs.
+ */
+Object.prototype.toJSON = function(opt_key) {};
+
+
+/**
+ * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/toISOString
+ * @return {string}
+ */
+Date.prototype.toISOString = function() {};
+
+
+/**
+ * @param {*=} opt_ignoredKey
+ * @return {string}
+ * @override
+ */
+Date.prototype.toJSON = function(opt_ignoredKey) {};
+
+
+/**
+ * A fake type to model the JSON object.
+ * @constructor
+ */
+var JSONType = function() {};
+
+
+/**
+ * @param {string} jsonStr The string to parse.
+ * @param {(function(string, *) : *)=} opt_reviver
+ * @return {*} The JSON object.
+ * @throws {Error}
+ * @nosideeffects
+ */
+JSONType.prototype.parse = function(jsonStr, opt_reviver) {};
+
+
+/**
+ * @param {*} jsonObj Input object.
+ * @param {(Array.<string>|(function(string, *) : *)|null)=} opt_replacer
+ * @param {(number|string)=} opt_space
+ * @return {string} JSON string which represents jsonObj.
+ * @throws {Error}
+ * @nosideeffects
+ */
+JSONType.prototype.stringify = function(jsonObj, opt_replacer, opt_space) {};
+
+
+/**
+ * @type {!JSONType}
+ * @suppress {duplicate}
+ */
+var JSON;
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es6.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es6.js
new file mode 100644
index 0000000000..4afb5777a5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es6.js
@@ -0,0 +1,856 @@
+/*
+ * Copyright 2014 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for ECMAScript 6.
+ * @see http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts
+ * @see https://www.khronos.org/registry/typedarray/specs/latest/
+ * @externs
+ */
+
+// TODO(johnlenz): symbol should be a primitive type.
+/** @typedef {?} */
+var symbol;
+
+/**
+ * @param {string} description
+ * @return {symbol}
+ */
+function Symbol(description) {}
+
+/** @const {symbol} */
+Symbol.iterator;
+
+
+/**
+ * @interface
+ * @template VALUE
+ */
+function Iterable() {}
+
+// TODO(johnlenz): remove this when the compiler understands "symbol" natively
+/**
+ * @return {Iterator.<VALUE>}
+ * @suppress {externsValidation}
+ */
+Iterable.prototype[Symbol.iterator] = function() {};
+
+
+
+// TODO(johnlenz): Iterator should be a templated record type.
+/**
+ * @interface
+ * @template VALUE
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/The_Iterator_protocol
+ */
+function Iterator() {}
+
+/**
+ * @param {VALUE=} value
+ * @return {{value:VALUE, done:boolean}}
+ */
+Iterator.prototype.next;
+
+
+/**
+ * @constructor
+ * @see http://people.mozilla.org/~jorendorff/es6-draft.html#sec-generator-objects
+ * @implements {Iterator<VALUE>}
+ * @template VALUE
+ */
+var Generator = function() {};
+
+/**
+ * @param {?=} opt_value
+ * @return {{value:VALUE, done:boolean}}
+ * @override
+ */
+Generator.prototype.next = function(opt_value) {};
+
+/**
+ * @param {VALUE} value
+ * @return {{value:VALUE, done:boolean}}
+ */
+Generator.prototype.return = function(value) {};
+
+/**
+ * @param {?} exception
+ * @return {{value:VALUE, done:boolean}}
+ */
+Generator.prototype.throw = function(exception) {};
+
+
+// TODO(johnlenz): Array should be Iterable.
+
+
+
+/**
+ * @param {number} value
+ * @return {number}
+ * @nosideeffects
+ */
+Math.log10 = function(value) {};
+
+/**
+ * @param {number} value
+ * @return {number}
+ * @nosideeffects
+ */
+Math.log2 = function(value) {};
+
+/**
+ * @param {number} value
+ * @return {number}
+ * @nosideeffects
+ */
+Math.log1p = function(value) {};
+
+/**
+ * @param {number} value
+ * @return {number}
+ * @nosideeffects
+ */
+Math.expm1 = function(value) {};
+
+/**
+ * @param {number} value
+ * @return {number}
+ * @nosideeffects
+ */
+Math.cosh = function(value) {};
+
+/**
+ * @param {number} value
+ * @return {number}
+ * @nosideeffects
+ */
+Math.sinh = function(value) {};
+
+/**
+ * @param {number} value
+ * @return {number}
+ * @nosideeffects
+ */
+Math.tanh = function(value) {};
+
+/**
+ * @param {number} value
+ * @return {number}
+ * @nosideeffects
+ */
+Math.acosh = function(value) {};
+
+/**
+ * @param {number} value
+ * @return {number}
+ * @nosideeffects
+ */
+Math.asinh = function(value) {};
+
+/**
+ * @param {number} value
+ * @return {number}
+ * @nosideeffects
+ */
+Math.atanh = function(value) {};
+
+/**
+ * @param {number} value
+ * @return {number}
+ * @nosideeffects
+ */
+Math.trunc = function(value) {};
+
+/**
+ * @param {number} value
+ * @return {number}
+ * @nosideeffects
+ */
+Math.sign = function(value) {};
+
+/**
+ * @param {number} value
+ * @return {number}
+ * @nosideeffects
+ */
+Math.cbrt = function(value) {};
+
+/**
+ * @param {number} value1
+ * @param {...number} var_args
+ * @return {number}
+ * @nosideeffects
+ * @see http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.hypot
+ */
+Math.hypot = function(value1, var_args) {};
+
+
+/**
+ * @param {*} a
+ * @param {*} b
+ * @return {boolean}
+ * @see http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.is
+ */
+Object.is;
+
+
+/**
+ * Returns a language-sensitive string representation of this number.
+ * @param {(string|!Array<string>)=} opt_locales
+ * @param {Object=} opt_options
+ * @return {string}
+ * @nosideeffects
+ * @see https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString
+ * @see http://www.ecma-international.org/ecma-402/1.0/#sec-13.2.1
+ * @override
+ */
+Number.prototype.toLocaleString = function(opt_locales, opt_options) {};
+
+
+/**
+ * @see http://dev.w3.org/html5/postmsg/
+ * @interface
+ */
+function Transferable() {}
+
+/**
+ * @param {number} length The length in bytes
+ * @constructor
+ * @noalias
+ * @throws {Error}
+ * @nosideeffects
+ * @implements {Transferable}
+ */
+function ArrayBuffer(length) {}
+
+/** @type {number} */
+ArrayBuffer.prototype.byteLength;
+
+/**
+ * @param {number} begin
+ * @param {number=} opt_end
+ * @return {!ArrayBuffer}
+ * @nosideeffects
+ */
+ArrayBuffer.prototype.slice = function(begin, opt_end) {};
+
+
+/**
+ * @constructor
+ * @noalias
+ */
+function ArrayBufferView() {}
+
+/** @type {!ArrayBuffer} */
+ArrayBufferView.prototype.buffer;
+
+/** @type {number} */
+ArrayBufferView.prototype.byteOffset;
+
+/** @type {number} */
+ArrayBufferView.prototype.byteLength;
+
+
+/**
+ * @param {number|ArrayBufferView|Array.<number>|ArrayBuffer} length or array
+ * or buffer
+ * @param {number=} opt_byteOffset
+ * @param {number=} opt_length
+ * @extends {ArrayBufferView}
+ * @constructor
+ * @noalias
+ * @throws {Error}
+ * @modifies {arguments} If the user passes a backing array, then indexed
+ * accesses will modify the backing array. JSCompiler does not model
+ * this well. In other words, if you have:
+ * <code>
+ * var x = new ArrayBuffer(1);
+ * var y = new Int8Array(x);
+ * y[0] = 2;
+ * </code>
+ * JSCompiler will not recognize that the last assignment modifies x.
+ * We workaround this by marking all these arrays as @modifies {arguments},
+ * to introduce the possibility that x aliases y.
+ */
+function Int8Array(length, opt_byteOffset, opt_length) {}
+
+/** @type {number} */
+Int8Array.BYTES_PER_ELEMENT;
+
+/** @type {number} */
+Int8Array.prototype.BYTES_PER_ELEMENT;
+
+/** @type {number} */
+Int8Array.prototype.length;
+
+/**
+ * @param {ArrayBufferView|Array.<number>} array
+ * @param {number=} opt_offset
+ */
+Int8Array.prototype.set = function(array, opt_offset) {};
+
+/**
+ * @param {number} begin
+ * @param {number=} opt_end
+ * @return {!Int8Array}
+ * @nosideeffects
+ */
+Int8Array.prototype.subarray = function(begin, opt_end) {};
+
+
+/**
+ * @param {number|ArrayBufferView|Array.<number>|ArrayBuffer} length or array
+ * or buffer
+ * @param {number=} opt_byteOffset
+ * @param {number=} opt_length
+ * @extends {ArrayBufferView}
+ * @constructor
+ * @noalias
+ * @throws {Error}
+ * @modifies {arguments}
+ */
+function Uint8Array(length, opt_byteOffset, opt_length) {}
+
+/** @type {number} */
+Uint8Array.BYTES_PER_ELEMENT;
+
+/** @type {number} */
+Uint8Array.prototype.BYTES_PER_ELEMENT;
+
+/** @type {number} */
+Uint8Array.prototype.length;
+
+/**
+ * @param {ArrayBufferView|Array.<number>} array
+ * @param {number=} opt_offset
+ */
+Uint8Array.prototype.set = function(array, opt_offset) {};
+
+/**
+ * @param {number} begin
+ * @param {number=} opt_end
+ * @return {!Uint8Array}
+ * @nosideeffects
+ */
+Uint8Array.prototype.subarray = function(begin, opt_end) {};
+
+
+/**
+ * @param {number|ArrayBufferView|Array.<number>|ArrayBuffer} length or array
+ * or buffer
+ * @param {number=} opt_byteOffset
+ * @param {number=} opt_length
+ * @extends {ArrayBufferView}
+ * @constructor
+ * @noalias
+ * @throws {Error}
+ * @modifies {arguments}
+ */
+function Uint8ClampedArray(length, opt_byteOffset, opt_length) {}
+
+/** @type {number} */
+Uint8ClampedArray.BYTES_PER_ELEMENT;
+
+/** @type {number} */
+Uint8ClampedArray.prototype.BYTES_PER_ELEMENT;
+
+/** @type {number} */
+Uint8ClampedArray.prototype.length;
+
+/**
+ * @param {ArrayBufferView|Array.<number>} array
+ * @param {number=} opt_offset
+ */
+Uint8ClampedArray.prototype.set = function(array, opt_offset) {};
+
+/**
+ * @param {number} begin
+ * @param {number=} opt_end
+ * @return {!Uint8ClampedArray}
+ * @nosideeffects
+ */
+Uint8ClampedArray.prototype.subarray = function(begin, opt_end) {};
+
+
+/**
+ * @typedef {Uint8ClampedArray}
+ * @deprecated CanvasPixelArray has been replaced by Uint8ClampedArray
+ * in the latest spec.
+ * @see http://www.w3.org/TR/2dcontext/#imagedata
+ */
+var CanvasPixelArray;
+
+
+/**
+ * @param {number|ArrayBufferView|Array.<number>|ArrayBuffer} length or array
+ * or buffer
+ * @param {number=} opt_byteOffset
+ * @param {number=} opt_length
+ * @extends {ArrayBufferView}
+ * @constructor
+ * @noalias
+ * @throws {Error}
+ * @modifies {arguments}
+ */
+function Int16Array(length, opt_byteOffset, opt_length) {}
+
+/** @type {number} */
+Int16Array.BYTES_PER_ELEMENT;
+
+/** @type {number} */
+Int16Array.prototype.BYTES_PER_ELEMENT;
+
+/** @type {number} */
+Int16Array.prototype.length;
+
+/**
+ * @param {ArrayBufferView|Array.<number>} array
+ * @param {number=} opt_offset
+ */
+Int16Array.prototype.set = function(array, opt_offset) {};
+
+/**
+ * @param {number} begin
+ * @param {number=} opt_end
+ * @return {!Int16Array}
+ * @nosideeffects
+ */
+Int16Array.prototype.subarray = function(begin, opt_end) {};
+
+
+/**
+ * @param {number|ArrayBufferView|Array.<number>|ArrayBuffer} length or array
+ * or buffer
+ * @param {number=} opt_byteOffset
+ * @param {number=} opt_length
+ * @extends {ArrayBufferView}
+ * @constructor
+ * @noalias
+ * @throws {Error}
+ * @modifies {arguments}
+ */
+function Uint16Array(length, opt_byteOffset, opt_length) {}
+
+/** @type {number} */
+Uint16Array.BYTES_PER_ELEMENT;
+
+/** @type {number} */
+Uint16Array.prototype.BYTES_PER_ELEMENT;
+
+/** @type {number} */
+Uint16Array.prototype.length;
+
+/**
+ * @param {ArrayBufferView|Array.<number>} array
+ * @param {number=} opt_offset
+ */
+Uint16Array.prototype.set = function(array, opt_offset) {};
+
+/**
+ * @param {number} begin
+ * @param {number=} opt_end
+ * @return {!Uint16Array}
+ * @nosideeffects
+ */
+Uint16Array.prototype.subarray = function(begin, opt_end) {};
+
+
+/**
+ * @param {number|ArrayBufferView|Array.<number>|ArrayBuffer} length or array
+ * or buffer
+ * @param {number=} opt_byteOffset
+ * @param {number=} opt_length
+ * @extends {ArrayBufferView}
+ * @constructor
+ * @noalias
+ * @throws {Error}
+ * @modifies {arguments}
+ */
+function Int32Array(length, opt_byteOffset, opt_length) {}
+
+/** @type {number} */
+Int32Array.BYTES_PER_ELEMENT;
+
+/** @type {number} */
+Int32Array.prototype.BYTES_PER_ELEMENT;
+
+/** @type {number} */
+Int32Array.prototype.length;
+
+/**
+ * @param {ArrayBufferView|Array.<number>} array
+ * @param {number=} opt_offset
+ */
+Int32Array.prototype.set = function(array, opt_offset) {};
+
+/**
+ * @param {number} begin
+ * @param {number=} opt_end
+ * @return {!Int32Array}
+ * @nosideeffects
+ */
+Int32Array.prototype.subarray = function(begin, opt_end) {};
+
+
+/**
+ * @param {number|ArrayBufferView|Array.<number>|ArrayBuffer} length or array
+ * or buffer
+ * @param {number=} opt_byteOffset
+ * @param {number=} opt_length
+ * @extends {ArrayBufferView}
+ * @constructor
+ * @noalias
+ * @throws {Error}
+ * @modifies {arguments}
+ */
+function Uint32Array(length, opt_byteOffset, opt_length) {}
+
+/** @type {number} */
+Uint32Array.BYTES_PER_ELEMENT;
+
+/** @type {number} */
+Uint32Array.prototype.BYTES_PER_ELEMENT;
+
+/** @type {number} */
+Uint32Array.prototype.length;
+
+/**
+ * @param {ArrayBufferView|Array.<number>} array
+ * @param {number=} opt_offset
+ */
+Uint32Array.prototype.set = function(array, opt_offset) {};
+
+/**
+ * @param {number} begin
+ * @param {number=} opt_end
+ * @return {!Uint32Array}
+ * @nosideeffects
+ */
+Uint32Array.prototype.subarray = function(begin, opt_end) {};
+
+
+/**
+ * @param {number|ArrayBufferView|Array.<number>|ArrayBuffer} length or array
+ * or buffer
+ * @param {number=} opt_byteOffset
+ * @param {number=} opt_length
+ * @extends {ArrayBufferView}
+ * @constructor
+ * @noalias
+ * @throws {Error}
+ * @modifies {arguments}
+ */
+function Float32Array(length, opt_byteOffset, opt_length) {}
+
+/** @type {number} */
+Float32Array.BYTES_PER_ELEMENT;
+
+/** @type {number} */
+Float32Array.prototype.BYTES_PER_ELEMENT;
+
+/** @type {number} */
+Float32Array.prototype.length;
+
+/**
+ * @param {ArrayBufferView|Array.<number>} array
+ * @param {number=} opt_offset
+ */
+Float32Array.prototype.set = function(array, opt_offset) {};
+
+/**
+ * @param {number} begin
+ * @param {number=} opt_end
+ * @return {!Float32Array}
+ * @nosideeffects
+ */
+Float32Array.prototype.subarray = function(begin, opt_end) {};
+
+
+/**
+ * @param {number|ArrayBufferView|Array.<number>|ArrayBuffer} length or array
+ * or buffer
+ * @param {number=} opt_byteOffset
+ * @param {number=} opt_length
+ * @extends {ArrayBufferView}
+ * @constructor
+ * @noalias
+ * @throws {Error}
+ * @modifies {arguments}
+ */
+function Float64Array(length, opt_byteOffset, opt_length) {}
+
+/** @type {number} */
+Float64Array.BYTES_PER_ELEMENT;
+
+/** @type {number} */
+Float64Array.prototype.BYTES_PER_ELEMENT;
+
+/** @type {number} */
+Float64Array.prototype.length;
+
+/**
+ * @param {ArrayBufferView|Array.<number>} array
+ * @param {number=} opt_offset
+ */
+Float64Array.prototype.set = function(array, opt_offset) {};
+
+/**
+ * @param {number} begin
+ * @param {number=} opt_end
+ * @return {!Float64Array}
+ * @nosideeffects
+ */
+Float64Array.prototype.subarray = function(begin, opt_end) {};
+
+
+/**
+ * @param {ArrayBuffer} buffer
+ * @param {number=} opt_byteOffset
+ * @param {number=} opt_byteLength
+ * @extends {ArrayBufferView}
+ * @constructor
+ * @noalias
+ * @throws {Error}
+ * @nosideeffects
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays/DataView
+ */
+function DataView(buffer, opt_byteOffset, opt_byteLength) {}
+
+/**
+ * @param {number} byteOffset
+ * @return {number}
+ * @throws {Error}
+ * @nosideeffects
+ */
+DataView.prototype.getInt8 = function(byteOffset) {};
+
+/**
+ * @param {number} byteOffset
+ * @return {number}
+ * @throws {Error}
+ * @nosideeffects
+ */
+DataView.prototype.getUint8 = function(byteOffset) {};
+
+/**
+ * @param {number} byteOffset
+ * @param {boolean=} opt_littleEndian
+ * @return {number}
+ * @throws {Error}
+ * @nosideeffects
+ */
+DataView.prototype.getInt16 = function(byteOffset, opt_littleEndian) {};
+
+/**
+ * @param {number} byteOffset
+ * @param {boolean=} opt_littleEndian
+ * @return {number}
+ * @throws {Error}
+ * @nosideeffects
+ */
+DataView.prototype.getUint16 = function(byteOffset, opt_littleEndian) {};
+
+/**
+ * @param {number} byteOffset
+ * @param {boolean=} opt_littleEndian
+ * @return {number}
+ * @throws {Error}
+ * @nosideeffects
+ */
+DataView.prototype.getInt32 = function(byteOffset, opt_littleEndian) {};
+
+/**
+ * @param {number} byteOffset
+ * @param {boolean=} opt_littleEndian
+ * @return {number}
+ * @throws {Error}
+ * @nosideeffects
+ */
+DataView.prototype.getUint32 = function(byteOffset, opt_littleEndian) {};
+
+/**
+ * @param {number} byteOffset
+ * @param {boolean=} opt_littleEndian
+ * @return {number}
+ * @throws {Error}
+ * @nosideeffects
+ */
+DataView.prototype.getFloat32 = function(byteOffset, opt_littleEndian) {};
+
+/**
+ * @param {number} byteOffset
+ * @param {boolean=} opt_littleEndian
+ * @return {number}
+ * @throws {Error}
+ * @nosideeffects
+ */
+DataView.prototype.getFloat64 = function(byteOffset, opt_littleEndian) {};
+
+/**
+ * @param {number} byteOffset
+ * @param {number} value
+ * @throws {Error}
+ */
+DataView.prototype.setInt8 = function(byteOffset, value) {};
+
+/**
+ * @param {number} byteOffset
+ * @param {number} value
+ * @throws {Error}
+ */
+DataView.prototype.setUint8 = function(byteOffset, value) {};
+
+/**
+ * @param {number} byteOffset
+ * @param {number} value
+ * @param {boolean=} opt_littleEndian
+ * @throws {Error}
+ */
+DataView.prototype.setInt16 = function(byteOffset, value, opt_littleEndian) {};
+
+/**
+ * @param {number} byteOffset
+ * @param {number} value
+ * @param {boolean=} opt_littleEndian
+ * @throws {Error}
+ */
+DataView.prototype.setUint16 = function(byteOffset, value, opt_littleEndian) {};
+
+/**
+ * @param {number} byteOffset
+ * @param {number} value
+ * @param {boolean=} opt_littleEndian
+ * @throws {Error}
+ */
+DataView.prototype.setInt32 = function(byteOffset, value, opt_littleEndian) {};
+
+/**
+ * @param {number} byteOffset
+ * @param {number} value
+ * @param {boolean=} opt_littleEndian
+ * @throws {Error}
+ */
+DataView.prototype.setUint32 = function(byteOffset, value, opt_littleEndian) {};
+
+/**
+ * @param {number} byteOffset
+ * @param {number} value
+ * @param {boolean=} opt_littleEndian
+ * @throws {Error}
+ */
+DataView.prototype.setFloat32 = function(
+ byteOffset, value, opt_littleEndian) {};
+
+/**
+ * @param {number} byteOffset
+ * @param {number} value
+ * @param {boolean=} opt_littleEndian
+ * @throws {Error}
+ */
+DataView.prototype.setFloat64 = function(
+ byteOffset, value, opt_littleEndian) {};
+
+
+/**
+ * @see https://github.com/promises-aplus/promises-spec
+ * @typedef {{then: !Function}}
+ */
+var Thenable;
+
+
+/**
+ * This is not an official DOM interface. It is used to add generic typing
+ * and respective type inference where available.
+ * {@see goog.Thenable} inherits from this making all promises
+ * interoperate.
+ * @interface
+ * @template TYPE
+ */
+var IThenable = function() {};
+
+
+/**
+ * @param {?(function(TYPE):
+ * (RESULT|IThenable.<RESULT>|Thenable))=} opt_onFulfilled
+ * @param {?(function(*): *)=} opt_onRejected
+ * @return {!IThenable.<RESULT>}
+ * @template RESULT
+ */
+IThenable.prototype.then = function(opt_onFulfilled, opt_onRejected) {};
+
+
+/**
+ * @see https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects
+ * @param {function(
+ * function((TYPE|IThenable.<TYPE>|Thenable|null)=),
+ * function(*=))} resolver
+ * @constructor
+ * @implements {IThenable.<TYPE>}
+ * @template TYPE
+ */
+var Promise = function(resolver) {};
+
+
+/**
+ * @param {(TYPE|IThenable.<TYPE>)=} opt_value
+ * @return {!Promise.<TYPE>}
+ * @template TYPE
+ */
+Promise.resolve = function(opt_value) {};
+
+
+/**
+ * @param {*=} opt_error
+ * @return {!Promise.<?>}
+ */
+Promise.reject = function(opt_error) {};
+
+
+/**
+ * @template T
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
+ * @param {!Array<T|!Promise<T>>} iterable
+ * @return {!Promise<!Array<T>>}
+ */
+Promise.all = function(iterable) {};
+
+
+/**
+ * @template T
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
+ * @param {!Array.<T>} iterable
+ * @return {!Promise.<T>}
+ */
+Promise.race = function(iterable) {};
+
+
+/**
+ * @param {?(function(TYPE):
+ * (RESULT|IThenable.<RESULT>|Thenable))=} opt_onFulfilled
+ * @param {?(function(*): *)=} opt_onRejected
+ * @return {!Promise.<RESULT>}
+ * @template RESULT
+ * @override
+ */
+Promise.prototype.then = function(opt_onFulfilled, opt_onRejected) {};
+
+
+/**
+ * @param {function(*): RESULT} onRejected
+ * @return {!Promise.<RESULT>}
+ * @template RESULT
+ */
+Promise.prototype.catch = function(onRejected) {};
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es6_collections.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es6_collections.js
new file mode 100644
index 0000000000..8be2d6daa4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/es6_collections.js
@@ -0,0 +1,253 @@
+/*
+ * Copyright 2014 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for ECMAScript 6.
+ * @see http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts
+ * @externs
+ */
+
+// TODO(johnlenz): Use Tuples for the Map and Set iterators where appropriate.
+
+/**
+ * @constructor
+ * @param {Iterable.<!Array.<KEY|VALUE>>|!Array.<!Array.<KEY|VALUE>>=} opt_iterable
+ * @implements {Iterable.<!Array.<KEY|VALUE>>}
+ * @template KEY, VALUE
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map
+ */
+function Map(opt_iterable) {}
+
+/** @return {void} */
+Map.prototype.clear;
+
+/**
+ * @param {KEY} key
+ * @return {boolean}
+ */
+Map.prototype.delete;
+
+/**
+ * @return {!Iterator.<!Array.<KEY|VALUE>>}
+ * @nosideeffects
+ */
+Map.prototype.entries;
+
+/**
+ * @param {function(this:THIS, VALUE, KEY, MAP):void} callback
+ * @param {THIS} thisArg
+ * @this {MAP}
+ * @template MAP,THIS
+ */
+Map.prototype.forEach;
+
+/**
+ * @param {KEY} key
+ * @return {VALUE|undefined}
+ * @nosideeffects
+ */
+Map.prototype.get;
+
+/**
+ * @param {KEY} key
+ * @return {boolean}
+ * @nosideeffects
+ */
+Map.prototype.has;
+
+/**
+ * @return {!Iterator.<KEY>}
+ */
+Map.prototype.keys;
+
+/**
+ * @param {KEY} key
+ * @param {VALUE} value
+ * @return {THIS}
+ * @this {THIS}
+ * @template THIS
+ */
+Map.prototype.set;
+
+/**
+ * @type {number}
+ * (readonly)
+ */
+Map.prototype.size;
+
+/**
+ * @return {!Iterator.<VALUE>}
+ * @nosideeffects
+ */
+Map.prototype.values;
+
+/**
+ * @return {!Iterator.<!Array.<KEY|VALUE>>}
+ */
+Map.prototype[Symbol.iterator] = function() {};
+
+
+/**
+ * @constructor
+ * @param {Iterable.<!Array.<KEY|VALUE>>|!Array.<!Array.<KEY|VALUE>>=} opt_iterable
+ * @template KEY, VALUE
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap
+ */
+function WeakMap(opt_iterable) {}
+
+/** @return {void} */
+WeakMap.prototype.clear;
+
+/**
+ * @param {KEY} key
+ * @return {boolean}
+ */
+WeakMap.prototype.delete;
+
+/**
+ * @param {KEY} key
+ * @return {VALUE|undefined}
+ * @nosideeffects
+ */
+WeakMap.prototype.get;
+
+/**
+ * @param {KEY} key
+ * @return {boolean}
+ * @nosideeffects
+ */
+WeakMap.prototype.has;
+
+/**
+ * @param {KEY} key
+ * @param {VALUE} value
+ * @return {THIS}
+ * @this {THIS}
+ * @template THIS
+ */
+WeakMap.prototype.set;
+
+
+
+/**
+ * @constructor
+ * @param {Iterable.<VALUE>|Array.<VALUE>=} opt_iterable
+ * @implements {Iterable.<VALUE>}
+ * @template VALUE
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
+ */
+function Set(opt_iterable) {}
+
+/**
+ * @param {VALUE} value
+ * @return {THIS}
+ * @this {THIS}
+ * @template THIS
+ */
+Set.prototype.add;
+
+/**
+ * @return {void}
+ */
+Set.prototype.clear;
+
+/**
+ * @param {VALUE} value
+ * @return {boolean}
+ */
+Set.prototype.delete;
+
+/**
+ * @return {!Iterator.<!Array.<VALUE>>} Where each array has two entries:
+ * [value, value]
+ * @nosideeffects
+ */
+Set.prototype.entries;
+
+/**
+ * @param {function(VALUE, VALUE, SET)} callback
+ * @param {THIS} thisArg
+ * @this {SET}
+ * @template SET,THIS
+ */
+Set.prototype.forEach;
+
+/**
+ * @param {VALUE} value
+ * @return {boolean}
+ * @nosideeffects
+ */
+Set.prototype.has;
+
+/**
+ * @type {number} (readonly)
+ */
+Set.prototype.size;
+
+/**
+ * @return {!Iterator.<VALUE>}
+ * @nosideeffects
+ */
+Set.prototype.keys;
+
+/**
+ * @return {!Iterator.<VALUE>}
+ * @nosideeffects
+ */
+Set.prototype.values;
+
+/**
+ * @return {!Iterator.<VALUE>}
+ */
+Set.prototype[Symbol.iterator] = function() {};
+
+
+
+/**
+ * @constructor
+ * @param {Iterable.<VALUE>|Array.<VALUE>=} opt_iterable
+ * @template VALUE
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
+ */
+function WeakSet(opt_iterable) {}
+
+/**
+ * @param {VALUE} value
+ * @return {THIS}
+ * @this {THIS}
+ * @template THIS
+ */
+WeakSet.prototype.add;
+
+/**
+ * @return {void}
+ */
+WeakSet.prototype.clear;
+
+/**
+ * @param {VALUE} value
+ * @return {boolean}
+ */
+WeakSet.prototype.delete;
+
+/**
+ * @param {VALUE} value
+ * @return {boolean}
+ * @nosideeffects
+ */
+WeakSet.prototype.has;
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/fileapi.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/fileapi.js
new file mode 100644
index 0000000000..f878a9d227
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/fileapi.js
@@ -0,0 +1,961 @@
+/*
+ * Copyright 2010 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * @fileoverview Definitions for objects in the File API, File Writer API, and
+ * File System API. Details of the API are at:
+ * http://www.w3.org/TR/FileAPI/
+ * http://www.w3.org/TR/file-writer-api/
+ * http://www.w3.org/TR/file-system-api/
+ *
+ * @externs
+ * @author dbk@google.com (David Barrett-Kahn)
+ */
+
+
+/**
+ * @see http://dev.w3.org/2006/webapi/FileAPI/#dfn-Blob
+ * @param {Array.<ArrayBufferView|Blob|string>=} opt_blobParts
+ * @param {Object=} opt_options
+ * @constructor
+ * @nosideeffects
+ */
+function Blob(opt_blobParts, opt_options) {}
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-size
+ * @type {number}
+ */
+Blob.prototype.size;
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-type
+ * @type {string}
+ */
+Blob.prototype.type;
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-slice
+ * @param {number} start
+ * @param {number} length
+ * @return {!Blob}
+ * @nosideeffects
+ */
+Blob.prototype.slice = function(start, length) {};
+
+/**
+ * This replaces Blob.slice in Chrome since WebKit revision 84005.
+ * @see http://lists.w3.org/Archives/Public/public-webapps/2011AprJun/0222.html
+ * @param {number} start
+ * @param {number} end
+ * @return {!Blob}
+ * @nosideeffects
+ */
+Blob.prototype.webkitSlice = function(start, end) {};
+
+/**
+ * This replaces Blob.slice in Firefox.
+ * @see http://lists.w3.org/Archives/Public/public-webapps/2011AprJun/0222.html
+ * @param {number} start
+ * @param {number} end
+ * @return {!Blob}
+ * @nosideeffects
+ */
+Blob.prototype.mozSlice = function(start, end) {};
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#the-blobbuilder-interface
+ * @constructor
+ */
+function BlobBuilder() {}
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-BlobBuilder-append0
+ * @see http://www.w3.org/TR/file-writer-api/#widl-BlobBuilder-append1
+ * @see http://www.w3.org/TR/file-writer-api/#widl-BlobBuilder-append2
+ * @param {string|Blob|ArrayBuffer} data
+ * @param {string=} endings
+ */
+BlobBuilder.prototype.append = function(data, endings) {};
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-BlobBuilder-getBlob
+ * @param {string=} contentType
+ * @return {!Blob}
+ */
+BlobBuilder.prototype.getBlob = function(contentType) {};
+
+/**
+ * This has replaced BlobBuilder in Chrome since WebKit revision 84008.
+ * @see http://lists.w3.org/Archives/Public/public-webapps/2011AprJun/0222.html
+ * @constructor
+ */
+function WebKitBlobBuilder() {}
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-BlobBuilder-append0
+ * @see http://www.w3.org/TR/file-writer-api/#widl-BlobBuilder-append1
+ * @see http://www.w3.org/TR/file-writer-api/#widl-BlobBuilder-append2
+ * @param {string|Blob|ArrayBuffer} data
+ * @param {string=} endings
+ */
+WebKitBlobBuilder.prototype.append = function(data, endings) {};
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-BlobBuilder-getBlob
+ * @param {string=} contentType
+ * @return {!Blob}
+ */
+WebKitBlobBuilder.prototype.getBlob = function(contentType) {};
+
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#the-directoryentry-interface
+ * @constructor
+ * @extends {Entry}
+ */
+function DirectoryEntry() {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-DirectoryEntry-createReader
+ * @return {!DirectoryReader}
+ */
+DirectoryEntry.prototype.createReader = function() {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-DirectoryEntry-getFile
+ * @param {string} path
+ * @param {Object=} options
+ * @param {function(!FileEntry)=} successCallback
+ * @param {function(!FileError)=} errorCallback
+ */
+DirectoryEntry.prototype.getFile = function(path, options, successCallback,
+ errorCallback) {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-DirectoryEntry-getDirectory
+ * @param {string} path
+ * @param {Object=} options
+ * @param {function(!DirectoryEntry)=} successCallback
+ * @param {function(!FileError)=} errorCallback
+ */
+DirectoryEntry.prototype.getDirectory = function(path, options, successCallback,
+ errorCallback) {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-DirectoryEntry-removeRecursively
+ * @param {function()} successCallback
+ * @param {function(!FileError)=} errorCallback
+ */
+DirectoryEntry.prototype.removeRecursively = function(successCallback,
+ errorCallback) {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#the-directoryreader-interface
+ * @constructor
+ */
+function DirectoryReader() {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-DirectoryReader-readEntries
+ * @param {function(!Array.<!Entry>)} successCallback
+ * @param {function(!FileError)=} errorCallback
+ */
+DirectoryReader.prototype.readEntries = function(successCallback,
+ errorCallback) {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#the-entry-interface
+ * @constructor
+ */
+function Entry() {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-Entry-isFile
+ * @type {boolean}
+ */
+Entry.prototype.isFile;
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-Entry-isDirectory
+ * @type {boolean}
+ */
+Entry.prototype.isDirectory;
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-Entry-name
+ * @type {string}
+ */
+Entry.prototype.name;
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-Entry-fullPath
+ * @type {string}
+ */
+Entry.prototype.fullPath;
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-Entry-filesystem
+ * @type {!FileSystem}
+ */
+Entry.prototype.filesystem;
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-Entry-moveTo
+ * @param {!DirectoryEntry} parent
+ * @param {string=} newName
+ * @param {function(!Entry)=} successCallback
+ * @param {function(!FileError)=} errorCallback
+ */
+Entry.prototype.moveTo = function(parent, newName, successCallback,
+ errorCallback) {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-Entry-copyTo
+ * @param {!DirectoryEntry} parent
+ * @param {string=} newName
+ * @param {function(!Entry)=} successCallback
+ * @param {function(!FileError)=} errorCallback
+ */
+Entry.prototype.copyTo = function(parent, newName, successCallback,
+ errorCallback) {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-Entry-toURL
+ * @param {string=} mimeType
+ * @return {string}
+ */
+Entry.prototype.toURL = function(mimeType) {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-Entry-remove
+ * @param {function()} successCallback
+ * @param {function(!FileError)=} errorCallback
+ */
+Entry.prototype.remove = function(successCallback, errorCallback) {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-Entry-getMetadata
+ * @param {function(!Metadata)} successCallback
+ * @param {function(!FileError)=} errorCallback
+ */
+Entry.prototype.getMetadata = function(successCallback, errorCallback) {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-Entry-getParent
+ * @param {function(!Entry)} successCallback
+ * @param {function(!FileError)=} errorCallback
+ */
+Entry.prototype.getParent = function(successCallback, errorCallback) {};
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-file
+ * @constructor
+ * @extends {Blob}
+ */
+function File() {}
+
+/**
+ * Chrome uses this instead of name.
+ * @deprecated Use name instead.
+ * @type {string}
+ */
+File.prototype.fileName;
+
+/**
+ * Chrome uses this instead of size.
+ * @deprecated Use size instead.
+ * @type {string}
+ */
+File.prototype.fileSize;
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-name
+ * @type {string}
+ */
+File.prototype.name;
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-lastModifiedDate
+ * @type {Date}
+ */
+File.prototype.lastModifiedDate;
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#the-fileentry-interface
+ * @constructor
+ * @extends {Entry}
+ */
+function FileEntry() {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-FileEntry-createWriter
+ * @param {function(!FileWriter)} successCallback
+ * @param {function(!FileError)=} errorCallback
+ */
+FileEntry.prototype.createWriter = function(successCallback, errorCallback) {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-FileEntry-file
+ * @param {function(!File)} successCallback
+ * @param {function(!FileError)=} errorCallback
+ */
+FileEntry.prototype.file = function(successCallback, errorCallback) {};
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#FileErrorInterface
+ * @constructor
+ * @extends {DOMError}
+ */
+function FileError() {}
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-NOT_FOUND_ERR
+ * @type {number}
+ */
+FileError.prototype.NOT_FOUND_ERR = 1;
+
+/** @type {number} */
+FileError.NOT_FOUND_ERR = 1;
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-SECURITY_ERR
+ * @type {number}
+ */
+FileError.prototype.SECURITY_ERR = 2;
+
+/** @type {number} */
+FileError.SECURITY_ERR = 2;
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-ABORT_ERR
+ * @type {number}
+ */
+FileError.prototype.ABORT_ERR = 3;
+
+/** @type {number} */
+FileError.ABORT_ERR = 3;
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-NOT_READABLE_ERR
+ * @type {number}
+ */
+FileError.prototype.NOT_READABLE_ERR = 4;
+
+/** @type {number} */
+FileError.NOT_READABLE_ERR = 4;
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-ENCODING_ERR
+ * @type {number}
+ */
+FileError.prototype.ENCODING_ERR = 5;
+
+/** @type {number} */
+FileError.ENCODING_ERR = 5;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileError-NO_MODIFICATION_ALLOWED_ERR
+ * @type {number}
+ */
+FileError.prototype.NO_MODIFICATION_ALLOWED_ERR = 6;
+
+/** @type {number} */
+FileError.NO_MODIFICATION_ALLOWED_ERR = 6;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileException-INVALID_STATE_ERR
+ * @type {number}
+ */
+FileError.prototype.INVALID_STATE_ERR = 7;
+
+/** @type {number} */
+FileError.INVALID_STATE_ERR = 7;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileException-SYNTAX_ERR
+ * @type {number}
+ */
+FileError.prototype.SYNTAX_ERR = 8;
+
+/** @type {number} */
+FileError.SYNTAX_ERR = 8;
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-FileError-INVALID_MODIFICATION_ERR
+ * @type {number}
+ */
+FileError.prototype.INVALID_MODIFICATION_ERR = 9;
+
+/** @type {number} */
+FileError.INVALID_MODIFICATION_ERR = 9;
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-FileError-QUOTA_EXCEEDED_ERR
+ * @type {number}
+ */
+FileError.prototype.QUOTA_EXCEEDED_ERR = 10;
+
+/** @type {number} */
+FileError.QUOTA_EXCEEDED_ERR = 10;
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-FileException-TYPE_MISMATCH_ERR
+ * @type {number}
+ */
+FileError.prototype.TYPE_MISMATCH_ERR = 11;
+
+/** @type {number} */
+FileError.TYPE_MISMATCH_ERR = 11;
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-FileException-PATH_EXISTS_ERR
+ * @type {number}
+ */
+FileError.prototype.PATH_EXISTS_ERR = 12;
+
+/** @type {number} */
+FileError.PATH_EXISTS_ERR = 12;
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-code-exception
+ * @type {number}
+ * @deprecated Use the 'name' or 'message' attributes of DOMError rather than
+ * 'code'
+ */
+FileError.prototype.code;
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-filereader
+ * @constructor
+ * @implements {EventTarget}
+ */
+function FileReader() {}
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+FileReader.prototype.addEventListener = function(type, listener, opt_useCapture)
+ {};
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+FileReader.prototype.removeEventListener = function(type, listener,
+ opt_useCapture) {};
+
+/** @override */
+FileReader.prototype.dispatchEvent = function(evt) {};
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-readAsArrayBuffer
+ * @param {!Blob} blob
+ */
+FileReader.prototype.readAsArrayBuffer = function(blob) {};
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-readAsBinaryStringAsync
+ * @param {!Blob} blob
+ */
+FileReader.prototype.readAsBinaryString = function(blob) {};
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-readAsText
+ * @param {!Blob} blob
+ * @param {string=} encoding
+ */
+FileReader.prototype.readAsText = function(blob, encoding) {};
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-readAsDataURL
+ * @param {!Blob} blob
+ */
+FileReader.prototype.readAsDataURL = function(blob) {};
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-abort
+ */
+FileReader.prototype.abort = function() {};
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-empty
+ * @type {number}
+ */
+FileReader.prototype.EMPTY = 0;
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-loading
+ * @type {number}
+ */
+FileReader.prototype.LOADING = 1;
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-done
+ * @type {number}
+ */
+FileReader.prototype.DONE = 2;
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-readystate
+ * @type {number}
+ */
+FileReader.prototype.readyState;
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-result
+ * @type {string|Blob|ArrayBuffer}
+ */
+FileReader.prototype.result;
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-error
+ * @type {FileError}
+ */
+FileReader.prototype.error;
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-onloadstart
+ * @type {?function(!ProgressEvent)}
+ */
+FileReader.prototype.onloadstart;
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-onprogress
+ * @type {?function(!ProgressEvent)}
+ */
+FileReader.prototype.onprogress;
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-onload
+ * @type {?function(!ProgressEvent)}
+ */
+FileReader.prototype.onload;
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-onabort
+ * @type {?function(!ProgressEvent)}
+ */
+FileReader.prototype.onabort;
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-onerror
+ * @type {?function(!ProgressEvent)}
+ */
+FileReader.prototype.onerror;
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-onloadend
+ * @type {?function(!ProgressEvent)}
+ */
+FileReader.prototype.onloadend;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#idl-def-FileSaver
+ * @constructor
+ */
+function FileSaver() {};
+
+/** @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-abort */
+FileSaver.prototype.abort = function() {};
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-INIT
+ * @type {number}
+ */
+FileSaver.prototype.INIT = 0;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-WRITING
+ * @type {number}
+ */
+FileSaver.prototype.WRITING = 1;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-DONE
+ * @type {number}
+ */
+FileSaver.prototype.DONE = 2;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-readyState
+ * @type {number}
+ */
+FileSaver.prototype.readyState;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-error
+ * @type {FileError}
+ */
+FileSaver.prototype.error;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-onwritestart
+ * @type {?function(!ProgressEvent)}
+ */
+FileSaver.prototype.onwritestart;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-onprogress
+ * @type {?function(!ProgressEvent)}
+ */
+FileSaver.prototype.onprogress;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-onwrite
+ * @type {?function(!ProgressEvent)}
+ */
+FileSaver.prototype.onwrite;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-onabort
+ * @type {?function(!ProgressEvent)}
+ */
+FileSaver.prototype.onabort;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-onerror
+ * @type {?function(!ProgressEvent)}
+ */
+FileSaver.prototype.onerror;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileSaver-onwriteend
+ * @type {?function(!ProgressEvent)}
+ */
+FileSaver.prototype.onwriteend;
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#the-filesystem-interface
+ * @constructor
+ */
+function FileSystem() {}
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-FileSystem-name
+ * @type {string}
+ */
+FileSystem.prototype.name;
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-FileSystem-root
+ * @type {!DirectoryEntry}
+ */
+FileSystem.prototype.root;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#idl-def-FileWriter
+ * @constructor
+ * @extends {FileSaver}
+ */
+function FileWriter() {}
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileWriter-position
+ * @type {number}
+ */
+FileWriter.prototype.position;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileWriter-length
+ * @type {number}
+ */
+FileWriter.prototype.length;
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileWriter-write
+ * @param {!Blob} blob
+ */
+FileWriter.prototype.write = function(blob) {};
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileWriter-seek
+ * @param {number} offset
+ */
+FileWriter.prototype.seek = function(offset) {};
+
+/**
+ * @see http://www.w3.org/TR/file-writer-api/#widl-FileWriter-truncate
+ * @param {number} size
+ */
+FileWriter.prototype.truncate = function(size) {};
+
+/**
+ * LocalFileSystem interface, implemented by Window and WorkerGlobalScope.
+ * @see http://www.w3.org/TR/file-system-api/#idl-def-LocalFileSystem
+ * @constructor
+ */
+function LocalFileSystem() {}
+
+/**
+ * Metadata interface.
+ * @see http://www.w3.org/TR/file-system-api/#idl-def-Metadata
+ * @constructor
+ */
+function Metadata() {}
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-Metadata-modificationTime
+ * @type {!Date}
+ */
+Metadata.prototype.modificationTime;
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-Metadata-size
+ * @type {number}
+ */
+Metadata.prototype.size;
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-LocalFileSystem-TEMPORARY
+ * @type {number}
+*/
+Window.prototype.TEMPORARY = 0;
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-LocalFileSystem-PERSISTENT
+ * @type {number}
+*/
+Window.prototype.PERSISTENT = 1;
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-LocalFileSystem-requestFileSystem
+ * @param {number} type
+ * @param {number} size
+ * @param {function(!FileSystem)} successCallback
+ * @param {function(!FileError)=} errorCallback
+ */
+function requestFileSystem(type, size, successCallback, errorCallback) {}
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-LocalFileSystem-requestFileSystem
+ * @param {number} type
+ * @param {number} size
+ * @param {function(!FileSystem)} successCallback
+ * @param {function(!FileError)=} errorCallback
+ */
+Window.prototype.requestFileSystem = function(type, size, successCallback,
+ errorCallback) {};
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-LocalFileSystem-resolveLocalFileSystemURI
+ * @param {string} uri
+ * @param {function(!Entry)} successCallback
+ * @param {function(!FileError)=} errorCallback
+ */
+function resolveLocalFileSystemURI(uri, successCallback, errorCallback) {}
+
+/**
+ * @see http://www.w3.org/TR/file-system-api/#widl-LocalFileSystem-resolveLocalFileSystemURI
+ * @param {string} uri
+ * @param {function(!Entry)} successCallback
+ * @param {function(!FileError)=} errorCallback
+ */
+Window.prototype.resolveLocalFileSystemURI = function(uri, successCallback,
+ errorCallback) {}
+
+/**
+ * This has replaced requestFileSystem in Chrome since WebKit revision 84224.
+ * @see http://www.w3.org/TR/file-system-api/#widl-LocalFileSystem-requestFileSystem
+ * @param {number} type
+ * @param {number} size
+ * @param {function(!FileSystem)} successCallback
+ * @param {function(!FileError)=} errorCallback
+ */
+function webkitRequestFileSystem(type, size, successCallback, errorCallback) {}
+
+/**
+ * This has replaced requestFileSystem in Chrome since WebKit revision 84224.
+ * @see http://www.w3.org/TR/file-system-api/#widl-LocalFileSystem-requestFileSystem
+ * @param {number} type
+ * @param {number} size
+ * @param {function(!FileSystem)} successCallback
+ * @param {function(!FileError)=} errorCallback
+ */
+Window.prototype.webkitRequestFileSystem = function(type, size, successCallback,
+ errorCallback) {};
+
+/**
+ * This has replaced resolveLocalFileSystemURI in Chrome since WebKit revision
+ * 84224.
+ * @see http://www.w3.org/TR/file-system-api/#widl-LocalFileSystem-resolveLocalFileSystemURI
+ * @param {string} uri
+ * @param {function(!Entry)} successCallback
+ * @param {function(!FileError)=} errorCallback
+ */
+function webkitResolveLocalFileSystemURI(uri, successCallback, errorCallback) {}
+
+/**
+ * This has replaced resolveLocalFileSystemURI in Chrome since WebKit revision
+ * 84224.
+ * @see http://www.w3.org/TR/file-system-api/#widl-LocalFileSystem-resolveLocalFileSystemURI
+ * @param {string} uri
+ * @param {function(!Entry)} successCallback
+ * @param {function(!FileError)=} errorCallback
+ */
+Window.prototype.webkitResolveLocalFileSystemURI = function(uri, successCallback,
+ errorCallback) {}
+
+// WindowBlobURIMethods interface, implemented by Window and WorkerGlobalScope.
+// There are three APIs for this: the old specced API, the new specced API, and
+// the webkit-prefixed API.
+// @see http://www.w3.org/TR/FileAPI/#creating-revoking
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-createObjectURL
+ * @param {!Object} obj
+ * @return {string}
+ */
+function createObjectURL(obj) {};
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-createObjectURL
+ * @param {!Object} obj
+ * @return {string}
+ */
+Window.prototype.createObjectURL = function(obj) {};
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-revokeObjectURL
+ * @param {string} url
+ */
+function revokeObjectURL(url) {};
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-revokeObjectURL
+ * @param {string} url
+ */
+Window.prototype.revokeObjectURL = function(url) {};
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#URL-object
+ * @constructor
+ */
+function DOMURL() {}
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#
+ * @constructor
+ * @param {string} urlString
+ * @param {string=} opt_base
+ * @extends {DOMURL}
+ */
+function URL(urlString, opt_base) {}
+
+/** @type {string} */
+URL.prototype.protocol;
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-createObjectURL
+ * @param {!File|!Blob|!MediaSource|!MediaStream} obj
+ * @return {string}
+ */
+URL.createObjectURL = function(obj) {};
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-revokeObjectURL
+ * @param {string} url
+ */
+URL.revokeObjectURL = function(url) {};
+
+/**
+ * This has been replaced by URL in Chrome since WebKit revision 75739.
+ * @constructor
+ * @param {string} urlString
+ * @param {string=} opt_base
+ * @extends {DOMURL}
+ */
+function webkitURL(urlString, opt_base) {}
+
+/** @constructor */
+window.webkitURL = webkitURL;
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-createObjectURL
+ * @param {!Object} obj
+ * @return {string}
+ */
+webkitURL.createObjectURL = function(obj) {};
+
+/**
+ * @see http://www.w3.org/TR/FileAPI/#dfn-revokeObjectURL
+ * @param {string} url
+ */
+webkitURL.revokeObjectURL = function(url) {};
+
+/**
+ * @see https://developers.google.com/chrome/whitepapers/storage
+ * @constructor
+ */
+function StorageInfo() {}
+
+/**
+ * @see https://developers.google.com/chrome/whitepapers/storage
+ * @type {number}
+ * */
+StorageInfo.prototype.TEMPORARY = 0;
+
+/**
+ * @see https://developers.google.com/chrome/whitepapers/storage
+ * @type {number}
+ */
+StorageInfo.prototype.PERSISTENT = 1;
+
+/**
+ * @see https://developers.google.com/chrome/whitepapers/storage#requestQuota
+ * @param {number} type
+ * @param {number} size
+ * @param {function(number)} successCallback
+ * @param {function(!DOMException)=} errorCallback
+ */
+StorageInfo.prototype.requestQuota = function(type, size, successCallback,
+ errorCallback) {};
+
+/**
+ * @see https://developers.google.com/chrome/whitepapers/storage#queryUsageAndQuota
+ * @param {number} type
+ * @param {function(number, number)} successCallback
+ * @param {function(!DOMException)=} errorCallback
+ */
+StorageInfo.prototype.queryUsageAndQuota = function(type, successCallback,
+ errorCallback) {};
+
+/**
+ * @see https://developers.google.com/chrome/whitepapers/storage
+ * @type {!StorageInfo}
+ */
+Window.prototype.webkitStorageInfo;
+
+/**
+ * @see https://dvcs.w3.org/hg/quota/raw-file/tip/Overview.html#storagequota-interface.
+ * @constructor
+ */
+function StorageQuota() {}
+
+/**
+ * @param {number} size
+ * @param {function(number)=} opt_successCallback
+ * @param {function(!DOMException)=} opt_errorCallback
+ */
+StorageQuota.prototype.requestQuota = function(size, opt_successCallback,
+ opt_errorCallback) {};
+
+/**
+ * @param {function(number, number)} successCallback
+ * @param {function(!DOMException)=} opt_errorCallback
+ */
+StorageQuota.prototype.queryUsageAndQuota = function(successCallback,
+ opt_errorCallback) {};
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/flash.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/flash.js
new file mode 100644
index 0000000000..097bd86914
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/flash.js
@@ -0,0 +1,210 @@
+/*
+ * Copyright 2008 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * @fileoverview Definitions for all the Flash Object JavaScript methods. This
+ * file depends on w3c_dom2.js.
+ * Created from
+ * http://www.adobe.com/support/flash/publishexport/scriptingwithflash/scriptingwithflash_03.html
+ *
+ * @externs
+ */
+
+
+// Standard Methods.
+
+/**
+ * Call a Flash function exported by ExternalInterface.
+ * @param {string} xmlString The XML string passed to Flash. The outer element
+ * should be {@code <invoke>}. A sample invocation string:
+ * {@code <invoke name="function_name" returntype="javascript">
+ * <string>test</string></invoke>}
+ * @return {string} The serialized return value from Flash that you can eval.
+ */
+HTMLObjectElement.prototype.CallFunction = function(xmlString) {};
+
+/**
+ * Returns the value of the Flash variable specified by varName or null if the
+ * variable does not exist.
+ * @param {string} varName The variable name.
+ * @return {string?} The variable value.
+ */
+HTMLObjectElement.prototype.GetVariable = function(varName) {};
+
+/**
+ * Activates the frame number specified by {@code frameNumber} in the current
+ * movie.
+ * @param {number} frameNumber A non-negative integer frame number.
+ */
+HTMLObjectElement.prototype.GotoFrame = function(frameNumber) {};
+
+/**
+ * @return {boolean} Whether the movie is currently playing.
+ */
+HTMLObjectElement.prototype.IsPlaying = function() {};
+
+/**
+ * Loads the movie identified by {@code url} to the layer specified by {@code
+ * layerNumber}.
+ * @param {number} layerNumber The layer number.
+ * @param {string} url The movie URL.
+ */
+HTMLObjectElement.prototype.LoadMovie = function(layerNumber, url) {};
+
+/**
+ * Pans a zoomed-in movie to the coordinates specified by x and y. Use mode to
+ * specify whether the values for x and y are pixels or a percent of the window.
+ * When mode is 0, the coordinates are pixels; when mode is 1, the coordinates
+ * are percent of the window.
+ * @param {number} x The x-coordinate.
+ * @param {number} y The y-coordinate.
+ * @param {number} mode The mode.
+ */
+HTMLObjectElement.prototype.Pan = function(x, y, mode) {};
+
+/**
+ * @return {number} The percent of the Flash Player movie that has streamed
+ * into the browser so far; Possible values are from 0 to 100.
+ */
+HTMLObjectElement.prototype.PercentLoaded = function() {};
+
+/**
+ * Starts playing the movie.
+ */
+HTMLObjectElement.prototype.Play = function() {};
+
+/**
+ * Goes to the first frame.
+ */
+HTMLObjectElement.prototype.Rewind = function() {};
+
+/**
+ * Sets the value of the flash variable.
+ * @param {string} variableName The variable name.
+ * @param {string} value The value.
+ */
+HTMLObjectElement.prototype.SetVariable = function(variableName, value) {};
+
+/**
+ * Zooms in on a rectangular area of the movie. The units of the coordinates
+ * are in twips (1440 units per inch).
+ * @param {number} left The left coordinate.
+ * @param {number} top The top coordinate.
+ * @param {number} right The right coordinate.
+ * @param {number} bottom The bottom coordinate.
+ */
+HTMLObjectElement.prototype.SetZoomRect = function(left, top, right, bottom) {};
+
+/**
+ * Stops playing the movie.
+ */
+HTMLObjectElement.prototype.StopPlay = function() {};
+
+/**
+ * @return {number} The total number of frames in the movie.
+ */
+HTMLObjectElement.prototype.TotalFrames = function() {};
+
+/**
+ * Zooms the view by a relative scale factor.
+ * @param {number} percent The percentage scale factor, should be an integer.
+ */
+HTMLObjectElement.prototype.Zoom = function(percent) {};
+
+
+// TellTarget Methods.
+
+/**
+ * Executes the action in the timeline specified by {@code target} in the
+ * specified frame.
+ * @param {string} target The timeline.
+ * @param {number} frameNumber The frame number.
+ */
+HTMLObjectElement.prototype.TCallFrame = function(target, frameNumber) {};
+
+/**
+ * Executes the action in the timeline specified by {@code target} in the
+ * specified frame.
+ * @param {string} target The timeline.
+ * @param {string} label The frame label.
+ */
+HTMLObjectElement.prototype.TCallLabel = function(target, label) {};
+
+/**
+ * Returns the number of the current frame for the specified timeline.
+ * @param {string} target The timeline.
+ * @return {number} The number of the current frame.
+ */
+HTMLObjectElement.prototype.TCurentFrame = function(target) {};
+
+/**
+ * Returns the label of the current frame for the specified timeline.
+ * @param {string} target The timeline.
+ * @return {string} The label of the current frame, empty string if no
+ * current frame.
+ */
+HTMLObjectElement.prototype.TCurrentLabel = function(target) {};
+
+/**
+ * Returns a string indicating the value of the property in the
+ * specified timeline.
+ * @param {string} target The timeline.
+ * @param {number} property The integer corresponding to the desired property.
+ * @return {string} The value of the property.
+ */
+HTMLObjectElement.prototype.TGetProperty = function(target, property) {};
+
+/**
+ * Returns a number indicating the value of the property in the specified
+ * timeline.
+ * @param {string} target The timeline.
+ * @param {number} property The integer corresponding to the desired property.
+ * @return {number} A number indicating the value of the property.
+ */
+HTMLObjectElement.prototype.TGetPropertyAsNumber = function(target, property) {};
+
+/**
+ * Goes to the specified frame number in the specified timeline.
+ * @param {string} target The timeline.
+ * @param {number} frameNumber The frame number.
+ */
+HTMLObjectElement.prototype.TGotoFrame = function(target, frameNumber) {};
+
+/**
+ * Goes to the specified frame label in the specified timeline.
+ * @param {string} target The timeline.
+ * @param {string} label The framelabel.
+ */
+HTMLObjectElement.prototype.TGotoLabel = function(target, label) {};
+
+/**
+ * Plays the specified timeline.
+ * @param {number} target The timeline.
+ */
+HTMLObjectElement.prototype.TPlay = function(target) {};
+
+/**
+ * Sets the value of the property in the specified timeline.
+ * @param {number} target The timeline.
+ * @param {number} property The integer corresponding to the desired property.
+ * @param {string|number} value The value.
+ */
+HTMLObjectElement.prototype.TSetProperty = function(target, property, value) {};
+
+/**
+ * Stops the specified timeline.
+ * @param {number} target The timeline.
+ */
+HTMLObjectElement.prototype.TStopPlay = function(target) {};
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_css.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_css.js
new file mode 100644
index 0000000000..c85f7b10fa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_css.js
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2008 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for Gecko's custom CSS properties. Copied from:
+ * http://mxr.mozilla.org/mozilla2.0/source/dom/interfaces/css/nsIDOMCSS2Properties.idl
+ *
+ * @externs
+ * @author nicksantos@google.com (Nick Santos)
+ */
+
+
+/** @type {string} */ CSSProperties.prototype.MozAppearance;
+/** @type {string} */ CSSProperties.prototype.MozBackfaceVisibility;
+/** @type {string} */ CSSProperties.prototype.MozBackgroundClip;
+/** @type {string} */ CSSProperties.prototype.MozBackgroundInlinePolicy;
+/** @type {string} */ CSSProperties.prototype.MozBackgroundOrigin;
+/** @type {string} */ CSSProperties.prototype.MozBinding;
+/** @type {string} */ CSSProperties.prototype.MozBorderBottomColors;
+/** @type {string} */ CSSProperties.prototype.MozBorderEnd;
+/** @type {string} */ CSSProperties.prototype.MozBorderEndColor;
+/** @type {string} */ CSSProperties.prototype.MozBorderEndStyle;
+/** @type {string} */ CSSProperties.prototype.MozBorderEndWidth;
+/** @type {string} */ CSSProperties.prototype.MozBorderImage;
+/** @type {string} */ CSSProperties.prototype.MozBorderLeftColors;
+/** @type {string} */ CSSProperties.prototype.MozBorderRadius;
+/** @type {string} */ CSSProperties.prototype.MozBorderRadiusTopleft;
+/** @type {string} */ CSSProperties.prototype.MozBorderRadiusTopright;
+/** @type {string} */ CSSProperties.prototype.MozBorderRadiusBottomleft;
+/** @type {string} */ CSSProperties.prototype.MozBorderRadiusBottomright;
+/** @type {string} */ CSSProperties.prototype.MozBorderRightColors;
+/** @type {string} */ CSSProperties.prototype.MozBorderStart;
+/** @type {string} */ CSSProperties.prototype.MozBorderStartColor;
+/** @type {string} */ CSSProperties.prototype.MozBorderStartStyle;
+/** @type {string} */ CSSProperties.prototype.MozBorderStartWidth;
+/** @type {string} */ CSSProperties.prototype.MozBorderTopColors;
+/** @type {string} */ CSSProperties.prototype.MozBoxAlign;
+/** @type {string} */ CSSProperties.prototype.MozBoxDirection;
+/** @type {string} */ CSSProperties.prototype.MozBoxFlex;
+/** @type {string} */ CSSProperties.prototype.MozBoxOrdinalGroup;
+/** @type {string} */ CSSProperties.prototype.MozBoxOrient;
+/** @type {string} */ CSSProperties.prototype.MozBoxPack;
+/** @type {string} */ CSSProperties.prototype.MozBoxSizing;
+/** @type {string} */ CSSProperties.prototype.MozBoxShadow;
+/** @type {string} */ CSSProperties.prototype.MozColumnCount;
+/** @type {string} */ CSSProperties.prototype.MozColumnGap;
+/** @type {string} */ CSSProperties.prototype.MozColumnRule;
+/** @type {string} */ CSSProperties.prototype.MozColumnRuleColor;
+/** @type {string} */ CSSProperties.prototype.MozColumnRuleStyle;
+/** @type {string} */ CSSProperties.prototype.MozColumnRuleWidth;
+/** @type {string} */ CSSProperties.prototype.MozColumnWidth;
+/** @type {string} */ CSSProperties.prototype.MozFloatEdge;
+/** @type {string} */ CSSProperties.prototype.MozFontFeatureSettings;
+/** @type {string} */ CSSProperties.prototype.MozFontLanguageOverride;
+/** @type {string} */ CSSProperties.prototype.MozForceBrokenImageIcon;
+/** @type {string} */ CSSProperties.prototype.MozImageRegion;
+/** @type {string} */ CSSProperties.prototype.MozMarginEnd;
+/** @type {string} */ CSSProperties.prototype.MozMarginStart;
+/** @type {number|string} */ CSSProperties.prototype.MozOpacity;
+/** @type {string} */ CSSProperties.prototype.MozOutline;
+/** @type {string} */ CSSProperties.prototype.MozOutlineColor;
+/** @type {string} */ CSSProperties.prototype.MozOutlineOffset;
+/** @type {string} */ CSSProperties.prototype.MozOutlineRadius;
+/** @type {string} */ CSSProperties.prototype.MozOutlineRadiusBottomleft;
+/** @type {string} */ CSSProperties.prototype.MozOutlineRadiusBottomright;
+/** @type {string} */ CSSProperties.prototype.MozOutlineRadiusTopleft;
+/** @type {string} */ CSSProperties.prototype.MozOutlineRadiusTopright;
+/** @type {string} */ CSSProperties.prototype.MozOutlineStyle;
+/** @type {string} */ CSSProperties.prototype.MozOutlineWidth;
+/** @type {string} */ CSSProperties.prototype.MozPaddingEnd;
+/** @type {string} */ CSSProperties.prototype.MozPaddingStart;
+/** @type {string} */ CSSProperties.prototype.MozPerspective;
+/** @type {string} */ CSSProperties.prototype.MozStackSizing;
+/** @type {string} */ CSSProperties.prototype.MozTabSize;
+/** @type {string} */ CSSProperties.prototype.MozTransform;
+/** @type {string} */ CSSProperties.prototype.MozTransformOrigin;
+/** @type {string} */ CSSProperties.prototype.MozTransition;
+/** @type {string} */ CSSProperties.prototype.MozTransitionDelay;
+/** @type {string} */ CSSProperties.prototype.MozTransitionDuration;
+/** @type {string} */ CSSProperties.prototype.MozTransitionProperty;
+/** @type {string} */ CSSProperties.prototype.MozTransitionTimingFunction;
+/** @type {string} */ CSSProperties.prototype.MozUserFocus;
+/** @type {string} */ CSSProperties.prototype.MozUserInput;
+/** @type {string} */ CSSProperties.prototype.MozUserModify;
+/** @type {string} */ CSSProperties.prototype.MozUserSelect;
+/** @type {string} */ CSSProperties.prototype.MozWindowShadow;
+
+
+// These are non-standard Gecko CSSOM properties on Window.prototype.screen.
+
+/**
+ * @type {number}
+ * @see https://developer.mozilla.org/En/DOM/window.screen.availTop
+ */
+Screen.prototype.availTop;
+
+/**
+ * @type {number}
+ * @see https://developer.mozilla.org/En/DOM/window.screen.availLeft
+ */
+Screen.prototype.availLeft;
+
+/**
+ * @type {number}
+ * @see https://developer.mozilla.org/En/DOM/window.screen.left
+ */
+Screen.prototype.left;
+
+/**
+ * @type {number}
+ * @see https://developer.mozilla.org/En/DOM/window.screen.top
+ */
+Screen.prototype.top;
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_dom.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_dom.js
new file mode 100644
index 0000000000..a3314d8123
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_dom.js
@@ -0,0 +1,1120 @@
+/*
+ * Copyright 2008 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for all the extensions over
+ * W3C's DOM specification by Gecko. This file depends on
+ * w3c_dom2.js.
+ *
+ * When a non-standard extension appears in both Gecko and IE, we put
+ * it in gecko_dom.js
+ *
+ * @externs
+ */
+
+// TODO: Almost all of it has not been annotated with types.
+
+// Gecko DOM;
+
+/**
+ * Mozilla only???
+ * @constructor
+ * @extends {HTMLElement}
+ */
+function HTMLSpanElement() {}
+
+/**
+ * @see https://developer.mozilla.org/en/Components_object
+ */
+Window.prototype.Components;
+
+/**
+ * @type Window
+ * @see https://developer.mozilla.org/en/DOM/window.content
+ */
+Window.prototype.content;
+
+/**
+ * @type {boolean}
+ * @see https://developer.mozilla.org/en/DOM/window.closed
+ */
+Window.prototype.closed;
+
+/** @see https://developer.mozilla.org/en/DOM/window.controllers */
+Window.prototype.controllers;
+
+/** @see https://developer.mozilla.org/en/DOM/window.crypto */
+Window.prototype.crypto;
+
+/**
+ * Gets/sets the status bar text for the given window.
+ * @type {string}
+ * @see https://developer.mozilla.org/en/DOM/window.defaultStatus
+ */
+Window.prototype.defaultStatus;
+
+/** @see https://developer.mozilla.org/en/DOM/window.dialogArguments */
+Window.prototype.dialogArguments;
+
+/** @see https://developer.mozilla.org/en/DOM/window.directories */
+Window.prototype.directories;
+
+/**
+ * @type {HTMLObjectElement|HTMLIFrameElement|null}
+ * @see https://developer.mozilla.org/en/DOM/window.frameElement
+ */
+Window.prototype.frameElement;
+
+/**
+ * Allows lookup of frames by index or by name.
+ * @type {?Object}
+ * @see https://developer.mozilla.org/en/DOM/window.frames
+ */
+Window.prototype.frames;
+
+/**
+ * @type {boolean}
+ * @see https://developer.mozilla.org/en/DOM/window.fullScreen
+ */
+Window.prototype.fullScreen;
+
+/**
+ * @see https://developer.mozilla.org/en/DOM/Storage#globalStorage
+ */
+Window.prototype.globalStorage;
+
+/**
+ * @type {!History}
+ * @see https://developer.mozilla.org/en/DOM/window.history
+ */
+Window.prototype.history;
+
+/**
+ * Returns the number of frames (either frame or iframe elements) in the
+ * window.
+ *
+ * @type {number}
+ * @see https://developer.mozilla.org/en/DOM/window.length
+ */
+Window.prototype.length;
+
+/**
+ * @type {!Location}
+ * @implicitCast
+ * @see https://developer.mozilla.org/en/DOM/window.location
+ */
+Window.prototype.location;
+
+/**
+ * @see https://developer.mozilla.org/en/DOM/window.locationbar
+ */
+Window.prototype.locationbar;
+
+/**
+ * @see https://developer.mozilla.org/en/DOM/window.menubar
+ */
+Window.prototype.menubar;
+
+/**
+ * @type {string}
+ * @see https://developer.mozilla.org/en/DOM/window.name
+ */
+Window.prototype.name;
+
+/**
+ * @type {Navigator}
+ * @see https://developer.mozilla.org/en/DOM/window.navigator
+ */
+Window.prototype.navigator;
+
+/**
+ * @type {?Window}
+ * @see https://developer.mozilla.org/en/DOM/window.opener
+ */
+Window.prototype.opener;
+
+/**
+ * @type {!Window}
+ * @see https://developer.mozilla.org/en/DOM/window.parent
+ */
+Window.prototype.parent;
+
+/** @see https://developer.mozilla.org/en/DOM/window.personalbar */
+Window.prototype.personalbar;
+
+/** @see https://developer.mozilla.org/en/DOM/window.pkcs11 */
+Window.prototype.pkcs11;
+
+/** @see https://developer.mozilla.org/en/DOM/window */
+Window.prototype.returnValue;
+
+/** @see https://developer.mozilla.org/en/DOM/window.scrollbars */
+Window.prototype.scrollbars;
+
+/**
+ * @type {number}
+ * @see https://developer.mozilla.org/En/DOM/window.scrollMaxX
+ */
+Window.prototype.scrollMaxX;
+
+/**
+ * @type {number}
+ * @see https://developer.mozilla.org/En/DOM/window.scrollMaxY
+ */
+Window.prototype.scrollMaxY;
+
+/**
+ * @type {!Window}
+ * @see https://developer.mozilla.org/en/DOM/window.self
+ */
+Window.prototype.self;
+
+/** @see https://developer.mozilla.org/en/DOM/Storage#sessionStorage */
+Window.prototype.sessionStorage;
+
+/** @see https://developer.mozilla.org/en/DOM/window.sidebar */
+Window.prototype.sidebar;
+
+/**
+ * @type {?string}
+ * @see https://developer.mozilla.org/en/DOM/window.status
+ */
+Window.prototype.status;
+
+/** @see https://developer.mozilla.org/en/DOM/window.statusbar */
+Window.prototype.statusbar;
+
+/** @see https://developer.mozilla.org/en/DOM/window.toolbar */
+Window.prototype.toolbar;
+
+/**
+ * @type {!Window}
+ * @see https://developer.mozilla.org/en/DOM/window.self
+ */
+Window.prototype.top;
+
+/**
+ * @type {!Window}
+ * @see https://developer.mozilla.org/en/DOM/window.self
+ */
+Window.prototype.window;
+
+/**
+ * @param {*} message
+ * @see https://developer.mozilla.org/en/DOM/window.alert
+ */
+Window.prototype.alert = function(message) {};
+
+/**
+ * Decodes a string of data which has been encoded using base-64 encoding.
+ *
+ * @param {string} encodedData
+ * @return {string}
+ * @see https://developer.mozilla.org/en/DOM/window.atob
+ * @nosideeffects
+ */
+function atob(encodedData) {}
+
+/** @see https://developer.mozilla.org/en/DOM/window.back */
+Window.prototype.back = function() {};
+
+/** @see https://developer.mozilla.org/en/DOM/window.blur */
+Window.prototype.blur = function() {};
+
+/**
+ * @param {string} stringToEncode
+ * @return {string}
+ * @see https://developer.mozilla.org/en/DOM/window.btoa
+ * @nosideeffects
+ */
+function btoa(stringToEncode) {}
+
+/** @deprecated */
+Window.prototype.captureEvents;
+
+/** @see https://developer.mozilla.org/en/DOM/window.close */
+Window.prototype.close = function() {};
+
+/** @see https://developer.mozilla.org/en/DOM/window.find */
+Window.prototype.find;
+
+/** @see https://developer.mozilla.org/en/DOM/window.focus */
+Window.prototype.focus = function() {};
+
+/** @see https://developer.mozilla.org/en/DOM/window.forward */
+Window.prototype.forward = function() {};
+
+/** @see https://developer.mozilla.org/en/DOM/window.getAttention */
+Window.prototype.getAttention = function() {};
+
+/**
+ * @return {Selection}
+ * @see https://developer.mozilla.org/en/DOM/window.getSelection
+ * @nosideeffects
+ */
+Window.prototype.getSelection = function() {};
+
+/** @see https://developer.mozilla.org/en/DOM/window.home */
+Window.prototype.home = function() {};
+
+Window.prototype.openDialog;
+Window.prototype.releaseEvents;
+Window.prototype.scrollByLines;
+Window.prototype.scrollByPages;
+
+/**
+ * @param {string} uri
+ * @param {?=} opt_arguments
+ * @param {string=} opt_options
+ * @see https://developer.mozilla.org/en/DOM/window.showModalDialog
+ */
+Window.prototype.showModalDialog;
+
+Window.prototype.sizeToContent;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536769(VS.85).aspx
+ */
+Window.prototype.stop = function() {};
+
+Window.prototype.updateCommands;
+
+// properties of Document
+
+/**
+ * @see https://developer.mozilla.org/en/DOM/document.alinkColor
+ * @type {string}
+ */
+Document.prototype.alinkColor;
+
+/**
+ * @see https://developer.mozilla.org/en/DOM/document.anchors
+ * @type {HTMLCollection}
+ */
+Document.prototype.anchors;
+
+/**
+ * @see https://developer.mozilla.org/en/DOM/document.applets
+ * @type {HTMLCollection}
+ */
+Document.prototype.applets;
+/** @type {boolean} */ Document.prototype.async;
+/** @type {string?} */ Document.prototype.baseURI;
+Document.prototype.baseURIObject;
+
+/**
+ * @see https://developer.mozilla.org/en/DOM/document.bgColor
+ * @type {string}
+ */
+Document.prototype.bgColor;
+
+/** @type {HTMLBodyElement} */ Document.prototype.body;
+Document.prototype.characterSet;
+
+/**
+ * @see https://developer.mozilla.org/en/DOM/document.compatMode
+ * @type {string}
+ */
+Document.prototype.compatMode;
+
+Document.prototype.contentType;
+/** @type {string} */ Document.prototype.cookie;
+Document.prototype.defaultView;
+
+/**
+ * @see https://developer.mozilla.org/en/DOM/document.designMode
+ * @type {string}
+ */
+Document.prototype.designMode;
+
+Document.prototype.documentURIObject;
+
+/**
+ * @see https://developer.mozilla.org/en/DOM/document.domain
+ * @type {string}
+ */
+Document.prototype.domain;
+
+/**
+ * @see https://developer.mozilla.org/en/DOM/document.embeds
+ * @type {HTMLCollection}
+ */
+Document.prototype.embeds;
+
+/**
+ * @see https://developer.mozilla.org/en/DOM/document.fgColor
+ * @type {string}
+ */
+Document.prototype.fgColor;
+
+/** @type {Element} */ Document.prototype.firstChild;
+
+/**
+ * @see https://developer.mozilla.org/en/DOM/document.forms
+ * @type {HTMLCollection}
+ */
+Document.prototype.forms;
+
+/** @type {number} */ Document.prototype.height;
+/** @type {HTMLCollection} */ Document.prototype.images;
+
+/**
+ * @type {string}
+ * @see https://developer.mozilla.org/en/DOM/document.lastModified
+ */
+Document.prototype.lastModified;
+
+/**
+ * @type {string}
+ * @see https://developer.mozilla.org/en/DOM/document.linkColor
+ */
+Document.prototype.linkColor;
+
+/**
+ * @see https://developer.mozilla.org/en/DOM/document.links
+ * @type {HTMLCollection}
+ */
+Document.prototype.links;
+
+/**
+ * @type {!Location}
+ * @implicitCast
+ */
+Document.prototype.location;
+
+Document.prototype.namespaceURI;
+Document.prototype.nodePrincipal;
+Document.prototype.plugins;
+Document.prototype.popupNode;
+
+/**
+ * @type {string}
+ * @see https://developer.mozilla.org/en/DOM/document.referrer
+ */
+Document.prototype.referrer;
+
+/**
+ * @type {StyleSheetList}
+ * @see https://developer.mozilla.org/en/DOM/document.styleSheets
+ */
+Document.prototype.styleSheets;
+
+/** @type {?string} */ Document.prototype.title;
+Document.prototype.tooltipNode;
+/** @type {string} */ Document.prototype.URL;
+
+/**
+ * @type {string}
+ * @see https://developer.mozilla.org/en/DOM/document.vlinkColor
+ */
+Document.prototype.vlinkColor;
+
+/** @type {number} */ Document.prototype.width;
+
+// Methods of Document
+/**
+ * @see https://developer.mozilla.org/en/DOM/document.clear
+ */
+Document.prototype.clear = function() {};
+
+/**
+ * @see https://developer.mozilla.org/en/DOM/document.close
+ */
+Document.prototype.close;
+
+/**
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/document.createElementNS
+ * @see http://w3c.github.io/webcomponents/spec/custom/#extensions-to-document-interface-to-instantiate
+ * @param {?string} namespaceURI
+ * @param {string} qualifiedName
+ * @param {string=} opt_typeExtension
+ * @return {!Element}
+ */
+Document.prototype.createElementNS =
+ function(namespaceURI, qualifiedName, opt_typeExtension) {};
+
+/**
+ * @param {string} type
+ * @return {Event}
+ */
+Document.prototype.createEvent = function(type) {};
+Document.prototype.createNSResolver;
+/** @return {Range} */ Document.prototype.createRange = function() {};
+Document.prototype.createTreeWalker;
+
+Document.prototype.evaluate;
+
+/**
+ * @param {string} commandName
+ * @param {?boolean=} opt_showUi
+ * @param {*=} opt_value
+ * @see https://developer.mozilla.org/en/Rich-Text_Editing_in_Mozilla#Executing_Commands
+ */
+Document.prototype.execCommand;
+
+/**
+ * @param {string} s id.
+ * @return {HTMLElement}
+ * @nosideeffects
+ * @see https://developer.mozilla.org/en/DOM/document.getElementById
+ */
+Document.prototype.getElementById = function(s) {};
+
+/**
+ * @param {string} name
+ * @return {!NodeList}
+ * @nosideeffects
+ * @see https://developer.mozilla.org/en/DOM/document.getElementsByClassName
+ */
+Document.prototype.getElementsByClassName = function(name) {};
+
+/**
+ * @param {string} name
+ * @return {!NodeList}
+ * @nosideeffects
+ * @see https://developer.mozilla.org/en/DOM/document.getElementsByName
+ */
+Document.prototype.getElementsByName = function(name) {};
+
+/**
+ * @param {string} namespace
+ * @param {string} name
+ * @return {!NodeList}
+ * @nosideeffects
+ * @see https://developer.mozilla.org/en/DOM/document.getElementsByTagNameNS
+ */
+Document.prototype.getElementsByTagNameNS = function(namespace, name) {};
+
+/**
+ * @param {Node} externalNode
+ * @param {boolean} deep
+ * @return {Node}
+ */
+Document.prototype.importNode = function(externalNode, deep) {};
+
+/** @param {string} uri */
+Document.prototype.load = function(uri) {};
+Document.prototype.loadOverlay;
+
+/**
+ * @see https://developer.mozilla.org/en/DOM/document.open
+ */
+Document.prototype.open;
+
+/**
+ * @see https://developer.mozilla.org/en/Midas
+ * @see http://msdn.microsoft.com/en-us/library/ms536676(VS.85).aspx
+ */
+Document.prototype.queryCommandEnabled;
+
+/**
+ * @see https://developer.mozilla.org/en/Midas
+ * @see http://msdn.microsoft.com/en-us/library/ms536678(VS.85).aspx
+ */
+Document.prototype.queryCommandIndeterm;
+
+/**
+ * @see https://developer.mozilla.org/en/Midas
+ * @see http://msdn.microsoft.com/en-us/library/ms536679(VS.85).aspx
+ */
+Document.prototype.queryCommandState;
+
+/**
+ * @see https://developer.mozilla.org/en/DOM/document.queryCommandSupported
+ * @see http://msdn.microsoft.com/en-us/library/ms536681(VS.85).aspx
+ * @param {string} command
+ * @return {?} Implementation-specific.
+ */
+Document.prototype.queryCommandSupported;
+
+/**
+ * @see https://developer.mozilla.org/en/Midas
+ * @see http://msdn.microsoft.com/en-us/library/ms536683(VS.85).aspx
+ */
+Document.prototype.queryCommandValue;
+
+/**
+ * @see https://developer.mozilla.org/en/DOM/document.write
+ * @param {string} text
+ */
+Document.prototype.write = function(text) {};
+
+/**
+ * @see https://developer.mozilla.org/en/DOM/document.writeln
+ * @param {string} text
+ */
+Document.prototype.writeln = function(text) {};
+
+Document.prototype.ononline;
+Document.prototype.onoffline;
+
+// XUL
+/**
+ * @see http://developer.mozilla.org/en/DOM/document.getBoxObjectFor
+ * @return {BoxObject}
+ * @nosideeffects
+ */
+Document.prototype.getBoxObjectFor = function(element) {};
+
+// From:
+// http://lxr.mozilla.org/mozilla1.8/source/dom/public/idl/range/nsIDOMNSRange.idl
+
+/**
+ * @param {string} tag
+ * @return {DocumentFragment}
+ */
+Range.prototype.createContextualFragment;
+
+/**
+ * @param {Node} parent
+ * @param {number} offset
+ * @return {boolean}
+ * @nosideeffects
+ */
+Range.prototype.isPointInRange;
+
+/**
+ * @param {Node} parent
+ * @param {number} offset
+ * @return {number}
+ * @nosideeffects
+ */
+Range.prototype.comparePoint;
+
+/**
+ * @param {Node} n
+ * @return {boolean}
+ * @nosideeffects
+ */
+Range.prototype.intersectsNode;
+
+/**
+ * @param {Node} n
+ * @return {number}
+ * @nosideeffects
+ */
+Range.prototype.compareNode;
+
+
+/** @constructor */
+function Selection() {}
+
+/**
+ * @type {Node}
+ * @see https://developer.mozilla.org/en/DOM/Selection/anchorNode
+ */
+Selection.prototype.anchorNode;
+
+/**
+ * @type {number}
+ * @see https://developer.mozilla.org/en/DOM/Selection/anchorOffset
+ */
+Selection.prototype.anchorOffset;
+
+/**
+ * @type {Node}
+ * @see https://developer.mozilla.org/en/DOM/Selection/focusNode
+ */
+Selection.prototype.focusNode;
+
+/**
+ * @type {number}
+ * @see https://developer.mozilla.org/en/DOM/Selection/focusOffset
+ */
+Selection.prototype.focusOffset;
+
+/**
+ * @type {boolean}
+ * @see https://developer.mozilla.org/en/DOM/Selection/isCollapsed
+ */
+Selection.prototype.isCollapsed;
+
+/**
+ * @type {number}
+ * @see https://developer.mozilla.org/en/DOM/Selection/rangeCount
+ */
+Selection.prototype.rangeCount;
+
+/**
+ * @param {Range} range
+ * @return {undefined}
+ * @see https://developer.mozilla.org/en/DOM/Selection/addRange
+ */
+Selection.prototype.addRange = function(range) {};
+
+/**
+ * @param {number} index
+ * @return {Range}
+ * @see https://developer.mozilla.org/en/DOM/Selection/getRangeAt
+ * @nosideeffects
+ */
+Selection.prototype.getRangeAt = function(index) {};
+
+/**
+ * @param {Node} node
+ * @param {number} index
+ * @return {undefined}
+ * @see https://developer.mozilla.org/en/DOM/Selection/collapse
+ */
+Selection.prototype.collapse = function(node, index) {};
+
+/**
+ * @return {undefined}
+ * @see https://developer.mozilla.org/en/DOM/Selection/collapseToEnd
+ */
+Selection.prototype.collapseToEnd = function() {};
+
+/**
+ * @return {undefined}
+ * @see https://developer.mozilla.org/en/DOM/Selection/collapseToStart
+ */
+Selection.prototype.collapseToStart = function() {};
+
+/**
+ * @param {Node} node
+ * @param {boolean} partlyContained
+ * @return {boolean}
+ * @see https://developer.mozilla.org/en/DOM/Selection/containsNode
+ * @nosideeffects
+ */
+Selection.prototype.containsNode = function(node, partlyContained) {};
+
+/**
+ * @see https://developer.mozilla.org/en/DOM/Selection/deleteFromDocument
+ */
+Selection.prototype.deleteFromDocument = function() {};
+
+/**
+ * @param {Node} parentNode
+ * @param {number} offset
+ * @see https://developer.mozilla.org/en/DOM/Selection/extend
+ */
+Selection.prototype.extend = function(parentNode, offset) {};
+
+/**
+ * @see https://developer.mozilla.org/en/DOM/Selection/removeAllRanges
+ */
+Selection.prototype.removeAllRanges = function() {};
+
+/**
+ * @param {Range} range
+ * @see https://developer.mozilla.org/en/DOM/Selection/removeRange
+ */
+Selection.prototype.removeRange = function(range) {};
+
+/**
+ * @param {Node} parentNode
+ * @see https://developer.mozilla.org/en/DOM/Selection/selectAllChildren
+ */
+Selection.prototype.selectAllChildren;
+
+/**
+ * @see https://developer.mozilla.org/en/DOM/Selection/selectionLanguageChange
+ */
+Selection.prototype.selectionLanguageChange;
+
+/** @type {NamedNodeMap} */ Element.prototype.attributes;
+Element.prototype.baseURIObject;
+/** @type {!NodeList} */ Element.prototype.childNodes;
+
+/**
+ * @type {!NodeList}
+ * @see https://developer.mozilla.org/en/DOM/element.children
+ */
+Element.prototype.children;
+
+/**
+ * @type {string}
+ * @implicitCast
+ */
+Element.prototype.className;
+/** @type {string} */ Element.prototype.dir;
+
+/**
+ * Firebug sets this property on elements it is inserting into the DOM.
+ * @type {boolean}
+ */
+Element.prototype.firebugIgnore;
+
+/** @type {Node} */ Element.prototype.firstChild;
+/**
+ * @type {string}
+ * @implicitCast
+ */
+Element.prototype.id;
+/**
+ * @type {string}
+ * @implicitCast
+ */
+Element.prototype.innerHTML;
+/** @type {string} */ Element.prototype.lang;
+/** @type {Node} */ Element.prototype.lastChild;
+Element.prototype.localName;
+Element.prototype.name;
+Element.prototype.namespaceURI;
+/** @type {Node} */ Element.prototype.nextSibling;
+Element.prototype.nodeName;
+Element.prototype.nodePrincipal;
+/** @type {number} */ Element.prototype.nodeType;
+Element.prototype.nodeValue;
+/** @type {Document} */ Element.prototype.ownerDocument;
+/** @type {Node} */ Element.prototype.parentNode;
+Element.prototype.prefix;
+/** @type {Node} */ Element.prototype.previousSibling;
+/** @type {!CSSStyleDeclaration} */ Element.prototype.style;
+/**
+ * @type {number}
+ * @implicitCast
+ */
+Element.prototype.tabIndex;
+
+/**
+ * @type {string}
+ * @implicitCast
+ */
+Element.prototype.textContent;
+/** @type {string} */ Element.prototype.title;
+
+/**
+ * @param {Node} child
+ * @return {Node} appendedElement.
+ * @override
+ */
+Element.prototype.appendChild = function(child) {};
+
+/**
+ * @override
+ * @return {!Element}
+ */
+Element.prototype.cloneNode = function(deep) {};
+
+/** @override */
+Element.prototype.dispatchEvent = function(event) {};
+
+/** @return {undefined} */
+Element.prototype.blur = function() {};
+
+/** @return {undefined} */
+Element.prototype.click = function() {};
+
+/** @return {undefined} */
+Element.prototype.focus = function() {};
+
+/**
+ * @return {boolean}
+ * @override
+ * @nosideeffects
+ */
+Element.prototype.hasAttributes = function() {};
+
+/**
+ * @return {boolean}
+ * @override
+ * @nosideeffects
+ */
+Element.prototype.hasChildNodes = function() {};
+
+/** @override */
+Element.prototype.insertBefore = function(insertedNode, adjacentNode) {};
+
+/**
+ * @return {undefined}
+ * @override
+ */
+Element.prototype.normalize = function() {};
+
+/**
+ * @param {Node} removedNode
+ * @return {!Node}
+ * @override
+ */
+Element.prototype.removeChild = function(removedNode) {};
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+Element.prototype.removeEventListener = function(type, handler, opt_useCapture)
+ {};
+
+/** @override */
+Element.prototype.replaceChild = function(insertedNode, replacedNode) {};
+
+/** @type {number} */
+HTMLInputElement.prototype.selectionStart;
+
+/** @type {number} */
+HTMLInputElement.prototype.selectionEnd;
+
+/**
+ * @param {number} selectionStart
+ * @param {number} selectionEnd
+ * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html#dom-textarea/input-setselectionrange
+ */
+HTMLInputElement.prototype.setSelectionRange =
+ function(selectionStart, selectionEnd) {};
+
+/** @type {number} */
+HTMLTextAreaElement.prototype.selectionStart;
+
+/** @type {number} */
+HTMLTextAreaElement.prototype.selectionEnd;
+
+/**
+ * @param {number} selectionStart
+ * @param {number} selectionEnd
+ * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html#dom-textarea/input-setselectionrange
+ */
+HTMLTextAreaElement.prototype.setSelectionRange =
+ function(selectionStart, selectionEnd) {};
+
+/** @constructor */
+function Navigator() {}
+
+/**
+ * @type {string}
+ * @see https://developer.mozilla.org/en/Navigator.appCodeName
+ */
+Navigator.prototype.appCodeName;
+
+/**
+ * @type {string}
+ * @see https://developer.mozilla.org/en/Navigator.appVersion
+ */
+Navigator.prototype.appName;
+
+/**
+ * @type {string}
+ * @see https://developer.mozilla.org/en/Navigator.appVersion
+ */
+Navigator.prototype.appVersion;
+
+/**
+ * @type {string}
+ * @see https://developer.mozilla.org/en/Navigator.buildID
+ */
+Navigator.prototype.buildID;
+
+/**
+ * @type {boolean}
+ * @see https://developer.mozilla.org/en/Navigator.cookieEnabled
+ */
+Navigator.prototype.cookieEnabled;
+
+/**
+ * @type {string}
+ * @see https://developer.mozilla.org/en/Navigator.language
+ */
+Navigator.prototype.language;
+
+/**
+ * @type {MimeTypeArray}
+ * @see https://developer.mozilla.org/en/Navigator.mimeTypes
+ */
+Navigator.prototype.mimeTypes;
+
+/**
+ * @type {boolean}
+ * @see https://developer.mozilla.org/en/Navigator.onLine
+ */
+Navigator.prototype.onLine;
+
+/**
+ * @type {string}
+ * @see https://developer.mozilla.org/en/Navigator.oscpu
+ */
+Navigator.prototype.oscpu;
+
+/**
+ * @type {string}
+ * @see https://developer.mozilla.org/en/Navigator.platform
+ */
+Navigator.prototype.platform;
+
+/**
+ * @type {PluginArray}
+ * @see https://developer.mozilla.org/en/Navigator.plugins
+ */
+Navigator.prototype.plugins;
+
+/**
+ * @type {string}
+ * @see https://developer.mozilla.org/en/Navigator.product
+ */
+Navigator.prototype.product;
+
+/**
+ * @type {string}
+ * @see https://developer.mozilla.org/en/Navigator.productSub
+ */
+Navigator.prototype.productSub;
+
+/**
+ * @type {string}
+ * @see https://developer.mozilla.org/en/Navigator.securityPolicy
+ */
+Navigator.prototype.securityPolicy;
+
+/**
+ * @param {string} url
+ * @param {ArrayBufferView|Blob|string|FormData=} opt_data
+ * @return {boolean}
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/navigator.sendBeacon
+ */
+Navigator.prototype.sendBeacon = function(url, opt_data) {};
+
+/**
+ * @type {string}
+ * @see https://developer.mozilla.org/en/Navigator.userAgent
+ */
+Navigator.prototype.userAgent;
+
+/**
+ * @type {string}
+ * @see https://developer.mozilla.org/en/Navigator.vendor
+ */
+Navigator.prototype.vendor;
+
+/**
+ * @type {string}
+ * @see https://developer.mozilla.org/en/Navigator.vendorSub
+ */
+Navigator.prototype.vendorSub;
+
+/**
+ * @type {function(): boolean}
+ * @see https://developer.mozilla.org/en/Navigator.javaEnabled
+ * @nosideeffects
+ */
+Navigator.prototype.javaEnabled = function() {};
+
+/**
+ * @constructor
+ * @see https://developer.mozilla.org/en/DOM/PluginArray
+ */
+function PluginArray() {}
+
+/** @type {number} */
+PluginArray.prototype.length;
+
+/**
+ * @param {number} index
+ * @return {Plugin}
+ */
+PluginArray.prototype.item = function(index) {};
+
+/**
+ * @param {string} name
+ * @return {Plugin}
+ */
+PluginArray.prototype.namedItem = function(name) {};
+
+/** @param {boolean=} reloadDocuments */
+PluginArray.prototype.refresh = function(reloadDocuments) {};
+
+/** @constructor */
+function MimeTypeArray() {}
+
+/**
+ * @param {number} index
+ * @return {MimeType}
+ */
+MimeTypeArray.prototype.item = function(index) {};
+
+/**
+ * @type {number}
+ * @see https://developer.mozilla.org/en/DOM/window.navigator.mimeTypes
+ */
+MimeTypeArray.prototype.length;
+
+/**
+ * @param {string} name
+ * @return {MimeType}
+ */
+MimeTypeArray.prototype.namedItem = function(name) {};
+
+/** @constructor */
+function MimeType() {}
+
+/** @type {string} */
+MimeType.prototype.description;
+
+/** @type {Plugin} */
+MimeType.prototype.enabledPlugin;
+
+/** @type {string} */
+MimeType.prototype.suffixes;
+
+/** @type {string} */
+MimeType.prototype.type;
+
+/** @constructor */
+function Plugin() {}
+
+/** @type {string} */
+Plugin.prototype.description;
+
+/** @type {string} */
+Plugin.prototype.filename;
+
+/** @type {number} */
+Plugin.prototype.length;
+
+/** @type {string} */
+Plugin.prototype.name;
+
+/** @constructor */
+function BoxObject() {}
+
+/** @type {Element} */
+BoxObject.prototype.element;
+
+/** @type {number} */
+BoxObject.prototype.screenX;
+
+/** @type {number} */
+BoxObject.prototype.screenY;
+
+/** @type {number} */
+BoxObject.prototype.x;
+
+/** @type {number} */
+BoxObject.prototype.y;
+
+/** @type {number} */
+BoxObject.prototype.width;
+
+
+/**
+ * @type {number}
+ * @see http://www.google.com/codesearch/p?hl=en#eksvcKKj5Ng/mozilla/dom/public/idl/html/nsIDOMNSHTMLImageElement.idl&q=naturalWidth
+ */
+HTMLImageElement.prototype.naturalWidth;
+
+/**
+ * @type {number}
+ * @see http://www.google.com/codesearch/p?hl=en#eksvcKKj5Ng/mozilla/dom/public/idl/html/nsIDOMNSHTMLImageElement.idl&q=naturalHeight
+ */
+HTMLImageElement.prototype.naturalHeight;
+
+
+/**
+ * @param {Element} element
+ * @param {?string=} pseudoElt
+ * @return {CSSStyleDeclaration}
+ * @nosideeffects
+ */
+function getComputedStyle(element, pseudoElt) {}
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_event.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_event.js
new file mode 100644
index 0000000000..cf3b21bf1c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_event.js
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2008 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for all the extensions over
+ * W3C's event specification by Gecko. This file depends on
+ * w3c_event.js.
+ *
+ * @externs
+ */
+
+// TODO: Almost all of it has not been annotated with types.
+
+/** @type {number} */ Event.prototype.HORIZONTAL_AXIS;
+/** @type {number} */ Event.prototype.VERTICAL_AXIS;
+/** @type {boolean} */ Event.prototype.altKey;
+/** @type {number} */ Event.prototype.axis;
+/** @type {number} */ Event.prototype.button;
+/** @type {boolean} */ Event.prototype.cancelBubble;
+/** @type {number} */ Event.prototype.charCode;
+/** @type {number} */ Event.prototype.clientX;
+/** @type {number} */ Event.prototype.clientY;
+/** @type {boolean} */ Event.prototype.ctrlKey;
+/** @type {EventTarget} */ Event.prototype.explicitOriginalTarget;
+/** @type {boolean} */ Event.prototype.isChar;
+/** @type {number} */ Event.prototype.keyCode;
+/** @type {number} */ Event.prototype.layerX;
+/** @type {number} */ Event.prototype.layerY;
+/** @type {boolean} */ Event.prototype.metaKey;
+/** @type {EventTarget} */ Event.prototype.originalTarget;
+/** @type {number} */ Event.prototype.pageX;
+/** @type {number} */ Event.prototype.pageY;
+/** @type {EventTarget} */ Event.prototype.relatedTarget;
+/** @type {number} */ Event.prototype.screenX;
+/** @type {number} */ Event.prototype.screenY;
+/** @type {boolean} */ Event.prototype.shiftKey;
+/** @type {Window} */ Event.prototype.view;
+/** @type {number} */ Event.prototype.which;
+
+/** @constructor */ function nsIDOMPageTransitionEvent() {}
+/** @type {boolean} */ nsIDOMPageTransitionEvent.prototype.persisted;
+
+//Methods
+Event.prototype.initKeyEvent;
+Event.prototype.initMouseEvent;
+Event.prototype.initUIEvent;
+Event.prototype.initMessageEvent;
+Event.prototype.preventBubble;
+Event.prototype.preventCapture;
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_xml.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_xml.js
new file mode 100644
index 0000000000..ccab53d672
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/gecko_xml.js
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2008 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for all the extensions over some of the
+ * W3C's XML specifications by Gecko. This file depends on
+ * w3c_xml.js. The whole file has been fully type annotated.
+ *
+ * @externs
+ */
+
+/**
+ * XMLSerializer can be used to convert DOM subtree or DOM document into text.
+ * XMLSerializer is available to unprivileged scripts.
+ *
+ * XMLSerializer is mainly useful for applications and extensions based on
+ * Mozilla platform. While it's available to web pages, it's not part of any
+ * standard and level of support in other browsers is unknown.
+ *
+ * @constructor
+ */
+function XMLSerializer() {}
+
+/**
+ * Returns the serialized subtree in the form of a string
+ * @param {Node} subtree
+ * @return {string}
+ */
+XMLSerializer.prototype.serializeToString = function(subtree) {};
+
+/**
+ * The subtree rooted by the specified element is serialized to a byte stream
+ * using the character set specified.
+ *
+ * @param {Node} subtree
+ * @return {Object}
+ */
+XMLSerializer.prototype.serializeToStream = function(subtree) {};
+
+/**
+ * DOMParser is mainly useful for applications and extensions based on Mozilla
+ * platform. While it's available to web pages, it's not part of any standard and
+ * level of support in other browsers is unknown.
+ *
+ * @constructor
+ */
+function DOMParser() {}
+
+/**
+ * The string passed in is parsed into a DOM document.
+ *
+ * Example:
+ * var parser = new DOMParser();
+ * var doc = parser.parseFromString(aStr, "text/xml");
+ *
+ * @param {string} src The UTF16 string to be parsed.
+ * @param {string} type The content type of the string.
+ * @return {Document}
+ */
+DOMParser.prototype.parseFromString = function(src, type) {};
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/google.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/google.js
new file mode 100644
index 0000000000..adb0e1a3fd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/google.js
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2010 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Declaration of the type level google namespace.
+ * @externs
+ * @author nicksantos@google.com (Nick Santos)
+ */
+
+/**
+ * Suppresses the compiler warning when multiple externs files declare the
+ * google namespace.
+ * @suppress {duplicate}
+ * @noalias
+ */
+// TODO(nicksantos): Consolidate to one google namespace declaration.
+var google = {};
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/html5.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/html5.js
new file mode 100644
index 0000000000..4e8fbd0ec7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/html5.js
@@ -0,0 +1,3231 @@
+/*
+ * Copyright 2008 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * @fileoverview Definitions for all the extensions over the
+ * W3C's DOM3 specification in HTML5. This file depends on
+ * w3c_dom3.js. The whole file has been fully type annotated.
+ *
+ * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/index.html
+ * @see http://dev.w3.org/html5/spec/Overview.html
+ *
+ * This also includes Typed Array definitions from
+ * http://www.khronos.org/registry/typedarray/specs/latest/
+ *
+ * This relies on w3c_event.js being included first.
+ *
+ * @externs
+ */
+
+
+/**
+ * Note: In IE, the contains() method only exists on Elements, not Nodes.
+ * Therefore, it is recommended that you use the Conformance framework to
+ * prevent calling this on Nodes which are not Elements.
+ * @see https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect
+ *
+ * @param {Node} n The node to check
+ * @return {boolean} If 'n' is this Node, or is contained within this Node.
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Node.contains
+ * @nosideeffects
+ */
+Node.prototype.contains = function(n) {};
+
+
+/**
+ * @constructor
+ * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#the-canvas-element
+ * @extends {HTMLElement}
+ */
+function HTMLCanvasElement() {}
+
+/** @type {number} */
+HTMLCanvasElement.prototype.width;
+
+/** @type {number} */
+HTMLCanvasElement.prototype.height;
+
+/**
+ * @param {string=} opt_type
+ * @param {...*} var_args
+ * @return {string}
+ * @throws {Error}
+ * @nosideeffects
+ */
+HTMLCanvasElement.prototype.toDataURL = function(opt_type, var_args) {};
+
+/**
+ * @param {string} contextId
+ * @param {Object=} opt_args
+ * @return {Object}
+ */
+HTMLCanvasElement.prototype.getContext = function(contextId, opt_args) {};
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/2dcontext/#canvasrenderingcontext2d
+ */
+function CanvasRenderingContext2D() {}
+
+/** @type {HTMLCanvasElement} */
+CanvasRenderingContext2D.prototype.canvas;
+
+/**
+ * @return {undefined}
+ */
+CanvasRenderingContext2D.prototype.save = function() {};
+
+/**
+ * @return {undefined}
+ */
+CanvasRenderingContext2D.prototype.restore = function() {};
+
+/**
+ * @param {number} x
+ * @param {number} y
+ * @return {undefined}
+ */
+CanvasRenderingContext2D.prototype.scale = function(x, y) {};
+
+/**
+ * @param {number} angle
+ * @return {undefined}
+ */
+CanvasRenderingContext2D.prototype.rotate = function(angle) {};
+
+/**
+ * @param {number} x
+ * @param {number} y
+ * @return {undefined}
+ */
+CanvasRenderingContext2D.prototype.translate = function(x, y) {};
+
+/**
+ * @param {number} m11
+ * @param {number} m12
+ * @param {number} m21
+ * @param {number} m22
+ * @param {number} dx
+ * @param {number} dy
+ * @return {undefined}
+ */
+CanvasRenderingContext2D.prototype.transform = function(
+ m11, m12, m21, m22, dx, dy) {};
+
+/**
+ * @param {number} m11
+ * @param {number} m12
+ * @param {number} m21
+ * @param {number} m22
+ * @param {number} dx
+ * @param {number} dy
+ * @return {undefined}
+ */
+CanvasRenderingContext2D.prototype.setTransform = function(
+ m11, m12, m21, m22, dx, dy) {};
+
+/**
+ * @param {number} x0
+ * @param {number} y0
+ * @param {number} x1
+ * @param {number} y1
+ * @return {CanvasGradient}
+ * @throws {Error}
+ * @nosideeffects
+ */
+CanvasRenderingContext2D.prototype.createLinearGradient = function(
+ x0, y0, x1, y1) {};
+
+/**
+ * @param {number} x0
+ * @param {number} y0
+ * @param {number} r0
+ * @param {number} x1
+ * @param {number} y1
+ * @param {number} r1
+ * @return {CanvasGradient}
+ * @throws {Error}
+ * @nosideeffects
+ */
+CanvasRenderingContext2D.prototype.createRadialGradient = function(
+ x0, y0, r0, x1, y1, r1) {};
+
+/**
+ * @param {HTMLImageElement|HTMLCanvasElement} image
+ * @param {string} repetition
+ * @return {CanvasPattern}
+ * @throws {Error}
+ * @nosideeffects
+ */
+CanvasRenderingContext2D.prototype.createPattern = function(
+ image, repetition) {};
+
+/**
+ * @param {number} x
+ * @param {number} y
+ * @param {number} w
+ * @param {number} h
+ * @return {undefined}
+ */
+CanvasRenderingContext2D.prototype.clearRect = function(x, y, w, h) {};
+
+/**
+ * @param {number} x
+ * @param {number} y
+ * @param {number} w
+ * @param {number} h
+ * @return {undefined}
+ */
+CanvasRenderingContext2D.prototype.fillRect = function(x, y, w, h) {};
+
+/**
+ * @param {number} x
+ * @param {number} y
+ * @param {number} w
+ * @param {number} h
+ * @return {undefined}
+ */
+CanvasRenderingContext2D.prototype.strokeRect = function(x, y, w, h) {};
+
+/**
+ * @return {undefined}
+ */
+CanvasRenderingContext2D.prototype.beginPath = function() {};
+
+/**
+ * @return {undefined}
+ */
+CanvasRenderingContext2D.prototype.closePath = function() {};
+
+/**
+ * @param {number} x
+ * @param {number} y
+ * @return {undefined}
+ */
+CanvasRenderingContext2D.prototype.moveTo = function(x, y) {};
+
+/**
+ * @param {number} x
+ * @param {number} y
+ * @return {undefined}
+ */
+CanvasRenderingContext2D.prototype.lineTo = function(x, y) {};
+
+/**
+ * @param {number} cpx
+ * @param {number} cpy
+ * @param {number} x
+ * @param {number} y
+ * @return {undefined}
+ */
+CanvasRenderingContext2D.prototype.quadraticCurveTo = function(
+ cpx, cpy, x, y) {};
+
+/**
+ * @param {number} cp1x
+ * @param {number} cp1y
+ * @param {number} cp2x
+ * @param {number} cp2y
+ * @param {number} x
+ * @param {number} y
+ * @return {undefined}
+ */
+CanvasRenderingContext2D.prototype.bezierCurveTo = function(
+ cp1x, cp1y, cp2x, cp2y, x, y) {};
+
+/**
+ * @param {number} x1
+ * @param {number} y1
+ * @param {number} x2
+ * @param {number} y2
+ * @param {number} radius
+ * @return {undefined}
+ */
+CanvasRenderingContext2D.prototype.arcTo = function(x1, y1, x2, y2, radius) {};
+
+/**
+ * @param {number} x
+ * @param {number} y
+ * @param {number} w
+ * @param {number} h
+ * @return {undefined}
+ */
+CanvasRenderingContext2D.prototype.rect = function(x, y, w, h) {};
+
+/**
+ * @param {number} x
+ * @param {number} y
+ * @param {number} radius
+ * @param {number} startAngle
+ * @param {number} endAngle
+ * @param {boolean=} opt_anticlockwise
+ * @return {undefined}
+ */
+CanvasRenderingContext2D.prototype.arc = function(
+ x, y, radius, startAngle, endAngle, opt_anticlockwise) {};
+
+/**
+ * @return {undefined}
+ */
+CanvasRenderingContext2D.prototype.fill = function() {};
+
+/**
+ * @return {undefined}
+ */
+CanvasRenderingContext2D.prototype.stroke = function() {};
+
+/**
+ * @return {undefined}
+ */
+CanvasRenderingContext2D.prototype.clip = function() {};
+
+/**
+ * @param {number} x
+ * @param {number} y
+ * @return {boolean}
+ * @nosideeffects
+ */
+CanvasRenderingContext2D.prototype.isPointInPath = function(x, y) {};
+
+/**
+ * @param {string} text
+ * @param {number} x
+ * @param {number} y
+ * @param {number=} opt_maxWidth
+ * @return {undefined}
+ */
+CanvasRenderingContext2D.prototype.fillText = function(
+ text, x, y, opt_maxWidth) {};
+
+/**
+ * @param {string} text
+ * @param {number} x
+ * @param {number} y
+ * @param {number=} opt_maxWidth
+ * @return {undefined}
+ */
+CanvasRenderingContext2D.prototype.strokeText = function(
+ text, x, y, opt_maxWidth) {};
+
+/**
+ * @param {string} text
+ * @return {TextMetrics}
+ * @nosideeffects
+ */
+CanvasRenderingContext2D.prototype.measureText = function(text) {};
+
+/**
+ * @param {HTMLImageElement|HTMLCanvasElement|Image|HTMLVideoElement} image
+ * @param {number} dx Destination x coordinate.
+ * @param {number} dy Destination y coordinate.
+ * @param {number=} opt_dw Destination box width. Defaults to the image width.
+ * @param {number=} opt_dh Destination box height.
+ * Defaults to the image height.
+ * @param {number=} opt_sx Source box x coordinate. Used to select a portion of
+ * the source image to draw. Defaults to 0.
+ * @param {number=} opt_sy Source box y coordinate. Used to select a portion of
+ * the source image to draw. Defaults to 0.
+ * @param {number=} opt_sw Source box width. Used to select a portion of
+ * the source image to draw. Defaults to the full image width.
+ * @param {number=} opt_sh Source box height. Used to select a portion of
+ * the source image to draw. Defaults to the full image height.
+ * @return {undefined}
+ */
+CanvasRenderingContext2D.prototype.drawImage = function(
+ image, dx, dy, opt_dw, opt_dh, opt_sx, opt_sy, opt_sw, opt_sh) {};
+
+/**
+ * @param {number} sw
+ * @param {number} sh
+ * @return {ImageData}
+ * @nosideeffects
+ */
+CanvasRenderingContext2D.prototype.createImageData = function(sw, sh) {};
+
+/**
+ * @param {number} sx
+ * @param {number} sy
+ * @param {number} sw
+ * @param {number} sh
+ * @return {ImageData}
+ * @throws {Error}
+ * @nosideeffects
+ */
+CanvasRenderingContext2D.prototype.getImageData = function(sx, sy, sw, sh) {};
+
+/**
+ * @param {ImageData} imagedata
+ * @param {number} dx
+ * @param {number} dy
+ * @param {number=} opt_dirtyX
+ * @param {number=} opt_dirtyY
+ * @param {number=} opt_dirtyWidth
+ * @param {number=} opt_dirtyHeight
+ * @return {undefined}
+ */
+CanvasRenderingContext2D.prototype.putImageData = function(imagedata, dx, dy,
+ opt_dirtyX, opt_dirtyY, opt_dirtyWidth, opt_dirtyHeight) {};
+
+/**
+ * Note: WebKit only
+ * @param {number|string=} opt_a
+ * @param {number=} opt_b
+ * @param {number=} opt_c
+ * @param {number=} opt_d
+ * @param {number=} opt_e
+ * @see http://developer.apple.com/library/safari/#documentation/appleapplications/reference/WebKitDOMRef/CanvasRenderingContext2D_idl/Classes/CanvasRenderingContext2D/index.html
+ * @return {undefined}
+ */
+CanvasRenderingContext2D.prototype.setFillColor;
+
+/**
+ * Note: WebKit only
+ * @param {number|string=} opt_a
+ * @param {number=} opt_b
+ * @param {number=} opt_c
+ * @param {number=} opt_d
+ * @param {number=} opt_e
+ * @see http://developer.apple.com/library/safari/#documentation/appleapplications/reference/WebKitDOMRef/CanvasRenderingContext2D_idl/Classes/CanvasRenderingContext2D/index.html
+ * @return {undefined}
+ */
+CanvasRenderingContext2D.prototype.setStrokeColor;
+
+/**
+ * @return {Array.<number>}
+ */
+CanvasRenderingContext2D.prototype.getLineDash;
+
+/**
+ * @param {Array.<number>} segments
+ * @return {undefined}
+ */
+CanvasRenderingContext2D.prototype.setLineDash;
+
+/** @type {string} */
+CanvasRenderingContext2D.prototype.fillColor;
+
+/**
+ * @type {string}
+ * @implicitCast
+ */
+CanvasRenderingContext2D.prototype.fillStyle;
+
+/** @type {string} */
+CanvasRenderingContext2D.prototype.font;
+
+/** @type {number} */
+CanvasRenderingContext2D.prototype.globalAlpha;
+
+/** @type {string} */
+CanvasRenderingContext2D.prototype.globalCompositeOperation;
+
+/** @type {number} */
+CanvasRenderingContext2D.prototype.lineWidth;
+
+/** @type {string} */
+CanvasRenderingContext2D.prototype.lineCap;
+
+/** @type {string} */
+CanvasRenderingContext2D.prototype.lineJoin;
+
+/** @type {number} */
+CanvasRenderingContext2D.prototype.miterLimit;
+
+/** @type {number} */
+CanvasRenderingContext2D.prototype.shadowBlur;
+
+/** @type {string} */
+CanvasRenderingContext2D.prototype.shadowColor;
+
+/** @type {number} */
+CanvasRenderingContext2D.prototype.shadowOffsetX;
+
+/** @type {number} */
+CanvasRenderingContext2D.prototype.shadowOffsetY;
+
+/**
+ * @type {string}
+ * @implicitCast
+ */
+CanvasRenderingContext2D.prototype.strokeStyle;
+
+/** @type {string} */
+CanvasRenderingContext2D.prototype.strokeColor;
+
+/** @type {string} */
+CanvasRenderingContext2D.prototype.textAlign;
+
+/** @type {string} */
+CanvasRenderingContext2D.prototype.textBaseline;
+
+/**
+ * @constructor
+ */
+function CanvasGradient() {}
+
+/**
+ * @param {number} offset
+ * @param {string} color
+ * @return {undefined}
+ */
+CanvasGradient.prototype.addColorStop = function(offset, color) {};
+
+/**
+ * @constructor
+ */
+function CanvasPattern() {}
+
+/**
+ * @constructor
+ */
+function TextMetrics() {}
+
+/** @type {number} */
+TextMetrics.prototype.width;
+
+/**
+ * @constructor
+ */
+function ImageData() {}
+
+/** @type {Uint8ClampedArray} */
+ImageData.prototype.data;
+
+/** @type {number} */
+ImageData.prototype.width;
+
+/** @type {number} */
+ImageData.prototype.height;
+
+/**
+ * @constructor
+ */
+function ClientInformation() {}
+
+/** @type {boolean} */
+ClientInformation.prototype.onLine;
+
+/**
+ * @param {string} protocol
+ * @param {string} uri
+ * @param {string} title
+ * @return {undefined}
+ */
+ClientInformation.prototype.registerProtocolHandler = function(
+ protocol, uri, title) {};
+
+/**
+ * @param {string} mimeType
+ * @param {string} uri
+ * @param {string} title
+ * @return {undefined}
+ */
+ClientInformation.prototype.registerContentHandler = function(
+ mimeType, uri, title) {};
+
+// HTML5 Database objects
+/**
+ * @constructor
+ */
+function Database() {}
+
+/**
+ * @type {string}
+ */
+Database.prototype.version;
+
+/**
+ * @param {function(!SQLTransaction) : void} callback
+ * @param {(function(!SQLError) : void)=} opt_errorCallback
+ * @param {Function=} opt_Callback
+ */
+Database.prototype.transaction = function(
+ callback, opt_errorCallback, opt_Callback) {};
+
+/**
+ * @param {function(!SQLTransaction) : void} callback
+ * @param {(function(!SQLError) : void)=} opt_errorCallback
+ * @param {Function=} opt_Callback
+ */
+Database.prototype.readTransaction = function(
+ callback, opt_errorCallback, opt_Callback) {};
+
+/**
+ * @param {string} oldVersion
+ * @param {string} newVersion
+ * @param {function(!SQLTransaction) : void} callback
+ * @param {function(!SQLError) : void} errorCallback
+ * @param {Function} successCallback
+ */
+Database.prototype.changeVersion = function(
+ oldVersion, newVersion, callback, errorCallback, successCallback) {};
+
+/**
+ * @interface
+ */
+function DatabaseCallback() {}
+
+/**
+ * @param {!Database} db
+ * @return {undefined}
+ */
+DatabaseCallback.prototype.handleEvent = function(db) {};
+
+/**
+ * @constructor
+ */
+function SQLError() {}
+
+/**
+ * @type {number}
+ */
+SQLError.prototype.code;
+
+/**
+ * @type {string}
+ */
+SQLError.prototype.message;
+
+/**
+ * @constructor
+ */
+function SQLTransaction() {}
+
+/**
+ * @param {string} sqlStatement
+ * @param {Array.<*>=} opt_queryArgs
+ * @param {SQLStatementCallback=} opt_callback
+ * @param {(function(!SQLTransaction, !SQLError) : (boolean|void))=}
+ * opt_errorCallback
+ */
+SQLTransaction.prototype.executeSql = function(
+ sqlStatement, opt_queryArgs, opt_callback, opt_errorCallback) {};
+
+/**
+ * @typedef {(function(!SQLTransaction, !SQLResultSet) : void)}
+ */
+var SQLStatementCallback;
+
+/**
+ * @constructor
+ */
+function SQLResultSet() {}
+
+/**
+ * @type {number}
+ */
+SQLResultSet.prototype.insertId;
+
+/**
+ * @type {number}
+ */
+SQLResultSet.prototype.rowsAffected;
+
+/**
+ * @type {SQLResultSetRowList}
+ */
+SQLResultSet.prototype.rows;
+
+/**
+ * @constructor
+ */
+function SQLResultSetRowList() {}
+
+/**
+ * @type {number}
+ */
+SQLResultSetRowList.prototype.length;
+
+/**
+ * @param {number} index
+ * @return {Object}
+ * @nosideeffects
+ */
+SQLResultSetRowList.prototype.item = function(index) {};
+
+/**
+ * @param {string} name
+ * @param {string} version
+ * @param {string} description
+ * @param {number} size
+ * @param {(DatabaseCallback|function(Database))=} opt_callback
+ * @return {Database}
+ */
+function openDatabase(name, version, description, size, opt_callback) {}
+
+/**
+ * @param {string} name
+ * @param {string} version
+ * @param {string} description
+ * @param {number} size
+ * @param {(DatabaseCallback|function(Database))=} opt_callback
+ * @return {Database}
+ */
+Window.prototype.openDatabase =
+ function(name, version, description, size, opt_callback) {};
+
+/**
+ * @type {boolean}
+ */
+HTMLImageElement.prototype.complete;
+
+/**
+ * @type {string}
+ * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/embedded-content-1.html#attr-img-crossorigin
+ */
+HTMLImageElement.prototype.crossOrigin;
+
+/**
+ * This is a superposition of the Window and Worker postMessage methods.
+ * @param {*} message
+ * @param {(string|!Array.<!Transferable>)=} opt_targetOriginOrTransfer
+ * @param {(string|!Array.<!MessagePort>|!Array.<!Transferable>)=}
+ * opt_targetOriginOrPortsOrTransfer
+ * @return {void}
+ */
+function postMessage(message, opt_targetOriginOrTransfer,
+ opt_targetOriginOrPortsOrTransfer) {}
+
+/**
+ * The postMessage method (as implemented in Opera).
+ * @param {string} message
+ */
+Document.prototype.postMessage = function(message) {};
+
+/**
+ * Document head accessor.
+ * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/dom.html#the-head-element-0
+ * @type {HTMLHeadElement}
+ */
+Document.prototype.head;
+
+/**
+ * @see https://developer.apple.com/webapps/docs/documentation/AppleApplications/Reference/SafariJSRef/DOMApplicationCache/DOMApplicationCache.html
+ * @constructor
+ * @implements {EventTarget}
+ */
+function DOMApplicationCache() {}
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+DOMApplicationCache.prototype.addEventListener = function(
+ type, listener, opt_useCapture) {};
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+DOMApplicationCache.prototype.removeEventListener = function(
+ type, listener, opt_useCapture) {};
+
+/** @override */
+DOMApplicationCache.prototype.dispatchEvent = function(evt) {};
+
+/**
+ * The object isn't associated with an application cache. This can occur if the
+ * update process fails and there is no previous cache to revert to, or if there
+ * is no manifest file.
+ * @type {number}
+ */
+DOMApplicationCache.prototype.UNCACHED = 0;
+
+/**
+ * The cache is idle.
+ * @type {number}
+ */
+DOMApplicationCache.prototype.IDLE = 1;
+
+/**
+ * The update has started but the resources are not downloaded yet - for
+ * example, this can happen when the manifest file is fetched.
+ * @type {number}
+ */
+DOMApplicationCache.prototype.CHECKING = 2;
+
+/**
+ * The resources are being downloaded into the cache.
+ * @type {number}
+ */
+DOMApplicationCache.prototype.DOWNLOADING = 3;
+
+/**
+ * Resources have finished downloading and the new cache is ready to be used.
+ * @type {number}
+ */
+DOMApplicationCache.prototype.UPDATEREADY = 4;
+
+/**
+ * The cache is obsolete.
+ * @type {number}
+ */
+DOMApplicationCache.prototype.OBSOLETE = 5;
+
+/**
+ * The current status of the application cache.
+ * @type {number}
+ */
+DOMApplicationCache.prototype.status;
+
+/**
+ * Sent when the update process finishes for the first time; that is, the first
+ * time an application cache is saved.
+ * @type {?function(!Event)}
+ */
+DOMApplicationCache.prototype.oncached;
+
+/**
+ * Sent when the cache update process begins.
+ * @type {?function(!Event)}
+ */
+DOMApplicationCache.prototype.onchecking;
+
+/**
+ * Sent when the update process begins downloading resources in the manifest
+ * file.
+ * @type {?function(!Event)}
+ */
+DOMApplicationCache.prototype.ondownloading;
+
+/**
+ * Sent when an error occurs.
+ * @type {?function(!Event)}
+ */
+DOMApplicationCache.prototype.onerror;
+
+/**
+ * Sent when the update process finishes but the manifest file does not change.
+ * @type {?function(!Event)}
+ */
+DOMApplicationCache.prototype.onnoupdate;
+
+/**
+ * Sent when each resource in the manifest file begins to download.
+ * @type {?function(!Event)}
+ */
+DOMApplicationCache.prototype.onprogress;
+
+/**
+ * Sent when there is an existing application cache, the update process
+ * finishes, and there is a new application cache ready for use.
+ * @type {?function(!Event)}
+ */
+DOMApplicationCache.prototype.onupdateready;
+
+/**
+ * Replaces the active cache with the latest version.
+ * @throws {DOMException}
+ */
+DOMApplicationCache.prototype.swapCache = function() {};
+
+/**
+ * Manually triggers the update process.
+ * @throws {DOMException}
+ */
+DOMApplicationCache.prototype.update = function() {};
+
+/** @type {DOMApplicationCache} */
+var applicationCache;
+
+/** @type {DOMApplicationCache} */
+Window.prototype.applicationCache;
+
+/**
+ * @see https://developer.mozilla.org/En/DOM/Worker/Functions_available_to_workers
+ * @param {...string} var_args
+ */
+Window.prototype.importScripts = function(var_args) {};
+
+/**
+ * @see https://developer.mozilla.org/En/DOM/Worker/Functions_available_to_workers
+ * @param {...string} var_args
+ */
+var importScripts = function(var_args) {};
+
+/**
+ * @see http://dev.w3.org/html5/workers/
+ * @constructor
+ * @implements {EventTarget}
+ */
+function WebWorker() {}
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+WebWorker.prototype.addEventListener = function(
+ type, listener, opt_useCapture) {};
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+WebWorker.prototype.removeEventListener = function(
+ type, listener, opt_useCapture) {};
+
+/** @override */
+WebWorker.prototype.dispatchEvent = function(evt) {};
+
+/**
+ * Stops the worker process
+ */
+WebWorker.prototype.terminate = function() {};
+
+/**
+ * Posts a message to the worker thread.
+ * @param {string} message
+ */
+WebWorker.prototype.postMessage = function(message) {};
+
+/**
+ * Sent when the worker thread posts a message to its creator.
+ * @type {?function(!MessageEvent.<*>)}
+ */
+WebWorker.prototype.onmessage;
+
+/**
+ * Sent when the worker thread encounters an error.
+ * TODO(tbreisacher): Should this change to function(!ErrorEvent)?
+ * @type {?function(!Event)}
+ */
+WebWorker.prototype.onerror;
+
+/**
+ * @see http://dev.w3.org/html5/workers/
+ * @constructor
+ * @implements {EventTarget}
+ */
+function Worker(opt_arg0) {}
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+Worker.prototype.addEventListener = function(
+ type, listener, opt_useCapture) {};
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+Worker.prototype.removeEventListener = function(
+ type, listener, opt_useCapture) {};
+
+/** @override */
+Worker.prototype.dispatchEvent = function(evt) {};
+
+/**
+ * Stops the worker process
+ */
+Worker.prototype.terminate = function() {};
+
+/**
+ * Posts a message to the worker thread.
+ * @param {*} message
+ * @param {Array.<!Transferable>=} opt_transfer
+ */
+Worker.prototype.postMessage = function(message, opt_transfer) {};
+
+/**
+ * Posts a message to the worker thread.
+ * @param {*} message
+ * @param {Array.<!Transferable>=} opt_transfer
+ */
+Worker.prototype.webkitPostMessage = function(message, opt_transfer) {};
+
+/**
+ * Sent when the worker thread posts a message to its creator.
+ * @type {?function(!MessageEvent.<*>)}
+ */
+Worker.prototype.onmessage;
+
+/**
+ * Sent when the worker thread encounters an error.
+ * TODO(tbreisacher): Should this change to function(!ErrorEvent)?
+ * @type {?function(!Event)}
+ */
+Worker.prototype.onerror;
+
+/**
+ * @see http://dev.w3.org/html5/workers/
+ * @param {string} scriptURL The URL of the script to run in the SharedWorker.
+ * @param {string=} opt_name A name that can later be used to obtain a
+ * reference to the same SharedWorker.
+ * @constructor
+ * @implements {EventTarget}
+ */
+function SharedWorker(scriptURL, opt_name) {}
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+SharedWorker.prototype.addEventListener = function(
+ type, listener, opt_useCapture) {};
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+SharedWorker.prototype.removeEventListener = function(
+ type, listener, opt_useCapture) {};
+
+/** @override */
+SharedWorker.prototype.dispatchEvent = function(evt) {};
+
+/**
+ * @type {!MessagePort}
+ */
+SharedWorker.prototype.port;
+
+/**
+ * Called on network errors for loading the initial script.
+ * TODO(tbreisacher): Should this change to function(!ErrorEvent)?
+ * @type {?function(!Event)}
+ */
+SharedWorker.prototype.onerror;
+
+/**
+ * @see http://dev.w3.org/html5/workers/
+ * @interface
+ */
+function WorkerLocation() {}
+
+/** @type {string} */
+WorkerLocation.prototype.protocol;
+
+/** @type {string} */
+WorkerLocation.prototype.host;
+
+/** @type {string} */
+WorkerLocation.prototype.hostname;
+
+/** @type {string} */
+WorkerLocation.prototype.port;
+
+/** @type {string} */
+WorkerLocation.prototype.pathname;
+
+/** @type {string} */
+WorkerLocation.prototype.search;
+
+/** @type {string} */
+WorkerLocation.prototype.hash;
+
+/**
+ * @see http://dev.w3.org/html5/workers/
+ * @interface
+ * @extends {EventTarget}
+ */
+function WorkerGlobalScope() {}
+
+/** @type {WorkerGlobalScope} */
+WorkerGlobalScope.prototype.self;
+
+/** @type {WorkerLocation} */
+WorkerGlobalScope.prototype.location;
+
+/**
+ * Closes the worker represented by this WorkerGlobalScope.
+ */
+WorkerGlobalScope.prototype.close = function() {};
+
+/**
+ * Sent when the worker encounters an error.
+ * @type {?function(!Event)}
+ */
+WorkerGlobalScope.prototype.onerror;
+
+/**
+ * Sent when the worker goes offline.
+ * @type {?function(!Event)}
+ */
+WorkerGlobalScope.prototype.onoffline;
+
+/**
+ * Sent when the worker goes online.
+ * @type {?function(!Event)}
+ */
+WorkerGlobalScope.prototype.ononline;
+
+/**
+ * @see http://dev.w3.org/html5/workers/
+ * @interface
+ * @extends {WorkerGlobalScope}
+ */
+function DedicatedWorkerGlobalScope() {}
+
+/**
+ * Posts a message to creator of this worker.
+ * @param {*} message
+ * @param {Array.<!Transferable>=} opt_transfer
+ */
+DedicatedWorkerGlobalScope.prototype.postMessage =
+ function(message, opt_transfer) {};
+
+/**
+ * Posts a message to creator of this worker.
+ * @param {*} message
+ * @param {Array.<!Transferable>=} opt_transfer
+ */
+DedicatedWorkerGlobalScope.prototype.webkitPostMessage =
+ function(message, opt_transfer) {};
+
+/**
+ * Sent when the creator posts a message to this worker.
+ * @type {?function(!MessageEvent.<*>)}
+ */
+DedicatedWorkerGlobalScope.prototype.onmessage;
+
+/**
+ * @see http://dev.w3.org/html5/workers/
+ * @interface
+ * @extends {WorkerGlobalScope}
+ */
+function SharedWorkerGlobalScope() {}
+
+/** @type {string} */
+SharedWorkerGlobalScope.prototype.name;
+
+/**
+ * Sent when a connection to this worker is opened.
+ * @type {?function(!Event)}
+ */
+SharedWorkerGlobalScope.prototype.onconnect;
+
+/** @type {Element} */
+HTMLElement.prototype.contextMenu;
+
+/** @type {boolean} */
+HTMLElement.prototype.draggable;
+
+/**
+ * This is actually a DOMSettableTokenList property. However since that
+ * interface isn't currently defined and no known browsers implement this
+ * feature, just define the property for now.
+ *
+ * @const
+ * @type {Object}
+ */
+HTMLElement.prototype.dropzone;
+
+/**
+ * @see http://www.w3.org/TR/html5/dom.html#dom-getelementsbyclassname
+ * @param {string} classNames
+ * @return {!NodeList}
+ * @nosideeffects
+ */
+HTMLElement.prototype.getElementsByClassName = function(classNames) {};
+// NOTE: Document.prototype.getElementsByClassName is in gecko_dom.js
+
+/** @type {boolean} */
+HTMLElement.prototype.hidden;
+
+/** @type {boolean} */
+HTMLElement.prototype.spellcheck;
+
+/**
+ * @see http://www.w3.org/TR/components-intro/
+ * @return {!ShadowRoot}
+ */
+HTMLElement.prototype.createShadowRoot;
+
+/**
+ * @see http://www.w3.org/TR/components-intro/
+ * @return {!ShadowRoot}
+ */
+HTMLElement.prototype.webkitCreateShadowRoot;
+
+/**
+ * @see http://www.w3.org/TR/shadow-dom/
+ * @type {ShadowRoot}
+ */
+HTMLElement.prototype.shadowRoot;
+
+/**
+ * @see http://www.w3.org/TR/shadow-dom/
+ * @return {!NodeList}
+ */
+HTMLElement.prototype.getDestinationInsertionPoints = function() {};
+
+/**
+ * @see http://www.w3.org/TR/components-intro/
+ * @type {function()}
+ */
+HTMLElement.prototype.createdCallback;
+
+/**
+ * @see http://w3c.github.io/webcomponents/explainer/#lifecycle-callbacks
+ * @type {function()}
+ */
+HTMLElement.prototype.attachedCallback;
+
+/**
+ * @see http://w3c.github.io/webcomponents/explainer/#lifecycle-callbacks
+ * @type {function()}
+ */
+HTMLElement.prototype.detachedCallback;
+
+/** @type {string} */
+HTMLAnchorElement.prototype.hash;
+
+/** @type {string} */
+HTMLAnchorElement.prototype.host;
+
+/** @type {string} */
+HTMLAnchorElement.prototype.hostname;
+
+/** @type {string} */
+HTMLAnchorElement.prototype.pathname;
+
+/**
+ * The 'ping' attribute is known to be supported in recent versions (as of
+ * mid-2014) of Chrome, Safari, and Firefox, and is not supported in any
+ * current version of Internet Explorer.
+ *
+ * @type {string}
+ * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#hyperlink-auditing
+ */
+HTMLAnchorElement.prototype.ping;
+
+/** @type {string} */
+HTMLAnchorElement.prototype.port;
+
+/** @type {string} */
+HTMLAnchorElement.prototype.protocol;
+
+/** @type {string} */
+HTMLAnchorElement.prototype.search;
+
+/**
+ * @type {string}
+ * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#hyperlink-auditing
+ */
+HTMLAreaElement.prototype.ping;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/html-markup/iframe.html#iframe.attrs.srcdoc
+ */
+HTMLIFrameElement.prototype.srcdoc;
+
+/** @type {string} */
+HTMLInputElement.prototype.autocomplete;
+
+/** @type {string} */
+HTMLInputElement.prototype.dirname;
+
+/** @type {FileList} */
+HTMLInputElement.prototype.files;
+
+/** @type {string} */
+HTMLInputElement.prototype.list;
+
+/** @type {string} */
+HTMLInputElement.prototype.max;
+
+/** @type {string} */
+HTMLInputElement.prototype.min;
+
+/** @type {string} */
+HTMLInputElement.prototype.pattern;
+
+/** @type {boolean} */
+HTMLInputElement.prototype.multiple;
+
+/** @type {string} */
+HTMLInputElement.prototype.placeholder;
+
+/** @type {boolean} */
+HTMLInputElement.prototype.required;
+
+/** @type {string} */
+HTMLInputElement.prototype.step;
+
+/** @type {Date} */
+HTMLInputElement.prototype.valueAsDate;
+
+/** @type {number} */
+HTMLInputElement.prototype.valueAsNumber;
+
+/**
+ * Changes the form control's value by the value given in the step attribute
+ * multiplied by opt_n.
+ * @param {number=} opt_n step multiplier. Defaults to 1.
+ */
+HTMLInputElement.prototype.stepDown = function(opt_n) {};
+
+/**
+ * Changes the form control's value by the value given in the step attribute
+ * multiplied by opt_n.
+ * @param {number=} opt_n step multiplier. Defaults to 1.
+ */
+HTMLInputElement.prototype.stepUp = function(opt_n) {};
+
+
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement
+ */
+function HTMLMediaElement() {}
+
+/**
+ * @type {number}
+ * @const
+ */
+HTMLMediaElement.HAVE_NOTHING; // = 0
+
+/**
+ * @type {number}
+ * @const
+ */
+HTMLMediaElement.HAVE_METADATA; // = 1
+
+/**
+ * @type {number}
+ * @const
+ */
+HTMLMediaElement.HAVE_CURRENT_DATA; // = 2
+
+/**
+ * @type {number}
+ * @const
+ */
+HTMLMediaElement.HAVE_FUTURE_DATA; // = 3
+
+/**
+ * @type {number}
+ * @const
+ */
+HTMLMediaElement.HAVE_ENOUGH_DATA; // = 4
+
+/** @type {MediaError} */
+HTMLMediaElement.prototype.error;
+
+/** @type {string} */
+HTMLMediaElement.prototype.src;
+
+/** @type {string} */
+HTMLMediaElement.prototype.currentSrc;
+
+/** @type {number} */
+HTMLMediaElement.prototype.networkState;
+
+/** @type {boolean} */
+HTMLMediaElement.prototype.autobuffer;
+
+/** @type {TimeRanges} */
+HTMLMediaElement.prototype.buffered;
+
+/**
+ * Loads the media element.
+ */
+HTMLMediaElement.prototype.load = function() {};
+
+/**
+ * @param {string} type Type of the element in question in question.
+ * @return {string} Whether it can play the type.
+ * @nosideeffects
+ */
+HTMLMediaElement.prototype.canPlayType = function(type) {};
+
+/**
+ * Callback when the media is buffered and ready to play through.
+ * @type {function(!Event)}
+ */
+HTMLMediaElement.prototype.oncanplaythrough;
+
+/** @type {number} */
+HTMLMediaElement.prototype.readyState;
+
+/** @type {boolean} */
+HTMLMediaElement.prototype.seeking;
+
+/**
+ * The current time, in seconds.
+ * @type {number}
+ */
+HTMLMediaElement.prototype.currentTime;
+
+/**
+ * The absolute timeline offset.
+ * @return {!Date}
+ */
+HTMLMediaElement.prototype.getStartDate = function() {};
+
+/**
+ * The length of the media in seconds.
+ * @type {number}
+ */
+HTMLMediaElement.prototype.duration;
+
+/** @type {boolean} */
+HTMLMediaElement.prototype.paused;
+
+/** @type {number} */
+HTMLMediaElement.prototype.defaultPlaybackRate;
+
+/** @type {number} */
+HTMLMediaElement.prototype.playbackRate;
+
+/** @type {TimeRanges} */
+HTMLMediaElement.prototype.played;
+
+/** @type {TimeRanges} */
+HTMLMediaElement.prototype.seekable;
+
+/** @type {boolean} */
+HTMLMediaElement.prototype.ended;
+
+/** @type {boolean} */
+HTMLMediaElement.prototype.autoplay;
+
+/** @type {boolean} */
+HTMLMediaElement.prototype.loop;
+
+/**
+ * Starts playing the media.
+ */
+HTMLMediaElement.prototype.play = function() {};
+
+/**
+ * Pauses the media.
+ */
+HTMLMediaElement.prototype.pause = function() {};
+
+/** @type {boolean} */
+HTMLMediaElement.prototype.controls;
+
+/**
+ * The audio volume, from 0.0 (silent) to 1.0 (loudest).
+ * @type {number}
+ */
+HTMLMediaElement.prototype.volume;
+
+/** @type {boolean} */
+HTMLMediaElement.prototype.muted;
+
+/**
+ * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-media-addtexttrack
+ * @param {string} kind Kind of the text track.
+ * @param {string=} opt_label Label of the text track.
+ * @param {string=} opt_language Language of the text track.
+ * @return {TextTrack} TextTrack object added to the media element.
+ */
+HTMLMediaElement.prototype.addTextTrack =
+ function(kind, opt_label, opt_language) {};
+
+/** @type {TextTrackList} */
+HTMLMediaElement.prototype.textTracks;
+
+
+/**
+ * @see http://www.w3.org/TR/shadow-dom/
+ * @return {!NodeList}
+ */
+Text.prototype.getDestinationInsertionPoints = function() {};
+
+
+/**
+ * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#texttracklist
+ * @constructor
+ */
+function TextTrackList() {}
+
+/** @type {number} */
+TextTrackList.prototype.length;
+
+/**
+ * @param {string} id
+ * @return {TextTrack}
+ */
+TextTrackList.prototype.getTrackById = function(id) {};
+
+
+/**
+ * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#texttrack
+ * @constructor
+ * @implements {EventTarget}
+ */
+function TextTrack() {}
+
+/**
+ * @param {TextTrackCue} cue
+ */
+TextTrack.prototype.addCue = function(cue) {};
+
+/**
+ * @param {TextTrackCue} cue
+ */
+TextTrack.prototype.removeCue = function(cue) {};
+
+/**
+ * @const {TextTrackCueList}
+ */
+TextTrack.prototype.activeCues;
+
+/**
+ * @const {TextTrackCueList}
+ */
+TextTrack.prototype.cues;
+
+/** @override */
+TextTrack.prototype.addEventListener = function(type, listener, useCapture) {};
+
+/** @override */
+TextTrack.prototype.dispatchEvent = function(evt) {};
+
+/** @override */
+TextTrack.prototype.removeEventListener = function(type, listener, useCapture)
+ {};
+
+
+
+/**
+ * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#texttrackcuelist
+ * @constructor
+ */
+function TextTrackCueList() {}
+
+/** @const {number} */
+TextTrackCueList.prototype.length;
+
+/**
+ * @param {string} id
+ * @return {TextTrackCue}
+ */
+TextTrackCueList.prototype.getCueById = function(id) {};
+
+
+
+/**
+ * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#texttrackcue
+ * @constructor
+ * @param {number} startTime
+ * @param {number} endTime
+ * @param {string} text
+ */
+function TextTrackCue(startTime, endTime, text) {}
+
+/** @type {string} */
+TextTrackCue.prototype.id;
+
+/** @type {number} */
+TextTrackCue.prototype.startTime;
+
+/** @type {number} */
+TextTrackCue.prototype.endTime;
+
+/** @type {string} */
+TextTrackCue.prototype.text;
+
+
+/**
+ * @see http://dev.w3.org/html5/webvtt/#the-vttcue-interface
+ * @constructor
+ * @extends {TextTrackCue}
+ */
+function VTTCue(startTime, endTime, text) {}
+
+
+/**
+ * @constructor
+ * @extends {HTMLMediaElement}
+ */
+function HTMLAudioElement() {}
+
+/**
+ * @constructor
+ * @extends {HTMLMediaElement}
+ * The webkit-prefixed attributes are defined in
+ * https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/core/html/HTMLVideoElement.idl
+ */
+function HTMLVideoElement() {}
+
+/**
+ * Starts displaying the video in full screen mode.
+ */
+HTMLVideoElement.prototype.webkitEnterFullscreen = function() {};
+
+/**
+ * Starts displaying the video in full screen mode.
+ */
+HTMLVideoElement.prototype.webkitEnterFullScreen = function() {};
+
+/**
+ * Stops displaying the video in full screen mode.
+ */
+HTMLVideoElement.prototype.webkitExitFullscreen = function() {};
+
+/**
+ * Stops displaying the video in full screen mode.
+ */
+HTMLVideoElement.prototype.webkitExitFullScreen = function() {};
+
+/** @type {string} */
+HTMLVideoElement.prototype.width;
+
+/** @type {string} */
+HTMLVideoElement.prototype.height;
+
+/** @type {number} */
+HTMLVideoElement.prototype.videoWidth;
+
+/** @type {number} */
+HTMLVideoElement.prototype.videoHeight;
+
+/** @type {string} */
+HTMLVideoElement.prototype.poster;
+
+/** @type {boolean} */
+HTMLVideoElement.prototype.webkitSupportsFullscreen;
+
+/** @type {boolean} */
+HTMLVideoElement.prototype.webkitDisplayingFullscreen;
+
+/** @type {number} */
+HTMLVideoElement.prototype.webkitDecodedFrameCount;
+
+/** @type {number} */
+HTMLVideoElement.prototype.webkitDroppedFrameCount;
+
+/**
+ * @constructor
+ */
+function MediaError() {}
+
+/** @type {number} */
+MediaError.prototype.code;
+
+// HTML5 MessageChannel
+/**
+ * @see http://dev.w3.org/html5/spec/comms.html#messagechannel
+ * @constructor
+ */
+function MessageChannel() {}
+
+/**
+ * Returns the first port.
+ * @type {!MessagePort}
+ */
+MessageChannel.prototype.port1;
+
+/**
+ * Returns the second port.
+ * @type {!MessagePort}
+ */
+MessageChannel.prototype.port2;
+
+// HTML5 MessagePort
+/**
+ * @see http://dev.w3.org/html5/spec/comms.html#messageport
+ * @constructor
+ * @implements {EventTarget}
+ * @implements {Transferable}
+ */
+function MessagePort() {}
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+MessagePort.prototype.addEventListener = function(
+ type, listener, opt_useCapture) {};
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+MessagePort.prototype.removeEventListener = function(
+ type, listener, opt_useCapture) {};
+
+/** @override */
+MessagePort.prototype.dispatchEvent = function(evt) {};
+
+
+/**
+ * Posts a message through the channel, optionally with the given
+ * Array of Transferables.
+ * @param {*} message
+ * @param {Array.<!Transferable>=} opt_transfer
+ */
+MessagePort.prototype.postMessage = function(message, opt_transfer) {
+};
+
+/**
+ * Begins dispatching messages received on the port.
+ */
+MessagePort.prototype.start = function() {};
+
+/**
+ * Disconnects the port, so that it is no longer active.
+ */
+MessagePort.prototype.close = function() {};
+
+/**
+ * TODO(blickly): Change this to MessageEvent.<*> and add casts as needed
+ * @type {?function(!MessageEvent.<?>)}
+ */
+MessagePort.prototype.onmessage;
+
+// HTML5 MessageEvent class
+/**
+ * @see http://dev.w3.org/html5/spec/comms.html#messageevent
+ * @constructor
+ * @extends {Event}
+ * @template T
+ */
+function MessageEvent() {}
+
+/**
+ * The data payload of the message.
+ * @type {T}
+ */
+MessageEvent.prototype.data;
+
+/**
+ * The origin of the message, for server-sent events and cross-document
+ * messaging.
+ * @type {string}
+ */
+MessageEvent.prototype.origin;
+
+/**
+ * The last event ID, for server-sent events.
+ * @type {string}
+ */
+MessageEvent.prototype.lastEventId;
+
+/**
+ * The window that dispatched the event.
+ * @type {Window}
+ */
+MessageEvent.prototype.source;
+
+/**
+ * The Array of MessagePorts sent with the message, for cross-document
+ * messaging and channel messaging.
+ * @type {Array.<MessagePort>}
+ */
+MessageEvent.prototype.ports;
+
+/**
+ * Initializes the event in a manner analogous to the similarly-named methods in
+ * the DOM Events interfaces.
+ * @param {string} typeArg
+ * @param {boolean} canBubbleArg
+ * @param {boolean} cancelableArg
+ * @param {T} dataArg
+ * @param {string} originArg
+ * @param {string} lastEventIdArg
+ * @param {Window} sourceArg
+ * @param {Array.<MessagePort>} portsArg
+ */
+MessageEvent.prototype.initMessageEvent = function(typeArg, canBubbleArg,
+ cancelableArg, dataArg, originArg, lastEventIdArg, sourceArg, portsArg) {};
+
+/**
+ * Initializes the event in a manner analogous to the similarly-named methods in
+ * the DOM Events interfaces.
+ * @param {string} namespaceURI
+ * @param {string} typeArg
+ * @param {boolean} canBubbleArg
+ * @param {boolean} cancelableArg
+ * @param {T} dataArg
+ * @param {string} originArg
+ * @param {string} lastEventIdArg
+ * @param {Window} sourceArg
+ * @param {Array.<MessagePort>} portsArg
+ */
+MessageEvent.prototype.initMessageEventNS = function(namespaceURI, typeArg,
+ canBubbleArg, cancelableArg, dataArg, originArg, lastEventIdArg, sourceArg,
+ portsArg) {};
+
+/**
+ * HTML5 DataTransfer class.
+ *
+ * We say that this extends ClipboardData, because Event.prototype.clipboardData
+ * is a DataTransfer on WebKit but a ClipboardData on IE. The interfaces are so
+ * similar that it's easier to merge them.
+ *
+ * @see http://www.w3.org/TR/2011/WD-html5-20110113/dnd.html
+ * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html
+ * @see http://developers.whatwg.org/dnd.html#datatransferitem
+ * @constructor
+ * @extends {ClipboardData}
+ */
+function DataTransfer() {}
+
+/** @type {string} */
+DataTransfer.prototype.dropEffect;
+
+/** @type {string} */
+DataTransfer.prototype.effectAllowed;
+
+/** @type {Array.<string>} */
+DataTransfer.prototype.types;
+
+/** @type {FileList} */
+DataTransfer.prototype.files;
+
+/**
+ * @param {string=} opt_format Format for which to remove data.
+ * @override
+ */
+DataTransfer.prototype.clearData = function(opt_format) {};
+
+/**
+ * @param {string} format Format for which to set data.
+ * @param {string} data Data to add.
+ * @override
+ */
+DataTransfer.prototype.setData = function(format, data) {};
+
+/**
+ * @param {string} format Format for which to set data.
+ * @return {string} Data for the given format.
+ * @override
+ */
+DataTransfer.prototype.getData = function(format) { return ''; };
+
+/**
+ * @param {HTMLElement} img The image to use when dragging.
+ * @param {number} x Horizontal position of the cursor.
+ * @param {number} y Vertical position of the cursor.
+ */
+DataTransfer.prototype.setDragImage = function(img, x, y) {};
+
+/**
+ * @param {HTMLElement} elem Element to receive drag result events.
+ */
+DataTransfer.prototype.addElement = function(elem) {};
+
+/**
+ * Addition for accessing clipboard file data that are part of the proposed
+ * HTML5 spec.
+ * @type {DataTransfer}
+ */
+MouseEvent.prototype.dataTransfer;
+
+/**
+ * @typedef {{
+ * bubbles: (boolean|undefined),
+ * cancelable: (boolean|undefined),
+ * view: (Window|undefined),
+ * detail: (number|undefined),
+ * screenX: (number|undefined),
+ * screenY: (number|undefined),
+ * clientX: (number|undefined),
+ * clientY: (number|undefined),
+ * ctrlKey: (boolean|undefined),
+ * shiftKey: (boolean|undefined),
+ * altKey: (boolean|undefined),
+ * metaKey: (boolean|undefined),
+ * button: (number|undefined),
+ * buttons: (number|undefined),
+ * relatedTarget: (EventTarget|undefined),
+ * deltaX: (number|undefined),
+ * deltaY: (number|undefined),
+ * deltaZ: (number|undefined),
+ * deltaMode: (number|undefined)
+ * }}
+ */
+var WheelEventInit;
+
+/**
+ * @param {string} type
+ * @param {WheelEventInit=} opt_eventInitDict
+ * @see http://www.w3.org/TR/DOM-Level-3-Events/#interface-WheelEvent
+ * @constructor
+ * @extends {MouseEvent}
+ */
+var WheelEvent = function(type, opt_eventInitDict) {};
+
+/** @const {number} */
+WheelEvent.prototype.deltaX;
+
+/** @const {number} */
+WheelEvent.prototype.deltaY;
+
+/** @const {number} */
+WheelEvent.prototype.deltaZ;
+
+/** @const {number} */
+WheelEvent.prototype.deltaMode;
+
+/**
+ * HTML5 DataTransferItem class.
+ *
+ * @see http://www.w3.org/TR/2011/WD-html5-20110113/dnd.html
+ * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html
+ * @see http://developers.whatwg.org/dnd.html#datatransferitem
+ * @constructor
+ */
+var DataTransferItem = function() {};
+
+/** @type {string} */
+DataTransferItem.prototype.kind;
+
+/** @type {string} */
+DataTransferItem.prototype.type;
+
+/**
+ * @param {function(string)} callback
+ * @nosideeffects
+ */
+DataTransferItem.prototype.getAsString = function(callback) {};
+
+/**
+ * @return {?File} The file corresponding to this item, or null.
+ * @nosideeffects
+ */
+DataTransferItem.prototype.getAsFile = function() { return null; };
+
+/**
+ * @return {?Entry} The Entry corresponding to this item, or null. Note that
+ * despite its name,this method only works in Chrome, and will eventually
+ * be renamed to {@code getAsEntry}.
+ * @nosideeffects
+ */
+DataTransferItem.prototype.webkitGetAsEntry = function() { return null; };
+
+/**
+ * HTML5 DataTransferItemList class. There are some discrepancies in the docs
+ * on the whatwg.org site. When in doubt, these prototypes match what is
+ * implemented as of Chrome 30.
+ *
+ * @see http://www.w3.org/TR/2011/WD-html5-20110113/dnd.html
+ * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html
+ * @see http://developers.whatwg.org/dnd.html#datatransferitem
+ * @constructor
+ */
+var DataTransferItemList = function() {};
+
+/** @type {number} */
+DataTransferItemList.prototype.length;
+
+/**
+ * @param {number} i File to return from the list.
+ * @return {DataTransferItem} The ith DataTransferItem in the list, or null.
+ * @nosideeffects
+ */
+DataTransferItemList.prototype.item = function(i) { return null; };
+
+/**
+ * Adds an item to the list.
+ * @param {string|!File} data Data for the item being added.
+ * @param {string=} opt_type Mime type of the item being added. MUST be present
+ * if the {@code data} parameter is a string.
+ */
+DataTransferItemList.prototype.add = function(data, opt_type) {};
+
+/**
+ * Removes an item from the list.
+ * @param {number} i File to remove from the list.
+ */
+DataTransferItemList.prototype.remove = function(i) {};
+
+/**
+ * Removes all items from the list.
+ */
+DataTransferItemList.prototype.clear = function() {};
+
+/** @type {!DataTransferItemList} */
+DataTransfer.prototype.items;
+
+
+/**
+ * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-dragevent-interface
+ * @constructor
+ * @extends {MouseEvent}
+ */
+function DragEvent() {}
+
+/** @type {DataTransfer} */
+DragEvent.prototype.dataTransfer;
+
+
+/**
+ * @typedef {{
+ * lengthComputable: (boolean|undefined),
+ * loaded: (number|undefined),
+ * total: (number|undefined)
+ * }}
+ */
+var ProgressEventInit;
+
+/**
+ * @constructor
+ * @param {string} type
+ * @param {ProgressEventInit=} opt_progressEventInitDict
+ * @extends {Event}
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent
+ */
+function ProgressEvent(type, opt_progressEventInitDict) {}
+
+/** @type {number} */
+ProgressEvent.prototype.total;
+
+/** @type {number} */
+ProgressEvent.prototype.loaded;
+
+/** @type {boolean} */
+ProgressEvent.prototype.lengthComputable;
+
+
+/**
+ * @constructor
+ */
+function TimeRanges() {}
+
+/** @type {number} */
+TimeRanges.prototype.length;
+
+/**
+ * @param {number} index The index.
+ * @return {number} The start time of the range at index.
+ * @throws {DOMException}
+ */
+TimeRanges.prototype.start = function(index) { return 0; };
+
+/**
+ * @param {number} index The index.
+ * @return {number} The end time of the range at index.
+ * @throws {DOMException}
+ */
+TimeRanges.prototype.end = function(index) { return 0; };
+
+
+// HTML5 Web Socket class
+/**
+ * @see http://dev.w3.org/html5/websockets/
+ * @constructor
+ * @param {string} url
+ * @param {string=} opt_protocol
+ * @implements {EventTarget}
+ */
+function WebSocket(url, opt_protocol) {}
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+WebSocket.prototype.addEventListener = function(
+ type, listener, opt_useCapture) {};
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+WebSocket.prototype.removeEventListener = function(
+ type, listener, opt_useCapture) {};
+
+/** @override */
+WebSocket.prototype.dispatchEvent = function(evt) {};
+
+/**
+ * Returns the URL value that was passed to the constructor.
+ * @type {string}
+ */
+WebSocket.prototype.URL;
+
+/**
+ * The connection has not yet been established.
+ * @type {number}
+ */
+WebSocket.prototype.CONNECTING = 0;
+
+/**
+ * The Web Socket connection is established and communication is possible.
+ * @type {number}
+ */
+WebSocket.prototype.OPEN = 1;
+
+/**
+ * The connection has been closed or could not be opened.
+ * @type {number}
+ */
+WebSocket.prototype.CLOSED = 2;
+
+/**
+ * Represents the state of the connection.
+ * @type {number}
+ */
+WebSocket.prototype.readyState;
+
+/**
+ * Returns the number of bytes that have been queued but not yet sent.
+ * @type {number}
+ */
+WebSocket.prototype.bufferedAmount;
+
+/**
+ * An event handler called on open event.
+ * @type {?function(!Event)}
+ */
+WebSocket.prototype.onopen;
+
+/**
+ * An event handler called on message event.
+ * TODO(blickly): Change this to MessageEvent.<*> and add casts as needed
+ * @type {?function(!MessageEvent.<?>)}
+ */
+WebSocket.prototype.onmessage;
+
+/**
+ * An event handler called on close event.
+ * @type {?function(!Event)}
+ */
+WebSocket.prototype.onclose;
+
+/**
+ * Transmits data using the connection.
+ * @param {string|ArrayBuffer|ArrayBufferView} data
+ * @return {boolean}
+ */
+WebSocket.prototype.send = function(data) {};
+
+/**
+ * Closes the Web Socket connection or connection attempt, if any.
+ */
+WebSocket.prototype.close = function() {};
+
+/**
+ * @type {string} Sets the type of data (blob or arraybuffer) for binary data.
+ */
+WebSocket.prototype.binaryType;
+
+// HTML5 History
+/**
+ * Pushes a new state into the session history.
+ * @see http://www.w3.org/TR/html5/history.html#the-history-interface
+ * @param {*} data New state.
+ * @param {string} title The title for a new session history entry.
+ * @param {string=} opt_url The URL for a new session history entry.
+ */
+History.prototype.pushState = function(data, title, opt_url) {};
+
+/**
+ * Replaces the current state in the session history.
+ * @see http://www.w3.org/TR/html5/history.html#the-history-interface
+ * @param {*} data New state.
+ * @param {string} title The title for a session history entry.
+ * @param {string=} opt_url The URL for a new session history entry.
+ */
+History.prototype.replaceState = function(data, title, opt_url) {};
+
+/**
+ * Pending state object.
+ * @see https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history#Reading_the_current_state
+ * @type {*}
+ */
+History.prototype.state;
+
+/**
+ * @see http://www.whatwg.org/specs/web-apps/current-work/#popstateevent
+ * @constructor
+ * @extends {Event}
+ *
+ * @param {string} type
+ * @param {{state: *}=} opt_eventInitDict
+ */
+function PopStateEvent(type, opt_eventInitDict) {}
+
+/**
+ * @type {*}
+ */
+PopStateEvent.prototype.state;
+
+/**
+ * Initializes the event after it has been created with document.createEvent
+ * @param {string} typeArg
+ * @param {boolean} canBubbleArg
+ * @param {boolean} cancelableArg
+ * @param {*} stateArg
+ */
+PopStateEvent.prototype.initPopStateEvent = function(typeArg, canBubbleArg,
+ cancelableArg, stateArg) {};
+
+/**
+ * @see http://www.whatwg.org/specs/web-apps/current-work/#hashchangeevent
+ * @constructor
+ * @extends {Event}
+ *
+ * @param {string} type
+ * @param {{oldURL: string, newURL: string}=} opt_eventInitDict
+ */
+function HashChangeEvent(type, opt_eventInitDict) {}
+
+/** @type {string} */
+HashChangeEvent.prototype.oldURL;
+
+/** @type {string} */
+HashChangeEvent.prototype.newURL;
+
+/**
+ * Initializes the event after it has been created with document.createEvent
+ * @param {string} typeArg
+ * @param {boolean} canBubbleArg
+ * @param {boolean} cancelableArg
+ * @param {string} oldURLArg
+ * @param {string} newURLArg
+ */
+HashChangeEvent.prototype.initHashChangeEvent = function(typeArg, canBubbleArg,
+ cancelableArg, oldURLArg, newURLArg) {};
+
+/**
+ * @see http://www.whatwg.org/specs/web-apps/current-work/#pagetransitionevent
+ * @constructor
+ * @extends {Event}
+ *
+ * @param {string} type
+ * @param {{persisted: boolean}=} opt_eventInitDict
+ */
+function PageTransitionEvent(type, opt_eventInitDict) {}
+
+/** @type {boolean} */
+PageTransitionEvent.prototype.persisted;
+
+/**
+ * Initializes the event after it has been created with document.createEvent
+ * @param {string} typeArg
+ * @param {boolean} canBubbleArg
+ * @param {boolean} cancelableArg
+ * @param {*} persistedArg
+ */
+PageTransitionEvent.prototype.initPageTransitionEvent = function(typeArg,
+ canBubbleArg, cancelableArg, persistedArg) {};
+
+/**
+ * @constructor
+ */
+function FileList() {}
+
+/** @type {number} */
+FileList.prototype.length;
+
+/**
+ * @param {number} i File to return from the list.
+ * @return {File} The ith file in the list.
+ * @nosideeffects
+ */
+FileList.prototype.item = function(i) { return null; };
+
+/**
+ * @type {boolean}
+ * @see http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#withcredentials
+ */
+XMLHttpRequest.prototype.withCredentials;
+
+/**
+ * @type {XMLHttpRequestUpload}
+ * @see http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#the-upload-attribute
+ */
+XMLHttpRequest.prototype.upload;
+
+/**
+ * @param {string} mimeType The mime type to override with.
+ */
+XMLHttpRequest.prototype.overrideMimeType = function(mimeType) {};
+
+/**
+ * @type {string}
+ * @see http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#the-responsetype-attribute
+ */
+XMLHttpRequest.prototype.responseType;
+
+/**
+ * @type {*}
+ * @see http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#the-responsetype-attribute
+ */
+XMLHttpRequest.prototype.response;
+
+
+/**
+ * @type {ArrayBuffer}
+ * Implemented as a draft spec in Firefox 4 as the way to get a requested array
+ * buffer from an XMLHttpRequest.
+ * @see https://developer.mozilla.org/En/Using_XMLHttpRequest#Receiving_binary_data_using_JavaScript_typed_arrays
+ */
+XMLHttpRequest.prototype.mozResponseArrayBuffer;
+
+/**
+ * XMLHttpRequestEventTarget defines events for checking the status of a data
+ * transfer between a client and a server. This should be a common base class
+ * for XMLHttpRequest and XMLHttpRequestUpload.
+ *
+ * @constructor
+ * @implements {EventTarget}
+ */
+function XMLHttpRequestEventTarget() {}
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+XMLHttpRequestEventTarget.prototype.addEventListener = function(
+ type, listener, opt_useCapture) {};
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+XMLHttpRequestEventTarget.prototype.removeEventListener = function(
+ type, listener, opt_useCapture) {};
+
+/** @override */
+XMLHttpRequestEventTarget.prototype.dispatchEvent = function(evt) {};
+
+/**
+ * An event target to track the status of an upload.
+ *
+ * @constructor
+ * @extends {XMLHttpRequestEventTarget}
+ */
+function XMLHttpRequestUpload() {}
+
+/**
+ * @param {number=} opt_width
+ * @param {number=} opt_height
+ * @constructor
+ * @extends {HTMLImageElement}
+ */
+function Image(opt_width, opt_height) {}
+
+
+/**
+ * Dataset collection.
+ * This is really a DOMStringMap but it behaves close enough to an object to
+ * pass as an object.
+ * @type {Object}
+ * @const
+ */
+HTMLElement.prototype.dataset;
+
+
+/**
+ * @constructor
+ * @see https://dom.spec.whatwg.org/#interface-domtokenlist
+ */
+function DOMTokenList() {}
+
+/**
+ * Returns the number of CSS classes applied to this Element.
+ * @type {number}
+ */
+DOMTokenList.prototype.length;
+
+/**
+ * @param {number} index The index of the item to return.
+ * @return {string} The CSS class at the specified index.
+ * @nosideeffects
+ */
+DOMTokenList.prototype.item = function(index) {};
+
+/**
+ * @param {string} token The CSS class to check for.
+ * @return {boolean} Whether the CSS class has been applied to the Element.
+ * @nosideeffects
+ */
+DOMTokenList.prototype.contains = function(token) {};
+
+/**
+ * @param {...string} var_args The CSS class(es) to add to this element.
+ */
+DOMTokenList.prototype.add = function(var_args) {};
+
+/**
+ * @param {...string} var_args The CSS class(es) to remove from this element.
+ */
+DOMTokenList.prototype.remove = function(var_args) {};
+
+/**
+ * @param {string} token The CSS class to toggle from this element.
+ * @param {boolean=} opt_force True to add the class whether it exists
+ * or not. False to remove the class whether it exists or not.
+ * This argument is not supported on IE 10 and below, according to
+ * the MDN page linked below.
+ * @return {boolean} False if the token was removed; True otherwise.
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Element.classList
+ */
+DOMTokenList.prototype.toggle = function(token, opt_force) {};
+
+/**
+ * @return {string} A stringified representation of CSS classes.
+ * @nosideeffects
+ * @override
+ */
+DOMTokenList.prototype.toString = function() {};
+
+/**
+ * A better interface to CSS classes than className.
+ * @type {DOMTokenList}
+ * @see http://www.w3.org/TR/html5/elements.html#dom-classlist
+ * @const
+ */
+HTMLElement.prototype.classList;
+
+/**
+ * Web Cryptography API
+ * @see http://www.w3.org/TR/WebCryptoAPI/
+ */
+
+/** @see https://developer.mozilla.org/en/DOM/window.crypto */
+Window.prototype.crypto;
+
+/**
+ * @see https://developer.mozilla.org/en/DOM/window.crypto.getRandomValues
+ * @param {!ArrayBufferView} typedArray
+ * @return {!ArrayBufferView}
+ * @throws {Error}
+ */
+Window.prototype.crypto.getRandomValues = function(typedArray) {};
+
+/**
+ * Constraint Validation API properties and methods
+ * @see http://www.w3.org/TR/2009/WD-html5-20090423/forms.html#the-constraint-validation-api
+ */
+
+/** @return {boolean} */
+HTMLFormElement.prototype.checkValidity = function() {};
+
+/** @type {boolean} */
+HTMLFormElement.prototype.noValidate;
+
+/** @constructor */
+function ValidityState() {}
+
+/** @type {boolean} */
+ValidityState.prototype.customError;
+
+/** @type {boolean} */
+ValidityState.prototype.patternMismatch;
+
+/** @type {boolean} */
+ValidityState.prototype.rangeOverflow;
+
+/** @type {boolean} */
+ValidityState.prototype.rangeUnderflow;
+
+/** @type {boolean} */
+ValidityState.prototype.stepMismatch;
+
+/** @type {boolean} */
+ValidityState.prototype.typeMismatch;
+
+/** @type {boolean} */
+ValidityState.prototype.tooLong;
+
+/** @type {boolean} */
+ValidityState.prototype.valid;
+
+/** @type {boolean} */
+ValidityState.prototype.valueMissing;
+
+
+/** @type {boolean} */
+HTMLButtonElement.prototype.autofocus;
+
+/**
+ * @const
+ * @type {NodeList}
+ */
+HTMLButtonElement.prototype.labels;
+
+/** @type {string} */
+HTMLButtonElement.prototype.validationMessage;
+
+/**
+ * @const
+ * @type {ValidityState}
+ */
+HTMLButtonElement.prototype.validity;
+
+/** @type {boolean} */
+HTMLButtonElement.prototype.willValidate;
+
+/** @return {boolean} */
+HTMLButtonElement.prototype.checkValidity = function() {};
+
+/** @param {string} message */
+HTMLButtonElement.prototype.setCustomValidity = function(message) {};
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/html5/forms.html#attr-fs-formaction
+ */
+HTMLButtonElement.prototype.formAction;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/html5/forms.html#attr-fs-formenctype
+ */
+HTMLButtonElement.prototype.formEnctype;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/html5/forms.html#attr-fs-formmethod
+ */
+HTMLButtonElement.prototype.formMethod;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/html5/forms.html#attr-fs-formtarget
+ */
+HTMLButtonElement.prototype.formTarget;
+
+/** @type {boolean} */
+HTMLInputElement.prototype.autofocus;
+
+/** @type {boolean} */
+HTMLInputElement.prototype.formNoValidate;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/html5/forms.html#attr-fs-formaction
+ */
+HTMLInputElement.prototype.formAction;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/html5/forms.html#attr-fs-formenctype
+ */
+HTMLInputElement.prototype.formEnctype;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/html5/forms.html#attr-fs-formmethod
+ */
+HTMLInputElement.prototype.formMethod;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/html5/forms.html#attr-fs-formtarget
+ */
+HTMLInputElement.prototype.formTarget;
+
+/**
+ * @const
+ * @type {NodeList}
+ */
+HTMLInputElement.prototype.labels;
+
+/** @type {string} */
+HTMLInputElement.prototype.validationMessage;
+
+/**
+ * @const
+ * @type {ValidityState}
+ */
+HTMLInputElement.prototype.validity;
+
+/** @type {boolean} */
+HTMLInputElement.prototype.willValidate;
+
+/** @return {boolean} */
+HTMLInputElement.prototype.checkValidity = function() {};
+
+/** @param {string} message */
+HTMLInputElement.prototype.setCustomValidity = function(message) {};
+
+/** @type {Element} */
+HTMLLabelElement.prototype.control;
+
+/** @type {boolean} */
+HTMLSelectElement.prototype.autofocus;
+
+/**
+ * @const
+ * @type {NodeList}
+ */
+HTMLSelectElement.prototype.labels;
+
+/** @type {HTMLCollection} */
+HTMLSelectElement.prototype.selectedOptions;
+
+/** @type {string} */
+HTMLSelectElement.prototype.validationMessage;
+
+/**
+ * @const
+ * @type {ValidityState}
+ */
+HTMLSelectElement.prototype.validity;
+
+/** @type {boolean} */
+HTMLSelectElement.prototype.willValidate;
+
+/** @return {boolean} */
+HTMLSelectElement.prototype.checkValidity = function() {};
+
+/** @param {string} message */
+HTMLSelectElement.prototype.setCustomValidity = function(message) {};
+
+/** @type {boolean} */
+HTMLTextAreaElement.prototype.autofocus;
+
+/**
+ * @const
+ * @type {NodeList}
+ */
+HTMLTextAreaElement.prototype.labels;
+
+/** @type {string} */
+HTMLTextAreaElement.prototype.validationMessage;
+
+/**
+ * @const
+ * @type {ValidityState}
+ */
+HTMLTextAreaElement.prototype.validity;
+
+/** @type {boolean} */
+HTMLTextAreaElement.prototype.willValidate;
+
+/** @return {boolean} */
+HTMLTextAreaElement.prototype.checkValidity = function() {};
+
+/** @param {string} message */
+HTMLTextAreaElement.prototype.setCustomValidity = function(message) {};
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/html5/the-embed-element.html#htmlembedelement
+ */
+function HTMLEmbedElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/html5/dimension-attributes.html#dom-dim-width
+ */
+HTMLEmbedElement.prototype.width;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/html5/dimension-attributes.html#dom-dim-height
+ */
+HTMLEmbedElement.prototype.height;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/html5/the-embed-element.html#dom-embed-src
+ */
+HTMLEmbedElement.prototype.src;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/html5/the-embed-element.html#dom-embed-type
+ */
+HTMLEmbedElement.prototype.type;
+
+// Fullscreen APIs.
+
+/**
+ * @see http://www.w3.org/TR/2012/WD-fullscreen-20120703/#dom-element-requestfullscreen
+ */
+Element.prototype.requestFullscreen = function() {};
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/2012/WD-fullscreen-20120703/#dom-document-fullscreenenabled
+ */
+Document.prototype.fullscreenEnabled;
+
+/**
+ * @type {Element}
+ * @see http://www.w3.org/TR/2012/WD-fullscreen-20120703/#dom-document-fullscreenelement
+ */
+Document.prototype.fullscreenElement;
+
+/**
+ * @see http://www.w3.org/TR/2012/WD-fullscreen-20120703/#dom-document-exitfullscreen
+ */
+Document.prototype.exitFullscreen = function() {};
+
+// Externs definitions of browser current implementations.
+// Firefox 10 implementation.
+Element.prototype.mozRequestFullScreen = function() {};
+
+Element.prototype.mozRequestFullScreenWithKeys = function() {};
+
+/** @type {boolean} */
+Document.prototype.mozFullScreen;
+
+Document.prototype.mozCancelFullScreen = function() {};
+
+/** @type {Element} */
+Document.prototype.mozFullScreenElement;
+
+/** @type {boolean} */
+Document.prototype.mozFullScreenEnabled;
+
+// Chrome 21 implementation.
+/**
+ * The current fullscreen element for the document is set to this element.
+ * Valid only for Webkit browsers.
+ * @param {number=} opt_allowKeyboardInput Whether keyboard input is desired.
+ * Should use ALLOW_KEYBOARD_INPUT constant.
+ */
+Element.prototype.webkitRequestFullScreen = function(opt_allowKeyboardInput) {};
+
+/**
+ * The current fullscreen element for the document is set to this element.
+ * Valid only for Webkit browsers.
+ * @param {number=} opt_allowKeyboardInput Whether keyboard input is desired.
+ * Should use ALLOW_KEYBOARD_INPUT constant.
+ */
+Element.prototype.webkitRequestFullscreen = function(opt_allowKeyboardInput) {};
+
+/** @type {boolean} */
+Document.prototype.webkitIsFullScreen;
+
+Document.prototype.webkitCancelFullScreen = function() {};
+
+/** @type {Element} */
+Document.prototype.webkitCurrentFullScreenElement;
+
+/** @type {Element} */
+Document.prototype.webkitFullscreenElement;
+
+/** @type {boolean} */
+Document.prototype.webkitFullScreenKeyboardInputAllowed;
+
+// IE 11 implementation.
+// http://msdn.microsoft.com/en-us/library/ie/dn265028(v=vs.85).aspx
+/** @return {void} */
+Element.prototype.msRequestFullscreen = function() {};
+
+/** @return {void} */
+Element.prototype.msExitFullscreen = function() {};
+
+/** @type {boolean} */
+Document.prototype.msFullscreenEnabled;
+
+/** @type {Element} */
+Document.prototype.msFullscreenElement;
+
+/** @type {number} */
+Element.ALLOW_KEYBOARD_INPUT = 1;
+
+/** @type {number} */
+Element.prototype.ALLOW_KEYBOARD_INPUT = 1;
+
+
+/** @constructor */
+function MutationObserverInit() {}
+
+/** @type {boolean} */
+MutationObserverInit.prototype.childList;
+
+/** @type {boolean} */
+MutationObserverInit.prototype.attributes;
+
+/** @type {boolean} */
+MutationObserverInit.prototype.characterData;
+
+/** @type {boolean} */
+MutationObserverInit.prototype.subtree;
+
+/** @type {boolean} */
+MutationObserverInit.prototype.attributeOldValue;
+
+/** @type {boolean} */
+MutationObserverInit.prototype.characterDataOldValue;
+
+/** @type {Array.<string>} */
+MutationObserverInit.prototype.attributeFilter;
+
+
+/** @constructor */
+function MutationRecord() {}
+
+/** @type {string} */
+MutationRecord.prototype.type;
+
+/** @type {Node} */
+MutationRecord.prototype.target;
+
+/** @type {NodeList} */
+MutationRecord.prototype.addedNodes;
+
+/** @type {NodeList} */
+MutationRecord.prototype.removedNodes;
+
+/** @type {Node} */
+MutationRecord.prototype.previouSibling;
+
+/** @type {Node} */
+MutationRecord.prototype.nextSibling;
+
+/** @type {?string} */
+MutationRecord.prototype.attributeName;
+
+/** @type {?string} */
+MutationRecord.prototype.attributeNamespace;
+
+/** @type {?string} */
+MutationRecord.prototype.oldValue;
+
+
+/**
+ * @see http://www.w3.org/TR/domcore/#mutation-observers
+ * @param {function(Array.<MutationRecord>, MutationObserver)} callback
+ * @constructor
+ */
+function MutationObserver(callback) {}
+
+/**
+ * @param {Node} target
+ * @param {MutationObserverInit=} options
+ */
+MutationObserver.prototype.observe = function(target, options) {};
+
+MutationObserver.prototype.disconnect = function() {};
+
+/**
+ * @type {function(new:MutationObserver, function(Array.<MutationRecord>))}
+ */
+Window.prototype.WebKitMutationObserver;
+
+/**
+ * @type {function(new:MutationObserver, function(Array.<MutationRecord>))}
+ */
+Window.prototype.MozMutationObserver;
+
+
+/**
+ * @see http://www.w3.org/TR/page-visibility/
+ * @type {VisibilityState}
+ */
+Document.prototype.visibilityState;
+
+/**
+ * @type {string}
+ */
+Document.prototype.webkitVisibilityState;
+
+/**
+ * @type {string}
+ */
+Document.prototype.msVisibilityState;
+
+/**
+ * @see http://www.w3.org/TR/page-visibility/
+ * @type {boolean}
+ */
+Document.prototype.hidden;
+
+/**
+ * @type {boolean}
+ */
+Document.prototype.webkitHidden;
+
+/**
+ * @type {boolean}
+ */
+Document.prototype.msHidden;
+
+/**
+ * @see http://www.w3.org/TR/components-intro/
+ * @see http://w3c.github.io/webcomponents/spec/custom/#extensions-to-document-interface-to-register
+ * @param {string} type
+ * @param {{extends: (string|undefined), prototype: (Object|undefined)}} options
+ */
+Document.prototype.registerElement;
+
+/**
+ * This method is deprecated and should be removed by the end of 2014.
+ * @see http://www.w3.org/TR/components-intro/
+ * @see http://w3c.github.io/webcomponents/spec/custom/#extensions-to-document-interface-to-register
+ * @param {string} type
+ * @param {{extends: (string|undefined), prototype: (Object|undefined)}} options
+ */
+Document.prototype.register;
+
+/**
+ * @type {!FontFaceSet}
+ * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontfacesource-fonts
+ */
+Document.prototype.fonts;
+
+
+/**
+ * Definition of ShadowRoot interface,
+ * @see http://www.w3.org/TR/shadow-dom/#api-shadow-root
+ * @constructor
+ * @extends {DocumentFragment}
+ */
+function ShadowRoot() {}
+
+/**
+ * The host element that a ShadowRoot is attached to.
+ * Note: this is not yet W3C standard but is undergoing development.
+ * W3C feature tracking bug:
+ * https://www.w3.org/Bugs/Public/show_bug.cgi?id=22399
+ * Draft specification:
+ * https://dvcs.w3.org/hg/webcomponents/raw-file/6743f1ace623/spec/shadow/index.html#shadow-root-object
+ * @type {!Element}
+ */
+ShadowRoot.prototype.host;
+
+/**
+ * @param {string} id id.
+ * @return {HTMLElement}
+ * @nosideeffects
+ */
+ShadowRoot.prototype.getElementById = function(id) {};
+
+
+/**
+ * @param {string} className
+ * @return {!NodeList}
+ * @nosideeffects
+ */
+ShadowRoot.prototype.getElementsByClassName = function(className) {};
+
+
+/**
+ * @param {string} tagName
+ * @return {!NodeList}
+ * @nosideeffects
+ */
+ShadowRoot.prototype.getElementsByTagName = function(tagName) {};
+
+
+/**
+ * @param {string} namespace
+ * @param {string} localName
+ * @return {!NodeList}
+ * @nosideeffects
+ */
+ShadowRoot.prototype.getElementsByTagNameNS = function(namespace, localName) {};
+
+
+/**
+ * @return {Selection}
+ * @nosideeffects
+ */
+ShadowRoot.prototype.getSelection = function() {};
+
+
+/**
+ * @param {number} x
+ * @param {number} y
+ * @return {Element}
+ * @nosideeffects
+ */
+ShadowRoot.prototype.elementFromPoint = function(x, y) {};
+
+
+/**
+ * @type {boolean}
+ */
+ShadowRoot.prototype.applyAuthorStyles;
+
+
+/**
+ * @type {boolean}
+ */
+ShadowRoot.prototype.resetStyleInheritance;
+
+
+/**
+ * @type {Element}
+ */
+ShadowRoot.prototype.activeElement;
+
+
+/**
+ * @type {?ShadowRoot}
+ */
+ShadowRoot.prototype.olderShadowRoot;
+
+
+/**
+ * @type {string}
+ */
+ShadowRoot.prototype.innerHTML;
+
+
+/**
+ * @type {!StyleSheetList}
+ */
+ShadowRoot.prototype.styleSheets;
+
+
+
+/**
+ * @see http://www.w3.org/TR/shadow-dom/#the-content-element
+ * @constructor
+ * @extends {HTMLElement}
+ */
+function HTMLContentElement() {}
+
+/**
+ * @type {!string}
+ */
+HTMLContentElement.prototype.select;
+
+/**
+ * @return {!NodeList}
+ */
+HTMLContentElement.prototype.getDistributedNodes = function() {};
+
+
+/**
+ * @see http://www.w3.org/TR/shadow-dom/#the-shadow-element
+ * @constructor
+ * @extends {HTMLElement}
+ */
+function HTMLShadowElement() {}
+
+/**
+ * @return {!NodeList}
+ */
+HTMLShadowElement.prototype.getDistributedNodes = function() {};
+
+
+/**
+ * @see http://www.w3.org/TR/html5/webappapis.html#the-errorevent-interface
+ *
+ * @constructor
+ * @extends {Event}
+ *
+ * @param {string} type
+ * @param {ErrorEventInit=} opt_eventInitDict
+ */
+function ErrorEvent(type, opt_eventInitDict) {}
+
+/** @const {string} */
+ErrorEvent.prototype.message;
+
+/** @const {string} */
+ErrorEvent.prototype.filename;
+
+/** @const {number} */
+ErrorEvent.prototype.lineno;
+
+/** @const {number} */
+ErrorEvent.prototype.colno;
+
+/** @const {*} */
+ErrorEvent.prototype.error;
+
+
+/**
+ * @see http://www.w3.org/TR/html5/webappapis.html#the-errorevent-interface
+ *
+ * @typedef {{
+ * bubbles: (boolean|undefined),
+ * cancelable: (boolean|undefined),
+ * message: string,
+ * filename: string,
+ * lineno: number,
+ * colno: number,
+ * error: *
+ * }}
+ */
+ var ErrorEventInit;
+
+
+/**
+ * @see http://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument
+ * @param {string=} opt_title A title to give the new HTML document
+ * @return {!HTMLDocument}
+ */
+DOMImplementation.prototype.createHTMLDocument = function(opt_title) {};
+
+
+
+/**
+ * @constructor
+ * @see https://html.spec.whatwg.org/multipage/embedded-content.html#the-picture-element
+ * @extends {HTMLElement}
+ */
+function HTMLPictureElement() {}
+
+/**
+ * @constructor
+ * @see https://html.spec.whatwg.org/multipage/embedded-content.html#the-picture-element
+ * @extends {HTMLElement}
+ */
+function HTMLSourceElement() {}
+
+/** @type {string} */
+HTMLSourceElement.prototype.media;
+
+/** @type {string} */
+HTMLSourceElement.prototype.sizes;
+
+/** @type {string} */
+HTMLSourceElement.prototype.src;
+
+/** @type {string} */
+HTMLSourceElement.prototype.srcset;
+
+/** @type {string} */
+HTMLSourceElement.prototype.type;
+
+/** @type {string} */
+HTMLImageElement.prototype.sizes;
+
+/** @type {string} */
+HTMLImageElement.prototype.srcset;
+
+
+/**
+ * 4.11 Interactive elements
+ * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html
+ */
+
+/**
+ * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#the-details-element
+ * @constructor
+ * @extends {HTMLElement}
+ */
+function HTMLDetailsElement() {}
+
+/**
+ * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-details-open
+ * @type {boolean}
+ */
+HTMLDetailsElement.prototype.open;
+
+
+// As of 2/20/2015, <summary> has no special web IDL interface nor global
+// constructor (i.e. HTMLSummaryElement).
+
+
+/**
+ * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-menu-type
+ * @type {string}
+ */
+HTMLMenuElement.prototype.type;
+
+/**
+ * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-menu-label
+ * @type {string}
+ */
+HTMLMenuElement.prototype.label;
+
+
+/**
+ * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#the-menuitem-element
+ * @constructor
+ * @extends {HTMLElement}
+ */
+function HTMLMenuItemElement() {}
+
+/**
+ * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-menuitem-type
+ * @type {string}
+ */
+HTMLMenuItemElement.prototype.type;
+
+/**
+ * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-menuitem-label
+ * @type {string}
+ */
+HTMLMenuItemElement.prototype.label;
+
+/**
+ * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-menuitem-icon
+ * @type {string}
+ */
+HTMLMenuItemElement.prototype.icon;
+
+/**
+ * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-menuitem-disabled
+ * @type {boolean}
+ */
+HTMLMenuItemElement.prototype.disabled;
+
+/**
+ * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-menuitem-checked
+ * @type {boolean}
+ */
+HTMLMenuItemElement.prototype.checked;
+
+/**
+ * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-menuitem-radiogroup
+ * @type {string}
+ */
+HTMLMenuItemElement.prototype.radiogroup;
+
+/**
+ * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-menuitem-default
+ * @type {boolean}
+ */
+HTMLMenuItemElement.prototype.default;
+
+// TODO(dbeam): add HTMLMenuItemElement.prototype.command if it's implemented.
+
+
+/**
+ * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#relatedevent
+ * @param {string} type
+ * @param {{relatedTarget: (EventTarget|undefined)}=} opt_eventInitDict
+ * @constructor
+ * @extends {Event}
+ */
+function RelatedEvent(type, opt_eventInitDict) {}
+
+/**
+ * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-relatedevent-relatedtarget
+ * @type {EventTarget|undefined}
+ */
+RelatedEvent.prototype.relatedTarget;
+
+
+/**
+ * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#the-dialog-element
+ * @constructor
+ * @extends {HTMLElement}
+ */
+function HTMLDialogElement() {}
+
+/**
+ * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-dialog-open
+ * @type {boolean}
+ */
+HTMLDialogElement.prototype.open;
+
+/**
+ * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-dialog-returnvalue
+ * @type {string}
+ */
+HTMLDialogElement.prototype.returnValue;
+
+/**
+ * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-dialog-show
+ * @param {(MouseEvent|Element)=} opt_anchor
+ */
+HTMLDialogElement.prototype.show = function(opt_anchor) {};
+
+/**
+ * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-dialog-showmodal
+ * @param {(MouseEvent|Element)=} opt_anchor
+ */
+HTMLDialogElement.prototype.showModal = function(opt_anchor) {};
+
+/**
+ * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-dialog-close
+ * @param {string=} opt_returnValue
+ */
+HTMLDialogElement.prototype.close = function(opt_returnValue) {};
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_css.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_css.js
new file mode 100644
index 0000000000..359b9ceb41
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_css.js
@@ -0,0 +1,267 @@
+/*
+ * Copyright 2008 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for IE's custom CSS properties, as defined here:
+ * http://msdn.microsoft.com/en-us/library/aa768661(VS.85).aspx
+ *
+ * This page is also useful for the IDL definitions:
+ * http://source.winehq.org/source/include/mshtml.idl
+ *
+ * @externs
+ * @author nicksantos@google.com
+ */
+
+/** @type {Element} */
+StyleSheet.prototype.owningElement;
+
+/** @type {boolean} */
+StyleSheet.prototype.readOnly;
+
+/** @type {StyleSheetList} */
+StyleSheet.prototype.imports;
+
+/** @type {string} */
+StyleSheet.prototype.id;
+
+/**
+ * @param {string} bstrURL
+ * @param {number} lIndex
+ * @return {number}
+ */
+StyleSheet.prototype.addImport;
+
+/**
+ * @param {string} bstrSelector
+ * @param {string} bstrStyle
+ * @param {number=} opt_iIndex
+ * @return {number}
+ * @see http://msdn.microsoft.com/en-us/library/aa358796%28v=vs.85%29.aspx
+ */
+StyleSheet.prototype.addRule;
+
+/**
+ * @param {number} lIndex
+ */
+StyleSheet.prototype.removeImport;
+
+/**
+ * @param {number} lIndex
+ */
+StyleSheet.prototype.removeRule;
+
+/** @type {string} */
+StyleSheet.prototype.cssText;
+
+/** @type {CSSRuleList} */
+StyleSheet.prototype.rules;
+
+// StyleSheet methods
+
+/**
+ * @param {string} propName
+ * @return {string}
+ * @see http://msdn.microsoft.com/en-us/library/aa358797(VS.85).aspx
+ */
+StyleSheet.prototype.getExpression;
+
+/**
+ * @param {string} name
+ * @param {string} expression
+ * @return {undefined}
+ * @see http://msdn.microsoft.com/en-us/library/ms531196(VS.85).aspx
+ */
+StyleSheet.prototype.setExpression;
+
+/**
+ * @param {string} expression
+ * @return {undefined}
+ * @see http://msdn.microsoft.com/en-us/library/aa358798(VS.85).aspx
+ */
+StyleSheet.prototype.removeExpression;
+
+// IE-only CSS style names.
+
+/** @type {string} */ CSSProperties.prototype.backgroundPositionX;
+
+/** @type {string} */ CSSProperties.prototype.backgroundPositionY;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ie/ms531081(v=vs.85).aspx
+ * NOTE: Left untyped to avoid conflict with caller.
+ */
+CSSProperties.prototype.behavior;
+
+/**
+ * @type {string}
+ * @see http://msdn.microsoft.com/en-us/library/ms533883.aspx
+ */
+CSSProperties.prototype.imeMode;
+
+/**
+ * @type {string}
+ * @see http://msdn.microsoft.com/en-us/library/ms534176(VS.85).aspx
+ */
+CSSProperties.prototype.msInterpolationMode;
+
+/** @type {string} */ CSSProperties.prototype.overflowX;
+
+/** @type {string} */ CSSProperties.prototype.overflowY;
+
+/** @type {number} */ CSSProperties.prototype.pixelWidth;
+
+/** @type {number} */ CSSProperties.prototype.pixelHeight;
+
+/** @type {number} */ CSSProperties.prototype.pixelLeft;
+
+/** @type {number} */ CSSProperties.prototype.pixelTop;
+
+/** @type {string} */ CSSProperties.prototype.styleFloat;
+
+/**
+ * @type {string|number}
+ * @see http://msdn.microsoft.com/en-us/library/ms535169(VS.85).aspx
+ */
+CSSProperties.prototype.zoom;
+
+/**
+ * @type {string}
+ * @see http://msdn.microsoft.com/en-us/library/ms535153(VS.85).aspx
+ */
+CSSProperties.prototype.writingMode;
+
+/**
+ * IE-specific extensions.
+ * @see http://blogs.msdn.com/b/ie/archive/2008/09/08/microsoft-css-vendor-extensions.aspx
+ */
+
+/** @type {string} */
+CSSProperties.prototype.MsAccelerator;
+
+/** @type {string} */
+CSSProperties.prototype.MsBackgroundPositionX;
+
+/** @type {string} */
+CSSProperties.prototype.MsBackgroundPositionY;
+
+/** @type {string} */
+CSSProperties.prototype.MsBehavior;
+
+/** @type {string} */
+CSSProperties.prototype.MsBlockProgression;
+
+/** @type {string} */
+CSSProperties.prototype.MsFilter;
+
+/** @type {string} */
+CSSProperties.prototype.MsImeMode;
+
+/** @type {string} */
+CSSProperties.prototype.MsLayoutGrid;
+
+/** @type {string} */
+CSSProperties.prototype.MsLayoutGridChar;
+
+/** @type {string} */
+CSSProperties.prototype.MsLayoutGridLine;
+
+/** @type {string} */
+CSSProperties.prototype.MsLayoutGridMode;
+
+/** @type {string} */
+CSSProperties.prototype.MsLayoutGridType;
+
+/** @type {string} */
+CSSProperties.prototype.MsLineBreak;
+
+/** @type {string} */
+CSSProperties.prototype.MsLineGridMode;
+
+/** @type {string} */
+CSSProperties.prototype.MsInterpolationMode;
+
+/** @type {string} */
+CSSProperties.prototype.MsOverflowX;
+
+/** @type {string} */
+CSSProperties.prototype.MsOverflowY;
+
+/** @type {string} */
+CSSProperties.prototype.MsScrollbar3dlightColor;
+
+/** @type {string} */
+CSSProperties.prototype.MsScrollbarArrowColor;
+
+/** @type {string} */
+CSSProperties.prototype.MsScrollbarBaseColor;
+
+/** @type {string} */
+CSSProperties.prototype.MsScrollbarDarkshadowColor;
+
+/** @type {string} */
+CSSProperties.prototype.MsScrollbarFaceColor;
+
+CSSProperties.prototype.MsScrollbarHighlightColor;
+
+/** @type {string} */
+CSSProperties.prototype.MsScrollbarShadowColor;
+
+/** @type {string} */
+CSSProperties.prototype.MsScrollbarTrackColor;
+
+/** @type {string} */
+CSSProperties.prototype.MsTextAlignLast;
+
+/** @type {string} */
+CSSProperties.prototype.MsTextAutospace;
+
+/** @type {string} */
+CSSProperties.prototype.MsTextJustify;
+
+/** @type {string} */
+CSSProperties.prototype.MsTextKashidaSpace;
+
+/** @type {string} */
+CSSProperties.prototype.MsTextOverflow;
+
+/** @type {string} */
+CSSProperties.prototype.MsTextUnderlinePosition;
+
+/** @type {string} */
+CSSProperties.prototype.MsWordBreak;
+
+/** @type {string} */
+CSSProperties.prototype.MsWordWrap;
+
+/** @type {string} */
+CSSProperties.prototype.MsWritingMode;
+
+/** @type {string} */
+CSSProperties.prototype.MsZoom;
+
+// See: http://msdn.microsoft.com/en-us/library/windows/apps/Hh702466.aspx
+
+/** @type {string} */
+CSSProperties.prototype.msContentZooming;
+
+/** @type {string} */
+CSSProperties.prototype.msTouchAction;
+
+/** @type {string} */
+CSSProperties.prototype.msTransform;
+
+/** @type {string} */
+CSSProperties.prototype.msTransition;
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_dom.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_dom.js
new file mode 100644
index 0000000000..cbb2ea5adb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_dom.js
@@ -0,0 +1,1395 @@
+/*
+ * Copyright 2008 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for all the extensions over the
+ * W3C's DOM specification by IE in JScript. This file depends on
+ * w3c_dom2.js. The whole file has NOT been fully type annotated.
+ *
+ * When a non-standard extension appears in both Gecko and IE, we put
+ * it in gecko_dom.js
+ *
+ * @externs
+ * @author stevey@google.com (Steve Yegge)
+ */
+
+// TODO(nicksantos): Rewrite all the DOM interfaces as interfaces, instead
+// of kludging them as an inheritance hierarchy.
+
+/**
+ * @constructor
+ * @extends {Document}
+ * @see http://msdn.microsoft.com/en-us/library/ms757878(VS.85).aspx
+ */
+function XMLDOMDocument() {}
+
+/**
+ * @type {boolean}
+ * @see http://msdn.microsoft.com/en-us/library/ms761398(VS.85).aspx
+ */
+XMLDOMDocument.prototype.async;
+
+/**
+ * @type {!Function}
+ * @see http://msdn.microsoft.com/en-us/library/ms762647(VS.85).aspx
+ */
+XMLDOMDocument.prototype.ondataavailable;
+
+/**
+ * @type {!Function}
+ * @see http://msdn.microsoft.com/en-us/library/ms764640(VS.85).aspx
+ */
+XMLDOMDocument.prototype.onreadystatechange;
+
+/**
+ * @type {!Function}
+ * @see http://msdn.microsoft.com/en-us/library/ms753795(VS.85).aspx
+ */
+XMLDOMDocument.prototype.ontransformnode;
+
+/**
+ * @type {Object}
+ * @see http://msdn.microsoft.com/en-us/library/ms756041(VS.85).aspx
+ */
+XMLDOMDocument.prototype.parseError;
+
+/**
+ * @type {boolean}
+ * @see http://msdn.microsoft.com/en-us/library/ms761353(VS.85).aspx
+ */
+XMLDOMDocument.prototype.preserveWhiteSpace;
+
+/**
+ * @type {number}
+ * @see http://msdn.microsoft.com/en-us/library/ms753702(VS.85).aspx
+ */
+XMLDOMDocument.prototype.readyState;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms762283(VS.85).aspx
+ * @type {boolean}
+ */
+XMLDOMDocument.prototype.resolveExternals;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms760290(v=vs.85).aspx
+ * @param {string} name
+ * @param {*} value
+ */
+XMLDOMDocument.prototype.setProperty = function(name, value) {};
+
+/**
+ * @type {string}
+ * @see http://msdn.microsoft.com/en-us/library/ms767669(VS.85).aspx
+ */
+XMLDOMDocument.prototype.url;
+
+/**
+ * @type {boolean}
+ * @see http://msdn.microsoft.com/en-us/library/ms762791(VS.85).aspx
+ */
+XMLDOMDocument.prototype.validateOnParse;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms763830(VS.85).aspx
+ */
+XMLDOMDocument.prototype.abort = function() {};
+
+/**
+ * @param {*} type
+ * @param {string} name
+ * @param {string} namespaceURI
+ * @return {Node}
+ * @see http://msdn.microsoft.com/en-us/library/ms757901(VS.85).aspx
+ * @nosideeffects
+ */
+XMLDOMDocument.prototype.createNode = function(type, name, namespaceURI) {};
+
+/**
+ * @param {string} xmlSource
+ * @return {boolean}
+ * @see http://msdn.microsoft.com/en-us/library/ms762722(VS.85).aspx
+ * @override
+ */
+XMLDOMDocument.prototype.load = function(xmlSource) {};
+
+/**
+ * @param {string} xmlString
+ * @return {boolean}
+ * @see http://msdn.microsoft.com/en-us/library/ms754585(VS.85).aspx
+ * @override
+ */
+XMLDOMDocument.prototype.loadXML = function(xmlString) {};
+
+/**
+ * @param {string} id
+ * @return {Node}
+ * @see http://msdn.microsoft.com/en-us/library/ms766397(VS.85).aspx
+ */
+XMLDOMDocument.prototype.nodeFromID = function(id) {};
+
+//==============================================================================
+// XMLNode methods and properties
+// In a real DOM hierarchy, XMLDOMDocument inherits from XMLNode and Document.
+// Since we can't express that in our type system, we put XMLNode properties
+// on Node.
+
+/**
+ * @type {string}
+ * @see http://msdn.microsoft.com/en-us/library/ms767570(VS.85).aspx
+ */
+Node.prototype.baseName;
+
+/**
+ * @type {?string}
+ * @see http://msdn.microsoft.com/en-us/library/ms762763(VS.85).aspx
+ */
+Node.prototype.dataType;
+
+/**
+ * @type {Node}
+ * @see http://msdn.microsoft.com/en-us/library/ms764733(VS.85).aspx
+ */
+Node.prototype.definition;
+
+/**
+ * IE5 used document instead of ownerDocument.
+ * Old versions of WebKit used document instead of contentDocument.
+ * @type {Document}
+ */
+Node.prototype.document;
+
+
+/**
+ * Inserts the given HTML text into the element at the location.
+ * @param {string} sWhere Where to insert the HTML text, one of 'beforeBegin',
+ * 'afterBegin', 'beforeEnd', 'afterEnd'.
+ * @param {string} sText HTML text to insert.
+ * @see http://msdn.microsoft.com/en-us/library/ms536452(VS.85).aspx
+ */
+Node.prototype.insertAdjacentHTML = function(sWhere, sText) {};
+
+
+/**
+ * @type {*}
+ * @see http://msdn.microsoft.com/en-us/library/ms762308(VS.85).aspx
+ */
+Node.prototype.nodeTypedValue;
+
+/**
+ * @type {string}
+ * @see http://msdn.microsoft.com/en-us/library/ms757895(VS.85).aspx
+ */
+Node.prototype.nodeTypeString;
+
+/**
+ * @type {boolean}
+ * @see http://msdn.microsoft.com/en-us/library/ms762237(VS.85).aspx
+ */
+Node.prototype.parsed;
+
+/**
+ * @type {Element}
+ * @see http://msdn.microsoft.com/en-us/library/ms534327(VS.85).aspx
+ */
+Node.prototype.parentElement;
+
+/**
+ * @type {boolean}
+ * @see http://msdn.microsoft.com/en-us/library/ms753816(VS.85).aspx
+ */
+Node.prototype.specified;
+
+/**
+ * @type {string}
+ * @see http://msdn.microsoft.com/en-us/library/ms762687(VS.85).aspx
+ */
+Node.prototype.text;
+
+/**
+ * @type {string}
+ * @see http://msdn.microsoft.com/en-us/library/ms755989(VS.85).aspx
+ */
+Node.prototype.xml;
+
+/**
+ * @param {string} expression An XPath expression.
+ * @return {NodeList}
+ * @see http://msdn.microsoft.com/en-us/library/ms754523(VS.85).aspx
+ * @nosideeffects
+ */
+Node.prototype.selectNodes = function(expression) {};
+
+/**
+ * @param {string} expression An XPath expression.
+ * @return {Node}
+ * @see http://msdn.microsoft.com/en-us/library/ms757846(VS.85).aspx
+ * @nosideeffects
+ */
+Node.prototype.selectSingleNode = function(expression) {};
+
+/**
+ * @param {Node} stylesheet XSLT stylesheet.
+ * @return {string}
+ * @see http://msdn.microsoft.com/en-us/library/ms761399(VS.85).aspx
+ * @nosideeffects
+ */
+Node.prototype.transformNode = function(stylesheet) {};
+
+/**
+ * @param {Node} stylesheet XSLT stylesheet.
+ * @param {Object} outputObject
+ * @see http://msdn.microsoft.com/en-us/library/ms766561(VS.85).aspx
+ */
+Node.prototype.transformNodeToObject =
+ function(stylesheet, outputObject) {};
+
+//==============================================================================
+// Node methods
+
+/**
+ * @param {boolean=} opt_bRemoveChildren Whether to remove the entire sub-tree.
+ * Defaults to false.
+ * @return {Node} The object that was removed.
+ * @see http://msdn.microsoft.com/en-us/library/ms536708(VS.85).aspx
+ */
+Node.prototype.removeNode = function(opt_bRemoveChildren) {};
+
+/**
+ * @constructor
+ */
+function ClipboardData() {}
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms535220(VS.85).aspx
+ * @param {string=} opt_type Type of clipboard data to clear. 'Text' or
+ * 'URL' or 'File' or 'HTML' or 'Image'.
+ */
+ClipboardData.prototype.clearData = function(opt_type) {};
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms535220(VS.85).aspx
+ * @param {string} type Type of clipboard data to set ('Text' or 'URL').
+ * @param {string} data Data to set
+ * @return {boolean} Whether the data were set correctly.
+ */
+ClipboardData.prototype.setData = function(type, data) {};
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms535220(VS.85).aspx
+ * @param {string} type Type of clipboard data to get ('Text' or 'URL').
+ * @return {string} The current data
+ */
+ClipboardData.prototype.getData = function(type) { };
+
+/**
+ * @type {!Window}
+ * @see https://developer.mozilla.org/en/DOM/window
+ */
+var window;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms535220(VS.85).aspx
+ * @type ClipboardData
+ */
+Window.prototype.clipboardData;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms533724(VS.85).aspx
+ */
+Window.prototype.dialogHeight;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms533725(VS.85).aspx
+ */
+Window.prototype.dialogLeft;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms533726(VS.85).aspx
+ */
+Window.prototype.dialogTop;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms533727(VS.85).aspx
+ */
+Window.prototype.dialogWidth;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms535863(VS.85).aspx
+ */
+Window.prototype.event;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/cc197012(VS.85).aspx
+ */
+Window.prototype.maxConnectionsPer1_0Server;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/cc197013(VS.85).aspx
+ */
+Window.prototype.maxConnectionsPerServer;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms534198(VS.85).aspx
+ */
+Window.prototype.offscreenBuffering;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms534389(VS.85).aspx
+ */
+Window.prototype.screenLeft;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms534389(VS.85).aspx
+ */
+Window.prototype.screenTop;
+
+// Functions
+
+/**
+ * @param {string} event
+ * @param {Function} handler
+ * @see http://msdn.microsoft.com/en-us/library/ms536343(VS.85).aspx
+ */
+Window.prototype.attachEvent;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536392(VS.85).aspx
+ */
+Window.prototype.createPopup;
+
+/**
+ * @param {string} event
+ * @param {Function} handler
+ * @see http://msdn.microsoft.com/en-us/library/ms536411(VS.85).aspx
+ */
+Window.prototype.detachEvent;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536420(VS.85).aspx
+ */
+Window.prototype.execScript;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536425(VS.85).aspx
+ */
+Window.prototype.focus;
+
+/**
+ * @param {number} x
+ * @param {number} y
+ * @see http://msdn.microsoft.com/en-us/library/ms536618(VS.85).aspx
+ */
+Window.prototype.moveBy = function(x, y) {};
+
+/**
+ * @param {number} x
+ * @param {number} y
+ * @see http://msdn.microsoft.com/en-us/library/ms536626(VS.85).aspx
+ */
+Window.prototype.moveTo = function(x, y) {};
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536638(VS.85).aspx
+ */
+Window.prototype.navigate;
+
+/**
+ * @param {*=} opt_url
+ * @param {string=} opt_windowName
+ * @param {string=} opt_windowFeatures
+ * @param {boolean=} opt_replace
+ * @return {Window}
+ * @see http://msdn.microsoft.com/en-us/library/ms536651(VS.85).aspx
+ */
+Window.prototype.open = function(opt_url, opt_windowName, opt_windowFeatures,
+ opt_replace) {};
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536672(VS.85).aspx
+ */
+Window.prototype.print = function() {};
+
+/**
+ * @param {number} width
+ * @param {number} height
+ * @see http://msdn.microsoft.com/en-us/library/ms536722(VS.85).aspx
+ */
+Window.prototype.resizeBy = function(width, height) {};
+
+/**
+ * @param {number} width
+ * @param {number} height
+ * @see http://msdn.microsoft.com/en-us/library/ms536723(VS.85).aspx
+ */
+Window.prototype.resizeTo = function(width, height) {};
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536738(VS.85).aspx
+ */
+Window.prototype.setActive;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536758(VS.85).aspx
+ */
+Window.prototype.showHelp;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536761(VS.85).aspx
+ */
+Window.prototype.showModelessDialog;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms535246%28v=vs.85%29.aspx
+ * @const {!Object}
+ */
+Window.prototype.external;
+
+/**
+ * @constructor
+ */
+function History() { };
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms535864(VS.85).aspx
+ * @param {number|string} delta The number of entries to go back, or
+ * the URL to which to go back. (URL form is supported only in IE)
+ */
+History.prototype.go = function(delta) {};
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms535864(VS.85).aspx
+ * @param {number=} opt_distance The number of entries to go back
+ * (Mozilla doesn't support distance -- use #go instead)
+ */
+History.prototype.back = function(opt_distance) {};
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms535864(VS.85).aspx
+ * @type {number}
+ */
+History.prototype.length;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms535864(VS.85).aspx
+ */
+History.prototype.forward = function() {};
+
+/**
+ * @type {boolean}
+ * @implicitCast
+ * @see http://msdn.microsoft.com/en-us/library/ie/ms533072(v=vs.85).aspx
+ */
+HTMLFrameElement.prototype.allowTransparency;
+
+/**
+ * @type {Window}
+ * @see http://msdn.microsoft.com/en-us/library/ms533692(VS.85).aspx
+ */
+HTMLFrameElement.prototype.contentWindow;
+
+/**
+ * @type {boolean}
+ * @implicitCast
+ * @see http://msdn.microsoft.com/en-us/library/ie/ms533072(v=vs.85).aspx
+ */
+HTMLIFrameElement.prototype.allowTransparency;
+
+/**
+ * @type {Window}
+ * @see http://msdn.microsoft.com/en-us/library/ms533692(VS.85).aspx
+ */
+HTMLIFrameElement.prototype.contentWindow;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536385(VS.85).aspx
+ */
+HTMLBodyElement.prototype.createControlRange;
+
+/**
+ * @type {string}
+ * @see http://msdn.microsoft.com/en-us/library/ms534359(VS.85).aspx
+ */
+HTMLScriptElement.prototype.readyState;
+
+/**
+ * @type {string}
+ * @see http://msdn.microsoft.com/en-us/library/ms534359(VS.85).aspx
+ */
+HTMLIFrameElement.prototype.readyState;
+
+/**
+ * @type {string}
+ * @see http://msdn.microsoft.com/en-us/library/ms534359(VS.85).aspx
+ */
+HTMLImageElement.prototype.readyState;
+
+/**
+ * @type {string}
+ * @see http://msdn.microsoft.com/en-us/library/ms534359(VS.85).aspx
+ */
+HTMLObjectElement.prototype.readyState;
+
+
+/**
+ * @constructor
+ */
+function ControlRange() {}
+
+ControlRange.prototype.add;
+ControlRange.prototype.addElement;
+ControlRange.prototype.execCommand;
+ControlRange.prototype.item;
+ControlRange.prototype.queryCommandEnabled;
+ControlRange.prototype.queryCommandIndeterm;
+ControlRange.prototype.queryCommandState;
+ControlRange.prototype.queryCommandSupported;
+ControlRange.prototype.queryCommandValue;
+ControlRange.prototype.remove;
+ControlRange.prototype.scrollIntoView;
+ControlRange.prototype.select;
+
+/**
+ * @constructor
+ * @see http://msdn.microsoft.com/en-us/library/ms535872.aspx
+ */
+function TextRange() {}
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms533538(VS.85).aspx
+ */
+TextRange.prototype.boundingHeight;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms533539(VS.85).aspx
+ */
+TextRange.prototype.boundingLeft;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms533540(VS.85).aspx
+ */
+TextRange.prototype.boundingTop;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms533541(VS.85).aspx
+ */
+TextRange.prototype.boundingWidth;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms533874(VS.85).aspx
+ */
+TextRange.prototype.htmlText;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms534200(VS.85).aspx
+ */
+TextRange.prototype.offsetLeft;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms534303(VS.85).aspx
+ */
+TextRange.prototype.offsetTop;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms534676(VS.85).aspx
+ */
+TextRange.prototype.text;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536371(VS.85).aspx
+ */
+TextRange.prototype.collapse;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536373(VS.85).aspx
+ */
+TextRange.prototype.compareEndPoints;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536416(VS.85).aspx
+ */
+TextRange.prototype.duplicate;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536419(VS.85).aspx
+ */
+TextRange.prototype.execCommand;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536421(VS.85).aspx
+ */
+TextRange.prototype.expand;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536422(VS.85).aspx
+ */
+TextRange.prototype.findText;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536432(VS.85).aspx
+ */
+TextRange.prototype.getBookmark;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536433(VS.85).aspx
+ */
+TextRange.prototype.getBoundingClientRect;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536435(VS.85).aspx
+ */
+TextRange.prototype.getClientRects;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536450(VS.85).aspx
+ */
+TextRange.prototype.inRange;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536458(VS.85).aspx
+ */
+TextRange.prototype.isEqual;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536616(VS.85).aspx
+ */
+TextRange.prototype.move;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536620(VS.85).aspx
+ */
+TextRange.prototype.moveEnd;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536623(VS.85).aspx
+ */
+TextRange.prototype.moveStart;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536628(VS.85).aspx
+ */
+TextRange.prototype.moveToBookmark;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536630(VS.85).aspx
+ */
+TextRange.prototype.moveToElementText;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536632(VS.85).aspx
+ */
+TextRange.prototype.moveToPoint;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536654(VS.85).aspx
+ */
+TextRange.prototype.parentElement;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536656(VS.85).aspx
+ */
+TextRange.prototype.pasteHTML;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536676(VS.85).aspx
+ */
+TextRange.prototype.queryCommandEnabled;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536678(VS.85).aspx
+ */
+TextRange.prototype.queryCommandIndeterm;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536679(VS.85).aspx
+ */
+TextRange.prototype.queryCommandState;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536681(VS.85).aspx
+ */
+TextRange.prototype.queryCommandSupported;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536683(VS.85).aspx
+ */
+TextRange.prototype.queryCommandValue;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536730(VS.85).aspx
+ */
+TextRange.prototype.scrollIntoView;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536735(VS.85).aspx
+ */
+TextRange.prototype.select;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536745(VS.85).aspx
+ */
+TextRange.prototype.setEndPoint;
+
+/**
+ * @return {undefined}
+ * @see http://msdn.microsoft.com/en-us/library/ms536418(VS.85).aspx
+ */
+Selection.prototype.clear = function() {};
+
+/**
+ * @return {TextRange|ControlRange}
+ * @see http://msdn.microsoft.com/en-us/library/ms536394(VS.85).aspx
+ */
+Selection.prototype.createRange = function() {};
+
+/**
+ * @return {Array.<TextRange>}
+ * @see http://msdn.microsoft.com/en-us/library/ms536396(VS.85).aspx
+ */
+Selection.prototype.createRangeCollection = function() {};
+
+/**
+ * @constructor
+ * @see http://msdn.microsoft.com/en-us/library/ms537447(VS.85).aspx
+ */
+function controlRange() {}
+
+
+Document.prototype.loadXML;
+
+
+// http://msdn.microsoft.com/en-us/library/ms531073(VS.85).aspx
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms533065(VS.85).aspx
+ */
+Document.prototype.activeElement;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms533553(VS.85).aspx
+ */
+Document.prototype.charset;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms533693(VS.85).aspx
+ */
+Document.prototype.cookie;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms533714(VS.85).aspx
+ */
+Document.prototype.defaultCharset;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms533731(VS.85).aspx
+ */
+Document.prototype.dir;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/cc196988(VS.85).aspx
+ */
+Document.prototype.documentMode;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms533747(VS.85).aspx
+ */
+Document.prototype.expando;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms533750(VS.85).aspx
+ */
+Document.prototype.fileCreatedDate;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms533751(VS.85).aspx
+ */
+Document.prototype.fileModifiedDate;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms533752(VS.85).aspx
+ */
+Document.prototype.fileSize;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms534331(VS.85).aspx
+ */
+Document.prototype.parentWindow;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms534353(VS.85).aspx
+ */
+Document.prototype.protocol;
+
+/**
+ * @type {string}
+ * @see http://msdn.microsoft.com/en-us/library/ms534359(VS.85).aspx
+ */
+HTMLDocument.prototype.readyState;
+
+/**
+ * @type {Selection}
+ * @see http://msdn.microsoft.com/en-us/library/ms535869(VS.85).aspx
+ */
+Document.prototype.selection;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms534704(VS.85).aspx
+ */
+Document.prototype.uniqueID;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms534709(VS.85).aspx
+ */
+Document.prototype.URLUnencoded;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms535155(VS.85).aspx
+ */
+Document.prototype.XMLDocument;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms535163(VS.85).aspx
+ */
+Document.prototype.XSLDocument;
+
+// functions
+
+/**
+ * @param {string} event
+ * @param {Function} handler
+ * @see http://msdn.microsoft.com/en-us/library/ms536343(VS.85).aspx
+ */
+Document.prototype.attachEvent;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536390(VS.85).aspx
+ */
+Document.prototype.createEventObject;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms531194(VS.85).aspx
+ */
+Document.prototype.createStyleSheet;
+
+/**
+ * @param {string} event
+ * @param {Function} handler
+ * @see http://msdn.microsoft.com/en-us/library/ms536411(VS.85).aspx
+ */
+Document.prototype.detachEvent;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536425(VS.85).aspx
+ */
+Document.prototype.focus;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536447(VS.85).aspx
+ * @return {boolean}
+ */
+Document.prototype.hasFocus = function() {};
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536614(VS.85).aspx
+ */
+Document.prototype.mergeAttributes;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536685(VS.85).aspx
+ */
+Document.prototype.recalc;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536689(VS.85).aspx
+ */
+Document.prototype.releaseCapture;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536738(VS.85).aspx
+ */
+Document.prototype.setActive;
+
+
+// collections
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms537434(VS.85).aspx
+ */
+Document.prototype.all;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms537445(VS.85).aspx
+ */
+Document.prototype.childNodes;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms537459(VS.85).aspx
+ */
+Document.prototype.frames;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms537470(VS.85).aspx
+ */
+Document.prototype.namespaces;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms537487(VS.85).aspx
+ */
+Document.prototype.scripts;
+
+/**
+ * @param {string} sUrl
+ * @return {number}
+ * @see http://msdn.microsoft.com/en-us/library/ms535922(VS.85).aspx
+ */
+Element.prototype.addBehavior = function(sUrl) {};
+
+/**
+ * @param {string} event
+ * @param {Function} handler
+ * @see http://msdn.microsoft.com/en-us/library/mm536343(v=vs.85).aspx
+ */
+Element.prototype.attachEvent;
+
+/**
+ * @type {boolean}
+ * @see http://msdn.microsoft.com/en-us/library/ms533546(VS.85).aspx
+ */
+Element.prototype.canHaveChildren;
+
+/**
+ * @type {string}
+ * @see http://msdn.microsoft.com/en-us/library/ms533559(v=vs.85).aspx
+ */
+Element.prototype.classid;
+
+/**
+ * @param {number} iCoordX Integer that specifies the client window coordinate
+ * of x.
+ * @param {number} iCoordY Integer that specifies the client window coordinate
+ * of y.
+ * @return {string} The component of an element located at the specified
+ * coordinates.
+ * @see http://msdn.microsoft.com/en-us/library/ms536375(VS.85).aspx
+ * @nosideeffects
+ */
+Element.prototype.componentFromPoint = function(iCoordX, iCoordY) {};
+
+
+/**
+ * @type {boolean}
+ * @see http://msdn.microsoft.com/en-us/library/ms533690(VS.85).aspx
+ */
+Element.prototype.contentEditable;
+
+/**
+ * @return {TextRange}
+ * @see http://msdn.microsoft.com/en-us/library/ms536401(VS.85).aspx
+ */
+Element.prototype.createTextRange;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms535231(VS.85).aspx
+ */
+Element.prototype.currentStyle;
+
+/**
+ * @param {string} event
+ * @param {Function} handler
+ * @see http://msdn.microsoft.com/en-us/library/ie/ms536411(v=vs.85).aspx
+ */
+Element.prototype.detachEvent;
+
+/**
+ * @param {string=} opt_action
+ * @see http://msdn.microsoft.com/en-us/library/ms536414%28VS.85%29.aspx
+ */
+Element.prototype.doScroll = function(opt_action) {};
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536423(VS.85).aspx
+ */
+Element.prototype.fireEvent;
+
+/**
+ * @type {boolean}
+ * @see http://msdn.microsoft.com/en-us/library/ms533783(VS.85).aspx
+ */
+Element.prototype.hideFocus;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms533899.aspx
+ */
+Element.prototype.innerText;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms537838(VS.85).aspx
+ */
+Element.prototype.isContentEditable;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms531395(v=vs.85).aspx
+ * NOTE: Left untyped to avoid conflict with subclasses.
+ */
+Element.prototype.load;
+
+/**
+ * @param {number} pointerId Id of the pointer that is assign to the element.
+ * @see http://msdn.microsoft.com/en-us/library/ie/hh771882(v=vs.85).aspx
+ */
+Element.prototype.msSetPointerCapture = function(pointerId) {};
+
+/**
+ * @param {number} pointerId
+ * @see http://msdn.microsoft.com/en-us/library/ie/hh771880.aspx
+ */
+Element.prototype.msReleasePointerCapture = function(pointerId) {};
+
+/**
+ * @type {?function(Event)}
+ * @see http://msdn.microsoft.com/en-us/library/ms536903(v=vs.85).aspx
+ */
+Element.prototype.onbeforedeactivate;
+
+/**
+ * @type {?function(Event)}
+ * @see http://msdn.microsoft.com/en-us/library/ms536945(VS.85).aspx
+ */
+Element.prototype.onmouseenter;
+
+/**
+ * @type {?function(Event)}
+ * @see http://msdn.microsoft.com/en-us/library/ms536946(VS.85).aspx
+ */
+Element.prototype.onmouseleave;
+
+/**
+ * @type {?function(Event)}
+ * @see http://msdn.microsoft.com/en-us/library/ms536969(VS.85).aspx
+ */
+Element.prototype.onselectstart;
+
+/**
+ * @type {string}
+ * @see http://msdn.microsoft.com/en-us/library/aa752326(VS.85).aspx
+ */
+Element.prototype.outerHTML;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536689(VS.85).aspx
+ */
+Element.prototype.releaseCapture = function() {};
+
+/**
+ * @param {number} iID
+ * @return {boolean}
+ * @see http://msdn.microsoft.com/en-us/library/ms536700(VS.85).aspx
+ */
+Element.prototype.removeBehavior = function(iID) {};
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/aa703996(VS.85).aspx
+ */
+Element.prototype.runtimeStyle;
+
+/**
+ * @param {string} sStoreName The arbitrary name assigned to a persistent object
+ * in a UserData store.
+ * @see http://msdn.microsoft.com/en-us/library/ms531403(v=vs.85).aspx
+ */
+Element.prototype.save = function(sStoreName) {};
+
+/**
+ * @param {boolean=} opt_bContainerCapture Events originating in a container are
+ * captured by the container. Defaults to true.
+ * @see http://msdn.microsoft.com/en-us/library/ms536742(VS.85).aspx
+ */
+Element.prototype.setCapture = function(opt_bContainerCapture) {};
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms534635(VS.85).aspx
+ */
+Element.prototype.sourceIndex;
+
+/**
+ * @type {string}
+ * @see http://msdn.microsoft.com/en-us/library/ms537840.aspx
+ */
+Element.prototype.unselectable;
+
+/**
+ * @constructor
+ * @see http://msdn.microsoft.com/en-us/library/aa752462(v=vs.85).aspx
+ */
+function HTMLFiltersCollection() {}
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/aa752463(v=vs.85).aspx
+ * @type {number}
+ */
+HTMLFiltersCollection.prototype.length;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms537452(v=vs.85).aspx
+ * @type {HTMLFiltersCollection}
+ */
+Element.prototype.filters;
+
+/**
+ * @constructor
+ * @see http://msdn.microsoft.com/en-us/library/ms532853(v=vs.85).aspx
+ */
+function HTMLFilter() {}
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms532954(v=vs.85).aspx
+ */
+HTMLFilter.prototype.apply = function() {};
+
+/**
+ * @constructor
+ * @extends {HTMLFilter}
+ * @see http://msdn.microsoft.com/en-us/library/ms532967(v=vs.85).aspx
+ */
+function AlphaFilter() {}
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms532910(v=vs.85).aspx
+ * @type {number}
+ */
+AlphaFilter.prototype.Opacity;
+
+/**
+ * @constructor
+ * @extends {HTMLFilter}
+ * @see http://msdn.microsoft.com/en-us/library/ms532969(v=vs.85).aspx
+ */
+function AlphaImageLoaderFilter() {}
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms532920(v=vs.85).aspx
+ * @type {string}
+ */
+AlphaImageLoaderFilter.prototype.sizingMethod;
+
+/**
+ * @constructor
+ * @see http://msdn.microsoft.com/en-us/library/ms535866(VS.85).aspx
+ */
+function Location() {}
+
+/**
+ * @see http://trac.webkit.org/changeset/113945
+ * @type {DOMStringList}
+ */
+Location.prototype.ancestorOrigins;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms533775(VS.85).aspx
+ * @type {string}
+ */
+Location.prototype.hash;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms533784(VS.85).aspx
+ * @type {string}
+ */
+Location.prototype.host;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms533785(VS.85).aspx
+ * @type {string}
+ */
+Location.prototype.hostname;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms533867(VS.85).aspx
+ * @type {string}
+ */
+Location.prototype.href;
+
+/**
+ * @see https://docs.google.com/document/view?id=1r_VTFKApVOaNIkocrg0z-t7lZgzisTuGTXkdzAk4gLU&hl=en
+ * @type {string}
+ */
+Location.prototype.origin;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms534332(VS.85).aspx
+ * @type {string}
+ */
+Location.prototype.pathname;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms534342(VS.85).aspx
+ */
+Location.prototype.port;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms534353(VS.85).aspx
+ * @type {string}
+ */
+Location.prototype.protocol;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms534620(VS.85).aspx
+ * @type {string}
+ */
+Location.prototype.search;
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ms536342(VS.85).aspx
+ * @param {string} url
+ */
+Location.prototype.assign = function(url) {};
+
+/**
+ * @param {boolean=} opt_forceReload If true, reloads the page from
+ * the server. Defaults to false.
+ * @see http://msdn.microsoft.com/en-us/library/ms536691(VS.85).aspx
+ */
+Location.prototype.reload = function(opt_forceReload) {};
+
+/**
+ * @param {string} url
+ * @see http://msdn.microsoft.com/en-us/library/ms536712(VS.85).aspx
+ */
+Location.prototype.replace = function(url) {};
+
+
+// For IE, returns an object representing key-value pairs for all the global
+// variables prefixed with str, e.g. test*
+
+/** @param {*=} opt_str */
+function RuntimeObject(opt_str) {}
+
+
+/**
+ * @type {StyleSheet}
+ * @see http://msdn.microsoft.com/en-us/library/dd347030(VS.85).aspx
+ */
+HTMLStyleElement.prototype.styleSheet;
+
+
+/**
+ * IE implements Cross Origin Resource Sharing (cross-domain XMLHttpRequests)
+ * via the XDomainRequest object.
+ *
+ * @constructor
+ * @see http://msdn.microsoft.com/en-us/library/cc288060(v=vs.85).aspx
+ * @see http://www.w3.org/TR/cors/
+ */
+function XDomainRequest() {}
+
+/**
+ * Aborts the request.
+ * @see http://msdn.microsoft.com/en-us/library/cc288129(v=vs.85).aspx
+ */
+XDomainRequest.prototype.abort = function() {};
+
+/**
+ * Sets the method and URL for the request.
+ * @param {string} bstrMethod Either "GET" or "POST"
+ * @param {string} bstrUrl The target URL
+ * @see http://msdn.microsoft.com/en-us/library/cc288168(v=vs.85).aspx
+ */
+XDomainRequest.prototype.open = function(bstrMethod, bstrUrl) {};
+
+/**
+ * Sends the request.
+ * @param {string=} varBody The POST body to send to the server. If omitted,
+ * the behavior is identical to sending an empty string.
+ * @see http://msdn.microsoft.com/en-us/library/cc288207(v=vs.85).aspx
+ */
+XDomainRequest.prototype.send = function(varBody) {};
+
+/**
+ * Called if the request could not be completed. Note that error information is
+ * not available.
+ * @see http://msdn.microsoft.com/en-us/library/ms536930%28v=VS.85%29.aspx
+ * @type {?function()}
+ */
+XDomainRequest.prototype.onerror;
+
+/**
+ * Called when the response has finished.
+ * @see http://msdn.microsoft.com/en-us/library/ms536942%28v=VS.85%29.aspx
+ * @type {?function()}
+ */
+XDomainRequest.prototype.onload;
+
+/**
+ * Called every time part of the response has been received.
+ * @see http://msdn.microsoft.com/en-us/library/cc197058%28v=VS.85%29.aspx
+ * @type {?function()}
+ */
+XDomainRequest.prototype.onprogress;
+
+/**
+ * Called if the timeout period has elapsed.
+ * @see http://msdn.microsoft.com/en-us/library/cc197061%28v=VS.85%29.aspx
+ * @type {?function()}
+ */
+XDomainRequest.prototype.ontimeout;
+
+/**
+ * The current response body.
+ * @see http://msdn.microsoft.com/en-us/library/cc287956%28v=VS.85%29.aspx
+ * @type {string}
+ */
+XDomainRequest.prototype.responseText;
+
+/**
+ * The timeout (in milliseconds) for the request.
+ * @type {number}
+ */
+XDomainRequest.prototype.timeout;
+
+/**
+ * The Content-Type of the response, or an empty string.
+ * @type {string}
+ */
+XDomainRequest.prototype.contentType;
+
+/**
+ * @type {string}
+ * @see http://msdn.microsoft.com/en-us/library/ms533542(v=vs.85).aspx
+ */
+Navigator.prototype.browserLanguage;
+
+/**
+ * @type {boolean}
+ * @see http://blogs.msdn.com/b/ie/archive/2011/09/20/touch-input-for-ie10-and-metro-style-apps.aspx
+ */
+Navigator.prototype.msPointerEnabled;
+
+/**
+ * @type {number}
+ * @see http://msdn.microsoft.com/en-us/library/ms533721(v=vs.85).aspx
+ */
+Screen.prototype.deviceXDPI;
+
+/**
+ * @type {number}
+ * @see http://msdn.microsoft.com/en-us/library/ms534128%28v=vs.85%29.aspx
+ */
+Screen.prototype.logicalXDPI;
+
+/**
+ * @type {number}
+ * @see http://msdn.microsoft.com/en-us/library/ms534130%28v=vs.85%29.aspx
+ */
+Screen.prototype.logicalYDPI;
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_event.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_event.js
new file mode 100644
index 0000000000..de2b899046
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_event.js
@@ -0,0 +1,309 @@
+/*
+ * Copyright 2008 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for all the extensions over the
+ * W3C's event specification by IE in JScript. This file depends on
+ * w3c_event.js.
+ *
+ * @see http://msdn.microsoft.com/en-us/library/ms535863.aspx
+ * @externs
+ */
+
+/** @type {string} */
+Event.prototype.Abstract;
+
+/** @type {boolean} */
+Event.prototype.altLeft;
+
+/** @type {string} */
+Event.prototype.Banner;
+
+/**
+ * A ClipboardData on IE, but a DataTransfer on WebKit.
+ * @see http://msdn.microsoft.com/en-us/library/ms535220.aspx
+ * @type {(ClipboardData|undefined)}
+ */
+Event.prototype.clipboardData;
+
+/** @type {boolean} */
+Event.prototype.contentOverflow;
+
+/** @type {boolean} */
+Event.prototype.ctrlLeft;
+
+/** @type {string} */
+Event.prototype.dataFld;
+
+Event.prototype.domain;
+
+/** @type {Element} */
+Event.prototype.fromElement;
+
+/** @type {string} */
+Event.prototype.MoreInfo;
+
+/** @type {string} */
+Event.prototype.nextPage;
+
+/** @type {number} */
+Event.prototype.offsetX;
+
+/** @type {number} */
+Event.prototype.offsetY;
+
+/** @type {string} */
+Event.prototype.propertyName;
+
+/** @type {string} */
+Event.prototype.qualifier;
+
+/** @type {number} */
+Event.prototype.reason;
+
+/** @type {Object.<*,*>} */
+Event.prototype.recordset;
+
+/** @type {boolean} */
+Event.prototype.repeat;
+
+/** @type {(boolean|string|undefined)} */
+Event.prototype.returnValue;
+
+/** @type {string} */
+Event.prototype.saveType;
+
+Event.prototype.scheme;
+
+/** @type {boolean} */
+Event.prototype.shiftLeft;
+
+/** @type {Window} */
+Event.prototype.source;
+
+/** @type {Element} */
+Event.prototype.srcElement;
+
+Event.prototype.srcFilter;
+
+/** @type {string} */
+Event.prototype.srcUrn;
+
+/** @type {Element} */
+Event.prototype.toElement;
+
+Event.prototype.userName;
+
+/** @type {number} */
+Event.prototype.wheelDelta;
+
+/** @type {number} */
+Event.prototype.x;
+
+/** @type {number} */
+Event.prototype.y;
+
+/**
+ * @constructor
+ * @see http://msdn.microsoft.com/en-us/library/windows/apps/hh441257.aspx
+ */
+function MSPointerPoint() {}
+
+/** @type {number} */
+MSPointerPoint.prototype.pointerId;
+
+/** @type {number} */
+MSPointerPoint.prototype.pointerType;
+
+/**
+ * @constructor
+ * @extends {Event}
+ * @see http://msdn.microsoft.com/en-us/library/windows/apps/hh441233.aspx
+ */
+function MSPointerEvent() {}
+
+/** @type {number} */
+MSPointerEvent.MSPOINTER_TYPE_MOUSE;
+
+/** @type {number} */
+MSPointerEvent.MSPOINTER_TYPE_PEN;
+
+/** @type {number} */
+MSPointerEvent.MSPOINTER_TYPE_TOUCH;
+
+/** @type {number} */
+MSPointerEvent.prototype.height;
+
+/** @type {number} */
+MSPointerEvent.prototype.hwTimestamp;
+
+/** @type {boolean} */
+MSPointerEvent.prototype.isPrimary;
+
+/** @type {number} */
+MSPointerEvent.prototype.pointerId;
+
+/** @type {number} */
+MSPointerEvent.prototype.pointerType;
+
+/** @type {number} */
+MSPointerEvent.prototype.pressure;
+
+/** @type {number} */
+MSPointerEvent.prototype.rotation;
+
+/** @type {number} */
+MSPointerEvent.prototype.tiltX;
+
+/** @type {number} */
+MSPointerEvent.prototype.tiltY;
+
+/** @type {number} */
+MSPointerEvent.prototype.timeStamp;
+
+/** @type {number} */
+MSPointerEvent.prototype.width;
+
+/**
+ * @param {number} pointerId
+ * @return {undefined}
+ */
+MSPointerEvent.prototype.msReleasePointerCapture;
+
+/**
+ * @param {number} pointerId
+ * @return {undefined}
+ */
+MSPointerEvent.prototype.msSetPointerCapture;
+
+/**
+ * @param {string} typeArg
+ * @param {boolean} canBubbleArg
+ * @param {boolean} cancelableArg
+ * @param {Window} viewArg
+ * @param {number} detailArg
+ * @param {number} screenXArg
+ * @param {number} screenYArg
+ * @param {number} clientXArg
+ * @param {number} clientYArg
+ * @param {boolean} ctrlKeyArg
+ * @param {boolean} altKeyArg
+ * @param {boolean} shiftKeyArg
+ * @param {boolean} metaKeyArg
+ * @param {number} buttonArg
+ * @param {Element} relatedTargetArg
+ * @param {number} offsetXArg
+ * @param {number} offsetYArg
+ * @param {number} widthArg
+ * @param {number} heightArg
+ * @param {number} pressure
+ * @param {number} rotation
+ * @param {number} tiltX
+ * @param {number} tiltY
+ * @param {number} pointerIdArg
+ * @param {number} pointerType
+ * @param {number} hwTimestampArg
+ * @param {boolean} isPrimary
+ * @return {undefined}
+ * @see http://msdn.microsoft.com/en-us/library/windows/apps/hh441246.aspx
+ */
+MSPointerEvent.prototype.initPointerEvent;
+
+/**
+ * @constructor
+ * @see http://msdn.microsoft.com/en-us/library/ie/hh968249(v=vs.85).aspx
+ */
+function MSGesture() {}
+
+/**
+ * @type {Element}
+ */
+MSGesture.prototype.target;
+
+/**
+ * @param {number} pointerId
+ */
+MSGesture.prototype.addPointer = function(pointerId) {};
+
+MSGesture.prototype.stop = function() {};
+
+/**
+ * @constructor
+ * @extends {Event}
+ * @see http://msdn.microsoft.com/en-us/library/ie/hh772076(v=vs.85).aspx
+ */
+function MSGestureEvent() {}
+
+/** @type {number} */
+MSGestureEvent.prototype.expansion;
+
+/** @type {!MSGesture} */
+MSGestureEvent.prototype.gestureObject;
+
+/** @type {number} */
+MSGestureEvent.prototype.hwTimestamp;
+
+/** @type {number} */
+MSGestureEvent.prototype.rotation;
+
+/** @type {number} */
+MSGestureEvent.prototype.scale;
+
+/** @type {number} */
+MSGestureEvent.prototype.translationX;
+
+/** @type {number} */
+MSGestureEvent.prototype.translationY;
+
+/** @type {number} */
+MSGestureEvent.prototype.velocityAngular;
+
+/** @type {number} */
+MSGestureEvent.prototype.velocityExpansion;
+
+/** @type {number} */
+MSGestureEvent.prototype.velocityX;
+
+/** @type {number} */
+MSGestureEvent.prototype.velocityY;
+
+/**
+ * @param {string} typeArg
+ * @param {boolean} canBubbleArg
+ * @param {boolean} cancelableArg
+ * @param {Window} viewArg
+ * @param {number} detailArg
+ * @param {number} screenXArg
+ * @param {number} screenYArg
+ * @param {number} clientXArg
+ * @param {number} clientYArg
+ * @param {number} offsetXArg
+ * @param {number} offsetYArg
+ * @param {number} translationXArg
+ * @param {number} translationYArg
+ * @param {number} scaleArg
+ * @param {number} expansionArg
+ * @param {number} rotationArg
+ * @param {number} velocityXArg
+ * @param {number} velocityYArg
+ * @param {number} velocityExpansionArg
+ * @param {number} velocityAngularArg
+ * @param {number} hwTimestampArg
+ * @param {EventTarget} relatedTargetArg
+ * @return {undefined}
+ * @see http://msdn.microsoft.com/en-us/library/windows/apps/hh441187.aspx
+ */
+MSGestureEvent.prototype.initGestureEvent;
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_vml.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_vml.js
new file mode 100644
index 0000000000..249ffc73a5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/ie_vml.js
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2009 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for IE's vector markup language, or VML.
+ *
+ * @externs
+ * @author robbyw@google.com (Robby Walker)
+ */
+
+
+/**
+ * @type {Object|string}
+ * @see http://msdn.microsoft.com/en-us/library/bb263836(VS.85).aspx
+ */
+Element.prototype.coordorigin;
+
+/**
+ * @type {Object|string}
+ * @see http://msdn.microsoft.com/en-us/library/bb263837(VS.85).aspx
+ */
+Element.prototype.coordsize;
+
+/**
+ * @type {string}
+ * @see http://msdn.microsoft.com/en-us/library/bb263839(VS.85).aspx
+ */
+Element.prototype.fillcolor;
+
+/**
+ * @type {boolean}
+ * @see http://msdn.microsoft.com/en-us/library/bb263840(VS.85).aspx
+ */
+Element.prototype.filled;
+
+/**
+ * @type {string}
+ * @see http://msdn.microsoft.com/en-us/library/bb263871(VS.85).aspx
+ */
+Element.prototype.path;
+
+/**
+ * @type {number|string}
+ * @see http://msdn.microsoft.com/en-us/library/bb263877(VS.85).aspx
+ */
+Element.prototype.rotation;
+
+/**
+ * @type {string}
+ * @see http://msdn.microsoft.com/en-us/library/bb263881(VS.85).aspx
+ */
+Element.prototype.strokecolor;
+
+/**
+ * @type {boolean}
+ * @see http://msdn.microsoft.com/en-us/library/bb263882(VS.85).aspx
+ */
+Element.prototype.stroked;
+
+/**
+ * @type {number|string}
+ * @see http://msdn.microsoft.com/en-us/library/bb263883(VS.85).aspx
+ */
+Element.prototype.strokeweight;
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/intl.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/intl.js
new file mode 100644
index 0000000000..d1404872af
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/intl.js
@@ -0,0 +1,163 @@
+/*
+ * Copyright 2013 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for the JS Internationalization API as defined in
+ * http://www.ecma-international.org/ecma-402/1.0/
+ *
+ * @externs
+ */
+
+/** @const */
+var Intl = {};
+
+/**
+ * NOTE: this API is not from ecma402 and is subject to change.
+ * @param {string|Array.<string>=} opt_locales
+ * @param {{type: (string|undefined)}=}
+ * opt_options
+ * @constructor
+ */
+Intl.v8BreakIterator = function(opt_locales, opt_options) {};
+
+/**
+ * @param {string} text
+ */
+Intl.v8BreakIterator.prototype.adoptText = function(text) {};
+
+/**
+ * @return {string}
+ */
+Intl.v8BreakIterator.prototype.breakType = function() {};
+
+/**
+ * @return {number}
+ */
+Intl.v8BreakIterator.prototype.current = function() {};
+
+/**
+ * @return {number}
+ */
+Intl.v8BreakIterator.prototype.first = function() {};
+
+/**
+ * @return {number}
+ */
+Intl.v8BreakIterator.prototype.next = function() {};
+
+/**
+ * @constructor
+ * @param {string|Array.<string>=} opt_locales
+ * @param {{usage: (string|undefined), localeMatcher: (string|undefined),
+ * sensitivity: (string|undefined), ignorePunctuation: (boolean|undefined),
+ * numeric: (boolean|undefined), caseFirst: (string|undefined)}=}
+ * opt_options
+ */
+Intl.Collator = function(opt_locales, opt_options) {};
+
+/**
+ * @param {Array.<string>} locales
+ * @param {{localeMatcher: (string|undefined)}=} opt_options
+ */
+Intl.Collator.supportedLocalesOf = function(locales, opt_options) {};
+
+/**
+ * @param {string} arg1
+ * @param {string} arg2
+ * @return {number}
+ */
+Intl.Collator.prototype.compare = function(arg1, arg2) {};
+
+/**
+ * @return {{locale: string, usage: string, sensitivity: string,
+ * ignorePunctuation: boolean, collation: string, numeric: boolean,
+ * caseFirst: string}}
+ */
+Intl.Collator.prototype.resolvedOptions = function() {};
+
+/**
+ * @constructor
+ * @param {string|Array.<string>=} opt_locales
+ * @param {{localeMatcher: (string|undefined), useGrouping: (boolean|undefined),
+ * numberingSystem: (string|undefined), style: (string|undefined),
+ * currency: (string|undefined), currencyDisplay: (string|undefined),
+ * minimumIntegerDigits: (number|undefined),
+ * minimumFractionDigits: (number|undefined),
+ * maximumFractionDigits: (number|undefined),
+ * minimumSignificantDigits: (number|undefined),
+ * maximumSignificantDigits: (number|undefined)}=}
+ * opt_options
+ */
+Intl.NumberFormat = function(opt_locales, opt_options) {};
+
+/**
+ * @param {Array.<string>} locales
+ * @param {{localeMatcher: (string|undefined)}=} opt_options
+ */
+Intl.NumberFormat.supportedLocalesOf = function(locales, opt_options) {};
+
+/**
+ * @param {number} num
+ * @return {string}
+ */
+Intl.NumberFormat.prototype.format = function(num) {};
+
+/**
+ * @return {{locale: string, numberingSystem: string, style: string,
+ * currency: (string|undefined), currencyDisplay: (string|undefined),
+ * minimumIntegerDigits: number, minimumFractionDigits: number,
+ * maximumFractionDigits: number, minimumSignificantDigits: number,
+ * maximumSignificantDigits: number, useGrouping: boolean}}
+ */
+Intl.NumberFormat.prototype.resolvedOptions = function() {};
+
+/**
+ * @constructor
+ * @param {string|Array.<string>=} opt_locales
+ * @param {{localeMatcher: (string|undefined),
+ * formatMatcher: (string|undefined), calendar: (string|undefined),
+ * numberingSystem: (string|undefined), tz: (string|undefined),
+ * weekday: (string|undefined), era: (string|undefined),
+ * year: (string|undefined), month: (string|undefined),
+ * day: (string|undefined), hour: (string|undefined),
+ * minute: (string|undefined), second: (string|undefined),
+ * timeZoneName: (string|undefined), hour12: (boolean|undefined)}=}
+ * opt_options
+ */
+Intl.DateTimeFormat = function(opt_locales, opt_options) {};
+
+/**
+ * @param {Array.<string>} locales
+ * @param {{localeMatcher: string}=} opt_options
+ */
+Intl.DateTimeFormat.supportedLocalesOf = function(locales, opt_options) {};
+
+/**
+ * @param {number} date
+ * @return {string}
+ */
+Intl.DateTimeFormat.prototype.format = function(date) {};
+
+/**
+ * @return {{locale: string, calendar: string, numberingSystem: string,
+ * timeZone: (string|undefined), weekday: (string|undefined),
+ * era: (string|undefined), year: (string|undefined),
+ * month: (string|undefined), day: (string|undefined),
+ * hour: (string|undefined), minute: (string|undefined),
+ * second: (string|undefined), timeZoneName: (string|undefined),
+ * hour12: (boolean|undefined)}}
+ */
+Intl.DateTimeFormat.prototype.resolvedOptions = function() {};
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/iphone.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/iphone.js
new file mode 100644
index 0000000000..232014149e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/iphone.js
@@ -0,0 +1,362 @@
+/*
+ * Copyright 2009 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * @fileoverview Definitions for all iPhone extensions. Created from:
+ * http://developer.apple.com/library/safari/navigation/
+ *
+ * @externs
+ * @author agrieve@google.com (Andrew Grieve)
+ */
+
+/**
+ * The Touch class represents a single touch on the surface. A touch is the
+ * presence or movement of a finger that is part of a unique multi-touch
+ * sequence.
+ * @see http://developer.apple.com/library/safari/#documentation/UserExperience/Reference/TouchClassReference/Touch/Touch.html
+ * @constructor
+ */
+function Touch() {}
+
+/**
+ * The x-coordinate of the touch's location relative to the window's viewport.
+ * @type {number}
+ */
+Touch.prototype.clientX;
+
+/**
+ * The y-coordinate of the touch's location relative to the window's viewport.
+ * @type {number}
+ */
+Touch.prototype.clientY;
+
+/**
+ * The unique identifier for this touch object.
+ * @type {number}
+ */
+Touch.prototype.identifier;
+
+/**
+ * The x-coordinate of the touch's location in page coordinates.
+ * @type {number}
+ */
+Touch.prototype.pageX;
+
+/**
+ * The y-coordinate of the touch's location in page coordinates.
+ * @type {number}
+ */
+Touch.prototype.pageY;
+
+/**
+ * The x-coordinate of the touch's location in screen coordinates.
+ * @type {number}
+ */
+Touch.prototype.screenX;
+
+/**
+ * The y-coordinate of the touch's location in screen coordinates.
+ * @type {number}
+ */
+Touch.prototype.screenY;
+
+/**
+ * The target of this touch.
+ * @type {EventTarget}
+ */
+Touch.prototype.target;
+
+/**
+ * Creates a new Touch object.
+ * @see http://developer.apple.com/library/safari/#documentation/UserExperience/Reference/DocumentAdditionsReference/DocumentAdditions/DocumentAdditions.html#//apple_ref/javascript/instm/Document/createTouch
+ * @param {Window} view
+ * @param {EventTarget} target
+ * @param {number} identifier
+ * @param {number} pageX
+ * @param {number} pageY
+ * @param {number} screenX
+ * @param {number} screenY
+ * @return {Touch}
+ */
+Document.prototype.createTouch = function(view, target, identifier, pageX,
+ pageY, screenX, screenY) {};
+
+/**
+ * The TouchList class is used to represent a collection of Touch objects.
+ * @see http://developer.apple.com/library/safari/#documentation/UserExperience/Reference/TouchListClassReference/TouchList/TouchList.html
+ * @constructor
+ */
+function TouchList() {}
+
+/**
+ * The number of Touch objects in this TouchList object.
+ * @type {number}
+ */
+TouchList.prototype.length;
+
+/**
+ * Returns the Touch object at the given index.
+ * @param {number} index
+ * @return {!Touch}
+ */
+TouchList.prototype.item = function(index) {};
+
+/**
+ * Creates a new TouchList object.
+ * @see http://developer.apple.com/library/safari/#documentation/UserExperience/Reference/DocumentAdditionsReference/DocumentAdditions/DocumentAdditions.html#//apple_ref/javascript/instm/Document/createTouchList
+ * @param {Array.<Touch>} touches
+ * @return {TouchList}
+ */
+Document.prototype.createTouchList = function(touches) {};
+
+/**
+ * The TouchEvent class encapsulates information about a touch event.
+ *
+ * <p>The system continually sends TouchEvent objects to an application as
+ * fingers touch and move across a surface. A touch event provides a snapshot of
+ * all touches during a multi-touch sequence, most importantly the touches that
+ * are new or have changed for a particular target. A multi-touch sequence
+ * begins when a finger first touches the surface. Other fingers may
+ * subsequently touch the surface, and all fingers may move across the surface.
+ * The sequence ends when the last of these fingers is lifted from the surface.
+ * An application receives touch event objects during each phase of any touch.
+ * </p>
+ *
+ * <p>The different types of TouchEvent objects that can occur are:
+ * <ul>
+ * <li>touchstart - Sent when a finger for a given event touches the surface.
+ * <li>touchmove - Sent when a given event moves on the surface.
+ * <li>touchend - Sent when a given event lifts from the surface.
+ * <li>touchcancel - Sent when the system cancels tracking for the touch.
+ * </ul>
+ * TouchEvent objects are combined together to form high-level GestureEvent
+ * objects that are also sent during a multi-touch sequence.</p>
+ *
+ * @see http://developer.apple.com/library/safari/#documentation/UserExperience/Reference/TouchEventClassReference/TouchEvent/TouchEvent.html
+ * @extends {UIEvent}
+ * @constructor
+ */
+function TouchEvent() {}
+
+/**
+ * A collection of Touch objects representing all touches associated with this
+ * target.
+ * @type {TouchList}
+ */
+TouchEvent.prototype.touches;
+
+/**
+ * A collection of Touch objects representing all touches associated with this
+ * target.
+ * @type {TouchList}
+ */
+TouchEvent.prototype.targetTouches;
+
+/**
+ * A collection of Touch objects representing all touches that changed in this event.
+ * @type {TouchList}
+ */
+TouchEvent.prototype.changedTouches;
+
+/**
+ * The distance between two fingers since the start of an event as a multiplier
+ * of the initial distance. The initial value is 1.0. If less than 1.0, the
+ * gesture is pinch close (to zoom out). If greater than 1.0, the gesture is
+ * pinch open (to zoom in).
+ * @type {number}
+ */
+TouchEvent.prototype.scale;
+
+/**
+ * The delta rotation since the start of an event, in degrees, where clockwise
+ * is positive and counter-clockwise is negative. The initial value is 0.0.
+ * @type {number}
+ */
+TouchEvent.prototype.rotation;
+
+/**
+ * Initializes a newly created TouchEvent object.
+ * @param {string} type
+ * @param {boolean} canBubble
+ * @param {boolean} cancelable
+ * @param {Window} view
+ * @param {number} detail
+ * @param {number} screenX
+ * @param {number} screenY
+ * @param {number} clientX
+ * @param {number} clientY
+ * @param {boolean} ctrlKey
+ * @param {boolean} altKey
+ * @param {boolean} shiftKey
+ * @param {boolean} metaKey
+ * @param {TouchList} touches
+ * @param {TouchList} targetTouches
+ * @param {TouchList} changedTouches
+ * @param {number} scale
+ * @param {number} rotation
+ */
+TouchEvent.prototype.initTouchEvent = function(type, canBubble, cancelable,
+ view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey,
+ metaKey, touches, targetTouches, changedTouches, scale, rotation) {};
+
+/**
+ * The GestureEvent class encapsulates information about a multi-touch gesture.
+ *
+ * GestureEvent objects are high-level events that encapsulate the low-level
+ * TouchEvent objects. Both GestureEvent and TouchEvent events are sent during
+ * a multi-touch sequence. Gesture events contain scaling and rotation
+ * information allowing gestures to be combined, if supported by the platform.
+ * If not supported, one gesture ends before another starts. Listen for
+ * GestureEvent events if you want to respond to gestures only, not process
+ * the low-level TouchEvent objects.
+ *
+ * @see http://developer.apple.com/library/safari/#documentation/UserExperience/Reference/GestureEventClassReference/GestureEvent/GestureEvent.html
+ * @extends {UIEvent}
+ * @constructor
+ */
+function GestureEvent() {}
+
+/**
+ * The distance between two fingers since the start of an event as a multiplier
+ * of the initial distance. The initial value is 1.0. If less than 1.0, the
+ * gesture is pinch close (to zoom out). If greater than 1.0, the gesture is
+ * pinch open (to zoom in).
+ * @type {number}
+ */
+GestureEvent.prototype.scale;
+
+/**
+ * The delta rotation since the start of an event, in degrees, where clockwise
+ * is positive and counter-clockwise is negative. The initial value is 0.0.
+ * @type {number}
+ */
+GestureEvent.prototype.rotation;
+
+/**
+ * The target of this gesture.
+ * @type {EventTarget}
+ */
+GestureEvent.prototype.target;
+
+/**
+ * Initializes a newly created GestureEvent object.
+ * @param {string} type
+ * @param {boolean} canBubble
+ * @param {boolean} cancelable
+ * @param {Window} view
+ * @param {number} detail
+ * @param {number} screenX
+ * @param {number} screenY
+ * @param {number} clientX
+ * @param {number} clientY
+ * @param {boolean} ctrlKey
+ * @param {boolean} altKey
+ * @param {boolean} shiftKey
+ * @param {boolean} metaKey
+ * @param {EventTarget} target
+ * @param {number} scale
+ * @param {number} rotation
+ */
+GestureEvent.prototype.initGestureEvent = function(type, canBubble, cancelable,
+ view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey,
+ metaKey, target, scale, rotation) {};
+
+/**
+ * Specifies the JavaScript method to invoke when the system cancels tracking
+ * for the touch.
+ * @type {?function(!TouchEvent)}
+ */
+Element.prototype.ontouchcancel;
+
+/**
+ * Specifies the JavaScript method to invoke when a given event lifts from the
+ * surface.
+ * @type {?function(!TouchEvent)}
+ */
+Element.prototype.ontouchend;
+
+/**
+ * Specifies the JavaScript method to invoke when a finger for a given event
+ * moves on the surface.
+ * @type {?function(!TouchEvent)}
+ */
+Element.prototype.ontouchmove;
+
+/**
+ * Specifies the JavaScript method to invoke when a finger for a given event
+ * touches the surface.
+ * @type {?function(!TouchEvent)}
+ */
+Element.prototype.ontouchstart;
+
+/**
+ * Specifies the JavaScript method to invoke when a gesture is started by
+ * two or more fingers touching the surface.
+ * @type {?function(!GestureEvent)}
+ */
+Element.prototype.ongesturestart;
+
+/**
+ * Specifies the JavaScript method to invoke when fingers are moved during a
+ * gesture.
+ * @type {?function(!GestureEvent)}
+ */
+Element.prototype.ongesturechange;
+
+/**
+ * Specifies the JavaScript method to invoke when a gesture ends (when there are
+ * 0 or 1 fingers touching the surface).
+ * @type {?function(!GestureEvent)}
+ */
+Element.prototype.ongestureend;
+
+/**
+ * Specifies the JavaScript method to invoke when the browser device's
+ * orientation changes, i.e.the device is rotated.
+ * @type {?function(!Event)}
+ * @see http://developer.apple.com/library/IOS/#documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html
+ */
+Window.prototype.onorientationchange;
+
+/**
+ * Returns the orientation of the browser's device, one of [-90, 0, 90, 180].
+ * @type {number}
+ * @see http://developer.apple.com/library/IOS/#documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html
+ */
+Window.prototype.orientation;
+
+/**
+ * @implicitCast
+ * @type {boolean}
+ */
+HTMLInputElement.prototype.autocorrect;
+
+/**
+ * @implicitCast
+ * @type {boolean}
+ */
+HTMLInputElement.prototype.autocapitalize;
+
+/**
+ * @implicitCast
+ * @type {boolean}
+ */
+HTMLTextAreaElement.prototype.autocorrect;
+
+/**
+ * @implicitCast
+ * @type {boolean}
+ */
+HTMLTextAreaElement.prototype.autocapitalize;
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/mediasource.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/mediasource.js
new file mode 100644
index 0000000000..f813ede3ea
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/mediasource.js
@@ -0,0 +1,142 @@
+/*
+ * Copyright 2012 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * @fileoverview Definitions for the Media Source Extensions. Note that the
+ * properties available here are the union of several versions of the spec.
+ * @see http://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html
+ *
+ * @externs
+ */
+
+/**
+ * @constructor
+ * @implements {EventTarget}
+ */
+function MediaSource() {}
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+MediaSource.prototype.addEventListener = function(
+ type, listener, opt_useCapture) {};
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+MediaSource.prototype.removeEventListener = function(
+ type, listener, opt_useCapture) {};
+
+/** @override */
+MediaSource.prototype.dispatchEvent = function(evt) {};
+
+/** @type {Array.<SourceBuffer>} */
+MediaSource.prototype.sourceBuffers;
+
+/** @type {Array.<SourceBuffer>} */
+MediaSource.prototype.activeSourceBuffers;
+
+/** @type {number} */
+MediaSource.prototype.duration;
+
+/**
+ * @param {string} type
+ * @return {SourceBuffer}
+ */
+MediaSource.prototype.addSourceBuffer = function(type) {};
+
+/**
+ * @param {SourceBuffer} sourceBuffer
+ */
+MediaSource.prototype.removeSourceBuffer = function(sourceBuffer) {};
+
+/** @type {string} */
+MediaSource.prototype.readyState;
+
+/**
+ * @param {string=} opt_error
+ */
+MediaSource.prototype.endOfStream = function(opt_error) {};
+
+/**
+ * @param {string} type
+ * @return {boolean}
+ */
+MediaSource.isTypeSupported = function(type) {};
+
+
+/**
+ * @constructor
+ * @implements {EventTarget}
+ */
+function SourceBuffer() {}
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+SourceBuffer.prototype.addEventListener = function(
+ type, listener, opt_useCapture) {};
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+SourceBuffer.prototype.removeEventListener = function(
+ type, listener, opt_useCapture) {};
+
+/** @override */
+SourceBuffer.prototype.dispatchEvent = function(evt) {};
+
+/** @type {string} */
+SourceBuffer.prototype.appendMode;
+
+/** @type {boolean} */
+SourceBuffer.prototype.updating;
+
+/** @type {TimeRanges} */
+SourceBuffer.prototype.buffered;
+
+/** @type {number} */
+SourceBuffer.prototype.timestampOffset;
+
+/** @type {number} */
+SourceBuffer.prototype.appendWindowStart;
+
+/** @type {number} */
+SourceBuffer.prototype.appendWindowEnd;
+
+/**
+ * @param {Uint8Array} data
+ */
+SourceBuffer.prototype.append = function(data) {};
+
+/**
+ * @param {ArrayBuffer|ArrayBufferView} data
+ */
+SourceBuffer.prototype.appendBuffer = function(data) {};
+
+/**
+ * Abort the current segment append sequence.
+ */
+SourceBuffer.prototype.abort = function() {};
+
+/**
+ * @param {number} start
+ * @param {number} end
+ */
+SourceBuffer.prototype.remove = function(start, end) {};
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/page_visibility.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/page_visibility.js
new file mode 100644
index 0000000000..42bc9a4cdf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/page_visibility.js
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2015 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * @fileoverview Externs for Page Visibility.
+ *
+ * @see http://www.w3.org/TR/page-visibility
+ * @externs
+ */
+
+/**
+ * @enum {string}
+ * @see http://www.w3.org/TR/page-visibility/#VisibilityState
+ */
+var VisibilityState = {
+ HIDDEN: 'hidden',
+ VISIBLE: 'visible',
+ PRERENDER: 'prerender',
+ UNLOADED: 'unloaded'
+};
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/v8.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/v8.js
new file mode 100644
index 0000000000..be11bd83a5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/v8.js
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2013 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview This file describes the externs API for V8-specific objects.
+ * @externs
+ */
+
+
+
+/**
+ * Stack frame elements in V8.
+ * @constructor
+ */
+function CallSite() {}
+
+
+/**
+ * Returns the value of this.
+ * @return {Object|undefined}
+ */
+CallSite.prototype.getThis = function() {};
+
+
+/**
+ * Returns the type of this as a string. This is the name of the function stored
+ * in the constructor field of this, if available, otherwise the object's
+ * [[Class]] internal property.
+ * @return {string|undefined}
+ */
+CallSite.prototype.getTypeName = function() {};
+
+
+/**
+ * Returns the current function.
+ * @return {!Function|undefined}
+ */
+CallSite.prototype.getFunction = function() {};
+
+
+/**
+ * Returns the name of the current function, typically its name property. If a
+ * name property is not available an attempt will be made to try to infer a name
+ * from the function's context.
+ * @return {string|undefined}
+ */
+CallSite.prototype.getFunctionName = function() {};
+
+
+/**
+ * Returns the name of the property of this or one of its prototypes that holds
+ * the current function.
+ * @return {string|undefined}
+ */
+CallSite.prototype.getMethodName = function() {};
+
+
+/**
+ * If this function was defined in a script returns the name of the script
+ * @return {string|undefined}
+ */
+CallSite.prototype.getFileName = function() {};
+
+
+/**
+ * If this function was defined in a script returns the current line number.
+ * @return {number|undefined}
+ */
+CallSite.prototype.getLineNumber = function() {};
+
+
+/**
+ * If this function was defined in a script returns the current column number.
+ * @return {number|undefined}
+ */
+CallSite.prototype.getColumnNumber = function() {};
+
+
+/**
+ * If this function was created using a call to eval, returns a CallSite object
+ * representing the location where eval was called
+ * @return {CallSite|undefined}
+ */
+CallSite.prototype.getEvalOrigin = function() {};
+
+
+/**
+ * Is this a toplevel invocation, that is, is this the global object?
+ * @return {boolean}
+ */
+CallSite.prototype.isToplevel = function() {};
+
+
+/**
+ * Does this call take place in code defined by a call to eval?
+ * @return {boolean}
+ */
+CallSite.prototype.isEval = function() {};
+
+
+/**
+ * Is this call in native V8 code?
+ * @return {boolean}
+ */
+CallSite.prototype.isNative = function() {};
+
+
+/**
+ * Is this a constructor call?
+ * @return {boolean}
+ */
+CallSite.prototype.isConstructor = function() {};
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_anim_timing.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_anim_timing.js
new file mode 100644
index 0000000000..ea34abef54
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_anim_timing.js
@@ -0,0 +1,191 @@
+/*
+ * Copyright 2011 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * @fileoverview Definitions for timing control for script base animations. The
+ * whole file has been fully type annotated.
+ *
+ * @see http://www.w3.org/TR/animation-timing/
+ * @see http://webstuff.nfshost.com/anim-timing/Overview.html
+ * @externs
+ */
+
+/**
+ * @param {function(number)} callback
+ * @param {Element=} opt_element In early versions of this API, the callback
+ * was invoked only if the element was visible.
+ * @return {number}
+ */
+function requestAnimationFrame(callback, opt_element) {};
+
+/**
+ * @param {number} handle
+ */
+function cancelRequestAnimationFrame(handle) {};
+
+/**
+ * @param {function(number)} callback
+ * @param {Element=} opt_element
+ * @return {number}
+ */
+function webkitRequestAnimationFrame(callback, opt_element) {};
+
+/**
+ * @param {number} handle
+ */
+function webkitCancelRequestAnimationFrame(handle) {};
+
+/**
+ * @param {number} handle
+ */
+function webkitCancelAnimationFrame(handle) {};
+
+/**
+ * @param {?function(number)} callback It's legitimate to pass a null
+ * callback and listen on the MozBeforePaint event instead.
+ * @param {Element=} opt_element
+ * @return {number}
+ */
+function mozRequestAnimationFrame(callback, opt_element) {};
+
+/**
+ * @param {number} handle
+ */
+function mozCancelRequestAnimationFrame(handle) {};
+
+/**
+ * @param {number} handle
+ */
+function mozCancelAnimationFrame(handle) {};
+
+/**
+ * @param {function(number)} callback
+ * @param {Element=} opt_element
+ * @return {number}
+ */
+function msRequestAnimationFrame(callback, opt_element) {};
+
+/**
+ * @param {number} handle
+ */
+function msCancelRequestAnimationFrame(handle) {};
+
+/**
+ * @param {number} handle
+ */
+function msCancelAnimationFrame(handle) {};
+
+/**
+ * @param {function(number)} callback
+ * @param {Element=} opt_element
+ * @return {number}
+ */
+function oRequestAnimationFrame(callback, opt_element) {};
+
+/**
+ * @param {number} handle
+ */
+function oCancelRequestAnimationFrame(handle) {};
+
+/**
+ * @param {number} handle
+ */
+function oCancelAnimationFrame(handle) {};
+
+/**
+ * @param {function(number)} callback
+ * @param {Element=} opt_element
+ * @return {number}
+ */
+Window.prototype.requestAnimationFrame = function(callback, opt_element) {};
+
+/**
+ * @param {number} handle
+ */
+Window.prototype.cancelRequestAnimationFrame = function(handle) {};
+
+/**
+ * @param {number} handle
+ */
+Window.prototype.cancelAnimationFrame = function(handle) {};
+
+/**
+ * @param {function(number)} callback
+ * @param {Element=} opt_element
+ * @return {number}
+ */
+Window.prototype.webkitRequestAnimationFrame = function(callback, opt_element) {};
+
+/**
+ * @param {number} handle
+ */
+Window.prototype.webkitCancelRequestAnimationFrame = function(handle) {};
+
+/**
+ * @param {number} handle
+ */
+Window.prototype.webkitCancelAnimationFrame = function(handle) {};
+
+/**
+ * @param {?function(number)} callback It's legitimate to pass a null
+ * callback and listen on the MozBeforePaint event instead.
+ * @param {Element=} opt_element
+ * @return {number}
+ */
+Window.prototype.mozRequestAnimationFrame = function(callback, opt_element) {};
+
+/**
+ * @param {number} handle
+ */
+Window.prototype.mozCancelRequestAnimationFrame = function(handle) {};
+
+/**
+ * @param {number} handle
+ */
+Window.prototype.mozCancelAnimationFrame = function(handle) {};
+
+/**
+ * @param {function(number)} callback
+ * @param {Element=} opt_element
+ * @return {number}
+ */
+Window.prototype.msRequestAnimationFrame = function(callback, opt_element) {};
+
+/**
+ * @param {number} handle
+ */
+Window.prototype.msCancelRequestAnimationFrame = function(handle) {};
+
+/**
+ * @param {number} handle
+ */
+Window.prototype.msCancelAnimationFrame = function(handle) {};
+
+/**
+ * @param {function(number)} callback
+ * @param {Element=} opt_element
+ * @return {number}
+ */
+Window.prototype.oRequestAnimationFrame = function(callback, opt_element) {};
+
+/**
+ * @param {number} handle
+ */
+Window.prototype.oCancelRequestAnimationFrame = function(handle) {};
+
+/**
+ * @param {number} handle
+ */
+Window.prototype.oCancelAnimationFrame = function(handle) {};
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_css.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_css.js
new file mode 100644
index 0000000000..e3b4ebae95
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_css.js
@@ -0,0 +1,2505 @@
+/*
+ * Copyright 2008 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for W3C's CSS specification
+ * The whole file has been fully type annotated.
+ * http://www.w3.org/TR/DOM-Level-2-Style/css.html
+ * @externs
+ * @author stevey@google.com (Steve Yegge)
+ *
+ * TODO(nicksantos): When there are no more occurrences of w3c_range.js and
+ * gecko_dom.js being included directly in BUILD files, bug dbeam to split the
+ * bottom part of this file into a separate externs.
+ */
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheet
+ */
+function StyleSheet() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheet-type
+ */
+StyleSheet.prototype.type;
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheet-disabled
+ */
+StyleSheet.prototype.disabled;
+
+/**
+ * @type {Node}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheet-owner
+ */
+StyleSheet.prototype.ownerNode;
+
+/**
+ * @type {StyleSheet}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheet-parentStyleSheet
+ */
+StyleSheet.prototype.parentStyleSheet;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheet-href
+ */
+StyleSheet.prototype.href;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheet-title
+ */
+StyleSheet.prototype.title;
+
+/**
+ * @type {MediaList}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheet-media
+ */
+StyleSheet.prototype.media;
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheetList
+ */
+function StyleSheetList() {}
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheetList-length
+ */
+StyleSheetList.prototype.length;
+
+/**
+ * @param {number} index
+ * @return {StyleSheet}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheetList-item
+ */
+StyleSheetList.prototype.item = function(index) {};
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-MediaList
+ */
+function MediaList() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-MediaList-mediaText
+ */
+MediaList.prototype.mediaText;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-MediaList-length
+ */
+MediaList.prototype.length;
+
+/**
+ * @param {number} index
+ * @return {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-MediaList-item
+ */
+MediaList.prototype.item = function(index) {};
+
+/**
+ * @interface
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-LinkStyle
+ */
+function LinkStyle() {}
+
+/**
+ * @type {StyleSheet}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-LinkStyle-sheet
+ */
+LinkStyle.prototype.sheet;
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheet-DocumentStyle
+ */
+function DocumentStyle() {}
+
+/**
+ * @type {StyleSheetList}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-StyleSheet-DocumentStyle-styleSheets
+ */
+DocumentStyle.prototype.styleSheets;
+
+/**
+ * @constructor
+ * @extends {StyleSheet}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleSheet
+ */
+function CSSStyleSheet() {}
+
+/**
+ * @type {CSSRule}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleSheet-ownerRule
+ */
+CSSStyleSheet.prototype.ownerRule;
+
+/**
+ * @type {CSSRuleList}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleSheet-cssRules
+ */
+CSSStyleSheet.prototype.cssRules;
+
+/**
+ * @param {string} rule
+ * @param {number} index
+ * @return {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleSheet-insertRule
+ */
+CSSStyleSheet.prototype.insertRule = function(rule, index) {};
+
+/**
+ * @param {number} index
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleSheet-deleteRule
+ */
+CSSStyleSheet.prototype.deleteRule = function(index) {};
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRuleList
+ */
+function CSSRuleList() {}
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRuleList-length
+ */
+CSSRuleList.prototype.length;
+
+/**
+ * @param {number} index
+ * @return {CSSRule}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRuleList-item
+ */
+CSSRuleList.prototype.item = function(index) {};
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule
+ */
+function CSSRule() {}
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule-ruleType
+ */
+CSSRule.prototype.type;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule-cssText
+ */
+CSSRule.prototype.cssText;
+
+/**
+ * @type {CSSStyleSheet}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule-sheet
+ */
+CSSRule.prototype.parentStyleSheet;
+
+/**
+ * @type {CSSRule}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule-parentRule
+ */
+CSSRule.prototype.parentRule;
+
+/**
+ * @type {CSSStyleDeclaration}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleRule
+ */
+CSSRule.prototype.style;
+
+/**
+ * Indicates that the rule is a {@see CSSUnknownRule}.
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule-ruleType
+ */
+CSSRule.UNKNOWN_RULE = 0;
+
+/**
+ * Indicates that the rule is a {@see CSSStyleRule}.
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule-ruleType
+ */
+CSSRule.STYLE_RULE = 1;
+
+/**
+ * Indicates that the rule is a {@see CSSCharsetRule}.
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule-ruleType
+ */
+CSSRule.CHARSET_RULE = 2;
+
+/**
+ * Indicates that the rule is a {@see CSSImportRule}.
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule-ruleType
+ */
+CSSRule.IMPORT_RULE = 3;
+
+/**
+ * Indicates that the rule is a {@see CSSMediaRule}.
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule-ruleType
+ */
+CSSRule.MEDIA_RULE = 4;
+
+/**
+ * Indicates that the rule is a {@see CSSFontFaceRule}.
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule-ruleType
+ */
+CSSRule.FONT_FACE_RULE = 5;
+
+/**
+ * Indicates that the rule is a {@see CSSPageRule}.
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule-ruleType
+ */
+CSSRule.PAGE_RULE = 6;
+
+/**
+ * @constructor
+ * @extends {CSSRule}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleRule
+ */
+function CSSStyleRule() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleRule-selectorText
+ */
+CSSStyleRule.prototype.selectorText;
+
+/**
+ * @type {CSSStyleDeclaration}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleRule-style
+ */
+CSSStyleRule.prototype.style;
+
+/**
+ * @constructor
+ * @extends {CSSRule}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSMediaRule
+ */
+function CSSMediaRule() {}
+
+/**
+ * @type {MediaList}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSMediaRule-mediaTypes
+ */
+CSSMediaRule.prototype.media;
+
+/**
+ * @type {CSSRuleList}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSMediaRule-cssRules
+ */
+CSSMediaRule.prototype.cssRules;
+
+/**
+ * @param {string} rule
+ * @param {number} index
+ * @return {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSMediaRule-insertRule
+ */
+CSSMediaRule.prototype.insertRule = function(rule, index) {};
+
+/**
+ * @param {number} index
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSMediaRule-deleteRule
+ */
+CSSMediaRule.prototype.deleteRule = function(index) {};
+
+/**
+ * @constructor
+ * @extends {CSSRule}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSFontFaceRule
+ */
+function CSSFontFaceRule() {}
+
+/**
+ * @type {CSSStyleDeclaration}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSFontFaceRule-style
+ */
+CSSFontFaceRule.prototype.style;
+
+/**
+ * @constructor
+ * @extends {CSSRule}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPageRule
+ */
+function CSSPageRule() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPageRule-name
+ */
+CSSPageRule.prototype.selectorText;
+
+/**
+ * @type {CSSStyleDeclaration}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPageRule-style
+ */
+CSSPageRule.prototype.style;
+
+/**
+ * @constructor
+ * @extends {CSSRule}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSImportRule
+ */
+function CSSImportRule() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSImportRule-href
+ */
+CSSImportRule.prototype.href;
+
+/**
+ * @type {MediaList}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSImportRule-media
+ */
+CSSImportRule.prototype.media;
+
+/**
+ * @type {CSSStyleSheet}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSImportRule-styleSheet
+ */
+CSSImportRule.prototype.styleSheet;
+
+/**
+ * @constructor
+ * @extends {CSSRule}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSCharsetRule
+ */
+function CSSCharsetRule() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSCharsetRule-encoding
+ */
+CSSCharsetRule.prototype.encoding;
+
+/**
+ * @constructor
+ * @extends {CSSRule}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSUnknownRule
+ */
+function CSSUnknownRule() {}
+
+/**
+ * @constructor
+ * @extends {CSSProperties}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration
+ */
+function CSSStyleDeclaration() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-cssText
+ */
+CSSStyleDeclaration.prototype.cssText;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-length
+ */
+CSSStyleDeclaration.prototype.length;
+
+/**
+ * @type {CSSRule}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-parentRule
+ */
+CSSStyleDeclaration.prototype.parentRule;
+
+/**
+ * @param {string} propertyName
+ * @return {CSSValue}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-getPropertyCSSValue
+ */
+CSSStyleDeclaration.prototype.getPropertyCSSValue = function(propertyName) {};
+
+/**
+ * @param {string} propertyName
+ * @return {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-getPropertyPriority
+ */
+CSSStyleDeclaration.prototype.getPropertyPriority = function(propertyName) {};
+
+/**
+ * @param {string} propertyName
+ * @return {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-getPropertyValue
+ */
+CSSStyleDeclaration.prototype.getPropertyValue = function(propertyName) {};
+
+/**
+ * @param {number} index
+ * @return {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-item
+ */
+CSSStyleDeclaration.prototype.item = function(index) {};
+
+/**
+ * @param {string} propertyName
+ * @return {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-removeProperty
+ */
+CSSStyleDeclaration.prototype.removeProperty = function(propertyName) {};
+
+/**
+ * @param {string} propertyName
+ * @param {string} value
+ * @param {string=} opt_priority
+ * @return {undefined}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-setProperty
+ */
+CSSStyleDeclaration.prototype.setProperty = function(propertyName, value, opt_priority) {};
+
+// IE-specific
+
+/**
+ * @param {string} name
+ * @param {number=} opt_flags
+ * @return {string|number|boolean|null}
+ * @see http://msdn.microsoft.com/en-us/library/ms536429(VS.85).aspx
+ */
+CSSStyleDeclaration.prototype.getAttribute = function(name, opt_flags) {};
+
+/**
+ * @param {string} name
+ * @return {string|number|boolean|null}
+ * @see http://msdn.microsoft.com/en-us/library/aa358797(VS.85).aspx
+ */
+CSSStyleDeclaration.prototype.getExpression = function(name) {};
+
+/**
+ * @param {string} name
+ * @param {number=} opt_flags
+ * @return {boolean}
+ * @see http://msdn.microsoft.com/en-us/library/ms536696(VS.85).aspx
+ */
+CSSStyleDeclaration.prototype.removeAttribute =
+ function(name, opt_flags) {};
+
+/**
+ * @param {string} name
+ * @return {boolean}
+ * @see http://msdn.microsoft.com/en-us/library/aa358798(VS.85).aspx
+ */
+CSSStyleDeclaration.prototype.removeExpression = function(name) {};
+
+/**
+ * @param {string} name
+ * @param {*} value
+ * @param {number=} opt_flags
+ * @see http://msdn.microsoft.com/en-us/library/ms536739(VS.85).aspx
+ */
+CSSStyleDeclaration.prototype.setAttribute = function(name, value, opt_flags) {};
+
+/**
+ * @param {string} name
+ * @param {string} expr
+ * @param {string=} opt_language
+ * @return {undefined}
+ * @see http://msdn.microsoft.com/en-us/library/ms531196(VS.85).aspx
+ */
+CSSStyleDeclaration.prototype.setExpression =
+ function(name, expr, opt_language) {};
+
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSValue
+ */
+function CSSValue() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSValue-cssText
+ */
+CSSValue.prototype.cssText;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSValue-cssValueType
+ */
+CSSValue.prototype.cssValueType;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSValue-types
+ */
+CSSValue.CSS_INHERIT = 0;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSValue-types
+ */
+CSSValue.CSS_PRIMITIVE_VALUE = 1;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSValue-types
+ */
+CSSValue.CSS_VALUE_LIST = 2;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSValue-types
+ */
+CSSValue.CSS_CUSTOM = 3;
+
+/**
+ * @constructor
+ * @extends {CSSValue}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue
+ */
+function CSSPrimitiveValue() {}
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue
+ */
+CSSPrimitiveValue.prototype.primitiveType;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue
+ */
+CSSPrimitiveValue.CSS_UNKNOWN = 0;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue
+ */
+CSSPrimitiveValue.CSS_NUMBER = 1;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue
+ */
+CSSPrimitiveValue.CSS_PERCENTAGE = 2;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue
+ */
+CSSPrimitiveValue.CSS_EMS = 3;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue
+ */
+CSSPrimitiveValue.CSS_EXS = 4;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue
+ */
+CSSPrimitiveValue.CSS_PX = 5;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue
+ */
+CSSPrimitiveValue.CSS_CM = 6;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue
+ */
+CSSPrimitiveValue.CSS_MM = 7;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue
+ */
+CSSPrimitiveValue.CSS_IN = 8;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue
+ */
+CSSPrimitiveValue.CSS_PT = 9;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue
+ */
+CSSPrimitiveValue.CSS_PC = 10;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue
+ */
+CSSPrimitiveValue.CSS_DEG = 11;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue
+ */
+CSSPrimitiveValue.CSS_RAD = 12;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue
+ */
+CSSPrimitiveValue.CSS_GRAD = 13;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue
+ */
+CSSPrimitiveValue.CSS_MS = 14;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue
+ */
+CSSPrimitiveValue.CSS_S = 15;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue
+ */
+CSSPrimitiveValue.CSS_HZ = 16;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue
+ */
+CSSPrimitiveValue.CSS_KHZ = 17;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue
+ */
+CSSPrimitiveValue.CSS_DIMENSION = 18;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue
+ */
+CSSPrimitiveValue.CSS_STRING = 19;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue
+ */
+CSSPrimitiveValue.CSS_URI = 20;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue
+ */
+CSSPrimitiveValue.CSS_IDENT = 21;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue
+ */
+CSSPrimitiveValue.CSS_ATTR = 22;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue
+ */
+CSSPrimitiveValue.CSS_COUNTER = 23;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue
+ */
+CSSPrimitiveValue.CSS_RECT = 24;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue
+ */
+CSSPrimitiveValue.CSS_RGBCOLOR = 25;
+
+/**
+ * @return {Counter}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue-getCounterValue
+ * @throws DOMException {@see DomException.INVALID_ACCESS_ERR}
+ */
+CSSPrimitiveValue.prototype.getCounterValue = function() {};
+
+/**
+ * @param {number} unitType
+ * @return {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue-getFloatValue
+ * @throws DOMException {@see DomException.INVALID_ACCESS_ERR}
+ */
+CSSPrimitiveValue.prototype.getFloatValue = function(unitType) {};
+
+/**
+ * @return {RGBColor}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue-getRGBColorValue
+ * @throws DOMException {@see DomException.INVALID_ACCESS_ERR}
+ */
+CSSPrimitiveValue.prototype.getRGBColorValue = function() {};
+
+/**
+ * @return {Rect}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue-getRectValue
+ * @throws DOMException {@see DomException.INVALID_ACCESS_ERR}
+ */
+CSSPrimitiveValue.prototype.getRectValue = function() {};
+
+/**
+ * @return {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue-getStringValue
+ * @throws DOMException {@see DomException.INVALID_ACCESS_ERR}
+ */
+CSSPrimitiveValue.prototype.getStringValue = function() {};
+
+/**
+ * @param {number} unitType
+ * @param {number} floatValue
+ * @return {undefined}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue-setFloatValue
+ * @throws DOMException {@see DomException.INVALID_ACCESS_ERR},
+ * {@see DomException.NO_MODIFICATION_ALLOWED_ERR}
+ */
+CSSPrimitiveValue.prototype.setFloatValue = function(unitType, floatValue) {};
+
+/**
+ * @param {number} stringType
+ * @param {string} stringValue
+ * @return {undefined}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue-setStringValue
+ * @throws DOMException {@see DomException.INVALID_ACCESS_ERR},
+ * {@see DomException.NO_MODIFICATION_ALLOWED_ERR}
+ */
+CSSPrimitiveValue.prototype.setStringValue = function(stringType, stringValue) {};
+
+/**
+ * @constructor
+ * @extends {CSSValue}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSValueList
+ */
+function CSSValueList() {}
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSValueList-length
+ */
+CSSValueList.prototype.length;
+
+/**
+ * @param {number} index
+ * @return {CSSValue}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSValueList-item
+ */
+CSSValueList.prototype.item = function(index) {};
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-RGBColor
+ */
+function RGBColor() {}
+
+/**
+ * @type {CSSPrimitiveValue}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-RGBColor-red
+ */
+RGBColor.prototype.red;
+
+/**
+ * @type {CSSPrimitiveValue}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-RGBColor-green
+ */
+RGBColor.prototype.green;
+
+/**
+ * @type {CSSPrimitiveValue}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-RGBColor-blue
+ */
+RGBColor.prototype.blue;
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-Rect
+ */
+function Rect() {}
+
+/**
+ * @type {CSSPrimitiveValue}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-Rect-top
+ */
+Rect.prototype.top;
+
+/**
+ * @type {CSSPrimitiveValue}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-Rect-right
+ */
+Rect.prototype.right;
+
+/**
+ * @type {CSSPrimitiveValue}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-Rect-bottom
+ */
+Rect.prototype.bottom;
+
+/**
+ * @type {CSSPrimitiveValue}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-Rect-left
+ */
+Rect.prototype.left;
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-Counter
+ */
+function Counter() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-Counter-identifier
+ */
+Counter.prototype.identifier;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-Counter-listStyle
+ */
+Counter.prototype.listStyle;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-Counter-separator
+ */
+Counter.prototype.separator;
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-ViewCSS
+ */
+function ViewCSS() {}
+
+/**
+ * @param {Element} elt
+ * @param {?string=} opt_pseudoElt This argument is required according to the
+ * CSS2 specification, but optional in all major browsers. See the note at
+ * https://developer.mozilla.org/en-US/docs/Web/API/Window.getComputedStyle
+ * @return {CSSStyleDeclaration}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSview-getComputedStyle
+ */
+ViewCSS.prototype.getComputedStyle = function(elt, opt_pseudoElt) {};
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-DocumentCSS
+ */
+function DocumentCSS() {}
+
+/**
+ * @param {Element} elt
+ * @param {string} pseudoElt
+ * @return {CSSStyleDeclaration}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-DocumentCSS-getOverrideStyle
+ */
+DocumentCSS.prototype.getOverrideStyle = function(elt, pseudoElt) {};
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-DOMImplementationCSS
+ */
+function DOMImplementationCSS() {}
+
+/**
+ * @param {string} title
+ * @param {string} media
+ * @return {CSSStyleSheet}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-DOMImplementationCSS-createCSSStyleSheet
+ * @throws DOMException {@see DomException.SYNTAX_ERR}
+ */
+DOMImplementationCSS.prototype.createCSSStyleSheet = function(title, media) {};
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-ElementCSSInlineStyle
+ */
+function ElementCSSInlineStyle() {}
+
+/**
+ * @type {CSSStyleDeclaration}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-ElementCSSInlineStyle-style
+ */
+ElementCSSInlineStyle.prototype.style;
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties
+ */
+function CSSProperties() {}
+
+// CSS 2 properties
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-azimuth
+ */
+CSSProperties.prototype.azimuth;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-background
+ */
+CSSProperties.prototype.background;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-backgroundAttachment
+ */
+CSSProperties.prototype.backgroundAttachment;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-backgroundColor
+ */
+CSSProperties.prototype.backgroundColor;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-backgroundImage
+ */
+CSSProperties.prototype.backgroundImage;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-backgroundPosition
+ */
+CSSProperties.prototype.backgroundPosition;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-backgroundRepeat
+ */
+CSSProperties.prototype.backgroundRepeat;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/css3-background/#the-background-size
+ */
+CSSProperties.prototype.backgroundSize;
+
+/**
+ * @implicitCast
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-border
+ */
+CSSProperties.prototype.border;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderCollapse
+ */
+CSSProperties.prototype.borderCollapse;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderColor
+ */
+CSSProperties.prototype.borderColor;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderSpacing
+ */
+CSSProperties.prototype.borderSpacing;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSPrimitiveValue-borderStyle
+ */
+CSSProperties.prototype.borderStyle;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderTop
+ */
+CSSProperties.prototype.borderTop;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderRight
+ */
+CSSProperties.prototype.borderRight;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderBottom
+ */
+CSSProperties.prototype.borderBottom;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderLeft
+ */
+CSSProperties.prototype.borderLeft;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderTopColor
+ */
+CSSProperties.prototype.borderTopColor;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderRightColor
+ */
+CSSProperties.prototype.borderRightColor;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderBottomColor
+ */
+CSSProperties.prototype.borderBottomColor;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderLeftColor
+ */
+CSSProperties.prototype.borderLeftColor;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderTopStyle
+ */
+CSSProperties.prototype.borderTopStyle;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderRightStyle
+ */
+CSSProperties.prototype.borderRightStyle;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderBottomStyle
+ */
+CSSProperties.prototype.borderBottomStyle;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderLeftStyle
+ */
+CSSProperties.prototype.borderLeftStyle;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderTopWidth
+ */
+CSSProperties.prototype.borderTopWidth;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderRightWidth
+ */
+CSSProperties.prototype.borderRightWidth;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderBottomWidth
+ */
+CSSProperties.prototype.borderBottomWidth;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderLeftWidth
+ */
+CSSProperties.prototype.borderLeftWidth;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-borderWidth
+ */
+CSSProperties.prototype.borderWidth;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/css3-background/#the-border-radius
+ */
+CSSProperties.prototype.borderRadius;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/css3-background/#the-border-radius
+ */
+CSSProperties.prototype.borderBottomLeftRadius;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/css3-background/#the-border-radius
+ */
+CSSProperties.prototype.borderBottomRightRadius;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/css3-background/#the-border-radius
+ */
+CSSProperties.prototype.borderTopLeftRadius;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/css3-background/#the-border-radius
+ */
+CSSProperties.prototype.borderTopRightRadius;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-bottom
+ */
+CSSProperties.prototype.bottom;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-captionSide
+ */
+CSSProperties.prototype.captionSide;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-clear
+ */
+CSSProperties.prototype.clear;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-clip
+ */
+CSSProperties.prototype.clip;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-color
+ */
+CSSProperties.prototype.color;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-content
+ */
+CSSProperties.prototype.content;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-counterIncrement
+ */
+CSSProperties.prototype.counterIncrement;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-counterReset
+ */
+CSSProperties.prototype.counterReset;
+
+/**
+ * This is not an official part of the W3C spec. In practice, this is a settable
+ * property that works cross-browser. It is used in goog.dom.setProperties() and
+ * needs to be extern'd so the --disambiguate_properties JS compiler pass works.
+ * @type {string}
+ */
+CSSProperties.prototype.cssText;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-cue
+ */
+CSSProperties.prototype.cue;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-cueAfter
+ */
+CSSProperties.prototype.cueAfter;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-cueBefore
+ */
+CSSProperties.prototype.cueBefore;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-cursor
+ */
+CSSProperties.prototype.cursor;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-direction
+ */
+CSSProperties.prototype.direction;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-display
+ */
+CSSProperties.prototype.display;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-elevation
+ */
+CSSProperties.prototype.elevation;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-emptyCells
+ */
+CSSProperties.prototype.emptyCells;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-cssFloat
+ */
+CSSProperties.prototype.cssFloat;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-font
+ */
+CSSProperties.prototype.font;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-fontFamily
+ */
+CSSProperties.prototype.fontFamily;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-fontSize
+ */
+CSSProperties.prototype.fontSize;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-fontSizeAdjust
+ */
+CSSProperties.prototype.fontSizeAdjust;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-fontStretch
+ */
+CSSProperties.prototype.fontStretch;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-fontStyle
+ */
+CSSProperties.prototype.fontStyle;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-fontVariant
+ */
+CSSProperties.prototype.fontVariant;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-fontWeight
+ */
+CSSProperties.prototype.fontWeight;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-height
+ */
+CSSProperties.prototype.height;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-left
+ */
+CSSProperties.prototype.left;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-letterSpacing
+ */
+CSSProperties.prototype.letterSpacing;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-lineHeight
+ */
+CSSProperties.prototype.lineHeight;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-listStyle
+ */
+CSSProperties.prototype.listStyle;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-listStyleImage
+ */
+CSSProperties.prototype.listStyleImage;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-listStylePosition
+ */
+CSSProperties.prototype.listStylePosition;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-listStyleType
+ */
+CSSProperties.prototype.listStyleType;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-margin
+ */
+CSSProperties.prototype.margin;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-marginTop
+ */
+CSSProperties.prototype.marginTop;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-marginRight
+ */
+CSSProperties.prototype.marginRight;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-marginBottom
+ */
+CSSProperties.prototype.marginBottom;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-marginLeft
+ */
+CSSProperties.prototype.marginLeft;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-markerOffset
+ */
+CSSProperties.prototype.markerOffset;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-marks
+ */
+CSSProperties.prototype.marks;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-maxHeight
+ */
+CSSProperties.prototype.maxHeight;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-maxWidth
+ */
+CSSProperties.prototype.maxWidth;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-minHeight
+ */
+CSSProperties.prototype.minHeight;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-minWidth
+ */
+CSSProperties.prototype.minWidth;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-orphans
+ */
+CSSProperties.prototype.orphans;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-outline
+ */
+CSSProperties.prototype.outline;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-outlineColor
+ */
+CSSProperties.prototype.outlineColor;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-outlineStyle
+ */
+CSSProperties.prototype.outlineStyle;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-outlineWidth
+ */
+CSSProperties.prototype.outlineWidth;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-overflow
+ */
+CSSProperties.prototype.overflow;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-padding
+ */
+CSSProperties.prototype.padding;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-paddingTop
+ */
+CSSProperties.prototype.paddingTop;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-paddingRight
+ */
+CSSProperties.prototype.paddingRight;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-paddingBottom
+ */
+CSSProperties.prototype.paddingBottom;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-paddingLeft
+ */
+CSSProperties.prototype.paddingLeft;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-page
+ */
+CSSProperties.prototype.page;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-pageBreakAfter
+ */
+CSSProperties.prototype.pageBreakAfter;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-pageBreakBefore
+ */
+CSSProperties.prototype.pageBreakBefore;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-pageBreakInside
+ */
+CSSProperties.prototype.pageBreakInside;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-pause
+ */
+CSSProperties.prototype.pause;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-pauseAfter
+ */
+CSSProperties.prototype.pauseAfter;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-pauseBefore
+ */
+CSSProperties.prototype.pauseBefore;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-pitch
+ */
+CSSProperties.prototype.pitch;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-pitchRange
+ */
+CSSProperties.prototype.pitchRange;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-playDuring
+ */
+CSSProperties.prototype.playDuring;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-position
+ */
+CSSProperties.prototype.position;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-quotes
+ */
+CSSProperties.prototype.quotes;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/css3-ui/#resize
+ */
+CSSProperties.prototype.resize;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-richness
+ */
+CSSProperties.prototype.richness;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-right
+ */
+CSSProperties.prototype.right;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-size
+ */
+CSSProperties.prototype.size;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-speak
+ */
+CSSProperties.prototype.speak;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-speakHeader
+ */
+CSSProperties.prototype.speakHeader;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-speakNumeral
+ */
+CSSProperties.prototype.speakNumeral;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-speakPunctuation
+ */
+CSSProperties.prototype.speakPunctuation;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-speechRate
+ */
+CSSProperties.prototype.speechRate;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-stress
+ */
+CSSProperties.prototype.stress;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-tableLayout
+ */
+CSSProperties.prototype.tableLayout;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-textAlign
+ */
+CSSProperties.prototype.textAlign;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-textDecoration
+ */
+CSSProperties.prototype.textDecoration;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-textIndent
+ */
+CSSProperties.prototype.textIndent;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-textShadow
+ */
+CSSProperties.prototype.textShadow;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-textTransform
+ */
+CSSProperties.prototype.textTransform;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-top
+ */
+CSSProperties.prototype.top;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-unicodeBidi
+ */
+CSSProperties.prototype.unicodeBidi;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-verticalAlign
+ */
+CSSProperties.prototype.verticalAlign;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-visibility
+ */
+CSSProperties.prototype.visibility;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-voiceFamily
+ */
+CSSProperties.prototype.voiceFamily;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-volume
+ */
+CSSProperties.prototype.volume;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-whiteSpace
+ */
+CSSProperties.prototype.whiteSpace;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-widows
+ */
+CSSProperties.prototype.widows;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-width
+ */
+CSSProperties.prototype.width;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-wordSpacing
+ */
+CSSProperties.prototype.wordSpacing;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-wordWrap
+ */
+CSSProperties.prototype.wordWrap;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSProperties-zIndex
+ */
+CSSProperties.prototype.zIndex;
+
+// CSS 3 properties
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/css3-background/#box-shadow
+ */
+CSSProperties.prototype.boxShadow;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/css3-ui/#box-sizing
+ */
+CSSProperties.prototype.boxSizing;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/css3-color/#transparency
+ */
+CSSProperties.prototype.opacity;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/css3-ui/#text-overflow
+ */
+CSSProperties.prototype.textOverflow;
+
+// CSS 3 transforms
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/css3-2d-transforms/#backface-visibility-property
+ */
+CSSProperties.prototype.backfaceVisibility;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/css3-2d-transforms/#perspective
+ */
+CSSProperties.prototype.perspective;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/css3-2d-transforms/#perspective-origin
+ */
+CSSProperties.prototype.perspectiveOrigin;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/css3-2d-transforms/#effects
+ */
+CSSProperties.prototype.transform;
+
+/**
+ * @type {string|number}
+ * @see http://www.w3.org/TR/css3-2d-transforms/#transform-origin
+ */
+CSSProperties.prototype.transformOrigin;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/css3-2d-transforms/#transform-style
+ */
+CSSProperties.prototype.transformStyle;
+
+// CSS 3 transitions
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/css3-transitions/#transition
+ */
+CSSProperties.prototype.transition;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/css3-transitions/#transition-delay
+ */
+CSSProperties.prototype.transitionDelay;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/css3-transitions/#transition-duration
+ */
+CSSProperties.prototype.transitionDuration;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/css3-transitions/#transition-property-property
+ */
+CSSProperties.prototype.transitionProperty;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/css3-transitions/#transition-timing-function
+ */
+CSSProperties.prototype.transitionTimingFunction;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/SVG11/interact.html#PointerEventsProperty
+ */
+CSSProperties.prototype.pointerEvents;
+
+/**
+ * TODO(dbeam): Put this in separate file named w3c_cssom.js.
+ * Externs for the CSSOM View Module.
+ * @see http://www.w3.org/TR/cssom-view/
+ */
+
+// http://www.w3.org/TR/cssom-view/#extensions-to-the-window-interface
+
+/**
+ * @param {string} media_query_list
+ * @return {MediaQueryList}
+ * @see http://www.w3.org/TR/cssom-view/#dom-window-matchmedia
+ */
+Window.prototype.matchMedia = function(media_query_list) {};
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-window-innerwidth
+ */
+Window.prototype.innerWidth;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-window-innerheight
+ */
+Window.prototype.innerHeight;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-window-scrollx
+ */
+Window.prototype.scrollX;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-window-pagexoffset
+ */
+Window.prototype.pageXOffset;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-window-scrolly
+ */
+Window.prototype.scrollY;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-window-pageyoffset
+ */
+Window.prototype.pageYOffset;
+
+/**
+ * @param {number} x
+ * @param {number} y
+ * @see http://www.w3.org/TR/cssom-view/#dom-window-scroll
+ */
+Window.prototype.scroll = function(x, y) {};
+
+/**
+ * @param {number} x
+ * @param {number} y
+ * @see http://www.w3.org/TR/cssom-view/#dom-window-scrollto
+ */
+Window.prototype.scrollTo = function(x, y) {};
+
+/**
+ * @param {number} x
+ * @param {number} y
+ * @see http://www.w3.org/TR/cssom-view/#dom-window-scrollby
+ */
+Window.prototype.scrollBy = function(x, y) {};
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-window-screenx
+ */
+Window.prototype.screenX;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-window-screeny
+ */
+Window.prototype.screenY;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-window-outerwidth
+ */
+Window.prototype.outerWidth;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-window-outerheight
+ */
+Window.prototype.outerHeight;
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/cssom-view/#mediaquerylist
+ */
+function MediaQueryList() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/cssom-view/#dom-mediaquerylist-media
+ */
+MediaQueryList.prototype.media;
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/cssom-view/#dom-mediaquerylist-matches
+ */
+MediaQueryList.prototype.matches;
+
+/**
+ * @param {MediaQueryListListener} listener
+ * @see http://www.w3.org/TR/cssom-view/#dom-mediaquerylist-addlistener
+ */
+MediaQueryList.prototype.addListener = function(listener) {};
+
+/**
+ * @param {MediaQueryListListener} listener
+ * @see http://www.w3.org/TR/cssom-view/#dom-mediaquerylist-removelistener
+ */
+MediaQueryList.prototype.removeListener = function(listener) {};
+
+/**
+ * @typedef {(function(!MediaQueryList) : void)}
+ * @see http://www.w3.org/TR/cssom-view/#mediaquerylistlistener
+ */
+var MediaQueryListListener;
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/cssom-view/#screen
+ */
+function Screen() {}
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-screen-availwidth
+ */
+Screen.prototype.availWidth;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-screen-availheight
+ */
+Screen.prototype.availHeight;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-screen-width
+ */
+Screen.prototype.width;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-screen-height
+ */
+Screen.prototype.height;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-screen-colordepth
+ */
+Screen.prototype.colorDepth;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-screen-pixeldepth
+ */
+Screen.prototype.pixelDepth;
+
+
+// http://www.w3.org/TR/cssom-view/#extensions-to-the-document-interface
+
+/**
+ * @param {number} x
+ * @param {number} y
+ * @return {?Element}
+ * @see http://www.w3.org/TR/cssom-view/#dom-document-elementfrompoint
+ */
+Document.prototype.elementFromPoint = function(x, y) {};
+
+/**
+ * @param {number} x
+ * @param {number} y
+ * @return {CaretPosition}
+ * @see http://www.w3.org/TR/cssom-view/#dom-document-caretpositionfrompoint
+ */
+Document.prototype.caretPositionFromPoint = function(x, y) {};
+
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/cssom-view/#caretposition
+ */
+function CaretPosition() {}
+
+/**
+ * @type {Node}
+ * @see http://www.w3.org/TR/cssom-view/#dom-caretposition-offsetnode
+ */
+CaretPosition.prototype.offsetNode;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-caretposition-offset
+ */
+CaretPosition.prototype.offset;
+
+
+// http://www.w3.org/TR/cssom-view/#extensions-to-the-element-interface
+
+/**
+ * @return {!ClientRectList}
+ * @see http://www.w3.org/TR/cssom-view/#dom-element-getclientrects
+ */
+Element.prototype.getClientRects = function() {};
+
+/**
+ * @return {!ClientRect}
+ * @see http://www.w3.org/TR/cssom-view/#dom-element-getboundingclientrect
+ */
+Element.prototype.getBoundingClientRect = function() {};
+
+/**
+ * @param {boolean=} opt_top
+ * @see http://www.w3.org/TR/cssom-view/#dom-element-scrollintoview
+ */
+Element.prototype.scrollIntoView = function(opt_top) {};
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-element-scrolltop
+ */
+Element.prototype.scrollTop;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-element-scrollleft
+ */
+Element.prototype.scrollLeft;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-element-scrollwidth
+ */
+Element.prototype.scrollWidth;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-element-scrollheight
+ */
+Element.prototype.scrollHeight;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-element-clienttop
+ */
+Element.prototype.clientTop;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-element-clientleft
+ */
+Element.prototype.clientLeft;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-element-clientwidth
+ */
+Element.prototype.clientWidth;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-element-clientheight
+ */
+Element.prototype.clientHeight;
+
+// http://www.w3.org/TR/cssom-view/#extensions-to-the-htmlelement-interface
+
+/**
+ * @type {Element}
+ * @see http://www.w3.org/TR/cssom-view/#dom-htmlelement-offsetparent
+ */
+HTMLElement.prototype.offsetParent;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-htmlelement-offsettop
+ */
+HTMLElement.prototype.offsetTop;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-htmlelement-offsetleft
+ */
+HTMLElement.prototype.offsetLeft;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-htmlelement-offsetwidth
+ */
+HTMLElement.prototype.offsetWidth;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-htmlelement-offsetheight
+ */
+HTMLElement.prototype.offsetHeight;
+
+
+// http://www.w3.org/TR/cssom-view/#extensions-to-the-range-interface
+
+/**
+ * @return {!ClientRectList}
+ * @see http://www.w3.org/TR/cssom-view/#dom-range-getclientrects
+ */
+Range.prototype.getClientRects = function() {};
+
+/**
+ * @return {!ClientRect}
+ * @see http://www.w3.org/TR/cssom-view/#dom-range-getboundingclientrect
+ */
+Range.prototype.getBoundingClientRect = function() {};
+
+
+// http://www.w3.org/TR/cssom-view/#extensions-to-the-mouseevent-interface
+
+// MouseEvent: screen{X,Y} and client{X,Y} are in DOM Level 2/3 Event as well,
+// so it seems like a specification issue. I've emailed www-style@w3.org in
+// hopes of resolving the conflict, but in the mean time they can live here
+// (http://lists.w3.org/Archives/Public/www-style/2012May/0039.html).
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-mouseevent-screenx
+ */
+//MouseEvent.prototype.screenX;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-mouseevent-screeny
+ */
+//MouseEvent.prototype.screenY;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-mouseevent-pagex
+ */
+MouseEvent.prototype.pageX;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-mouseevent-pagey
+ */
+MouseEvent.prototype.pageY;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-mouseevent-clientx
+ */
+//MouseEvent.prototype.clientX;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-mouseevent-clienty
+ */
+//MouseEvent.prototype.clientY;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-mouseevent-x
+ */
+MouseEvent.prototype.x;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-mouseevent-y
+ */
+MouseEvent.prototype.y;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-mouseevent-offsetx
+ */
+MouseEvent.prototype.offsetX;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-mouseevent-offsety
+ */
+MouseEvent.prototype.offsetY;
+
+
+// http://www.w3.org/TR/cssom-view/#rectangles
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/cssom-view/#the-clientrectlist-interface
+ */
+function ClientRectList() {}
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-clientrectlist-length
+ */
+ClientRectList.prototype.length;
+
+/**
+ * @param {number} index
+ * @return {ClientRect}
+ * @see http://www.w3.org/TR/cssom-view/#dom-clientrectlist-item
+ */
+ClientRectList.prototype.item = function(index) {};
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/cssom-view/#the-clientrect-interface
+ */
+function ClientRect() {}
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-clientrect-top
+ */
+ClientRect.prototype.top;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-clientrect-right
+ */
+ClientRect.prototype.right;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-clientrect-bottom
+ */
+ClientRect.prototype.bottom;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-clientrect-left
+ */
+ClientRect.prototype.left;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-clientrect-width
+ */
+ClientRect.prototype.width;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/cssom-view/#dom-clientrect-height
+ */
+ClientRect.prototype.height;
+
+/**
+ * @constructor
+ * http://www.w3.org/TR/css3-conditional/#CSS-interface
+ */
+function CSSInterface() {}
+
+/**
+ * @param {string} property
+ * @param {string=} opt_value
+ * @return {boolean}
+ */
+CSSInterface.prototype.supports = function(property, opt_value) {};
+
+/**
+ * TODO(nicksantos): This suppress tag probably isn't needed, and
+ * should be removed.
+ * @suppress {duplicate}
+ * @type {CSSInterface}
+ */
+var CSS;
+
+/** @type {CSSInterface} */
+Window.prototype.CSS;
+
+// http://dev.w3.org/csswg/css-font-loading/
+
+/**
+ * @enum {string}
+ * @see http://dev.w3.org/csswg/css-font-loading/#enumdef-fontfaceloadstatus
+ */
+var FontFaceLoadStatus = {
+ ERROR: 'error',
+ LOADED: 'loaded',
+ LOADING: 'loading',
+ UNLOADED: 'unloaded'
+};
+
+/**
+ * @typedef {{
+ * style: (string|undefined),
+ * weight: (string|undefined),
+ * stretch: (string|undefined),
+ * unicodeRange: (string|undefined),
+ * variant: (string|undefined),
+ * featureSettings: (string|undefined)
+ * }}
+ * @see http://dev.w3.org/csswg/css-font-loading/#dictdef-fontfacedescriptors
+ */
+var FontFaceDescriptors;
+
+/**
+ * @constructor
+ * @param {string} fontFamily
+ * @param {string} source
+ * @param {!FontFaceDescriptors} descriptors
+ * @see http://dev.w3.org/csswg/css-font-loading/#font-face-constructor
+ */
+function FontFace(fontFamily, source, descriptors) {}
+
+/**
+ * @type {string}
+ * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontface-family
+ */
+FontFace.prototype.family;
+
+/**
+ * @type {string}
+ * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontface-style
+ */
+FontFace.prototype.style;
+
+/**
+ * @type {string}
+ * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontface-weight
+ */
+FontFace.prototype.weight;
+
+/**
+ * @type {string}
+ * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontface-stretch
+ */
+FontFace.prototype.stretch;
+
+/**
+ * @type {string}
+ * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontface-unicoderange
+ */
+FontFace.prototype.unicodeRange;
+
+/**
+ * @type {string}
+ * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontface-variant
+ */
+FontFace.prototype.variant;
+
+/**
+ * @type {string}
+ * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontface-featuresettings
+ */
+FontFace.prototype.featureSettings;
+
+/**
+ * @type {FontFaceLoadStatus}
+ * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontface-status
+ */
+FontFace.prototype.status;
+
+/**
+ * @return {!Promise.<!FontFace>}
+ * @see http://dev.w3.org/csswg/css-font-loading/#font-face-load
+ */
+FontFace.prototype.load = function() {};
+
+/**
+ * @enum
+ * @see http://dev.w3.org/csswg/css-font-loading/#enumdef-fontfacesetloadstatus
+ */
+var FontFaceSetLoadStatus = {
+ LOADED: 'loaded',
+ LOADING: 'loading'
+};
+
+/**
+ * @interface
+ * @see http://dev.w3.org/csswg/css-font-loading/#FontFaceSet-interface
+ */
+function FontFaceSet() {}
+
+// Event handlers
+// http://dev.w3.org/csswg/css-font-loading/#FontFaceSet-events
+
+/** @type {?function (Event)} */ FontFaceSet.prototype.onloading;
+/** @type {?function (Event)} */ FontFaceSet.prototype.onloadingdone;
+/** @type {?function (Event)} */ FontFaceSet.prototype.onloadingerror;
+
+/**
+ * @param {!FontFace} value
+ * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontfaceset-add
+ */
+FontFaceSet.prototype.add = function(value) {};
+
+/**
+ * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontfaceset-clear
+ */
+FontFaceSet.prototype.clear = function() {};
+
+/**
+ * @param {!FontFace} value
+ * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontfaceset-delete
+ */
+FontFaceSet.prototype.delete = function(value) {};
+
+/**
+ * @param {!FontFace} font
+ * @return {boolean}
+ * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontfaceset-has
+ */
+FontFaceSet.prototype.has = function(font) {};
+
+/**
+ * @param {function(!FontFace, number, !FontFaceSet)} cb
+ * @param {Object|undefined=} opt_selfObj
+ * see http://dev.w3.org/csswg/css-font-loading/#dom-fontfaceset-foreach
+ */
+FontFaceSet.prototype.forEach = function(cb, opt_selfObj) {};
+
+/**
+ * @param {string} font
+ * @param {string=} opt_text
+ * @return {!Promise.<!Array.<!FontFace>>}
+ * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontfaceset-load
+ */
+FontFaceSet.prototype.load = function(font, opt_text) {};
+
+/**
+ * @param {string} font
+ * @param {string=} opt_text
+ * @return {boolean}
+ * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontfaceset-check
+ */
+FontFaceSet.prototype.check = function(font, opt_text) {};
+
+/**
+ * @type {!Promise.<!FontFaceSet>}
+ * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontfaceset-ready
+ */
+FontFaceSet.prototype.ready;
+
+/**
+ * @type {FontFaceSetLoadStatus}
+ * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontfaceset-status
+ */
+FontFaceSet.prototype.status;
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_css3d.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_css3d.js
new file mode 100644
index 0000000000..1c3d64c93a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_css3d.js
@@ -0,0 +1,199 @@
+/*
+ * Copyright 2010 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for W3C's CSS 3D Transforms specification.
+ * The whole file has been fully type annotated. Created from
+ * https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html
+ *
+ * @externs
+ */
+
+/**
+ * @constructor
+ * @param {string=} opt_matrix
+ * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#the-cssmatrix-interface
+ */
+function CSSMatrix(opt_matrix) {}
+
+/**
+ * @type {number}
+ * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes
+ */
+CSSMatrix.prototype.m11;
+
+/**
+ * @type {number}
+ * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes
+ */
+CSSMatrix.prototype.m12;
+
+/**
+ * @type {number}
+ * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes
+ */
+CSSMatrix.prototype.m13;
+
+/**
+ * @type {number}
+ * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes
+ */
+CSSMatrix.prototype.m14;
+
+/**
+ * @type {number}
+ * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes
+ */
+CSSMatrix.prototype.m21;
+
+/**
+ * @type {number}
+ * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes
+ */
+CSSMatrix.prototype.m22;
+
+/**
+ * @type {number}
+ * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes
+ */
+CSSMatrix.prototype.m23;
+
+/**
+ * @type {number}
+ * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes
+ */
+CSSMatrix.prototype.m24;
+
+/**
+ * @type {number}
+ * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes
+ */
+CSSMatrix.prototype.m31;
+
+/**
+ * @type {number}
+ * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes
+ */
+CSSMatrix.prototype.m32;
+
+/**
+ * @type {number}
+ * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes
+ */
+CSSMatrix.prototype.m33;
+
+/**
+ * @type {number}
+ * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes
+ */
+CSSMatrix.prototype.m34;
+
+/**
+ * @type {number}
+ * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes
+ */
+CSSMatrix.prototype.m41;
+
+/**
+ * @type {number}
+ * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes
+ */
+CSSMatrix.prototype.m42;
+
+/**
+ * @type {number}
+ * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes
+ */
+CSSMatrix.prototype.m43;
+
+/**
+ * @type {number}
+ * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#three-dimensional-attributes
+ */
+CSSMatrix.prototype.m44;
+
+/**
+ * @param {string} string
+ * @return {void}
+ */
+CSSMatrix.prototype.setMatrixValue = function(string) {};
+
+/**
+ * @param {!CSSMatrix} secondMatrix
+ * @return {!CSSMatrix}
+ * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#widl-CSSMatrix-multiply-CSSMatrix-CSSMatrix-other
+ */
+CSSMatrix.prototype.multiply = function(secondMatrix) {};
+
+/**
+ * @return {CSSMatrix} Returns void if the matrix is non-invertable.
+ * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#widl-CSSMatrix-inverse-CSSMatrix
+ */
+CSSMatrix.prototype.inverse = function() {};
+
+/**
+ * @param {number=} opt_x Defaults to 0.
+ * @param {number=} opt_y Defaults to 0.
+ * @param {number=} opt_z Defaults to 0.
+ * @return {!CSSMatrix}
+ * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#widl-CSSMatrix-translate-CSSMatrix-unrestricted-double-tx-unrestricted-double-ty-unrestricted-double-tz
+ */
+CSSMatrix.prototype.translate = function(opt_x, opt_y, opt_z) {};
+
+/**
+ * @param {number=} opt_scaleX Defaults to 1.
+ * @param {number=} opt_scaleY Defaults to scaleX.
+ * @param {number=} opt_scaleZ Defaults to 1.
+ * @return {!CSSMatrix}
+ * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#widl-CSSMatrix-scale-CSSMatrix-unrestricted-double-scale-unrestricted-double-originX-unrestricted-double-originY
+ */
+CSSMatrix.prototype.scale = function(opt_scaleX, opt_scaleY, opt_scaleZ) {};
+
+/**
+ * @param {number=} opt_rotX Defaults to 0.
+ * @param {number=} opt_rotY Defaults to 0.
+ * @param {number=} opt_rotZ Defaults to rotX if rotY is not defined, else 0.
+ * @return {!CSSMatrix}
+ * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#widl-CSSMatrix-rotate-CSSMatrix-unrestricted-double-angle-unrestricted-double-originX-unrestricted-double-originY
+ */
+CSSMatrix.prototype.rotate = function(opt_rotX, opt_rotY, opt_rotZ) {};
+
+/**
+ * @param {number=} opt_x Defaults to 0.
+ * @param {number=} opt_y Defaults to 0.
+ * @param {number=} opt_z Defaults to 0.
+ * @param {number=} opt_angle Defaults to 0.
+ * @return {!CSSMatrix}
+ * @see https://dvcs.w3.org/hg/FXTF/raw-file/tip/matrix/index.html#widl-CSSMatrix-rotateAxisAngle-CSSMatrix-unrestricted-double-x-unrestricted-double-y-unrestricted-double-z-unrestricted-double-angle
+ */
+CSSMatrix.prototype.rotateAxisAngle =
+ function(opt_x, opt_y, opt_z, opt_angle) {};
+
+/**
+ * @constructor
+ * @param {string=} opt_matrix
+ * @extends {CSSMatrix}
+ * @see http://developer.apple.com/safari/library/documentation/AudioVideo/Reference/WebKitCSSMatrixClassReference/WebKitCSSMatrix/WebKitCSSMatrix.html#//apple_ref/javascript/instm/WebKitCSSMatrix/setMatrixValue
+ */
+function WebKitCSSMatrix(opt_matrix) {}
+
+/**
+ * @constructor
+ * @param {string=} opt_matrix
+ * @extends {CSSMatrix}
+ * @see http://msdn.microsoft.com/en-us/library/windows/apps/hh453593.aspx
+ */
+function MSCSSMatrix(opt_matrix) {}
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_device_sensor_event.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_device_sensor_event.js
new file mode 100644
index 0000000000..de36ea3244
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_device_sensor_event.js
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2013 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for W3C's device orientation and device motion
+ * events specification.
+ * This file depends on w3c_event.js.
+ * The whole file has been partially type annotated.
+ * Created from http://dev.w3.org/geo/api/spec-source-orientation.
+ *
+ * @externs
+ */
+
+/**
+ * @constructor
+ * @extends {Event}
+ */
+function DeviceOrientationEvent() {}
+
+/** @type {?number} */
+DeviceOrientationEvent.prototype.alpha;
+
+/** @type {?number} */
+DeviceOrientationEvent.prototype.beta;
+
+/** @type {?number} */
+DeviceOrientationEvent.prototype.gamma;
+
+/** @type {boolean} */
+DeviceOrientationEvent.prototype.absolute;
+
+/**
+ * @type {?number}
+ * @see https://developer.apple.com/library/safari/documentation/SafariDOMAdditions/Reference/DeviceOrientationEventClassRef/DeviceOrientationEvent/DeviceOrientationEvent.html#//apple_ref/javascript/instp/DeviceOrientationEvent/webkitCompassAccuracy
+ */
+DeviceOrientationEvent.prototype.webkitCompassAccuracy;
+
+/**
+ * @type {?number}
+ * @see https://developer.apple.com/library/safari/documentation/SafariDOMAdditions/Reference/DeviceOrientationEventClassRef/DeviceOrientationEvent/DeviceOrientationEvent.html#//apple_ref/javascript/instp/DeviceOrientationEvent/webkitCompassHeading
+ */
+DeviceOrientationEvent.prototype.webkitCompassHeading;
+
+/**
+ * @constructor
+ */
+function DeviceAcceleration() {}
+
+/** @type {?number} */
+DeviceAcceleration.prototype.x;
+
+/** @type {?number} */
+DeviceAcceleration.prototype.y;
+
+/** @type {?number} */
+DeviceAcceleration.prototype.z;
+
+/**
+ * @constructor
+ */
+function DeviceRotationRate() {}
+
+/** @type {?number} */
+DeviceRotationRate.prototype.alpha;
+
+/** @type {?number} */
+DeviceRotationRate.prototype.beta;
+
+/** @type {?number} */
+DeviceRotationRate.prototype.gamma;
+
+/**
+ * @constructor
+ * @extends {Event}
+ */
+function DeviceMotionEvent() {}
+
+/** @type {?DeviceAcceleration} */
+DeviceMotionEvent.prototype.acceleration;
+
+/** @type {?DeviceAcceleration} */
+DeviceMotionEvent.prototype.accelerationIncludingGravity;
+
+/** @type {?DeviceRotationRate} */
+DeviceMotionEvent.prototype.rotationRate;
+
+/** @type {?number} */
+DeviceMotionEvent.prototype.interval;
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_dom1.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_dom1.js
new file mode 100644
index 0000000000..d00f73fd4b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_dom1.js
@@ -0,0 +1,874 @@
+/*
+ * Copyright 2008 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for W3C's DOM Level 1 specification.
+ * The whole file has been fully type annotated. Created from
+ * http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html
+ *
+ * @externs
+ * @author stevey@google.com (Steve Yegge)
+ */
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-17189187
+ */
+function DOMException() {}
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF
+ */
+DOMException.INDEX_SIZE_ERR = 1;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF
+ */
+DOMException.DOMSTRING_SIZE_ERR = 2;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF
+ */
+DOMException.HIERARCHY_REQUEST_ERR = 3;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF
+ */
+DOMException.WRONG_DOCUMENT_ERR = 4;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF
+ */
+DOMException.INVALID_CHARACTER_ERR = 5;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF
+ */
+DOMException.NO_DATA_ALLOWED_ERR = 6;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF
+ */
+DOMException.NO_MODIFICATION_ALLOWED_ERR = 7;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF
+ */
+DOMException.NOT_FOUND_ERR = 8;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF
+ */
+DOMException.NOT_SUPPORTED_ERR = 9;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF
+ */
+DOMException.INUSE_ATTRIBUTE_ERR = 10;
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF
+ */
+function ExceptionCode() {}
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-102161490
+ */
+function DOMImplementation() {}
+
+/**
+ * @param {string} feature
+ * @param {string} version
+ * @return {boolean}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-5CED94D7
+ * @nosideeffects
+ */
+DOMImplementation.prototype.hasFeature = function(feature, version) {};
+
+/**
+ * @constructor
+ * @implements {EventTarget}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247
+ */
+function Node() {}
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+Node.prototype.addEventListener = function(type, listener, opt_useCapture) {};
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+Node.prototype.removeEventListener = function(type, listener, opt_useCapture) {};
+
+/** @override */
+Node.prototype.dispatchEvent = function(evt) {};
+
+/**
+ * @type {NamedNodeMap}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-attributes
+ */
+Node.prototype.attributes;
+
+/**
+ * @type {!NodeList}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-childNodes
+ */
+Node.prototype.childNodes;
+
+/**
+ * @type {Node}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-firstChild
+ */
+Node.prototype.firstChild;
+
+/**
+ * @type {Node}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-lastChild
+ */
+Node.prototype.lastChild;
+
+/**
+ * @type {Node}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-nextSibling
+ */
+Node.prototype.nextSibling;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-nodeName
+ */
+Node.prototype.nodeName;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-nodeValue
+ */
+Node.prototype.nodeValue;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-nodeType
+ */
+Node.prototype.nodeType;
+
+/**
+ * @type {Document}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-ownerDocument
+ */
+Node.prototype.ownerDocument;
+
+/**
+ * @type {Node}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-parentNode
+ */
+Node.prototype.parentNode;
+
+/**
+ * @type {Node}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-previousSibling
+ */
+Node.prototype.previousSibling;
+
+/**
+ * @param {Node} newChild
+ * @return {Node}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-appendChild
+ */
+Node.prototype.appendChild = function(newChild) {};
+
+/**
+ * @param {boolean} deep
+ * @return {!Node}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-cloneNode
+ * @nosideeffects
+ */
+Node.prototype.cloneNode = function(deep) {};
+
+/**
+ * @return {boolean}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-hasChildNodes
+ * @nosideeffects
+ */
+Node.prototype.hasChildNodes = function() {};
+
+/**
+ * @param {Node} newChild
+ * @param {Node} refChild
+ * @return {!Node}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-insertBefore
+ */
+Node.prototype.insertBefore = function(newChild, refChild) {};
+
+/**
+ * @param {Node} oldChild
+ * @return {!Node}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-removeChild
+ */
+Node.prototype.removeChild = function(oldChild) {};
+
+/**
+ * @param {Node} newChild
+ * @param {Node} oldChild
+ * @return {!Node}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-replaceChild
+ */
+Node.prototype.replaceChild = function(newChild, oldChild) {};
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247
+ */
+Node.ATTRIBUTE_NODE;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247
+ */
+Node.CDATA_SECTION_NODE;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247
+ */
+Node.COMMENT_NODE;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247
+ */
+Node.DOCUMENT_FRAGMENT_NODE;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247
+ */
+Node.DOCUMENT_NODE;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247
+ */
+Node.DOCUMENT_TYPE_NODE;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247
+ */
+Node.ELEMENT_NODE;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247
+ */
+Node.ENTITY_NODE;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247
+ */
+Node.ENTITY_REFERENCE_NODE;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247
+ */
+Node.PROCESSING_INSTRUCTION_NODE;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247
+ */
+Node.TEXT_NODE;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247
+ */
+Node.XPATH_NAMESPACE_NODE;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247
+ */
+Node.NOTATION_NODE;
+
+/**
+ * @constructor
+ * @extends {Node}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-B63ED1A3
+ */
+function DocumentFragment() {}
+
+/**
+ * @constructor
+ * @extends {Node}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#i-Document
+ */
+function Document() {}
+
+/**
+ * @type {DocumentType}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-doctype
+ */
+Document.prototype.doctype;
+
+/**
+ * @type {!Element}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-documentElement
+ */
+Document.prototype.documentElement;
+
+/**
+ * @type {DOMImplementation}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-implementation
+ */
+Document.prototype.implementation;
+
+/**
+ * @param {string} name
+ * @return {!Attr}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-createAttribute
+ * @nosideeffects
+ */
+Document.prototype.createAttribute = function(name) {};
+
+/**
+ * @param {string} data
+ * @return {!Comment}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-createComment
+ * @nosideeffects
+ */
+Document.prototype.createComment = function(data) {};
+
+/**
+ * @param {string} data
+ * @return {!CDATASection}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-createCDATASection
+ * @nosideeffects
+ */
+Document.prototype.createCDATASection = function(data) {};
+
+/**
+ * @return {!DocumentFragment}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-createDocumentFragment
+ * @nosideeffects
+ */
+Document.prototype.createDocumentFragment = function() {};
+
+/**
+ * Create a DOM element.
+ *
+ * Web components introduced the second parameter as a way of extending existing
+ * tags (e.g. document.createElement('button', 'fancy-button')).
+ *
+ * @param {string} tagName
+ * @param {string=} opt_typeExtension
+ * @return {!Element}
+ * @nosideeffects
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-createElement
+ * @see http://w3c.github.io/webcomponents/spec/custom/#extensions-to-document-interface-to-instantiate
+ */
+Document.prototype.createElement = function(tagName, opt_typeExtension) {};
+
+/**
+ * @param {string} name
+ * @return {!EntityReference}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-createEntityReference
+ * @nosideeffects
+ */
+Document.prototype.createEntityReference = function(name) {};
+
+/**
+ * @param {string} target
+ * @param {string} data
+ * @return {!ProcessingInstruction}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-createProcessingInstruction
+ * @nosideeffects
+ */
+Document.prototype.createProcessingInstruction = function(target, data) {};
+
+/**
+ * @param {number|string} data
+ * @return {!Text}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-createTextNode
+ * @nosideeffects
+ */
+Document.prototype.createTextNode = function(data) {};
+
+/**
+ * @param {string} tagname
+ * @return {!NodeList}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-A6C9094
+ * @nosideeffects
+ */
+Document.prototype.getElementsByTagName = function(tagname) {};
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-536297177
+ */
+function NodeList() {}
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-203510337
+ */
+NodeList.prototype.length;
+
+/**
+ * @param {number} index
+ * @return {Node}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-844377136
+ */
+NodeList.prototype.item = function(index) {};
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1780488922
+ */
+function NamedNodeMap() {}
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-6D0FB19E
+ */
+NamedNodeMap.prototype.length;
+
+/**
+ * @param {string} name
+ * @return {Node}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1074577549
+ * @nosideeffects
+ */
+NamedNodeMap.prototype.getNamedItem = function(name) {};
+
+/**
+ * @param {number} index
+ * @return {Node}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-349467F9
+ * @nosideeffects
+ */
+NamedNodeMap.prototype.item = function(index) {};
+
+/**
+ * @param {string} name
+ * @return {Node}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-D58B193
+ */
+NamedNodeMap.prototype.removeNamedItem = function(name) {};
+
+/**
+ * @param {Node} arg
+ * @return {Node}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1025163788
+ */
+NamedNodeMap.prototype.setNamedItem = function(arg) {};
+
+/**
+ * @constructor
+ * @extends {Node}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-FF21A306
+ */
+function CharacterData() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-72AB8359
+ */
+CharacterData.prototype.data;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-7D61178C
+ */
+CharacterData.prototype.length;
+
+/**
+ * @param {string} arg
+ * @return {undefined}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-32791A2F
+ */
+CharacterData.prototype.appendData = function(arg) {};
+
+/**
+ * @param {number} offset
+ * @param {number} count
+ * @return {undefined}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-7C603781
+ */
+CharacterData.prototype.deleteData = function(offset, count) {};
+
+/**
+ * @param {number} offset
+ * @param {string} arg
+ * @return {undefined}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-3EDB695F
+ */
+CharacterData.prototype.insertData = function(offset, arg) {};
+
+/**
+ * @param {number} offset
+ * @param {number} count
+ * @param {string} arg
+ * @return {undefined}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-E5CBA7FB
+ */
+CharacterData.prototype.replaceData = function(offset, count, arg) {};
+
+/**
+ * @param {number} offset
+ * @param {number} count
+ * @return {string}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-6531BCCF
+ * @nosideeffects
+ */
+CharacterData.prototype.substringData = function(offset, count) {};
+
+/**
+ * @constructor
+ * @extends {Node}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-637646024
+ */
+function Attr() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1112119403
+ */
+Attr.prototype.name;
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-862529273
+ */
+Attr.prototype.specified;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-221662474
+ */
+Attr.prototype.value;
+
+/**
+ * @constructor
+ * @extends {Node}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-745549614
+ */
+function Element() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-tagName
+ */
+Element.prototype.tagName;
+
+/**
+ * @param {string} name
+ * @param {number?=} opt_flags
+ * @return {string}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-getAttribute
+ * @see http://msdn.microsoft.com/en-us/library/ms536429(VS.85).aspx
+ * @nosideeffects
+ */
+Element.prototype.getAttribute = function(name, opt_flags) {};
+
+/**
+ * @param {string} name
+ * @return {Attr}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-getAttributeNode
+ * @nosideeffects
+ */
+Element.prototype.getAttributeNode = function(name) {};
+
+/**
+ * @param {string} tagname
+ * @return {!NodeList}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1938918D
+ * @nosideeffects
+ */
+Element.prototype.getElementsByTagName = function(tagname) {};
+
+/**
+ * @param {string} name
+ * @return {undefined}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-removeAttribute
+ */
+Element.prototype.removeAttribute = function(name) {};
+
+/**
+ * @param {Attr} oldAttr
+ * @return {?Attr}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-removeAttributeNode
+ */
+Element.prototype.removeAttributeNode = function(oldAttr) {};
+
+/**
+ * @param {string} name
+ * @param {string|number|boolean} value Values are converted to strings with
+ * ToString, so we accept number and boolean since both convert easily to
+ * strings.
+ * @return {undefined}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-setAttribute
+ */
+Element.prototype.setAttribute = function(name, value) {};
+
+/**
+ * @param {Attr} newAttr
+ * @return {?Attr}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-setAttributeNode
+ */
+Element.prototype.setAttributeNode = function(newAttr) {};
+
+// Event handlers
+// The DOM level 3 spec has a good index of these
+// http://www.w3.org/TR/DOM-Level-3-Events/#event-types
+
+/** @type {?function (Event)} */ Element.prototype.onabort;
+/** @type {?function (Event)} */ Element.prototype.onbeforeinput;
+/** @type {?function (Event)} */ Element.prototype.onbeforeunload;
+/** @type {?function (Event)} */ Element.prototype.onblur;
+/** @type {?function (Event)} */ Element.prototype.onchange;
+/** @type {?function (Event)} */ Element.prototype.onclick;
+/** @type {?function (Event)} */ Element.prototype.oncompositionstart;
+/** @type {?function (Event)} */ Element.prototype.oncompositionupdate;
+/** @type {?function (Event)} */ Element.prototype.oncompositionend;
+/** @type {?function (Event)} */ Element.prototype.oncontextmenu;
+/** @type {?function (Event)} */ Element.prototype.oncopy;
+/** @type {?function (Event)} */ Element.prototype.oncut;
+/** @type {?function (Event)} */ Element.prototype.ondblclick;
+/** @type {?function (Event)} */ Element.prototype.onerror;
+/** @type {?function (Event)} */ Element.prototype.onfocus;
+/** @type {?function (Event)} */ Element.prototype.onfocusin;
+/** @type {?function (Event)} */ Element.prototype.onfocusout;
+/** @type {?function (Event)} */ Element.prototype.oninput;
+/** @type {?function (Event)} */ Element.prototype.onkeydown;
+/** @type {?function (Event)} */ Element.prototype.onkeypress;
+/** @type {?function (Event)} */ Element.prototype.onkeyup;
+/** @type {?function (Event)} */ Element.prototype.onload;
+/** @type {?function (Event)} */ Element.prototype.onunload;
+/** @type {?function (Event)} */ Element.prototype.onmousedown;
+/** @type {?function (Event)} */ Element.prototype.onmousemove;
+/** @type {?function (Event)} */ Element.prototype.onmouseout;
+/** @type {?function (Event)} */ Element.prototype.onmouseover;
+/** @type {?function (Event)} */ Element.prototype.onmouseup;
+/** @type {?function (Event)} */ Element.prototype.onmousewheel;
+/** @type {?function (Event)} */ Element.prototype.onpaste;
+/** @type {?function (Event)} */ Element.prototype.onreset;
+/** @type {?function (Event)} */ Element.prototype.onresize;
+/** @type {?function (Event)} */ Element.prototype.onscroll;
+/** @type {?function (Event)} */ Element.prototype.onselect;
+/** @type {?function (Event=)} */ Element.prototype.onsubmit;
+/** @type {?function (Event)} */ Element.prototype.ontextinput;
+/** @type {?function (Event)} */ Element.prototype.onwheel;
+
+/**
+ * @constructor
+ * @extends {CharacterData}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1312295772
+ */
+function Text() {}
+
+/**
+ * @param {number} offset
+ * @return {Text}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-38853C1D
+ */
+Text.prototype.splitText = function(offset) {};
+
+/**
+ * @constructor
+ * @extends {CharacterData}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1728279322
+ */
+function Comment() {}
+
+/**
+ * @constructor
+ * @extends {Text}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-667469212
+ */
+function CDATASection() {}
+
+/**
+ * @constructor
+ * @extends {Node}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-412266927
+ */
+function DocumentType() {}
+
+/**
+ * @type {NamedNodeMap}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1788794630
+ */
+DocumentType.prototype.entities;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1844763134
+ */
+DocumentType.prototype.name;
+
+/**
+ * @type {NamedNodeMap}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-D46829EF
+ */
+DocumentType.prototype.notations;
+
+/**
+ * @constructor
+ * @extends {Node}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-5431D1B9
+ */
+function Notation() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-54F2B4D0
+ */
+Notation.prototype.publicId;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-E8AAB1D0
+ */
+Notation.prototype.systemId;
+
+/**
+ * @constructor
+ * @extends {Node}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-527DCFF2
+ */
+function Entity() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-D7303025
+ */
+Entity.prototype.publicId;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-D7C29F3E
+ */
+Entity.prototype.systemId;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-6ABAEB38
+ */
+Entity.prototype.notationName;
+
+/**
+ * @constructor
+ * @extends {Node}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-11C98490
+ */
+function EntityReference() {}
+
+/**
+ * @constructor
+ * @extends {Node}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1004215813
+ */
+function ProcessingInstruction() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-837822393
+ */
+ProcessingInstruction.prototype.data;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1478689192
+ */
+ProcessingInstruction.prototype.target;
+
+
+/**
+ * @constructor
+ * @implements {EventTarget}
+ */
+function Window() {}
+Window.prototype.Window;
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+Window.prototype.addEventListener = function(type, listener, opt_useCapture) {};
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+Window.prototype.removeEventListener = function(type, listener, opt_useCapture)
+ {};
+
+/** @override */
+Window.prototype.dispatchEvent = function(evt) {};
+
+/** @type {?function (Event)} */ Window.prototype.onabort;
+/** @type {?function (Event)} */ Window.prototype.onbeforeunload;
+/** @type {?function (Event)} */ Window.prototype.onblur;
+/** @type {?function (Event)} */ Window.prototype.onchange;
+/** @type {?function (Event)} */ Window.prototype.onclick;
+/** @type {?function (Event)} */ Window.prototype.onclose;
+/** @type {?function (Event)} */ Window.prototype.oncontextmenu;
+/** @type {?function (Event)} */ Window.prototype.ondblclick;
+/** @type {?function (Event)} */ Window.prototype.ondragdrop;
+// onerror has a special signature.
+// See https://developer.mozilla.org/en/DOM/window.onerror
+// and http://msdn.microsoft.com/en-us/library/cc197053(VS.85).aspx
+/** @type {?function (string, string, number)} */
+Window.prototype.onerror;
+/** @type {?function (Event)} */ Window.prototype.onfocus;
+/** @type {?function (Event)} */ Window.prototype.onhashchange;
+/** @type {?function (Event)} */ Window.prototype.onkeydown;
+/** @type {?function (Event)} */ Window.prototype.onkeypress;
+/** @type {?function (Event)} */ Window.prototype.onkeyup;
+/** @type {?function (Event)} */ Window.prototype.onload;
+/** @type {?function (Event)} */ Window.prototype.onmousedown;
+/** @type {?function (Event)} */ Window.prototype.onmousemove;
+/** @type {?function (Event)} */ Window.prototype.onmouseout;
+/** @type {?function (Event)} */ Window.prototype.onmouseover;
+/** @type {?function (Event)} */ Window.prototype.onmouseup;
+/** @type {?function (Event)} */ Window.prototype.onmousewheel;
+/** @type {?function (Event)} */ Window.prototype.onpaint;
+/** @type {?function (Event)} */ Window.prototype.onpopstate;
+/** @type {?function (Event)} */ Window.prototype.onreset;
+/** @type {?function (Event)} */ Window.prototype.onresize;
+/** @type {?function (Event)} */ Window.prototype.onscroll;
+/** @type {?function (Event)} */ Window.prototype.onselect;
+/** @type {?function (Event=)} */ Window.prototype.onsubmit;
+/** @type {?function (Event)} */ Window.prototype.onunload;
+/** @type {?function (Event)} */ Window.prototype.onwheel;
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_dom2.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_dom2.js
new file mode 100644
index 0000000000..d6642074cd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_dom2.js
@@ -0,0 +1,2619 @@
+/*
+ * Copyright 2008 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for W3C's DOM Level 2 specification.
+ * This file depends on w3c_dom1.js.
+ * The whole file has been fully type annotated.
+ * Created from
+ * http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html
+ *
+ * @externs
+ * @author stevey@google.com (Steve Yegge)
+ */
+// All the provided definitions have been type annotated.
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-75708506
+ */
+function HTMLCollection() {}
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-40057551
+ */
+HTMLCollection.prototype.length;
+
+/**
+ * @param {number} index
+ * @return {Node}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-33262535
+ * @nosideeffects
+ */
+HTMLCollection.prototype.item = function(index) {};
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-2-HTML/html.html#HTMLOptionsCollection
+ */
+function HTMLOptionsCollection() {}
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-HTML/html.html#HTMLOptionsCollection-length
+ */
+HTMLOptionsCollection.prototype.length;
+
+/**
+ * @param {number} index
+ * @return {Node}
+ * @see http://www.w3.org/TR/DOM-Level-2-HTML/html.html#HTMLOptionsCollection-item
+ * @nosideeffects
+ */
+HTMLOptionsCollection.prototype.item = function(index) {};
+
+/**
+ * @constructor
+ * @extends {Document}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-26809268
+ */
+function HTMLDocument() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-18446827
+ */
+HTMLDocument.prototype.title;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-95229140
+ */
+HTMLDocument.prototype.referrer;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-2250147
+ */
+HTMLDocument.prototype.domain;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-46183437
+ */
+HTMLDocument.prototype.URL;
+
+/**
+ * @type {HTMLBodyElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-56360201
+ */
+HTMLDocument.prototype.body;
+
+/**
+ * @type {HTMLCollection}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-90379117
+ */
+HTMLDocument.prototype.images;
+
+/**
+ * @type {HTMLCollection}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-85113862
+ */
+HTMLDocument.prototype.applets;
+
+/**
+ * @type {HTMLCollection}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-7068919
+ */
+HTMLDocument.prototype.links;
+
+/**
+ * @type {HTMLCollection}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-1689064
+ */
+HTMLDocument.prototype.forms;
+
+/**
+ * @type {HTMLCollection}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-7577272
+ */
+HTMLDocument.prototype.anchors;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-8747038
+ */
+HTMLDocument.prototype.cookie;
+
+/**
+ * @return {undefined}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-72161170
+ * @override
+ */
+HTMLDocument.prototype.open = function() {};
+
+/**
+ * @return {undefined}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-98948567
+ * @override
+ */
+HTMLDocument.prototype.close = function() {};
+
+/**
+ * @param {string} text
+ * @return {undefined}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-75233634
+ * @override
+ */
+HTMLDocument.prototype.write = function(text) {};
+
+/**
+ * @param {string} text
+ * @return {undefined}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-35318390
+ * @override
+ */
+HTMLDocument.prototype.writeln = function(text) {};
+
+/**
+ * @param {string} elementName
+ * @return {!NodeList}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-71555259
+ * @override
+ * @nosideeffects
+ */
+HTMLDocument.prototype.getElementsByName = function(elementName) {};
+
+/**
+ * @param {Node} root
+ * @param {number=} whatToShow
+ * @param {NodeFilter=} filter
+ * @param {boolean=} entityReferenceExpansion
+ * @return {!NodeIterator}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-Document
+ * @nosideeffects
+ */
+HTMLDocument.prototype.createNodeIterator = function(
+ root, whatToShow, filter, entityReferenceExpansion) {};
+
+/**
+ * @param {Node} root
+ * @param {number=} whatToShow
+ * @param {NodeFilter=} filter
+ * @param {boolean=} entityReferenceExpansion
+ * @return {!TreeWalker}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-Document
+ * @nosideeffects
+ */
+HTMLDocument.prototype.createTreeWalker = function(
+ root, whatToShow, filter, entityReferenceExpansion) {};
+
+
+/** @typedef {{
+ createNodeIterator: function(Node, number=, NodeFilter=, boolean=) : NodeIterator,
+ createTreeWalker: function(Node, number=, NodeFilter=, boolean=) : TreeWalker
+}} */
+var TraversalDocument;
+
+/**
+ * @interface
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-NodeFilter
+*/
+function NodeFilter() {}
+
+/* Constants for whatToShow */
+/** @const {number} */ NodeFilter.SHOW_ALL;
+/** @const {number} */ NodeFilter.SHOW_ATTRIBUTE;
+/** @const {number} */ NodeFilter.SHOW_CDATA_SECTION;
+/** @const {number} */ NodeFilter.SHOW_COMMENT;
+/** @const {number} */ NodeFilter.SHOW_DOCUMENT;
+/** @const {number} */ NodeFilter.SHOW_DOCUMENT_FRAGMENT;
+/** @const {number} */ NodeFilter.SHOW_DOCUMENT_TYPE;
+/** @const {number} */ NodeFilter.SHOW_ELEMENT;
+/** @const {number} */ NodeFilter.SHOW_ENTITY;
+/** @const {number} */ NodeFilter.SHOW_ENTITY_REFERENCE;
+/** @const {number} */ NodeFilter.SHOW_NOTATION;
+/** @const {number} */ NodeFilter.SHOW_PROCESSING_INSTRUCTION;
+/** @const {number} */ NodeFilter.SHOW_TEXT;
+
+/* Consants for acceptNode */
+/** @const {number} */ NodeFilter.FILTER_ACCEPT;
+/** @const {number} */ NodeFilter.FILTER_REJECT;
+/** @const {number} */ NodeFilter.FILTER_SKIP;
+
+/**
+ * @param {Node} n
+ * @return {number} Any of NodeFilter.FILTER_* constants.
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-NodeFilter-acceptNode
+*/
+NodeFilter.prototype.acceptNode = function(n) {};
+
+/**
+ * @interface
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-NodeIterator
+*/
+function NodeIterator() {}
+
+/**
+ * Detach and invalidate the NodeIterator.
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-NodeIterator-detach
+ */
+NodeIterator.prototype.detach = function() {};
+
+/**
+ * @return {Node} Next node in the set.
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-NodeIterator-nextNode
+ */
+NodeIterator.prototype.nextNode = function() {};
+
+/**
+ * @return {Node} Previous node in the set.
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-NodeIterator-previousNode
+ */
+NodeIterator.prototype.previousNode = function() {};
+
+/**
+ * @interface
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-TreeWalker
+*/
+function TreeWalker() {}
+
+/**
+ * @return {?Node} The new Node or null.
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-TreeWalker-firstChild
+ */
+TreeWalker.prototype.firstChild = function() {};
+
+/**
+ * @return {?Node} The new Node or null..
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-TreeWalker-lastChild
+ */
+TreeWalker.prototype.lastChild = function() {};
+
+/**
+ * @return {?Node} The new Node or null.
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-TreeWalker-nextNode
+ */
+TreeWalker.prototype.nextNode = function() {};
+
+/**
+ * @return {?Node} The new Node or null.
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-TreeWalker-nextSibling
+ */
+TreeWalker.prototype.nextSibling = function() {};
+
+/**
+ * @return {?Node} The new Node or null.
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-TreeWalker-parentNode
+ */
+TreeWalker.prototype.parentNode = function() {};
+
+/**
+ * @return {?Node} The new Node or null.
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-TreeWalker-previousNode
+ */
+TreeWalker.prototype.previousNode = function() {};
+
+/**
+ * @return {?Node} The new Node or null.
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-TreeWalker-previousSibling
+ */
+TreeWalker.prototype.previousSibling = function() {};
+
+/**
+ * @type {Node}
+ */
+TreeWalker.prototype.root;
+
+/**
+ * @type {number}
+ */
+TreeWalker.prototype.whatToShow;
+
+/**
+ * @type {NodeFilter}
+ */
+TreeWalker.prototype.filter;
+
+/**
+ * @type {boolean}
+ */
+TreeWalker.prototype.expandEntityReference;
+
+/**
+ * @type {Node}
+ */
+TreeWalker.prototype.currentNode;
+
+/**
+ * @constructor
+ * @extends {Element}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-58190037
+ */
+function HTMLElement() {}
+
+/**
+ * @implicitCast
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-63534901
+ */
+HTMLElement.prototype.id;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-78276800
+ */
+HTMLElement.prototype.title;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-59132807
+ */
+HTMLElement.prototype.lang;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-52460740
+ */
+HTMLElement.prototype.dir;
+
+/**
+ * @implicitCast
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-95362176
+ */
+HTMLElement.prototype.className;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-33759296
+ */
+function HTMLHtmlElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-9383775
+ */
+HTMLHtmlElement.prototype.version;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-77253168
+ */
+function HTMLHeadElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-96921909
+ */
+HTMLHeadElement.prototype.profile;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @implements {LinkStyle}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-35143001
+ */
+function HTMLLinkElement() {}
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-87355129
+ */
+HTMLLinkElement.prototype.disabled;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-63954491
+ */
+HTMLLinkElement.prototype.charset;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-33532588
+ */
+HTMLLinkElement.prototype.href;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-85145682
+ */
+HTMLLinkElement.prototype.hreflang;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-75813125
+ */
+HTMLLinkElement.prototype.media;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-41369587
+ */
+HTMLLinkElement.prototype.rel;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-40715461
+ */
+HTMLLinkElement.prototype.rev;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-84183095
+ */
+HTMLLinkElement.prototype.target;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-32498296
+ */
+HTMLLinkElement.prototype.type;
+
+/** @type {StyleSheet} */
+HTMLLinkElement.prototype.sheet;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-79243169
+ */
+function HTMLTitleElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-77500413
+ */
+HTMLTitleElement.prototype.text;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-37041454
+ */
+function HTMLMetaElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-87670826
+ */
+HTMLMetaElement.prototype.content;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-77289449
+ */
+HTMLMetaElement.prototype.httpEquiv;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-31037081
+ */
+HTMLMetaElement.prototype.name;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-35993789
+ */
+HTMLMetaElement.prototype.scheme;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-73629039
+ */
+function HTMLBaseElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-65382887
+ */
+HTMLBaseElement.prototype.href;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-73844298
+ */
+HTMLBaseElement.prototype.target;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-85283003
+ */
+function HTMLIsIndexElement() {}
+
+/**
+ * @type {HTMLFormElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-87069980
+ */
+HTMLIsIndexElement.prototype.form;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-33589862
+ */
+HTMLIsIndexElement.prototype.prompt;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @implements {LinkStyle}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-16428977
+ */
+function HTMLStyleElement() {}
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-51162010
+ */
+HTMLStyleElement.prototype.disabled;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-76412738
+ */
+HTMLStyleElement.prototype.media;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-22472002
+ */
+HTMLStyleElement.prototype.type;
+
+/** @type {StyleSheet} */
+HTMLStyleElement.prototype.sheet;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-62018039
+ */
+function HTMLBodyElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-59424581
+ */
+HTMLBodyElement.prototype.aLink;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-37574810
+ */
+HTMLBodyElement.prototype.background;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-24940084
+ */
+HTMLBodyElement.prototype.bgColor;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-7662206
+ */
+HTMLBodyElement.prototype.link;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-73714763
+ */
+HTMLBodyElement.prototype.text;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-83224305
+ */
+HTMLBodyElement.prototype.vLink;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-40002357
+ */
+function HTMLFormElement() {}
+
+/**
+ * @type {HTMLCollection}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-76728479
+ */
+HTMLFormElement.prototype.elements;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#HTML-HTMLFormElement-length
+ */
+HTMLFormElement.prototype.length;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-22051454
+ */
+HTMLFormElement.prototype.name;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-19661795
+ */
+HTMLFormElement.prototype.acceptCharset;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-74049184
+ */
+HTMLFormElement.prototype.action;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-84227810
+ */
+HTMLFormElement.prototype.enctype;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-82545539
+ */
+HTMLFormElement.prototype.method;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-6512890
+ */
+HTMLFormElement.prototype.target;
+
+/**
+ * @return {undefined}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-76767676
+ */
+HTMLFormElement.prototype.submit = function() {};
+
+/**
+ * @return {undefined}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-76767677
+ */
+HTMLFormElement.prototype.reset = function() {};
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-94282980
+ */
+function HTMLSelectElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-58783172
+ */
+HTMLSelectElement.prototype.type;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-85676760
+ */
+HTMLSelectElement.prototype.selectedIndex;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-59351919
+ */
+HTMLSelectElement.prototype.value;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-5933486
+ */
+HTMLSelectElement.prototype.length;
+
+/**
+ * @type {HTMLFormElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-20489458
+ */
+HTMLSelectElement.prototype.form;
+
+/**
+ * @type {!HTMLOptionsCollection}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-30606413
+ */
+HTMLSelectElement.prototype.options;
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-79102918
+ */
+HTMLSelectElement.prototype.disabled;
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-13246613
+ */
+HTMLSelectElement.prototype.multiple;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-41636323
+ */
+HTMLSelectElement.prototype.name;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-18293826
+ */
+HTMLSelectElement.prototype.size;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-40676705
+ */
+HTMLSelectElement.prototype.tabIndex;
+
+/**
+ * @param {HTMLElement} element
+ * @param {HTMLElement} before
+ * @return {undefined}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-14493106
+ */
+HTMLSelectElement.prototype.add = function(element, before) {};
+
+/**
+ * @return {undefined}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-28216144
+ * @override
+ */
+HTMLSelectElement.prototype.blur = function() {};
+
+/**
+ * @return {undefined}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-32130014
+ * @override
+ */
+HTMLSelectElement.prototype.focus = function() {};
+
+/**
+ * @param {number} index
+ * @return {undefined}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-33404570
+ */
+HTMLSelectElement.prototype.remove = function(index) {};
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-38450247
+ */
+function HTMLOptGroupElement() {}
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-15518803
+ */
+HTMLOptGroupElement.prototype.disabled;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-95806054
+ */
+HTMLOptGroupElement.prototype.label;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-70901257
+ */
+function HTMLOptionElement() {}
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-37770574
+ */
+HTMLOptionElement.prototype.defaultSelected;
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-23482473
+ */
+HTMLOptionElement.prototype.disabled;
+
+/**
+ * @type {HTMLFormElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-17116503
+ */
+HTMLOptionElement.prototype.form;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-14038413
+ */
+HTMLOptionElement.prototype.index;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-40736115
+ */
+HTMLOptionElement.prototype.label;
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-70874476
+ */
+HTMLOptionElement.prototype.selected;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-48154426
+ */
+HTMLOptionElement.prototype.text;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-6185554
+ */
+HTMLOptionElement.prototype.value;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-6043025
+ */
+function HTMLInputElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-15328520
+ */
+HTMLInputElement.prototype.accept;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-59914154
+ */
+HTMLInputElement.prototype.accessKey;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-96991182
+ */
+HTMLInputElement.prototype.align;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-92701314
+ */
+HTMLInputElement.prototype.alt;
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-30233917
+ */
+HTMLInputElement.prototype.checked;
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-20509171
+ */
+HTMLInputElement.prototype.defaultChecked;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-26091157
+ */
+HTMLInputElement.prototype.defaultValue;
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-50886781
+ */
+HTMLInputElement.prototype.disabled;
+
+/**
+ * @type {HTMLFormElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-63239895
+ */
+HTMLInputElement.prototype.form;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-54719353
+ */
+HTMLInputElement.prototype.maxLength;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-89658498
+ */
+HTMLInputElement.prototype.name;
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-88461592
+ */
+HTMLInputElement.prototype.readOnly;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-79659438
+ */
+HTMLInputElement.prototype.size;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-97320704
+ */
+HTMLInputElement.prototype.src;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-62176355
+ */
+HTMLInputElement.prototype.tabIndex;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-62883744
+ */
+HTMLInputElement.prototype.type;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-32463706
+ */
+HTMLInputElement.prototype.useMap;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-49531485
+ */
+HTMLInputElement.prototype.value;
+
+/**
+ * @return {undefined}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-26838235
+ * @override
+ */
+HTMLInputElement.prototype.blur = function() {};
+
+/**
+ * @return {undefined}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-2651361
+ * @override
+ */
+HTMLInputElement.prototype.click = function() {};
+
+/**
+ * @return {undefined}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-65996295
+ * @override
+ */
+HTMLInputElement.prototype.focus = function() {};
+
+/**
+ * @return {undefined}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-34677168
+ */
+HTMLInputElement.prototype.select = function() {};
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-24874179
+ */
+function HTMLTextAreaElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-93102991
+ */
+HTMLTextAreaElement.prototype.accessKey;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-51387225
+ */
+HTMLTextAreaElement.prototype.cols;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-36152213
+ */
+HTMLTextAreaElement.prototype.defaultValue;
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-98725443
+ */
+HTMLTextAreaElement.prototype.disabled;
+
+/**
+ * @type {HTMLFormElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-18911464
+ */
+HTMLTextAreaElement.prototype.form;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-70715578
+ */
+HTMLTextAreaElement.prototype.name;
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-39131423
+ */
+HTMLTextAreaElement.prototype.readOnly;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-46975887
+ */
+HTMLTextAreaElement.prototype.rows;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-60363303
+ */
+HTMLTextAreaElement.prototype.tabIndex;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#HTML-HTMLTextAreaElement-type
+ */
+HTMLTextAreaElement.prototype.type;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-70715579
+ */
+HTMLTextAreaElement.prototype.value;
+
+/**
+ * @return {undefined}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-6750689
+ * @override
+ */
+HTMLTextAreaElement.prototype.blur = function() {};
+
+/**
+ * @return {undefined}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-39055426
+ * @override
+ */
+HTMLTextAreaElement.prototype.focus = function() {};
+
+/**
+ * @return {undefined}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-48880622
+ */
+HTMLTextAreaElement.prototype.select = function() {};
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-34812697
+ */
+function HTMLButtonElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-73169431
+ */
+HTMLButtonElement.prototype.accessKey;
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-92757155
+ */
+HTMLButtonElement.prototype.disabled;
+
+/**
+ * @type {HTMLFormElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-71254493
+ */
+HTMLButtonElement.prototype.form;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-11029910
+ */
+HTMLButtonElement.prototype.name;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-39190908
+ */
+HTMLButtonElement.prototype.tabIndex;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-27430092
+ */
+HTMLButtonElement.prototype.type;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-72856782
+ */
+HTMLButtonElement.prototype.value;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-13691394
+ */
+function HTMLLabelElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-43589892
+ */
+HTMLLabelElement.prototype.accessKey;
+
+/**
+ * @type {HTMLFormElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-32480901
+ */
+HTMLLabelElement.prototype.form;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-96509813
+ */
+HTMLLabelElement.prototype.htmlFor;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-7365882
+ */
+function HTMLFieldSetElement() {}
+
+/**
+ * @type {HTMLFormElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-75392630
+ */
+HTMLFieldSetElement.prototype.form;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-21482039
+ */
+function HTMLLegendElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-11297832
+ */
+HTMLLegendElement.prototype.accessKey;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-79538067
+ */
+HTMLLegendElement.prototype.align;
+
+/**
+ * @type {HTMLFormElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-29594519
+ */
+HTMLLegendElement.prototype.form;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-86834457
+ */
+function HTMLUListElement() {}
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-39864178
+ */
+HTMLUListElement.prototype.compact;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-96874670
+ */
+HTMLUListElement.prototype.type;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-58056027
+ */
+function HTMLOListElement() {}
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-76448506
+ */
+HTMLOListElement.prototype.compact;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-14793325
+ */
+HTMLOListElement.prototype.start;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-40971103
+ */
+HTMLOListElement.prototype.type;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-52368974
+ */
+function HTMLDListElement() {}
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-21738539
+ */
+HTMLDListElement.prototype.compact;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-71600284
+ */
+function HTMLDirectoryElement() {}
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-75317739
+ */
+HTMLDirectoryElement.prototype.compact;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-72509186
+ * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#the-menu-element
+ */
+function HTMLMenuElement() {}
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-68436464
+ */
+HTMLMenuElement.prototype.compact;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-74680021
+ */
+function HTMLLIElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-52387668
+ */
+HTMLLIElement.prototype.type;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-45496263
+ */
+HTMLLIElement.prototype.value;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-22445964
+ */
+function HTMLDivElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-70908791
+ */
+HTMLDivElement.prototype.align;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-84675076
+ */
+function HTMLParagraphElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-53465507
+ */
+HTMLParagraphElement.prototype.align;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-43345119
+ */
+function HTMLHeadingElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-6796462
+ */
+HTMLHeadingElement.prototype.align;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-70319763
+ */
+function HTMLQuoteElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-53895598
+ */
+HTMLQuoteElement.prototype.cite;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-11383425
+ */
+function HTMLPreElement() {}
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-13894083
+ */
+HTMLPreElement.prototype.width;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-56836063
+ */
+function HTMLBRElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-82703081
+ */
+HTMLBRElement.prototype.clear;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-32774408
+ */
+function HTMLBaseFontElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-87502302
+ */
+HTMLBaseFontElement.prototype.color;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-88128969
+ */
+HTMLBaseFontElement.prototype.face;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-38930424
+ */
+HTMLBaseFontElement.prototype.size;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-43943847
+ */
+function HTMLFontElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-53532975
+ */
+HTMLFontElement.prototype.color;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-55715655
+ */
+HTMLFontElement.prototype.face;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-90127284
+ */
+HTMLFontElement.prototype.size;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-68228811
+ */
+function HTMLHRElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-15235012
+ */
+HTMLHRElement.prototype.align;
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-79813978
+ */
+HTMLHRElement.prototype.noShade;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-77612587
+ */
+HTMLHRElement.prototype.size;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-87744198
+ */
+HTMLHRElement.prototype.width;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-79359609
+ */
+function HTMLModElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-75101708
+ */
+HTMLModElement.prototype.cite;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-88432678
+ */
+HTMLModElement.prototype.dateTime;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-48250443
+ */
+function HTMLAnchorElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-89647724
+ */
+HTMLAnchorElement.prototype.accessKey;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-67619266
+ */
+HTMLAnchorElement.prototype.charset;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-92079539
+ */
+HTMLAnchorElement.prototype.coords;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-88517319
+ */
+HTMLAnchorElement.prototype.href;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-87358513
+ */
+HTMLAnchorElement.prototype.hreflang;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-32783304
+ */
+HTMLAnchorElement.prototype.name;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-3815891
+ */
+HTMLAnchorElement.prototype.rel;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-58259771
+ */
+HTMLAnchorElement.prototype.rev;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-49899808
+ */
+HTMLAnchorElement.prototype.shape;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-41586466
+ */
+HTMLAnchorElement.prototype.tabIndex;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-6414197
+ */
+HTMLAnchorElement.prototype.target;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-63938221
+ */
+HTMLAnchorElement.prototype.type;
+
+/**
+ * @return {undefined}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-65068939
+ * @override
+ */
+HTMLAnchorElement.prototype.blur = function() {};
+
+/**
+ * @return {undefined}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-47150313
+ * @override
+ */
+HTMLAnchorElement.prototype.focus = function() {};
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-17701901
+ */
+function HTMLImageElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-3211094
+ */
+HTMLImageElement.prototype.align;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-95636861
+ */
+HTMLImageElement.prototype.alt;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-136671
+ */
+HTMLImageElement.prototype.border;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-91561496
+ */
+HTMLImageElement.prototype.height;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-53675471
+ */
+HTMLImageElement.prototype.hspace;
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-58983880
+ */
+HTMLImageElement.prototype.isMap;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-77376969
+ */
+HTMLImageElement.prototype.longDesc;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-91256910
+ */
+HTMLImageElement.prototype.lowSrc;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-47534097
+ */
+HTMLImageElement.prototype.name;
+
+/**
+ * @type {string}
+ * @implicitCast
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-87762984
+ */
+HTMLImageElement.prototype.src;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-35981181
+ */
+HTMLImageElement.prototype.useMap;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-85374897
+ */
+HTMLImageElement.prototype.vspace;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-13839076
+ */
+HTMLImageElement.prototype.width;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-9893177
+ */
+function HTMLObjectElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-16962097
+ */
+HTMLObjectElement.prototype.align;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-47783837
+ */
+HTMLObjectElement.prototype.archive;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-82818419
+ */
+HTMLObjectElement.prototype.border;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-75241146
+ */
+HTMLObjectElement.prototype.code;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-25709136
+ */
+HTMLObjectElement.prototype.codeBase;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-19945008
+ */
+HTMLObjectElement.prototype.codeType;
+
+/**
+ * @type {Document}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-38538621
+ */
+HTMLObjectElement.prototype.contentDocument;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-81766986
+ */
+HTMLObjectElement.prototype.data;
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-942770
+ */
+HTMLObjectElement.prototype.declare;
+
+/**
+ * @type {HTMLFormElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-46094773
+ */
+HTMLObjectElement.prototype.form;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-88925838
+ */
+HTMLObjectElement.prototype.height;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-17085376
+ */
+HTMLObjectElement.prototype.hspace;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-20110362
+ */
+HTMLObjectElement.prototype.name;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-25039673
+ */
+HTMLObjectElement.prototype.standby;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-27083787
+ */
+HTMLObjectElement.prototype.tabIndex;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-91665621
+ */
+HTMLObjectElement.prototype.type;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-6649772
+ */
+HTMLObjectElement.prototype.useMap;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-8682483
+ */
+HTMLObjectElement.prototype.vspace;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-38538620
+ */
+HTMLObjectElement.prototype.width;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-64077273
+ */
+function HTMLParamElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-59871447
+ */
+HTMLParamElement.prototype.name;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-18179888
+ */
+HTMLParamElement.prototype.type;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-77971357
+ */
+HTMLParamElement.prototype.value;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-23931872
+ */
+HTMLParamElement.prototype.valueType;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-31006348
+ */
+function HTMLAppletElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-8049912
+ */
+HTMLAppletElement.prototype.align;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-58610064
+ */
+HTMLAppletElement.prototype.alt;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-14476360
+ */
+HTMLAppletElement.prototype.archive;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-61509645
+ */
+HTMLAppletElement.prototype.code;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-6581160
+ */
+HTMLAppletElement.prototype.codeBase;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-90184867
+ */
+HTMLAppletElement.prototype.height;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-1567197
+ */
+HTMLAppletElement.prototype.hspace;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-39843695
+ */
+HTMLAppletElement.prototype.name;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-93681523
+ */
+HTMLAppletElement.prototype.object;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-22637173
+ */
+HTMLAppletElement.prototype.vspace;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-16526327
+ */
+HTMLAppletElement.prototype.width;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-94109203
+ */
+function HTMLMapElement() {}
+
+/**
+ * @type {HTMLCollection}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-71838730
+ */
+HTMLMapElement.prototype.areas;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-52696514
+ */
+HTMLMapElement.prototype.name;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-26019118
+ */
+function HTMLAreaElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-57944457
+ */
+HTMLAreaElement.prototype.accessKey;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-39775416
+ */
+HTMLAreaElement.prototype.alt;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-66021476
+ */
+HTMLAreaElement.prototype.coords;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-34672936
+ */
+HTMLAreaElement.prototype.href;
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-61826871
+ */
+HTMLAreaElement.prototype.noHref;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-85683271
+ */
+HTMLAreaElement.prototype.shape;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-8722121
+ */
+HTMLAreaElement.prototype.tabIndex;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-46054682
+ */
+HTMLAreaElement.prototype.target;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-81598695
+ */
+function HTMLScriptElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-35305677
+ */
+HTMLScriptElement.prototype.charset;
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-93788534
+ */
+HTMLScriptElement.prototype.defer;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-56700403
+ */
+HTMLScriptElement.prototype.event;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-66979266
+ */
+HTMLScriptElement.prototype.htmlFor;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-75147231
+ */
+HTMLScriptElement.prototype.src;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-46872999
+ */
+HTMLScriptElement.prototype.text;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-30534818
+ */
+HTMLScriptElement.prototype.type;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-64060425
+ */
+function HTMLTableElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-23180977
+ */
+HTMLTableElement.prototype.align;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-83532985
+ */
+HTMLTableElement.prototype.bgColor;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-50969400
+ */
+HTMLTableElement.prototype.border;
+
+/**
+ * @type {HTMLTableCaptionElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-14594520
+ */
+HTMLTableElement.prototype.caption;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-59162158
+ */
+HTMLTableElement.prototype.cellPadding;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-68907883
+ */
+HTMLTableElement.prototype.cellSpacing;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-64808476
+ */
+HTMLTableElement.prototype.frame;
+
+/**
+ * @type {HTMLCollection}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-6156016
+ */
+HTMLTableElement.prototype.rows;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-26347553
+ */
+HTMLTableElement.prototype.rules;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-44998528
+ */
+HTMLTableElement.prototype.summary;
+
+/**
+ * @type {HTMLCollection}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-63206416
+ */
+HTMLTableElement.prototype.tBodies;
+
+/**
+ * @type {HTMLTableSectionElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-64197097
+ */
+HTMLTableElement.prototype.tFoot;
+
+/**
+ * @type {HTMLTableSectionElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-9530944
+ */
+HTMLTableElement.prototype.tHead;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-77447361
+ */
+HTMLTableElement.prototype.width;
+
+/**
+ * @return {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-96920263
+ */
+HTMLTableElement.prototype.createCaption = function() {};
+
+/**
+ * @return {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-8453710
+ */
+HTMLTableElement.prototype.createTFoot = function() {};
+
+/**
+ * @return {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-70313345
+ */
+HTMLTableElement.prototype.createTHead = function() {};
+
+/**
+ * @return {undefined}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-22930071
+ */
+HTMLTableElement.prototype.deleteCaption = function() {};
+
+/**
+ * @param {number} index
+ * @return {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-13114938
+ */
+HTMLTableElement.prototype.deleteRow = function(index) {};
+
+/**
+ * @return {undefined}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-78363258
+ */
+HTMLTableElement.prototype.deleteTFoot = function() {};
+
+/**
+ * @return {undefined}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-38310198
+ */
+HTMLTableElement.prototype.deleteTHead = function() {};
+
+/**
+ * @param {number} index
+ * @return {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-39872903
+ */
+HTMLTableElement.prototype.insertRow = function(index) {};
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-12035137
+ */
+function HTMLTableCaptionElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-79875068
+ */
+HTMLTableCaptionElement.prototype.align;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-84150186
+ */
+function HTMLTableColElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-31128447
+ */
+HTMLTableColElement.prototype.align;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-9447412
+ */
+HTMLTableColElement.prototype.ch;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-57779225
+ */
+HTMLTableColElement.prototype.chOff;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-96511335
+ */
+HTMLTableColElement.prototype.span;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-83291710
+ */
+HTMLTableColElement.prototype.vAlign;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-25196799
+ */
+HTMLTableColElement.prototype.width;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-67417573
+ */
+function HTMLTableSectionElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-40530119
+ */
+HTMLTableSectionElement.prototype.align;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-83470012
+ */
+HTMLTableSectionElement.prototype.ch;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-53459732
+ */
+HTMLTableSectionElement.prototype.chOff;
+
+/**
+ * @type {HTMLCollection}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-52092650
+ */
+HTMLTableSectionElement.prototype.rows;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-4379116
+ */
+HTMLTableSectionElement.prototype.vAlign;
+
+/**
+ * @param {number} index
+ * @return {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-5625626
+ */
+HTMLTableSectionElement.prototype.deleteRow = function(index) {};
+
+/**
+ * @param {number} index
+ * @return {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-93995626
+ */
+HTMLTableSectionElement.prototype.insertRow = function(index) {};
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-6986576
+ */
+function HTMLTableRowElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-74098257
+ */
+HTMLTableRowElement.prototype.align;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-18161327
+ */
+HTMLTableRowElement.prototype.bgColor;
+
+/**
+ * @type {HTMLCollection}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-67349879
+ */
+HTMLTableRowElement.prototype.cells;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-16230502
+ */
+HTMLTableRowElement.prototype.ch;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-68207461
+ */
+HTMLTableRowElement.prototype.chOff;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-67347567
+ */
+HTMLTableRowElement.prototype.rowIndex;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-79105901
+ */
+HTMLTableRowElement.prototype.sectionRowIndex;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-90000058
+ */
+HTMLTableRowElement.prototype.vAlign;
+
+/**
+ * @param {number} index
+ * @return {undefined}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-11738598
+ */
+HTMLTableRowElement.prototype.deleteCell = function(index) {};
+
+/**
+ * @param {number} index
+ * @return {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-68927016
+ */
+HTMLTableRowElement.prototype.insertCell = function(index) {};
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-82915075
+ */
+function HTMLTableCellElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-74444037
+ */
+HTMLTableCellElement.prototype.abbr;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-98433879
+ */
+HTMLTableCellElement.prototype.align;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-76554418
+ */
+HTMLTableCellElement.prototype.axis;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-88135431
+ */
+HTMLTableCellElement.prototype.bgColor;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-80748363
+ */
+HTMLTableCellElement.prototype.cellIndex;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-30914780
+ */
+HTMLTableCellElement.prototype.ch;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-20144310
+ */
+HTMLTableCellElement.prototype.chOff;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-84645244
+ */
+HTMLTableCellElement.prototype.colSpan;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-89104817
+ */
+HTMLTableCellElement.prototype.headers;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-83679212
+ */
+HTMLTableCellElement.prototype.height;
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-62922045
+ */
+HTMLTableCellElement.prototype.noWrap;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-48237625
+ */
+HTMLTableCellElement.prototype.rowSpan;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-36139952
+ */
+HTMLTableCellElement.prototype.scope;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-58284221
+ */
+HTMLTableCellElement.prototype.vAlign;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-27480795
+ */
+HTMLTableCellElement.prototype.width;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-43829095
+ */
+function HTMLFrameSetElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-98869594
+ */
+HTMLFrameSetElement.prototype.cols;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-19739247
+ */
+HTMLFrameSetElement.prototype.rows;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-97790553
+ */
+function HTMLFrameElement() {}
+
+/**
+ * @type {Document}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-78799536
+ */
+HTMLFrameElement.prototype.contentDocument;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-11858633
+ */
+HTMLFrameElement.prototype.frameBorder;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-7836998
+ */
+HTMLFrameElement.prototype.longDesc;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-55569778
+ */
+HTMLFrameElement.prototype.marginHeight;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-8369969
+ */
+HTMLFrameElement.prototype.marginWidth;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-91128709
+ */
+HTMLFrameElement.prototype.name;
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-80766578
+ */
+HTMLFrameElement.prototype.noResize;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-45411424
+ */
+HTMLFrameElement.prototype.scrolling;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-78799535
+ */
+HTMLFrameElement.prototype.src;
+
+/**
+ * @constructor
+ * @extends {HTMLElement}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-50708718
+ */
+function HTMLIFrameElement() {}
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-11309947
+ */
+HTMLIFrameElement.prototype.align;
+
+/**
+ * @type {Document}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-67133006
+ */
+HTMLIFrameElement.prototype.contentDocument;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-22463410
+ */
+HTMLIFrameElement.prototype.frameBorder;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-1678118
+ */
+HTMLIFrameElement.prototype.height;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-70472105
+ */
+HTMLIFrameElement.prototype.longDesc;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-91371294
+ */
+HTMLIFrameElement.prototype.marginHeight;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-66486595
+ */
+HTMLIFrameElement.prototype.marginWidth;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-96819659
+ */
+HTMLIFrameElement.prototype.name;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-36369822
+ */
+HTMLIFrameElement.prototype.scrolling;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-43933957
+ */
+HTMLIFrameElement.prototype.src;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-67133005
+ */
+HTMLIFrameElement.prototype.width;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-258A00AF
+ */
+DOMException.INVALID_STATE_ERR = 11;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-258A00AF
+ */
+DOMException.SYNTAX_ERR = 12;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-258A00AF
+ */
+DOMException.INVALID_MODIFICATION_ERR = 13;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-258A00AF
+ */
+DOMException.NAMESPACE_ERR = 14;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-258A00AF
+ */
+DOMException.INVALID_ACCESS_ERR = 15;
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_dom3.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_dom3.js
new file mode 100644
index 0000000000..ad34d56587
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_dom3.js
@@ -0,0 +1,854 @@
+/*
+ * Copyright 2008 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for W3C's DOM Level 3 specification.
+ * This file depends on w3c_dom2.js.
+ * The whole file has been fully type annotated.
+ * Created from
+ * http://www.w3.org/TR/DOM-Level-3-Core/ecma-script-binding.html
+ *
+ * @externs
+ * @author stevey@google.com (Steve Yegge)
+ */
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-258A00AF
+ */
+DOMException.prototype.code;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-258A00AF
+ */
+DOMException.VALIDATION_ERR = 16;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-258A00AF
+ */
+DOMException.TYPE_MISMATCH_ERR = 17;
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMStringList
+ */
+function DOMStringList() {}
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMStringList-length
+ */
+DOMStringList.prototype.length;
+
+/**
+ * @param {string} str
+ * @return {boolean}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMStringList-contains
+ */
+DOMStringList.prototype.contains = function(str) {};
+
+/**
+ * @param {number} index
+ * @return {string}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMStringList-item
+ */
+DOMStringList.prototype.item = function(index) {};
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#NameList
+ */
+function NameList() {}
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#NameList-length
+ */
+NameList.prototype.length;
+
+/**
+ * @param {string} str
+ * @return {boolean}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#NameList-contains
+ * @nosideeffects
+ */
+NameList.prototype.contains = function(str) {};
+
+/**
+ * @param {string} namespaceURI
+ * @param {string} name
+ * @return {boolean}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#NameList-containsNS
+ * @nosideeffects
+ */
+NameList.prototype.containsNS = function(namespaceURI, name) {};
+
+/**
+ * @param {number} index
+ * @return {string}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#NameList-getName
+ * @nosideeffects
+ */
+NameList.prototype.getName = function(index) {};
+
+/**
+ * @param {number} index
+ * @return {string}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#NameList-getNamespaceURI
+ * @nosideeffects
+ */
+NameList.prototype.getNamespaceURI = function(index) {};
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMImplementationList
+ */
+function DOMImplementationList() {}
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMImplementationList-length
+ */
+DOMImplementationList.prototype.length;
+
+/**
+ * @param {number} index
+ * @return {DOMImplementation}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMImplementationList-item
+ * @nosideeffects
+ */
+DOMImplementationList.prototype.item = function(index) {};
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMImplementationSource
+ */
+function DOMImplementationSource() {}
+
+/**
+ * @param {string} namespaceURI
+ * @param {string} publicId
+ * @param {DocumentType} doctype
+ * @return {Document}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Level-2-Core-DOM-createDocument
+ * @nosideeffects
+ */
+DOMImplementation.prototype.createDocument = function(namespaceURI, publicId, doctype) {};
+
+/**
+ * @param {string} qualifiedName
+ * @param {string} publicId
+ * @param {string} systemId
+ * @return {DocumentType}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Level-2-Core-DOM-createDocType
+ * @nosideeffects
+ */
+DOMImplementation.prototype.createDocumentType = function(qualifiedName, publicId, systemId) {};
+
+/**
+ * @param {string} features
+ * @return {DOMImplementation}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-getDOMImpl
+ * @nosideeffects
+ */
+DOMImplementationSource.prototype.getDOMImplementation = function(features) {};
+
+/**
+ * @param {string} features
+ * @return {DOMImplementationList}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-getDOMImpls
+ * @nosideeffects
+ */
+DOMImplementationSource.prototype.getDOMImplementationList = function(features) {};
+
+/**
+ * @param {string} feature
+ * @param {string} version
+ * @return {Object}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMImplementation3-getFeature
+ * @nosideeffects
+ */
+DOMImplementation.prototype.getFeature = function(feature, version) {};
+
+/**
+ * @param {Node} externalNode
+ * @return {Node}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-adoptNode
+ */
+Document.prototype.adoptNode = function(externalNode) {};
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-documentURI
+ */
+Document.prototype.documentURI;
+
+/**
+ * @type {DOMConfiguration}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-domConfig
+ */
+Document.prototype.domConfig;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-inputEncoding
+ */
+Document.prototype.inputEncoding;
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-strictErrorChecking
+ */
+Document.prototype.strictErrorChecking;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-encoding
+ */
+Document.prototype.xmlEncoding;
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-standalone
+ */
+Document.prototype.xmlStandalone;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-version
+ */
+Document.prototype.xmlVersion;
+
+/**
+ * @return {undefined}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-normalizeDocument
+ */
+Document.prototype.normalizeDocument = function() {};
+
+/**
+ * @param {Node} n
+ * @param {string} namespaceURI
+ * @param {string} qualifiedName
+ * @return {Node}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-renameNode
+ */
+Document.prototype.renameNode = function(n, namespaceURI, qualifiedName) {};
+
+/**
+ * @type {?string}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-baseURI
+ */
+Node.prototype.baseURI;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-NodeNSLocalN
+ */
+Node.prototype.localName;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-NodeNSname
+ */
+Node.prototype.namespaceURI;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-NodeNSPrefix
+ */
+Node.prototype.prefix;
+
+/**
+ * @type {string}
+ * @implicitCast
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-textContent
+ */
+Node.prototype.textContent;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node-DOCUMENT_POSITION_DISCONNECTED
+ */
+Node.DOCUMENT_POSITION_DISCONNECTED = 0x01;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node-DOCUMENT_POSITION_PRECEDING
+ */
+Node.DOCUMENT_POSITION_PRECEDING = 0x02;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node-DOCUMENT_POSITION_FOLLOWING
+ */
+Node.DOCUMENT_POSITION_FOLLOWING = 0x04;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node-DOCUMENT_POSITION_CONTAINS
+ */
+Node.DOCUMENT_POSITION_CONTAINS = 0x08;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node-DOCUMENT_POSITION_CONTAINED_BY
+ */
+Node.DOCUMENT_POSITION_CONTAINED_BY = 0x10;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node-DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
+ */
+Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;
+
+/**
+ * @param {Node} other
+ * @return {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-compareDocumentPosition
+ * @nosideeffects
+ */
+Node.prototype.compareDocumentPosition = function(other) {};
+
+/**
+ * @param {string} feature
+ * @param {string} version
+ * @return {Object}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-getFeature
+ * @nosideeffects
+ */
+Node.prototype.getFeature = function(feature, version) {};
+
+/**
+ * @param {string} key
+ * @return {Object}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-getUserData
+ * @nosideeffects
+ */
+Node.prototype.getUserData = function(key) {};
+
+/**
+ * @return {boolean}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-NodeHasAttrs
+ * @nosideeffects
+ */
+Node.prototype.hasAttributes = function() {};
+
+/**
+ * @param {string} namespaceURI
+ * @return {boolean}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-isDefaultNamespace
+ * @nosideeffects
+ */
+Node.prototype.isDefaultNamespace = function(namespaceURI) {};
+
+/**
+ * @param {Node} arg
+ * @return {boolean}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-isEqualNode
+ * @nosideeffects
+ */
+Node.prototype.isEqualNode = function(arg) {};
+
+/**
+ * @param {Node} other
+ * @return {boolean}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-isSameNode
+ * @nosideeffects
+ */
+Node.prototype.isSameNode = function(other) {};
+
+/**
+ * @param {string} feature
+ * @param {string} version
+ * @return {boolean}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Level-2-Core-Node-supports
+ * @nosideeffects
+ */
+Node.prototype.isSupported = function(feature, version) {};
+
+/**
+ * @param {string} prefix
+ * @return {string}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespaceURI
+ * @nosideeffects
+ */
+Node.prototype.lookupNamespaceURI = function(prefix) {};
+
+/**
+ * @param {string} namespaceURI
+ * @return {string}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespacePrefix
+ * @nosideeffects
+ */
+Node.prototype.lookupPrefix = function(namespaceURI) {};
+
+/**
+ * @return undefined
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-normalize
+ */
+Node.prototype.normalize = function() {};
+
+/**
+ * @param {Object} key
+ * @param {Object} data
+ * @param {UserDataHandler} handler
+ * @return {Object}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-setUserData'
+ */
+Node.prototype.setUserData = function(key, data, handler) {};
+
+/**
+ * @param {string} query
+ * @return {Node}
+ * @see http://www.w3.org/TR/selectors-api/#queryselector
+ * @nosideeffects
+ */
+Node.prototype.querySelector = function(query) {};
+
+/**
+ * @param {string} query
+ * @return {!NodeList}
+ * @see http://www.w3.org/TR/selectors-api/#queryselectorall
+ * @nosideeffects
+ */
+Node.prototype.querySelectorAll = function(query) {};
+
+/**
+ * @type {Element}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Attr-ownerElement
+ */
+Attr.prototype.ownerElement;
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Attr-isId
+ */
+Attr.prototype.isId;
+
+/**
+ * @type {TypeInfo}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Attr-schemaTypeInfo
+ */
+Attr.prototype.schemaTypeInfo;
+
+/**
+ * @type {TypeInfo}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Element-schemaTypeInfo
+ */
+Element.prototype.schemaTypeInfo;
+
+/**
+ * @param {string} namespaceURI
+ * @param {string} localName
+ * @return {Attr}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElGetAtNodeNS
+ * @nosideeffects
+ */
+Element.prototype.getAttributeNodeNS = function(namespaceURI, localName) {};
+
+/**
+ * @param {string} namespaceURI
+ * @param {string} localName
+ * @return {string}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElGetAttrNS
+ * @nosideeffects
+ */
+Element.prototype.getAttributeNS = function(namespaceURI, localName) {};
+
+/**
+ * @param {string} namespaceURI
+ * @param {string} localName
+ * @return {!NodeList}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-A6C90942
+ * @nosideeffects
+ */
+Element.prototype.getElementsByTagNameNS = function(namespaceURI, localName) {};
+
+/**
+ * @param {string} name
+ * @return {boolean}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElHasAttr
+ * @nosideeffects
+ */
+Element.prototype.hasAttribute = function(name) {};
+
+/**
+ * @param {string} namespaceURI
+ * @param {string} localName
+ * @return {boolean}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElHasAttrNS
+ * @nosideeffects
+ */
+Element.prototype.hasAttributeNS = function(namespaceURI, localName) {};
+
+/**
+ * @param {string} namespaceURI
+ * @param {string} localName
+ * @return {undefined}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElRemAtNS
+ */
+Element.prototype.removeAttributeNS = function(namespaceURI, localName) {};
+
+/**
+ * @param {Attr} newAttr
+ * @return {Attr}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElSetAtNodeNS
+ */
+Element.prototype.setAttributeNodeNS = function(newAttr) {};
+
+/**
+ * @param {string} namespaceURI
+ * @param {string} qualifiedName
+ * @param {string|number|boolean} value Values are converted to strings with
+ * ToString, so we accept number and boolean since both convert easily to
+ * strings.
+ * @return {undefined}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElSetAttrNS
+ */
+Element.prototype.setAttributeNS = function(namespaceURI, qualifiedName, value) {};
+
+/**
+ * @param {string} name
+ * @param {boolean} isId
+ * @return {undefined}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElSetIdAttr
+ */
+Element.prototype.setIdAttribute = function(name, isId) {};
+
+/**
+ * @param {Attr} idAttr
+ * @param {boolean} isId
+ * @return {undefined}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElSetIdAttrNode
+ */
+Element.prototype.setIdAttributeNode = function(idAttr, isId) {};
+
+/**
+ * @param {string} namespaceURI
+ * @param {string} localName
+ * @param {boolean} isId
+ * @return {undefined}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElSetIdAttrNS
+ */
+Element.prototype.setIdAttributeNS = function(namespaceURI, localName, isId) {};
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Text3-wholeText
+ */
+Text.prototype.wholeText;
+
+/**
+ * @param {string} newText
+ * @return {Text}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Text3-replaceWholeText
+ */
+Text.prototype.replaceWholeText = function(newText) {};
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo
+ */
+function TypeInfo() {}
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-DERIVATION_EXTENSION
+ */
+TypeInfo.prototype.DERIVATION_EXTENSION;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-DERIVATION_LIST
+ */
+TypeInfo.prototype.DERIVATION_LIST;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-DERIVATION_RESTRICTION
+ */
+TypeInfo.prototype.DERIVATION_RESTRICTION;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-DERIVATION_UNION
+ */
+TypeInfo.prototype.DERIVATION_UNION;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-typeName
+ */
+TypeInfo.prototype.typeName;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-typeNamespace
+ */
+TypeInfo.prototype.typeNamespace;
+
+/**
+ * @param {string} typeNamespaceArg
+ * @param {string} typeNameArg
+ * @param {number} derivationMethod
+ * @return {boolean}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-isDerivedFrom
+ * @nosideeffects
+ */
+TypeInfo.prototype.isDerivedFrom = function(typeNamespaceArg, typeNameArg, derivationMethod) {};
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#UserDataHandler
+ */
+function UserDataHandler() {}
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#UserDataHandler-CLONED
+ */
+UserDataHandler.prototype.NODE_CLONED = 1;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#UserDataHandler-IMPORTED
+ */
+UserDataHandler.prototype.NODE_IMPORTED = 2;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#UserDataHandler-DELETED
+ */
+UserDataHandler.prototype.NODE_DELETED = 3;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#UserDataHandler-RENAMED
+ */
+UserDataHandler.prototype.NODE_RENAMED = 4;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#UserDataHandler-ADOPTED
+ */
+UserDataHandler.prototype.NODE_ADOPTED = 5;
+
+/**
+ * @param {number} operation
+ * @param {string} key
+ * @param {*=} opt_data
+ * @param {?Node=} opt_src
+ * @param {?Node=} opt_dst
+ * @return {undefined}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-handleUserDataEvent
+ */
+UserDataHandler.prototype.handle = function(operation, key, opt_data,
+ opt_src, opt_dst) {};
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-Interfaces-DOMError
+ */
+function DOMError() {}
+
+/**
+ * @type {DOMLocator}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-DOMError-location
+ */
+DOMError.prototype.location;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-DOMError-message
+ */
+DOMError.prototype.message;
+
+/**
+ * @type {Object}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-DOMError-relatedData
+ */
+DOMError.prototype.relatedData;
+
+/**
+ * @type {Object}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-DOMError-relatedException
+ */
+DOMError.prototype.relatedException;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-DOMError-severity-warning
+ */
+DOMError.SEVERITY_WARNING = 1;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-DOMError-severity-error
+ */
+DOMError.SEVERITY_ERROR = 2;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-DOMError-severity-fatal-error
+ */
+DOMError.SEVERITY_FATAL_ERROR = 3;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-DOMError-severity
+ */
+DOMError.prototype.severity;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-DOMError-type
+ */
+DOMError.prototype.type;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/dom/#domerror
+ */
+DOMError.prototype.name;
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-Interfaces-DOMErrorHandler
+ */
+function DOMErrorHandler() {}
+
+/**
+ * @param {DOMError} error
+ * @return {boolean}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ERRORS-DOMErrorHandler-handleError
+ */
+DOMErrorHandler.prototype.handleError = function(error) {};
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Interfaces-DOMLocator
+ */
+function DOMLocator() {}
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMLocator-byteOffset
+ */
+DOMLocator.prototype.byteOffset;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMLocator-column-number
+ */
+DOMLocator.prototype.columnNumber;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMLocator-line-number
+ */
+DOMLocator.prototype.lineNumber;
+
+/**
+ * @type {Node}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMLocator-node
+ */
+DOMLocator.prototype.relatedNode;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMLocator-uri
+ */
+DOMLocator.prototype.uri;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMLocator-utf16Offset
+ */
+DOMLocator.prototype.utf16Offset;
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMConfiguration
+ */
+function DOMConfiguration() {}
+
+/**
+ * @type {DOMStringList}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMConfiguration-parameterNames
+ */
+DOMConfiguration.prototype.parameterNames;
+
+/**
+ * @param {string} name
+ * @return {boolean}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMConfiguration-canSetParameter
+ * @nosideeffects
+ */
+DOMConfiguration.prototype.canSetParameter = function(name) {};
+
+/**
+ * @param {string} name
+ * @return {*}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMConfiguration-getParameter
+ * @nosideeffects
+ */
+DOMConfiguration.prototype.getParameter = function(name) {};
+
+/**
+ * @param {string} name
+ * @param {*} value
+ * @return {*}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMConfiguration-property
+ */
+DOMConfiguration.prototype.setParameter = function(name, value) {};
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-Core-DocType-internalSubset
+ */
+DocumentType.prototype.internalSubset;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-Core-DocType-publicId
+ */
+DocumentType.prototype.publicId;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-Core-DocType-systemId
+ */
+DocumentType.prototype.systemId;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Entity3-inputEncoding
+ */
+Entity.prototype.inputEncoding;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Entity3-encoding
+ */
+Entity.prototype.xmlEncoding;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Entity3-version
+ */
+Entity.prototype.xmlVersion;
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_elementtraversal.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_elementtraversal.js
new file mode 100644
index 0000000000..ee4b4589af
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_elementtraversal.js
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2009 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for DOM Element Traversal interface.
+ * This file depends on w3c_dom1.js.
+ * The whole file has been fully type annotated.
+ * Created from:
+ * http://www.w3.org/TR/ElementTraversal/#ecmascript-bindings
+ *
+ * @externs
+ * @author arv@google.com (Erik Arvidsson)
+ */
+
+/**
+ * @type {Element}
+ * @see https://developer.mozilla.org/En/DOM/Element.firstElementChild
+ */
+Element.prototype.firstElementChild;
+
+/**
+ * @type {Element}
+ * @see https://developer.mozilla.org/En/DOM/Element.lastElementChild
+ */
+Element.prototype.lastElementChild;
+
+/**
+ * @type {Element}
+ * @see https://developer.mozilla.org/En/DOM/Element.previousElementSibling
+ */
+Element.prototype.previousElementSibling;
+
+/**
+ * @type {Element}
+ * @see https://developer.mozilla.org/En/DOM/Element.nextElementSibling
+ */
+Element.prototype.nextElementSibling;
+
+/**
+ * @type {number}
+ * @see https://developer.mozilla.org/En/DOM/Element.childElementCount
+ */
+Element.prototype.childElementCount;
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_encoding.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_encoding.js
new file mode 100644
index 0000000000..947821a909
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_encoding.js
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2015 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for W3C's Encoding specification
+ * https://encoding.spec.whatwg.org
+ * @externs
+ */
+
+/**
+ * @constructor
+ * @param {string=} encoding
+ * @param {Object=} options
+ */
+function TextDecoder(encoding, options) {}
+
+/** @type {string} **/ TextDecoder.prototype.encoding;
+/** @type {boolean} **/ TextDecoder.prototype.fatal;
+/** @type {boolean} **/ TextDecoder.prototype.ignoreBOM;
+
+/**
+ * @param {!Uint8Array} input
+ * @param {Object=} options
+ * @return {string}
+ */
+TextDecoder.prototype.decode = function decode(input, options) {};
+
+/**
+ * @constructor
+ * @param {string=} encoding
+ * @param {Object=} options
+ */
+function TextEncoder(encoding, options) {}
+
+/** @type {string} **/ TextEncoder.prototype.encoding;
+
+/**
+ * @param {string} input
+ * @return {!Uint8Array}
+ */
+TextEncoder.prototype.encode = function(input) {};
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_event.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_event.js
new file mode 100644
index 0000000000..7c72dd1836
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_event.js
@@ -0,0 +1,372 @@
+/*
+ * Copyright 2008 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for W3C's event specification.
+ * The whole file has been fully type annotated.
+ * Created from
+ * http://www.w3.org/TR/DOM-Level-2-Events/ecma-script-binding.html
+ *
+ * @externs
+ */
+
+
+/**
+ * @interface
+ */
+function EventTarget() {}
+
+/**
+ * @param {string} type
+ * @param {EventListener|function(!Event):(boolean|undefined)} listener
+ * @param {boolean} useCapture
+ * @return {undefined}
+ */
+EventTarget.prototype.addEventListener = function(type, listener, useCapture)
+ {};
+
+/**
+ * @param {string} type
+ * @param {EventListener|function(!Event):(boolean|undefined)} listener
+ * @param {boolean} useCapture
+ * @return {undefined}
+ */
+EventTarget.prototype.removeEventListener = function(type, listener, useCapture)
+ {};
+
+/**
+ * @param {!Event} evt
+ * @return {boolean}
+ */
+EventTarget.prototype.dispatchEvent = function(evt) {};
+
+/**
+ * @interface
+ */
+function EventListener() {}
+
+/**
+ * @param {!Event} evt
+ * @return {undefined}
+ */
+EventListener.prototype.handleEvent = function(evt) {};
+
+// The EventInit interface and the parameters to the Event constructor are part
+// of DOM Level 3 (suggested) and the DOM "Living Standard" (mandated). They are
+// included here as externs cannot be redefined. The same applies to other
+// *EventInit interfaces and *Event constructors throughout this file. See:
+// http://www.w3.org/TR/DOM-Level-3-Events/#event-initializers
+// http://dom.spec.whatwg.org/#constructing-events
+// https://dvcs.w3.org/hg/d4e/raw-file/tip/source_respec.htm#event-constructors
+
+/**
+ * @typedef {{
+ * bubbles: (boolean|undefined),
+ * cancelable: (boolean|undefined)
+ * }}
+ */
+var EventInit;
+
+/**
+ * @constructor
+ * @param {string} type
+ * @param {EventInit=} opt_eventInitDict
+ */
+function Event(type, opt_eventInitDict) {}
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Events/ecma-script-binding.html
+ */
+Event.AT_TARGET;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Events/ecma-script-binding.html
+ */
+Event.BUBBLING_PHASE;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Events/ecma-script-binding.html
+ */
+Event.CAPTURING_PHASE;
+
+
+/** @type {string} */
+Event.prototype.type;
+
+/** @type {EventTarget} */
+Event.prototype.target;
+
+/** @type {EventTarget} */
+Event.prototype.currentTarget;
+
+/** @type {number} */
+Event.prototype.eventPhase;
+
+/** @type {boolean} */
+Event.prototype.bubbles;
+
+/** @type {boolean} */
+Event.prototype.cancelable;
+
+/** @type {number} */
+Event.prototype.timeStamp;
+
+/**
+ * Present for events spawned in browsers that support shadow dom.
+ * @type {Array.<!Element>|undefined}
+ */
+Event.prototype.path;
+
+/**
+ * @return {undefined}
+ */
+Event.prototype.stopPropagation = function() {};
+
+/**
+ * @return {undefined}
+ */
+Event.prototype.preventDefault = function() {};
+
+/**
+ * @param {string} eventTypeArg
+ * @param {boolean} canBubbleArg
+ * @param {boolean} cancelableArg
+ * @return {undefined}
+ */
+Event.prototype.initEvent = function(eventTypeArg, canBubbleArg, cancelableArg) {};
+
+/**
+ * @typedef {{
+ * bubbles: (boolean|undefined),
+ * cancelable: (boolean|undefined),
+ * detail: *
+ * }}
+ */
+var CustomEventInit;
+
+/**
+ * @constructor
+ * @extends {Event}
+ * @param {string} type
+ * @param {CustomEventInit=} opt_eventInitDict
+ * @see http://www.w3.org/TR/DOM-Level-3-Events/#interface-CustomEvent
+ */
+function CustomEvent(type, opt_eventInitDict) {}
+
+/**
+ * @param {string} eventType
+ * @param {boolean} bubbles
+ * @param {boolean} cancelable
+ * @param {*} detail
+ */
+CustomEvent.prototype.initCustomEvent = function(
+ eventType, bubbles, cancelable, detail) {};
+
+/**
+ * @type {*}
+ */
+CustomEvent.prototype.detail;
+
+/**
+ * @interface
+ */
+function DocumentEvent() {}
+
+/**
+ * @param {string} eventType
+ * @return {!Event}
+ */
+DocumentEvent.prototype.createEvent = function(eventType) {};
+
+/**
+ * @typedef {{
+ * bubbles: (boolean|undefined),
+ * cancelable: (boolean|undefined),
+ * view: (Window|undefined),
+ * detail: (number|undefined)
+ * }}
+ */
+var UIEventInit;
+
+/**
+ * @constructor
+ * @extends {Event}
+ * @param {string} type
+ * @param {UIEventInit=} opt_eventInitDict
+ */
+function UIEvent(type, opt_eventInitDict) {}
+
+/** @type {number} */
+UIEvent.prototype.detail;
+
+/**
+ * @param {string} typeArg
+ * @param {boolean} canBubbleArg
+ * @param {boolean} cancelableArg
+ * @param {Window} viewArg
+ * @param {number} detailArg
+ * @return {undefined}
+ */
+UIEvent.prototype.initUIEvent = function(typeArg, canBubbleArg, cancelableArg,
+ viewArg, detailArg) {};
+
+/**
+ * @typedef {{
+ * bubbles: (boolean|undefined),
+ * cancelable: (boolean|undefined),
+ * view: (Window|undefined),
+ * detail: (number|undefined),
+ * screenX: (number|undefined),
+ * screenY: (number|undefined),
+ * clientX: (number|undefined),
+ * clientY: (number|undefined),
+ * ctrlKey: (boolean|undefined),
+ * shiftKey: (boolean|undefined),
+ * altKey: (boolean|undefined),
+ * metaKey: (boolean|undefined),
+ * button: (number|undefined),
+ * buttons: (number|undefined),
+ * relatedTarget: (EventTarget|undefined)
+ * }}
+ */
+var MouseEventInit;
+
+/**
+ * @constructor
+ * @extends {UIEvent}
+ * @param {string} type
+ * @param {MouseEventInit=} opt_eventInitDict
+ */
+function MouseEvent(type, opt_eventInitDict) {}
+
+/** @type {number} */
+MouseEvent.prototype.screenX;
+
+/** @type {number} */
+MouseEvent.prototype.screenY;
+
+/** @type {number} */
+MouseEvent.prototype.clientX;
+
+/** @type {number} */
+MouseEvent.prototype.clientY;
+
+/** @type {boolean} */
+MouseEvent.prototype.ctrlKey;
+
+/** @type {boolean} */
+MouseEvent.prototype.shiftKey;
+
+/** @type {boolean} */
+MouseEvent.prototype.altKey;
+
+/** @type {boolean} */
+MouseEvent.prototype.metaKey;
+
+/** @type {number} */
+MouseEvent.prototype.button;
+
+/** @type {EventTarget} */
+MouseEvent.prototype.relatedTarget;
+
+
+/**
+ * @constructor
+ * @extends {Event}
+ */
+function MutationEvent() {}
+
+/** @type {Node} */
+MutationEvent.prototype.relatedNode;
+
+/** @type {string} */
+MutationEvent.prototype.prevValue;
+
+/** @type {string} */
+MutationEvent.prototype.newValue;
+
+/** @type {string} */
+MutationEvent.prototype.attrName;
+
+/** @type {number} */
+MutationEvent.prototype.attrChange;
+
+/**
+ * @param {string} typeArg
+ * @param {boolean} canBubbleArg
+ * @param {boolean} cancelableArg
+ * @param {Node} relatedNodeArg
+ * @param {string} prevValueArg
+ * @param {string} newValueArg
+ * @param {string} attrNameArg
+ * @param {number} attrChangeArg
+ * @return {undefined}
+ */
+MutationEvent.prototype.initMutationEvent = function(typeArg, canBubbleArg, cancelableArg, relatedNodeArg, prevValueArg, newValueArg, attrNameArg, attrChangeArg) {};
+
+
+// DOM3
+/**
+ * @typedef {{
+ * bubbles: (boolean|undefined),
+ * cancelable: (boolean|undefined),
+ * view: (Window|undefined),
+ * detail: (number|undefined),
+ * char: (string|undefined),
+ * key: (string|undefined),
+ * code: (string|undefined),
+ * location: (number|undefined),
+ * ctrlKey: (boolean|undefined),
+ * shiftKey: (boolean|undefined),
+ * altKey: (boolean|undefined),
+ * metaKey: (boolean|undefined),
+ * repeat: (boolean|undefined),
+ * locale: (string|undefined)
+ * }}
+ */
+var KeyboardEventInit;
+
+/**
+ * @constructor
+ * @extends {UIEvent}
+ * @param {string} type
+ * @param {KeyboardEventInit=} opt_eventInitDict
+ */
+function KeyboardEvent(type, opt_eventInitDict) {}
+
+/** @type {string} */
+KeyboardEvent.prototype.keyIdentifier;
+
+/** @type {boolean} */
+KeyboardEvent.prototype.ctrlKey;
+
+/** @type {boolean} */
+KeyboardEvent.prototype.shiftKey;
+
+/** @type {boolean} */
+KeyboardEvent.prototype.altKey;
+
+/** @type {boolean} */
+KeyboardEvent.prototype.metaKey;
+
+/**
+ * @param {string} keyIdentifierArg
+ * @return {boolean}
+ */
+KeyboardEvent.prototype.getModifierState = function(keyIdentifierArg) {};
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_event3.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_event3.js
new file mode 100644
index 0000000000..e98716e2fa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_event3.js
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2010 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for W3C's event Level 3 specification.
+ * This file depends on w3c_event.js.
+ * The whole file has been partially type annotated.
+ * Created from
+ * http://www.w3.org/TR/DOM-Level-3-Events/#ecma-script-binding-ecma-binding
+ *
+ * @externs
+ */
+
+/**
+ * @param {string} typeArg
+ * @param {boolean} canBubbleArg
+ * @param {boolean} cancelableArg
+ * @param {Window} viewArg
+ * @param {string} keyIdentifierArg
+ * @param {number} keyLocationArg
+ * @param {string} modifiersList
+ */
+KeyboardEvent.prototype.initKeyboardEvent = function(typeArg, canBubbleArg, cancelableArg, viewArg, keyIdentifierArg, keyLocationArg, modifiersList) {};
+
+/** @type {string} */
+KeyboardEvent.prototype.char;
+
+/** @type {string} */
+KeyboardEvent.prototype.key;
+
+/** @type {number} */
+KeyboardEvent.prototype.location;
+
+/** @type {boolean} */
+KeyboardEvent.prototype.repeat;
+
+/** @type {string} */
+KeyboardEvent.prototype.locale;
+
+/** @type {number} */
+MouseEvent.prototype.buttons;
+
+/** @type {boolean} */
+Event.prototype.defaultPrevented;
+
+/** @type {string} */
+Event.prototype.namespaceURI;
+
+/** @return {undefined} */
+Event.prototype.stopImmediatePropagation = function() {};
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_geolocation.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_geolocation.js
new file mode 100644
index 0000000000..0b9db09137
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_geolocation.js
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2009 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for W3C's Geolocation specification
+ * http://www.w3.org/TR/geolocation-API/
+ * @externs
+ */
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/geolocation-API/#geolocation
+ */
+function Geolocation() {}
+
+/**
+ * @param {function(GeolocationPosition)} successCallback
+ * @param {(function(GeolocationPositionError)|null)=} opt_errorCallback
+ * @param {GeolocationPositionOptions=} opt_options
+ */
+Geolocation.prototype.getCurrentPosition = function(successCallback,
+ opt_errorCallback,
+ opt_options) {};
+
+/**
+ * @param {function(GeolocationPosition)} successCallback
+ * @param {(function(GeolocationPositionError)|null)=} opt_errorCallback
+ * @param {GeolocationPositionOptions=} opt_options
+ * @return {number}
+ */
+Geolocation.prototype.watchPosition = function(successCallback,
+ opt_errorCallback,
+ opt_options) {};
+
+/** @param {number} watchId */
+Geolocation.prototype.clearWatch = function(watchId) {};
+
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/geolocation-API/#coordinates
+ */
+function GeolocationCoordinates() {}
+/** @type {number} */ GeolocationCoordinates.prototype.latitude;
+/** @type {number} */ GeolocationCoordinates.prototype.longitude;
+/** @type {number} */ GeolocationCoordinates.prototype.accuracy;
+/** @type {number} */ GeolocationCoordinates.prototype.altitude;
+/** @type {number} */ GeolocationCoordinates.prototype.altitudeAccuracy;
+/** @type {number} */ GeolocationCoordinates.prototype.heading;
+/** @type {number} */ GeolocationCoordinates.prototype.speed;
+
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/geolocation-API/#position
+ */
+function GeolocationPosition() {}
+/** @type {GeolocationCoordinates} */
+GeolocationPosition.prototype.coords;
+/** @type {Date} */ GeolocationPosition.prototype.timestamp;
+
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/geolocation-API/#position-options
+ */
+function GeolocationPositionOptions() {}
+/** @type {boolean} */
+GeolocationPositionOptions.prototype.enableHighAccuracy;
+/** @type {number} */ GeolocationPositionOptions.prototype.maximumAge;
+/** @type {number} */ GeolocationPositionOptions.prototype.timeout;
+
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/geolocation-API/#position-error
+ */
+function GeolocationPositionError() {}
+/** @type {number} */ GeolocationPositionError.prototype.code;
+/** @type {string} */ GeolocationPositionError.prototype.message;
+/** @type {number} */ GeolocationPositionError.prototype.UNKNOWN_ERROR;
+/** @type {number} */ GeolocationPositionError.prototype.PERMISSION_DENIED;
+/** @type {number} */
+GeolocationPositionError.prototype.POSITION_UNAVAILABLE;
+/** @type {number} */ GeolocationPositionError.prototype.TIMEOUT;
+
+/** @type {Geolocation} */
+Navigator.prototype.geolocation;
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_indexeddb.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_indexeddb.js
new file mode 100644
index 0000000000..19c35ec1ee
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_indexeddb.js
@@ -0,0 +1,914 @@
+/*
+ * Copyright 2011 The Closure Compiler Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for W3C's IndexedDB API. In Chrome all the
+ * IndexedDB classes are prefixed with 'webkit'. In order to access constants
+ * and static methods of these classes they must be duplicated with the
+ * prefix here.
+ * @see http://www.w3.org/TR/IndexedDB/
+ *
+ * @externs
+ * @author guido.tapia@picnet.com.au (Guido Tapia)
+ */
+
+/** @type {IDBFactory} */
+Window.prototype.moz_indexedDB;
+
+/** @type {IDBFactory} */
+Window.prototype.mozIndexedDB;
+
+/** @type {IDBFactory} */
+Window.prototype.webkitIndexedDB;
+
+/** @type {IDBFactory} */
+Window.prototype.msIndexedDB;
+
+/** @type {IDBFactory} */
+Window.prototype.indexedDB;
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBFactory
+ */
+function IDBFactory() {}
+
+/**
+ * @param {string} name The name of the database to open.
+ * @param {number=} opt_version The version at which to open the database.
+ * @return {!IDBOpenDBRequest} The IDBRequest object.
+ */
+IDBFactory.prototype.open = function(name, opt_version) {};
+
+/**
+ * @param {string} name The name of the database to delete.
+ * @return {!IDBOpenDBRequest} The IDBRequest object.
+ */
+IDBFactory.prototype.deleteDatabase = function(name) {};
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBDatabaseException
+ */
+function IDBDatabaseException() {}
+
+/**
+ * @constructor
+ * @extends {IDBDatabaseException}
+ * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBDatabaseException
+ */
+function webkitIDBDatabaseException() {}
+
+/**
+ * @const
+ * @type {number}
+ */
+IDBDatabaseException.UNKNOWN_ERR;
+
+/**
+ * @const
+ * @type {number}
+ */
+webkitIDBDatabaseException.UNKNOWN_ERR;
+
+/**
+ * @const
+ * @type {number}
+ */
+IDBDatabaseException.NON_TRANSIENT_ERR;
+
+/**
+ * @const
+ * @type {number}
+ */
+webkitIDBDatabaseException.NON_TRANSIENT_ERR;
+
+/**
+ * @const
+ * @type {number}
+ */
+IDBDatabaseException.NOT_FOUND_ERR;
+
+/**
+ * @const
+ * @type {number}
+ */
+webkitIDBDatabaseException.NOT_FOUND_ERR;
+
+/**
+ * @const
+ * @type {number}
+ */
+IDBDatabaseException.CONSTRAINT_ERR;
+
+/**
+ * @const
+ * @type {number}
+ */
+webkitIDBDatabaseException.CONSTRAINT_ERR;
+
+/**
+ * @const
+ * @type {number}
+ */
+IDBDatabaseException.DATA_ERR;
+
+/**
+ * @const
+ * @type {number}
+ */
+webkitIDBDatabaseException.DATA_ERR;
+
+/**
+ * @const
+ * @type {number}
+ */
+IDBDatabaseException.NOT_ALLOWED_ERR;
+
+/**
+ * @const
+ * @type {number}
+ */
+webkitIDBDatabaseException.NOT_ALLOWED_ERR;
+
+/**
+ * @const
+ * @type {number}
+ */
+IDBDatabaseException.TRANSACTION_INACTIVE_ERR;
+
+/**
+ * @const
+ * @type {number}
+ */
+webkitIDBDatabaseException.TRANSACTION_INACTIVE_ERR;
+
+/**
+ * @const
+ * @type {number}
+ */
+IDBDatabaseException.ABORT_ERR;
+
+/**
+ * @const
+ * @type {number}
+ */
+webkitIDBDatabaseException.ABORT_ERR;
+
+/**
+ * @const
+ * @type {number}
+ */
+IDBDatabaseException.READ_ONLY_ERR;
+
+/**
+ * @const
+ * @type {number}
+ */
+webkitIDBDatabaseException.READ_ONLY_ERR;
+
+/**
+ * @const
+ * @type {number}
+ */
+IDBDatabaseException.TIMEOUT_ERR;
+
+/**
+ * @const
+ * @type {number}
+ */
+webkitIDBDatabaseException.TIMEOUT_ERR;
+
+/**
+ * @const
+ * @type {number}
+ */
+IDBDatabaseException.QUOTA_ERR;
+
+/**
+ * @const
+ * @type {number}
+ */
+webkitIDBDatabaseException.QUOTA_ERR;
+
+/**
+ * @const
+ * @type {number}
+ */
+IDBDatabaseException.prototype.code;
+
+/**
+ * @const
+ * @type {number}
+ */
+webkitIDBDatabaseException.prototype.code;
+
+/**
+ * @const
+ * @type {string}
+ */
+IDBDatabaseException.prototype.message;
+
+/**
+ * @const
+ * @type {string}
+ */
+webkitIDBDatabaseException.prototype.message;
+
+/**
+ * @constructor
+ * @implements {EventTarget}
+ * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBRequest
+ */
+function IDBRequest() {}
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+IDBRequest.prototype.addEventListener =
+ function(type, listener, opt_useCapture) {};
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+IDBRequest.prototype.removeEventListener =
+ function(type, listener, opt_useCapture) {};
+
+/** @override */
+IDBRequest.prototype.dispatchEvent = function(evt) {};
+
+/**
+ * @constructor
+ * @extends {IDBRequest}
+ * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBRequest
+ */
+function webkitIDBRequest() {}
+
+/**
+ * @type {number}
+ * @const
+ */
+IDBRequest.LOADING;
+
+/**
+ * @type {number}
+ * @const
+ */
+webkitIDBRequest.LOADING;
+
+/**
+ * @type {number}
+ * @const
+ */
+IDBRequest.DONE;
+
+/**
+ * @type {number}
+ * @const
+ */
+webkitIDBRequest.DONE;
+
+/** @type {number} */
+IDBRequest.prototype.readyState; // readonly
+
+/** @type {function(!Event)} */
+IDBRequest.prototype.onsuccess = function(e) {};
+
+/** @type {function(!Event)} */
+IDBRequest.prototype.onerror = function(e) {};
+
+/** @type {*} */
+IDBRequest.prototype.result; // readonly
+
+/**
+ * @type {number}
+ * @deprecated Use "error"
+ */
+IDBRequest.prototype.errorCode; // readonly
+
+
+/** @type {!DOMError} */
+IDBRequest.prototype.error; // readonly
+
+/** @type {Object} */
+IDBRequest.prototype.source; // readonly
+
+/** @type {IDBTransaction} */
+IDBRequest.prototype.transaction; // readonly
+
+/**
+ * @constructor
+ * @extends {IDBRequest}
+ * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBOpenDBRequest
+ */
+function IDBOpenDBRequest() {}
+
+/**
+ * @type {function(!IDBVersionChangeEvent)}
+ */
+IDBOpenDBRequest.prototype.onblocked = function(e) {};
+
+/**
+ * @type {function(!IDBVersionChangeEvent)}
+ */
+IDBOpenDBRequest.prototype.onupgradeneeded = function(e) {};
+
+/**
+ * @constructor
+ * @implements {EventTarget}
+ * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBDatabase
+ */
+function IDBDatabase() {}
+
+/**
+ * @type {string}
+ * @const
+ */
+IDBDatabase.prototype.name;
+
+/**
+ * @type {string}
+ * @const
+ */
+IDBDatabase.prototype.description;
+
+/**
+ * @type {string}
+ * @const
+ */
+IDBDatabase.prototype.version;
+
+/**
+ * @type {DOMStringList}
+ * @const
+ */
+IDBDatabase.prototype.objectStoreNames;
+
+/**
+ * @param {string} name The name of the object store.
+ * @param {Object=} opt_parameters Parameters to be passed
+ * creating the object store.
+ * @return {!IDBObjectStore} The created/open object store.
+ */
+IDBDatabase.prototype.createObjectStore =
+ function(name, opt_parameters) {};
+
+/**
+ * @param {string} name The name of the object store to remove.
+ */
+IDBDatabase.prototype.deleteObjectStore = function(name) {};
+
+/**
+ * @param {string} version The new version of the database.
+ * @return {!IDBRequest} The IDBRequest object.
+ */
+IDBDatabase.prototype.setVersion = function(version) {};
+
+/**
+ * @param {Array.<string>} storeNames The stores to open in this transaction.
+ * @param {(number|string)=} mode The mode for opening the object stores.
+ * @return {!IDBTransaction} The IDBRequest object.
+ */
+IDBDatabase.prototype.transaction = function(storeNames, mode) {};
+
+/**
+ * Closes the database connection.
+ */
+IDBDatabase.prototype.close = function() {};
+
+/**
+ * @type {Function}
+ */
+IDBDatabase.prototype.onabort = function() {};
+
+/**
+ * @type {Function}
+ */
+IDBDatabase.prototype.onerror = function() {};
+
+/**
+ * @type {Function}
+ */
+IDBDatabase.prototype.onversionchange = function() {};
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+IDBDatabase.prototype.addEventListener =
+ function(type, listener, opt_useCapture) {};
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+IDBDatabase.prototype.removeEventListener =
+ function(type, listener, opt_useCapture) {};
+
+/** @override */
+IDBDatabase.prototype.dispatchEvent = function(evt) {};
+
+/**
+ * Typedef for valid key types according to the w3 specification. Note that this
+ * is slightly wider than what is actually allowed, as all Array elements must
+ * have a valid key type.
+ * @see http://www.w3.org/TR/IndexedDB/#key-construct
+ * @typedef {number|string|!Date|!Array.<?>}
+ */
+var IDBKeyType;
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBObjectStore
+ */
+function IDBObjectStore() {}
+
+/**
+ * @type {string}
+ */
+IDBObjectStore.prototype.name;
+
+/**
+ * @type {string}
+ */
+IDBObjectStore.prototype.keyPath;
+
+/**
+ * @type {DOMStringList}
+ */
+IDBObjectStore.prototype.indexNames;
+
+/** @type {IDBTransaction} */
+IDBObjectStore.prototype.transaction;
+
+/** @type {boolean} */
+IDBObjectStore.prototype.autoIncrement;
+
+/**
+ * @param {*} value The value to put into the object store.
+ * @param {IDBKeyType=} key The key of this value.
+ * @return {!IDBRequest} The IDBRequest object.
+ */
+IDBObjectStore.prototype.put = function(value, key) {};
+
+/**
+ * @param {*} value The value to add into the object store.
+ * @param {IDBKeyType=} key The key of this value.
+ * @return {!IDBRequest} The IDBRequest object.
+ */
+IDBObjectStore.prototype.add = function(value, key) {};
+
+/**
+ * @param {IDBKeyType} key The key of this value.
+ * @return {!IDBRequest} The IDBRequest object.
+ */
+IDBObjectStore.prototype.delete = function(key) {};
+
+/**
+ * @param {IDBKeyType|!IDBKeyRange} key The key of the document to retrieve.
+ * @return {!IDBRequest} The IDBRequest object.
+ */
+IDBObjectStore.prototype.get = function(key) {};
+
+/**
+ * @return {!IDBRequest} The IDBRequest object.
+ */
+IDBObjectStore.prototype.clear = function() {};
+
+/**
+ * @param {IDBKeyRange=} range The range of the cursor.
+ * @param {(number|string)=} direction The direction of cursor enumeration.
+ * @return {!IDBRequest} The IDBRequest object.
+ */
+IDBObjectStore.prototype.openCursor = function(range, direction) {};
+
+/**
+ * @param {string} name The name of the index.
+ * @param {string|!Array.<string>} keyPath The path to the index key.
+ * @param {Object=} opt_paramters Optional parameters
+ * for the created index.
+ * @return {!IDBIndex} The IDBIndex object.
+ */
+IDBObjectStore.prototype.createIndex = function(name, keyPath, opt_paramters) {};
+
+/**
+ * @param {string} name The name of the index to retrieve.
+ * @return {!IDBIndex} The IDBIndex object.
+ */
+IDBObjectStore.prototype.index = function(name) {};
+
+/**
+ * @param {string} indexName The name of the index to remove.
+ */
+IDBObjectStore.prototype.deleteIndex = function(indexName) {};
+
+/**
+ * @param {(IDBKeyType|IDBKeyRange)=} key The key of this value.
+ * @return {!IDBRequest} The IDBRequest object.
+ * @see http://www.w3.org/TR/IndexedDB/#widl-IDBObjectStore-count
+ */
+IDBObjectStore.prototype.count = function(key) {};
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBIndex
+ */
+function IDBIndex() {}
+
+/**
+ * @type {string}
+ * @const
+ */
+IDBIndex.prototype.name;
+
+/**
+ * @type {!IDBObjectStore}
+ * @const
+ */
+IDBIndex.prototype.objectStore;
+
+/**
+ * @type {string}
+ * @const
+ */
+IDBIndex.prototype.keyPath;
+
+/**
+ * @type {boolean}
+ * @const
+ */
+IDBIndex.prototype.unique;
+
+/**
+ * @param {IDBKeyRange=} range The range of the cursor.
+ * @param {(number|string)=} direction The direction of cursor enumeration.
+ * @return {!IDBRequest} The IDBRequest object.
+ */
+IDBIndex.prototype.openCursor = function(range, direction) {};
+
+/**
+ * @param {IDBKeyRange=} range The range of the cursor.
+ * @param {(number|string)=} direction The direction of cursor enumeration.
+ * @return {!IDBRequest} The IDBRequest object.
+ */
+IDBIndex.prototype.openKeyCursor = function(range, direction) {};
+
+/**
+ * @param {IDBKeyType|!IDBKeyRange} key The id of the object to retrieve.
+ * @return {!IDBRequest} The IDBRequest object.
+ */
+IDBIndex.prototype.get = function(key) {};
+
+/**
+ * @param {IDBKeyType|!IDBKeyRange} key The id of the object to retrieve.
+ * @return {!IDBRequest} The IDBRequest object.
+ */
+IDBIndex.prototype.getKey = function(key) {};
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBCursor
+ */
+function IDBCursor() {}
+
+/**
+ * @constructor
+ * @extends {IDBCursor}
+ * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBCursor
+ */
+function webkitIDBCursor() {}
+
+/**
+ * @const
+ * @type {number}
+ */
+IDBCursor.NEXT;
+
+/**
+ * @const
+ * @type {number}
+ */
+webkitIDBCursor.NEXT;
+
+/**
+ * @const
+ * @type {number}
+ */
+IDBCursor.NEXT_NO_DUPLICATE;
+
+/**
+ * @const
+ * @type {number}
+ */
+webkitIDBCursor.NEXT_NO_DUPLICATE;
+
+/**
+ * @const
+ * @type {number}
+ */
+IDBCursor.PREV;
+
+/**
+ * @const
+ * @type {number}
+ */
+webkitIDBCursor.PREV;
+
+/**
+ * @const
+ * @type {number}
+ */
+IDBCursor.PREV_NO_DUPLICATE;
+
+/**
+ * @const
+ * @type {number}
+ */
+webkitIDBCursor.PREV_NO_DUPLICATE;
+
+/**
+ * @type {*}
+ * @const
+ */
+IDBCursor.prototype.source;
+
+/**
+ * @type {number}
+ * @const
+ */
+IDBCursor.prototype.direction;
+
+/**
+ * @type {IDBKeyType}
+ * @const
+ */
+IDBCursor.prototype.key;
+
+/**
+ * @type {number}
+ * @const
+ */
+IDBCursor.prototype.primaryKey;
+
+/**
+ * @param {*} value The new value for the current object in the cursor.
+ * @return {!IDBRequest} The IDBRequest object.
+ */
+IDBCursor.prototype.update = function(value) {};
+
+/**
+ * Note: Must be quoted to avoid parse error.
+ * @param {IDBKeyType=} key Continue enumerating the cursor from the specified
+ * key (or next).
+ */
+IDBCursor.prototype.continue = function(key) {};
+
+/**
+ * @param {number} count Number of times to iterate the cursor.
+ */
+IDBCursor.prototype.advance = function(count) {};
+
+/**
+ * Note: Must be quoted to avoid parse error.
+ * @return {!IDBRequest} The IDBRequest object.
+ */
+IDBCursor.prototype.delete = function() {};
+
+/**
+ * @constructor
+ * @extends {IDBCursor}
+ * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBCursorWithValue
+ */
+function IDBCursorWithValue() {}
+
+/** @type {*} */
+IDBCursorWithValue.prototype.value; // readonly
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBTransaction
+ */
+function IDBTransaction() {}
+
+/**
+ * @constructor
+ * @extends {IDBTransaction}
+ * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBTransaction
+ */
+function webkitIDBTransaction() {}
+
+/**
+ * @const
+ * @type {number}
+ */
+IDBTransaction.READ_WRITE;
+
+/**
+ * @const
+ * @type {number}
+ */
+webkitIDBTransaction.READ_WRITE;
+
+/**
+ * @const
+ * @type {number}
+ */
+IDBTransaction.READ_ONLY;
+
+/**
+ * @const
+ * @type {number}
+ */
+webkitIDBTransaction.READ_ONLY;
+
+/**
+ * @const
+ * @type {number}
+ */
+IDBTransaction.VERSION_CHANGE;
+
+/**
+ * @const
+ * @type {number}
+ */
+webkitIDBTransaction.VERSION_CHANGE;
+
+/**
+ * @type {number|string}
+ * @const
+ */
+IDBTransaction.prototype.mode;
+
+/**
+ * @type {IDBDatabase}
+ * @const
+ */
+IDBTransaction.prototype.db;
+
+/**
+ * @param {string} name The name of the object store to retrieve.
+ * @return {!IDBObjectStore} The object store.
+ */
+IDBTransaction.prototype.objectStore = function(name) {};
+
+/**
+ * Aborts the transaction.
+ */
+IDBTransaction.prototype.abort = function() {};
+
+/**
+ * @type {Function}
+ */
+IDBTransaction.prototype.onabort = function() {};
+
+/**
+ * @type {Function}
+ */
+IDBTransaction.prototype.oncomplete = function() {};
+
+/**
+ * @type {Function}
+ */
+IDBTransaction.prototype.onerror = function() {};
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBKeyRange
+ */
+function IDBKeyRange() {}
+
+/**
+ * @constructor
+ * @extends {IDBKeyRange}
+ * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBKeyRange
+ */
+function webkitIDBKeyRange() {}
+
+/**
+ * @type {*}
+ * @const
+ */
+IDBKeyRange.prototype.lower;
+
+/**
+ * @type {*}
+ * @const
+ */
+IDBKeyRange.prototype.upper;
+
+/**
+ * @type {*}
+ * @const
+ */
+IDBKeyRange.prototype.lowerOpen;
+
+/**
+ * @type {*}
+ * @const
+ */
+IDBKeyRange.prototype.upperOpen;
+
+/**
+ * @param {IDBKeyType} value The single key value of this range.
+ * @return {!IDBKeyRange} The key range.
+ */
+IDBKeyRange.only = function(value) {};
+
+/**
+ * @param {IDBKeyType} value The single key value of this range.
+ * @return {!IDBKeyRange} The key range.
+ */
+webkitIDBKeyRange.only = function(value) {};
+
+/**
+ * @param {IDBKeyType} bound Creates a lower bound key range.
+ * @param {boolean=} open Open the key range.
+ * @return {!IDBKeyRange} The key range.
+ */
+IDBKeyRange.lowerBound = function(bound, open) {};
+
+/**
+ * @param {IDBKeyType} bound Creates a lower bound key range.
+ * @param {boolean=} open Open the key range.
+ * @return {!IDBKeyRange} The key range.
+ */
+webkitIDBKeyRange.lowerBound = function(bound, open) {};
+
+/**
+ * @param {IDBKeyType} bound Creates an upper bound key range.
+ * @param {boolean=} open Open the key range.
+ * @return {!IDBKeyRange} The key range.
+ */
+IDBKeyRange.upperBound = function(bound, open) {};
+
+/**
+ * @param {IDBKeyType} bound Creates an upper bound key range.
+ * @param {boolean=} open Open the key range.
+ * @return {!IDBKeyRange} The key range.
+ */
+webkitIDBKeyRange.upperBound = function(bound, open) {};
+
+/**
+ * @param {IDBKeyType} left The left bound value.
+ * @param {IDBKeyType} right The right bound value.
+ * @param {boolean=} openLeft Whether the left bound value should be excluded.
+ * @param {boolean=} openRight Whether the right bound value should be excluded.
+ * @return {!IDBKeyRange} The key range.
+ */
+IDBKeyRange.bound = function(left, right, openLeft, openRight) {};
+
+/**
+ * @param {IDBKeyType} left The left bound value.
+ * @param {IDBKeyType} right The right bound value.
+ * @param {boolean=} openLeft Whether the left bound value should be excluded.
+ * @param {boolean=} openRight Whether the right bound value should be excluded.
+ * @return {!IDBKeyRange} The key range.
+ */
+webkitIDBKeyRange.bound = function(left, right, openLeft, openRight) {};
+
+/**
+ * @constructor
+ * @extends {Event}
+ * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBVersionChangeEvent
+ */
+function IDBVersionChangeEvent() {}
+
+/**
+ * @type {number}
+ * @const
+ */
+IDBVersionChangeEvent.prototype.oldVersion;
+
+/**
+ * @type {?number}
+ * @const
+ */
+IDBVersionChangeEvent.prototype.newVersion;
+
+/**
+ * @constructor
+ * @extends {IDBVersionChangeEvent}
+ * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBVersionChangeEvent
+ */
+function webkitIDBVersionChangeEvent() {}
+
+/**
+ * @type {string}
+ * @const
+ */
+webkitIDBVersionChangeEvent.prototype.version;
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_navigation_timing.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_navigation_timing.js
new file mode 100644
index 0000000000..cf0315e7e5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_navigation_timing.js
@@ -0,0 +1,161 @@
+/*
+ * Copyright 2011 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for W3C's Navigation Timing specification.
+ *
+ * Created from
+ * @see http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html
+ * @see http://w3c-test.org/webperf/specs/ResourceTiming
+ * @see http://www.w3.org/TR/performance-timeline
+ *
+ * @externs
+ */
+
+/** @constructor */
+function PerformanceTiming() {}
+/** @type {number} */ PerformanceTiming.prototype.navigationStart;
+/** @type {number} */ PerformanceTiming.prototype.unloadEventStart;
+/** @type {number} */ PerformanceTiming.prototype.unloadEventEnd;
+/** @type {number} */ PerformanceTiming.prototype.redirectStart;
+/** @type {number} */ PerformanceTiming.prototype.redirectEnd;
+/** @type {number} */ PerformanceTiming.prototype.fetchStart;
+/** @type {number} */ PerformanceTiming.prototype.domainLookupStart;
+/** @type {number} */ PerformanceTiming.prototype.domainLookupEnd;
+/** @type {number} */ PerformanceTiming.prototype.connectStart;
+/** @type {number} */ PerformanceTiming.prototype.connectEnd;
+/** @type {number} */ PerformanceTiming.prototype.secureConnectionStart;
+/** @type {number} */ PerformanceTiming.prototype.requestStart;
+/** @type {number} */ PerformanceTiming.prototype.responseStart;
+/** @type {number} */ PerformanceTiming.prototype.responseEnd;
+/** @type {number} */ PerformanceTiming.prototype.domLoading;
+/** @type {number} */ PerformanceTiming.prototype.domInteractive;
+/** @type {number} */ PerformanceTiming.prototype.domContentLoadedEventStart;
+/** @type {number} */ PerformanceTiming.prototype.domContentLoadedEventEnd;
+/** @type {number} */ PerformanceTiming.prototype.domComplete;
+/** @type {number} */ PerformanceTiming.prototype.loadEventStart;
+/** @type {number} */ PerformanceTiming.prototype.loadEventEnd;
+
+/** @constructor */
+function PerformanceEntry() {}
+/** @type {string} */ PerformanceEntry.prototype.name;
+/** @type {string} */ PerformanceEntry.prototype.entryType;
+/** @type {number} */ PerformanceEntry.prototype.startTime;
+/** @type {number} */ PerformanceEntry.prototype.duration;
+
+/**
+ * @constructor
+ * @extends {PerformanceEntry}
+ */
+function PerformanceResourceTiming() {}
+/** @type {number} */ PerformanceResourceTiming.prototype.redirectStart;
+/** @type {number} */ PerformanceResourceTiming.prototype.redirectEnd;
+/** @type {number} */ PerformanceResourceTiming.prototype.fetchStart;
+/** @type {number} */ PerformanceResourceTiming.prototype.domainLookupStart;
+/** @type {number} */ PerformanceResourceTiming.prototype.domainLookupEnd;
+/** @type {number} */ PerformanceResourceTiming.prototype.connectStart;
+/** @type {number} */ PerformanceResourceTiming.prototype.connectEnd;
+/** @type {number} */
+PerformanceResourceTiming.prototype.secureConnectionStart;
+/** @type {number} */ PerformanceResourceTiming.prototype.requestStart;
+/** @type {number} */ PerformanceResourceTiming.prototype.responseStart;
+/** @type {number} */ PerformanceResourceTiming.prototype.responseEnd;
+/** @type {string} */ PerformanceResourceTiming.prototype.initiatorType;
+
+/** @constructor */
+function PerformanceNavigation() {}
+/** @type {number} */ PerformanceNavigation.prototype.TYPE_NAVIGATE = 0;
+/** @type {number} */ PerformanceNavigation.prototype.TYPE_RELOAD = 1;
+/** @type {number} */ PerformanceNavigation.prototype.TYPE_BACK_FORWARD = 2;
+/** @type {number} */ PerformanceNavigation.prototype.TYPE_RESERVED = 255;
+/** @type {number} */ PerformanceNavigation.prototype.type;
+/** @type {number} */ PerformanceNavigation.prototype.redirectCount;
+
+// Only available in WebKit, and only with the --enable-memory-info flag.
+/** @constructor */
+function PerformanceMemory() {}
+/** @type {number} */ PerformanceMemory.prototype.jsHeapSizeLimit;
+/** @type {number} */ PerformanceMemory.prototype.totalJSHeapSize;
+/** @type {number} */ PerformanceMemory.prototype.usedJSHeapSize;
+
+/** @constructor */
+function Performance() {}
+/** @type {PerformanceTiming} */ Performance.prototype.timing;
+/** @type {PerformanceNavigation} */ Performance.prototype.navigation;
+
+/**
+ * Clears the buffer used to store the current list of
+ * PerformanceResourceTiming resources.
+ * @return {undefined}
+ */
+Performance.prototype.clearResourceTimings = function() {};
+
+/**
+ * Clear out the buffer of performance timing events for webkit browsers.
+ * @return {undefined}
+ */
+Performance.prototype.webkitClearResourceTimings = function() {};
+
+/**
+ * Set the maximum number of PerformanceResourceTiming resources that may be
+ * stored in the buffer.
+ * @param {number} maxSize
+ */
+Performance.prototype.setResourceTimingBufferSize = function(maxSize) {};
+
+/**
+ * @return {Array.<PerformanceEntry>} A copy of the PerformanceEntry list,
+ * in chronological order with respect to startTime.
+ * @nosideeffects
+ */
+Performance.prototype.getEntries = function() {};
+
+/**
+ * @param {string} entryType Only return {@code PerformanceEntry}s with this
+ * entryType.
+ * @return {Array.<PerformanceEntry>} A copy of the PerformanceEntry list,
+ * in chronological order with respect to startTime.
+ * @nosideeffects
+ */
+Performance.prototype.getEntriesByType = function(entryType) {};
+
+/**
+ * @param {string} name Only return {@code PerformanceEntry}s with this name.
+ * @param {string=} opt_entryType Only return {@code PerformanceEntry}s with
+ * this entryType.
+ * @return {Array.<PerformanceEntry>} PerformanceEntry list in chronological
+ * order with respect to startTime.
+ * @nosideeffects
+ */
+Performance.prototype.getEntriesByName = function(name, opt_entryType) {};
+
+// Only available in WebKit, and only with the --enable-memory-info flag.
+/** @type {PerformanceMemory} */ Performance.prototype.memory;
+
+/**
+ * @return {number}
+ * @nosideeffects
+ */
+Performance.prototype.now = function() {};
+
+/**
+ * @return {number}
+ * @nosideeffects
+ */
+Performance.prototype.webkitNow = function() {};
+
+/** @type {Performance} */
+Window.prototype.performance;
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_range.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_range.js
new file mode 100644
index 0000000000..fb79fd2364
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_range.js
@@ -0,0 +1,248 @@
+/*
+ * Copyright 2008 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for W3C's range specification.
+ * This file depends on w3c_dom2.js.
+ * The whole file has been fully type annotated.
+ * Created from
+ * http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html
+ *
+ * @externs
+ * @author stevey@google.com (Steve Yegge)
+ */
+
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-Interface
+ */
+function Range() {}
+
+/**
+ * @type {Node}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-attr-startParent
+ */
+Range.prototype.startContainer;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-attr-startOffset
+ */
+Range.prototype.startOffset;
+
+/**
+ * @type {Node}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-attr-endParent
+ */
+Range.prototype.endContainer;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-attr-endOffset
+ */
+Range.prototype.endOffset;
+
+/**
+ * @type {boolean}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-attr-collapsed
+ */
+Range.prototype.collapsed;
+
+/**
+ * @type {Node}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-attr-commonParent
+ */
+Range.prototype.commonAncestorContainer;
+
+/**
+ * @param {Node} refNode
+ * @param {number} offset
+ * @return {undefined}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-setStart
+ */
+Range.prototype.setStart = function(refNode, offset) {};
+
+/**
+ * @param {Node} refNode
+ * @param {number} offset
+ * @return {undefined}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-setEnd
+ */
+Range.prototype.setEnd = function(refNode, offset) {};
+
+/**
+ * @param {Node} refNode
+ * @return {undefined}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-setStartBefore
+ */
+Range.prototype.setStartBefore = function(refNode) {};
+
+/**
+ * @param {Node} refNode
+ * @return {undefined}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-setStartAfter
+ */
+Range.prototype.setStartAfter = function(refNode) {};
+
+/**
+ * @param {Node} refNode
+ * @return {undefined}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-setEndBefore
+ */
+Range.prototype.setEndBefore = function(refNode) {};
+
+/**
+ * @param {Node} refNode
+ * @return {undefined}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-setEndAfter
+ */
+Range.prototype.setEndAfter = function(refNode) {};
+
+/**
+ * @param {boolean} toStart
+ * @return {undefined}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-collapse
+ */
+Range.prototype.collapse = function(toStart) {};
+
+/**
+ * @param {Node} refNode
+ * @return {undefined}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-selectNode
+ */
+Range.prototype.selectNode = function(refNode) {};
+
+/**
+ * @param {Node} refNode
+ * @return {undefined}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-selectNodeContents
+ */
+Range.prototype.selectNodeContents = function(refNode) {};
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-compareHow
+ */
+Range.prototype.START_TO_START = 0;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-compareHow
+ */
+Range.prototype.START_TO_END = 1;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-compareHow
+ */
+Range.prototype.END_TO_END = 2;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-compareHow
+ */
+Range.prototype.END_TO_START = 3;
+
+/**
+ * @param {number} how
+ * @param {Range} sourceRange
+ * @return {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-compareBoundaryPoints
+ */
+Range.prototype.compareBoundaryPoints = function(how, sourceRange) {};
+
+/**
+ * @return {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-deleteContents
+ */
+Range.prototype.deleteContents = function() {};
+
+/**
+ * @return {DocumentFragment}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-extractContents
+ */
+Range.prototype.extractContents = function() {};
+
+/**
+ * @return {DocumentFragment}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-cloneContents
+ */
+Range.prototype.cloneContents = function() {};
+
+/**
+ * @param {Node} newNode
+ * @return {DocumentFragment}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-insertNode
+ */
+Range.prototype.insertNode = function(newNode) {};
+
+/**
+ * @param {Node} newParent
+ * @return {undefined}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-surroundContents
+ */
+Range.prototype.surroundContents = function(newParent) {};
+
+/**
+ * @return {Range}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-clone
+ */
+Range.prototype.cloneRange = function() {};
+
+/**
+ * @return {undefined}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-detach
+ */
+Range.prototype.detach = function() {};
+
+// Introduced in DOM Level 2:
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-DocumentRange-idl
+ */
+function DocumentRange() {}
+
+/**
+ * @return {Range}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-DocumentRange-method-createRange
+ */
+DocumentRange.prototype.createRange = function() {};
+
+// Introduced in DOM Level 2:
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#RangeException
+ */
+function RangeException() {}
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#RangeExceptionCode
+ */
+RangeException.prototype.code;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#RangeExceptionCode
+ */
+RangeException.prototype.BAD_BOUNDARYPOINTS_ERR = 1;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#RangeExceptionCode
+ */
+RangeException.prototype.INVALID_NODE_TYPE_ERR = 2;
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_rtc.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_rtc.js
new file mode 100644
index 0000000000..f10971f910
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_rtc.js
@@ -0,0 +1,1002 @@
+/*
+ * Copyright 2012 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for components of the WebRTC browser API.
+ * @see http://dev.w3.org/2011/webrtc/editor/webrtc.html
+ * @see http://tools.ietf.org/html/draft-ietf-rtcweb-jsep-01
+ * @see http://www.w3.org/TR/mediacapture-streams/
+ *
+ * @externs
+ * @author bemasc@google.com (Benjamin M. Schwartz)
+ */
+
+/**
+ * @typedef {string}
+ * @see {http://dev.w3.org/2011/webrtc/editor/getusermedia.html
+ * #idl-def-MediaStreamTrackState}
+ * In WebIDL this is an enum with values 'live', 'mute', and 'ended',
+ * but there is no mechanism in Closure for describing a specialization of
+ * the string type.
+ */
+var MediaStreamTrackState;
+
+/**
+ * @interface
+ */
+function SourceInfo() {}
+
+/** @const {string} */
+SourceInfo.prototype.kind;
+
+/** @const {string} */
+SourceInfo.prototype.id;
+
+/** @const {?string} */
+SourceInfo.prototype.label;
+
+/** @const {boolean} */
+SourceInfo.prototype.facing;
+
+/**
+ * @interface
+ * @see http://www.w3.org/TR/mediacapture-streams/#mediastreamtrack
+ */
+function MediaStreamTrack() {}
+
+/**
+ * @param {!function(!Array.<!SourceInfo>)} callback
+ */
+MediaStreamTrack.getSources = function(callback) {};
+
+/**
+ * @type {string}
+ * @const
+ */
+MediaStreamTrack.prototype.kind;
+
+/**
+ * @type {string}
+ * @const
+ */
+MediaStreamTrack.prototype.id;
+
+/**
+ * @type {string}
+ * @const
+ */
+MediaStreamTrack.prototype.label;
+
+/**
+ * @type {boolean}
+ */
+MediaStreamTrack.prototype.enabled;
+
+/**
+ * @type {MediaStreamTrackState}
+ * Read only.
+ */
+MediaStreamTrack.prototype.readyState;
+
+/**
+ * @type {?function(!Event)}
+ */
+MediaStreamTrack.prototype.onmute;
+
+/**
+ * @type {?function(!Event)}
+ */
+MediaStreamTrack.prototype.onunmute;
+
+/**
+ * @type {?function(!Event)}
+ */
+MediaStreamTrack.prototype.onended;
+
+/**
+ * @return {!MediaStreamTrack}
+ */
+MediaStreamTrack.prototype.clone = function() {};
+
+/** @return {void} */
+MediaStreamTrack.prototype.stop = function() {};
+
+/**
+ * @constructor
+ * @extends {Event}
+ * @private
+ * @see http://dev.w3.org/2011/webrtc/editor/
+ * webrtc-20120720.html#mediastreamtrackevent
+ * TODO(bemasc): Update this link to the final definition once one exists
+ * (https://www.w3.org/Bugs/Public/show_bug.cgi?id=19568)
+ */
+function MediaStreamTrackEvent() {}
+
+/**
+ * @type {!MediaStreamTrack}
+ * @const
+ */
+MediaStreamTrackEvent.prototype.track;
+
+/**
+ * @param {!MediaStream|!Array.<!MediaStreamTrack>=} streamOrTracks
+ * @constructor
+ * @implements {EventTarget}
+ * @see http://www.w3.org/TR/mediacapture-streams/#mediastream
+ */
+function MediaStream(streamOrTracks) {}
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+MediaStream.prototype.addEventListener = function(type, listener,
+ opt_useCapture) {};
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+MediaStream.prototype.removeEventListener = function(type, listener,
+ opt_useCapture) {};
+
+/** @override */
+MediaStream.prototype.dispatchEvent = function(evt) {};
+
+/**
+ * TODO(bemasc): Remove this property.
+ * @deprecated
+ * @type {string}
+ * @const
+ */
+MediaStream.prototype.label;
+
+/**
+ * @type {string}
+ * @const
+ */
+MediaStream.prototype.id;
+
+/**
+ * @return {!Array.<!MediaStreamTrack>}
+ */
+MediaStream.prototype.getAudioTracks = function() {};
+
+/**
+ * @return {!Array.<!MediaStreamTrack>}
+ */
+MediaStream.prototype.getVideoTracks = function() {};
+
+/**
+ * @param {string} trackId
+ * @return {MediaStreamTrack}
+ */
+MediaStream.prototype.getTrackById = function(trackId) {};
+
+/**
+ * @param {!MediaStreamTrack} track
+ */
+MediaStream.prototype.addTrack = function(track) {};
+
+/**
+ * @param {!MediaStreamTrack} track
+ */
+MediaStream.prototype.removeTrack = function(track) {};
+
+/**
+ * @type {boolean}
+ */
+MediaStream.prototype.ended;
+
+/**
+ * @type {?function(!Event)}
+ */
+MediaStream.prototype.onended;
+
+/**
+ * @type {?function(!MediaStreamTrackEvent)}
+ */
+MediaStream.prototype.onaddtrack;
+
+/**
+ * @type {?function(!MediaStreamTrackEvent)}
+ */
+MediaStream.prototype.onremovetrack;
+
+/**
+ * @deprecated
+ * TODO(bemasc): Remove this method once browsers have updated to
+ * MediaStreamTrack.stop().
+ */
+MediaStream.prototype.stop = function() {};
+
+/**
+ * @type {function(new: MediaStream,
+ * (!MediaStream|!Array.<!MediaStreamTrack>)=)}
+ */
+var webkitMediaStream;
+
+/**
+ * This interface defines the available constraint attributes. These are the
+ * attributes defined in
+ * {@see http://tools.ietf.org/html/draft-alvestrand-constraints-resolution-01}.
+ * Note that although that draft refers to "Media Constraints", the W3C uses
+ * the terms "Media[Stream|Track]Constraints" for this type, and
+ * defines a different type (for RTCPeerConnection) called "MediaConstraints".
+ *
+ * This interface type is not part of any standard, so it is marked as private.
+ * It is defined here in order to reserve the property names, which would
+ * otherwise be rewritten when the compiler processes an object literal.
+ * Several subsequent interfaces are defined in the same pattern.
+ *
+ * Note that although this list includes all the properties supported by
+ * libjingle (and hence by Chromium), browsers are permitted to offer other
+ * properties as well ({
+ * @see http://tools.ietf.org/html/draft-burnett-rtcweb-constraints-registry-02
+ * }), and browsers are expected to silently ignore unknown properties. This
+ * creates the potential for a very confusing situation in which properties
+ * not listed here are renamed by the compiler and then ignored by the browser.
+ *
+ * @interface
+ * @private
+ */
+function MediaTrackConstraintSetInterface_() {}
+
+/**
+ * @type {?number}
+ */
+MediaTrackConstraintSetInterface_.prototype.minWidth;
+
+/**
+ * @type {?number}
+ */
+MediaTrackConstraintSetInterface_.prototype.maxWidth;
+
+/**
+ * @type {?number}
+ */
+MediaTrackConstraintSetInterface_.prototype.minHeight;
+
+/**
+ * @type {?number}
+ */
+MediaTrackConstraintSetInterface_.prototype.maxHeight;
+
+/**
+ * @type {?number}
+ */
+MediaTrackConstraintSetInterface_.prototype.minAspectRatio;
+
+/**
+ * @type {?number}
+ */
+MediaTrackConstraintSetInterface_.prototype.maxAspectRatio;
+
+/**
+ * Due to a typo, this is called "minFramerate" in the -01 draft.
+ * @type {?number}
+ */
+MediaTrackConstraintSetInterface_.prototype.minFrameRate;
+
+/**
+ * @type {?number}
+ */
+MediaTrackConstraintSetInterface_.prototype.maxFrameRate;
+
+/**
+ * This type and two more below are defined as unions with Object because they
+ * are normally used as record types by constructing an Object literal, but all
+ * of their properties are optional.
+ * @typedef {Object|MediaTrackConstraintSetInterface_}
+ */
+var MediaTrackConstraintSet;
+
+/**
+ * @interface
+ * @private
+ */
+function MediaTrackConstraintsInterface_() {}
+
+/**
+ * @type {?MediaTrackConstraintSet}
+ */
+MediaTrackConstraintsInterface_.prototype.mandatory;
+
+/**
+ * @type {?Array.<!MediaTrackConstraintSet>}
+ */
+MediaTrackConstraintsInterface_.prototype.optional;
+
+/**
+ * @typedef {Object|MediaTrackConstraintsInterface_}
+ */
+var MediaTrackConstraints;
+
+/**
+ * @interface
+ * @private
+ */
+function MediaStreamConstraintsInterface_() {}
+
+/**
+ * @type {boolean|MediaTrackConstraints}
+ */
+MediaStreamConstraintsInterface_.prototype.audio;
+
+/**
+ * @type {boolean|MediaTrackConstraints}
+ */
+MediaStreamConstraintsInterface_.prototype.video;
+
+/**
+ * @typedef {Object|MediaStreamConstraintsInterface_}
+ */
+var MediaStreamConstraints;
+
+/**
+ * @see {http://dev.w3.org/2011/webrtc/editor/getusermedia.html#
+ * navigatorusermediaerror-and-navigatorusermediaerrorcallback}
+ * @interface
+ */
+function NavigatorUserMediaError() {}
+
+/**
+ * @type {number}
+ * @deprecated Removed from the standard and some browsers.
+ * @const
+ */
+NavigatorUserMediaError.prototype.PERMISSION_DENIED; /** 1 */
+
+/**
+ * @type {number}
+ * @deprecated Removed from the standard and some browsers.
+ * Read only.
+ */
+NavigatorUserMediaError.prototype.code;
+
+/**
+ * @type {string}
+ * Read only.
+ */
+NavigatorUserMediaError.prototype.name;
+
+/**
+ * @type {?string}
+ * Read only.
+ */
+NavigatorUserMediaError.prototype.message;
+
+/**
+ * @type {?string}
+ * Read only.
+ */
+NavigatorUserMediaError.prototype.constraintName;
+
+/**
+ * @param {MediaStreamConstraints} constraints A MediaStreamConstraints object.
+ * @param {function(!MediaStream)} successCallback
+ * A NavigatorUserMediaSuccessCallback function.
+ * @param {function(!NavigatorUserMediaError)=} errorCallback A
+ * NavigatorUserMediaErrorCallback function.
+ * @see http://dev.w3.org/2011/webrtc/editor/getusermedia.html
+ * @see http://www.w3.org/TR/mediacapture-streams/
+ */
+Navigator.prototype.webkitGetUserMedia =
+ function(constraints, successCallback, errorCallback) {};
+
+/**
+ * @param {string} type
+ * @param {!Object} eventInitDict
+ * @constructor
+ */
+function MediaStreamEvent(type, eventInitDict) {}
+
+/**
+ * @type {?MediaStream}
+ * @const
+ */
+MediaStreamEvent.prototype.stream;
+
+/**
+ * @typedef {string}
+ * @see http://www.w3.org/TR/webrtc/#rtcsdptype
+ * In WebIDL this is an enum with values 'offer', 'pranswer', and 'answer',
+ * but there is no mechanism in Closure for describing a specialization of
+ * the string type.
+ */
+var RTCSdpType;
+
+/**
+ * @param {!Object=} descriptionInitDict The RTCSessionDescriptionInit
+ * dictionary. This optional argument may have type
+ * {type:RTCSdpType, sdp:string}, but neither of these keys are required to be
+ * present, and other keys are ignored, so the closest Closure type is Object.
+ * @constructor
+ * @see http://dev.w3.org/2011/webrtc/editor/webrtc.html#rtcsessiondescription-class
+ */
+function RTCSessionDescription(descriptionInitDict) {}
+
+/**
+ * @type {?RTCSdpType}
+ * @see http://www.w3.org/TR/webrtc/#widl-RTCSessionDescription-type
+ */
+RTCSessionDescription.prototype.type;
+
+/**
+ * @type {?string}
+ * @see http://www.w3.org/TR/webrtc/#widl-RTCSessionDescription-sdp
+ */
+RTCSessionDescription.prototype.sdp;
+
+/**
+ * TODO(bemasc): Remove this definition once it is removed from the browser.
+ * @param {string} label The label index (audio/video/data -> 0,1,2)
+ * @param {string} sdp The ICE candidate in SDP text form
+ * @constructor
+ */
+function IceCandidate(label, sdp) {}
+
+/**
+ * @return {string}
+ */
+IceCandidate.prototype.toSdp = function() {};
+
+/**
+ * @type {?string}
+ */
+IceCandidate.prototype.label;
+
+/**
+ * @param {!Object=} candidateInitDict The RTCIceCandidateInit dictionary.
+ * This optional argument may have type
+ * {candidate: string, sdpMid: string, sdpMLineIndex:number}, but none of
+ * these keys are required to be present, and other keys are ignored, so the
+ * closest Closure type is Object.
+ * @constructor
+ * @see http://www.w3.org/TR/webrtc/#rtcicecandidate-type
+ */
+function RTCIceCandidate(candidateInitDict) {}
+
+/**
+ * @type {?string}
+ */
+RTCIceCandidate.prototype.candidate;
+
+/**
+ * @type {?string}
+ */
+RTCIceCandidate.prototype.sdpMid;
+
+/**
+ * @type {?number}
+ */
+RTCIceCandidate.prototype.sdpMLineIndex;
+
+/**
+ * @typedef {{url: string}}
+ * @private
+ * @see http://www.w3.org/TR/webrtc/#rtciceserver-type
+ * This dictionary type also has an optional key {credential: ?string}.
+ */
+var RTCIceServerRecord_;
+
+/**
+ * @interface
+ * @private
+ */
+function RTCIceServerInterface_() {}
+
+/**
+ * @type {string}
+ */
+RTCIceServerInterface_.prototype.url;
+
+/**
+ * @type {?string}
+ */
+RTCIceServerInterface_.prototype.credential;
+
+/**
+ * This type, and several below it, are constructed as unions between records
+ *
+ * @typedef {RTCIceServerRecord_|RTCIceServerInterface_}
+ * @private
+ */
+var RTCIceServer;
+
+/**
+ * @typedef {{iceServers: !Array.<!RTCIceServer>}}
+ * @private
+ */
+var RTCConfigurationRecord_;
+
+/**
+ * @interface
+ * @private
+ */
+function RTCConfigurationInterface_() {}
+
+/**
+ * @type {!Array.<!RTCIceServer>}
+ */
+RTCConfigurationInterface_.prototype.iceServers;
+
+/**
+ * @typedef {RTCConfigurationRecord_|RTCConfigurationInterface_}
+ */
+var RTCConfiguration;
+
+/**
+ * @typedef {function(!RTCSessionDescription)}
+ */
+var RTCSessionDescriptionCallback;
+
+/**
+ * @typedef {function(string)}
+ */
+var RTCPeerConnectionErrorCallback;
+
+/**
+ * @typedef {function()}
+ */
+var RTCVoidCallback;
+
+/**
+ * @typedef {string}
+ */
+var RTCSignalingState;
+
+/**
+ * @typedef {string}
+ */
+var RTCIceConnectionState;
+
+/**
+ * @typedef {string}
+ */
+var RTCIceGatheringState;
+
+/**
+ * @param {string} type
+ * @param {!Object} eventInitDict
+ * @constructor
+ */
+function RTCPeerConnectionIceEvent(type, eventInitDict) {}
+
+/**
+ * @type {RTCIceCandidate}
+ * @const
+ */
+RTCPeerConnectionIceEvent.prototype.candidate;
+
+// Note: The specification of RTCStats types is still under development.
+// Declarations here will be updated and removed to follow the development of
+// modern browsers, breaking compatibility with older versions as they become
+// obsolete.
+/**
+ * @interface
+ */
+function RTCStatsReport() {}
+
+/**
+ * @type {Date}
+ * @const
+ */
+RTCStatsReport.prototype.timestamp;
+
+/**
+ * @return {!Array.<!string>}
+ */
+RTCStatsReport.prototype.names = function() {};
+
+/**
+ * @param {string} name
+ * @return {string}
+ */
+RTCStatsReport.prototype.stat = function(name) {};
+
+/**
+ * @deprecated
+ * @type {RTCStatsReport}
+ * @const
+ */
+RTCStatsReport.prototype.local;
+
+/**
+ * @deprecated
+ * @type {RTCStatsReport}
+ * @const
+ */
+RTCStatsReport.prototype.remote;
+
+/**
+ * @type {string}
+ * @const
+ */
+RTCStatsReport.prototype.type;
+
+/**
+ * @type {string}
+ * @const
+ */
+RTCStatsReport.prototype.id;
+
+/**
+ * TODO(bemasc): Remove this type once it is no longer in use. It has already
+ * been removed from the specification.
+ * @typedef {RTCStatsReport}
+ * @deprecated
+ */
+var RTCStatsElement;
+
+/**
+ * @interface
+ */
+function RTCStatsResponse() {}
+
+/**
+ * @return {!Array.<!RTCStatsReport>}
+ */
+RTCStatsResponse.prototype.result = function() {};
+
+/**
+ * @typedef {function(!RTCStatsResponse, MediaStreamTrack=)}
+ */
+var RTCStatsCallback;
+
+/**
+ * This type is not yet standardized, so the properties here only represent
+ * the current capabilities of libjingle (and hence Chromium).
+ * TODO(bemasc): Add a link to the relevant standard once MediaConstraint has a
+ * standard definition.
+ *
+ * @interface
+ * @private
+ */
+function MediaConstraintSetInterface_() {}
+
+/**
+ * @type {?boolean}
+ */
+MediaConstraintSetInterface_.prototype.OfferToReceiveAudio;
+
+/**
+ * @type {?boolean}
+ */
+MediaConstraintSetInterface_.prototype.OfferToReceiveVideo;
+
+/**
+ * @type {?boolean}
+ */
+MediaConstraintSetInterface_.prototype.DtlsSrtpKeyAgreement;
+
+/**
+ * @type {?boolean}
+ */
+MediaConstraintSetInterface_.prototype.RtpDataChannels;
+
+/**
+ * TODO(bemasc): Make this type public once it is defined in a standard.
+ *
+ * @typedef {Object|MediaConstraintSetInterface_}
+ * @private
+ */
+var MediaConstraintSet_;
+
+/**
+ * @interface
+ * @private
+ */
+function MediaConstraintsInterface_() {}
+
+/**
+ * @type {?MediaConstraintSet_}
+ */
+MediaConstraintsInterface_.prototype.mandatory;
+
+/**
+ * @type {?Array.<!MediaConstraintSet_>}
+ */
+MediaConstraintsInterface_.prototype.optional;
+
+/**
+ * This type is used extensively in
+ * {@see http://dev.w3.org/2011/webrtc/editor/webrtc.html} but is not yet
+ * defined.
+ *
+ * @typedef {Object|MediaConstraintsInterface_}
+ */
+var MediaConstraints;
+
+/**
+ * @interface
+ */
+function RTCDataChannel() {}
+
+/**
+ * @type {string}
+ * @const
+ */
+RTCDataChannel.prototype.label;
+
+/**
+ * @type {boolean}
+ * @const
+ */
+RTCDataChannel.prototype.reliable;
+
+/**
+ * An enumerated string type (RTCDataChannelState) with values:
+ * "connecting", "open", "closing", and "closed".
+ * @type {string}
+ * Read only.
+ */
+RTCDataChannel.prototype.readyState;
+
+/**
+ * @type {number}
+ * Read only.
+ */
+RTCDataChannel.prototype.bufferedAmount;
+
+/**
+ * @type {?function(!Event)}
+ */
+RTCDataChannel.prototype.onopen;
+
+/**
+ * @type {?function(!Event)}
+ */
+RTCDataChannel.prototype.onerror;
+
+/**
+ * @type {?function(!Event)}
+ */
+RTCDataChannel.prototype.onclose;
+
+RTCDataChannel.prototype.close = function() {};
+
+/**
+ * @type {?function(!MessageEvent.<*>)}
+ */
+RTCDataChannel.prototype.onmessage;
+
+/**
+ * @type {string}
+ */
+RTCDataChannel.prototype.binaryType;
+
+/**
+ * @param {string|!Blob|!ArrayBuffer|!ArrayBufferView} data
+ */
+RTCDataChannel.prototype.send = function(data) {};
+
+/**
+ * @constructor
+ * @extends {Event}
+ * @private
+ */
+function RTCDataChannelEvent() {}
+
+/**
+ * @type {!RTCDataChannel}
+ * Read only.
+ */
+RTCDataChannelEvent.prototype.channel;
+
+/**
+ * @typedef {{reliable: boolean}}
+ */
+var RTCDataChannelInitRecord_;
+
+/**
+ * @interface
+ * @private
+ */
+function RTCDataChannelInitInterface_() {}
+
+/**
+ * @type {boolean}
+ */
+RTCDataChannelInitInterface_.prototype.reliable;
+
+/**
+ * @typedef {RTCDataChannelInitInterface_|RTCDataChannelInitRecord_}
+ */
+var RTCDataChannelInit;
+
+/**
+ * @param {RTCConfiguration} configuration
+ * @param {!MediaConstraints=} constraints
+ * @constructor
+ * @implements {EventTarget}
+ */
+function RTCPeerConnection(configuration, constraints) {}
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+RTCPeerConnection.prototype.addEventListener = function(
+ type, listener, opt_useCapture) {};
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+RTCPeerConnection.prototype.removeEventListener = function(
+ type, listener, opt_useCapture) {};
+
+/** @override */
+RTCPeerConnection.prototype.dispatchEvent = function(evt) {};
+
+/**
+ * @param {!RTCSessionDescriptionCallback} successCallback
+ * @param {!RTCPeerConnectionErrorCallback=} failureCallback
+ * @param {!MediaConstraints=} constraints
+ */
+RTCPeerConnection.prototype.createOffer = function(successCallback,
+ failureCallback, constraints) {};
+
+/**
+ * @param {RTCSessionDescriptionCallback} successCallback
+ * @param {?RTCPeerConnectionErrorCallback=} failureCallback
+ * @param {!MediaConstraints=} constraints
+ */
+RTCPeerConnection.prototype.createAnswer = function(successCallback,
+ failureCallback, constraints) {};
+
+/**
+ * @param {!RTCSessionDescription} description
+ * @param {!RTCVoidCallback=} successCallback
+ * @param {!RTCPeerConnectionErrorCallback=} failureCallback
+ */
+RTCPeerConnection.prototype.setLocalDescription = function(description,
+ successCallback, failureCallback) {};
+
+/**
+ * @param {!RTCSessionDescription} description
+ * @param {!RTCVoidCallback=} successCallback
+ * @param {!RTCPeerConnectionErrorCallback=} failureCallback
+ */
+RTCPeerConnection.prototype.setRemoteDescription = function(description,
+ successCallback, failureCallback) {};
+
+/**
+ * @type {?RTCSessionDescription}
+ * Read only.
+ */
+RTCPeerConnection.prototype.localDescription;
+
+/**
+ * @type {?RTCSessionDescription}
+ * Read only.
+ */
+RTCPeerConnection.prototype.remoteDescription;
+
+/**
+ * @type {RTCSignalingState}
+ * Read only.
+ */
+RTCPeerConnection.prototype.signalingState;
+
+/**
+ * @param {?RTCConfiguration=} configuration
+ * @param {?MediaConstraints=} constraints
+ */
+RTCPeerConnection.prototype.updateIce = function(configuration, constraints) {};
+
+/**
+ * @param {!RTCIceCandidate} candidate
+ */
+RTCPeerConnection.prototype.addIceCandidate = function(candidate) {};
+
+/**
+ * @type {!RTCIceGatheringState}
+ * Read only.
+ */
+RTCPeerConnection.prototype.iceGatheringState;
+
+/**
+ * @type {!RTCIceConnectionState}
+ * Read only.
+ */
+RTCPeerConnection.prototype.iceConnectionState;
+
+/**
+ * @return {!Array.<!MediaStream>}
+ */
+RTCPeerConnection.prototype.getLocalStreams = function() {};
+
+/**
+ * @return {!Array.<!MediaStream>}
+ */
+RTCPeerConnection.prototype.getRemoteStreams = function() {};
+
+/**
+ * @param {string} streamId
+ * @return {MediaStream}
+ */
+RTCPeerConnection.prototype.getStreamById = function(streamId) {};
+
+/**
+ * @param {?string} label
+ * @param {RTCDataChannelInit=} dataChannelDict
+ * @return {!RTCDataChannel}
+ */
+RTCPeerConnection.prototype.createDataChannel =
+ function(label, dataChannelDict) {};
+/**
+ * @param {!MediaStream} stream
+ * @param {!MediaConstraints=} constraints
+ */
+RTCPeerConnection.prototype.addStream = function(stream, constraints) {};
+
+/**
+ * @param {!MediaStream} stream
+ */
+RTCPeerConnection.prototype.removeStream = function(stream) {};
+
+// TODO(bemasc): Add identity provider stuff once implementations exist
+
+/**
+ * @param {!RTCStatsCallback} successCallback
+ * @param {MediaStreamTrack=} selector
+ */
+RTCPeerConnection.prototype.getStats = function(successCallback, selector) {};
+
+RTCPeerConnection.prototype.close = function() {};
+
+/**
+ * @type {?function(!Event)}
+ */
+RTCPeerConnection.prototype.onnegotiationneeded;
+
+/**
+ * @type {?function(!RTCPeerConnectionIceEvent)}
+ */
+RTCPeerConnection.prototype.onicecandidate;
+
+/**
+ * @type {?function(!Event)}
+ */
+RTCPeerConnection.prototype.onsignalingstatechange;
+
+/**
+ * @type {?function(!MediaStreamEvent)}
+ */
+RTCPeerConnection.prototype.onaddstream;
+
+/**
+ * @type {?function(!MediaStreamEvent)}
+ */
+RTCPeerConnection.prototype.onremovestream;
+
+/**
+ * @type {?function(!Event)}
+ */
+RTCPeerConnection.prototype.oniceconnectionstatechange;
+
+/**
+ * @type {?function(!RTCDataChannelEvent)}
+ */
+RTCPeerConnection.prototype.ondatachannel;
+
+/**
+ * @type {function(new: RTCPeerConnection, RTCConfiguration,
+ * !MediaConstraints=)}
+ */
+var webkitRTCPeerConnection;
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_selectors.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_selectors.js
new file mode 100644
index 0000000000..546dec9ce0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_selectors.js
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2008 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for W3C's Selectors API.
+ * This file depends on w3c_dom1.js.
+ * @see http://www.w3.org/TR/selectors-api2/
+ *
+ * @externs
+ */
+
+/**
+ * @param {string} selectors
+ * @return {Element}
+ * @override
+ */
+Document.prototype.querySelector = function(selectors) {};
+
+/**
+ * @param {string} selectors
+ * @return {!NodeList}
+ * @override
+ */
+Document.prototype.querySelectorAll = function(selectors) {};
+
+/**
+ * @param {string} selectors
+ * @return {Element}
+ * @override
+ */
+Element.prototype.querySelector = function(selectors) {};
+
+/**
+ * @param {string} selectors
+ * @return {!NodeList}
+ * @override
+ */
+Element.prototype.querySelectorAll = function(selectors) {};
+
+/**
+ * https://dom.spec.whatwg.org/#dom-element-matches
+ * https://developer.mozilla.org/en-US/docs/Web/API/Element.matches
+ * @param {string} selectors
+ * @return {boolean}
+ */
+Element.prototype.matches = function(selectors) {};
+
+/**
+ * @param {string} selectors
+ * @param {(Node|NodeList)=} refNodes
+ * @return {boolean}
+ */
+Element.prototype.matchesSelector = function(selectors, refNodes) {};
+
+/**
+ * @see https://developer.mozilla.org/en/DOM/Node.mozMatchesSelector
+ * @param {string} selectors
+ * @return {boolean}
+ */
+Element.prototype.mozMatchesSelector = function(selectors) {};
+
+/**
+ * @see http://developer.apple.com/library/safari/documentation/WebKit/Reference/ElementClassRef/Element/Element.html
+ * @param {string} selectors
+ * @return {boolean}
+ */
+Element.prototype.webkitMatchesSelector = function(selectors) {};
+
+/**
+ * @see http://msdn.microsoft.com/en-us/library/ff975201.aspx
+ * @param {string} selectors
+ * @return {boolean}
+ */
+Element.prototype.msMatchesSelector = function(selectors) {};
+
+/**
+ * @see http://www.opera.com/docs/changelogs/windows/1150/
+ * @param {string} selectors
+ * @return {boolean}
+ */
+Element.prototype.oMatchesSelector = function(selectors) {};
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_xml.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_xml.js
new file mode 100644
index 0000000000..7dadd24268
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/w3c_xml.js
@@ -0,0 +1,417 @@
+/*
+ * Copyright 2008 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for W3C's XML related specifications.
+ * This file depends on w3c_dom2.js.
+ * The whole file has been fully type annotated.
+ *
+ * Provides the XML standards from W3C.
+ * Includes:
+ * XPath - Fully type annotated
+ * XMLHttpRequest - Fully type annotated
+ *
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html
+ * @see http://www.w3.org/TR/XMLHttpRequest/
+ * @see http://www.w3.org/TR/XMLHttpRequest2/
+ *
+ * @externs
+ * @author stevey@google.com (Steve Yegge)
+ */
+
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathException
+ */
+function XPathException() {}
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#INVALID_EXPRESSION_ERR
+ */
+XPathException.INVALID_EXPRESSION_ERR = 52;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#TYPE_ERR
+ */
+XPathException.TYPE_ERR = 52;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#
+ */
+XPathException.prototype.code;
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator
+ */
+function XPathEvaluator() {}
+
+/**
+ * @param {string} expr
+ * @param {?XPathNSResolver=} opt_resolver
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator-createExpression
+ * @throws XPathException
+ * @throws DOMException
+ */
+XPathEvaluator.prototype.createExpression = function(expr, opt_resolver) {};
+
+/**
+ * @param {Node} nodeResolver
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator-createNSResolver
+ */
+XPathEvaluator.prototype.createNSResolver = function(nodeResolver) {};
+
+/**
+ * @param {string} expr
+ * @param {Node} contextNode
+ * @param {?XPathNSResolver=} opt_resolver
+ * @param {?number=} opt_type
+ * @param {*=} opt_result
+ * @return {XPathResult}
+ * @throws XPathException
+ * @throws DOMException
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator-evaluate
+ */
+XPathEvaluator.prototype.evaluate = function(expr, contextNode, opt_resolver,
+ opt_type, opt_result) {};
+
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathExpression
+ */
+function XPathExpression() {}
+
+/**
+ * @param {Node} contextNode
+ * @param {number=} opt_type
+ * @param {*=} opt_result
+ * @return {*}
+ * @throws XPathException
+ * @throws DOMException
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathExpression-evaluate
+ */
+XPathExpression.prototype.evaluate = function(contextNode, opt_type,
+ opt_result) {};
+
+
+/**
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathNSResolver
+ */
+function XPathNSResolver() {}
+
+/**
+ * @param {string} prefix
+ * @return {?string}
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathNSResolver-lookupNamespaceURI
+ */
+XPathNSResolver.prototype.lookupNamespaceURI = function(prefix) {};
+
+/**
+ * From http://www.w3.org/TR/xpath
+ *
+ * XPath is a language for addressing parts of an XML document, designed to be
+ * used by both XSLT and XPointer.
+ *
+ * @noalias
+ * @constructor
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult
+ */
+function XPathResult() {}
+
+/**
+ * @type {boolean} {@see XPathException.TYPE_ERR}
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-booleanValue
+ */
+XPathResult.prototype.booleanValue;
+
+/**
+ * @type {boolean} {@see XPathException.TYPE_ERR}
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-invalid-iterator-state
+ */
+XPathResult.prototype.invalidInteratorState;
+
+/**
+ * @type {number}
+ * @throws XPathException {@see XPathException.TYPE_ERR}
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-numberValue
+ */
+XPathResult.prototype.numberValue;
+
+/**
+ * @type {number}
+ * @throws XPathException {@see XPathException.TYPE_ERR}
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-resultType
+ */
+XPathResult.prototype.resultType;
+
+/**
+ * @type {Node}
+ * @throws XPathException {@see XPathException.TYPE_ERR}
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-singleNodeValue
+ */
+XPathResult.prototype.singleNodeValue;
+
+/**
+ * @type {number}
+ * @throws XPathException {@see XPathException.TYPE_ERR}
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-snapshot-length
+ */
+XPathResult.prototype.snapshotLength;
+
+/**
+ * @type {string}
+ * @throws XPathException {@see XPathException.TYPE_ERR}
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-stringValue
+ */
+XPathResult.prototype.stringValue;
+
+/**
+ * @return {Node}
+ * @throws XPathException {@see XPathException.TYPE_ERR}
+ * @throws DOMException {@see DOMException.INVALID_STATE_ERR}
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-iterateNext
+ */
+XPathResult.prototype.iterateNext = function() {};
+
+/**
+ * @param {number} index
+ * @return {Node}
+ * @throws XPathException
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-snapshotItem
+ */
+XPathResult.prototype.snapshotItem = function(index) {};
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-ANY-TYPE
+ */
+XPathResult.ANY_TYPE = 0;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-NUMBER-TYPE
+ */
+XPathResult.NUMBER_TYPE = 1;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-STRING-TYPE
+ */
+XPathResult.STRING_TYPE = 2;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-BOOLEAN-TYPE
+ */
+XPathResult.BOOLEAN_TYPE = 3;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-UNORDERED-NODE-ITERATOR-TYPE
+ */
+XPathResult.UNORDERED_NODE_ITERATOR_TYPE = 4;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-ORDERED-NODE-ITERATOR-TYPE
+ */
+XPathResult.ORDERED_NODE_ITERATOR_TYPE = 5;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-UNORDERED-NODE-SNAPSHOT-TYPE
+ */
+XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE = 6;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-ORDERED-NODE-SNAPSHOT-TYPE
+ */
+XPathResult.ORDERED_NODE_SNAPSHOT_TYPE = 7;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-ANY-UNORDERED-NODE-TYPE
+ */
+XPathResult.ANY_UNORDERED_NODE_TYPE = 8;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-FIRST-ORDERED-NODE-TYPE
+ */
+XPathResult.FIRST_ORDERED_NODE_TYPE = 9;
+
+/**
+ * @constructor
+ * @extends {Node}
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathNamespace
+ */
+function XPathNamespace() {}
+
+/**
+ * @type {Element}
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathNamespace-ownerElement
+ */
+XPathNamespace.prototype.ownerElement;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPATH_NAMESPACE_NODE
+ */
+XPathNamespace.XPATH_NAMESPACE_NODE = 13;
+
+/**
+ * From http://www.w3.org/TR/XMLHttpRequest/
+ *
+ * (Draft)
+ *
+ * The XMLHttpRequest Object specification defines an API that provides
+ * scripted client functionality for transferring data between a client and a
+ * server.
+ *
+ * @constructor
+ * @implements {EventTarget}
+ * @see http://www.w3.org/TR/XMLHttpRequest/#xmlhttprequest-object
+ */
+function XMLHttpRequest() {}
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+XMLHttpRequest.prototype.addEventListener =
+ function(type, listener, opt_useCapture) {};
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+XMLHttpRequest.prototype.removeEventListener =
+ function(type, listener, opt_useCapture) {};
+
+/** @override */
+XMLHttpRequest.prototype.dispatchEvent = function(evt) {};
+
+/**
+ * @param {string} method
+ * @param {string} url
+ * @param {?boolean=} opt_async
+ * @param {?string=} opt_user
+ * @param {?string=} opt_password
+ * @return {undefined}
+ * @see http://www.w3.org/TR/XMLHttpRequest/#the-open()-method
+ */
+XMLHttpRequest.prototype.open = function(method, url, opt_async, opt_user,
+ opt_password) {};
+
+/**
+ * @param {string} header
+ * @param {string} value
+ * @return {undefined}
+ * @see http://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader()-method
+ */
+XMLHttpRequest.prototype.setRequestHeader = function(header, value) {};
+
+/**
+ * @param {ArrayBuffer|ArrayBufferView|Blob|Document|FormData|string=} opt_data
+ * @return {undefined}
+ * @see http://www.w3.org/TR/XMLHttpRequest/#the-send()-method
+ */
+XMLHttpRequest.prototype.send = function(opt_data) {};
+
+/**
+ * @return {undefined}
+ * @see http://www.w3.org/TR/XMLHttpRequest/#the-abort()-method
+ */
+XMLHttpRequest.prototype.abort = function() {};
+
+/**
+ * @return {string}
+ * @see http://www.w3.org/TR/XMLHttpRequest/#the-getallresponseheaders()-method
+ */
+XMLHttpRequest.prototype.getAllResponseHeaders = function() {};
+
+/**
+ * @param {string} header
+ * @return {string}
+ * @see http://www.w3.org/TR/XMLHttpRequest/#the-getresponseheader()-method
+ */
+XMLHttpRequest.prototype.getResponseHeader = function(header) {};
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/XMLHttpRequest/#the-responsetext-attribute
+ */
+XMLHttpRequest.prototype.responseText;
+
+/**
+ * @type {Document}
+ * @see http://www.w3.org/TR/XMLHttpRequest/#the-responsexml-attribute
+ */
+XMLHttpRequest.prototype.responseXML;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/XMLHttpRequest/#the-readystate-attribute
+ */
+XMLHttpRequest.prototype.readyState;
+
+/**
+ * @type {number}
+ * @see http://www.w3.org/TR/XMLHttpRequest/#the-status-attribute
+ */
+XMLHttpRequest.prototype.status;
+
+/**
+ * @type {string}
+ * @see http://www.w3.org/TR/XMLHttpRequest/#the-statustext-attribute
+ */
+XMLHttpRequest.prototype.statusText;
+
+/**
+ * @type {Function}
+ * @see http://www.w3.org/TR/XMLHttpRequest/#handler-xhr-onreadystatechange
+ */
+XMLHttpRequest.prototype.onreadystatechange;
+
+/**
+ * @type {Function}
+ * @see http://www.w3.org/TR/XMLHttpRequest/#handler-xhr-onerror
+ */
+XMLHttpRequest.prototype.onerror;
+
+/**
+ * The FormData object represents an ordered collection of entries. Each entry
+ * has a name and value.
+ *
+ * @param {?Element=} opt_form An optional form to use for constructing the form
+ * data set.
+ * @constructor
+ * @see http://www.w3.org/TR/XMLHttpRequest2/#the-formdata-interface
+ */
+function FormData(opt_form) {}
+
+/**
+ * @param {string} name
+ * @param {Blob|string} value
+ */
+FormData.prototype.append = function(name, value) {};
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_css.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_css.js
new file mode 100644
index 0000000000..60841f8e26
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_css.js
@@ -0,0 +1,456 @@
+/*
+ * Copyright 2008 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for WebKit's custom CSS properties. Copied from:
+ * {@link
+ * http://trac.webkit.org/browser/trunk/Source/WebCore/css/CSSPropertyNames.in}
+ *
+ * If you make changes to this file, notice that every property appears
+ * twice: once as an uppercase name and once as a lowercase name.
+ * WebKit allows both. The uppercase version is preferred.
+ *
+ * @externs
+ * @author nicksantos@google.com (Nick Santos)
+ */
+
+/** @type {string} */ CSSProperties.prototype.WebkitAlignContent;
+/** @type {string} */ CSSProperties.prototype.WebkitAlignItems;
+/** @type {string} */ CSSProperties.prototype.WebkitAlignSelf;
+/** @type {string} */ CSSProperties.prototype.WebkitAnimation;
+/** @type {string} */ CSSProperties.prototype.WebkitAnimationDelay;
+/** @type {string} */ CSSProperties.prototype.WebkitAnimationDirection;
+/** @type {string} */ CSSProperties.prototype.WebkitAnimationDuration;
+/** @type {string} */ CSSProperties.prototype.WebkitAnimationFillMode;
+/** @type {string} */ CSSProperties.prototype.WebkitAnimationIterationCount;
+/** @type {string} */ CSSProperties.prototype.WebkitAnimationName;
+/** @type {string} */ CSSProperties.prototype.WebkitAnimationPlayState;
+/** @type {string} */ CSSProperties.prototype.WebkitAnimationTimingFunction;
+/** @type {string} */ CSSProperties.prototype.WebkitAppearance;
+/** @type {string} */ CSSProperties.prototype.WebkitAppRegion;
+/** @type {string} */ CSSProperties.prototype.WebkitAspectRatio;
+/** @type {string} */ CSSProperties.prototype.WebkitBackfaceVisibility;
+/** @type {string} */ CSSProperties.prototype.WebkitBackgroundClip;
+/** @type {string} */ CSSProperties.prototype.WebkitBackgroundComposite;
+/** @type {string} */ CSSProperties.prototype.WebkitBackgroundOrigin;
+/** @type {string} */ CSSProperties.prototype.WebkitBackgroundSize;
+/** @type {string} */ CSSProperties.prototype.WebkitBinding;
+/** @type {string} */ CSSProperties.prototype.WebkitBlendMode;
+/** @type {string} */ CSSProperties.prototype.WebkitBorderAfter;
+/** @type {string} */ CSSProperties.prototype.WebkitBorderAfterColor;
+/** @type {string} */ CSSProperties.prototype.WebkitBorderAfterStyle;
+/** @type {string} */ CSSProperties.prototype.WebkitBorderAfterWidth;
+/** @type {string} */ CSSProperties.prototype.WebkitBorderBefore;
+/** @type {string} */ CSSProperties.prototype.WebkitBorderBeforeColor;
+/** @type {string} */ CSSProperties.prototype.WebkitBorderBeforeStyle;
+/** @type {string} */ CSSProperties.prototype.WebkitBorderBeforeWidth;
+/** @type {string} */ CSSProperties.prototype.WebkitBorderBottomLeftRadius;
+/** @type {string} */ CSSProperties.prototype.WebkitBorderBottomRightRadius;
+/** @type {string} */ CSSProperties.prototype.WebkitBorderEnd;
+/** @type {string} */ CSSProperties.prototype.WebkitBorderEndColor;
+/** @type {string} */ CSSProperties.prototype.WebkitBorderEndStyle;
+/** @type {string} */ CSSProperties.prototype.WebkitBorderEndWidth;
+/** @type {string} */ CSSProperties.prototype.WebkitBorderFit;
+/** @type {string} */ CSSProperties.prototype.WebkitBorderHorizontalSpacing;
+/** @type {string} */ CSSProperties.prototype.WebkitBorderImage;
+/** @type {string} */ CSSProperties.prototype.WebkitBorderRadius;
+/** @type {string} */ CSSProperties.prototype.WebkitBorderStart;
+/** @type {string} */ CSSProperties.prototype.WebkitBorderStartColor;
+/** @type {string} */ CSSProperties.prototype.WebkitBorderStartStyle;
+/** @type {string} */ CSSProperties.prototype.WebkitBorderStartWidth;
+/** @type {string} */ CSSProperties.prototype.WebkitBorderTopLeftRadius;
+/** @type {string} */ CSSProperties.prototype.WebkitBorderTopRightRadius;
+/** @type {string} */ CSSProperties.prototype.WebkitBorderVerticalSpacing;
+/** @type {string} */ CSSProperties.prototype.WebkitBoxAlign;
+/** @type {string} */ CSSProperties.prototype.WebkitBoxDecorationBreak;
+/** @type {string} */ CSSProperties.prototype.WebkitBoxDirection;
+/** @type {string} */ CSSProperties.prototype.WebkitBoxFlex;
+/** @type {string} */ CSSProperties.prototype.WebkitBoxFlexGroup;
+/** @type {string} */ CSSProperties.prototype.WebkitBoxLines;
+/** @type {string} */ CSSProperties.prototype.WebkitBoxOrdinalGroup;
+/** @type {string} */ CSSProperties.prototype.WebkitBoxOrient;
+/** @type {string} */ CSSProperties.prototype.WebkitBoxPack;
+/** @type {string} */ CSSProperties.prototype.WebkitBoxReflect;
+/** @type {string} */ CSSProperties.prototype.WebkitBoxShadow;
+/** @type {string} */ CSSProperties.prototype.WebkitBoxSizing;
+/** @type {string} */ CSSProperties.prototype.WebkitColorCorrection;
+/** @type {string} */ CSSProperties.prototype.WebkitColumnAxis;
+/** @type {string} */ CSSProperties.prototype.WebkitColumnBreakAfter;
+/** @type {string} */ CSSProperties.prototype.WebkitColumnBreakBefore;
+/** @type {string} */ CSSProperties.prototype.WebkitColumnBreakInside;
+/** @type {string} */ CSSProperties.prototype.WebkitColumnCount;
+/** @type {string} */ CSSProperties.prototype.WebkitColumnGap;
+/** @type {string} */ CSSProperties.prototype.WebkitColumnProgression;
+/** @type {string} */ CSSProperties.prototype.WebkitColumnRule;
+/** @type {string} */ CSSProperties.prototype.WebkitColumnRuleColor;
+/** @type {string} */ CSSProperties.prototype.WebkitColumnRuleStyle;
+/** @type {string} */ CSSProperties.prototype.WebkitColumnRuleWidth;
+/** @type {string} */ CSSProperties.prototype.WebkitColumns;
+/** @type {string} */ CSSProperties.prototype.WebkitColumnSpan;
+/** @type {string} */ CSSProperties.prototype.WebkitColumnWidth;
+/** @type {string} */ CSSProperties.prototype.WebkitDashboardRegion;
+/** @type {string} */ CSSProperties.prototype.WebkitFilter;
+/** @type {string} */ CSSProperties.prototype.WebkitFlex;
+/** @type {string} */ CSSProperties.prototype.WebkitFlexBasis;
+/** @type {string} */ CSSProperties.prototype.WebkitFlexDirection;
+/** @type {string} */ CSSProperties.prototype.WebkitFlexFlow;
+/** @type {string} */ CSSProperties.prototype.WebkitFlexGrow;
+/** @type {string} */ CSSProperties.prototype.WebkitFlexShrink;
+/** @type {string} */ CSSProperties.prototype.WebkitFlexWrap;
+/** @type {string} */ CSSProperties.prototype.WebkitFlowFrom;
+/** @type {string} */ CSSProperties.prototype.WebkitFlowInto;
+/** @type {string} */ CSSProperties.prototype.WebkitFontSizeDelta;
+/** @type {string} */ CSSProperties.prototype.WebkitFontSmoothing;
+/** @type {string} */ CSSProperties.prototype.WebkitGridColumn;
+/** @type {string} */ CSSProperties.prototype.WebkitGridColumns;
+/** @type {string} */ CSSProperties.prototype.WebkitGridRow;
+/** @type {string} */ CSSProperties.prototype.WebkitGridRows;
+/** @type {string} */ CSSProperties.prototype.WebkitHighlight;
+/** @type {string} */ CSSProperties.prototype.WebkitHyphenateCharacter;
+/** @type {string} */ CSSProperties.prototype.WebkitHyphenateLimitAfter;
+/** @type {string} */ CSSProperties.prototype.WebkitHyphenateLimitBefore;
+/** @type {string} */ CSSProperties.prototype.WebkitHyphenateLimitLines;
+/** @type {string} */ CSSProperties.prototype.WebkitHyphens;
+/** @type {string} */ CSSProperties.prototype.WebkitJustifyContent;
+/** @type {string} */ CSSProperties.prototype.WebkitLineAlign;
+/** @type {string} */ CSSProperties.prototype.WebkitLineBoxContain;
+/** @type {string} */ CSSProperties.prototype.WebkitLineBreak;
+/** @type {string} */ CSSProperties.prototype.WebkitLineClamp;
+/** @type {string} */ CSSProperties.prototype.WebkitLineGrid;
+/** @type {string} */ CSSProperties.prototype.WebkitLineSnap;
+/** @type {string} */ CSSProperties.prototype.WebkitLocale;
+/** @type {string} */ CSSProperties.prototype.WebkitLogicalHeight;
+/** @type {string} */ CSSProperties.prototype.WebkitLogicalWidth;
+/** @type {string} */ CSSProperties.prototype.WebkitMarginAfter;
+/** @type {string} */ CSSProperties.prototype.WebkitMarginAfterCollapse;
+/** @type {string} */ CSSProperties.prototype.WebkitMarginBefore;
+/** @type {string} */ CSSProperties.prototype.WebkitMarginBeforeCollapse;
+/** @type {string} */ CSSProperties.prototype.WebkitMarginBottomCollapse;
+/** @type {string} */ CSSProperties.prototype.WebkitMarginCollapse;
+/** @type {string} */ CSSProperties.prototype.WebkitMarginEnd;
+/** @type {string} */ CSSProperties.prototype.WebkitMarginStart;
+/** @type {string} */ CSSProperties.prototype.WebkitMarginTopCollapse;
+/** @type {string} */ CSSProperties.prototype.WebkitMarquee;
+/** @type {string} */ CSSProperties.prototype.WebkitMarqueeDirection;
+/** @type {string} */ CSSProperties.prototype.WebkitMarqueeIncrement;
+/** @type {string} */ CSSProperties.prototype.WebkitMarqueeRepetition;
+/** @type {string} */ CSSProperties.prototype.WebkitMarqueeSpeed;
+/** @type {string} */ CSSProperties.prototype.WebkitMarqueeStyle;
+/** @type {string} */ CSSProperties.prototype.WebkitMask;
+/** @type {string} */ CSSProperties.prototype.WebkitMaskAttachment;
+/** @type {string} */ CSSProperties.prototype.WebkitMaskBoxImage;
+/** @type {string} */ CSSProperties.prototype.WebkitMaskBoxImageOutset;
+/** @type {string} */ CSSProperties.prototype.WebkitMaskBoxImageRepeat;
+/** @type {string} */ CSSProperties.prototype.WebkitMaskBoxImageSlice;
+/** @type {string} */ CSSProperties.prototype.WebkitMaskBoxImageSource;
+/** @type {string} */ CSSProperties.prototype.WebkitMaskBoxImageWidth;
+/** @type {string} */ CSSProperties.prototype.WebkitMaskClip;
+/** @type {string} */ CSSProperties.prototype.WebkitMaskComposite;
+/** @type {string} */ CSSProperties.prototype.WebkitMaskImage;
+/** @type {string} */ CSSProperties.prototype.WebkitMaskOrigin;
+/** @type {string} */ CSSProperties.prototype.WebkitMaskPosition;
+/** @type {string} */ CSSProperties.prototype.WebkitMaskPositionX;
+/** @type {string} */ CSSProperties.prototype.WebkitMaskPositionY;
+/** @type {string} */ CSSProperties.prototype.WebkitMaskRepeat;
+/** @type {string} */ CSSProperties.prototype.WebkitMaskRepeatX;
+/** @type {string} */ CSSProperties.prototype.WebkitMaskRepeatY;
+/** @type {string} */ CSSProperties.prototype.WebkitMaskSize;
+/** @type {string} */
+CSSProperties.prototype.WebkitMatchNearestMailBlockquoteColor;
+/** @type {string} */ CSSProperties.prototype.WebkitMaxLogicalHeight;
+/** @type {string} */ CSSProperties.prototype.WebkitMaxLogicalWidth;
+/** @type {string} */ CSSProperties.prototype.WebkitMinLogicalHeight;
+/** @type {string} */ CSSProperties.prototype.WebkitMinLogicalWidth;
+/** @type {string} */ CSSProperties.prototype.WebkitNbspMode;
+/** @type {string} */ CSSProperties.prototype.WebkitOrder;
+/** @type {string} */ CSSProperties.prototype.WebkitOverflowScrolling;
+/** @type {string} */ CSSProperties.prototype.WebkitPaddingAfter;
+/** @type {string} */ CSSProperties.prototype.WebkitPaddingBefore;
+/** @type {string} */ CSSProperties.prototype.WebkitPaddingEnd;
+/** @type {string} */ CSSProperties.prototype.WebkitPaddingStart;
+/** @type {string} */ CSSProperties.prototype.WebkitPerspective;
+/** @type {string} */ CSSProperties.prototype.WebkitPerspectiveOrigin;
+/** @type {string} */ CSSProperties.prototype.WebkitPerspectiveOriginX;
+/** @type {string} */ CSSProperties.prototype.WebkitPerspectiveOriginY;
+/** @type {string} */ CSSProperties.prototype.WebkitPrintColorAdjust;
+/** @type {string} */ CSSProperties.prototype.WebkitRegionBreakAfter;
+/** @type {string} */ CSSProperties.prototype.WebkitRegionBreakBefore;
+/** @type {string} */ CSSProperties.prototype.WebkitRegionBreakInside;
+/** @type {string} */ CSSProperties.prototype.WebkitRegionOverflow;
+/** @type {string} */ CSSProperties.prototype.WebkitRtlOrdering;
+/** @type {string} */ CSSProperties.prototype.WebkitRubyPosition;
+/** @type {string} */ CSSProperties.prototype.WebkitShapeInside;
+/** @type {string} */ CSSProperties.prototype.WebkitShapeMargin;
+/** @type {string} */ CSSProperties.prototype.WebkitShapeOutside;
+/** @type {string} */ CSSProperties.prototype.WebkitShapePadding;
+/** @type {string} */ CSSProperties.prototype.WebkitTapHighlightColor;
+/** @type {string} */ CSSProperties.prototype.WebkitTextAlignLast;
+/** @type {string} */ CSSProperties.prototype.WebkitTextCombine;
+/** @type {string} */ CSSProperties.prototype.WebkitTextDecorationLine;
+/** @type {string} */ CSSProperties.prototype.WebkitTextDecorationsInEffect;
+/** @type {string} */ CSSProperties.prototype.WebkitTextDecorationStyle;
+/** @type {string} */ CSSProperties.prototype.WebkitTextEmphasis;
+/** @type {string} */ CSSProperties.prototype.WebkitTextEmphasisColor;
+/** @type {string} */ CSSProperties.prototype.WebkitTextEmphasisPosition;
+/** @type {string} */ CSSProperties.prototype.WebkitTextEmphasisStyle;
+/** @type {string} */ CSSProperties.prototype.WebkitTextFillColor;
+/** @type {string} */ CSSProperties.prototype.WebkitTextOrientation;
+/** @type {string} */ CSSProperties.prototype.WebkitTextSecurity;
+/** @type {string} */ CSSProperties.prototype.WebkitTextSizeAdjust;
+/** @type {string} */ CSSProperties.prototype.WebkitTextStroke;
+/** @type {string} */ CSSProperties.prototype.WebkitTextStrokeColor;
+/** @type {string} */ CSSProperties.prototype.WebkitTextStrokeWidth;
+/** @type {string} */ CSSProperties.prototype.WebkitTransform;
+/** @type {string} */ CSSProperties.prototype.WebkitTransformOrigin;
+/** @type {string} */ CSSProperties.prototype.WebkitTransformOriginX;
+/** @type {string} */ CSSProperties.prototype.WebkitTransformOriginY;
+/** @type {string} */ CSSProperties.prototype.WebkitTransformOriginZ;
+/** @type {string} */ CSSProperties.prototype.WebkitTransformStyle;
+/** @type {string} */ CSSProperties.prototype.WebkitTransition;
+/** @type {string} */ CSSProperties.prototype.WebkitTransitionDelay;
+/** @type {string} */ CSSProperties.prototype.WebkitTransitionDuration;
+/** @type {string} */ CSSProperties.prototype.WebkitTransitionProperty;
+/** @type {string} */ CSSProperties.prototype.WebkitTransitionRepeatCount;
+/** @type {string} */ CSSProperties.prototype.WebkitTransitionTimingFunction;
+/** @type {string} */ CSSProperties.prototype.WebkitUserDrag;
+/** @type {string} */ CSSProperties.prototype.WebkitUserModify;
+/** @type {string} */ CSSProperties.prototype.WebkitUserSelect;
+/** @type {string} */ CSSProperties.prototype.WebkitWrap;
+/** @type {string} */ CSSProperties.prototype.WebkitWrapFlow;
+/** @type {string} */ CSSProperties.prototype.WebkitWrapThrough;
+/** @type {string} */ CSSProperties.prototype.WebkitWritingMode;
+
+// WebKit also adds bindings for the lowercase versions of these properties.
+// The uppercase version is preferred.
+
+/** @type {string} */ CSSProperties.prototype.webkitAlignContent;
+/** @type {string} */ CSSProperties.prototype.webkitAlignItems;
+/** @type {string} */ CSSProperties.prototype.webkitAlignSelf;
+/** @type {string} */ CSSProperties.prototype.webkitAnimation;
+/** @type {string} */ CSSProperties.prototype.webkitAnimationDelay;
+/** @type {string} */ CSSProperties.prototype.webkitAnimationDirection;
+/** @type {string} */ CSSProperties.prototype.webkitAnimationDuration;
+/** @type {string} */ CSSProperties.prototype.webkitAnimationFillMode;
+/** @type {string} */ CSSProperties.prototype.webkitAnimationIterationCount;
+/** @type {string} */ CSSProperties.prototype.webkitAnimationName;
+/** @type {string} */ CSSProperties.prototype.webkitAnimationPlayState;
+/** @type {string} */ CSSProperties.prototype.webkitAnimationTimingFunction;
+/** @type {string} */ CSSProperties.prototype.webkitAppearance;
+/** @type {string} */ CSSProperties.prototype.webkitAppRegion;
+/** @type {string} */ CSSProperties.prototype.webkitAspectRatio;
+/** @type {string} */ CSSProperties.prototype.webkitBackfaceVisibility;
+/** @type {string} */ CSSProperties.prototype.webkitBackgroundClip;
+/** @type {string} */ CSSProperties.prototype.webkitBackgroundComposite;
+/** @type {string} */ CSSProperties.prototype.webkitBackgroundOrigin;
+/** @type {string} */ CSSProperties.prototype.webkitBackgroundSize;
+/** @type {string} */ CSSProperties.prototype.webkitBinding;
+/** @type {string} */ CSSProperties.prototype.webkitBlendMode;
+/** @type {string} */ CSSProperties.prototype.webkitBorderAfter;
+/** @type {string} */ CSSProperties.prototype.webkitBorderAfterColor;
+/** @type {string} */ CSSProperties.prototype.webkitBorderAfterStyle;
+/** @type {string} */ CSSProperties.prototype.webkitBorderAfterWidth;
+/** @type {string} */ CSSProperties.prototype.webkitBorderBefore;
+/** @type {string} */ CSSProperties.prototype.webkitBorderBeforeColor;
+/** @type {string} */ CSSProperties.prototype.webkitBorderBeforeStyle;
+/** @type {string} */ CSSProperties.prototype.webkitBorderBeforeWidth;
+/** @type {string} */ CSSProperties.prototype.webkitBorderBottomLeftRadius;
+/** @type {string} */ CSSProperties.prototype.webkitBorderBottomRightRadius;
+/** @type {string} */ CSSProperties.prototype.webkitBorderEnd;
+/** @type {string} */ CSSProperties.prototype.webkitBorderEndColor;
+/** @type {string} */ CSSProperties.prototype.webkitBorderEndStyle;
+/** @type {string} */ CSSProperties.prototype.webkitBorderEndWidth;
+/** @type {string} */ CSSProperties.prototype.webkitBorderFit;
+/** @type {string} */ CSSProperties.prototype.webkitBorderHorizontalSpacing;
+/** @type {string} */ CSSProperties.prototype.webkitBorderImage;
+/** @type {string} */ CSSProperties.prototype.webkitBorderRadius;
+/** @type {string} */ CSSProperties.prototype.webkitBorderStart;
+/** @type {string} */ CSSProperties.prototype.webkitBorderStartColor;
+/** @type {string} */ CSSProperties.prototype.webkitBorderStartStyle;
+/** @type {string} */ CSSProperties.prototype.webkitBorderStartWidth;
+/** @type {string} */ CSSProperties.prototype.webkitBorderTopLeftRadius;
+/** @type {string} */ CSSProperties.prototype.webkitBorderTopRightRadius;
+/** @type {string} */ CSSProperties.prototype.webkitBorderVerticalSpacing;
+/** @type {string} */ CSSProperties.prototype.webkitBoxAlign;
+/** @type {string} */ CSSProperties.prototype.webkitBoxDecorationBreak;
+/** @type {string} */ CSSProperties.prototype.webkitBoxDirection;
+/** @type {string} */ CSSProperties.prototype.webkitBoxFlex;
+/** @type {string} */ CSSProperties.prototype.webkitBoxFlexGroup;
+/** @type {string} */ CSSProperties.prototype.webkitBoxLines;
+/** @type {string} */ CSSProperties.prototype.webkitBoxOrdinalGroup;
+/** @type {string} */ CSSProperties.prototype.webkitBoxOrient;
+/** @type {string} */ CSSProperties.prototype.webkitBoxPack;
+/** @type {string} */ CSSProperties.prototype.webkitBoxReflect;
+/** @type {string} */ CSSProperties.prototype.webkitBoxShadow;
+/** @type {string} */ CSSProperties.prototype.webkitBoxSizing;
+/** @type {string} */ CSSProperties.prototype.webkitColorCorrection;
+/** @type {string} */ CSSProperties.prototype.webkitColumnAxis;
+/** @type {string} */ CSSProperties.prototype.webkitColumnBreakAfter;
+/** @type {string} */ CSSProperties.prototype.webkitColumnBreakBefore;
+/** @type {string} */ CSSProperties.prototype.webkitColumnBreakInside;
+/** @type {string} */ CSSProperties.prototype.webkitColumnCount;
+/** @type {string} */ CSSProperties.prototype.webkitColumnGap;
+/** @type {string} */ CSSProperties.prototype.webkitColumnProgression;
+/** @type {string} */ CSSProperties.prototype.webkitColumnRule;
+/** @type {string} */ CSSProperties.prototype.webkitColumnRuleColor;
+/** @type {string} */ CSSProperties.prototype.webkitColumnRuleStyle;
+/** @type {string} */ CSSProperties.prototype.webkitColumnRuleWidth;
+/** @type {string} */ CSSProperties.prototype.webkitColumns;
+/** @type {string} */ CSSProperties.prototype.webkitColumnSpan;
+/** @type {string} */ CSSProperties.prototype.webkitColumnWidth;
+/** @type {string} */ CSSProperties.prototype.webkitDashboardRegion;
+/** @type {string} */ CSSProperties.prototype.webkitFilter;
+/** @type {string} */ CSSProperties.prototype.webkitFlex;
+/** @type {string} */ CSSProperties.prototype.webkitFlexBasis;
+/** @type {string} */ CSSProperties.prototype.webkitFlexDirection;
+/** @type {string} */ CSSProperties.prototype.webkitFlexFlow;
+/** @type {string} */ CSSProperties.prototype.webkitFlexGrow;
+/** @type {string} */ CSSProperties.prototype.webkitFlexShrink;
+/** @type {string} */ CSSProperties.prototype.webkitFlexWrap;
+/** @type {string} */ CSSProperties.prototype.webkitFlowFrom;
+/** @type {string} */ CSSProperties.prototype.webkitFlowInto;
+/** @type {string} */ CSSProperties.prototype.webkitFontSizeDelta;
+/** @type {string} */ CSSProperties.prototype.webkitFontSmoothing;
+/** @type {string} */ CSSProperties.prototype.webkitGridColumn;
+/** @type {string} */ CSSProperties.prototype.webkitGridColumns;
+/** @type {string} */ CSSProperties.prototype.webkitGridRow;
+/** @type {string} */ CSSProperties.prototype.webkitGridRows;
+/** @type {string} */ CSSProperties.prototype.webkitHighlight;
+/** @type {string} */ CSSProperties.prototype.webkitHyphenateCharacter;
+/** @type {string} */ CSSProperties.prototype.webkitHyphenateLimitAfter;
+/** @type {string} */ CSSProperties.prototype.webkitHyphenateLimitBefore;
+/** @type {string} */ CSSProperties.prototype.webkitHyphenateLimitLines;
+/** @type {string} */ CSSProperties.prototype.webkitHyphens;
+/** @type {string} */ CSSProperties.prototype.webkitJustifyContent;
+/** @type {string} */ CSSProperties.prototype.webkitLineAlign;
+/** @type {string} */ CSSProperties.prototype.webkitLineBoxContain;
+/** @type {string} */ CSSProperties.prototype.webkitLineBreak;
+/** @type {string} */ CSSProperties.prototype.webkitLineClamp;
+/** @type {string} */ CSSProperties.prototype.webkitLineGrid;
+/** @type {string} */ CSSProperties.prototype.webkitLineSnap;
+/** @type {string} */ CSSProperties.prototype.webkitLocale;
+/** @type {string} */ CSSProperties.prototype.webkitLogicalHeight;
+/** @type {string} */ CSSProperties.prototype.webkitLogicalWidth;
+/** @type {string} */ CSSProperties.prototype.webkitMarginAfter;
+/** @type {string} */ CSSProperties.prototype.webkitMarginAfterCollapse;
+/** @type {string} */ CSSProperties.prototype.webkitMarginBefore;
+/** @type {string} */ CSSProperties.prototype.webkitMarginBeforeCollapse;
+/** @type {string} */ CSSProperties.prototype.webkitMarginBottomCollapse;
+/** @type {string} */ CSSProperties.prototype.webkitMarginCollapse;
+/** @type {string} */ CSSProperties.prototype.webkitMarginEnd;
+/** @type {string} */ CSSProperties.prototype.webkitMarginStart;
+/** @type {string} */ CSSProperties.prototype.webkitMarginTopCollapse;
+/** @type {string} */ CSSProperties.prototype.webkitMarquee;
+/** @type {string} */ CSSProperties.prototype.webkitMarqueeDirection;
+/** @type {string} */ CSSProperties.prototype.webkitMarqueeIncrement;
+/** @type {string} */ CSSProperties.prototype.webkitMarqueeRepetition;
+/** @type {string} */ CSSProperties.prototype.webkitMarqueeSpeed;
+/** @type {string} */ CSSProperties.prototype.webkitMarqueeStyle;
+/** @type {string} */ CSSProperties.prototype.webkitMask;
+/** @type {string} */ CSSProperties.prototype.webkitMaskAttachment;
+/** @type {string} */ CSSProperties.prototype.webkitMaskBoxImage;
+/** @type {string} */ CSSProperties.prototype.webkitMaskBoxImageOutset;
+/** @type {string} */ CSSProperties.prototype.webkitMaskBoxImageRepeat;
+/** @type {string} */ CSSProperties.prototype.webkitMaskBoxImageSlice;
+/** @type {string} */ CSSProperties.prototype.webkitMaskBoxImageSource;
+/** @type {string} */ CSSProperties.prototype.webkitMaskBoxImageWidth;
+/** @type {string} */ CSSProperties.prototype.webkitMaskClip;
+/** @type {string} */ CSSProperties.prototype.webkitMaskComposite;
+/** @type {string} */ CSSProperties.prototype.webkitMaskImage;
+/** @type {string} */ CSSProperties.prototype.webkitMaskOrigin;
+/** @type {string} */ CSSProperties.prototype.webkitMaskPosition;
+/** @type {string} */ CSSProperties.prototype.webkitMaskPositionX;
+/** @type {string} */ CSSProperties.prototype.webkitMaskPositionY;
+/** @type {string} */ CSSProperties.prototype.webkitMaskRepeat;
+/** @type {string} */ CSSProperties.prototype.webkitMaskRepeatX;
+/** @type {string} */ CSSProperties.prototype.webkitMaskRepeatY;
+/** @type {string} */ CSSProperties.prototype.webkitMaskSize;
+/** @type {string} */
+CSSProperties.prototype.webkitMatchNearestMailBlockquoteColor;
+/** @type {string} */ CSSProperties.prototype.webkitMaxLogicalHeight;
+/** @type {string} */ CSSProperties.prototype.webkitMaxLogicalWidth;
+/** @type {string} */ CSSProperties.prototype.webkitMinLogicalHeight;
+/** @type {string} */ CSSProperties.prototype.webkitMinLogicalWidth;
+/** @type {string} */ CSSProperties.prototype.webkitNbspMode;
+/** @type {string} */ CSSProperties.prototype.webkitOrder;
+/** @type {string} */ CSSProperties.prototype.webkitOverflowScrolling;
+/** @type {string} */ CSSProperties.prototype.webkitPaddingAfter;
+/** @type {string} */ CSSProperties.prototype.webkitPaddingBefore;
+/** @type {string} */ CSSProperties.prototype.webkitPaddingEnd;
+/** @type {string} */ CSSProperties.prototype.webkitPaddingStart;
+/** @type {string} */ CSSProperties.prototype.webkitPerspective;
+/** @type {string} */ CSSProperties.prototype.webkitPerspectiveOrigin;
+/** @type {string} */ CSSProperties.prototype.webkitPerspectiveOriginX;
+/** @type {string} */ CSSProperties.prototype.webkitPerspectiveOriginY;
+/** @type {string} */ CSSProperties.prototype.webkitPrintColorAdjust;
+/** @type {string} */ CSSProperties.prototype.webkitRegionBreakAfter;
+/** @type {string} */ CSSProperties.prototype.webkitRegionBreakBefore;
+/** @type {string} */ CSSProperties.prototype.webkitRegionBreakInside;
+/** @type {string} */ CSSProperties.prototype.webkitRegionOverflow;
+/** @type {string} */ CSSProperties.prototype.webkitRtlOrdering;
+/** @type {string} */ CSSProperties.prototype.webkitRubyPosition;
+/** @type {string} */ CSSProperties.prototype.webkitShapeInside;
+/** @type {string} */ CSSProperties.prototype.webkitShapeMargin;
+/** @type {string} */ CSSProperties.prototype.webkitShapeOutside;
+/** @type {string} */ CSSProperties.prototype.webkitShapePadding;
+/** @type {string} */ CSSProperties.prototype.webkitTapHighlightColor;
+/** @type {string} */ CSSProperties.prototype.webkitTextAlignLast;
+/** @type {string} */ CSSProperties.prototype.webkitTextCombine;
+/** @type {string} */ CSSProperties.prototype.webkitTextDecorationLine;
+/** @type {string} */ CSSProperties.prototype.webkitTextDecorationsInEffect;
+/** @type {string} */ CSSProperties.prototype.webkitTextDecorationStyle;
+/** @type {string} */ CSSProperties.prototype.webkitTextEmphasis;
+/** @type {string} */ CSSProperties.prototype.webkitTextEmphasisColor;
+/** @type {string} */ CSSProperties.prototype.webkitTextEmphasisPosition;
+/** @type {string} */ CSSProperties.prototype.webkitTextEmphasisStyle;
+/** @type {string} */ CSSProperties.prototype.webkitTextFillColor;
+/** @type {string} */ CSSProperties.prototype.webkitTextOrientation;
+/** @type {string} */ CSSProperties.prototype.webkitTextSecurity;
+/** @type {string} */ CSSProperties.prototype.webkitTextSizeAdjust;
+/** @type {string} */ CSSProperties.prototype.webkitTextStroke;
+/** @type {string} */ CSSProperties.prototype.webkitTextStrokeColor;
+/** @type {string} */ CSSProperties.prototype.webkitTextStrokeWidth;
+/** @type {string} */ CSSProperties.prototype.webkitTransform;
+/** @type {string} */ CSSProperties.prototype.webkitTransformOrigin;
+/** @type {string} */ CSSProperties.prototype.webkitTransformOriginX;
+/** @type {string} */ CSSProperties.prototype.webkitTransformOriginY;
+/** @type {string} */ CSSProperties.prototype.webkitTransformOriginZ;
+/** @type {string} */ CSSProperties.prototype.webkitTransformStyle;
+/** @type {string} */ CSSProperties.prototype.webkitTransition;
+/** @type {string} */ CSSProperties.prototype.webkitTransitionDelay;
+/** @type {string} */ CSSProperties.prototype.webkitTransitionDuration;
+/** @type {string} */ CSSProperties.prototype.webkitTransitionProperty;
+/** @type {string} */ CSSProperties.prototype.webkitTransitionRepeatCount;
+/** @type {string} */ CSSProperties.prototype.webkitTransitionTimingFunction;
+/** @type {string} */ CSSProperties.prototype.webkitUserDrag;
+/** @type {string} */ CSSProperties.prototype.webkitUserModify;
+/** @type {string} */ CSSProperties.prototype.webkitUserSelect;
+/** @type {string} */ CSSProperties.prototype.webkitWrap;
+/** @type {string} */ CSSProperties.prototype.webkitWrapFlow;
+/** @type {string} */ CSSProperties.prototype.webkitWrapThrough;
+/** @type {string} */ CSSProperties.prototype.webkitWritingMode;
+
+/**
+ * @constructor
+ * @param {number} x
+ * @param {number} y
+ */
+function WebKitPoint(x, y) {}
+
+/** @type {number} */
+WebKitPoint.prototype.x;
+
+/** @type {number} */
+WebKitPoint.prototype.y;
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_dom.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_dom.js
new file mode 100644
index 0000000000..da8c8fdde9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_dom.js
@@ -0,0 +1,281 @@
+/*
+ * Copyright 2008 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for all the extensions over W3C's DOM
+ * specification by WebKit. This file depends on w3c_dom2.js.
+ * All the provided definitions has been type annotated
+ *
+ * @externs
+ */
+
+
+/**
+ * @param {boolean=} opt_center
+ * @see https://bugzilla.mozilla.org/show_bug.cgi?id=403510
+ */
+Element.prototype.scrollIntoViewIfNeeded = function(opt_center) {};
+
+/**
+ * @constructor
+ * @see http://trac.webkit.org/browser/trunk/Source/WebCore/page/MemoryInfo.idl
+ * @see http://trac.webkit.org/browser/trunk/Source/WebCore/page/MemoryInfo.cpp
+ */
+function MemoryInfo() {};
+
+/** @type {number} */
+MemoryInfo.prototype.totalJSHeapSize;
+
+/** @type {number} */
+MemoryInfo.prototype.usedJSHeapSize;
+
+/** @type {number} */
+MemoryInfo.prototype.jsHeapSizeLimit;
+
+/**
+ * @constructor
+ * @see http://trac.webkit.org/browser/trunk/Source/WebCore/inspector/ScriptProfileNode.idl
+ */
+function ScriptProfileNode() {};
+
+/** @type {string} */
+ScriptProfileNode.prototype.functionName;
+
+/** @type {string} */
+ScriptProfileNode.prototype.url;
+
+/** @type {number} */
+ScriptProfileNode.prototype.lineNumber;
+
+/** @type {number} */
+ScriptProfileNode.prototype.totalTime;
+
+/** @type {number} */
+ScriptProfileNode.prototype.selfTime;
+
+/** @type {number} */
+ScriptProfileNode.prototype.numberOfCalls;
+
+/** @type {Array.<ScriptProfileNode>} */
+ScriptProfileNode.prototype.children;
+
+/** @type {boolean} */
+ScriptProfileNode.prototype.visible;
+
+/** @type {number} */
+ScriptProfileNode.prototype.callUID;
+
+/**
+ * @constructor
+ * @see http://trac.webkit.org/browser/trunk/Source/WebCore/inspector/ScriptProfile.idl
+ */
+function ScriptProfile() {};
+
+/** @type {string} */
+ScriptProfile.prototype.title;
+
+/** @type {number} */
+ScriptProfile.prototype.uid;
+
+/** @type {ScriptProfileNode} */
+ScriptProfile.prototype.head;
+
+/**
+ * @constructor
+ * @see http://trac.webkit.org/browser/trunk/Source/WebCore/page/Console.idl
+ * @see http://trac.webkit.org/browser/trunk/Source/WebCore/page/Console.cpp
+ */
+function Console() {};
+
+/**
+ * @param {*} condition
+ * @param {...*} var_args
+ */
+Console.prototype.assert = function(condition, var_args) {};
+
+/**
+ * @param {...*} var_args
+ */
+Console.prototype.error = function(var_args) {};
+
+/**
+ * @param {...*} var_args
+ */
+Console.prototype.info = function(var_args) {};
+
+/**
+ * @param {...*} var_args
+ */
+Console.prototype.log = function(var_args) {};
+
+/**
+ * @param {...*} var_args
+ */
+Console.prototype.warn = function(var_args) {};
+
+/**
+ * @param {...*} var_args
+ */
+Console.prototype.debug = function(var_args) {};
+
+/**
+ * @param {*} value
+ */
+Console.prototype.dir = function(value) {};
+
+/**
+ * @param {...*} var_args
+ */
+Console.prototype.dirxml = function(var_args) {};
+
+/**
+ * @param {!Object} data
+ * @param {*=} opt_columns
+ */
+Console.prototype.table = function(data, opt_columns) {};
+
+/**
+ * @return {undefined}
+ */
+Console.prototype.trace = function() {};
+
+/**
+ * @param {*} value
+ */
+Console.prototype.count = function(value) {};
+
+/**
+ * @param {*} value
+ */
+Console.prototype.markTimeline = function(value) {};
+
+/**
+ * @param {string=} opt_title
+ */
+Console.prototype.profile = function(opt_title) {};
+
+/** @type {Array.<ScriptProfile>} */
+Console.prototype.profiles;
+
+/**
+ * @param {string=} opt_title
+ */
+Console.prototype.profileEnd = function(opt_title) {};
+
+/**
+ * @param {string} name
+ */
+Console.prototype.time = function(name) {};
+
+/**
+ * @param {string} name
+ */
+Console.prototype.timeEnd = function(name) {};
+
+/**
+ * @param {*} value
+ */
+Console.prototype.timeStamp = function(value) {};
+
+/**
+ * @param {...*} var_args
+ */
+Console.prototype.group = function(var_args) {};
+
+/**
+ * @param {...*} var_args
+ */
+Console.prototype.groupCollapsed = function(var_args) {};
+
+Console.prototype.groupEnd = function() {};
+
+Console.prototype.clear = function() {};
+
+/** @type {MemoryInfo} */
+Console.prototype.memory;
+
+/** @type {!Console} */
+Window.prototype.console;
+
+/**
+ * @type {!Console}
+ * @suppress {duplicate}
+ */
+var console;
+
+/**
+ * @type {number}
+ * @see http://developer.android.com/reference/android/webkit/WebView.html
+ */
+Window.prototype.devicePixelRatio;
+
+/** @type {Node} */
+Selection.prototype.baseNode;
+
+/** @type {number} */
+Selection.prototype.baseOffset;
+
+/** @type {Node} */
+Selection.prototype.extentNode;
+
+/** @type {number} */
+Selection.prototype.extentOffset;
+
+/** @type {string} */
+Selection.prototype.type;
+
+/**
+ * @return {undefined}
+ */
+Selection.prototype.empty = function() {};
+
+/**
+ * @param {Node} baseNode
+ * @param {number} baseOffset
+ * @param {Node} extentNode
+ * @param {number} extentOffset
+ * @return {undefined}
+ */
+Selection.prototype.setBaseAndExtent =
+ function(baseNode, baseOffset, extentNode, extentOffset) {};
+
+/**
+ * @param {string} alter
+ * @param {string} direction
+ * @param {string} granularity
+ * @return {undefined}
+ */
+Selection.prototype.modify = function(alter, direction, granularity) {};
+
+/**
+ * @param {Element} element
+ * @param {string} pseudoElement
+ * @param {boolean=} opt_authorOnly
+ * @return {CSSRuleList}
+ * @nosideeffects
+ */
+ViewCSS.prototype.getMatchedCSSRules =
+ function(element, pseudoElement, opt_authorOnly) {};
+
+/**
+ * @param {string} contextId
+ * @param {string} name
+ * @param {number} width
+ * @param {number} height
+ * @nosideeffects
+ */
+Document.prototype.getCSSCanvasContext =
+ function(contextId, name, width, height) {};
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_event.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_event.js
new file mode 100644
index 0000000000..9fad616f3b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_event.js
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2009 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview Definitions for all the extensions over W3C's
+ * event specification by WebKit. This file depends on w3c_event.js.
+ * All the provided definitions have been type annotated
+ *
+ * @externs
+ */
+
+/** @type {number} */
+Event.prototype.wheelDeltaX;
+
+/** @type {number} */
+Event.prototype.wheelDeltaY;
+
+/**
+ * @constructor
+ * @extends {Event}
+ * @see http://developer.apple.com/library/safari/documentation/AudioVideo/Reference/WebKitAnimationEventClassReference/WebKitAnimationEvent/WebKitAnimationEvent.html
+ */
+function WebKitAnimationEvent() {}
+
+/**
+ * @type {string}
+ * @const
+ */
+WebKitAnimationEvent.prototype.animationName;
+
+/**
+ * @type {number}
+ * @const
+ */
+WebKitAnimationEvent.prototype.elapsedTime; \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_notifications.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_notifications.js
new file mode 100644
index 0000000000..30e4a0bc70
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webkit_notifications.js
@@ -0,0 +1,201 @@
+/*
+ * Copyright 2010 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * @fileoverview Definitions for W3C's Notifications specification.
+ * @externs
+ */
+
+/**
+ * @typedef {{dir: (string|undefined), lang: (string|undefined),
+ * body: (string|undefined), tag: (string|undefined),
+ * icon: (string|undefined)}}
+ * @see http://notifications.spec.whatwg.org/#notificationoptions
+ */
+var NotificationOptions;
+
+/** @interface */
+var NotificationOptionsInterface_;
+/** @type {string} */ NotificationOptionsInterface_.prototype.dir;
+/** @type {string} */ NotificationOptionsInterface_.prototype.lang;
+/** @type {string} */ NotificationOptionsInterface_.prototype.body;
+/** @type {string} */ NotificationOptionsInterface_.prototype.tag;
+/** @type {string} */ NotificationOptionsInterface_.prototype.icon;
+
+/**
+ * @param {string} title
+ * @param {NotificationOptions=} opt_options
+ * @constructor
+ * @implements {EventTarget}
+ * @see http://notifications.spec.whatwg.org/#notification
+ */
+function Notification(title, opt_options) {}
+
+/**
+ * @type {string}
+ */
+Notification.permission;
+
+/**
+ * @param {NotificationPermissionCallback=} opt_callback
+ */
+Notification.requestPermission = function(opt_callback) {};
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+Notification.prototype.addEventListener =
+ function(type, listener, opt_useCapture) {};
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+Notification.prototype.removeEventListener =
+ function(type, listener, opt_useCapture) {};
+
+/** @override */
+Notification.prototype.dispatchEvent = function(evt) {};
+
+/**
+ * The ID used by clients to uniquely identify notifications to eliminate
+ * duplicate notifications.
+ * @type {string}
+ * @deprecated Use NotificationOptions.tag instead.
+ */
+Notification.prototype.replaceId;
+
+/**
+ * The string used by clients to specify the directionality (rtl/ltr) of the
+ * notification.
+ * @type {string}
+ * @deprecated Use NotificationOptions.titleDir and bodyDir instead.
+ */
+Notification.prototype.dir;
+
+/**
+ * Displays the notification.
+ */
+Notification.prototype.show = function() {};
+
+/**
+ * Prevents the notification from being displayed, or closes it if it is already
+ * displayed.
+ */
+Notification.prototype.cancel = function() {};
+
+/**
+ * Prevents the notification from being displayed, or closes it if it is already
+ * displayed.
+ */
+Notification.prototype.close = function() {};
+
+/**
+ * An event handler called when notification is closed.
+ * @type {?function(Event)}
+ */
+Notification.prototype.onclose;
+
+/**
+ * An event handler called if the notification could not be displayed due to
+ * an error (i.e. resource could not be loaded).
+ * @type {?function(Event)}
+ */
+Notification.prototype.onerror;
+
+/**
+ * An event handler called when the notification has become visible.
+ * @type {?function(Event)}
+ * @deprecated Use onshow instead.
+ */
+Notification.prototype.ondisplay;
+
+/**
+ * An event handler called when the notification has become visible.
+ * @type {?function(Event)}
+ */
+Notification.prototype.onshow;
+
+/**
+ * An event handler called when the notification has been clicked on.
+ * @type {?function(Event)}
+ */
+Notification.prototype.onclick;
+
+/**
+ * @constructor
+ */
+window.Notification = Notification;
+
+/**
+ * @type {string}
+ */
+window.Notification.permission;
+
+/**
+ * @param {NotificationPermissionCallback=} opt_callback
+ */
+window.Notification.requestPermission = function(opt_callback) {};
+
+/**
+ * @typedef {function(string)}
+ * @see http://notifications.spec.whatwg.org/#notificationpermissioncallback
+ */
+var NotificationPermissionCallback;
+
+/**
+ * @constructor
+ * @see http://dev.w3.org/2006/webapi/WebNotifications/publish/#dialog-if
+ * @deprecated Use Notification instead.
+ */
+function NotificationCenter() {}
+
+/**
+ * Creates a text+icon notification and displays it to the user.
+ * @param {string} iconUrl
+ * @param {string} title
+ * @param {string} body
+ * @return {Notification}
+ */
+NotificationCenter.prototype.createNotification =
+ function(iconUrl, title, body) {};
+
+/**
+ * Creates an HTML notification and displays it to the user.
+ * @param {string} url
+ * @return {Notification}
+ */
+NotificationCenter.prototype.createHTMLNotification = function(url) {};
+
+/**
+ * Checks if the user has permission to display notifications.
+ * @return {number}
+ */
+NotificationCenter.prototype.checkPermission = function() {};
+
+/**
+ * Requests permission from the user to display notifications.
+ * @param {Function=} opt_callback
+ * @return {void}
+ */
+NotificationCenter.prototype.requestPermission = function(opt_callback) {};
+
+/**
+ * WebKit browsers expose the NotificationCenter API through
+ * window.webkitNotifications.
+ * @type {NotificationCenter}
+ */
+Window.prototype.webkitNotifications;
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webstorage.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webstorage.js
new file mode 100644
index 0000000000..eee69d2581
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/webstorage.js
@@ -0,0 +1,148 @@
+/*
+ * Copyright 2009 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * @fileoverview Definitions for W3C's WebStorage specification.
+ * This file depends on html5.js.
+ * @externs
+ */
+
+/**
+ * @interface
+ * @see http://www.w3.org/TR/2011/CR-webstorage-20111208/#the-storage-interface
+ */
+function Storage() {}
+
+/**
+ * @type {number}
+ * @const
+ */
+Storage.prototype.length;
+
+/**
+ * @param {number} index
+ * @return {?string}
+ */
+Storage.prototype.key = function(index) {};
+
+/**
+ * @param {string} key
+ * @return {?string}
+ */
+Storage.prototype.getItem = function(key) {};
+
+/**
+ * @param {string} key
+ * @param {string} data
+ * @return {void}
+ */
+Storage.prototype.setItem = function(key, data) {};
+
+/**
+ * @param {string} key
+ * @return {void}
+ */
+Storage.prototype.removeItem = function(key) {};
+
+/**
+ * @return {void}
+ */
+Storage.prototype.clear = function() {};
+
+/**
+ * @interface
+ * @see http://www.w3.org/TR/2011/CR-webstorage-20111208/#the-sessionstorage-attribute
+ */
+function WindowSessionStorage() {}
+
+/**
+ * @type {Storage}
+ */
+WindowSessionStorage.prototype.sessionStorage;
+
+/**
+ * Window implements WindowSessionStorage
+ *
+ * @type {Storage}
+ */
+Window.prototype.sessionStorage;
+
+/**
+ * @interface
+ * @see http://www.w3.org/TR/2011/CR-webstorage-20111208/#the-localstorage-attribute
+ */
+function WindowLocalStorage() {}
+
+/**
+ * @type {Storage}
+ */
+WindowLocalStorage.prototype.localStorage;
+
+/**
+ * Window implements WindowLocalStorage
+ *
+ * @type {Storage}
+ */
+Window.prototype.localStorage;
+
+/**
+ * This is the storage event interface.
+ * @see http://www.w3.org/TR/2011/CR-webstorage-20111208/#the-storage-event
+ * @extends {Event}
+ * @constructor
+ */
+function StorageEvent() {}
+
+/**
+ * @type {string}
+ */
+StorageEvent.prototype.key;
+
+/**
+ * @type {?string}
+ */
+StorageEvent.prototype.oldValue;
+
+/**
+ * @type {?string}
+ */
+StorageEvent.prototype.newValue;
+
+/**
+ * @type {string}
+ */
+StorageEvent.prototype.url;
+
+/**
+ * @type {?Storage}
+ */
+StorageEvent.prototype.storageArea;
+
+/**
+ * @param {string} typeArg
+ * @param {boolean} canBubbleArg
+ * @param {boolean} cancelableArg
+ * @param {string} keyArg
+ * @param {?string} oldValueArg
+ * @param {?string} newValueArg
+ * @param {string} urlArg
+ * @param {?Storage} storageAreaArg
+ * @return {void}
+ */
+StorageEvent.prototype.initStorageEvent = function(typeArg, canBubbleArg,
+ cancelableArg, keyArg,
+ oldValueArg, newValueArg,
+ urlArg, storageAreaArg) {};
+
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/window.js b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/window.js
new file mode 100644
index 0000000000..34e3945c1c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/temp_externs/window.js
@@ -0,0 +1,191 @@
+/*
+ * Copyright 2008 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @fileoverview JavaScript Built-Ins for windows properties.
+ *
+ * @externs
+ * @author stevey@google.com (Steve Yegge)
+ */
+
+// Window properties
+// Only common properties are here. Others such as open()
+// should be used with an explicit Window object.
+
+/**
+ * @type {!Window}
+ * @see https://developer.mozilla.org/en/DOM/window.top
+ * @const
+ */
+var top;
+
+/**
+ * @type {Navigator}
+ * @see https://developer.mozilla.org/en/DOM/window.navigator
+ * @const
+ */
+var navigator;
+
+/**
+ * @type {!HTMLDocument}
+ * @see https://developer.mozilla.org/en/DOM/window.document
+ * @const
+ */
+var document;
+
+/**
+ * @type {Location}
+ * @see https://developer.mozilla.org/en/DOM/window.location
+ * @const
+ * @suppress {duplicate}
+ * @implicitCast
+ */
+var location;
+
+/**
+ * @type {!Screen}
+ * @see https://developer.mozilla.org/En/DOM/window.screen
+ * @const
+ */
+var screen;
+
+/**
+ * @type {!Window}
+ * @see https://developer.mozilla.org/En/DOM/Window.self
+ * @const
+ */
+var self;
+
+// Magic functions for Firefox's LiveConnect.
+// We'll probably never use these in practice. But redefining them
+// will fire up the JVM, so we want to reserve the symbol names.
+
+/**
+ * @see https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/JavaArray
+ */
+var JavaArray;
+
+/**
+ * @see https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/JavaClass
+ */
+var JavaClass;
+
+// We just ripped this from the FF source; it doesn't appear to be
+// publicly documented.
+var JavaMember;
+
+/**
+ * @see https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/JavaObject
+ */
+var JavaObject;
+
+/**
+ * @see https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/JavaPackage
+ */
+var JavaPackage;
+
+/**
+ * @see https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Packages
+ */
+var Packages;
+
+/**
+ * @see https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/java
+ */
+var java;
+
+/**
+ * @see https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/netscape
+ */
+var netscape;
+
+/**
+ * @see https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/sun
+ */
+var sun;
+
+/**
+ * @see https://developer.mozilla.org/en/DOM/window.alert
+ */
+function alert(x) {}
+
+/**
+ * @param {number|undefined|null} immediateID
+ * @see https://developer.mozilla.org/en-US/docs/DOM/window.clearImmediate
+ * @see http://msdn.microsoft.com/en-us/library/ie/hh924825(v=vs.85).aspx
+ */
+function clearImmediate(immediateID) {}
+
+/**
+ * @param {number|undefined?} intervalID
+ * @see https://developer.mozilla.org/en/DOM/window.clearInterval
+ * @suppress {duplicate}
+ */
+function clearInterval(intervalID) {}
+
+/**
+ * @param {number|undefined?} timeoutID
+ * @see https://developer.mozilla.org/en/DOM/window.clearTimeout
+ * @suppress {duplicate}
+ */
+function clearTimeout(timeoutID) {}
+
+/**
+ * @param {*} message
+ * @return {boolean}
+ * @see https://developer.mozilla.org/en/DOM/window.confirm
+ */
+function confirm(message) {}
+
+/**
+ * @see https://developer.mozilla.org/en/DOM/window.dump
+ */
+function dump(x) {}
+
+/**
+ * @param {string} message
+ * @param {string=} opt_value
+ * @return {?string}
+ * @see https://developer.mozilla.org/en/DOM/window.prompt
+ */
+function prompt(message, opt_value) {}
+
+/**
+ * @param {function()} callback
+ * @return {number}
+ * @see https://developer.mozilla.org/en-US/docs/DOM/window.setImmediate
+ * @see http://msdn.microsoft.com/en-us/library/ie/hh773176(v=vs.85).aspx
+ */
+function setImmediate(callback) {}
+
+/**
+ * @param {Function|string} callback
+ * @param {number=} opt_delay
+ * @return {number}
+ * @see https://developer.mozilla.org/en/DOM/window.setInterval
+ * @see https://html.spec.whatwg.org/multipage/webappapis.html#timers
+ */
+function setInterval(callback, opt_delay) {}
+
+/**
+ * @param {Function|string} callback
+ * @param {number=} opt_delay
+ * @param {...*} var_args
+ * @return {number}
+ * @see https://developer.mozilla.org/en/DOM/window.setTimeout
+ * @see https://html.spec.whatwg.org/multipage/webappapis.html#timers
+ */
+function setTimeout(callback, opt_delay, var_args) {}
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/test-webgl2.js b/dom/canvas/test/webgl-conf/checkout/deqp/test-webgl2.js
new file mode 100644
index 0000000000..d6122231f0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/test-webgl2.js
@@ -0,0 +1,4 @@
+/** @type {WebGL2RenderingContext} */ var myContext;
+console.log(myContext.READ_BUFFER);
+// See whether WebGL 1.0 properties are correctly type checked.
+console.log(myContext.DEPTH_BUFFER_BIT);
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/test-webgl2.sh b/dom/canvas/test/webgl-conf/checkout/deqp/test-webgl2.sh
new file mode 100755
index 0000000000..508941f3c1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/test-webgl2.sh
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+: ${JAVA:=java}
+
+# Temporary shell script to help shake out the bugs to webgl2.js until
+# it's folded back into the Closure workspace.
+$JAVA -jar ../../../../closure/compiler.jar \
+ --use_only_custom_externs \
+ --js test-webgl2.js \
+ --externs temp_externs/chrome.js \
+ --externs temp_externs/deprecated.js \
+ --externs temp_externs/es3.js \
+ --externs temp_externs/es5.js \
+ --externs temp_externs/es6.js \
+ --externs temp_externs/es6_collections.js \
+ --externs temp_externs/fileapi.js \
+ --externs temp_externs/flash.js \
+ --externs temp_externs/gecko_css.js \
+ --externs temp_externs/gecko_dom.js \
+ --externs temp_externs/gecko_event.js \
+ --externs temp_externs/gecko_xml.js \
+ --externs temp_externs/google.js \
+ --externs temp_externs/html5.js \
+ --externs temp_externs/ie_css.js \
+ --externs temp_externs/ie_dom.js \
+ --externs temp_externs/ie_event.js \
+ --externs temp_externs/ie_vml.js \
+ --externs temp_externs/intl.js \
+ --externs temp_externs/iphone.js \
+ --externs temp_externs/mediasource.js \
+ --externs temp_externs/page_visibility.js \
+ --externs temp_externs/v8.js \
+ --externs temp_externs/w3c_anim_timing.js \
+ --externs temp_externs/w3c_css.js \
+ --externs temp_externs/w3c_css3d.js \
+ --externs temp_externs/w3c_device_sensor_event.js \
+ --externs temp_externs/w3c_dom1.js \
+ --externs temp_externs/w3c_dom2.js \
+ --externs temp_externs/w3c_dom3.js \
+ --externs temp_externs/w3c_elementtraversal.js \
+ --externs temp_externs/w3c_encoding.js \
+ --externs temp_externs/w3c_event.js \
+ --externs temp_externs/w3c_event3.js \
+ --externs temp_externs/w3c_geolocation.js \
+ --externs temp_externs/w3c_indexeddb.js \
+ --externs temp_externs/w3c_navigation_timing.js \
+ --externs temp_externs/w3c_range.js \
+ --externs temp_externs/w3c_rtc.js \
+ --externs temp_externs/w3c_selectors.js \
+ --externs temp_externs/w3c_xml.js \
+ --externs temp_externs/webkit_css.js \
+ --externs temp_externs/webkit_dom.js \
+ --externs temp_externs/webkit_event.js \
+ --externs temp_externs/webkit_notifications.js \
+ --externs temp_externs/webstorage.js \
+ --externs temp_externs/window.js \
+ --externs webgl2.js \
+ --compilation_level ADVANCED \
+ --warning_level VERBOSE \
+ --js_output_file /dev/null
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/webgl2.js b/dom/canvas/test/webgl-conf/checkout/deqp/webgl2.js
new file mode 100644
index 0000000000..91527fcbe7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/webgl2.js
@@ -0,0 +1,5520 @@
+/*
+ * Copyright 2010 The Closure Compiler Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// WebGL 2.0 portions:
+
+/*
+Copyright (c) 2019 The Khronos Group Inc.
+Use of this source code is governed by an MIT-style license that can be
+found in the LICENSE.txt file.
+*/
+
+/**
+ * @fileoverview Definitions for WebGL functions as described at
+ * http://www.khronos.org/registry/webgl/specs/latest/1.0 and
+ * http://www.khronos.org/registry/webgl/specs/latest/2.0
+ *
+ * This file is current up to the WebGL 2.0 spec, including extensions.
+ *
+ * This relies on html5.js being included for Canvas and Typed Array support.
+ *
+ * This includes some extensions defined at
+ * http://www.khronos.org/registry/webgl/extensions/
+ *
+ * This file will be merged back into the Closure workspace as soon as
+ * the WebGL 2.0 changes have been fully tested.
+ *
+ * @externs
+ */
+
+/**
+ * @constructor
+ * @noalias
+ * @private
+ */
+function WebGLRenderingContextBase() {}
+
+/** @typedef {number} */
+WebGLRenderingContextBase.GLenum;
+
+/** @type {number} */
+WebGLRenderingContextBase.DEPTH_BUFFER_BIT;
+
+/** @type {number} */
+WebGLRenderingContextBase.STENCIL_BUFFER_BIT;
+
+/** @type {number} */
+WebGLRenderingContextBase.COLOR_BUFFER_BIT;
+
+/** @type {number} */
+WebGLRenderingContextBase.POINTS;
+
+/** @type {number} */
+WebGLRenderingContextBase.LINES;
+
+/** @type {number} */
+WebGLRenderingContextBase.LINE_LOOP;
+
+/** @type {number} */
+WebGLRenderingContextBase.LINE_STRIP;
+
+/** @type {number} */
+WebGLRenderingContextBase.TRIANGLES;
+
+/** @type {number} */
+WebGLRenderingContextBase.TRIANGLE_STRIP;
+
+/** @type {number} */
+WebGLRenderingContextBase.TRIANGLE_FAN;
+
+/** @type {number} */
+WebGLRenderingContextBase.ZERO;
+
+/** @type {number} */
+WebGLRenderingContextBase.ONE;
+
+/** @type {number} */
+WebGLRenderingContextBase.SRC_COLOR;
+
+/** @type {number} */
+WebGLRenderingContextBase.ONE_MINUS_SRC_COLOR;
+
+/** @type {number} */
+WebGLRenderingContextBase.SRC_ALPHA;
+
+/** @type {number} */
+WebGLRenderingContextBase.ONE_MINUS_SRC_ALPHA;
+
+/** @type {number} */
+WebGLRenderingContextBase.DST_ALPHA;
+
+/** @type {number} */
+WebGLRenderingContextBase.ONE_MINUS_DST_ALPHA;
+
+/** @type {number} */
+WebGLRenderingContextBase.DST_COLOR;
+
+/** @type {number} */
+WebGLRenderingContextBase.ONE_MINUS_DST_COLOR;
+
+/** @type {number} */
+WebGLRenderingContextBase.SRC_ALPHA_SATURATE;
+
+/** @type {number} */
+WebGLRenderingContextBase.FUNC_ADD;
+
+/** @type {number} */
+WebGLRenderingContextBase.BLEND_EQUATION;
+
+/** @type {number} */
+WebGLRenderingContextBase.BLEND_EQUATION_RGB;
+
+/** @type {number} */
+WebGLRenderingContextBase.BLEND_EQUATION_ALPHA;
+
+/** @type {number} */
+WebGLRenderingContextBase.FUNC_SUBTRACT;
+
+/** @type {number} */
+WebGLRenderingContextBase.FUNC_REVERSE_SUBTRACT;
+
+/** @type {number} */
+WebGLRenderingContextBase.BLEND_DST_RGB;
+
+/** @type {number} */
+WebGLRenderingContextBase.BLEND_SRC_RGB;
+
+/** @type {number} */
+WebGLRenderingContextBase.BLEND_DST_ALPHA;
+
+/** @type {number} */
+WebGLRenderingContextBase.BLEND_SRC_ALPHA;
+
+/** @type {number} */
+WebGLRenderingContextBase.CONSTANT_COLOR;
+
+/** @type {number} */
+WebGLRenderingContextBase.ONE_MINUS_CONSTANT_COLOR;
+
+/** @type {number} */
+WebGLRenderingContextBase.CONSTANT_ALPHA;
+
+/** @type {number} */
+WebGLRenderingContextBase.ONE_MINUS_CONSTANT_ALPHA;
+
+/** @type {number} */
+WebGLRenderingContextBase.BLEND_COLOR;
+
+/** @type {number} */
+WebGLRenderingContextBase.ARRAY_BUFFER;
+
+/** @type {number} */
+WebGLRenderingContextBase.ELEMENT_ARRAY_BUFFER;
+
+/** @type {number} */
+WebGLRenderingContextBase.ARRAY_BUFFER_BINDING;
+
+/** @type {number} */
+WebGLRenderingContextBase.ELEMENT_ARRAY_BUFFER_BINDING;
+
+/** @type {number} */
+WebGLRenderingContextBase.STREAM_DRAW;
+
+/** @type {number} */
+WebGLRenderingContextBase.STATIC_DRAW;
+
+/** @type {number} */
+WebGLRenderingContextBase.DYNAMIC_DRAW;
+
+/** @type {number} */
+WebGLRenderingContextBase.BUFFER_SIZE;
+
+/** @type {number} */
+WebGLRenderingContextBase.BUFFER_USAGE;
+
+/** @type {number} */
+WebGLRenderingContextBase.CURRENT_VERTEX_ATTRIB;
+
+/** @type {number} */
+WebGLRenderingContextBase.FRONT;
+
+/** @type {number} */
+WebGLRenderingContextBase.BACK;
+
+/** @type {number} */
+WebGLRenderingContextBase.FRONT_AND_BACK;
+
+/** @type {number} */
+WebGLRenderingContextBase.CULL_FACE;
+
+/** @type {number} */
+WebGLRenderingContextBase.BLEND;
+
+/** @type {number} */
+WebGLRenderingContextBase.DITHER;
+
+/** @type {number} */
+WebGLRenderingContextBase.STENCIL_TEST;
+
+/** @type {number} */
+WebGLRenderingContextBase.DEPTH_TEST;
+
+/** @type {number} */
+WebGLRenderingContextBase.SCISSOR_TEST;
+
+/** @type {number} */
+WebGLRenderingContextBase.POLYGON_OFFSET_FILL;
+
+/** @type {number} */
+WebGLRenderingContextBase.SAMPLE_ALPHA_TO_COVERAGE;
+
+/** @type {number} */
+WebGLRenderingContextBase.SAMPLE_COVERAGE;
+
+/** @type {number} */
+WebGLRenderingContextBase.NO_ERROR;
+
+/** @type {number} */
+WebGLRenderingContextBase.INVALID_ENUM;
+
+/** @type {number} */
+WebGLRenderingContextBase.INVALID_VALUE;
+
+/** @type {number} */
+WebGLRenderingContextBase.INVALID_OPERATION;
+
+/** @type {number} */
+WebGLRenderingContextBase.OUT_OF_MEMORY;
+
+/** @type {number} */
+WebGLRenderingContextBase.CW;
+
+/** @type {number} */
+WebGLRenderingContextBase.CCW;
+
+/** @type {number} */
+WebGLRenderingContextBase.LINE_WIDTH;
+
+/** @type {number} */
+WebGLRenderingContextBase.ALIASED_POINT_SIZE_RANGE;
+
+/** @type {number} */
+WebGLRenderingContextBase.ALIASED_LINE_WIDTH_RANGE;
+
+/** @type {number} */
+WebGLRenderingContextBase.CULL_FACE_MODE;
+
+/** @type {number} */
+WebGLRenderingContextBase.FRONT_FACE;
+
+/** @type {number} */
+WebGLRenderingContextBase.DEPTH_RANGE;
+
+/** @type {number} */
+WebGLRenderingContextBase.DEPTH_WRITEMASK;
+
+/** @type {number} */
+WebGLRenderingContextBase.DEPTH_CLEAR_VALUE;
+
+/** @type {number} */
+WebGLRenderingContextBase.DEPTH_FUNC;
+
+/** @type {number} */
+WebGLRenderingContextBase.STENCIL_CLEAR_VALUE;
+
+/** @type {number} */
+WebGLRenderingContextBase.STENCIL_FUNC;
+
+/** @type {number} */
+WebGLRenderingContextBase.STENCIL_FAIL;
+
+/** @type {number} */
+WebGLRenderingContextBase.STENCIL_PASS_DEPTH_FAIL;
+
+/** @type {number} */
+WebGLRenderingContextBase.STENCIL_PASS_DEPTH_PASS;
+
+/** @type {number} */
+WebGLRenderingContextBase.STENCIL_REF;
+
+/** @type {number} */
+WebGLRenderingContextBase.STENCIL_VALUE_MASK;
+
+/** @type {number} */
+WebGLRenderingContextBase.STENCIL_WRITEMASK;
+
+/** @type {number} */
+WebGLRenderingContextBase.STENCIL_BACK_FUNC;
+
+/** @type {number} */
+WebGLRenderingContextBase.STENCIL_BACK_FAIL;
+
+/** @type {number} */
+WebGLRenderingContextBase.STENCIL_BACK_PASS_DEPTH_FAIL;
+
+/** @type {number} */
+WebGLRenderingContextBase.STENCIL_BACK_PASS_DEPTH_PASS;
+
+/** @type {number} */
+WebGLRenderingContextBase.STENCIL_BACK_REF;
+
+/** @type {number} */
+WebGLRenderingContextBase.STENCIL_BACK_VALUE_MASK;
+
+/** @type {number} */
+WebGLRenderingContextBase.STENCIL_BACK_WRITEMASK;
+
+/** @type {number} */
+WebGLRenderingContextBase.VIEWPORT;
+
+/** @type {number} */
+WebGLRenderingContextBase.SCISSOR_BOX;
+
+/** @type {number} */
+WebGLRenderingContextBase.COLOR_CLEAR_VALUE;
+
+/** @type {number} */
+WebGLRenderingContextBase.COLOR_WRITEMASK;
+
+/** @type {number} */
+WebGLRenderingContextBase.UNPACK_ALIGNMENT;
+
+/** @type {number} */
+WebGLRenderingContextBase.PACK_ALIGNMENT;
+
+/** @type {number} */
+WebGLRenderingContextBase.MAX_TEXTURE_SIZE;
+
+/** @type {number} */
+WebGLRenderingContextBase.MAX_VIEWPORT_DIMS;
+
+/** @type {number} */
+WebGLRenderingContextBase.SUBPIXEL_BITS;
+
+/** @type {number} */
+WebGLRenderingContextBase.RED_BITS;
+
+/** @type {number} */
+WebGLRenderingContextBase.GREEN_BITS;
+
+/** @type {number} */
+WebGLRenderingContextBase.BLUE_BITS;
+
+/** @type {number} */
+WebGLRenderingContextBase.ALPHA_BITS;
+
+/** @type {number} */
+WebGLRenderingContextBase.DEPTH_BITS;
+
+/** @type {number} */
+WebGLRenderingContextBase.STENCIL_BITS;
+
+/** @type {number} */
+WebGLRenderingContextBase.POLYGON_OFFSET_UNITS;
+
+/** @type {number} */
+WebGLRenderingContextBase.POLYGON_OFFSET_FACTOR;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE_BINDING_2D;
+
+/** @type {number} */
+WebGLRenderingContextBase.SAMPLE_BUFFERS;
+
+/** @type {number} */
+WebGLRenderingContextBase.SAMPLES;
+
+/** @type {number} */
+WebGLRenderingContextBase.SAMPLE_COVERAGE_VALUE;
+
+/** @type {number} */
+WebGLRenderingContextBase.SAMPLE_COVERAGE_INVERT;
+
+/** @type {number} */
+WebGLRenderingContextBase.COMPRESSED_TEXTURE_FORMATS;
+
+/** @type {number} */
+WebGLRenderingContextBase.DONT_CARE;
+
+/** @type {number} */
+WebGLRenderingContextBase.FASTEST;
+
+/** @type {number} */
+WebGLRenderingContextBase.NICEST;
+
+/** @type {number} */
+WebGLRenderingContextBase.GENERATE_MIPMAP_HINT;
+
+/** @type {number} */
+WebGLRenderingContextBase.BYTE;
+
+/** @type {number} */
+WebGLRenderingContextBase.UNSIGNED_BYTE;
+
+/** @type {number} */
+WebGLRenderingContextBase.SHORT;
+
+/** @type {number} */
+WebGLRenderingContextBase.UNSIGNED_SHORT;
+
+/** @type {number} */
+WebGLRenderingContextBase.INT;
+
+/** @type {number} */
+WebGLRenderingContextBase.UNSIGNED_INT;
+
+/** @type {number} */
+WebGLRenderingContextBase.FLOAT;
+
+/** @type {number} */
+WebGLRenderingContextBase.DEPTH_COMPONENT;
+
+/** @type {number} */
+WebGLRenderingContextBase.ALPHA;
+
+/** @type {number} */
+WebGLRenderingContextBase.RGB;
+
+/** @type {number} */
+WebGLRenderingContextBase.RGBA;
+
+/** @type {number} */
+WebGLRenderingContextBase.LUMINANCE;
+
+/** @type {number} */
+WebGLRenderingContextBase.LUMINANCE_ALPHA;
+
+/** @type {number} */
+WebGLRenderingContextBase.UNSIGNED_SHORT_4_4_4_4;
+
+/** @type {number} */
+WebGLRenderingContextBase.UNSIGNED_SHORT_5_5_5_1;
+
+/** @type {number} */
+WebGLRenderingContextBase.UNSIGNED_SHORT_5_6_5;
+
+/** @type {number} */
+WebGLRenderingContextBase.FRAGMENT_SHADER;
+
+/** @type {number} */
+WebGLRenderingContextBase.VERTEX_SHADER;
+
+/** @type {number} */
+WebGLRenderingContextBase.MAX_VERTEX_ATTRIBS;
+
+/** @type {number} */
+WebGLRenderingContextBase.MAX_VERTEX_UNIFORM_VECTORS;
+
+/** @type {number} */
+WebGLRenderingContextBase.MAX_VARYING_VECTORS;
+
+/** @type {number} */
+WebGLRenderingContextBase.MAX_COMBINED_TEXTURE_IMAGE_UNITS;
+
+/** @type {number} */
+WebGLRenderingContextBase.MAX_VERTEX_TEXTURE_IMAGE_UNITS;
+
+/** @type {number} */
+WebGLRenderingContextBase.MAX_TEXTURE_IMAGE_UNITS;
+
+/** @type {number} */
+WebGLRenderingContextBase.MAX_FRAGMENT_UNIFORM_VECTORS;
+
+/** @type {number} */
+WebGLRenderingContextBase.SHADER_TYPE;
+
+/** @type {number} */
+WebGLRenderingContextBase.DELETE_STATUS;
+
+/** @type {number} */
+WebGLRenderingContextBase.LINK_STATUS;
+
+/** @type {number} */
+WebGLRenderingContextBase.VALIDATE_STATUS;
+
+/** @type {number} */
+WebGLRenderingContextBase.ATTACHED_SHADERS;
+
+/** @type {number} */
+WebGLRenderingContextBase.ACTIVE_UNIFORMS;
+
+/** @type {number} */
+WebGLRenderingContextBase.ACTIVE_ATTRIBUTES;
+
+/** @type {number} */
+WebGLRenderingContextBase.SHADING_LANGUAGE_VERSION;
+
+/** @type {number} */
+WebGLRenderingContextBase.CURRENT_PROGRAM;
+
+/** @type {number} */
+WebGLRenderingContextBase.NEVER;
+
+/** @type {number} */
+WebGLRenderingContextBase.LESS;
+
+/** @type {number} */
+WebGLRenderingContextBase.EQUAL;
+
+/** @type {number} */
+WebGLRenderingContextBase.LEQUAL;
+
+/** @type {number} */
+WebGLRenderingContextBase.GREATER;
+
+/** @type {number} */
+WebGLRenderingContextBase.NOTEQUAL;
+
+/** @type {number} */
+WebGLRenderingContextBase.GEQUAL;
+
+/** @type {number} */
+WebGLRenderingContextBase.ALWAYS;
+
+/** @type {number} */
+WebGLRenderingContextBase.KEEP;
+
+/** @type {number} */
+WebGLRenderingContextBase.REPLACE;
+
+/** @type {number} */
+WebGLRenderingContextBase.INCR;
+
+/** @type {number} */
+WebGLRenderingContextBase.DECR;
+
+/** @type {number} */
+WebGLRenderingContextBase.INVERT;
+
+/** @type {number} */
+WebGLRenderingContextBase.INCR_WRAP;
+
+/** @type {number} */
+WebGLRenderingContextBase.DECR_WRAP;
+
+/** @type {number} */
+WebGLRenderingContextBase.VENDOR;
+
+/** @type {number} */
+WebGLRenderingContextBase.RENDERER;
+
+/** @type {number} */
+WebGLRenderingContextBase.VERSION;
+
+/** @type {number} */
+WebGLRenderingContextBase.NEAREST;
+
+/** @type {number} */
+WebGLRenderingContextBase.LINEAR;
+
+/** @type {number} */
+WebGLRenderingContextBase.NEAREST_MIPMAP_NEAREST;
+
+/** @type {number} */
+WebGLRenderingContextBase.LINEAR_MIPMAP_NEAREST;
+
+/** @type {number} */
+WebGLRenderingContextBase.NEAREST_MIPMAP_LINEAR;
+
+/** @type {number} */
+WebGLRenderingContextBase.LINEAR_MIPMAP_LINEAR;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE_MAG_FILTER;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE_MIN_FILTER;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE_WRAP_S;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE_WRAP_T;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE_2D;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE_CUBE_MAP;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE_BINDING_CUBE_MAP;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE_CUBE_MAP_POSITIVE_X;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE_CUBE_MAP_NEGATIVE_X;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE_CUBE_MAP_POSITIVE_Y;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE_CUBE_MAP_NEGATIVE_Y;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE_CUBE_MAP_POSITIVE_Z;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE_CUBE_MAP_NEGATIVE_Z;
+
+/** @type {number} */
+WebGLRenderingContextBase.MAX_CUBE_MAP_TEXTURE_SIZE;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE0;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE1;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE2;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE3;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE4;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE5;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE6;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE7;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE8;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE9;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE10;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE11;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE12;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE13;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE14;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE15;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE16;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE17;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE18;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE19;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE20;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE21;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE22;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE23;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE24;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE25;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE26;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE27;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE28;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE29;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE30;
+
+/** @type {number} */
+WebGLRenderingContextBase.TEXTURE31;
+
+/** @type {number} */
+WebGLRenderingContextBase.ACTIVE_TEXTURE;
+
+/** @type {number} */
+WebGLRenderingContextBase.REPEAT;
+
+/** @type {number} */
+WebGLRenderingContextBase.CLAMP_TO_EDGE;
+
+/** @type {number} */
+WebGLRenderingContextBase.MIRRORED_REPEAT;
+
+/** @type {number} */
+WebGLRenderingContextBase.FLOAT_VEC2;
+
+/** @type {number} */
+WebGLRenderingContextBase.FLOAT_VEC3;
+
+/** @type {number} */
+WebGLRenderingContextBase.FLOAT_VEC4;
+
+/** @type {number} */
+WebGLRenderingContextBase.INT_VEC2;
+
+/** @type {number} */
+WebGLRenderingContextBase.INT_VEC3;
+
+/** @type {number} */
+WebGLRenderingContextBase.INT_VEC4;
+
+/** @type {number} */
+WebGLRenderingContextBase.BOOL;
+
+/** @type {number} */
+WebGLRenderingContextBase.BOOL_VEC2;
+
+/** @type {number} */
+WebGLRenderingContextBase.BOOL_VEC3;
+
+/** @type {number} */
+WebGLRenderingContextBase.BOOL_VEC4;
+
+/** @type {number} */
+WebGLRenderingContextBase.FLOAT_MAT2;
+
+/** @type {number} */
+WebGLRenderingContextBase.FLOAT_MAT3;
+
+/** @type {number} */
+WebGLRenderingContextBase.FLOAT_MAT4;
+
+/** @type {number} */
+WebGLRenderingContextBase.SAMPLER_2D;
+
+/** @type {number} */
+WebGLRenderingContextBase.SAMPLER_CUBE;
+
+/** @type {number} */
+WebGLRenderingContextBase.VERTEX_ATTRIB_ARRAY_ENABLED;
+
+/** @type {number} */
+WebGLRenderingContextBase.VERTEX_ATTRIB_ARRAY_SIZE;
+
+/** @type {number} */
+WebGLRenderingContextBase.VERTEX_ATTRIB_ARRAY_STRIDE;
+
+/** @type {number} */
+WebGLRenderingContextBase.VERTEX_ATTRIB_ARRAY_TYPE;
+
+/** @type {number} */
+WebGLRenderingContextBase.VERTEX_ATTRIB_ARRAY_NORMALIZED;
+
+/** @type {number} */
+WebGLRenderingContextBase.VERTEX_ATTRIB_ARRAY_POINTER;
+
+/** @type {number} */
+WebGLRenderingContextBase.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING;
+
+/** @type {number} */
+WebGLRenderingContextBase.IMPLEMENTATION_COLOR_READ_TYPE;
+
+/** @type {number} */
+WebGLRenderingContextBase.IMPLEMENTATION_COLOR_READ_FORMAT;
+
+/** @type {number} */
+WebGLRenderingContextBase.COMPILE_STATUS;
+
+/** @type {number} */
+WebGLRenderingContextBase.LOW_FLOAT;
+
+/** @type {number} */
+WebGLRenderingContextBase.MEDIUM_FLOAT;
+
+/** @type {number} */
+WebGLRenderingContextBase.HIGH_FLOAT;
+
+/** @type {number} */
+WebGLRenderingContextBase.LOW_INT;
+
+/** @type {number} */
+WebGLRenderingContextBase.MEDIUM_INT;
+
+/** @type {number} */
+WebGLRenderingContextBase.HIGH_INT;
+
+/** @type {number} */
+WebGLRenderingContextBase.FRAMEBUFFER;
+
+/** @type {number} */
+WebGLRenderingContextBase.RENDERBUFFER;
+
+/** @type {number} */
+WebGLRenderingContextBase.RGBA4;
+
+/** @type {number} */
+WebGLRenderingContextBase.RGB5_A1;
+
+/** @type {number} */
+WebGLRenderingContextBase.RGB565;
+
+/** @type {number} */
+WebGLRenderingContextBase.DEPTH_COMPONENT16;
+
+/** @type {number} */
+WebGLRenderingContextBase.STENCIL_INDEX;
+
+/** @type {number} */
+WebGLRenderingContextBase.STENCIL_INDEX8;
+
+/** @type {number} */
+WebGLRenderingContextBase.DEPTH_STENCIL;
+
+/** @type {number} */
+WebGLRenderingContextBase.RENDERBUFFER_WIDTH;
+
+/** @type {number} */
+WebGLRenderingContextBase.RENDERBUFFER_HEIGHT;
+
+/** @type {number} */
+WebGLRenderingContextBase.RENDERBUFFER_INTERNAL_FORMAT;
+
+/** @type {number} */
+WebGLRenderingContextBase.RENDERBUFFER_RED_SIZE;
+
+/** @type {number} */
+WebGLRenderingContextBase.RENDERBUFFER_GREEN_SIZE;
+
+/** @type {number} */
+WebGLRenderingContextBase.RENDERBUFFER_BLUE_SIZE;
+
+/** @type {number} */
+WebGLRenderingContextBase.RENDERBUFFER_ALPHA_SIZE;
+
+/** @type {number} */
+WebGLRenderingContextBase.RENDERBUFFER_DEPTH_SIZE;
+
+/** @type {number} */
+WebGLRenderingContextBase.RENDERBUFFER_STENCIL_SIZE;
+
+/** @type {number} */
+WebGLRenderingContextBase.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE;
+
+/** @type {number} */
+WebGLRenderingContextBase.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME;
+
+/** @type {number} */
+WebGLRenderingContextBase.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL;
+
+/** @type {number} */
+WebGLRenderingContextBase.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE;
+
+/** @type {number} */
+WebGLRenderingContextBase.COLOR_ATTACHMENT0;
+
+/** @type {number} */
+WebGLRenderingContextBase.DEPTH_ATTACHMENT;
+
+/** @type {number} */
+WebGLRenderingContextBase.STENCIL_ATTACHMENT;
+
+/** @type {number} */
+WebGLRenderingContextBase.DEPTH_STENCIL_ATTACHMENT;
+
+/** @type {number} */
+WebGLRenderingContextBase.NONE;
+
+/** @type {number} */
+WebGLRenderingContextBase.FRAMEBUFFER_COMPLETE;
+
+/** @type {number} */
+WebGLRenderingContextBase.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
+
+/** @type {number} */
+WebGLRenderingContextBase.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT;
+
+/** @type {number} */
+WebGLRenderingContextBase.FRAMEBUFFER_INCOMPLETE_DIMENSIONS;
+
+/** @type {number} */
+WebGLRenderingContextBase.FRAMEBUFFER_UNSUPPORTED;
+
+/** @type {number} */
+WebGLRenderingContextBase.FRAMEBUFFER_BINDING;
+
+/** @type {number} */
+WebGLRenderingContextBase.RENDERBUFFER_BINDING;
+
+/** @type {number} */
+WebGLRenderingContextBase.MAX_RENDERBUFFER_SIZE;
+
+/** @type {number} */
+WebGLRenderingContextBase.INVALID_FRAMEBUFFER_OPERATION;
+
+/** @type {number} */
+WebGLRenderingContextBase.UNPACK_FLIP_Y_WEBGL;
+
+/** @type {number} */
+WebGLRenderingContextBase.UNPACK_PREMULTIPLY_ALPHA_WEBGL;
+
+/** @type {number} */
+WebGLRenderingContextBase.CONTEXT_LOST_WEBGL;
+
+/** @type {number} */
+WebGLRenderingContextBase.UNPACK_COLORSPACE_CONVERSION_WEBGL;
+
+/** @type {number} */
+WebGLRenderingContextBase.BROWSER_DEFAULT_WEBGL;
+
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.DEPTH_BUFFER_BIT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.STENCIL_BUFFER_BIT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.COLOR_BUFFER_BIT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.POINTS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.LINES;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.LINE_LOOP;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.LINE_STRIP;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TRIANGLES;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TRIANGLE_STRIP;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TRIANGLE_FAN;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.ZERO;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.ONE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.SRC_COLOR;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.ONE_MINUS_SRC_COLOR;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.SRC_ALPHA;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.ONE_MINUS_SRC_ALPHA;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.DST_ALPHA;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.ONE_MINUS_DST_ALPHA;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.DST_COLOR;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.ONE_MINUS_DST_COLOR;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.SRC_ALPHA_SATURATE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.FUNC_ADD;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.BLEND_EQUATION;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.BLEND_EQUATION_RGB;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.BLEND_EQUATION_ALPHA;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.FUNC_SUBTRACT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.FUNC_REVERSE_SUBTRACT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.BLEND_DST_RGB;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.BLEND_SRC_RGB;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.BLEND_DST_ALPHA;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.BLEND_SRC_ALPHA;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.CONSTANT_COLOR;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.ONE_MINUS_CONSTANT_COLOR;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.CONSTANT_ALPHA;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.ONE_MINUS_CONSTANT_ALPHA;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.BLEND_COLOR;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.ARRAY_BUFFER;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.ELEMENT_ARRAY_BUFFER;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.ARRAY_BUFFER_BINDING;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.ELEMENT_ARRAY_BUFFER_BINDING;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.STREAM_DRAW;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.STATIC_DRAW;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.DYNAMIC_DRAW;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.BUFFER_SIZE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.BUFFER_USAGE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.CURRENT_VERTEX_ATTRIB;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.FRONT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.BACK;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.FRONT_AND_BACK;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.CULL_FACE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.BLEND;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.DITHER;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.STENCIL_TEST;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.DEPTH_TEST;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.SCISSOR_TEST;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.POLYGON_OFFSET_FILL;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.SAMPLE_ALPHA_TO_COVERAGE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.SAMPLE_COVERAGE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.NO_ERROR;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.INVALID_ENUM;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.INVALID_VALUE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.INVALID_OPERATION;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.OUT_OF_MEMORY;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.CW;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.CCW;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.LINE_WIDTH;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.ALIASED_POINT_SIZE_RANGE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.ALIASED_LINE_WIDTH_RANGE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.CULL_FACE_MODE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.FRONT_FACE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.DEPTH_RANGE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.DEPTH_WRITEMASK;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.DEPTH_CLEAR_VALUE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.DEPTH_FUNC;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.STENCIL_CLEAR_VALUE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.STENCIL_FUNC;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.STENCIL_FAIL;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.STENCIL_PASS_DEPTH_FAIL;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.STENCIL_PASS_DEPTH_PASS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.STENCIL_REF;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.STENCIL_VALUE_MASK;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.STENCIL_WRITEMASK;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.STENCIL_BACK_FUNC;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.STENCIL_BACK_FAIL;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.STENCIL_BACK_PASS_DEPTH_FAIL;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.STENCIL_BACK_PASS_DEPTH_PASS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.STENCIL_BACK_REF;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.STENCIL_BACK_VALUE_MASK;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.STENCIL_BACK_WRITEMASK;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.VIEWPORT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.SCISSOR_BOX;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.COLOR_CLEAR_VALUE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.COLOR_WRITEMASK;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.UNPACK_ALIGNMENT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.PACK_ALIGNMENT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.MAX_TEXTURE_SIZE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.MAX_VIEWPORT_DIMS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.SUBPIXEL_BITS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.RED_BITS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.GREEN_BITS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.BLUE_BITS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.ALPHA_BITS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.DEPTH_BITS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.STENCIL_BITS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.POLYGON_OFFSET_UNITS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.POLYGON_OFFSET_FACTOR;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE_BINDING_2D;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.SAMPLE_BUFFERS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.SAMPLES;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.SAMPLE_COVERAGE_VALUE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.SAMPLE_COVERAGE_INVERT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.COMPRESSED_TEXTURE_FORMATS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.DONT_CARE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.FASTEST;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.NICEST;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.GENERATE_MIPMAP_HINT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.BYTE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.UNSIGNED_BYTE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.SHORT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.UNSIGNED_SHORT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.INT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.UNSIGNED_INT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.FLOAT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.DEPTH_COMPONENT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.ALPHA;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.RGB;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.RGBA;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.LUMINANCE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.LUMINANCE_ALPHA;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.UNSIGNED_SHORT_4_4_4_4;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.UNSIGNED_SHORT_5_5_5_1;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.UNSIGNED_SHORT_5_6_5;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.FRAGMENT_SHADER;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.VERTEX_SHADER;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.MAX_VERTEX_ATTRIBS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.MAX_VERTEX_UNIFORM_VECTORS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.MAX_VARYING_VECTORS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.MAX_COMBINED_TEXTURE_IMAGE_UNITS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.MAX_VERTEX_TEXTURE_IMAGE_UNITS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.MAX_TEXTURE_IMAGE_UNITS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.MAX_FRAGMENT_UNIFORM_VECTORS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.SHADER_TYPE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.DELETE_STATUS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.LINK_STATUS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.VALIDATE_STATUS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.ATTACHED_SHADERS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.ACTIVE_UNIFORMS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.ACTIVE_ATTRIBUTES;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.SHADING_LANGUAGE_VERSION;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.CURRENT_PROGRAM;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.NEVER;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.LESS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.EQUAL;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.LEQUAL;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.GREATER;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.NOTEQUAL;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.GEQUAL;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.ALWAYS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.KEEP;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.REPLACE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.INCR;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.DECR;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.INVERT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.INCR_WRAP;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.DECR_WRAP;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.VENDOR;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.RENDERER;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.VERSION;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.NEAREST;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.LINEAR;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.NEAREST_MIPMAP_NEAREST;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.LINEAR_MIPMAP_NEAREST;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.NEAREST_MIPMAP_LINEAR;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.LINEAR_MIPMAP_LINEAR;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE_MAG_FILTER;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE_MIN_FILTER;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE_WRAP_S;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE_WRAP_T;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE_2D;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE_CUBE_MAP;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE_BINDING_CUBE_MAP;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE_CUBE_MAP_POSITIVE_X;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE_CUBE_MAP_NEGATIVE_X;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE_CUBE_MAP_POSITIVE_Y;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE_CUBE_MAP_NEGATIVE_Y;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE_CUBE_MAP_POSITIVE_Z;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE_CUBE_MAP_NEGATIVE_Z;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.MAX_CUBE_MAP_TEXTURE_SIZE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE0;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE1;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE2;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE3;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE4;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE5;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE6;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE7;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE8;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE9;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE10;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE11;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE12;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE13;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE14;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE15;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE16;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE17;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE18;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE19;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE20;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE21;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE22;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE23;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE24;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE25;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE26;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE27;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE28;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE29;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE30;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.TEXTURE31;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.ACTIVE_TEXTURE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.REPEAT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.CLAMP_TO_EDGE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.MIRRORED_REPEAT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.FLOAT_VEC2;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.FLOAT_VEC3;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.FLOAT_VEC4;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.INT_VEC2;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.INT_VEC3;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.INT_VEC4;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.BOOL;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.BOOL_VEC2;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.BOOL_VEC3;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.BOOL_VEC4;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.FLOAT_MAT2;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.FLOAT_MAT3;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.FLOAT_MAT4;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.SAMPLER_2D;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.SAMPLER_CUBE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.VERTEX_ATTRIB_ARRAY_ENABLED;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.VERTEX_ATTRIB_ARRAY_SIZE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.VERTEX_ATTRIB_ARRAY_STRIDE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.VERTEX_ATTRIB_ARRAY_TYPE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.VERTEX_ATTRIB_ARRAY_NORMALIZED;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.VERTEX_ATTRIB_ARRAY_POINTER;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.IMPLEMENTATION_COLOR_READ_TYPE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.IMPLEMENTATION_COLOR_READ_FORMAT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.COMPILE_STATUS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.LOW_FLOAT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.MEDIUM_FLOAT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.HIGH_FLOAT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.LOW_INT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.MEDIUM_INT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.HIGH_INT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.FRAMEBUFFER;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.RENDERBUFFER;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.RGBA4;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.RGB5_A1;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.RGB565;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.DEPTH_COMPONENT16;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.STENCIL_INDEX;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.STENCIL_INDEX8;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.DEPTH_STENCIL;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.RENDERBUFFER_WIDTH;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.RENDERBUFFER_HEIGHT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.RENDERBUFFER_INTERNAL_FORMAT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.RENDERBUFFER_RED_SIZE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.RENDERBUFFER_GREEN_SIZE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.RENDERBUFFER_BLUE_SIZE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.RENDERBUFFER_ALPHA_SIZE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.RENDERBUFFER_DEPTH_SIZE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.RENDERBUFFER_STENCIL_SIZE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.COLOR_ATTACHMENT0;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.DEPTH_ATTACHMENT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.STENCIL_ATTACHMENT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.DEPTH_STENCIL_ATTACHMENT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.NONE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.FRAMEBUFFER_COMPLETE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.FRAMEBUFFER_INCOMPLETE_DIMENSIONS;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.FRAMEBUFFER_UNSUPPORTED;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.FRAMEBUFFER_BINDING;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.RENDERBUFFER_BINDING;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.MAX_RENDERBUFFER_SIZE;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.INVALID_FRAMEBUFFER_OPERATION;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.UNPACK_FLIP_Y_WEBGL;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.UNPACK_PREMULTIPLY_ALPHA_WEBGL;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.CONTEXT_LOST_WEBGL;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.UNPACK_COLORSPACE_CONVERSION_WEBGL;
+
+/** @type {number} */
+WebGLRenderingContextBase.prototype.BROWSER_DEFAULT_WEBGL;
+
+
+/**
+ * @type {!HTMLCanvasElement}
+ */
+WebGLRenderingContextBase.prototype.canvas;
+
+/**
+ * @type {number}
+ */
+WebGLRenderingContextBase.prototype.drawingBufferWidth;
+
+/**
+ * @type {number}
+ */
+WebGLRenderingContextBase.prototype.drawingBufferHeight;
+
+/**
+ * @return {!WebGLContextAttributes}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.getContextAttributes = function() {};
+
+/**
+ * @return {boolean}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.isContextLost = function() {};
+
+/**
+ * @return {!Array.<string>}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.getSupportedExtensions = function() {};
+
+/**
+ * Note that this has side effects by enabling the extension even if the
+ * result is not used.
+ * @param {string} name
+ * @return {Object}
+ */
+WebGLRenderingContextBase.prototype.getExtension = function(name) {};
+
+/**
+ * @param {number} texture
+ */
+WebGLRenderingContextBase.prototype.activeTexture = function(texture) {};
+
+/**
+ * @param {WebGLProgram} program
+ * @param {WebGLShader} shader
+ */
+WebGLRenderingContextBase.prototype.attachShader = function(program, shader) {};
+
+/**
+ * @param {WebGLProgram} program
+ * @param {number} index
+ * @param {string} name
+ */
+WebGLRenderingContextBase.prototype.bindAttribLocation = function(
+ program, index, name) {};
+
+/**
+ * @param {number} target
+ * @param {WebGLBuffer} buffer
+ */
+WebGLRenderingContextBase.prototype.bindBuffer = function(target, buffer) {};
+
+/**
+ * @param {number} target
+ * @param {WebGLFramebuffer} buffer
+ */
+WebGLRenderingContextBase.prototype.bindFramebuffer = function(target, buffer) {};
+
+/**
+ * @param {number} target
+ * @param {WebGLRenderbuffer} buffer
+ */
+WebGLRenderingContextBase.prototype.bindRenderbuffer = function(target, buffer) {};
+
+/**
+ * @param {number} target
+ * @param {WebGLTexture} texture
+ */
+WebGLRenderingContextBase.prototype.bindTexture = function(target, texture) {};
+
+/**
+ * @param {number} red
+ * @param {number} green
+ * @param {number} blue
+ * @param {number} alpha
+ */
+WebGLRenderingContextBase.prototype.blendColor = function(
+ red, blue, green, alpha) {};
+
+/**
+ * @param {number} mode
+ */
+WebGLRenderingContextBase.prototype.blendEquation = function(mode) {};
+
+/**
+ * @param {number} modeRGB
+ * @param {number} modeAlpha
+ */
+WebGLRenderingContextBase.prototype.blendEquationSeparate = function(
+ modeRGB, modeAlpha) {};
+
+/**
+ * @param {number} sfactor
+ * @param {number} dfactor
+ */
+WebGLRenderingContextBase.prototype.blendFunc = function(sfactor, dfactor) {};
+
+/**
+ * @param {number} srcRGB
+ * @param {number} dstRGB
+ * @param {number} srcAlpha
+ * @param {number} dstAlpha
+ */
+WebGLRenderingContextBase.prototype.blendFuncSeparate = function(
+ srcRGB, dstRGB, srcAlpha, dstAlpha) {};
+
+/**
+ * @param {number} target
+ * @param {ArrayBufferView|ArrayBuffer|number} data
+ * @param {number} usage
+ */
+WebGLRenderingContextBase.prototype.bufferData = function(target, data, usage) {};
+
+/**
+ * @param {number} target
+ * @param {number} offset
+ * @param {ArrayBufferView|ArrayBuffer} data
+ */
+WebGLRenderingContextBase.prototype.bufferSubData = function(
+ target, offset, data) {};
+
+/**
+ * @param {number} target
+ * @return {number}
+ */
+WebGLRenderingContextBase.prototype.checkFramebufferStatus = function(target) {};
+
+/**
+ * @param {number} mask
+ */
+WebGLRenderingContextBase.prototype.clear = function(mask) {};
+
+/**
+ * @param {number} red
+ * @param {number} green
+ * @param {number} blue
+ * @param {number} alpha
+ */
+WebGLRenderingContextBase.prototype.clearColor = function(
+ red, green, blue, alpha) {};
+
+/**
+ * @param {number} depth
+ */
+WebGLRenderingContextBase.prototype.clearDepth = function(depth) {};
+
+/**
+ * @param {number} s
+ */
+WebGLRenderingContextBase.prototype.clearStencil = function(s) {};
+
+/**
+ * @param {boolean} red
+ * @param {boolean} green
+ * @param {boolean} blue
+ * @param {boolean} alpha
+ */
+WebGLRenderingContextBase.prototype.colorMask = function(
+ red, green, blue, alpha) {};
+
+/**
+ * @param {WebGLShader} shader
+ */
+WebGLRenderingContextBase.prototype.compileShader = function(shader) {};
+
+/**
+ * @param {number} target
+ * @param {number} level
+ * @param {number} internalformat
+ * @param {number} width
+ * @param {number} height
+ * @param {number} border
+ * @param {ArrayBufferView} data
+ */
+WebGLRenderingContextBase.prototype.compressedTexImage2D = function(
+ target, level, internalformat, width, height, border, data) {};
+
+/**
+ * @param {number} target
+ * @param {number} level
+ * @param {number} xoffset
+ * @param {number} yoffset
+ * @param {number} width
+ * @param {number} height
+ * @param {number} format
+ * @param {ArrayBufferView} data
+ */
+WebGLRenderingContextBase.prototype.compressedTexSubImage2D = function(
+ target, level, xoffset, yoffset, width, height, format, data) {};
+
+/**
+ * @param {number} target
+ * @param {number} level
+ * @param {number} format
+ * @param {number} x
+ * @param {number} y
+ * @param {number} width
+ * @param {number} height
+ * @param {number} border
+ */
+WebGLRenderingContextBase.prototype.copyTexImage2D = function(
+ target, level, format, x, y, width, height, border) {};
+
+/**
+ * @param {number} target
+ * @param {number} level
+ * @param {number} xoffset
+ * @param {number} yoffset
+ * @param {number} x
+ * @param {number} y
+ * @param {number} width
+ * @param {number} height
+ */
+WebGLRenderingContextBase.prototype.copyTexSubImage2D = function(
+ target, level, xoffset, yoffset, x, y, width, height) {};
+
+/**
+ * @return {!WebGLBuffer}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.createBuffer = function() {};
+
+/**
+ * @return {!WebGLFramebuffer}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.createFramebuffer = function() {};
+
+/**
+ * @return {!WebGLProgram}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.createProgram = function() {};
+
+/**
+ * @return {!WebGLRenderbuffer}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.createRenderbuffer = function() {};
+
+/**
+ * @param {number} type
+ * @return {!WebGLShader}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.createShader = function(type) {};
+
+/**
+ * @return {!WebGLTexture}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.createTexture = function() {};
+
+/**
+ * @param {number} mode
+ */
+WebGLRenderingContextBase.prototype.cullFace = function(mode) {};
+
+/**
+ * @param {WebGLBuffer} buffer
+ */
+WebGLRenderingContextBase.prototype.deleteBuffer = function(buffer) {};
+
+/**
+ * @param {WebGLFramebuffer} buffer
+ */
+WebGLRenderingContextBase.prototype.deleteFramebuffer = function(buffer) {};
+
+/**
+ * @param {WebGLProgram} program
+ */
+WebGLRenderingContextBase.prototype.deleteProgram = function(program) {};
+
+/**
+ * @param {WebGLRenderbuffer} buffer
+ */
+WebGLRenderingContextBase.prototype.deleteRenderbuffer = function(buffer) {};
+
+/**
+ * @param {WebGLShader} shader
+ */
+WebGLRenderingContextBase.prototype.deleteShader = function(shader) {};
+
+/**
+ * @param {WebGLTexture} texture
+ */
+WebGLRenderingContextBase.prototype.deleteTexture = function(texture) {};
+
+/**
+ * @param {number} func
+ */
+WebGLRenderingContextBase.prototype.depthFunc = function(func) {};
+
+/**
+ * @param {boolean} flag
+ */
+WebGLRenderingContextBase.prototype.depthMask = function(flag) {};
+
+/**
+ * @param {number} nearVal
+ * @param {number} farVal
+ */
+WebGLRenderingContextBase.prototype.depthRange = function(nearVal, farVal) {};
+
+/**
+ * @param {WebGLProgram} program
+ * @param {WebGLShader} shader
+ */
+WebGLRenderingContextBase.prototype.detachShader = function(program, shader) {};
+
+/**
+ * @param {number} flags
+ */
+WebGLRenderingContextBase.prototype.disable = function(flags) {};
+
+/**
+ * @param {number} index
+ */
+WebGLRenderingContextBase.prototype.disableVertexAttribArray = function(
+ index) {};
+
+/**
+ * @param {number} mode
+ * @param {number} first
+ * @param {number} count
+ */
+WebGLRenderingContextBase.prototype.drawArrays = function(mode, first, count) {};
+
+/**
+ * @param {number} mode
+ * @param {number} count
+ * @param {number} type
+ * @param {number} offset
+ */
+WebGLRenderingContextBase.prototype.drawElements = function(
+ mode, count, type, offset) {};
+
+/**
+ * @param {number} cap
+ */
+WebGLRenderingContextBase.prototype.enable = function(cap) {};
+
+/**
+ * @param {number} index
+ */
+WebGLRenderingContextBase.prototype.enableVertexAttribArray = function(
+ index) {};
+
+WebGLRenderingContextBase.prototype.finish = function() {};
+
+WebGLRenderingContextBase.prototype.flush = function() {};
+
+/**
+ * @param {number} target
+ * @param {number} attachment
+ * @param {number} renderbuffertarget
+ * @param {WebGLRenderbuffer} renderbuffer
+ */
+WebGLRenderingContextBase.prototype.framebufferRenderbuffer = function(
+ target, attachment, renderbuffertarget, renderbuffer) {};
+
+/**
+ * @param {number} target
+ * @param {number} attachment
+ * @param {number} textarget
+ * @param {WebGLTexture} texture
+ * @param {number} level
+ */
+WebGLRenderingContextBase.prototype.framebufferTexture2D = function(
+ target, attachment, textarget, texture, level) {};
+
+/**
+ * @param {number} mode
+ */
+WebGLRenderingContextBase.prototype.frontFace = function(mode) {};
+
+/**
+ * @param {number} target
+ */
+WebGLRenderingContextBase.prototype.generateMipmap = function(target) {};
+
+/**
+ * @param {WebGLProgram} program
+ * @param {number} index
+ * @return {WebGLActiveInfo}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.getActiveAttrib = function(program, index) {};
+
+/**
+ * @param {WebGLProgram} program
+ * @param {number} index
+ * @return {WebGLActiveInfo}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.getActiveUniform = function(program, index) {};
+
+/**
+ * @param {WebGLProgram} program
+ * @return {!Array.<WebGLShader>}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.getAttachedShaders = function(program) {};
+
+/**
+ * @param {WebGLProgram} program
+ * @param {string} name
+ * @return {number}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.getAttribLocation = function(program, name) {};
+
+/**
+ * @param {number} target
+ * @param {number} pname
+ * @return {*}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.getBufferParameter = function(target, pname) {};
+
+/**
+ * @param {number} pname
+ * @return {*}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.getParameter = function(pname) {};
+
+/**
+ * @return {number}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.getError = function() {};
+
+/**
+ * @param {number} target
+ * @param {number} attachment
+ * @param {number} pname
+ * @return {*}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.getFramebufferAttachmentParameter = function(
+ target, attachment, pname) {};
+
+/**
+ * @param {WebGLProgram} program
+ * @param {number} pname
+ * @return {*}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.getProgramParameter = function(
+ program, pname) {};
+
+/**
+ * @param {WebGLProgram} program
+ * @return {string}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.getProgramInfoLog = function(program) {};
+
+/**
+ * @param {number} target
+ * @param {number} pname
+ * @return {*}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.getRenderbufferParameter = function(
+ target, pname) {};
+
+/**
+ * @param {WebGLShader} shader
+ * @param {number} pname
+ * @return {*}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.getShaderParameter = function(shader, pname) {};
+
+/**
+ * @param {number} shadertype
+ * @param {number} precisiontype
+ * @return {WebGLShaderPrecisionFormat}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.getShaderPrecisionFormat = function(shadertype,
+ precisiontype) {};
+
+/**
+ * @param {WebGLShader} shader
+ * @return {string}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.getShaderInfoLog = function(shader) {};
+
+/**
+ * @param {WebGLShader} shader
+ * @return {string}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.getShaderSource = function(shader) {};
+
+/**
+ * @param {number} target
+ * @param {number} pname
+ * @return {*}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.getTexParameter = function(target, pname) {};
+
+/**
+ * @param {WebGLProgram} program
+ * @param {WebGLUniformLocation} location
+ * @return {*}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.getUniform = function(program, location) {};
+
+/**
+ * @param {WebGLProgram} program
+ * @param {string} name
+ * @return {WebGLUniformLocation}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.getUniformLocation = function(program, name) {};
+
+/**
+ * @param {number} index
+ * @param {number} pname
+ * @return {*}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.getVertexAttrib = function(index, pname) {};
+
+/**
+ * @param {number} index
+ * @param {number} pname
+ * @return {number}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.getVertexAttribOffset = function(
+ index, pname) {};
+
+/**
+ * @param {number} target
+ * @param {number} mode
+ */
+WebGLRenderingContextBase.prototype.hint = function(target, mode) {};
+
+/**
+ * @param {WebGLObject} buffer
+ * @return {boolean}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.isBuffer = function(buffer) {};
+
+/**
+ * @param {number} cap
+ * @return {boolean}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.isEnabled = function(cap) {};
+
+/**
+ * @param {WebGLObject} framebuffer
+ * @return {boolean}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.isFramebuffer = function(framebuffer) {};
+
+/**
+ * @param {WebGLObject} program
+ * @return {boolean}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.isProgram = function(program) {};
+
+/**
+ * @param {WebGLObject} renderbuffer
+ * @return {boolean}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.isRenderbuffer = function(renderbuffer) {};
+
+/**
+ * @param {WebGLObject} shader
+ * @return {boolean}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.isShader = function(shader) {};
+
+/**
+ * @param {WebGLObject} texture
+ * @return {boolean}
+ * @nosideeffects
+ */
+WebGLRenderingContextBase.prototype.isTexture = function(texture) {};
+
+/**
+ * @param {number} width
+ */
+WebGLRenderingContextBase.prototype.lineWidth = function(width) {};
+
+/**
+ * @param {WebGLProgram} program
+ */
+WebGLRenderingContextBase.prototype.linkProgram = function(program) {};
+
+/**
+ * @param {number} pname
+ * @param {number} param
+ */
+WebGLRenderingContextBase.prototype.pixelStorei = function(pname, param) {};
+
+/**
+ * @param {number} factor
+ * @param {number} units
+ */
+WebGLRenderingContextBase.prototype.polygonOffset = function(factor, units) {};
+
+/**
+ * @param {number} x
+ * @param {number} y
+ * @param {number} width
+ * @param {number} height
+ * @param {number} format
+ * @param {number} type
+ * @param {ArrayBufferView} pixels
+ */
+WebGLRenderingContextBase.prototype.readPixels = function(
+ x, y, width, height, format, type, pixels) {};
+
+/**
+ * @param {number} target
+ * @param {number} internalformat
+ * @param {number} width
+ * @param {number} height
+ */
+WebGLRenderingContextBase.prototype.renderbufferStorage = function(
+ target, internalformat, width, height) {};
+
+/**
+ * @param {number} coverage
+ * @param {boolean} invert
+ */
+WebGLRenderingContextBase.prototype.sampleCoverage = function(coverage, invert) {};
+
+/**
+ * @param {number} x
+ * @param {number} y
+ * @param {number} width
+ * @param {number} height
+ */
+WebGLRenderingContextBase.prototype.scissor = function(x, y, width, height) {};
+
+/**
+ * @param {WebGLShader} shader
+ * @param {string} source
+ */
+WebGLRenderingContextBase.prototype.shaderSource = function(shader, source) {};
+
+/**
+ * @param {number} func
+ * @param {number} ref
+ * @param {number} mask
+ */
+WebGLRenderingContextBase.prototype.stencilFunc = function(func, ref, mask) {};
+
+/**
+ * @param {number} face
+ * @param {number} func
+ * @param {number} ref
+ * @param {number} mask
+ */
+WebGLRenderingContextBase.prototype.stencilFuncSeparate = function(
+ face, func, ref, mask) {};
+
+/**
+ * @param {number} mask
+ */
+WebGLRenderingContextBase.prototype.stencilMask = function(mask) {};
+
+/**
+ * @param {number} face
+ * @param {number} mask
+ */
+WebGLRenderingContextBase.prototype.stencilMaskSeparate = function(face, mask) {};
+
+/**
+ * @param {number} fail
+ * @param {number} zfail
+ * @param {number} zpass
+ */
+WebGLRenderingContextBase.prototype.stencilOp = function(fail, zfail, zpass) {};
+
+/**
+ * @param {number} face
+ * @param {number} fail
+ * @param {number} zfail
+ * @param {number} zpass
+ */
+WebGLRenderingContextBase.prototype.stencilOpSeparate = function(
+ face, fail, zfail, zpass) {};
+
+/**
+ * @param {number} target
+ * @param {number} level
+ * @param {number} internalformat
+ * @param {number} format or width
+ * @param {number} type or height
+ * @param {ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|
+ * number} img or border
+ * @param {number=} opt_format
+ * @param {number=} opt_type
+ * @param {ArrayBufferView=} opt_pixels
+ */
+WebGLRenderingContextBase.prototype.texImage2D = function(
+ target, level, internalformat, format, type, img, opt_format, opt_type,
+ opt_pixels) {};
+
+/**
+ * @param {number} target
+ * @param {number} pname
+ * @param {number} param
+ */
+WebGLRenderingContextBase.prototype.texParameterf = function(
+ target, pname, param) {};
+
+/**
+ * @param {number} target
+ * @param {number} pname
+ * @param {number} param
+ */
+WebGLRenderingContextBase.prototype.texParameteri = function(
+ target, pname, param) {};
+
+/**
+ * @param {number} target
+ * @param {number} level
+ * @param {number} xoffset
+ * @param {number} yoffset
+ * @param {number} format or width
+ * @param {number} type or height
+ * @param {ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|
+ * number} data or format
+ * @param {number=} opt_type
+ * @param {ArrayBufferView=} opt_pixels
+ */
+WebGLRenderingContextBase.prototype.texSubImage2D = function(
+ target, level, xoffset, yoffset, format, type, data, opt_type,
+ opt_pixels) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {number} value
+ */
+WebGLRenderingContextBase.prototype.uniform1f = function(location, value) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {Float32Array|Array.<number>} value
+ */
+WebGLRenderingContextBase.prototype.uniform1fv = function(location, value) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {number} value
+ */
+WebGLRenderingContextBase.prototype.uniform1i = function(location, value) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {Int32Array|Array.<number>} value
+ */
+WebGLRenderingContextBase.prototype.uniform1iv = function(location, value) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {number} value1
+ * @param {number} value2
+ */
+WebGLRenderingContextBase.prototype.uniform2f = function(
+ location, value1, value2) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {Float32Array|Array.<number>} value
+ */
+WebGLRenderingContextBase.prototype.uniform2fv = function(location, value) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {number} value1
+ * @param {number} value2
+ */
+WebGLRenderingContextBase.prototype.uniform2i = function(
+ location, value1, value2) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {Int32Array|Array.<number>} value
+ */
+WebGLRenderingContextBase.prototype.uniform2iv = function(location, value) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {number} value1
+ * @param {number} value2
+ * @param {number} value3
+ */
+WebGLRenderingContextBase.prototype.uniform3f = function(
+ location, value1, value2, value3) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {Float32Array|Array.<number>} value
+ */
+WebGLRenderingContextBase.prototype.uniform3fv = function(location, value) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {number} value1
+ * @param {number} value2
+ * @param {number} value3
+ */
+WebGLRenderingContextBase.prototype.uniform3i = function(
+ location, value1, value2, value3) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {Int32Array|Array.<number>} value
+ */
+WebGLRenderingContextBase.prototype.uniform3iv = function(location, value) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {number} value1
+ * @param {number} value2
+ * @param {number} value3
+ * @param {number} value4
+ */
+WebGLRenderingContextBase.prototype.uniform4f = function(
+ location, value1, value2, value3, value4) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {Float32Array|Array.<number>} value
+ */
+WebGLRenderingContextBase.prototype.uniform4fv = function(location, value) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {number} value1
+ * @param {number} value2
+ * @param {number} value3
+ * @param {number} value4
+ */
+WebGLRenderingContextBase.prototype.uniform4i = function(
+ location, value1, value2, value3, value4) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {Int32Array|Array.<number>} value
+ */
+WebGLRenderingContextBase.prototype.uniform4iv = function(location, value) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {boolean} transpose
+ * @param {Float32Array|Array.<number>} data
+ */
+WebGLRenderingContextBase.prototype.uniformMatrix2fv = function(
+ location, transpose, data) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {boolean} transpose
+ * @param {Float32Array|Array.<number>} data
+ */
+WebGLRenderingContextBase.prototype.uniformMatrix3fv = function(
+ location, transpose, data) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {boolean} transpose
+ * @param {Float32Array|Array.<number>} data
+ */
+WebGLRenderingContextBase.prototype.uniformMatrix4fv = function(
+ location, transpose, data) {};
+
+/**
+ * @param {WebGLProgram} program
+ */
+WebGLRenderingContextBase.prototype.useProgram = function(program) {};
+
+/**
+ * @param {WebGLProgram} program
+ */
+WebGLRenderingContextBase.prototype.validateProgram = function(program) {};
+
+/**
+ * @param {number} indx
+ * @param {number} x
+ */
+WebGLRenderingContextBase.prototype.vertexAttrib1f = function(indx, x) {};
+
+/**
+ * @param {number} indx
+ * @param {Float32Array|Array.<number>} values
+ */
+WebGLRenderingContextBase.prototype.vertexAttrib1fv = function(indx, values) {};
+
+/**
+ * @param {number} indx
+ * @param {number} x
+ * @param {number} y
+ */
+WebGLRenderingContextBase.prototype.vertexAttrib2f = function(
+ indx, x, y) {};
+
+/**
+ * @param {number} indx
+ * @param {Float32Array|Array.<number>} values
+ */
+WebGLRenderingContextBase.prototype.vertexAttrib2fv = function(
+ indx, values) {};
+
+/**
+ * @param {number} indx
+ * @param {number} x
+ * @param {number} y
+ * @param {number} z
+ */
+WebGLRenderingContextBase.prototype.vertexAttrib3f = function(
+ indx, x, y, z) {};
+
+/**
+ * @param {number} indx
+ * @param {Float32Array|Array.<number>} values
+ */
+WebGLRenderingContextBase.prototype.vertexAttrib3fv = function(indx, values) {};
+
+/**
+ * @param {number} indx
+ * @param {number} x
+ * @param {number} y
+ * @param {number} z
+ * @param {number} w
+ */
+WebGLRenderingContextBase.prototype.vertexAttrib4f = function(
+ indx, x, y, z, w) {};
+
+/**
+ * @param {number} indx
+ * @param {Float32Array|Array.<number>} values
+ */
+WebGLRenderingContextBase.prototype.vertexAttrib4fv = function(indx, values) {};
+
+/**
+ * @param {number} indx
+ * @param {number} size
+ * @param {number} type
+ * @param {boolean} normalized
+ * @param {number} stride
+ * @param {number} offset
+ */
+WebGLRenderingContextBase.prototype.vertexAttribPointer = function(
+ indx, size, type, normalized, stride, offset) {};
+
+/**
+ * @param {number} x
+ * @param {number} y
+ * @param {number} width
+ * @param {number} height
+ */
+WebGLRenderingContextBase.prototype.viewport = function(x, y, width, height) {};
+
+
+/**
+ * @constructor
+ * @noalias
+ */
+function WebGLContextAttributes() {}
+
+/**
+ * @type {boolean}
+ */
+WebGLContextAttributes.prototype.alpha;
+
+/**
+ * @type {boolean}
+ */
+WebGLContextAttributes.prototype.depth;
+
+/**
+ * @type {boolean}
+ */
+WebGLContextAttributes.prototype.stencil;
+
+/**
+ * @type {boolean}
+ */
+WebGLContextAttributes.prototype.antialias;
+
+/**
+ * @type {boolean}
+ */
+WebGLContextAttributes.prototype.premultipliedAlpha;
+
+/**
+ * @type {boolean}
+ */
+WebGLContextAttributes.prototype.preserveDrawingBuffer;
+
+
+/**
+ * @param {string} eventType
+ * @constructor
+ * @noalias
+ * @extends {Event}
+ */
+function WebGLContextEvent(eventType) {}
+
+/**
+ * @type {string}
+ */
+WebGLContextEvent.prototype.statusMessage;
+
+
+/**
+ * @constructor
+ * @noalias
+ */
+function WebGLShaderPrecisionFormat() {}
+
+/**
+ * @type {number}
+ */
+WebGLShaderPrecisionFormat.prototype.rangeMin;
+
+/**
+ * @type {number}
+ */
+WebGLShaderPrecisionFormat.prototype.rangeMax;
+
+/**
+ * @type {number}
+ */
+WebGLShaderPrecisionFormat.prototype.precision;
+
+
+/**
+ * @constructor
+ * @noalias
+ */
+function WebGLObject() {}
+
+
+/**
+ * @constructor
+ * @noalias
+ * @extends {WebGLObject}
+ */
+function WebGLBuffer() {}
+
+
+/**
+ * @constructor
+ * @noalias
+ * @extends {WebGLObject}
+ */
+function WebGLFramebuffer() {}
+
+
+/**
+ * @constructor
+ * @noalias
+ * @extends {WebGLObject}
+ */
+function WebGLProgram() {}
+
+
+/**
+ * @constructor
+ * @noalias
+ * @extends {WebGLObject}
+ */
+function WebGLRenderbuffer() {}
+
+
+/**
+ * @constructor
+ * @noalias
+ * @extends {WebGLObject}
+ */
+function WebGLShader() {}
+
+
+/**
+ * @constructor
+ * @noalias
+ * @extends {WebGLObject}
+ */
+function WebGLTexture() {}
+
+
+/**
+ * @constructor
+ * @noalias
+ */
+function WebGLActiveInfo() {}
+
+/** @type {number} */
+WebGLActiveInfo.prototype.size;
+
+/** @type {number} */
+WebGLActiveInfo.prototype.type;
+
+/** @type {string} */
+WebGLActiveInfo.prototype.name;
+
+
+/**
+ * @constructor
+ * @noalias
+ */
+function WebGLUniformLocation() {}
+
+
+/**
+ * @see http://www.khronos.org/registry/webgl/extensions/OES_texture_float/
+ * @constructor
+ * @noalias
+ */
+function OES_texture_float() {}
+
+
+/**
+ * @see http://www.khronos.org/registry/webgl/extensions/OES_texture_half_float/
+ * @constructor
+ * @noalias
+ */
+function OES_texture_half_float() {}
+
+/** @type {number} */
+OES_texture_half_float.prototype.HALF_FLOAT_OES;
+
+
+/**
+ * @see http://www.khronos.org/registry/webgl/extensions/WEBGL_lose_context/
+ * @constructor
+ * @noalias
+ */
+function WEBGL_lose_context() {}
+
+WEBGL_lose_context.prototype.loseContext = function() {};
+
+WEBGL_lose_context.prototype.restoreContext = function() {};
+
+
+/**
+ * @see http://www.khronos.org/registry/webgl/extensions/OES_standard_derivatives/
+ * @constructor
+ * @noalias
+ */
+function OES_standard_derivatives() {}
+
+/** @type {number} */
+OES_standard_derivatives.prototype.FRAGMENT_SHADER_DERIVATIVE_HINT_OES;
+
+
+/**
+ * @see http://www.khronos.org/registry/webgl/extensions/OES_vertex_array_object/
+ * @constructor
+ * @noalias
+ * @extends {WebGLObject}
+ */
+function WebGLVertexArrayObjectOES() {}
+
+
+/**
+ * @see http://www.khronos.org/registry/webgl/extensions/OES_vertex_array_object/
+ * @constructor
+ * @noalias
+ */
+function OES_vertex_array_object() {}
+
+/** @type {number} */
+OES_vertex_array_object.prototype.VERTEX_ARRAY_BINDING_OES;
+
+/**
+ * @return {WebGLVertexArrayObjectOES}
+ * @nosideeffects
+ */
+OES_vertex_array_object.prototype.createVertexArrayOES = function() {};
+
+/**
+ * @param {WebGLVertexArrayObjectOES} arrayObject
+ */
+OES_vertex_array_object.prototype.deleteVertexArrayOES =
+ function(arrayObject) {};
+
+/**
+ * @param {WebGLVertexArrayObjectOES} arrayObject
+ * @return {boolean}
+ * @nosideeffects
+ */
+OES_vertex_array_object.prototype.isVertexArrayOES = function(arrayObject) {};
+
+/**
+ * @param {WebGLVertexArrayObjectOES} arrayObject
+ */
+OES_vertex_array_object.prototype.bindVertexArrayOES = function(arrayObject) {};
+
+
+/**
+ * @see http://www.khronos.org/registry/webgl/extensions/WEBGL_debug_renderer_info/
+ * @constructor
+ * @noalias
+ */
+function WEBGL_debug_renderer_info() {}
+
+/** @type {number} */
+WEBGL_debug_renderer_info.prototype.UNMASKED_VENDOR_WEBGL;
+
+/** @type {number} */
+WEBGL_debug_renderer_info.prototype.UNMASKED_RENDERER_WEBGL;
+
+
+/**
+ * @see http://www.khronos.org/registry/webgl/extensions/WEBGL_debug_shaders/
+ * @constructor
+ * @noalias
+ */
+function WEBGL_debug_shaders() {}
+
+/**
+ * @param {WebGLShader} shader
+ * @return {string}
+ * @nosideeffects
+ */
+WEBGL_debug_shaders.prototype.getTranslatedShaderSource = function(shader) {};
+
+
+/**
+ * @see http://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_s3tc/
+ * @constructor
+ * @noalias
+ */
+function WEBGL_compressed_texture_s3tc() {}
+
+/** @type {number} */
+WEBGL_compressed_texture_s3tc.prototype.COMPRESSED_RGB_S3TC_DXT1_EXT;
+
+/** @type {number} */
+WEBGL_compressed_texture_s3tc.prototype.COMPRESSED_RGBA_S3TC_DXT1_EXT;
+
+/** @type {number} */
+WEBGL_compressed_texture_s3tc.prototype.COMPRESSED_RGBA_S3TC_DXT3_EXT;
+
+/** @type {number} */
+WEBGL_compressed_texture_s3tc.prototype.COMPRESSED_RGBA_S3TC_DXT5_EXT;
+
+
+/**
+ * @see http://www.khronos.org/registry/webgl/extensions/OES_depth_texture/
+ * @constructor
+ * @noalias
+ */
+function OES_depth_texture() {}
+
+
+/**
+ * @see http://www.khronos.org/registry/webgl/extensions/OES_element_index_uint/
+ * @constructor
+ * @noalias
+ */
+function OES_element_index_uint() {}
+
+
+/**
+ * @see http://www.khronos.org/registry/webgl/extensions/EXT_texture_filter_anisotropic/
+ * @constructor
+ * @noalias
+ */
+function EXT_texture_filter_anisotropic() {}
+
+/** @type {number} */
+EXT_texture_filter_anisotropic.prototype.TEXTURE_MAX_ANISOTROPY_EXT;
+
+/** @type {number} */
+EXT_texture_filter_anisotropic.prototype.MAX_TEXTURE_MAX_ANISOTROPY_EXT;
+
+
+
+/**
+ * @see http://www.khronos.org/registry/webgl/extensions/ANGLE_instanced_arrays/
+ * @constructor
+ * @noalias
+ */
+function ANGLE_instanced_arrays() {}
+
+
+/** @type {number} */
+ANGLE_instanced_arrays.prototype.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE;
+
+
+/**
+ * @param {number} mode Primitive type.
+ * @param {number} first First vertex.
+ * @param {number} count Number of vertices per instance.
+ * @param {number} primcount Number of instances.
+ */
+ANGLE_instanced_arrays.prototype.drawArraysInstancedANGLE = function(
+ mode, first, count, primcount) {};
+
+
+/**
+ * @param {number} mode Primitive type.
+ * @param {number} count Number of vertex indices per instance.
+ * @param {number} type Type of a vertex index.
+ * @param {number} offset Offset to the first vertex index.
+ * @param {number} primcount Number of instances.
+ */
+ANGLE_instanced_arrays.prototype.drawElementsInstancedANGLE = function(
+ mode, count, type, offset, primcount) {};
+
+
+/**
+ * @param {number} index Attribute index.
+ * @param {number} divisor Instance divisor.
+ */
+ANGLE_instanced_arrays.prototype.vertexAttribDivisorANGLE = function(
+ index, divisor) {};
+
+
+/**
+ * @constructor
+ * @noalias
+ * @extends {WebGLRenderingContextBase}
+ */
+function WebGLRenderingContext() {}
+
+
+/**
+ * @constructor
+ * @private
+ * @noalias
+ * @extends {WebGLRenderingContextBase}
+ */
+function WebGL2RenderingContextBase() {}
+
+
+/** @type {number} */
+WebGL2RenderingContextBase.READ_BUFFER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNPACK_ROW_LENGTH;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNPACK_SKIP_ROWS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNPACK_SKIP_PIXELS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.PACK_ROW_LENGTH;
+
+/** @type {number} */
+WebGL2RenderingContextBase.PACK_SKIP_ROWS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.PACK_SKIP_PIXELS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.COLOR;
+
+/** @type {number} */
+WebGL2RenderingContextBase.DEPTH;
+
+/** @type {number} */
+WebGL2RenderingContextBase.STENCIL;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RED;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RGB8;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RGBA8;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RGB10_A2;
+
+/** @type {number} */
+WebGL2RenderingContextBase.TEXTURE_BINDING_3D;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNPACK_SKIP_IMAGES;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNPACK_IMAGE_HEIGHT;
+
+/** @type {number} */
+WebGL2RenderingContextBase.TEXTURE_3D;
+
+/** @type {number} */
+WebGL2RenderingContextBase.TEXTURE_WRAP_R;
+
+/** @type {number} */
+WebGL2RenderingContextBase.MAX_3D_TEXTURE_SIZE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNSIGNED_INT_2_10_10_10_REV;
+
+/** @type {number} */
+WebGL2RenderingContextBase.MAX_ELEMENTS_VERTICES;
+
+/** @type {number} */
+WebGL2RenderingContextBase.MAX_ELEMENTS_INDICES;
+
+/** @type {number} */
+WebGL2RenderingContextBase.TEXTURE_MIN_LOD;
+
+/** @type {number} */
+WebGL2RenderingContextBase.TEXTURE_MAX_LOD;
+
+/** @type {number} */
+WebGL2RenderingContextBase.TEXTURE_BASE_LEVEL;
+
+/** @type {number} */
+WebGL2RenderingContextBase.TEXTURE_MAX_LEVEL;
+
+/** @type {number} */
+WebGL2RenderingContextBase.MIN;
+
+/** @type {number} */
+WebGL2RenderingContextBase.MAX;
+
+/** @type {number} */
+WebGL2RenderingContextBase.DEPTH_COMPONENT24;
+
+/** @type {number} */
+WebGL2RenderingContextBase.MAX_TEXTURE_LOD_BIAS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.TEXTURE_COMPARE_MODE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.TEXTURE_COMPARE_FUNC;
+
+/** @type {number} */
+WebGL2RenderingContextBase.CURRENT_QUERY;
+
+/** @type {number} */
+WebGL2RenderingContextBase.QUERY_RESULT;
+
+/** @type {number} */
+WebGL2RenderingContextBase.QUERY_RESULT_AVAILABLE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.STREAM_READ;
+
+/** @type {number} */
+WebGL2RenderingContextBase.STREAM_COPY;
+
+/** @type {number} */
+WebGL2RenderingContextBase.STATIC_READ;
+
+/** @type {number} */
+WebGL2RenderingContextBase.STATIC_COPY;
+
+/** @type {number} */
+WebGL2RenderingContextBase.DYNAMIC_READ;
+
+/** @type {number} */
+WebGL2RenderingContextBase.DYNAMIC_COPY;
+
+/** @type {number} */
+WebGL2RenderingContextBase.MAX_DRAW_BUFFERS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.DRAW_BUFFER0;
+
+/** @type {number} */
+WebGL2RenderingContextBase.DRAW_BUFFER1;
+
+/** @type {number} */
+WebGL2RenderingContextBase.DRAW_BUFFER2;
+
+/** @type {number} */
+WebGL2RenderingContextBase.DRAW_BUFFER3;
+
+/** @type {number} */
+WebGL2RenderingContextBase.DRAW_BUFFER4;
+
+/** @type {number} */
+WebGL2RenderingContextBase.DRAW_BUFFER5;
+
+/** @type {number} */
+WebGL2RenderingContextBase.DRAW_BUFFER6;
+
+/** @type {number} */
+WebGL2RenderingContextBase.DRAW_BUFFER7;
+
+/** @type {number} */
+WebGL2RenderingContextBase.DRAW_BUFFER8;
+
+/** @type {number} */
+WebGL2RenderingContextBase.DRAW_BUFFER9;
+
+/** @type {number} */
+WebGL2RenderingContextBase.DRAW_BUFFER10;
+
+/** @type {number} */
+WebGL2RenderingContextBase.DRAW_BUFFER11;
+
+/** @type {number} */
+WebGL2RenderingContextBase.DRAW_BUFFER12;
+
+/** @type {number} */
+WebGL2RenderingContextBase.DRAW_BUFFER13;
+
+/** @type {number} */
+WebGL2RenderingContextBase.DRAW_BUFFER14;
+
+/** @type {number} */
+WebGL2RenderingContextBase.DRAW_BUFFER15;
+
+/** @type {number} */
+WebGL2RenderingContextBase.MAX_FRAGMENT_UNIFORM_COMPONENTS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.MAX_VERTEX_UNIFORM_COMPONENTS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.SAMPLER_3D;
+
+/** @type {number} */
+WebGL2RenderingContextBase.SAMPLER_2D_SHADOW;
+
+/** @type {number} */
+WebGL2RenderingContextBase.FRAGMENT_SHADER_DERIVATIVE_HINT;
+
+/** @type {number} */
+WebGL2RenderingContextBase.PIXEL_PACK_BUFFER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.PIXEL_UNPACK_BUFFER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.PIXEL_PACK_BUFFER_BINDING;
+
+/** @type {number} */
+WebGL2RenderingContextBase.PIXEL_UNPACK_BUFFER_BINDING;
+
+/** @type {number} */
+WebGL2RenderingContextBase.FLOAT_MAT2x3;
+
+/** @type {number} */
+WebGL2RenderingContextBase.FLOAT_MAT2x4;
+
+/** @type {number} */
+WebGL2RenderingContextBase.FLOAT_MAT3x2;
+
+/** @type {number} */
+WebGL2RenderingContextBase.FLOAT_MAT3x4;
+
+/** @type {number} */
+WebGL2RenderingContextBase.FLOAT_MAT4x2;
+
+/** @type {number} */
+WebGL2RenderingContextBase.FLOAT_MAT4x3;
+
+/** @type {number} */
+WebGL2RenderingContextBase.SRGB;
+
+/** @type {number} */
+WebGL2RenderingContextBase.SRGB8;
+
+/** @type {number} */
+WebGL2RenderingContextBase.SRGB8_ALPHA8;
+
+/** @type {number} */
+WebGL2RenderingContextBase.COMPARE_REF_TO_TEXTURE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RGBA32F;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RGB32F;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RGBA16F;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RGB16F;
+
+/** @type {number} */
+WebGL2RenderingContextBase.VERTEX_ATTRIB_ARRAY_INTEGER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.MAX_ARRAY_TEXTURE_LAYERS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.MIN_PROGRAM_TEXEL_OFFSET;
+
+/** @type {number} */
+WebGL2RenderingContextBase.MAX_PROGRAM_TEXEL_OFFSET;
+
+/** @type {number} */
+WebGL2RenderingContextBase.MAX_VARYING_COMPONENTS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.TEXTURE_2D_ARRAY;
+
+/** @type {number} */
+WebGL2RenderingContextBase.TEXTURE_BINDING_2D_ARRAY;
+
+/** @type {number} */
+WebGL2RenderingContextBase.R11F_G11F_B10F;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNSIGNED_INT_10F_11F_11F_REV;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RGB9_E5;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNSIGNED_INT_5_9_9_9_REV;
+
+/** @type {number} */
+WebGL2RenderingContextBase.TRANSFORM_FEEDBACK_BUFFER_MODE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.TRANSFORM_FEEDBACK_VARYINGS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.TRANSFORM_FEEDBACK_BUFFER_START;
+
+/** @type {number} */
+WebGL2RenderingContextBase.TRANSFORM_FEEDBACK_BUFFER_SIZE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RASTERIZER_DISCARD;
+
+/** @type {number} */
+WebGL2RenderingContextBase.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.INTERLEAVED_ATTRIBS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.SEPARATE_ATTRIBS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.TRANSFORM_FEEDBACK_BUFFER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.TRANSFORM_FEEDBACK_BUFFER_BINDING;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RGBA32UI;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RGB32UI;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RGBA16UI;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RGB16UI;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RGBA8UI;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RGB8UI;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RGBA32I;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RGB32I;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RGBA16I;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RGB16I;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RGBA8I;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RGB8I;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RED_INTEGER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RGB_INTEGER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RGBA_INTEGER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.SAMPLER_2D_ARRAY;
+
+/** @type {number} */
+WebGL2RenderingContextBase.SAMPLER_2D_ARRAY_SHADOW;
+
+/** @type {number} */
+WebGL2RenderingContextBase.SAMPLER_CUBE_SHADOW;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNSIGNED_INT_VEC2;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNSIGNED_INT_VEC3;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNSIGNED_INT_VEC4;
+
+/** @type {number} */
+WebGL2RenderingContextBase.INT_SAMPLER_2D;
+
+/** @type {number} */
+WebGL2RenderingContextBase.INT_SAMPLER_3D;
+
+/** @type {number} */
+WebGL2RenderingContextBase.INT_SAMPLER_CUBE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.INT_SAMPLER_2D_ARRAY;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNSIGNED_INT_SAMPLER_2D;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNSIGNED_INT_SAMPLER_3D;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNSIGNED_INT_SAMPLER_CUBE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNSIGNED_INT_SAMPLER_2D_ARRAY;
+
+/** @type {number} */
+WebGL2RenderingContextBase.DEPTH_COMPONENT32F;
+
+/** @type {number} */
+WebGL2RenderingContextBase.DEPTH32F_STENCIL8;
+
+/** @type {number} */
+WebGL2RenderingContextBase.FLOAT_32_UNSIGNED_INT_24_8_REV;
+
+/** @type {number} */
+WebGL2RenderingContextBase.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING;
+
+/** @type {number} */
+WebGL2RenderingContextBase.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.FRAMEBUFFER_ATTACHMENT_RED_SIZE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.FRAMEBUFFER_DEFAULT;
+
+/** @type {number} */
+WebGL2RenderingContextBase.DEPTH_STENCIL_ATTACHMENT;
+
+/** @type {number} */
+WebGL2RenderingContextBase.DEPTH_STENCIL;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNSIGNED_INT_24_8;
+
+/** @type {number} */
+WebGL2RenderingContextBase.DEPTH24_STENCIL8;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNSIGNED_NORMALIZED;
+
+// Same as FRAMEBUFFER_BINDING
+/** @type {number} */
+WebGL2RenderingContextBase.DRAW_FRAMEBUFFER_BINDING;
+
+/** @type {number} */
+WebGL2RenderingContextBase.READ_FRAMEBUFFER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.DRAW_FRAMEBUFFER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.READ_FRAMEBUFFER_BINDING;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RENDERBUFFER_SAMPLES;
+
+/** @type {number} */
+WebGL2RenderingContextBase.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.MAX_COLOR_ATTACHMENTS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.COLOR_ATTACHMENT1;
+
+/** @type {number} */
+WebGL2RenderingContextBase.COLOR_ATTACHMENT2;
+
+/** @type {number} */
+WebGL2RenderingContextBase.COLOR_ATTACHMENT3;
+
+/** @type {number} */
+WebGL2RenderingContextBase.COLOR_ATTACHMENT4;
+
+/** @type {number} */
+WebGL2RenderingContextBase.COLOR_ATTACHMENT5;
+
+/** @type {number} */
+WebGL2RenderingContextBase.COLOR_ATTACHMENT6;
+
+/** @type {number} */
+WebGL2RenderingContextBase.COLOR_ATTACHMENT7;
+
+/** @type {number} */
+WebGL2RenderingContextBase.COLOR_ATTACHMENT8;
+
+/** @type {number} */
+WebGL2RenderingContextBase.COLOR_ATTACHMENT9;
+
+/** @type {number} */
+WebGL2RenderingContextBase.COLOR_ATTACHMENT10;
+
+/** @type {number} */
+WebGL2RenderingContextBase.COLOR_ATTACHMENT11;
+
+/** @type {number} */
+WebGL2RenderingContextBase.COLOR_ATTACHMENT12;
+
+/** @type {number} */
+WebGL2RenderingContextBase.COLOR_ATTACHMENT13;
+
+/** @type {number} */
+WebGL2RenderingContextBase.COLOR_ATTACHMENT14;
+
+/** @type {number} */
+WebGL2RenderingContextBase.COLOR_ATTACHMENT15;
+
+/** @type {number} */
+WebGL2RenderingContextBase.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.MAX_SAMPLES;
+
+/** @type {number} */
+WebGL2RenderingContextBase.HALF_FLOAT;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RG;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RG_INTEGER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.R8;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RG8;
+
+/** @type {number} */
+WebGL2RenderingContextBase.R16F;
+
+/** @type {number} */
+WebGL2RenderingContextBase.R32F;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RG16F;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RG32F;
+
+/** @type {number} */
+WebGL2RenderingContextBase.R8I;
+
+/** @type {number} */
+WebGL2RenderingContextBase.R8UI;
+
+/** @type {number} */
+WebGL2RenderingContextBase.R16I;
+
+/** @type {number} */
+WebGL2RenderingContextBase.R16UI;
+
+/** @type {number} */
+WebGL2RenderingContextBase.R32I;
+
+/** @type {number} */
+WebGL2RenderingContextBase.R32UI;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RG8I;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RG8UI;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RG16I;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RG16UI;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RG32I;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RG32UI;
+
+/** @type {number} */
+WebGL2RenderingContextBase.VERTEX_ARRAY_BINDING;
+
+/** @type {number} */
+WebGL2RenderingContextBase.R8_SNORM;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RG8_SNORM;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RGB8_SNORM;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RGBA8_SNORM;
+
+/** @type {number} */
+WebGL2RenderingContextBase.SIGNED_NORMALIZED;
+
+/** @type {number} */
+WebGL2RenderingContextBase.COPY_READ_BUFFER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.COPY_WRITE_BUFFER;
+
+// Same as COPY_READ_BUFFER
+/** @type {number} */
+WebGL2RenderingContextBase.COPY_READ_BUFFER_BINDING;
+
+// Same as COPY_WRITE_BUFFER
+/** @type {number} */
+WebGL2RenderingContextBase.COPY_WRITE_BUFFER_BINDING;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNIFORM_BUFFER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNIFORM_BUFFER_BINDING;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNIFORM_BUFFER_START;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNIFORM_BUFFER_SIZE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.MAX_VERTEX_UNIFORM_BLOCKS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.MAX_FRAGMENT_UNIFORM_BLOCKS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.MAX_COMBINED_UNIFORM_BLOCKS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.MAX_UNIFORM_BUFFER_BINDINGS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.MAX_UNIFORM_BLOCK_SIZE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNIFORM_BUFFER_OFFSET_ALIGNMENT;
+
+/** @type {number} */
+WebGL2RenderingContextBase.ACTIVE_UNIFORM_BLOCKS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNIFORM_TYPE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNIFORM_SIZE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNIFORM_BLOCK_INDEX;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNIFORM_OFFSET;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNIFORM_ARRAY_STRIDE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNIFORM_MATRIX_STRIDE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNIFORM_IS_ROW_MAJOR;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNIFORM_BLOCK_BINDING;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNIFORM_BLOCK_DATA_SIZE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNIFORM_BLOCK_ACTIVE_UNIFORMS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.INVALID_INDEX;
+
+/** @type {number} */
+WebGL2RenderingContextBase.MAX_VERTEX_OUTPUT_COMPONENTS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.MAX_FRAGMENT_INPUT_COMPONENTS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.MAX_SERVER_WAIT_TIMEOUT;
+
+/** @type {number} */
+WebGL2RenderingContextBase.OBJECT_TYPE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.SYNC_CONDITION;
+
+/** @type {number} */
+WebGL2RenderingContextBase.SYNC_STATUS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.SYNC_FLAGS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.SYNC_FENCE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.SYNC_GPU_COMMANDS_COMPLETE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.UNSIGNALED;
+
+/** @type {number} */
+WebGL2RenderingContextBase.SIGNALED;
+
+/** @type {number} */
+WebGL2RenderingContextBase.ALREADY_SIGNALED;
+
+/** @type {number} */
+WebGL2RenderingContextBase.TIMEOUT_EXPIRED;
+
+/** @type {number} */
+WebGL2RenderingContextBase.CONDITION_SATISFIED;
+
+/** @type {number} */
+WebGL2RenderingContextBase.WAIT_FAILED;
+
+/** @type {number} */
+WebGL2RenderingContextBase.SYNC_FLUSH_COMMANDS_BIT;
+
+/** @type {number} */
+WebGL2RenderingContextBase.VERTEX_ATTRIB_ARRAY_DIVISOR;
+
+/** @type {number} */
+WebGL2RenderingContextBase.ANY_SAMPLES_PASSED;
+
+/** @type {number} */
+WebGL2RenderingContextBase.ANY_SAMPLES_PASSED_CONSERVATIVE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.SAMPLER_BINDING;
+
+/** @type {number} */
+WebGL2RenderingContextBase.RGB10_A2UI;
+
+/** @type {number} */
+WebGL2RenderingContextBase.INT_2_10_10_10_REV;
+
+/** @type {number} */
+WebGL2RenderingContextBase.TRANSFORM_FEEDBACK;
+
+/** @type {number} */
+WebGL2RenderingContextBase.TRANSFORM_FEEDBACK_PAUSED;
+
+/** @type {number} */
+WebGL2RenderingContextBase.TRANSFORM_FEEDBACK_ACTIVE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.TRANSFORM_FEEDBACK_BINDING;
+
+/** @type {number} */
+WebGL2RenderingContextBase.TEXTURE_IMMUTABLE_FORMAT;
+
+/** @type {number} */
+WebGL2RenderingContextBase.MAX_ELEMENT_INDEX;
+
+/** @type {number} */
+WebGL2RenderingContextBase.NUM_SAMPLE_COUNTS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.TEXTURE_IMMUTABLE_LEVELS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.TIMEOUT_IGNORED;
+
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.READ_BUFFER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNPACK_ROW_LENGTH;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNPACK_SKIP_ROWS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNPACK_SKIP_PIXELS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.PACK_ROW_LENGTH;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.PACK_SKIP_ROWS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.PACK_SKIP_PIXELS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.COLOR;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.DEPTH;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.STENCIL;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RED;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RGB8;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RGBA8;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RGB10_A2;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.TEXTURE_BINDING_3D;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNPACK_SKIP_IMAGES;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNPACK_IMAGE_HEIGHT;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.TEXTURE_3D;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.TEXTURE_WRAP_R;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.MAX_3D_TEXTURE_SIZE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNSIGNED_INT_2_10_10_10_REV;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.MAX_ELEMENTS_VERTICES;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.MAX_ELEMENTS_INDICES;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.TEXTURE_MIN_LOD;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.TEXTURE_MAX_LOD;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.TEXTURE_BASE_LEVEL;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.TEXTURE_MAX_LEVEL;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.MIN;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.MAX;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.DEPTH_COMPONENT24;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.MAX_TEXTURE_LOD_BIAS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.TEXTURE_COMPARE_MODE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.TEXTURE_COMPARE_FUNC;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.CURRENT_QUERY;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.QUERY_RESULT;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.QUERY_RESULT_AVAILABLE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.STREAM_READ;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.STREAM_COPY;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.STATIC_READ;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.STATIC_COPY;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.DYNAMIC_READ;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.DYNAMIC_COPY;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.MAX_DRAW_BUFFERS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.DRAW_BUFFER0;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.DRAW_BUFFER1;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.DRAW_BUFFER2;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.DRAW_BUFFER3;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.DRAW_BUFFER4;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.DRAW_BUFFER5;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.DRAW_BUFFER6;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.DRAW_BUFFER7;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.DRAW_BUFFER8;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.DRAW_BUFFER9;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.DRAW_BUFFER10;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.DRAW_BUFFER11;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.DRAW_BUFFER12;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.DRAW_BUFFER13;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.DRAW_BUFFER14;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.DRAW_BUFFER15;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.MAX_FRAGMENT_UNIFORM_COMPONENTS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.MAX_VERTEX_UNIFORM_COMPONENTS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.SAMPLER_3D;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.SAMPLER_2D_SHADOW;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.FRAGMENT_SHADER_DERIVATIVE_HINT;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.PIXEL_PACK_BUFFER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.PIXEL_UNPACK_BUFFER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.PIXEL_PACK_BUFFER_BINDING;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.PIXEL_UNPACK_BUFFER_BINDING;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.FLOAT_MAT2x3;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.FLOAT_MAT2x4;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.FLOAT_MAT3x2;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.FLOAT_MAT3x4;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.FLOAT_MAT4x2;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.FLOAT_MAT4x3;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.SRGB;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.SRGB8;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.SRGB8_ALPHA8;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.COMPARE_REF_TO_TEXTURE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RGBA32F;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RGB32F;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RGBA16F;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RGB16F;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.VERTEX_ATTRIB_ARRAY_INTEGER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.MAX_ARRAY_TEXTURE_LAYERS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.MIN_PROGRAM_TEXEL_OFFSET;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.MAX_PROGRAM_TEXEL_OFFSET;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.MAX_VARYING_COMPONENTS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.TEXTURE_2D_ARRAY;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.TEXTURE_BINDING_2D_ARRAY;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.R11F_G11F_B10F;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNSIGNED_INT_10F_11F_11F_REV;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RGB9_E5;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNSIGNED_INT_5_9_9_9_REV;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.TRANSFORM_FEEDBACK_BUFFER_MODE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.TRANSFORM_FEEDBACK_VARYINGS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.TRANSFORM_FEEDBACK_BUFFER_START;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.TRANSFORM_FEEDBACK_BUFFER_SIZE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RASTERIZER_DISCARD;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.INTERLEAVED_ATTRIBS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.SEPARATE_ATTRIBS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.TRANSFORM_FEEDBACK_BUFFER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.TRANSFORM_FEEDBACK_BUFFER_BINDING;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RGBA32UI;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RGB32UI;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RGBA16UI;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RGB16UI;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RGBA8UI;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RGB8UI;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RGBA32I;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RGB32I;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RGBA16I;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RGB16I;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RGBA8I;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RGB8I;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RED_INTEGER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RGB_INTEGER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RGBA_INTEGER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.SAMPLER_2D_ARRAY;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.SAMPLER_2D_ARRAY_SHADOW;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.SAMPLER_CUBE_SHADOW;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNSIGNED_INT_VEC2;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNSIGNED_INT_VEC3;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNSIGNED_INT_VEC4;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.INT_SAMPLER_2D;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.INT_SAMPLER_3D;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.INT_SAMPLER_CUBE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.INT_SAMPLER_2D_ARRAY;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNSIGNED_INT_SAMPLER_2D;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNSIGNED_INT_SAMPLER_3D;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNSIGNED_INT_SAMPLER_CUBE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNSIGNED_INT_SAMPLER_2D_ARRAY;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.DEPTH_COMPONENT32F;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.DEPTH32F_STENCIL8;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.FLOAT_32_UNSIGNED_INT_24_8_REV;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.FRAMEBUFFER_ATTACHMENT_RED_SIZE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.FRAMEBUFFER_DEFAULT;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.DEPTH_STENCIL_ATTACHMENT;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.DEPTH_STENCIL;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNSIGNED_INT_24_8;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.DEPTH24_STENCIL8;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNSIGNED_NORMALIZED;
+
+// Same as FRAMEBUFFER_BINDING
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.DRAW_FRAMEBUFFER_BINDING;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.READ_FRAMEBUFFER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.DRAW_FRAMEBUFFER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.READ_FRAMEBUFFER_BINDING;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RENDERBUFFER_SAMPLES;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.MAX_COLOR_ATTACHMENTS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT1;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT2;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT3;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT4;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT5;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT6;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT7;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT8;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT9;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT10;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT11;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT12;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT13;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT14;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.COLOR_ATTACHMENT15;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.MAX_SAMPLES;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.HALF_FLOAT;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RG;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RG_INTEGER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.R8;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RG8;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.R16F;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.R32F;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RG16F;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RG32F;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.R8I;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.R8UI;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.R16I;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.R16UI;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.R32I;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.R32UI;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RG8I;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RG8UI;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RG16I;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RG16UI;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RG32I;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RG32UI;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.VERTEX_ARRAY_BINDING;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.R8_SNORM;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RG8_SNORM;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RGB8_SNORM;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RGBA8_SNORM;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.SIGNED_NORMALIZED;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.COPY_READ_BUFFER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.COPY_WRITE_BUFFER;
+
+// Same as COPY_READ_BUFFER
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.COPY_READ_BUFFER_BINDING;
+
+// Same as COPY_WRITE_BUFFER
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.COPY_WRITE_BUFFER_BINDING;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNIFORM_BUFFER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNIFORM_BUFFER_BINDING;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNIFORM_BUFFER_START;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNIFORM_BUFFER_SIZE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.MAX_VERTEX_UNIFORM_BLOCKS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.MAX_FRAGMENT_UNIFORM_BLOCKS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.MAX_COMBINED_UNIFORM_BLOCKS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.MAX_UNIFORM_BUFFER_BINDINGS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.MAX_UNIFORM_BLOCK_SIZE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNIFORM_BUFFER_OFFSET_ALIGNMENT;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.ACTIVE_UNIFORM_BLOCKS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNIFORM_TYPE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNIFORM_SIZE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNIFORM_BLOCK_INDEX;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNIFORM_OFFSET;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNIFORM_ARRAY_STRIDE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNIFORM_MATRIX_STRIDE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNIFORM_IS_ROW_MAJOR;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNIFORM_BLOCK_BINDING;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNIFORM_BLOCK_DATA_SIZE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNIFORM_BLOCK_ACTIVE_UNIFORMS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.INVALID_INDEX;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.MAX_VERTEX_OUTPUT_COMPONENTS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.MAX_FRAGMENT_INPUT_COMPONENTS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.MAX_SERVER_WAIT_TIMEOUT;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.OBJECT_TYPE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.SYNC_CONDITION;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.SYNC_STATUS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.SYNC_FLAGS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.SYNC_FENCE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.SYNC_GPU_COMMANDS_COMPLETE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.UNSIGNALED;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.SIGNALED;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.ALREADY_SIGNALED;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.TIMEOUT_EXPIRED;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.CONDITION_SATISFIED;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.WAIT_FAILED;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.SYNC_FLUSH_COMMANDS_BIT;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.VERTEX_ATTRIB_ARRAY_DIVISOR;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.ANY_SAMPLES_PASSED;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.ANY_SAMPLES_PASSED_CONSERVATIVE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.SAMPLER_BINDING;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.RGB10_A2UI;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.INT_2_10_10_10_REV;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.TRANSFORM_FEEDBACK;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.TRANSFORM_FEEDBACK_PAUSED;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.TRANSFORM_FEEDBACK_ACTIVE;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.TRANSFORM_FEEDBACK_BINDING;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.TEXTURE_IMMUTABLE_FORMAT;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.MAX_ELEMENT_INDEX;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.NUM_SAMPLE_COUNTS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.TEXTURE_IMMUTABLE_LEVELS;
+
+/** @type {number} */
+WebGL2RenderingContextBase.prototype.TIMEOUT_IGNORED;
+
+/**
+ * @constructor
+ * @noalias
+ * @extends {WebGLObject}
+ */
+function WebGLQuery() {}
+
+
+/**
+ * @constructor
+ * @noalias
+ * @extends {WebGLObject}
+ */
+function WebGLSampler() {}
+
+
+/**
+ * @constructor
+ * @noalias
+ * @extends {WebGLObject}
+ */
+function WebGLSync() {}
+
+
+/**
+ * @constructor
+ * @noalias
+ * @extends {WebGLObject}
+ */
+function WebGLTransformFeedback() {}
+
+
+/**
+ * @constructor
+ * @noalias
+ * @extends {WebGLObject}
+ */
+function WebGLVertexArrayObject() {}
+
+
+/**
+ * @param {number} target
+ * @param {WebGLQuery} query
+ */
+WebGL2RenderingContextBase.prototype.beginQuery = function(target, query) {};
+
+/**
+ * @param {number} primitiveMode
+ */
+WebGL2RenderingContextBase.prototype.beginTransformFeedback = function(primitiveMode) {};
+
+/**
+ * @param {number} target
+ * @param {number} index
+ * @param {WebGLBuffer} buffer
+ */
+WebGL2RenderingContextBase.prototype.bindBufferBase = function(target, index, buffer) {};
+
+/**
+ * @param {number} target
+ * @param {number} index
+ * @param {WebGLBuffer} buffer
+ * @param {number} offset
+ * @param {number} size
+ */
+WebGL2RenderingContextBase.prototype.bindBufferRange = function(target, index, buffer, offset, size) {};
+
+/**
+ * @param {number} unit
+ * @param {WebGLSampler} sampler
+ */
+WebGL2RenderingContextBase.prototype.bindSampler = function(unit, sampler) {};
+
+/**
+ * @param {number} target
+ * @param {WebGLTransformFeedback} id
+ */
+WebGL2RenderingContextBase.prototype.bindTransformFeedback = function(target, id) {};
+
+/**
+ * @param {WebGLVertexArrayObject} array
+ */
+WebGL2RenderingContextBase.prototype.bindVertexArray = function(array) {};
+
+/**
+ * @param {number} srcX0
+ * @param {number} srcY0
+ * @param {number} srcX1
+ * @param {number} srcY1
+ * @param {number} dstX0
+ * @param {number} dstY0
+ * @param {number} dstX1
+ * @param {number} dstY1
+ * @param {number} mask
+ * @param {number} filter
+ */
+WebGL2RenderingContextBase.prototype.blitFramebuffer = function(
+ srcX0, srcY0, srcX1, srcY1, dstX0, dstY0,
+ dstX1, dstY1, mask, filter) {};
+
+/**
+ * @param {number} buffer
+ * @param {number} drawbuffer
+ * @param {Int32Array|Array.<number>} value
+ */
+WebGL2RenderingContextBase.prototype.clearBufferiv = function(buffer, drawbuffer, value) {};
+
+/**
+ * @param {number} buffer
+ * @param {number} drawbuffer
+ * @param {Uint32Array|Array.<number>} value
+ */
+WebGL2RenderingContextBase.prototype.clearBufferuiv = function(buffer, drawbuffer, value) {};
+
+/**
+ * @param {number} buffer
+ * @param {number} drawbuffer
+ * @param {Float32Array|Array.<number>} value
+ */
+WebGL2RenderingContextBase.prototype.clearBufferfv = function(buffer, drawbuffer, value) {};
+
+/**
+ * @param {number} buffer
+ * @param {number} drawbuffer
+ * @param {number} depth
+ * @param {number} stencil
+ */
+WebGL2RenderingContextBase.prototype.clearBufferfi = function(buffer, drawbuffer, depth, stencil) {};
+
+/**
+ * @param {WebGLSync} sync
+ * @param {number} flags
+ * @param {number} timeout
+ * @return {number}
+ */
+WebGL2RenderingContextBase.prototype.clientWaitSync = function(sync, flags, timeout) {};
+
+/**
+ * @param {number} target
+ * @param {number} level
+ * @param {number} internalformat
+ * @param {number} width
+ * @param {number} height
+ * @param {number} depth
+ * @param {number} border
+ * @param {ArrayBufferView} data
+ */
+WebGL2RenderingContextBase.prototype.compressedTexImage3D = function(
+ target, level, internalformat, width, height, depth, border, data) {};
+
+/**
+ * @param {number} target
+ * @param {number} level
+ * @param {number} xoffset
+ * @param {number} yoffset
+ * @param {number} zoffset
+ * @param {number} width
+ * @param {number} height
+ * @param {number} depth
+ * @param {number} format
+ * @param {ArrayBufferView} data
+ */
+WebGL2RenderingContextBase.prototype.compressedTexSubImage3D = function(
+ target, level, xoffset, yoffset, zoffset, width, height, depth, format, data) {};
+
+/**
+ * @param {number} readTarget
+ * @param {number} writeTarget
+ * @param {number} readOffset
+ * @param {number} writeOffset
+ * @param {number} size
+ */
+WebGL2RenderingContextBase.prototype.copyBufferSubData = function(
+ readTarget, writeTarget, readOffset, writeOffset, size) {};
+
+/**
+ * @param {number} target
+ * @param {number} level
+ * @param {number} xoffset
+ * @param {number} yoffset
+ * @param {number} zoffset
+ * @param {number} x
+ * @param {number} y
+ * @param {number} width
+ * @param {number} height
+ */
+WebGL2RenderingContextBase.prototype.copyTexSubImage3D = function(
+ target, level, xoffset, yoffset, zoffset, x, y, width, height) {};
+
+/**
+ * @return {!WebGLQuery}
+ * @nosideeffects
+ */
+WebGL2RenderingContextBase.prototype.createQuery = function() {};
+
+/**
+ * @return {!WebGLSampler}
+ * @nosideeffects
+ */
+WebGL2RenderingContextBase.prototype.createSampler = function() {};
+
+/**
+ * @return {!WebGLTransformFeedback}
+ * @nosideeffects
+ */
+WebGL2RenderingContextBase.prototype.createTransformFeedback = function() {};
+
+/**
+ * @return {!WebGLVertexArrayObject}
+ * @nosideeffects
+ */
+WebGL2RenderingContextBase.prototype.createVertexArray = function() {};
+
+
+/**
+ * @param {WebGLQuery} query
+ */
+WebGL2RenderingContextBase.prototype.deleteQuery = function(query) {};
+
+/**
+ * @param {WebGLSampler} sampler
+ */
+WebGL2RenderingContextBase.prototype.deleteSampler = function(sampler) {};
+
+/**
+ * @param {WebGLSync} sync
+ */
+WebGL2RenderingContextBase.prototype.deleteSync = function(sync) {};
+
+/**
+ * @param {WebGLTransformFeedback} feedback
+ */
+WebGL2RenderingContextBase.prototype.deleteTransformFeedback = function(feedback) {};
+
+/**
+ * @param {WebGLVertexArrayObject} vertexArray
+ */
+WebGL2RenderingContextBase.prototype.deleteVertexArray = function(vertexArray) {};
+
+/**
+ * @param {number} mode
+ * @param {number} first
+ * @param {number} count
+ * @param {number} instanceCount
+ */
+WebGL2RenderingContextBase.prototype.drawArraysInstanced = function(mode, first, count, instanceCount) {};
+
+/**
+ * @param {number} mode
+ * @param {number} count
+ * @param {number} type
+ * @param {number} offset
+ * @param {number} instanceCount
+ */
+WebGL2RenderingContextBase.prototype.drawElementsInstanced = function(mode, count, type, offset, instanceCount) {};
+
+/**
+ * @param {number} mode
+ * @param {number} start
+ * @param {number} end
+ * @param {number} count
+ * @param {number} type
+ * @param {number} offset
+ */
+WebGL2RenderingContextBase.prototype.drawRangeElements = function(mode, start, end, count, type, offset) {};
+
+/**
+ * @param {Array.<number>} buffers
+ */
+WebGL2RenderingContextBase.prototype.drawBuffers = function(buffers) {};
+
+/**
+ * @param {number} target
+ */
+WebGL2RenderingContextBase.prototype.endQuery = function(target) {};
+
+/**
+ */
+WebGL2RenderingContextBase.prototype.endTransformFeedback = function() {};
+
+/**
+ * @param {number} condition
+ * @param {number} flags
+ * @return {WebGLSync}
+ */
+WebGL2RenderingContextBase.prototype.fenceSync = function(condition, flags) {};
+
+/**
+ * @param {number} target
+ * @param {number} attachment
+ * @param {WebGLTexture} texture
+ * @param {number} level
+ * @param {number} layer
+ */
+WebGL2RenderingContextBase.prototype.framebufferTextureLayer = function(
+ target, attachment, texture, level, layer) {};
+
+/**
+ * @param {WebGLProgram} program
+ * @param {number} uniformBlockIndex
+ * @return {string}
+ * @nosideeffects
+ */
+WebGL2RenderingContextBase.prototype.getActiveUniformBlockName = function(program, uniformBlockIndex) {};
+
+/**
+ * @param {WebGLProgram} program
+ * @param {number} uniformBlockIndex
+ * @param {number} pname
+ * @return {*}
+ * @nosideeffects
+ */
+WebGL2RenderingContextBase.prototype.getActiveUniformBlockParameter = function(
+ program, uniformBlockIndex, pname) {};
+
+/**
+ * @param {WebGLProgram} program
+ * @param {Array.<number>} uniformIndices
+ * @param {number} pname
+ * @return {Array.<number>}
+ * @nosideeffects
+ */
+WebGL2RenderingContextBase.prototype.getActiveUniforms = function(
+ program, uniformIndices, pname) {};
+
+/**
+ * @param {number} target
+ * @param {number} offset
+ * @param {ArrayBuffer} returnedData
+ * @nosideeffects
+ */
+WebGL2RenderingContextBase.prototype.getBufferSubData = function(
+ target, offset, returnedData) {};
+
+/**
+ * @param {WebGLProgram} program
+ * @param {string} name
+ * @return {number}
+ * @nosideeffects
+ */
+WebGL2RenderingContextBase.prototype.getFragDataLocation = function(program, name) {};
+
+/**
+ * @param {number} target
+ * @param {number} index
+ * @return {*}
+ * @nosideeffects
+ */
+WebGL2RenderingContextBase.prototype.getIndexedParameter = function(target, index) {};
+
+/**
+ * @param {number} target
+ * @param {number} internalformat
+ * @param {number} pname
+ * @return {*}
+ * @nosideeffects
+ */
+WebGL2RenderingContextBase.prototype.getInternalformatParameter = function(target, internalformat, pname) {};
+
+/**
+ * @param {number} target
+ * @param {number} pname
+ * @return {WebGLQuery}
+ * @nosideeffects
+ */
+WebGL2RenderingContextBase.prototype.getQuery = function(target, pname) {};
+
+/**
+ * @param {WebGLQuery} query
+ * @param {number} pname
+ * @return {*}
+ * @nosideeffects
+ */
+WebGL2RenderingContextBase.prototype.getQueryParameter = function(query, pname) {};
+
+/**
+ * @param {WebGLSampler} sampler
+ * @param {number} pname
+ * @return {*}
+ * @nosideeffects
+ */
+WebGL2RenderingContextBase.prototype.getSamplerParameter = function(sampler, pname) {};
+
+/**
+ * @param {WebGLSync} sync
+ * @param {number} pname
+ * @return {*}
+ * @nosideeffects
+ */
+WebGL2RenderingContextBase.prototype.getSyncParameter = function(sync, pname) {};
+
+/**
+ * @param {WebGLProgram} program
+ * @param {number} index
+ * @return {WebGLActiveInfo}
+ * @nosideeffects
+ */
+WebGL2RenderingContextBase.prototype.getTransformFeedbackVarying = function(program, index) {};
+
+/**
+ * @param {WebGLProgram} program
+ * @param {string} uniformBlockName
+ * @return {number}
+ * @nosideeffects
+ */
+WebGL2RenderingContextBase.prototype.getUniformBlockIndex = function(program, uniformBlockName) {};
+
+/**
+ * @param {WebGLProgram} program
+ * @param {Array.<string>} uniformNames
+ * @return {Array.<number>}
+ * @nosideeffects
+ */
+WebGL2RenderingContextBase.prototype.getUniformIndices = function(program, uniformNames) {};
+
+/**
+ * @param {number} target
+ * @param {Array.<number>} attachments
+ */
+WebGL2RenderingContextBase.prototype.invalidateFramebuffer = function(target, attachments) {};
+
+/**
+ * @param {number} target
+ * @param {Array.<number>} attachments
+ * @param {number} x
+ * @param {number} y
+ * @param {number} width
+ * @param {number} height
+ */
+WebGL2RenderingContextBase.prototype.invalidateSubFramebuffer = function(
+ target, attachments, x, y, width, height) {};
+
+/**
+ * @param {WebGLQuery} query
+ * @return {boolean}
+ * @nosideeffects
+ */
+WebGL2RenderingContextBase.prototype.isQuery = function(query) {};
+
+/**
+ * @param {WebGLSampler} sampler
+ * @return {boolean}
+ * @nosideeffects
+ */
+WebGL2RenderingContextBase.prototype.isSampler = function(sampler) {};
+
+/**
+ * @param {WebGLSync} sync
+ * @return {boolean}
+ * @nosideeffects
+ */
+WebGL2RenderingContextBase.prototype.isSync = function(sync) {};
+
+/**
+ * @param {WebGLTransformFeedback} feedback
+ * @return {boolean}
+ * @nosideeffects
+ */
+WebGL2RenderingContextBase.prototype.isTransformFeedback = function(feedback) {};
+
+/**
+ * @param {WebGLVertexArrayObject} vertexArray
+ * @return {boolean}
+ * @nosideeffects
+ */
+WebGL2RenderingContextBase.prototype.isVertexArray = function(vertexArray) {};
+
+/**
+ */
+WebGL2RenderingContextBase.prototype.pauseTransformFeedback = function() {};
+
+/**
+ * @param {number} src
+ */
+WebGL2RenderingContextBase.prototype.readBuffer = function(src) {};
+
+/**
+ * @param {number} target
+ * @param {number} samples
+ * @param {number} internalformat
+ * @param {number} width
+ * @param {number} height
+ */
+WebGL2RenderingContextBase.prototype.renderbufferStorageMultisample = function(
+ target, samples, internalformat, width, height) {};
+
+/**
+ */
+WebGL2RenderingContextBase.prototype.resumeTransformFeedback = function() {};
+
+/**
+ * @param {WebGLSampler} sampler
+ * @param {number} pname
+ * @param {number} param
+ */
+WebGL2RenderingContextBase.prototype.samplerParameteri = function(sampler, pname, param) {};
+
+/**
+ * @param {WebGLSampler} sampler
+ * @param {number} pname
+ * @param {number} param
+ */
+WebGL2RenderingContextBase.prototype.samplerParameterf = function(sampler, pname, param) {};
+
+/**
+ * @param {number} target
+ * @param {number} levels
+ * @param {number} internalformat
+ * @param {number} width
+ * @param {number} height
+ */
+WebGL2RenderingContextBase.prototype.texStorage2D = function(target, levels, internalformat, width, height) {};
+
+/**
+ * @param {number} target
+ * @param {number} levels
+ * @param {number} internalformat
+ * @param {number} width
+ * @param {number} height
+ * @param {number} depth
+ */
+WebGL2RenderingContextBase.prototype.texStorage3D = function(target, levels, internalformat, width, height, depth) {};
+
+/**
+ * @param {number} target
+ * @param {number} level
+ * @param {number} internalformat
+ * @param {number} width
+ * @param {number} height
+ * @param {number} depth
+ * @param {number} border
+ * @param {number} format
+ * @param {number} type
+ * @param {ArrayBufferView} pixels
+ */
+WebGL2RenderingContextBase.prototype.texImage3D = function(
+ target, level, internalformat, width, height, depth, border, format, type, pixels) {};
+
+/**
+ * @param {number} target
+ * @param {number} level
+ * @param {number} xoffset
+ * @param {number} yoffset
+ * @param {number} zoffset
+ * @param {number} format or width
+ * @param {number} type or height
+ * @param {ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|
+ * number} source or depth
+ * @param {number=} opt_format
+ * @param {number=} opt_type
+ * @param {ArrayBufferView=} opt_pixels
+ */
+WebGL2RenderingContextBase.prototype.texSubImage3D = function(
+ target, level, xoffset, yoffset, zoffset, format, type, source, opt_format, opt_type, opt_pixels) {};
+
+/**
+ * @param {WebGLProgram} program
+ * @param {Array.<string>} varyings
+ * @param {number} bufferMode
+ */
+WebGL2RenderingContextBase.prototype.transformFeedbackVaryings = function(program, varyings, bufferMode) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {number} v0
+ */
+WebGL2RenderingContextBase.prototype.uniform1ui = function(location, v0) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {number} v0
+ * @param {number} v1
+ */
+WebGL2RenderingContextBase.prototype.uniform2ui = function(location, v0, v1) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {number} v0
+ * @param {number} v1
+ * @param {number} v2
+ */
+WebGL2RenderingContextBase.prototype.uniform3ui = function(location, v0, v1, v2) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {number} v0
+ * @param {number} v1
+ * @param {number} v2
+ * @param {number} v3
+ */
+WebGL2RenderingContextBase.prototype.uniform4ui = function(location, v0, v1, v2, v3) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {Uint32Array|Array.<number>} value
+ */
+WebGL2RenderingContextBase.prototype.uniform1uiv = function(location, value) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {Uint32Array|Array.<number>} value
+ */
+WebGL2RenderingContextBase.prototype.uniform2uiv = function(location, value) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {Uint32Array|Array.<number>} value
+ */
+WebGL2RenderingContextBase.prototype.uniform3uiv = function(location, value) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {Uint32Array|Array.<number>} value
+ */
+WebGL2RenderingContextBase.prototype.uniform4uiv = function(location, value) {};
+
+/**
+ * @param {WebGLProgram} program
+ * @param {number} uniformBlockIndex
+ * @param {number} uniformBlockBinding
+ */
+WebGL2RenderingContextBase.prototype.uniformBlockBinding = function(program, uniformBlockIndex, uniformBlockBinding) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {boolean} transpose
+ * @param {Float32Array|Array.<number>} value
+ */
+WebGL2RenderingContextBase.prototype.uniformMatrix2x3fv = function(location, transpose, value) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {boolean} transpose
+ * @param {Float32Array|Array.<number>} value
+ */
+WebGL2RenderingContextBase.prototype.uniformMatrix3x2fv = function(location, transpose, value) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {boolean} transpose
+ * @param {Float32Array|Array.<number>} value
+ */
+WebGL2RenderingContextBase.prototype.uniformMatrix2x4fv = function(location, transpose, value) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {boolean} transpose
+ * @param {Float32Array|Array.<number>} value
+ */
+WebGL2RenderingContextBase.prototype.uniformMatrix4x2fv = function(location, transpose, value) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {boolean} transpose
+ * @param {Float32Array|Array.<number>} value
+ */
+WebGL2RenderingContextBase.prototype.uniformMatrix3x4fv = function(location, transpose, value) {};
+
+/**
+ * @param {WebGLUniformLocation} location
+ * @param {boolean} transpose
+ * @param {Float32Array|Array.<number>} value
+ */
+WebGL2RenderingContextBase.prototype.uniformMatrix4x3fv = function(location, transpose, value) {};
+
+/**
+ * @param {number} index
+ * @param {number} x
+ * @param {number} y
+ * @param {number} z
+ * @param {number} w
+ */
+WebGL2RenderingContextBase.prototype.vertexAttribI4i = function(index, x, y, z, w) {};
+
+/**
+ * @param {number} index
+ * @param {(Array.<number>|Int32Array)} v
+ */
+WebGL2RenderingContextBase.prototype.vertexAttribI4iv = function(index, v) {};
+
+/**
+ * @param {number} index
+ * @param {number} x
+ * @param {number} y
+ * @param {number} z
+ * @param {number} w
+ */
+WebGL2RenderingContextBase.prototype.vertexAttribI4ui = function(index, x, y, z, w) {};
+
+/**
+ * @param {number} index
+ * @param {(Array.<number>|Uint32Array)} v
+ */
+WebGL2RenderingContextBase.prototype.vertexAttribI4uiv = function(index, v) {};
+
+/**
+ * @param {number} index
+ * @param {number} size
+ * @param {number} type
+ * @param {number} stride
+ * @param {number} offset
+ */
+WebGL2RenderingContextBase.prototype.vertexAttribIPointer = function(index, size, type, stride, offset) {};
+
+/**
+ * @param {number} index
+ * @param {number} divisor
+ */
+WebGL2RenderingContextBase.prototype.vertexAttribDivisor = function(index, divisor) {};
+
+/**
+ * @param {WebGLSync} sync
+ * @param {number} flags
+ * @param {number} timeout
+ */
+WebGL2RenderingContextBase.prototype.waitSync = function(sync, flags, timeout) {};
+
+/**
+ * @constructor
+ * @noalias
+ * @extends {WebGL2RenderingContextBase}
+ */
+function WebGL2RenderingContext() {}